| [ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Summary view] [Print] [Text view]
1 "use strict"; 2 var wp; 3 (wp ||= {}).blockLibrary = (() => { 4 var __create = Object.create; 5 var __defProp = Object.defineProperty; 6 var __getOwnPropDesc = Object.getOwnPropertyDescriptor; 7 var __getOwnPropNames = Object.getOwnPropertyNames; 8 var __getProtoOf = Object.getPrototypeOf; 9 var __hasOwnProp = Object.prototype.hasOwnProperty; 10 var __require = /* @__PURE__ */ ((x2) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x2, { 11 get: (a2, b2) => (typeof require !== "undefined" ? require : a2)[b2] 12 }) : x2)(function(x2) { 13 if (typeof require !== "undefined") return require.apply(this, arguments); 14 throw Error('Dynamic require of "' + x2 + '" is not supported'); 15 }); 16 var __commonJS = (cb, mod) => function __require2() { 17 return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; 18 }; 19 var __export = (target, all) => { 20 for (var name117 in all) 21 __defProp(target, name117, { get: all[name117], enumerable: true }); 22 }; 23 var __copyProps = (to, from, except, desc) => { 24 if (from && typeof from === "object" || typeof from === "function") { 25 for (let key of __getOwnPropNames(from)) 26 if (!__hasOwnProp.call(to, key) && key !== except) 27 __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); 28 } 29 return to; 30 }; 31 var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( 32 // If the importer is in node compatibility mode or this is not an ESM 33 // file that has been converted to a CommonJS file using a Babel- 34 // compatible transform (i.e. "__esModule" has not been set), then set 35 // "default" to the CommonJS "module.exports" for node compatibility. 36 isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, 37 mod 38 )); 39 var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); 40 41 // package-external:@wordpress/blocks 42 var require_blocks = __commonJS({ 43 "package-external:@wordpress/blocks"(exports, module) { 44 module.exports = window.wp.blocks; 45 } 46 }); 47 48 // package-external:@wordpress/data 49 var require_data = __commonJS({ 50 "package-external:@wordpress/data"(exports, module) { 51 module.exports = window.wp.data; 52 } 53 }); 54 55 // package-external:@wordpress/block-editor 56 var require_block_editor = __commonJS({ 57 "package-external:@wordpress/block-editor"(exports, module) { 58 module.exports = window.wp.blockEditor; 59 } 60 }); 61 62 // package-external:@wordpress/server-side-render 63 var require_server_side_render = __commonJS({ 64 "package-external:@wordpress/server-side-render"(exports, module) { 65 module.exports = window.wp.serverSideRender; 66 } 67 }); 68 69 // package-external:@wordpress/i18n 70 var require_i18n = __commonJS({ 71 "package-external:@wordpress/i18n"(exports, module) { 72 module.exports = window.wp.i18n; 73 } 74 }); 75 76 // package-external:@wordpress/components 77 var require_components = __commonJS({ 78 "package-external:@wordpress/components"(exports, module) { 79 module.exports = window.wp.components; 80 } 81 }); 82 83 // package-external:@wordpress/element 84 var require_element = __commonJS({ 85 "package-external:@wordpress/element"(exports, module) { 86 module.exports = window.wp.element; 87 } 88 }); 89 90 // package-external:@wordpress/blob 91 var require_blob = __commonJS({ 92 "package-external:@wordpress/blob"(exports, module) { 93 module.exports = window.wp.blob; 94 } 95 }); 96 97 // package-external:@wordpress/core-data 98 var require_core_data = __commonJS({ 99 "package-external:@wordpress/core-data"(exports, module) { 100 module.exports = window.wp.coreData; 101 } 102 }); 103 104 // package-external:@wordpress/compose 105 var require_compose = __commonJS({ 106 "package-external:@wordpress/compose"(exports, module) { 107 module.exports = window.wp.compose; 108 } 109 }); 110 111 // vendor-external:react/jsx-runtime 112 var require_jsx_runtime = __commonJS({ 113 "vendor-external:react/jsx-runtime"(exports, module) { 114 module.exports = window.ReactJSXRuntime; 115 } 116 }); 117 118 // package-external:@wordpress/primitives 119 var require_primitives = __commonJS({ 120 "package-external:@wordpress/primitives"(exports, module) { 121 module.exports = window.wp.primitives; 122 } 123 }); 124 125 // package-external:@wordpress/url 126 var require_url = __commonJS({ 127 "package-external:@wordpress/url"(exports, module) { 128 module.exports = window.wp.url; 129 } 130 }); 131 132 // package-external:@wordpress/html-entities 133 var require_html_entities = __commonJS({ 134 "package-external:@wordpress/html-entities"(exports, module) { 135 module.exports = window.wp.htmlEntities; 136 } 137 }); 138 139 // package-external:@wordpress/notices 140 var require_notices = __commonJS({ 141 "package-external:@wordpress/notices"(exports, module) { 142 module.exports = window.wp.notices; 143 } 144 }); 145 146 // package-external:@wordpress/private-apis 147 var require_private_apis = __commonJS({ 148 "package-external:@wordpress/private-apis"(exports, module) { 149 module.exports = window.wp.privateApis; 150 } 151 }); 152 153 // package-external:@wordpress/keycodes 154 var require_keycodes = __commonJS({ 155 "package-external:@wordpress/keycodes"(exports, module) { 156 module.exports = window.wp.keycodes; 157 } 158 }); 159 160 // package-external:@wordpress/deprecated 161 var require_deprecated = __commonJS({ 162 "package-external:@wordpress/deprecated"(exports, module) { 163 module.exports = window.wp.deprecated; 164 } 165 }); 166 167 // package-external:@wordpress/rich-text 168 var require_rich_text = __commonJS({ 169 "package-external:@wordpress/rich-text"(exports, module) { 170 module.exports = window.wp.richText; 171 } 172 }); 173 174 // package-external:@wordpress/date 175 var require_date = __commonJS({ 176 "package-external:@wordpress/date"(exports, module) { 177 module.exports = window.wp.date; 178 } 179 }); 180 181 // package-external:@wordpress/api-fetch 182 var require_api_fetch = __commonJS({ 183 "package-external:@wordpress/api-fetch"(exports, module) { 184 module.exports = window.wp.apiFetch; 185 } 186 }); 187 188 // package-external:@wordpress/hooks 189 var require_hooks = __commonJS({ 190 "package-external:@wordpress/hooks"(exports, module) { 191 module.exports = window.wp.hooks; 192 } 193 }); 194 195 // node_modules/remove-accents/index.js 196 var require_remove_accents = __commonJS({ 197 "node_modules/remove-accents/index.js"(exports, module) { 198 var characterMap = { 199 "\xC0": "A", 200 "\xC1": "A", 201 "\xC2": "A", 202 "\xC3": "A", 203 "\xC4": "A", 204 "\xC5": "A", 205 "\u1EA4": "A", 206 "\u1EAE": "A", 207 "\u1EB2": "A", 208 "\u1EB4": "A", 209 "\u1EB6": "A", 210 "\xC6": "AE", 211 "\u1EA6": "A", 212 "\u1EB0": "A", 213 "\u0202": "A", 214 "\u1EA2": "A", 215 "\u1EA0": "A", 216 "\u1EA8": "A", 217 "\u1EAA": "A", 218 "\u1EAC": "A", 219 "\xC7": "C", 220 "\u1E08": "C", 221 "\xC8": "E", 222 "\xC9": "E", 223 "\xCA": "E", 224 "\xCB": "E", 225 "\u1EBE": "E", 226 "\u1E16": "E", 227 "\u1EC0": "E", 228 "\u1E14": "E", 229 "\u1E1C": "E", 230 "\u0206": "E", 231 "\u1EBA": "E", 232 "\u1EBC": "E", 233 "\u1EB8": "E", 234 "\u1EC2": "E", 235 "\u1EC4": "E", 236 "\u1EC6": "E", 237 "\xCC": "I", 238 "\xCD": "I", 239 "\xCE": "I", 240 "\xCF": "I", 241 "\u1E2E": "I", 242 "\u020A": "I", 243 "\u1EC8": "I", 244 "\u1ECA": "I", 245 "\xD0": "D", 246 "\xD1": "N", 247 "\xD2": "O", 248 "\xD3": "O", 249 "\xD4": "O", 250 "\xD5": "O", 251 "\xD6": "O", 252 "\xD8": "O", 253 "\u1ED0": "O", 254 "\u1E4C": "O", 255 "\u1E52": "O", 256 "\u020E": "O", 257 "\u1ECE": "O", 258 "\u1ECC": "O", 259 "\u1ED4": "O", 260 "\u1ED6": "O", 261 "\u1ED8": "O", 262 "\u1EDC": "O", 263 "\u1EDE": "O", 264 "\u1EE0": "O", 265 "\u1EDA": "O", 266 "\u1EE2": "O", 267 "\xD9": "U", 268 "\xDA": "U", 269 "\xDB": "U", 270 "\xDC": "U", 271 "\u1EE6": "U", 272 "\u1EE4": "U", 273 "\u1EEC": "U", 274 "\u1EEE": "U", 275 "\u1EF0": "U", 276 "\xDD": "Y", 277 "\xE0": "a", 278 "\xE1": "a", 279 "\xE2": "a", 280 "\xE3": "a", 281 "\xE4": "a", 282 "\xE5": "a", 283 "\u1EA5": "a", 284 "\u1EAF": "a", 285 "\u1EB3": "a", 286 "\u1EB5": "a", 287 "\u1EB7": "a", 288 "\xE6": "ae", 289 "\u1EA7": "a", 290 "\u1EB1": "a", 291 "\u0203": "a", 292 "\u1EA3": "a", 293 "\u1EA1": "a", 294 "\u1EA9": "a", 295 "\u1EAB": "a", 296 "\u1EAD": "a", 297 "\xE7": "c", 298 "\u1E09": "c", 299 "\xE8": "e", 300 "\xE9": "e", 301 "\xEA": "e", 302 "\xEB": "e", 303 "\u1EBF": "e", 304 "\u1E17": "e", 305 "\u1EC1": "e", 306 "\u1E15": "e", 307 "\u1E1D": "e", 308 "\u0207": "e", 309 "\u1EBB": "e", 310 "\u1EBD": "e", 311 "\u1EB9": "e", 312 "\u1EC3": "e", 313 "\u1EC5": "e", 314 "\u1EC7": "e", 315 "\xEC": "i", 316 "\xED": "i", 317 "\xEE": "i", 318 "\xEF": "i", 319 "\u1E2F": "i", 320 "\u020B": "i", 321 "\u1EC9": "i", 322 "\u1ECB": "i", 323 "\xF0": "d", 324 "\xF1": "n", 325 "\xF2": "o", 326 "\xF3": "o", 327 "\xF4": "o", 328 "\xF5": "o", 329 "\xF6": "o", 330 "\xF8": "o", 331 "\u1ED1": "o", 332 "\u1E4D": "o", 333 "\u1E53": "o", 334 "\u020F": "o", 335 "\u1ECF": "o", 336 "\u1ECD": "o", 337 "\u1ED5": "o", 338 "\u1ED7": "o", 339 "\u1ED9": "o", 340 "\u1EDD": "o", 341 "\u1EDF": "o", 342 "\u1EE1": "o", 343 "\u1EDB": "o", 344 "\u1EE3": "o", 345 "\xF9": "u", 346 "\xFA": "u", 347 "\xFB": "u", 348 "\xFC": "u", 349 "\u1EE7": "u", 350 "\u1EE5": "u", 351 "\u1EED": "u", 352 "\u1EEF": "u", 353 "\u1EF1": "u", 354 "\xFD": "y", 355 "\xFF": "y", 356 "\u0100": "A", 357 "\u0101": "a", 358 "\u0102": "A", 359 "\u0103": "a", 360 "\u0104": "A", 361 "\u0105": "a", 362 "\u0106": "C", 363 "\u0107": "c", 364 "\u0108": "C", 365 "\u0109": "c", 366 "\u010A": "C", 367 "\u010B": "c", 368 "\u010C": "C", 369 "\u010D": "c", 370 "C\u0306": "C", 371 "c\u0306": "c", 372 "\u010E": "D", 373 "\u010F": "d", 374 "\u0110": "D", 375 "\u0111": "d", 376 "\u0112": "E", 377 "\u0113": "e", 378 "\u0114": "E", 379 "\u0115": "e", 380 "\u0116": "E", 381 "\u0117": "e", 382 "\u0118": "E", 383 "\u0119": "e", 384 "\u011A": "E", 385 "\u011B": "e", 386 "\u011C": "G", 387 "\u01F4": "G", 388 "\u011D": "g", 389 "\u01F5": "g", 390 "\u011E": "G", 391 "\u011F": "g", 392 "\u0120": "G", 393 "\u0121": "g", 394 "\u0122": "G", 395 "\u0123": "g", 396 "\u0124": "H", 397 "\u0125": "h", 398 "\u0126": "H", 399 "\u0127": "h", 400 "\u1E2A": "H", 401 "\u1E2B": "h", 402 "\u0128": "I", 403 "\u0129": "i", 404 "\u012A": "I", 405 "\u012B": "i", 406 "\u012C": "I", 407 "\u012D": "i", 408 "\u012E": "I", 409 "\u012F": "i", 410 "\u0130": "I", 411 "\u0131": "i", 412 "\u0132": "IJ", 413 "\u0133": "ij", 414 "\u0134": "J", 415 "\u0135": "j", 416 "\u0136": "K", 417 "\u0137": "k", 418 "\u1E30": "K", 419 "\u1E31": "k", 420 "K\u0306": "K", 421 "k\u0306": "k", 422 "\u0139": "L", 423 "\u013A": "l", 424 "\u013B": "L", 425 "\u013C": "l", 426 "\u013D": "L", 427 "\u013E": "l", 428 "\u013F": "L", 429 "\u0140": "l", 430 "\u0141": "l", 431 "\u0142": "l", 432 "\u1E3E": "M", 433 "\u1E3F": "m", 434 "M\u0306": "M", 435 "m\u0306": "m", 436 "\u0143": "N", 437 "\u0144": "n", 438 "\u0145": "N", 439 "\u0146": "n", 440 "\u0147": "N", 441 "\u0148": "n", 442 "\u0149": "n", 443 "N\u0306": "N", 444 "n\u0306": "n", 445 "\u014C": "O", 446 "\u014D": "o", 447 "\u014E": "O", 448 "\u014F": "o", 449 "\u0150": "O", 450 "\u0151": "o", 451 "\u0152": "OE", 452 "\u0153": "oe", 453 "P\u0306": "P", 454 "p\u0306": "p", 455 "\u0154": "R", 456 "\u0155": "r", 457 "\u0156": "R", 458 "\u0157": "r", 459 "\u0158": "R", 460 "\u0159": "r", 461 "R\u0306": "R", 462 "r\u0306": "r", 463 "\u0212": "R", 464 "\u0213": "r", 465 "\u015A": "S", 466 "\u015B": "s", 467 "\u015C": "S", 468 "\u015D": "s", 469 "\u015E": "S", 470 "\u0218": "S", 471 "\u0219": "s", 472 "\u015F": "s", 473 "\u0160": "S", 474 "\u0161": "s", 475 "\u0162": "T", 476 "\u0163": "t", 477 "\u021B": "t", 478 "\u021A": "T", 479 "\u0164": "T", 480 "\u0165": "t", 481 "\u0166": "T", 482 "\u0167": "t", 483 "T\u0306": "T", 484 "t\u0306": "t", 485 "\u0168": "U", 486 "\u0169": "u", 487 "\u016A": "U", 488 "\u016B": "u", 489 "\u016C": "U", 490 "\u016D": "u", 491 "\u016E": "U", 492 "\u016F": "u", 493 "\u0170": "U", 494 "\u0171": "u", 495 "\u0172": "U", 496 "\u0173": "u", 497 "\u0216": "U", 498 "\u0217": "u", 499 "V\u0306": "V", 500 "v\u0306": "v", 501 "\u0174": "W", 502 "\u0175": "w", 503 "\u1E82": "W", 504 "\u1E83": "w", 505 "X\u0306": "X", 506 "x\u0306": "x", 507 "\u0176": "Y", 508 "\u0177": "y", 509 "\u0178": "Y", 510 "Y\u0306": "Y", 511 "y\u0306": "y", 512 "\u0179": "Z", 513 "\u017A": "z", 514 "\u017B": "Z", 515 "\u017C": "z", 516 "\u017D": "Z", 517 "\u017E": "z", 518 "\u017F": "s", 519 "\u0192": "f", 520 "\u01A0": "O", 521 "\u01A1": "o", 522 "\u01AF": "U", 523 "\u01B0": "u", 524 "\u01CD": "A", 525 "\u01CE": "a", 526 "\u01CF": "I", 527 "\u01D0": "i", 528 "\u01D1": "O", 529 "\u01D2": "o", 530 "\u01D3": "U", 531 "\u01D4": "u", 532 "\u01D5": "U", 533 "\u01D6": "u", 534 "\u01D7": "U", 535 "\u01D8": "u", 536 "\u01D9": "U", 537 "\u01DA": "u", 538 "\u01DB": "U", 539 "\u01DC": "u", 540 "\u1EE8": "U", 541 "\u1EE9": "u", 542 "\u1E78": "U", 543 "\u1E79": "u", 544 "\u01FA": "A", 545 "\u01FB": "a", 546 "\u01FC": "AE", 547 "\u01FD": "ae", 548 "\u01FE": "O", 549 "\u01FF": "o", 550 "\xDE": "TH", 551 "\xFE": "th", 552 "\u1E54": "P", 553 "\u1E55": "p", 554 "\u1E64": "S", 555 "\u1E65": "s", 556 "X\u0301": "X", 557 "x\u0301": "x", 558 "\u0403": "\u0413", 559 "\u0453": "\u0433", 560 "\u040C": "\u041A", 561 "\u045C": "\u043A", 562 "A\u030B": "A", 563 "a\u030B": "a", 564 "E\u030B": "E", 565 "e\u030B": "e", 566 "I\u030B": "I", 567 "i\u030B": "i", 568 "\u01F8": "N", 569 "\u01F9": "n", 570 "\u1ED2": "O", 571 "\u1ED3": "o", 572 "\u1E50": "O", 573 "\u1E51": "o", 574 "\u1EEA": "U", 575 "\u1EEB": "u", 576 "\u1E80": "W", 577 "\u1E81": "w", 578 "\u1EF2": "Y", 579 "\u1EF3": "y", 580 "\u0200": "A", 581 "\u0201": "a", 582 "\u0204": "E", 583 "\u0205": "e", 584 "\u0208": "I", 585 "\u0209": "i", 586 "\u020C": "O", 587 "\u020D": "o", 588 "\u0210": "R", 589 "\u0211": "r", 590 "\u0214": "U", 591 "\u0215": "u", 592 "B\u030C": "B", 593 "b\u030C": "b", 594 "\u010C\u0323": "C", 595 "\u010D\u0323": "c", 596 "\xCA\u030C": "E", 597 "\xEA\u030C": "e", 598 "F\u030C": "F", 599 "f\u030C": "f", 600 "\u01E6": "G", 601 "\u01E7": "g", 602 "\u021E": "H", 603 "\u021F": "h", 604 "J\u030C": "J", 605 "\u01F0": "j", 606 "\u01E8": "K", 607 "\u01E9": "k", 608 "M\u030C": "M", 609 "m\u030C": "m", 610 "P\u030C": "P", 611 "p\u030C": "p", 612 "Q\u030C": "Q", 613 "q\u030C": "q", 614 "\u0158\u0329": "R", 615 "\u0159\u0329": "r", 616 "\u1E66": "S", 617 "\u1E67": "s", 618 "V\u030C": "V", 619 "v\u030C": "v", 620 "W\u030C": "W", 621 "w\u030C": "w", 622 "X\u030C": "X", 623 "x\u030C": "x", 624 "Y\u030C": "Y", 625 "y\u030C": "y", 626 "A\u0327": "A", 627 "a\u0327": "a", 628 "B\u0327": "B", 629 "b\u0327": "b", 630 "\u1E10": "D", 631 "\u1E11": "d", 632 "\u0228": "E", 633 "\u0229": "e", 634 "\u0190\u0327": "E", 635 "\u025B\u0327": "e", 636 "\u1E28": "H", 637 "\u1E29": "h", 638 "I\u0327": "I", 639 "i\u0327": "i", 640 "\u0197\u0327": "I", 641 "\u0268\u0327": "i", 642 "M\u0327": "M", 643 "m\u0327": "m", 644 "O\u0327": "O", 645 "o\u0327": "o", 646 "Q\u0327": "Q", 647 "q\u0327": "q", 648 "U\u0327": "U", 649 "u\u0327": "u", 650 "X\u0327": "X", 651 "x\u0327": "x", 652 "Z\u0327": "Z", 653 "z\u0327": "z", 654 "\u0439": "\u0438", 655 "\u0419": "\u0418", 656 "\u0451": "\u0435", 657 "\u0401": "\u0415" 658 }; 659 var chars = Object.keys(characterMap).join("|"); 660 var allAccents = new RegExp(chars, "g"); 661 var firstAccent = new RegExp(chars, ""); 662 function matcher(match) { 663 return characterMap[match]; 664 } 665 var removeAccents5 = function(string) { 666 return string.replace(allAccents, matcher); 667 }; 668 var hasAccents = function(string) { 669 return !!string.match(firstAccent); 670 }; 671 module.exports = removeAccents5; 672 module.exports.has = hasAccents; 673 module.exports.remove = removeAccents5; 674 } 675 }); 676 677 // package-external:@wordpress/dom 678 var require_dom = __commonJS({ 679 "package-external:@wordpress/dom"(exports, module) { 680 module.exports = window.wp.dom; 681 } 682 }); 683 684 // package-external:@wordpress/a11y 685 var require_a11y = __commonJS({ 686 "package-external:@wordpress/a11y"(exports, module) { 687 module.exports = window.wp.a11y; 688 } 689 }); 690 691 // package-external:@wordpress/escape-html 692 var require_escape_html = __commonJS({ 693 "package-external:@wordpress/escape-html"(exports, module) { 694 module.exports = window.wp.escapeHtml; 695 } 696 }); 697 698 // package-external:@wordpress/wordcount 699 var require_wordcount = __commonJS({ 700 "package-external:@wordpress/wordcount"(exports, module) { 701 module.exports = window.wp.wordcount; 702 } 703 }); 704 705 // package-external:@wordpress/patterns 706 var require_patterns = __commonJS({ 707 "package-external:@wordpress/patterns"(exports, module) { 708 module.exports = window.wp.patterns; 709 } 710 }); 711 712 // package-external:@wordpress/autop 713 var require_autop = __commonJS({ 714 "package-external:@wordpress/autop"(exports, module) { 715 module.exports = window.wp.autop; 716 } 717 }); 718 719 // node_modules/fast-deep-equal/es6/index.js 720 var require_es6 = __commonJS({ 721 "node_modules/fast-deep-equal/es6/index.js"(exports, module) { 722 "use strict"; 723 module.exports = function equal(a2, b2) { 724 if (a2 === b2) return true; 725 if (a2 && b2 && typeof a2 == "object" && typeof b2 == "object") { 726 if (a2.constructor !== b2.constructor) return false; 727 var length, i2, keys; 728 if (Array.isArray(a2)) { 729 length = a2.length; 730 if (length != b2.length) return false; 731 for (i2 = length; i2-- !== 0; ) 732 if (!equal(a2[i2], b2[i2])) return false; 733 return true; 734 } 735 if (a2 instanceof Map && b2 instanceof Map) { 736 if (a2.size !== b2.size) return false; 737 for (i2 of a2.entries()) 738 if (!b2.has(i2[0])) return false; 739 for (i2 of a2.entries()) 740 if (!equal(i2[1], b2.get(i2[0]))) return false; 741 return true; 742 } 743 if (a2 instanceof Set && b2 instanceof Set) { 744 if (a2.size !== b2.size) return false; 745 for (i2 of a2.entries()) 746 if (!b2.has(i2[0])) return false; 747 return true; 748 } 749 if (ArrayBuffer.isView(a2) && ArrayBuffer.isView(b2)) { 750 length = a2.length; 751 if (length != b2.length) return false; 752 for (i2 = length; i2-- !== 0; ) 753 if (a2[i2] !== b2[i2]) return false; 754 return true; 755 } 756 if (a2.constructor === RegExp) return a2.source === b2.source && a2.flags === b2.flags; 757 if (a2.valueOf !== Object.prototype.valueOf) return a2.valueOf() === b2.valueOf(); 758 if (a2.toString !== Object.prototype.toString) return a2.toString() === b2.toString(); 759 keys = Object.keys(a2); 760 length = keys.length; 761 if (length !== Object.keys(b2).length) return false; 762 for (i2 = length; i2-- !== 0; ) 763 if (!Object.prototype.hasOwnProperty.call(b2, keys[i2])) return false; 764 for (i2 = length; i2-- !== 0; ) { 765 var key = keys[i2]; 766 if (!equal(a2[key], b2[key])) return false; 767 } 768 return true; 769 } 770 return a2 !== a2 && b2 !== b2; 771 }; 772 } 773 }); 774 775 // package-external:@wordpress/keyboard-shortcuts 776 var require_keyboard_shortcuts = __commonJS({ 777 "package-external:@wordpress/keyboard-shortcuts"(exports, module) { 778 module.exports = window.wp.keyboardShortcuts; 779 } 780 }); 781 782 // packages/block-library/build-module/index.js 783 var index_exports = {}; 784 __export(index_exports, { 785 __experimentalGetCoreBlocks: () => __experimentalGetCoreBlocks, 786 __experimentalRegisterExperimentalCoreBlocks: () => __experimentalRegisterExperimentalCoreBlocks, 787 privateApis: () => privateApis3, 788 registerCoreBlocks: () => registerCoreBlocks 789 }); 790 var import_blocks124 = __toESM(require_blocks()); 791 var import_data152 = __toESM(require_data()); 792 var import_block_editor281 = __toESM(require_block_editor()); 793 var import_server_side_render7 = __toESM(require_server_side_render()); 794 var import_i18n261 = __toESM(require_i18n()); 795 796 // packages/block-library/build-module/accordion/index.js 797 var accordion_exports = {}; 798 __export(accordion_exports, { 799 init: () => init, 800 metadata: () => block_default, 801 name: () => name, 802 settings: () => settings 803 }); 804 var import_i18n2 = __toESM(require_i18n()); 805 806 // packages/block-library/build-module/accordion/edit.js 807 var import_block_editor2 = __toESM(require_block_editor()); 808 var import_i18n = __toESM(require_i18n()); 809 var import_components = __toESM(require_components()); 810 var import_data2 = __toESM(require_data()); 811 var import_blocks = __toESM(require_blocks()); 812 813 // packages/block-library/build-module/utils/hooks.js 814 var import_data = __toESM(require_data()); 815 var import_element = __toESM(require_element()); 816 var import_blob = __toESM(require_blob()); 817 var import_block_editor = __toESM(require_block_editor()); 818 var import_core_data = __toESM(require_core_data()); 819 var import_compose = __toESM(require_compose()); 820 function useCanEditEntity(kind, name117, recordId) { 821 return (0, import_data.useSelect)( 822 (select9) => select9(import_core_data.store).canUser("update", { 823 kind, 824 name: name117, 825 id: recordId 826 }), 827 [kind, name117, recordId] 828 ); 829 } 830 function useUploadMediaFromBlobURL(args = {}) { 831 const latestArgsRef = (0, import_element.useRef)(args); 832 const hasUploadStartedRef = (0, import_element.useRef)(false); 833 const { getSettings: getSettings2 } = (0, import_data.useSelect)(import_block_editor.store); 834 (0, import_element.useLayoutEffect)(() => { 835 latestArgsRef.current = args; 836 }); 837 (0, import_element.useEffect)(() => { 838 if (hasUploadStartedRef.current) { 839 return; 840 } 841 if (!latestArgsRef.current.url || !(0, import_blob.isBlobURL)(latestArgsRef.current.url)) { 842 return; 843 } 844 const file = (0, import_blob.getBlobByURL)(latestArgsRef.current.url); 845 if (!file) { 846 return; 847 } 848 const { url, allowedTypes, onChange, onError } = latestArgsRef.current; 849 const { mediaUpload } = getSettings2(); 850 if (!mediaUpload) { 851 return; 852 } 853 hasUploadStartedRef.current = true; 854 mediaUpload({ 855 filesList: [file], 856 allowedTypes, 857 onFileChange: ([media]) => { 858 if ((0, import_blob.isBlobURL)(media?.url)) { 859 return; 860 } 861 (0, import_blob.revokeBlobURL)(url); 862 onChange(media); 863 hasUploadStartedRef.current = false; 864 }, 865 onError: (message) => { 866 (0, import_blob.revokeBlobURL)(url); 867 onError(message); 868 hasUploadStartedRef.current = false; 869 } 870 }); 871 }, [getSettings2]); 872 } 873 function useDefaultAvatar() { 874 const avatarURL = (0, import_data.useSelect)((select9) => { 875 const { getSettings: getSettings2 } = select9(import_block_editor.store); 876 const { __experimentalDiscussionSettings } = getSettings2(); 877 return __experimentalDiscussionSettings?.avatarURL ?? ""; 878 }, []); 879 return avatarURL; 880 } 881 function useToolsPanelDropdownMenuProps() { 882 const isMobile = (0, import_compose.useViewportMatch)("medium", "<"); 883 return !isMobile ? { 884 popoverProps: { 885 placement: "left-start", 886 // For non-mobile, inner sidebar width (248px) - button width (24px) - border (1px) + padding (16px) + spacing (20px) 887 offset: 259 888 } 889 } : {}; 890 } 891 892 // packages/block-library/build-module/accordion/edit.js 893 var import_jsx_runtime = __toESM(require_jsx_runtime()); 894 var ACCORDION_BLOCK_NAME = "core/accordion-item"; 895 var ACCORDION_HEADING_BLOCK_NAME = "core/accordion-heading"; 896 var ACCORDION_BLOCK = { 897 name: ACCORDION_BLOCK_NAME 898 }; 899 function Edit({ 900 attributes: { 901 autoclose, 902 iconPosition, 903 showIcon, 904 headingLevel, 905 levelOptions 906 }, 907 clientId, 908 setAttributes, 909 isSelected: isSingleSelected 910 }) { 911 const registry = (0, import_data2.useRegistry)(); 912 const { getBlockOrder } = (0, import_data2.useSelect)(import_block_editor2.store); 913 const blockProps = (0, import_block_editor2.useBlockProps)({ 914 role: "group" 915 }); 916 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 917 const { updateBlockAttributes, insertBlock } = (0, import_data2.useDispatch)(import_block_editor2.store); 918 const blockEditingMode = (0, import_block_editor2.useBlockEditingMode)(); 919 const isContentOnlyMode = blockEditingMode === "contentOnly"; 920 const innerBlocksProps = (0, import_block_editor2.useInnerBlocksProps)(blockProps, { 921 template: [[ACCORDION_BLOCK_NAME]], 922 defaultBlock: ACCORDION_BLOCK, 923 directInsert: true, 924 templateInsertUpdatesSelection: true 925 }); 926 const addAccordionItemBlock = () => { 927 const newAccordionItem = (0, import_blocks.createBlock)(ACCORDION_BLOCK_NAME, {}, [ 928 (0, import_blocks.createBlock)(ACCORDION_HEADING_BLOCK_NAME, { 929 level: headingLevel 930 }), 931 (0, import_blocks.createBlock)("core/accordion-panel", {}) 932 ]); 933 insertBlock(newAccordionItem, void 0, clientId); 934 }; 935 const updateHeadingLevel = (newHeadingLevel) => { 936 const innerBlockClientIds = getBlockOrder(clientId); 937 const accordionHeaderClientIds = []; 938 innerBlockClientIds.forEach((contentClientId) => { 939 const headerClientIds = getBlockOrder(contentClientId); 940 accordionHeaderClientIds.push(...headerClientIds); 941 }); 942 registry.batch(() => { 943 setAttributes({ headingLevel: newHeadingLevel }); 944 updateBlockAttributes(accordionHeaderClientIds, { 945 level: newHeadingLevel 946 }); 947 }); 948 }; 949 return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [ 950 isSingleSelected && !isContentOnlyMode && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [ 951 /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor2.BlockControls, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.ToolbarGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( 952 import_block_editor2.HeadingLevelDropdown, 953 { 954 value: headingLevel, 955 options: levelOptions, 956 onChange: updateHeadingLevel 957 } 958 ) }) }), 959 /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor2.BlockControls, { group: "other", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.ToolbarButton, { onClick: addAccordionItemBlock, children: (0, import_i18n.__)("Add item") }) }) 960 ] }), 961 /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor2.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)( 962 import_components.__experimentalToolsPanel, 963 { 964 label: (0, import_i18n.__)("Settings"), 965 resetAll: () => { 966 setAttributes({ 967 autoclose: false, 968 showIcon: true, 969 iconPosition: "right" 970 }); 971 }, 972 dropdownMenuProps, 973 children: [ 974 /* @__PURE__ */ (0, import_jsx_runtime.jsx)( 975 import_components.__experimentalToolsPanelItem, 976 { 977 label: (0, import_i18n.__)("Auto-close"), 978 isShownByDefault: true, 979 hasValue: () => !!autoclose, 980 onDeselect: () => setAttributes({ autoclose: false }), 981 children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( 982 import_components.ToggleControl, 983 { 984 isBlock: true, 985 label: (0, import_i18n.__)("Auto-close"), 986 onChange: (value) => { 987 setAttributes({ 988 autoclose: value 989 }); 990 }, 991 checked: autoclose, 992 help: (0, import_i18n.__)( 993 "Automatically close accordions when a new one is opened." 994 ) 995 } 996 ) 997 } 998 ), 999 /* @__PURE__ */ (0, import_jsx_runtime.jsx)( 1000 import_components.__experimentalToolsPanelItem, 1001 { 1002 label: (0, import_i18n.__)("Show icon"), 1003 isShownByDefault: true, 1004 hasValue: () => !showIcon, 1005 onDeselect: () => setAttributes({ showIcon: true }), 1006 children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( 1007 import_components.ToggleControl, 1008 { 1009 isBlock: true, 1010 label: (0, import_i18n.__)("Show icon"), 1011 onChange: (value) => { 1012 setAttributes({ 1013 showIcon: value, 1014 iconPosition: value ? iconPosition : "right" 1015 }); 1016 }, 1017 checked: showIcon, 1018 help: (0, import_i18n.__)( 1019 "Display a plus icon next to the accordion header." 1020 ) 1021 } 1022 ) 1023 } 1024 ), 1025 showIcon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)( 1026 import_components.__experimentalToolsPanelItem, 1027 { 1028 label: (0, import_i18n.__)("Icon Position"), 1029 isShownByDefault: true, 1030 hasValue: () => iconPosition !== "right", 1031 onDeselect: () => setAttributes({ iconPosition: "right" }), 1032 children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)( 1033 import_components.__experimentalToggleGroupControl, 1034 { 1035 __next40pxDefaultSize: true, 1036 isBlock: true, 1037 label: (0, import_i18n.__)("Icon Position"), 1038 value: iconPosition, 1039 onChange: (value) => { 1040 setAttributes({ iconPosition: value }); 1041 }, 1042 children: [ 1043 /* @__PURE__ */ (0, import_jsx_runtime.jsx)( 1044 import_components.__experimentalToggleGroupControlOption, 1045 { 1046 label: (0, import_i18n.__)("Left"), 1047 value: "left" 1048 } 1049 ), 1050 /* @__PURE__ */ (0, import_jsx_runtime.jsx)( 1051 import_components.__experimentalToggleGroupControlOption, 1052 { 1053 label: (0, import_i18n.__)("Right"), 1054 value: "right" 1055 } 1056 ) 1057 ] 1058 } 1059 ) 1060 } 1061 ) 1062 ] 1063 } 1064 ) }, "setting"), 1065 /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...innerBlocksProps }) 1066 ] }); 1067 } 1068 1069 // packages/block-library/build-module/accordion/save.js 1070 var import_block_editor3 = __toESM(require_block_editor()); 1071 var import_jsx_runtime2 = __toESM(require_jsx_runtime()); 1072 function save() { 1073 const blockProps = import_block_editor3.useBlockProps.save({ 1074 role: "group" 1075 }); 1076 return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { ...import_block_editor3.useInnerBlocksProps.save(blockProps) }); 1077 } 1078 1079 // packages/block-library/build-module/accordion/block.json 1080 var block_default = { 1081 $schema: "https://schemas.wp.org/trunk/block.json", 1082 apiVersion: 3, 1083 name: "core/accordion", 1084 title: "Accordion", 1085 category: "design", 1086 description: "Displays a foldable layout that groups content in collapsible sections.", 1087 example: {}, 1088 supports: { 1089 anchor: true, 1090 html: false, 1091 align: ["wide", "full"], 1092 background: { 1093 backgroundImage: true, 1094 backgroundSize: true, 1095 __experimentalDefaultControls: { 1096 backgroundImage: true 1097 } 1098 }, 1099 color: { 1100 background: true, 1101 gradients: true 1102 }, 1103 __experimentalBorder: { 1104 color: true, 1105 radius: true, 1106 style: true, 1107 width: true, 1108 __experimentalDefaultControls: { 1109 color: true, 1110 radius: true, 1111 style: true, 1112 width: true 1113 } 1114 }, 1115 spacing: { 1116 padding: true, 1117 margin: ["top", "bottom"], 1118 blockGap: true 1119 }, 1120 shadow: true, 1121 layout: true, 1122 ariaLabel: true, 1123 interactivity: true, 1124 typography: { 1125 fontSize: true, 1126 lineHeight: true, 1127 __experimentalFontFamily: true, 1128 __experimentalFontWeight: true, 1129 __experimentalFontStyle: true, 1130 __experimentalTextTransform: true, 1131 __experimentalTextDecoration: true, 1132 __experimentalLetterSpacing: true, 1133 __experimentalDefaultControls: { 1134 fontSize: true 1135 } 1136 }, 1137 contentRole: true 1138 }, 1139 attributes: { 1140 iconPosition: { 1141 type: "string", 1142 default: "right" 1143 }, 1144 showIcon: { 1145 type: "boolean", 1146 default: true 1147 }, 1148 autoclose: { 1149 type: "boolean", 1150 default: false 1151 }, 1152 headingLevel: { 1153 type: "number", 1154 default: 3 1155 }, 1156 levelOptions: { 1157 type: "array" 1158 } 1159 }, 1160 providesContext: { 1161 "core/accordion-icon-position": "iconPosition", 1162 "core/accordion-show-icon": "showIcon", 1163 "core/accordion-heading-level": "headingLevel" 1164 }, 1165 allowedBlocks: ["core/accordion-item"], 1166 textdomain: "default", 1167 viewScriptModule: "@wordpress/block-library/accordion/view" 1168 }; 1169 1170 // packages/block-library/build-module/utils/init-block.js 1171 var import_blocks2 = __toESM(require_blocks()); 1172 function initBlock(block) { 1173 if (!block) { 1174 return; 1175 } 1176 const { metadata, settings: settings116, name: name117 } = block; 1177 return (0, import_blocks2.registerBlockType)({ name: name117, ...metadata }, settings116); 1178 } 1179 1180 // packages/block-library/build-module/accordion/icon.js 1181 var import_primitives = __toESM(require_primitives()); 1182 var import_jsx_runtime3 = __toESM(require_jsx_runtime()); 1183 var icon_default = /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [ 1184 /* @__PURE__ */ (0, import_jsx_runtime3.jsx)( 1185 import_primitives.Path, 1186 { 1187 fillRule: "evenodd", 1188 clipRule: "evenodd", 1189 d: "M19.5 9.25L9.5 9.25L9.5 7.75L19.5 7.75L19.5 9.25Z", 1190 fill: "currentColor" 1191 } 1192 ), 1193 /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives.Path, { d: "M4.5 6L8.5 8.5L4.5 11L4.5 6Z", fill: "currentColor" }), 1194 /* @__PURE__ */ (0, import_jsx_runtime3.jsx)( 1195 import_primitives.Path, 1196 { 1197 fillRule: "evenodd", 1198 clipRule: "evenodd", 1199 d: "M19.5 16.25L9.5 16.25L9.5 14.75L19.5 14.75L19.5 16.25Z", 1200 fill: "currentColor" 1201 } 1202 ), 1203 /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives.Path, { d: "M4.5 13L8.5 15.5L4.5 18L4.5 13Z", fill: "currentColor" }) 1204 ] }); 1205 1206 // packages/block-library/build-module/accordion/index.js 1207 var { name } = block_default; 1208 var settings = { 1209 icon: icon_default, 1210 example: { 1211 innerBlocks: [ 1212 { 1213 name: "core/accordion-item", 1214 innerBlocks: [ 1215 { 1216 name: "core/accordion-heading", 1217 attributes: { 1218 title: (0, import_i18n2.__)( 1219 "Lorem ipsum dolor sit amet, consectetur." 1220 ) 1221 } 1222 } 1223 ] 1224 }, 1225 { 1226 name: "core/accordion-item", 1227 innerBlocks: [ 1228 { 1229 name: "core/accordion-heading", 1230 attributes: { 1231 title: (0, import_i18n2.__)( 1232 "Suspendisse commodo lacus, interdum et." 1233 ) 1234 } 1235 } 1236 ] 1237 } 1238 ] 1239 }, 1240 edit: Edit, 1241 save 1242 }; 1243 var init = () => initBlock({ name, metadata: block_default, settings }); 1244 1245 // packages/block-library/build-module/accordion-item/index.js 1246 var accordion_item_exports = {}; 1247 __export(accordion_item_exports, { 1248 init: () => init2, 1249 metadata: () => block_default2, 1250 name: () => name2, 1251 settings: () => settings2 1252 }); 1253 1254 // packages/block-library/build-module/accordion-item/edit.js 1255 var import_i18n3 = __toESM(require_i18n()); 1256 var import_block_editor4 = __toESM(require_block_editor()); 1257 var import_data3 = __toESM(require_data()); 1258 var import_element2 = __toESM(require_element()); 1259 var import_components2 = __toESM(require_components()); 1260 1261 // node_modules/clsx/dist/clsx.mjs 1262 function r(e2) { 1263 var t2, f2, n2 = ""; 1264 if ("string" == typeof e2 || "number" == typeof e2) n2 += e2; 1265 else if ("object" == typeof e2) if (Array.isArray(e2)) { 1266 var o2 = e2.length; 1267 for (t2 = 0; t2 < o2; t2++) e2[t2] && (f2 = r(e2[t2])) && (n2 && (n2 += " "), n2 += f2); 1268 } else for (f2 in e2) e2[f2] && (n2 && (n2 += " "), n2 += f2); 1269 return n2; 1270 } 1271 function clsx() { 1272 for (var e2, t2, f2 = 0, n2 = "", o2 = arguments.length; f2 < o2; f2++) (e2 = arguments[f2]) && (t2 = r(e2)) && (n2 && (n2 += " "), n2 += t2); 1273 return n2; 1274 } 1275 var clsx_default = clsx; 1276 1277 // packages/block-library/build-module/accordion-item/edit.js 1278 var import_jsx_runtime4 = __toESM(require_jsx_runtime()); 1279 function Edit2({ 1280 attributes: attributes3, 1281 clientId, 1282 setAttributes, 1283 context 1284 }) { 1285 const { openByDefault } = attributes3; 1286 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 1287 const { isSelected, getBlockOrder } = (0, import_data3.useSelect)( 1288 (select9) => { 1289 const { 1290 isBlockSelected, 1291 hasSelectedInnerBlock, 1292 getBlockOrder: getBlockOrderSelector 1293 } = select9(import_block_editor4.store); 1294 return { 1295 isSelected: isBlockSelected(clientId) || hasSelectedInnerBlock(clientId, true), 1296 getBlockOrder: getBlockOrderSelector 1297 }; 1298 }, 1299 [clientId] 1300 ); 1301 const contentBlockClientId = getBlockOrder(clientId)[1]; 1302 const { updateBlockAttributes, __unstableMarkNextChangeAsNotPersistent } = (0, import_data3.useDispatch)(import_block_editor4.store); 1303 (0, import_element2.useEffect)(() => { 1304 if (contentBlockClientId) { 1305 __unstableMarkNextChangeAsNotPersistent(); 1306 updateBlockAttributes(contentBlockClientId, { 1307 isSelected 1308 }); 1309 } 1310 }, [ 1311 isSelected, 1312 contentBlockClientId, 1313 __unstableMarkNextChangeAsNotPersistent, 1314 updateBlockAttributes 1315 ]); 1316 const blockProps = (0, import_block_editor4.useBlockProps)({ 1317 className: clsx_default({ 1318 "is-open": openByDefault || isSelected 1319 }) 1320 }); 1321 const headingLevel = context && context["core/accordion-heading-level"]; 1322 const innerBlocksProps = (0, import_block_editor4.useInnerBlocksProps)(blockProps, { 1323 template: [ 1324 [ 1325 "core/accordion-heading", 1326 headingLevel ? { level: headingLevel } : {} 1327 ], 1328 [ 1329 "core/accordion-panel", 1330 { 1331 openByDefault 1332 } 1333 ] 1334 ], 1335 templateLock: "all", 1336 directInsert: true, 1337 templateInsertUpdatesSelection: true 1338 }); 1339 return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [ 1340 /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_block_editor4.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)( 1341 import_components2.__experimentalToolsPanel, 1342 { 1343 label: (0, import_i18n3.__)("Settings"), 1344 resetAll: () => { 1345 setAttributes({ openByDefault: false }); 1346 if (contentBlockClientId) { 1347 updateBlockAttributes(contentBlockClientId, { 1348 openByDefault: false 1349 }); 1350 } 1351 }, 1352 dropdownMenuProps, 1353 children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)( 1354 import_components2.__experimentalToolsPanelItem, 1355 { 1356 label: (0, import_i18n3.__)("Open by default"), 1357 isShownByDefault: true, 1358 hasValue: () => !!openByDefault, 1359 onDeselect: () => { 1360 setAttributes({ openByDefault: false }); 1361 if (contentBlockClientId) { 1362 updateBlockAttributes(contentBlockClientId, { 1363 openByDefault: false 1364 }); 1365 } 1366 }, 1367 children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)( 1368 import_components2.ToggleControl, 1369 { 1370 label: (0, import_i18n3.__)("Open by default"), 1371 onChange: (value) => { 1372 setAttributes({ 1373 openByDefault: value 1374 }); 1375 if (contentBlockClientId) { 1376 updateBlockAttributes( 1377 contentBlockClientId, 1378 { 1379 openByDefault: value 1380 } 1381 ); 1382 } 1383 }, 1384 checked: openByDefault, 1385 help: (0, import_i18n3.__)( 1386 "Accordion content will be displayed by default." 1387 ) 1388 } 1389 ) 1390 } 1391 ) 1392 } 1393 ) }, "setting"), 1394 /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { ...innerBlocksProps }) 1395 ] }); 1396 } 1397 1398 // packages/block-library/build-module/accordion-item/save.js 1399 var import_block_editor5 = __toESM(require_block_editor()); 1400 var import_jsx_runtime5 = __toESM(require_jsx_runtime()); 1401 function save2({ attributes: attributes3 }) { 1402 const { openByDefault } = attributes3; 1403 const blockProps = import_block_editor5.useBlockProps.save({ 1404 className: clsx_default({ 1405 "is-open": openByDefault 1406 }) 1407 }); 1408 const innerBlocksProps = import_block_editor5.useInnerBlocksProps.save(blockProps); 1409 return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { ...innerBlocksProps }); 1410 } 1411 1412 // packages/block-library/build-module/accordion-item/block.json 1413 var block_default2 = { 1414 $schema: "https://schemas.wp.org/trunk/block.json", 1415 apiVersion: 3, 1416 name: "core/accordion-item", 1417 title: "Accordion Item", 1418 category: "design", 1419 description: "Wraps the heading and panel in one unit.", 1420 parent: ["core/accordion"], 1421 allowedBlocks: ["core/accordion-heading", "core/accordion-panel"], 1422 supports: { 1423 html: false, 1424 color: { 1425 background: true, 1426 gradients: true 1427 }, 1428 interactivity: true, 1429 spacing: { 1430 margin: ["top", "bottom"], 1431 blockGap: true 1432 }, 1433 __experimentalBorder: { 1434 color: true, 1435 radius: true, 1436 style: true, 1437 width: true, 1438 __experimentalDefaultControls: { 1439 color: true, 1440 radius: true, 1441 style: true, 1442 width: true 1443 } 1444 }, 1445 shadow: true, 1446 layout: { 1447 allowEditing: false 1448 }, 1449 typography: { 1450 fontSize: true, 1451 lineHeight: true, 1452 __experimentalFontFamily: true, 1453 __experimentalFontWeight: true, 1454 __experimentalFontStyle: true, 1455 __experimentalTextTransform: true, 1456 __experimentalTextDecoration: true, 1457 __experimentalLetterSpacing: true, 1458 __experimentalDefaultControls: { 1459 fontSize: true 1460 } 1461 }, 1462 contentRole: true 1463 }, 1464 attributes: { 1465 openByDefault: { 1466 type: "boolean", 1467 default: false 1468 } 1469 }, 1470 textdomain: "default", 1471 style: "wp-block-accordion-item" 1472 }; 1473 1474 // packages/block-library/build-module/accordion-item/icon.js 1475 var import_primitives2 = __toESM(require_primitives()); 1476 var import_jsx_runtime6 = __toESM(require_jsx_runtime()); 1477 var icon_default2 = /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [ 1478 /* @__PURE__ */ (0, import_jsx_runtime6.jsx)( 1479 import_primitives2.Path, 1480 { 1481 fillRule: "evenodd", 1482 clipRule: "evenodd", 1483 d: "M19.5 9.5L9.5 9.5L9.5 8L19.5 8L19.5 9.5Z", 1484 fill: "currentColor" 1485 } 1486 ), 1487 /* @__PURE__ */ (0, import_jsx_runtime6.jsx)( 1488 import_primitives2.Path, 1489 { 1490 fillRule: "evenodd", 1491 clipRule: "evenodd", 1492 d: "M19.5 13L9.5 13L9.5 11.5L19.5 11.5L19.5 13Z", 1493 fill: "currentColor" 1494 } 1495 ), 1496 /* @__PURE__ */ (0, import_jsx_runtime6.jsx)( 1497 import_primitives2.Path, 1498 { 1499 fillRule: "evenodd", 1500 clipRule: "evenodd", 1501 d: "M19.5 16.3999L9.5 16.3999L9.5 14.8999L19.5 14.8999L19.5 16.3999Z", 1502 fill: "currentColor" 1503 } 1504 ), 1505 /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives2.Path, { d: "M4.5 6.25L8.5 8.75L4.5 11.25L4.5 6.25Z", fill: "currentColor" }) 1506 ] }); 1507 1508 // packages/block-library/build-module/accordion-item/index.js 1509 var { name: name2 } = block_default2; 1510 var settings2 = { 1511 icon: icon_default2, 1512 edit: Edit2, 1513 save: save2 1514 }; 1515 var init2 = () => initBlock({ name: name2, metadata: block_default2, settings: settings2 }); 1516 1517 // packages/block-library/build-module/accordion-heading/index.js 1518 var accordion_heading_exports = {}; 1519 __export(accordion_heading_exports, { 1520 init: () => init3, 1521 metadata: () => block_default3, 1522 name: () => name3, 1523 settings: () => settings3 1524 }); 1525 1526 // packages/block-library/build-module/accordion-heading/edit.js 1527 var import_i18n4 = __toESM(require_i18n()); 1528 var import_element3 = __toESM(require_element()); 1529 var import_block_editor6 = __toESM(require_block_editor()); 1530 var import_jsx_runtime7 = __toESM(require_jsx_runtime()); 1531 function Edit3({ attributes: attributes3, setAttributes, context }) { 1532 const { title } = attributes3; 1533 const { 1534 "core/accordion-icon-position": iconPosition, 1535 "core/accordion-show-icon": showIcon, 1536 "core/accordion-heading-level": headingLevel 1537 } = context; 1538 const TagName2 = "h" + headingLevel; 1539 (0, import_element3.useEffect)(() => { 1540 if (iconPosition !== void 0 && showIcon !== void 0) { 1541 setAttributes({ 1542 iconPosition, 1543 showIcon 1544 }); 1545 } 1546 }, [iconPosition, showIcon, setAttributes]); 1547 const [fluidTypographySettings, layout] = (0, import_block_editor6.useSettings)( 1548 "typography.fluid", 1549 "layout" 1550 ); 1551 const typographyProps = (0, import_block_editor6.getTypographyClassesAndStyles)(attributes3, { 1552 typography: { 1553 fluid: fluidTypographySettings 1554 }, 1555 layout: { 1556 wideSize: layout?.wideSize 1557 } 1558 }); 1559 const blockProps = (0, import_block_editor6.useBlockProps)(); 1560 const spacingProps = (0, import_block_editor6.__experimentalGetSpacingClassesAndStyles)(attributes3); 1561 return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TagName2, { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)( 1562 "button", 1563 { 1564 className: "wp-block-accordion-heading__toggle", 1565 style: spacingProps.style, 1566 tabIndex: "-1", 1567 children: [ 1568 showIcon && iconPosition === "left" && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)( 1569 "span", 1570 { 1571 className: "wp-block-accordion-heading__toggle-icon", 1572 "aria-hidden": "true", 1573 children: "+" 1574 } 1575 ), 1576 /* @__PURE__ */ (0, import_jsx_runtime7.jsx)( 1577 import_block_editor6.RichText, 1578 { 1579 withoutInteractiveFormatting: true, 1580 disableLineBreaks: true, 1581 tagName: "span", 1582 value: title, 1583 onChange: (newTitle) => setAttributes({ title: newTitle }), 1584 placeholder: (0, import_i18n4.__)("Accordion title"), 1585 className: "wp-block-accordion-heading__toggle-title", 1586 style: { 1587 letterSpacing: typographyProps.style.letterSpacing, 1588 textDecoration: typographyProps.style.textDecoration 1589 } 1590 } 1591 ), 1592 showIcon && iconPosition === "right" && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)( 1593 "span", 1594 { 1595 className: "wp-block-accordion-heading__toggle-icon", 1596 "aria-hidden": "true", 1597 children: "+" 1598 } 1599 ) 1600 ] 1601 } 1602 ) }); 1603 } 1604 1605 // packages/block-library/build-module/accordion-heading/save.js 1606 var import_block_editor7 = __toESM(require_block_editor()); 1607 var import_jsx_runtime8 = __toESM(require_jsx_runtime()); 1608 function save3({ attributes: attributes3 }) { 1609 const { level, title, iconPosition, showIcon } = attributes3; 1610 const TagName2 = "h" + (level || 3); 1611 const typographyProps = (0, import_block_editor7.getTypographyClassesAndStyles)(attributes3); 1612 const blockProps = import_block_editor7.useBlockProps.save(); 1613 const spacingProps = (0, import_block_editor7.__experimentalGetSpacingClassesAndStyles)(attributes3); 1614 return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TagName2, { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)( 1615 "button", 1616 { 1617 className: "wp-block-accordion-heading__toggle", 1618 style: spacingProps.style, 1619 children: [ 1620 showIcon && iconPosition === "left" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)( 1621 "span", 1622 { 1623 className: "wp-block-accordion-heading__toggle-icon", 1624 "aria-hidden": "true", 1625 children: "+" 1626 } 1627 ), 1628 /* @__PURE__ */ (0, import_jsx_runtime8.jsx)( 1629 import_block_editor7.RichText.Content, 1630 { 1631 className: "wp-block-accordion-heading__toggle-title", 1632 tagName: "span", 1633 value: title, 1634 style: { 1635 letterSpacing: typographyProps.style.letterSpacing, 1636 textDecoration: typographyProps.style.textDecoration 1637 } 1638 } 1639 ), 1640 showIcon && iconPosition === "right" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)( 1641 "span", 1642 { 1643 className: "wp-block-accordion-heading__toggle-icon", 1644 "aria-hidden": "true", 1645 children: "+" 1646 } 1647 ) 1648 ] 1649 } 1650 ) }); 1651 } 1652 1653 // packages/block-library/build-module/accordion-heading/block.json 1654 var block_default3 = { 1655 $schema: "https://schemas.wp.org/trunk/block.json", 1656 apiVersion: 3, 1657 name: "core/accordion-heading", 1658 title: "Accordion Heading", 1659 category: "design", 1660 description: "Displays a heading that toggles the accordion panel.", 1661 parent: ["core/accordion-item"], 1662 usesContext: [ 1663 "core/accordion-icon-position", 1664 "core/accordion-show-icon", 1665 "core/accordion-heading-level" 1666 ], 1667 supports: { 1668 anchor: true, 1669 color: { 1670 background: true, 1671 gradients: true 1672 }, 1673 align: false, 1674 interactivity: true, 1675 spacing: { 1676 padding: true, 1677 __experimentalDefaultControls: { 1678 padding: true 1679 }, 1680 __experimentalSkipSerialization: true, 1681 __experimentalSelector: ".wp-block-accordion-heading__toggle" 1682 }, 1683 __experimentalBorder: { 1684 color: true, 1685 radius: true, 1686 style: true, 1687 width: true, 1688 __experimentalDefaultControls: { 1689 color: true, 1690 radius: true, 1691 style: true, 1692 width: true 1693 } 1694 }, 1695 typography: { 1696 __experimentalSkipSerialization: [ 1697 "textDecoration", 1698 "letterSpacing" 1699 ], 1700 fontSize: true, 1701 __experimentalFontFamily: true, 1702 __experimentalFontWeight: true, 1703 __experimentalFontStyle: true, 1704 __experimentalTextTransform: true, 1705 __experimentalTextDecoration: true, 1706 __experimentalLetterSpacing: true, 1707 __experimentalDefaultControls: { 1708 fontSize: true, 1709 fontFamily: true 1710 } 1711 }, 1712 shadow: true, 1713 visibility: false, 1714 lock: false 1715 }, 1716 selectors: { 1717 typography: { 1718 letterSpacing: ".wp-block-accordion-heading .wp-block-accordion-heading__toggle-title", 1719 textDecoration: ".wp-block-accordion-heading .wp-block-accordion-heading__toggle-title" 1720 } 1721 }, 1722 attributes: { 1723 openByDefault: { 1724 type: "boolean", 1725 default: false 1726 }, 1727 title: { 1728 type: "rich-text", 1729 source: "rich-text", 1730 selector: ".wp-block-accordion-heading__toggle-title", 1731 role: "content" 1732 }, 1733 level: { 1734 type: "number" 1735 }, 1736 iconPosition: { 1737 type: "string", 1738 enum: ["left", "right"], 1739 default: "right" 1740 }, 1741 showIcon: { 1742 type: "boolean", 1743 default: true 1744 } 1745 }, 1746 textdomain: "default" 1747 }; 1748 1749 // packages/block-library/build-module/accordion-heading/icon.js 1750 var import_primitives3 = __toESM(require_primitives()); 1751 var import_jsx_runtime9 = __toESM(require_jsx_runtime()); 1752 var icon_default3 = /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [ 1753 /* @__PURE__ */ (0, import_jsx_runtime9.jsx)( 1754 import_primitives3.Path, 1755 { 1756 fillRule: "evenodd", 1757 clipRule: "evenodd", 1758 d: "M19.5 12.75L9.5 12.75L9.5 11.25L19.5 11.25L19.5 12.75Z", 1759 fill: "currentColor" 1760 } 1761 ), 1762 /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives3.Path, { d: "M4.5 9.5L8.5 12L4.5 14.5L4.5 9.5Z", fill: "currentColor" }) 1763 ] }); 1764 1765 // packages/block-library/build-module/accordion-heading/deprecated.js 1766 var import_block_editor8 = __toESM(require_block_editor()); 1767 var import_jsx_runtime10 = __toESM(require_jsx_runtime()); 1768 var v1 = { 1769 attributes: { 1770 openByDefault: { 1771 type: "boolean", 1772 default: false 1773 }, 1774 title: { 1775 type: "rich-text", 1776 source: "rich-text", 1777 selector: ".wp-block-accordion-heading__toggle-title", 1778 role: "content" 1779 }, 1780 level: { 1781 type: "number" 1782 }, 1783 iconPosition: { 1784 type: "string", 1785 enum: ["left", "right"], 1786 default: "right" 1787 }, 1788 showIcon: { 1789 type: "boolean", 1790 default: true 1791 } 1792 }, 1793 supports: { 1794 anchor: true, 1795 color: { 1796 background: true, 1797 gradients: true 1798 }, 1799 align: false, 1800 interactivity: true, 1801 spacing: { 1802 padding: true, 1803 __experimentalDefaultControls: { 1804 padding: true 1805 }, 1806 __experimentalSkipSerialization: true, 1807 __experimentalSelector: ".wp-block-accordion-heading__toggle" 1808 }, 1809 __experimentalBorder: { 1810 color: true, 1811 radius: true, 1812 style: true, 1813 width: true, 1814 __experimentalDefaultControls: { 1815 color: true, 1816 radius: true, 1817 style: true, 1818 width: true 1819 } 1820 }, 1821 typography: { 1822 fontSize: true, 1823 __experimentalFontFamily: true, 1824 __experimentalFontWeight: true, 1825 __experimentalFontStyle: true, 1826 __experimentalTextTransform: true, 1827 __experimentalTextDecoration: true, 1828 __experimentalLetterSpacing: true, 1829 __experimentalDefaultControls: { 1830 fontSize: true, 1831 fontFamily: true 1832 } 1833 }, 1834 shadow: true, 1835 visibility: false 1836 }, 1837 save({ attributes: attributes3 }) { 1838 const { level, title, iconPosition, showIcon } = attributes3; 1839 const TagName2 = "h" + (level || 3); 1840 const blockProps = import_block_editor8.useBlockProps.save(); 1841 const spacingProps = (0, import_block_editor8.__experimentalGetSpacingClassesAndStyles)(attributes3); 1842 return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TagName2, { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)( 1843 "button", 1844 { 1845 className: "wp-block-accordion-heading__toggle", 1846 style: spacingProps.style, 1847 children: [ 1848 showIcon && iconPosition === "left" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)( 1849 "span", 1850 { 1851 className: "wp-block-accordion-heading__toggle-icon", 1852 "aria-hidden": "true", 1853 children: "+" 1854 } 1855 ), 1856 /* @__PURE__ */ (0, import_jsx_runtime10.jsx)( 1857 import_block_editor8.RichText.Content, 1858 { 1859 className: "wp-block-accordion-heading__toggle-title", 1860 tagName: "span", 1861 value: title 1862 } 1863 ), 1864 showIcon && iconPosition === "right" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)( 1865 "span", 1866 { 1867 className: "wp-block-accordion-heading__toggle-icon", 1868 "aria-hidden": "true", 1869 children: "+" 1870 } 1871 ) 1872 ] 1873 } 1874 ) }); 1875 } 1876 }; 1877 var deprecated_default = [v1]; 1878 1879 // packages/block-library/build-module/accordion-heading/index.js 1880 var { name: name3 } = block_default3; 1881 var settings3 = { 1882 icon: icon_default3, 1883 edit: Edit3, 1884 save: save3, 1885 deprecated: deprecated_default 1886 }; 1887 var init3 = () => initBlock({ name: name3, metadata: block_default3, settings: settings3 }); 1888 1889 // packages/block-library/build-module/accordion-panel/index.js 1890 var accordion_panel_exports = {}; 1891 __export(accordion_panel_exports, { 1892 init: () => init4, 1893 metadata: () => block_default4, 1894 name: () => name4, 1895 settings: () => settings4 1896 }); 1897 1898 // packages/block-library/build-module/accordion-panel/edit.js 1899 var import_block_editor9 = __toESM(require_block_editor()); 1900 var import_jsx_runtime11 = __toESM(require_jsx_runtime()); 1901 function Edit4({ attributes: attributes3 }) { 1902 const { allowedBlocks, templateLock, openByDefault, isSelected } = attributes3; 1903 const blockProps = (0, import_block_editor9.useBlockProps)({ 1904 "aria-hidden": !isSelected && !openByDefault, 1905 role: "region" 1906 }); 1907 const innerBlocksProps = (0, import_block_editor9.useInnerBlocksProps)(blockProps, { 1908 allowedBlocks, 1909 template: [["core/paragraph", {}]], 1910 templateLock 1911 }); 1912 return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { ...innerBlocksProps }); 1913 } 1914 1915 // packages/block-library/build-module/accordion-panel/save.js 1916 var import_block_editor10 = __toESM(require_block_editor()); 1917 var import_jsx_runtime12 = __toESM(require_jsx_runtime()); 1918 function save4() { 1919 const blockProps = import_block_editor10.useBlockProps.save({ 1920 role: "region" 1921 }); 1922 const innerBlocksProps = import_block_editor10.useInnerBlocksProps.save(blockProps); 1923 return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { ...innerBlocksProps }); 1924 } 1925 1926 // packages/block-library/build-module/accordion-panel/block.json 1927 var block_default4 = { 1928 $schema: "https://schemas.wp.org/trunk/block.json", 1929 apiVersion: 3, 1930 name: "core/accordion-panel", 1931 title: "Accordion Panel", 1932 category: "design", 1933 description: "Contains the hidden or revealed content beneath the heading.", 1934 parent: ["core/accordion-item"], 1935 supports: { 1936 html: false, 1937 color: { 1938 background: true, 1939 gradients: true 1940 }, 1941 interactivity: true, 1942 spacing: { 1943 padding: true, 1944 blockGap: true, 1945 __experimentalDefaultControls: { 1946 padding: true, 1947 blockGap: true 1948 } 1949 }, 1950 __experimentalBorder: { 1951 color: true, 1952 radius: true, 1953 style: true, 1954 width: true, 1955 __experimentalDefaultControls: { 1956 color: true, 1957 radius: true, 1958 style: true, 1959 width: true 1960 } 1961 }, 1962 typography: { 1963 fontSize: true, 1964 lineHeight: true, 1965 __experimentalFontFamily: true, 1966 __experimentalFontWeight: true, 1967 __experimentalFontStyle: true, 1968 __experimentalTextTransform: true, 1969 __experimentalTextDecoration: true, 1970 __experimentalLetterSpacing: true, 1971 __experimentalDefaultControls: { 1972 fontSize: true 1973 } 1974 }, 1975 shadow: true, 1976 layout: { 1977 allowEditing: false 1978 }, 1979 visibility: false, 1980 contentRole: true, 1981 allowedBlocks: true, 1982 lock: false 1983 }, 1984 attributes: { 1985 templateLock: { 1986 type: ["string", "boolean"], 1987 enum: ["all", "insert", "contentOnly", false], 1988 default: false 1989 }, 1990 openByDefault: { 1991 type: "boolean", 1992 default: false 1993 }, 1994 isSelected: { 1995 type: "boolean", 1996 default: false 1997 } 1998 }, 1999 textdomain: "default", 2000 style: "wp-block-accordion-panel" 2001 }; 2002 2003 // packages/block-library/build-module/accordion-panel/icon.js 2004 var import_primitives4 = __toESM(require_primitives()); 2005 var import_jsx_runtime13 = __toESM(require_jsx_runtime()); 2006 var icon_default4 = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives4.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)( 2007 import_primitives4.Path, 2008 { 2009 fillRule: "evenodd", 2010 clipRule: "evenodd", 2011 d: "M8.10417 6.00024H6.5C5.39543 6.00024 4.5 6.89567 4.5 8.00024V10.3336H6V8.00024C6 7.7241 6.22386 7.50024 6.5 7.50024H8.10417V6.00024ZM4.5 13.6669V16.0002C4.5 17.1048 5.39543 18.0002 6.5 18.0002H8.10417V16.5002H6.5C6.22386 16.5002 6 16.2764 6 16.0002V13.6669H4.5ZM10.3958 6.00024V7.50024H13.6042V6.00024H10.3958ZM15.8958 6.00024V7.50024H17.5C17.7761 7.50024 18 7.7241 18 8.00024V10.3336H19.5V8.00024C19.5 6.89567 18.6046 6.00024 17.5 6.00024H15.8958ZM19.5 13.6669H18V16.0002C18 16.2764 17.7761 16.5002 17.5 16.5002H15.8958V18.0002H17.5C18.6046 18.0002 19.5 17.1048 19.5 16.0002V13.6669ZM13.6042 18.0002V16.5002H10.3958V18.0002H13.6042Z", 2012 fill: "currentColor" 2013 } 2014 ) }); 2015 2016 // packages/block-library/build-module/accordion-panel/index.js 2017 var { name: name4 } = block_default4; 2018 var settings4 = { 2019 icon: icon_default4, 2020 edit: Edit4, 2021 save: save4 2022 }; 2023 var init4 = () => initBlock({ name: name4, metadata: block_default4, settings: settings4 }); 2024 2025 // packages/block-library/build-module/archives/index.js 2026 var archives_exports = {}; 2027 __export(archives_exports, { 2028 init: () => init5, 2029 metadata: () => block_default5, 2030 name: () => name5, 2031 settings: () => settings5 2032 }); 2033 2034 // packages/icons/build-module/icon/index.js 2035 var import_element4 = __toESM(require_element()); 2036 var icon_default5 = (0, import_element4.forwardRef)( 2037 ({ icon, size = 24, ...props }, ref) => { 2038 return (0, import_element4.cloneElement)(icon, { 2039 width: size, 2040 height: size, 2041 ...props, 2042 ref 2043 }); 2044 } 2045 ); 2046 2047 // packages/icons/build-module/library/add-submenu.js 2048 var import_primitives5 = __toESM(require_primitives()); 2049 var import_jsx_runtime14 = __toESM(require_jsx_runtime()); 2050 var add_submenu_default = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives5.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives5.Path, { 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" }) }); 2051 2052 // packages/icons/build-module/library/align-center.js 2053 var import_primitives6 = __toESM(require_primitives()); 2054 var import_jsx_runtime15 = __toESM(require_jsx_runtime()); 2055 var align_center_default = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_primitives6.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_primitives6.Path, { d: "M7.5 5.5h9V4h-9v1.5Zm-3.5 7h16V11H4v1.5Zm3.5 7h9V18h-9v1.5Z" }) }); 2056 2057 // packages/icons/build-module/library/align-left.js 2058 var import_primitives7 = __toESM(require_primitives()); 2059 var import_jsx_runtime16 = __toESM(require_jsx_runtime()); 2060 var align_left_default = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_primitives7.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_primitives7.Path, { d: "M13 5.5H4V4h9v1.5Zm7 7H4V11h16v1.5Zm-7 7H4V18h9v1.5Z" }) }); 2061 2062 // packages/icons/build-module/library/align-none.js 2063 var import_primitives8 = __toESM(require_primitives()); 2064 var import_jsx_runtime17 = __toESM(require_jsx_runtime()); 2065 var align_none_default = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_primitives8.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_primitives8.Path, { d: "M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM5 9h14v6H5V9Z" }) }); 2066 2067 // packages/icons/build-module/library/align-right.js 2068 var import_primitives9 = __toESM(require_primitives()); 2069 var import_jsx_runtime18 = __toESM(require_jsx_runtime()); 2070 var align_right_default = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_primitives9.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_primitives9.Path, { d: "M11.111 5.5H20V4h-8.889v1.5ZM4 12.5h16V11H4v1.5Zm7.111 7H20V18h-8.889v1.5Z" }) }); 2071 2072 // packages/icons/build-module/library/archive.js 2073 var import_primitives10 = __toESM(require_primitives()); 2074 var import_jsx_runtime19 = __toESM(require_jsx_runtime()); 2075 var archive_default = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_primitives10.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)( 2076 import_primitives10.Path, 2077 { 2078 fillRule: "evenodd", 2079 clipRule: "evenodd", 2080 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" 2081 } 2082 ) }); 2083 2084 // packages/icons/build-module/library/audio.js 2085 var import_primitives11 = __toESM(require_primitives()); 2086 var import_jsx_runtime20 = __toESM(require_jsx_runtime()); 2087 var audio_default = /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_primitives11.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_primitives11.Path, { d: "M17.7 4.3c-1.2 0-2.8 0-3.8 1-.6.6-.9 1.5-.9 2.6V14c-.6-.6-1.5-1-2.5-1C8.6 13 7 14.6 7 16.5S8.6 20 10.5 20c1.5 0 2.8-1 3.3-2.3.5-.8.7-1.8.7-2.5V7.9c0-.7.2-1.2.5-1.6.6-.6 1.8-.6 2.8-.6h.3V4.3h-.4z" }) }); 2088 2089 // packages/icons/build-module/library/block-default.js 2090 var import_primitives12 = __toESM(require_primitives()); 2091 var import_jsx_runtime21 = __toESM(require_jsx_runtime()); 2092 var block_default_default = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_primitives12.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_primitives12.Path, { 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" }) }); 2093 2094 // packages/icons/build-module/library/block-table.js 2095 var import_primitives13 = __toESM(require_primitives()); 2096 var import_jsx_runtime22 = __toESM(require_jsx_runtime()); 2097 var block_table_default = /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_primitives13.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_primitives13.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-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" }) }); 2098 2099 // packages/icons/build-module/library/breadcrumbs.js 2100 var import_primitives14 = __toESM(require_primitives()); 2101 var import_jsx_runtime23 = __toESM(require_jsx_runtime()); 2102 var breadcrumbs_default = /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_primitives14.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_primitives14.Path, { d: "M4 13.5h3v-3H4v3Zm6-3.5 2 2-2 2 1 1 3-3-3-3-1 1Zm7 .5v3h3v-3h-3Z" }) }); 2103 2104 // packages/icons/build-module/library/button.js 2105 var import_primitives15 = __toESM(require_primitives()); 2106 var import_jsx_runtime24 = __toESM(require_jsx_runtime()); 2107 var button_default = /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_primitives15.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_primitives15.Path, { d: "M8 12.5h8V11H8v1.5Z M19 6.5H5a2 2 0 0 0-2 2V15a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.5a2 2 0 0 0-2-2ZM5 8h14a.5.5 0 0 1 .5.5V15a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V8.5A.5.5 0 0 1 5 8Z" }) }); 2108 2109 // packages/icons/build-module/library/buttons.js 2110 var import_primitives16 = __toESM(require_primitives()); 2111 var import_jsx_runtime25 = __toESM(require_jsx_runtime()); 2112 var buttons_default = /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_primitives16.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_primitives16.Path, { d: "M14.5 17.5H9.5V16H14.5V17.5Z M14.5 8H9.5V6.5H14.5V8Z M7 3.5H17C18.1046 3.5 19 4.39543 19 5.5V9C19 10.1046 18.1046 11 17 11H7C5.89543 11 5 10.1046 5 9V5.5C5 4.39543 5.89543 3.5 7 3.5ZM17 5H7C6.72386 5 6.5 5.22386 6.5 5.5V9C6.5 9.27614 6.72386 9.5 7 9.5H17C17.2761 9.5 17.5 9.27614 17.5 9V5.5C17.5 5.22386 17.2761 5 17 5Z M7 13H17C18.1046 13 19 13.8954 19 15V18.5C19 19.6046 18.1046 20.5 17 20.5H7C5.89543 20.5 5 19.6046 5 18.5V15C5 13.8954 5.89543 13 7 13ZM17 14.5H7C6.72386 14.5 6.5 14.7239 6.5 15V18.5C6.5 18.7761 6.72386 19 7 19H17C17.2761 19 17.5 18.7761 17.5 18.5V15C17.5 14.7239 17.2761 14.5 17 14.5Z" }) }); 2113 2114 // packages/icons/build-module/library/calendar.js 2115 var import_primitives17 = __toESM(require_primitives()); 2116 var import_jsx_runtime26 = __toESM(require_jsx_runtime()); 2117 var calendar_default = /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_primitives17.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_primitives17.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V7h15v12zM9 10H7v2h2v-2zm0 4H7v2h2v-2zm4-4h-2v2h2v-2zm4 0h-2v2h2v-2zm-4 4h-2v2h2v-2zm4 0h-2v2h2v-2z" }) }); 2118 2119 // packages/icons/build-module/library/caption.js 2120 var import_primitives18 = __toESM(require_primitives()); 2121 var import_jsx_runtime27 = __toESM(require_jsx_runtime()); 2122 var caption_default = /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_primitives18.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)( 2123 import_primitives18.Path, 2124 { 2125 fillRule: "evenodd", 2126 clipRule: "evenodd", 2127 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" 2128 } 2129 ) }); 2130 2131 // packages/icons/build-module/library/category.js 2132 var import_primitives19 = __toESM(require_primitives()); 2133 var import_jsx_runtime28 = __toESM(require_jsx_runtime()); 2134 var category_default = /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_primitives19.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)( 2135 import_primitives19.Path, 2136 { 2137 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", 2138 fillRule: "evenodd", 2139 clipRule: "evenodd" 2140 } 2141 ) }); 2142 2143 // packages/icons/build-module/library/chevron-down.js 2144 var import_primitives20 = __toESM(require_primitives()); 2145 var import_jsx_runtime29 = __toESM(require_jsx_runtime()); 2146 var chevron_down_default = /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_primitives20.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_primitives20.Path, { d: "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z" }) }); 2147 2148 // packages/icons/build-module/library/chevron-left-small.js 2149 var import_primitives21 = __toESM(require_primitives()); 2150 var import_jsx_runtime30 = __toESM(require_jsx_runtime()); 2151 var chevron_left_small_default = /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_primitives21.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_primitives21.Path, { d: "m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z" }) }); 2152 2153 // packages/icons/build-module/library/chevron-right-small.js 2154 var import_primitives22 = __toESM(require_primitives()); 2155 var import_jsx_runtime31 = __toESM(require_jsx_runtime()); 2156 var chevron_right_small_default = /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_primitives22.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_primitives22.Path, { d: "M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z" }) }); 2157 2158 // packages/icons/build-module/library/chevron-up.js 2159 var import_primitives23 = __toESM(require_primitives()); 2160 var import_jsx_runtime32 = __toESM(require_jsx_runtime()); 2161 var chevron_up_default = /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_primitives23.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_primitives23.Path, { d: "M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z" }) }); 2162 2163 // packages/icons/build-module/library/classic.js 2164 var import_primitives24 = __toESM(require_primitives()); 2165 var import_jsx_runtime33 = __toESM(require_jsx_runtime()); 2166 var classic_default = /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_primitives24.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_primitives24.Path, { d: "M20 6H4c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H4c-.3 0-.5-.2-.5-.5V8c0-.3.2-.5.5-.5h16c.3 0 .5.2.5.5v9zM10 10H8v2h2v-2zm-5 2h2v-2H5v2zm8-2h-2v2h2v-2zm-5 6h8v-2H8v2zm6-4h2v-2h-2v2zm3 0h2v-2h-2v2zm0 4h2v-2h-2v2zM5 16h2v-2H5v2z" }) }); 2167 2168 // packages/icons/build-module/library/close.js 2169 var import_primitives25 = __toESM(require_primitives()); 2170 var import_jsx_runtime34 = __toESM(require_jsx_runtime()); 2171 var close_default = /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_primitives25.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_primitives25.Path, { 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" }) }); 2172 2173 // packages/icons/build-module/library/code.js 2174 var import_primitives26 = __toESM(require_primitives()); 2175 var import_jsx_runtime35 = __toESM(require_jsx_runtime()); 2176 var code_default = /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_primitives26.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_primitives26.Path, { d: "M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z" }) }); 2177 2178 // packages/icons/build-module/library/column.js 2179 var import_primitives27 = __toESM(require_primitives()); 2180 var import_jsx_runtime36 = __toESM(require_jsx_runtime()); 2181 var column_default = /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_primitives27.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_primitives27.Path, { d: "M19 6H6c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zM6 17.5c-.3 0-.5-.2-.5-.5V8c0-.3.2-.5.5-.5h3v10H6zm13.5-.5c0 .3-.2.5-.5.5h-3v-10h3c.3 0 .5.2.5.5v9z" }) }); 2182 2183 // packages/icons/build-module/library/columns.js 2184 var import_primitives28 = __toESM(require_primitives()); 2185 var import_jsx_runtime37 = __toESM(require_jsx_runtime()); 2186 var columns_default = /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_primitives28.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)( 2187 import_primitives28.Path, 2188 { 2189 fillRule: "evenodd", 2190 clipRule: "evenodd", 2191 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" 2192 } 2193 ) }); 2194 2195 // packages/icons/build-module/library/comment-author-avatar.js 2196 var import_primitives29 = __toESM(require_primitives()); 2197 var import_jsx_runtime38 = __toESM(require_jsx_runtime()); 2198 var comment_author_avatar_default = /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_primitives29.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)( 2199 import_primitives29.Path, 2200 { 2201 fillRule: "evenodd", 2202 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", 2203 clipRule: "evenodd" 2204 } 2205 ) }); 2206 2207 // packages/icons/build-module/library/comment-author-name.js 2208 var import_primitives30 = __toESM(require_primitives()); 2209 var import_jsx_runtime39 = __toESM(require_jsx_runtime()); 2210 var comment_author_name_default = /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_primitives30.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: [ 2211 /* @__PURE__ */ (0, import_jsx_runtime39.jsx)( 2212 import_primitives30.Path, 2213 { 2214 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", 2215 fillRule: "evenodd", 2216 clipRule: "evenodd" 2217 } 2218 ), 2219 /* @__PURE__ */ (0, import_jsx_runtime39.jsx)( 2220 import_primitives30.Path, 2221 { 2222 d: "M15 15V15C15 13.8954 14.1046 13 13 13L11 13C9.89543 13 9 13.8954 9 15V15", 2223 fillRule: "evenodd", 2224 clipRule: "evenodd" 2225 } 2226 ), 2227 /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_primitives30.Circle, { cx: "12", cy: "9", r: "2", fillRule: "evenodd", clipRule: "evenodd" }) 2228 ] }); 2229 2230 // packages/icons/build-module/library/comment-content.js 2231 var import_primitives31 = __toESM(require_primitives()); 2232 var import_jsx_runtime40 = __toESM(require_jsx_runtime()); 2233 var comment_content_default = /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_primitives31.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)( 2234 import_primitives31.Path, 2235 { 2236 fillRule: "evenodd", 2237 clipRule: "evenodd", 2238 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" 2239 } 2240 ) }); 2241 2242 // packages/icons/build-module/library/comment-edit-link.js 2243 var import_primitives32 = __toESM(require_primitives()); 2244 var import_jsx_runtime41 = __toESM(require_jsx_runtime()); 2245 var comment_edit_link_default = /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_primitives32.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_primitives32.Path, { d: "m6.249 11.065.44-.44h3.186l-1.5 1.5H7.31l-1.957 1.96A.792.792 0 0 1 4 13.524V5a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v1.5L12.5 8V5.5h-7v6.315l.749-.75ZM20 19.75H7v-1.5h13v1.5Zm0-12.653-8.967 9.064L8 17l.867-2.935L17.833 5 20 7.097Z" }) }); 2246 2247 // packages/icons/build-module/library/comment-reply-link.js 2248 var import_primitives33 = __toESM(require_primitives()); 2249 var import_jsx_runtime42 = __toESM(require_jsx_runtime()); 2250 var comment_reply_link_default = /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_primitives33.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_primitives33.Path, { d: "M6.68822 10.625L6.24878 11.0649L5.5 11.8145L5.5 5.5L12.5 5.5V8L14 6.5V5C14 4.44772 13.5523 4 13 4H5C4.44772 4 4 4.44771 4 5V13.5247C4 13.8173 4.16123 14.086 4.41935 14.2237C4.72711 14.3878 5.10601 14.3313 5.35252 14.0845L7.31 12.125H8.375L9.875 10.625H7.31H6.68822ZM14.5605 10.4983L11.6701 13.75H16.9975C17.9963 13.75 18.7796 14.1104 19.3553 14.7048C19.9095 15.2771 20.2299 16.0224 20.4224 16.7443C20.7645 18.0276 20.7543 19.4618 20.7487 20.2544C20.7481 20.345 20.7475 20.4272 20.7475 20.4999L19.2475 20.5001C19.2475 20.4191 19.248 20.3319 19.2484 20.2394V20.2394C19.2526 19.4274 19.259 18.2035 18.973 17.1307C18.8156 16.5401 18.586 16.0666 18.2778 15.7483C17.9909 15.4521 17.5991 15.25 16.9975 15.25H11.8106L14.5303 17.9697L13.4696 19.0303L8.96956 14.5303L13.4394 9.50171L14.5605 10.4983Z" }) }); 2251 2252 // packages/icons/build-module/library/comment.js 2253 var import_primitives34 = __toESM(require_primitives()); 2254 var import_jsx_runtime43 = __toESM(require_jsx_runtime()); 2255 var comment_default = /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_primitives34.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_primitives34.Path, { d: "M18 4H6c-1.1 0-2 .9-2 2v12.9c0 .6.5 1.1 1.1 1.1.3 0 .5-.1.8-.3L8.5 17H18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H7.9l-2.4 2.4V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v9z" }) }); 2256 2257 // packages/icons/build-module/library/cover.js 2258 var import_primitives35 = __toESM(require_primitives()); 2259 var import_jsx_runtime44 = __toESM(require_jsx_runtime()); 2260 var cover_default = /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_primitives35.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_primitives35.Path, { d: "M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h6.2v8.9l2.5-3.1 2.5 3.1V4.5h2.2c.4 0 .8.4.8.8v13.4z" }) }); 2261 2262 // packages/icons/build-module/library/crop.js 2263 var import_primitives36 = __toESM(require_primitives()); 2264 var import_jsx_runtime45 = __toESM(require_jsx_runtime()); 2265 var crop_default = /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_primitives36.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_primitives36.Path, { 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" }) }); 2266 2267 // packages/icons/build-module/library/custom-link.js 2268 var import_primitives37 = __toESM(require_primitives()); 2269 var import_jsx_runtime46 = __toESM(require_jsx_runtime()); 2270 var custom_link_default = /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_primitives37.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_primitives37.Path, { 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" }) }); 2271 2272 // packages/icons/build-module/library/custom-post-type.js 2273 var import_primitives38 = __toESM(require_primitives()); 2274 var import_jsx_runtime47 = __toESM(require_jsx_runtime()); 2275 var custom_post_type_default = /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_primitives38.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_primitives38.Path, { 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" }) }); 2276 2277 // packages/icons/build-module/library/details.js 2278 var import_primitives39 = __toESM(require_primitives()); 2279 var import_jsx_runtime48 = __toESM(require_jsx_runtime()); 2280 var details_default = /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_primitives39.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: [ 2281 /* @__PURE__ */ (0, import_jsx_runtime48.jsx)( 2282 import_primitives39.Path, 2283 { 2284 d: "M4 16h10v1.5H4V16Zm0-4.5h16V13H4v-1.5ZM10 7h10v1.5H10V7Z", 2285 fillRule: "evenodd", 2286 clipRule: "evenodd" 2287 } 2288 ), 2289 /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_primitives39.Path, { d: "m4 5.25 4 2.5-4 2.5v-5Z" }) 2290 ] }); 2291 2292 // packages/icons/build-module/library/file.js 2293 var import_primitives40 = __toESM(require_primitives()); 2294 var import_jsx_runtime49 = __toESM(require_jsx_runtime()); 2295 var file_default = /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_primitives40.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)( 2296 import_primitives40.Path, 2297 { 2298 fillRule: "evenodd", 2299 clipRule: "evenodd", 2300 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" 2301 } 2302 ) }); 2303 2304 // packages/icons/build-module/library/footer.js 2305 var import_primitives41 = __toESM(require_primitives()); 2306 var import_jsx_runtime50 = __toESM(require_jsx_runtime()); 2307 var footer_default = /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_primitives41.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)( 2308 import_primitives41.Path, 2309 { 2310 fillRule: "evenodd", 2311 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" 2312 } 2313 ) }); 2314 2315 // packages/icons/build-module/library/format-indent-rtl.js 2316 var import_primitives42 = __toESM(require_primitives()); 2317 var import_jsx_runtime51 = __toESM(require_jsx_runtime()); 2318 var format_indent_rtl_default = /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_primitives42.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_primitives42.Path, { 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" }) }); 2319 2320 // packages/icons/build-module/library/format-indent.js 2321 var import_primitives43 = __toESM(require_primitives()); 2322 var import_jsx_runtime52 = __toESM(require_jsx_runtime()); 2323 var format_indent_default = /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_primitives43.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_primitives43.Path, { 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" }) }); 2324 2325 // packages/icons/build-module/library/format-list-bullets-rtl.js 2326 var import_primitives44 = __toESM(require_primitives()); 2327 var import_jsx_runtime53 = __toESM(require_jsx_runtime()); 2328 var format_list_bullets_rtl_default = /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_primitives44.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_primitives44.Path, { 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" }) }); 2329 2330 // packages/icons/build-module/library/format-list-bullets.js 2331 var import_primitives45 = __toESM(require_primitives()); 2332 var import_jsx_runtime54 = __toESM(require_jsx_runtime()); 2333 var format_list_bullets_default = /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_primitives45.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_primitives45.Path, { 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" }) }); 2334 2335 // packages/icons/build-module/library/format-list-numbered-rtl.js 2336 var import_primitives46 = __toESM(require_primitives()); 2337 var import_jsx_runtime55 = __toESM(require_jsx_runtime()); 2338 var format_list_numbered_rtl_default = /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_primitives46.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_primitives46.Path, { 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" }) }); 2339 2340 // packages/icons/build-module/library/format-list-numbered.js 2341 var import_primitives47 = __toESM(require_primitives()); 2342 var import_jsx_runtime56 = __toESM(require_jsx_runtime()); 2343 var format_list_numbered_default = /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_primitives47.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_primitives47.Path, { 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" }) }); 2344 2345 // packages/icons/build-module/library/format-ltr.js 2346 var import_primitives48 = __toESM(require_primitives()); 2347 var import_jsx_runtime57 = __toESM(require_jsx_runtime()); 2348 var format_ltr_default = /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_primitives48.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_primitives48.Path, { d: "M3 9c0 2.8 2.2 5 5 5v-.2V20h1.5V5.5H12V20h1.5V5.5h3V4H8C5.2 4 3 6.2 3 9Zm15.9-1-1.1 1 2.6 3-2.6 3 1.1 1 3.4-4-3.4-4Z" }) }); 2349 2350 // packages/icons/build-module/library/format-outdent-rtl.js 2351 var import_primitives49 = __toESM(require_primitives()); 2352 var import_jsx_runtime58 = __toESM(require_jsx_runtime()); 2353 var format_outdent_rtl_default = /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_primitives49.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_primitives49.Path, { 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" }) }); 2354 2355 // packages/icons/build-module/library/format-outdent.js 2356 var import_primitives50 = __toESM(require_primitives()); 2357 var import_jsx_runtime59 = __toESM(require_jsx_runtime()); 2358 var format_outdent_default = /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_primitives50.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_primitives50.Path, { 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" }) }); 2359 2360 // packages/icons/build-module/library/fullscreen.js 2361 var import_primitives51 = __toESM(require_primitives()); 2362 var import_jsx_runtime60 = __toESM(require_jsx_runtime()); 2363 var fullscreen_default = /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_primitives51.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_primitives51.Path, { d: "M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z" }) }); 2364 2365 // packages/icons/build-module/library/gallery.js 2366 var import_primitives52 = __toESM(require_primitives()); 2367 var import_jsx_runtime61 = __toESM(require_jsx_runtime()); 2368 var gallery_default = /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_primitives52.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)( 2369 import_primitives52.Path, 2370 { 2371 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", 2372 fillRule: "evenodd", 2373 clipRule: "evenodd" 2374 } 2375 ) }); 2376 2377 // packages/icons/build-module/library/grid.js 2378 var import_primitives53 = __toESM(require_primitives()); 2379 var import_jsx_runtime62 = __toESM(require_jsx_runtime()); 2380 var grid_default = /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_primitives53.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)( 2381 import_primitives53.Path, 2382 { 2383 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", 2384 fillRule: "evenodd", 2385 clipRule: "evenodd" 2386 } 2387 ) }); 2388 2389 // packages/icons/build-module/library/group.js 2390 var import_primitives54 = __toESM(require_primitives()); 2391 var import_jsx_runtime63 = __toESM(require_jsx_runtime()); 2392 var group_default = /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_primitives54.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_primitives54.Path, { 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" }) }); 2393 2394 // packages/icons/build-module/library/header.js 2395 var import_primitives55 = __toESM(require_primitives()); 2396 var import_jsx_runtime64 = __toESM(require_jsx_runtime()); 2397 var header_default = /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_primitives55.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_primitives55.Path, { 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" }) }); 2398 2399 // packages/icons/build-module/library/heading-level-1.js 2400 var import_primitives56 = __toESM(require_primitives()); 2401 var import_jsx_runtime65 = __toESM(require_jsx_runtime()); 2402 var heading_level_1_default = /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_primitives56.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_primitives56.Path, { d: "M17.6 7c-.6.9-1.5 1.7-2.6 2v1h2v7h2V7h-1.4zM11 11H7V7H5v10h2v-4h4v4h2V7h-2v4z" }) }); 2403 2404 // packages/icons/build-module/library/heading-level-2.js 2405 var import_primitives57 = __toESM(require_primitives()); 2406 var import_jsx_runtime66 = __toESM(require_jsx_runtime()); 2407 var heading_level_2_default = /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_primitives57.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_primitives57.Path, { d: "M9 11.1H5v-4H3v10h2v-4h4v4h2v-10H9v4zm8 4c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6v1.5h8v-2H17z" }) }); 2408 2409 // packages/icons/build-module/library/heading-level-3.js 2410 var import_primitives58 = __toESM(require_primitives()); 2411 var import_jsx_runtime67 = __toESM(require_jsx_runtime()); 2412 var heading_level_3_default = /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_primitives58.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_primitives58.Path, { d: "M9 11H5V7H3v10h2v-4h4v4h2V7H9v4zm11.3 1.7c-.4-.4-1-.7-1.6-.8v-.1c.6-.2 1.1-.5 1.5-.9.3-.4.5-.8.5-1.3 0-.4-.1-.8-.3-1.1-.2-.3-.5-.6-.8-.8-.4-.2-.8-.4-1.2-.5-.6-.1-1.1-.2-1.6-.2-.6 0-1.3.1-1.8.3s-1.1.5-1.6.9l1.2 1.4c.4-.2.7-.4 1.1-.6.3-.2.7-.3 1.1-.3.4 0 .8.1 1.1.3.3.2.4.5.4.8 0 .4-.2.7-.6.9-.7.3-1.5.5-2.2.4v1.6c.5 0 1 0 1.5.1.3.1.7.2 1 .3.2.1.4.2.5.4s.1.4.1.6c0 .3-.2.7-.5.8-.4.2-.9.3-1.4.3s-1-.1-1.4-.3c-.4-.2-.8-.4-1.2-.7L13 15.6c.5.4 1 .8 1.6 1 .7.3 1.5.4 2.3.4.6 0 1.1-.1 1.6-.2.4-.1.9-.2 1.3-.5.4-.2.7-.5.9-.9.2-.4.3-.8.3-1.2 0-.6-.3-1.1-.7-1.5z" }) }); 2413 2414 // packages/icons/build-module/library/heading-level-4.js 2415 var import_primitives59 = __toESM(require_primitives()); 2416 var import_jsx_runtime68 = __toESM(require_jsx_runtime()); 2417 var heading_level_4_default = /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_primitives59.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_primitives59.Path, { d: "M20 13V7h-3l-4 6v2h5v2h2v-2h1v-2h-1zm-2 0h-2.8L18 9v4zm-9-2H5V7H3v10h2v-4h4v4h2V7H9v4z" }) }); 2418 2419 // packages/icons/build-module/library/heading-level-5.js 2420 var import_primitives60 = __toESM(require_primitives()); 2421 var import_jsx_runtime69 = __toESM(require_jsx_runtime()); 2422 var heading_level_5_default = /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_primitives60.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_primitives60.Path, { d: "M9 11H5V7H3v10h2v-4h4v4h2V7H9v4zm11.7 1.2c-.2-.3-.5-.7-.8-.9-.3-.3-.7-.5-1.1-.6-.5-.1-.9-.2-1.4-.2-.2 0-.5.1-.7.1-.2.1-.5.1-.7.2l.1-1.9h4.3V7H14l-.3 5 1 .6.5-.2.4-.1c.1-.1.3-.1.4-.1h.5c.5 0 1 .1 1.4.4.4.2.6.7.6 1.1 0 .4-.2.8-.6 1.1-.4.3-.9.4-1.4.4-.4 0-.9-.1-1.3-.3-.4-.2-.7-.4-1.1-.7 0 0-1.1 1.4-1 1.5.5.4 1 .8 1.6 1 .7.3 1.5.4 2.3.4.5 0 1-.1 1.5-.3s.9-.4 1.3-.7c.4-.3.7-.7.9-1.1s.3-.9.3-1.4-.1-1-.3-1.4z" }) }); 2423 2424 // packages/icons/build-module/library/heading-level-6.js 2425 var import_primitives61 = __toESM(require_primitives()); 2426 var import_jsx_runtime70 = __toESM(require_jsx_runtime()); 2427 var heading_level_6_default = /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_primitives61.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_primitives61.Path, { d: "M20.7 12.4c-.2-.3-.4-.6-.7-.9s-.6-.5-1-.6c-.4-.2-.8-.2-1.2-.2-.5 0-.9.1-1.3.3s-.8.5-1.2.8c0-.5 0-.9.2-1.4l.6-.9c.2-.2.5-.4.8-.5.6-.2 1.3-.2 1.9 0 .3.1.6.3.8.5 0 0 1.3-1.3 1.3-1.4-.4-.3-.9-.6-1.4-.8-.6-.2-1.3-.3-2-.3-.6 0-1.1.1-1.7.4-.5.2-1 .5-1.4.9-.4.4-.8 1-1 1.6-.3.7-.4 1.5-.4 2.3s.1 1.5.3 2.1c.2.6.6 1.1 1 1.5.4.4.9.7 1.4.9 1 .3 2 .3 3 0 .4-.1.8-.3 1.2-.6.3-.3.6-.6.8-1 .2-.5.3-.9.3-1.4s-.1-.9-.3-1.3zm-2 2.1c-.1.2-.3.4-.4.5-.1.1-.3.2-.5.2-.2.1-.4.1-.6.1-.2.1-.5 0-.7-.1-.2 0-.3-.2-.5-.3-.1-.2-.3-.4-.4-.6-.2-.3-.3-.7-.3-1 .3-.3.6-.5 1-.7.3-.1.7-.2 1-.2.4 0 .8.1 1.1.3.3.3.4.7.4 1.1 0 .2 0 .5-.1.7zM9 11H5V7H3v10h2v-4h4v4h2V7H9v4z" }) }); 2428 2429 // packages/icons/build-module/library/heading.js 2430 var import_primitives62 = __toESM(require_primitives()); 2431 var import_jsx_runtime71 = __toESM(require_jsx_runtime()); 2432 var heading_default = /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_primitives62.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_primitives62.Path, { d: "M6 5V18.5911L12 13.8473L18 18.5911V5H6Z" }) }); 2433 2434 // packages/icons/build-module/library/home.js 2435 var import_primitives63 = __toESM(require_primitives()); 2436 var import_jsx_runtime72 = __toESM(require_jsx_runtime()); 2437 var home_default = /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_primitives63.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_primitives63.Path, { d: "M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z" }) }); 2438 2439 // packages/icons/build-module/library/html.js 2440 var import_primitives64 = __toESM(require_primitives()); 2441 var import_jsx_runtime73 = __toESM(require_jsx_runtime()); 2442 var html_default = /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_primitives64.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_primitives64.Path, { 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" }) }); 2443 2444 // packages/icons/build-module/library/image.js 2445 var import_primitives65 = __toESM(require_primitives()); 2446 var import_jsx_runtime74 = __toESM(require_jsx_runtime()); 2447 var image_default = /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_primitives65.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_primitives65.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-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" }) }); 2448 2449 // packages/icons/build-module/library/keyboard-return.js 2450 var import_primitives66 = __toESM(require_primitives()); 2451 var import_jsx_runtime75 = __toESM(require_jsx_runtime()); 2452 var keyboard_return_default = /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_primitives66.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_primitives66.Path, { 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" }) }); 2453 2454 // packages/icons/build-module/library/layout.js 2455 var import_primitives67 = __toESM(require_primitives()); 2456 var import_jsx_runtime76 = __toESM(require_jsx_runtime()); 2457 var layout_default = /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_primitives67.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_primitives67.Path, { d: "M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z" }) }); 2458 2459 // packages/icons/build-module/library/link-off.js 2460 var import_primitives68 = __toESM(require_primitives()); 2461 var import_jsx_runtime77 = __toESM(require_jsx_runtime()); 2462 var link_off_default = /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_primitives68.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_primitives68.Path, { d: "M17.031 4.703 15.576 4l-1.56 3H14v.03l-2.324 4.47H9.5V13h1.396l-1.502 2.889h-.95a3.694 3.694 0 0 1 0-7.389H10V7H8.444a5.194 5.194 0 1 0 0 10.389h.17L7.5 19.53l1.416.719L15.049 8.5h.507a3.694 3.694 0 0 1 0 7.39H14v1.5h1.556a5.194 5.194 0 0 0 .273-10.383l1.202-2.304Z" }) }); 2463 2464 // packages/icons/build-module/library/link.js 2465 var import_primitives69 = __toESM(require_primitives()); 2466 var import_jsx_runtime78 = __toESM(require_jsx_runtime()); 2467 var link_default = /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_primitives69.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_primitives69.Path, { d: "M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z" }) }); 2468 2469 // packages/icons/build-module/library/list-item.js 2470 var import_primitives70 = __toESM(require_primitives()); 2471 var import_jsx_runtime79 = __toESM(require_jsx_runtime()); 2472 var list_item_default = /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_primitives70.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_primitives70.Path, { 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" }) }); 2473 2474 // packages/icons/build-module/library/list.js 2475 var import_primitives71 = __toESM(require_primitives()); 2476 var import_jsx_runtime80 = __toESM(require_jsx_runtime()); 2477 var list_default = /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_primitives71.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_primitives71.Path, { 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" }) }); 2478 2479 // packages/icons/build-module/library/login.js 2480 var import_primitives72 = __toESM(require_primitives()); 2481 var import_jsx_runtime81 = __toESM(require_jsx_runtime()); 2482 var login_default = /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_primitives72.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_primitives72.Path, { 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" }) }); 2483 2484 // packages/icons/build-module/library/loop.js 2485 var import_primitives73 = __toESM(require_primitives()); 2486 var import_jsx_runtime82 = __toESM(require_jsx_runtime()); 2487 var loop_default = /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_primitives73.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_primitives73.Path, { 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" }) }); 2488 2489 // packages/icons/build-module/library/map-marker.js 2490 var import_primitives74 = __toESM(require_primitives()); 2491 var import_jsx_runtime83 = __toESM(require_jsx_runtime()); 2492 var map_marker_default = /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_primitives74.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_primitives74.Path, { 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" }) }); 2493 2494 // packages/icons/build-module/library/math.js 2495 var import_primitives75 = __toESM(require_primitives()); 2496 var import_jsx_runtime84 = __toESM(require_jsx_runtime()); 2497 var math_default = /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_primitives75.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_primitives75.Path, { d: "M11.2 6.8c-.7 0-1.4.5-1.6 1.1l-2.8 7.5-1.2-1.8c-.1-.2-.4-.3-.6-.3H3v1.5h1.6l1.2 1.8c.6.9 1.9.7 2.2-.3l2.9-7.9s.1-.2.2-.2h7.8V6.7h-7.8Zm5.3 3.4-1.9 1.9-1.9-1.9-1.1 1.1 1.9 1.9-1.9 1.9 1.1 1.1 1.9-1.9 1.9 1.9 1.1-1.1-1.9-1.9 1.9-1.9-1.1-1.1Z" }) }); 2498 2499 // packages/icons/build-module/library/media-and-text.js 2500 var import_primitives76 = __toESM(require_primitives()); 2501 var import_jsx_runtime85 = __toESM(require_jsx_runtime()); 2502 var media_and_text_default = /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_primitives76.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_primitives76.Path, { d: "M3 6v11.5h8V6H3Zm11 3h7V7.5h-7V9Zm7 3.5h-7V11h7v1.5ZM14 16h7v-1.5h-7V16Z" }) }); 2503 2504 // packages/icons/build-module/library/media.js 2505 var import_primitives77 = __toESM(require_primitives()); 2506 var import_jsx_runtime86 = __toESM(require_jsx_runtime()); 2507 var media_default = /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(import_primitives77.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [ 2508 /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_primitives77.Path, { d: "m7 6.5 4 2.5-4 2.5z" }), 2509 /* @__PURE__ */ (0, import_jsx_runtime86.jsx)( 2510 import_primitives77.Path, 2511 { 2512 fillRule: "evenodd", 2513 clipRule: "evenodd", 2514 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" 2515 } 2516 ) 2517 ] }); 2518 2519 // packages/icons/build-module/library/menu.js 2520 var import_primitives78 = __toESM(require_primitives()); 2521 var import_jsx_runtime87 = __toESM(require_jsx_runtime()); 2522 var menu_default = /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_primitives78.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_primitives78.Path, { d: "M5 5v1.5h14V5H5zm0 7.8h14v-1.5H5v1.5zM5 19h14v-1.5H5V19z" }) }); 2523 2524 // packages/icons/build-module/library/more-vertical.js 2525 var import_primitives79 = __toESM(require_primitives()); 2526 var import_jsx_runtime88 = __toESM(require_jsx_runtime()); 2527 var more_vertical_default = /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_primitives79.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_primitives79.Path, { d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z" }) }); 2528 2529 // packages/icons/build-module/library/more.js 2530 var import_primitives80 = __toESM(require_primitives()); 2531 var import_jsx_runtime89 = __toESM(require_jsx_runtime()); 2532 var more_default = /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_primitives80.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_primitives80.Path, { d: "M4 9v1.5h16V9H4zm12 5.5h4V13h-4v1.5zm-6 0h4V13h-4v1.5zm-6 0h4V13H4v1.5z" }) }); 2533 2534 // packages/icons/build-module/library/navigation.js 2535 var import_primitives81 = __toESM(require_primitives()); 2536 var import_jsx_runtime90 = __toESM(require_jsx_runtime()); 2537 var navigation_default = /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_primitives81.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_primitives81.Path, { 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" }) }); 2538 2539 // packages/icons/build-module/library/next.js 2540 var import_primitives82 = __toESM(require_primitives()); 2541 var import_jsx_runtime91 = __toESM(require_jsx_runtime()); 2542 var next_default = /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_primitives82.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_primitives82.Path, { 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" }) }); 2543 2544 // packages/icons/build-module/library/overlay-text.js 2545 var import_primitives83 = __toESM(require_primitives()); 2546 var import_jsx_runtime92 = __toESM(require_jsx_runtime()); 2547 var overlay_text_default = /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_primitives83.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_primitives83.Path, { 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" }) }); 2548 2549 // packages/icons/build-module/library/page-break.js 2550 var import_primitives84 = __toESM(require_primitives()); 2551 var import_jsx_runtime93 = __toESM(require_jsx_runtime()); 2552 var page_break_default = /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_primitives84.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_primitives84.Path, { 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" }) }); 2553 2554 // packages/icons/build-module/library/page.js 2555 var import_primitives85 = __toESM(require_primitives()); 2556 var import_jsx_runtime94 = __toESM(require_jsx_runtime()); 2557 var page_default = /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(import_primitives85.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [ 2558 /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_primitives85.Path, { d: "M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z" }), 2559 /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_primitives85.Path, { 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" }) 2560 ] }); 2561 2562 // packages/icons/build-module/library/pages.js 2563 var import_primitives86 = __toESM(require_primitives()); 2564 var import_jsx_runtime95 = __toESM(require_jsx_runtime()); 2565 var pages_default = /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(import_primitives86.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [ 2566 /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_primitives86.Path, { d: "M14.5 5.5h-7V7h7V5.5ZM7.5 9h7v1.5h-7V9Zm7 3.5h-7V14h7v-1.5Z" }), 2567 /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_primitives86.Path, { 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" }), 2568 /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_primitives86.Path, { d: "M20 8v11c0 .69-.31 1-.999 1H6v1.5h13.001c1.52 0 2.499-.982 2.499-2.5V8H20Z" }) 2569 ] }); 2570 2571 // packages/icons/build-module/library/paragraph.js 2572 var import_primitives87 = __toESM(require_primitives()); 2573 var import_jsx_runtime96 = __toESM(require_jsx_runtime()); 2574 var paragraph_default = /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_primitives87.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_primitives87.Path, { 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" }) }); 2575 2576 // packages/icons/build-module/library/pencil.js 2577 var import_primitives88 = __toESM(require_primitives()); 2578 var import_jsx_runtime97 = __toESM(require_jsx_runtime()); 2579 var pencil_default = /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_primitives88.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_primitives88.Path, { d: "m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z" }) }); 2580 2581 // packages/icons/build-module/library/pin.js 2582 var import_primitives89 = __toESM(require_primitives()); 2583 var import_jsx_runtime98 = __toESM(require_jsx_runtime()); 2584 var pin_default = /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_primitives89.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_primitives89.Path, { d: "m21.5 9.1-6.6-6.6-4.2 5.6c-1.2-.1-2.4.1-3.6.7-.1 0-.1.1-.2.1-.5.3-.9.6-1.2.9l3.7 3.7-5.7 5.7v1.1h1.1l5.7-5.7 3.7 3.7c.4-.4.7-.8.9-1.2.1-.1.1-.2.2-.3.6-1.1.8-2.4.6-3.6l5.6-4.1zm-7.3 3.5.1.9c.1.9 0 1.8-.4 2.6l-6-6c.8-.4 1.7-.5 2.6-.4l.9.1L15 4.9 19.1 9l-4.9 3.6z" }) }); 2585 2586 // packages/icons/build-module/library/plugins.js 2587 var import_primitives90 = __toESM(require_primitives()); 2588 var import_jsx_runtime99 = __toESM(require_jsx_runtime()); 2589 var plugins_default = /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_primitives90.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_primitives90.Path, { 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" }) }); 2590 2591 // packages/icons/build-module/library/plus.js 2592 var import_primitives91 = __toESM(require_primitives()); 2593 var import_jsx_runtime100 = __toESM(require_jsx_runtime()); 2594 var plus_default = /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_primitives91.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_primitives91.Path, { d: "M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z" }) }); 2595 2596 // packages/icons/build-module/library/position-center.js 2597 var import_primitives92 = __toESM(require_primitives()); 2598 var import_jsx_runtime101 = __toESM(require_jsx_runtime()); 2599 var position_center_default = /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_primitives92.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_primitives92.Path, { d: "M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM7 9h10v6H7V9Z" }) }); 2600 2601 // packages/icons/build-module/library/position-left.js 2602 var import_primitives93 = __toESM(require_primitives()); 2603 var import_jsx_runtime102 = __toESM(require_jsx_runtime()); 2604 var position_left_default = /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_primitives93.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_primitives93.Path, { d: "M5 5.5h8V4H5v1.5ZM5 20h8v-1.5H5V20ZM19 9H5v6h14V9Z" }) }); 2605 2606 // packages/icons/build-module/library/position-right.js 2607 var import_primitives94 = __toESM(require_primitives()); 2608 var import_jsx_runtime103 = __toESM(require_jsx_runtime()); 2609 var position_right_default = /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(import_primitives94.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(import_primitives94.Path, { d: "M19 5.5h-8V4h8v1.5ZM19 20h-8v-1.5h8V20ZM5 9h14v6H5V9Z" }) }); 2610 2611 // packages/icons/build-module/library/post-author.js 2612 var import_primitives95 = __toESM(require_primitives()); 2613 var import_jsx_runtime104 = __toESM(require_jsx_runtime()); 2614 var post_author_default = /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_primitives95.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)( 2615 import_primitives95.Path, 2616 { 2617 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", 2618 fillRule: "evenodd", 2619 clipRule: "evenodd" 2620 } 2621 ) }); 2622 2623 // packages/icons/build-module/library/post-categories.js 2624 var import_primitives96 = __toESM(require_primitives()); 2625 var import_jsx_runtime105 = __toESM(require_jsx_runtime()); 2626 var post_categories_default = /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_primitives96.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)( 2627 import_primitives96.Path, 2628 { 2629 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", 2630 fillRule: "evenodd", 2631 clipRule: "evenodd" 2632 } 2633 ) }); 2634 2635 // packages/icons/build-module/library/post-comments-count.js 2636 var import_primitives97 = __toESM(require_primitives()); 2637 var import_jsx_runtime106 = __toESM(require_jsx_runtime()); 2638 var post_comments_count_default = /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_primitives97.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_primitives97.Path, { 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" }) }); 2639 2640 // packages/icons/build-module/library/post-comments-form.js 2641 var import_primitives98 = __toESM(require_primitives()); 2642 var import_jsx_runtime107 = __toESM(require_jsx_runtime()); 2643 var post_comments_form_default = /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_primitives98.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_primitives98.Path, { 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" }) }); 2644 2645 // packages/icons/build-module/library/post-comments.js 2646 var import_primitives99 = __toESM(require_primitives()); 2647 var import_jsx_runtime108 = __toESM(require_jsx_runtime()); 2648 var post_comments_default = /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_primitives99.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_primitives99.Path, { d: "M14 10.1V4c0-.6-.4-1-1-1H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1zm-1.5-.5H6.7l-1.2 1.2V4.5h7v5.1zM19 12h-8c-.6 0-1 .4-1 1v6.1c0 .6.4 1 1 1h5.7l1.8 1.8c.1.2.4.3.6.3.1 0 .2 0 .3-.1.4-.1.6-.5.6-.8V13c0-.6-.4-1-1-1zm-.5 7.8l-1.2-1.2h-5.8v-5.1h7v6.3z" }) }); 2649 2650 // packages/icons/build-module/library/post-content.js 2651 var import_primitives100 = __toESM(require_primitives()); 2652 var import_jsx_runtime109 = __toESM(require_jsx_runtime()); 2653 var post_content_default = /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_primitives100.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_primitives100.Path, { d: "M4 6h12V4.5H4V6Zm16 4.5H4V9h16v1.5ZM4 15h16v-1.5H4V15Zm0 4.5h16V18H4v1.5Z" }) }); 2654 2655 // packages/icons/build-module/library/post-date.js 2656 var import_primitives101 = __toESM(require_primitives()); 2657 var import_jsx_runtime110 = __toESM(require_jsx_runtime()); 2658 var post_date_default = /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)(import_primitives101.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [ 2659 /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_primitives101.Path, { d: "M11.696 13.972c.356-.546.599-.958.728-1.235a1.79 1.79 0 00.203-.783c0-.264-.077-.47-.23-.618-.148-.153-.354-.23-.618-.23-.295 0-.569.07-.82.212a3.413 3.413 0 00-.738.571l-.147-1.188c.289-.234.59-.41.903-.526.313-.117.66-.175 1.041-.175.375 0 .695.08.959.24.264.153.46.362.59.626.135.265.203.556.203.876 0 .362-.08.734-.24 1.115-.154.381-.427.87-.82 1.466l-.756 1.152H14v1.106h-4l1.696-2.609z" }), 2660 /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_primitives101.Path, { d: "M19.5 7h-15v12a.5.5 0 00.5.5h14a.5.5 0 00.5-.5V7zM3 7V5a2 2 0 012-2h14a2 2 0 012 2v14a2 2 0 01-2 2H5a2 2 0 01-2-2V7z" }) 2661 ] }); 2662 2663 // packages/icons/build-module/library/post-excerpt.js 2664 var import_primitives102 = __toESM(require_primitives()); 2665 var import_jsx_runtime111 = __toESM(require_jsx_runtime()); 2666 var post_excerpt_default = /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_primitives102.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_primitives102.Path, { 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" }) }); 2667 2668 // packages/icons/build-module/library/post-featured-image.js 2669 var import_primitives103 = __toESM(require_primitives()); 2670 var import_jsx_runtime112 = __toESM(require_jsx_runtime()); 2671 var post_featured_image_default = /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_primitives103.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_primitives103.Path, { 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" }) }); 2672 2673 // packages/icons/build-module/library/post-list.js 2674 var import_primitives104 = __toESM(require_primitives()); 2675 var import_jsx_runtime113 = __toESM(require_jsx_runtime()); 2676 var post_list_default = /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_primitives104.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_primitives104.Path, { 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" }) }); 2677 2678 // packages/icons/build-module/library/post-terms.js 2679 var import_primitives105 = __toESM(require_primitives()); 2680 var import_jsx_runtime114 = __toESM(require_jsx_runtime()); 2681 var post_terms_default = /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_primitives105.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_primitives105.Path, { 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" }) }); 2682 2683 // packages/icons/build-module/library/preformatted.js 2684 var import_primitives106 = __toESM(require_primitives()); 2685 var import_jsx_runtime115 = __toESM(require_jsx_runtime()); 2686 var preformatted_default = /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_primitives106.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_primitives106.Path, { 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" }) }); 2687 2688 // packages/icons/build-module/library/previous.js 2689 var import_primitives107 = __toESM(require_primitives()); 2690 var import_jsx_runtime116 = __toESM(require_jsx_runtime()); 2691 var previous_default = /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_primitives107.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_primitives107.Path, { 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" }) }); 2692 2693 // packages/icons/build-module/library/pull-left.js 2694 var import_primitives108 = __toESM(require_primitives()); 2695 var import_jsx_runtime117 = __toESM(require_jsx_runtime()); 2696 var pull_left_default = /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(import_primitives108.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(import_primitives108.Path, { d: "M4 18h6V6H4v12zm9-9.5V10h7V8.5h-7zm0 7h7V14h-7v1.5z" }) }); 2697 2698 // packages/icons/build-module/library/pull-right.js 2699 var import_primitives109 = __toESM(require_primitives()); 2700 var import_jsx_runtime118 = __toESM(require_jsx_runtime()); 2701 var pull_right_default = /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_primitives109.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_primitives109.Path, { d: "M14 6v12h6V6h-6zM4 10h7V8.5H4V10zm0 5.5h7V14H4v1.5z" }) }); 2702 2703 // packages/icons/build-module/library/pullquote.js 2704 var import_primitives110 = __toESM(require_primitives()); 2705 var import_jsx_runtime119 = __toESM(require_jsx_runtime()); 2706 var pullquote_default = /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_primitives110.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_primitives110.Path, { 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" }) }); 2707 2708 // packages/icons/build-module/library/query-pagination-next.js 2709 var import_primitives111 = __toESM(require_primitives()); 2710 var import_jsx_runtime120 = __toESM(require_jsx_runtime()); 2711 var query_pagination_next_default = /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_primitives111.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_primitives111.Path, { d: "M5 13.5h3v-3H5v3zm5 0h3v-3h-3v3zM17 9l-1 1 2 2-2 2 1 1 3-3-3-3z" }) }); 2712 2713 // packages/icons/build-module/library/query-pagination-numbers.js 2714 var import_primitives112 = __toESM(require_primitives()); 2715 var import_jsx_runtime121 = __toESM(require_jsx_runtime()); 2716 var query_pagination_numbers_default = /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_primitives112.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_primitives112.Path, { d: "M4 13.5h6v-3H4v3zm8.2-2.5.8-.3V14h1V9.3l-2.2.7.4 1zm7.1-1.2c-.5-.6-1.2-.5-1.7-.4-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5h2.7v-1h-.9c.3-.6.8-1.4.9-2.1 0-.3-.1-.8-.3-1.1z" }) }); 2717 2718 // packages/icons/build-module/library/query-pagination-previous.js 2719 var import_primitives113 = __toESM(require_primitives()); 2720 var import_jsx_runtime122 = __toESM(require_jsx_runtime()); 2721 var query_pagination_previous_default = /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_primitives113.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_primitives113.Path, { d: "M16 10.5v3h3v-3h-3zm-5 3h3v-3h-3v3zM7 9l-3 3 3 3 1-1-2-2 2-2-1-1z" }) }); 2722 2723 // packages/icons/build-module/library/query-pagination.js 2724 var import_primitives114 = __toESM(require_primitives()); 2725 var import_jsx_runtime123 = __toESM(require_jsx_runtime()); 2726 var query_pagination_default = /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_primitives114.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_primitives114.Path, { d: "M4 13.5h6v-3H4v3zm8 0h3v-3h-3v3zm5-3v3h3v-3h-3z" }) }); 2727 2728 // packages/icons/build-module/library/quote.js 2729 var import_primitives115 = __toESM(require_primitives()); 2730 var import_jsx_runtime124 = __toESM(require_jsx_runtime()); 2731 var quote_default = /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_primitives115.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_primitives115.Path, { 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" }) }); 2732 2733 // packages/icons/build-module/library/remove-submenu.js 2734 var import_primitives116 = __toESM(require_primitives()); 2735 var import_jsx_runtime125 = __toESM(require_jsx_runtime()); 2736 var remove_submenu_default = /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_primitives116.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)( 2737 import_primitives116.Path, 2738 { 2739 fillRule: "evenodd", 2740 clipRule: "evenodd", 2741 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" 2742 } 2743 ) }); 2744 2745 // packages/icons/build-module/library/resize-corner-n-e.js 2746 var import_primitives117 = __toESM(require_primitives()); 2747 var import_jsx_runtime126 = __toESM(require_jsx_runtime()); 2748 var resize_corner_n_e_default = /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_primitives117.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_primitives117.Path, { d: "M7 18h4.5v1.5h-7v-7H6V17L17 6h-4.5V4.5h7v7H18V7L7 18Z" }) }); 2749 2750 // packages/icons/build-module/library/row.js 2751 var import_primitives118 = __toESM(require_primitives()); 2752 var import_jsx_runtime127 = __toESM(require_jsx_runtime()); 2753 var row_default = /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_primitives118.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_primitives118.Path, { 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" }) }); 2754 2755 // packages/icons/build-module/library/rss.js 2756 var import_primitives119 = __toESM(require_primitives()); 2757 var import_jsx_runtime128 = __toESM(require_jsx_runtime()); 2758 var rss_default = /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_primitives119.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_primitives119.Path, { 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" }) }); 2759 2760 // packages/icons/build-module/library/search.js 2761 var import_primitives120 = __toESM(require_primitives()); 2762 var import_jsx_runtime129 = __toESM(require_jsx_runtime()); 2763 var search_default = /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(import_primitives120.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(import_primitives120.Path, { 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" }) }); 2764 2765 // packages/icons/build-module/library/separator.js 2766 var import_primitives121 = __toESM(require_primitives()); 2767 var import_jsx_runtime130 = __toESM(require_jsx_runtime()); 2768 var separator_default = /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_primitives121.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_primitives121.Path, { d: "M4.5 12.5v4H3V7h1.5v3.987h15V7H21v9.5h-1.5v-4h-15Z" }) }); 2769 2770 // packages/icons/build-module/library/share.js 2771 var import_primitives122 = __toESM(require_primitives()); 2772 var import_jsx_runtime131 = __toESM(require_jsx_runtime()); 2773 var share_default = /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_primitives122.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_primitives122.Path, { 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" }) }); 2774 2775 // packages/icons/build-module/library/shortcode.js 2776 var import_primitives123 = __toESM(require_primitives()); 2777 var import_jsx_runtime132 = __toESM(require_jsx_runtime()); 2778 var shortcode_default = /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_primitives123.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_primitives123.Path, { 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" }) }); 2779 2780 // packages/icons/build-module/library/sidebar.js 2781 var import_primitives124 = __toESM(require_primitives()); 2782 var import_jsx_runtime133 = __toESM(require_jsx_runtime()); 2783 var sidebar_default = /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_primitives124.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_primitives124.Path, { d: "M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z" }) }); 2784 2785 // packages/icons/build-module/library/site-logo.js 2786 var import_primitives125 = __toESM(require_primitives()); 2787 var import_jsx_runtime134 = __toESM(require_jsx_runtime()); 2788 var site_logo_default = /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_primitives125.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_primitives125.Path, { 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 1.5c3.4 0 6.2 2.7 6.5 6l-1.2-.6-.8-.4c-.1 0-.2 0-.3-.1H16c-.1-.2-.4-.2-.7 0l-2.9 2.1L9 11.3h-.7L5.5 13v-1.1c0-3.6 2.9-6.5 6.5-6.5Zm0 13c-2.7 0-5-1.7-6-4l2.8-1.7 3.5 1.2h.4s.2 0 .4-.2l2.9-2.1.4.2c.6.3 1.4.7 2.1 1.1-.5 3.1-3.2 5.4-6.4 5.4Z" }) }); 2789 2790 // packages/icons/build-module/library/square.js 2791 var import_primitives126 = __toESM(require_primitives()); 2792 var import_jsx_runtime135 = __toESM(require_jsx_runtime()); 2793 var square_default = /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_primitives126.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)( 2794 import_primitives126.Path, 2795 { 2796 fill: "none", 2797 d: "M5.75 12.75V18.25H11.25M12.75 5.75H18.25V11.25", 2798 stroke: "currentColor", 2799 strokeWidth: "1.5", 2800 strokeLinecap: "square" 2801 } 2802 ) }); 2803 2804 // packages/icons/build-module/library/stack.js 2805 var import_primitives127 = __toESM(require_primitives()); 2806 var import_jsx_runtime136 = __toESM(require_jsx_runtime()); 2807 var stack_default = /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_primitives127.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_primitives127.Path, { 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" }) }); 2808 2809 // packages/icons/build-module/library/symbol-filled.js 2810 var import_primitives128 = __toESM(require_primitives()); 2811 var import_jsx_runtime137 = __toESM(require_jsx_runtime()); 2812 var symbol_filled_default = /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_primitives128.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_primitives128.Path, { 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" }) }); 2813 2814 // packages/icons/build-module/library/symbol.js 2815 var import_primitives129 = __toESM(require_primitives()); 2816 var import_jsx_runtime138 = __toESM(require_jsx_runtime()); 2817 var symbol_default = /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_primitives129.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_primitives129.Path, { 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" }) }); 2818 2819 // packages/icons/build-module/library/table-column-after.js 2820 var import_primitives130 = __toESM(require_primitives()); 2821 var import_jsx_runtime139 = __toESM(require_jsx_runtime()); 2822 var table_column_after_default = /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(import_primitives130.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(import_primitives130.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14.2c.1.9.9 1.7 1.8 1.8H19.2c1-.1 1.8-1 1.8-2V5c0-1.1-.9-2-2-2ZM8.5 19.5H5c-.3 0-.5-.2-.5-.5v-3.5h4v4Zm0-5.5h-4v-4h4v4Zm0-5.5h-4V5c0-.3.2-.5.5-.5h3.5v4Zm11 10.5c0 .3-.2.5-.5.5h-9v-15h9c.3 0 .5.2.5.5v14Zm-4-10.8H14v3h-3v1.5h3v3h1.5v-3h3v-1.5h-3v-3Z" }) }); 2823 2824 // packages/icons/build-module/library/table-column-before.js 2825 var import_primitives131 = __toESM(require_primitives()); 2826 var import_jsx_runtime140 = __toESM(require_jsx_runtime()); 2827 var table_column_before_default = /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(import_primitives131.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(import_primitives131.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1 .8 1.9 1.8 2H19.2c.9-.1 1.7-.9 1.8-1.8V5c0-1.1-.9-2-2-2Zm-5 16.5H5c-.3 0-.5-.2-.5-.5V5c0-.3.2-.5.5-.5h9v15Zm5.5-.5c0 .3-.2.5-.5.5h-3.5v-4h4V19Zm0-5h-4v-4h4v4Zm0-5.5h-4v-4H19c.3 0 .5.2.5.5v3.5Zm-11 7.3H10v-3h3v-1.5h-3v-3H8.5v3h-3v1.5h3v3Z" }) }); 2828 2829 // packages/icons/build-module/library/table-column-delete.js 2830 var import_primitives132 = __toESM(require_primitives()); 2831 var import_jsx_runtime141 = __toESM(require_jsx_runtime()); 2832 var table_column_delete_default = /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(import_primitives132.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(import_primitives132.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14.2c.1.9.9 1.7 1.8 1.8H19.2c1-.1 1.8-1 1.8-2V5c0-1.1-.9-2-2-2ZM8.5 19.5H5c-.3 0-.5-.2-.5-.5V5c0-.3.2-.5.5-.5h3.5v15Zm11-.5c0 .3-.2.5-.5.5h-9v-15h9c.3 0 .5.2.5.5v14ZM16.9 8.8l-2.1 2.1-2.1-2.1-1.1 1.1 2.1 2.1-2.1 2.1 1.1 1.1 2.1-2.1 2.1 2.1 1.1-1.1-2.1-2.1L18 9.9l-1.1-1.1Z" }) }); 2833 2834 // packages/icons/build-module/library/table-of-contents.js 2835 var import_primitives133 = __toESM(require_primitives()); 2836 var import_jsx_runtime142 = __toESM(require_jsx_runtime()); 2837 var table_of_contents_default = /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_primitives133.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [ 2838 /* @__PURE__ */ (0, import_jsx_runtime142.jsx)( 2839 import_primitives133.Path, 2840 { 2841 fillRule: "evenodd", 2842 clipRule: "evenodd", 2843 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" 2844 } 2845 ), 2846 /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_primitives133.Path, { 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" }) 2847 ] }); 2848 2849 // packages/icons/build-module/library/table-row-after.js 2850 var import_primitives134 = __toESM(require_primitives()); 2851 var import_jsx_runtime143 = __toESM(require_jsx_runtime()); 2852 var table_row_after_default = /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(import_primitives134.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(import_primitives134.Path, { d: "M19 3H4.8c-.9.1-1.7.9-1.8 1.8V19.2c.1 1 1 1.8 2 1.8h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2Zm-9 1.5h4v4h-4v-4ZM4.5 5c0-.3.2-.5.5-.5h3.5v4h-4V5Zm15 14c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-9h15v9Zm0-10.5h-4v-4H19c.3 0 .5.2.5.5v3.5Zm-8.3 10h1.5v-3h3V14h-3v-3h-1.5v3h-3v1.5h3v3Z" }) }); 2853 2854 // packages/icons/build-module/library/table-row-before.js 2855 var import_primitives135 = __toESM(require_primitives()); 2856 var import_jsx_runtime144 = __toESM(require_jsx_runtime()); 2857 var table_row_before_default = /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(import_primitives135.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(import_primitives135.Path, { d: "M21 5c0-1.1-.9-2-2-2H5c-1 0-1.9.8-2 1.8V19.2c.1.9.9 1.7 1.8 1.8H19c1.1 0 2-.9 2-2V5ZM4.5 14V5c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v9h-15Zm4 5.5H5c-.3 0-.5-.2-.5-.5v-3.5h4v4Zm5.5 0h-4v-4h4v4Zm5.5-.5c0 .3-.2.5-.5.5h-3.5v-4h4V19ZM11.2 10h-3V8.5h3v-3h1.5v3h3V10h-3v3h-1.5v-3Z" }) }); 2858 2859 // packages/icons/build-module/library/table-row-delete.js 2860 var import_primitives136 = __toESM(require_primitives()); 2861 var import_jsx_runtime145 = __toESM(require_jsx_runtime()); 2862 var table_row_delete_default = /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(import_primitives136.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(import_primitives136.Path, { d: "M19 3H4.8c-.9.1-1.7.9-1.8 1.8V19.2c.1 1 1 1.8 2 1.8h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2Zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-9h15v9Zm0-10.5h-15V5c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v3.5Zm-9.6 9.4 2.1-2.1 2.1 2.1 1.1-1.1-2.1-2.1 2.1-2.1-1.1-1.1-2.1 2.1-2.1-2.1-1.1 1.1 2.1 2.1-2.1 2.1 1.1 1.1Z" }) }); 2863 2864 // packages/icons/build-module/library/table.js 2865 var import_primitives137 = __toESM(require_primitives()); 2866 var import_jsx_runtime146 = __toESM(require_jsx_runtime()); 2867 var table_default = /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(import_primitives137.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(import_primitives137.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2Zm.5 2v6.2h-6.8V4.4h6.2c.3 0 .5.2.5.5ZM5 4.5h6.2v6.8H4.4V5.1c0-.3.2-.5.5-.5ZM4.5 19v-6.2h6.8v6.8H5.1c-.3 0-.5-.2-.5-.5Zm14.5.5h-6.2v-6.8h6.8v6.2c0 .3-.2.5-.5.5Z" }) }); 2868 2869 // packages/icons/build-module/library/tag.js 2870 var import_primitives138 = __toESM(require_primitives()); 2871 var import_jsx_runtime147 = __toESM(require_jsx_runtime()); 2872 var tag_default = /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(import_primitives138.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(import_primitives138.Path, { 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" }) }); 2873 2874 // packages/icons/build-module/library/term-count.js 2875 var import_primitives139 = __toESM(require_primitives()); 2876 var import_jsx_runtime148 = __toESM(require_jsx_runtime()); 2877 var term_count_default = /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)(import_primitives139.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [ 2878 /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(import_primitives139.Path, { d: "M 12.841306,16.677917 12.001264,12.71529 Q 11.835801,11.930402 11.695793,11.417042 11.560029,10.89944 11.398809,10.568514 11.237588,10.237588 11,10 10.635133,9.6351329 10.219354,9.6351329 9.8078183,9.6308902 9.4387086,10 8.9932313,10.445477 8.8574668,11.022476 8.7259449,11.595233 8.7259449,12.155262 L 7.4955791,11.196425 Q 7.5719467,10.509117 7.8307477,9.9109045 8.0937915,9.3084495 8.6410921,8.7611489 9.1799075,8.2223335 9.7569066,8.086569 q 0.5812414,-0.1400071 1.1242994,0.046669 0.543058,0.1866762 0.975808,0.6194255 0.335168,0.3351686 0.581242,0.767918 0.24183,0.4285067 0.436992,1.0564174 0.195161,0.619426 0.381837,1.527351 l 0.364867,1.756453 1.883733,-1.883732 1.018234,1.018233 z" }), 2879 /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(import_primitives139.Path, { d: "M12.574 4a.75.75 0 0 1 .53.22l6.723 6.724a2.315 2.315 0 0 1 0 3.264l-.532-.528.531.53-5.61 5.611a2.31 2.31 0 0 1-3.276.001l-6.72-6.716a.75.75 0 0 1-.22-.53V4.75A.75.75 0 0 1 4.75 4h7.824ZM5.5 5.5v6.764l6.501 6.497a.817.817 0 0 0 .889.178.816.816 0 0 0 .264-.178l5.61-5.61a.816.816 0 0 0-.001-1.149l-6.5-6.502H5.5Z" }) 2880 ] }); 2881 2882 // packages/icons/build-module/library/term-description.js 2883 var import_primitives140 = __toESM(require_primitives()); 2884 var import_jsx_runtime149 = __toESM(require_jsx_runtime()); 2885 var term_description_default = /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(import_primitives140.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(import_primitives140.Path, { 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" }) }); 2886 2887 // packages/icons/build-module/library/term-name.js 2888 var import_primitives141 = __toESM(require_primitives()); 2889 var import_jsx_runtime150 = __toESM(require_jsx_runtime()); 2890 var term_name_default = /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)(import_primitives141.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [ 2891 /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(import_primitives141.Path, { d: "m14.95 13.889-1.061 1.061-5.552-5.553 1.06-1.06 5.552 5.552Z" }), 2892 /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(import_primitives141.Path, { d: "M12.574 4a.75.75 0 0 1 .53.22l6.723 6.724a2.315 2.315 0 0 1 0 3.264l-.532-.528.531.53-5.61 5.611a2.31 2.31 0 0 1-3.276.001l-6.72-6.716a.75.75 0 0 1-.22-.53V4.75A.75.75 0 0 1 4.75 4h7.824ZM5.5 5.5v6.764l6.501 6.497a.817.817 0 0 0 .889.178.816.816 0 0 0 .264-.178l5.61-5.61a.816.816 0 0 0-.001-1.149l-6.5-6.502H5.5Z" }) 2893 ] }); 2894 2895 // packages/icons/build-module/library/time-to-read.js 2896 var import_primitives142 = __toESM(require_primitives()); 2897 var import_jsx_runtime151 = __toESM(require_jsx_runtime()); 2898 var time_to_read_default = /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(import_primitives142.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(import_primitives142.Path, { 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" }) }); 2899 2900 // packages/icons/build-module/library/title.js 2901 var import_primitives143 = __toESM(require_primitives()); 2902 var import_jsx_runtime152 = __toESM(require_jsx_runtime()); 2903 var title_default = /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(import_primitives143.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(import_primitives143.Path, { d: "m4 5.5h2v6.5h1.5v-6.5h2v-1.5h-5.5zm16 10.5h-16v-1.5h16zm-7 4h-9v-1.5h9z" }) }); 2904 2905 // packages/icons/build-module/library/upload.js 2906 var import_primitives144 = __toESM(require_primitives()); 2907 var import_jsx_runtime153 = __toESM(require_jsx_runtime()); 2908 var upload_default = /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(import_primitives144.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(import_primitives144.Path, { 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" }) }); 2909 2910 // packages/icons/build-module/library/verse.js 2911 var import_primitives145 = __toESM(require_primitives()); 2912 var import_jsx_runtime154 = __toESM(require_jsx_runtime()); 2913 var verse_default = /* @__PURE__ */ (0, import_jsx_runtime154.jsx)(import_primitives145.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime154.jsx)(import_primitives145.Path, { 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" }) }); 2914 2915 // packages/icons/build-module/library/video.js 2916 var import_primitives146 = __toESM(require_primitives()); 2917 var import_jsx_runtime155 = __toESM(require_jsx_runtime()); 2918 var video_default = /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(import_primitives146.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(import_primitives146.Path, { d: "M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z" }) }); 2919 2920 // packages/icons/build-module/library/word-count.js 2921 var import_primitives147 = __toESM(require_primitives()); 2922 var import_jsx_runtime156 = __toESM(require_jsx_runtime()); 2923 var word_count_default = /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(import_primitives147.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(import_primitives147.Path, { d: "M19 5c1.1 0 2 .9 2 2v10c0 1.1-.9 2-2 2H5c-1.1 0-2-.9-2-2V7c0-1.1.9-2 2-2zM5 6.5c-.3 0-.5.2-.5.5v10c0 .3.2.5.5.5h14c.3 0 .5-.2.5-.5V7c0-.3-.2-.5-.5-.5zM14.734 9q.714 0 1.15.253.437.247.639.84.2.591.2 1.61v1.15q0 .402.036.667.04.258.172.39.138.127.437.127h.104l-.162.828h-.08q-.5 0-.776-.097a.9.9 0 0 1-.414-.283 2 2 0 0 1-.259-.448q-.316.367-.748.598-.43.23-.977.23-.524 0-.914-.213a1.56 1.56 0 0 1-.61-.58 1.65 1.65 0 0 1-.213-.84q0-.477.207-.817.213-.345.564-.568.357-.23.794-.363.437-.139.902-.196.471-.062.902-.068 0-.805-.315-1.053-.316-.247-.915-.247-.316 0-.678.098-.356.097-.805.408l-.15-.84a2.8 2.8 0 0 1 .846-.419A3.4 3.4 0 0 1 14.734 9m-5.877 1.669H9.86l.59-1.531h.689l-.585 1.53h.898l-.249.727h-.922l-.337.866h1.019l-.354.773h-.962l-.681 1.804h-.701l.69-1.804h-.999l-.693 1.804h-.69l.685-1.804H6.3l.34-.773h.915l.333-.866h-.994l.244-.726H8.16l.594-1.531h.693zm6.832 1.264q-.823.029-1.335.16-.506.133-.74.397-.236.265-.236.685 0 .454.241.66.248.202.632.202.414 0 .8-.207.39-.207.637-.552zm-7.441.328h1l.34-.866h-1z" }) }); 2924 2925 // packages/block-library/build-module/archives/block.json 2926 var block_default5 = { 2927 $schema: "https://schemas.wp.org/trunk/block.json", 2928 apiVersion: 3, 2929 name: "core/archives", 2930 title: "Archives", 2931 category: "widgets", 2932 description: "Display a date archive of your posts.", 2933 textdomain: "default", 2934 attributes: { 2935 displayAsDropdown: { 2936 type: "boolean", 2937 default: false 2938 }, 2939 showLabel: { 2940 type: "boolean", 2941 default: true 2942 }, 2943 showPostCounts: { 2944 type: "boolean", 2945 default: false 2946 }, 2947 type: { 2948 type: "string", 2949 default: "monthly" 2950 } 2951 }, 2952 supports: { 2953 align: true, 2954 __experimentalBorder: { 2955 radius: true, 2956 color: true, 2957 width: true, 2958 style: true 2959 }, 2960 html: false, 2961 spacing: { 2962 margin: true, 2963 padding: true, 2964 __experimentalDefaultControls: { 2965 margin: false, 2966 padding: false 2967 } 2968 }, 2969 typography: { 2970 fontSize: true, 2971 lineHeight: true, 2972 __experimentalFontFamily: true, 2973 __experimentalFontWeight: true, 2974 __experimentalFontStyle: true, 2975 __experimentalTextTransform: true, 2976 __experimentalTextDecoration: true, 2977 __experimentalLetterSpacing: true, 2978 __experimentalDefaultControls: { 2979 fontSize: true 2980 } 2981 }, 2982 color: { 2983 gradients: true, 2984 link: true, 2985 __experimentalDefaultControls: { 2986 background: true, 2987 text: true, 2988 link: true 2989 } 2990 }, 2991 interactivity: { 2992 clientNavigation: true 2993 } 2994 }, 2995 editorStyle: "wp-block-archives-editor" 2996 }; 2997 2998 // packages/block-library/build-module/archives/edit.js 2999 var import_components3 = __toESM(require_components()); 3000 var import_i18n5 = __toESM(require_i18n()); 3001 var import_block_editor11 = __toESM(require_block_editor()); 3002 var import_server_side_render = __toESM(require_server_side_render()); 3003 var import_jsx_runtime157 = __toESM(require_jsx_runtime()); 3004 function ArchivesEdit({ attributes: attributes3, setAttributes }) { 3005 const { showLabel, showPostCounts, displayAsDropdown, type } = attributes3; 3006 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 3007 return /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)(import_jsx_runtime157.Fragment, { children: [ 3008 /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(import_block_editor11.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)( 3009 import_components3.__experimentalToolsPanel, 3010 { 3011 label: (0, import_i18n5.__)("Settings"), 3012 resetAll: () => { 3013 setAttributes({ 3014 displayAsDropdown: false, 3015 showLabel: true, 3016 showPostCounts: false, 3017 type: "monthly" 3018 }); 3019 }, 3020 dropdownMenuProps, 3021 children: [ 3022 /* @__PURE__ */ (0, import_jsx_runtime157.jsx)( 3023 import_components3.__experimentalToolsPanelItem, 3024 { 3025 label: (0, import_i18n5.__)("Display as dropdown"), 3026 isShownByDefault: true, 3027 hasValue: () => displayAsDropdown, 3028 onDeselect: () => setAttributes({ displayAsDropdown: false }), 3029 children: /* @__PURE__ */ (0, import_jsx_runtime157.jsx)( 3030 import_components3.ToggleControl, 3031 { 3032 label: (0, import_i18n5.__)("Display as dropdown"), 3033 checked: displayAsDropdown, 3034 onChange: () => setAttributes({ 3035 displayAsDropdown: !displayAsDropdown 3036 }) 3037 } 3038 ) 3039 } 3040 ), 3041 displayAsDropdown && /* @__PURE__ */ (0, import_jsx_runtime157.jsx)( 3042 import_components3.__experimentalToolsPanelItem, 3043 { 3044 label: (0, import_i18n5.__)("Show label"), 3045 isShownByDefault: true, 3046 hasValue: () => !showLabel, 3047 onDeselect: () => setAttributes({ showLabel: true }), 3048 children: /* @__PURE__ */ (0, import_jsx_runtime157.jsx)( 3049 import_components3.ToggleControl, 3050 { 3051 label: (0, import_i18n5.__)("Show label"), 3052 checked: showLabel, 3053 onChange: () => setAttributes({ 3054 showLabel: !showLabel 3055 }) 3056 } 3057 ) 3058 } 3059 ), 3060 /* @__PURE__ */ (0, import_jsx_runtime157.jsx)( 3061 import_components3.__experimentalToolsPanelItem, 3062 { 3063 label: (0, import_i18n5.__)("Show post counts"), 3064 isShownByDefault: true, 3065 hasValue: () => showPostCounts, 3066 onDeselect: () => setAttributes({ showPostCounts: false }), 3067 children: /* @__PURE__ */ (0, import_jsx_runtime157.jsx)( 3068 import_components3.ToggleControl, 3069 { 3070 label: (0, import_i18n5.__)("Show post counts"), 3071 checked: showPostCounts, 3072 onChange: () => setAttributes({ 3073 showPostCounts: !showPostCounts 3074 }) 3075 } 3076 ) 3077 } 3078 ), 3079 /* @__PURE__ */ (0, import_jsx_runtime157.jsx)( 3080 import_components3.__experimentalToolsPanelItem, 3081 { 3082 label: (0, import_i18n5.__)("Group by"), 3083 isShownByDefault: true, 3084 hasValue: () => type !== "monthly", 3085 onDeselect: () => setAttributes({ type: "monthly" }), 3086 children: /* @__PURE__ */ (0, import_jsx_runtime157.jsx)( 3087 import_components3.SelectControl, 3088 { 3089 __next40pxDefaultSize: true, 3090 label: (0, import_i18n5.__)("Group by"), 3091 options: [ 3092 { label: (0, import_i18n5.__)("Year"), value: "yearly" }, 3093 { label: (0, import_i18n5.__)("Month"), value: "monthly" }, 3094 { label: (0, import_i18n5.__)("Week"), value: "weekly" }, 3095 { label: (0, import_i18n5.__)("Day"), value: "daily" } 3096 ], 3097 value: type, 3098 onChange: (value) => setAttributes({ type: value }) 3099 } 3100 ) 3101 } 3102 ) 3103 ] 3104 } 3105 ) }), 3106 /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("div", { ...(0, import_block_editor11.useBlockProps)(), children: /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(import_components3.Disabled, { children: /* @__PURE__ */ (0, import_jsx_runtime157.jsx)( 3107 import_server_side_render.default, 3108 { 3109 block: "core/archives", 3110 skipBlockSupportAttributes: true, 3111 attributes: attributes3 3112 } 3113 ) }) }) 3114 ] }); 3115 } 3116 3117 // packages/block-library/build-module/archives/index.js 3118 var { name: name5 } = block_default5; 3119 var settings5 = { 3120 icon: archive_default, 3121 example: {}, 3122 edit: ArchivesEdit 3123 }; 3124 var init5 = () => initBlock({ name: name5, metadata: block_default5, settings: settings5 }); 3125 3126 // packages/block-library/build-module/avatar/index.js 3127 var avatar_exports = {}; 3128 __export(avatar_exports, { 3129 init: () => init6, 3130 metadata: () => block_default6, 3131 name: () => name6, 3132 settings: () => settings6 3133 }); 3134 3135 // packages/block-library/build-module/avatar/block.json 3136 var block_default6 = { 3137 $schema: "https://schemas.wp.org/trunk/block.json", 3138 apiVersion: 3, 3139 name: "core/avatar", 3140 title: "Avatar", 3141 category: "theme", 3142 description: "Add a user\u2019s avatar.", 3143 textdomain: "default", 3144 attributes: { 3145 userId: { 3146 type: "number" 3147 }, 3148 size: { 3149 type: "number", 3150 default: 96 3151 }, 3152 isLink: { 3153 type: "boolean", 3154 default: false 3155 }, 3156 linkTarget: { 3157 type: "string", 3158 default: "_self" 3159 } 3160 }, 3161 usesContext: ["postType", "postId", "commentId"], 3162 supports: { 3163 html: false, 3164 align: true, 3165 alignWide: false, 3166 spacing: { 3167 margin: true, 3168 padding: true, 3169 __experimentalDefaultControls: { 3170 margin: false, 3171 padding: false 3172 } 3173 }, 3174 __experimentalBorder: { 3175 __experimentalSkipSerialization: true, 3176 radius: true, 3177 width: true, 3178 color: true, 3179 style: true, 3180 __experimentalDefaultControls: { 3181 radius: true 3182 } 3183 }, 3184 color: { 3185 text: false, 3186 background: false 3187 }, 3188 filter: { 3189 duotone: true 3190 }, 3191 interactivity: { 3192 clientNavigation: true 3193 } 3194 }, 3195 selectors: { 3196 border: ".wp-block-avatar img", 3197 filter: { 3198 duotone: ".wp-block-avatar img" 3199 } 3200 }, 3201 editorStyle: "wp-block-avatar-editor", 3202 style: "wp-block-avatar" 3203 }; 3204 3205 // packages/block-library/build-module/avatar/edit.js 3206 var import_block_editor12 = __toESM(require_block_editor()); 3207 var import_components5 = __toESM(require_components()); 3208 var import_i18n8 = __toESM(require_i18n()); 3209 var import_url = __toESM(require_url()); 3210 3211 // packages/block-library/build-module/avatar/hooks.js 3212 var import_core_data2 = __toESM(require_core_data()); 3213 var import_i18n6 = __toESM(require_i18n()); 3214 var import_data4 = __toESM(require_data()); 3215 function getAvatarSizes(sizes) { 3216 const minSize = sizes ? sizes[0] : 24; 3217 const maxSize = sizes ? sizes[sizes.length - 1] : 96; 3218 const maxSizeBuffer = Math.floor(maxSize * 2.5); 3219 return { 3220 minSize, 3221 maxSize: maxSizeBuffer 3222 }; 3223 } 3224 function useCommentAvatar({ commentId }) { 3225 const [avatars] = (0, import_core_data2.useEntityProp)( 3226 "root", 3227 "comment", 3228 "author_avatar_urls", 3229 commentId 3230 ); 3231 const [authorName] = (0, import_core_data2.useEntityProp)( 3232 "root", 3233 "comment", 3234 "author_name", 3235 commentId 3236 ); 3237 const avatarUrls = avatars ? Object.values(avatars) : null; 3238 const sizes = avatars ? Object.keys(avatars) : null; 3239 const { minSize, maxSize } = getAvatarSizes(sizes); 3240 const defaultAvatar = useDefaultAvatar(); 3241 return { 3242 src: avatarUrls ? avatarUrls[avatarUrls.length - 1] : defaultAvatar, 3243 minSize, 3244 maxSize, 3245 alt: authorName ? ( 3246 // translators: %s: Author name. 3247 (0, import_i18n6.sprintf)((0, import_i18n6.__)("%s Avatar"), authorName) 3248 ) : (0, import_i18n6.__)("Default Avatar") 3249 }; 3250 } 3251 function useUserAvatar({ userId, postId, postType }) { 3252 const { authorDetails } = (0, import_data4.useSelect)( 3253 (select9) => { 3254 const { getEditedEntityRecord, getUser } = select9(import_core_data2.store); 3255 if (userId) { 3256 return { 3257 authorDetails: getUser(userId) 3258 }; 3259 } 3260 const _authorId = getEditedEntityRecord( 3261 "postType", 3262 postType, 3263 postId 3264 )?.author; 3265 return { 3266 authorDetails: _authorId ? getUser(_authorId) : null 3267 }; 3268 }, 3269 [postType, postId, userId] 3270 ); 3271 const avatarUrls = authorDetails?.avatar_urls ? Object.values(authorDetails.avatar_urls) : null; 3272 const sizes = authorDetails?.avatar_urls ? Object.keys(authorDetails.avatar_urls) : null; 3273 const { minSize, maxSize } = getAvatarSizes(sizes); 3274 const defaultAvatar = useDefaultAvatar(); 3275 return { 3276 src: avatarUrls ? avatarUrls[avatarUrls.length - 1] : defaultAvatar, 3277 minSize, 3278 maxSize, 3279 alt: authorDetails ? ( 3280 // translators: %s: Author name. 3281 (0, import_i18n6.sprintf)((0, import_i18n6.__)("%s Avatar"), authorDetails?.name) 3282 ) : (0, import_i18n6.__)("Default Avatar") 3283 }; 3284 } 3285 3286 // packages/block-library/build-module/avatar/user-control.js 3287 var import_i18n7 = __toESM(require_i18n()); 3288 var import_components4 = __toESM(require_components()); 3289 var import_data5 = __toESM(require_data()); 3290 var import_core_data3 = __toESM(require_core_data()); 3291 var import_element5 = __toESM(require_element()); 3292 var import_compose2 = __toESM(require_compose()); 3293 var import_html_entities = __toESM(require_html_entities()); 3294 var import_jsx_runtime158 = __toESM(require_jsx_runtime()); 3295 var AUTHORS_QUERY = { 3296 who: "authors", 3297 per_page: 100, 3298 _fields: "id,name", 3299 context: "view" 3300 }; 3301 function UserControl({ value, onChange }) { 3302 const [filterValue, setFilterValue] = (0, import_element5.useState)(""); 3303 const { authors, isLoading } = (0, import_data5.useSelect)( 3304 (select9) => { 3305 const { getUsers, isResolving } = select9(import_core_data3.store); 3306 const query = { ...AUTHORS_QUERY }; 3307 if (filterValue) { 3308 query.search = filterValue; 3309 query.search_columns = ["name"]; 3310 } 3311 return { 3312 authors: getUsers(query), 3313 isLoading: isResolving("getUsers", [query]) 3314 }; 3315 }, 3316 [filterValue] 3317 ); 3318 const options2 = (0, import_element5.useMemo)(() => { 3319 return (authors ?? []).map((author) => { 3320 return { 3321 value: author.id, 3322 label: (0, import_html_entities.decodeEntities)(author.name) 3323 }; 3324 }); 3325 }, [authors]); 3326 return /* @__PURE__ */ (0, import_jsx_runtime158.jsx)( 3327 import_components4.ComboboxControl, 3328 { 3329 __next40pxDefaultSize: true, 3330 label: (0, import_i18n7.__)("User"), 3331 help: (0, import_i18n7.__)( 3332 "Select the avatar user to display, if it is blank it will use the post/page author." 3333 ), 3334 value, 3335 onChange, 3336 options: options2, 3337 onFilterValueChange: (0, import_compose2.debounce)(setFilterValue, 300), 3338 isLoading 3339 } 3340 ); 3341 } 3342 3343 // packages/block-library/build-module/avatar/edit.js 3344 var import_jsx_runtime159 = __toESM(require_jsx_runtime()); 3345 var AvatarInspectorControls = ({ 3346 setAttributes, 3347 avatar, 3348 attributes: attributes3, 3349 selectUser 3350 }) => { 3351 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 3352 return /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(import_block_editor12.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)( 3353 import_components5.__experimentalToolsPanel, 3354 { 3355 label: (0, import_i18n8.__)("Settings"), 3356 resetAll: () => { 3357 setAttributes({ 3358 size: 96, 3359 isLink: false, 3360 linkTarget: "_self", 3361 userId: void 0 3362 }); 3363 }, 3364 dropdownMenuProps, 3365 children: [ 3366 /* @__PURE__ */ (0, import_jsx_runtime159.jsx)( 3367 import_components5.__experimentalToolsPanelItem, 3368 { 3369 label: (0, import_i18n8.__)("Image size"), 3370 isShownByDefault: true, 3371 hasValue: () => attributes3?.size !== 96, 3372 onDeselect: () => setAttributes({ size: 96 }), 3373 children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)( 3374 import_components5.RangeControl, 3375 { 3376 __next40pxDefaultSize: true, 3377 label: (0, import_i18n8.__)("Image size"), 3378 onChange: (newSize) => setAttributes({ 3379 size: newSize 3380 }), 3381 min: avatar.minSize, 3382 max: avatar.maxSize, 3383 initialPosition: attributes3?.size, 3384 value: attributes3?.size 3385 } 3386 ) 3387 } 3388 ), 3389 /* @__PURE__ */ (0, import_jsx_runtime159.jsx)( 3390 import_components5.__experimentalToolsPanelItem, 3391 { 3392 label: (0, import_i18n8.__)("Link to user profile"), 3393 isShownByDefault: true, 3394 hasValue: () => attributes3?.isLink, 3395 onDeselect: () => setAttributes({ isLink: false }), 3396 children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)( 3397 import_components5.ToggleControl, 3398 { 3399 label: (0, import_i18n8.__)("Link to user profile"), 3400 onChange: () => setAttributes({ isLink: !attributes3.isLink }), 3401 checked: attributes3.isLink 3402 } 3403 ) 3404 } 3405 ), 3406 attributes3.isLink && /* @__PURE__ */ (0, import_jsx_runtime159.jsx)( 3407 import_components5.__experimentalToolsPanelItem, 3408 { 3409 label: (0, import_i18n8.__)("Open in new tab"), 3410 isShownByDefault: true, 3411 hasValue: () => attributes3?.linkTarget !== "_self", 3412 onDeselect: () => setAttributes({ linkTarget: "_self" }), 3413 children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)( 3414 import_components5.ToggleControl, 3415 { 3416 label: (0, import_i18n8.__)("Open in new tab"), 3417 onChange: (value) => setAttributes({ 3418 linkTarget: value ? "_blank" : "_self" 3419 }), 3420 checked: attributes3.linkTarget === "_blank" 3421 } 3422 ) 3423 } 3424 ), 3425 selectUser && /* @__PURE__ */ (0, import_jsx_runtime159.jsx)( 3426 import_components5.__experimentalToolsPanelItem, 3427 { 3428 label: (0, import_i18n8.__)("User"), 3429 isShownByDefault: true, 3430 hasValue: () => !!attributes3?.userId, 3431 onDeselect: () => setAttributes({ userId: void 0 }), 3432 children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)( 3433 UserControl, 3434 { 3435 value: attributes3?.userId, 3436 onChange: (value) => { 3437 setAttributes({ 3438 userId: value 3439 }); 3440 } 3441 } 3442 ) 3443 } 3444 ) 3445 ] 3446 } 3447 ) }); 3448 }; 3449 var AvatarLinkWrapper = ({ children, isLink }) => isLink ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)( 3450 "a", 3451 { 3452 href: "#avatar-pseudo-link", 3453 className: "wp-block-avatar__link", 3454 onClick: (event) => event.preventDefault(), 3455 children 3456 } 3457 ) : children; 3458 var ResizableAvatar = ({ 3459 setAttributes, 3460 attributes: attributes3, 3461 avatar, 3462 blockProps, 3463 isSelected 3464 }) => { 3465 const borderProps = (0, import_block_editor12.__experimentalUseBorderProps)(attributes3); 3466 const doubledSizedSrc = (0, import_url.addQueryArgs)( 3467 (0, import_url.removeQueryArgs)(avatar?.src, ["s"]), 3468 { 3469 s: attributes3?.size * 2 3470 } 3471 ); 3472 return /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(AvatarLinkWrapper, { isLink: attributes3.isLink, children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)( 3473 import_components5.ResizableBox, 3474 { 3475 size: { 3476 width: attributes3.size, 3477 height: attributes3.size 3478 }, 3479 showHandle: isSelected, 3480 onResizeStop: (event, direction, elt, delta) => { 3481 setAttributes({ 3482 size: parseInt( 3483 attributes3.size + (delta.height || delta.width), 3484 10 3485 ) 3486 }); 3487 }, 3488 lockAspectRatio: true, 3489 enable: { 3490 top: false, 3491 right: !(0, import_i18n8.isRTL)(), 3492 bottom: true, 3493 left: (0, import_i18n8.isRTL)() 3494 }, 3495 minWidth: avatar.minSize, 3496 maxWidth: avatar.maxSize, 3497 children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)( 3498 "img", 3499 { 3500 src: doubledSizedSrc, 3501 alt: avatar.alt, 3502 className: clsx_default( 3503 "avatar", 3504 "avatar-" + attributes3.size, 3505 "photo", 3506 "wp-block-avatar__image", 3507 borderProps.className 3508 ), 3509 style: borderProps.style 3510 } 3511 ) 3512 } 3513 ) }) }); 3514 }; 3515 var CommentEdit = ({ attributes: attributes3, context, setAttributes, isSelected }) => { 3516 const { commentId } = context; 3517 const blockProps = (0, import_block_editor12.useBlockProps)(); 3518 const avatar = useCommentAvatar({ commentId }); 3519 return /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(import_jsx_runtime159.Fragment, { children: [ 3520 /* @__PURE__ */ (0, import_jsx_runtime159.jsx)( 3521 AvatarInspectorControls, 3522 { 3523 avatar, 3524 setAttributes, 3525 attributes: attributes3, 3526 selectUser: false 3527 } 3528 ), 3529 /* @__PURE__ */ (0, import_jsx_runtime159.jsx)( 3530 ResizableAvatar, 3531 { 3532 attributes: attributes3, 3533 avatar, 3534 blockProps, 3535 isSelected, 3536 setAttributes 3537 } 3538 ) 3539 ] }); 3540 }; 3541 var UserEdit = ({ attributes: attributes3, context, setAttributes, isSelected }) => { 3542 const { postId, postType } = context; 3543 const avatar = useUserAvatar({ 3544 userId: attributes3?.userId, 3545 postId, 3546 postType 3547 }); 3548 const blockProps = (0, import_block_editor12.useBlockProps)(); 3549 return /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(import_jsx_runtime159.Fragment, { children: [ 3550 /* @__PURE__ */ (0, import_jsx_runtime159.jsx)( 3551 AvatarInspectorControls, 3552 { 3553 selectUser: true, 3554 attributes: attributes3, 3555 avatar, 3556 setAttributes 3557 } 3558 ), 3559 /* @__PURE__ */ (0, import_jsx_runtime159.jsx)( 3560 ResizableAvatar, 3561 { 3562 attributes: attributes3, 3563 avatar, 3564 blockProps, 3565 isSelected, 3566 setAttributes 3567 } 3568 ) 3569 ] }); 3570 }; 3571 function Edit5(props) { 3572 if (props?.context?.commentId || props?.context?.commentId === null) { 3573 return /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(CommentEdit, { ...props }); 3574 } 3575 return /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(UserEdit, { ...props }); 3576 } 3577 3578 // packages/block-library/build-module/avatar/index.js 3579 var { name: name6 } = block_default6; 3580 var settings6 = { 3581 icon: comment_author_avatar_default, 3582 edit: Edit5, 3583 example: {} 3584 }; 3585 var init6 = () => initBlock({ name: name6, metadata: block_default6, settings: settings6 }); 3586 3587 // packages/block-library/build-module/audio/index.js 3588 var audio_exports = {}; 3589 __export(audio_exports, { 3590 init: () => init7, 3591 metadata: () => block_default8, 3592 name: () => name7, 3593 settings: () => settings7 3594 }); 3595 var import_i18n11 = __toESM(require_i18n()); 3596 var import_blocks6 = __toESM(require_blocks()); 3597 3598 // packages/block-library/build-module/audio/deprecated.js 3599 var import_block_editor13 = __toESM(require_block_editor()); 3600 var import_jsx_runtime160 = __toESM(require_jsx_runtime()); 3601 var deprecated_default2 = [ 3602 { 3603 attributes: { 3604 src: { 3605 type: "string", 3606 source: "attribute", 3607 selector: "audio", 3608 attribute: "src" 3609 }, 3610 caption: { 3611 type: "string", 3612 source: "html", 3613 selector: "figcaption" 3614 }, 3615 id: { 3616 type: "number" 3617 }, 3618 autoplay: { 3619 type: "boolean", 3620 source: "attribute", 3621 selector: "audio", 3622 attribute: "autoplay" 3623 }, 3624 loop: { 3625 type: "boolean", 3626 source: "attribute", 3627 selector: "audio", 3628 attribute: "loop" 3629 }, 3630 preload: { 3631 type: "string", 3632 source: "attribute", 3633 selector: "audio", 3634 attribute: "preload" 3635 } 3636 }, 3637 supports: { 3638 align: true 3639 }, 3640 save({ attributes: attributes3 }) { 3641 const { autoplay, caption, loop, preload, src } = attributes3; 3642 return /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)("figure", { children: [ 3643 /* @__PURE__ */ (0, import_jsx_runtime160.jsx)( 3644 "audio", 3645 { 3646 controls: "controls", 3647 src, 3648 autoPlay: autoplay, 3649 loop, 3650 preload 3651 } 3652 ), 3653 !import_block_editor13.RichText.isEmpty(caption) && /* @__PURE__ */ (0, import_jsx_runtime160.jsx)( 3654 import_block_editor13.RichText.Content, 3655 { 3656 tagName: "figcaption", 3657 value: caption 3658 } 3659 ) 3660 ] }); 3661 } 3662 } 3663 ]; 3664 3665 // packages/block-library/build-module/audio/edit.js 3666 var import_blob2 = __toESM(require_blob()); 3667 var import_components8 = __toESM(require_components()); 3668 var import_block_editor15 = __toESM(require_block_editor()); 3669 var import_i18n10 = __toESM(require_i18n()); 3670 var import_data6 = __toESM(require_data()); 3671 var import_notices = __toESM(require_notices()); 3672 var import_element8 = __toESM(require_element()); 3673 3674 // node_modules/memize/dist/index.js 3675 function memize(fn, options2) { 3676 var size = 0; 3677 var head; 3678 var tail; 3679 options2 = options2 || {}; 3680 function memoized() { 3681 var node = head, len = arguments.length, args, i2; 3682 searchCache: while (node) { 3683 if (node.args.length !== arguments.length) { 3684 node = node.next; 3685 continue; 3686 } 3687 for (i2 = 0; i2 < len; i2++) { 3688 if (node.args[i2] !== arguments[i2]) { 3689 node = node.next; 3690 continue searchCache; 3691 } 3692 } 3693 if (node !== head) { 3694 if (node === tail) { 3695 tail = node.prev; 3696 } 3697 node.prev.next = node.next; 3698 if (node.next) { 3699 node.next.prev = node.prev; 3700 } 3701 node.next = head; 3702 node.prev = null; 3703 head.prev = node; 3704 head = node; 3705 } 3706 return node.val; 3707 } 3708 args = new Array(len); 3709 for (i2 = 0; i2 < len; i2++) { 3710 args[i2] = arguments[i2]; 3711 } 3712 node = { 3713 args, 3714 // Generate the result from original function 3715 val: fn.apply(null, args) 3716 }; 3717 if (head) { 3718 head.prev = node; 3719 node.next = head; 3720 } else { 3721 tail = node; 3722 } 3723 if (size === /** @type {MemizeOptions} */ 3724 options2.maxSize) { 3725 tail = /** @type {MemizeCacheNode} */ 3726 tail.prev; 3727 tail.next = null; 3728 } else { 3729 size++; 3730 } 3731 head = node; 3732 return node.val; 3733 } 3734 memoized.clear = function() { 3735 head = null; 3736 tail = null; 3737 size = 0; 3738 }; 3739 return memoized; 3740 } 3741 3742 // packages/block-library/build-module/embed/util.js 3743 var import_components6 = __toESM(require_components()); 3744 var import_element6 = __toESM(require_element()); 3745 var import_blocks3 = __toESM(require_blocks()); 3746 3747 // packages/block-library/build-module/embed/block.json 3748 var block_default7 = { 3749 $schema: "https://schemas.wp.org/trunk/block.json", 3750 apiVersion: 3, 3751 name: "core/embed", 3752 title: "Embed", 3753 category: "embed", 3754 description: "Add a block that displays content pulled from other sites, like Twitter or YouTube.", 3755 textdomain: "default", 3756 attributes: { 3757 url: { 3758 type: "string", 3759 role: "content" 3760 }, 3761 caption: { 3762 type: "rich-text", 3763 source: "rich-text", 3764 selector: "figcaption", 3765 role: "content" 3766 }, 3767 type: { 3768 type: "string", 3769 role: "content" 3770 }, 3771 providerNameSlug: { 3772 type: "string", 3773 role: "content" 3774 }, 3775 allowResponsive: { 3776 type: "boolean", 3777 default: true 3778 }, 3779 responsive: { 3780 type: "boolean", 3781 default: false, 3782 role: "content" 3783 }, 3784 previewable: { 3785 type: "boolean", 3786 default: true, 3787 role: "content" 3788 } 3789 }, 3790 supports: { 3791 align: true, 3792 spacing: { 3793 margin: true 3794 }, 3795 interactivity: { 3796 clientNavigation: true 3797 } 3798 }, 3799 editorStyle: "wp-block-embed-editor", 3800 style: "wp-block-embed" 3801 }; 3802 3803 // packages/block-library/build-module/embed/constants.js 3804 var ASPECT_RATIOS = [ 3805 // Common video resolutions. 3806 { ratio: "2.33", className: "wp-embed-aspect-21-9" }, 3807 { ratio: "2.00", className: "wp-embed-aspect-18-9" }, 3808 { ratio: "1.78", className: "wp-embed-aspect-16-9" }, 3809 { ratio: "1.33", className: "wp-embed-aspect-4-3" }, 3810 // Vertical video and instagram square video support. 3811 { ratio: "1.00", className: "wp-embed-aspect-1-1" }, 3812 { ratio: "0.56", className: "wp-embed-aspect-9-16" }, 3813 { ratio: "0.50", className: "wp-embed-aspect-1-2" } 3814 ]; 3815 var WP_EMBED_TYPE = "wp-embed"; 3816 3817 // packages/block-library/build-module/lock-unlock.js 3818 var import_private_apis = __toESM(require_private_apis()); 3819 var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)( 3820 "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.", 3821 "@wordpress/block-library" 3822 ); 3823 3824 // packages/block-library/build-module/embed/util.js 3825 var import_jsx_runtime161 = __toESM(require_jsx_runtime()); 3826 var { name: DEFAULT_EMBED_BLOCK } = block_default7; 3827 var { kebabCase } = unlock(import_components6.privateApis); 3828 var getEmbedInfoByProvider = (provider) => (0, import_blocks3.getBlockVariations)(DEFAULT_EMBED_BLOCK)?.find( 3829 ({ name: name117 }) => name117 === provider 3830 ); 3831 var matchesPatterns = (url, patterns = []) => patterns.some((pattern) => url.match(pattern)); 3832 var findMoreSuitableBlock = (url) => (0, import_blocks3.getBlockVariations)(DEFAULT_EMBED_BLOCK)?.find( 3833 ({ patterns }) => matchesPatterns(url, patterns) 3834 ); 3835 var isFromWordPress = (html) => html && html.includes('class="wp-embedded-content"'); 3836 var getPhotoHtml = (photo) => { 3837 const imageUrl = photo.url || photo.thumbnail_url; 3838 const photoPreview = /* @__PURE__ */ (0, import_jsx_runtime161.jsx)("p", { children: /* @__PURE__ */ (0, import_jsx_runtime161.jsx)("img", { src: imageUrl, alt: photo.title, width: "100%" }) }); 3839 return (0, import_element6.renderToString)(photoPreview); 3840 }; 3841 var createUpgradedEmbedBlock = (props, attributesFromPreview = {}) => { 3842 const { preview, attributes: attributes3 = {} } = props; 3843 const { url, providerNameSlug, type, ...restAttributes } = attributes3; 3844 if (!url || !(0, import_blocks3.getBlockType)(DEFAULT_EMBED_BLOCK)) { 3845 return; 3846 } 3847 const matchedBlock = findMoreSuitableBlock(url); 3848 const isCurrentBlockWP = providerNameSlug === "wordpress" || type === WP_EMBED_TYPE; 3849 const shouldCreateNewBlock = !isCurrentBlockWP && matchedBlock && (matchedBlock.attributes.providerNameSlug !== providerNameSlug || !providerNameSlug); 3850 if (shouldCreateNewBlock) { 3851 return (0, import_blocks3.createBlock)(DEFAULT_EMBED_BLOCK, { 3852 url, 3853 ...restAttributes, 3854 ...matchedBlock.attributes 3855 }); 3856 } 3857 const wpVariation = (0, import_blocks3.getBlockVariations)(DEFAULT_EMBED_BLOCK)?.find( 3858 ({ name: name117 }) => name117 === "wordpress" 3859 ); 3860 if (!wpVariation || !preview || !isFromWordPress(preview.html) || isCurrentBlockWP) { 3861 return; 3862 } 3863 return (0, import_blocks3.createBlock)(DEFAULT_EMBED_BLOCK, { 3864 url, 3865 ...wpVariation.attributes, 3866 // By now we have the preview, but when the new block first renders, it 3867 // won't have had all the attributes set, and so won't get the correct 3868 // type and it won't render correctly. So, we pass through the current attributes 3869 // here so that the initial render works when we switch to the WordPress 3870 // block. This only affects the WordPress block because it can't be 3871 // rendered in the usual Sandbox (it has a sandbox of its own) and it 3872 // relies on the preview to set the correct render type. 3873 ...attributesFromPreview 3874 }); 3875 }; 3876 var hasAspectRatioClass = (existingClassNames) => { 3877 if (!existingClassNames) { 3878 return false; 3879 } 3880 return ASPECT_RATIOS.some( 3881 ({ className }) => existingClassNames.includes(className) 3882 ); 3883 }; 3884 var removeAspectRatioClasses = (existingClassNames) => { 3885 if (!existingClassNames) { 3886 return existingClassNames; 3887 } 3888 const aspectRatioClassNames = ASPECT_RATIOS.reduce( 3889 (accumulator, { className }) => { 3890 accumulator.push(className); 3891 return accumulator; 3892 }, 3893 ["wp-has-aspect-ratio"] 3894 ); 3895 let outputClassNames = existingClassNames; 3896 for (const className of aspectRatioClassNames) { 3897 outputClassNames = outputClassNames.replace(className, ""); 3898 } 3899 return outputClassNames.trim(); 3900 }; 3901 function getClassNames(html, existingClassNames, allowResponsive = true) { 3902 if (!allowResponsive) { 3903 return removeAspectRatioClasses(existingClassNames); 3904 } 3905 const previewDocument = document.implementation.createHTMLDocument(""); 3906 previewDocument.body.innerHTML = html; 3907 const iframe = previewDocument.body.querySelector("iframe"); 3908 if (iframe && iframe.height && iframe.width) { 3909 const aspectRatio = (iframe.width / iframe.height).toFixed(2); 3910 for (let ratioIndex = 0; ratioIndex < ASPECT_RATIOS.length; ratioIndex++) { 3911 const potentialRatio = ASPECT_RATIOS[ratioIndex]; 3912 if (aspectRatio >= potentialRatio.ratio) { 3913 const ratioDiff = aspectRatio - potentialRatio.ratio; 3914 if (ratioDiff > 0.1) { 3915 return removeAspectRatioClasses(existingClassNames); 3916 } 3917 return clsx_default( 3918 removeAspectRatioClasses(existingClassNames), 3919 potentialRatio.className, 3920 "wp-has-aspect-ratio" 3921 ); 3922 } 3923 } 3924 } 3925 return existingClassNames; 3926 } 3927 function fallback(url, onReplace) { 3928 const link = /* @__PURE__ */ (0, import_jsx_runtime161.jsx)("a", { href: url, children: url }); 3929 onReplace( 3930 (0, import_blocks3.createBlock)("core/paragraph", { content: (0, import_element6.renderToString)(link) }) 3931 ); 3932 } 3933 var getAttributesFromPreview = memize( 3934 (preview, title, currentClassNames, isResponsive, allowResponsive = true) => { 3935 if (!preview) { 3936 return {}; 3937 } 3938 const attributes3 = {}; 3939 let { type = "rich" } = preview; 3940 const { html, provider_name: providerName } = preview; 3941 const providerNameSlug = kebabCase( 3942 (providerName || title).toLowerCase() 3943 ); 3944 if (isFromWordPress(html)) { 3945 type = WP_EMBED_TYPE; 3946 } 3947 if (html || "photo" === type) { 3948 attributes3.type = type; 3949 attributes3.providerNameSlug = providerNameSlug; 3950 } 3951 if (hasAspectRatioClass(currentClassNames)) { 3952 return attributes3; 3953 } 3954 attributes3.className = getClassNames( 3955 html, 3956 currentClassNames, 3957 isResponsive && allowResponsive 3958 ); 3959 return attributes3; 3960 } 3961 ); 3962 var getMergedAttributesWithPreview = (currentAttributes, preview, title, isResponsive) => { 3963 const { allowResponsive, className } = currentAttributes; 3964 return { 3965 ...currentAttributes, 3966 ...getAttributesFromPreview( 3967 preview, 3968 title, 3969 className, 3970 isResponsive, 3971 allowResponsive 3972 ) 3973 }; 3974 }; 3975 3976 // packages/block-library/build-module/utils/caption.js 3977 var import_element7 = __toESM(require_element()); 3978 var import_compose3 = __toESM(require_compose()); 3979 var import_i18n9 = __toESM(require_i18n()); 3980 var import_block_editor14 = __toESM(require_block_editor()); 3981 var import_components7 = __toESM(require_components()); 3982 var import_blocks4 = __toESM(require_blocks()); 3983 var import_jsx_runtime162 = __toESM(require_jsx_runtime()); 3984 function Caption({ 3985 attributeKey = "caption", 3986 attributes: attributes3, 3987 setAttributes, 3988 isSelected, 3989 insertBlocksAfter, 3990 placeholder: placeholder2 = (0, import_i18n9.__)("Add caption"), 3991 label = (0, import_i18n9.__)("Caption text"), 3992 showToolbarButton = true, 3993 excludeElementClassName, 3994 className, 3995 readOnly, 3996 tagName = "figcaption", 3997 addLabel = (0, import_i18n9.__)("Add caption"), 3998 removeLabel = (0, import_i18n9.__)("Remove caption"), 3999 icon = caption_default, 4000 ...props 4001 }) { 4002 const caption = attributes3[attributeKey]; 4003 const prevCaption = (0, import_compose3.usePrevious)(caption); 4004 const { PrivateRichText: RichText69 } = unlock(import_block_editor14.privateApis); 4005 const isCaptionEmpty = RichText69.isEmpty(caption); 4006 const isPrevCaptionEmpty = RichText69.isEmpty(prevCaption); 4007 const [showCaption, setShowCaption] = (0, import_element7.useState)(!isCaptionEmpty); 4008 (0, import_element7.useEffect)(() => { 4009 if (!isCaptionEmpty && isPrevCaptionEmpty) { 4010 setShowCaption(true); 4011 } 4012 }, [isCaptionEmpty, isPrevCaptionEmpty]); 4013 (0, import_element7.useEffect)(() => { 4014 if (!isSelected && isCaptionEmpty) { 4015 setShowCaption(false); 4016 } 4017 }, [isSelected, isCaptionEmpty]); 4018 const ref = (0, import_element7.useCallback)( 4019 (node) => { 4020 if (node && isCaptionEmpty) { 4021 node.focus(); 4022 } 4023 }, 4024 [isCaptionEmpty] 4025 ); 4026 return /* @__PURE__ */ (0, import_jsx_runtime162.jsxs)(import_jsx_runtime162.Fragment, { children: [ 4027 showToolbarButton && /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(import_block_editor14.BlockControls, { group: "block", children: /* @__PURE__ */ (0, import_jsx_runtime162.jsx)( 4028 import_components7.ToolbarButton, 4029 { 4030 onClick: () => { 4031 setShowCaption(!showCaption); 4032 if (showCaption && caption) { 4033 setAttributes({ 4034 [attributeKey]: void 0 4035 }); 4036 } 4037 }, 4038 icon, 4039 isPressed: showCaption, 4040 label: showCaption ? removeLabel : addLabel 4041 } 4042 ) }), 4043 showCaption && (!RichText69.isEmpty(caption) || isSelected) && /* @__PURE__ */ (0, import_jsx_runtime162.jsx)( 4044 RichText69, 4045 { 4046 identifier: attributeKey, 4047 tagName, 4048 className: clsx_default( 4049 className, 4050 excludeElementClassName ? "" : (0, import_block_editor14.__experimentalGetElementClassName)("caption") 4051 ), 4052 ref, 4053 "aria-label": label, 4054 placeholder: placeholder2, 4055 value: caption, 4056 onChange: (value) => setAttributes({ [attributeKey]: value }), 4057 inlineToolbar: true, 4058 __unstableOnSplitAtEnd: () => insertBlocksAfter( 4059 (0, import_blocks4.createBlock)((0, import_blocks4.getDefaultBlockName)()) 4060 ), 4061 readOnly, 4062 ...props 4063 } 4064 ) 4065 ] }); 4066 } 4067 4068 // packages/block-library/build-module/audio/edit.js 4069 var import_jsx_runtime163 = __toESM(require_jsx_runtime()); 4070 var ALLOWED_MEDIA_TYPES = ["audio"]; 4071 function AudioEdit({ 4072 attributes: attributes3, 4073 className, 4074 setAttributes, 4075 onReplace, 4076 isSelected: isSingleSelected, 4077 insertBlocksAfter 4078 }) { 4079 const { id, autoplay, loop, preload, src } = attributes3; 4080 const [temporaryURL, setTemporaryURL] = (0, import_element8.useState)(attributes3.blob); 4081 const blockEditingMode = (0, import_block_editor15.useBlockEditingMode)(); 4082 const hasNonContentControls = blockEditingMode === "default"; 4083 useUploadMediaFromBlobURL({ 4084 url: temporaryURL, 4085 allowedTypes: ALLOWED_MEDIA_TYPES, 4086 onChange: onSelectAudio, 4087 onError: onUploadError 4088 }); 4089 function toggleAttribute(attribute) { 4090 return (newValue) => { 4091 setAttributes({ [attribute]: newValue }); 4092 }; 4093 } 4094 function onSelectURL(newSrc) { 4095 if (newSrc !== src) { 4096 const embedBlock = createUpgradedEmbedBlock({ 4097 attributes: { url: newSrc } 4098 }); 4099 if (void 0 !== embedBlock && onReplace) { 4100 onReplace(embedBlock); 4101 return; 4102 } 4103 setAttributes({ src: newSrc, id: void 0, blob: void 0 }); 4104 setTemporaryURL(); 4105 } 4106 } 4107 const { createErrorNotice } = (0, import_data6.useDispatch)(import_notices.store); 4108 function onUploadError(message) { 4109 createErrorNotice(message, { type: "snackbar" }); 4110 } 4111 function getAutoplayHelp(checked) { 4112 return checked ? (0, import_i18n10.__)("Autoplay may cause usability issues for some users.") : null; 4113 } 4114 function onSelectAudio(media) { 4115 if (!media || !media.url) { 4116 setAttributes({ 4117 src: void 0, 4118 id: void 0, 4119 caption: void 0, 4120 blob: void 0 4121 }); 4122 setTemporaryURL(); 4123 return; 4124 } 4125 if ((0, import_blob2.isBlobURL)(media.url)) { 4126 setTemporaryURL(media.url); 4127 return; 4128 } 4129 setAttributes({ 4130 blob: void 0, 4131 src: media.url, 4132 id: media.id, 4133 caption: media.caption 4134 }); 4135 setTemporaryURL(); 4136 } 4137 const classes = clsx_default(className, { 4138 "is-transient": !!temporaryURL 4139 }); 4140 const blockProps = (0, import_block_editor15.useBlockProps)({ 4141 className: classes 4142 }); 4143 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 4144 if (!src && !temporaryURL) { 4145 return /* @__PURE__ */ (0, import_jsx_runtime163.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime163.jsx)( 4146 import_block_editor15.MediaPlaceholder, 4147 { 4148 icon: /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(import_block_editor15.BlockIcon, { icon: audio_default }), 4149 onSelect: onSelectAudio, 4150 onSelectURL, 4151 accept: "audio/*", 4152 allowedTypes: ALLOWED_MEDIA_TYPES, 4153 value: attributes3, 4154 onError: onUploadError 4155 } 4156 ) }); 4157 } 4158 return /* @__PURE__ */ (0, import_jsx_runtime163.jsxs)(import_jsx_runtime163.Fragment, { children: [ 4159 isSingleSelected && /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(import_block_editor15.BlockControls, { group: "other", children: /* @__PURE__ */ (0, import_jsx_runtime163.jsx)( 4160 import_block_editor15.MediaReplaceFlow, 4161 { 4162 mediaId: id, 4163 mediaURL: src, 4164 allowedTypes: ALLOWED_MEDIA_TYPES, 4165 accept: "audio/*", 4166 onSelect: onSelectAudio, 4167 onSelectURL, 4168 onError: onUploadError, 4169 onReset: () => onSelectAudio(void 0) 4170 } 4171 ) }), 4172 /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(import_block_editor15.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime163.jsxs)( 4173 import_components8.__experimentalToolsPanel, 4174 { 4175 label: (0, import_i18n10.__)("Settings"), 4176 resetAll: () => { 4177 setAttributes({ 4178 autoplay: false, 4179 loop: false, 4180 preload: void 0 4181 }); 4182 }, 4183 dropdownMenuProps, 4184 children: [ 4185 /* @__PURE__ */ (0, import_jsx_runtime163.jsx)( 4186 import_components8.__experimentalToolsPanelItem, 4187 { 4188 label: (0, import_i18n10.__)("Autoplay"), 4189 isShownByDefault: true, 4190 hasValue: () => !!autoplay, 4191 onDeselect: () => setAttributes({ 4192 autoplay: false 4193 }), 4194 children: /* @__PURE__ */ (0, import_jsx_runtime163.jsx)( 4195 import_components8.ToggleControl, 4196 { 4197 label: (0, import_i18n10.__)("Autoplay"), 4198 onChange: toggleAttribute("autoplay"), 4199 checked: !!autoplay, 4200 help: getAutoplayHelp 4201 } 4202 ) 4203 } 4204 ), 4205 /* @__PURE__ */ (0, import_jsx_runtime163.jsx)( 4206 import_components8.__experimentalToolsPanelItem, 4207 { 4208 label: (0, import_i18n10.__)("Loop"), 4209 isShownByDefault: true, 4210 hasValue: () => !!loop, 4211 onDeselect: () => setAttributes({ 4212 loop: false 4213 }), 4214 children: /* @__PURE__ */ (0, import_jsx_runtime163.jsx)( 4215 import_components8.ToggleControl, 4216 { 4217 label: (0, import_i18n10.__)("Loop"), 4218 onChange: toggleAttribute("loop"), 4219 checked: !!loop 4220 } 4221 ) 4222 } 4223 ), 4224 /* @__PURE__ */ (0, import_jsx_runtime163.jsx)( 4225 import_components8.__experimentalToolsPanelItem, 4226 { 4227 label: (0, import_i18n10.__)("Preload"), 4228 isShownByDefault: true, 4229 hasValue: () => !!preload, 4230 onDeselect: () => setAttributes({ 4231 preload: void 0 4232 }), 4233 children: /* @__PURE__ */ (0, import_jsx_runtime163.jsx)( 4234 import_components8.SelectControl, 4235 { 4236 __next40pxDefaultSize: true, 4237 label: (0, import_i18n10._x)( 4238 "Preload", 4239 "noun; Audio block parameter" 4240 ), 4241 value: preload || "", 4242 onChange: (value) => setAttributes({ 4243 preload: value || void 0 4244 }), 4245 options: [ 4246 { value: "", label: (0, import_i18n10.__)("Browser default") }, 4247 { value: "auto", label: (0, import_i18n10.__)("Auto") }, 4248 { value: "metadata", label: (0, import_i18n10.__)("Metadata") }, 4249 { 4250 value: "none", 4251 label: (0, import_i18n10._x)("None", "Preload value") 4252 } 4253 ] 4254 } 4255 ) 4256 } 4257 ) 4258 ] 4259 } 4260 ) }), 4261 /* @__PURE__ */ (0, import_jsx_runtime163.jsxs)("figure", { ...blockProps, children: [ 4262 /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(import_components8.Disabled, { isDisabled: !isSingleSelected, children: /* @__PURE__ */ (0, import_jsx_runtime163.jsx)("audio", { controls: "controls", src: src ?? temporaryURL }) }), 4263 !!temporaryURL && /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(import_components8.Spinner, {}), 4264 /* @__PURE__ */ (0, import_jsx_runtime163.jsx)( 4265 Caption, 4266 { 4267 attributes: attributes3, 4268 setAttributes, 4269 isSelected: isSingleSelected, 4270 insertBlocksAfter, 4271 label: (0, import_i18n10.__)("Audio caption text"), 4272 showToolbarButton: isSingleSelected && hasNonContentControls 4273 } 4274 ) 4275 ] }) 4276 ] }); 4277 } 4278 var edit_default = AudioEdit; 4279 4280 // packages/block-library/build-module/audio/block.json 4281 var block_default8 = { 4282 $schema: "https://schemas.wp.org/trunk/block.json", 4283 apiVersion: 3, 4284 name: "core/audio", 4285 title: "Audio", 4286 category: "media", 4287 description: "Embed a simple audio player.", 4288 keywords: ["music", "sound", "podcast", "recording"], 4289 textdomain: "default", 4290 attributes: { 4291 blob: { 4292 type: "string", 4293 role: "local" 4294 }, 4295 src: { 4296 type: "string", 4297 source: "attribute", 4298 selector: "audio", 4299 attribute: "src", 4300 role: "content" 4301 }, 4302 caption: { 4303 type: "rich-text", 4304 source: "rich-text", 4305 selector: "figcaption", 4306 role: "content" 4307 }, 4308 id: { 4309 type: "number", 4310 role: "content" 4311 }, 4312 autoplay: { 4313 type: "boolean", 4314 source: "attribute", 4315 selector: "audio", 4316 attribute: "autoplay" 4317 }, 4318 loop: { 4319 type: "boolean", 4320 source: "attribute", 4321 selector: "audio", 4322 attribute: "loop" 4323 }, 4324 preload: { 4325 type: "string", 4326 source: "attribute", 4327 selector: "audio", 4328 attribute: "preload" 4329 } 4330 }, 4331 supports: { 4332 anchor: true, 4333 align: true, 4334 spacing: { 4335 margin: true, 4336 padding: true, 4337 __experimentalDefaultControls: { 4338 margin: false, 4339 padding: false 4340 } 4341 }, 4342 interactivity: { 4343 clientNavigation: true 4344 } 4345 }, 4346 editorStyle: "wp-block-audio-editor", 4347 style: "wp-block-audio" 4348 }; 4349 4350 // packages/block-library/build-module/audio/save.js 4351 var import_block_editor16 = __toESM(require_block_editor()); 4352 var import_jsx_runtime164 = __toESM(require_jsx_runtime()); 4353 function save5({ attributes: attributes3 }) { 4354 const { autoplay, caption, loop, preload, src } = attributes3; 4355 return src && /* @__PURE__ */ (0, import_jsx_runtime164.jsxs)("figure", { ...import_block_editor16.useBlockProps.save(), children: [ 4356 /* @__PURE__ */ (0, import_jsx_runtime164.jsx)( 4357 "audio", 4358 { 4359 controls: "controls", 4360 src, 4361 autoPlay: autoplay, 4362 loop, 4363 preload 4364 } 4365 ), 4366 !import_block_editor16.RichText.isEmpty(caption) && /* @__PURE__ */ (0, import_jsx_runtime164.jsx)( 4367 import_block_editor16.RichText.Content, 4368 { 4369 tagName: "figcaption", 4370 value: caption, 4371 className: (0, import_block_editor16.__experimentalGetElementClassName)( 4372 "caption" 4373 ) 4374 } 4375 ) 4376 ] }); 4377 } 4378 4379 // packages/block-library/build-module/audio/transforms.js 4380 var import_blob3 = __toESM(require_blob()); 4381 var import_blocks5 = __toESM(require_blocks()); 4382 var transforms = { 4383 from: [ 4384 { 4385 type: "files", 4386 isMatch(files) { 4387 return files.length === 1 && files[0].type.indexOf("audio/") === 0; 4388 }, 4389 transform(files) { 4390 const file = files[0]; 4391 const block = (0, import_blocks5.createBlock)("core/audio", { 4392 blob: (0, import_blob3.createBlobURL)(file) 4393 }); 4394 return block; 4395 } 4396 }, 4397 { 4398 type: "shortcode", 4399 tag: "audio", 4400 attributes: { 4401 src: { 4402 type: "string", 4403 shortcode: ({ 4404 named: { src, mp3, m4a, ogg, wav, wma } 4405 }) => { 4406 return src || mp3 || m4a || ogg || wav || wma; 4407 } 4408 }, 4409 loop: { 4410 type: "string", 4411 shortcode: ({ named: { loop } }) => { 4412 return loop; 4413 } 4414 }, 4415 autoplay: { 4416 type: "string", 4417 shortcode: ({ named: { autoplay } }) => { 4418 return autoplay; 4419 } 4420 }, 4421 preload: { 4422 type: "string", 4423 shortcode: ({ named: { preload } }) => { 4424 return preload; 4425 } 4426 } 4427 } 4428 } 4429 ] 4430 }; 4431 var transforms_default = transforms; 4432 4433 // packages/block-library/build-module/audio/index.js 4434 var { fieldsKey, formKey } = unlock(import_blocks6.privateApis); 4435 var { name: name7 } = block_default8; 4436 var settings7 = { 4437 icon: audio_default, 4438 example: { 4439 attributes: { 4440 src: "https://upload.wikimedia.org/wikipedia/commons/d/dd/Armstrong_Small_Step.ogg" 4441 }, 4442 viewportWidth: 350 4443 }, 4444 transforms: transforms_default, 4445 deprecated: deprecated_default2, 4446 edit: edit_default, 4447 save: save5 4448 }; 4449 if (window.__experimentalContentOnlyInspectorFields) { 4450 settings7[fieldsKey] = [ 4451 { 4452 id: "audio", 4453 label: (0, import_i18n11.__)("Audio"), 4454 type: "media", 4455 mapping: { 4456 id: "id", 4457 url: "src" 4458 }, 4459 args: { 4460 allowedTypes: ["audio"], 4461 multiple: false 4462 } 4463 }, 4464 { 4465 id: "caption", 4466 label: (0, import_i18n11.__)("Caption"), 4467 type: "richtext" 4468 } 4469 ]; 4470 settings7[formKey] = { 4471 fields: ["audio"] 4472 }; 4473 } 4474 var init7 = () => initBlock({ name: name7, metadata: block_default8, settings: settings7 }); 4475 4476 // packages/block-library/build-module/breadcrumbs/index.js 4477 var breadcrumbs_exports = {}; 4478 __export(breadcrumbs_exports, { 4479 init: () => init8, 4480 metadata: () => block_default9, 4481 name: () => name8, 4482 settings: () => settings8 4483 }); 4484 4485 // packages/block-library/build-module/breadcrumbs/block.json 4486 var block_default9 = { 4487 $schema: "https://schemas.wp.org/trunk/block.json", 4488 apiVersion: 3, 4489 name: "core/breadcrumbs", 4490 title: "Breadcrumbs", 4491 __experimental: true, 4492 category: "theme", 4493 description: "Display a breadcrumb trail for hierarchical post types or based on taxonomy terms.", 4494 textdomain: "default", 4495 attributes: { 4496 prefersTaxonomy: { 4497 type: "boolean", 4498 default: false 4499 }, 4500 separator: { 4501 type: "string", 4502 default: "/" 4503 }, 4504 showHomeItem: { 4505 type: "boolean", 4506 default: true 4507 }, 4508 showCurrentItem: { 4509 type: "boolean", 4510 default: true 4511 }, 4512 showOnHomePage: { 4513 type: "boolean", 4514 default: false 4515 } 4516 }, 4517 usesContext: ["postId", "postType", "templateSlug"], 4518 supports: { 4519 html: false, 4520 align: ["wide", "full"], 4521 spacing: { 4522 margin: true, 4523 padding: true 4524 }, 4525 color: { 4526 gradients: true, 4527 link: true, 4528 __experimentalDefaultControls: { 4529 background: true, 4530 text: true 4531 } 4532 }, 4533 __experimentalBorder: { 4534 radius: true, 4535 color: true, 4536 width: true, 4537 style: true, 4538 __experimentalDefaultControls: { 4539 radius: false, 4540 color: true, 4541 width: true, 4542 style: true 4543 } 4544 }, 4545 typography: { 4546 fontSize: true, 4547 lineHeight: true, 4548 __experimentalFontFamily: true, 4549 __experimentalFontWeight: true, 4550 __experimentalFontStyle: true, 4551 __experimentalTextTransform: true, 4552 __experimentalTextDecoration: true, 4553 __experimentalLetterSpacing: true, 4554 __experimentalDefaultControls: { 4555 fontSize: true 4556 } 4557 }, 4558 interactivity: { 4559 clientNavigation: true 4560 } 4561 }, 4562 style: "wp-block-breadcrumbs" 4563 }; 4564 4565 // packages/block-library/build-module/breadcrumbs/edit.js 4566 var import_i18n12 = __toESM(require_i18n()); 4567 var import_block_editor17 = __toESM(require_block_editor()); 4568 var import_components9 = __toESM(require_components()); 4569 var import_data7 = __toESM(require_data()); 4570 var import_core_data4 = __toESM(require_core_data()); 4571 var import_element9 = __toESM(require_element()); 4572 var import_server_side_render2 = __toESM(require_server_side_render()); 4573 var import_jsx_runtime165 = __toESM(require_jsx_runtime()); 4574 var separatorDefaultValue = "/"; 4575 function BreadcrumbEdit({ 4576 attributes: attributes3, 4577 setAttributes, 4578 context: { postId, postType, templateSlug } 4579 }) { 4580 const { 4581 separator, 4582 showHomeItem, 4583 showCurrentItem, 4584 prefersTaxonomy, 4585 showOnHomePage 4586 } = attributes3; 4587 const { 4588 post, 4589 isPostTypeHierarchical, 4590 postTypeHasTaxonomies, 4591 hasTermsAssigned, 4592 isLoading 4593 } = (0, import_data7.useSelect)( 4594 (select9) => { 4595 if (!postType) { 4596 return {}; 4597 } 4598 const _post = select9(import_core_data4.store).getEntityRecord( 4599 "postType", 4600 postType, 4601 postId 4602 ); 4603 const postTypeObject = select9(import_core_data4.store).getPostType(postType); 4604 const _postTypeHasTaxonomies = postTypeObject && postTypeObject.taxonomies.length; 4605 let taxonomies; 4606 if (_postTypeHasTaxonomies) { 4607 taxonomies = select9(import_core_data4.store).getTaxonomies({ 4608 type: postType, 4609 per_page: -1 4610 }); 4611 } 4612 return { 4613 post: _post, 4614 isPostTypeHierarchical: postTypeObject?.hierarchical, 4615 postTypeHasTaxonomies: _postTypeHasTaxonomies, 4616 hasTermsAssigned: _post && (taxonomies || []).filter( 4617 ({ visibility }) => visibility?.publicly_queryable 4618 ).some((taxonomy) => { 4619 return !!_post[taxonomy.rest_base]?.length; 4620 }), 4621 isLoading: postId && !_post || !postTypeObject || _postTypeHasTaxonomies && !taxonomies 4622 }; 4623 }, 4624 [postType, postId] 4625 ); 4626 const [invalidationKey, setInvalidationKey] = (0, import_element9.useState)(0); 4627 (0, import_element9.useEffect)(() => { 4628 setInvalidationKey((c2) => c2 + 1); 4629 }, [post]); 4630 const blockProps = (0, import_block_editor17.useBlockProps)(); 4631 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 4632 const { content } = (0, import_server_side_render2.useServerSideRender)({ 4633 attributes: attributes3, 4634 skipBlockSupportAttributes: true, 4635 block: "core/breadcrumbs", 4636 urlQueryArgs: { post_id: postId, invalidationKey } 4637 }); 4638 if (isLoading) { 4639 return /* @__PURE__ */ (0, import_jsx_runtime165.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime165.jsx)(import_components9.Spinner, {}) }); 4640 } 4641 let _showTerms; 4642 if (!isPostTypeHierarchical && !post?.parent) { 4643 _showTerms = true; 4644 } else if (!postTypeHasTaxonomies) { 4645 _showTerms = false; 4646 } else { 4647 _showTerms = prefersTaxonomy; 4648 } 4649 let placeholder2 = null; 4650 const showPlaceholder = !postId || !postType || // When `templateSlug` is set only show placeholder if the post type is not. 4651 // This is needed because when we are showing the template in post editor we 4652 // want to show the real breadcrumbs if we have the post type. 4653 templateSlug && !postType || !_showTerms && !isPostTypeHierarchical || _showTerms && !hasTermsAssigned; 4654 if (showPlaceholder) { 4655 const placeholderItems = []; 4656 if (showHomeItem) { 4657 placeholderItems.push((0, import_i18n12.__)("Home")); 4658 } 4659 if (templateSlug && !postId) { 4660 placeholderItems.push((0, import_i18n12.__)("Page")); 4661 } else if (_showTerms) { 4662 placeholderItems.push((0, import_i18n12.__)("Category")); 4663 } else { 4664 placeholderItems.push((0, import_i18n12.__)("Ancestor"), (0, import_i18n12.__)("Parent")); 4665 } 4666 placeholder2 = /* @__PURE__ */ (0, import_jsx_runtime165.jsx)( 4667 "nav", 4668 { 4669 style: { 4670 "--separator": `'$separator}'` 4671 }, 4672 inert: "true", 4673 children: /* @__PURE__ */ (0, import_jsx_runtime165.jsxs)("ol", { children: [ 4674 placeholderItems.map((text, index) => /* @__PURE__ */ (0, import_jsx_runtime165.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime165.jsx)("a", { href: `#breadcrumbs-pseudo-link-$index}`, children: text }) }, index)), 4675 showCurrentItem && /* @__PURE__ */ (0, import_jsx_runtime165.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime165.jsx)("span", { "aria-current": "page", children: (0, import_i18n12.__)("Current") }) }) 4676 ] }) 4677 } 4678 ); 4679 } 4680 return /* @__PURE__ */ (0, import_jsx_runtime165.jsxs)(import_jsx_runtime165.Fragment, { children: [ 4681 /* @__PURE__ */ (0, import_jsx_runtime165.jsx)(import_block_editor17.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime165.jsxs)( 4682 import_components9.__experimentalToolsPanel, 4683 { 4684 label: (0, import_i18n12.__)("Settings"), 4685 resetAll: () => { 4686 setAttributes({ 4687 separator: separatorDefaultValue, 4688 showHomeItem: true, 4689 showCurrentItem: true 4690 }); 4691 }, 4692 dropdownMenuProps, 4693 children: [ 4694 /* @__PURE__ */ (0, import_jsx_runtime165.jsx)( 4695 import_components9.__experimentalToolsPanelItem, 4696 { 4697 label: (0, import_i18n12.__)("Show home breadcrumb"), 4698 isShownByDefault: true, 4699 hasValue: () => !showHomeItem, 4700 onDeselect: () => setAttributes({ 4701 showHomeItem: true 4702 }), 4703 children: /* @__PURE__ */ (0, import_jsx_runtime165.jsx)( 4704 import_components9.ToggleControl, 4705 { 4706 label: (0, import_i18n12.__)("Show home breadcrumb"), 4707 onChange: (value) => setAttributes({ showHomeItem: value }), 4708 checked: showHomeItem 4709 } 4710 ) 4711 } 4712 ), 4713 /* @__PURE__ */ (0, import_jsx_runtime165.jsx)( 4714 import_components9.__experimentalToolsPanelItem, 4715 { 4716 label: (0, import_i18n12.__)("Show current breadcrumb"), 4717 isShownByDefault: true, 4718 hasValue: () => !showCurrentItem, 4719 onDeselect: () => setAttributes({ 4720 showCurrentItem: true 4721 }), 4722 children: /* @__PURE__ */ (0, import_jsx_runtime165.jsx)( 4723 import_components9.ToggleControl, 4724 { 4725 label: (0, import_i18n12.__)("Show current breadcrumb"), 4726 onChange: (value) => setAttributes({ showCurrentItem: value }), 4727 checked: showCurrentItem 4728 } 4729 ) 4730 } 4731 ), 4732 /* @__PURE__ */ (0, import_jsx_runtime165.jsx)( 4733 import_components9.__experimentalToolsPanelItem, 4734 { 4735 label: (0, import_i18n12.__)("Separator"), 4736 isShownByDefault: true, 4737 hasValue: () => separator !== separatorDefaultValue, 4738 onDeselect: () => setAttributes({ 4739 separator: separatorDefaultValue 4740 }), 4741 children: /* @__PURE__ */ (0, import_jsx_runtime165.jsx)( 4742 import_components9.TextControl, 4743 { 4744 __next40pxDefaultSize: true, 4745 autoComplete: "off", 4746 label: (0, import_i18n12.__)("Separator"), 4747 value: separator, 4748 onChange: (value) => setAttributes({ separator: value }), 4749 onBlur: () => { 4750 if (!separator) { 4751 setAttributes({ 4752 separator: separatorDefaultValue 4753 }); 4754 } 4755 } 4756 } 4757 ) 4758 } 4759 ) 4760 ] 4761 } 4762 ) }), 4763 /* @__PURE__ */ (0, import_jsx_runtime165.jsxs)(import_block_editor17.InspectorControls, { group: "advanced", children: [ 4764 /* @__PURE__ */ (0, import_jsx_runtime165.jsx)( 4765 import_components9.CheckboxControl, 4766 { 4767 label: (0, import_i18n12.__)("Show on homepage"), 4768 checked: showOnHomePage, 4769 onChange: (value) => setAttributes({ showOnHomePage: value }), 4770 help: (0, import_i18n12.__)( 4771 "If this breadcrumbs block appears in a template or template part that\u2019s shown on the homepage, enable this option to display the breadcrumb trail. Otherwise, this setting has no effect." 4772 ) 4773 } 4774 ), 4775 /* @__PURE__ */ (0, import_jsx_runtime165.jsx)( 4776 import_components9.CheckboxControl, 4777 { 4778 label: (0, import_i18n12.__)("Prefer taxonomy terms"), 4779 checked: prefersTaxonomy, 4780 onChange: (value) => setAttributes({ prefersTaxonomy: value }), 4781 help: (0, import_i18n12.__)( 4782 "The exact type of breadcrumbs shown will vary automatically depending on the page in which this block is displayed. In the specific case of a hierarchical post type with taxonomies, the breadcrumbs can either reflect its post hierarchy (default) or the hierarchy of its assigned taxonomy terms." 4783 ) 4784 } 4785 ) 4786 ] }), 4787 /* @__PURE__ */ (0, import_jsx_runtime165.jsx)("div", { ...blockProps, children: showPlaceholder ? placeholder2 : /* @__PURE__ */ (0, import_jsx_runtime165.jsx)(import_element9.RawHTML, { inert: "true", children: content }) }) 4788 ] }); 4789 } 4790 4791 // packages/block-library/build-module/breadcrumbs/index.js 4792 var { name: name8 } = block_default9; 4793 var settings8 = { 4794 icon: breadcrumbs_default, 4795 edit: BreadcrumbEdit 4796 }; 4797 var init8 = () => initBlock({ name: name8, metadata: block_default9, settings: settings8 }); 4798 4799 // packages/block-library/build-module/button/index.js 4800 var button_exports = {}; 4801 __export(button_exports, { 4802 init: () => init9, 4803 metadata: () => block_default10, 4804 name: () => name9, 4805 settings: () => settings9 4806 }); 4807 var import_i18n14 = __toESM(require_i18n()); 4808 var import_blocks8 = __toESM(require_blocks()); 4809 4810 // packages/block-library/build-module/button/deprecated.js 4811 var import_block_editor19 = __toESM(require_block_editor()); 4812 var import_compose4 = __toESM(require_compose()); 4813 4814 // packages/block-library/build-module/utils/migrate-font-family.js 4815 var import_block_editor18 = __toESM(require_block_editor()); 4816 var { cleanEmptyObject } = unlock(import_block_editor18.privateApis); 4817 function migrate_font_family_default(attributes3) { 4818 if (!attributes3?.style?.typography?.fontFamily) { 4819 return attributes3; 4820 } 4821 const { fontFamily, ...typography } = attributes3.style.typography; 4822 return { 4823 ...attributes3, 4824 style: cleanEmptyObject({ 4825 ...attributes3.style, 4826 typography 4827 }), 4828 fontFamily: fontFamily.split("|").pop() 4829 }; 4830 } 4831 4832 // packages/block-library/build-module/utils/migrate-text-align.js 4833 function migrate_text_align_default(attributes3) { 4834 const { textAlign, ...restAttributes } = attributes3; 4835 if (!textAlign) { 4836 return attributes3; 4837 } 4838 return { 4839 ...restAttributes, 4840 style: { 4841 ...attributes3.style, 4842 typography: { 4843 ...attributes3.style?.typography, 4844 textAlign 4845 } 4846 } 4847 }; 4848 } 4849 4850 // packages/block-library/build-module/button/deprecated.js 4851 var import_jsx_runtime166 = __toESM(require_jsx_runtime()); 4852 var migrateBorderRadius = (attributes3) => { 4853 const { borderRadius, ...newAttributes } = attributes3; 4854 const oldBorderRadius = [ 4855 borderRadius, 4856 newAttributes.style?.border?.radius 4857 ].find((possibleBorderRadius) => { 4858 return typeof possibleBorderRadius === "number" && possibleBorderRadius !== 0; 4859 }); 4860 if (!oldBorderRadius) { 4861 return newAttributes; 4862 } 4863 return { 4864 ...newAttributes, 4865 style: { 4866 ...newAttributes.style, 4867 border: { 4868 ...newAttributes.style?.border, 4869 radius: `$oldBorderRadius}px` 4870 } 4871 } 4872 }; 4873 }; 4874 function migrateAlign(attributes3) { 4875 if (!attributes3.align) { 4876 return attributes3; 4877 } 4878 const { align, ...otherAttributes } = attributes3; 4879 return { 4880 ...otherAttributes, 4881 className: clsx_default( 4882 otherAttributes.className, 4883 `align$attributes3.align}` 4884 ) 4885 }; 4886 } 4887 var migrateCustomColorsAndGradients = (attributes3) => { 4888 if (!attributes3.customTextColor && !attributes3.customBackgroundColor && !attributes3.customGradient) { 4889 return attributes3; 4890 } 4891 const style2 = { color: {} }; 4892 if (attributes3.customTextColor) { 4893 style2.color.text = attributes3.customTextColor; 4894 } 4895 if (attributes3.customBackgroundColor) { 4896 style2.color.background = attributes3.customBackgroundColor; 4897 } 4898 if (attributes3.customGradient) { 4899 style2.color.gradient = attributes3.customGradient; 4900 } 4901 const { 4902 customTextColor, 4903 customBackgroundColor, 4904 customGradient, 4905 ...restAttributes 4906 } = attributes3; 4907 return { 4908 ...restAttributes, 4909 style: style2 4910 }; 4911 }; 4912 var oldColorsMigration = (attributes3) => { 4913 const { color, textColor, ...restAttributes } = { 4914 ...attributes3, 4915 customTextColor: attributes3.textColor && "#" === attributes3.textColor[0] ? attributes3.textColor : void 0, 4916 customBackgroundColor: attributes3.color && "#" === attributes3.color[0] ? attributes3.color : void 0 4917 }; 4918 return migrateCustomColorsAndGradients(restAttributes); 4919 }; 4920 var blockAttributes = { 4921 url: { 4922 type: "string", 4923 source: "attribute", 4924 selector: "a", 4925 attribute: "href" 4926 }, 4927 title: { 4928 type: "string", 4929 source: "attribute", 4930 selector: "a", 4931 attribute: "title" 4932 }, 4933 text: { 4934 type: "string", 4935 source: "html", 4936 selector: "a" 4937 } 4938 }; 4939 var v13 = { 4940 attributes: { 4941 tagName: { 4942 type: "string", 4943 enum: ["a", "button"], 4944 default: "a" 4945 }, 4946 type: { 4947 type: "string", 4948 default: "button" 4949 }, 4950 textAlign: { 4951 type: "string" 4952 }, 4953 url: { 4954 type: "string", 4955 source: "attribute", 4956 selector: "a", 4957 attribute: "href", 4958 role: "content" 4959 }, 4960 title: { 4961 type: "string", 4962 source: "attribute", 4963 selector: "a,button", 4964 attribute: "title", 4965 role: "content" 4966 }, 4967 text: { 4968 type: "rich-text", 4969 source: "rich-text", 4970 selector: "a,button", 4971 role: "content" 4972 }, 4973 linkTarget: { 4974 type: "string", 4975 source: "attribute", 4976 selector: "a", 4977 attribute: "target", 4978 role: "content" 4979 }, 4980 rel: { 4981 type: "string", 4982 source: "attribute", 4983 selector: "a", 4984 attribute: "rel", 4985 role: "content" 4986 }, 4987 placeholder: { 4988 type: "string" 4989 }, 4990 backgroundColor: { 4991 type: "string" 4992 }, 4993 textColor: { 4994 type: "string" 4995 }, 4996 gradient: { 4997 type: "string" 4998 }, 4999 width: { 5000 type: "number" 5001 } 5002 }, 5003 supports: { 5004 anchor: true, 5005 align: true, 5006 alignWide: false, 5007 color: { 5008 __experimentalSkipSerialization: true, 5009 gradients: true, 5010 __experimentalDefaultControls: { 5011 background: true, 5012 text: true 5013 } 5014 }, 5015 typography: { 5016 __experimentalSkipSerialization: [ 5017 "fontSize", 5018 "lineHeight", 5019 "fontFamily", 5020 "fontWeight", 5021 "fontStyle", 5022 "textTransform", 5023 "textDecoration", 5024 "letterSpacing" 5025 ], 5026 fontSize: true, 5027 lineHeight: true, 5028 __experimentalFontFamily: true, 5029 __experimentalFontWeight: true, 5030 __experimentalFontStyle: true, 5031 __experimentalTextTransform: true, 5032 __experimentalTextDecoration: true, 5033 __experimentalLetterSpacing: true, 5034 __experimentalWritingMode: true, 5035 __experimentalDefaultControls: { 5036 fontSize: true 5037 } 5038 }, 5039 reusable: false, 5040 shadow: { 5041 __experimentalSkipSerialization: true 5042 }, 5043 spacing: { 5044 __experimentalSkipSerialization: true, 5045 padding: ["horizontal", "vertical"], 5046 __experimentalDefaultControls: { 5047 padding: true 5048 } 5049 }, 5050 __experimentalBorder: { 5051 color: true, 5052 radius: true, 5053 style: true, 5054 width: true, 5055 __experimentalSkipSerialization: true, 5056 __experimentalDefaultControls: { 5057 color: true, 5058 radius: true, 5059 style: true, 5060 width: true 5061 } 5062 }, 5063 interactivity: { 5064 clientNavigation: true 5065 } 5066 }, 5067 selectors: { 5068 root: ".wp-block-button .wp-block-button__link", 5069 typography: { 5070 writingMode: ".wp-block-button" 5071 } 5072 }, 5073 save({ attributes: attributes3, className }) { 5074 const { 5075 tagName, 5076 type, 5077 textAlign, 5078 fontSize, 5079 linkTarget, 5080 rel, 5081 style: style2, 5082 text, 5083 title, 5084 url, 5085 width 5086 } = attributes3; 5087 const TagName2 = tagName || "a"; 5088 const isButtonTag = "button" === TagName2; 5089 const buttonType = type || "button"; 5090 const borderProps = (0, import_block_editor19.__experimentalGetBorderClassesAndStyles)(attributes3); 5091 const colorProps = (0, import_block_editor19.__experimentalGetColorClassesAndStyles)(attributes3); 5092 const spacingProps = (0, import_block_editor19.__experimentalGetSpacingClassesAndStyles)(attributes3); 5093 const shadowProps = (0, import_block_editor19.__experimentalGetShadowClassesAndStyles)(attributes3); 5094 const typographyProps = (0, import_block_editor19.getTypographyClassesAndStyles)(attributes3); 5095 const buttonClasses = clsx_default( 5096 "wp-block-button__link", 5097 colorProps.className, 5098 borderProps.className, 5099 typographyProps.className, 5100 { 5101 [`has-text-align-$textAlign}`]: textAlign, 5102 // For backwards compatibility add style that isn't provided via 5103 // block support. 5104 "no-border-radius": style2?.border?.radius === 0, 5105 [`has-custom-font-size`]: fontSize || style2?.typography?.fontSize 5106 }, 5107 (0, import_block_editor19.__experimentalGetElementClassName)("button") 5108 ); 5109 const buttonStyle = { 5110 ...borderProps.style, 5111 ...colorProps.style, 5112 ...spacingProps.style, 5113 ...shadowProps.style, 5114 ...typographyProps.style, 5115 writingMode: void 0 5116 }; 5117 const wrapperClasses = clsx_default(className, { 5118 [`has-custom-width wp-block-button__width-$width}`]: width 5119 }); 5120 return /* @__PURE__ */ (0, import_jsx_runtime166.jsx)("div", { ...import_block_editor19.useBlockProps.save({ className: wrapperClasses }), children: /* @__PURE__ */ (0, import_jsx_runtime166.jsx)( 5121 import_block_editor19.RichText.Content, 5122 { 5123 tagName: TagName2, 5124 type: isButtonTag ? buttonType : null, 5125 className: buttonClasses, 5126 href: isButtonTag ? null : url, 5127 title, 5128 style: buttonStyle, 5129 value: text, 5130 target: isButtonTag ? null : linkTarget, 5131 rel: isButtonTag ? null : rel 5132 } 5133 ) }); 5134 }, 5135 isEligible(attributes3) { 5136 return !!attributes3.textAlign; 5137 }, 5138 migrate: migrate_text_align_default 5139 }; 5140 var v12 = { 5141 attributes: { 5142 tagName: { 5143 type: "string", 5144 enum: ["a", "button"], 5145 default: "a" 5146 }, 5147 type: { 5148 type: "string", 5149 default: "button" 5150 }, 5151 textAlign: { 5152 type: "string" 5153 }, 5154 url: { 5155 type: "string", 5156 source: "attribute", 5157 selector: "a", 5158 attribute: "href" 5159 }, 5160 title: { 5161 type: "string", 5162 source: "attribute", 5163 selector: "a,button", 5164 attribute: "title", 5165 role: "content" 5166 }, 5167 text: { 5168 type: "rich-text", 5169 source: "rich-text", 5170 selector: "a,button", 5171 role: "content" 5172 }, 5173 linkTarget: { 5174 type: "string", 5175 source: "attribute", 5176 selector: "a", 5177 attribute: "target", 5178 role: "content" 5179 }, 5180 rel: { 5181 type: "string", 5182 source: "attribute", 5183 selector: "a", 5184 attribute: "rel", 5185 role: "content" 5186 }, 5187 placeholder: { 5188 type: "string" 5189 }, 5190 backgroundColor: { 5191 type: "string" 5192 }, 5193 textColor: { 5194 type: "string" 5195 }, 5196 gradient: { 5197 type: "string" 5198 }, 5199 width: { 5200 type: "number" 5201 } 5202 }, 5203 supports: { 5204 anchor: true, 5205 align: true, 5206 alignWide: false, 5207 color: { 5208 __experimentalSkipSerialization: true, 5209 gradients: true, 5210 __experimentalDefaultControls: { 5211 background: true, 5212 text: true 5213 } 5214 }, 5215 typography: { 5216 fontSize: true, 5217 lineHeight: true, 5218 __experimentalFontFamily: true, 5219 __experimentalFontWeight: true, 5220 __experimentalFontStyle: true, 5221 __experimentalTextTransform: true, 5222 __experimentalTextDecoration: true, 5223 __experimentalLetterSpacing: true, 5224 __experimentalWritingMode: true, 5225 __experimentalDefaultControls: { 5226 fontSize: true 5227 } 5228 }, 5229 reusable: false, 5230 shadow: { 5231 __experimentalSkipSerialization: true 5232 }, 5233 spacing: { 5234 __experimentalSkipSerialization: true, 5235 padding: ["horizontal", "vertical"], 5236 __experimentalDefaultControls: { 5237 padding: true 5238 } 5239 }, 5240 __experimentalBorder: { 5241 color: true, 5242 radius: true, 5243 style: true, 5244 width: true, 5245 __experimentalSkipSerialization: true, 5246 __experimentalDefaultControls: { 5247 color: true, 5248 radius: true, 5249 style: true, 5250 width: true 5251 } 5252 }, 5253 __experimentalSelector: ".wp-block-button__link", 5254 interactivity: { 5255 clientNavigation: true 5256 } 5257 }, 5258 save({ attributes: attributes3, className }) { 5259 const { 5260 tagName, 5261 type, 5262 textAlign, 5263 fontSize, 5264 linkTarget, 5265 rel, 5266 style: style2, 5267 text, 5268 title, 5269 url, 5270 width 5271 } = attributes3; 5272 const TagName2 = tagName || "a"; 5273 const isButtonTag = "button" === TagName2; 5274 const buttonType = type || "button"; 5275 const borderProps = (0, import_block_editor19.__experimentalGetBorderClassesAndStyles)(attributes3); 5276 const colorProps = (0, import_block_editor19.__experimentalGetColorClassesAndStyles)(attributes3); 5277 const spacingProps = (0, import_block_editor19.__experimentalGetSpacingClassesAndStyles)(attributes3); 5278 const shadowProps = (0, import_block_editor19.__experimentalGetShadowClassesAndStyles)(attributes3); 5279 const buttonClasses = clsx_default( 5280 "wp-block-button__link", 5281 colorProps.className, 5282 borderProps.className, 5283 { 5284 [`has-text-align-$textAlign}`]: textAlign, 5285 // For backwards compatibility add style that isn't provided via 5286 // block support. 5287 "no-border-radius": style2?.border?.radius === 0 5288 }, 5289 (0, import_block_editor19.__experimentalGetElementClassName)("button") 5290 ); 5291 const buttonStyle = { 5292 ...borderProps.style, 5293 ...colorProps.style, 5294 ...spacingProps.style, 5295 ...shadowProps.style 5296 }; 5297 const wrapperClasses = clsx_default(className, { 5298 [`has-custom-width wp-block-button__width-$width}`]: width, 5299 [`has-custom-font-size`]: fontSize || style2?.typography?.fontSize 5300 }); 5301 return /* @__PURE__ */ (0, import_jsx_runtime166.jsx)("div", { ...import_block_editor19.useBlockProps.save({ className: wrapperClasses }), children: /* @__PURE__ */ (0, import_jsx_runtime166.jsx)( 5302 import_block_editor19.RichText.Content, 5303 { 5304 tagName: TagName2, 5305 type: isButtonTag ? buttonType : null, 5306 className: buttonClasses, 5307 href: isButtonTag ? null : url, 5308 title, 5309 style: buttonStyle, 5310 value: text, 5311 target: isButtonTag ? null : linkTarget, 5312 rel: isButtonTag ? null : rel 5313 } 5314 ) }); 5315 } 5316 }; 5317 var v11 = { 5318 attributes: { 5319 url: { 5320 type: "string", 5321 source: "attribute", 5322 selector: "a", 5323 attribute: "href" 5324 }, 5325 title: { 5326 type: "string", 5327 source: "attribute", 5328 selector: "a", 5329 attribute: "title" 5330 }, 5331 text: { 5332 type: "string", 5333 source: "html", 5334 selector: "a" 5335 }, 5336 linkTarget: { 5337 type: "string", 5338 source: "attribute", 5339 selector: "a", 5340 attribute: "target" 5341 }, 5342 rel: { 5343 type: "string", 5344 source: "attribute", 5345 selector: "a", 5346 attribute: "rel" 5347 }, 5348 placeholder: { 5349 type: "string" 5350 }, 5351 backgroundColor: { 5352 type: "string" 5353 }, 5354 textColor: { 5355 type: "string" 5356 }, 5357 gradient: { 5358 type: "string" 5359 }, 5360 width: { 5361 type: "number" 5362 } 5363 }, 5364 supports: { 5365 anchor: true, 5366 align: true, 5367 alignWide: false, 5368 color: { 5369 __experimentalSkipSerialization: true, 5370 gradients: true, 5371 __experimentalDefaultControls: { 5372 background: true, 5373 text: true 5374 } 5375 }, 5376 typography: { 5377 fontSize: true, 5378 __experimentalFontFamily: true, 5379 __experimentalDefaultControls: { 5380 fontSize: true 5381 } 5382 }, 5383 reusable: false, 5384 spacing: { 5385 __experimentalSkipSerialization: true, 5386 padding: ["horizontal", "vertical"], 5387 __experimentalDefaultControls: { 5388 padding: true 5389 } 5390 }, 5391 __experimentalBorder: { 5392 radius: true, 5393 __experimentalSkipSerialization: true, 5394 __experimentalDefaultControls: { 5395 radius: true 5396 } 5397 }, 5398 __experimentalSelector: ".wp-block-button__link" 5399 }, 5400 save({ attributes: attributes3, className }) { 5401 const { fontSize, linkTarget, rel, style: style2, text, title, url, width } = attributes3; 5402 if (!text) { 5403 return null; 5404 } 5405 const borderProps = (0, import_block_editor19.__experimentalGetBorderClassesAndStyles)(attributes3); 5406 const colorProps = (0, import_block_editor19.__experimentalGetColorClassesAndStyles)(attributes3); 5407 const spacingProps = (0, import_block_editor19.__experimentalGetSpacingClassesAndStyles)(attributes3); 5408 const buttonClasses = clsx_default( 5409 "wp-block-button__link", 5410 colorProps.className, 5411 borderProps.className, 5412 { 5413 // For backwards compatibility add style that isn't provided via 5414 // block support. 5415 "no-border-radius": style2?.border?.radius === 0 5416 } 5417 ); 5418 const buttonStyle = { 5419 ...borderProps.style, 5420 ...colorProps.style, 5421 ...spacingProps.style 5422 }; 5423 const wrapperClasses = clsx_default(className, { 5424 [`has-custom-width wp-block-button__width-$width}`]: width, 5425 [`has-custom-font-size`]: fontSize || style2?.typography?.fontSize 5426 }); 5427 return /* @__PURE__ */ (0, import_jsx_runtime166.jsx)("div", { ...import_block_editor19.useBlockProps.save({ className: wrapperClasses }), children: /* @__PURE__ */ (0, import_jsx_runtime166.jsx)( 5428 import_block_editor19.RichText.Content, 5429 { 5430 tagName: "a", 5431 className: buttonClasses, 5432 href: url, 5433 title, 5434 style: buttonStyle, 5435 value: text, 5436 target: linkTarget, 5437 rel 5438 } 5439 ) }); 5440 } 5441 }; 5442 var v10 = { 5443 attributes: { 5444 url: { 5445 type: "string", 5446 source: "attribute", 5447 selector: "a", 5448 attribute: "href" 5449 }, 5450 title: { 5451 type: "string", 5452 source: "attribute", 5453 selector: "a", 5454 attribute: "title" 5455 }, 5456 text: { 5457 type: "string", 5458 source: "html", 5459 selector: "a" 5460 }, 5461 linkTarget: { 5462 type: "string", 5463 source: "attribute", 5464 selector: "a", 5465 attribute: "target" 5466 }, 5467 rel: { 5468 type: "string", 5469 source: "attribute", 5470 selector: "a", 5471 attribute: "rel" 5472 }, 5473 placeholder: { 5474 type: "string" 5475 }, 5476 backgroundColor: { 5477 type: "string" 5478 }, 5479 textColor: { 5480 type: "string" 5481 }, 5482 gradient: { 5483 type: "string" 5484 }, 5485 width: { 5486 type: "number" 5487 } 5488 }, 5489 supports: { 5490 anchor: true, 5491 align: true, 5492 alignWide: false, 5493 color: { 5494 __experimentalSkipSerialization: true, 5495 gradients: true 5496 }, 5497 typography: { 5498 fontSize: true, 5499 __experimentalFontFamily: true 5500 }, 5501 reusable: false, 5502 spacing: { 5503 __experimentalSkipSerialization: true, 5504 padding: ["horizontal", "vertical"], 5505 __experimentalDefaultControls: { 5506 padding: true 5507 } 5508 }, 5509 __experimentalBorder: { 5510 radius: true, 5511 __experimentalSkipSerialization: true 5512 }, 5513 __experimentalSelector: ".wp-block-button__link" 5514 }, 5515 save({ attributes: attributes3, className }) { 5516 const { fontSize, linkTarget, rel, style: style2, text, title, url, width } = attributes3; 5517 if (!text) { 5518 return null; 5519 } 5520 const borderProps = (0, import_block_editor19.__experimentalGetBorderClassesAndStyles)(attributes3); 5521 const colorProps = (0, import_block_editor19.__experimentalGetColorClassesAndStyles)(attributes3); 5522 const spacingProps = (0, import_block_editor19.__experimentalGetSpacingClassesAndStyles)(attributes3); 5523 const buttonClasses = clsx_default( 5524 "wp-block-button__link", 5525 colorProps.className, 5526 borderProps.className, 5527 { 5528 // For backwards compatibility add style that isn't provided via 5529 // block support. 5530 "no-border-radius": style2?.border?.radius === 0 5531 } 5532 ); 5533 const buttonStyle = { 5534 ...borderProps.style, 5535 ...colorProps.style, 5536 ...spacingProps.style 5537 }; 5538 const wrapperClasses = clsx_default(className, { 5539 [`has-custom-width wp-block-button__width-$width}`]: width, 5540 [`has-custom-font-size`]: fontSize || style2?.typography?.fontSize 5541 }); 5542 return /* @__PURE__ */ (0, import_jsx_runtime166.jsx)("div", { ...import_block_editor19.useBlockProps.save({ className: wrapperClasses }), children: /* @__PURE__ */ (0, import_jsx_runtime166.jsx)( 5543 import_block_editor19.RichText.Content, 5544 { 5545 tagName: "a", 5546 className: buttonClasses, 5547 href: url, 5548 title, 5549 style: buttonStyle, 5550 value: text, 5551 target: linkTarget, 5552 rel 5553 } 5554 ) }); 5555 }, 5556 migrate: migrate_font_family_default, 5557 isEligible({ style: style2 }) { 5558 return style2?.typography?.fontFamily; 5559 } 5560 }; 5561 var deprecated = [ 5562 v13, 5563 v12, 5564 v11, 5565 v10, 5566 { 5567 supports: { 5568 anchor: true, 5569 align: true, 5570 alignWide: false, 5571 color: { 5572 __experimentalSkipSerialization: true, 5573 gradients: true 5574 }, 5575 typography: { 5576 fontSize: true, 5577 __experimentalFontFamily: true 5578 }, 5579 reusable: false, 5580 __experimentalSelector: ".wp-block-button__link" 5581 }, 5582 attributes: { 5583 ...blockAttributes, 5584 linkTarget: { 5585 type: "string", 5586 source: "attribute", 5587 selector: "a", 5588 attribute: "target" 5589 }, 5590 rel: { 5591 type: "string", 5592 source: "attribute", 5593 selector: "a", 5594 attribute: "rel" 5595 }, 5596 placeholder: { 5597 type: "string" 5598 }, 5599 backgroundColor: { 5600 type: "string" 5601 }, 5602 textColor: { 5603 type: "string" 5604 }, 5605 gradient: { 5606 type: "string" 5607 }, 5608 width: { 5609 type: "number" 5610 } 5611 }, 5612 isEligible({ style: style2 }) { 5613 return typeof style2?.border?.radius === "number"; 5614 }, 5615 save({ attributes: attributes3, className }) { 5616 const { 5617 fontSize, 5618 linkTarget, 5619 rel, 5620 style: style2, 5621 text, 5622 title, 5623 url, 5624 width 5625 } = attributes3; 5626 if (!text) { 5627 return null; 5628 } 5629 const borderRadius = style2?.border?.radius; 5630 const colorProps = (0, import_block_editor19.__experimentalGetColorClassesAndStyles)(attributes3); 5631 const buttonClasses = clsx_default( 5632 "wp-block-button__link", 5633 colorProps.className, 5634 { 5635 "no-border-radius": style2?.border?.radius === 0 5636 } 5637 ); 5638 const buttonStyle = { 5639 borderRadius: borderRadius ? borderRadius : void 0, 5640 ...colorProps.style 5641 }; 5642 const wrapperClasses = clsx_default(className, { 5643 [`has-custom-width wp-block-button__width-$width}`]: width, 5644 [`has-custom-font-size`]: fontSize || style2?.typography?.fontSize 5645 }); 5646 return /* @__PURE__ */ (0, import_jsx_runtime166.jsx)("div", { ...import_block_editor19.useBlockProps.save({ className: wrapperClasses }), children: /* @__PURE__ */ (0, import_jsx_runtime166.jsx)( 5647 import_block_editor19.RichText.Content, 5648 { 5649 tagName: "a", 5650 className: buttonClasses, 5651 href: url, 5652 title, 5653 style: buttonStyle, 5654 value: text, 5655 target: linkTarget, 5656 rel 5657 } 5658 ) }); 5659 }, 5660 migrate: (0, import_compose4.compose)(migrate_font_family_default, migrateBorderRadius) 5661 }, 5662 { 5663 supports: { 5664 anchor: true, 5665 align: true, 5666 alignWide: false, 5667 color: { 5668 __experimentalSkipSerialization: true 5669 }, 5670 reusable: false, 5671 __experimentalSelector: ".wp-block-button__link" 5672 }, 5673 attributes: { 5674 ...blockAttributes, 5675 linkTarget: { 5676 type: "string", 5677 source: "attribute", 5678 selector: "a", 5679 attribute: "target" 5680 }, 5681 rel: { 5682 type: "string", 5683 source: "attribute", 5684 selector: "a", 5685 attribute: "rel" 5686 }, 5687 placeholder: { 5688 type: "string" 5689 }, 5690 borderRadius: { 5691 type: "number" 5692 }, 5693 backgroundColor: { 5694 type: "string" 5695 }, 5696 textColor: { 5697 type: "string" 5698 }, 5699 gradient: { 5700 type: "string" 5701 }, 5702 style: { 5703 type: "object" 5704 }, 5705 width: { 5706 type: "number" 5707 } 5708 }, 5709 save({ attributes: attributes3, className }) { 5710 const { borderRadius, linkTarget, rel, text, title, url, width } = attributes3; 5711 const colorProps = (0, import_block_editor19.__experimentalGetColorClassesAndStyles)(attributes3); 5712 const buttonClasses = clsx_default( 5713 "wp-block-button__link", 5714 colorProps.className, 5715 { 5716 "no-border-radius": borderRadius === 0 5717 } 5718 ); 5719 const buttonStyle = { 5720 borderRadius: borderRadius ? borderRadius + "px" : void 0, 5721 ...colorProps.style 5722 }; 5723 const wrapperClasses = clsx_default(className, { 5724 [`has-custom-width wp-block-button__width-$width}`]: width 5725 }); 5726 return /* @__PURE__ */ (0, import_jsx_runtime166.jsx)("div", { ...import_block_editor19.useBlockProps.save({ className: wrapperClasses }), children: /* @__PURE__ */ (0, import_jsx_runtime166.jsx)( 5727 import_block_editor19.RichText.Content, 5728 { 5729 tagName: "a", 5730 className: buttonClasses, 5731 href: url, 5732 title, 5733 style: buttonStyle, 5734 value: text, 5735 target: linkTarget, 5736 rel 5737 } 5738 ) }); 5739 }, 5740 migrate: (0, import_compose4.compose)(migrate_font_family_default, migrateBorderRadius) 5741 }, 5742 { 5743 supports: { 5744 anchor: true, 5745 align: true, 5746 alignWide: false, 5747 color: { 5748 __experimentalSkipSerialization: true 5749 }, 5750 reusable: false, 5751 __experimentalSelector: ".wp-block-button__link" 5752 }, 5753 attributes: { 5754 ...blockAttributes, 5755 linkTarget: { 5756 type: "string", 5757 source: "attribute", 5758 selector: "a", 5759 attribute: "target" 5760 }, 5761 rel: { 5762 type: "string", 5763 source: "attribute", 5764 selector: "a", 5765 attribute: "rel" 5766 }, 5767 placeholder: { 5768 type: "string" 5769 }, 5770 borderRadius: { 5771 type: "number" 5772 }, 5773 backgroundColor: { 5774 type: "string" 5775 }, 5776 textColor: { 5777 type: "string" 5778 }, 5779 gradient: { 5780 type: "string" 5781 }, 5782 style: { 5783 type: "object" 5784 }, 5785 width: { 5786 type: "number" 5787 } 5788 }, 5789 save({ attributes: attributes3, className }) { 5790 const { borderRadius, linkTarget, rel, text, title, url, width } = attributes3; 5791 const colorProps = (0, import_block_editor19.__experimentalGetColorClassesAndStyles)(attributes3); 5792 const buttonClasses = clsx_default( 5793 "wp-block-button__link", 5794 colorProps.className, 5795 { 5796 "no-border-radius": borderRadius === 0 5797 } 5798 ); 5799 const buttonStyle = { 5800 borderRadius: borderRadius ? borderRadius + "px" : void 0, 5801 ...colorProps.style 5802 }; 5803 const wrapperClasses = clsx_default(className, { 5804 [`has-custom-width wp-block-button__width-$width}`]: width 5805 }); 5806 return /* @__PURE__ */ (0, import_jsx_runtime166.jsx)("div", { ...import_block_editor19.useBlockProps.save({ className: wrapperClasses }), children: /* @__PURE__ */ (0, import_jsx_runtime166.jsx)( 5807 import_block_editor19.RichText.Content, 5808 { 5809 tagName: "a", 5810 className: buttonClasses, 5811 href: url, 5812 title, 5813 style: buttonStyle, 5814 value: text, 5815 target: linkTarget, 5816 rel 5817 } 5818 ) }); 5819 }, 5820 migrate: (0, import_compose4.compose)(migrate_font_family_default, migrateBorderRadius) 5821 }, 5822 { 5823 supports: { 5824 align: true, 5825 alignWide: false, 5826 color: { gradients: true } 5827 }, 5828 attributes: { 5829 ...blockAttributes, 5830 linkTarget: { 5831 type: "string", 5832 source: "attribute", 5833 selector: "a", 5834 attribute: "target" 5835 }, 5836 rel: { 5837 type: "string", 5838 source: "attribute", 5839 selector: "a", 5840 attribute: "rel" 5841 }, 5842 placeholder: { 5843 type: "string" 5844 }, 5845 borderRadius: { 5846 type: "number" 5847 }, 5848 backgroundColor: { 5849 type: "string" 5850 }, 5851 textColor: { 5852 type: "string" 5853 }, 5854 gradient: { 5855 type: "string" 5856 }, 5857 style: { 5858 type: "object" 5859 } 5860 }, 5861 save({ attributes: attributes3 }) { 5862 const { borderRadius, linkTarget, rel, text, title, url } = attributes3; 5863 const buttonClasses = clsx_default("wp-block-button__link", { 5864 "no-border-radius": borderRadius === 0 5865 }); 5866 const buttonStyle = { 5867 borderRadius: borderRadius ? borderRadius + "px" : void 0 5868 }; 5869 return /* @__PURE__ */ (0, import_jsx_runtime166.jsx)( 5870 import_block_editor19.RichText.Content, 5871 { 5872 tagName: "a", 5873 className: buttonClasses, 5874 href: url, 5875 title, 5876 style: buttonStyle, 5877 value: text, 5878 target: linkTarget, 5879 rel 5880 } 5881 ); 5882 }, 5883 migrate: migrateBorderRadius 5884 }, 5885 { 5886 supports: { 5887 align: true, 5888 alignWide: false 5889 }, 5890 attributes: { 5891 ...blockAttributes, 5892 linkTarget: { 5893 type: "string", 5894 source: "attribute", 5895 selector: "a", 5896 attribute: "target" 5897 }, 5898 rel: { 5899 type: "string", 5900 source: "attribute", 5901 selector: "a", 5902 attribute: "rel" 5903 }, 5904 placeholder: { 5905 type: "string" 5906 }, 5907 borderRadius: { 5908 type: "number" 5909 }, 5910 backgroundColor: { 5911 type: "string" 5912 }, 5913 textColor: { 5914 type: "string" 5915 }, 5916 customBackgroundColor: { 5917 type: "string" 5918 }, 5919 customTextColor: { 5920 type: "string" 5921 }, 5922 customGradient: { 5923 type: "string" 5924 }, 5925 gradient: { 5926 type: "string" 5927 } 5928 }, 5929 isEligible: (attributes3) => !!attributes3.customTextColor || !!attributes3.customBackgroundColor || !!attributes3.customGradient || !!attributes3.align, 5930 migrate: (0, import_compose4.compose)( 5931 migrateBorderRadius, 5932 migrateCustomColorsAndGradients, 5933 migrateAlign 5934 ), 5935 save({ attributes: attributes3 }) { 5936 const { 5937 backgroundColor, 5938 borderRadius, 5939 customBackgroundColor, 5940 customTextColor, 5941 customGradient, 5942 linkTarget, 5943 gradient, 5944 rel, 5945 text, 5946 textColor, 5947 title, 5948 url 5949 } = attributes3; 5950 const textClass = (0, import_block_editor19.getColorClassName)("color", textColor); 5951 const backgroundClass = !customGradient && (0, import_block_editor19.getColorClassName)("background-color", backgroundColor); 5952 const gradientClass = (0, import_block_editor19.__experimentalGetGradientClass)(gradient); 5953 const buttonClasses = clsx_default("wp-block-button__link", { 5954 "has-text-color": textColor || customTextColor, 5955 [textClass]: textClass, 5956 "has-background": backgroundColor || customBackgroundColor || customGradient || gradient, 5957 [backgroundClass]: backgroundClass, 5958 "no-border-radius": borderRadius === 0, 5959 [gradientClass]: gradientClass 5960 }); 5961 const buttonStyle = { 5962 background: customGradient ? customGradient : void 0, 5963 backgroundColor: backgroundClass || customGradient || gradient ? void 0 : customBackgroundColor, 5964 color: textClass ? void 0 : customTextColor, 5965 borderRadius: borderRadius ? borderRadius + "px" : void 0 5966 }; 5967 return /* @__PURE__ */ (0, import_jsx_runtime166.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime166.jsx)( 5968 import_block_editor19.RichText.Content, 5969 { 5970 tagName: "a", 5971 className: buttonClasses, 5972 href: url, 5973 title, 5974 style: buttonStyle, 5975 value: text, 5976 target: linkTarget, 5977 rel 5978 } 5979 ) }); 5980 } 5981 }, 5982 { 5983 attributes: { 5984 ...blockAttributes, 5985 align: { 5986 type: "string", 5987 default: "none" 5988 }, 5989 backgroundColor: { 5990 type: "string" 5991 }, 5992 textColor: { 5993 type: "string" 5994 }, 5995 customBackgroundColor: { 5996 type: "string" 5997 }, 5998 customTextColor: { 5999 type: "string" 6000 }, 6001 linkTarget: { 6002 type: "string", 6003 source: "attribute", 6004 selector: "a", 6005 attribute: "target" 6006 }, 6007 rel: { 6008 type: "string", 6009 source: "attribute", 6010 selector: "a", 6011 attribute: "rel" 6012 }, 6013 placeholder: { 6014 type: "string" 6015 } 6016 }, 6017 isEligible(attribute) { 6018 return attribute.className && attribute.className.includes("is-style-squared"); 6019 }, 6020 migrate(attributes3) { 6021 let newClassName = attributes3.className; 6022 if (newClassName) { 6023 newClassName = newClassName.replace(/is-style-squared[\s]?/, "").trim(); 6024 } 6025 return migrateBorderRadius( 6026 migrateCustomColorsAndGradients({ 6027 ...attributes3, 6028 className: newClassName ? newClassName : void 0, 6029 borderRadius: 0 6030 }) 6031 ); 6032 }, 6033 save({ attributes: attributes3 }) { 6034 const { 6035 backgroundColor, 6036 customBackgroundColor, 6037 customTextColor, 6038 linkTarget, 6039 rel, 6040 text, 6041 textColor, 6042 title, 6043 url 6044 } = attributes3; 6045 const textClass = (0, import_block_editor19.getColorClassName)("color", textColor); 6046 const backgroundClass = (0, import_block_editor19.getColorClassName)( 6047 "background-color", 6048 backgroundColor 6049 ); 6050 const buttonClasses = clsx_default("wp-block-button__link", { 6051 "has-text-color": textColor || customTextColor, 6052 [textClass]: textClass, 6053 "has-background": backgroundColor || customBackgroundColor, 6054 [backgroundClass]: backgroundClass 6055 }); 6056 const buttonStyle = { 6057 backgroundColor: backgroundClass ? void 0 : customBackgroundColor, 6058 color: textClass ? void 0 : customTextColor 6059 }; 6060 return /* @__PURE__ */ (0, import_jsx_runtime166.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime166.jsx)( 6061 import_block_editor19.RichText.Content, 6062 { 6063 tagName: "a", 6064 className: buttonClasses, 6065 href: url, 6066 title, 6067 style: buttonStyle, 6068 value: text, 6069 target: linkTarget, 6070 rel 6071 } 6072 ) }); 6073 } 6074 }, 6075 { 6076 attributes: { 6077 ...blockAttributes, 6078 align: { 6079 type: "string", 6080 default: "none" 6081 }, 6082 backgroundColor: { 6083 type: "string" 6084 }, 6085 textColor: { 6086 type: "string" 6087 }, 6088 customBackgroundColor: { 6089 type: "string" 6090 }, 6091 customTextColor: { 6092 type: "string" 6093 } 6094 }, 6095 migrate: oldColorsMigration, 6096 save({ attributes: attributes3 }) { 6097 const { 6098 url, 6099 text, 6100 title, 6101 backgroundColor, 6102 textColor, 6103 customBackgroundColor, 6104 customTextColor 6105 } = attributes3; 6106 const textClass = (0, import_block_editor19.getColorClassName)("color", textColor); 6107 const backgroundClass = (0, import_block_editor19.getColorClassName)( 6108 "background-color", 6109 backgroundColor 6110 ); 6111 const buttonClasses = clsx_default("wp-block-button__link", { 6112 "has-text-color": textColor || customTextColor, 6113 [textClass]: textClass, 6114 "has-background": backgroundColor || customBackgroundColor, 6115 [backgroundClass]: backgroundClass 6116 }); 6117 const buttonStyle = { 6118 backgroundColor: backgroundClass ? void 0 : customBackgroundColor, 6119 color: textClass ? void 0 : customTextColor 6120 }; 6121 return /* @__PURE__ */ (0, import_jsx_runtime166.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime166.jsx)( 6122 import_block_editor19.RichText.Content, 6123 { 6124 tagName: "a", 6125 className: buttonClasses, 6126 href: url, 6127 title, 6128 style: buttonStyle, 6129 value: text 6130 } 6131 ) }); 6132 } 6133 }, 6134 { 6135 attributes: { 6136 ...blockAttributes, 6137 color: { 6138 type: "string" 6139 }, 6140 textColor: { 6141 type: "string" 6142 }, 6143 align: { 6144 type: "string", 6145 default: "none" 6146 } 6147 }, 6148 save({ attributes: attributes3 }) { 6149 const { url, text, title, align, color, textColor } = attributes3; 6150 const buttonStyle = { 6151 backgroundColor: color, 6152 color: textColor 6153 }; 6154 const linkClass = "wp-block-button__link"; 6155 return /* @__PURE__ */ (0, import_jsx_runtime166.jsx)("div", { className: `align$align}`, children: /* @__PURE__ */ (0, import_jsx_runtime166.jsx)( 6156 import_block_editor19.RichText.Content, 6157 { 6158 tagName: "a", 6159 className: linkClass, 6160 href: url, 6161 title, 6162 style: buttonStyle, 6163 value: text 6164 } 6165 ) }); 6166 }, 6167 migrate: oldColorsMigration 6168 }, 6169 { 6170 attributes: { 6171 ...blockAttributes, 6172 color: { 6173 type: "string" 6174 }, 6175 textColor: { 6176 type: "string" 6177 }, 6178 align: { 6179 type: "string", 6180 default: "none" 6181 } 6182 }, 6183 save({ attributes: attributes3 }) { 6184 const { url, text, title, align, color, textColor } = attributes3; 6185 return /* @__PURE__ */ (0, import_jsx_runtime166.jsx)( 6186 "div", 6187 { 6188 className: `align$align}`, 6189 style: { backgroundColor: color }, 6190 children: /* @__PURE__ */ (0, import_jsx_runtime166.jsx)( 6191 import_block_editor19.RichText.Content, 6192 { 6193 tagName: "a", 6194 href: url, 6195 title, 6196 style: { color: textColor }, 6197 value: text 6198 } 6199 ) 6200 } 6201 ); 6202 }, 6203 migrate: oldColorsMigration 6204 } 6205 ]; 6206 var deprecated_default3 = deprecated; 6207 6208 // packages/block-library/build-module/button/edit.js 6209 var import_i18n13 = __toESM(require_i18n()); 6210 var import_element11 = __toESM(require_element()); 6211 var import_components10 = __toESM(require_components()); 6212 var import_block_editor21 = __toESM(require_block_editor()); 6213 var import_keycodes = __toESM(require_keycodes()); 6214 var import_blocks7 = __toESM(require_blocks()); 6215 var import_compose6 = __toESM(require_compose()); 6216 var import_data9 = __toESM(require_data()); 6217 6218 // packages/block-library/build-module/button/constants.js 6219 var NEW_TAB_REL = "noreferrer noopener"; 6220 var NEW_TAB_TARGET = "_blank"; 6221 var NOFOLLOW_REL = "nofollow"; 6222 6223 // packages/block-library/build-module/button/get-updated-link-attributes.js 6224 var import_url2 = __toESM(require_url()); 6225 function getUpdatedLinkAttributes({ 6226 rel = "", 6227 url = "", 6228 opensInNewTab, 6229 nofollow 6230 }) { 6231 let newLinkTarget; 6232 let updatedRel = rel; 6233 if (opensInNewTab) { 6234 newLinkTarget = NEW_TAB_TARGET; 6235 updatedRel = updatedRel?.includes(NEW_TAB_REL) ? updatedRel : updatedRel + ` $NEW_TAB_REL}`; 6236 } else { 6237 const relRegex = new RegExp(`\\b$NEW_TAB_REL}\\s*`, "g"); 6238 updatedRel = updatedRel?.replace(relRegex, "").trim(); 6239 } 6240 if (nofollow) { 6241 updatedRel = updatedRel?.includes(NOFOLLOW_REL) ? updatedRel : (updatedRel + ` $NOFOLLOW_REL}`).trim(); 6242 } else { 6243 const relRegex = new RegExp(`\\b$NOFOLLOW_REL}\\s*`, "g"); 6244 updatedRel = updatedRel?.replace(relRegex, "").trim(); 6245 } 6246 return { 6247 url: (0, import_url2.prependHTTP)(url), 6248 linkTarget: newLinkTarget, 6249 rel: updatedRel || void 0 6250 }; 6251 } 6252 6253 // packages/block-library/build-module/utils/remove-anchor-tag.js 6254 function removeAnchorTag(value) { 6255 return value.toString().replace(/<\/?a[^>]*>/g, ""); 6256 } 6257 6258 // packages/block-library/build-module/utils/deprecated-text-align-attributes.js 6259 var import_compose5 = __toESM(require_compose()); 6260 var import_element10 = __toESM(require_element()); 6261 var import_deprecated3 = __toESM(require_deprecated()); 6262 var import_data8 = __toESM(require_data()); 6263 var import_block_editor20 = __toESM(require_block_editor()); 6264 function useDeprecatedTextAlign(props) { 6265 const { name: name117, attributes: attributes3, setAttributes } = props; 6266 const { textAlign } = attributes3; 6267 const { __unstableMarkNextChangeAsNotPersistent } = (0, import_data8.useDispatch)(import_block_editor20.store); 6268 const updateStyleWithAlign = (0, import_compose5.useEvent)(() => { 6269 (0, import_deprecated3.default)(`textAlign attribute in $name117}`, { 6270 alternative: "style.typography.textAlign", 6271 since: "7.0" 6272 }); 6273 __unstableMarkNextChangeAsNotPersistent(); 6274 setAttributes((currentAttr) => ({ 6275 style: { 6276 ...currentAttr.style, 6277 typography: { 6278 ...currentAttr.style?.typography, 6279 textAlign 6280 } 6281 } 6282 })); 6283 }); 6284 const lastUpdatedAlignRef = (0, import_element10.useRef)(); 6285 (0, import_element10.useEffect)(() => { 6286 if (textAlign === lastUpdatedAlignRef.current) { 6287 return; 6288 } 6289 lastUpdatedAlignRef.current = textAlign; 6290 updateStyleWithAlign(); 6291 }, [textAlign, updateStyleWithAlign]); 6292 } 6293 6294 // packages/block-library/build-module/button/edit.js 6295 var import_jsx_runtime167 = __toESM(require_jsx_runtime()); 6296 var { HTMLElementControl } = unlock(import_block_editor21.privateApis); 6297 var LINK_SETTINGS = [ 6298 ...import_block_editor21.LinkControl.DEFAULT_LINK_SETTINGS, 6299 { 6300 id: "nofollow", 6301 title: (0, import_i18n13.__)("Mark as nofollow") 6302 } 6303 ]; 6304 function useEnter(props) { 6305 const { replaceBlocks, selectionChange } = (0, import_data9.useDispatch)(import_block_editor21.store); 6306 const { getBlock, getBlockRootClientId, getBlockIndex } = (0, import_data9.useSelect)(import_block_editor21.store); 6307 const propsRef = (0, import_element11.useRef)(props); 6308 propsRef.current = props; 6309 return (0, import_compose6.useRefEffect)((element) => { 6310 function onKeyDown(event) { 6311 if (event.defaultPrevented || event.keyCode !== import_keycodes.ENTER) { 6312 return; 6313 } 6314 const { content, clientId } = propsRef.current; 6315 if (content.length) { 6316 return; 6317 } 6318 event.preventDefault(); 6319 const topParentListBlock = getBlock( 6320 getBlockRootClientId(clientId) 6321 ); 6322 const blockIndex = getBlockIndex(clientId); 6323 const head = (0, import_blocks7.cloneBlock)({ 6324 ...topParentListBlock, 6325 innerBlocks: topParentListBlock.innerBlocks.slice( 6326 0, 6327 blockIndex 6328 ) 6329 }); 6330 const middle = (0, import_blocks7.createBlock)((0, import_blocks7.getDefaultBlockName)()); 6331 const after = topParentListBlock.innerBlocks.slice( 6332 blockIndex + 1 6333 ); 6334 const tail = after.length ? [ 6335 (0, import_blocks7.cloneBlock)({ 6336 ...topParentListBlock, 6337 innerBlocks: after 6338 }) 6339 ] : []; 6340 replaceBlocks( 6341 topParentListBlock.clientId, 6342 [head, middle, ...tail], 6343 1 6344 ); 6345 selectionChange(middle.clientId); 6346 } 6347 element.addEventListener("keydown", onKeyDown); 6348 return () => { 6349 element.removeEventListener("keydown", onKeyDown); 6350 }; 6351 }, []); 6352 } 6353 function WidthPanel({ selectedWidth, setAttributes }) { 6354 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 6355 return /* @__PURE__ */ (0, import_jsx_runtime167.jsx)( 6356 import_components10.__experimentalToolsPanel, 6357 { 6358 label: (0, import_i18n13.__)("Settings"), 6359 resetAll: () => setAttributes({ width: void 0 }), 6360 dropdownMenuProps, 6361 children: /* @__PURE__ */ (0, import_jsx_runtime167.jsx)( 6362 import_components10.__experimentalToolsPanelItem, 6363 { 6364 label: (0, import_i18n13.__)("Width"), 6365 isShownByDefault: true, 6366 hasValue: () => !!selectedWidth, 6367 onDeselect: () => setAttributes({ width: void 0 }), 6368 children: /* @__PURE__ */ (0, import_jsx_runtime167.jsx)( 6369 import_components10.__experimentalToggleGroupControl, 6370 { 6371 label: (0, import_i18n13.__)("Width"), 6372 value: selectedWidth, 6373 onChange: (newWidth) => setAttributes({ width: newWidth }), 6374 isBlock: true, 6375 __next40pxDefaultSize: true, 6376 children: [25, 50, 75, 100].map((widthValue) => { 6377 return /* @__PURE__ */ (0, import_jsx_runtime167.jsx)( 6378 import_components10.__experimentalToggleGroupControlOption, 6379 { 6380 value: widthValue, 6381 label: (0, import_i18n13.sprintf)( 6382 /* translators: %d: Percentage value. */ 6383 (0, import_i18n13.__)("%d%%"), 6384 widthValue 6385 ) 6386 }, 6387 widthValue 6388 ); 6389 }) 6390 } 6391 ) 6392 } 6393 ) 6394 } 6395 ); 6396 } 6397 function ButtonEdit(props) { 6398 const { 6399 attributes: attributes3, 6400 setAttributes, 6401 className, 6402 isSelected, 6403 onReplace, 6404 mergeBlocks, 6405 clientId, 6406 context 6407 } = props; 6408 const { 6409 tagName, 6410 linkTarget, 6411 placeholder: placeholder2, 6412 rel, 6413 style: style2, 6414 text, 6415 url, 6416 width, 6417 metadata 6418 } = attributes3; 6419 useDeprecatedTextAlign(props); 6420 const TagName2 = tagName || "a"; 6421 function onKeyDown(event) { 6422 if (import_keycodes.isKeyboardEvent.primary(event, "k")) { 6423 startEditing(event); 6424 } else if (import_keycodes.isKeyboardEvent.primaryShift(event, "k")) { 6425 unlink(); 6426 richTextRef.current?.focus(); 6427 } 6428 } 6429 const [popoverAnchor, setPopoverAnchor] = (0, import_element11.useState)(null); 6430 const borderProps = (0, import_block_editor21.__experimentalUseBorderProps)(attributes3); 6431 const colorProps = (0, import_block_editor21.__experimentalUseColorProps)(attributes3); 6432 const spacingProps = (0, import_block_editor21.__experimentalGetSpacingClassesAndStyles)(attributes3); 6433 const shadowProps = (0, import_block_editor21.__experimentalGetShadowClassesAndStyles)(attributes3); 6434 const ref = (0, import_element11.useRef)(); 6435 const richTextRef = (0, import_element11.useRef)(); 6436 const blockProps = (0, import_block_editor21.useBlockProps)({ 6437 ref: (0, import_compose6.useMergeRefs)([setPopoverAnchor, ref]), 6438 onKeyDown 6439 }); 6440 const blockEditingMode = (0, import_block_editor21.useBlockEditingMode)(); 6441 const [isEditingURL, setIsEditingURL] = (0, import_element11.useState)(false); 6442 const isURLSet = !!url; 6443 const opensInNewTab = linkTarget === NEW_TAB_TARGET; 6444 const nofollow = !!rel?.includes(NOFOLLOW_REL); 6445 const isLinkTag = "a" === TagName2; 6446 const { 6447 createPageEntity, 6448 userCanCreatePages, 6449 lockUrlControls = false 6450 } = (0, import_data9.useSelect)( 6451 (select9) => { 6452 if (!isSelected) { 6453 return {}; 6454 } 6455 const _settings = select9(import_block_editor21.store).getSettings(); 6456 const blockBindingsSource = (0, import_blocks7.getBlockBindingsSource)( 6457 metadata?.bindings?.url?.source 6458 ); 6459 return { 6460 createPageEntity: _settings.__experimentalCreatePageEntity, 6461 userCanCreatePages: _settings.__experimentalUserCanCreatePages, 6462 lockUrlControls: !!metadata?.bindings?.url && !blockBindingsSource?.canUserEditValue?.({ 6463 select: select9, 6464 context, 6465 args: metadata?.bindings?.url?.args 6466 }) 6467 }; 6468 }, 6469 [context, isSelected, metadata?.bindings?.url] 6470 ); 6471 async function handleCreate(pageTitle) { 6472 const page = await createPageEntity({ 6473 title: pageTitle, 6474 status: "draft" 6475 }); 6476 return { 6477 id: page.id, 6478 type: page.type, 6479 title: page.title.rendered, 6480 url: page.link, 6481 kind: "post-type" 6482 }; 6483 } 6484 function createButtonText(searchTerm) { 6485 return (0, import_element11.createInterpolateElement)( 6486 (0, import_i18n13.sprintf)( 6487 /* translators: %s: search term. */ 6488 (0, import_i18n13.__)("Create page: <mark>%s</mark>"), 6489 searchTerm 6490 ), 6491 { mark: /* @__PURE__ */ (0, import_jsx_runtime167.jsx)("mark", {}) } 6492 ); 6493 } 6494 function startEditing(event) { 6495 event.preventDefault(); 6496 setIsEditingURL(true); 6497 } 6498 function unlink() { 6499 setAttributes({ 6500 url: void 0, 6501 linkTarget: void 0, 6502 rel: void 0 6503 }); 6504 setIsEditingURL(false); 6505 } 6506 (0, import_element11.useEffect)(() => { 6507 if (!isSelected) { 6508 setIsEditingURL(false); 6509 } 6510 }, [isSelected]); 6511 const linkValue = (0, import_element11.useMemo)( 6512 () => ({ url, opensInNewTab, nofollow }), 6513 [url, opensInNewTab, nofollow] 6514 ); 6515 const useEnterRef = useEnter({ content: text, clientId }); 6516 const mergedRef = (0, import_compose6.useMergeRefs)([useEnterRef, richTextRef]); 6517 const [fluidTypographySettings, layout] = (0, import_block_editor21.useSettings)( 6518 "typography.fluid", 6519 "layout" 6520 ); 6521 const typographyProps = (0, import_block_editor21.getTypographyClassesAndStyles)(attributes3, { 6522 typography: { 6523 fluid: fluidTypographySettings 6524 }, 6525 layout: { 6526 wideSize: layout?.wideSize 6527 } 6528 }); 6529 const hasNonContentControls = blockEditingMode === "default"; 6530 const hasBlockControls = hasNonContentControls || isLinkTag && !lockUrlControls; 6531 return /* @__PURE__ */ (0, import_jsx_runtime167.jsxs)(import_jsx_runtime167.Fragment, { children: [ 6532 /* @__PURE__ */ (0, import_jsx_runtime167.jsx)( 6533 "div", 6534 { 6535 ...blockProps, 6536 className: clsx_default(blockProps.className, { 6537 [`has-custom-width wp-block-button__width-$width}`]: width 6538 }), 6539 children: /* @__PURE__ */ (0, import_jsx_runtime167.jsx)( 6540 import_block_editor21.RichText, 6541 { 6542 ref: mergedRef, 6543 "aria-label": (0, import_i18n13.__)("Button text"), 6544 placeholder: placeholder2 || (0, import_i18n13.__)("Add text\u2026"), 6545 value: text, 6546 onChange: (value) => setAttributes({ 6547 text: removeAnchorTag(value) 6548 }), 6549 withoutInteractiveFormatting: true, 6550 className: clsx_default( 6551 className, 6552 "wp-block-button__link", 6553 colorProps.className, 6554 borderProps.className, 6555 typographyProps.className, 6556 { 6557 // For backwards compatibility add style that isn't 6558 // provided via block support. 6559 "no-border-radius": style2?.border?.radius === 0, 6560 [`has-custom-font-size`]: blockProps.style.fontSize 6561 }, 6562 (0, import_block_editor21.__experimentalGetElementClassName)("button") 6563 ), 6564 style: { 6565 ...borderProps.style, 6566 ...colorProps.style, 6567 ...spacingProps.style, 6568 ...shadowProps.style, 6569 ...typographyProps.style, 6570 writingMode: void 0 6571 }, 6572 onReplace, 6573 onMerge: mergeBlocks, 6574 identifier: "text" 6575 } 6576 ) 6577 } 6578 ), 6579 hasBlockControls && /* @__PURE__ */ (0, import_jsx_runtime167.jsx)(import_block_editor21.BlockControls, { group: "block", children: isLinkTag && !lockUrlControls && /* @__PURE__ */ (0, import_jsx_runtime167.jsx)( 6580 import_components10.ToolbarButton, 6581 { 6582 name: "link", 6583 icon: !isURLSet ? link_default : link_off_default, 6584 title: !isURLSet ? (0, import_i18n13.__)("Link") : (0, import_i18n13.__)("Unlink"), 6585 shortcut: !isURLSet ? import_keycodes.displayShortcut.primary("k") : import_keycodes.displayShortcut.primaryShift("k"), 6586 onClick: !isURLSet ? startEditing : unlink, 6587 isActive: isURLSet 6588 } 6589 ) }), 6590 isLinkTag && isSelected && (isEditingURL || isURLSet) && !lockUrlControls && /* @__PURE__ */ (0, import_jsx_runtime167.jsx)( 6591 import_components10.Popover, 6592 { 6593 placement: "bottom", 6594 onClose: () => { 6595 setIsEditingURL(false); 6596 richTextRef.current?.focus(); 6597 }, 6598 anchor: popoverAnchor, 6599 focusOnMount: isEditingURL ? "firstElement" : false, 6600 __unstableSlotName: "__unstable-block-tools-after", 6601 shift: true, 6602 children: /* @__PURE__ */ (0, import_jsx_runtime167.jsx)( 6603 import_block_editor21.LinkControl, 6604 { 6605 value: linkValue, 6606 onChange: ({ 6607 url: newURL, 6608 opensInNewTab: newOpensInNewTab, 6609 nofollow: newNofollow 6610 }) => setAttributes( 6611 getUpdatedLinkAttributes({ 6612 rel, 6613 url: newURL, 6614 opensInNewTab: newOpensInNewTab, 6615 nofollow: newNofollow 6616 }) 6617 ), 6618 onRemove: () => { 6619 unlink(); 6620 richTextRef.current?.focus(); 6621 }, 6622 forceIsEditingLink: isEditingURL, 6623 settings: LINK_SETTINGS, 6624 createSuggestion: createPageEntity && handleCreate, 6625 withCreateSuggestion: userCanCreatePages, 6626 createSuggestionButtonText: createButtonText 6627 } 6628 ) 6629 } 6630 ), 6631 /* @__PURE__ */ (0, import_jsx_runtime167.jsx)(import_block_editor21.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime167.jsx)( 6632 WidthPanel, 6633 { 6634 selectedWidth: width, 6635 setAttributes 6636 } 6637 ) }), 6638 /* @__PURE__ */ (0, import_jsx_runtime167.jsxs)(import_block_editor21.InspectorControls, { group: "advanced", children: [ 6639 /* @__PURE__ */ (0, import_jsx_runtime167.jsx)( 6640 HTMLElementControl, 6641 { 6642 tagName, 6643 onChange: (value) => setAttributes({ tagName: value }), 6644 options: [ 6645 { label: (0, import_i18n13.__)("Default (<a>)"), value: "a" }, 6646 { label: "<button>", value: "button" } 6647 ] 6648 } 6649 ), 6650 isLinkTag && /* @__PURE__ */ (0, import_jsx_runtime167.jsx)( 6651 import_components10.TextControl, 6652 { 6653 __next40pxDefaultSize: true, 6654 label: (0, import_i18n13.__)("Link relation"), 6655 help: (0, import_element11.createInterpolateElement)( 6656 (0, import_i18n13.__)( 6657 "The <a>Link Relation</a> attribute defines the relationship between a linked resource and the current document." 6658 ), 6659 { 6660 a: /* @__PURE__ */ (0, import_jsx_runtime167.jsx)(import_components10.ExternalLink, { href: "https://developer.mozilla.org/docs/Web/HTML/Attributes/rel" }) 6661 } 6662 ), 6663 value: rel || "", 6664 onChange: (newRel) => setAttributes({ rel: newRel }) 6665 } 6666 ) 6667 ] }) 6668 ] }); 6669 } 6670 var edit_default2 = ButtonEdit; 6671 6672 // packages/block-library/build-module/button/block.json 6673 var block_default10 = { 6674 $schema: "https://schemas.wp.org/trunk/block.json", 6675 apiVersion: 3, 6676 name: "core/button", 6677 title: "Button", 6678 category: "design", 6679 parent: ["core/buttons"], 6680 description: "Prompt visitors to take action with a button-style link.", 6681 keywords: ["link"], 6682 textdomain: "default", 6683 attributes: { 6684 tagName: { 6685 type: "string", 6686 enum: ["a", "button"], 6687 default: "a" 6688 }, 6689 type: { 6690 type: "string", 6691 default: "button" 6692 }, 6693 url: { 6694 type: "string", 6695 source: "attribute", 6696 selector: "a", 6697 attribute: "href", 6698 role: "content" 6699 }, 6700 title: { 6701 type: "string", 6702 source: "attribute", 6703 selector: "a,button", 6704 attribute: "title", 6705 role: "content" 6706 }, 6707 text: { 6708 type: "rich-text", 6709 source: "rich-text", 6710 selector: "a,button", 6711 role: "content" 6712 }, 6713 linkTarget: { 6714 type: "string", 6715 source: "attribute", 6716 selector: "a", 6717 attribute: "target", 6718 role: "content" 6719 }, 6720 rel: { 6721 type: "string", 6722 source: "attribute", 6723 selector: "a", 6724 attribute: "rel", 6725 role: "content" 6726 }, 6727 placeholder: { 6728 type: "string" 6729 }, 6730 backgroundColor: { 6731 type: "string" 6732 }, 6733 textColor: { 6734 type: "string" 6735 }, 6736 gradient: { 6737 type: "string" 6738 }, 6739 width: { 6740 type: "number" 6741 } 6742 }, 6743 supports: { 6744 anchor: true, 6745 splitting: true, 6746 align: false, 6747 alignWide: false, 6748 color: { 6749 __experimentalSkipSerialization: true, 6750 gradients: true, 6751 __experimentalDefaultControls: { 6752 background: true, 6753 text: true 6754 } 6755 }, 6756 typography: { 6757 __experimentalSkipSerialization: [ 6758 "fontSize", 6759 "lineHeight", 6760 "textAlign", 6761 "fontFamily", 6762 "fontWeight", 6763 "fontStyle", 6764 "textTransform", 6765 "textDecoration", 6766 "letterSpacing" 6767 ], 6768 fontSize: true, 6769 lineHeight: true, 6770 textAlign: true, 6771 __experimentalFontFamily: true, 6772 __experimentalFontWeight: true, 6773 __experimentalFontStyle: true, 6774 __experimentalTextTransform: true, 6775 __experimentalTextDecoration: true, 6776 __experimentalLetterSpacing: true, 6777 __experimentalWritingMode: true, 6778 __experimentalDefaultControls: { 6779 fontSize: true 6780 } 6781 }, 6782 reusable: false, 6783 shadow: { 6784 __experimentalSkipSerialization: true 6785 }, 6786 spacing: { 6787 __experimentalSkipSerialization: true, 6788 padding: ["horizontal", "vertical"], 6789 __experimentalDefaultControls: { 6790 padding: true 6791 } 6792 }, 6793 __experimentalBorder: { 6794 color: true, 6795 radius: true, 6796 style: true, 6797 width: true, 6798 __experimentalSkipSerialization: true, 6799 __experimentalDefaultControls: { 6800 color: true, 6801 radius: true, 6802 style: true, 6803 width: true 6804 } 6805 }, 6806 interactivity: { 6807 clientNavigation: true 6808 } 6809 }, 6810 styles: [ 6811 { name: "fill", label: "Fill", isDefault: true }, 6812 { name: "outline", label: "Outline" } 6813 ], 6814 editorStyle: "wp-block-button-editor", 6815 style: "wp-block-button", 6816 selectors: { 6817 root: ".wp-block-button .wp-block-button__link", 6818 typography: { 6819 writingMode: ".wp-block-button" 6820 } 6821 } 6822 }; 6823 6824 // packages/block-library/build-module/button/save.js 6825 var import_block_editor22 = __toESM(require_block_editor()); 6826 var import_jsx_runtime168 = __toESM(require_jsx_runtime()); 6827 function save6({ attributes: attributes3, className }) { 6828 const { 6829 tagName, 6830 type, 6831 fontSize, 6832 linkTarget, 6833 rel, 6834 style: style2, 6835 text, 6836 title, 6837 url, 6838 width 6839 } = attributes3; 6840 const TagName2 = tagName || "a"; 6841 const isButtonTag = "button" === TagName2; 6842 const buttonType = type || "button"; 6843 const borderProps = (0, import_block_editor22.__experimentalGetBorderClassesAndStyles)(attributes3); 6844 const colorProps = (0, import_block_editor22.__experimentalGetColorClassesAndStyles)(attributes3); 6845 const spacingProps = (0, import_block_editor22.__experimentalGetSpacingClassesAndStyles)(attributes3); 6846 const shadowProps = (0, import_block_editor22.__experimentalGetShadowClassesAndStyles)(attributes3); 6847 const typographyProps = (0, import_block_editor22.getTypographyClassesAndStyles)(attributes3); 6848 const buttonClasses = clsx_default( 6849 "wp-block-button__link", 6850 colorProps.className, 6851 borderProps.className, 6852 typographyProps.className, 6853 { 6854 // For backwards compatibility add style that isn't provided via 6855 // block support. 6856 "no-border-radius": style2?.border?.radius === 0, 6857 [`has-custom-font-size`]: fontSize || style2?.typography?.fontSize 6858 }, 6859 (0, import_block_editor22.__experimentalGetElementClassName)("button") 6860 ); 6861 const buttonStyle = { 6862 ...borderProps.style, 6863 ...colorProps.style, 6864 ...spacingProps.style, 6865 ...shadowProps.style, 6866 ...typographyProps.style, 6867 writingMode: void 0 6868 }; 6869 const wrapperClasses = clsx_default(className, { 6870 [`has-custom-width wp-block-button__width-$width}`]: width 6871 }); 6872 return /* @__PURE__ */ (0, import_jsx_runtime168.jsx)("div", { ...import_block_editor22.useBlockProps.save({ className: wrapperClasses }), children: /* @__PURE__ */ (0, import_jsx_runtime168.jsx)( 6873 import_block_editor22.RichText.Content, 6874 { 6875 tagName: TagName2, 6876 type: isButtonTag ? buttonType : null, 6877 className: buttonClasses, 6878 href: isButtonTag ? null : url, 6879 title, 6880 style: buttonStyle, 6881 value: text, 6882 target: isButtonTag ? null : linkTarget, 6883 rel: isButtonTag ? null : rel 6884 } 6885 ) }); 6886 } 6887 6888 // packages/block-library/build-module/button/index.js 6889 var { fieldsKey: fieldsKey2, formKey: formKey2 } = unlock(import_blocks8.privateApis); 6890 var { name: name9 } = block_default10; 6891 var settings9 = { 6892 icon: button_default, 6893 example: { 6894 attributes: { 6895 className: "is-style-fill", 6896 text: (0, import_i18n14.__)("Call to action") 6897 } 6898 }, 6899 edit: edit_default2, 6900 save: save6, 6901 deprecated: deprecated_default3, 6902 merge: (a2, { text = "" }) => ({ 6903 ...a2, 6904 text: (a2.text || "") + text 6905 }) 6906 }; 6907 if (window.__experimentalContentOnlyInspectorFields) { 6908 settings9[fieldsKey2] = [ 6909 { 6910 id: "text", 6911 label: (0, import_i18n14.__)("Content"), 6912 type: "richtext" 6913 }, 6914 { 6915 id: "link", 6916 label: (0, import_i18n14.__)("Link"), 6917 type: "link", 6918 mapping: { 6919 url: "url", 6920 rel: "rel", 6921 linkTarget: "linkTarget" 6922 } 6923 } 6924 ]; 6925 settings9[formKey2] = { 6926 fields: ["text"] 6927 }; 6928 } 6929 var init9 = () => initBlock({ name: name9, metadata: block_default10, settings: settings9 }); 6930 6931 // packages/block-library/build-module/buttons/index.js 6932 var buttons_exports = {}; 6933 __export(buttons_exports, { 6934 init: () => init10, 6935 metadata: () => block_default11, 6936 name: () => name10, 6937 settings: () => settings10 6938 }); 6939 var import_i18n15 = __toESM(require_i18n()); 6940 6941 // packages/block-library/build-module/buttons/deprecated.js 6942 var import_block_editor23 = __toESM(require_block_editor()); 6943 var import_jsx_runtime169 = __toESM(require_jsx_runtime()); 6944 var migrateWithLayout = (attributes3) => { 6945 if (!!attributes3.layout) { 6946 return attributes3; 6947 } 6948 const { contentJustification, orientation, ...updatedAttributes } = attributes3; 6949 if (contentJustification || orientation) { 6950 Object.assign(updatedAttributes, { 6951 layout: { 6952 type: "flex", 6953 ...contentJustification && { 6954 justifyContent: contentJustification 6955 }, 6956 ...orientation && { orientation } 6957 } 6958 }); 6959 } 6960 return updatedAttributes; 6961 }; 6962 var deprecated3 = [ 6963 { 6964 attributes: { 6965 contentJustification: { 6966 type: "string" 6967 }, 6968 orientation: { 6969 type: "string", 6970 default: "horizontal" 6971 } 6972 }, 6973 supports: { 6974 anchor: true, 6975 align: ["wide", "full"], 6976 __experimentalExposeControlsToChildren: true, 6977 spacing: { 6978 blockGap: true, 6979 margin: ["top", "bottom"], 6980 __experimentalDefaultControls: { 6981 blockGap: true 6982 } 6983 } 6984 }, 6985 isEligible: ({ contentJustification, orientation }) => !!contentJustification || !!orientation, 6986 migrate: migrateWithLayout, 6987 save({ attributes: { contentJustification, orientation } }) { 6988 return /* @__PURE__ */ (0, import_jsx_runtime169.jsx)( 6989 "div", 6990 { 6991 ...import_block_editor23.useBlockProps.save({ 6992 className: clsx_default({ 6993 [`is-content-justification-$contentJustification}`]: contentJustification, 6994 "is-vertical": orientation === "vertical" 6995 }) 6996 }), 6997 children: /* @__PURE__ */ (0, import_jsx_runtime169.jsx)(import_block_editor23.InnerBlocks.Content, {}) 6998 } 6999 ); 7000 } 7001 }, 7002 { 7003 supports: { 7004 align: ["center", "left", "right"], 7005 anchor: true 7006 }, 7007 save() { 7008 return /* @__PURE__ */ (0, import_jsx_runtime169.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime169.jsx)(import_block_editor23.InnerBlocks.Content, {}) }); 7009 }, 7010 isEligible({ align }) { 7011 return align && ["center", "left", "right"].includes(align); 7012 }, 7013 migrate(attributes3) { 7014 return migrateWithLayout({ 7015 ...attributes3, 7016 align: void 0, 7017 // Floating Buttons blocks shouldn't have been supported in the 7018 // first place. Most users using them probably expected them to 7019 // act like content justification controls, so these blocks are 7020 // migrated to use content justification. 7021 // As for center-aligned Buttons blocks, the content justification 7022 // equivalent will create an identical end result in most cases. 7023 contentJustification: attributes3.align 7024 }); 7025 } 7026 } 7027 ]; 7028 var deprecated_default4 = deprecated3; 7029 7030 // packages/block-library/build-module/buttons/transforms.js 7031 var import_blocks10 = __toESM(require_blocks()); 7032 var import_rich_text = __toESM(require_rich_text()); 7033 7034 // packages/block-library/build-module/utils/get-transformed-attributes.js 7035 var import_blocks9 = __toESM(require_blocks()); 7036 function getTransformedAttributes(attributes3, newBlockName, bindingsCallback = null) { 7037 if (!attributes3) { 7038 return void 0; 7039 } 7040 const newBlockType = (0, import_blocks9.getBlockType)(newBlockName); 7041 if (!newBlockType) { 7042 return void 0; 7043 } 7044 const transformedAttributes = {}; 7045 if ((0, import_blocks9.hasBlockSupport)(newBlockType, "anchor") && attributes3.anchor) { 7046 transformedAttributes.anchor = attributes3.anchor; 7047 } 7048 if ((0, import_blocks9.hasBlockSupport)(newBlockType, "ariaLabel") && attributes3.ariaLabel) { 7049 transformedAttributes.ariaLabel = attributes3.ariaLabel; 7050 } 7051 if (attributes3.metadata) { 7052 const transformedMetadata = []; 7053 if (bindingsCallback) { 7054 transformedMetadata.push("id", "bindings"); 7055 } 7056 if (transformedMetadata.length > 0) { 7057 const newMetadata = Object.entries(attributes3.metadata).reduce( 7058 (obj, [prop, value]) => { 7059 if (!transformedMetadata.includes(prop)) { 7060 return obj; 7061 } 7062 obj[prop] = prop === "bindings" ? bindingsCallback(value) : value; 7063 return obj; 7064 }, 7065 {} 7066 ); 7067 if (Object.keys(newMetadata).length > 0) { 7068 transformedAttributes.metadata = newMetadata; 7069 } 7070 } 7071 } 7072 if (Object.keys(transformedAttributes).length === 0) { 7073 return void 0; 7074 } 7075 return transformedAttributes; 7076 } 7077 7078 // packages/block-library/build-module/buttons/transforms.js 7079 var transforms2 = { 7080 from: [ 7081 { 7082 type: "block", 7083 isMultiBlock: true, 7084 blocks: ["core/button"], 7085 transform: (buttons) => ( 7086 // Creates the buttons block. 7087 (0, import_blocks10.createBlock)( 7088 "core/buttons", 7089 {}, 7090 // Loop the selected buttons. 7091 buttons.map( 7092 (attributes3) => ( 7093 // Create singular button in the buttons block. 7094 (0, import_blocks10.createBlock)("core/button", attributes3) 7095 ) 7096 ) 7097 ) 7098 ) 7099 }, 7100 { 7101 type: "block", 7102 isMultiBlock: true, 7103 blocks: ["core/paragraph"], 7104 transform: (buttons) => ( 7105 // Creates the buttons block. 7106 (0, import_blocks10.createBlock)( 7107 "core/buttons", 7108 {}, 7109 // Loop the selected buttons. 7110 buttons.map((attributes3) => { 7111 const { content } = attributes3; 7112 const element = (0, import_rich_text.__unstableCreateElement)(document, content); 7113 const text = element.innerText || ""; 7114 const link = element.querySelector("a"); 7115 const url = link?.getAttribute("href"); 7116 return (0, import_blocks10.createBlock)("core/button", { 7117 ...attributes3, 7118 ...getTransformedAttributes( 7119 attributes3, 7120 "core/button", 7121 ({ content: contentBinding }) => ({ 7122 text: contentBinding 7123 }) 7124 ), 7125 text, 7126 url 7127 }); 7128 }) 7129 ) 7130 ), 7131 isMatch: (paragraphs) => { 7132 return paragraphs.every((attributes3) => { 7133 const element = (0, import_rich_text.__unstableCreateElement)( 7134 document, 7135 attributes3.content 7136 ); 7137 const text = element.innerText || ""; 7138 const links = element.querySelectorAll("a"); 7139 return text.length <= 30 && links.length <= 1; 7140 }); 7141 } 7142 } 7143 ] 7144 }; 7145 var transforms_default2 = transforms2; 7146 7147 // packages/block-library/build-module/buttons/edit.js 7148 var import_block_editor24 = __toESM(require_block_editor()); 7149 var import_data10 = __toESM(require_data()); 7150 var import_blocks11 = __toESM(require_blocks()); 7151 var import_jsx_runtime170 = __toESM(require_jsx_runtime()); 7152 var DEFAULT_BLOCK = { 7153 name: "core/button", 7154 attributesToCopy: [ 7155 "backgroundColor", 7156 "border", 7157 "className", 7158 "fontFamily", 7159 "fontSize", 7160 "gradient", 7161 "style", 7162 "textColor", 7163 "width" 7164 ] 7165 }; 7166 function ButtonsEdit({ attributes: attributes3, className }) { 7167 const { fontSize, layout, style: style2 } = attributes3; 7168 const blockProps = (0, import_block_editor24.useBlockProps)({ 7169 className: clsx_default(className, { 7170 "has-custom-font-size": fontSize || style2?.typography?.fontSize 7171 }) 7172 }); 7173 const { hasButtonVariations } = (0, import_data10.useSelect)((select9) => { 7174 const buttonVariations = select9(import_blocks11.store).getBlockVariations( 7175 "core/button", 7176 "inserter" 7177 ); 7178 return { 7179 hasButtonVariations: buttonVariations.length > 0 7180 }; 7181 }, []); 7182 const innerBlocksProps = (0, import_block_editor24.useInnerBlocksProps)(blockProps, { 7183 defaultBlock: DEFAULT_BLOCK, 7184 // This check should be handled by the `Inserter` internally to be consistent across all blocks that use it. 7185 directInsert: !hasButtonVariations, 7186 template: [["core/button"]], 7187 templateInsertUpdatesSelection: true, 7188 orientation: layout?.orientation ?? "horizontal" 7189 }); 7190 return /* @__PURE__ */ (0, import_jsx_runtime170.jsx)("div", { ...innerBlocksProps }); 7191 } 7192 var edit_default3 = ButtonsEdit; 7193 7194 // packages/block-library/build-module/buttons/block.json 7195 var block_default11 = { 7196 $schema: "https://schemas.wp.org/trunk/block.json", 7197 apiVersion: 3, 7198 name: "core/buttons", 7199 title: "Buttons", 7200 category: "design", 7201 allowedBlocks: ["core/button"], 7202 description: "Prompt visitors to take action with a group of button-style links.", 7203 keywords: ["link"], 7204 textdomain: "default", 7205 supports: { 7206 anchor: true, 7207 align: ["wide", "full"], 7208 html: false, 7209 __experimentalExposeControlsToChildren: true, 7210 color: { 7211 gradients: true, 7212 text: false, 7213 __experimentalDefaultControls: { 7214 background: true 7215 } 7216 }, 7217 spacing: { 7218 blockGap: ["horizontal", "vertical"], 7219 padding: true, 7220 margin: ["top", "bottom"], 7221 __experimentalDefaultControls: { 7222 blockGap: true 7223 } 7224 }, 7225 typography: { 7226 fontSize: true, 7227 lineHeight: true, 7228 __experimentalFontFamily: true, 7229 __experimentalFontWeight: true, 7230 __experimentalFontStyle: true, 7231 __experimentalTextTransform: true, 7232 __experimentalTextDecoration: true, 7233 __experimentalLetterSpacing: true, 7234 __experimentalDefaultControls: { 7235 fontSize: true 7236 } 7237 }, 7238 __experimentalBorder: { 7239 color: true, 7240 radius: true, 7241 style: true, 7242 width: true, 7243 __experimentalDefaultControls: { 7244 color: true, 7245 radius: true, 7246 style: true, 7247 width: true 7248 } 7249 }, 7250 layout: { 7251 allowSwitching: false, 7252 allowInheriting: false, 7253 default: { 7254 type: "flex" 7255 } 7256 }, 7257 interactivity: { 7258 clientNavigation: true 7259 }, 7260 contentRole: true 7261 }, 7262 editorStyle: "wp-block-buttons-editor", 7263 style: "wp-block-buttons" 7264 }; 7265 7266 // packages/block-library/build-module/buttons/save.js 7267 var import_block_editor25 = __toESM(require_block_editor()); 7268 var import_jsx_runtime171 = __toESM(require_jsx_runtime()); 7269 function save7({ attributes: attributes3, className }) { 7270 const { fontSize, style: style2 } = attributes3; 7271 const blockProps = import_block_editor25.useBlockProps.save({ 7272 className: clsx_default(className, { 7273 "has-custom-font-size": fontSize || style2?.typography?.fontSize 7274 }) 7275 }); 7276 const innerBlocksProps = import_block_editor25.useInnerBlocksProps.save(blockProps); 7277 return /* @__PURE__ */ (0, import_jsx_runtime171.jsx)("div", { ...innerBlocksProps }); 7278 } 7279 7280 // packages/block-library/build-module/buttons/index.js 7281 var { name: name10 } = block_default11; 7282 var settings10 = { 7283 icon: buttons_default, 7284 example: { 7285 attributes: { 7286 layout: { 7287 type: "flex", 7288 justifyContent: "center" 7289 } 7290 }, 7291 innerBlocks: [ 7292 { 7293 name: "core/button", 7294 attributes: { text: (0, import_i18n15.__)("Find out more") } 7295 }, 7296 { 7297 name: "core/button", 7298 attributes: { text: (0, import_i18n15.__)("Contact us") } 7299 } 7300 ] 7301 }, 7302 deprecated: deprecated_default4, 7303 transforms: transforms_default2, 7304 edit: edit_default3, 7305 save: save7 7306 }; 7307 var init10 = () => initBlock({ name: name10, metadata: block_default11, settings: settings10 }); 7308 7309 // packages/block-library/build-module/calendar/index.js 7310 var calendar_exports = {}; 7311 __export(calendar_exports, { 7312 init: () => init11, 7313 metadata: () => block_default12, 7314 name: () => name11, 7315 settings: () => settings11 7316 }); 7317 7318 // packages/block-library/build-module/calendar/block.json 7319 var block_default12 = { 7320 $schema: "https://schemas.wp.org/trunk/block.json", 7321 apiVersion: 3, 7322 name: "core/calendar", 7323 title: "Calendar", 7324 category: "widgets", 7325 description: "A calendar of your site\u2019s posts.", 7326 keywords: ["posts", "archive"], 7327 textdomain: "default", 7328 attributes: { 7329 month: { 7330 type: "integer" 7331 }, 7332 year: { 7333 type: "integer" 7334 } 7335 }, 7336 supports: { 7337 align: true, 7338 html: false, 7339 color: { 7340 link: true, 7341 __experimentalSkipSerialization: ["text", "background"], 7342 __experimentalDefaultControls: { 7343 background: true, 7344 text: true 7345 }, 7346 __experimentalSelector: "table, th" 7347 }, 7348 typography: { 7349 fontSize: true, 7350 lineHeight: true, 7351 __experimentalFontFamily: true, 7352 __experimentalFontWeight: true, 7353 __experimentalFontStyle: true, 7354 __experimentalTextTransform: true, 7355 __experimentalLetterSpacing: true, 7356 __experimentalDefaultControls: { 7357 fontSize: true 7358 } 7359 }, 7360 interactivity: { 7361 clientNavigation: true 7362 } 7363 }, 7364 style: "wp-block-calendar" 7365 }; 7366 7367 // packages/block-library/build-module/calendar/edit.js 7368 var import_components11 = __toESM(require_components()); 7369 var import_data11 = __toESM(require_data()); 7370 var import_server_side_render3 = __toESM(require_server_side_render()); 7371 var import_block_editor26 = __toESM(require_block_editor()); 7372 var import_core_data5 = __toESM(require_core_data()); 7373 var import_i18n16 = __toESM(require_i18n()); 7374 var import_jsx_runtime172 = __toESM(require_jsx_runtime()); 7375 var getYearMonth = memize((date) => { 7376 if (!date) { 7377 return {}; 7378 } 7379 const dateObj = new Date(date); 7380 return { 7381 year: dateObj.getFullYear(), 7382 month: dateObj.getMonth() + 1 7383 }; 7384 }); 7385 function CalendarEdit({ attributes: attributes3 }) { 7386 const blockProps = (0, import_block_editor26.useBlockProps)(); 7387 const { date, hasPosts, hasPostsResolved } = (0, import_data11.useSelect)((select9) => { 7388 const { getEntityRecords, hasFinishedResolution } = select9(import_core_data5.store); 7389 const singlePublishedPostQuery = { 7390 status: "publish", 7391 per_page: 1 7392 }; 7393 const posts = getEntityRecords( 7394 "postType", 7395 "post", 7396 singlePublishedPostQuery 7397 ); 7398 const postsResolved = hasFinishedResolution("getEntityRecords", [ 7399 "postType", 7400 "post", 7401 singlePublishedPostQuery 7402 ]); 7403 let _date; 7404 const editorSelectors = select9("core/editor"); 7405 if (editorSelectors) { 7406 const postType = editorSelectors.getEditedPostAttribute("type"); 7407 if (postType === "post") { 7408 _date = editorSelectors.getEditedPostAttribute("date"); 7409 } 7410 } 7411 return { 7412 date: _date, 7413 hasPostsResolved: postsResolved, 7414 hasPosts: postsResolved && posts?.length === 1 7415 }; 7416 }, []); 7417 if (!hasPosts) { 7418 return /* @__PURE__ */ (0, import_jsx_runtime172.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime172.jsx)(import_components11.Placeholder, { icon: calendar_default, label: (0, import_i18n16.__)("Calendar"), children: !hasPostsResolved ? /* @__PURE__ */ (0, import_jsx_runtime172.jsx)(import_components11.Spinner, {}) : (0, import_i18n16.__)("No published posts found.") }) }); 7419 } 7420 return /* @__PURE__ */ (0, import_jsx_runtime172.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime172.jsx)(import_components11.Disabled, { children: /* @__PURE__ */ (0, import_jsx_runtime172.jsx)( 7421 import_server_side_render3.default, 7422 { 7423 block: "core/calendar", 7424 attributes: { ...attributes3, ...getYearMonth(date) } 7425 } 7426 ) }) }); 7427 } 7428 7429 // packages/block-library/build-module/calendar/transforms.js 7430 var import_blocks12 = __toESM(require_blocks()); 7431 var transforms3 = { 7432 from: [ 7433 { 7434 type: "block", 7435 blocks: ["core/archives"], 7436 transform: () => (0, import_blocks12.createBlock)("core/calendar") 7437 } 7438 ], 7439 to: [ 7440 { 7441 type: "block", 7442 blocks: ["core/archives"], 7443 transform: () => (0, import_blocks12.createBlock)("core/archives") 7444 } 7445 ] 7446 }; 7447 var transforms_default3 = transforms3; 7448 7449 // packages/block-library/build-module/calendar/index.js 7450 var { name: name11 } = block_default12; 7451 var settings11 = { 7452 icon: calendar_default, 7453 example: {}, 7454 edit: CalendarEdit, 7455 transforms: transforms_default3 7456 }; 7457 var init11 = () => initBlock({ name: name11, metadata: block_default12, settings: settings11 }); 7458 7459 // packages/block-library/build-module/categories/index.js 7460 var categories_exports = {}; 7461 __export(categories_exports, { 7462 init: () => init12, 7463 metadata: () => block_default13, 7464 name: () => name12, 7465 settings: () => settings12 7466 }); 7467 7468 // packages/block-library/build-module/categories/block.json 7469 var block_default13 = { 7470 $schema: "https://schemas.wp.org/trunk/block.json", 7471 apiVersion: 3, 7472 name: "core/categories", 7473 title: "Terms List", 7474 category: "widgets", 7475 description: "Display a list of all terms of a given taxonomy.", 7476 keywords: ["categories"], 7477 textdomain: "default", 7478 attributes: { 7479 taxonomy: { 7480 type: "string", 7481 default: "category" 7482 }, 7483 displayAsDropdown: { 7484 type: "boolean", 7485 default: false 7486 }, 7487 showHierarchy: { 7488 type: "boolean", 7489 default: false 7490 }, 7491 showPostCounts: { 7492 type: "boolean", 7493 default: false 7494 }, 7495 showOnlyTopLevel: { 7496 type: "boolean", 7497 default: false 7498 }, 7499 showEmpty: { 7500 type: "boolean", 7501 default: false 7502 }, 7503 label: { 7504 type: "string", 7505 role: "content" 7506 }, 7507 showLabel: { 7508 type: "boolean", 7509 default: true 7510 } 7511 }, 7512 usesContext: ["enhancedPagination"], 7513 supports: { 7514 align: true, 7515 html: false, 7516 spacing: { 7517 margin: true, 7518 padding: true, 7519 __experimentalDefaultControls: { 7520 margin: false, 7521 padding: false 7522 } 7523 }, 7524 typography: { 7525 fontSize: true, 7526 lineHeight: true, 7527 __experimentalFontFamily: true, 7528 __experimentalFontWeight: true, 7529 __experimentalFontStyle: true, 7530 __experimentalTextTransform: true, 7531 __experimentalTextDecoration: true, 7532 __experimentalLetterSpacing: true, 7533 __experimentalDefaultControls: { 7534 fontSize: true 7535 } 7536 }, 7537 color: { 7538 gradients: true, 7539 link: true, 7540 __experimentalDefaultControls: { 7541 background: true, 7542 text: true, 7543 link: true 7544 } 7545 }, 7546 interactivity: { 7547 clientNavigation: true 7548 }, 7549 __experimentalBorder: { 7550 radius: true, 7551 color: true, 7552 width: true, 7553 style: true, 7554 __experimentalDefaultControls: { 7555 radius: true, 7556 color: true, 7557 width: true, 7558 style: true 7559 } 7560 } 7561 }, 7562 editorStyle: "wp-block-categories-editor", 7563 style: "wp-block-categories" 7564 }; 7565 7566 // packages/block-library/build-module/categories/edit.js 7567 var import_components12 = __toESM(require_components()); 7568 var import_compose7 = __toESM(require_compose()); 7569 var import_block_editor27 = __toESM(require_block_editor()); 7570 var import_html_entities2 = __toESM(require_html_entities()); 7571 var import_i18n17 = __toESM(require_i18n()); 7572 var import_core_data6 = __toESM(require_core_data()); 7573 var import_data12 = __toESM(require_data()); 7574 var import_notices2 = __toESM(require_notices()); 7575 var import_jsx_runtime173 = __toESM(require_jsx_runtime()); 7576 function CategoriesEdit({ 7577 attributes: { 7578 displayAsDropdown, 7579 showHierarchy, 7580 showPostCounts, 7581 showOnlyTopLevel, 7582 showEmpty, 7583 label, 7584 showLabel, 7585 taxonomy: taxonomySlug 7586 }, 7587 setAttributes, 7588 className, 7589 clientId 7590 }) { 7591 const selectId = (0, import_compose7.useInstanceId)(CategoriesEdit, "blocks-category-select"); 7592 const { records: allTaxonomies, isResolvingTaxonomies } = (0, import_core_data6.useEntityRecords)( 7593 "root", 7594 "taxonomy", 7595 { per_page: -1 } 7596 ); 7597 const taxonomies = allTaxonomies?.filter((t2) => t2.visibility.public); 7598 const taxonomy = taxonomies?.find((t2) => t2.slug === taxonomySlug); 7599 const isHierarchicalTaxonomy = !isResolvingTaxonomies && taxonomy?.hierarchical; 7600 const query = { per_page: -1, hide_empty: !showEmpty, context: "view" }; 7601 if (isHierarchicalTaxonomy && showOnlyTopLevel) { 7602 query.parent = 0; 7603 } 7604 const { records: categories, isResolving } = (0, import_core_data6.useEntityRecords)( 7605 "taxonomy", 7606 taxonomySlug, 7607 query 7608 ); 7609 const { createWarningNotice } = (0, import_data12.useDispatch)(import_notices2.store); 7610 const showRedirectionPreventedNotice = (event) => { 7611 event.preventDefault(); 7612 createWarningNotice((0, import_i18n17.__)("Links are disabled in the editor."), { 7613 id: `block-library/core/categories/redirection-prevented/$clientId}`, 7614 type: "snackbar" 7615 }); 7616 }; 7617 const getCategoriesList = (parentId) => { 7618 if (!categories?.length) { 7619 return []; 7620 } 7621 if (parentId === null) { 7622 return categories; 7623 } 7624 return categories.filter(({ parent }) => parent === parentId); 7625 }; 7626 const toggleAttribute = (attributeName) => (newValue) => setAttributes({ [attributeName]: newValue }); 7627 const renderCategoryName = (name117) => !name117 ? (0, import_i18n17.__)("(Untitled)") : (0, import_html_entities2.decodeEntities)(name117).trim(); 7628 const renderCategoryList = () => { 7629 const parentId = isHierarchicalTaxonomy && showHierarchy ? 0 : null; 7630 const categoriesList = getCategoriesList(parentId); 7631 return categoriesList.map( 7632 (category) => renderCategoryListItem(category) 7633 ); 7634 }; 7635 const renderCategoryListItem = (category) => { 7636 const childCategories = getCategoriesList(category.id); 7637 const { id, link, count, name: name117 } = category; 7638 return /* @__PURE__ */ (0, import_jsx_runtime173.jsxs)("li", { className: `cat-item cat-item-$id}`, children: [ 7639 /* @__PURE__ */ (0, import_jsx_runtime173.jsx)("a", { href: link, onClick: showRedirectionPreventedNotice, children: renderCategoryName(name117) }), 7640 showPostCounts && ` ($count})`, 7641 isHierarchicalTaxonomy && showHierarchy && !!childCategories.length && /* @__PURE__ */ (0, import_jsx_runtime173.jsx)("ul", { className: "children", children: childCategories.map( 7642 (childCategory) => renderCategoryListItem(childCategory) 7643 ) }) 7644 ] }, id); 7645 }; 7646 const renderCategoryDropdown = () => { 7647 const parentId = isHierarchicalTaxonomy && showHierarchy ? 0 : null; 7648 const categoriesList = getCategoriesList(parentId); 7649 return /* @__PURE__ */ (0, import_jsx_runtime173.jsxs)(import_jsx_runtime173.Fragment, { children: [ 7650 showLabel ? /* @__PURE__ */ (0, import_jsx_runtime173.jsx)( 7651 import_block_editor27.RichText, 7652 { 7653 className: "wp-block-categories__label", 7654 "aria-label": (0, import_i18n17.__)("Label text"), 7655 placeholder: taxonomy?.name, 7656 withoutInteractiveFormatting: true, 7657 value: label, 7658 onChange: (html) => setAttributes({ label: html }) 7659 } 7660 ) : /* @__PURE__ */ (0, import_jsx_runtime173.jsx)(import_components12.VisuallyHidden, { as: "label", htmlFor: selectId, children: label ? label : taxonomy?.name }), 7661 /* @__PURE__ */ (0, import_jsx_runtime173.jsxs)("select", { id: selectId, children: [ 7662 /* @__PURE__ */ (0, import_jsx_runtime173.jsx)("option", { children: (0, import_i18n17.sprintf)( 7663 /* translators: %s: taxonomy's singular name */ 7664 (0, import_i18n17.__)("Select %s"), 7665 taxonomy?.labels?.singular_name 7666 ) }), 7667 categoriesList.map( 7668 (category) => renderCategoryDropdownItem(category, 0) 7669 ) 7670 ] }) 7671 ] }); 7672 }; 7673 const renderCategoryDropdownItem = (category, level) => { 7674 const { id, count, name: name117 } = category; 7675 const childCategories = getCategoriesList(id); 7676 return [ 7677 /* @__PURE__ */ (0, import_jsx_runtime173.jsxs)("option", { className: `level-$level}`, children: [ 7678 Array.from({ length: level * 3 }).map(() => "\xA0"), 7679 renderCategoryName(name117), 7680 showPostCounts && ` ($count})` 7681 ] }, id), 7682 isHierarchicalTaxonomy && showHierarchy && !!childCategories.length && childCategories.map( 7683 (childCategory) => renderCategoryDropdownItem(childCategory, level + 1) 7684 ) 7685 ]; 7686 }; 7687 const TagName2 = !!categories?.length && !displayAsDropdown && !isResolving ? "ul" : "div"; 7688 const classes = clsx_default( 7689 className, 7690 `wp-block-categories-taxonomy-$taxonomySlug}`, 7691 { 7692 "wp-block-categories-list": !!categories?.length && !displayAsDropdown && !isResolving, 7693 "wp-block-categories-dropdown": !!categories?.length && displayAsDropdown && !isResolving 7694 } 7695 ); 7696 const blockProps = (0, import_block_editor27.useBlockProps)({ 7697 className: classes 7698 }); 7699 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 7700 return /* @__PURE__ */ (0, import_jsx_runtime173.jsxs)(TagName2, { ...blockProps, children: [ 7701 /* @__PURE__ */ (0, import_jsx_runtime173.jsx)(import_block_editor27.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime173.jsxs)( 7702 import_components12.__experimentalToolsPanel, 7703 { 7704 label: (0, import_i18n17.__)("Settings"), 7705 resetAll: () => { 7706 setAttributes({ 7707 taxonomy: "category", 7708 displayAsDropdown: false, 7709 showHierarchy: false, 7710 showPostCounts: false, 7711 showOnlyTopLevel: false, 7712 showEmpty: false, 7713 showLabel: true 7714 }); 7715 }, 7716 dropdownMenuProps, 7717 children: [ 7718 Array.isArray(taxonomies) && /* @__PURE__ */ (0, import_jsx_runtime173.jsx)( 7719 import_components12.__experimentalToolsPanelItem, 7720 { 7721 hasValue: () => { 7722 return taxonomySlug !== "category"; 7723 }, 7724 label: (0, import_i18n17.__)("Taxonomy"), 7725 onDeselect: () => { 7726 setAttributes({ taxonomy: "category" }); 7727 }, 7728 isShownByDefault: true, 7729 children: /* @__PURE__ */ (0, import_jsx_runtime173.jsx)( 7730 import_components12.SelectControl, 7731 { 7732 __next40pxDefaultSize: true, 7733 label: (0, import_i18n17.__)("Taxonomy"), 7734 options: taxonomies.map((t2) => ({ 7735 label: t2.name, 7736 value: t2.slug 7737 })), 7738 value: taxonomySlug, 7739 onChange: (selectedTaxonomy) => setAttributes({ 7740 taxonomy: selectedTaxonomy 7741 }) 7742 } 7743 ) 7744 } 7745 ), 7746 /* @__PURE__ */ (0, import_jsx_runtime173.jsx)( 7747 import_components12.__experimentalToolsPanelItem, 7748 { 7749 hasValue: () => !!displayAsDropdown, 7750 label: (0, import_i18n17.__)("Display as dropdown"), 7751 onDeselect: () => setAttributes({ displayAsDropdown: false }), 7752 isShownByDefault: true, 7753 children: /* @__PURE__ */ (0, import_jsx_runtime173.jsx)( 7754 import_components12.ToggleControl, 7755 { 7756 label: (0, import_i18n17.__)("Display as dropdown"), 7757 checked: displayAsDropdown, 7758 onChange: toggleAttribute("displayAsDropdown") 7759 } 7760 ) 7761 } 7762 ), 7763 displayAsDropdown && /* @__PURE__ */ (0, import_jsx_runtime173.jsx)( 7764 import_components12.__experimentalToolsPanelItem, 7765 { 7766 hasValue: () => !showLabel, 7767 label: (0, import_i18n17.__)("Show label"), 7768 onDeselect: () => setAttributes({ showLabel: true }), 7769 isShownByDefault: true, 7770 children: /* @__PURE__ */ (0, import_jsx_runtime173.jsx)( 7771 import_components12.ToggleControl, 7772 { 7773 className: "wp-block-categories__indentation", 7774 label: (0, import_i18n17.__)("Show label"), 7775 checked: showLabel, 7776 onChange: toggleAttribute("showLabel") 7777 } 7778 ) 7779 } 7780 ), 7781 /* @__PURE__ */ (0, import_jsx_runtime173.jsx)( 7782 import_components12.__experimentalToolsPanelItem, 7783 { 7784 hasValue: () => !!showPostCounts, 7785 label: (0, import_i18n17.__)("Show post counts"), 7786 onDeselect: () => setAttributes({ showPostCounts: false }), 7787 isShownByDefault: true, 7788 children: /* @__PURE__ */ (0, import_jsx_runtime173.jsx)( 7789 import_components12.ToggleControl, 7790 { 7791 label: (0, import_i18n17.__)("Show post counts"), 7792 checked: showPostCounts, 7793 onChange: toggleAttribute("showPostCounts") 7794 } 7795 ) 7796 } 7797 ), 7798 isHierarchicalTaxonomy && /* @__PURE__ */ (0, import_jsx_runtime173.jsx)( 7799 import_components12.__experimentalToolsPanelItem, 7800 { 7801 hasValue: () => !!showOnlyTopLevel, 7802 label: (0, import_i18n17.__)("Show only top level terms"), 7803 onDeselect: () => setAttributes({ showOnlyTopLevel: false }), 7804 isShownByDefault: true, 7805 children: /* @__PURE__ */ (0, import_jsx_runtime173.jsx)( 7806 import_components12.ToggleControl, 7807 { 7808 label: (0, import_i18n17.__)("Show only top level terms"), 7809 checked: showOnlyTopLevel, 7810 onChange: toggleAttribute( 7811 "showOnlyTopLevel" 7812 ) 7813 } 7814 ) 7815 } 7816 ), 7817 /* @__PURE__ */ (0, import_jsx_runtime173.jsx)( 7818 import_components12.__experimentalToolsPanelItem, 7819 { 7820 hasValue: () => !!showEmpty, 7821 label: (0, import_i18n17.__)("Show empty terms"), 7822 onDeselect: () => setAttributes({ showEmpty: false }), 7823 isShownByDefault: true, 7824 children: /* @__PURE__ */ (0, import_jsx_runtime173.jsx)( 7825 import_components12.ToggleControl, 7826 { 7827 label: (0, import_i18n17.__)("Show empty terms"), 7828 checked: showEmpty, 7829 onChange: toggleAttribute("showEmpty") 7830 } 7831 ) 7832 } 7833 ), 7834 isHierarchicalTaxonomy && !showOnlyTopLevel && /* @__PURE__ */ (0, import_jsx_runtime173.jsx)( 7835 import_components12.__experimentalToolsPanelItem, 7836 { 7837 hasValue: () => !!showHierarchy, 7838 label: (0, import_i18n17.__)("Show hierarchy"), 7839 onDeselect: () => setAttributes({ showHierarchy: false }), 7840 isShownByDefault: true, 7841 children: /* @__PURE__ */ (0, import_jsx_runtime173.jsx)( 7842 import_components12.ToggleControl, 7843 { 7844 label: (0, import_i18n17.__)("Show hierarchy"), 7845 checked: showHierarchy, 7846 onChange: toggleAttribute("showHierarchy") 7847 } 7848 ) 7849 } 7850 ) 7851 ] 7852 } 7853 ) }), 7854 isResolving && /* @__PURE__ */ (0, import_jsx_runtime173.jsx)(import_components12.Placeholder, { icon: pin_default, label: (0, import_i18n17.__)("Terms"), children: /* @__PURE__ */ (0, import_jsx_runtime173.jsx)(import_components12.Spinner, {}) }), 7855 !isResolving && categories?.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime173.jsx)("p", { children: taxonomy.labels.no_terms }), 7856 !isResolving && categories?.length > 0 && (displayAsDropdown ? renderCategoryDropdown() : renderCategoryList()) 7857 ] }); 7858 } 7859 7860 // packages/block-library/build-module/categories/variations.js 7861 var import_i18n18 = __toESM(require_i18n()); 7862 var variations = [ 7863 { 7864 name: "terms", 7865 title: (0, import_i18n18.__)("Terms List"), 7866 icon: category_default, 7867 attributes: { 7868 // We need to set an attribute here that will be set when inserting the block. 7869 // We cannot leave this empty, as that would be interpreted as the default value, 7870 // which is `category` -- for which we're defining a distinct variation below, 7871 // for backwards compatibility reasons. 7872 // The logical fallback is thus the only other built-in and public taxonomy: Tags. 7873 taxonomy: "post_tag" 7874 }, 7875 isActive: (blockAttributes8) => ( 7876 // This variation is used for any taxonomy other than `category`. 7877 blockAttributes8.taxonomy !== "category" 7878 ) 7879 }, 7880 { 7881 name: "categories", 7882 title: (0, import_i18n18.__)("Categories List"), 7883 description: (0, import_i18n18.__)("Display a list of all categories."), 7884 icon: category_default, 7885 attributes: { 7886 taxonomy: "category" 7887 }, 7888 isActive: ["taxonomy"], 7889 // The following is needed to prevent "Terms List" from showing up twice in the inserter 7890 // (once for the block, once for the variation). Fortunately, it does not collide with 7891 // `categories` being the default value of the `taxonomy` attribute. 7892 isDefault: true 7893 } 7894 ]; 7895 var variations_default = variations; 7896 7897 // packages/block-library/build-module/categories/index.js 7898 var { name: name12 } = block_default13; 7899 var settings12 = { 7900 icon: category_default, 7901 example: {}, 7902 edit: CategoriesEdit, 7903 variations: variations_default 7904 }; 7905 var init12 = () => initBlock({ name: name12, metadata: block_default13, settings: settings12 }); 7906 7907 // packages/block-library/build-module/freeform/index.js 7908 var freeform_exports = {}; 7909 __export(freeform_exports, { 7910 init: () => init13, 7911 metadata: () => block_default14, 7912 name: () => name13, 7913 settings: () => settings13 7914 }); 7915 7916 // packages/block-library/build-module/freeform/edit.js 7917 var import_block_editor30 = __toESM(require_block_editor()); 7918 var import_compose9 = __toESM(require_compose()); 7919 var import_data15 = __toESM(require_data()); 7920 var import_components15 = __toESM(require_components()); 7921 var import_element13 = __toESM(require_element()); 7922 var import_i18n21 = __toESM(require_i18n()); 7923 var import_keycodes2 = __toESM(require_keycodes()); 7924 7925 // packages/block-library/build-module/freeform/convert-to-blocks-button.js 7926 var import_i18n19 = __toESM(require_i18n()); 7927 var import_components13 = __toESM(require_components()); 7928 var import_data13 = __toESM(require_data()); 7929 var import_blocks13 = __toESM(require_blocks()); 7930 var import_block_editor28 = __toESM(require_block_editor()); 7931 var import_jsx_runtime174 = __toESM(require_jsx_runtime()); 7932 var ConvertToBlocksButton = ({ clientId }) => { 7933 const { replaceBlocks } = (0, import_data13.useDispatch)(import_block_editor28.store); 7934 const block = (0, import_data13.useSelect)( 7935 (select9) => { 7936 return select9(import_block_editor28.store).getBlock(clientId); 7937 }, 7938 [clientId] 7939 ); 7940 return /* @__PURE__ */ (0, import_jsx_runtime174.jsx)( 7941 import_components13.ToolbarButton, 7942 { 7943 onClick: () => replaceBlocks( 7944 block.clientId, 7945 (0, import_blocks13.rawHandler)({ HTML: (0, import_blocks13.serialize)(block) }) 7946 ), 7947 children: (0, import_i18n19.__)("Convert to blocks") 7948 } 7949 ); 7950 }; 7951 var convert_to_blocks_button_default = ConvertToBlocksButton; 7952 7953 // packages/block-library/build-module/freeform/modal.js 7954 var import_block_editor29 = __toESM(require_block_editor()); 7955 var import_components14 = __toESM(require_components()); 7956 var import_element12 = __toESM(require_element()); 7957 var import_i18n20 = __toESM(require_i18n()); 7958 var import_data14 = __toESM(require_data()); 7959 var import_compose8 = __toESM(require_compose()); 7960 var import_jsx_runtime175 = __toESM(require_jsx_runtime()); 7961 function ModalAuxiliaryActions({ onClick, isModalFullScreen }) { 7962 const isMobileViewport = (0, import_compose8.useViewportMatch)("small", "<"); 7963 if (isMobileViewport) { 7964 return null; 7965 } 7966 return /* @__PURE__ */ (0, import_jsx_runtime175.jsx)( 7967 import_components14.Button, 7968 { 7969 size: "compact", 7970 onClick, 7971 icon: fullscreen_default, 7972 isPressed: isModalFullScreen, 7973 label: isModalFullScreen ? (0, import_i18n20.__)("Exit fullscreen") : (0, import_i18n20.__)("Enter fullscreen") 7974 } 7975 ); 7976 } 7977 function ClassicEdit(props) { 7978 const styles = (0, import_data14.useSelect)( 7979 (select9) => select9(import_block_editor29.store).getSettings().styles 7980 ); 7981 (0, import_element12.useEffect)(() => { 7982 const { baseURL, suffix, settings: settings116 } = window.wpEditorL10n.tinymce; 7983 window.tinymce.EditorManager.overrideDefaults({ 7984 base_url: baseURL, 7985 suffix 7986 }); 7987 window.wp.oldEditor.initialize(props.id, { 7988 tinymce: { 7989 ...settings116, 7990 setup(editor) { 7991 editor.on("init", () => { 7992 const doc = editor.getDoc(); 7993 styles.forEach(({ css }) => { 7994 const styleEl = doc.createElement("style"); 7995 styleEl.innerHTML = css; 7996 doc.head.appendChild(styleEl); 7997 }); 7998 }); 7999 } 8000 } 8001 }); 8002 return () => { 8003 window.wp.oldEditor.remove(props.id); 8004 }; 8005 }, []); 8006 return /* @__PURE__ */ (0, import_jsx_runtime175.jsx)("textarea", { ...props }); 8007 } 8008 function ModalEdit(props) { 8009 const { 8010 clientId, 8011 attributes: { content }, 8012 setAttributes, 8013 onReplace 8014 } = props; 8015 const [isOpen, setOpen] = (0, import_element12.useState)(false); 8016 const [isModalFullScreen, setIsModalFullScreen] = (0, import_element12.useState)(false); 8017 const id = `editor-$clientId}`; 8018 const onClose = () => content ? setOpen(false) : onReplace([]); 8019 return /* @__PURE__ */ (0, import_jsx_runtime175.jsxs)(import_jsx_runtime175.Fragment, { children: [ 8020 /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(import_block_editor29.BlockControls, { children: /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(import_components14.ToolbarGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(import_components14.ToolbarButton, { onClick: () => setOpen(true), children: (0, import_i18n20.__)("Edit") }) }) }), 8021 content && /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(import_element12.RawHTML, { children: content }), 8022 (isOpen || !content) && /* @__PURE__ */ (0, import_jsx_runtime175.jsxs)( 8023 import_components14.Modal, 8024 { 8025 title: (0, import_i18n20.__)("Classic Editor"), 8026 onRequestClose: onClose, 8027 shouldCloseOnClickOutside: false, 8028 overlayClassName: "block-editor-freeform-modal", 8029 isFullScreen: isModalFullScreen, 8030 className: "block-editor-freeform-modal__content", 8031 headerActions: /* @__PURE__ */ (0, import_jsx_runtime175.jsx)( 8032 ModalAuxiliaryActions, 8033 { 8034 onClick: () => setIsModalFullScreen(!isModalFullScreen), 8035 isModalFullScreen 8036 } 8037 ), 8038 children: [ 8039 /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(ClassicEdit, { id, defaultValue: content }), 8040 /* @__PURE__ */ (0, import_jsx_runtime175.jsxs)( 8041 import_components14.Flex, 8042 { 8043 className: "block-editor-freeform-modal__actions", 8044 justify: "flex-end", 8045 expanded: false, 8046 children: [ 8047 /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(import_components14.FlexItem, { children: /* @__PURE__ */ (0, import_jsx_runtime175.jsx)( 8048 import_components14.Button, 8049 { 8050 __next40pxDefaultSize: true, 8051 variant: "tertiary", 8052 onClick: onClose, 8053 children: (0, import_i18n20.__)("Cancel") 8054 } 8055 ) }), 8056 /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(import_components14.FlexItem, { children: /* @__PURE__ */ (0, import_jsx_runtime175.jsx)( 8057 import_components14.Button, 8058 { 8059 __next40pxDefaultSize: true, 8060 variant: "primary", 8061 onClick: () => { 8062 setAttributes({ 8063 content: window.wp.oldEditor.getContent( 8064 id 8065 ) 8066 }); 8067 setOpen(false); 8068 }, 8069 children: (0, import_i18n20.__)("Save") 8070 } 8071 ) }) 8072 ] 8073 } 8074 ) 8075 ] 8076 } 8077 ) 8078 ] }); 8079 } 8080 8081 // packages/block-library/build-module/freeform/edit.js 8082 var import_jsx_runtime176 = __toESM(require_jsx_runtime()); 8083 var { wp } = window; 8084 function isTmceEmpty(editor) { 8085 const body = editor.getBody(); 8086 if (body.childNodes.length > 1) { 8087 return false; 8088 } else if (body.childNodes.length === 0) { 8089 return true; 8090 } 8091 if (body.childNodes[0].childNodes.length > 1) { 8092 return false; 8093 } 8094 return /^\n?$/.test(body.innerText || body.textContent); 8095 } 8096 function FreeformEdit(props) { 8097 const { clientId } = props; 8098 const canRemove = (0, import_data15.useSelect)( 8099 (select9) => select9(import_block_editor30.store).canRemoveBlock(clientId), 8100 [clientId] 8101 ); 8102 const [isIframed, setIsIframed] = (0, import_element13.useState)(false); 8103 const ref = (0, import_compose9.useRefEffect)((element) => { 8104 setIsIframed(element.ownerDocument !== document); 8105 }, []); 8106 return /* @__PURE__ */ (0, import_jsx_runtime176.jsxs)(import_jsx_runtime176.Fragment, { children: [ 8107 canRemove && /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(import_block_editor30.BlockControls, { children: /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(import_components15.ToolbarGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(convert_to_blocks_button_default, { clientId }) }) }), 8108 /* @__PURE__ */ (0, import_jsx_runtime176.jsx)("div", { ...(0, import_block_editor30.useBlockProps)({ ref }), children: isIframed ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(ModalEdit, { ...props }) : /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(ClassicEdit2, { ...props }) }) 8109 ] }); 8110 } 8111 function ClassicEdit2({ 8112 clientId, 8113 attributes: { content }, 8114 setAttributes, 8115 onReplace 8116 }) { 8117 const { getMultiSelectedBlockClientIds } = (0, import_data15.useSelect)(import_block_editor30.store); 8118 const didMountRef = (0, import_element13.useRef)(false); 8119 (0, import_element13.useEffect)(() => { 8120 if (!didMountRef.current) { 8121 return; 8122 } 8123 const editor = window.tinymce.get(`editor-$clientId}`); 8124 if (!editor) { 8125 return; 8126 } 8127 const currentContent = editor.getContent(); 8128 if (currentContent !== content) { 8129 editor.setContent(content || ""); 8130 } 8131 }, [clientId, content]); 8132 (0, import_element13.useEffect)(() => { 8133 const { baseURL, suffix } = window.wpEditorL10n.tinymce; 8134 didMountRef.current = true; 8135 window.tinymce.EditorManager.overrideDefaults({ 8136 base_url: baseURL, 8137 suffix 8138 }); 8139 function onSetup(editor) { 8140 let bookmark; 8141 if (content) { 8142 editor.on("loadContent", () => editor.setContent(content)); 8143 } 8144 editor.on("blur", () => { 8145 bookmark = editor.selection.getBookmark(2, true); 8146 const scrollContainer = document.querySelector( 8147 ".interface-interface-skeleton__content" 8148 ); 8149 const scrollPosition = scrollContainer.scrollTop; 8150 if (!getMultiSelectedBlockClientIds()?.length) { 8151 setAttributes({ 8152 content: editor.getContent() 8153 }); 8154 } 8155 editor.once("focus", () => { 8156 if (bookmark) { 8157 editor.selection.moveToBookmark(bookmark); 8158 if (scrollContainer.scrollTop !== scrollPosition) { 8159 scrollContainer.scrollTop = scrollPosition; 8160 } 8161 } 8162 }); 8163 return false; 8164 }); 8165 editor.on("mousedown touchstart", () => { 8166 bookmark = null; 8167 }); 8168 const debouncedOnChange = (0, import_compose9.debounce)(() => { 8169 const value = editor.getContent(); 8170 if (value !== editor._lastChange) { 8171 editor._lastChange = value; 8172 setAttributes({ 8173 content: value 8174 }); 8175 } 8176 }, 250); 8177 editor.on("Paste Change input Undo Redo", debouncedOnChange); 8178 editor.on("remove", debouncedOnChange.cancel); 8179 editor.on("keydown", (event) => { 8180 if (import_keycodes2.isKeyboardEvent.primary(event, "z")) { 8181 event.stopPropagation(); 8182 } 8183 if ((event.keyCode === import_keycodes2.BACKSPACE || event.keyCode === import_keycodes2.DELETE) && isTmceEmpty(editor)) { 8184 onReplace([]); 8185 event.preventDefault(); 8186 event.stopImmediatePropagation(); 8187 } 8188 const { altKey } = event; 8189 if (altKey && event.keyCode === import_keycodes2.F10) { 8190 event.stopPropagation(); 8191 } 8192 }); 8193 editor.on("paste", (event) => { 8194 event.stopPropagation(); 8195 }); 8196 editor.on("init", () => { 8197 const rootNode = editor.getBody(); 8198 if (rootNode.ownerDocument.activeElement === rootNode) { 8199 rootNode.blur(); 8200 editor.focus(); 8201 } 8202 }); 8203 } 8204 function initialize() { 8205 const { settings: settings116 } = window.wpEditorL10n.tinymce; 8206 wp.oldEditor.initialize(`editor-$clientId}`, { 8207 tinymce: { 8208 ...settings116, 8209 inline: true, 8210 content_css: false, 8211 fixed_toolbar_container: `#toolbar-$clientId}`, 8212 setup: onSetup 8213 } 8214 }); 8215 } 8216 function onReadyStateChange() { 8217 if (document.readyState === "complete") { 8218 initialize(); 8219 } 8220 } 8221 if (document.readyState === "complete") { 8222 initialize(); 8223 } else { 8224 document.addEventListener("readystatechange", onReadyStateChange); 8225 } 8226 return () => { 8227 document.removeEventListener( 8228 "readystatechange", 8229 onReadyStateChange 8230 ); 8231 wp.oldEditor.remove(`editor-$clientId}`); 8232 didMountRef.current = false; 8233 }; 8234 }, []); 8235 function focus2() { 8236 const editor = window.tinymce.get(`editor-$clientId}`); 8237 if (editor) { 8238 editor.focus(); 8239 } 8240 } 8241 function onToolbarKeyDown(event) { 8242 event.stopPropagation(); 8243 event.nativeEvent.stopImmediatePropagation(); 8244 } 8245 return /* @__PURE__ */ (0, import_jsx_runtime176.jsxs)(import_jsx_runtime176.Fragment, { children: [ 8246 /* @__PURE__ */ (0, import_jsx_runtime176.jsx)( 8247 "div", 8248 { 8249 id: `toolbar-$clientId}`, 8250 className: "block-library-classic__toolbar", 8251 onClick: focus2, 8252 "data-placeholder": (0, import_i18n21.__)("Classic"), 8253 onKeyDown: onToolbarKeyDown 8254 }, 8255 "toolbar" 8256 ), 8257 /* @__PURE__ */ (0, import_jsx_runtime176.jsx)( 8258 "div", 8259 { 8260 id: `editor-$clientId}`, 8261 className: "wp-block-freeform block-library-rich-text__tinymce" 8262 }, 8263 "editor" 8264 ) 8265 ] }); 8266 } 8267 8268 // packages/block-library/build-module/freeform/block.json 8269 var block_default14 = { 8270 $schema: "https://schemas.wp.org/trunk/block.json", 8271 apiVersion: 3, 8272 name: "core/freeform", 8273 title: "Classic", 8274 category: "text", 8275 description: "Use the classic WordPress editor.", 8276 textdomain: "default", 8277 attributes: { 8278 content: { 8279 type: "string", 8280 source: "raw" 8281 } 8282 }, 8283 supports: { 8284 className: false, 8285 customClassName: false, 8286 lock: false, 8287 reusable: false, 8288 renaming: false, 8289 visibility: false 8290 }, 8291 editorStyle: "wp-block-freeform-editor" 8292 }; 8293 8294 // packages/block-library/build-module/freeform/save.js 8295 var import_element14 = __toESM(require_element()); 8296 var import_jsx_runtime177 = __toESM(require_jsx_runtime()); 8297 function save8({ attributes: attributes3 }) { 8298 const { content } = attributes3; 8299 return /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(import_element14.RawHTML, { children: content }); 8300 } 8301 8302 // packages/block-library/build-module/freeform/index.js 8303 var { name: name13 } = block_default14; 8304 var settings13 = { 8305 icon: classic_default, 8306 edit: FreeformEdit, 8307 save: save8 8308 }; 8309 var init13 = () => initBlock({ name: name13, metadata: block_default14, settings: settings13 }); 8310 8311 // packages/block-library/build-module/code/index.js 8312 var code_exports = {}; 8313 __export(code_exports, { 8314 init: () => init14, 8315 metadata: () => block_default15, 8316 name: () => name14, 8317 settings: () => settings14 8318 }); 8319 var import_i18n23 = __toESM(require_i18n()); 8320 var import_blocks16 = __toESM(require_blocks()); 8321 8322 // packages/block-library/build-module/code/edit.js 8323 var import_i18n22 = __toESM(require_i18n()); 8324 var import_block_editor31 = __toESM(require_block_editor()); 8325 var import_blocks14 = __toESM(require_blocks()); 8326 var import_jsx_runtime178 = __toESM(require_jsx_runtime()); 8327 function CodeEdit({ 8328 attributes: attributes3, 8329 setAttributes, 8330 onRemove, 8331 insertBlocksAfter, 8332 mergeBlocks 8333 }) { 8334 const blockProps = (0, import_block_editor31.useBlockProps)(); 8335 return /* @__PURE__ */ (0, import_jsx_runtime178.jsx)("pre", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime178.jsx)( 8336 import_block_editor31.RichText, 8337 { 8338 tagName: "code", 8339 identifier: "content", 8340 value: attributes3.content, 8341 onChange: (content) => setAttributes({ content }), 8342 onRemove, 8343 onMerge: mergeBlocks, 8344 placeholder: (0, import_i18n22.__)("Write code\u2026"), 8345 "aria-label": (0, import_i18n22.__)("Code"), 8346 preserveWhiteSpace: true, 8347 __unstablePastePlainText: true, 8348 __unstableOnSplitAtDoubleLineEnd: () => insertBlocksAfter((0, import_blocks14.createBlock)((0, import_blocks14.getDefaultBlockName)())) 8349 } 8350 ) }); 8351 } 8352 8353 // packages/block-library/build-module/code/block.json 8354 var block_default15 = { 8355 $schema: "https://schemas.wp.org/trunk/block.json", 8356 apiVersion: 3, 8357 name: "core/code", 8358 title: "Code", 8359 category: "text", 8360 description: "Display code snippets that respect your spacing and tabs.", 8361 textdomain: "default", 8362 attributes: { 8363 content: { 8364 type: "rich-text", 8365 source: "rich-text", 8366 selector: "code", 8367 __unstablePreserveWhiteSpace: true, 8368 role: "content" 8369 } 8370 }, 8371 supports: { 8372 align: ["wide"], 8373 anchor: true, 8374 typography: { 8375 fontSize: true, 8376 lineHeight: true, 8377 __experimentalFontFamily: true, 8378 __experimentalFontWeight: true, 8379 __experimentalFontStyle: true, 8380 __experimentalTextTransform: true, 8381 __experimentalTextDecoration: true, 8382 __experimentalLetterSpacing: true, 8383 __experimentalDefaultControls: { 8384 fontSize: true 8385 } 8386 }, 8387 spacing: { 8388 margin: ["top", "bottom"], 8389 padding: true, 8390 __experimentalDefaultControls: { 8391 margin: false, 8392 padding: false 8393 } 8394 }, 8395 __experimentalBorder: { 8396 radius: true, 8397 color: true, 8398 width: true, 8399 style: true, 8400 __experimentalDefaultControls: { 8401 width: true, 8402 color: true 8403 } 8404 }, 8405 color: { 8406 text: true, 8407 background: true, 8408 gradients: true, 8409 __experimentalDefaultControls: { 8410 background: true, 8411 text: true 8412 } 8413 }, 8414 interactivity: { 8415 clientNavigation: true 8416 } 8417 }, 8418 style: "wp-block-code" 8419 }; 8420 8421 // packages/block-library/build-module/code/save.js 8422 var import_block_editor32 = __toESM(require_block_editor()); 8423 8424 // packages/block-library/build-module/code/utils.js 8425 var import_compose10 = __toESM(require_compose()); 8426 function escape(content) { 8427 return (0, import_compose10.pipe)( 8428 escapeOpeningSquareBrackets, 8429 escapeProtocolInIsolatedUrls 8430 )(content || ""); 8431 } 8432 function escapeOpeningSquareBrackets(content) { 8433 return content.replace(/\[/g, "["); 8434 } 8435 function escapeProtocolInIsolatedUrls(content) { 8436 return content.replace( 8437 /^(\s*https?:)\/\/([^\s<>"]+\s*)$/m, 8438 "$1//$2" 8439 ); 8440 } 8441 8442 // packages/block-library/build-module/code/save.js 8443 var import_jsx_runtime179 = __toESM(require_jsx_runtime()); 8444 function save9({ attributes: attributes3 }) { 8445 return /* @__PURE__ */ (0, import_jsx_runtime179.jsx)("pre", { ...import_block_editor32.useBlockProps.save(), children: /* @__PURE__ */ (0, import_jsx_runtime179.jsx)( 8446 import_block_editor32.RichText.Content, 8447 { 8448 tagName: "code", 8449 value: escape( 8450 typeof attributes3.content === "string" ? attributes3.content : attributes3.content.toHTMLString({ 8451 preserveWhiteSpace: true 8452 }) 8453 ) 8454 } 8455 ) }); 8456 } 8457 8458 // packages/block-library/build-module/code/transforms.js 8459 var import_blocks15 = __toESM(require_blocks()); 8460 var import_rich_text2 = __toESM(require_rich_text()); 8461 var transforms4 = { 8462 from: [ 8463 { 8464 type: "enter", 8465 regExp: /^```$/, 8466 transform: () => (0, import_blocks15.createBlock)("core/code") 8467 }, 8468 { 8469 type: "block", 8470 blocks: ["core/paragraph"], 8471 transform: (attributes3) => { 8472 const { content } = attributes3; 8473 return (0, import_blocks15.createBlock)("core/code", { 8474 ...attributes3, 8475 ...getTransformedAttributes(attributes3, "core/code"), 8476 content 8477 }); 8478 } 8479 }, 8480 { 8481 type: "block", 8482 blocks: ["core/html"], 8483 transform: (attributes3) => { 8484 const { content: text } = attributes3; 8485 return (0, import_blocks15.createBlock)("core/code", { 8486 ...attributes3, 8487 ...getTransformedAttributes(attributes3, "core/code"), 8488 // The HTML is plain text (with plain line breaks), so 8489 // convert it to rich text. 8490 content: (0, import_rich_text2.toHTMLString)({ value: (0, import_rich_text2.create)({ text }) }) 8491 }); 8492 } 8493 }, 8494 { 8495 type: "raw", 8496 isMatch: (node) => node.nodeName === "PRE" && node.children.length === 1 && node.firstChild.nodeName === "CODE", 8497 schema: { 8498 pre: { 8499 children: { 8500 code: { 8501 children: { 8502 "#text": {} 8503 } 8504 } 8505 } 8506 } 8507 } 8508 } 8509 ], 8510 to: [ 8511 { 8512 type: "block", 8513 blocks: ["core/paragraph"], 8514 transform: (attributes3) => { 8515 const { content } = attributes3; 8516 return (0, import_blocks15.createBlock)("core/paragraph", { 8517 ...getTransformedAttributes(attributes3, "core/paragraph"), 8518 content 8519 }); 8520 } 8521 } 8522 ] 8523 }; 8524 var transforms_default4 = transforms4; 8525 8526 // packages/block-library/build-module/code/index.js 8527 var { fieldsKey: fieldsKey3, formKey: formKey3 } = unlock(import_blocks16.privateApis); 8528 var { name: name14 } = block_default15; 8529 var settings14 = { 8530 icon: code_default, 8531 example: { 8532 attributes: { 8533 /* eslint-disable @wordpress/i18n-no-collapsible-whitespace */ 8534 // translators: Preserve \n markers for line breaks 8535 content: (0, import_i18n23.__)( 8536 "// A \u201Cblock\u201D 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 );" 8537 ) 8538 /* eslint-enable @wordpress/i18n-no-collapsible-whitespace */ 8539 } 8540 }, 8541 merge(attributes3, attributesToMerge) { 8542 return { 8543 content: attributes3.content + "\n\n" + attributesToMerge.content 8544 }; 8545 }, 8546 transforms: transforms_default4, 8547 edit: CodeEdit, 8548 save: save9 8549 }; 8550 if (window.__experimentalContentOnlyInspectorFields) { 8551 settings14[fieldsKey3] = [ 8552 { 8553 id: "content", 8554 label: (0, import_i18n23.__)("Code"), 8555 type: "richtext" 8556 } 8557 ]; 8558 settings14[formKey3] = { 8559 fields: ["content"] 8560 }; 8561 } 8562 var init14 = () => initBlock({ name: name14, metadata: block_default15, settings: settings14 }); 8563 8564 // packages/block-library/build-module/column/index.js 8565 var column_exports = {}; 8566 __export(column_exports, { 8567 init: () => init15, 8568 metadata: () => block_default16, 8569 name: () => name15, 8570 settings: () => settings15 8571 }); 8572 8573 // packages/block-library/build-module/column/deprecated.js 8574 var import_block_editor33 = __toESM(require_block_editor()); 8575 var import_jsx_runtime180 = __toESM(require_jsx_runtime()); 8576 var deprecated4 = [ 8577 { 8578 attributes: { 8579 verticalAlignment: { 8580 type: "string" 8581 }, 8582 width: { 8583 type: "number", 8584 min: 0, 8585 max: 100 8586 } 8587 }, 8588 isEligible({ width }) { 8589 return isFinite(width); 8590 }, 8591 migrate(attributes3) { 8592 return { 8593 ...attributes3, 8594 width: `$attributes3.width}%` 8595 }; 8596 }, 8597 save({ attributes: attributes3 }) { 8598 const { verticalAlignment, width } = attributes3; 8599 const wrapperClasses = clsx_default({ 8600 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment 8601 }); 8602 const style2 = { flexBasis: width + "%" }; 8603 return /* @__PURE__ */ (0, import_jsx_runtime180.jsx)("div", { className: wrapperClasses, style: style2, children: /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(import_block_editor33.InnerBlocks.Content, {}) }); 8604 } 8605 } 8606 ]; 8607 var deprecated_default5 = deprecated4; 8608 8609 // packages/block-library/build-module/column/edit.js 8610 var import_block_editor34 = __toESM(require_block_editor()); 8611 var import_components16 = __toESM(require_components()); 8612 var import_data16 = __toESM(require_data()); 8613 var import_i18n24 = __toESM(require_i18n()); 8614 var import_jsx_runtime181 = __toESM(require_jsx_runtime()); 8615 function ColumnInspectorControls({ width, setAttributes }) { 8616 const [availableUnits] = (0, import_block_editor34.useSettings)("spacing.units"); 8617 const units = (0, import_components16.__experimentalUseCustomUnits)({ 8618 availableUnits: availableUnits || ["%", "px", "em", "rem", "vw"] 8619 }); 8620 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 8621 return /* @__PURE__ */ (0, import_jsx_runtime181.jsx)( 8622 import_components16.__experimentalToolsPanel, 8623 { 8624 label: (0, import_i18n24.__)("Settings"), 8625 resetAll: () => { 8626 setAttributes({ width: void 0 }); 8627 }, 8628 dropdownMenuProps, 8629 children: /* @__PURE__ */ (0, import_jsx_runtime181.jsx)( 8630 import_components16.__experimentalToolsPanelItem, 8631 { 8632 hasValue: () => width !== void 0, 8633 label: (0, import_i18n24.__)("Width"), 8634 onDeselect: () => setAttributes({ width: void 0 }), 8635 isShownByDefault: true, 8636 children: /* @__PURE__ */ (0, import_jsx_runtime181.jsx)( 8637 import_components16.__experimentalUnitControl, 8638 { 8639 label: (0, import_i18n24.__)("Width"), 8640 __unstableInputWidth: "calc(50% - 8px)", 8641 __next40pxDefaultSize: true, 8642 value: width || "", 8643 onChange: (nextWidth) => { 8644 nextWidth = 0 > parseFloat(nextWidth) ? "0" : nextWidth; 8645 setAttributes({ width: nextWidth }); 8646 }, 8647 units 8648 } 8649 ) 8650 } 8651 ) 8652 } 8653 ); 8654 } 8655 function ColumnEdit({ 8656 attributes: { verticalAlignment, width, templateLock, allowedBlocks }, 8657 setAttributes, 8658 clientId 8659 }) { 8660 const classes = clsx_default("block-core-columns", { 8661 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment 8662 }); 8663 const { columnsIds, hasChildBlocks, rootClientId } = (0, import_data16.useSelect)( 8664 (select9) => { 8665 const { getBlockOrder, getBlockRootClientId } = select9(import_block_editor34.store); 8666 const rootId = getBlockRootClientId(clientId); 8667 return { 8668 hasChildBlocks: getBlockOrder(clientId).length > 0, 8669 rootClientId: rootId, 8670 columnsIds: getBlockOrder(rootId) 8671 }; 8672 }, 8673 [clientId] 8674 ); 8675 const { updateBlockAttributes } = (0, import_data16.useDispatch)(import_block_editor34.store); 8676 const updateAlignment = (value) => { 8677 setAttributes({ verticalAlignment: value }); 8678 updateBlockAttributes(rootClientId, { 8679 verticalAlignment: null 8680 }); 8681 }; 8682 const widthWithUnit = Number.isFinite(width) ? width + "%" : width; 8683 const blockProps = (0, import_block_editor34.useBlockProps)({ 8684 className: classes, 8685 style: widthWithUnit ? { flexBasis: widthWithUnit } : void 0 8686 }); 8687 const columnsCount = columnsIds.length; 8688 const currentColumnPosition = columnsIds.indexOf(clientId) + 1; 8689 const label = (0, import_i18n24.sprintf)( 8690 /* translators: 1: Block label (i.e. "Block: Column"), 2: Position of the selected block, 3: Total number of sibling blocks of the same type */ 8691 (0, import_i18n24.__)("%1$s (%2$d of %3$d)"), 8692 blockProps["aria-label"], 8693 currentColumnPosition, 8694 columnsCount 8695 ); 8696 const innerBlocksProps = (0, import_block_editor34.useInnerBlocksProps)( 8697 { ...blockProps, "aria-label": label }, 8698 { 8699 templateLock, 8700 allowedBlocks, 8701 renderAppender: hasChildBlocks ? void 0 : import_block_editor34.InnerBlocks.ButtonBlockAppender 8702 } 8703 ); 8704 return /* @__PURE__ */ (0, import_jsx_runtime181.jsxs)(import_jsx_runtime181.Fragment, { children: [ 8705 /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(import_block_editor34.BlockControls, { children: /* @__PURE__ */ (0, import_jsx_runtime181.jsx)( 8706 import_block_editor34.BlockVerticalAlignmentToolbar, 8707 { 8708 onChange: updateAlignment, 8709 value: verticalAlignment, 8710 controls: ["top", "center", "bottom", "stretch"] 8711 } 8712 ) }), 8713 /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(import_block_editor34.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime181.jsx)( 8714 ColumnInspectorControls, 8715 { 8716 width, 8717 setAttributes 8718 } 8719 ) }), 8720 /* @__PURE__ */ (0, import_jsx_runtime181.jsx)("div", { ...innerBlocksProps }) 8721 ] }); 8722 } 8723 var edit_default4 = ColumnEdit; 8724 8725 // packages/block-library/build-module/column/block.json 8726 var block_default16 = { 8727 $schema: "https://schemas.wp.org/trunk/block.json", 8728 apiVersion: 3, 8729 name: "core/column", 8730 title: "Column", 8731 category: "design", 8732 parent: ["core/columns"], 8733 description: "A single column within a columns block.", 8734 textdomain: "default", 8735 attributes: { 8736 verticalAlignment: { 8737 type: "string" 8738 }, 8739 width: { 8740 type: "string" 8741 }, 8742 templateLock: { 8743 type: ["string", "boolean"], 8744 enum: ["all", "insert", "contentOnly", false] 8745 } 8746 }, 8747 supports: { 8748 __experimentalOnEnter: true, 8749 anchor: true, 8750 reusable: false, 8751 html: false, 8752 color: { 8753 gradients: true, 8754 heading: true, 8755 button: true, 8756 link: true, 8757 __experimentalDefaultControls: { 8758 background: true, 8759 text: true 8760 } 8761 }, 8762 shadow: true, 8763 spacing: { 8764 blockGap: true, 8765 padding: true, 8766 __experimentalDefaultControls: { 8767 padding: true, 8768 blockGap: true 8769 } 8770 }, 8771 __experimentalBorder: { 8772 color: true, 8773 radius: true, 8774 style: true, 8775 width: true, 8776 __experimentalDefaultControls: { 8777 color: true, 8778 radius: true, 8779 style: true, 8780 width: true 8781 } 8782 }, 8783 typography: { 8784 fontSize: true, 8785 lineHeight: true, 8786 __experimentalFontFamily: true, 8787 __experimentalFontWeight: true, 8788 __experimentalFontStyle: true, 8789 __experimentalTextTransform: true, 8790 __experimentalTextDecoration: true, 8791 __experimentalLetterSpacing: true, 8792 __experimentalDefaultControls: { 8793 fontSize: true 8794 } 8795 }, 8796 layout: true, 8797 interactivity: { 8798 clientNavigation: true 8799 }, 8800 allowedBlocks: true 8801 } 8802 }; 8803 8804 // packages/block-library/build-module/column/save.js 8805 var import_block_editor35 = __toESM(require_block_editor()); 8806 var import_jsx_runtime182 = __toESM(require_jsx_runtime()); 8807 function save10({ attributes: attributes3 }) { 8808 const { verticalAlignment, width } = attributes3; 8809 const wrapperClasses = clsx_default({ 8810 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment 8811 }); 8812 let style2; 8813 if (width && /\d/.test(width)) { 8814 let flexBasis = Number.isFinite(width) ? width + "%" : width; 8815 if (!Number.isFinite(width) && width?.endsWith("%")) { 8816 const multiplier = 1e12; 8817 flexBasis = Math.round(Number.parseFloat(width) * multiplier) / multiplier + "%"; 8818 } 8819 style2 = { flexBasis }; 8820 } 8821 const blockProps = import_block_editor35.useBlockProps.save({ 8822 className: wrapperClasses, 8823 style: style2 8824 }); 8825 const innerBlocksProps = import_block_editor35.useInnerBlocksProps.save(blockProps); 8826 return /* @__PURE__ */ (0, import_jsx_runtime182.jsx)("div", { ...innerBlocksProps }); 8827 } 8828 8829 // packages/block-library/build-module/column/index.js 8830 var { name: name15 } = block_default16; 8831 var settings15 = { 8832 icon: column_default, 8833 edit: edit_default4, 8834 save: save10, 8835 deprecated: deprecated_default5 8836 }; 8837 var init15 = () => initBlock({ name: name15, metadata: block_default16, settings: settings15 }); 8838 8839 // packages/block-library/build-module/columns/index.js 8840 var columns_exports = {}; 8841 __export(columns_exports, { 8842 init: () => init16, 8843 metadata: () => block_default17, 8844 name: () => name16, 8845 settings: () => settings16 8846 }); 8847 var import_i18n27 = __toESM(require_i18n()); 8848 8849 // packages/block-library/build-module/columns/deprecated.js 8850 var import_blocks17 = __toESM(require_blocks()); 8851 var import_block_editor36 = __toESM(require_block_editor()); 8852 var import_jsx_runtime183 = __toESM(require_jsx_runtime()); 8853 function getDeprecatedLayoutColumn(originalContent) { 8854 let { doc } = getDeprecatedLayoutColumn; 8855 if (!doc) { 8856 doc = document.implementation.createHTMLDocument(""); 8857 getDeprecatedLayoutColumn.doc = doc; 8858 } 8859 let columnMatch; 8860 doc.body.innerHTML = originalContent; 8861 for (const classListItem of doc.body.firstChild.classList) { 8862 if (columnMatch = classListItem.match(/^layout-column-(\d+)$/)) { 8863 return Number(columnMatch[1]) - 1; 8864 } 8865 } 8866 } 8867 var migrateCustomColors = (attributes3) => { 8868 if (!attributes3.customTextColor && !attributes3.customBackgroundColor) { 8869 return attributes3; 8870 } 8871 const style2 = { color: {} }; 8872 if (attributes3.customTextColor) { 8873 style2.color.text = attributes3.customTextColor; 8874 } 8875 if (attributes3.customBackgroundColor) { 8876 style2.color.background = attributes3.customBackgroundColor; 8877 } 8878 const { customTextColor, customBackgroundColor, ...restAttributes } = attributes3; 8879 return { 8880 ...restAttributes, 8881 style: style2, 8882 isStackedOnMobile: true 8883 }; 8884 }; 8885 var deprecated_default6 = [ 8886 { 8887 attributes: { 8888 verticalAlignment: { 8889 type: "string" 8890 }, 8891 backgroundColor: { 8892 type: "string" 8893 }, 8894 customBackgroundColor: { 8895 type: "string" 8896 }, 8897 customTextColor: { 8898 type: "string" 8899 }, 8900 textColor: { 8901 type: "string" 8902 } 8903 }, 8904 migrate: migrateCustomColors, 8905 save({ attributes: attributes3 }) { 8906 const { 8907 verticalAlignment, 8908 backgroundColor, 8909 customBackgroundColor, 8910 textColor, 8911 customTextColor 8912 } = attributes3; 8913 const backgroundClass = (0, import_block_editor36.getColorClassName)( 8914 "background-color", 8915 backgroundColor 8916 ); 8917 const textClass = (0, import_block_editor36.getColorClassName)("color", textColor); 8918 const className = clsx_default({ 8919 "has-background": backgroundColor || customBackgroundColor, 8920 "has-text-color": textColor || customTextColor, 8921 [backgroundClass]: backgroundClass, 8922 [textClass]: textClass, 8923 [`are-vertically-aligned-$verticalAlignment}`]: verticalAlignment 8924 }); 8925 const style2 = { 8926 backgroundColor: backgroundClass ? void 0 : customBackgroundColor, 8927 color: textClass ? void 0 : customTextColor 8928 }; 8929 return /* @__PURE__ */ (0, import_jsx_runtime183.jsx)( 8930 "div", 8931 { 8932 className: className ? className : void 0, 8933 style: style2, 8934 children: /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(import_block_editor36.InnerBlocks.Content, {}) 8935 } 8936 ); 8937 } 8938 }, 8939 { 8940 attributes: { 8941 columns: { 8942 type: "number", 8943 default: 2 8944 } 8945 }, 8946 isEligible(attributes3, innerBlocks) { 8947 const isFastPassEligible = innerBlocks.some( 8948 (innerBlock) => /layout-column-\d+/.test(innerBlock.originalContent) 8949 ); 8950 if (!isFastPassEligible) { 8951 return false; 8952 } 8953 return innerBlocks.some( 8954 (innerBlock) => getDeprecatedLayoutColumn(innerBlock.originalContent) !== void 0 8955 ); 8956 }, 8957 migrate(attributes3, innerBlocks) { 8958 const columns = innerBlocks.reduce((accumulator, innerBlock) => { 8959 const { originalContent } = innerBlock; 8960 let columnIndex = getDeprecatedLayoutColumn(originalContent); 8961 if (columnIndex === void 0) { 8962 columnIndex = 0; 8963 } 8964 if (!accumulator[columnIndex]) { 8965 accumulator[columnIndex] = []; 8966 } 8967 accumulator[columnIndex].push(innerBlock); 8968 return accumulator; 8969 }, []); 8970 const migratedInnerBlocks = columns.map( 8971 (columnBlocks) => (0, import_blocks17.createBlock)("core/column", {}, columnBlocks) 8972 ); 8973 const { columns: ignoredColumns, ...restAttributes } = attributes3; 8974 return [ 8975 { 8976 ...restAttributes, 8977 isStackedOnMobile: true 8978 }, 8979 migratedInnerBlocks 8980 ]; 8981 }, 8982 save({ attributes: attributes3 }) { 8983 const { columns } = attributes3; 8984 return /* @__PURE__ */ (0, import_jsx_runtime183.jsx)("div", { className: `has-$columns}-columns`, children: /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(import_block_editor36.InnerBlocks.Content, {}) }); 8985 } 8986 }, 8987 { 8988 attributes: { 8989 columns: { 8990 type: "number", 8991 default: 2 8992 } 8993 }, 8994 migrate(attributes3, innerBlocks) { 8995 const { columns, ...restAttributes } = attributes3; 8996 attributes3 = { 8997 ...restAttributes, 8998 isStackedOnMobile: true 8999 }; 9000 return [attributes3, innerBlocks]; 9001 }, 9002 save({ attributes: attributes3 }) { 9003 const { verticalAlignment, columns } = attributes3; 9004 const wrapperClasses = clsx_default(`has-$columns}-columns`, { 9005 [`are-vertically-aligned-$verticalAlignment}`]: verticalAlignment 9006 }); 9007 return /* @__PURE__ */ (0, import_jsx_runtime183.jsx)("div", { className: wrapperClasses, children: /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(import_block_editor36.InnerBlocks.Content, {}) }); 9008 } 9009 } 9010 ]; 9011 9012 // packages/block-library/build-module/columns/edit.js 9013 var import_i18n25 = __toESM(require_i18n()); 9014 var import_components17 = __toESM(require_components()); 9015 var import_block_editor37 = __toESM(require_block_editor()); 9016 var import_data17 = __toESM(require_data()); 9017 var import_blocks18 = __toESM(require_blocks()); 9018 9019 // packages/block-library/build-module/columns/utils.js 9020 var toWidthPrecision = (value) => { 9021 const unitlessValue = parseFloat(value); 9022 return Number.isFinite(unitlessValue) ? parseFloat(unitlessValue.toFixed(2)) : void 0; 9023 }; 9024 function getEffectiveColumnWidth(block, totalBlockCount) { 9025 const { width = 100 / totalBlockCount } = block.attributes; 9026 return toWidthPrecision(width); 9027 } 9028 function getTotalColumnsWidth(blocks, totalBlockCount = blocks.length) { 9029 return blocks.reduce( 9030 (sum, block) => sum + getEffectiveColumnWidth(block, totalBlockCount), 9031 0 9032 ); 9033 } 9034 function getColumnWidths(blocks, totalBlockCount = blocks.length) { 9035 return blocks.reduce((accumulator, block) => { 9036 const width = getEffectiveColumnWidth(block, totalBlockCount); 9037 return Object.assign(accumulator, { [block.clientId]: width }); 9038 }, {}); 9039 } 9040 function getRedistributedColumnWidths(blocks, availableWidth, totalBlockCount = blocks.length) { 9041 const totalWidth = getTotalColumnsWidth(blocks, totalBlockCount); 9042 return Object.fromEntries( 9043 Object.entries(getColumnWidths(blocks, totalBlockCount)).map( 9044 ([clientId, width]) => { 9045 const newWidth = availableWidth * width / totalWidth; 9046 return [clientId, toWidthPrecision(newWidth)]; 9047 } 9048 ) 9049 ); 9050 } 9051 function hasExplicitPercentColumnWidths(blocks) { 9052 return blocks.every((block) => { 9053 const blockWidth = block.attributes.width; 9054 return Number.isFinite( 9055 blockWidth?.endsWith?.("%") ? parseFloat(blockWidth) : blockWidth 9056 ); 9057 }); 9058 } 9059 function getMappedColumnWidths(blocks, widths) { 9060 return blocks.map((block) => ({ 9061 ...block, 9062 attributes: { 9063 ...block.attributes, 9064 width: `$widths[block.clientId]}%` 9065 } 9066 })); 9067 } 9068 9069 // packages/block-library/build-module/columns/edit.js 9070 var import_jsx_runtime184 = __toESM(require_jsx_runtime()); 9071 var DEFAULT_BLOCK2 = { 9072 name: "core/column" 9073 }; 9074 function ColumnInspectorControls2({ 9075 clientId, 9076 setAttributes, 9077 isStackedOnMobile 9078 }) { 9079 const { count, canInsertColumnBlock, minCount } = (0, import_data17.useSelect)( 9080 (select9) => { 9081 const { canInsertBlockType, canRemoveBlock, getBlockOrder } = select9(import_block_editor37.store); 9082 const blockOrder = getBlockOrder(clientId); 9083 const preventRemovalBlockIndexes = blockOrder.reduce( 9084 (acc, blockId, index) => { 9085 if (!canRemoveBlock(blockId)) { 9086 acc.push(index); 9087 } 9088 return acc; 9089 }, 9090 [] 9091 ); 9092 return { 9093 count: blockOrder.length, 9094 canInsertColumnBlock: canInsertBlockType( 9095 "core/column", 9096 clientId 9097 ), 9098 minCount: Math.max(...preventRemovalBlockIndexes) + 1 9099 }; 9100 }, 9101 [clientId] 9102 ); 9103 const { getBlocks } = (0, import_data17.useSelect)(import_block_editor37.store); 9104 const { replaceInnerBlocks } = (0, import_data17.useDispatch)(import_block_editor37.store); 9105 function updateColumns(previousColumns, newColumns) { 9106 let innerBlocks = getBlocks(clientId); 9107 const hasExplicitWidths = hasExplicitPercentColumnWidths(innerBlocks); 9108 const isAddingColumn = newColumns > previousColumns; 9109 if (isAddingColumn && hasExplicitWidths) { 9110 const newColumnWidth = toWidthPrecision(100 / newColumns); 9111 const newlyAddedColumns = newColumns - previousColumns; 9112 const widths = getRedistributedColumnWidths( 9113 innerBlocks, 9114 100 - newColumnWidth * newlyAddedColumns 9115 ); 9116 innerBlocks = [ 9117 ...getMappedColumnWidths(innerBlocks, widths), 9118 ...Array.from({ 9119 length: newlyAddedColumns 9120 }).map(() => { 9121 return (0, import_blocks18.createBlock)("core/column", { 9122 width: `$newColumnWidth}%` 9123 }); 9124 }) 9125 ]; 9126 } else if (isAddingColumn) { 9127 innerBlocks = [ 9128 ...innerBlocks, 9129 ...Array.from({ 9130 length: newColumns - previousColumns 9131 }).map(() => { 9132 return (0, import_blocks18.createBlock)("core/column"); 9133 }) 9134 ]; 9135 } else if (newColumns < previousColumns) { 9136 innerBlocks = innerBlocks.slice( 9137 0, 9138 -(previousColumns - newColumns) 9139 ); 9140 if (hasExplicitWidths) { 9141 const widths = getRedistributedColumnWidths(innerBlocks, 100); 9142 innerBlocks = getMappedColumnWidths(innerBlocks, widths); 9143 } 9144 } 9145 replaceInnerBlocks(clientId, innerBlocks); 9146 } 9147 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 9148 return /* @__PURE__ */ (0, import_jsx_runtime184.jsxs)( 9149 import_components17.__experimentalToolsPanel, 9150 { 9151 label: (0, import_i18n25.__)("Settings"), 9152 resetAll: () => { 9153 setAttributes({ 9154 isStackedOnMobile: true 9155 }); 9156 }, 9157 dropdownMenuProps, 9158 children: [ 9159 canInsertColumnBlock && /* @__PURE__ */ (0, import_jsx_runtime184.jsxs)(import_components17.__experimentalVStack, { spacing: 4, style: { gridColumn: "1 / -1" }, children: [ 9160 /* @__PURE__ */ (0, import_jsx_runtime184.jsx)( 9161 import_components17.RangeControl, 9162 { 9163 __next40pxDefaultSize: true, 9164 label: (0, import_i18n25.__)("Columns"), 9165 value: count, 9166 onChange: (value) => updateColumns(count, Math.max(minCount, value)), 9167 min: Math.max(1, minCount), 9168 max: Math.max(6, count) 9169 } 9170 ), 9171 count > 6 && /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(import_components17.Notice, { status: "warning", isDismissible: false, children: (0, import_i18n25.__)( 9172 "This column count exceeds the recommended amount and may cause visual breakage." 9173 ) }) 9174 ] }), 9175 /* @__PURE__ */ (0, import_jsx_runtime184.jsx)( 9176 import_components17.__experimentalToolsPanelItem, 9177 { 9178 label: (0, import_i18n25.__)("Stack on mobile"), 9179 isShownByDefault: true, 9180 hasValue: () => isStackedOnMobile !== true, 9181 onDeselect: () => setAttributes({ 9182 isStackedOnMobile: true 9183 }), 9184 children: /* @__PURE__ */ (0, import_jsx_runtime184.jsx)( 9185 import_components17.ToggleControl, 9186 { 9187 label: (0, import_i18n25.__)("Stack on mobile"), 9188 checked: isStackedOnMobile, 9189 onChange: () => setAttributes({ 9190 isStackedOnMobile: !isStackedOnMobile 9191 }) 9192 } 9193 ) 9194 } 9195 ) 9196 ] 9197 } 9198 ); 9199 } 9200 function ColumnsEditContainer({ attributes: attributes3, setAttributes, clientId }) { 9201 const { isStackedOnMobile, verticalAlignment, templateLock } = attributes3; 9202 const registry = (0, import_data17.useRegistry)(); 9203 const { getBlockOrder } = (0, import_data17.useSelect)(import_block_editor37.store); 9204 const { updateBlockAttributes } = (0, import_data17.useDispatch)(import_block_editor37.store); 9205 const classes = clsx_default({ 9206 [`are-vertically-aligned-$verticalAlignment}`]: verticalAlignment, 9207 [`is-not-stacked-on-mobile`]: !isStackedOnMobile 9208 }); 9209 const blockProps = (0, import_block_editor37.useBlockProps)({ 9210 className: classes 9211 }); 9212 const innerBlocksProps = (0, import_block_editor37.useInnerBlocksProps)(blockProps, { 9213 defaultBlock: DEFAULT_BLOCK2, 9214 directInsert: true, 9215 orientation: "horizontal", 9216 renderAppender: false, 9217 templateLock 9218 }); 9219 function updateAlignment(newVerticalAlignment) { 9220 const innerBlockClientIds = getBlockOrder(clientId); 9221 registry.batch(() => { 9222 setAttributes({ verticalAlignment: newVerticalAlignment }); 9223 updateBlockAttributes(innerBlockClientIds, { 9224 verticalAlignment: newVerticalAlignment 9225 }); 9226 }); 9227 } 9228 return /* @__PURE__ */ (0, import_jsx_runtime184.jsxs)(import_jsx_runtime184.Fragment, { children: [ 9229 /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(import_block_editor37.BlockControls, { children: /* @__PURE__ */ (0, import_jsx_runtime184.jsx)( 9230 import_block_editor37.BlockVerticalAlignmentToolbar, 9231 { 9232 onChange: updateAlignment, 9233 value: verticalAlignment 9234 } 9235 ) }), 9236 /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(import_block_editor37.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime184.jsx)( 9237 ColumnInspectorControls2, 9238 { 9239 clientId, 9240 setAttributes, 9241 isStackedOnMobile 9242 } 9243 ) }), 9244 /* @__PURE__ */ (0, import_jsx_runtime184.jsx)("div", { ...innerBlocksProps }) 9245 ] }); 9246 } 9247 function Placeholder3({ clientId, name: name117, setAttributes }) { 9248 const { blockType, defaultVariation, variations: variations18 } = (0, import_data17.useSelect)( 9249 (select9) => { 9250 const { 9251 getBlockVariations: getBlockVariations3, 9252 getBlockType: getBlockType5, 9253 getDefaultBlockVariation 9254 } = select9(import_blocks18.store); 9255 return { 9256 blockType: getBlockType5(name117), 9257 defaultVariation: getDefaultBlockVariation(name117, "block"), 9258 variations: getBlockVariations3(name117, "block") 9259 }; 9260 }, 9261 [name117] 9262 ); 9263 const { replaceInnerBlocks } = (0, import_data17.useDispatch)(import_block_editor37.store); 9264 const blockProps = (0, import_block_editor37.useBlockProps)(); 9265 return /* @__PURE__ */ (0, import_jsx_runtime184.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime184.jsx)( 9266 import_block_editor37.__experimentalBlockVariationPicker, 9267 { 9268 icon: blockType?.icon?.src, 9269 label: blockType?.title, 9270 variations: variations18, 9271 instructions: (0, import_i18n25.__)("Divide into columns. Select a layout:"), 9272 onSelect: (nextVariation = defaultVariation) => { 9273 if (nextVariation.attributes) { 9274 setAttributes(nextVariation.attributes); 9275 } 9276 if (nextVariation.innerBlocks) { 9277 replaceInnerBlocks( 9278 clientId, 9279 (0, import_blocks18.createBlocksFromInnerBlocksTemplate)( 9280 nextVariation.innerBlocks 9281 ), 9282 true 9283 ); 9284 } 9285 }, 9286 allowSkip: true 9287 } 9288 ) }); 9289 } 9290 var ColumnsEdit = (props) => { 9291 const { clientId } = props; 9292 const hasInnerBlocks = (0, import_data17.useSelect)( 9293 (select9) => select9(import_block_editor37.store).getBlocks(clientId).length > 0, 9294 [clientId] 9295 ); 9296 const Component = hasInnerBlocks ? ColumnsEditContainer : Placeholder3; 9297 return /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(Component, { ...props }); 9298 }; 9299 var edit_default5 = ColumnsEdit; 9300 9301 // packages/block-library/build-module/columns/block.json 9302 var block_default17 = { 9303 $schema: "https://schemas.wp.org/trunk/block.json", 9304 apiVersion: 3, 9305 name: "core/columns", 9306 title: "Columns", 9307 category: "design", 9308 allowedBlocks: ["core/column"], 9309 description: "Display content in multiple columns, with blocks added to each column.", 9310 textdomain: "default", 9311 attributes: { 9312 verticalAlignment: { 9313 type: "string" 9314 }, 9315 isStackedOnMobile: { 9316 type: "boolean", 9317 default: true 9318 }, 9319 templateLock: { 9320 type: ["string", "boolean"], 9321 enum: ["all", "insert", "contentOnly", false] 9322 } 9323 }, 9324 supports: { 9325 anchor: true, 9326 align: ["wide", "full"], 9327 html: false, 9328 color: { 9329 gradients: true, 9330 link: true, 9331 heading: true, 9332 button: true, 9333 __experimentalDefaultControls: { 9334 background: true, 9335 text: true 9336 } 9337 }, 9338 spacing: { 9339 blockGap: { 9340 __experimentalDefault: "2em", 9341 sides: ["horizontal", "vertical"] 9342 }, 9343 margin: ["top", "bottom"], 9344 padding: true, 9345 __experimentalDefaultControls: { 9346 padding: true, 9347 blockGap: true 9348 } 9349 }, 9350 layout: { 9351 allowSwitching: false, 9352 allowInheriting: false, 9353 allowEditing: false, 9354 default: { 9355 type: "flex", 9356 flexWrap: "nowrap" 9357 } 9358 }, 9359 __experimentalBorder: { 9360 color: true, 9361 radius: true, 9362 style: true, 9363 width: true, 9364 __experimentalDefaultControls: { 9365 color: true, 9366 radius: true, 9367 style: true, 9368 width: true 9369 } 9370 }, 9371 typography: { 9372 fontSize: true, 9373 lineHeight: true, 9374 __experimentalFontFamily: true, 9375 __experimentalFontWeight: true, 9376 __experimentalFontStyle: true, 9377 __experimentalTextTransform: true, 9378 __experimentalTextDecoration: true, 9379 __experimentalLetterSpacing: true, 9380 __experimentalDefaultControls: { 9381 fontSize: true 9382 } 9383 }, 9384 interactivity: { 9385 clientNavigation: true 9386 }, 9387 shadow: true 9388 }, 9389 editorStyle: "wp-block-columns-editor", 9390 style: "wp-block-columns" 9391 }; 9392 9393 // packages/block-library/build-module/columns/save.js 9394 var import_block_editor38 = __toESM(require_block_editor()); 9395 var import_jsx_runtime185 = __toESM(require_jsx_runtime()); 9396 function save11({ attributes: attributes3 }) { 9397 const { isStackedOnMobile, verticalAlignment } = attributes3; 9398 const className = clsx_default({ 9399 [`are-vertically-aligned-$verticalAlignment}`]: verticalAlignment, 9400 [`is-not-stacked-on-mobile`]: !isStackedOnMobile 9401 }); 9402 const blockProps = import_block_editor38.useBlockProps.save({ className }); 9403 const innerBlocksProps = import_block_editor38.useInnerBlocksProps.save(blockProps); 9404 return /* @__PURE__ */ (0, import_jsx_runtime185.jsx)("div", { ...innerBlocksProps }); 9405 } 9406 9407 // packages/block-library/build-module/columns/variations.js 9408 var import_components18 = __toESM(require_components()); 9409 var import_i18n26 = __toESM(require_i18n()); 9410 var import_jsx_runtime186 = __toESM(require_jsx_runtime()); 9411 var variations2 = [ 9412 { 9413 name: "one-column-full", 9414 title: (0, import_i18n26.__)("100"), 9415 description: (0, import_i18n26.__)("One column"), 9416 icon: /* @__PURE__ */ (0, import_jsx_runtime186.jsx)( 9417 import_components18.SVG, 9418 { 9419 xmlns: "http://www.w3.org/2000/svg", 9420 width: "48", 9421 height: "48", 9422 viewBox: "0 0 48 48", 9423 children: /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(import_components18.Path, { d: "M0 10a2 2 0 0 1 2-2h44a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Z" }) 9424 } 9425 ), 9426 innerBlocks: [["core/column"]], 9427 scope: ["block"] 9428 }, 9429 { 9430 name: "two-columns-equal", 9431 title: (0, import_i18n26.__)("50 / 50"), 9432 description: (0, import_i18n26.__)("Two columns; equal split"), 9433 icon: /* @__PURE__ */ (0, import_jsx_runtime186.jsx)( 9434 import_components18.SVG, 9435 { 9436 xmlns: "http://www.w3.org/2000/svg", 9437 width: "48", 9438 height: "48", 9439 viewBox: "0 0 48 48", 9440 children: /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(import_components18.Path, { d: "M0 10a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm25 0a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H27a2 2 0 0 1-2-2V10Z" }) 9441 } 9442 ), 9443 isDefault: true, 9444 innerBlocks: [["core/column"], ["core/column"]], 9445 scope: ["block"] 9446 }, 9447 { 9448 name: "two-columns-one-third-two-thirds", 9449 title: (0, import_i18n26.__)("33 / 66"), 9450 description: (0, import_i18n26.__)("Two columns; one-third, two-thirds split"), 9451 icon: /* @__PURE__ */ (0, import_jsx_runtime186.jsx)( 9452 import_components18.SVG, 9453 { 9454 xmlns: "http://www.w3.org/2000/svg", 9455 width: "48", 9456 height: "48", 9457 viewBox: "0 0 48 48", 9458 children: /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(import_components18.Path, { d: "M0 10a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm17 0a2 2 0 0 1 2-2h27a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H19a2 2 0 0 1-2-2V10Z" }) 9459 } 9460 ), 9461 innerBlocks: [ 9462 ["core/column", { width: "33.33%" }], 9463 ["core/column", { width: "66.66%" }] 9464 ], 9465 scope: ["block"] 9466 }, 9467 { 9468 name: "two-columns-two-thirds-one-third", 9469 title: (0, import_i18n26.__)("66 / 33"), 9470 description: (0, import_i18n26.__)("Two columns; two-thirds, one-third split"), 9471 icon: /* @__PURE__ */ (0, import_jsx_runtime186.jsx)( 9472 import_components18.SVG, 9473 { 9474 xmlns: "http://www.w3.org/2000/svg", 9475 width: "48", 9476 height: "48", 9477 viewBox: "0 0 48 48", 9478 children: /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(import_components18.Path, { d: "M0 10a2 2 0 0 1 2-2h27a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm33 0a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H35a2 2 0 0 1-2-2V10Z" }) 9479 } 9480 ), 9481 innerBlocks: [ 9482 ["core/column", { width: "66.66%" }], 9483 ["core/column", { width: "33.33%" }] 9484 ], 9485 scope: ["block"] 9486 }, 9487 { 9488 name: "three-columns-equal", 9489 title: (0, import_i18n26.__)("33 / 33 / 33"), 9490 description: (0, import_i18n26.__)("Three columns; equal split"), 9491 icon: /* @__PURE__ */ (0, import_jsx_runtime186.jsx)( 9492 import_components18.SVG, 9493 { 9494 xmlns: "http://www.w3.org/2000/svg", 9495 width: "48", 9496 height: "48", 9497 viewBox: "0 0 48 48", 9498 children: /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(import_components18.Path, { d: "M0 10a2 2 0 0 1 2-2h10.531c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H2a2 2 0 0 1-2-2V10Zm16.5 0c0-1.105.864-2 1.969-2H29.53c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H18.47c-1.105 0-1.969-.895-1.969-2V10Zm17 0c0-1.105.864-2 1.969-2H46a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H35.469c-1.105 0-1.969-.895-1.969-2V10Z" }) 9499 } 9500 ), 9501 innerBlocks: [ 9502 ["core/column"], 9503 ["core/column"], 9504 ["core/column"] 9505 ], 9506 scope: ["block"] 9507 }, 9508 { 9509 name: "three-columns-wider-center", 9510 title: (0, import_i18n26.__)("25 / 50 / 25"), 9511 description: (0, import_i18n26.__)("Three columns; wide center column"), 9512 icon: /* @__PURE__ */ (0, import_jsx_runtime186.jsx)( 9513 import_components18.SVG, 9514 { 9515 xmlns: "http://www.w3.org/2000/svg", 9516 width: "48", 9517 height: "48", 9518 viewBox: "0 0 48 48", 9519 children: /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(import_components18.Path, { d: "M0 10a2 2 0 0 1 2-2h7.531c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H2a2 2 0 0 1-2-2V10Zm13.5 0c0-1.105.864-2 1.969-2H32.53c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H15.47c-1.105 0-1.969-.895-1.969-2V10Zm23 0c0-1.105.864-2 1.969-2H46a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2h-7.531c-1.105 0-1.969-.895-1.969-2V10Z" }) 9520 } 9521 ), 9522 innerBlocks: [ 9523 ["core/column", { width: "25%" }], 9524 ["core/column", { width: "50%" }], 9525 ["core/column", { width: "25%" }] 9526 ], 9527 scope: ["block"] 9528 } 9529 ]; 9530 var variations_default2 = variations2; 9531 9532 // packages/block-library/build-module/columns/transforms.js 9533 var import_blocks19 = __toESM(require_blocks()); 9534 var MAXIMUM_SELECTED_BLOCKS = 6; 9535 var transforms5 = { 9536 from: [ 9537 { 9538 type: "block", 9539 isMultiBlock: true, 9540 blocks: ["*"], 9541 __experimentalConvert: (blocks) => { 9542 const columnWidth = +(100 / blocks.length).toFixed(2); 9543 const innerBlocksTemplate = blocks.map( 9544 ({ name: name117, attributes: attributes3, innerBlocks }) => [ 9545 "core/column", 9546 { width: `$columnWidth}%` }, 9547 [[name117, { ...attributes3 }, innerBlocks]] 9548 ] 9549 ); 9550 return (0, import_blocks19.createBlock)( 9551 "core/columns", 9552 {}, 9553 (0, import_blocks19.createBlocksFromInnerBlocksTemplate)(innerBlocksTemplate) 9554 ); 9555 }, 9556 isMatch: ({ length: selectedBlocksLength }, blocks) => { 9557 if (blocks.length === 1 && blocks[0].name === "core/columns") { 9558 return false; 9559 } 9560 return selectedBlocksLength && selectedBlocksLength <= MAXIMUM_SELECTED_BLOCKS; 9561 } 9562 }, 9563 { 9564 type: "block", 9565 blocks: ["core/media-text"], 9566 priority: 1, 9567 transform: (attributes3, innerBlocks) => { 9568 const { 9569 align, 9570 backgroundColor, 9571 textColor, 9572 style: style2, 9573 mediaAlt: alt, 9574 mediaId: id, 9575 mediaPosition: mediaPosition2, 9576 mediaSizeSlug: sizeSlug, 9577 mediaType, 9578 mediaUrl: url, 9579 mediaWidth, 9580 verticalAlignment 9581 } = attributes3; 9582 let media; 9583 if (mediaType === "image" || !mediaType) { 9584 const imageAttrs = { id, alt, url, sizeSlug }; 9585 const linkAttrs = { 9586 href: attributes3.href, 9587 linkClass: attributes3.linkClass, 9588 linkDestination: attributes3.linkDestination, 9589 linkTarget: attributes3.linkTarget, 9590 rel: attributes3.rel 9591 }; 9592 media = ["core/image", { ...imageAttrs, ...linkAttrs }]; 9593 } else { 9594 media = ["core/video", { id, src: url }]; 9595 } 9596 const innerBlocksTemplate = [ 9597 ["core/column", { width: `$mediaWidth}%` }, [media]], 9598 [ 9599 "core/column", 9600 { width: `$100 - mediaWidth}%` }, 9601 innerBlocks 9602 ] 9603 ]; 9604 if (mediaPosition2 === "right") { 9605 innerBlocksTemplate.reverse(); 9606 } 9607 return (0, import_blocks19.createBlock)( 9608 "core/columns", 9609 { 9610 align, 9611 backgroundColor, 9612 textColor, 9613 style: style2, 9614 verticalAlignment 9615 }, 9616 (0, import_blocks19.createBlocksFromInnerBlocksTemplate)(innerBlocksTemplate) 9617 ); 9618 } 9619 } 9620 ], 9621 ungroup: (attributes3, innerBlocks) => innerBlocks.flatMap((innerBlock) => innerBlock.innerBlocks) 9622 }; 9623 var transforms_default5 = transforms5; 9624 9625 // packages/block-library/build-module/columns/index.js 9626 var { name: name16 } = block_default17; 9627 var settings16 = { 9628 icon: columns_default, 9629 variations: variations_default2, 9630 example: { 9631 viewportWidth: 782, 9632 // Columns collapse "@media (max-width: 781px)". 9633 innerBlocks: [ 9634 { 9635 name: "core/column", 9636 innerBlocks: [ 9637 { 9638 name: "core/paragraph", 9639 attributes: { 9640 /* translators: example text. */ 9641 content: (0, import_i18n27.__)( 9642 "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et eros eu felis." 9643 ) 9644 } 9645 }, 9646 { 9647 name: "core/image", 9648 attributes: { 9649 url: "https://s.w.org/images/core/5.3/Windbuchencom.jpg" 9650 } 9651 }, 9652 { 9653 name: "core/paragraph", 9654 attributes: { 9655 /* translators: example text. */ 9656 content: (0, import_i18n27.__)( 9657 "Suspendisse commodo neque lacus, a dictum orci interdum et." 9658 ) 9659 } 9660 } 9661 ] 9662 }, 9663 { 9664 name: "core/column", 9665 innerBlocks: [ 9666 { 9667 name: "core/paragraph", 9668 attributes: { 9669 /* translators: example text. */ 9670 content: (0, import_i18n27.__)( 9671 "Etiam et egestas lorem. Vivamus sagittis sit amet dolor quis lobortis. Integer sed fermentum arcu, id vulputate lacus. Etiam fermentum sem eu quam hendrerit." 9672 ) 9673 } 9674 }, 9675 { 9676 name: "core/paragraph", 9677 attributes: { 9678 /* translators: example text. */ 9679 content: (0, import_i18n27.__)( 9680 "Nam risus massa, ullamcorper consectetur eros fermentum, porta aliquet ligula. Sed vel mauris nec enim." 9681 ) 9682 } 9683 } 9684 ] 9685 } 9686 ] 9687 }, 9688 deprecated: deprecated_default6, 9689 edit: edit_default5, 9690 save: save11, 9691 transforms: transforms_default5 9692 }; 9693 var init16 = () => initBlock({ name: name16, metadata: block_default17, settings: settings16 }); 9694 9695 // packages/block-library/build-module/comments/index.js 9696 var comments_exports = {}; 9697 __export(comments_exports, { 9698 init: () => init17, 9699 metadata: () => block_default18, 9700 name: () => name17, 9701 settings: () => settings17 9702 }); 9703 9704 // packages/block-library/build-module/comments/block.json 9705 var block_default18 = { 9706 $schema: "https://schemas.wp.org/trunk/block.json", 9707 apiVersion: 3, 9708 name: "core/comments", 9709 title: "Comments", 9710 category: "theme", 9711 description: "An advanced block that allows displaying post comments using different visual configurations.", 9712 textdomain: "default", 9713 attributes: { 9714 tagName: { 9715 type: "string", 9716 default: "div" 9717 }, 9718 legacy: { 9719 type: "boolean", 9720 default: false 9721 } 9722 }, 9723 supports: { 9724 align: ["wide", "full"], 9725 html: false, 9726 color: { 9727 gradients: true, 9728 heading: true, 9729 link: true, 9730 __experimentalDefaultControls: { 9731 background: true, 9732 text: true, 9733 link: true 9734 } 9735 }, 9736 spacing: { 9737 margin: true, 9738 padding: true 9739 }, 9740 typography: { 9741 fontSize: true, 9742 lineHeight: true, 9743 __experimentalFontFamily: true, 9744 __experimentalFontWeight: true, 9745 __experimentalFontStyle: true, 9746 __experimentalTextTransform: true, 9747 __experimentalTextDecoration: true, 9748 __experimentalLetterSpacing: true, 9749 __experimentalDefaultControls: { 9750 fontSize: true 9751 } 9752 }, 9753 __experimentalBorder: { 9754 radius: true, 9755 color: true, 9756 width: true, 9757 style: true, 9758 __experimentalDefaultControls: { 9759 radius: true, 9760 color: true, 9761 width: true, 9762 style: true 9763 } 9764 } 9765 }, 9766 editorStyle: "wp-block-comments-editor", 9767 usesContext: ["postId", "postType"] 9768 }; 9769 9770 // packages/block-library/build-module/comments/deprecated.js 9771 var import_block_editor39 = __toESM(require_block_editor()); 9772 var import_jsx_runtime187 = __toESM(require_jsx_runtime()); 9773 var v14 = { 9774 attributes: { 9775 tagName: { 9776 type: "string", 9777 default: "div" 9778 } 9779 }, 9780 apiVersion: 3, 9781 supports: { 9782 align: ["wide", "full"], 9783 html: false, 9784 color: { 9785 gradients: true, 9786 link: true, 9787 __experimentalDefaultControls: { 9788 background: true, 9789 text: true, 9790 link: true 9791 } 9792 } 9793 }, 9794 save({ attributes: { tagName: Tag } }) { 9795 const blockProps = import_block_editor39.useBlockProps.save(); 9796 const { className } = blockProps; 9797 const classes = className?.split(" ") || []; 9798 const newClasses = classes?.filter( 9799 (cls) => cls !== "wp-block-comments" 9800 ); 9801 const newBlockProps = { 9802 ...blockProps, 9803 className: newClasses.join(" ") 9804 }; 9805 return /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(Tag, { ...newBlockProps, children: /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(import_block_editor39.InnerBlocks.Content, {}) }); 9806 } 9807 }; 9808 var deprecated_default7 = [v14]; 9809 9810 // packages/block-library/build-module/comments/edit/index.js 9811 var import_block_editor44 = __toESM(require_block_editor()); 9812 9813 // packages/block-library/build-module/comments/edit/comments-inspector-controls.js 9814 var import_i18n28 = __toESM(require_i18n()); 9815 var import_block_editor40 = __toESM(require_block_editor()); 9816 var import_jsx_runtime188 = __toESM(require_jsx_runtime()); 9817 var { HTMLElementControl: HTMLElementControl2 } = unlock(import_block_editor40.privateApis); 9818 function CommentsInspectorControls({ 9819 attributes: { tagName }, 9820 setAttributes 9821 }) { 9822 return /* @__PURE__ */ (0, import_jsx_runtime188.jsx)(import_block_editor40.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime188.jsx)(import_block_editor40.InspectorControls, { group: "advanced", children: /* @__PURE__ */ (0, import_jsx_runtime188.jsx)( 9823 HTMLElementControl2, 9824 { 9825 tagName, 9826 onChange: (value) => setAttributes({ tagName: value }), 9827 options: [ 9828 { label: (0, import_i18n28.__)("Default (<div>)"), value: "div" }, 9829 { label: "<section>", value: "section" }, 9830 { label: "<aside>", value: "aside" } 9831 ] 9832 } 9833 ) }) }); 9834 } 9835 9836 // packages/block-library/build-module/comments/edit/comments-legacy.js 9837 var import_block_editor43 = __toESM(require_block_editor()); 9838 var import_i18n31 = __toESM(require_i18n()); 9839 var import_components20 = __toESM(require_components()); 9840 9841 // packages/block-library/build-module/comments/edit/placeholder.js 9842 var import_block_editor42 = __toESM(require_block_editor()); 9843 var import_i18n30 = __toESM(require_i18n()); 9844 var import_data19 = __toESM(require_data()); 9845 var import_core_data8 = __toESM(require_core_data()); 9846 var import_element15 = __toESM(require_element()); 9847 9848 // packages/block-library/build-module/post-comments-form/form.js 9849 var import_i18n29 = __toESM(require_i18n()); 9850 var import_block_editor41 = __toESM(require_block_editor()); 9851 var import_components19 = __toESM(require_components()); 9852 var import_compose11 = __toESM(require_compose()); 9853 var import_core_data7 = __toESM(require_core_data()); 9854 var import_data18 = __toESM(require_data()); 9855 var import_jsx_runtime189 = __toESM(require_jsx_runtime()); 9856 var CommentsFormPlaceholder = () => { 9857 const instanceId = (0, import_compose11.useInstanceId)(CommentsFormPlaceholder); 9858 return /* @__PURE__ */ (0, import_jsx_runtime189.jsxs)("div", { className: "comment-respond", children: [ 9859 /* @__PURE__ */ (0, import_jsx_runtime189.jsx)("h3", { className: "comment-reply-title", children: (0, import_i18n29.__)("Leave a Reply") }), 9860 /* @__PURE__ */ (0, import_jsx_runtime189.jsxs)( 9861 "form", 9862 { 9863 noValidate: true, 9864 className: "comment-form", 9865 onSubmit: (event) => event.preventDefault(), 9866 children: [ 9867 /* @__PURE__ */ (0, import_jsx_runtime189.jsxs)("p", { children: [ 9868 /* @__PURE__ */ (0, import_jsx_runtime189.jsx)("label", { htmlFor: `comment-$instanceId}`, children: (0, import_i18n29.__)("Comment") }), 9869 /* @__PURE__ */ (0, import_jsx_runtime189.jsx)( 9870 "textarea", 9871 { 9872 id: `comment-$instanceId}`, 9873 name: "comment", 9874 cols: "45", 9875 rows: "8", 9876 readOnly: true 9877 } 9878 ) 9879 ] }), 9880 /* @__PURE__ */ (0, import_jsx_runtime189.jsx)("p", { className: "form-submit wp-block-button", children: /* @__PURE__ */ (0, import_jsx_runtime189.jsx)( 9881 "input", 9882 { 9883 name: "submit", 9884 type: "submit", 9885 className: clsx_default( 9886 "wp-block-button__link", 9887 (0, import_block_editor41.__experimentalGetElementClassName)("button") 9888 ), 9889 label: (0, import_i18n29.__)("Post Comment"), 9890 value: (0, import_i18n29.__)("Post Comment"), 9891 "aria-disabled": "true" 9892 } 9893 ) }) 9894 ] 9895 } 9896 ) 9897 ] }); 9898 }; 9899 var CommentsForm = ({ postId, postType }) => { 9900 const [commentStatus, setCommentStatus] = (0, import_core_data7.useEntityProp)( 9901 "postType", 9902 postType, 9903 "comment_status", 9904 postId 9905 ); 9906 const isSiteEditor = postType === void 0 || postId === void 0; 9907 const defaultCommentStatus = (0, import_data18.useSelect)( 9908 (select9) => select9(import_block_editor41.store).getSettings().__experimentalDiscussionSettings?.defaultCommentStatus, 9909 [] 9910 ); 9911 const postTypeSupportsComments = (0, import_data18.useSelect)( 9912 (select9) => postType ? !!select9(import_core_data7.store).getPostType(postType)?.supports.comments : false 9913 ); 9914 if (!isSiteEditor && "open" !== commentStatus) { 9915 if ("closed" === commentStatus) { 9916 const actions = [ 9917 /* @__PURE__ */ (0, import_jsx_runtime189.jsx)( 9918 import_components19.Button, 9919 { 9920 __next40pxDefaultSize: true, 9921 onClick: () => setCommentStatus("open"), 9922 variant: "primary", 9923 children: (0, import_i18n29._x)( 9924 "Enable comments", 9925 "action that affects the current post" 9926 ) 9927 }, 9928 "enableComments" 9929 ) 9930 ]; 9931 return /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(import_block_editor41.Warning, { actions, children: (0, import_i18n29.__)( 9932 "Post Comments Form block: Comments are not enabled for this item." 9933 ) }); 9934 } else if (!postTypeSupportsComments) { 9935 return /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(import_block_editor41.Warning, { children: (0, import_i18n29.sprintf)( 9936 /* translators: %s: Post type (i.e. "post", "page") */ 9937 (0, import_i18n29.__)( 9938 "Post Comments Form block: Comments are not enabled for this post type (%s)." 9939 ), 9940 postType 9941 ) }); 9942 } else if ("open" !== defaultCommentStatus) { 9943 return /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(import_block_editor41.Warning, { children: (0, import_i18n29.__)( 9944 "Post Comments Form block: Comments are not enabled." 9945 ) }); 9946 } 9947 } 9948 return /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(CommentsFormPlaceholder, {}); 9949 }; 9950 var form_default = CommentsForm; 9951 9952 // packages/block-library/build-module/comments/edit/placeholder.js 9953 var import_jsx_runtime190 = __toESM(require_jsx_runtime()); 9954 function PostCommentsPlaceholder({ postType, postId }) { 9955 let [postTitle] = (0, import_core_data8.useEntityProp)("postType", postType, "title", postId); 9956 postTitle = postTitle || (0, import_i18n30.__)("Post Title"); 9957 const avatarURL = (0, import_data19.useSelect)( 9958 (select9) => select9(import_block_editor42.store).getSettings().__experimentalDiscussionSettings?.avatarURL, 9959 [] 9960 ); 9961 return /* @__PURE__ */ (0, import_jsx_runtime190.jsxs)("div", { className: "wp-block-comments__legacy-placeholder", inert: "true", children: [ 9962 /* @__PURE__ */ (0, import_jsx_runtime190.jsx)("h3", { 9963 /* translators: %s: Post title. */ 9964 children: (0, import_i18n30.sprintf)((0, import_i18n30.__)("One response to %s"), postTitle) 9965 }), 9966 /* @__PURE__ */ (0, import_jsx_runtime190.jsxs)("div", { className: "navigation", children: [ 9967 /* @__PURE__ */ (0, import_jsx_runtime190.jsx)("div", { className: "alignleft", children: /* @__PURE__ */ (0, import_jsx_runtime190.jsxs)("a", { href: "#top", children: [ 9968 "\xAB ", 9969 (0, import_i18n30.__)("Older Comments") 9970 ] }) }), 9971 /* @__PURE__ */ (0, import_jsx_runtime190.jsx)("div", { className: "alignright", children: /* @__PURE__ */ (0, import_jsx_runtime190.jsxs)("a", { href: "#top", children: [ 9972 (0, import_i18n30.__)("Newer Comments"), 9973 " \xBB" 9974 ] }) }) 9975 ] }), 9976 /* @__PURE__ */ (0, import_jsx_runtime190.jsx)("ol", { className: "commentlist", children: /* @__PURE__ */ (0, import_jsx_runtime190.jsx)("li", { className: "comment even thread-even depth-1", children: /* @__PURE__ */ (0, import_jsx_runtime190.jsxs)("article", { className: "comment-body", children: [ 9977 /* @__PURE__ */ (0, import_jsx_runtime190.jsxs)("footer", { className: "comment-meta", children: [ 9978 /* @__PURE__ */ (0, import_jsx_runtime190.jsxs)("div", { className: "comment-author vcard", children: [ 9979 /* @__PURE__ */ (0, import_jsx_runtime190.jsx)( 9980 "img", 9981 { 9982 alt: (0, import_i18n30.__)("Commenter Avatar"), 9983 src: avatarURL, 9984 className: "avatar avatar-32 photo", 9985 height: "32", 9986 width: "32", 9987 loading: "lazy" 9988 } 9989 ), 9990 /* @__PURE__ */ (0, import_jsx_runtime190.jsx)("b", { className: "fn", children: /* @__PURE__ */ (0, import_jsx_runtime190.jsx)("a", { href: "#top", className: "url", children: (0, import_i18n30.__)("A WordPress Commenter") }) }), 9991 " ", 9992 /* @__PURE__ */ (0, import_jsx_runtime190.jsxs)("span", { className: "says", children: [ 9993 (0, import_i18n30.__)("says"), 9994 ":" 9995 ] }) 9996 ] }), 9997 /* @__PURE__ */ (0, import_jsx_runtime190.jsxs)("div", { className: "comment-metadata", children: [ 9998 /* @__PURE__ */ (0, import_jsx_runtime190.jsx)("a", { href: "#top", children: /* @__PURE__ */ (0, import_jsx_runtime190.jsx)("time", { dateTime: "2000-01-01T00:00:00+00:00", children: (0, import_i18n30.__)("January 1, 2000 at 00:00 am") }) }), 9999 " ", 10000 /* @__PURE__ */ (0, import_jsx_runtime190.jsx)("span", { className: "edit-link", children: /* @__PURE__ */ (0, import_jsx_runtime190.jsx)( 10001 "a", 10002 { 10003 className: "comment-edit-link", 10004 href: "#top", 10005 children: (0, import_i18n30.__)("Edit") 10006 } 10007 ) }) 10008 ] }) 10009 ] }), 10010 /* @__PURE__ */ (0, import_jsx_runtime190.jsx)("div", { className: "comment-content", children: /* @__PURE__ */ (0, import_jsx_runtime190.jsxs)("p", { children: [ 10011 (0, import_i18n30.__)("Hi, this is a comment."), 10012 /* @__PURE__ */ (0, import_jsx_runtime190.jsx)("br", {}), 10013 (0, import_i18n30.__)( 10014 "To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard." 10015 ), 10016 /* @__PURE__ */ (0, import_jsx_runtime190.jsx)("br", {}), 10017 (0, import_element15.createInterpolateElement)( 10018 (0, import_i18n30.__)( 10019 "Commenter avatars come from <a>Gravatar</a>." 10020 ), 10021 { 10022 a: ( 10023 // eslint-disable-next-line jsx-a11y/anchor-has-content 10024 /* @__PURE__ */ (0, import_jsx_runtime190.jsx)("a", { href: "https://gravatar.com/" }) 10025 ) 10026 } 10027 ) 10028 ] }) }), 10029 /* @__PURE__ */ (0, import_jsx_runtime190.jsx)("div", { className: "reply", children: /* @__PURE__ */ (0, import_jsx_runtime190.jsx)( 10030 "a", 10031 { 10032 className: "comment-reply-link", 10033 href: "#top", 10034 "aria-label": (0, import_i18n30.__)( 10035 "Reply to A WordPress Commenter" 10036 ), 10037 children: (0, import_i18n30.__)("Reply") 10038 } 10039 ) }) 10040 ] }) }) }), 10041 /* @__PURE__ */ (0, import_jsx_runtime190.jsxs)("div", { className: "navigation", children: [ 10042 /* @__PURE__ */ (0, import_jsx_runtime190.jsx)("div", { className: "alignleft", children: /* @__PURE__ */ (0, import_jsx_runtime190.jsxs)("a", { href: "#top", children: [ 10043 "\xAB ", 10044 (0, import_i18n30.__)("Older Comments") 10045 ] }) }), 10046 /* @__PURE__ */ (0, import_jsx_runtime190.jsx)("div", { className: "alignright", children: /* @__PURE__ */ (0, import_jsx_runtime190.jsxs)("a", { href: "#top", children: [ 10047 (0, import_i18n30.__)("Newer Comments"), 10048 " \xBB" 10049 ] }) }) 10050 ] }), 10051 /* @__PURE__ */ (0, import_jsx_runtime190.jsx)(form_default, { postId, postType }) 10052 ] }); 10053 } 10054 10055 // packages/block-library/build-module/comments/edit/comments-legacy.js 10056 var import_jsx_runtime191 = __toESM(require_jsx_runtime()); 10057 function CommentsLegacy({ 10058 attributes: attributes3, 10059 setAttributes, 10060 context: { postType, postId } 10061 }) { 10062 const { textAlign } = attributes3; 10063 const actions = [ 10064 /* @__PURE__ */ (0, import_jsx_runtime191.jsx)( 10065 import_components20.Button, 10066 { 10067 __next40pxDefaultSize: true, 10068 onClick: () => void setAttributes({ legacy: false }), 10069 variant: "primary", 10070 children: (0, import_i18n31.__)("Switch to editable mode") 10071 }, 10072 "convert" 10073 ) 10074 ]; 10075 const blockProps = (0, import_block_editor43.useBlockProps)({ 10076 className: clsx_default({ 10077 [`has-text-align-$textAlign}`]: textAlign 10078 }) 10079 }); 10080 return /* @__PURE__ */ (0, import_jsx_runtime191.jsxs)(import_jsx_runtime191.Fragment, { children: [ 10081 /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(import_block_editor43.BlockControls, { group: "block", children: /* @__PURE__ */ (0, import_jsx_runtime191.jsx)( 10082 import_block_editor43.AlignmentControl, 10083 { 10084 value: textAlign, 10085 onChange: (nextAlign) => { 10086 setAttributes({ textAlign: nextAlign }); 10087 } 10088 } 10089 ) }), 10090 /* @__PURE__ */ (0, import_jsx_runtime191.jsxs)("div", { ...blockProps, children: [ 10091 /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(import_block_editor43.Warning, { actions, children: (0, import_i18n31.__)( 10092 "Comments block: You\u2019re 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." 10093 ) }), 10094 /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(PostCommentsPlaceholder, { postId, postType }) 10095 ] }) 10096 ] }); 10097 } 10098 10099 // packages/block-library/build-module/comments/edit/template.js 10100 var TEMPLATE = [ 10101 ["core/comments-title"], 10102 [ 10103 "core/comment-template", 10104 {}, 10105 [ 10106 [ 10107 "core/columns", 10108 {}, 10109 [ 10110 [ 10111 "core/column", 10112 { width: "40px" }, 10113 [ 10114 [ 10115 "core/avatar", 10116 { 10117 size: 40, 10118 style: { 10119 border: { radius: "20px" } 10120 } 10121 } 10122 ] 10123 ] 10124 ], 10125 [ 10126 "core/column", 10127 {}, 10128 [ 10129 [ 10130 "core/comment-author-name", 10131 { 10132 fontSize: "small" 10133 } 10134 ], 10135 [ 10136 "core/group", 10137 { 10138 layout: { type: "flex" }, 10139 style: { 10140 spacing: { 10141 margin: { 10142 top: "0px", 10143 bottom: "0px" 10144 } 10145 } 10146 } 10147 }, 10148 [ 10149 [ 10150 "core/comment-date", 10151 { 10152 fontSize: "small" 10153 } 10154 ], 10155 [ 10156 "core/comment-edit-link", 10157 { 10158 fontSize: "small" 10159 } 10160 ] 10161 ] 10162 ], 10163 ["core/comment-content"], 10164 [ 10165 "core/comment-reply-link", 10166 { 10167 fontSize: "small" 10168 } 10169 ] 10170 ] 10171 ] 10172 ] 10173 ] 10174 ] 10175 ], 10176 ["core/comments-pagination"], 10177 ["core/post-comments-form"] 10178 ]; 10179 var template_default = TEMPLATE; 10180 10181 // packages/block-library/build-module/comments/edit/index.js 10182 var import_jsx_runtime192 = __toESM(require_jsx_runtime()); 10183 function CommentsEdit(props) { 10184 const { attributes: attributes3, setAttributes, clientId } = props; 10185 const { tagName: TagName2, legacy } = attributes3; 10186 const blockProps = (0, import_block_editor44.useBlockProps)(); 10187 const innerBlocksProps = (0, import_block_editor44.useInnerBlocksProps)(blockProps, { 10188 template: template_default 10189 }); 10190 if (legacy) { 10191 return /* @__PURE__ */ (0, import_jsx_runtime192.jsx)(CommentsLegacy, { ...props }); 10192 } 10193 return /* @__PURE__ */ (0, import_jsx_runtime192.jsxs)(import_jsx_runtime192.Fragment, { children: [ 10194 /* @__PURE__ */ (0, import_jsx_runtime192.jsx)( 10195 CommentsInspectorControls, 10196 { 10197 attributes: attributes3, 10198 setAttributes, 10199 clientId 10200 } 10201 ), 10202 /* @__PURE__ */ (0, import_jsx_runtime192.jsx)(TagName2, { ...innerBlocksProps }) 10203 ] }); 10204 } 10205 10206 // packages/block-library/build-module/comments/save.js 10207 var import_block_editor45 = __toESM(require_block_editor()); 10208 var import_jsx_runtime193 = __toESM(require_jsx_runtime()); 10209 function save12({ attributes: { tagName: Tag, legacy } }) { 10210 const blockProps = import_block_editor45.useBlockProps.save(); 10211 const innerBlocksProps = import_block_editor45.useInnerBlocksProps.save(blockProps); 10212 return legacy ? null : /* @__PURE__ */ (0, import_jsx_runtime193.jsx)(Tag, { ...innerBlocksProps }); 10213 } 10214 10215 // packages/block-library/build-module/comments/index.js 10216 var { name: name17 } = block_default18; 10217 var settings17 = { 10218 icon: post_comments_default, 10219 example: {}, 10220 edit: CommentsEdit, 10221 save: save12, 10222 deprecated: deprecated_default7 10223 }; 10224 var init17 = () => initBlock({ name: name17, metadata: block_default18, settings: settings17 }); 10225 10226 // packages/block-library/build-module/comment-author-avatar/index.js 10227 var comment_author_avatar_exports = {}; 10228 __export(comment_author_avatar_exports, { 10229 init: () => init18, 10230 metadata: () => block_default19, 10231 name: () => name18, 10232 settings: () => settings18 10233 }); 10234 10235 // packages/block-library/build-module/comment-author-avatar/block.json 10236 var block_default19 = { 10237 $schema: "https://schemas.wp.org/trunk/block.json", 10238 apiVersion: 3, 10239 __experimental: "fse", 10240 name: "core/comment-author-avatar", 10241 title: "Comment Author Avatar (deprecated)", 10242 category: "theme", 10243 ancestor: ["core/comment-template"], 10244 description: "This block is deprecated. Please use the Avatar block instead.", 10245 textdomain: "default", 10246 attributes: { 10247 width: { 10248 type: "number", 10249 default: 96 10250 }, 10251 height: { 10252 type: "number", 10253 default: 96 10254 } 10255 }, 10256 usesContext: ["commentId"], 10257 supports: { 10258 html: false, 10259 inserter: false, 10260 __experimentalBorder: { 10261 radius: true, 10262 width: true, 10263 color: true, 10264 style: true 10265 }, 10266 color: { 10267 background: true, 10268 text: false, 10269 __experimentalDefaultControls: { 10270 background: true 10271 } 10272 }, 10273 spacing: { 10274 __experimentalSkipSerialization: true, 10275 margin: true, 10276 padding: true 10277 }, 10278 interactivity: { 10279 clientNavigation: true 10280 } 10281 } 10282 }; 10283 10284 // packages/block-library/build-module/comment-author-avatar/edit.js 10285 var import_block_editor46 = __toESM(require_block_editor()); 10286 var import_components21 = __toESM(require_components()); 10287 var import_core_data9 = __toESM(require_core_data()); 10288 var import_data20 = __toESM(require_data()); 10289 var import_i18n32 = __toESM(require_i18n()); 10290 var import_jsx_runtime194 = __toESM(require_jsx_runtime()); 10291 function Edit6({ 10292 attributes: attributes3, 10293 context: { commentId }, 10294 setAttributes, 10295 isSelected 10296 }) { 10297 const { height, width } = attributes3; 10298 const [avatars] = (0, import_core_data9.useEntityProp)( 10299 "root", 10300 "comment", 10301 "author_avatar_urls", 10302 commentId 10303 ); 10304 const [authorName] = (0, import_core_data9.useEntityProp)( 10305 "root", 10306 "comment", 10307 "author_name", 10308 commentId 10309 ); 10310 const avatarUrls = avatars ? Object.values(avatars) : null; 10311 const sizes = avatars ? Object.keys(avatars) : null; 10312 const minSize = sizes ? sizes[0] : 24; 10313 const maxSize = sizes ? sizes[sizes.length - 1] : 96; 10314 const blockProps = (0, import_block_editor46.useBlockProps)(); 10315 const spacingProps = (0, import_block_editor46.__experimentalGetSpacingClassesAndStyles)(attributes3); 10316 const maxSizeBuffer = Math.floor(maxSize * 2.5); 10317 const avatarURL = (0, import_data20.useSelect)((select9) => { 10318 const { __experimentalDiscussionSettings } = select9(import_block_editor46.store).getSettings(); 10319 return __experimentalDiscussionSettings?.avatarURL; 10320 }, []); 10321 const inspectorControls = /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(import_block_editor46.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(import_components21.PanelBody, { title: (0, import_i18n32.__)("Settings"), children: /* @__PURE__ */ (0, import_jsx_runtime194.jsx)( 10322 import_components21.RangeControl, 10323 { 10324 __next40pxDefaultSize: true, 10325 label: (0, import_i18n32.__)("Image size"), 10326 onChange: (newWidth) => setAttributes({ 10327 width: newWidth, 10328 height: newWidth 10329 }), 10330 min: minSize, 10331 max: maxSizeBuffer, 10332 initialPosition: width, 10333 value: width 10334 } 10335 ) }) }); 10336 const resizableAvatar = /* @__PURE__ */ (0, import_jsx_runtime194.jsx)( 10337 import_components21.ResizableBox, 10338 { 10339 size: { 10340 width, 10341 height 10342 }, 10343 showHandle: isSelected, 10344 onResizeStop: (event, direction, elt, delta) => { 10345 setAttributes({ 10346 height: parseInt(height + delta.height, 10), 10347 width: parseInt(width + delta.width, 10) 10348 }); 10349 }, 10350 lockAspectRatio: true, 10351 enable: { 10352 top: false, 10353 right: !(0, import_i18n32.isRTL)(), 10354 bottom: true, 10355 left: (0, import_i18n32.isRTL)() 10356 }, 10357 minWidth: minSize, 10358 maxWidth: maxSizeBuffer, 10359 children: /* @__PURE__ */ (0, import_jsx_runtime194.jsx)( 10360 "img", 10361 { 10362 src: avatarUrls ? avatarUrls[avatarUrls.length - 1] : avatarURL, 10363 alt: `$authorName} ${(0, import_i18n32.__)("Avatar")}`, 10364 ...blockProps 10365 } 10366 ) 10367 } 10368 ); 10369 return /* @__PURE__ */ (0, import_jsx_runtime194.jsxs)(import_jsx_runtime194.Fragment, { children: [ 10370 inspectorControls, 10371 /* @__PURE__ */ (0, import_jsx_runtime194.jsx)("div", { ...spacingProps, children: resizableAvatar }) 10372 ] }); 10373 } 10374 10375 // packages/block-library/build-module/comment-author-avatar/index.js 10376 var { name: name18 } = block_default19; 10377 var settings18 = { 10378 icon: comment_author_avatar_default, 10379 edit: Edit6 10380 }; 10381 var init18 = () => initBlock({ name: name18, metadata: block_default19, settings: settings18 }); 10382 10383 // packages/block-library/build-module/comment-author-name/index.js 10384 var comment_author_name_exports = {}; 10385 __export(comment_author_name_exports, { 10386 init: () => init19, 10387 metadata: () => block_default20, 10388 name: () => name19, 10389 settings: () => settings19 10390 }); 10391 10392 // packages/block-library/build-module/comment-author-name/block.json 10393 var block_default20 = { 10394 $schema: "https://schemas.wp.org/trunk/block.json", 10395 apiVersion: 3, 10396 name: "core/comment-author-name", 10397 title: "Comment Author Name", 10398 category: "theme", 10399 ancestor: ["core/comment-template"], 10400 description: "Displays the name of the author of the comment.", 10401 textdomain: "default", 10402 attributes: { 10403 isLink: { 10404 type: "boolean", 10405 default: true 10406 }, 10407 linkTarget: { 10408 type: "string", 10409 default: "_self" 10410 }, 10411 textAlign: { 10412 type: "string" 10413 } 10414 }, 10415 usesContext: ["commentId"], 10416 supports: { 10417 html: false, 10418 spacing: { 10419 margin: true, 10420 padding: true 10421 }, 10422 color: { 10423 gradients: true, 10424 link: true, 10425 __experimentalDefaultControls: { 10426 background: true, 10427 text: true, 10428 link: true 10429 } 10430 }, 10431 typography: { 10432 fontSize: true, 10433 lineHeight: true, 10434 __experimentalFontFamily: true, 10435 __experimentalFontWeight: true, 10436 __experimentalFontStyle: true, 10437 __experimentalTextTransform: true, 10438 __experimentalTextDecoration: true, 10439 __experimentalLetterSpacing: true, 10440 __experimentalDefaultControls: { 10441 fontSize: true 10442 } 10443 }, 10444 interactivity: { 10445 clientNavigation: true 10446 }, 10447 __experimentalBorder: { 10448 radius: true, 10449 color: true, 10450 width: true, 10451 style: true, 10452 __experimentalDefaultControls: { 10453 radius: true, 10454 color: true, 10455 width: true, 10456 style: true 10457 } 10458 } 10459 }, 10460 style: "wp-block-comment-author-name" 10461 }; 10462 10463 // packages/block-library/build-module/comment-author-name/edit.js 10464 var import_i18n33 = __toESM(require_i18n()); 10465 var import_data21 = __toESM(require_data()); 10466 var import_block_editor47 = __toESM(require_block_editor()); 10467 var import_core_data10 = __toESM(require_core_data()); 10468 var import_components22 = __toESM(require_components()); 10469 var import_jsx_runtime195 = __toESM(require_jsx_runtime()); 10470 function Edit7({ 10471 attributes: { isLink, linkTarget, textAlign }, 10472 context: { commentId }, 10473 setAttributes 10474 }) { 10475 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 10476 const blockProps = (0, import_block_editor47.useBlockProps)({ 10477 className: clsx_default({ 10478 [`has-text-align-$textAlign}`]: textAlign 10479 }) 10480 }); 10481 let displayName = (0, import_data21.useSelect)( 10482 (select9) => { 10483 const { getEntityRecord } = select9(import_core_data10.store); 10484 const comment = getEntityRecord("root", "comment", commentId); 10485 const authorName = comment?.author_name; 10486 if (comment && !authorName) { 10487 const user = getEntityRecord("root", "user", comment.author); 10488 return user?.name ?? (0, import_i18n33.__)("Anonymous"); 10489 } 10490 return authorName ?? ""; 10491 }, 10492 [commentId] 10493 ); 10494 const blockControls = /* @__PURE__ */ (0, import_jsx_runtime195.jsx)(import_block_editor47.BlockControls, { group: "block", children: /* @__PURE__ */ (0, import_jsx_runtime195.jsx)( 10495 import_block_editor47.AlignmentControl, 10496 { 10497 value: textAlign, 10498 onChange: (newAlign) => setAttributes({ textAlign: newAlign }) 10499 } 10500 ) }); 10501 const inspectorControls = /* @__PURE__ */ (0, import_jsx_runtime195.jsx)(import_block_editor47.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime195.jsxs)( 10502 import_components22.__experimentalToolsPanel, 10503 { 10504 label: (0, import_i18n33.__)("Settings"), 10505 resetAll: () => { 10506 setAttributes({ 10507 isLink: true, 10508 linkTarget: "_self" 10509 }); 10510 }, 10511 dropdownMenuProps, 10512 children: [ 10513 /* @__PURE__ */ (0, import_jsx_runtime195.jsx)( 10514 import_components22.__experimentalToolsPanelItem, 10515 { 10516 label: (0, import_i18n33.__)("Link to authors URL"), 10517 isShownByDefault: true, 10518 hasValue: () => !isLink, 10519 onDeselect: () => setAttributes({ 10520 isLink: true 10521 }), 10522 children: /* @__PURE__ */ (0, import_jsx_runtime195.jsx)( 10523 import_components22.ToggleControl, 10524 { 10525 label: (0, import_i18n33.__)("Link to authors URL"), 10526 onChange: () => setAttributes({ isLink: !isLink }), 10527 checked: isLink 10528 } 10529 ) 10530 } 10531 ), 10532 isLink && /* @__PURE__ */ (0, import_jsx_runtime195.jsx)( 10533 import_components22.__experimentalToolsPanelItem, 10534 { 10535 label: (0, import_i18n33.__)("Open in new tab"), 10536 isShownByDefault: true, 10537 hasValue: () => linkTarget !== "_self", 10538 onDeselect: () => setAttributes({ 10539 linkTarget: "_self" 10540 }), 10541 children: /* @__PURE__ */ (0, import_jsx_runtime195.jsx)( 10542 import_components22.ToggleControl, 10543 { 10544 label: (0, import_i18n33.__)("Open in new tab"), 10545 onChange: (value) => setAttributes({ 10546 linkTarget: value ? "_blank" : "_self" 10547 }), 10548 checked: linkTarget === "_blank" 10549 } 10550 ) 10551 } 10552 ) 10553 ] 10554 } 10555 ) }); 10556 if (!commentId || !displayName) { 10557 displayName = (0, import_i18n33._x)("Comment Author", "block title"); 10558 } 10559 const displayAuthor = isLink ? /* @__PURE__ */ (0, import_jsx_runtime195.jsx)( 10560 "a", 10561 { 10562 href: "#comment-author-pseudo-link", 10563 onClick: (event) => event.preventDefault(), 10564 children: displayName 10565 } 10566 ) : displayName; 10567 return /* @__PURE__ */ (0, import_jsx_runtime195.jsxs)(import_jsx_runtime195.Fragment, { children: [ 10568 inspectorControls, 10569 blockControls, 10570 /* @__PURE__ */ (0, import_jsx_runtime195.jsx)("div", { ...blockProps, children: displayAuthor }) 10571 ] }); 10572 } 10573 10574 // packages/block-library/build-module/comment-author-name/deprecated.js 10575 var v15 = { 10576 attributes: { 10577 isLink: { 10578 type: "boolean", 10579 default: false 10580 }, 10581 linkTarget: { 10582 type: "string", 10583 default: "_self" 10584 } 10585 }, 10586 supports: { 10587 html: false, 10588 color: { 10589 gradients: true, 10590 link: true 10591 }, 10592 typography: { 10593 fontSize: true, 10594 lineHeight: true, 10595 __experimentalFontFamily: true, 10596 __experimentalFontWeight: true, 10597 __experimentalFontStyle: true, 10598 __experimentalTextTransform: true, 10599 __experimentalLetterSpacing: true 10600 } 10601 }, 10602 save() { 10603 return null; 10604 }, 10605 migrate: migrate_font_family_default, 10606 isEligible({ style: style2 }) { 10607 return style2?.typography?.fontFamily; 10608 } 10609 }; 10610 var deprecated_default8 = [v15]; 10611 10612 // packages/block-library/build-module/comment-author-name/index.js 10613 var { name: name19 } = block_default20; 10614 var settings19 = { 10615 icon: comment_author_name_default, 10616 edit: Edit7, 10617 deprecated: deprecated_default8, 10618 example: {} 10619 }; 10620 var init19 = () => initBlock({ name: name19, metadata: block_default20, settings: settings19 }); 10621 10622 // packages/block-library/build-module/comment-content/index.js 10623 var comment_content_exports = {}; 10624 __export(comment_content_exports, { 10625 init: () => init20, 10626 metadata: () => block_default21, 10627 name: () => name20, 10628 settings: () => settings20 10629 }); 10630 10631 // packages/block-library/build-module/comment-content/block.json 10632 var block_default21 = { 10633 $schema: "https://schemas.wp.org/trunk/block.json", 10634 apiVersion: 3, 10635 name: "core/comment-content", 10636 title: "Comment Content", 10637 category: "theme", 10638 ancestor: ["core/comment-template"], 10639 description: "Displays the contents of a comment.", 10640 textdomain: "default", 10641 usesContext: ["commentId"], 10642 attributes: { 10643 textAlign: { 10644 type: "string" 10645 } 10646 }, 10647 supports: { 10648 color: { 10649 gradients: true, 10650 link: true, 10651 __experimentalDefaultControls: { 10652 background: true, 10653 text: true 10654 } 10655 }, 10656 typography: { 10657 fontSize: true, 10658 lineHeight: true, 10659 __experimentalFontFamily: true, 10660 __experimentalFontWeight: true, 10661 __experimentalFontStyle: true, 10662 __experimentalTextTransform: true, 10663 __experimentalTextDecoration: true, 10664 __experimentalLetterSpacing: true, 10665 __experimentalDefaultControls: { 10666 fontSize: true 10667 } 10668 }, 10669 __experimentalBorder: { 10670 radius: true, 10671 color: true, 10672 width: true, 10673 style: true, 10674 __experimentalDefaultControls: { 10675 radius: true, 10676 color: true, 10677 width: true, 10678 style: true 10679 } 10680 }, 10681 spacing: { 10682 padding: ["horizontal", "vertical"], 10683 __experimentalDefaultControls: { 10684 padding: true 10685 } 10686 }, 10687 html: false 10688 }, 10689 style: "wp-block-comment-content" 10690 }; 10691 10692 // packages/block-library/build-module/comment-content/edit.js 10693 var import_i18n34 = __toESM(require_i18n()); 10694 var import_element16 = __toESM(require_element()); 10695 var import_components23 = __toESM(require_components()); 10696 var import_core_data11 = __toESM(require_core_data()); 10697 var import_block_editor48 = __toESM(require_block_editor()); 10698 var import_jsx_runtime196 = __toESM(require_jsx_runtime()); 10699 function Edit8({ 10700 setAttributes, 10701 attributes: { textAlign }, 10702 context: { commentId } 10703 }) { 10704 const blockProps = (0, import_block_editor48.useBlockProps)({ 10705 className: clsx_default({ 10706 [`has-text-align-$textAlign}`]: textAlign 10707 }) 10708 }); 10709 const [content] = (0, import_core_data11.useEntityProp)( 10710 "root", 10711 "comment", 10712 "content", 10713 commentId 10714 ); 10715 const blockControls = /* @__PURE__ */ (0, import_jsx_runtime196.jsx)(import_block_editor48.BlockControls, { group: "block", children: /* @__PURE__ */ (0, import_jsx_runtime196.jsx)( 10716 import_block_editor48.AlignmentControl, 10717 { 10718 value: textAlign, 10719 onChange: (newAlign) => setAttributes({ textAlign: newAlign }) 10720 } 10721 ) }); 10722 if (!commentId || !content) { 10723 return /* @__PURE__ */ (0, import_jsx_runtime196.jsxs)(import_jsx_runtime196.Fragment, { children: [ 10724 blockControls, 10725 /* @__PURE__ */ (0, import_jsx_runtime196.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime196.jsx)("p", { children: (0, import_i18n34._x)("Comment Content", "block title") }) }) 10726 ] }); 10727 } 10728 return /* @__PURE__ */ (0, import_jsx_runtime196.jsxs)(import_jsx_runtime196.Fragment, { children: [ 10729 blockControls, 10730 /* @__PURE__ */ (0, import_jsx_runtime196.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime196.jsx)(import_components23.Disabled, { children: /* @__PURE__ */ (0, import_jsx_runtime196.jsx)(import_element16.RawHTML, { children: content.rendered }, "html") }) }) 10731 ] }); 10732 } 10733 10734 // packages/block-library/build-module/comment-content/index.js 10735 var { name: name20 } = block_default21; 10736 var settings20 = { 10737 icon: comment_content_default, 10738 edit: Edit8, 10739 example: {} 10740 }; 10741 var init20 = () => initBlock({ name: name20, metadata: block_default21, settings: settings20 }); 10742 10743 // packages/block-library/build-module/comment-date/index.js 10744 var comment_date_exports = {}; 10745 __export(comment_date_exports, { 10746 init: () => init21, 10747 metadata: () => block_default22, 10748 name: () => name21, 10749 settings: () => settings21 10750 }); 10751 10752 // packages/block-library/build-module/comment-date/block.json 10753 var block_default22 = { 10754 $schema: "https://schemas.wp.org/trunk/block.json", 10755 apiVersion: 3, 10756 name: "core/comment-date", 10757 title: "Comment Date", 10758 category: "theme", 10759 ancestor: ["core/comment-template"], 10760 description: "Displays the date on which the comment was posted.", 10761 textdomain: "default", 10762 attributes: { 10763 format: { 10764 type: "string" 10765 }, 10766 isLink: { 10767 type: "boolean", 10768 default: true 10769 } 10770 }, 10771 usesContext: ["commentId"], 10772 supports: { 10773 html: false, 10774 color: { 10775 gradients: true, 10776 link: true, 10777 __experimentalDefaultControls: { 10778 background: true, 10779 text: true, 10780 link: true 10781 } 10782 }, 10783 spacing: { 10784 margin: true, 10785 padding: true 10786 }, 10787 typography: { 10788 fontSize: true, 10789 lineHeight: true, 10790 __experimentalFontFamily: true, 10791 __experimentalFontWeight: true, 10792 __experimentalFontStyle: true, 10793 __experimentalTextTransform: true, 10794 __experimentalTextDecoration: true, 10795 __experimentalLetterSpacing: true, 10796 __experimentalDefaultControls: { 10797 fontSize: true 10798 } 10799 }, 10800 interactivity: { 10801 clientNavigation: true 10802 }, 10803 __experimentalBorder: { 10804 radius: true, 10805 color: true, 10806 width: true, 10807 style: true, 10808 __experimentalDefaultControls: { 10809 radius: true, 10810 color: true, 10811 width: true, 10812 style: true 10813 } 10814 } 10815 }, 10816 style: "wp-block-comment-date" 10817 }; 10818 10819 // packages/block-library/build-module/comment-date/edit.js 10820 var import_core_data12 = __toESM(require_core_data()); 10821 var import_date = __toESM(require_date()); 10822 var import_block_editor49 = __toESM(require_block_editor()); 10823 var import_components24 = __toESM(require_components()); 10824 var import_i18n35 = __toESM(require_i18n()); 10825 var import_jsx_runtime197 = __toESM(require_jsx_runtime()); 10826 function Edit9({ 10827 attributes: { format: format3, isLink }, 10828 context: { commentId }, 10829 setAttributes 10830 }) { 10831 const blockProps = (0, import_block_editor49.useBlockProps)(); 10832 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 10833 let [date] = (0, import_core_data12.useEntityProp)("root", "comment", "date", commentId); 10834 const [siteFormat = (0, import_date.getSettings)().formats.date] = (0, import_core_data12.useEntityProp)( 10835 "root", 10836 "site", 10837 "date_format" 10838 ); 10839 const inspectorControls = /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(import_block_editor49.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime197.jsxs)( 10840 import_components24.__experimentalToolsPanel, 10841 { 10842 label: (0, import_i18n35.__)("Settings"), 10843 resetAll: () => { 10844 setAttributes({ 10845 format: void 0, 10846 isLink: true 10847 }); 10848 }, 10849 dropdownMenuProps, 10850 children: [ 10851 /* @__PURE__ */ (0, import_jsx_runtime197.jsx)( 10852 import_components24.__experimentalToolsPanelItem, 10853 { 10854 label: (0, import_i18n35.__)("Date format"), 10855 hasValue: () => format3 !== void 0, 10856 onDeselect: () => setAttributes({ format: void 0 }), 10857 isShownByDefault: true, 10858 children: /* @__PURE__ */ (0, import_jsx_runtime197.jsx)( 10859 import_block_editor49.__experimentalDateFormatPicker, 10860 { 10861 format: format3, 10862 defaultFormat: siteFormat, 10863 onChange: (nextFormat) => setAttributes({ format: nextFormat }) 10864 } 10865 ) 10866 } 10867 ), 10868 /* @__PURE__ */ (0, import_jsx_runtime197.jsx)( 10869 import_components24.__experimentalToolsPanelItem, 10870 { 10871 label: (0, import_i18n35.__)("Link to comment"), 10872 hasValue: () => !isLink, 10873 onDeselect: () => setAttributes({ isLink: true }), 10874 isShownByDefault: true, 10875 children: /* @__PURE__ */ (0, import_jsx_runtime197.jsx)( 10876 import_components24.ToggleControl, 10877 { 10878 label: (0, import_i18n35.__)("Link to comment"), 10879 onChange: () => setAttributes({ isLink: !isLink }), 10880 checked: isLink 10881 } 10882 ) 10883 } 10884 ) 10885 ] 10886 } 10887 ) }); 10888 if (!commentId || !date) { 10889 date = (0, import_i18n35._x)("Comment Date", "block title"); 10890 } 10891 let commentDate = date instanceof Date ? /* @__PURE__ */ (0, import_jsx_runtime197.jsx)("time", { dateTime: (0, import_date.dateI18n)("c", date), children: format3 === "human-diff" ? (0, import_date.humanTimeDiff)(date) : (0, import_date.dateI18n)(format3 || siteFormat, date) }) : /* @__PURE__ */ (0, import_jsx_runtime197.jsx)("time", { children: date }); 10892 if (isLink) { 10893 commentDate = /* @__PURE__ */ (0, import_jsx_runtime197.jsx)( 10894 "a", 10895 { 10896 href: "#comment-date-pseudo-link", 10897 onClick: (event) => event.preventDefault(), 10898 children: commentDate 10899 } 10900 ); 10901 } 10902 return /* @__PURE__ */ (0, import_jsx_runtime197.jsxs)(import_jsx_runtime197.Fragment, { children: [ 10903 inspectorControls, 10904 /* @__PURE__ */ (0, import_jsx_runtime197.jsx)("div", { ...blockProps, children: commentDate }) 10905 ] }); 10906 } 10907 10908 // packages/block-library/build-module/comment-date/deprecated.js 10909 var v16 = { 10910 attributes: { 10911 format: { 10912 type: "string" 10913 }, 10914 isLink: { 10915 type: "boolean", 10916 default: false 10917 } 10918 }, 10919 supports: { 10920 html: false, 10921 color: { 10922 gradients: true, 10923 link: true 10924 }, 10925 typography: { 10926 fontSize: true, 10927 lineHeight: true, 10928 __experimentalFontFamily: true, 10929 __experimentalFontWeight: true, 10930 __experimentalFontStyle: true, 10931 __experimentalTextTransform: true, 10932 __experimentalLetterSpacing: true 10933 } 10934 }, 10935 save() { 10936 return null; 10937 }, 10938 migrate: migrate_font_family_default, 10939 isEligible({ style: style2 }) { 10940 return style2?.typography?.fontFamily; 10941 } 10942 }; 10943 var deprecated_default9 = [v16]; 10944 10945 // packages/block-library/build-module/comment-date/index.js 10946 var { name: name21 } = block_default22; 10947 var settings21 = { 10948 icon: post_date_default, 10949 edit: Edit9, 10950 deprecated: deprecated_default9, 10951 example: {} 10952 }; 10953 var init21 = () => initBlock({ name: name21, metadata: block_default22, settings: settings21 }); 10954 10955 // packages/block-library/build-module/comment-edit-link/index.js 10956 var comment_edit_link_exports = {}; 10957 __export(comment_edit_link_exports, { 10958 init: () => init22, 10959 metadata: () => block_default23, 10960 name: () => name22, 10961 settings: () => settings22 10962 }); 10963 10964 // packages/block-library/build-module/comment-edit-link/block.json 10965 var block_default23 = { 10966 $schema: "https://schemas.wp.org/trunk/block.json", 10967 apiVersion: 3, 10968 name: "core/comment-edit-link", 10969 title: "Comment Edit Link", 10970 category: "theme", 10971 ancestor: ["core/comment-template"], 10972 description: "Displays a link to edit the comment in the WordPress Dashboard. This link is only visible to users with the edit comment capability.", 10973 textdomain: "default", 10974 usesContext: ["commentId"], 10975 attributes: { 10976 linkTarget: { 10977 type: "string", 10978 default: "_self" 10979 }, 10980 textAlign: { 10981 type: "string" 10982 } 10983 }, 10984 supports: { 10985 html: false, 10986 color: { 10987 link: true, 10988 gradients: true, 10989 text: false, 10990 __experimentalDefaultControls: { 10991 background: true, 10992 link: true 10993 } 10994 }, 10995 spacing: { 10996 margin: true, 10997 padding: true, 10998 __experimentalDefaultControls: { 10999 margin: false, 11000 padding: false 11001 } 11002 }, 11003 typography: { 11004 fontSize: true, 11005 lineHeight: true, 11006 __experimentalFontFamily: true, 11007 __experimentalFontWeight: true, 11008 __experimentalFontStyle: true, 11009 __experimentalTextTransform: true, 11010 __experimentalTextDecoration: true, 11011 __experimentalLetterSpacing: true, 11012 __experimentalDefaultControls: { 11013 fontSize: true 11014 } 11015 }, 11016 interactivity: { 11017 clientNavigation: true 11018 }, 11019 __experimentalBorder: { 11020 radius: true, 11021 color: true, 11022 width: true, 11023 style: true 11024 } 11025 }, 11026 style: "wp-block-comment-edit-link" 11027 }; 11028 11029 // packages/block-library/build-module/comment-edit-link/edit.js 11030 var import_block_editor50 = __toESM(require_block_editor()); 11031 var import_components25 = __toESM(require_components()); 11032 var import_i18n36 = __toESM(require_i18n()); 11033 var import_jsx_runtime198 = __toESM(require_jsx_runtime()); 11034 function Edit10({ 11035 attributes: { linkTarget, textAlign }, 11036 setAttributes 11037 }) { 11038 const blockProps = (0, import_block_editor50.useBlockProps)({ 11039 className: clsx_default({ 11040 [`has-text-align-$textAlign}`]: textAlign 11041 }) 11042 }); 11043 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 11044 const blockControls = /* @__PURE__ */ (0, import_jsx_runtime198.jsx)(import_block_editor50.BlockControls, { group: "block", children: /* @__PURE__ */ (0, import_jsx_runtime198.jsx)( 11045 import_block_editor50.AlignmentControl, 11046 { 11047 value: textAlign, 11048 onChange: (newAlign) => setAttributes({ textAlign: newAlign }) 11049 } 11050 ) }); 11051 const inspectorControls = /* @__PURE__ */ (0, import_jsx_runtime198.jsx)(import_block_editor50.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime198.jsx)( 11052 import_components25.__experimentalToolsPanel, 11053 { 11054 label: (0, import_i18n36.__)("Settings"), 11055 resetAll: () => { 11056 setAttributes({ 11057 linkTarget: "_self" 11058 }); 11059 }, 11060 dropdownMenuProps, 11061 children: /* @__PURE__ */ (0, import_jsx_runtime198.jsx)( 11062 import_components25.__experimentalToolsPanelItem, 11063 { 11064 label: (0, import_i18n36.__)("Open in new tab"), 11065 isShownByDefault: true, 11066 hasValue: () => linkTarget === "_blank", 11067 onDeselect: () => setAttributes({ linkTarget: "_self" }), 11068 children: /* @__PURE__ */ (0, import_jsx_runtime198.jsx)( 11069 import_components25.ToggleControl, 11070 { 11071 label: (0, import_i18n36.__)("Open in new tab"), 11072 onChange: (value) => setAttributes({ 11073 linkTarget: value ? "_blank" : "_self" 11074 }), 11075 checked: linkTarget === "_blank" 11076 } 11077 ) 11078 } 11079 ) 11080 } 11081 ) }); 11082 return /* @__PURE__ */ (0, import_jsx_runtime198.jsxs)(import_jsx_runtime198.Fragment, { children: [ 11083 blockControls, 11084 inspectorControls, 11085 /* @__PURE__ */ (0, import_jsx_runtime198.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime198.jsx)( 11086 "a", 11087 { 11088 href: "#edit-comment-pseudo-link", 11089 onClick: (event) => event.preventDefault(), 11090 children: (0, import_i18n36.__)("Edit") 11091 } 11092 ) }) 11093 ] }); 11094 } 11095 11096 // packages/block-library/build-module/comment-edit-link/index.js 11097 var { name: name22 } = block_default23; 11098 var settings22 = { 11099 icon: comment_edit_link_default, 11100 edit: Edit10, 11101 example: {} 11102 }; 11103 var init22 = () => initBlock({ name: name22, metadata: block_default23, settings: settings22 }); 11104 11105 // packages/block-library/build-module/comment-reply-link/index.js 11106 var comment_reply_link_exports = {}; 11107 __export(comment_reply_link_exports, { 11108 init: () => init23, 11109 metadata: () => block_default24, 11110 name: () => name23, 11111 settings: () => settings23 11112 }); 11113 11114 // packages/block-library/build-module/comment-reply-link/block.json 11115 var block_default24 = { 11116 $schema: "https://schemas.wp.org/trunk/block.json", 11117 apiVersion: 3, 11118 name: "core/comment-reply-link", 11119 title: "Comment Reply Link", 11120 category: "theme", 11121 ancestor: ["core/comment-template"], 11122 description: "Displays a link to reply to a comment.", 11123 textdomain: "default", 11124 usesContext: ["commentId"], 11125 attributes: { 11126 textAlign: { 11127 type: "string" 11128 } 11129 }, 11130 supports: { 11131 color: { 11132 gradients: true, 11133 link: true, 11134 text: false, 11135 __experimentalDefaultControls: { 11136 background: true, 11137 link: true 11138 } 11139 }, 11140 spacing: { 11141 margin: true, 11142 padding: true, 11143 __experimentalDefaultControls: { 11144 margin: false, 11145 padding: false 11146 } 11147 }, 11148 typography: { 11149 fontSize: true, 11150 lineHeight: true, 11151 __experimentalFontFamily: true, 11152 __experimentalFontWeight: true, 11153 __experimentalFontStyle: true, 11154 __experimentalTextTransform: true, 11155 __experimentalTextDecoration: true, 11156 __experimentalLetterSpacing: true, 11157 __experimentalDefaultControls: { 11158 fontSize: true 11159 } 11160 }, 11161 __experimentalBorder: { 11162 radius: true, 11163 color: true, 11164 width: true, 11165 style: true 11166 }, 11167 html: false 11168 }, 11169 style: "wp-block-comment-reply-link" 11170 }; 11171 11172 // packages/block-library/build-module/comment-reply-link/edit.js 11173 var import_i18n37 = __toESM(require_i18n()); 11174 var import_block_editor51 = __toESM(require_block_editor()); 11175 var import_jsx_runtime199 = __toESM(require_jsx_runtime()); 11176 function Edit11({ setAttributes, attributes: { textAlign } }) { 11177 const blockProps = (0, import_block_editor51.useBlockProps)({ 11178 className: clsx_default({ 11179 [`has-text-align-$textAlign}`]: textAlign 11180 }) 11181 }); 11182 const blockControls = /* @__PURE__ */ (0, import_jsx_runtime199.jsx)(import_block_editor51.BlockControls, { group: "block", children: /* @__PURE__ */ (0, import_jsx_runtime199.jsx)( 11183 import_block_editor51.AlignmentControl, 11184 { 11185 value: textAlign, 11186 onChange: (newAlign) => setAttributes({ textAlign: newAlign }) 11187 } 11188 ) }); 11189 return /* @__PURE__ */ (0, import_jsx_runtime199.jsxs)(import_jsx_runtime199.Fragment, { children: [ 11190 blockControls, 11191 /* @__PURE__ */ (0, import_jsx_runtime199.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime199.jsx)( 11192 "a", 11193 { 11194 href: "#comment-reply-pseudo-link", 11195 onClick: (event) => event.preventDefault(), 11196 children: (0, import_i18n37.__)("Reply") 11197 } 11198 ) }) 11199 ] }); 11200 } 11201 var edit_default6 = Edit11; 11202 11203 // packages/block-library/build-module/comment-reply-link/index.js 11204 var { name: name23 } = block_default24; 11205 var settings23 = { 11206 edit: edit_default6, 11207 icon: comment_reply_link_default, 11208 example: {} 11209 }; 11210 var init23 = () => initBlock({ name: name23, metadata: block_default24, settings: settings23 }); 11211 11212 // packages/block-library/build-module/comment-template/index.js 11213 var comment_template_exports = {}; 11214 __export(comment_template_exports, { 11215 init: () => init24, 11216 metadata: () => block_default25, 11217 name: () => name24, 11218 settings: () => settings24 11219 }); 11220 11221 // packages/block-library/build-module/comment-template/block.json 11222 var block_default25 = { 11223 $schema: "https://schemas.wp.org/trunk/block.json", 11224 apiVersion: 3, 11225 name: "core/comment-template", 11226 title: "Comment Template", 11227 category: "design", 11228 parent: ["core/comments"], 11229 description: "Contains the block elements used to display a comment, like the title, date, author, avatar and more.", 11230 textdomain: "default", 11231 usesContext: ["postId"], 11232 supports: { 11233 align: true, 11234 html: false, 11235 reusable: false, 11236 spacing: { 11237 margin: true, 11238 padding: true 11239 }, 11240 typography: { 11241 fontSize: true, 11242 lineHeight: true, 11243 __experimentalFontFamily: true, 11244 __experimentalFontWeight: true, 11245 __experimentalFontStyle: true, 11246 __experimentalTextTransform: true, 11247 __experimentalTextDecoration: true, 11248 __experimentalLetterSpacing: true, 11249 __experimentalDefaultControls: { 11250 fontSize: true 11251 } 11252 }, 11253 interactivity: { 11254 clientNavigation: true 11255 }, 11256 __experimentalBorder: { 11257 radius: true, 11258 color: true, 11259 width: true, 11260 style: true, 11261 __experimentalDefaultControls: { 11262 radius: true, 11263 color: true, 11264 width: true, 11265 style: true 11266 } 11267 } 11268 }, 11269 style: "wp-block-comment-template" 11270 }; 11271 11272 // packages/block-library/build-module/comment-template/edit.js 11273 var import_element18 = __toESM(require_element()); 11274 var import_data23 = __toESM(require_data()); 11275 var import_i18n38 = __toESM(require_i18n()); 11276 var import_block_editor53 = __toESM(require_block_editor()); 11277 var import_components26 = __toESM(require_components()); 11278 var import_core_data13 = __toESM(require_core_data()); 11279 11280 // packages/block-library/build-module/comment-template/hooks.js 11281 var import_element17 = __toESM(require_element()); 11282 var import_data22 = __toESM(require_data()); 11283 var import_block_editor52 = __toESM(require_block_editor()); 11284 var import_url3 = __toESM(require_url()); 11285 var import_api_fetch = __toESM(require_api_fetch()); 11286 var MAX_COMMENTS_PER_PAGE = 100; 11287 var useCommentQueryArgs = ({ postId }) => { 11288 const queryArgs = { 11289 status: "approve", 11290 order: "asc", 11291 context: "embed", 11292 parent: 0, 11293 _embed: "children" 11294 }; 11295 const { 11296 pageComments, 11297 commentsPerPage, 11298 defaultCommentsPage: defaultPage 11299 } = (0, import_data22.useSelect)((select9) => { 11300 const { getSettings: getSettings2 } = select9(import_block_editor52.store); 11301 const { __experimentalDiscussionSettings } = getSettings2(); 11302 return __experimentalDiscussionSettings ?? {}; 11303 }, []); 11304 const perPage = pageComments ? Math.min(commentsPerPage, MAX_COMMENTS_PER_PAGE) : MAX_COMMENTS_PER_PAGE; 11305 const page = useDefaultPageIndex({ 11306 defaultPage, 11307 postId, 11308 perPage, 11309 queryArgs 11310 }); 11311 return (0, import_element17.useMemo)(() => { 11312 return page ? { 11313 ...queryArgs, 11314 post: postId, 11315 per_page: perPage, 11316 page 11317 } : null; 11318 }, [postId, perPage, page]); 11319 }; 11320 var useDefaultPageIndex = ({ defaultPage, postId, perPage, queryArgs }) => { 11321 const [defaultPages, setDefaultPages] = (0, import_element17.useState)({}); 11322 const key = `$postId}_$perPage}`; 11323 const page = defaultPages[key] || 0; 11324 (0, import_element17.useEffect)(() => { 11325 if (page || defaultPage !== "newest") { 11326 return; 11327 } 11328 (0, import_api_fetch.default)({ 11329 path: (0, import_url3.addQueryArgs)("/wp/v2/comments", { 11330 ...queryArgs, 11331 post: postId, 11332 per_page: perPage, 11333 _fields: "id" 11334 }), 11335 method: "HEAD", 11336 parse: false 11337 }).then((res) => { 11338 const pages = parseInt(res.headers.get("X-WP-TotalPages")); 11339 setDefaultPages({ 11340 ...defaultPages, 11341 [key]: pages <= 1 ? 1 : pages 11342 // If there are 0 pages, it means that there are no comments, but there is no 0th page. 11343 }); 11344 }).catch(() => { 11345 setDefaultPages({ 11346 ...defaultPages, 11347 [key]: 1 11348 }); 11349 }); 11350 }, [defaultPage, postId, perPage, setDefaultPages]); 11351 return defaultPage === "newest" ? page : 1; 11352 }; 11353 var useCommentTree = (topLevelComments) => { 11354 const commentTree = (0, import_element17.useMemo)( 11355 () => topLevelComments?.map(({ id, _embedded }) => { 11356 const [children] = _embedded?.children || [[]]; 11357 return { 11358 commentId: id, 11359 children: children.map((child) => ({ 11360 commentId: child.id 11361 })) 11362 }; 11363 }), 11364 [topLevelComments] 11365 ); 11366 return commentTree; 11367 }; 11368 11369 // packages/block-library/build-module/comment-template/edit.js 11370 var import_jsx_runtime200 = __toESM(require_jsx_runtime()); 11371 var TEMPLATE2 = [ 11372 ["core/avatar"], 11373 ["core/comment-author-name"], 11374 ["core/comment-date"], 11375 ["core/comment-content"], 11376 ["core/comment-reply-link"], 11377 ["core/comment-edit-link"] 11378 ]; 11379 var getCommentsPlaceholder = ({ 11380 perPage, 11381 pageComments, 11382 threadComments, 11383 threadCommentsDepth 11384 }) => { 11385 const commentsDepth = !threadComments ? 1 : Math.min(threadCommentsDepth, 3); 11386 const buildChildrenComment = (commentsLevel) => { 11387 if (commentsLevel < commentsDepth) { 11388 const nextLevel = commentsLevel + 1; 11389 return [ 11390 { 11391 commentId: -(commentsLevel + 3), 11392 children: buildChildrenComment(nextLevel) 11393 } 11394 ]; 11395 } 11396 return []; 11397 }; 11398 const placeholderComments = [ 11399 { commentId: -1, children: buildChildrenComment(1) } 11400 ]; 11401 if ((!pageComments || perPage >= 2) && commentsDepth < 3) { 11402 placeholderComments.push({ 11403 commentId: -2, 11404 children: [] 11405 }); 11406 } 11407 if ((!pageComments || perPage >= 3) && commentsDepth < 2) { 11408 placeholderComments.push({ 11409 commentId: -3, 11410 children: [] 11411 }); 11412 } 11413 return placeholderComments; 11414 }; 11415 function CommentTemplateInnerBlocks({ 11416 comment, 11417 activeCommentId, 11418 setActiveCommentId, 11419 firstCommentId, 11420 blocks 11421 }) { 11422 const { children, ...innerBlocksProps } = (0, import_block_editor53.useInnerBlocksProps)( 11423 {}, 11424 { template: TEMPLATE2 } 11425 ); 11426 return /* @__PURE__ */ (0, import_jsx_runtime200.jsxs)("li", { ...innerBlocksProps, children: [ 11427 comment.commentId === (activeCommentId || firstCommentId) ? children : null, 11428 /* @__PURE__ */ (0, import_jsx_runtime200.jsx)( 11429 MemoizedCommentTemplatePreview, 11430 { 11431 blocks, 11432 commentId: comment.commentId, 11433 setActiveCommentId, 11434 isHidden: comment.commentId === (activeCommentId || firstCommentId) 11435 } 11436 ), 11437 comment?.children?.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime200.jsx)( 11438 CommentsList, 11439 { 11440 comments: comment.children, 11441 activeCommentId, 11442 setActiveCommentId, 11443 blocks, 11444 firstCommentId 11445 } 11446 ) : null 11447 ] }); 11448 } 11449 var CommentTemplatePreview = ({ 11450 blocks, 11451 commentId, 11452 setActiveCommentId, 11453 isHidden 11454 }) => { 11455 const blockPreviewProps = (0, import_block_editor53.__experimentalUseBlockPreview)({ 11456 blocks 11457 }); 11458 const handleOnClick = () => { 11459 setActiveCommentId(commentId); 11460 }; 11461 const style2 = { 11462 display: isHidden ? "none" : void 0 11463 }; 11464 return /* @__PURE__ */ (0, import_jsx_runtime200.jsx)( 11465 "div", 11466 { 11467 ...blockPreviewProps, 11468 tabIndex: 0, 11469 role: "button", 11470 style: style2, 11471 onClick: handleOnClick, 11472 onKeyPress: handleOnClick 11473 } 11474 ); 11475 }; 11476 var MemoizedCommentTemplatePreview = (0, import_element18.memo)(CommentTemplatePreview); 11477 var CommentsList = ({ 11478 comments, 11479 blockProps, 11480 activeCommentId, 11481 setActiveCommentId, 11482 blocks, 11483 firstCommentId 11484 }) => /* @__PURE__ */ (0, import_jsx_runtime200.jsx)("ol", { ...blockProps, children: comments && comments.map(({ commentId, ...comment }, index) => /* @__PURE__ */ (0, import_jsx_runtime200.jsx)( 11485 import_block_editor53.BlockContextProvider, 11486 { 11487 value: { 11488 // If the commentId is negative it means that this comment is a 11489 // "placeholder" and that the block is most likely being used in the 11490 // site editor. In this case, we have to set the commentId to `null` 11491 // because otherwise the (non-existent) comment with a negative ID 11492 // would be requested from the REST API. 11493 commentId: commentId < 0 ? null : commentId 11494 }, 11495 children: /* @__PURE__ */ (0, import_jsx_runtime200.jsx)( 11496 CommentTemplateInnerBlocks, 11497 { 11498 comment: { commentId, ...comment }, 11499 activeCommentId, 11500 setActiveCommentId, 11501 blocks, 11502 firstCommentId 11503 } 11504 ) 11505 }, 11506 comment.commentId || index 11507 )) }); 11508 function CommentTemplateEdit({ 11509 clientId, 11510 context: { postId } 11511 }) { 11512 const blockProps = (0, import_block_editor53.useBlockProps)(); 11513 const [activeCommentId, setActiveCommentId] = (0, import_element18.useState)(); 11514 const { 11515 commentOrder, 11516 threadCommentsDepth, 11517 threadComments, 11518 commentsPerPage, 11519 pageComments 11520 } = (0, import_data23.useSelect)((select9) => { 11521 const { getSettings: getSettings2 } = select9(import_block_editor53.store); 11522 return getSettings2().__experimentalDiscussionSettings ?? {}; 11523 }, []); 11524 const commentQuery = useCommentQueryArgs({ 11525 postId 11526 }); 11527 const { topLevelComments, blocks } = (0, import_data23.useSelect)( 11528 (select9) => { 11529 const { getEntityRecords } = select9(import_core_data13.store); 11530 const { getBlocks } = select9(import_block_editor53.store); 11531 return { 11532 // Request only top-level comments. Replies are embedded. 11533 topLevelComments: commentQuery ? getEntityRecords("root", "comment", commentQuery) : null, 11534 blocks: getBlocks(clientId) 11535 }; 11536 }, 11537 [clientId, commentQuery] 11538 ); 11539 let commentTree = useCommentTree( 11540 // Reverse the order of top comments if needed. 11541 commentOrder === "desc" && topLevelComments ? [...topLevelComments].reverse() : topLevelComments 11542 ); 11543 if (!topLevelComments) { 11544 return /* @__PURE__ */ (0, import_jsx_runtime200.jsx)("p", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime200.jsx)(import_components26.Spinner, {}) }); 11545 } 11546 if (!postId) { 11547 commentTree = getCommentsPlaceholder({ 11548 perPage: commentsPerPage, 11549 pageComments, 11550 threadComments, 11551 threadCommentsDepth 11552 }); 11553 } 11554 if (!commentTree.length) { 11555 return /* @__PURE__ */ (0, import_jsx_runtime200.jsx)("p", { ...blockProps, children: (0, import_i18n38.__)("No results found.") }); 11556 } 11557 return /* @__PURE__ */ (0, import_jsx_runtime200.jsx)( 11558 CommentsList, 11559 { 11560 comments: commentTree, 11561 blockProps, 11562 blocks, 11563 activeCommentId, 11564 setActiveCommentId, 11565 firstCommentId: commentTree[0]?.commentId 11566 } 11567 ); 11568 } 11569 11570 // packages/block-library/build-module/comment-template/save.js 11571 var import_block_editor54 = __toESM(require_block_editor()); 11572 var import_jsx_runtime201 = __toESM(require_jsx_runtime()); 11573 function CommentTemplateSave() { 11574 return /* @__PURE__ */ (0, import_jsx_runtime201.jsx)(import_block_editor54.InnerBlocks.Content, {}); 11575 } 11576 11577 // packages/block-library/build-module/comment-template/index.js 11578 var { name: name24 } = block_default25; 11579 var settings24 = { 11580 icon: layout_default, 11581 edit: CommentTemplateEdit, 11582 save: CommentTemplateSave 11583 }; 11584 var init24 = () => initBlock({ name: name24, metadata: block_default25, settings: settings24 }); 11585 11586 // packages/block-library/build-module/comments-pagination-previous/index.js 11587 var comments_pagination_previous_exports = {}; 11588 __export(comments_pagination_previous_exports, { 11589 init: () => init25, 11590 metadata: () => block_default26, 11591 name: () => name25, 11592 settings: () => settings25 11593 }); 11594 var import_i18n40 = __toESM(require_i18n()); 11595 11596 // packages/block-library/build-module/comments-pagination-previous/block.json 11597 var block_default26 = { 11598 $schema: "https://schemas.wp.org/trunk/block.json", 11599 apiVersion: 3, 11600 name: "core/comments-pagination-previous", 11601 title: "Comments Previous Page", 11602 category: "theme", 11603 parent: ["core/comments-pagination"], 11604 description: "Displays the previous comment's page link.", 11605 textdomain: "default", 11606 attributes: { 11607 label: { 11608 type: "string" 11609 } 11610 }, 11611 usesContext: ["postId", "comments/paginationArrow"], 11612 supports: { 11613 reusable: false, 11614 html: false, 11615 color: { 11616 gradients: true, 11617 text: false, 11618 __experimentalDefaultControls: { 11619 background: true 11620 } 11621 }, 11622 typography: { 11623 fontSize: true, 11624 lineHeight: true, 11625 __experimentalFontFamily: true, 11626 __experimentalFontWeight: true, 11627 __experimentalFontStyle: true, 11628 __experimentalTextTransform: true, 11629 __experimentalTextDecoration: true, 11630 __experimentalLetterSpacing: true, 11631 __experimentalDefaultControls: { 11632 fontSize: true 11633 } 11634 }, 11635 interactivity: { 11636 clientNavigation: true 11637 } 11638 } 11639 }; 11640 11641 // packages/block-library/build-module/comments-pagination-previous/edit.js 11642 var import_i18n39 = __toESM(require_i18n()); 11643 var import_block_editor55 = __toESM(require_block_editor()); 11644 var import_jsx_runtime202 = __toESM(require_jsx_runtime()); 11645 var arrowMap = { 11646 none: "", 11647 arrow: "\u2190", 11648 chevron: "\xAB" 11649 }; 11650 function CommentsPaginationPreviousEdit({ 11651 attributes: { label }, 11652 setAttributes, 11653 context: { "comments/paginationArrow": paginationArrow } 11654 }) { 11655 const displayArrow = arrowMap[paginationArrow]; 11656 return /* @__PURE__ */ (0, import_jsx_runtime202.jsxs)( 11657 "a", 11658 { 11659 href: "#comments-pagination-previous-pseudo-link", 11660 onClick: (event) => event.preventDefault(), 11661 ...(0, import_block_editor55.useBlockProps)(), 11662 children: [ 11663 displayArrow && /* @__PURE__ */ (0, import_jsx_runtime202.jsx)( 11664 "span", 11665 { 11666 className: `wp-block-comments-pagination-previous-arrow is-arrow-$paginationArrow}`, 11667 children: displayArrow 11668 } 11669 ), 11670 /* @__PURE__ */ (0, import_jsx_runtime202.jsx)( 11671 import_block_editor55.PlainText, 11672 { 11673 __experimentalVersion: 2, 11674 tagName: "span", 11675 "aria-label": (0, import_i18n39.__)("Older comments page link"), 11676 placeholder: (0, import_i18n39.__)("Older Comments"), 11677 value: label, 11678 onChange: (newLabel) => setAttributes({ label: newLabel }) 11679 } 11680 ) 11681 ] 11682 } 11683 ); 11684 } 11685 11686 // packages/block-library/build-module/comments-pagination-previous/index.js 11687 var { name: name25 } = block_default26; 11688 var settings25 = { 11689 icon: query_pagination_previous_default, 11690 edit: CommentsPaginationPreviousEdit, 11691 example: { 11692 attributes: { 11693 label: (0, import_i18n40.__)("Older Comments") 11694 } 11695 } 11696 }; 11697 var init25 = () => initBlock({ name: name25, metadata: block_default26, settings: settings25 }); 11698 11699 // packages/block-library/build-module/comments-pagination/index.js 11700 var comments_pagination_exports = {}; 11701 __export(comments_pagination_exports, { 11702 init: () => init26, 11703 metadata: () => block_default27, 11704 name: () => name26, 11705 settings: () => settings26 11706 }); 11707 11708 // packages/block-library/build-module/comments-pagination/block.json 11709 var block_default27 = { 11710 $schema: "https://schemas.wp.org/trunk/block.json", 11711 apiVersion: 3, 11712 name: "core/comments-pagination", 11713 title: "Comments Pagination", 11714 category: "theme", 11715 parent: ["core/comments"], 11716 allowedBlocks: [ 11717 "core/comments-pagination-previous", 11718 "core/comments-pagination-numbers", 11719 "core/comments-pagination-next" 11720 ], 11721 description: "Displays a paginated navigation to next/previous set of comments, when applicable.", 11722 textdomain: "default", 11723 attributes: { 11724 paginationArrow: { 11725 type: "string", 11726 default: "none" 11727 } 11728 }, 11729 example: { 11730 attributes: { 11731 paginationArrow: "none" 11732 } 11733 }, 11734 providesContext: { 11735 "comments/paginationArrow": "paginationArrow" 11736 }, 11737 supports: { 11738 align: true, 11739 reusable: false, 11740 html: false, 11741 color: { 11742 gradients: true, 11743 link: true, 11744 __experimentalDefaultControls: { 11745 background: true, 11746 text: true, 11747 link: true 11748 } 11749 }, 11750 layout: { 11751 allowSwitching: false, 11752 allowInheriting: false, 11753 default: { 11754 type: "flex" 11755 } 11756 }, 11757 typography: { 11758 fontSize: true, 11759 lineHeight: true, 11760 __experimentalFontFamily: true, 11761 __experimentalFontWeight: true, 11762 __experimentalFontStyle: true, 11763 __experimentalTextTransform: true, 11764 __experimentalTextDecoration: true, 11765 __experimentalLetterSpacing: true, 11766 __experimentalDefaultControls: { 11767 fontSize: true 11768 } 11769 }, 11770 interactivity: { 11771 clientNavigation: true 11772 } 11773 }, 11774 editorStyle: "wp-block-comments-pagination-editor", 11775 style: "wp-block-comments-pagination" 11776 }; 11777 11778 // packages/block-library/build-module/comments-pagination/edit.js 11779 var import_i18n42 = __toESM(require_i18n()); 11780 var import_block_editor56 = __toESM(require_block_editor()); 11781 var import_data24 = __toESM(require_data()); 11782 var import_components28 = __toESM(require_components()); 11783 11784 // packages/block-library/build-module/comments-pagination/comments-pagination-arrow-controls.js 11785 var import_i18n41 = __toESM(require_i18n()); 11786 var import_components27 = __toESM(require_components()); 11787 var import_jsx_runtime203 = __toESM(require_jsx_runtime()); 11788 function CommentsPaginationArrowControls({ value, onChange }) { 11789 return /* @__PURE__ */ (0, import_jsx_runtime203.jsxs)( 11790 import_components27.__experimentalToggleGroupControl, 11791 { 11792 __next40pxDefaultSize: true, 11793 label: (0, import_i18n41.__)("Arrow"), 11794 value, 11795 onChange, 11796 help: (0, import_i18n41.__)( 11797 "A decorative arrow appended to the next and previous comments link." 11798 ), 11799 isBlock: true, 11800 children: [ 11801 /* @__PURE__ */ (0, import_jsx_runtime203.jsx)( 11802 import_components27.__experimentalToggleGroupControlOption, 11803 { 11804 value: "none", 11805 label: (0, import_i18n41._x)( 11806 "None", 11807 "Arrow option for Comments Pagination Next/Previous blocks" 11808 ) 11809 } 11810 ), 11811 /* @__PURE__ */ (0, import_jsx_runtime203.jsx)( 11812 import_components27.__experimentalToggleGroupControlOption, 11813 { 11814 value: "arrow", 11815 label: (0, import_i18n41._x)( 11816 "Arrow", 11817 "Arrow option for Comments Pagination Next/Previous blocks" 11818 ) 11819 } 11820 ), 11821 /* @__PURE__ */ (0, import_jsx_runtime203.jsx)( 11822 import_components27.__experimentalToggleGroupControlOption, 11823 { 11824 value: "chevron", 11825 label: (0, import_i18n41._x)( 11826 "Chevron", 11827 "Arrow option for Comments Pagination Next/Previous blocks" 11828 ) 11829 } 11830 ) 11831 ] 11832 } 11833 ); 11834 } 11835 11836 // packages/block-library/build-module/comments-pagination/edit.js 11837 var import_jsx_runtime204 = __toESM(require_jsx_runtime()); 11838 var TEMPLATE3 = [ 11839 ["core/comments-pagination-previous"], 11840 ["core/comments-pagination-numbers"], 11841 ["core/comments-pagination-next"] 11842 ]; 11843 function QueryPaginationEdit({ 11844 attributes: { paginationArrow }, 11845 setAttributes, 11846 clientId 11847 }) { 11848 const hasNextPreviousBlocks = (0, import_data24.useSelect)((select9) => { 11849 const { getBlocks } = select9(import_block_editor56.store); 11850 const innerBlocks = getBlocks(clientId); 11851 return innerBlocks?.find((innerBlock) => { 11852 return [ 11853 "core/comments-pagination-previous", 11854 "core/comments-pagination-next" 11855 ].includes(innerBlock.name); 11856 }); 11857 }, []); 11858 const blockProps = (0, import_block_editor56.useBlockProps)(); 11859 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 11860 const innerBlocksProps = (0, import_block_editor56.useInnerBlocksProps)(blockProps, { 11861 template: TEMPLATE3 11862 }); 11863 const pageComments = (0, import_data24.useSelect)((select9) => { 11864 const { getSettings: getSettings2 } = select9(import_block_editor56.store); 11865 const { __experimentalDiscussionSettings } = getSettings2(); 11866 return __experimentalDiscussionSettings?.pageComments; 11867 }, []); 11868 if (!pageComments) { 11869 return /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(import_block_editor56.Warning, { children: (0, import_i18n42.__)( 11870 "Comments Pagination block: paging comments is disabled in the Discussion Settings" 11871 ) }); 11872 } 11873 return /* @__PURE__ */ (0, import_jsx_runtime204.jsxs)(import_jsx_runtime204.Fragment, { children: [ 11874 hasNextPreviousBlocks && /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(import_block_editor56.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime204.jsx)( 11875 import_components28.__experimentalToolsPanel, 11876 { 11877 label: (0, import_i18n42.__)("Settings"), 11878 dropdownMenuProps, 11879 resetAll: () => setAttributes({ paginationArrow: "none" }), 11880 children: /* @__PURE__ */ (0, import_jsx_runtime204.jsx)( 11881 import_components28.__experimentalToolsPanelItem, 11882 { 11883 label: (0, import_i18n42.__)("Arrow"), 11884 hasValue: () => paginationArrow !== "none", 11885 onDeselect: () => setAttributes({ paginationArrow: "none" }), 11886 isShownByDefault: true, 11887 children: /* @__PURE__ */ (0, import_jsx_runtime204.jsx)( 11888 CommentsPaginationArrowControls, 11889 { 11890 value: paginationArrow, 11891 onChange: (value) => { 11892 setAttributes({ paginationArrow: value }); 11893 } 11894 } 11895 ) 11896 } 11897 ) 11898 } 11899 ) }), 11900 /* @__PURE__ */ (0, import_jsx_runtime204.jsx)("div", { ...innerBlocksProps }) 11901 ] }); 11902 } 11903 11904 // packages/block-library/build-module/comments-pagination/save.js 11905 var import_block_editor57 = __toESM(require_block_editor()); 11906 var import_jsx_runtime205 = __toESM(require_jsx_runtime()); 11907 function save13() { 11908 return /* @__PURE__ */ (0, import_jsx_runtime205.jsx)(import_block_editor57.InnerBlocks.Content, {}); 11909 } 11910 11911 // packages/block-library/build-module/comments-pagination/index.js 11912 var { name: name26 } = block_default27; 11913 var settings26 = { 11914 icon: query_pagination_default, 11915 edit: QueryPaginationEdit, 11916 save: save13 11917 }; 11918 var init26 = () => initBlock({ name: name26, metadata: block_default27, settings: settings26 }); 11919 11920 // packages/block-library/build-module/comments-pagination-next/index.js 11921 var comments_pagination_next_exports = {}; 11922 __export(comments_pagination_next_exports, { 11923 init: () => init27, 11924 metadata: () => block_default28, 11925 name: () => name27, 11926 settings: () => settings27 11927 }); 11928 var import_i18n44 = __toESM(require_i18n()); 11929 11930 // packages/block-library/build-module/comments-pagination-next/block.json 11931 var block_default28 = { 11932 $schema: "https://schemas.wp.org/trunk/block.json", 11933 apiVersion: 3, 11934 name: "core/comments-pagination-next", 11935 title: "Comments Next Page", 11936 category: "theme", 11937 parent: ["core/comments-pagination"], 11938 description: "Displays the next comment's page link.", 11939 textdomain: "default", 11940 attributes: { 11941 label: { 11942 type: "string" 11943 } 11944 }, 11945 usesContext: ["postId", "comments/paginationArrow"], 11946 supports: { 11947 reusable: false, 11948 html: false, 11949 color: { 11950 gradients: true, 11951 text: false, 11952 __experimentalDefaultControls: { 11953 background: true 11954 } 11955 }, 11956 typography: { 11957 fontSize: true, 11958 lineHeight: true, 11959 __experimentalFontFamily: true, 11960 __experimentalFontWeight: true, 11961 __experimentalFontStyle: true, 11962 __experimentalTextTransform: true, 11963 __experimentalTextDecoration: true, 11964 __experimentalLetterSpacing: true, 11965 __experimentalDefaultControls: { 11966 fontSize: true 11967 } 11968 }, 11969 interactivity: { 11970 clientNavigation: true 11971 } 11972 } 11973 }; 11974 11975 // packages/block-library/build-module/comments-pagination-next/edit.js 11976 var import_i18n43 = __toESM(require_i18n()); 11977 var import_block_editor58 = __toESM(require_block_editor()); 11978 var import_jsx_runtime206 = __toESM(require_jsx_runtime()); 11979 var arrowMap2 = { 11980 none: "", 11981 arrow: "\u2192", 11982 chevron: "\xBB" 11983 }; 11984 function CommentsPaginationNextEdit({ 11985 attributes: { label }, 11986 setAttributes, 11987 context: { "comments/paginationArrow": paginationArrow } 11988 }) { 11989 const displayArrow = arrowMap2[paginationArrow]; 11990 return /* @__PURE__ */ (0, import_jsx_runtime206.jsxs)( 11991 "a", 11992 { 11993 href: "#comments-pagination-next-pseudo-link", 11994 onClick: (event) => event.preventDefault(), 11995 ...(0, import_block_editor58.useBlockProps)(), 11996 children: [ 11997 /* @__PURE__ */ (0, import_jsx_runtime206.jsx)( 11998 import_block_editor58.PlainText, 11999 { 12000 __experimentalVersion: 2, 12001 tagName: "span", 12002 "aria-label": (0, import_i18n43.__)("Newer comments page link"), 12003 placeholder: (0, import_i18n43.__)("Newer Comments"), 12004 value: label, 12005 onChange: (newLabel) => setAttributes({ label: newLabel }) 12006 } 12007 ), 12008 displayArrow && /* @__PURE__ */ (0, import_jsx_runtime206.jsx)( 12009 "span", 12010 { 12011 className: `wp-block-comments-pagination-next-arrow is-arrow-$paginationArrow}`, 12012 children: displayArrow 12013 } 12014 ) 12015 ] 12016 } 12017 ); 12018 } 12019 12020 // packages/block-library/build-module/comments-pagination-next/index.js 12021 var { name: name27 } = block_default28; 12022 var settings27 = { 12023 icon: query_pagination_next_default, 12024 edit: CommentsPaginationNextEdit, 12025 example: { 12026 attributes: { 12027 label: (0, import_i18n44.__)("Newer Comments") 12028 } 12029 } 12030 }; 12031 var init27 = () => initBlock({ name: name27, metadata: block_default28, settings: settings27 }); 12032 12033 // packages/block-library/build-module/comments-pagination-numbers/index.js 12034 var comments_pagination_numbers_exports = {}; 12035 __export(comments_pagination_numbers_exports, { 12036 init: () => init28, 12037 metadata: () => block_default29, 12038 name: () => name28, 12039 settings: () => settings28 12040 }); 12041 12042 // packages/block-library/build-module/comments-pagination-numbers/block.json 12043 var block_default29 = { 12044 $schema: "https://schemas.wp.org/trunk/block.json", 12045 apiVersion: 3, 12046 name: "core/comments-pagination-numbers", 12047 title: "Comments Page Numbers", 12048 category: "theme", 12049 parent: ["core/comments-pagination"], 12050 description: "Displays a list of page numbers for comments pagination.", 12051 textdomain: "default", 12052 usesContext: ["postId"], 12053 supports: { 12054 reusable: false, 12055 html: false, 12056 color: { 12057 gradients: true, 12058 text: false, 12059 __experimentalDefaultControls: { 12060 background: true 12061 } 12062 }, 12063 typography: { 12064 fontSize: true, 12065 lineHeight: true, 12066 __experimentalFontFamily: true, 12067 __experimentalFontWeight: true, 12068 __experimentalFontStyle: true, 12069 __experimentalTextTransform: true, 12070 __experimentalTextDecoration: true, 12071 __experimentalLetterSpacing: true, 12072 __experimentalDefaultControls: { 12073 fontSize: true 12074 } 12075 }, 12076 interactivity: { 12077 clientNavigation: true 12078 }, 12079 spacing: { 12080 margin: true, 12081 padding: true, 12082 __experimentalDefaultControls: { 12083 padding: true 12084 } 12085 } 12086 } 12087 }; 12088 12089 // packages/block-library/build-module/comments-pagination-numbers/edit.js 12090 var import_block_editor59 = __toESM(require_block_editor()); 12091 var import_jsx_runtime207 = __toESM(require_jsx_runtime()); 12092 var PaginationItem = ({ content, tag: Tag = "a", extraClass = "" }) => Tag === "a" ? /* @__PURE__ */ (0, import_jsx_runtime207.jsx)( 12093 Tag, 12094 { 12095 className: `page-numbers $extraClass}`, 12096 href: "#comments-pagination-numbers-pseudo-link", 12097 onClick: (event) => event.preventDefault(), 12098 children: content 12099 } 12100 ) : /* @__PURE__ */ (0, import_jsx_runtime207.jsx)(Tag, { className: `page-numbers $extraClass}`, children: content }); 12101 function CommentsPaginationNumbersEdit() { 12102 return /* @__PURE__ */ (0, import_jsx_runtime207.jsxs)("div", { ...(0, import_block_editor59.useBlockProps)(), children: [ 12103 /* @__PURE__ */ (0, import_jsx_runtime207.jsx)(PaginationItem, { content: "1" }), 12104 /* @__PURE__ */ (0, import_jsx_runtime207.jsx)(PaginationItem, { content: "2" }), 12105 /* @__PURE__ */ (0, import_jsx_runtime207.jsx)(PaginationItem, { content: "3", tag: "span", extraClass: "current" }), 12106 /* @__PURE__ */ (0, import_jsx_runtime207.jsx)(PaginationItem, { content: "4" }), 12107 /* @__PURE__ */ (0, import_jsx_runtime207.jsx)(PaginationItem, { content: "5" }), 12108 /* @__PURE__ */ (0, import_jsx_runtime207.jsx)(PaginationItem, { content: "...", tag: "span", extraClass: "dots" }), 12109 /* @__PURE__ */ (0, import_jsx_runtime207.jsx)(PaginationItem, { content: "8" }) 12110 ] }); 12111 } 12112 12113 // packages/block-library/build-module/comments-pagination-numbers/index.js 12114 var { name: name28 } = block_default29; 12115 var settings28 = { 12116 icon: query_pagination_numbers_default, 12117 edit: CommentsPaginationNumbersEdit, 12118 example: {} 12119 }; 12120 var init28 = () => initBlock({ name: name28, metadata: block_default29, settings: settings28 }); 12121 12122 // packages/block-library/build-module/comments-title/index.js 12123 var comments_title_exports = {}; 12124 __export(comments_title_exports, { 12125 init: () => init29, 12126 metadata: () => block_default30, 12127 name: () => name29, 12128 settings: () => settings29 12129 }); 12130 12131 // packages/block-library/build-module/comments-title/block.json 12132 var block_default30 = { 12133 $schema: "https://schemas.wp.org/trunk/block.json", 12134 apiVersion: 3, 12135 name: "core/comments-title", 12136 title: "Comments Title", 12137 category: "theme", 12138 ancestor: ["core/comments"], 12139 description: "Displays a title with the number of comments.", 12140 textdomain: "default", 12141 usesContext: ["postId", "postType"], 12142 attributes: { 12143 textAlign: { 12144 type: "string" 12145 }, 12146 showPostTitle: { 12147 type: "boolean", 12148 default: true 12149 }, 12150 showCommentsCount: { 12151 type: "boolean", 12152 default: true 12153 }, 12154 level: { 12155 type: "number", 12156 default: 2 12157 }, 12158 levelOptions: { 12159 type: "array" 12160 } 12161 }, 12162 supports: { 12163 anchor: false, 12164 align: true, 12165 html: false, 12166 __experimentalBorder: { 12167 radius: true, 12168 color: true, 12169 width: true, 12170 style: true 12171 }, 12172 color: { 12173 gradients: true, 12174 __experimentalDefaultControls: { 12175 background: true, 12176 text: true 12177 } 12178 }, 12179 spacing: { 12180 margin: true, 12181 padding: true 12182 }, 12183 typography: { 12184 fontSize: true, 12185 lineHeight: true, 12186 __experimentalFontFamily: true, 12187 __experimentalFontWeight: true, 12188 __experimentalFontStyle: true, 12189 __experimentalTextTransform: true, 12190 __experimentalTextDecoration: true, 12191 __experimentalLetterSpacing: true, 12192 __experimentalDefaultControls: { 12193 fontSize: true, 12194 __experimentalFontFamily: true, 12195 __experimentalFontStyle: true, 12196 __experimentalFontWeight: true 12197 } 12198 }, 12199 interactivity: { 12200 clientNavigation: true 12201 } 12202 } 12203 }; 12204 12205 // packages/block-library/build-module/comments-title/edit.js 12206 var import_block_editor60 = __toESM(require_block_editor()); 12207 var import_i18n45 = __toESM(require_i18n()); 12208 var import_core_data14 = __toESM(require_core_data()); 12209 var import_components29 = __toESM(require_components()); 12210 var import_element19 = __toESM(require_element()); 12211 var import_data25 = __toESM(require_data()); 12212 var import_api_fetch2 = __toESM(require_api_fetch()); 12213 var import_url4 = __toESM(require_url()); 12214 var import_jsx_runtime208 = __toESM(require_jsx_runtime()); 12215 function Edit12({ 12216 attributes: { 12217 textAlign, 12218 showPostTitle, 12219 showCommentsCount, 12220 level, 12221 levelOptions 12222 }, 12223 setAttributes, 12224 context: { postType, postId } 12225 }) { 12226 const TagName2 = "h" + level; 12227 const [commentsCount, setCommentsCount] = (0, import_element19.useState)(); 12228 const [rawTitle] = (0, import_core_data14.useEntityProp)("postType", postType, "title", postId); 12229 const isSiteEditor = typeof postId === "undefined"; 12230 const blockProps = (0, import_block_editor60.useBlockProps)({ 12231 className: clsx_default({ 12232 [`has-text-align-$textAlign}`]: textAlign 12233 }) 12234 }); 12235 const { 12236 threadCommentsDepth, 12237 threadComments, 12238 commentsPerPage, 12239 pageComments 12240 } = (0, import_data25.useSelect)((select9) => { 12241 const { getSettings: getSettings2 } = select9(import_block_editor60.store); 12242 return getSettings2().__experimentalDiscussionSettings ?? {}; 12243 }, []); 12244 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 12245 (0, import_element19.useEffect)(() => { 12246 if (isSiteEditor) { 12247 const nestedCommentsNumber = threadComments ? Math.min(threadCommentsDepth, 3) - 1 : 0; 12248 const topLevelCommentsNumber = pageComments ? commentsPerPage : 3; 12249 const commentsNumber = parseInt(nestedCommentsNumber) + parseInt(topLevelCommentsNumber); 12250 setCommentsCount(Math.min(commentsNumber, 3)); 12251 return; 12252 } 12253 const currentPostId = postId; 12254 (0, import_api_fetch2.default)({ 12255 path: (0, import_url4.addQueryArgs)("/wp/v2/comments", { 12256 post: postId, 12257 _fields: "id" 12258 }), 12259 method: "HEAD", 12260 parse: false 12261 }).then((res) => { 12262 if (currentPostId === postId) { 12263 setCommentsCount( 12264 parseInt(res.headers.get("X-WP-Total")) 12265 ); 12266 } 12267 }).catch(() => { 12268 setCommentsCount(0); 12269 }); 12270 }, [postId]); 12271 const blockControls = /* @__PURE__ */ (0, import_jsx_runtime208.jsxs)(import_block_editor60.BlockControls, { group: "block", children: [ 12272 /* @__PURE__ */ (0, import_jsx_runtime208.jsx)( 12273 import_block_editor60.AlignmentControl, 12274 { 12275 value: textAlign, 12276 onChange: (newAlign) => setAttributes({ textAlign: newAlign }) 12277 } 12278 ), 12279 /* @__PURE__ */ (0, import_jsx_runtime208.jsx)( 12280 import_block_editor60.HeadingLevelDropdown, 12281 { 12282 value: level, 12283 options: levelOptions, 12284 onChange: (newLevel) => setAttributes({ level: newLevel }) 12285 } 12286 ) 12287 ] }); 12288 const inspectorControls = /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(import_block_editor60.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime208.jsxs)( 12289 import_components29.__experimentalToolsPanel, 12290 { 12291 label: (0, import_i18n45.__)("Settings"), 12292 resetAll: () => { 12293 setAttributes({ 12294 showPostTitle: true, 12295 showCommentsCount: true 12296 }); 12297 }, 12298 dropdownMenuProps, 12299 children: [ 12300 /* @__PURE__ */ (0, import_jsx_runtime208.jsx)( 12301 import_components29.__experimentalToolsPanelItem, 12302 { 12303 label: (0, import_i18n45.__)("Show post title"), 12304 isShownByDefault: true, 12305 hasValue: () => !showPostTitle, 12306 onDeselect: () => setAttributes({ showPostTitle: true }), 12307 children: /* @__PURE__ */ (0, import_jsx_runtime208.jsx)( 12308 import_components29.ToggleControl, 12309 { 12310 label: (0, import_i18n45.__)("Show post title"), 12311 checked: showPostTitle, 12312 onChange: (value) => setAttributes({ showPostTitle: value }) 12313 } 12314 ) 12315 } 12316 ), 12317 /* @__PURE__ */ (0, import_jsx_runtime208.jsx)( 12318 import_components29.__experimentalToolsPanelItem, 12319 { 12320 label: (0, import_i18n45.__)("Show comments count"), 12321 isShownByDefault: true, 12322 hasValue: () => !showCommentsCount, 12323 onDeselect: () => setAttributes({ showCommentsCount: true }), 12324 children: /* @__PURE__ */ (0, import_jsx_runtime208.jsx)( 12325 import_components29.ToggleControl, 12326 { 12327 label: (0, import_i18n45.__)("Show comments count"), 12328 checked: showCommentsCount, 12329 onChange: (value) => setAttributes({ showCommentsCount: value }) 12330 } 12331 ) 12332 } 12333 ) 12334 ] 12335 } 12336 ) }); 12337 const postTitle = isSiteEditor ? (0, import_i18n45.__)("\u201CPost Title\u201D") : `"$rawTitle}"`; 12338 let placeholder2; 12339 if (showCommentsCount && commentsCount !== void 0) { 12340 if (showPostTitle) { 12341 if (commentsCount === 1) { 12342 placeholder2 = (0, import_i18n45.sprintf)((0, import_i18n45.__)("One response to %s"), postTitle); 12343 } else { 12344 placeholder2 = (0, import_i18n45.sprintf)( 12345 /* translators: 1: Number of comments, 2: Post title. */ 12346 (0, import_i18n45._n)( 12347 "%1$s response to %2$s", 12348 "%1$s responses to %2$s", 12349 commentsCount 12350 ), 12351 commentsCount, 12352 postTitle 12353 ); 12354 } 12355 } else if (commentsCount === 1) { 12356 placeholder2 = (0, import_i18n45.__)("One response"); 12357 } else { 12358 placeholder2 = (0, import_i18n45.sprintf)( 12359 /* translators: %s: Number of comments. */ 12360 (0, import_i18n45._n)("%s response", "%s responses", commentsCount), 12361 commentsCount 12362 ); 12363 } 12364 } else if (showPostTitle) { 12365 if (commentsCount === 1) { 12366 placeholder2 = (0, import_i18n45.sprintf)((0, import_i18n45.__)("Response to %s"), postTitle); 12367 } else { 12368 placeholder2 = (0, import_i18n45.sprintf)((0, import_i18n45.__)("Responses to %s"), postTitle); 12369 } 12370 } else if (commentsCount === 1) { 12371 placeholder2 = (0, import_i18n45.__)("Response"); 12372 } else { 12373 placeholder2 = (0, import_i18n45.__)("Responses"); 12374 } 12375 return /* @__PURE__ */ (0, import_jsx_runtime208.jsxs)(import_jsx_runtime208.Fragment, { children: [ 12376 blockControls, 12377 inspectorControls, 12378 /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(TagName2, { ...blockProps, children: placeholder2 }) 12379 ] }); 12380 } 12381 12382 // packages/block-library/build-module/comments-title/deprecated.js 12383 var { attributes, supports } = block_default30; 12384 var deprecated_default10 = [ 12385 { 12386 attributes: { 12387 ...attributes, 12388 singleCommentLabel: { 12389 type: "string" 12390 }, 12391 multipleCommentsLabel: { 12392 type: "string" 12393 } 12394 }, 12395 supports, 12396 migrate: (oldAttributes) => { 12397 const { 12398 singleCommentLabel, 12399 multipleCommentsLabel, 12400 ...newAttributes 12401 } = oldAttributes; 12402 return newAttributes; 12403 }, 12404 isEligible: ({ multipleCommentsLabel, singleCommentLabel }) => multipleCommentsLabel || singleCommentLabel, 12405 save: () => null 12406 } 12407 ]; 12408 12409 // packages/block-library/build-module/comments-title/index.js 12410 var { name: name29 } = block_default30; 12411 var settings29 = { 12412 icon: title_default, 12413 edit: Edit12, 12414 deprecated: deprecated_default10, 12415 example: {} 12416 }; 12417 var init29 = () => initBlock({ name: name29, metadata: block_default30, settings: settings29 }); 12418 12419 // packages/block-library/build-module/cover/index.js 12420 var cover_exports = {}; 12421 __export(cover_exports, { 12422 init: () => init30, 12423 metadata: () => block_default31, 12424 name: () => name30, 12425 settings: () => settings30 12426 }); 12427 var import_i18n54 = __toESM(require_i18n()); 12428 var import_blocks23 = __toESM(require_blocks()); 12429 12430 // packages/block-library/build-module/cover/deprecated.js 12431 var import_blocks20 = __toESM(require_blocks()); 12432 var import_block_editor61 = __toESM(require_block_editor()); 12433 var import_i18n46 = __toESM(require_i18n()); 12434 var import_compose12 = __toESM(require_compose()); 12435 12436 // packages/block-library/build-module/cover/shared.js 12437 var import_blob4 = __toESM(require_blob()); 12438 var POSITION_CLASSNAMES = { 12439 "top left": "is-position-top-left", 12440 "top center": "is-position-top-center", 12441 "top right": "is-position-top-right", 12442 "center left": "is-position-center-left", 12443 "center center": "is-position-center-center", 12444 center: "is-position-center-center", 12445 "center right": "is-position-center-right", 12446 "bottom left": "is-position-bottom-left", 12447 "bottom center": "is-position-bottom-center", 12448 "bottom right": "is-position-bottom-right" 12449 }; 12450 var IMAGE_BACKGROUND_TYPE = "image"; 12451 var VIDEO_BACKGROUND_TYPE = "video"; 12452 var EMBED_VIDEO_BACKGROUND_TYPE = "embed-video"; 12453 var COVER_MIN_HEIGHT = 50; 12454 var DEFAULT_FOCAL_POINT = { x: 0.5, y: 0.5 }; 12455 var ALLOWED_MEDIA_TYPES2 = ["image", "video"]; 12456 function mediaPosition({ x: x2, y: y2 } = DEFAULT_FOCAL_POINT) { 12457 return `$Math.round(x2 * 100)}% $Math.round(y2 * 100)}%`; 12458 } 12459 function dimRatioToClass(ratio) { 12460 return ratio === 50 || ratio === void 0 ? null : "has-background-dim-" + 10 * Math.round(ratio / 10); 12461 } 12462 function attributesFromMedia(media) { 12463 if (!media || !media.url && !media.src) { 12464 return { 12465 url: void 0, 12466 id: void 0 12467 }; 12468 } 12469 if ((0, import_blob4.isBlobURL)(media.url)) { 12470 media.type = (0, import_blob4.getBlobTypeByURL)(media.url); 12471 } 12472 let mediaType; 12473 if (media.media_type) { 12474 if (media.media_type === IMAGE_BACKGROUND_TYPE) { 12475 mediaType = IMAGE_BACKGROUND_TYPE; 12476 } else { 12477 mediaType = VIDEO_BACKGROUND_TYPE; 12478 } 12479 } else if (media.type && (media.type === IMAGE_BACKGROUND_TYPE || media.type === VIDEO_BACKGROUND_TYPE)) { 12480 mediaType = media.type; 12481 } else { 12482 return; 12483 } 12484 return { 12485 url: media.url || media.src, 12486 id: media.id, 12487 alt: media?.alt, 12488 backgroundType: mediaType, 12489 ...mediaType === VIDEO_BACKGROUND_TYPE ? { hasParallax: void 0 } : {} 12490 }; 12491 } 12492 function isContentPositionCenter(contentPosition) { 12493 return !contentPosition || contentPosition === "center center" || contentPosition === "center"; 12494 } 12495 function getPositionClassName(contentPosition) { 12496 if (isContentPositionCenter(contentPosition)) { 12497 return ""; 12498 } 12499 return POSITION_CLASSNAMES[contentPosition]; 12500 } 12501 12502 // packages/block-library/build-module/cover/deprecated.js 12503 var import_jsx_runtime209 = __toESM(require_jsx_runtime()); 12504 function backgroundImageStyles(url) { 12505 return url ? { backgroundImage: `url($url})` } : {}; 12506 } 12507 function dimRatioToClassV1(ratio) { 12508 return ratio === 0 || ratio === 50 || !ratio ? null : "has-background-dim-" + 10 * Math.round(ratio / 10); 12509 } 12510 function migrateDimRatio(attributes3) { 12511 return { 12512 ...attributes3, 12513 dimRatio: !attributes3.url ? 100 : attributes3.dimRatio 12514 }; 12515 } 12516 function migrateTag(attributes3) { 12517 if (!attributes3.tagName) { 12518 attributes3 = { 12519 ...attributes3, 12520 tagName: "div" 12521 }; 12522 } 12523 return { 12524 ...attributes3 12525 }; 12526 } 12527 var blockAttributes2 = { 12528 url: { 12529 type: "string" 12530 }, 12531 id: { 12532 type: "number" 12533 }, 12534 hasParallax: { 12535 type: "boolean", 12536 default: false 12537 }, 12538 dimRatio: { 12539 type: "number", 12540 default: 50 12541 }, 12542 overlayColor: { 12543 type: "string" 12544 }, 12545 customOverlayColor: { 12546 type: "string" 12547 }, 12548 backgroundType: { 12549 type: "string", 12550 default: "image" 12551 }, 12552 focalPoint: { 12553 type: "object" 12554 } 12555 }; 12556 var v8ToV11BlockAttributes = { 12557 url: { 12558 type: "string" 12559 }, 12560 id: { 12561 type: "number" 12562 }, 12563 alt: { 12564 type: "string", 12565 source: "attribute", 12566 selector: "img", 12567 attribute: "alt", 12568 default: "" 12569 }, 12570 hasParallax: { 12571 type: "boolean", 12572 default: false 12573 }, 12574 isRepeated: { 12575 type: "boolean", 12576 default: false 12577 }, 12578 dimRatio: { 12579 type: "number", 12580 default: 100 12581 }, 12582 overlayColor: { 12583 type: "string" 12584 }, 12585 customOverlayColor: { 12586 type: "string" 12587 }, 12588 backgroundType: { 12589 type: "string", 12590 default: "image" 12591 }, 12592 focalPoint: { 12593 type: "object" 12594 }, 12595 minHeight: { 12596 type: "number" 12597 }, 12598 minHeightUnit: { 12599 type: "string" 12600 }, 12601 gradient: { 12602 type: "string" 12603 }, 12604 customGradient: { 12605 type: "string" 12606 }, 12607 contentPosition: { 12608 type: "string" 12609 }, 12610 isDark: { 12611 type: "boolean", 12612 default: true 12613 }, 12614 allowedBlocks: { 12615 type: "array" 12616 }, 12617 templateLock: { 12618 type: ["string", "boolean"], 12619 enum: ["all", "insert", false] 12620 } 12621 }; 12622 var v12toV13BlockAttributes = { 12623 ...v8ToV11BlockAttributes, 12624 useFeaturedImage: { 12625 type: "boolean", 12626 default: false 12627 }, 12628 tagName: { 12629 type: "string", 12630 default: "div" 12631 } 12632 }; 12633 var v14BlockAttributes = { 12634 ...v12toV13BlockAttributes, 12635 isUserOverlayColor: { 12636 type: "boolean" 12637 }, 12638 sizeSlug: { 12639 type: "string" 12640 }, 12641 alt: { 12642 type: "string", 12643 default: "" 12644 } 12645 }; 12646 var v7toV11BlockSupports = { 12647 anchor: true, 12648 align: true, 12649 html: false, 12650 spacing: { 12651 padding: true, 12652 __experimentalDefaultControls: { 12653 padding: true 12654 } 12655 }, 12656 color: { 12657 __experimentalDuotone: "> .wp-block-cover__image-background, > .wp-block-cover__video-background", 12658 text: false, 12659 background: false 12660 } 12661 }; 12662 var v12BlockSupports = { 12663 ...v7toV11BlockSupports, 12664 spacing: { 12665 padding: true, 12666 margin: ["top", "bottom"], 12667 blockGap: true, 12668 __experimentalDefaultControls: { 12669 padding: true, 12670 blockGap: true 12671 } 12672 }, 12673 __experimentalBorder: { 12674 color: true, 12675 radius: true, 12676 style: true, 12677 width: true, 12678 __experimentalDefaultControls: { 12679 color: true, 12680 radius: true, 12681 style: true, 12682 width: true 12683 } 12684 }, 12685 color: { 12686 __experimentalDuotone: "> .wp-block-cover__image-background, > .wp-block-cover__video-background", 12687 heading: true, 12688 text: true, 12689 background: false, 12690 __experimentalSkipSerialization: ["gradients"], 12691 enableContrastChecker: false 12692 }, 12693 typography: { 12694 fontSize: true, 12695 lineHeight: true, 12696 __experimentalFontFamily: true, 12697 __experimentalFontWeight: true, 12698 __experimentalFontStyle: true, 12699 __experimentalTextTransform: true, 12700 __experimentalTextDecoration: true, 12701 __experimentalLetterSpacing: true, 12702 __experimentalDefaultControls: { 12703 fontSize: true 12704 } 12705 }, 12706 layout: { 12707 allowJustification: false 12708 } 12709 }; 12710 var v14BlockSupports = { 12711 ...v12BlockSupports, 12712 shadow: true, 12713 dimensions: { 12714 aspectRatio: true 12715 }, 12716 interactivity: { 12717 clientNavigation: true 12718 } 12719 }; 12720 var v142 = { 12721 attributes: v14BlockAttributes, 12722 supports: v14BlockSupports, 12723 save({ attributes: attributes3 }) { 12724 const { 12725 backgroundType, 12726 gradient, 12727 contentPosition, 12728 customGradient, 12729 customOverlayColor, 12730 dimRatio, 12731 focalPoint, 12732 useFeaturedImage, 12733 hasParallax, 12734 isDark: isDark2, 12735 isRepeated, 12736 overlayColor, 12737 url, 12738 alt, 12739 id, 12740 minHeight: minHeightProp, 12741 minHeightUnit, 12742 tagName: Tag, 12743 sizeSlug 12744 } = attributes3; 12745 const overlayColorClass = (0, import_block_editor61.getColorClassName)( 12746 "background-color", 12747 overlayColor 12748 ); 12749 const gradientClass = (0, import_block_editor61.__experimentalGetGradientClass)(gradient); 12750 const minHeight = minHeightProp && minHeightUnit ? `$minHeightProp}$minHeightUnit}` : minHeightProp; 12751 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 12752 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 12753 const isImgElement = !(hasParallax || isRepeated); 12754 const style2 = { 12755 minHeight: minHeight || void 0 12756 }; 12757 const bgStyle = { 12758 backgroundColor: !overlayColorClass ? customOverlayColor : void 0, 12759 background: customGradient ? customGradient : void 0 12760 }; 12761 const objectPosition = ( 12762 // prettier-ignore 12763 focalPoint && isImgElement ? mediaPosition(focalPoint) : void 0 12764 ); 12765 const backgroundImage = url ? `url($url})` : void 0; 12766 const backgroundPosition = mediaPosition(focalPoint); 12767 const classes = clsx_default( 12768 { 12769 "is-light": !isDark2, 12770 "has-parallax": hasParallax, 12771 "is-repeated": isRepeated, 12772 "has-custom-content-position": !isContentPositionCenter(contentPosition) 12773 }, 12774 getPositionClassName(contentPosition) 12775 ); 12776 const imgClasses = clsx_default( 12777 "wp-block-cover__image-background", 12778 id ? `wp-image-$id}` : null, 12779 { 12780 [`size-$sizeSlug}`]: sizeSlug, 12781 "has-parallax": hasParallax, 12782 "is-repeated": isRepeated 12783 } 12784 ); 12785 const gradientValue = gradient || customGradient; 12786 return /* @__PURE__ */ (0, import_jsx_runtime209.jsxs)(Tag, { ...import_block_editor61.useBlockProps.save({ className: classes, style: style2 }), children: [ 12787 /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 12788 "span", 12789 { 12790 "aria-hidden": "true", 12791 className: clsx_default( 12792 "wp-block-cover__background", 12793 overlayColorClass, 12794 dimRatioToClass(dimRatio), 12795 { 12796 "has-background-dim": dimRatio !== void 0, 12797 // For backwards compatibility. Former versions of the Cover Block applied 12798 // `.wp-block-cover__gradient-background` in the presence of 12799 // media, a gradient and a dim. 12800 "wp-block-cover__gradient-background": url && gradientValue && dimRatio !== 0, 12801 "has-background-gradient": gradientValue, 12802 [gradientClass]: gradientClass 12803 } 12804 ), 12805 style: bgStyle 12806 } 12807 ), 12808 !useFeaturedImage && isImageBackground && url && (isImgElement ? /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 12809 "img", 12810 { 12811 className: imgClasses, 12812 alt, 12813 src: url, 12814 style: { objectPosition }, 12815 "data-object-fit": "cover", 12816 "data-object-position": objectPosition 12817 } 12818 ) : /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 12819 "div", 12820 { 12821 role: alt ? "img" : void 0, 12822 "aria-label": alt ? alt : void 0, 12823 className: imgClasses, 12824 style: { backgroundPosition, backgroundImage } 12825 } 12826 )), 12827 isVideoBackground && url && /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 12828 "video", 12829 { 12830 className: clsx_default( 12831 "wp-block-cover__video-background", 12832 "intrinsic-ignore" 12833 ), 12834 autoPlay: true, 12835 muted: true, 12836 loop: true, 12837 playsInline: true, 12838 src: url, 12839 style: { objectPosition }, 12840 "data-object-fit": "cover", 12841 "data-object-position": objectPosition 12842 } 12843 ), 12844 /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 12845 "div", 12846 { 12847 ...import_block_editor61.useInnerBlocksProps.save({ 12848 className: "wp-block-cover__inner-container" 12849 }) 12850 } 12851 ) 12852 ] }); 12853 } 12854 }; 12855 var v132 = { 12856 attributes: v12toV13BlockAttributes, 12857 supports: v12BlockSupports, 12858 save({ attributes: attributes3 }) { 12859 const { 12860 backgroundType, 12861 gradient, 12862 contentPosition, 12863 customGradient, 12864 customOverlayColor, 12865 dimRatio, 12866 focalPoint, 12867 useFeaturedImage, 12868 hasParallax, 12869 isDark: isDark2, 12870 isRepeated, 12871 overlayColor, 12872 url, 12873 alt, 12874 id, 12875 minHeight: minHeightProp, 12876 minHeightUnit, 12877 tagName: Tag 12878 } = attributes3; 12879 const overlayColorClass = (0, import_block_editor61.getColorClassName)( 12880 "background-color", 12881 overlayColor 12882 ); 12883 const gradientClass = (0, import_block_editor61.__experimentalGetGradientClass)(gradient); 12884 const minHeight = minHeightProp && minHeightUnit ? `$minHeightProp}$minHeightUnit}` : minHeightProp; 12885 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 12886 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 12887 const isImgElement = !(hasParallax || isRepeated); 12888 const style2 = { 12889 minHeight: minHeight || void 0 12890 }; 12891 const bgStyle = { 12892 backgroundColor: !overlayColorClass ? customOverlayColor : void 0, 12893 background: customGradient ? customGradient : void 0 12894 }; 12895 const objectPosition = ( 12896 // prettier-ignore 12897 focalPoint && isImgElement ? mediaPosition(focalPoint) : void 0 12898 ); 12899 const backgroundImage = url ? `url($url})` : void 0; 12900 const backgroundPosition = mediaPosition(focalPoint); 12901 const classes = clsx_default( 12902 { 12903 "is-light": !isDark2, 12904 "has-parallax": hasParallax, 12905 "is-repeated": isRepeated, 12906 "has-custom-content-position": !isContentPositionCenter(contentPosition) 12907 }, 12908 getPositionClassName(contentPosition) 12909 ); 12910 const imgClasses = clsx_default( 12911 "wp-block-cover__image-background", 12912 id ? `wp-image-$id}` : null, 12913 { 12914 "has-parallax": hasParallax, 12915 "is-repeated": isRepeated 12916 } 12917 ); 12918 const gradientValue = gradient || customGradient; 12919 return /* @__PURE__ */ (0, import_jsx_runtime209.jsxs)(Tag, { ...import_block_editor61.useBlockProps.save({ className: classes, style: style2 }), children: [ 12920 /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 12921 "span", 12922 { 12923 "aria-hidden": "true", 12924 className: clsx_default( 12925 "wp-block-cover__background", 12926 overlayColorClass, 12927 dimRatioToClass(dimRatio), 12928 { 12929 "has-background-dim": dimRatio !== void 0, 12930 // For backwards compatibility. Former versions of the Cover Block applied 12931 // `.wp-block-cover__gradient-background` in the presence of 12932 // media, a gradient and a dim. 12933 "wp-block-cover__gradient-background": url && gradientValue && dimRatio !== 0, 12934 "has-background-gradient": gradientValue, 12935 [gradientClass]: gradientClass 12936 } 12937 ), 12938 style: bgStyle 12939 } 12940 ), 12941 !useFeaturedImage && isImageBackground && url && (isImgElement ? /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 12942 "img", 12943 { 12944 className: imgClasses, 12945 alt, 12946 src: url, 12947 style: { objectPosition }, 12948 "data-object-fit": "cover", 12949 "data-object-position": objectPosition 12950 } 12951 ) : /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 12952 "div", 12953 { 12954 role: "img", 12955 className: imgClasses, 12956 style: { backgroundPosition, backgroundImage } 12957 } 12958 )), 12959 isVideoBackground && url && /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 12960 "video", 12961 { 12962 className: clsx_default( 12963 "wp-block-cover__video-background", 12964 "intrinsic-ignore" 12965 ), 12966 autoPlay: true, 12967 muted: true, 12968 loop: true, 12969 playsInline: true, 12970 src: url, 12971 style: { objectPosition }, 12972 "data-object-fit": "cover", 12973 "data-object-position": objectPosition 12974 } 12975 ), 12976 /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 12977 "div", 12978 { 12979 ...import_block_editor61.useInnerBlocksProps.save({ 12980 className: "wp-block-cover__inner-container" 12981 }) 12982 } 12983 ) 12984 ] }); 12985 } 12986 }; 12987 var v122 = { 12988 attributes: v12toV13BlockAttributes, 12989 supports: v12BlockSupports, 12990 isEligible(attributes3) { 12991 return (attributes3.customOverlayColor !== void 0 || attributes3.overlayColor !== void 0) && attributes3.isUserOverlayColor === void 0; 12992 }, 12993 migrate(attributes3) { 12994 return { 12995 ...attributes3, 12996 isUserOverlayColor: true 12997 }; 12998 }, 12999 save({ attributes: attributes3 }) { 13000 const { 13001 backgroundType, 13002 gradient, 13003 contentPosition, 13004 customGradient, 13005 customOverlayColor, 13006 dimRatio, 13007 focalPoint, 13008 useFeaturedImage, 13009 hasParallax, 13010 isDark: isDark2, 13011 isRepeated, 13012 overlayColor, 13013 url, 13014 alt, 13015 id, 13016 minHeight: minHeightProp, 13017 minHeightUnit, 13018 tagName: Tag 13019 } = attributes3; 13020 const overlayColorClass = (0, import_block_editor61.getColorClassName)( 13021 "background-color", 13022 overlayColor 13023 ); 13024 const gradientClass = (0, import_block_editor61.__experimentalGetGradientClass)(gradient); 13025 const minHeight = minHeightProp && minHeightUnit ? `$minHeightProp}$minHeightUnit}` : minHeightProp; 13026 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 13027 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 13028 const isImgElement = !(hasParallax || isRepeated); 13029 const style2 = { 13030 minHeight: minHeight || void 0 13031 }; 13032 const bgStyle = { 13033 backgroundColor: !overlayColorClass ? customOverlayColor : void 0, 13034 background: customGradient ? customGradient : void 0 13035 }; 13036 const objectPosition = ( 13037 // prettier-ignore 13038 focalPoint && isImgElement ? mediaPosition(focalPoint) : void 0 13039 ); 13040 const backgroundImage = url ? `url($url})` : void 0; 13041 const backgroundPosition = mediaPosition(focalPoint); 13042 const classes = clsx_default( 13043 { 13044 "is-light": !isDark2, 13045 "has-parallax": hasParallax, 13046 "is-repeated": isRepeated, 13047 "has-custom-content-position": !isContentPositionCenter(contentPosition) 13048 }, 13049 getPositionClassName(contentPosition) 13050 ); 13051 const imgClasses = clsx_default( 13052 "wp-block-cover__image-background", 13053 id ? `wp-image-$id}` : null, 13054 { 13055 "has-parallax": hasParallax, 13056 "is-repeated": isRepeated 13057 } 13058 ); 13059 const gradientValue = gradient || customGradient; 13060 return /* @__PURE__ */ (0, import_jsx_runtime209.jsxs)(Tag, { ...import_block_editor61.useBlockProps.save({ className: classes, style: style2 }), children: [ 13061 /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 13062 "span", 13063 { 13064 "aria-hidden": "true", 13065 className: clsx_default( 13066 "wp-block-cover__background", 13067 overlayColorClass, 13068 dimRatioToClass(dimRatio), 13069 { 13070 "has-background-dim": dimRatio !== void 0, 13071 // For backwards compatibility. Former versions of the Cover Block applied 13072 // `.wp-block-cover__gradient-background` in the presence of 13073 // media, a gradient and a dim. 13074 "wp-block-cover__gradient-background": url && gradientValue && dimRatio !== 0, 13075 "has-background-gradient": gradientValue, 13076 [gradientClass]: gradientClass 13077 } 13078 ), 13079 style: bgStyle 13080 } 13081 ), 13082 !useFeaturedImage && isImageBackground && url && (isImgElement ? /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 13083 "img", 13084 { 13085 className: imgClasses, 13086 alt, 13087 src: url, 13088 style: { objectPosition }, 13089 "data-object-fit": "cover", 13090 "data-object-position": objectPosition 13091 } 13092 ) : /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 13093 "div", 13094 { 13095 role: "img", 13096 className: imgClasses, 13097 style: { backgroundPosition, backgroundImage } 13098 } 13099 )), 13100 isVideoBackground && url && /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 13101 "video", 13102 { 13103 className: clsx_default( 13104 "wp-block-cover__video-background", 13105 "intrinsic-ignore" 13106 ), 13107 autoPlay: true, 13108 muted: true, 13109 loop: true, 13110 playsInline: true, 13111 src: url, 13112 style: { objectPosition }, 13113 "data-object-fit": "cover", 13114 "data-object-position": objectPosition 13115 } 13116 ), 13117 /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 13118 "div", 13119 { 13120 ...import_block_editor61.useInnerBlocksProps.save({ 13121 className: "wp-block-cover__inner-container" 13122 }) 13123 } 13124 ) 13125 ] }); 13126 } 13127 }; 13128 var v112 = { 13129 attributes: v8ToV11BlockAttributes, 13130 supports: v7toV11BlockSupports, 13131 save({ attributes: attributes3 }) { 13132 const { 13133 backgroundType, 13134 gradient, 13135 contentPosition, 13136 customGradient, 13137 customOverlayColor, 13138 dimRatio, 13139 focalPoint, 13140 useFeaturedImage, 13141 hasParallax, 13142 isDark: isDark2, 13143 isRepeated, 13144 overlayColor, 13145 url, 13146 alt, 13147 id, 13148 minHeight: minHeightProp, 13149 minHeightUnit 13150 } = attributes3; 13151 const overlayColorClass = (0, import_block_editor61.getColorClassName)( 13152 "background-color", 13153 overlayColor 13154 ); 13155 const gradientClass = (0, import_block_editor61.__experimentalGetGradientClass)(gradient); 13156 const minHeight = minHeightProp && minHeightUnit ? `$minHeightProp}$minHeightUnit}` : minHeightProp; 13157 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 13158 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 13159 const isImgElement = !(hasParallax || isRepeated); 13160 const style2 = { 13161 minHeight: minHeight || void 0 13162 }; 13163 const bgStyle = { 13164 backgroundColor: !overlayColorClass ? customOverlayColor : void 0, 13165 background: customGradient ? customGradient : void 0 13166 }; 13167 const objectPosition = ( 13168 // prettier-ignore 13169 focalPoint && isImgElement ? mediaPosition(focalPoint) : void 0 13170 ); 13171 const backgroundImage = url ? `url($url})` : void 0; 13172 const backgroundPosition = mediaPosition(focalPoint); 13173 const classes = clsx_default( 13174 { 13175 "is-light": !isDark2, 13176 "has-parallax": hasParallax, 13177 "is-repeated": isRepeated, 13178 "has-custom-content-position": !isContentPositionCenter(contentPosition) 13179 }, 13180 getPositionClassName(contentPosition) 13181 ); 13182 const imgClasses = clsx_default( 13183 "wp-block-cover__image-background", 13184 id ? `wp-image-$id}` : null, 13185 { 13186 "has-parallax": hasParallax, 13187 "is-repeated": isRepeated 13188 } 13189 ); 13190 const gradientValue = gradient || customGradient; 13191 return /* @__PURE__ */ (0, import_jsx_runtime209.jsxs)("div", { ...import_block_editor61.useBlockProps.save({ className: classes, style: style2 }), children: [ 13192 /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 13193 "span", 13194 { 13195 "aria-hidden": "true", 13196 className: clsx_default( 13197 "wp-block-cover__background", 13198 overlayColorClass, 13199 dimRatioToClass(dimRatio), 13200 { 13201 "has-background-dim": dimRatio !== void 0, 13202 // For backwards compatibility. Former versions of the Cover Block applied 13203 // `.wp-block-cover__gradient-background` in the presence of 13204 // media, a gradient and a dim. 13205 "wp-block-cover__gradient-background": url && gradientValue && dimRatio !== 0, 13206 "has-background-gradient": gradientValue, 13207 [gradientClass]: gradientClass 13208 } 13209 ), 13210 style: bgStyle 13211 } 13212 ), 13213 !useFeaturedImage && isImageBackground && url && (isImgElement ? /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 13214 "img", 13215 { 13216 className: imgClasses, 13217 alt, 13218 src: url, 13219 style: { objectPosition }, 13220 "data-object-fit": "cover", 13221 "data-object-position": objectPosition 13222 } 13223 ) : /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 13224 "div", 13225 { 13226 role: "img", 13227 className: imgClasses, 13228 style: { backgroundPosition, backgroundImage } 13229 } 13230 )), 13231 isVideoBackground && url && /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 13232 "video", 13233 { 13234 className: clsx_default( 13235 "wp-block-cover__video-background", 13236 "intrinsic-ignore" 13237 ), 13238 autoPlay: true, 13239 muted: true, 13240 loop: true, 13241 playsInline: true, 13242 src: url, 13243 style: { objectPosition }, 13244 "data-object-fit": "cover", 13245 "data-object-position": objectPosition 13246 } 13247 ), 13248 /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 13249 "div", 13250 { 13251 ...import_block_editor61.useInnerBlocksProps.save({ 13252 className: "wp-block-cover__inner-container" 13253 }) 13254 } 13255 ) 13256 ] }); 13257 }, 13258 migrate: migrateTag 13259 }; 13260 var v102 = { 13261 attributes: v8ToV11BlockAttributes, 13262 supports: v7toV11BlockSupports, 13263 save({ attributes: attributes3 }) { 13264 const { 13265 backgroundType, 13266 gradient, 13267 contentPosition, 13268 customGradient, 13269 customOverlayColor, 13270 dimRatio, 13271 focalPoint, 13272 useFeaturedImage, 13273 hasParallax, 13274 isDark: isDark2, 13275 isRepeated, 13276 overlayColor, 13277 url, 13278 alt, 13279 id, 13280 minHeight: minHeightProp, 13281 minHeightUnit 13282 } = attributes3; 13283 const overlayColorClass = (0, import_block_editor61.getColorClassName)( 13284 "background-color", 13285 overlayColor 13286 ); 13287 const gradientClass = (0, import_block_editor61.__experimentalGetGradientClass)(gradient); 13288 const minHeight = minHeightProp && minHeightUnit ? `$minHeightProp}$minHeightUnit}` : minHeightProp; 13289 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 13290 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 13291 const isImgElement = !(hasParallax || isRepeated); 13292 const style2 = { 13293 ...isImageBackground && !isImgElement && !useFeaturedImage ? backgroundImageStyles(url) : {}, 13294 minHeight: minHeight || void 0 13295 }; 13296 const bgStyle = { 13297 backgroundColor: !overlayColorClass ? customOverlayColor : void 0, 13298 background: customGradient ? customGradient : void 0 13299 }; 13300 const objectPosition = ( 13301 // prettier-ignore 13302 focalPoint && isImgElement ? `$Math.round(focalPoint.x * 100)}% $Math.round(focalPoint.y * 100)}%` : void 0 13303 ); 13304 const classes = clsx_default( 13305 { 13306 "is-light": !isDark2, 13307 "has-parallax": hasParallax, 13308 "is-repeated": isRepeated, 13309 "has-custom-content-position": !isContentPositionCenter(contentPosition) 13310 }, 13311 getPositionClassName(contentPosition) 13312 ); 13313 const gradientValue = gradient || customGradient; 13314 return /* @__PURE__ */ (0, import_jsx_runtime209.jsxs)("div", { ...import_block_editor61.useBlockProps.save({ className: classes, style: style2 }), children: [ 13315 /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 13316 "span", 13317 { 13318 "aria-hidden": "true", 13319 className: clsx_default( 13320 "wp-block-cover__background", 13321 overlayColorClass, 13322 dimRatioToClass(dimRatio), 13323 { 13324 "has-background-dim": dimRatio !== void 0, 13325 // For backwards compatibility. Former versions of the Cover Block applied 13326 // `.wp-block-cover__gradient-background` in the presence of 13327 // media, a gradient and a dim. 13328 "wp-block-cover__gradient-background": url && gradientValue && dimRatio !== 0, 13329 "has-background-gradient": gradientValue, 13330 [gradientClass]: gradientClass 13331 } 13332 ), 13333 style: bgStyle 13334 } 13335 ), 13336 !useFeaturedImage && isImageBackground && isImgElement && url && /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 13337 "img", 13338 { 13339 className: clsx_default( 13340 "wp-block-cover__image-background", 13341 id ? `wp-image-$id}` : null 13342 ), 13343 alt, 13344 src: url, 13345 style: { objectPosition }, 13346 "data-object-fit": "cover", 13347 "data-object-position": objectPosition 13348 } 13349 ), 13350 isVideoBackground && url && /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 13351 "video", 13352 { 13353 className: clsx_default( 13354 "wp-block-cover__video-background", 13355 "intrinsic-ignore" 13356 ), 13357 autoPlay: true, 13358 muted: true, 13359 loop: true, 13360 playsInline: true, 13361 src: url, 13362 style: { objectPosition }, 13363 "data-object-fit": "cover", 13364 "data-object-position": objectPosition 13365 } 13366 ), 13367 /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 13368 "div", 13369 { 13370 ...import_block_editor61.useInnerBlocksProps.save({ 13371 className: "wp-block-cover__inner-container" 13372 }) 13373 } 13374 ) 13375 ] }); 13376 }, 13377 migrate: migrateTag 13378 }; 13379 var v9 = { 13380 attributes: v8ToV11BlockAttributes, 13381 supports: v7toV11BlockSupports, 13382 save({ attributes: attributes3 }) { 13383 const { 13384 backgroundType, 13385 gradient, 13386 contentPosition, 13387 customGradient, 13388 customOverlayColor, 13389 dimRatio, 13390 focalPoint, 13391 hasParallax, 13392 isDark: isDark2, 13393 isRepeated, 13394 overlayColor, 13395 url, 13396 alt, 13397 id, 13398 minHeight: minHeightProp, 13399 minHeightUnit 13400 } = attributes3; 13401 const overlayColorClass = (0, import_block_editor61.getColorClassName)( 13402 "background-color", 13403 overlayColor 13404 ); 13405 const gradientClass = (0, import_block_editor61.__experimentalGetGradientClass)(gradient); 13406 const minHeight = minHeightUnit ? `$minHeightProp}$minHeightUnit}` : minHeightProp; 13407 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 13408 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 13409 const isImgElement = !(hasParallax || isRepeated); 13410 const style2 = { 13411 ...isImageBackground && !isImgElement ? backgroundImageStyles(url) : {}, 13412 minHeight: minHeight || void 0 13413 }; 13414 const bgStyle = { 13415 backgroundColor: !overlayColorClass ? customOverlayColor : void 0, 13416 background: customGradient ? customGradient : void 0 13417 }; 13418 const objectPosition = ( 13419 // prettier-ignore 13420 focalPoint && isImgElement ? `$Math.round(focalPoint.x * 100)}% $Math.round(focalPoint.y * 100)}%` : void 0 13421 ); 13422 const classes = clsx_default( 13423 { 13424 "is-light": !isDark2, 13425 "has-parallax": hasParallax, 13426 "is-repeated": isRepeated, 13427 "has-custom-content-position": !isContentPositionCenter(contentPosition) 13428 }, 13429 getPositionClassName(contentPosition) 13430 ); 13431 const gradientValue = gradient || customGradient; 13432 return /* @__PURE__ */ (0, import_jsx_runtime209.jsxs)("div", { ...import_block_editor61.useBlockProps.save({ className: classes, style: style2 }), children: [ 13433 /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 13434 "span", 13435 { 13436 "aria-hidden": "true", 13437 className: clsx_default( 13438 "wp-block-cover__background", 13439 overlayColorClass, 13440 dimRatioToClass(dimRatio), 13441 { 13442 "has-background-dim": dimRatio !== void 0, 13443 // For backwards compatibility. Former versions of the Cover Block applied 13444 // `.wp-block-cover__gradient-background` in the presence of 13445 // media, a gradient and a dim. 13446 "wp-block-cover__gradient-background": url && gradientValue && dimRatio !== 0, 13447 "has-background-gradient": gradientValue, 13448 [gradientClass]: gradientClass 13449 } 13450 ), 13451 style: bgStyle 13452 } 13453 ), 13454 isImageBackground && isImgElement && url && /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 13455 "img", 13456 { 13457 className: clsx_default( 13458 "wp-block-cover__image-background", 13459 id ? `wp-image-$id}` : null 13460 ), 13461 alt, 13462 src: url, 13463 style: { objectPosition }, 13464 "data-object-fit": "cover", 13465 "data-object-position": objectPosition 13466 } 13467 ), 13468 isVideoBackground && url && /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 13469 "video", 13470 { 13471 className: clsx_default( 13472 "wp-block-cover__video-background", 13473 "intrinsic-ignore" 13474 ), 13475 autoPlay: true, 13476 muted: true, 13477 loop: true, 13478 playsInline: true, 13479 src: url, 13480 style: { objectPosition }, 13481 "data-object-fit": "cover", 13482 "data-object-position": objectPosition 13483 } 13484 ), 13485 /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 13486 "div", 13487 { 13488 ...import_block_editor61.useInnerBlocksProps.save({ 13489 className: "wp-block-cover__inner-container" 13490 }) 13491 } 13492 ) 13493 ] }); 13494 }, 13495 migrate: migrateTag 13496 }; 13497 var v8 = { 13498 attributes: v8ToV11BlockAttributes, 13499 supports: v7toV11BlockSupports, 13500 save({ attributes: attributes3 }) { 13501 const { 13502 backgroundType, 13503 gradient, 13504 contentPosition, 13505 customGradient, 13506 customOverlayColor, 13507 dimRatio, 13508 focalPoint, 13509 hasParallax, 13510 isDark: isDark2, 13511 isRepeated, 13512 overlayColor, 13513 url, 13514 alt, 13515 id, 13516 minHeight: minHeightProp, 13517 minHeightUnit 13518 } = attributes3; 13519 const overlayColorClass = (0, import_block_editor61.getColorClassName)( 13520 "background-color", 13521 overlayColor 13522 ); 13523 const gradientClass = (0, import_block_editor61.__experimentalGetGradientClass)(gradient); 13524 const minHeight = minHeightUnit ? `$minHeightProp}$minHeightUnit}` : minHeightProp; 13525 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 13526 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 13527 const isImgElement = !(hasParallax || isRepeated); 13528 const style2 = { 13529 ...isImageBackground && !isImgElement ? backgroundImageStyles(url) : {}, 13530 minHeight: minHeight || void 0 13531 }; 13532 const bgStyle = { 13533 backgroundColor: !overlayColorClass ? customOverlayColor : void 0, 13534 background: customGradient ? customGradient : void 0 13535 }; 13536 const objectPosition = ( 13537 // prettier-ignore 13538 focalPoint && isImgElement ? `$Math.round(focalPoint.x * 100)}% $Math.round(focalPoint.y * 100)}%` : void 0 13539 ); 13540 const classes = clsx_default( 13541 { 13542 "is-light": !isDark2, 13543 "has-parallax": hasParallax, 13544 "is-repeated": isRepeated, 13545 "has-custom-content-position": !isContentPositionCenter(contentPosition) 13546 }, 13547 getPositionClassName(contentPosition) 13548 ); 13549 return /* @__PURE__ */ (0, import_jsx_runtime209.jsxs)("div", { ...import_block_editor61.useBlockProps.save({ className: classes, style: style2 }), children: [ 13550 /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 13551 "span", 13552 { 13553 "aria-hidden": "true", 13554 className: clsx_default( 13555 overlayColorClass, 13556 dimRatioToClass(dimRatio), 13557 "wp-block-cover__gradient-background", 13558 gradientClass, 13559 { 13560 "has-background-dim": dimRatio !== void 0, 13561 "has-background-gradient": gradient || customGradient, 13562 [gradientClass]: !url && gradientClass 13563 } 13564 ), 13565 style: bgStyle 13566 } 13567 ), 13568 isImageBackground && isImgElement && url && /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 13569 "img", 13570 { 13571 className: clsx_default( 13572 "wp-block-cover__image-background", 13573 id ? `wp-image-$id}` : null 13574 ), 13575 alt, 13576 src: url, 13577 style: { objectPosition }, 13578 "data-object-fit": "cover", 13579 "data-object-position": objectPosition 13580 } 13581 ), 13582 isVideoBackground && url && /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 13583 "video", 13584 { 13585 className: clsx_default( 13586 "wp-block-cover__video-background", 13587 "intrinsic-ignore" 13588 ), 13589 autoPlay: true, 13590 muted: true, 13591 loop: true, 13592 playsInline: true, 13593 src: url, 13594 style: { objectPosition }, 13595 "data-object-fit": "cover", 13596 "data-object-position": objectPosition 13597 } 13598 ), 13599 /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 13600 "div", 13601 { 13602 ...import_block_editor61.useInnerBlocksProps.save({ 13603 className: "wp-block-cover__inner-container" 13604 }) 13605 } 13606 ) 13607 ] }); 13608 }, 13609 migrate: migrateTag 13610 }; 13611 var v7 = { 13612 attributes: { 13613 ...blockAttributes2, 13614 isRepeated: { 13615 type: "boolean", 13616 default: false 13617 }, 13618 minHeight: { 13619 type: "number" 13620 }, 13621 minHeightUnit: { 13622 type: "string" 13623 }, 13624 gradient: { 13625 type: "string" 13626 }, 13627 customGradient: { 13628 type: "string" 13629 }, 13630 contentPosition: { 13631 type: "string" 13632 }, 13633 alt: { 13634 type: "string", 13635 source: "attribute", 13636 selector: "img", 13637 attribute: "alt", 13638 default: "" 13639 } 13640 }, 13641 supports: v7toV11BlockSupports, 13642 save({ attributes: attributes3 }) { 13643 const { 13644 backgroundType, 13645 gradient, 13646 contentPosition, 13647 customGradient, 13648 customOverlayColor, 13649 dimRatio, 13650 focalPoint, 13651 hasParallax, 13652 isRepeated, 13653 overlayColor, 13654 url, 13655 alt, 13656 id, 13657 minHeight: minHeightProp, 13658 minHeightUnit 13659 } = attributes3; 13660 const overlayColorClass = (0, import_block_editor61.getColorClassName)( 13661 "background-color", 13662 overlayColor 13663 ); 13664 const gradientClass = (0, import_block_editor61.__experimentalGetGradientClass)(gradient); 13665 const minHeight = minHeightUnit ? `$minHeightProp}$minHeightUnit}` : minHeightProp; 13666 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 13667 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 13668 const isImgElement = !(hasParallax || isRepeated); 13669 const style2 = { 13670 ...isImageBackground && !isImgElement ? backgroundImageStyles(url) : {}, 13671 backgroundColor: !overlayColorClass ? customOverlayColor : void 0, 13672 background: customGradient && !url ? customGradient : void 0, 13673 minHeight: minHeight || void 0 13674 }; 13675 const objectPosition = ( 13676 // prettier-ignore 13677 focalPoint && isImgElement ? `$Math.round(focalPoint.x * 100)}% $Math.round(focalPoint.y * 100)}%` : void 0 13678 ); 13679 const classes = clsx_default( 13680 dimRatioToClassV1(dimRatio), 13681 overlayColorClass, 13682 { 13683 "has-background-dim": dimRatio !== 0, 13684 "has-parallax": hasParallax, 13685 "is-repeated": isRepeated, 13686 "has-background-gradient": gradient || customGradient, 13687 [gradientClass]: !url && gradientClass, 13688 "has-custom-content-position": !isContentPositionCenter(contentPosition) 13689 }, 13690 getPositionClassName(contentPosition) 13691 ); 13692 return /* @__PURE__ */ (0, import_jsx_runtime209.jsxs)("div", { ...import_block_editor61.useBlockProps.save({ className: classes, style: style2 }), children: [ 13693 url && (gradient || customGradient) && dimRatio !== 0 && /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 13694 "span", 13695 { 13696 "aria-hidden": "true", 13697 className: clsx_default( 13698 "wp-block-cover__gradient-background", 13699 gradientClass 13700 ), 13701 style: customGradient ? { background: customGradient } : void 0 13702 } 13703 ), 13704 isImageBackground && isImgElement && url && /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 13705 "img", 13706 { 13707 className: clsx_default( 13708 "wp-block-cover__image-background", 13709 id ? `wp-image-$id}` : null 13710 ), 13711 alt, 13712 src: url, 13713 style: { objectPosition }, 13714 "data-object-fit": "cover", 13715 "data-object-position": objectPosition 13716 } 13717 ), 13718 isVideoBackground && url && /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 13719 "video", 13720 { 13721 className: clsx_default( 13722 "wp-block-cover__video-background", 13723 "intrinsic-ignore" 13724 ), 13725 autoPlay: true, 13726 muted: true, 13727 loop: true, 13728 playsInline: true, 13729 src: url, 13730 style: { objectPosition }, 13731 "data-object-fit": "cover", 13732 "data-object-position": objectPosition 13733 } 13734 ), 13735 /* @__PURE__ */ (0, import_jsx_runtime209.jsx)("div", { className: "wp-block-cover__inner-container", children: /* @__PURE__ */ (0, import_jsx_runtime209.jsx)(import_block_editor61.InnerBlocks.Content, {}) }) 13736 ] }); 13737 }, 13738 migrate: (0, import_compose12.compose)(migrateDimRatio, migrateTag) 13739 }; 13740 var v6 = { 13741 attributes: { 13742 ...blockAttributes2, 13743 isRepeated: { 13744 type: "boolean", 13745 default: false 13746 }, 13747 minHeight: { 13748 type: "number" 13749 }, 13750 minHeightUnit: { 13751 type: "string" 13752 }, 13753 gradient: { 13754 type: "string" 13755 }, 13756 customGradient: { 13757 type: "string" 13758 }, 13759 contentPosition: { 13760 type: "string" 13761 } 13762 }, 13763 supports: { 13764 align: true 13765 }, 13766 save({ attributes: attributes3 }) { 13767 const { 13768 backgroundType, 13769 gradient, 13770 contentPosition, 13771 customGradient, 13772 customOverlayColor, 13773 dimRatio, 13774 focalPoint, 13775 hasParallax, 13776 isRepeated, 13777 overlayColor, 13778 url, 13779 minHeight: minHeightProp, 13780 minHeightUnit 13781 } = attributes3; 13782 const overlayColorClass = (0, import_block_editor61.getColorClassName)( 13783 "background-color", 13784 overlayColor 13785 ); 13786 const gradientClass = (0, import_block_editor61.__experimentalGetGradientClass)(gradient); 13787 const minHeight = minHeightUnit ? `$minHeightProp}$minHeightUnit}` : minHeightProp; 13788 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 13789 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 13790 const style2 = isImageBackground ? backgroundImageStyles(url) : {}; 13791 const videoStyle = {}; 13792 if (!overlayColorClass) { 13793 style2.backgroundColor = customOverlayColor; 13794 } 13795 if (customGradient && !url) { 13796 style2.background = customGradient; 13797 } 13798 style2.minHeight = minHeight || void 0; 13799 let positionValue; 13800 if (focalPoint) { 13801 positionValue = `$Math.round( 13802 focalPoint.x * 100 13803 )}% $Math.round(focalPoint.y * 100)}%`; 13804 if (isImageBackground && !hasParallax) { 13805 style2.backgroundPosition = positionValue; 13806 } 13807 if (isVideoBackground) { 13808 videoStyle.objectPosition = positionValue; 13809 } 13810 } 13811 const classes = clsx_default( 13812 dimRatioToClassV1(dimRatio), 13813 overlayColorClass, 13814 { 13815 "has-background-dim": dimRatio !== 0, 13816 "has-parallax": hasParallax, 13817 "is-repeated": isRepeated, 13818 "has-background-gradient": gradient || customGradient, 13819 [gradientClass]: !url && gradientClass, 13820 "has-custom-content-position": !isContentPositionCenter(contentPosition) 13821 }, 13822 getPositionClassName(contentPosition) 13823 ); 13824 return /* @__PURE__ */ (0, import_jsx_runtime209.jsxs)("div", { ...import_block_editor61.useBlockProps.save({ className: classes, style: style2 }), children: [ 13825 url && (gradient || customGradient) && dimRatio !== 0 && /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 13826 "span", 13827 { 13828 "aria-hidden": "true", 13829 className: clsx_default( 13830 "wp-block-cover__gradient-background", 13831 gradientClass 13832 ), 13833 style: customGradient ? { background: customGradient } : void 0 13834 } 13835 ), 13836 isVideoBackground && url && /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 13837 "video", 13838 { 13839 className: "wp-block-cover__video-background", 13840 autoPlay: true, 13841 muted: true, 13842 loop: true, 13843 playsInline: true, 13844 src: url, 13845 style: videoStyle 13846 } 13847 ), 13848 /* @__PURE__ */ (0, import_jsx_runtime209.jsx)("div", { className: "wp-block-cover__inner-container", children: /* @__PURE__ */ (0, import_jsx_runtime209.jsx)(import_block_editor61.InnerBlocks.Content, {}) }) 13849 ] }); 13850 }, 13851 migrate: (0, import_compose12.compose)(migrateDimRatio, migrateTag) 13852 }; 13853 var v5 = { 13854 attributes: { 13855 ...blockAttributes2, 13856 minHeight: { 13857 type: "number" 13858 }, 13859 gradient: { 13860 type: "string" 13861 }, 13862 customGradient: { 13863 type: "string" 13864 } 13865 }, 13866 supports: { 13867 align: true 13868 }, 13869 save({ attributes: attributes3 }) { 13870 const { 13871 backgroundType, 13872 gradient, 13873 customGradient, 13874 customOverlayColor, 13875 dimRatio, 13876 focalPoint, 13877 hasParallax, 13878 overlayColor, 13879 url, 13880 minHeight 13881 } = attributes3; 13882 const overlayColorClass = (0, import_block_editor61.getColorClassName)( 13883 "background-color", 13884 overlayColor 13885 ); 13886 const gradientClass = (0, import_block_editor61.__experimentalGetGradientClass)(gradient); 13887 const style2 = backgroundType === IMAGE_BACKGROUND_TYPE ? backgroundImageStyles(url) : {}; 13888 if (!overlayColorClass) { 13889 style2.backgroundColor = customOverlayColor; 13890 } 13891 if (focalPoint && !hasParallax) { 13892 style2.backgroundPosition = `$Math.round( 13893 focalPoint.x * 100 13894 )}% $Math.round(focalPoint.y * 100)}%`; 13895 } 13896 if (customGradient && !url) { 13897 style2.background = customGradient; 13898 } 13899 style2.minHeight = minHeight || void 0; 13900 const classes = clsx_default( 13901 dimRatioToClassV1(dimRatio), 13902 overlayColorClass, 13903 { 13904 "has-background-dim": dimRatio !== 0, 13905 "has-parallax": hasParallax, 13906 "has-background-gradient": customGradient, 13907 [gradientClass]: !url && gradientClass 13908 } 13909 ); 13910 return /* @__PURE__ */ (0, import_jsx_runtime209.jsxs)("div", { className: classes, style: style2, children: [ 13911 url && (gradient || customGradient) && dimRatio !== 0 && /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 13912 "span", 13913 { 13914 "aria-hidden": "true", 13915 className: clsx_default( 13916 "wp-block-cover__gradient-background", 13917 gradientClass 13918 ), 13919 style: customGradient ? { background: customGradient } : void 0 13920 } 13921 ), 13922 VIDEO_BACKGROUND_TYPE === backgroundType && url && /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 13923 "video", 13924 { 13925 className: "wp-block-cover__video-background", 13926 autoPlay: true, 13927 muted: true, 13928 loop: true, 13929 src: url 13930 } 13931 ), 13932 /* @__PURE__ */ (0, import_jsx_runtime209.jsx)("div", { className: "wp-block-cover__inner-container", children: /* @__PURE__ */ (0, import_jsx_runtime209.jsx)(import_block_editor61.InnerBlocks.Content, {}) }) 13933 ] }); 13934 }, 13935 migrate: (0, import_compose12.compose)(migrateDimRatio, migrateTag) 13936 }; 13937 var v4 = { 13938 attributes: { 13939 ...blockAttributes2, 13940 minHeight: { 13941 type: "number" 13942 }, 13943 gradient: { 13944 type: "string" 13945 }, 13946 customGradient: { 13947 type: "string" 13948 } 13949 }, 13950 supports: { 13951 align: true 13952 }, 13953 save({ attributes: attributes3 }) { 13954 const { 13955 backgroundType, 13956 gradient, 13957 customGradient, 13958 customOverlayColor, 13959 dimRatio, 13960 focalPoint, 13961 hasParallax, 13962 overlayColor, 13963 url, 13964 minHeight 13965 } = attributes3; 13966 const overlayColorClass = (0, import_block_editor61.getColorClassName)( 13967 "background-color", 13968 overlayColor 13969 ); 13970 const gradientClass = (0, import_block_editor61.__experimentalGetGradientClass)(gradient); 13971 const style2 = backgroundType === IMAGE_BACKGROUND_TYPE ? backgroundImageStyles(url) : {}; 13972 if (!overlayColorClass) { 13973 style2.backgroundColor = customOverlayColor; 13974 } 13975 if (focalPoint && !hasParallax) { 13976 style2.backgroundPosition = `$focalPoint.x * 100}% $focalPoint.y * 100}%`; 13977 } 13978 if (customGradient && !url) { 13979 style2.background = customGradient; 13980 } 13981 style2.minHeight = minHeight || void 0; 13982 const classes = clsx_default( 13983 dimRatioToClassV1(dimRatio), 13984 overlayColorClass, 13985 { 13986 "has-background-dim": dimRatio !== 0, 13987 "has-parallax": hasParallax, 13988 "has-background-gradient": customGradient, 13989 [gradientClass]: !url && gradientClass 13990 } 13991 ); 13992 return /* @__PURE__ */ (0, import_jsx_runtime209.jsxs)("div", { className: classes, style: style2, children: [ 13993 url && (gradient || customGradient) && dimRatio !== 0 && /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 13994 "span", 13995 { 13996 "aria-hidden": "true", 13997 className: clsx_default( 13998 "wp-block-cover__gradient-background", 13999 gradientClass 14000 ), 14001 style: customGradient ? { background: customGradient } : void 0 14002 } 14003 ), 14004 VIDEO_BACKGROUND_TYPE === backgroundType && url && /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 14005 "video", 14006 { 14007 className: "wp-block-cover__video-background", 14008 autoPlay: true, 14009 muted: true, 14010 loop: true, 14011 src: url 14012 } 14013 ), 14014 /* @__PURE__ */ (0, import_jsx_runtime209.jsx)("div", { className: "wp-block-cover__inner-container", children: /* @__PURE__ */ (0, import_jsx_runtime209.jsx)(import_block_editor61.InnerBlocks.Content, {}) }) 14015 ] }); 14016 }, 14017 migrate: (0, import_compose12.compose)(migrateDimRatio, migrateTag) 14018 }; 14019 var v3 = { 14020 attributes: { 14021 ...blockAttributes2, 14022 title: { 14023 type: "string", 14024 source: "html", 14025 selector: "p" 14026 }, 14027 contentAlign: { 14028 type: "string", 14029 default: "center" 14030 } 14031 }, 14032 supports: { 14033 align: true 14034 }, 14035 save({ attributes: attributes3 }) { 14036 const { 14037 backgroundType, 14038 contentAlign, 14039 customOverlayColor, 14040 dimRatio, 14041 focalPoint, 14042 hasParallax, 14043 overlayColor, 14044 title, 14045 url 14046 } = attributes3; 14047 const overlayColorClass = (0, import_block_editor61.getColorClassName)( 14048 "background-color", 14049 overlayColor 14050 ); 14051 const style2 = backgroundType === IMAGE_BACKGROUND_TYPE ? backgroundImageStyles(url) : {}; 14052 if (!overlayColorClass) { 14053 style2.backgroundColor = customOverlayColor; 14054 } 14055 if (focalPoint && !hasParallax) { 14056 style2.backgroundPosition = `$focalPoint.x * 100}% $focalPoint.y * 100}%`; 14057 } 14058 const classes = clsx_default( 14059 dimRatioToClassV1(dimRatio), 14060 overlayColorClass, 14061 { 14062 "has-background-dim": dimRatio !== 0, 14063 "has-parallax": hasParallax, 14064 [`has-$contentAlign}-content`]: contentAlign !== "center" 14065 } 14066 ); 14067 return /* @__PURE__ */ (0, import_jsx_runtime209.jsxs)("div", { className: classes, style: style2, children: [ 14068 VIDEO_BACKGROUND_TYPE === backgroundType && url && /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 14069 "video", 14070 { 14071 className: "wp-block-cover__video-background", 14072 autoPlay: true, 14073 muted: true, 14074 loop: true, 14075 src: url 14076 } 14077 ), 14078 !import_block_editor61.RichText.isEmpty(title) && /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 14079 import_block_editor61.RichText.Content, 14080 { 14081 tagName: "p", 14082 className: "wp-block-cover-text", 14083 value: title 14084 } 14085 ) 14086 ] }); 14087 }, 14088 migrate(attributes3) { 14089 const newAttribs = { 14090 ...attributes3, 14091 dimRatio: !attributes3.url ? 100 : attributes3.dimRatio, 14092 tagName: !attributes3.tagName ? "div" : attributes3.tagName 14093 }; 14094 const { title, contentAlign, ...restAttributes } = newAttribs; 14095 return [ 14096 restAttributes, 14097 [ 14098 (0, import_blocks20.createBlock)("core/paragraph", { 14099 content: attributes3.title, 14100 style: { 14101 typography: { 14102 textAlign: attributes3.contentAlign 14103 } 14104 }, 14105 fontSize: "large", 14106 placeholder: (0, import_i18n46.__)("Write title\u2026") 14107 }) 14108 ] 14109 ]; 14110 } 14111 }; 14112 var v2 = { 14113 attributes: { 14114 ...blockAttributes2, 14115 title: { 14116 type: "string", 14117 source: "html", 14118 selector: "p" 14119 }, 14120 contentAlign: { 14121 type: "string", 14122 default: "center" 14123 }, 14124 align: { 14125 type: "string" 14126 } 14127 }, 14128 supports: { 14129 className: false 14130 }, 14131 save({ attributes: attributes3 }) { 14132 const { 14133 url, 14134 title, 14135 hasParallax, 14136 dimRatio, 14137 align, 14138 contentAlign, 14139 overlayColor, 14140 customOverlayColor 14141 } = attributes3; 14142 const overlayColorClass = (0, import_block_editor61.getColorClassName)( 14143 "background-color", 14144 overlayColor 14145 ); 14146 const style2 = backgroundImageStyles(url); 14147 if (!overlayColorClass) { 14148 style2.backgroundColor = customOverlayColor; 14149 } 14150 const classes = clsx_default( 14151 "wp-block-cover-image", 14152 dimRatioToClassV1(dimRatio), 14153 overlayColorClass, 14154 { 14155 "has-background-dim": dimRatio !== 0, 14156 "has-parallax": hasParallax, 14157 [`has-$contentAlign}-content`]: contentAlign !== "center" 14158 }, 14159 align ? `align$align}` : null 14160 ); 14161 return /* @__PURE__ */ (0, import_jsx_runtime209.jsx)("div", { className: classes, style: style2, children: !import_block_editor61.RichText.isEmpty(title) && /* @__PURE__ */ (0, import_jsx_runtime209.jsx)( 14162 import_block_editor61.RichText.Content, 14163 { 14164 tagName: "p", 14165 className: "wp-block-cover-image-text", 14166 value: title 14167 } 14168 ) }); 14169 }, 14170 migrate(attributes3) { 14171 const newAttribs = { 14172 ...attributes3, 14173 dimRatio: !attributes3.url ? 100 : attributes3.dimRatio, 14174 tagName: !attributes3.tagName ? "div" : attributes3.tagName 14175 }; 14176 const { title, contentAlign, align, ...restAttributes } = newAttribs; 14177 return [ 14178 restAttributes, 14179 [ 14180 (0, import_blocks20.createBlock)("core/paragraph", { 14181 content: attributes3.title, 14182 style: { 14183 typography: { 14184 textAlign: attributes3.contentAlign 14185 } 14186 }, 14187 fontSize: "large", 14188 placeholder: (0, import_i18n46.__)("Write title\u2026") 14189 }) 14190 ] 14191 ]; 14192 } 14193 }; 14194 var v17 = { 14195 attributes: { 14196 ...blockAttributes2, 14197 title: { 14198 type: "string", 14199 source: "html", 14200 selector: "h2" 14201 }, 14202 align: { 14203 type: "string" 14204 }, 14205 contentAlign: { 14206 type: "string", 14207 default: "center" 14208 } 14209 }, 14210 supports: { 14211 className: false 14212 }, 14213 save({ attributes: attributes3 }) { 14214 const { url, title, hasParallax, dimRatio, align } = attributes3; 14215 const style2 = backgroundImageStyles(url); 14216 const classes = clsx_default( 14217 "wp-block-cover-image", 14218 dimRatioToClassV1(dimRatio), 14219 { 14220 "has-background-dim": dimRatio !== 0, 14221 "has-parallax": hasParallax 14222 }, 14223 align ? `align$align}` : null 14224 ); 14225 return /* @__PURE__ */ (0, import_jsx_runtime209.jsx)("section", { className: classes, style: style2, children: /* @__PURE__ */ (0, import_jsx_runtime209.jsx)(import_block_editor61.RichText.Content, { tagName: "h2", value: title }) }); 14226 }, 14227 migrate(attributes3) { 14228 const newAttribs = { 14229 ...attributes3, 14230 dimRatio: !attributes3.url ? 100 : attributes3.dimRatio, 14231 tagName: !attributes3.tagName ? "div" : attributes3.tagName 14232 }; 14233 const { title, contentAlign, align, ...restAttributes } = newAttribs; 14234 return [ 14235 restAttributes, 14236 [ 14237 (0, import_blocks20.createBlock)("core/paragraph", { 14238 content: attributes3.title, 14239 style: { 14240 typography: { 14241 textAlign: attributes3.contentAlign 14242 } 14243 }, 14244 fontSize: "large", 14245 placeholder: (0, import_i18n46.__)("Write title\u2026") 14246 }) 14247 ] 14248 ]; 14249 } 14250 }; 14251 var deprecated_default11 = [v142, v132, v122, v112, v102, v9, v8, v7, v6, v5, v4, v3, v2, v17]; 14252 14253 // packages/block-library/build-module/cover/edit/index.js 14254 var import_core_data16 = __toESM(require_core_data()); 14255 var import_element25 = __toESM(require_element()); 14256 var import_components34 = __toESM(require_components()); 14257 var import_compose15 = __toESM(require_compose()); 14258 var import_block_editor67 = __toESM(require_block_editor()); 14259 var import_i18n52 = __toESM(require_i18n()); 14260 var import_data28 = __toESM(require_data()); 14261 var import_blob6 = __toESM(require_blob()); 14262 var import_notices4 = __toESM(require_notices()); 14263 14264 // packages/block-library/build-module/cover/edit/inspector-controls.js 14265 var import_element21 = __toESM(require_element()); 14266 var import_components31 = __toESM(require_components()); 14267 var import_compose14 = __toESM(require_compose()); 14268 var import_block_editor63 = __toESM(require_block_editor()); 14269 var import_i18n48 = __toESM(require_i18n()); 14270 var import_data27 = __toESM(require_data()); 14271 var import_core_data15 = __toESM(require_core_data()); 14272 14273 // packages/block-library/build-module/cover/constants.js 14274 var DEFAULT_MEDIA_SIZE_SLUG = "full"; 14275 14276 // packages/block-library/build-module/utils/poster-image.js 14277 var import_block_editor62 = __toESM(require_block_editor()); 14278 var import_notices3 = __toESM(require_notices()); 14279 var import_components30 = __toESM(require_components()); 14280 var import_blob5 = __toESM(require_blob()); 14281 var import_i18n47 = __toESM(require_i18n()); 14282 var import_element20 = __toESM(require_element()); 14283 var import_compose13 = __toESM(require_compose()); 14284 var import_data26 = __toESM(require_data()); 14285 var import_jsx_runtime210 = __toESM(require_jsx_runtime()); 14286 var POSTER_IMAGE_ALLOWED_MEDIA_TYPES = ["image"]; 14287 function PosterImage({ poster, onChange }) { 14288 const posterButtonRef = (0, import_element20.useRef)(); 14289 const [isLoading, setIsLoading] = (0, import_element20.useState)(false); 14290 const descriptionId = (0, import_compose13.useInstanceId)( 14291 PosterImage, 14292 "block-library-poster-image-description" 14293 ); 14294 const { getSettings: getSettings2 } = (0, import_data26.useSelect)(import_block_editor62.store); 14295 const { createErrorNotice } = (0, import_data26.useDispatch)(import_notices3.store); 14296 const onDropFiles = (filesList) => { 14297 getSettings2().mediaUpload({ 14298 allowedTypes: POSTER_IMAGE_ALLOWED_MEDIA_TYPES, 14299 filesList, 14300 onFileChange: ([image]) => { 14301 if ((0, import_blob5.isBlobURL)(image?.url)) { 14302 setIsLoading(true); 14303 return; 14304 } 14305 if (image) { 14306 onChange(image); 14307 } 14308 setIsLoading(false); 14309 }, 14310 onError: (message) => { 14311 createErrorNotice(message, { 14312 id: "poster-image-upload-notice", 14313 type: "snackbar" 14314 }); 14315 setIsLoading(false); 14316 }, 14317 multiple: false 14318 }); 14319 }; 14320 const getPosterButtonContent = () => { 14321 if (!poster && isLoading) { 14322 return /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(import_components30.Spinner, {}); 14323 } 14324 return !poster ? (0, import_i18n47.__)("Set poster image") : (0, import_i18n47.__)("Replace"); 14325 }; 14326 return /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(import_block_editor62.MediaUploadCheck, { children: /* @__PURE__ */ (0, import_jsx_runtime210.jsxs)( 14327 import_components30.__experimentalToolsPanelItem, 14328 { 14329 label: (0, import_i18n47.__)("Poster image"), 14330 isShownByDefault: true, 14331 hasValue: () => !!poster, 14332 onDeselect: () => onChange(void 0), 14333 children: [ 14334 /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(import_components30.BaseControl.VisualLabel, { children: (0, import_i18n47.__)("Poster image") }), 14335 /* @__PURE__ */ (0, import_jsx_runtime210.jsx)( 14336 import_block_editor62.MediaUpload, 14337 { 14338 title: (0, import_i18n47.__)("Select poster image"), 14339 onSelect: onChange, 14340 allowedTypes: POSTER_IMAGE_ALLOWED_MEDIA_TYPES, 14341 render: ({ open }) => /* @__PURE__ */ (0, import_jsx_runtime210.jsxs)("div", { className: "block-library-poster-image__container", children: [ 14342 poster && /* @__PURE__ */ (0, import_jsx_runtime210.jsxs)( 14343 import_components30.Button, 14344 { 14345 __next40pxDefaultSize: true, 14346 onClick: open, 14347 "aria-haspopup": "dialog", 14348 "aria-label": (0, import_i18n47.__)( 14349 "Edit or replace the poster image." 14350 ), 14351 className: "block-library-poster-image__preview", 14352 disabled: isLoading, 14353 accessibleWhenDisabled: true, 14354 children: [ 14355 /* @__PURE__ */ (0, import_jsx_runtime210.jsx)( 14356 "img", 14357 { 14358 src: poster, 14359 alt: (0, import_i18n47.__)("Poster image preview"), 14360 className: "block-library-poster-image__preview-image" 14361 } 14362 ), 14363 isLoading && /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(import_components30.Spinner, {}) 14364 ] 14365 } 14366 ), 14367 /* @__PURE__ */ (0, import_jsx_runtime210.jsxs)( 14368 import_components30.__experimentalHStack, 14369 { 14370 className: clsx_default( 14371 "block-library-poster-image__actions", 14372 { 14373 "block-library-poster-image__actions-select": !poster 14374 } 14375 ), 14376 children: [ 14377 /* @__PURE__ */ (0, import_jsx_runtime210.jsx)( 14378 import_components30.Button, 14379 { 14380 __next40pxDefaultSize: true, 14381 onClick: open, 14382 ref: posterButtonRef, 14383 className: "block-library-poster-image__action", 14384 "aria-describedby": descriptionId, 14385 "aria-haspopup": "dialog", 14386 variant: !poster ? "secondary" : void 0, 14387 disabled: isLoading, 14388 accessibleWhenDisabled: true, 14389 children: getPosterButtonContent() 14390 } 14391 ), 14392 /* @__PURE__ */ (0, import_jsx_runtime210.jsx)("p", { id: descriptionId, hidden: true, children: poster ? (0, import_i18n47.sprintf)( 14393 /* translators: %s: poster image URL. */ 14394 (0, import_i18n47.__)( 14395 "The current poster image url is %s." 14396 ), 14397 poster 14398 ) : (0, import_i18n47.__)( 14399 "There is no poster image currently selected." 14400 ) }), 14401 !!poster && /* @__PURE__ */ (0, import_jsx_runtime210.jsx)( 14402 import_components30.Button, 14403 { 14404 __next40pxDefaultSize: true, 14405 onClick: () => { 14406 onChange(void 0); 14407 posterButtonRef.current.focus(); 14408 }, 14409 className: "block-library-poster-image__action", 14410 disabled: isLoading, 14411 accessibleWhenDisabled: true, 14412 children: (0, import_i18n47.__)("Remove") 14413 } 14414 ) 14415 ] 14416 } 14417 ), 14418 /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(import_components30.DropZone, { onFilesDrop: onDropFiles }) 14419 ] }) 14420 } 14421 ) 14422 ] 14423 } 14424 ) }); 14425 } 14426 var poster_image_default = PosterImage; 14427 14428 // packages/block-library/build-module/cover/edit/inspector-controls.js 14429 var import_jsx_runtime211 = __toESM(require_jsx_runtime()); 14430 var { cleanEmptyObject: cleanEmptyObject2, ResolutionTool, HTMLElementControl: HTMLElementControl3 } = unlock( 14431 import_block_editor63.privateApis 14432 ); 14433 function CoverHeightInput({ 14434 onChange, 14435 onUnitChange, 14436 unit = "px", 14437 value = "" 14438 }) { 14439 const instanceId = (0, import_compose14.useInstanceId)(import_components31.__experimentalUnitControl); 14440 const inputId = `block-cover-height-input-$instanceId}`; 14441 const isPx = unit === "px"; 14442 const [availableUnits] = (0, import_block_editor63.useSettings)("spacing.units"); 14443 const units = (0, import_components31.__experimentalUseCustomUnits)({ 14444 availableUnits: availableUnits || ["px", "em", "rem", "vw", "vh"], 14445 defaultValues: { px: 430, "%": 20, em: 20, rem: 20, vw: 20, vh: 50 } 14446 }); 14447 const handleOnChange = (unprocessedValue) => { 14448 const inputValue = unprocessedValue !== "" ? parseFloat(unprocessedValue) : void 0; 14449 if (isNaN(inputValue) && inputValue !== void 0) { 14450 return; 14451 } 14452 onChange(inputValue); 14453 }; 14454 const computedValue = (0, import_element21.useMemo)(() => { 14455 const [parsedQuantity] = (0, import_components31.__experimentalParseQuantityAndUnitFromRawValue)(value); 14456 return [parsedQuantity, unit].join(""); 14457 }, [unit, value]); 14458 const min = isPx ? COVER_MIN_HEIGHT : 0; 14459 return /* @__PURE__ */ (0, import_jsx_runtime211.jsx)( 14460 import_components31.__experimentalUnitControl, 14461 { 14462 __next40pxDefaultSize: true, 14463 label: (0, import_i18n48.__)("Minimum height"), 14464 id: inputId, 14465 isResetValueOnUnitChange: true, 14466 min, 14467 onChange: handleOnChange, 14468 onUnitChange, 14469 units, 14470 value: computedValue 14471 } 14472 ); 14473 } 14474 function CoverInspectorControls({ 14475 attributes: attributes3, 14476 setAttributes, 14477 clientId, 14478 setOverlayColor, 14479 coverRef, 14480 currentSettings, 14481 updateDimRatio, 14482 featuredImage 14483 }) { 14484 const { 14485 useFeaturedImage, 14486 id, 14487 dimRatio, 14488 focalPoint, 14489 hasParallax, 14490 isRepeated, 14491 minHeight, 14492 minHeightUnit, 14493 alt, 14494 tagName, 14495 poster 14496 } = attributes3; 14497 const { 14498 isVideoBackground, 14499 isImageBackground, 14500 mediaElement, 14501 url, 14502 overlayColor 14503 } = currentSettings; 14504 const sizeSlug = attributes3.sizeSlug || DEFAULT_MEDIA_SIZE_SLUG; 14505 const { gradientValue, setGradient } = (0, import_block_editor63.__experimentalUseGradient)(); 14506 const { getSettings: getSettings2 } = (0, import_data27.useSelect)(import_block_editor63.store); 14507 const imageSizes = getSettings2()?.imageSizes; 14508 const image = (0, import_data27.useSelect)( 14509 (select9) => id && isImageBackground ? select9(import_core_data15.store).getEntityRecord( 14510 "postType", 14511 "attachment", 14512 id, 14513 { context: "view" } 14514 ) : null, 14515 [id, isImageBackground] 14516 ); 14517 const currentBackgroundImage = useFeaturedImage ? featuredImage : image; 14518 function updateImage(newSizeSlug) { 14519 const newUrl = currentBackgroundImage?.media_details?.sizes?.[newSizeSlug]?.source_url; 14520 if (!newUrl) { 14521 return null; 14522 } 14523 setAttributes({ 14524 url: newUrl, 14525 sizeSlug: newSizeSlug 14526 }); 14527 } 14528 const imageSizeOptions = imageSizes?.filter( 14529 ({ slug }) => currentBackgroundImage?.media_details?.sizes?.[slug]?.source_url 14530 )?.map(({ name: name117, slug }) => ({ value: slug, label: name117 })); 14531 const toggleParallax = () => { 14532 setAttributes({ 14533 hasParallax: !hasParallax, 14534 ...!hasParallax ? { focalPoint: void 0 } : {} 14535 }); 14536 }; 14537 const toggleIsRepeated = () => { 14538 setAttributes({ 14539 isRepeated: !isRepeated 14540 }); 14541 }; 14542 const showFocalPointPicker = isVideoBackground || isImageBackground && (!hasParallax || isRepeated); 14543 const imperativeFocalPointPreview = (value) => { 14544 const [styleOfRef, property] = mediaElement.current ? [mediaElement.current.style, "objectPosition"] : [coverRef.current.style, "backgroundPosition"]; 14545 styleOfRef[property] = mediaPosition(value); 14546 }; 14547 const colorGradientSettings = (0, import_block_editor63.__experimentalUseMultipleOriginColorsAndGradients)(); 14548 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 14549 return /* @__PURE__ */ (0, import_jsx_runtime211.jsxs)(import_jsx_runtime211.Fragment, { children: [ 14550 /* @__PURE__ */ (0, import_jsx_runtime211.jsx)(import_block_editor63.InspectorControls, { children: (!!url || useFeaturedImage) && /* @__PURE__ */ (0, import_jsx_runtime211.jsxs)( 14551 import_components31.__experimentalToolsPanel, 14552 { 14553 label: (0, import_i18n48.__)("Settings"), 14554 resetAll: () => { 14555 setAttributes({ 14556 hasParallax: false, 14557 focalPoint: void 0, 14558 isRepeated: false, 14559 alt: "", 14560 poster: void 0 14561 }); 14562 updateImage(DEFAULT_MEDIA_SIZE_SLUG); 14563 }, 14564 dropdownMenuProps, 14565 children: [ 14566 isImageBackground && /* @__PURE__ */ (0, import_jsx_runtime211.jsxs)(import_jsx_runtime211.Fragment, { children: [ 14567 /* @__PURE__ */ (0, import_jsx_runtime211.jsx)( 14568 import_components31.__experimentalToolsPanelItem, 14569 { 14570 label: (0, import_i18n48.__)("Fixed background"), 14571 isShownByDefault: true, 14572 hasValue: () => !!hasParallax, 14573 onDeselect: () => setAttributes({ 14574 hasParallax: false, 14575 focalPoint: void 0 14576 }), 14577 children: /* @__PURE__ */ (0, import_jsx_runtime211.jsx)( 14578 import_components31.ToggleControl, 14579 { 14580 label: (0, import_i18n48.__)("Fixed background"), 14581 checked: !!hasParallax, 14582 onChange: toggleParallax 14583 } 14584 ) 14585 } 14586 ), 14587 /* @__PURE__ */ (0, import_jsx_runtime211.jsx)( 14588 import_components31.__experimentalToolsPanelItem, 14589 { 14590 label: (0, import_i18n48.__)("Repeated background"), 14591 isShownByDefault: true, 14592 hasValue: () => isRepeated, 14593 onDeselect: () => setAttributes({ 14594 isRepeated: false 14595 }), 14596 children: /* @__PURE__ */ (0, import_jsx_runtime211.jsx)( 14597 import_components31.ToggleControl, 14598 { 14599 label: (0, import_i18n48.__)("Repeated background"), 14600 checked: isRepeated, 14601 onChange: toggleIsRepeated 14602 } 14603 ) 14604 } 14605 ) 14606 ] }), 14607 showFocalPointPicker && /* @__PURE__ */ (0, import_jsx_runtime211.jsx)( 14608 import_components31.__experimentalToolsPanelItem, 14609 { 14610 label: (0, import_i18n48.__)("Focal point"), 14611 isShownByDefault: true, 14612 hasValue: () => !!focalPoint, 14613 onDeselect: () => setAttributes({ 14614 focalPoint: void 0 14615 }), 14616 children: /* @__PURE__ */ (0, import_jsx_runtime211.jsx)( 14617 import_components31.FocalPointPicker, 14618 { 14619 label: (0, import_i18n48.__)("Focal point"), 14620 url, 14621 value: focalPoint, 14622 onDragStart: imperativeFocalPointPreview, 14623 onDrag: imperativeFocalPointPreview, 14624 onChange: (newFocalPoint) => setAttributes({ 14625 focalPoint: newFocalPoint 14626 }) 14627 } 14628 ) 14629 } 14630 ), 14631 isVideoBackground && /* @__PURE__ */ (0, import_jsx_runtime211.jsx)( 14632 poster_image_default, 14633 { 14634 poster, 14635 onChange: (posterImage) => setAttributes({ 14636 poster: posterImage?.url 14637 }) 14638 } 14639 ), 14640 !useFeaturedImage && url && !isVideoBackground && /* @__PURE__ */ (0, import_jsx_runtime211.jsx)( 14641 import_components31.__experimentalToolsPanelItem, 14642 { 14643 label: (0, import_i18n48.__)("Alternative text"), 14644 isShownByDefault: true, 14645 hasValue: () => !!alt, 14646 onDeselect: () => setAttributes({ alt: "" }), 14647 children: /* @__PURE__ */ (0, import_jsx_runtime211.jsx)( 14648 import_components31.TextareaControl, 14649 { 14650 label: (0, import_i18n48.__)("Alternative text"), 14651 value: alt, 14652 onChange: (newAlt) => setAttributes({ alt: newAlt }), 14653 help: /* @__PURE__ */ (0, import_jsx_runtime211.jsxs)(import_jsx_runtime211.Fragment, { children: [ 14654 /* @__PURE__ */ (0, import_jsx_runtime211.jsx)( 14655 import_components31.ExternalLink, 14656 { 14657 href: ( 14658 // translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations. 14659 (0, import_i18n48.__)( 14660 "https://www.w3.org/WAI/tutorials/images/decision-tree/" 14661 ) 14662 ), 14663 children: (0, import_i18n48.__)( 14664 "Describe the purpose of the image." 14665 ) 14666 } 14667 ), 14668 /* @__PURE__ */ (0, import_jsx_runtime211.jsx)("br", {}), 14669 (0, import_i18n48.__)( 14670 "Leave empty if decorative." 14671 ) 14672 ] }) 14673 } 14674 ) 14675 } 14676 ), 14677 !!imageSizeOptions?.length && /* @__PURE__ */ (0, import_jsx_runtime211.jsx)( 14678 ResolutionTool, 14679 { 14680 value: sizeSlug, 14681 onChange: updateImage, 14682 options: imageSizeOptions, 14683 defaultValue: DEFAULT_MEDIA_SIZE_SLUG 14684 } 14685 ) 14686 ] 14687 } 14688 ) }), 14689 colorGradientSettings.hasColorsOrGradients && /* @__PURE__ */ (0, import_jsx_runtime211.jsxs)(import_block_editor63.InspectorControls, { group: "color", children: [ 14690 /* @__PURE__ */ (0, import_jsx_runtime211.jsx)( 14691 import_block_editor63.__experimentalColorGradientSettingsDropdown, 14692 { 14693 __experimentalIsRenderedInSidebar: true, 14694 settings: [ 14695 { 14696 colorValue: overlayColor.color, 14697 gradientValue, 14698 label: (0, import_i18n48.__)("Overlay"), 14699 onColorChange: setOverlayColor, 14700 onGradientChange: setGradient, 14701 isShownByDefault: true, 14702 resetAllFilter: () => ({ 14703 overlayColor: void 0, 14704 customOverlayColor: void 0, 14705 gradient: void 0, 14706 customGradient: void 0 14707 }), 14708 clearable: true 14709 } 14710 ], 14711 panelId: clientId, 14712 ...colorGradientSettings 14713 } 14714 ), 14715 /* @__PURE__ */ (0, import_jsx_runtime211.jsx)( 14716 import_components31.__experimentalToolsPanelItem, 14717 { 14718 hasValue: () => { 14719 return dimRatio === void 0 ? false : dimRatio !== (url ? 50 : 100); 14720 }, 14721 label: (0, import_i18n48.__)("Overlay opacity"), 14722 onDeselect: () => updateDimRatio(url ? 50 : 100), 14723 resetAllFilter: () => ({ 14724 dimRatio: url ? 50 : 100 14725 }), 14726 isShownByDefault: true, 14727 panelId: clientId, 14728 children: /* @__PURE__ */ (0, import_jsx_runtime211.jsx)( 14729 import_components31.RangeControl, 14730 { 14731 label: (0, import_i18n48.__)("Overlay opacity"), 14732 value: dimRatio, 14733 onChange: (newDimRatio) => updateDimRatio(newDimRatio), 14734 min: 0, 14735 max: 100, 14736 step: 10, 14737 required: true, 14738 __next40pxDefaultSize: true 14739 } 14740 ) 14741 } 14742 ) 14743 ] }), 14744 /* @__PURE__ */ (0, import_jsx_runtime211.jsx)(import_block_editor63.InspectorControls, { group: "dimensions", children: /* @__PURE__ */ (0, import_jsx_runtime211.jsx)( 14745 import_components31.__experimentalToolsPanelItem, 14746 { 14747 className: "single-column", 14748 hasValue: () => !!minHeight, 14749 label: (0, import_i18n48.__)("Minimum height"), 14750 onDeselect: () => setAttributes({ 14751 minHeight: void 0, 14752 minHeightUnit: void 0 14753 }), 14754 resetAllFilter: () => ({ 14755 minHeight: void 0, 14756 minHeightUnit: void 0 14757 }), 14758 isShownByDefault: true, 14759 panelId: clientId, 14760 children: /* @__PURE__ */ (0, import_jsx_runtime211.jsx)( 14761 CoverHeightInput, 14762 { 14763 value: attributes3?.style?.dimensions?.aspectRatio ? "" : minHeight, 14764 unit: minHeightUnit, 14765 onChange: (newMinHeight) => setAttributes({ 14766 minHeight: newMinHeight, 14767 style: cleanEmptyObject2({ 14768 ...attributes3?.style, 14769 dimensions: { 14770 ...attributes3?.style?.dimensions, 14771 aspectRatio: void 0 14772 // Reset aspect ratio when minHeight is set. 14773 } 14774 }) 14775 }), 14776 onUnitChange: (nextUnit) => setAttributes({ 14777 minHeightUnit: nextUnit 14778 }) 14779 } 14780 ) 14781 } 14782 ) }), 14783 /* @__PURE__ */ (0, import_jsx_runtime211.jsx)(import_block_editor63.InspectorControls, { group: "advanced", children: /* @__PURE__ */ (0, import_jsx_runtime211.jsx)( 14784 HTMLElementControl3, 14785 { 14786 tagName, 14787 onChange: (value) => setAttributes({ tagName: value }), 14788 clientId, 14789 options: [ 14790 { label: (0, import_i18n48.__)("Default (<div>)"), value: "div" }, 14791 { label: "<header>", value: "header" }, 14792 { label: "<main>", value: "main" }, 14793 { label: "<section>", value: "section" }, 14794 { label: "<article>", value: "article" }, 14795 { label: "<aside>", value: "aside" }, 14796 { label: "<footer>", value: "footer" } 14797 ] 14798 } 14799 ) }) 14800 ] }); 14801 } 14802 14803 // packages/block-library/build-module/cover/edit/block-controls.js 14804 var import_element23 = __toESM(require_element()); 14805 var import_block_editor64 = __toESM(require_block_editor()); 14806 var import_i18n50 = __toESM(require_i18n()); 14807 var import_components33 = __toESM(require_components()); 14808 14809 // packages/block-library/build-module/cover/edit/embed-video-url-input.js 14810 var import_element22 = __toESM(require_element()); 14811 var import_components32 = __toESM(require_components()); 14812 var import_i18n49 = __toESM(require_i18n()); 14813 14814 // packages/block-library/build-module/cover/embed-video-utils.js 14815 var import_blocks21 = __toESM(require_blocks()); 14816 var DEFAULT_EMBED_BLOCK2 = "core/embed"; 14817 var VIDEO_PROVIDERS = [ 14818 "youtube", 14819 "vimeo", 14820 "videopress", 14821 "animoto", 14822 "tiktok", 14823 "wordpress-tv" 14824 ]; 14825 function isValidVideoEmbedUrl(url) { 14826 if (!url) { 14827 return false; 14828 } 14829 const embedBlock = findVideoEmbedProvider(url); 14830 return embedBlock !== null; 14831 } 14832 function findVideoEmbedProvider(url) { 14833 const embedVariations = (0, import_blocks21.getBlockVariations)(DEFAULT_EMBED_BLOCK2); 14834 if (!embedVariations) { 14835 return null; 14836 } 14837 const matchingVariation = embedVariations.find( 14838 ({ patterns }) => matchesPatterns(url, patterns) 14839 ); 14840 if (!matchingVariation || !VIDEO_PROVIDERS.includes(matchingVariation.name)) { 14841 return null; 14842 } 14843 return matchingVariation; 14844 } 14845 function getIframeSrc(html) { 14846 if (!html) { 14847 return null; 14848 } 14849 const srcMatch = html.match(/src=["']([^"']+)["']/); 14850 return srcMatch ? srcMatch[1] : null; 14851 } 14852 function detectProviderFromSrc(src) { 14853 if (!src) { 14854 return null; 14855 } 14856 const lowerSrc = src.toLowerCase(); 14857 if (lowerSrc.includes("youtube.com") || lowerSrc.includes("youtu.be")) { 14858 return "youtube"; 14859 } 14860 if (lowerSrc.includes("vimeo.com")) { 14861 return "vimeo"; 14862 } 14863 if (lowerSrc.includes("videopress.com")) { 14864 return "videopress"; 14865 } 14866 if (lowerSrc.includes("animoto.com")) { 14867 return "animoto"; 14868 } 14869 if (lowerSrc.includes("tiktok.com")) { 14870 return "tiktok"; 14871 } 14872 if (lowerSrc.includes("wordpress.tv")) { 14873 return "wordpress-tv"; 14874 } 14875 return null; 14876 } 14877 function getBackgroundVideoSrc(src) { 14878 if (!src) { 14879 return src; 14880 } 14881 try { 14882 const url = new URL(src); 14883 const provider = detectProviderFromSrc(src); 14884 switch (provider) { 14885 case "youtube": 14886 url.searchParams.set("autoplay", "1"); 14887 url.searchParams.set("mute", "1"); 14888 url.searchParams.set("loop", "1"); 14889 url.searchParams.set("controls", "0"); 14890 url.searchParams.set("showinfo", "0"); 14891 url.searchParams.set("modestbranding", "1"); 14892 url.searchParams.set("playsinline", "1"); 14893 url.searchParams.set("rel", "0"); 14894 const videoId = url.pathname.split("/").pop(); 14895 if (videoId) { 14896 url.searchParams.set("playlist", videoId); 14897 } 14898 break; 14899 case "vimeo": 14900 url.searchParams.set("autoplay", "1"); 14901 url.searchParams.set("muted", "1"); 14902 url.searchParams.set("loop", "1"); 14903 url.searchParams.set("background", "1"); 14904 url.searchParams.set("controls", "0"); 14905 break; 14906 case "videopress": 14907 case "wordpress-tv": 14908 url.searchParams.set("autoplay", "1"); 14909 url.searchParams.set("loop", "1"); 14910 url.searchParams.set("muted", "1"); 14911 break; 14912 default: 14913 url.searchParams.set("autoplay", "1"); 14914 url.searchParams.set("muted", "1"); 14915 url.searchParams.set("loop", "1"); 14916 break; 14917 } 14918 return url.toString(); 14919 } catch (error) { 14920 return src; 14921 } 14922 } 14923 14924 // packages/block-library/build-module/cover/edit/embed-video-url-input.js 14925 var import_jsx_runtime212 = __toESM(require_jsx_runtime()); 14926 function EmbedVideoUrlInput({ onSubmit, onClose }) { 14927 const [url, setUrl] = (0, import_element22.useState)(""); 14928 const [error, setError] = (0, import_element22.useState)(""); 14929 const handleConfirm = () => { 14930 if (!url) { 14931 setError((0, import_i18n49.__)("Please enter a URL.")); 14932 return; 14933 } 14934 if (!isValidVideoEmbedUrl(url)) { 14935 setError( 14936 (0, import_i18n49.__)( 14937 "This URL is not supported. Please enter a valid video link from a supported provider." 14938 ) 14939 ); 14940 return; 14941 } 14942 onSubmit(url); 14943 onClose(); 14944 }; 14945 return /* @__PURE__ */ (0, import_jsx_runtime212.jsx)( 14946 import_components32.__experimentalConfirmDialog, 14947 { 14948 isOpen: true, 14949 onConfirm: handleConfirm, 14950 onCancel: onClose, 14951 confirmButtonText: (0, import_i18n49.__)("Add video"), 14952 size: "medium", 14953 children: /* @__PURE__ */ (0, import_jsx_runtime212.jsxs)(import_components32.__experimentalVStack, { spacing: 4, children: [ 14954 error && /* @__PURE__ */ (0, import_jsx_runtime212.jsx)(import_components32.Notice, { status: "error", isDismissible: false, children: error }), 14955 /* @__PURE__ */ (0, import_jsx_runtime212.jsx)( 14956 import_components32.TextControl, 14957 { 14958 __next40pxDefaultSize: true, 14959 label: (0, import_i18n49.__)("Video URL"), 14960 value: url, 14961 onChange: (value) => { 14962 setUrl(value); 14963 setError(""); 14964 }, 14965 placeholder: (0, import_i18n49.__)( 14966 "Enter YouTube, Vimeo, or other video URL" 14967 ), 14968 help: (0, import_i18n49.__)( 14969 "Add a background video to the cover block that will autoplay in a loop." 14970 ) 14971 } 14972 ) 14973 ] }) 14974 } 14975 ); 14976 } 14977 14978 // packages/block-library/build-module/cover/edit/block-controls.js 14979 var import_jsx_runtime213 = __toESM(require_jsx_runtime()); 14980 var { cleanEmptyObject: cleanEmptyObject3 } = unlock(import_block_editor64.privateApis); 14981 function CoverBlockControls({ 14982 attributes: attributes3, 14983 setAttributes, 14984 onSelectMedia, 14985 currentSettings, 14986 toggleUseFeaturedImage, 14987 onClearMedia, 14988 onSelectEmbedUrl, 14989 blockEditingMode 14990 }) { 14991 const { contentPosition, id, useFeaturedImage, minHeight, minHeightUnit } = attributes3; 14992 const { hasInnerBlocks, url } = currentSettings; 14993 const [prevMinHeightValue, setPrevMinHeightValue] = (0, import_element23.useState)(minHeight); 14994 const [prevMinHeightUnit, setPrevMinHeightUnit] = (0, import_element23.useState)(minHeightUnit); 14995 const [isEmbedUrlInputOpen, setIsEmbedUrlInputOpen] = (0, import_element23.useState)(false); 14996 const isMinFullHeight = minHeightUnit === "vh" && minHeight === 100 && !attributes3?.style?.dimensions?.aspectRatio; 14997 const isContentOnlyMode = blockEditingMode === "contentOnly"; 14998 const toggleMinFullHeight = () => { 14999 if (isMinFullHeight) { 15000 if (prevMinHeightUnit === "vh" && prevMinHeightValue === 100) { 15001 return setAttributes({ 15002 minHeight: void 0, 15003 minHeightUnit: void 0 15004 }); 15005 } 15006 return setAttributes({ 15007 minHeight: prevMinHeightValue, 15008 minHeightUnit: prevMinHeightUnit 15009 }); 15010 } 15011 setPrevMinHeightValue(minHeight); 15012 setPrevMinHeightUnit(minHeightUnit); 15013 return setAttributes({ 15014 minHeight: 100, 15015 minHeightUnit: "vh", 15016 style: cleanEmptyObject3({ 15017 ...attributes3?.style, 15018 dimensions: { 15019 ...attributes3?.style?.dimensions, 15020 aspectRatio: void 0 15021 // Reset aspect ratio when minHeight is set. 15022 } 15023 }) 15024 }); 15025 }; 15026 return /* @__PURE__ */ (0, import_jsx_runtime213.jsxs)(import_jsx_runtime213.Fragment, { children: [ 15027 !isContentOnlyMode && /* @__PURE__ */ (0, import_jsx_runtime213.jsxs)(import_block_editor64.BlockControls, { group: "block", children: [ 15028 /* @__PURE__ */ (0, import_jsx_runtime213.jsx)( 15029 import_block_editor64.__experimentalBlockAlignmentMatrixControl, 15030 { 15031 label: (0, import_i18n50.__)("Change content position"), 15032 value: contentPosition, 15033 onChange: (nextPosition) => setAttributes({ 15034 contentPosition: nextPosition 15035 }), 15036 isDisabled: !hasInnerBlocks 15037 } 15038 ), 15039 /* @__PURE__ */ (0, import_jsx_runtime213.jsx)( 15040 import_block_editor64.__experimentalBlockFullHeightAligmentControl, 15041 { 15042 isActive: isMinFullHeight, 15043 onToggle: toggleMinFullHeight, 15044 isDisabled: !hasInnerBlocks 15045 } 15046 ) 15047 ] }), 15048 /* @__PURE__ */ (0, import_jsx_runtime213.jsx)(import_block_editor64.BlockControls, { group: "other", children: /* @__PURE__ */ (0, import_jsx_runtime213.jsx)( 15049 import_block_editor64.MediaReplaceFlow, 15050 { 15051 mediaId: id, 15052 mediaURL: url, 15053 allowedTypes: ALLOWED_MEDIA_TYPES2, 15054 onSelect: onSelectMedia, 15055 onToggleFeaturedImage: toggleUseFeaturedImage, 15056 useFeaturedImage, 15057 name: !url ? (0, import_i18n50.__)("Add media") : (0, import_i18n50.__)("Replace"), 15058 onReset: onClearMedia, 15059 children: ({ onClose }) => /* @__PURE__ */ (0, import_jsx_runtime213.jsx)( 15060 import_components33.MenuItem, 15061 { 15062 icon: link_default, 15063 onClick: () => { 15064 setIsEmbedUrlInputOpen(true); 15065 onClose(); 15066 }, 15067 children: (0, import_i18n50.__)("Embed video from URL") 15068 } 15069 ) 15070 } 15071 ) }), 15072 isEmbedUrlInputOpen && /* @__PURE__ */ (0, import_jsx_runtime213.jsx)( 15073 EmbedVideoUrlInput, 15074 { 15075 onSubmit: (embedUrl) => { 15076 onSelectEmbedUrl(embedUrl); 15077 }, 15078 onClose: () => setIsEmbedUrlInputOpen(false) 15079 } 15080 ) 15081 ] }); 15082 } 15083 15084 // packages/block-library/build-module/cover/edit/cover-placeholder.js 15085 var import_block_editor65 = __toESM(require_block_editor()); 15086 var import_i18n51 = __toESM(require_i18n()); 15087 var import_jsx_runtime214 = __toESM(require_jsx_runtime()); 15088 function CoverPlaceholder({ 15089 disableMediaButtons = false, 15090 children, 15091 onSelectMedia, 15092 onError, 15093 style: style2, 15094 toggleUseFeaturedImage 15095 }) { 15096 return /* @__PURE__ */ (0, import_jsx_runtime214.jsx)( 15097 import_block_editor65.MediaPlaceholder, 15098 { 15099 icon: /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(import_block_editor65.BlockIcon, { icon: cover_default }), 15100 labels: { 15101 title: (0, import_i18n51.__)("Cover") 15102 }, 15103 onSelect: onSelectMedia, 15104 allowedTypes: ALLOWED_MEDIA_TYPES2, 15105 disableMediaButtons, 15106 onToggleFeaturedImage: toggleUseFeaturedImage, 15107 onError, 15108 style: style2, 15109 children 15110 } 15111 ); 15112 } 15113 15114 // packages/block-library/build-module/cover/edit/resizable-cover-popover.js 15115 var import_element24 = __toESM(require_element()); 15116 var import_block_editor66 = __toESM(require_block_editor()); 15117 var import_jsx_runtime215 = __toESM(require_jsx_runtime()); 15118 var RESIZABLE_BOX_ENABLE_OPTION = { 15119 top: false, 15120 right: false, 15121 bottom: true, 15122 left: false, 15123 topRight: false, 15124 bottomRight: false, 15125 bottomLeft: false, 15126 topLeft: false 15127 }; 15128 var { ResizableBoxPopover } = unlock(import_block_editor66.privateApis); 15129 function ResizableCoverPopover({ 15130 className, 15131 height, 15132 minHeight, 15133 onResize, 15134 onResizeStart, 15135 onResizeStop, 15136 showHandle, 15137 size, 15138 width, 15139 ...props 15140 }) { 15141 const [isResizing, setIsResizing] = (0, import_element24.useState)(false); 15142 const resizableBoxProps = { 15143 className: clsx_default(className, { "is-resizing": isResizing }), 15144 enable: RESIZABLE_BOX_ENABLE_OPTION, 15145 onResizeStart: (_event, _direction, elt) => { 15146 onResizeStart(elt.clientHeight); 15147 onResize(elt.clientHeight); 15148 }, 15149 onResize: (_event, _direction, elt) => { 15150 onResize(elt.clientHeight); 15151 if (!isResizing) { 15152 setIsResizing(true); 15153 } 15154 }, 15155 onResizeStop: (_event, _direction, elt) => { 15156 onResizeStop(elt.clientHeight); 15157 setIsResizing(false); 15158 }, 15159 showHandle, 15160 size, 15161 __experimentalShowTooltip: true, 15162 __experimentalTooltipProps: { 15163 axis: "y", 15164 position: "bottom", 15165 isVisible: isResizing 15166 } 15167 }; 15168 return /* @__PURE__ */ (0, import_jsx_runtime215.jsx)( 15169 ResizableBoxPopover, 15170 { 15171 className: "block-library-cover__resizable-box-popover", 15172 resizableBoxProps, 15173 ...props 15174 } 15175 ); 15176 } 15177 15178 // node_modules/colord/index.mjs 15179 var r2 = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }; 15180 var t = function(r3) { 15181 return "string" == typeof r3 ? r3.length > 0 : "number" == typeof r3; 15182 }; 15183 var n = function(r3, t2, n2) { 15184 return void 0 === t2 && (t2 = 0), void 0 === n2 && (n2 = Math.pow(10, t2)), Math.round(n2 * r3) / n2 + 0; 15185 }; 15186 var e = function(r3, t2, n2) { 15187 return void 0 === t2 && (t2 = 0), void 0 === n2 && (n2 = 1), r3 > n2 ? n2 : r3 > t2 ? r3 : t2; 15188 }; 15189 var u = function(r3) { 15190 return (r3 = isFinite(r3) ? r3 % 360 : 0) > 0 ? r3 : r3 + 360; 15191 }; 15192 var a = function(r3) { 15193 return { r: e(r3.r, 0, 255), g: e(r3.g, 0, 255), b: e(r3.b, 0, 255), a: e(r3.a) }; 15194 }; 15195 var o = function(r3) { 15196 return { r: n(r3.r), g: n(r3.g), b: n(r3.b), a: n(r3.a, 3) }; 15197 }; 15198 var i = /^#([0-9a-f]{3,8})$/i; 15199 var s = function(r3) { 15200 var t2 = r3.toString(16); 15201 return t2.length < 2 ? "0" + t2 : t2; 15202 }; 15203 var h = function(r3) { 15204 var t2 = r3.r, n2 = r3.g, e2 = r3.b, u2 = r3.a, a2 = Math.max(t2, n2, e2), o2 = a2 - Math.min(t2, n2, e2), i2 = o2 ? a2 === t2 ? (n2 - e2) / o2 : a2 === n2 ? 2 + (e2 - t2) / o2 : 4 + (t2 - n2) / o2 : 0; 15205 return { h: 60 * (i2 < 0 ? i2 + 6 : i2), s: a2 ? o2 / a2 * 100 : 0, v: a2 / 255 * 100, a: u2 }; 15206 }; 15207 var b = function(r3) { 15208 var t2 = r3.h, n2 = r3.s, e2 = r3.v, u2 = r3.a; 15209 t2 = t2 / 360 * 6, n2 /= 100, e2 /= 100; 15210 var a2 = Math.floor(t2), o2 = e2 * (1 - n2), i2 = e2 * (1 - (t2 - a2) * n2), s2 = e2 * (1 - (1 - t2 + a2) * n2), h2 = a2 % 6; 15211 return { r: 255 * [e2, i2, o2, o2, s2, e2][h2], g: 255 * [s2, e2, e2, i2, o2, o2][h2], b: 255 * [o2, o2, s2, e2, e2, i2][h2], a: u2 }; 15212 }; 15213 var g = function(r3) { 15214 return { h: u(r3.h), s: e(r3.s, 0, 100), l: e(r3.l, 0, 100), a: e(r3.a) }; 15215 }; 15216 var d = function(r3) { 15217 return { h: n(r3.h), s: n(r3.s), l: n(r3.l), a: n(r3.a, 3) }; 15218 }; 15219 var f = function(r3) { 15220 return b((n2 = (t2 = r3).s, { h: t2.h, s: (n2 *= ((e2 = t2.l) < 50 ? e2 : 100 - e2) / 100) > 0 ? 2 * n2 / (e2 + n2) * 100 : 0, v: e2 + n2, a: t2.a })); 15221 var t2, n2, e2; 15222 }; 15223 var c = function(r3) { 15224 return { h: (t2 = h(r3)).h, s: (u2 = (200 - (n2 = t2.s)) * (e2 = t2.v) / 100) > 0 && u2 < 200 ? n2 * e2 / 100 / (u2 <= 100 ? u2 : 200 - u2) * 100 : 0, l: u2 / 2, a: t2.a }; 15225 var t2, n2, e2, u2; 15226 }; 15227 var l = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i; 15228 var p = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i; 15229 var v = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i; 15230 var m = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i; 15231 var y = { string: [[function(r3) { 15232 var t2 = i.exec(r3); 15233 return t2 ? (r3 = t2[1]).length <= 4 ? { r: parseInt(r3[0] + r3[0], 16), g: parseInt(r3[1] + r3[1], 16), b: parseInt(r3[2] + r3[2], 16), a: 4 === r3.length ? n(parseInt(r3[3] + r3[3], 16) / 255, 2) : 1 } : 6 === r3.length || 8 === r3.length ? { r: parseInt(r3.substr(0, 2), 16), g: parseInt(r3.substr(2, 2), 16), b: parseInt(r3.substr(4, 2), 16), a: 8 === r3.length ? n(parseInt(r3.substr(6, 2), 16) / 255, 2) : 1 } : null : null; 15234 }, "hex"], [function(r3) { 15235 var t2 = v.exec(r3) || m.exec(r3); 15236 return t2 ? t2[2] !== t2[4] || t2[4] !== t2[6] ? null : a({ r: Number(t2[1]) / (t2[2] ? 100 / 255 : 1), g: Number(t2[3]) / (t2[4] ? 100 / 255 : 1), b: Number(t2[5]) / (t2[6] ? 100 / 255 : 1), a: void 0 === t2[7] ? 1 : Number(t2[7]) / (t2[8] ? 100 : 1) }) : null; 15237 }, "rgb"], [function(t2) { 15238 var n2 = l.exec(t2) || p.exec(t2); 15239 if (!n2) return null; 15240 var e2, u2, a2 = g({ h: (e2 = n2[1], u2 = n2[2], void 0 === u2 && (u2 = "deg"), Number(e2) * (r2[u2] || 1)), s: Number(n2[3]), l: Number(n2[4]), a: void 0 === n2[5] ? 1 : Number(n2[5]) / (n2[6] ? 100 : 1) }); 15241 return f(a2); 15242 }, "hsl"]], object: [[function(r3) { 15243 var n2 = r3.r, e2 = r3.g, u2 = r3.b, o2 = r3.a, i2 = void 0 === o2 ? 1 : o2; 15244 return t(n2) && t(e2) && t(u2) ? a({ r: Number(n2), g: Number(e2), b: Number(u2), a: Number(i2) }) : null; 15245 }, "rgb"], [function(r3) { 15246 var n2 = r3.h, e2 = r3.s, u2 = r3.l, a2 = r3.a, o2 = void 0 === a2 ? 1 : a2; 15247 if (!t(n2) || !t(e2) || !t(u2)) return null; 15248 var i2 = g({ h: Number(n2), s: Number(e2), l: Number(u2), a: Number(o2) }); 15249 return f(i2); 15250 }, "hsl"], [function(r3) { 15251 var n2 = r3.h, a2 = r3.s, o2 = r3.v, i2 = r3.a, s2 = void 0 === i2 ? 1 : i2; 15252 if (!t(n2) || !t(a2) || !t(o2)) return null; 15253 var h2 = (function(r4) { 15254 return { h: u(r4.h), s: e(r4.s, 0, 100), v: e(r4.v, 0, 100), a: e(r4.a) }; 15255 })({ h: Number(n2), s: Number(a2), v: Number(o2), a: Number(s2) }); 15256 return b(h2); 15257 }, "hsv"]] }; 15258 var N = function(r3, t2) { 15259 for (var n2 = 0; n2 < t2.length; n2++) { 15260 var e2 = t2[n2][0](r3); 15261 if (e2) return [e2, t2[n2][1]]; 15262 } 15263 return [null, void 0]; 15264 }; 15265 var x = function(r3) { 15266 return "string" == typeof r3 ? N(r3.trim(), y.string) : "object" == typeof r3 && null !== r3 ? N(r3, y.object) : [null, void 0]; 15267 }; 15268 var M = function(r3, t2) { 15269 var n2 = c(r3); 15270 return { h: n2.h, s: e(n2.s + 100 * t2, 0, 100), l: n2.l, a: n2.a }; 15271 }; 15272 var H = function(r3) { 15273 return (299 * r3.r + 587 * r3.g + 114 * r3.b) / 1e3 / 255; 15274 }; 15275 var $ = function(r3, t2) { 15276 var n2 = c(r3); 15277 return { h: n2.h, s: n2.s, l: e(n2.l + 100 * t2, 0, 100), a: n2.a }; 15278 }; 15279 var j = (function() { 15280 function r3(r4) { 15281 this.parsed = x(r4)[0], this.rgba = this.parsed || { r: 0, g: 0, b: 0, a: 1 }; 15282 } 15283 return r3.prototype.isValid = function() { 15284 return null !== this.parsed; 15285 }, r3.prototype.brightness = function() { 15286 return n(H(this.rgba), 2); 15287 }, r3.prototype.isDark = function() { 15288 return H(this.rgba) < 0.5; 15289 }, r3.prototype.isLight = function() { 15290 return H(this.rgba) >= 0.5; 15291 }, r3.prototype.toHex = function() { 15292 return r4 = o(this.rgba), t2 = r4.r, e2 = r4.g, u2 = r4.b, i2 = (a2 = r4.a) < 1 ? s(n(255 * a2)) : "", "#" + s(t2) + s(e2) + s(u2) + i2; 15293 var r4, t2, e2, u2, a2, i2; 15294 }, r3.prototype.toRgb = function() { 15295 return o(this.rgba); 15296 }, r3.prototype.toRgbString = function() { 15297 return r4 = o(this.rgba), t2 = r4.r, n2 = r4.g, e2 = r4.b, (u2 = r4.a) < 1 ? "rgba(" + t2 + ", " + n2 + ", " + e2 + ", " + u2 + ")" : "rgb(" + t2 + ", " + n2 + ", " + e2 + ")"; 15298 var r4, t2, n2, e2, u2; 15299 }, r3.prototype.toHsl = function() { 15300 return d(c(this.rgba)); 15301 }, r3.prototype.toHslString = function() { 15302 return r4 = d(c(this.rgba)), t2 = r4.h, n2 = r4.s, e2 = r4.l, (u2 = r4.a) < 1 ? "hsla(" + t2 + ", " + n2 + "%, " + e2 + "%, " + u2 + ")" : "hsl(" + t2 + ", " + n2 + "%, " + e2 + "%)"; 15303 var r4, t2, n2, e2, u2; 15304 }, r3.prototype.toHsv = function() { 15305 return r4 = h(this.rgba), { h: n(r4.h), s: n(r4.s), v: n(r4.v), a: n(r4.a, 3) }; 15306 var r4; 15307 }, r3.prototype.invert = function() { 15308 return w({ r: 255 - (r4 = this.rgba).r, g: 255 - r4.g, b: 255 - r4.b, a: r4.a }); 15309 var r4; 15310 }, r3.prototype.saturate = function(r4) { 15311 return void 0 === r4 && (r4 = 0.1), w(M(this.rgba, r4)); 15312 }, r3.prototype.desaturate = function(r4) { 15313 return void 0 === r4 && (r4 = 0.1), w(M(this.rgba, -r4)); 15314 }, r3.prototype.grayscale = function() { 15315 return w(M(this.rgba, -1)); 15316 }, r3.prototype.lighten = function(r4) { 15317 return void 0 === r4 && (r4 = 0.1), w($(this.rgba, r4)); 15318 }, r3.prototype.darken = function(r4) { 15319 return void 0 === r4 && (r4 = 0.1), w($(this.rgba, -r4)); 15320 }, r3.prototype.rotate = function(r4) { 15321 return void 0 === r4 && (r4 = 15), this.hue(this.hue() + r4); 15322 }, r3.prototype.alpha = function(r4) { 15323 return "number" == typeof r4 ? w({ r: (t2 = this.rgba).r, g: t2.g, b: t2.b, a: r4 }) : n(this.rgba.a, 3); 15324 var t2; 15325 }, r3.prototype.hue = function(r4) { 15326 var t2 = c(this.rgba); 15327 return "number" == typeof r4 ? w({ h: r4, s: t2.s, l: t2.l, a: t2.a }) : n(t2.h); 15328 }, r3.prototype.isEqual = function(r4) { 15329 return this.toHex() === w(r4).toHex(); 15330 }, r3; 15331 })(); 15332 var w = function(r3) { 15333 return r3 instanceof j ? r3 : new j(r3); 15334 }; 15335 var S = []; 15336 var k = function(r3) { 15337 r3.forEach(function(r4) { 15338 S.indexOf(r4) < 0 && (r4(j, y), S.push(r4)); 15339 }); 15340 }; 15341 15342 // node_modules/colord/plugins/names.mjs 15343 function names_default(e2, f2) { 15344 var a2 = { 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" }, r3 = {}; 15345 for (var d2 in a2) r3[a2[d2]] = d2; 15346 var l2 = {}; 15347 e2.prototype.toName = function(f3) { 15348 if (!(this.rgba.a || this.rgba.r || this.rgba.g || this.rgba.b)) return "transparent"; 15349 var d3, i2, n2 = r3[this.toHex()]; 15350 if (n2) return n2; 15351 if (null == f3 ? void 0 : f3.closest) { 15352 var o2 = this.toRgb(), t2 = 1 / 0, b2 = "black"; 15353 if (!l2.length) for (var c2 in a2) l2[c2] = new e2(a2[c2]).toRgb(); 15354 for (var g2 in a2) { 15355 var u2 = (d3 = o2, i2 = l2[g2], Math.pow(d3.r - i2.r, 2) + Math.pow(d3.g - i2.g, 2) + Math.pow(d3.b - i2.b, 2)); 15356 u2 < t2 && (t2 = u2, b2 = g2); 15357 } 15358 return b2; 15359 } 15360 }; 15361 f2.string.push([function(f3) { 15362 var r4 = f3.toLowerCase(), d3 = "transparent" === r4 ? "#0000" : a2[r4]; 15363 return d3 ? new e2(d3).toRgb() : null; 15364 }, "name"]); 15365 } 15366 15367 // node_modules/fast-average-color/dist/index.esm.js 15368 function toHex(num) { 15369 var str = num.toString(16); 15370 return str.length === 1 ? "0" + str : str; 15371 } 15372 function arrayToHex(arr) { 15373 return "#" + arr.map(toHex).join(""); 15374 } 15375 function isDark(color) { 15376 var result = (color[0] * 299 + color[1] * 587 + color[2] * 114) / 1e3; 15377 return result < 128; 15378 } 15379 function prepareIgnoredColor(color) { 15380 if (!color) { 15381 return []; 15382 } 15383 return isRGBArray(color) ? color : [color]; 15384 } 15385 function isRGBArray(value) { 15386 return Array.isArray(value[0]); 15387 } 15388 function isIgnoredColor(data, index, ignoredColor) { 15389 for (var i2 = 0; i2 < ignoredColor.length; i2++) { 15390 if (isIgnoredColorAsNumbers(data, index, ignoredColor[i2])) { 15391 return true; 15392 } 15393 } 15394 return false; 15395 } 15396 function isIgnoredColorAsNumbers(data, index, ignoredColor) { 15397 switch (ignoredColor.length) { 15398 case 3: 15399 if (isIgnoredRGBColor(data, index, ignoredColor)) { 15400 return true; 15401 } 15402 break; 15403 case 4: 15404 if (isIgnoredRGBAColor(data, index, ignoredColor)) { 15405 return true; 15406 } 15407 break; 15408 case 5: 15409 if (isIgnoredRGBAColorWithThreshold(data, index, ignoredColor)) { 15410 return true; 15411 } 15412 break; 15413 default: 15414 return false; 15415 } 15416 } 15417 function isIgnoredRGBColor(data, index, ignoredColor) { 15418 if (data[index + 3] !== 255) { 15419 return true; 15420 } 15421 if (data[index] === ignoredColor[0] && data[index + 1] === ignoredColor[1] && data[index + 2] === ignoredColor[2]) { 15422 return true; 15423 } 15424 return false; 15425 } 15426 function isIgnoredRGBAColor(data, index, ignoredColor) { 15427 if (data[index + 3] && ignoredColor[3]) { 15428 return data[index] === ignoredColor[0] && data[index + 1] === ignoredColor[1] && data[index + 2] === ignoredColor[2] && data[index + 3] === ignoredColor[3]; 15429 } 15430 return data[index + 3] === ignoredColor[3]; 15431 } 15432 function inRange(colorComponent, ignoredColorComponent, value) { 15433 return colorComponent >= ignoredColorComponent - value && colorComponent <= ignoredColorComponent + value; 15434 } 15435 function isIgnoredRGBAColorWithThreshold(data, index, ignoredColor) { 15436 var redIgnored = ignoredColor[0]; 15437 var greenIgnored = ignoredColor[1]; 15438 var blueIgnored = ignoredColor[2]; 15439 var alphaIgnored = ignoredColor[3]; 15440 var threshold = ignoredColor[4]; 15441 var alphaData = data[index + 3]; 15442 var alphaInRange = inRange(alphaData, alphaIgnored, threshold); 15443 if (!alphaIgnored) { 15444 return alphaInRange; 15445 } 15446 if (!alphaData && alphaInRange) { 15447 return true; 15448 } 15449 if (inRange(data[index], redIgnored, threshold) && inRange(data[index + 1], greenIgnored, threshold) && inRange(data[index + 2], blueIgnored, threshold) && alphaInRange) { 15450 return true; 15451 } 15452 return false; 15453 } 15454 function dominantAlgorithm(arr, len, options2) { 15455 var colorHash = {}; 15456 var divider = 24; 15457 var ignoredColor = options2.ignoredColor; 15458 var step = options2.step; 15459 var max = [0, 0, 0, 0, 0]; 15460 for (var i2 = 0; i2 < len; i2 += step) { 15461 var red = arr[i2]; 15462 var green = arr[i2 + 1]; 15463 var blue = arr[i2 + 2]; 15464 var alpha = arr[i2 + 3]; 15465 if (ignoredColor && isIgnoredColor(arr, i2, ignoredColor)) { 15466 continue; 15467 } 15468 var key = Math.round(red / divider) + "," + Math.round(green / divider) + "," + Math.round(blue / divider); 15469 if (colorHash[key]) { 15470 colorHash[key] = [ 15471 colorHash[key][0] + red * alpha, 15472 colorHash[key][1] + green * alpha, 15473 colorHash[key][2] + blue * alpha, 15474 colorHash[key][3] + alpha, 15475 colorHash[key][4] + 1 15476 ]; 15477 } else { 15478 colorHash[key] = [red * alpha, green * alpha, blue * alpha, alpha, 1]; 15479 } 15480 if (max[4] < colorHash[key][4]) { 15481 max = colorHash[key]; 15482 } 15483 } 15484 var redTotal = max[0]; 15485 var greenTotal = max[1]; 15486 var blueTotal = max[2]; 15487 var alphaTotal = max[3]; 15488 var count = max[4]; 15489 return alphaTotal ? [ 15490 Math.round(redTotal / alphaTotal), 15491 Math.round(greenTotal / alphaTotal), 15492 Math.round(blueTotal / alphaTotal), 15493 Math.round(alphaTotal / count) 15494 ] : options2.defaultColor; 15495 } 15496 function simpleAlgorithm(arr, len, options2) { 15497 var redTotal = 0; 15498 var greenTotal = 0; 15499 var blueTotal = 0; 15500 var alphaTotal = 0; 15501 var count = 0; 15502 var ignoredColor = options2.ignoredColor; 15503 var step = options2.step; 15504 for (var i2 = 0; i2 < len; i2 += step) { 15505 var alpha = arr[i2 + 3]; 15506 var red = arr[i2] * alpha; 15507 var green = arr[i2 + 1] * alpha; 15508 var blue = arr[i2 + 2] * alpha; 15509 if (ignoredColor && isIgnoredColor(arr, i2, ignoredColor)) { 15510 continue; 15511 } 15512 redTotal += red; 15513 greenTotal += green; 15514 blueTotal += blue; 15515 alphaTotal += alpha; 15516 count++; 15517 } 15518 return alphaTotal ? [ 15519 Math.round(redTotal / alphaTotal), 15520 Math.round(greenTotal / alphaTotal), 15521 Math.round(blueTotal / alphaTotal), 15522 Math.round(alphaTotal / count) 15523 ] : options2.defaultColor; 15524 } 15525 function sqrtAlgorithm(arr, len, options2) { 15526 var redTotal = 0; 15527 var greenTotal = 0; 15528 var blueTotal = 0; 15529 var alphaTotal = 0; 15530 var count = 0; 15531 var ignoredColor = options2.ignoredColor; 15532 var step = options2.step; 15533 for (var i2 = 0; i2 < len; i2 += step) { 15534 var red = arr[i2]; 15535 var green = arr[i2 + 1]; 15536 var blue = arr[i2 + 2]; 15537 var alpha = arr[i2 + 3]; 15538 if (ignoredColor && isIgnoredColor(arr, i2, ignoredColor)) { 15539 continue; 15540 } 15541 redTotal += red * red * alpha; 15542 greenTotal += green * green * alpha; 15543 blueTotal += blue * blue * alpha; 15544 alphaTotal += alpha; 15545 count++; 15546 } 15547 return alphaTotal ? [ 15548 Math.round(Math.sqrt(redTotal / alphaTotal)), 15549 Math.round(Math.sqrt(greenTotal / alphaTotal)), 15550 Math.round(Math.sqrt(blueTotal / alphaTotal)), 15551 Math.round(alphaTotal / count) 15552 ] : options2.defaultColor; 15553 } 15554 function getDefaultColor(options2) { 15555 return getOption(options2, "defaultColor", [0, 0, 0, 0]); 15556 } 15557 function getOption(options2, name117, defaultValue) { 15558 return options2[name117] === void 0 ? defaultValue : options2[name117]; 15559 } 15560 var MIN_SIZE = 10; 15561 var MAX_SIZE = 100; 15562 function isSvg(filename) { 15563 return filename.search(/\.svg(\?|$)/i) !== -1; 15564 } 15565 function getOriginalSize(resource) { 15566 if (isInstanceOfHTMLImageElement(resource)) { 15567 var width = resource.naturalWidth; 15568 var height = resource.naturalHeight; 15569 if (!resource.naturalWidth && isSvg(resource.src)) { 15570 width = height = MAX_SIZE; 15571 } 15572 return { 15573 width, 15574 height 15575 }; 15576 } 15577 if (isInstanceOfHTMLVideoElement(resource)) { 15578 return { 15579 width: resource.videoWidth, 15580 height: resource.videoHeight 15581 }; 15582 } 15583 return { 15584 width: resource.width, 15585 height: resource.height 15586 }; 15587 } 15588 function getSrc(resource) { 15589 if (isInstanceOfHTMLCanvasElement(resource)) { 15590 return "canvas"; 15591 } 15592 if (isInstanceOfOffscreenCanvas(resource)) { 15593 return "offscreencanvas"; 15594 } 15595 if (isInstanceOfImageBitmap(resource)) { 15596 return "imagebitmap"; 15597 } 15598 return resource.src; 15599 } 15600 function isInstanceOfHTMLImageElement(resource) { 15601 return typeof HTMLImageElement !== "undefined" && resource instanceof HTMLImageElement; 15602 } 15603 function isInstanceOfOffscreenCanvas(resource) { 15604 return typeof OffscreenCanvas !== "undefined" && resource instanceof OffscreenCanvas; 15605 } 15606 function isInstanceOfHTMLVideoElement(resource) { 15607 return typeof HTMLVideoElement !== "undefined" && resource instanceof HTMLVideoElement; 15608 } 15609 function isInstanceOfHTMLCanvasElement(resource) { 15610 return typeof HTMLCanvasElement !== "undefined" && resource instanceof HTMLCanvasElement; 15611 } 15612 function isInstanceOfImageBitmap(resource) { 15613 return typeof ImageBitmap !== "undefined" && resource instanceof ImageBitmap; 15614 } 15615 function prepareSizeAndPosition(originalSize, options2) { 15616 var srcLeft = getOption(options2, "left", 0); 15617 var srcTop = getOption(options2, "top", 0); 15618 var srcWidth = getOption(options2, "width", originalSize.width); 15619 var srcHeight = getOption(options2, "height", originalSize.height); 15620 var destWidth = srcWidth; 15621 var destHeight = srcHeight; 15622 if (options2.mode === "precision") { 15623 return { 15624 srcLeft, 15625 srcTop, 15626 srcWidth, 15627 srcHeight, 15628 destWidth, 15629 destHeight 15630 }; 15631 } 15632 var factor; 15633 if (srcWidth > srcHeight) { 15634 factor = srcWidth / srcHeight; 15635 destWidth = MAX_SIZE; 15636 destHeight = Math.round(destWidth / factor); 15637 } else { 15638 factor = srcHeight / srcWidth; 15639 destHeight = MAX_SIZE; 15640 destWidth = Math.round(destHeight / factor); 15641 } 15642 if (destWidth > srcWidth || destHeight > srcHeight || destWidth < MIN_SIZE || destHeight < MIN_SIZE) { 15643 destWidth = srcWidth; 15644 destHeight = srcHeight; 15645 } 15646 return { 15647 srcLeft, 15648 srcTop, 15649 srcWidth, 15650 srcHeight, 15651 destWidth, 15652 destHeight 15653 }; 15654 } 15655 var isWebWorkers = typeof window === "undefined"; 15656 function makeCanvas() { 15657 return isWebWorkers ? new OffscreenCanvas(1, 1) : document.createElement("canvas"); 15658 } 15659 var ERROR_PREFIX = "FastAverageColor: "; 15660 function outputError(message, silent, error) { 15661 if (!silent) { 15662 console.error(ERROR_PREFIX + message); 15663 if (error) { 15664 console.error(error); 15665 } 15666 } 15667 } 15668 function getError(text) { 15669 return Error(ERROR_PREFIX + text); 15670 } 15671 var FastAverageColor = ( 15672 /** @class */ 15673 (function() { 15674 function FastAverageColor2() { 15675 this.canvas = null; 15676 this.ctx = null; 15677 } 15678 FastAverageColor2.prototype.getColorAsync = function(resource, options2) { 15679 if (!resource) { 15680 return Promise.reject(getError("call .getColorAsync() without resource.")); 15681 } 15682 if (typeof resource === "string") { 15683 if (typeof Image === "undefined") { 15684 return Promise.reject(getError("resource as string is not supported in this environment")); 15685 } 15686 var img = new Image(); 15687 img.crossOrigin = options2 && options2.crossOrigin || ""; 15688 img.src = resource; 15689 return this.bindImageEvents(img, options2); 15690 } else if (isInstanceOfHTMLImageElement(resource) && !resource.complete) { 15691 return this.bindImageEvents(resource, options2); 15692 } else { 15693 var result = this.getColor(resource, options2); 15694 return result.error ? Promise.reject(result.error) : Promise.resolve(result); 15695 } 15696 }; 15697 FastAverageColor2.prototype.getColor = function(resource, options2) { 15698 options2 = options2 || {}; 15699 var defaultColor = getDefaultColor(options2); 15700 if (!resource) { 15701 outputError("call .getColor(null) without resource", options2.silent); 15702 return this.prepareResult(defaultColor); 15703 } 15704 var originalSize = getOriginalSize(resource); 15705 var size = prepareSizeAndPosition(originalSize, options2); 15706 if (!size.srcWidth || !size.srcHeight || !size.destWidth || !size.destHeight) { 15707 outputError('incorrect sizes for resource "'.concat(getSrc(resource), '"'), options2.silent); 15708 return this.prepareResult(defaultColor); 15709 } 15710 if (!this.canvas) { 15711 this.canvas = makeCanvas(); 15712 } 15713 if (!this.ctx) { 15714 this.ctx = this.canvas.getContext && this.canvas.getContext("2d"); 15715 if (!this.ctx) { 15716 outputError("Canvas Context 2D is not supported in this browser", options2.silent); 15717 return this.prepareResult(defaultColor); 15718 } 15719 } 15720 this.canvas.width = size.destWidth; 15721 this.canvas.height = size.destHeight; 15722 var value = defaultColor; 15723 try { 15724 this.ctx.clearRect(0, 0, size.destWidth, size.destHeight); 15725 this.ctx.drawImage(resource, size.srcLeft, size.srcTop, size.srcWidth, size.srcHeight, 0, 0, size.destWidth, size.destHeight); 15726 var bitmapData = this.ctx.getImageData(0, 0, size.destWidth, size.destHeight).data; 15727 value = this.getColorFromArray4(bitmapData, options2); 15728 } catch (e2) { 15729 outputError("security error (CORS) for resource ".concat(getSrc(resource), ".\nDetails: https://developer.mozilla.org/en/docs/Web/HTML/CORS_enabled_image"), options2.silent, e2); 15730 } 15731 return this.prepareResult(value); 15732 }; 15733 FastAverageColor2.prototype.getColorFromArray4 = function(arr, options2) { 15734 options2 = options2 || {}; 15735 var bytesPerPixel = 4; 15736 var arrLength = arr.length; 15737 var defaultColor = getDefaultColor(options2); 15738 if (arrLength < bytesPerPixel) { 15739 return defaultColor; 15740 } 15741 var len = arrLength - arrLength % bytesPerPixel; 15742 var step = (options2.step || 1) * bytesPerPixel; 15743 var algorithm; 15744 switch (options2.algorithm || "sqrt") { 15745 case "simple": 15746 algorithm = simpleAlgorithm; 15747 break; 15748 case "sqrt": 15749 algorithm = sqrtAlgorithm; 15750 break; 15751 case "dominant": 15752 algorithm = dominantAlgorithm; 15753 break; 15754 default: 15755 throw getError("".concat(options2.algorithm, " is unknown algorithm")); 15756 } 15757 return algorithm(arr, len, { 15758 defaultColor, 15759 ignoredColor: prepareIgnoredColor(options2.ignoredColor), 15760 step 15761 }); 15762 }; 15763 FastAverageColor2.prototype.prepareResult = function(value) { 15764 var rgb = value.slice(0, 3); 15765 var rgba = [value[0], value[1], value[2], value[3] / 255]; 15766 var isDarkColor = isDark(value); 15767 return { 15768 value: [value[0], value[1], value[2], value[3]], 15769 rgb: "rgb(" + rgb.join(",") + ")", 15770 rgba: "rgba(" + rgba.join(",") + ")", 15771 hex: arrayToHex(rgb), 15772 hexa: arrayToHex(value), 15773 isDark: isDarkColor, 15774 isLight: !isDarkColor 15775 }; 15776 }; 15777 FastAverageColor2.prototype.destroy = function() { 15778 if (this.canvas) { 15779 this.canvas.width = 1; 15780 this.canvas.height = 1; 15781 this.canvas = null; 15782 } 15783 this.ctx = null; 15784 }; 15785 FastAverageColor2.prototype.bindImageEvents = function(resource, options2) { 15786 var _this = this; 15787 return new Promise(function(resolve, reject) { 15788 var onload = function() { 15789 unbindEvents(); 15790 var result = _this.getColor(resource, options2); 15791 if (result.error) { 15792 reject(result.error); 15793 } else { 15794 resolve(result); 15795 } 15796 }; 15797 var onerror = function() { 15798 unbindEvents(); 15799 reject(getError('Error loading image "'.concat(resource.src, '".'))); 15800 }; 15801 var onabort = function() { 15802 unbindEvents(); 15803 reject(getError('Image "'.concat(resource.src, '" loading aborted'))); 15804 }; 15805 var unbindEvents = function() { 15806 resource.removeEventListener("load", onload); 15807 resource.removeEventListener("error", onerror); 15808 resource.removeEventListener("abort", onabort); 15809 }; 15810 resource.addEventListener("load", onload); 15811 resource.addEventListener("error", onerror); 15812 resource.addEventListener("abort", onabort); 15813 }); 15814 }; 15815 return FastAverageColor2; 15816 })() 15817 ); 15818 15819 // packages/block-library/build-module/cover/edit/color-utils.js 15820 var import_hooks20 = __toESM(require_hooks()); 15821 k([names_default]); 15822 var DEFAULT_BACKGROUND_COLOR = "#FFF"; 15823 var DEFAULT_OVERLAY_COLOR = "#000"; 15824 function compositeSourceOver(source, dest) { 15825 return { 15826 r: source.r * source.a + dest.r * dest.a * (1 - source.a), 15827 g: source.g * source.a + dest.g * dest.a * (1 - source.a), 15828 b: source.b * source.a + dest.b * dest.a * (1 - source.a), 15829 a: source.a + dest.a * (1 - source.a) 15830 }; 15831 } 15832 function retrieveFastAverageColor() { 15833 if (!retrieveFastAverageColor.fastAverageColor) { 15834 retrieveFastAverageColor.fastAverageColor = new FastAverageColor(); 15835 } 15836 return retrieveFastAverageColor.fastAverageColor; 15837 } 15838 var getMediaColor = memize(async (url) => { 15839 if (!url) { 15840 return DEFAULT_BACKGROUND_COLOR; 15841 } 15842 const { r: r3, g: g2, b: b2, a: a2 } = w(DEFAULT_BACKGROUND_COLOR).toRgb(); 15843 try { 15844 const imgCrossOrigin = (0, import_hooks20.applyFilters)( 15845 "media.crossOrigin", 15846 void 0, 15847 url 15848 ); 15849 const color = await retrieveFastAverageColor().getColorAsync(url, { 15850 // The default color is white, which is the color 15851 // that is returned if there's an error. 15852 // colord returns alpga 0-1, FAC needs 0-255 15853 defaultColor: [r3, g2, b2, a2 * 255], 15854 // Errors that come up don't reject the promise, 15855 // so error logging has to be silenced 15856 // with this option. 15857 silent: false, 15858 crossOrigin: imgCrossOrigin 15859 }); 15860 return color.hex; 15861 } catch (error) { 15862 return DEFAULT_BACKGROUND_COLOR; 15863 } 15864 }); 15865 function compositeIsDark(dimRatio, overlayColor, backgroundColor) { 15866 if (overlayColor === backgroundColor || dimRatio === 100) { 15867 return w(overlayColor).isDark(); 15868 } 15869 const overlay = w(overlayColor).alpha(dimRatio / 100).toRgb(); 15870 const background = w(backgroundColor).toRgb(); 15871 const composite = compositeSourceOver(overlay, background); 15872 return w(composite).isDark(); 15873 } 15874 15875 // packages/block-library/build-module/cover/edit/index.js 15876 var import_jsx_runtime216 = __toESM(require_jsx_runtime()); 15877 function getInnerBlocksTemplate(attributes3) { 15878 return [ 15879 [ 15880 "core/paragraph", 15881 { 15882 style: { 15883 typography: { 15884 textAlign: "center" 15885 } 15886 }, 15887 placeholder: (0, import_i18n52.__)("Write title\u2026"), 15888 ...attributes3 15889 } 15890 ] 15891 ]; 15892 } 15893 var isTemporaryMedia = (id, url) => !id && (0, import_blob6.isBlobURL)(url); 15894 function CoverEdit({ 15895 attributes: attributes3, 15896 clientId, 15897 isSelected, 15898 overlayColor, 15899 setAttributes, 15900 setOverlayColor, 15901 toggleSelection, 15902 context: { postId, postType } 15903 }) { 15904 const { 15905 contentPosition, 15906 id, 15907 url: originalUrl, 15908 backgroundType: originalBackgroundType, 15909 useFeaturedImage, 15910 dimRatio, 15911 focalPoint, 15912 hasParallax, 15913 isDark: isDark2, 15914 isRepeated, 15915 minHeight, 15916 minHeightUnit, 15917 alt, 15918 allowedBlocks, 15919 templateLock, 15920 tagName: TagName2 = "div", 15921 isUserOverlayColor, 15922 sizeSlug, 15923 poster 15924 } = attributes3; 15925 const [featuredImage] = (0, import_core_data16.useEntityProp)( 15926 "postType", 15927 postType, 15928 "featured_media", 15929 postId 15930 ); 15931 const { getSettings: getSettings2 } = (0, import_data28.useSelect)(import_block_editor67.store); 15932 const { __unstableMarkNextChangeAsNotPersistent } = (0, import_data28.useDispatch)(import_block_editor67.store); 15933 const { media } = (0, import_data28.useSelect)( 15934 (select9) => { 15935 return { 15936 media: featuredImage && useFeaturedImage ? select9(import_core_data16.store).getEntityRecord( 15937 "postType", 15938 "attachment", 15939 featuredImage, 15940 { 15941 context: "view" 15942 } 15943 ) : void 0 15944 }; 15945 }, 15946 [featuredImage, useFeaturedImage] 15947 ); 15948 const mediaUrl = media?.media_details?.sizes?.[sizeSlug]?.source_url ?? media?.source_url; 15949 (0, import_element25.useEffect)(() => { 15950 (async () => { 15951 if (!useFeaturedImage) { 15952 return; 15953 } 15954 const averageBackgroundColor = await getMediaColor(mediaUrl); 15955 let newOverlayColor = overlayColor.color; 15956 if (!isUserOverlayColor) { 15957 newOverlayColor = averageBackgroundColor; 15958 __unstableMarkNextChangeAsNotPersistent(); 15959 setOverlayColor(newOverlayColor); 15960 } 15961 const newIsDark = compositeIsDark( 15962 dimRatio, 15963 newOverlayColor, 15964 averageBackgroundColor 15965 ); 15966 __unstableMarkNextChangeAsNotPersistent(); 15967 setAttributes({ 15968 isDark: newIsDark, 15969 isUserOverlayColor: isUserOverlayColor || false 15970 }); 15971 })(); 15972 }, [mediaUrl]); 15973 const url = useFeaturedImage ? mediaUrl : ( 15974 // Ensure the url is not malformed due to sanitization through `wp_kses`. 15975 originalUrl?.replaceAll("&", "&") 15976 ); 15977 const backgroundType = useFeaturedImage ? IMAGE_BACKGROUND_TYPE : originalBackgroundType; 15978 const { createErrorNotice } = (0, import_data28.useDispatch)(import_notices4.store); 15979 const { gradientClass, gradientValue } = (0, import_block_editor67.__experimentalUseGradient)(); 15980 const onSelectMedia = async (newMedia) => { 15981 const mediaAttributes = attributesFromMedia(newMedia); 15982 const isImage = [newMedia?.type, newMedia?.media_type].includes( 15983 IMAGE_BACKGROUND_TYPE 15984 ); 15985 const averageBackgroundColor = await getMediaColor( 15986 isImage ? newMedia?.url : void 0 15987 ); 15988 let newOverlayColor = overlayColor.color; 15989 if (!isUserOverlayColor) { 15990 newOverlayColor = averageBackgroundColor; 15991 setOverlayColor(newOverlayColor); 15992 __unstableMarkNextChangeAsNotPersistent(); 15993 } 15994 const newDimRatio = originalUrl === void 0 && dimRatio === 100 ? 50 : dimRatio; 15995 const newIsDark = compositeIsDark( 15996 newDimRatio, 15997 newOverlayColor, 15998 averageBackgroundColor 15999 ); 16000 if (backgroundType === IMAGE_BACKGROUND_TYPE && mediaAttributes?.id) { 16001 const { imageDefaultSize } = getSettings2(); 16002 if (sizeSlug && (newMedia?.sizes?.[sizeSlug] || newMedia?.media_details?.sizes?.[sizeSlug])) { 16003 mediaAttributes.sizeSlug = sizeSlug; 16004 mediaAttributes.url = newMedia?.sizes?.[sizeSlug]?.url || newMedia?.media_details?.sizes?.[sizeSlug]?.source_url; 16005 } else if (newMedia?.sizes?.[imageDefaultSize] || newMedia?.media_details?.sizes?.[imageDefaultSize]) { 16006 mediaAttributes.sizeSlug = imageDefaultSize; 16007 mediaAttributes.url = newMedia?.sizes?.[imageDefaultSize]?.url || newMedia?.media_details?.sizes?.[imageDefaultSize]?.source_url; 16008 } else { 16009 mediaAttributes.sizeSlug = DEFAULT_MEDIA_SIZE_SLUG; 16010 } 16011 } 16012 setAttributes({ 16013 ...mediaAttributes, 16014 focalPoint: void 0, 16015 useFeaturedImage: void 0, 16016 dimRatio: newDimRatio, 16017 isDark: newIsDark, 16018 isUserOverlayColor: isUserOverlayColor || false 16019 }); 16020 }; 16021 const onClearMedia = () => { 16022 let newOverlayColor = overlayColor.color; 16023 if (!isUserOverlayColor) { 16024 newOverlayColor = DEFAULT_OVERLAY_COLOR; 16025 setOverlayColor(void 0); 16026 __unstableMarkNextChangeAsNotPersistent(); 16027 } 16028 const newIsDark = compositeIsDark( 16029 dimRatio, 16030 newOverlayColor, 16031 DEFAULT_BACKGROUND_COLOR 16032 ); 16033 setAttributes({ 16034 url: void 0, 16035 id: void 0, 16036 backgroundType: void 0, 16037 focalPoint: void 0, 16038 hasParallax: void 0, 16039 isRepeated: void 0, 16040 useFeaturedImage: void 0, 16041 isDark: newIsDark 16042 }); 16043 }; 16044 const onSetOverlayColor = async (newOverlayColor) => { 16045 const averageBackgroundColor = await getMediaColor(url); 16046 const newIsDark = compositeIsDark( 16047 dimRatio, 16048 newOverlayColor, 16049 averageBackgroundColor 16050 ); 16051 setOverlayColor(newOverlayColor); 16052 __unstableMarkNextChangeAsNotPersistent(); 16053 setAttributes({ 16054 isUserOverlayColor: true, 16055 isDark: newIsDark 16056 }); 16057 }; 16058 const onUpdateDimRatio = async (newDimRatio) => { 16059 const averageBackgroundColor = await getMediaColor(url); 16060 const newIsDark = compositeIsDark( 16061 newDimRatio, 16062 overlayColor.color, 16063 averageBackgroundColor 16064 ); 16065 setAttributes({ 16066 dimRatio: newDimRatio, 16067 isDark: newIsDark 16068 }); 16069 }; 16070 const onUploadError = (message) => { 16071 createErrorNotice(message, { type: "snackbar" }); 16072 }; 16073 const onSelectEmbedUrl = (embedUrl) => { 16074 const newDimRatio = originalUrl === void 0 && dimRatio === 100 ? 50 : dimRatio; 16075 setAttributes({ 16076 url: embedUrl, 16077 backgroundType: EMBED_VIDEO_BACKGROUND_TYPE, 16078 dimRatio: newDimRatio, 16079 id: void 0, 16080 focalPoint: void 0, 16081 hasParallax: void 0, 16082 isRepeated: void 0, 16083 useFeaturedImage: void 0 16084 }); 16085 }; 16086 const { embedPreview, isFetchingEmbed } = (0, import_data28.useSelect)( 16087 (select9) => { 16088 if (backgroundType !== EMBED_VIDEO_BACKGROUND_TYPE || !url) { 16089 return { 16090 embedPreview: void 0, 16091 isFetchingEmbed: false 16092 }; 16093 } 16094 const { getEmbedPreview, isRequestingEmbedPreview } = select9(import_core_data16.store); 16095 return { 16096 embedPreview: getEmbedPreview(url), 16097 isFetchingEmbed: isRequestingEmbedPreview(url) 16098 }; 16099 }, 16100 [url, backgroundType] 16101 ); 16102 const embedSrc = (0, import_element25.useMemo)(() => { 16103 if (backgroundType !== EMBED_VIDEO_BACKGROUND_TYPE || !embedPreview?.html) { 16104 return null; 16105 } 16106 const iframeSrc = getIframeSrc(embedPreview.html); 16107 if (!iframeSrc) { 16108 return null; 16109 } 16110 return getBackgroundVideoSrc(iframeSrc); 16111 }, [embedPreview, backgroundType]); 16112 const isUploadingMedia = isTemporaryMedia(id, url); 16113 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 16114 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 16115 const isEmbedVideoBackground = EMBED_VIDEO_BACKGROUND_TYPE === backgroundType; 16116 const blockEditingMode = (0, import_block_editor67.useBlockEditingMode)(); 16117 const hasNonContentControls = blockEditingMode === "default"; 16118 const [resizeListener, { height, width }] = (0, import_compose15.useResizeObserver)(); 16119 const resizableBoxDimensions = (0, import_element25.useMemo)(() => { 16120 return { 16121 height: minHeightUnit === "px" && minHeight ? minHeight : "auto", 16122 width: "auto" 16123 }; 16124 }, [minHeight, minHeightUnit]); 16125 const minHeightWithUnit = minHeight && minHeightUnit ? `$minHeight}$minHeightUnit}` : minHeight; 16126 const isImgElement = !(hasParallax || isRepeated); 16127 const style2 = { 16128 minHeight: minHeightWithUnit || void 0 16129 }; 16130 const backgroundImage = url ? `url($url})` : void 0; 16131 const backgroundPosition = mediaPosition(focalPoint); 16132 const bgStyle = { backgroundColor: overlayColor.color }; 16133 const mediaStyle = { 16134 objectPosition: focalPoint && isImgElement ? mediaPosition(focalPoint) : void 0 16135 }; 16136 const hasBackground = !!(url || overlayColor.color || gradientValue); 16137 const hasInnerBlocks = (0, import_data28.useSelect)( 16138 (select9) => select9(import_block_editor67.store).getBlock(clientId).innerBlocks.length > 0, 16139 [clientId] 16140 ); 16141 const ref = (0, import_element25.useRef)(); 16142 const blockProps = (0, import_block_editor67.useBlockProps)({ ref }); 16143 const [fontSizes] = (0, import_block_editor67.useSettings)("typography.fontSizes"); 16144 const hasFontSizes = fontSizes?.length > 0; 16145 const innerBlocksTemplate = getInnerBlocksTemplate({ 16146 fontSize: hasFontSizes ? "large" : void 0 16147 }); 16148 const innerBlocksProps = (0, import_block_editor67.useInnerBlocksProps)( 16149 { 16150 className: "wp-block-cover__inner-container" 16151 }, 16152 { 16153 // Avoid template sync when the `templateLock` value is `all` or `contentOnly`. 16154 // See: https://github.com/WordPress/gutenberg/pull/45632 16155 template: !hasInnerBlocks ? innerBlocksTemplate : void 0, 16156 templateInsertUpdatesSelection: true, 16157 allowedBlocks, 16158 templateLock, 16159 dropZoneElement: ref.current 16160 } 16161 ); 16162 const mediaElement = (0, import_element25.useRef)(); 16163 const currentSettings = { 16164 isVideoBackground, 16165 isImageBackground, 16166 mediaElement, 16167 hasInnerBlocks, 16168 url, 16169 isImgElement, 16170 overlayColor 16171 }; 16172 const toggleUseFeaturedImage = async () => { 16173 const newUseFeaturedImage = !useFeaturedImage; 16174 const averageBackgroundColor = newUseFeaturedImage ? await getMediaColor(mediaUrl) : DEFAULT_BACKGROUND_COLOR; 16175 const newOverlayColor = !isUserOverlayColor ? averageBackgroundColor : overlayColor.color; 16176 if (!isUserOverlayColor) { 16177 if (newUseFeaturedImage) { 16178 setOverlayColor(newOverlayColor); 16179 } else { 16180 setOverlayColor(void 0); 16181 } 16182 __unstableMarkNextChangeAsNotPersistent(); 16183 } 16184 const newDimRatio = dimRatio === 100 ? 50 : dimRatio; 16185 const newIsDark = compositeIsDark( 16186 newDimRatio, 16187 newOverlayColor, 16188 averageBackgroundColor 16189 ); 16190 setAttributes({ 16191 id: void 0, 16192 url: void 0, 16193 useFeaturedImage: newUseFeaturedImage, 16194 dimRatio: newDimRatio, 16195 backgroundType: useFeaturedImage ? IMAGE_BACKGROUND_TYPE : void 0, 16196 isDark: newIsDark 16197 }); 16198 }; 16199 const blockControls = /* @__PURE__ */ (0, import_jsx_runtime216.jsx)( 16200 CoverBlockControls, 16201 { 16202 attributes: attributes3, 16203 setAttributes, 16204 onSelectMedia, 16205 onSelectEmbedUrl, 16206 currentSettings, 16207 toggleUseFeaturedImage, 16208 onClearMedia, 16209 blockEditingMode 16210 } 16211 ); 16212 const inspectorControls = /* @__PURE__ */ (0, import_jsx_runtime216.jsx)( 16213 CoverInspectorControls, 16214 { 16215 attributes: attributes3, 16216 setAttributes, 16217 clientId, 16218 setOverlayColor: onSetOverlayColor, 16219 coverRef: ref, 16220 currentSettings, 16221 toggleUseFeaturedImage, 16222 updateDimRatio: onUpdateDimRatio, 16223 onClearMedia, 16224 featuredImage: media 16225 } 16226 ); 16227 const resizableCoverProps = { 16228 className: "block-library-cover__resize-container", 16229 clientId, 16230 height, 16231 minHeight: minHeightWithUnit, 16232 onResizeStart: () => { 16233 setAttributes({ minHeightUnit: "px" }); 16234 toggleSelection(false); 16235 }, 16236 onResize: (value) => { 16237 setAttributes({ minHeight: value }); 16238 }, 16239 onResizeStop: (newMinHeight) => { 16240 toggleSelection(true); 16241 setAttributes({ minHeight: newMinHeight }); 16242 }, 16243 // Hide the resize handle if an aspect ratio is set, as the aspect ratio takes precedence. 16244 showHandle: !attributes3.style?.dimensions?.aspectRatio, 16245 size: resizableBoxDimensions, 16246 width 16247 }; 16248 if (!useFeaturedImage && !hasInnerBlocks && !hasBackground) { 16249 return /* @__PURE__ */ (0, import_jsx_runtime216.jsxs)(import_jsx_runtime216.Fragment, { children: [ 16250 blockControls, 16251 inspectorControls, 16252 hasNonContentControls && isSelected && /* @__PURE__ */ (0, import_jsx_runtime216.jsx)(ResizableCoverPopover, { ...resizableCoverProps }), 16253 /* @__PURE__ */ (0, import_jsx_runtime216.jsxs)( 16254 TagName2, 16255 { 16256 ...blockProps, 16257 className: clsx_default("is-placeholder", blockProps.className), 16258 style: { 16259 ...blockProps.style, 16260 minHeight: minHeightWithUnit || void 0 16261 }, 16262 children: [ 16263 resizeListener, 16264 /* @__PURE__ */ (0, import_jsx_runtime216.jsx)( 16265 CoverPlaceholder, 16266 { 16267 onSelectMedia, 16268 onError: onUploadError, 16269 toggleUseFeaturedImage, 16270 children: /* @__PURE__ */ (0, import_jsx_runtime216.jsx)("div", { className: "wp-block-cover__placeholder-background-options", children: /* @__PURE__ */ (0, import_jsx_runtime216.jsx)( 16271 import_block_editor67.ColorPalette, 16272 { 16273 disableCustomColors: true, 16274 value: overlayColor.color, 16275 onChange: onSetOverlayColor, 16276 clearable: false, 16277 asButtons: true, 16278 "aria-label": (0, import_i18n52.__)("Overlay color") 16279 } 16280 ) }) 16281 } 16282 ) 16283 ] 16284 } 16285 ) 16286 ] }); 16287 } 16288 const classes = clsx_default( 16289 { 16290 "is-dark-theme": isDark2, 16291 "is-light": !isDark2, 16292 "is-transient": isUploadingMedia, 16293 "has-parallax": hasParallax, 16294 "is-repeated": isRepeated, 16295 "has-custom-content-position": !isContentPositionCenter(contentPosition) 16296 }, 16297 getPositionClassName(contentPosition) 16298 ); 16299 const showOverlay = url || !useFeaturedImage || useFeaturedImage && !url; 16300 return /* @__PURE__ */ (0, import_jsx_runtime216.jsxs)(import_jsx_runtime216.Fragment, { children: [ 16301 blockControls, 16302 inspectorControls, 16303 /* @__PURE__ */ (0, import_jsx_runtime216.jsxs)( 16304 TagName2, 16305 { 16306 ...blockProps, 16307 className: clsx_default(classes, blockProps.className), 16308 style: { ...style2, ...blockProps.style }, 16309 "data-url": url, 16310 children: [ 16311 resizeListener, 16312 !url && useFeaturedImage && /* @__PURE__ */ (0, import_jsx_runtime216.jsx)( 16313 import_components34.Placeholder, 16314 { 16315 className: "wp-block-cover__image--placeholder-image", 16316 withIllustration: true 16317 } 16318 ), 16319 url && isImageBackground && (isImgElement ? /* @__PURE__ */ (0, import_jsx_runtime216.jsx)( 16320 "img", 16321 { 16322 ref: mediaElement, 16323 className: "wp-block-cover__image-background", 16324 alt, 16325 src: url, 16326 style: mediaStyle 16327 } 16328 ) : /* @__PURE__ */ (0, import_jsx_runtime216.jsx)( 16329 "div", 16330 { 16331 ref: mediaElement, 16332 role: alt ? "img" : void 0, 16333 "aria-label": alt ? alt : void 0, 16334 className: clsx_default( 16335 classes, 16336 "wp-block-cover__image-background" 16337 ), 16338 style: { backgroundImage, backgroundPosition } 16339 } 16340 )), 16341 url && isVideoBackground && /* @__PURE__ */ (0, import_jsx_runtime216.jsx)( 16342 "video", 16343 { 16344 ref: mediaElement, 16345 className: "wp-block-cover__video-background", 16346 autoPlay: true, 16347 muted: true, 16348 loop: true, 16349 src: url, 16350 poster, 16351 style: mediaStyle 16352 } 16353 ), 16354 isEmbedVideoBackground && embedSrc && /* @__PURE__ */ (0, import_jsx_runtime216.jsx)( 16355 "div", 16356 { 16357 ref: mediaElement, 16358 className: "wp-block-cover__video-background wp-block-cover__embed-background", 16359 style: mediaStyle, 16360 children: /* @__PURE__ */ (0, import_jsx_runtime216.jsx)( 16361 "iframe", 16362 { 16363 src: embedSrc, 16364 title: "Background video", 16365 frameBorder: "0", 16366 allow: "autoplay; fullscreen" 16367 } 16368 ) 16369 } 16370 ), 16371 isEmbedVideoBackground && !embedSrc && isFetchingEmbed && /* @__PURE__ */ (0, import_jsx_runtime216.jsx)(import_components34.Spinner, {}), 16372 showOverlay && /* @__PURE__ */ (0, import_jsx_runtime216.jsx)( 16373 "span", 16374 { 16375 "aria-hidden": "true", 16376 className: clsx_default( 16377 "wp-block-cover__background", 16378 dimRatioToClass(dimRatio), 16379 { 16380 [overlayColor.class]: overlayColor.class, 16381 "has-background-dim": dimRatio !== void 0, 16382 // For backwards compatibility. Former versions of the Cover Block applied 16383 // `.wp-block-cover__gradient-background` in the presence of 16384 // media, a gradient and a dim. 16385 "wp-block-cover__gradient-background": url && gradientValue && dimRatio !== 0, 16386 "has-background-gradient": gradientValue, 16387 [gradientClass]: gradientClass 16388 } 16389 ), 16390 style: { backgroundImage: gradientValue, ...bgStyle } 16391 } 16392 ), 16393 isUploadingMedia && /* @__PURE__ */ (0, import_jsx_runtime216.jsx)(import_components34.Spinner, {}), 16394 /* @__PURE__ */ (0, import_jsx_runtime216.jsx)( 16395 CoverPlaceholder, 16396 { 16397 disableMediaButtons: true, 16398 onSelectMedia, 16399 onError: onUploadError, 16400 toggleUseFeaturedImage 16401 } 16402 ), 16403 /* @__PURE__ */ (0, import_jsx_runtime216.jsx)("div", { ...innerBlocksProps }) 16404 ] 16405 } 16406 ), 16407 hasNonContentControls && isSelected && /* @__PURE__ */ (0, import_jsx_runtime216.jsx)(ResizableCoverPopover, { ...resizableCoverProps }) 16408 ] }); 16409 } 16410 var edit_default7 = (0, import_compose15.compose)([ 16411 (0, import_block_editor67.withColors)({ overlayColor: "background-color" }) 16412 ])(CoverEdit); 16413 16414 // packages/block-library/build-module/cover/block.json 16415 var block_default31 = { 16416 $schema: "https://schemas.wp.org/trunk/block.json", 16417 apiVersion: 3, 16418 name: "core/cover", 16419 title: "Cover", 16420 category: "media", 16421 description: "Add an image or video with a text overlay.", 16422 textdomain: "default", 16423 attributes: { 16424 url: { 16425 type: "string", 16426 role: "content" 16427 }, 16428 useFeaturedImage: { 16429 type: "boolean", 16430 default: false 16431 }, 16432 id: { 16433 type: "number" 16434 }, 16435 alt: { 16436 type: "string", 16437 default: "" 16438 }, 16439 hasParallax: { 16440 type: "boolean", 16441 default: false 16442 }, 16443 isRepeated: { 16444 type: "boolean", 16445 default: false 16446 }, 16447 dimRatio: { 16448 type: "number", 16449 default: 100 16450 }, 16451 overlayColor: { 16452 type: "string" 16453 }, 16454 customOverlayColor: { 16455 type: "string" 16456 }, 16457 isUserOverlayColor: { 16458 type: "boolean" 16459 }, 16460 backgroundType: { 16461 type: "string", 16462 default: "image" 16463 }, 16464 focalPoint: { 16465 type: "object" 16466 }, 16467 minHeight: { 16468 type: "number" 16469 }, 16470 minHeightUnit: { 16471 type: "string" 16472 }, 16473 gradient: { 16474 type: "string" 16475 }, 16476 customGradient: { 16477 type: "string" 16478 }, 16479 contentPosition: { 16480 type: "string" 16481 }, 16482 isDark: { 16483 type: "boolean", 16484 default: true 16485 }, 16486 templateLock: { 16487 type: ["string", "boolean"], 16488 enum: ["all", "insert", "contentOnly", false] 16489 }, 16490 tagName: { 16491 type: "string", 16492 default: "div" 16493 }, 16494 sizeSlug: { 16495 type: "string" 16496 }, 16497 poster: { 16498 type: "string", 16499 source: "attribute", 16500 selector: "video", 16501 attribute: "poster" 16502 } 16503 }, 16504 usesContext: ["postId", "postType"], 16505 supports: { 16506 anchor: true, 16507 align: true, 16508 html: false, 16509 shadow: true, 16510 spacing: { 16511 padding: true, 16512 margin: ["top", "bottom"], 16513 blockGap: true, 16514 __experimentalDefaultControls: { 16515 padding: true, 16516 blockGap: true 16517 } 16518 }, 16519 __experimentalBorder: { 16520 color: true, 16521 radius: true, 16522 style: true, 16523 width: true, 16524 __experimentalDefaultControls: { 16525 color: true, 16526 radius: true, 16527 style: true, 16528 width: true 16529 } 16530 }, 16531 color: { 16532 heading: true, 16533 text: true, 16534 background: false, 16535 __experimentalSkipSerialization: ["gradients"], 16536 enableContrastChecker: false 16537 }, 16538 dimensions: { 16539 aspectRatio: true 16540 }, 16541 typography: { 16542 fontSize: true, 16543 lineHeight: true, 16544 __experimentalFontFamily: true, 16545 __experimentalFontWeight: true, 16546 __experimentalFontStyle: true, 16547 __experimentalTextTransform: true, 16548 __experimentalTextDecoration: true, 16549 __experimentalLetterSpacing: true, 16550 __experimentalDefaultControls: { 16551 fontSize: true 16552 } 16553 }, 16554 layout: { 16555 allowJustification: false 16556 }, 16557 interactivity: { 16558 clientNavigation: true 16559 }, 16560 filter: { 16561 duotone: true 16562 }, 16563 allowedBlocks: true 16564 }, 16565 selectors: { 16566 filter: { 16567 duotone: ".wp-block-cover > .wp-block-cover__image-background, .wp-block-cover > .wp-block-cover__video-background" 16568 } 16569 }, 16570 editorStyle: "wp-block-cover-editor", 16571 style: "wp-block-cover" 16572 }; 16573 16574 // packages/block-library/build-module/cover/save.js 16575 var import_block_editor68 = __toESM(require_block_editor()); 16576 var import_jsx_runtime217 = __toESM(require_jsx_runtime()); 16577 function save14({ attributes: attributes3 }) { 16578 const { 16579 backgroundType, 16580 gradient, 16581 contentPosition, 16582 customGradient, 16583 customOverlayColor, 16584 dimRatio, 16585 focalPoint, 16586 useFeaturedImage, 16587 hasParallax, 16588 isDark: isDark2, 16589 isRepeated, 16590 overlayColor, 16591 url, 16592 alt, 16593 id, 16594 minHeight: minHeightProp, 16595 minHeightUnit, 16596 tagName: Tag, 16597 sizeSlug, 16598 poster 16599 } = attributes3; 16600 const overlayColorClass = (0, import_block_editor68.getColorClassName)( 16601 "background-color", 16602 overlayColor 16603 ); 16604 const gradientClass = (0, import_block_editor68.__experimentalGetGradientClass)(gradient); 16605 const minHeight = minHeightProp && minHeightUnit ? `$minHeightProp}$minHeightUnit}` : minHeightProp; 16606 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 16607 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 16608 const isEmbedVideoBackground = EMBED_VIDEO_BACKGROUND_TYPE === backgroundType; 16609 const isImgElement = !(hasParallax || isRepeated); 16610 const style2 = { 16611 minHeight: minHeight || void 0 16612 }; 16613 const bgStyle = { 16614 backgroundColor: !overlayColorClass ? customOverlayColor : void 0, 16615 background: customGradient ? customGradient : void 0 16616 }; 16617 const objectPosition = ( 16618 // prettier-ignore 16619 focalPoint && isImgElement ? mediaPosition(focalPoint) : void 0 16620 ); 16621 const backgroundImage = url ? `url($url})` : void 0; 16622 const backgroundPosition = mediaPosition(focalPoint); 16623 const classes = clsx_default( 16624 { 16625 "is-light": !isDark2, 16626 "has-parallax": hasParallax, 16627 "is-repeated": isRepeated, 16628 "has-custom-content-position": !isContentPositionCenter(contentPosition) 16629 }, 16630 getPositionClassName(contentPosition) 16631 ); 16632 const imgClasses = clsx_default( 16633 "wp-block-cover__image-background", 16634 id ? `wp-image-$id}` : null, 16635 { 16636 [`size-$sizeSlug}`]: sizeSlug, 16637 "has-parallax": hasParallax, 16638 "is-repeated": isRepeated 16639 } 16640 ); 16641 const gradientValue = gradient || customGradient; 16642 return /* @__PURE__ */ (0, import_jsx_runtime217.jsxs)(Tag, { ...import_block_editor68.useBlockProps.save({ className: classes, style: style2 }), children: [ 16643 !useFeaturedImage && isImageBackground && url && (isImgElement ? /* @__PURE__ */ (0, import_jsx_runtime217.jsx)( 16644 "img", 16645 { 16646 className: imgClasses, 16647 alt, 16648 src: url, 16649 style: { objectPosition }, 16650 "data-object-fit": "cover", 16651 "data-object-position": objectPosition 16652 } 16653 ) : /* @__PURE__ */ (0, import_jsx_runtime217.jsx)( 16654 "div", 16655 { 16656 role: alt ? "img" : void 0, 16657 "aria-label": alt ? alt : void 0, 16658 className: imgClasses, 16659 style: { backgroundPosition, backgroundImage } 16660 } 16661 )), 16662 isVideoBackground && url && /* @__PURE__ */ (0, import_jsx_runtime217.jsx)( 16663 "video", 16664 { 16665 className: clsx_default( 16666 "wp-block-cover__video-background", 16667 "intrinsic-ignore" 16668 ), 16669 autoPlay: true, 16670 muted: true, 16671 loop: true, 16672 playsInline: true, 16673 src: url, 16674 poster, 16675 style: { objectPosition }, 16676 "data-object-fit": "cover", 16677 "data-object-position": objectPosition 16678 } 16679 ), 16680 isEmbedVideoBackground && url && /* @__PURE__ */ (0, import_jsx_runtime217.jsx)( 16681 "figure", 16682 { 16683 className: clsx_default( 16684 "wp-block-cover__video-background", 16685 "wp-block-cover__embed-background", 16686 "wp-block-embed" 16687 ), 16688 children: /* @__PURE__ */ (0, import_jsx_runtime217.jsx)("div", { className: "wp-block-embed__wrapper", children: url }) 16689 } 16690 ), 16691 /* @__PURE__ */ (0, import_jsx_runtime217.jsx)( 16692 "span", 16693 { 16694 "aria-hidden": "true", 16695 className: clsx_default( 16696 "wp-block-cover__background", 16697 overlayColorClass, 16698 dimRatioToClass(dimRatio), 16699 { 16700 "has-background-dim": dimRatio !== void 0, 16701 // For backwards compatibility. Former versions of the Cover Block applied 16702 // `.wp-block-cover__gradient-background` in the presence of 16703 // media, a gradient and a dim. 16704 "wp-block-cover__gradient-background": url && gradientValue && dimRatio !== 0, 16705 "has-background-gradient": gradientValue, 16706 [gradientClass]: gradientClass 16707 } 16708 ), 16709 style: bgStyle 16710 } 16711 ), 16712 /* @__PURE__ */ (0, import_jsx_runtime217.jsx)( 16713 "div", 16714 { 16715 ...import_block_editor68.useInnerBlocksProps.save({ 16716 className: "wp-block-cover__inner-container" 16717 }) 16718 } 16719 ) 16720 ] }); 16721 } 16722 16723 // packages/block-library/build-module/cover/transforms.js 16724 var import_blocks22 = __toESM(require_blocks()); 16725 var import_block_editor69 = __toESM(require_block_editor()); 16726 var { cleanEmptyObject: cleanEmptyObject4 } = unlock(import_block_editor69.privateApis); 16727 var transforms6 = { 16728 from: [ 16729 { 16730 type: "block", 16731 blocks: ["core/image"], 16732 transform: ({ caption, url, alt, align, id, anchor, style: style2 }) => (0, import_blocks22.createBlock)( 16733 "core/cover", 16734 { 16735 dimRatio: 50, 16736 url, 16737 alt, 16738 align, 16739 id, 16740 anchor, 16741 style: { 16742 color: { 16743 duotone: style2?.color?.duotone 16744 } 16745 } 16746 }, 16747 [ 16748 (0, import_blocks22.createBlock)("core/paragraph", { 16749 content: caption, 16750 fontSize: "large", 16751 style: { 16752 typography: { 16753 textAlign: "center" 16754 } 16755 } 16756 }) 16757 ] 16758 ) 16759 }, 16760 { 16761 type: "block", 16762 blocks: ["core/video"], 16763 transform: ({ caption, src, align, id, anchor }) => (0, import_blocks22.createBlock)( 16764 "core/cover", 16765 { 16766 dimRatio: 50, 16767 url: src, 16768 align, 16769 id, 16770 backgroundType: VIDEO_BACKGROUND_TYPE, 16771 anchor 16772 }, 16773 [ 16774 (0, import_blocks22.createBlock)("core/paragraph", { 16775 content: caption, 16776 fontSize: "large", 16777 style: { 16778 typography: { 16779 textAlign: "center" 16780 } 16781 } 16782 }) 16783 ] 16784 ) 16785 }, 16786 { 16787 type: "block", 16788 blocks: ["core/group"], 16789 transform: (attributes3, innerBlocks) => { 16790 const { align, anchor, backgroundColor, gradient, style: style2 } = attributes3; 16791 if (innerBlocks?.length === 1 && innerBlocks[0]?.name === "core/cover") { 16792 return (0, import_blocks22.createBlock)( 16793 "core/cover", 16794 innerBlocks[0].attributes, 16795 innerBlocks[0].innerBlocks 16796 ); 16797 } 16798 const dimRatio = backgroundColor || gradient || style2?.color?.background || style2?.color?.gradient ? void 0 : 50; 16799 const parentAttributes = { 16800 align, 16801 anchor, 16802 dimRatio, 16803 overlayColor: backgroundColor, 16804 customOverlayColor: style2?.color?.background, 16805 gradient, 16806 customGradient: style2?.color?.gradient 16807 }; 16808 const attributesWithoutBackgroundColors = { 16809 ...attributes3, 16810 backgroundColor: void 0, 16811 gradient: void 0, 16812 style: cleanEmptyObject4({ 16813 ...attributes3?.style, 16814 color: style2?.color ? { 16815 ...style2?.color, 16816 background: void 0, 16817 gradient: void 0 16818 } : void 0 16819 }) 16820 }; 16821 return (0, import_blocks22.createBlock)("core/cover", parentAttributes, [ 16822 (0, import_blocks22.createBlock)( 16823 "core/group", 16824 attributesWithoutBackgroundColors, 16825 innerBlocks 16826 ) 16827 ]); 16828 } 16829 } 16830 ], 16831 to: [ 16832 { 16833 type: "block", 16834 blocks: ["core/image"], 16835 isMatch: ({ 16836 backgroundType, 16837 url, 16838 overlayColor, 16839 customOverlayColor, 16840 gradient, 16841 customGradient 16842 }) => { 16843 if (url) { 16844 return backgroundType === IMAGE_BACKGROUND_TYPE; 16845 } 16846 return !overlayColor && !customOverlayColor && !gradient && !customGradient; 16847 }, 16848 transform: ({ title, url, alt, align, id, anchor, style: style2 }) => (0, import_blocks22.createBlock)("core/image", { 16849 caption: title, 16850 url, 16851 alt, 16852 align, 16853 id, 16854 anchor, 16855 style: { 16856 color: { 16857 duotone: style2?.color?.duotone 16858 } 16859 } 16860 }) 16861 }, 16862 { 16863 type: "block", 16864 blocks: ["core/video"], 16865 isMatch: ({ 16866 backgroundType, 16867 url, 16868 overlayColor, 16869 customOverlayColor, 16870 gradient, 16871 customGradient 16872 }) => { 16873 if (url) { 16874 return backgroundType === VIDEO_BACKGROUND_TYPE; 16875 } 16876 return !overlayColor && !customOverlayColor && !gradient && !customGradient; 16877 }, 16878 transform: ({ title, url, align, id, anchor }) => (0, import_blocks22.createBlock)("core/video", { 16879 caption: title, 16880 src: url, 16881 id, 16882 align, 16883 anchor 16884 }) 16885 }, 16886 { 16887 type: "block", 16888 blocks: ["core/group"], 16889 isMatch: ({ url, useFeaturedImage }) => { 16890 if (url || useFeaturedImage) { 16891 return false; 16892 } 16893 return true; 16894 }, 16895 transform: (attributes3, innerBlocks) => { 16896 const transformedColorAttributes = { 16897 backgroundColor: attributes3?.overlayColor, 16898 gradient: attributes3?.gradient, 16899 style: cleanEmptyObject4({ 16900 ...attributes3?.style, 16901 color: attributes3?.customOverlayColor || attributes3?.customGradient || attributes3?.style?.color ? { 16902 background: attributes3?.customOverlayColor, 16903 gradient: attributes3?.customGradient, 16904 ...attributes3?.style?.color 16905 } : void 0 16906 }) 16907 }; 16908 if (innerBlocks?.length === 1 && innerBlocks[0]?.name === "core/group") { 16909 const groupAttributes = cleanEmptyObject4( 16910 innerBlocks[0].attributes || {} 16911 ); 16912 if (groupAttributes?.backgroundColor || groupAttributes?.gradient || groupAttributes?.style?.color?.background || groupAttributes?.style?.color?.gradient) { 16913 return (0, import_blocks22.createBlock)( 16914 "core/group", 16915 groupAttributes, 16916 innerBlocks[0]?.innerBlocks 16917 ); 16918 } 16919 return (0, import_blocks22.createBlock)( 16920 "core/group", 16921 { 16922 ...transformedColorAttributes, 16923 ...groupAttributes, 16924 style: cleanEmptyObject4({ 16925 ...groupAttributes?.style, 16926 color: transformedColorAttributes?.style?.color || groupAttributes?.style?.color ? { 16927 ...transformedColorAttributes?.style?.color, 16928 ...groupAttributes?.style?.color 16929 } : void 0 16930 }) 16931 }, 16932 innerBlocks[0]?.innerBlocks 16933 ); 16934 } 16935 return (0, import_blocks22.createBlock)( 16936 "core/group", 16937 { ...attributes3, ...transformedColorAttributes }, 16938 innerBlocks 16939 ); 16940 } 16941 } 16942 ] 16943 }; 16944 var transforms_default6 = transforms6; 16945 16946 // packages/block-library/build-module/cover/variations.js 16947 var import_i18n53 = __toESM(require_i18n()); 16948 var variations3 = [ 16949 { 16950 name: "cover", 16951 title: (0, import_i18n53.__)("Cover"), 16952 description: (0, import_i18n53.__)("Add an image or video with a text overlay."), 16953 attributes: { layout: { type: "constrained" } }, 16954 isDefault: true, 16955 icon: cover_default 16956 } 16957 ]; 16958 var variations_default3 = variations3; 16959 16960 // packages/block-library/build-module/cover/index.js 16961 var { fieldsKey: fieldsKey4, formKey: formKey4 } = unlock(import_blocks23.privateApis); 16962 var { name: name30 } = block_default31; 16963 var settings30 = { 16964 icon: cover_default, 16965 example: { 16966 attributes: { 16967 customOverlayColor: "#065174", 16968 dimRatio: 40, 16969 url: "https://s.w.org/images/core/5.3/Windbuchencom.jpg", 16970 style: { 16971 typography: { 16972 fontSize: 48 16973 }, 16974 color: { 16975 text: "white" 16976 } 16977 } 16978 }, 16979 innerBlocks: [ 16980 { 16981 name: "core/paragraph", 16982 attributes: { 16983 content: `<strong>${(0, import_i18n54.__)("Snow Patrol")}</strong>`, 16984 style: { 16985 typography: { 16986 textAlign: "center" 16987 } 16988 } 16989 } 16990 } 16991 ] 16992 }, 16993 transforms: transforms_default6, 16994 save: save14, 16995 edit: edit_default7, 16996 deprecated: deprecated_default11, 16997 variations: variations_default3 16998 }; 16999 if (window.__experimentalContentOnlyInspectorFields) { 17000 settings30[fieldsKey4] = [ 17001 { 17002 id: "background", 17003 label: (0, import_i18n54.__)("Background"), 17004 type: "media", 17005 mapping: { 17006 type: "backgroundType", 17007 id: "id", 17008 url: "url", 17009 alt: "alt", 17010 featuredImage: "useFeaturedImage" 17011 }, 17012 args: { 17013 // TODO - How to support custom gradient? 17014 // Build it into Media, or use a custom control? 17015 allowedTypes: ["image", "video"], 17016 multiple: false 17017 } 17018 } 17019 ]; 17020 settings30[formKey4] = { 17021 fields: ["background"] 17022 }; 17023 } 17024 var init30 = () => initBlock({ name: name30, metadata: block_default31, settings: settings30 }); 17025 17026 // packages/block-library/build-module/details/index.js 17027 var details_exports = {}; 17028 __export(details_exports, { 17029 init: () => init31, 17030 metadata: () => block_default32, 17031 name: () => name31, 17032 settings: () => settings31 17033 }); 17034 var import_i18n56 = __toESM(require_i18n()); 17035 var import_blocks25 = __toESM(require_blocks()); 17036 17037 // packages/block-library/build-module/details/block.json 17038 var block_default32 = { 17039 $schema: "https://schemas.wp.org/trunk/block.json", 17040 apiVersion: 3, 17041 name: "core/details", 17042 title: "Details", 17043 category: "text", 17044 description: "Hide and show additional content.", 17045 keywords: ["summary", "toggle", "disclosure"], 17046 textdomain: "default", 17047 attributes: { 17048 showContent: { 17049 type: "boolean", 17050 default: false 17051 }, 17052 summary: { 17053 type: "rich-text", 17054 source: "rich-text", 17055 selector: "summary", 17056 role: "content" 17057 }, 17058 name: { 17059 type: "string", 17060 source: "attribute", 17061 attribute: "name", 17062 selector: ".wp-block-details" 17063 }, 17064 placeholder: { 17065 type: "string" 17066 } 17067 }, 17068 supports: { 17069 __experimentalOnEnter: true, 17070 align: ["wide", "full"], 17071 anchor: true, 17072 color: { 17073 gradients: true, 17074 link: true, 17075 __experimentalDefaultControls: { 17076 background: true, 17077 text: true 17078 } 17079 }, 17080 __experimentalBorder: { 17081 color: true, 17082 width: true, 17083 style: true 17084 }, 17085 html: false, 17086 spacing: { 17087 margin: true, 17088 padding: true, 17089 blockGap: true, 17090 __experimentalDefaultControls: { 17091 margin: false, 17092 padding: false 17093 } 17094 }, 17095 typography: { 17096 fontSize: true, 17097 lineHeight: true, 17098 __experimentalFontFamily: true, 17099 __experimentalFontWeight: true, 17100 __experimentalFontStyle: true, 17101 __experimentalTextTransform: true, 17102 __experimentalTextDecoration: true, 17103 __experimentalLetterSpacing: true, 17104 __experimentalDefaultControls: { 17105 fontSize: true 17106 } 17107 }, 17108 layout: { 17109 allowEditing: false 17110 }, 17111 interactivity: { 17112 clientNavigation: true 17113 }, 17114 allowedBlocks: true 17115 }, 17116 editorStyle: "wp-block-details-editor", 17117 style: "wp-block-details" 17118 }; 17119 17120 // packages/block-library/build-module/details/edit.js 17121 var import_block_editor70 = __toESM(require_block_editor()); 17122 var import_components35 = __toESM(require_components()); 17123 var import_i18n55 = __toESM(require_i18n()); 17124 var import_element26 = __toESM(require_element()); 17125 var import_data29 = __toESM(require_data()); 17126 var import_jsx_runtime218 = __toESM(require_jsx_runtime()); 17127 var { withIgnoreIMEEvents } = unlock(import_components35.privateApis); 17128 var TEMPLATE4 = [ 17129 [ 17130 "core/paragraph", 17131 { 17132 placeholder: (0, import_i18n55.__)("Type / to add a hidden block") 17133 } 17134 ] 17135 ]; 17136 function DetailsEdit({ attributes: attributes3, setAttributes, clientId }) { 17137 const { name: name117, showContent, summary, allowedBlocks, placeholder: placeholder2 } = attributes3; 17138 const blockProps = (0, import_block_editor70.useBlockProps)(); 17139 const innerBlocksProps = (0, import_block_editor70.useInnerBlocksProps)(blockProps, { 17140 template: TEMPLATE4, 17141 __experimentalCaptureToolbars: true, 17142 allowedBlocks 17143 }); 17144 const [isOpen, setIsOpen] = (0, import_element26.useState)(showContent); 17145 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 17146 const hasSelectedInnerBlock = (0, import_data29.useSelect)( 17147 (select9) => select9(import_block_editor70.store).hasSelectedInnerBlock(clientId, true), 17148 [clientId] 17149 ); 17150 const handleSummaryKeyDown = (event) => { 17151 if (event.key === "Enter" && !event.shiftKey) { 17152 setIsOpen((prevIsOpen) => !prevIsOpen); 17153 event.preventDefault(); 17154 } 17155 }; 17156 const handleSummaryKeyUp = (event) => { 17157 if (event.key === " ") { 17158 event.preventDefault(); 17159 } 17160 }; 17161 return /* @__PURE__ */ (0, import_jsx_runtime218.jsxs)(import_jsx_runtime218.Fragment, { children: [ 17162 /* @__PURE__ */ (0, import_jsx_runtime218.jsx)(import_block_editor70.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime218.jsx)( 17163 import_components35.__experimentalToolsPanel, 17164 { 17165 label: (0, import_i18n55.__)("Settings"), 17166 resetAll: () => { 17167 setAttributes({ 17168 showContent: false 17169 }); 17170 }, 17171 dropdownMenuProps, 17172 children: /* @__PURE__ */ (0, import_jsx_runtime218.jsx)( 17173 import_components35.__experimentalToolsPanelItem, 17174 { 17175 isShownByDefault: true, 17176 label: (0, import_i18n55.__)("Open by default"), 17177 hasValue: () => showContent, 17178 onDeselect: () => { 17179 setAttributes({ 17180 showContent: false 17181 }); 17182 }, 17183 children: /* @__PURE__ */ (0, import_jsx_runtime218.jsx)( 17184 import_components35.ToggleControl, 17185 { 17186 label: (0, import_i18n55.__)("Open by default"), 17187 checked: showContent, 17188 onChange: () => setAttributes({ 17189 showContent: !showContent 17190 }) 17191 } 17192 ) 17193 } 17194 ) 17195 } 17196 ) }), 17197 /* @__PURE__ */ (0, import_jsx_runtime218.jsx)(import_block_editor70.InspectorControls, { group: "advanced", children: /* @__PURE__ */ (0, import_jsx_runtime218.jsx)( 17198 import_components35.TextControl, 17199 { 17200 __next40pxDefaultSize: true, 17201 label: (0, import_i18n55.__)("Name attribute"), 17202 value: name117 || "", 17203 onChange: (newName) => setAttributes({ name: newName }), 17204 help: (0, import_i18n55.__)( 17205 "Enables multiple Details blocks with the same name attribute to be connected, with only one open at a time." 17206 ) 17207 } 17208 ) }), 17209 /* @__PURE__ */ (0, import_jsx_runtime218.jsxs)( 17210 "details", 17211 { 17212 ...innerBlocksProps, 17213 open: isOpen || hasSelectedInnerBlock, 17214 onToggle: (event) => setIsOpen(event.target.open), 17215 name: name117 || "", 17216 children: [ 17217 /* @__PURE__ */ (0, import_jsx_runtime218.jsx)( 17218 "summary", 17219 { 17220 onKeyDown: withIgnoreIMEEvents(handleSummaryKeyDown), 17221 onKeyUp: handleSummaryKeyUp, 17222 children: /* @__PURE__ */ (0, import_jsx_runtime218.jsx)( 17223 import_block_editor70.RichText, 17224 { 17225 identifier: "summary", 17226 "aria-label": (0, import_i18n55.__)( 17227 "Write summary. Press Enter to expand or collapse the details." 17228 ), 17229 placeholder: placeholder2 || (0, import_i18n55.__)("Write summary\u2026"), 17230 withoutInteractiveFormatting: true, 17231 value: summary, 17232 onChange: (newSummary) => setAttributes({ summary: newSummary }) 17233 } 17234 ) 17235 } 17236 ), 17237 innerBlocksProps.children 17238 ] 17239 } 17240 ) 17241 ] }); 17242 } 17243 var edit_default8 = DetailsEdit; 17244 17245 // packages/block-library/build-module/details/save.js 17246 var import_block_editor71 = __toESM(require_block_editor()); 17247 var import_jsx_runtime219 = __toESM(require_jsx_runtime()); 17248 function save15({ attributes: attributes3 }) { 17249 const { name: name117, showContent } = attributes3; 17250 const summary = attributes3.summary ? attributes3.summary : "Details"; 17251 const blockProps = import_block_editor71.useBlockProps.save(); 17252 return /* @__PURE__ */ (0, import_jsx_runtime219.jsxs)( 17253 "details", 17254 { 17255 ...blockProps, 17256 name: name117 || void 0, 17257 open: showContent, 17258 children: [ 17259 /* @__PURE__ */ (0, import_jsx_runtime219.jsx)("summary", { children: /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(import_block_editor71.RichText.Content, { value: summary }) }), 17260 /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(import_block_editor71.InnerBlocks.Content, {}) 17261 ] 17262 } 17263 ); 17264 } 17265 17266 // packages/block-library/build-module/details/transforms.js 17267 var import_blocks24 = __toESM(require_blocks()); 17268 var transforms_default7 = { 17269 from: [ 17270 { 17271 type: "block", 17272 isMultiBlock: true, 17273 blocks: ["*"], 17274 isMatch({}, blocks) { 17275 return !(blocks.length === 1 && blocks[0].name === "core/details"); 17276 }, 17277 __experimentalConvert(blocks) { 17278 return (0, import_blocks24.createBlock)( 17279 "core/details", 17280 {}, 17281 blocks.map((block) => (0, import_blocks24.cloneBlock)(block)) 17282 ); 17283 } 17284 } 17285 ] 17286 }; 17287 17288 // packages/block-library/build-module/details/index.js 17289 var { fieldsKey: fieldsKey5, formKey: formKey5 } = unlock(import_blocks25.privateApis); 17290 var { name: name31 } = block_default32; 17291 var settings31 = { 17292 icon: details_default, 17293 example: { 17294 attributes: { 17295 summary: (0, import_i18n56.__)("La Mancha"), 17296 showContent: true 17297 }, 17298 innerBlocks: [ 17299 { 17300 name: "core/paragraph", 17301 attributes: { 17302 content: (0, import_i18n56.__)( 17303 "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." 17304 ) 17305 } 17306 } 17307 ] 17308 }, 17309 __experimentalLabel(attributes3, { context }) { 17310 const { summary } = attributes3; 17311 const customName = attributes3?.metadata?.name; 17312 const hasSummary = summary?.trim().length > 0; 17313 if (context === "list-view" && (customName || hasSummary)) { 17314 return customName || summary; 17315 } 17316 if (context === "accessibility") { 17317 return !hasSummary ? (0, import_i18n56.__)("Details. Empty.") : (0, import_i18n56.sprintf)( 17318 /* translators: %s: accessibility text; summary title. */ 17319 (0, import_i18n56.__)("Details. %s"), 17320 summary 17321 ); 17322 } 17323 }, 17324 save: save15, 17325 edit: edit_default8, 17326 transforms: transforms_default7 17327 }; 17328 if (window.__experimentalContentOnlyInspectorFields) { 17329 settings31[fieldsKey5] = [ 17330 { 17331 id: "summary", 17332 label: (0, import_i18n56.__)("Summary"), 17333 type: "richtext" 17334 } 17335 ]; 17336 settings31[formKey5] = { 17337 fields: ["summary"] 17338 }; 17339 } 17340 var init31 = () => initBlock({ name: name31, metadata: block_default32, settings: settings31 }); 17341 17342 // packages/block-library/build-module/embed/index.js 17343 var embed_exports = {}; 17344 __export(embed_exports, { 17345 init: () => init32, 17346 metadata: () => block_default7, 17347 name: () => name32, 17348 settings: () => settings32 17349 }); 17350 17351 // packages/block-library/build-module/embed/embed-controls.js 17352 var import_i18n57 = __toESM(require_i18n()); 17353 var import_components36 = __toESM(require_components()); 17354 var import_block_editor72 = __toESM(require_block_editor()); 17355 var import_jsx_runtime220 = __toESM(require_jsx_runtime()); 17356 function getResponsiveHelp(checked) { 17357 return checked ? (0, import_i18n57.__)( 17358 "This embed will preserve its aspect ratio when the browser is resized." 17359 ) : (0, import_i18n57.__)( 17360 "This embed may not preserve its aspect ratio when the browser is resized." 17361 ); 17362 } 17363 var EmbedControls = ({ 17364 blockSupportsResponsive, 17365 showEditButton, 17366 themeSupportsResponsive, 17367 allowResponsive, 17368 toggleResponsive, 17369 switchBackToURLInput 17370 }) => { 17371 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 17372 return /* @__PURE__ */ (0, import_jsx_runtime220.jsxs)(import_jsx_runtime220.Fragment, { children: [ 17373 /* @__PURE__ */ (0, import_jsx_runtime220.jsx)(import_block_editor72.BlockControls, { children: /* @__PURE__ */ (0, import_jsx_runtime220.jsx)(import_components36.ToolbarGroup, { children: showEditButton && /* @__PURE__ */ (0, import_jsx_runtime220.jsx)( 17374 import_components36.ToolbarButton, 17375 { 17376 className: "components-toolbar__control", 17377 label: (0, import_i18n57.__)("Edit URL"), 17378 icon: pencil_default, 17379 onClick: switchBackToURLInput 17380 } 17381 ) }) }), 17382 themeSupportsResponsive && blockSupportsResponsive && /* @__PURE__ */ (0, import_jsx_runtime220.jsx)(import_block_editor72.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime220.jsx)( 17383 import_components36.__experimentalToolsPanel, 17384 { 17385 label: (0, import_i18n57.__)("Media settings"), 17386 resetAll: () => { 17387 toggleResponsive(true); 17388 }, 17389 dropdownMenuProps, 17390 children: /* @__PURE__ */ (0, import_jsx_runtime220.jsx)( 17391 import_components36.__experimentalToolsPanelItem, 17392 { 17393 label: (0, import_i18n57.__)("Media settings"), 17394 isShownByDefault: true, 17395 hasValue: () => !allowResponsive, 17396 onDeselect: () => { 17397 toggleResponsive(!allowResponsive); 17398 }, 17399 children: /* @__PURE__ */ (0, import_jsx_runtime220.jsx)( 17400 import_components36.ToggleControl, 17401 { 17402 label: (0, import_i18n57.__)("Resize for smaller devices"), 17403 checked: allowResponsive, 17404 help: getResponsiveHelp, 17405 onChange: toggleResponsive 17406 } 17407 ) 17408 } 17409 ) 17410 } 17411 ) }) 17412 ] }); 17413 }; 17414 var embed_controls_default = EmbedControls; 17415 17416 // packages/block-library/build-module/embed/icons.js 17417 var import_components37 = __toESM(require_components()); 17418 var import_jsx_runtime221 = __toESM(require_jsx_runtime()); 17419 var embedContentIcon = /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_components37.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_components37.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zm-6-9.5L16 12l-2.5 2.8 1.1 1L18 12l-3.5-3.5-1 1zm-3 0l-1-1L6 12l3.5 3.8 1.1-1L8 12l2.5-2.5z" }) }); 17420 var embedAudioIcon = /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_components37.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_components37.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zM13.2 7.7c-.4.4-.7 1.1-.7 1.9v3.7c-.4-.3-.8-.4-1.3-.4-1.2 0-2.2 1-2.2 2.2 0 1.2 1 2.2 2.2 2.2.5 0 1-.2 1.4-.5.9-.6 1.4-1.6 1.4-2.6V9.6c0-.4.1-.6.2-.8.3-.3 1-.3 1.6-.3h.2V7h-.2c-.7 0-1.8 0-2.6.7z" }) }); 17421 var embedPhotoIcon = /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_components37.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_components37.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9.2 4.5H19c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V9.8l4.6-5.3zm9.8 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z" }) }); 17422 var embedVideoIcon = /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_components37.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_components37.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zM10 15l5-3-5-3v6z" }) }); 17423 var embedTwitterIcon = { 17424 foreground: "#000000", 17425 src: /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_components37.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_components37.Path, { 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" }) }) 17426 }; 17427 var embedYouTubeIcon = { 17428 foreground: "#ff0000", 17429 src: /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_components37.SVG, { viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_components37.Path, { d: "M21.8 8s-.195-1.377-.795-1.984c-.76-.797-1.613-.8-2.004-.847-2.798-.203-6.996-.203-6.996-.203h-.01s-4.197 0-6.996.202c-.39.046-1.242.05-2.003.846C2.395 6.623 2.2 8 2.2 8S2 9.62 2 11.24v1.517c0 1.618.2 3.237.2 3.237s.195 1.378.795 1.985c.76.797 1.76.77 2.205.855 1.6.153 6.8.2 6.8.2s4.203-.005 7-.208c.392-.047 1.244-.05 2.005-.847.6-.607.795-1.985.795-1.985s.2-1.618.2-3.237v-1.517C22 9.62 21.8 8 21.8 8zM9.935 14.595v-5.62l5.403 2.82-5.403 2.8z" }) }) 17430 }; 17431 var embedFacebookIcon = { 17432 foreground: "#3b5998", 17433 src: /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_components37.SVG, { viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_components37.Path, { d: "M20 3H4c-.6 0-1 .4-1 1v16c0 .5.4 1 1 1h8.6v-7h-2.3v-2.7h2.3v-2c0-2.3 1.4-3.6 3.5-3.6 1 0 1.8.1 2.1.1v2.4h-1.4c-1.1 0-1.3.5-1.3 1.3v1.7h2.7l-.4 2.8h-2.3v7H20c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1z" }) }) 17434 }; 17435 var embedInstagramIcon = /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_components37.SVG, { viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_components37.G, { children: /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_components37.Path, { d: "M12 4.622c2.403 0 2.688.01 3.637.052.877.04 1.354.187 1.67.31.42.163.72.358 1.036.673.315.315.51.615.673 1.035.123.317.27.794.31 1.67.043.95.052 1.235.052 3.638s-.01 2.688-.052 3.637c-.04.877-.187 1.354-.31 1.67-.163.42-.358.72-.673 1.036-.315.315-.615.51-1.035.673-.317.123-.794.27-1.67.31-.95.043-1.234.052-3.638.052s-2.688-.01-3.637-.052c-.877-.04-1.354-.187-1.67-.31-.42-.163-.72-.358-1.036-.673-.315-.315-.51-.615-.673-1.035-.123-.317-.27-.794-.31-1.67-.043-.95-.052-1.235-.052-3.638s.01-2.688.052-3.637c.04-.877.187-1.354.31-1.67.163-.42.358-.72.673-1.036.315-.315.615-.51 1.035-.673.317-.123.794-.27 1.67-.31.95-.043 1.235-.052 3.638-.052M12 3c-2.444 0-2.75.01-3.71.054s-1.613.196-2.185.418c-.592.23-1.094.538-1.594 1.04-.5.5-.807 1-1.037 1.593-.223.572-.375 1.226-.42 2.184C3.01 9.25 3 9.555 3 12s.01 2.75.054 3.71.196 1.613.418 2.186c.23.592.538 1.094 1.038 1.594s1.002.808 1.594 1.038c.572.222 1.227.375 2.185.418.96.044 1.266.054 3.71.054s2.75-.01 3.71-.054 1.613-.196 2.186-.418c.592-.23 1.094-.538 1.594-1.038s.808-1.002 1.038-1.594c.222-.572.375-1.227.418-2.185.044-.96.054-1.266.054-3.71s-.01-2.75-.054-3.71-.196-1.613-.418-2.186c-.23-.592-.538-1.094-1.038-1.594s-1.002-.808-1.594-1.038c-.572-.222-1.227-.375-2.185-.418C14.75 3.01 14.445 3 12 3zm0 4.378c-2.552 0-4.622 2.07-4.622 4.622s2.07 4.622 4.622 4.622 4.622-2.07 4.622-4.622S14.552 7.378 12 7.378zM12 15c-1.657 0-3-1.343-3-3s1.343-3 3-3 3 1.343 3 3-1.343 3-3 3zm4.804-8.884c-.596 0-1.08.484-1.08 1.08s.484 1.08 1.08 1.08c.596 0 1.08-.484 1.08-1.08s-.483-1.08-1.08-1.08z" }) }) }); 17436 var embedWordPressIcon = { 17437 foreground: "#0073AA", 17438 src: /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_components37.SVG, { viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_components37.G, { children: /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_components37.Path, { d: "M12.158 12.786l-2.698 7.84c.806.236 1.657.365 2.54.365 1.047 0 2.05-.18 2.986-.51-.024-.037-.046-.078-.065-.123l-2.762-7.57zM3.008 12c0 3.56 2.07 6.634 5.068 8.092L3.788 8.342c-.5 1.117-.78 2.354-.78 3.658zm15.06-.454c0-1.112-.398-1.88-.74-2.48-.456-.74-.883-1.368-.883-2.11 0-.825.627-1.595 1.51-1.595.04 0 .078.006.116.008-1.598-1.464-3.73-2.36-6.07-2.36-3.14 0-5.904 1.613-7.512 4.053.21.008.41.012.58.012.94 0 2.395-.114 2.395-.114.484-.028.54.684.057.74 0 0-.487.058-1.03.086l3.275 9.74 1.968-5.902-1.4-3.838c-.485-.028-.944-.085-.944-.085-.486-.03-.43-.77.056-.742 0 0 1.484.114 2.368.114.94 0 2.397-.114 2.397-.114.486-.028.543.684.058.74 0 0-.488.058-1.03.086l3.25 9.665.897-2.997c.456-1.17.684-2.137.684-2.907zm1.82-3.86c.04.286.06.593.06.924 0 .912-.17 1.938-.683 3.22l-2.746 7.94c2.672-1.558 4.47-4.454 4.47-7.77 0-1.564-.4-3.033-1.1-4.314zM12 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10z" }) }) }) 17439 }; 17440 var embedSpotifyIcon = { 17441 foreground: "#1db954", 17442 src: /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_components37.SVG, { viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_components37.Path, { d: "M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2m4.586 14.424c-.18.295-.563.387-.857.207-2.35-1.434-5.305-1.76-8.786-.963-.335.077-.67-.133-.746-.47-.077-.334.132-.67.47-.745 3.808-.87 7.076-.496 9.712 1.115.293.18.386.563.206.857M17.81 13.7c-.226.367-.706.482-1.072.257-2.687-1.652-6.785-2.13-9.965-1.166-.413.127-.848-.106-.973-.517-.125-.413.108-.848.52-.973 3.632-1.102 8.147-.568 11.234 1.328.366.226.48.707.256 1.072m.105-2.835C14.692 8.95 9.375 8.775 6.297 9.71c-.493.15-1.016-.13-1.166-.624-.148-.495.13-1.017.625-1.167 3.532-1.073 9.404-.866 13.115 1.337.445.264.59.838.327 1.282-.264.443-.838.59-1.282.325" }) }) 17443 }; 17444 var embedFlickrIcon = /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_components37.SVG, { viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_components37.Path, { d: "m6.5 7c-2.75 0-5 2.25-5 5s2.25 5 5 5 5-2.25 5-5-2.25-5-5-5zm11 0c-2.75 0-5 2.25-5 5s2.25 5 5 5 5-2.25 5-5-2.25-5-5-5z" }) }); 17445 var embedVimeoIcon = { 17446 foreground: "#1ab7ea", 17447 src: /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_components37.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_components37.G, { children: /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_components37.Path, { d: "M22.396 7.164c-.093 2.026-1.507 4.8-4.245 8.32C15.323 19.16 12.93 21 10.97 21c-1.214 0-2.24-1.12-3.08-3.36-.56-2.052-1.118-4.105-1.68-6.158-.622-2.24-1.29-3.36-2.004-3.36-.156 0-.7.328-1.634.98l-.978-1.26c1.027-.903 2.04-1.806 3.037-2.71C6 3.95 7.03 3.328 7.716 3.265c1.62-.156 2.616.95 2.99 3.32.404 2.558.685 4.148.84 4.77.468 2.12.982 3.18 1.543 3.18.435 0 1.09-.687 1.963-2.064.872-1.376 1.34-2.422 1.402-3.142.125-1.187-.343-1.782-1.4-1.782-.5 0-1.013.115-1.542.34 1.023-3.35 2.977-4.976 5.862-4.883 2.14.063 3.148 1.45 3.024 4.16z" }) }) }) 17448 }; 17449 var embedRedditIcon = /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_components37.SVG, { viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_components37.Path, { d: "M22 12.068a2.184 2.184 0 0 0-2.186-2.186c-.592 0-1.13.233-1.524.609-1.505-1.075-3.566-1.774-5.86-1.864l1.004-4.695 3.261.699A1.56 1.56 0 1 0 18.255 3c-.61-.001-1.147.357-1.398.877l-3.638-.77a.382.382 0 0 0-.287.053.348.348 0 0 0-.161.251l-1.112 5.233c-2.33.072-4.426.77-5.95 1.864a2.201 2.201 0 0 0-1.523-.61 2.184 2.184 0 0 0-.896 4.176c-.036.215-.053.43-.053.663 0 3.37 3.924 6.111 8.763 6.111s8.763-2.724 8.763-6.11c0-.216-.017-.449-.053-.664A2.207 2.207 0 0 0 22 12.068Zm-15.018 1.56a1.56 1.56 0 0 1 3.118 0c0 .86-.699 1.558-1.559 1.558-.86.018-1.559-.699-1.559-1.559Zm8.728 4.139c-1.076 1.075-3.119 1.147-3.71 1.147-.61 0-2.652-.09-3.71-1.147a.4.4 0 0 1 0-.573.4.4 0 0 1 .574 0c.68.68 2.114.914 3.136.914 1.022 0 2.473-.233 3.136-.914a.4.4 0 0 1 .574 0 .436.436 0 0 1 0 .573Zm-.287-2.563a1.56 1.56 0 0 1 0-3.118c.86 0 1.56.699 1.56 1.56 0 .841-.7 1.558-1.56 1.558Z" }) }); 17450 var embedTumblrIcon = { 17451 foreground: "#35465c", 17452 src: /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_components37.SVG, { viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_components37.Path, { d: "M19 3H5a2 2 0 00-2 2v14c0 1.1.9 2 2 2h14a2 2 0 002-2V5a2 2 0 00-2-2zm-5.69 14.66c-2.72 0-3.1-1.9-3.1-3.16v-3.56H8.49V8.99c1.7-.62 2.54-1.99 2.64-2.87 0-.06.06-.41.06-.58h1.9v3.1h2.17v2.3h-2.18v3.1c0 .47.13 1.3 1.2 1.26h1.1v2.36c-1.01.02-2.07 0-2.07 0z" }) }) 17453 }; 17454 var embedAmazonIcon = /* @__PURE__ */ (0, import_jsx_runtime221.jsxs)(import_components37.SVG, { viewBox: "0 0 24 24", children: [ 17455 /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_components37.Path, { d: "M18.42 14.58c-.51-.66-1.05-1.23-1.05-2.5V7.87c0-1.8.15-3.45-1.2-4.68-1.05-1.02-2.79-1.35-4.14-1.35-2.6 0-5.52.96-6.12 4.14-.06.36.18.54.4.57l2.66.3c.24-.03.42-.27.48-.5.24-1.12 1.17-1.63 2.2-1.63.56 0 1.22.21 1.55.7.4.56.33 1.31.33 1.97v.36c-1.59.18-3.66.27-5.16.93a4.63 4.63 0 0 0-2.93 4.44c0 2.82 1.8 4.23 4.1 4.23 1.95 0 3.03-.45 4.53-1.98.51.72.66 1.08 1.59 1.83.18.09.45.09.63-.1v.04l2.1-1.8c.24-.21.2-.48.03-.75zm-5.4-1.2c-.45.75-1.14 1.23-1.92 1.23-1.05 0-1.65-.81-1.65-1.98 0-2.31 2.1-2.73 4.08-2.73v.6c0 1.05.03 1.92-.5 2.88z" }), 17456 /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_components37.Path, { d: "M21.69 19.2a17.62 17.62 0 0 1-21.6-1.57c-.23-.2 0-.5.28-.33a23.88 23.88 0 0 0 20.93 1.3c.45-.19.84.3.39.6z" }), 17457 /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_components37.Path, { d: "M22.8 17.96c-.36-.45-2.22-.2-3.1-.12-.23.03-.3-.18-.05-.36 1.5-1.05 3.96-.75 4.26-.39.3.36-.1 2.82-1.5 4.02-.21.18-.42.1-.3-.15.3-.8 1.02-2.58.69-3z" }) 17458 ] }); 17459 var embedAnimotoIcon = /* @__PURE__ */ (0, import_jsx_runtime221.jsxs)(import_components37.SVG, { viewBox: "0 0 24 24", children: [ 17460 /* @__PURE__ */ (0, import_jsx_runtime221.jsx)( 17461 import_components37.Path, 17462 { 17463 d: "m.0206909 21 19.8160091-13.07806 3.5831 6.20826z", 17464 fill: "#4bc7ee" 17465 } 17466 ), 17467 /* @__PURE__ */ (0, import_jsx_runtime221.jsx)( 17468 import_components37.Path, 17469 { 17470 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", 17471 fill: "#d4cdcb" 17472 } 17473 ), 17474 /* @__PURE__ */ (0, import_jsx_runtime221.jsx)( 17475 import_components37.Path, 17476 { 17477 d: "m.0206909 21 15.2439091-16.38571 4.3029 7.32271z", 17478 fill: "#c3d82e" 17479 } 17480 ), 17481 /* @__PURE__ */ (0, import_jsx_runtime221.jsx)( 17482 import_components37.Path, 17483 { 17484 d: "m13.618 1.83582c-.6421-1.114428-1.7087-1.114428-2.3249 0l-11.2931 19.16418 15.2646-16.38573z", 17485 fill: "#e4ecb0" 17486 } 17487 ), 17488 /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_components37.Path, { d: "m.0206909 21 19.5468091-9.063 1.6621 2.8344z", fill: "#209dbd" }), 17489 /* @__PURE__ */ (0, import_jsx_runtime221.jsx)( 17490 import_components37.Path, 17491 { 17492 d: "m.0206909 21 17.9209091-11.82623 1.6259 2.76323z", 17493 fill: "#7cb3c9" 17494 } 17495 ) 17496 ] }); 17497 var embedDailymotionIcon = /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_components37.SVG, { viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime221.jsx)( 17498 import_components37.Path, 17499 { 17500 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", 17501 fill: "#333436" 17502 } 17503 ) }); 17504 var embedPinterestIcon = /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_components37.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_components37.Path, { d: "M12.289,2C6.617,2,3.606,5.648,3.606,9.622c0,1.846,1.025,4.146,2.666,4.878c0.25,0.111,0.381,0.063,0.439-0.169 c0.044-0.175,0.267-1.029,0.365-1.428c0.032-0.128,0.017-0.237-0.091-0.362C6.445,11.911,6.01,10.75,6.01,9.668 c0-2.777,2.194-5.464,5.933-5.464c3.23,0,5.49,2.108,5.49,5.122c0,3.407-1.794,5.768-4.13,5.768c-1.291,0-2.257-1.021-1.948-2.277 c0.372-1.495,1.089-3.112,1.089-4.191c0-0.967-0.542-1.775-1.663-1.775c-1.319,0-2.379,1.309-2.379,3.059 c0,1.115,0.394,1.869,0.394,1.869s-1.302,5.279-1.54,6.261c-0.405,1.666,0.053,4.368,0.094,4.604 c0.021,0.126,0.167,0.169,0.25,0.063c0.129-0.165,1.699-2.419,2.142-4.051c0.158-0.59,0.817-2.995,0.817-2.995 c0.43,0.784,1.681,1.446,3.013,1.446c3.963,0,6.822-3.494,6.822-7.833C20.394,5.112,16.849,2,12.289,2" }) }); 17505 var embedWolframIcon = /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_components37.SVG, { viewBox: "0 0 44 44", children: /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_components37.Path, { d: "M32.59521,22.001l4.31885-4.84473-6.34131-1.38379.646-6.459-5.94336,2.61035L22,6.31934l-3.27344,5.60351L12.78418,9.3125l.645,6.458L7.08643,17.15234,11.40479,21.999,7.08594,26.84375l6.34131,1.38379-.64551,6.458,5.94287-2.60938L22,37.68066l3.27344-5.60351,5.94287,2.61035-.64551-6.458,6.34277-1.38183Zm.44385,2.75244L30.772,23.97827l-1.59558-2.07391,1.97888.735Zm-8.82147,6.1579L22.75,33.424V30.88977l1.52228-2.22168ZM18.56226,13.48816,19.819,15.09534l-2.49219-.88642L15.94037,12.337Zm6.87719.00116,2.62043-1.15027-1.38654,1.86981L24.183,15.0946Zm3.59357,2.6029-1.22546,1.7381.07525-2.73486,1.44507-1.94867ZM22,29.33008l-2.16406-3.15686L22,23.23688l2.16406,2.93634Zm-4.25458-9.582-.10528-3.836,3.60986,1.284v3.73242Zm5.00458-2.552,3.60986-1.284-.10528,3.836L22.75,20.92853Zm-7.78174-1.10559-.29352-2.94263,1.44245,1.94739.07519,2.73321Zm2.30982,5.08319,3.50817,1.18164-2.16247,2.9342-3.678-1.08447Zm2.4486,7.49285L21.25,30.88977v2.53485L19.78052,30.91Zm3.48707-6.31121,3.50817-1.18164,2.33228,3.03137-3.678,1.08447Zm10.87219-4.28113-2.714,3.04529L28.16418,19.928l1.92176-2.72565ZM24.06036,12.81769l-2.06012,2.6322-2.059-2.63318L22,9.292ZM9.91455,18.07227l4.00079-.87195,1.921,2.72735-3.20794,1.19019Zm2.93024,4.565,1.9801-.73462L13.228,23.97827l-2.26838.77429Zm-1.55591,3.58819L13.701,25.4021l2.64935.78058-2.14447.67853Zm3.64868,1.977L18.19,27.17334l.08313,3.46332L14.52979,32.2793Zm10.7876,2.43549.08447-3.464,3.25165,1.03052.407,4.07684Zm4.06824-3.77478-2.14545-.68,2.65063-.781,2.41266.825Z" }) }); 17506 var embedPocketCastsIcon = { 17507 foreground: "#f43e37", 17508 src: /* @__PURE__ */ (0, import_jsx_runtime221.jsxs)( 17509 import_components37.SVG, 17510 { 17511 width: "24", 17512 height: "24", 17513 viewBox: "0 0 24 24", 17514 fill: "none", 17515 xmlns: "http://www.w3.org/2000/svg", 17516 children: [ 17517 /* @__PURE__ */ (0, import_jsx_runtime221.jsx)( 17518 import_components37.Path, 17519 { 17520 fillRule: "evenodd", 17521 clipRule: "evenodd", 17522 d: "M24,12A12,12,0,1,1,12,0,12,12,0,0,1,24,12Z" 17523 } 17524 ), 17525 /* @__PURE__ */ (0, import_jsx_runtime221.jsx)( 17526 import_components37.Path, 17527 { 17528 fillRule: "evenodd", 17529 clipRule: "evenodd", 17530 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", 17531 fill: "#fff" 17532 } 17533 ) 17534 ] 17535 } 17536 ) 17537 }; 17538 var embedBlueskyIcon = /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_components37.SVG, { viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime221.jsx)( 17539 import_components37.Path, 17540 { 17541 fill: "#0a7aff", 17542 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" 17543 } 17544 ) }); 17545 17546 // packages/block-library/build-module/embed/embed-loading.js 17547 var import_components38 = __toESM(require_components()); 17548 var import_jsx_runtime222 = __toESM(require_jsx_runtime()); 17549 var EmbedLoading = () => /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("div", { className: "wp-block-embed is-loading", children: /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(import_components38.Spinner, {}) }); 17550 var embed_loading_default = EmbedLoading; 17551 17552 // packages/block-library/build-module/embed/embed-placeholder.js 17553 var import_i18n58 = __toESM(require_i18n()); 17554 var import_components39 = __toESM(require_components()); 17555 var import_block_editor73 = __toESM(require_block_editor()); 17556 var import_jsx_runtime223 = __toESM(require_jsx_runtime()); 17557 var EmbedPlaceholder = ({ 17558 icon, 17559 label, 17560 value, 17561 onSubmit, 17562 onChange, 17563 cannotEmbed, 17564 fallback: fallback2, 17565 tryAgain 17566 }) => { 17567 return /* @__PURE__ */ (0, import_jsx_runtime223.jsxs)( 17568 import_components39.Placeholder, 17569 { 17570 icon: /* @__PURE__ */ (0, import_jsx_runtime223.jsx)(import_block_editor73.BlockIcon, { icon, showColors: true }), 17571 label, 17572 className: "wp-block-embed", 17573 instructions: (0, import_i18n58.__)( 17574 "Paste a link to the content you want to display on your site." 17575 ), 17576 children: [ 17577 /* @__PURE__ */ (0, import_jsx_runtime223.jsxs)("form", { onSubmit, children: [ 17578 /* @__PURE__ */ (0, import_jsx_runtime223.jsx)( 17579 import_components39.__experimentalInputControl, 17580 { 17581 __next40pxDefaultSize: true, 17582 type: "url", 17583 value: value || "", 17584 className: "wp-block-embed__placeholder-input", 17585 label, 17586 hideLabelFromVision: true, 17587 placeholder: (0, import_i18n58.__)("Enter URL to embed here\u2026"), 17588 onChange 17589 } 17590 ), 17591 /* @__PURE__ */ (0, import_jsx_runtime223.jsx)(import_components39.Button, { __next40pxDefaultSize: true, variant: "primary", type: "submit", children: (0, import_i18n58._x)("Embed", "button label") }) 17592 ] }), 17593 /* @__PURE__ */ (0, import_jsx_runtime223.jsx)("div", { className: "wp-block-embed__learn-more", children: /* @__PURE__ */ (0, import_jsx_runtime223.jsx)( 17594 import_components39.ExternalLink, 17595 { 17596 href: (0, import_i18n58.__)( 17597 "https://wordpress.org/documentation/article/embeds/" 17598 ), 17599 children: (0, import_i18n58.__)("Learn more about embeds") 17600 } 17601 ) }), 17602 cannotEmbed && /* @__PURE__ */ (0, import_jsx_runtime223.jsxs)(import_components39.__experimentalVStack, { spacing: 3, className: "components-placeholder__error", children: [ 17603 /* @__PURE__ */ (0, import_jsx_runtime223.jsx)("div", { className: "components-placeholder__instructions", children: (0, import_i18n58.__)("Sorry, this content could not be embedded.") }), 17604 /* @__PURE__ */ (0, import_jsx_runtime223.jsxs)( 17605 import_components39.__experimentalHStack, 17606 { 17607 expanded: false, 17608 spacing: 3, 17609 justify: "flex-start", 17610 children: [ 17611 /* @__PURE__ */ (0, import_jsx_runtime223.jsx)( 17612 import_components39.Button, 17613 { 17614 __next40pxDefaultSize: true, 17615 variant: "secondary", 17616 onClick: tryAgain, 17617 children: (0, import_i18n58._x)("Try again", "button label") 17618 } 17619 ), 17620 " ", 17621 /* @__PURE__ */ (0, import_jsx_runtime223.jsx)( 17622 import_components39.Button, 17623 { 17624 __next40pxDefaultSize: true, 17625 variant: "secondary", 17626 onClick: fallback2, 17627 children: (0, import_i18n58._x)("Convert to link", "button label") 17628 } 17629 ) 17630 ] 17631 } 17632 ) 17633 ] }) 17634 ] 17635 } 17636 ); 17637 }; 17638 var embed_placeholder_default = EmbedPlaceholder; 17639 17640 // packages/block-library/build-module/embed/embed-preview.js 17641 var import_i18n59 = __toESM(require_i18n()); 17642 var import_components40 = __toESM(require_components()); 17643 var import_block_editor74 = __toESM(require_block_editor()); 17644 var import_element28 = __toESM(require_element()); 17645 var import_url5 = __toESM(require_url()); 17646 17647 // packages/block-library/build-module/embed/wp-embed-preview.js 17648 var import_compose16 = __toESM(require_compose()); 17649 var import_element27 = __toESM(require_element()); 17650 var import_jsx_runtime224 = __toESM(require_jsx_runtime()); 17651 var attributeMap = { 17652 class: "className", 17653 frameborder: "frameBorder", 17654 marginheight: "marginHeight", 17655 marginwidth: "marginWidth" 17656 }; 17657 function WpEmbedPreview({ html }) { 17658 const ref = (0, import_element27.useRef)(); 17659 const props = (0, import_element27.useMemo)(() => { 17660 const doc = new window.DOMParser().parseFromString(html, "text/html"); 17661 const iframe = doc.querySelector("iframe"); 17662 const iframeProps = {}; 17663 if (!iframe) { 17664 return iframeProps; 17665 } 17666 Array.from(iframe.attributes).forEach(({ name: name117, value }) => { 17667 if (name117 === "style") { 17668 return; 17669 } 17670 iframeProps[attributeMap[name117] || name117] = value; 17671 }); 17672 return iframeProps; 17673 }, [html]); 17674 (0, import_element27.useEffect)(() => { 17675 const { ownerDocument } = ref.current; 17676 const { defaultView } = ownerDocument; 17677 function resizeWPembeds({ data: { secret, message, value } = {} }) { 17678 if (message !== "height" || secret !== props["data-secret"]) { 17679 return; 17680 } 17681 ref.current.height = value; 17682 } 17683 defaultView.addEventListener("message", resizeWPembeds); 17684 return () => { 17685 defaultView.removeEventListener("message", resizeWPembeds); 17686 }; 17687 }, []); 17688 return /* @__PURE__ */ (0, import_jsx_runtime224.jsx)("div", { className: "wp-block-embed__wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime224.jsx)( 17689 "iframe", 17690 { 17691 ref: (0, import_compose16.useMergeRefs)([ref, (0, import_compose16.useFocusableIframe)()]), 17692 title: props.title, 17693 ...props 17694 } 17695 ) }); 17696 } 17697 17698 // packages/block-library/build-module/embed/embed-preview.js 17699 var import_jsx_runtime225 = __toESM(require_jsx_runtime()); 17700 function EmbedPreview({ 17701 preview, 17702 previewable, 17703 url, 17704 type, 17705 isSelected, 17706 className, 17707 icon, 17708 label 17709 }) { 17710 const [interactive, setInteractive] = (0, import_element28.useState)(false); 17711 if (!isSelected && interactive) { 17712 setInteractive(false); 17713 } 17714 const hideOverlay = () => { 17715 setInteractive(true); 17716 }; 17717 const { scripts } = preview; 17718 const html = "photo" === type ? getPhotoHtml(preview) : preview.html; 17719 const embedSourceUrl = (0, import_url5.getAuthority)(url); 17720 const iframeTitle = (0, import_i18n59.sprintf)( 17721 // translators: %s: host providing embed content e.g: www.youtube.com 17722 (0, import_i18n59.__)("Embedded content from %s"), 17723 embedSourceUrl 17724 ); 17725 const sandboxClassnames = clsx_default( 17726 type, 17727 className, 17728 "wp-block-embed__wrapper" 17729 ); 17730 const embedWrapper = "wp-embed" === type ? /* @__PURE__ */ (0, import_jsx_runtime225.jsx)(WpEmbedPreview, { html }) : /* @__PURE__ */ (0, import_jsx_runtime225.jsxs)("div", { className: "wp-block-embed__wrapper", children: [ 17731 /* @__PURE__ */ (0, import_jsx_runtime225.jsx)( 17732 import_components40.SandBox, 17733 { 17734 html, 17735 scripts, 17736 title: iframeTitle, 17737 type: sandboxClassnames, 17738 onFocus: hideOverlay 17739 } 17740 ), 17741 !interactive && /* @__PURE__ */ (0, import_jsx_runtime225.jsx)( 17742 "div", 17743 { 17744 className: "block-library-embed__interactive-overlay", 17745 onMouseUp: hideOverlay 17746 } 17747 ) 17748 ] }); 17749 return /* @__PURE__ */ (0, import_jsx_runtime225.jsx)(import_jsx_runtime225.Fragment, { children: previewable ? embedWrapper : /* @__PURE__ */ (0, import_jsx_runtime225.jsxs)( 17750 import_components40.Placeholder, 17751 { 17752 icon: /* @__PURE__ */ (0, import_jsx_runtime225.jsx)(import_block_editor74.BlockIcon, { icon, showColors: true }), 17753 label, 17754 children: [ 17755 /* @__PURE__ */ (0, import_jsx_runtime225.jsx)("p", { className: "components-placeholder__error", children: /* @__PURE__ */ (0, import_jsx_runtime225.jsx)("a", { href: url, children: url }) }), 17756 /* @__PURE__ */ (0, import_jsx_runtime225.jsx)("p", { className: "components-placeholder__error", children: (0, import_i18n59.sprintf)( 17757 /* translators: %s: host providing embed content e.g: www.youtube.com */ 17758 (0, import_i18n59.__)( 17759 "Embedded content from %s can't be previewed in the editor." 17760 ), 17761 embedSourceUrl 17762 ) }) 17763 ] 17764 } 17765 ) }); 17766 } 17767 17768 // packages/block-library/build-module/embed/edit.js 17769 var import_i18n60 = __toESM(require_i18n()); 17770 var import_element29 = __toESM(require_element()); 17771 var import_data30 = __toESM(require_data()); 17772 var import_block_editor75 = __toESM(require_block_editor()); 17773 var import_core_data17 = __toESM(require_core_data()); 17774 var import_primitives148 = __toESM(require_primitives()); 17775 var import_url6 = __toESM(require_url()); 17776 var import_jsx_runtime226 = __toESM(require_jsx_runtime()); 17777 var EmbedEdit = (props) => { 17778 const { 17779 attributes: { 17780 providerNameSlug, 17781 previewable, 17782 responsive, 17783 url: attributesUrl 17784 }, 17785 attributes: attributes3, 17786 isSelected, 17787 onReplace, 17788 setAttributes, 17789 insertBlocksAfter, 17790 onFocus 17791 } = props; 17792 const defaultEmbedInfo = { 17793 title: (0, import_i18n60._x)("Embed", "block title"), 17794 icon: embedContentIcon 17795 }; 17796 const { icon, title } = getEmbedInfoByProvider(providerNameSlug) || defaultEmbedInfo; 17797 const [url, setURL] = (0, import_element29.useState)(attributesUrl); 17798 const [isEditingURL, setIsEditingURL] = (0, import_element29.useState)(false); 17799 const { invalidateResolution } = (0, import_data30.useDispatch)(import_core_data17.store); 17800 const { 17801 preview, 17802 fetching, 17803 themeSupportsResponsive, 17804 cannotEmbed, 17805 hasResolved 17806 } = (0, import_data30.useSelect)( 17807 (select9) => { 17808 const { 17809 getEmbedPreview, 17810 isPreviewEmbedFallback, 17811 isRequestingEmbedPreview, 17812 getThemeSupports, 17813 hasFinishedResolution 17814 } = select9(import_core_data17.store); 17815 if (!attributesUrl) { 17816 return { fetching: false, cannotEmbed: false }; 17817 } 17818 const embedPreview = getEmbedPreview(attributesUrl); 17819 const previewIsFallback = isPreviewEmbedFallback(attributesUrl); 17820 const badEmbedProvider = embedPreview?.html === false && embedPreview?.type === void 0; 17821 const wordpressCantEmbed = embedPreview?.data?.status === 404; 17822 const validPreview = !!embedPreview && !badEmbedProvider && !wordpressCantEmbed; 17823 return { 17824 preview: validPreview ? embedPreview : void 0, 17825 fetching: isRequestingEmbedPreview(attributesUrl), 17826 themeSupportsResponsive: getThemeSupports()["responsive-embeds"], 17827 cannotEmbed: !validPreview || previewIsFallback, 17828 hasResolved: hasFinishedResolution("getEmbedPreview", [ 17829 attributesUrl 17830 ]) 17831 }; 17832 }, 17833 [attributesUrl] 17834 ); 17835 const getMergedAttributes = () => getMergedAttributesWithPreview( 17836 attributes3, 17837 preview, 17838 title, 17839 responsive 17840 ); 17841 function toggleResponsive(newAllowResponsive) { 17842 const { className: className2 } = attributes3; 17843 const { html } = preview; 17844 setAttributes({ 17845 allowResponsive: newAllowResponsive, 17846 className: getClassNames( 17847 html, 17848 className2, 17849 responsive && newAllowResponsive 17850 ) 17851 }); 17852 } 17853 (0, import_element29.useEffect)(() => { 17854 if (preview?.html || !cannotEmbed || !hasResolved) { 17855 return; 17856 } 17857 const newURL = attributesUrl.replace(/\/$/, ""); 17858 setURL(newURL); 17859 setIsEditingURL(false); 17860 setAttributes({ url: newURL }); 17861 }, [ 17862 preview?.html, 17863 attributesUrl, 17864 cannotEmbed, 17865 hasResolved, 17866 setAttributes 17867 ]); 17868 (0, import_element29.useEffect)(() => { 17869 if (!cannotEmbed || fetching || !url) { 17870 return; 17871 } 17872 if ((0, import_url6.getAuthority)(url) === "x.com") { 17873 const newURL = new URL(url); 17874 newURL.host = "twitter.com"; 17875 setAttributes({ url: newURL.toString() }); 17876 } 17877 }, [url, cannotEmbed, fetching, setAttributes]); 17878 (0, import_element29.useEffect)(() => { 17879 if (preview && !isEditingURL) { 17880 const mergedAttributes = getMergedAttributes(); 17881 const hasChanges = Object.keys(mergedAttributes).some( 17882 (key) => mergedAttributes[key] !== attributes3[key] 17883 ); 17884 if (hasChanges) { 17885 setAttributes(mergedAttributes); 17886 } 17887 if (onReplace) { 17888 const upgradedBlock = createUpgradedEmbedBlock( 17889 props, 17890 mergedAttributes 17891 ); 17892 if (upgradedBlock) { 17893 onReplace(upgradedBlock); 17894 } 17895 } 17896 } 17897 }, [preview, isEditingURL]); 17898 const blockProps = (0, import_block_editor75.useBlockProps)(); 17899 if (fetching) { 17900 return /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(import_primitives148.View, { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(embed_loading_default, {}) }); 17901 } 17902 const label = (0, import_i18n60.sprintf)((0, import_i18n60.__)("%s URL"), title); 17903 const showEmbedPlaceholder = !preview || cannotEmbed || isEditingURL; 17904 if (showEmbedPlaceholder) { 17905 return /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(import_primitives148.View, { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime226.jsx)( 17906 embed_placeholder_default, 17907 { 17908 icon, 17909 label, 17910 onFocus, 17911 onSubmit: (event) => { 17912 if (event) { 17913 event.preventDefault(); 17914 } 17915 const blockClass = removeAspectRatioClasses( 17916 attributes3.className 17917 ); 17918 setIsEditingURL(false); 17919 setAttributes({ url, className: blockClass }); 17920 }, 17921 value: url, 17922 cannotEmbed, 17923 onChange: (value) => setURL(value), 17924 fallback: () => fallback(url, onReplace), 17925 tryAgain: () => { 17926 invalidateResolution("getEmbedPreview", [url]); 17927 } 17928 } 17929 ) }); 17930 } 17931 const { 17932 caption, 17933 type, 17934 allowResponsive, 17935 className: classFromPreview 17936 } = getMergedAttributes(); 17937 const className = clsx_default(classFromPreview, props.className); 17938 return /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(import_jsx_runtime226.Fragment, { children: [ 17939 /* @__PURE__ */ (0, import_jsx_runtime226.jsx)( 17940 embed_controls_default, 17941 { 17942 showEditButton: preview && !cannotEmbed, 17943 themeSupportsResponsive, 17944 blockSupportsResponsive: responsive, 17945 allowResponsive, 17946 toggleResponsive, 17947 switchBackToURLInput: () => setIsEditingURL(true) 17948 } 17949 ), 17950 /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)( 17951 "figure", 17952 { 17953 ...blockProps, 17954 className: clsx_default(blockProps.className, className, { 17955 [`is-type-$type}`]: type, 17956 [`is-provider-$providerNameSlug}`]: providerNameSlug, 17957 [`wp-block-embed-$providerNameSlug}`]: providerNameSlug 17958 }), 17959 children: [ 17960 /* @__PURE__ */ (0, import_jsx_runtime226.jsx)( 17961 EmbedPreview, 17962 { 17963 preview, 17964 previewable, 17965 className, 17966 url, 17967 type, 17968 caption, 17969 onCaptionChange: (value) => setAttributes({ caption: value }), 17970 isSelected, 17971 icon, 17972 label, 17973 insertBlocksAfter, 17974 attributes: attributes3, 17975 setAttributes 17976 } 17977 ), 17978 /* @__PURE__ */ (0, import_jsx_runtime226.jsx)( 17979 Caption, 17980 { 17981 attributes: attributes3, 17982 setAttributes, 17983 isSelected, 17984 insertBlocksAfter, 17985 label: (0, import_i18n60.__)("Embed caption text"), 17986 showToolbarButton: isSelected 17987 } 17988 ) 17989 ] 17990 } 17991 ) 17992 ] }); 17993 }; 17994 var edit_default9 = EmbedEdit; 17995 17996 // packages/block-library/build-module/embed/save.js 17997 var import_block_editor76 = __toESM(require_block_editor()); 17998 var import_jsx_runtime227 = __toESM(require_jsx_runtime()); 17999 function save16({ attributes: attributes3 }) { 18000 const { url, caption, type, providerNameSlug } = attributes3; 18001 if (!url) { 18002 return null; 18003 } 18004 const className = clsx_default("wp-block-embed", { 18005 [`is-type-$type}`]: type, 18006 [`is-provider-$providerNameSlug}`]: providerNameSlug, 18007 [`wp-block-embed-$providerNameSlug}`]: providerNameSlug 18008 }); 18009 return /* @__PURE__ */ (0, import_jsx_runtime227.jsxs)("figure", { ...import_block_editor76.useBlockProps.save({ className }), children: [ 18010 /* @__PURE__ */ (0, import_jsx_runtime227.jsx)("div", { className: "wp-block-embed__wrapper", children: ` 18011 $url} 18012 ` }), 18013 !import_block_editor76.RichText.isEmpty(caption) && /* @__PURE__ */ (0, import_jsx_runtime227.jsx)( 18014 import_block_editor76.RichText.Content, 18015 { 18016 className: (0, import_block_editor76.__experimentalGetElementClassName)("caption"), 18017 tagName: "figcaption", 18018 value: caption 18019 } 18020 ) 18021 ] }); 18022 } 18023 18024 // packages/block-library/build-module/embed/transforms.js 18025 var import_blocks26 = __toESM(require_blocks()); 18026 var { name: EMBED_BLOCK } = block_default7; 18027 var transforms7 = { 18028 from: [ 18029 { 18030 type: "raw", 18031 isMatch: (node) => node.nodeName === "P" && /^\s*(https?:\/\/\S+)\s*$/i.test(node.textContent) && node.textContent?.match(/https/gi)?.length === 1, 18032 transform: (node) => { 18033 return (0, import_blocks26.createBlock)(EMBED_BLOCK, { 18034 url: node.textContent.trim() 18035 }); 18036 } 18037 } 18038 ], 18039 to: [ 18040 { 18041 type: "block", 18042 blocks: ["core/paragraph"], 18043 isMatch: ({ url }) => !!url, 18044 transform: ({ url, caption, className }) => { 18045 let value = `<a href="$url}">$url}</a>`; 18046 if (caption?.trim()) { 18047 value += `<br />$caption}`; 18048 } 18049 return (0, import_blocks26.createBlock)("core/paragraph", { 18050 content: value, 18051 className: removeAspectRatioClasses(className) 18052 }); 18053 } 18054 } 18055 ] 18056 }; 18057 var transforms_default8 = transforms7; 18058 18059 // packages/block-library/build-module/embed/variations.js 18060 var import_i18n61 = __toESM(require_i18n()); 18061 function getTitle(providerName) { 18062 return (0, import_i18n61.sprintf)( 18063 /* translators: %s: provider name */ 18064 (0, import_i18n61.__)("%s Embed"), 18065 providerName 18066 ); 18067 } 18068 var variations4 = [ 18069 { 18070 name: "twitter", 18071 title: getTitle("X"), 18072 icon: embedTwitterIcon, 18073 keywords: ["x", "twitter", "tweet", (0, import_i18n61.__)("social")], 18074 description: (0, import_i18n61.__)("Embed an X post."), 18075 patterns: [/^https?:\/\/(www\.)?twitter\.com\/.+/i], 18076 attributes: { providerNameSlug: "twitter", responsive: true } 18077 }, 18078 { 18079 name: "youtube", 18080 title: getTitle("YouTube"), 18081 icon: embedYouTubeIcon, 18082 keywords: [(0, import_i18n61.__)("music"), (0, import_i18n61.__)("video")], 18083 description: (0, import_i18n61.__)("Embed a YouTube video."), 18084 patterns: [ 18085 /^https?:\/\/((m|www)\.)?youtube\.com\/.+/i, 18086 /^https?:\/\/youtu\.be\/.+/i 18087 ], 18088 attributes: { providerNameSlug: "youtube", responsive: true } 18089 }, 18090 { 18091 // Deprecate Facebook Embed per FB policy 18092 // See: https://developers.facebook.com/docs/plugins/oembed-legacy 18093 name: "facebook", 18094 title: getTitle("Facebook"), 18095 icon: embedFacebookIcon, 18096 keywords: [(0, import_i18n61.__)("social")], 18097 description: (0, import_i18n61.__)("Embed a Facebook post."), 18098 scope: ["block"], 18099 patterns: [], 18100 attributes: { 18101 providerNameSlug: "facebook", 18102 previewable: false, 18103 responsive: true 18104 } 18105 }, 18106 { 18107 // Deprecate Instagram per FB policy 18108 // See: https://developers.facebook.com/docs/instagram/oembed-legacy 18109 name: "instagram", 18110 title: getTitle("Instagram"), 18111 icon: embedInstagramIcon, 18112 keywords: [(0, import_i18n61.__)("image"), (0, import_i18n61.__)("social")], 18113 description: (0, import_i18n61.__)("Embed an Instagram post."), 18114 scope: ["block"], 18115 patterns: [], 18116 attributes: { providerNameSlug: "instagram", responsive: true } 18117 }, 18118 { 18119 name: "wordpress", 18120 title: getTitle("WordPress"), 18121 icon: embedWordPressIcon, 18122 keywords: [(0, import_i18n61.__)("post"), (0, import_i18n61.__)("blog")], 18123 description: (0, import_i18n61.__)("Embed a WordPress post."), 18124 attributes: { 18125 providerNameSlug: "wordpress" 18126 } 18127 }, 18128 { 18129 name: "soundcloud", 18130 title: getTitle("SoundCloud"), 18131 icon: embedAudioIcon, 18132 keywords: [(0, import_i18n61.__)("music"), (0, import_i18n61.__)("audio")], 18133 description: (0, import_i18n61.__)("Embed SoundCloud content."), 18134 patterns: [/^https?:\/\/(www\.)?soundcloud\.com\/.+/i], 18135 attributes: { providerNameSlug: "soundcloud", responsive: true } 18136 }, 18137 { 18138 name: "spotify", 18139 title: getTitle("Spotify"), 18140 icon: embedSpotifyIcon, 18141 keywords: [(0, import_i18n61.__)("music"), (0, import_i18n61.__)("audio")], 18142 description: (0, import_i18n61.__)("Embed Spotify content."), 18143 patterns: [/^https?:\/\/(open|play)\.spotify\.com\/.+/i], 18144 attributes: { providerNameSlug: "spotify", responsive: true } 18145 }, 18146 { 18147 name: "flickr", 18148 title: getTitle("Flickr"), 18149 icon: embedFlickrIcon, 18150 keywords: [(0, import_i18n61.__)("image")], 18151 description: (0, import_i18n61.__)("Embed Flickr content."), 18152 patterns: [ 18153 /^https?:\/\/(www\.)?flickr\.com\/.+/i, 18154 /^https?:\/\/flic\.kr\/.+/i 18155 ], 18156 attributes: { providerNameSlug: "flickr", responsive: true } 18157 }, 18158 { 18159 name: "vimeo", 18160 title: getTitle("Vimeo"), 18161 icon: embedVimeoIcon, 18162 keywords: [(0, import_i18n61.__)("video")], 18163 description: (0, import_i18n61.__)("Embed a Vimeo video."), 18164 patterns: [/^https?:\/\/(www\.)?vimeo\.com\/.+/i], 18165 attributes: { providerNameSlug: "vimeo", responsive: true } 18166 }, 18167 { 18168 name: "animoto", 18169 title: getTitle("Animoto"), 18170 icon: embedAnimotoIcon, 18171 description: (0, import_i18n61.__)("Embed an Animoto video."), 18172 patterns: [/^https?:\/\/(www\.)?(animoto|video214)\.com\/.+/i], 18173 attributes: { providerNameSlug: "animoto", responsive: true } 18174 }, 18175 { 18176 name: "cloudup", 18177 title: getTitle("Cloudup"), 18178 icon: embedContentIcon, 18179 description: (0, import_i18n61.__)("Embed Cloudup content."), 18180 patterns: [/^https?:\/\/cloudup\.com\/.+/i], 18181 attributes: { providerNameSlug: "cloudup", responsive: true } 18182 }, 18183 { 18184 // Deprecated since CollegeHumor content is now powered by YouTube. 18185 name: "collegehumor", 18186 title: getTitle("CollegeHumor"), 18187 icon: embedVideoIcon, 18188 description: (0, import_i18n61.__)("Embed CollegeHumor content."), 18189 scope: ["block"], 18190 patterns: [], 18191 attributes: { providerNameSlug: "collegehumor", responsive: true } 18192 }, 18193 { 18194 name: "crowdsignal", 18195 title: getTitle("Crowdsignal"), 18196 icon: embedContentIcon, 18197 keywords: ["polldaddy", (0, import_i18n61.__)("survey")], 18198 description: (0, import_i18n61.__)("Embed Crowdsignal (formerly Polldaddy) content."), 18199 patterns: [ 18200 /^https?:\/\/((.+\.)?polldaddy\.com|poll\.fm|.+\.crowdsignal\.net|.+\.survey\.fm)\/.+/i 18201 ], 18202 attributes: { providerNameSlug: "crowdsignal", responsive: true } 18203 }, 18204 { 18205 name: "dailymotion", 18206 title: getTitle("Dailymotion"), 18207 icon: embedDailymotionIcon, 18208 keywords: [(0, import_i18n61.__)("video")], 18209 description: (0, import_i18n61.__)("Embed a Dailymotion video."), 18210 patterns: [/^https?:\/\/(www\.)?dailymotion\.com\/.+/i], 18211 attributes: { providerNameSlug: "dailymotion", responsive: true } 18212 }, 18213 { 18214 name: "imgur", 18215 title: getTitle("Imgur"), 18216 icon: embedPhotoIcon, 18217 description: (0, import_i18n61.__)("Embed Imgur content."), 18218 patterns: [/^https?:\/\/(.+\.)?imgur\.com\/.+/i], 18219 attributes: { providerNameSlug: "imgur", responsive: true } 18220 }, 18221 { 18222 name: "issuu", 18223 title: getTitle("Issuu"), 18224 icon: embedContentIcon, 18225 description: (0, import_i18n61.__)("Embed Issuu content."), 18226 patterns: [/^https?:\/\/(www\.)?issuu\.com\/.+/i], 18227 attributes: { providerNameSlug: "issuu", responsive: true } 18228 }, 18229 { 18230 name: "kickstarter", 18231 title: getTitle("Kickstarter"), 18232 icon: embedContentIcon, 18233 description: (0, import_i18n61.__)("Embed Kickstarter content."), 18234 patterns: [ 18235 /^https?:\/\/(www\.)?kickstarter\.com\/.+/i, 18236 /^https?:\/\/kck\.st\/.+/i 18237 ], 18238 attributes: { providerNameSlug: "kickstarter", responsive: true } 18239 }, 18240 { 18241 name: "mixcloud", 18242 title: getTitle("Mixcloud"), 18243 icon: embedAudioIcon, 18244 keywords: [(0, import_i18n61.__)("music"), (0, import_i18n61.__)("audio")], 18245 description: (0, import_i18n61.__)("Embed Mixcloud content."), 18246 patterns: [/^https?:\/\/(www\.)?mixcloud\.com\/.+/i], 18247 attributes: { providerNameSlug: "mixcloud", responsive: true } 18248 }, 18249 { 18250 name: "pocket-casts", 18251 title: getTitle("Pocket Casts"), 18252 icon: embedPocketCastsIcon, 18253 keywords: [(0, import_i18n61.__)("podcast"), (0, import_i18n61.__)("audio")], 18254 description: (0, import_i18n61.__)("Embed a podcast player from Pocket Casts."), 18255 patterns: [/^https:\/\/pca.st\/\w+/i], 18256 attributes: { providerNameSlug: "pocket-casts", responsive: true } 18257 }, 18258 { 18259 name: "reddit", 18260 title: getTitle("Reddit"), 18261 icon: embedRedditIcon, 18262 description: (0, import_i18n61.__)("Embed a Reddit thread."), 18263 patterns: [/^https?:\/\/(www\.)?reddit\.com\/.+/i], 18264 attributes: { providerNameSlug: "reddit", responsive: true } 18265 }, 18266 { 18267 name: "reverbnation", 18268 title: getTitle("ReverbNation"), 18269 icon: embedAudioIcon, 18270 description: (0, import_i18n61.__)("Embed ReverbNation content."), 18271 patterns: [/^https?:\/\/(www\.)?reverbnation\.com\/.+/i], 18272 attributes: { providerNameSlug: "reverbnation", responsive: true } 18273 }, 18274 { 18275 name: "scribd", 18276 title: getTitle("Scribd"), 18277 icon: embedContentIcon, 18278 description: (0, import_i18n61.__)("Embed Scribd content."), 18279 patterns: [/^https?:\/\/(www\.)?scribd\.com\/.+/i], 18280 attributes: { providerNameSlug: "scribd", responsive: true } 18281 }, 18282 { 18283 name: "smugmug", 18284 title: getTitle("SmugMug"), 18285 icon: embedPhotoIcon, 18286 description: (0, import_i18n61.__)("Embed SmugMug content."), 18287 patterns: [/^https?:\/\/(.+\.)?smugmug\.com\/.*/i], 18288 attributes: { 18289 providerNameSlug: "smugmug", 18290 previewable: false, 18291 responsive: true 18292 } 18293 }, 18294 { 18295 name: "speaker-deck", 18296 title: getTitle("Speaker Deck"), 18297 icon: embedContentIcon, 18298 description: (0, import_i18n61.__)("Embed Speaker Deck content."), 18299 patterns: [/^https?:\/\/(www\.)?speakerdeck\.com\/.+/i], 18300 attributes: { providerNameSlug: "speaker-deck", responsive: true } 18301 }, 18302 { 18303 name: "tiktok", 18304 title: getTitle("TikTok"), 18305 icon: embedVideoIcon, 18306 keywords: [(0, import_i18n61.__)("video")], 18307 description: (0, import_i18n61.__)("Embed a TikTok video."), 18308 patterns: [/^https?:\/\/(www\.)?tiktok\.com\/.+/i], 18309 attributes: { providerNameSlug: "tiktok", responsive: true } 18310 }, 18311 { 18312 name: "ted", 18313 title: getTitle("TED"), 18314 icon: embedVideoIcon, 18315 description: (0, import_i18n61.__)("Embed a TED video."), 18316 patterns: [/^https?:\/\/(www\.|embed\.)?ted\.com\/.+/i], 18317 attributes: { providerNameSlug: "ted", responsive: true } 18318 }, 18319 { 18320 name: "tumblr", 18321 title: getTitle("Tumblr"), 18322 icon: embedTumblrIcon, 18323 keywords: [(0, import_i18n61.__)("social")], 18324 description: (0, import_i18n61.__)("Embed a Tumblr post."), 18325 patterns: [/^https?:\/\/(.+)\.tumblr\.com\/.+/i], 18326 attributes: { providerNameSlug: "tumblr", responsive: true } 18327 }, 18328 { 18329 name: "videopress", 18330 title: getTitle("VideoPress"), 18331 icon: embedVideoIcon, 18332 keywords: [(0, import_i18n61.__)("video")], 18333 description: (0, import_i18n61.__)("Embed a VideoPress video."), 18334 patterns: [/^https?:\/\/videopress\.com\/.+/i], 18335 attributes: { providerNameSlug: "videopress", responsive: true } 18336 }, 18337 { 18338 name: "wordpress-tv", 18339 title: getTitle("WordPress.tv"), 18340 icon: embedVideoIcon, 18341 description: (0, import_i18n61.__)("Embed a WordPress.tv video."), 18342 patterns: [/^https?:\/\/wordpress\.tv\/.+/i], 18343 attributes: { providerNameSlug: "wordpress-tv", responsive: true } 18344 }, 18345 { 18346 name: "amazon-kindle", 18347 title: getTitle("Amazon Kindle"), 18348 icon: embedAmazonIcon, 18349 keywords: [(0, import_i18n61.__)("ebook")], 18350 description: (0, import_i18n61.__)("Embed Amazon Kindle content."), 18351 patterns: [ 18352 /^https?:\/\/([a-z0-9-]+\.)?(amazon|amzn)(\.[a-z]{2,4})+\/.+/i, 18353 /^https?:\/\/(www\.)?(a\.co|z\.cn)\/.+/i 18354 ], 18355 attributes: { providerNameSlug: "amazon-kindle" } 18356 }, 18357 { 18358 name: "pinterest", 18359 title: getTitle("Pinterest"), 18360 icon: embedPinterestIcon, 18361 keywords: [(0, import_i18n61.__)("social"), (0, import_i18n61.__)("bookmark")], 18362 description: (0, import_i18n61.__)("Embed Pinterest pins, boards, and profiles."), 18363 patterns: [ 18364 /^https?:\/\/([a-z]{2}|www)\.pinterest\.com(\.(au|mx))?\/.*/i 18365 ], 18366 attributes: { providerNameSlug: "pinterest" } 18367 }, 18368 { 18369 name: "wolfram-cloud", 18370 title: getTitle("Wolfram"), 18371 icon: embedWolframIcon, 18372 description: (0, import_i18n61.__)("Embed Wolfram notebook content."), 18373 patterns: [/^https?:\/\/(www\.)?wolframcloud\.com\/obj\/.+/i], 18374 attributes: { providerNameSlug: "wolfram-cloud", responsive: true } 18375 }, 18376 { 18377 name: "bluesky", 18378 title: getTitle("Bluesky"), 18379 icon: embedBlueskyIcon, 18380 description: (0, import_i18n61.__)("Embed a Bluesky post."), 18381 patterns: [/^https?:\/\/bsky\.app\/profile\/.+\/post\/.+/i], 18382 attributes: { providerNameSlug: "bluesky" } 18383 } 18384 ]; 18385 variations4.forEach((variation) => { 18386 if (variation.isActive) { 18387 return; 18388 } 18389 variation.isActive = (blockAttributes8, variationAttributes) => blockAttributes8.providerNameSlug === variationAttributes.providerNameSlug; 18390 }); 18391 var variations_default4 = variations4; 18392 18393 // packages/block-library/build-module/embed/deprecated.js 18394 var import_block_editor77 = __toESM(require_block_editor()); 18395 var import_jsx_runtime228 = __toESM(require_jsx_runtime()); 18396 var { attributes: blockAttributes3 } = block_default7; 18397 var v22 = { 18398 attributes: blockAttributes3, 18399 save({ attributes: attributes3 }) { 18400 const { url, caption, type, providerNameSlug } = attributes3; 18401 if (!url) { 18402 return null; 18403 } 18404 const className = clsx_default("wp-block-embed", { 18405 [`is-type-$type}`]: type, 18406 [`is-provider-$providerNameSlug}`]: providerNameSlug, 18407 [`wp-block-embed-$providerNameSlug}`]: providerNameSlug 18408 }); 18409 return /* @__PURE__ */ (0, import_jsx_runtime228.jsxs)("figure", { ...import_block_editor77.useBlockProps.save({ className }), children: [ 18410 /* @__PURE__ */ (0, import_jsx_runtime228.jsx)("div", { className: "wp-block-embed__wrapper", children: ` 18411 $url} 18412 ` }), 18413 !import_block_editor77.RichText.isEmpty(caption) && /* @__PURE__ */ (0, import_jsx_runtime228.jsx)(import_block_editor77.RichText.Content, { tagName: "figcaption", value: caption }) 18414 ] }); 18415 } 18416 }; 18417 var v18 = { 18418 attributes: blockAttributes3, 18419 save({ attributes: { url, caption, type, providerNameSlug } }) { 18420 if (!url) { 18421 return null; 18422 } 18423 const embedClassName = clsx_default("wp-block-embed", { 18424 [`is-type-$type}`]: type, 18425 [`is-provider-$providerNameSlug}`]: providerNameSlug 18426 }); 18427 return /* @__PURE__ */ (0, import_jsx_runtime228.jsxs)("figure", { className: embedClassName, children: [ 18428 ` 18429 $url} 18430 `, 18431 !import_block_editor77.RichText.isEmpty(caption) && /* @__PURE__ */ (0, import_jsx_runtime228.jsx)(import_block_editor77.RichText.Content, { tagName: "figcaption", value: caption }) 18432 ] }); 18433 } 18434 }; 18435 var deprecated5 = [v22, v18]; 18436 var deprecated_default12 = deprecated5; 18437 18438 // packages/block-library/build-module/embed/index.js 18439 var { name: name32 } = block_default7; 18440 var settings32 = { 18441 icon: embedContentIcon, 18442 edit: edit_default9, 18443 save: save16, 18444 transforms: transforms_default8, 18445 variations: variations_default4, 18446 deprecated: deprecated_default12 18447 }; 18448 var init32 = () => initBlock({ name: name32, metadata: block_default7, settings: settings32 }); 18449 18450 // packages/block-library/build-module/file/index.js 18451 var file_exports = {}; 18452 __export(file_exports, { 18453 init: () => init33, 18454 metadata: () => block_default33, 18455 name: () => name33, 18456 settings: () => settings33 18457 }); 18458 var import_i18n65 = __toESM(require_i18n()); 18459 var import_blocks28 = __toESM(require_blocks()); 18460 18461 // packages/block-library/build-module/file/deprecated.js 18462 var import_block_editor78 = __toESM(require_block_editor()); 18463 var import_i18n62 = __toESM(require_i18n()); 18464 var import_jsx_runtime229 = __toESM(require_jsx_runtime()); 18465 var v32 = { 18466 attributes: { 18467 id: { 18468 type: "number" 18469 }, 18470 href: { 18471 type: "string" 18472 }, 18473 fileId: { 18474 type: "string", 18475 source: "attribute", 18476 selector: "a:not([download])", 18477 attribute: "id" 18478 }, 18479 fileName: { 18480 type: "string", 18481 source: "html", 18482 selector: "a:not([download])" 18483 }, 18484 textLinkHref: { 18485 type: "string", 18486 source: "attribute", 18487 selector: "a:not([download])", 18488 attribute: "href" 18489 }, 18490 textLinkTarget: { 18491 type: "string", 18492 source: "attribute", 18493 selector: "a:not([download])", 18494 attribute: "target" 18495 }, 18496 showDownloadButton: { 18497 type: "boolean", 18498 default: true 18499 }, 18500 downloadButtonText: { 18501 type: "string", 18502 source: "html", 18503 selector: "a[download]" 18504 }, 18505 displayPreview: { 18506 type: "boolean" 18507 }, 18508 previewHeight: { 18509 type: "number", 18510 default: 600 18511 } 18512 }, 18513 supports: { 18514 anchor: true, 18515 align: true 18516 }, 18517 save({ attributes: attributes3 }) { 18518 const { 18519 href, 18520 fileId, 18521 fileName, 18522 textLinkHref, 18523 textLinkTarget, 18524 showDownloadButton, 18525 downloadButtonText, 18526 displayPreview, 18527 previewHeight 18528 } = attributes3; 18529 const pdfEmbedLabel = import_block_editor78.RichText.isEmpty(fileName) ? (0, import_i18n62.__)("PDF embed") : (0, import_i18n62.sprintf)( 18530 /* translators: %s: filename. */ 18531 (0, import_i18n62.__)("Embed of %s."), 18532 fileName 18533 ); 18534 const hasFilename = !import_block_editor78.RichText.isEmpty(fileName); 18535 const describedById = hasFilename ? fileId : void 0; 18536 return href && /* @__PURE__ */ (0, import_jsx_runtime229.jsxs)("div", { ...import_block_editor78.useBlockProps.save(), children: [ 18537 displayPreview && /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(import_jsx_runtime229.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime229.jsx)( 18538 "object", 18539 { 18540 className: "wp-block-file__embed", 18541 data: href, 18542 type: "application/pdf", 18543 style: { 18544 width: "100%", 18545 height: `$previewHeight}px` 18546 }, 18547 "aria-label": pdfEmbedLabel 18548 } 18549 ) }), 18550 hasFilename && /* @__PURE__ */ (0, import_jsx_runtime229.jsx)( 18551 "a", 18552 { 18553 id: describedById, 18554 href: textLinkHref, 18555 target: textLinkTarget, 18556 rel: textLinkTarget ? "noreferrer noopener" : void 0, 18557 children: /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(import_block_editor78.RichText.Content, { value: fileName }) 18558 } 18559 ), 18560 showDownloadButton && /* @__PURE__ */ (0, import_jsx_runtime229.jsx)( 18561 "a", 18562 { 18563 href, 18564 className: clsx_default( 18565 "wp-block-file__button", 18566 (0, import_block_editor78.__experimentalGetElementClassName)("button") 18567 ), 18568 download: true, 18569 "aria-describedby": describedById, 18570 children: /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(import_block_editor78.RichText.Content, { value: downloadButtonText }) 18571 } 18572 ) 18573 ] }); 18574 } 18575 }; 18576 var v23 = { 18577 attributes: { 18578 id: { 18579 type: "number" 18580 }, 18581 href: { 18582 type: "string" 18583 }, 18584 fileId: { 18585 type: "string", 18586 source: "attribute", 18587 selector: "a:not([download])", 18588 attribute: "id" 18589 }, 18590 fileName: { 18591 type: "string", 18592 source: "html", 18593 selector: "a:not([download])" 18594 }, 18595 textLinkHref: { 18596 type: "string", 18597 source: "attribute", 18598 selector: "a:not([download])", 18599 attribute: "href" 18600 }, 18601 textLinkTarget: { 18602 type: "string", 18603 source: "attribute", 18604 selector: "a:not([download])", 18605 attribute: "target" 18606 }, 18607 showDownloadButton: { 18608 type: "boolean", 18609 default: true 18610 }, 18611 downloadButtonText: { 18612 type: "string", 18613 source: "html", 18614 selector: "a[download]" 18615 }, 18616 displayPreview: { 18617 type: "boolean" 18618 }, 18619 previewHeight: { 18620 type: "number", 18621 default: 600 18622 } 18623 }, 18624 supports: { 18625 anchor: true, 18626 align: true 18627 }, 18628 save({ attributes: attributes3 }) { 18629 const { 18630 href, 18631 fileId, 18632 fileName, 18633 textLinkHref, 18634 textLinkTarget, 18635 showDownloadButton, 18636 downloadButtonText, 18637 displayPreview, 18638 previewHeight 18639 } = attributes3; 18640 const pdfEmbedLabel = import_block_editor78.RichText.isEmpty(fileName) ? (0, import_i18n62.__)("PDF embed") : (0, import_i18n62.sprintf)( 18641 /* translators: %s: filename. */ 18642 (0, import_i18n62.__)("Embed of %s."), 18643 fileName 18644 ); 18645 const hasFilename = !import_block_editor78.RichText.isEmpty(fileName); 18646 const describedById = hasFilename ? fileId : void 0; 18647 return href && /* @__PURE__ */ (0, import_jsx_runtime229.jsxs)("div", { ...import_block_editor78.useBlockProps.save(), children: [ 18648 displayPreview && /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(import_jsx_runtime229.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime229.jsx)( 18649 "object", 18650 { 18651 className: "wp-block-file__embed", 18652 data: href, 18653 type: "application/pdf", 18654 style: { 18655 width: "100%", 18656 height: `$previewHeight}px` 18657 }, 18658 "aria-label": pdfEmbedLabel 18659 } 18660 ) }), 18661 hasFilename && /* @__PURE__ */ (0, import_jsx_runtime229.jsx)( 18662 "a", 18663 { 18664 id: describedById, 18665 href: textLinkHref, 18666 target: textLinkTarget, 18667 rel: textLinkTarget ? "noreferrer noopener" : void 0, 18668 children: /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(import_block_editor78.RichText.Content, { value: fileName }) 18669 } 18670 ), 18671 showDownloadButton && /* @__PURE__ */ (0, import_jsx_runtime229.jsx)( 18672 "a", 18673 { 18674 href, 18675 className: "wp-block-file__button", 18676 download: true, 18677 "aria-describedby": describedById, 18678 children: /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(import_block_editor78.RichText.Content, { value: downloadButtonText }) 18679 } 18680 ) 18681 ] }); 18682 } 18683 }; 18684 var v19 = { 18685 attributes: { 18686 id: { 18687 type: "number" 18688 }, 18689 href: { 18690 type: "string" 18691 }, 18692 fileName: { 18693 type: "string", 18694 source: "html", 18695 selector: "a:not([download])" 18696 }, 18697 textLinkHref: { 18698 type: "string", 18699 source: "attribute", 18700 selector: "a:not([download])", 18701 attribute: "href" 18702 }, 18703 textLinkTarget: { 18704 type: "string", 18705 source: "attribute", 18706 selector: "a:not([download])", 18707 attribute: "target" 18708 }, 18709 showDownloadButton: { 18710 type: "boolean", 18711 default: true 18712 }, 18713 downloadButtonText: { 18714 type: "string", 18715 source: "html", 18716 selector: "a[download]" 18717 }, 18718 displayPreview: { 18719 type: "boolean" 18720 }, 18721 previewHeight: { 18722 type: "number", 18723 default: 600 18724 } 18725 }, 18726 supports: { 18727 anchor: true, 18728 align: true 18729 }, 18730 save({ attributes: attributes3 }) { 18731 const { 18732 href, 18733 fileName, 18734 textLinkHref, 18735 textLinkTarget, 18736 showDownloadButton, 18737 downloadButtonText, 18738 displayPreview, 18739 previewHeight 18740 } = attributes3; 18741 const pdfEmbedLabel = import_block_editor78.RichText.isEmpty(fileName) ? (0, import_i18n62.__)("PDF embed") : (0, import_i18n62.sprintf)( 18742 /* translators: %s: filename. */ 18743 (0, import_i18n62.__)("Embed of %s."), 18744 fileName 18745 ); 18746 return href && /* @__PURE__ */ (0, import_jsx_runtime229.jsxs)("div", { ...import_block_editor78.useBlockProps.save(), children: [ 18747 displayPreview && /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(import_jsx_runtime229.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime229.jsx)( 18748 "object", 18749 { 18750 className: "wp-block-file__embed", 18751 data: href, 18752 type: "application/pdf", 18753 style: { 18754 width: "100%", 18755 height: `$previewHeight}px` 18756 }, 18757 "aria-label": pdfEmbedLabel 18758 } 18759 ) }), 18760 !import_block_editor78.RichText.isEmpty(fileName) && /* @__PURE__ */ (0, import_jsx_runtime229.jsx)( 18761 "a", 18762 { 18763 href: textLinkHref, 18764 target: textLinkTarget, 18765 rel: textLinkTarget ? "noreferrer noopener" : void 0, 18766 children: /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(import_block_editor78.RichText.Content, { value: fileName }) 18767 } 18768 ), 18769 showDownloadButton && /* @__PURE__ */ (0, import_jsx_runtime229.jsx)( 18770 "a", 18771 { 18772 href, 18773 className: "wp-block-file__button", 18774 download: true, 18775 children: /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(import_block_editor78.RichText.Content, { value: downloadButtonText }) 18776 } 18777 ) 18778 ] }); 18779 } 18780 }; 18781 var deprecated6 = [v32, v23, v19]; 18782 var deprecated_default13 = deprecated6; 18783 18784 // packages/block-library/build-module/file/edit.js 18785 var import_blob7 = __toESM(require_blob()); 18786 var import_components42 = __toESM(require_components()); 18787 var import_data31 = __toESM(require_data()); 18788 var import_block_editor80 = __toESM(require_block_editor()); 18789 var import_element30 = __toESM(require_element()); 18790 var import_compose17 = __toESM(require_compose()); 18791 var import_i18n64 = __toESM(require_i18n()); 18792 var import_core_data18 = __toESM(require_core_data()); 18793 var import_notices5 = __toESM(require_notices()); 18794 var import_url7 = __toESM(require_url()); 18795 18796 // packages/block-library/build-module/file/inspector.js 18797 var import_i18n63 = __toESM(require_i18n()); 18798 var import_components41 = __toESM(require_components()); 18799 var import_block_editor79 = __toESM(require_block_editor()); 18800 var import_jsx_runtime230 = __toESM(require_jsx_runtime()); 18801 function FileBlockInspector({ 18802 hrefs, 18803 openInNewWindow, 18804 showDownloadButton, 18805 changeLinkDestinationOption, 18806 changeOpenInNewWindow, 18807 changeShowDownloadButton, 18808 displayPreview, 18809 changeDisplayPreview, 18810 previewHeight, 18811 changePreviewHeight 18812 }) { 18813 const { href, textLinkHref, attachmentPage } = hrefs; 18814 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 18815 let linkDestinationOptions = [{ value: href, label: (0, import_i18n63.__)("URL") }]; 18816 if (attachmentPage) { 18817 linkDestinationOptions = [ 18818 { value: href, label: (0, import_i18n63.__)("Media file") }, 18819 { value: attachmentPage, label: (0, import_i18n63.__)("Attachment page") } 18820 ]; 18821 } 18822 return /* @__PURE__ */ (0, import_jsx_runtime230.jsx)(import_jsx_runtime230.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime230.jsxs)(import_block_editor79.InspectorControls, { children: [ 18823 href.endsWith(".pdf") && /* @__PURE__ */ (0, import_jsx_runtime230.jsxs)( 18824 import_components41.__experimentalToolsPanel, 18825 { 18826 label: (0, import_i18n63.__)("PDF settings"), 18827 resetAll: () => { 18828 changeDisplayPreview(true); 18829 changePreviewHeight(600); 18830 }, 18831 dropdownMenuProps, 18832 children: [ 18833 /* @__PURE__ */ (0, import_jsx_runtime230.jsx)( 18834 import_components41.__experimentalToolsPanelItem, 18835 { 18836 label: (0, import_i18n63.__)("Show inline embed"), 18837 isShownByDefault: true, 18838 hasValue: () => !displayPreview, 18839 onDeselect: () => changeDisplayPreview(true), 18840 children: /* @__PURE__ */ (0, import_jsx_runtime230.jsx)( 18841 import_components41.ToggleControl, 18842 { 18843 label: (0, import_i18n63.__)("Show inline embed"), 18844 help: displayPreview ? (0, import_i18n63.__)( 18845 "Note: Most phone and tablet browsers won't display embedded PDFs." 18846 ) : null, 18847 checked: !!displayPreview, 18848 onChange: changeDisplayPreview 18849 } 18850 ) 18851 } 18852 ), 18853 displayPreview && /* @__PURE__ */ (0, import_jsx_runtime230.jsx)( 18854 import_components41.__experimentalToolsPanelItem, 18855 { 18856 label: (0, import_i18n63.__)("Height in pixels"), 18857 isShownByDefault: true, 18858 hasValue: () => previewHeight !== 600, 18859 onDeselect: () => changePreviewHeight(600), 18860 children: /* @__PURE__ */ (0, import_jsx_runtime230.jsx)( 18861 import_components41.RangeControl, 18862 { 18863 __next40pxDefaultSize: true, 18864 label: (0, import_i18n63.__)("Height in pixels"), 18865 min: MIN_PREVIEW_HEIGHT, 18866 max: Math.max( 18867 MAX_PREVIEW_HEIGHT, 18868 previewHeight 18869 ), 18870 value: previewHeight, 18871 onChange: changePreviewHeight 18872 } 18873 ) 18874 } 18875 ) 18876 ] 18877 } 18878 ), 18879 /* @__PURE__ */ (0, import_jsx_runtime230.jsxs)( 18880 import_components41.__experimentalToolsPanel, 18881 { 18882 label: (0, import_i18n63.__)("Settings"), 18883 resetAll: () => { 18884 changeLinkDestinationOption(href); 18885 changeOpenInNewWindow(false); 18886 changeShowDownloadButton(true); 18887 }, 18888 dropdownMenuProps, 18889 children: [ 18890 /* @__PURE__ */ (0, import_jsx_runtime230.jsx)( 18891 import_components41.__experimentalToolsPanelItem, 18892 { 18893 label: (0, import_i18n63.__)("Link to"), 18894 isShownByDefault: true, 18895 hasValue: () => textLinkHref !== href, 18896 onDeselect: () => changeLinkDestinationOption(href), 18897 children: /* @__PURE__ */ (0, import_jsx_runtime230.jsx)( 18898 import_components41.SelectControl, 18899 { 18900 __next40pxDefaultSize: true, 18901 label: (0, import_i18n63.__)("Link to"), 18902 value: textLinkHref, 18903 options: linkDestinationOptions, 18904 onChange: changeLinkDestinationOption 18905 } 18906 ) 18907 } 18908 ), 18909 /* @__PURE__ */ (0, import_jsx_runtime230.jsx)( 18910 import_components41.__experimentalToolsPanelItem, 18911 { 18912 label: (0, import_i18n63.__)("Open in new tab"), 18913 isShownByDefault: true, 18914 hasValue: () => !!openInNewWindow, 18915 onDeselect: () => changeOpenInNewWindow(false), 18916 children: /* @__PURE__ */ (0, import_jsx_runtime230.jsx)( 18917 import_components41.ToggleControl, 18918 { 18919 label: (0, import_i18n63.__)("Open in new tab"), 18920 checked: openInNewWindow, 18921 onChange: changeOpenInNewWindow 18922 } 18923 ) 18924 } 18925 ), 18926 /* @__PURE__ */ (0, import_jsx_runtime230.jsx)( 18927 import_components41.__experimentalToolsPanelItem, 18928 { 18929 label: (0, import_i18n63.__)("Show download button"), 18930 isShownByDefault: true, 18931 hasValue: () => !showDownloadButton, 18932 onDeselect: () => changeShowDownloadButton(true), 18933 children: /* @__PURE__ */ (0, import_jsx_runtime230.jsx)( 18934 import_components41.ToggleControl, 18935 { 18936 label: (0, import_i18n63.__)("Show download button"), 18937 checked: showDownloadButton, 18938 onChange: changeShowDownloadButton 18939 } 18940 ) 18941 } 18942 ) 18943 ] 18944 } 18945 ) 18946 ] }) }); 18947 } 18948 18949 // packages/block-library/build-module/file/utils/index.js 18950 var browserSupportsPdfs = () => { 18951 if (window.navigator.pdfViewerEnabled) { 18952 return true; 18953 } 18954 if (window.navigator.userAgent.indexOf("Mobi") > -1) { 18955 return false; 18956 } 18957 if (window.navigator.userAgent.indexOf("Android") > -1) { 18958 return false; 18959 } 18960 if (window.navigator.userAgent.indexOf("Macintosh") > -1 && window.navigator.maxTouchPoints && window.navigator.maxTouchPoints > 2) { 18961 return false; 18962 } 18963 if (!!(window.ActiveXObject || "ActiveXObject" in window) && !(createActiveXObject("AcroPDF.PDF") || createActiveXObject("PDF.PdfCtrl"))) { 18964 return false; 18965 } 18966 return true; 18967 }; 18968 var createActiveXObject = (type) => { 18969 let ax; 18970 try { 18971 ax = new window.ActiveXObject(type); 18972 } catch (e2) { 18973 ax = void 0; 18974 } 18975 return ax; 18976 }; 18977 18978 // packages/block-library/build-module/file/edit.js 18979 var import_jsx_runtime231 = __toESM(require_jsx_runtime()); 18980 var MIN_PREVIEW_HEIGHT = 200; 18981 var MAX_PREVIEW_HEIGHT = 2e3; 18982 function ClipboardToolbarButton({ text, disabled }) { 18983 const { createNotice } = (0, import_data31.useDispatch)(import_notices5.store); 18984 const ref = (0, import_compose17.useCopyToClipboard)(text, () => { 18985 createNotice("info", (0, import_i18n64.__)("Copied URL to clipboard."), { 18986 isDismissible: true, 18987 type: "snackbar" 18988 }); 18989 }); 18990 return /* @__PURE__ */ (0, import_jsx_runtime231.jsx)( 18991 import_components42.ToolbarButton, 18992 { 18993 className: "components-clipboard-toolbar-button", 18994 ref, 18995 disabled, 18996 children: (0, import_i18n64.__)("Copy URL") 18997 } 18998 ); 18999 } 19000 function FileEdit({ attributes: attributes3, isSelected, setAttributes, clientId }) { 19001 const { 19002 id, 19003 fileName, 19004 href, 19005 textLinkHref, 19006 textLinkTarget, 19007 showDownloadButton, 19008 downloadButtonText, 19009 displayPreview, 19010 previewHeight 19011 } = attributes3; 19012 const [temporaryURL, setTemporaryURL] = (0, import_element30.useState)(attributes3.blob); 19013 const { media } = (0, import_data31.useSelect)( 19014 (select9) => ({ 19015 media: id === void 0 ? void 0 : select9(import_core_data18.store).getEntityRecord( 19016 "postType", 19017 "attachment", 19018 id 19019 ) 19020 }), 19021 [id] 19022 ); 19023 const { createErrorNotice } = (0, import_data31.useDispatch)(import_notices5.store); 19024 const { toggleSelection, __unstableMarkNextChangeAsNotPersistent } = (0, import_data31.useDispatch)(import_block_editor80.store); 19025 useUploadMediaFromBlobURL({ 19026 url: temporaryURL, 19027 onChange: onSelectFile, 19028 onError: onUploadError 19029 }); 19030 (0, import_element30.useEffect)(() => { 19031 if (import_block_editor80.RichText.isEmpty(downloadButtonText)) { 19032 __unstableMarkNextChangeAsNotPersistent(); 19033 setAttributes({ 19034 downloadButtonText: (0, import_i18n64._x)("Download", "button label") 19035 }); 19036 } 19037 }, []); 19038 function onSelectFile(newMedia) { 19039 if (!newMedia || !newMedia.url) { 19040 setAttributes({ 19041 href: void 0, 19042 fileName: void 0, 19043 textLinkHref: void 0, 19044 id: void 0, 19045 fileId: void 0, 19046 displayPreview: void 0, 19047 previewHeight: void 0 19048 }); 19049 setTemporaryURL(); 19050 return; 19051 } 19052 if ((0, import_blob7.isBlobURL)(newMedia.url)) { 19053 setTemporaryURL(newMedia.url); 19054 return; 19055 } 19056 const isPdf = ( 19057 // Media Library and REST API use different properties for mime type. 19058 (newMedia.mime || newMedia.mime_type) === "application/pdf" || (0, import_url7.getFilename)(newMedia.url).toLowerCase().endsWith(".pdf") 19059 ); 19060 const pdfAttributes = { 19061 displayPreview: isPdf ? attributes3.displayPreview ?? true : void 0, 19062 previewHeight: isPdf ? attributes3.previewHeight ?? 600 : void 0 19063 }; 19064 setAttributes({ 19065 href: newMedia.url, 19066 fileName: newMedia.title, 19067 textLinkHref: newMedia.url, 19068 id: newMedia.id, 19069 fileId: `wp-block-file--media-$clientId}`, 19070 blob: void 0, 19071 ...pdfAttributes 19072 }); 19073 setTemporaryURL(); 19074 } 19075 function onUploadError(message) { 19076 setAttributes({ href: void 0 }); 19077 createErrorNotice(message, { type: "snackbar" }); 19078 } 19079 function changeLinkDestinationOption(newHref) { 19080 setAttributes({ textLinkHref: newHref }); 19081 } 19082 function changeOpenInNewWindow(newValue) { 19083 setAttributes({ 19084 textLinkTarget: newValue ? "_blank" : false 19085 }); 19086 } 19087 function changeShowDownloadButton(newValue) { 19088 setAttributes({ showDownloadButton: newValue }); 19089 } 19090 function changeDisplayPreview(newValue) { 19091 setAttributes({ displayPreview: newValue }); 19092 } 19093 function handleOnResizeStop(event, direction, elt, delta) { 19094 toggleSelection(true); 19095 const newHeight = parseInt(previewHeight + delta.height, 10); 19096 setAttributes({ previewHeight: newHeight }); 19097 } 19098 function changePreviewHeight(newValue) { 19099 const newHeight = Math.max( 19100 parseInt(newValue, 10), 19101 MIN_PREVIEW_HEIGHT 19102 ); 19103 setAttributes({ previewHeight: newHeight }); 19104 } 19105 const attachmentPage = media && media.link; 19106 const blockProps = (0, import_block_editor80.useBlockProps)({ 19107 className: clsx_default( 19108 !!temporaryURL && (0, import_components42.__unstableGetAnimateClassName)({ type: "loading" }), 19109 { 19110 "is-transient": !!temporaryURL 19111 } 19112 ) 19113 }); 19114 const displayPreviewInEditor = browserSupportsPdfs() && displayPreview; 19115 if (!href && !temporaryURL) { 19116 return /* @__PURE__ */ (0, import_jsx_runtime231.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime231.jsx)( 19117 import_block_editor80.MediaPlaceholder, 19118 { 19119 icon: /* @__PURE__ */ (0, import_jsx_runtime231.jsx)(import_block_editor80.BlockIcon, { icon: file_default }), 19120 labels: { 19121 title: (0, import_i18n64.__)("File"), 19122 instructions: (0, import_i18n64.__)( 19123 "Drag and drop a file, upload, or choose from your library." 19124 ) 19125 }, 19126 onSelect: onSelectFile, 19127 onError: onUploadError, 19128 accept: "*" 19129 } 19130 ) }); 19131 } 19132 return /* @__PURE__ */ (0, import_jsx_runtime231.jsxs)(import_jsx_runtime231.Fragment, { children: [ 19133 /* @__PURE__ */ (0, import_jsx_runtime231.jsx)( 19134 FileBlockInspector, 19135 { 19136 hrefs: { 19137 href: href || temporaryURL, 19138 textLinkHref, 19139 attachmentPage 19140 }, 19141 ...{ 19142 openInNewWindow: !!textLinkTarget, 19143 showDownloadButton, 19144 changeLinkDestinationOption, 19145 changeOpenInNewWindow, 19146 changeShowDownloadButton, 19147 displayPreview, 19148 changeDisplayPreview, 19149 previewHeight, 19150 changePreviewHeight 19151 } 19152 } 19153 ), 19154 /* @__PURE__ */ (0, import_jsx_runtime231.jsxs)(import_block_editor80.BlockControls, { group: "other", children: [ 19155 /* @__PURE__ */ (0, import_jsx_runtime231.jsx)( 19156 import_block_editor80.MediaReplaceFlow, 19157 { 19158 mediaId: id, 19159 mediaURL: href, 19160 accept: "*", 19161 onSelect: onSelectFile, 19162 onError: onUploadError, 19163 onReset: () => onSelectFile(void 0) 19164 } 19165 ), 19166 /* @__PURE__ */ (0, import_jsx_runtime231.jsx)( 19167 ClipboardToolbarButton, 19168 { 19169 text: href, 19170 disabled: (0, import_blob7.isBlobURL)(href) 19171 } 19172 ) 19173 ] }), 19174 /* @__PURE__ */ (0, import_jsx_runtime231.jsxs)("div", { ...blockProps, children: [ 19175 displayPreviewInEditor && /* @__PURE__ */ (0, import_jsx_runtime231.jsxs)( 19176 import_components42.ResizableBox, 19177 { 19178 size: { height: previewHeight, width: "100%" }, 19179 minHeight: MIN_PREVIEW_HEIGHT, 19180 maxHeight: MAX_PREVIEW_HEIGHT, 19181 grid: [1, 10], 19182 enable: { 19183 top: false, 19184 right: false, 19185 bottom: true, 19186 left: false, 19187 topRight: false, 19188 bottomRight: false, 19189 bottomLeft: false, 19190 topLeft: false 19191 }, 19192 onResizeStart: () => toggleSelection(false), 19193 onResizeStop: handleOnResizeStop, 19194 showHandle: isSelected, 19195 children: [ 19196 /* @__PURE__ */ (0, import_jsx_runtime231.jsx)( 19197 "object", 19198 { 19199 className: "wp-block-file__preview", 19200 data: href, 19201 type: "application/pdf", 19202 "aria-label": (0, import_i18n64.__)( 19203 "Embed of the selected PDF file." 19204 ) 19205 } 19206 ), 19207 !isSelected && /* @__PURE__ */ (0, import_jsx_runtime231.jsx)("div", { className: "wp-block-file__preview-overlay" }) 19208 ] 19209 } 19210 ), 19211 /* @__PURE__ */ (0, import_jsx_runtime231.jsxs)("div", { className: "wp-block-file__content-wrapper", children: [ 19212 /* @__PURE__ */ (0, import_jsx_runtime231.jsx)( 19213 import_block_editor80.RichText, 19214 { 19215 identifier: "fileName", 19216 tagName: "a", 19217 value: fileName, 19218 placeholder: (0, import_i18n64.__)("Write file name\u2026"), 19219 withoutInteractiveFormatting: true, 19220 onChange: (text) => setAttributes({ 19221 fileName: removeAnchorTag(text) 19222 }), 19223 href: textLinkHref 19224 } 19225 ), 19226 showDownloadButton && /* @__PURE__ */ (0, import_jsx_runtime231.jsx)("div", { className: "wp-block-file__button-richtext-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime231.jsx)( 19227 import_block_editor80.RichText, 19228 { 19229 identifier: "downloadButtonText", 19230 tagName: "div", 19231 "aria-label": (0, import_i18n64.__)("Download button text"), 19232 className: clsx_default( 19233 "wp-block-file__button", 19234 (0, import_block_editor80.__experimentalGetElementClassName)( 19235 "button" 19236 ) 19237 ), 19238 value: downloadButtonText, 19239 withoutInteractiveFormatting: true, 19240 placeholder: (0, import_i18n64.__)("Add text\u2026"), 19241 onChange: (text) => setAttributes({ 19242 downloadButtonText: removeAnchorTag(text) 19243 }) 19244 } 19245 ) }) 19246 ] }) 19247 ] }) 19248 ] }); 19249 } 19250 var edit_default10 = FileEdit; 19251 19252 // packages/block-library/build-module/file/block.json 19253 var block_default33 = { 19254 $schema: "https://schemas.wp.org/trunk/block.json", 19255 apiVersion: 3, 19256 name: "core/file", 19257 title: "File", 19258 category: "media", 19259 description: "Add a link to a downloadable file.", 19260 keywords: ["document", "pdf", "download"], 19261 textdomain: "default", 19262 attributes: { 19263 id: { 19264 type: "number" 19265 }, 19266 blob: { 19267 type: "string", 19268 role: "local" 19269 }, 19270 href: { 19271 type: "string", 19272 role: "content" 19273 }, 19274 fileId: { 19275 type: "string", 19276 source: "attribute", 19277 selector: "a:not([download])", 19278 attribute: "id" 19279 }, 19280 fileName: { 19281 type: "rich-text", 19282 source: "rich-text", 19283 selector: "a:not([download])", 19284 role: "content" 19285 }, 19286 textLinkHref: { 19287 type: "string", 19288 source: "attribute", 19289 selector: "a:not([download])", 19290 attribute: "href", 19291 role: "content" 19292 }, 19293 textLinkTarget: { 19294 type: "string", 19295 source: "attribute", 19296 selector: "a:not([download])", 19297 attribute: "target" 19298 }, 19299 showDownloadButton: { 19300 type: "boolean", 19301 default: true 19302 }, 19303 downloadButtonText: { 19304 type: "rich-text", 19305 source: "rich-text", 19306 selector: "a[download]", 19307 role: "content" 19308 }, 19309 displayPreview: { 19310 type: "boolean" 19311 }, 19312 previewHeight: { 19313 type: "number", 19314 default: 600 19315 } 19316 }, 19317 supports: { 19318 anchor: true, 19319 align: true, 19320 spacing: { 19321 margin: true, 19322 padding: true 19323 }, 19324 color: { 19325 gradients: true, 19326 link: true, 19327 text: false, 19328 __experimentalDefaultControls: { 19329 background: true, 19330 link: true 19331 } 19332 }, 19333 __experimentalBorder: { 19334 radius: true, 19335 color: true, 19336 width: true, 19337 style: true, 19338 __experimentalDefaultControls: { 19339 radius: true, 19340 color: true, 19341 width: true, 19342 style: true 19343 } 19344 }, 19345 interactivity: true 19346 }, 19347 editorStyle: "wp-block-file-editor", 19348 style: "wp-block-file" 19349 }; 19350 19351 // packages/block-library/build-module/file/save.js 19352 var import_block_editor81 = __toESM(require_block_editor()); 19353 var import_jsx_runtime232 = __toESM(require_jsx_runtime()); 19354 function save17({ attributes: attributes3 }) { 19355 const { 19356 href, 19357 fileId, 19358 fileName, 19359 textLinkHref, 19360 textLinkTarget, 19361 showDownloadButton, 19362 downloadButtonText, 19363 displayPreview, 19364 previewHeight 19365 } = attributes3; 19366 const pdfEmbedLabel = import_block_editor81.RichText.isEmpty(fileName) ? "PDF embed" : ( 19367 // To do: use toPlainText, but we need ensure it's RichTextData. See 19368 // https://github.com/WordPress/gutenberg/pull/56710. 19369 fileName.toString() 19370 ); 19371 const hasFilename = !import_block_editor81.RichText.isEmpty(fileName); 19372 const describedById = hasFilename ? fileId : void 0; 19373 return href && /* @__PURE__ */ (0, import_jsx_runtime232.jsxs)("div", { ...import_block_editor81.useBlockProps.save(), children: [ 19374 displayPreview && /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(import_jsx_runtime232.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime232.jsx)( 19375 "object", 19376 { 19377 className: "wp-block-file__embed", 19378 data: href, 19379 type: "application/pdf", 19380 style: { 19381 width: "100%", 19382 height: `$previewHeight}px` 19383 }, 19384 "aria-label": pdfEmbedLabel 19385 } 19386 ) }), 19387 hasFilename && /* @__PURE__ */ (0, import_jsx_runtime232.jsx)( 19388 "a", 19389 { 19390 id: describedById, 19391 href: textLinkHref, 19392 target: textLinkTarget, 19393 rel: textLinkTarget ? "noreferrer noopener" : void 0, 19394 children: /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(import_block_editor81.RichText.Content, { value: fileName }) 19395 } 19396 ), 19397 showDownloadButton && /* @__PURE__ */ (0, import_jsx_runtime232.jsx)( 19398 "a", 19399 { 19400 href, 19401 className: clsx_default( 19402 "wp-block-file__button", 19403 (0, import_block_editor81.__experimentalGetElementClassName)("button") 19404 ), 19405 download: true, 19406 "aria-describedby": describedById, 19407 children: /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(import_block_editor81.RichText.Content, { value: downloadButtonText }) 19408 } 19409 ) 19410 ] }); 19411 } 19412 19413 // packages/block-library/build-module/file/transforms.js 19414 var import_blob8 = __toESM(require_blob()); 19415 var import_blocks27 = __toESM(require_blocks()); 19416 var import_data32 = __toESM(require_data()); 19417 var import_core_data19 = __toESM(require_core_data()); 19418 var import_url8 = __toESM(require_url()); 19419 var transforms8 = { 19420 from: [ 19421 { 19422 type: "files", 19423 isMatch(files) { 19424 return files.length > 0; 19425 }, 19426 // We define a lower priority (higher number) than the default of 10. This 19427 // ensures that the File block is only created as a fallback. 19428 priority: 15, 19429 transform: (files) => { 19430 const blocks = []; 19431 files.forEach((file) => { 19432 const blobURL = (0, import_blob8.createBlobURL)(file); 19433 if (file.type.startsWith("video/")) { 19434 blocks.push( 19435 (0, import_blocks27.createBlock)("core/video", { 19436 blob: (0, import_blob8.createBlobURL)(file) 19437 }) 19438 ); 19439 } else if (file.type.startsWith("image/")) { 19440 blocks.push( 19441 (0, import_blocks27.createBlock)("core/image", { 19442 blob: (0, import_blob8.createBlobURL)(file) 19443 }) 19444 ); 19445 } else if (file.type.startsWith("audio/")) { 19446 blocks.push( 19447 (0, import_blocks27.createBlock)("core/audio", { 19448 blob: (0, import_blob8.createBlobURL)(file) 19449 }) 19450 ); 19451 } else { 19452 blocks.push( 19453 (0, import_blocks27.createBlock)("core/file", { 19454 blob: blobURL, 19455 fileName: file.name 19456 }) 19457 ); 19458 } 19459 }); 19460 return blocks; 19461 } 19462 }, 19463 { 19464 type: "block", 19465 blocks: ["core/audio"], 19466 transform: (attributes3) => { 19467 return (0, import_blocks27.createBlock)("core/file", { 19468 href: attributes3.src, 19469 fileName: attributes3.caption, 19470 textLinkHref: attributes3.src, 19471 id: attributes3.id, 19472 anchor: attributes3.anchor 19473 }); 19474 } 19475 }, 19476 { 19477 type: "block", 19478 blocks: ["core/video"], 19479 transform: (attributes3) => { 19480 return (0, import_blocks27.createBlock)("core/file", { 19481 href: attributes3.src, 19482 fileName: attributes3.caption, 19483 textLinkHref: attributes3.src, 19484 id: attributes3.id, 19485 anchor: attributes3.anchor 19486 }); 19487 } 19488 }, 19489 { 19490 type: "block", 19491 blocks: ["core/image"], 19492 transform: (attributes3) => { 19493 return (0, import_blocks27.createBlock)("core/file", { 19494 href: attributes3.url, 19495 fileName: attributes3.caption || (0, import_url8.getFilename)(attributes3.url), 19496 textLinkHref: attributes3.url, 19497 id: attributes3.id, 19498 anchor: attributes3.anchor 19499 }); 19500 } 19501 } 19502 ], 19503 to: [ 19504 { 19505 type: "block", 19506 blocks: ["core/audio"], 19507 isMatch: ({ id }) => { 19508 if (!id) { 19509 return false; 19510 } 19511 const { getEntityRecord } = (0, import_data32.select)(import_core_data19.store); 19512 const media = getEntityRecord("postType", "attachment", id); 19513 return !!media && media.mime_type.includes("audio"); 19514 }, 19515 transform: (attributes3) => { 19516 return (0, import_blocks27.createBlock)("core/audio", { 19517 src: attributes3.href, 19518 caption: attributes3.fileName, 19519 id: attributes3.id, 19520 anchor: attributes3.anchor 19521 }); 19522 } 19523 }, 19524 { 19525 type: "block", 19526 blocks: ["core/video"], 19527 isMatch: ({ id }) => { 19528 if (!id) { 19529 return false; 19530 } 19531 const { getEntityRecord } = (0, import_data32.select)(import_core_data19.store); 19532 const media = getEntityRecord("postType", "attachment", id); 19533 return !!media && media.mime_type.includes("video"); 19534 }, 19535 transform: (attributes3) => { 19536 return (0, import_blocks27.createBlock)("core/video", { 19537 src: attributes3.href, 19538 caption: attributes3.fileName, 19539 id: attributes3.id, 19540 anchor: attributes3.anchor 19541 }); 19542 } 19543 }, 19544 { 19545 type: "block", 19546 blocks: ["core/image"], 19547 isMatch: ({ id }) => { 19548 if (!id) { 19549 return false; 19550 } 19551 const { getEntityRecord } = (0, import_data32.select)(import_core_data19.store); 19552 const media = getEntityRecord("postType", "attachment", id); 19553 return !!media && media.mime_type.includes("image"); 19554 }, 19555 transform: (attributes3) => { 19556 return (0, import_blocks27.createBlock)("core/image", { 19557 url: attributes3.href, 19558 caption: attributes3.fileName, 19559 id: attributes3.id, 19560 anchor: attributes3.anchor 19561 }); 19562 } 19563 } 19564 ] 19565 }; 19566 var transforms_default9 = transforms8; 19567 19568 // packages/block-library/build-module/file/index.js 19569 var { fieldsKey: fieldsKey6, formKey: formKey6 } = unlock(import_blocks28.privateApis); 19570 var { name: name33 } = block_default33; 19571 var settings33 = { 19572 icon: file_default, 19573 example: { 19574 attributes: { 19575 href: "https://upload.wikimedia.org/wikipedia/commons/d/dd/Armstrong_Small_Step.ogg", 19576 fileName: (0, import_i18n65._x)("Armstrong_Small_Step", "Name of the file") 19577 } 19578 }, 19579 transforms: transforms_default9, 19580 deprecated: deprecated_default13, 19581 edit: edit_default10, 19582 save: save17 19583 }; 19584 if (window.__experimentalContentOnlyInspectorFields) { 19585 settings33[fieldsKey6] = [ 19586 { 19587 id: "file", 19588 label: (0, import_i18n65.__)("File"), 19589 type: "media", 19590 mapping: { 19591 id: "id", 19592 url: "href" 19593 }, 19594 args: { 19595 allowedTypes: [], 19596 multiple: false 19597 } 19598 }, 19599 { 19600 id: "fileName", 19601 label: (0, import_i18n65.__)("Filename"), 19602 type: "richtext" 19603 }, 19604 { 19605 id: "downloadButtonText", 19606 label: (0, import_i18n65.__)("Button Text"), 19607 type: "richtext" 19608 } 19609 ]; 19610 settings33[formKey6] = { 19611 fields: ["file"] 19612 }; 19613 } 19614 var init33 = () => initBlock({ name: name33, metadata: block_default33, settings: settings33 }); 19615 19616 // packages/block-library/build-module/form/index.js 19617 var form_exports = {}; 19618 __export(form_exports, { 19619 init: () => init34, 19620 metadata: () => block_default34, 19621 name: () => name34, 19622 settings: () => settings34 19623 }); 19624 19625 // packages/block-library/build-module/form/edit.js 19626 var import_i18n67 = __toESM(require_i18n()); 19627 var import_block_editor82 = __toESM(require_block_editor()); 19628 var import_components43 = __toESM(require_components()); 19629 var import_data33 = __toESM(require_data()); 19630 19631 // packages/block-library/build-module/form/utils.js 19632 var import_i18n66 = __toESM(require_i18n()); 19633 var formSubmissionNotificationSuccess = [ 19634 "core/form-submission-notification", 19635 { 19636 type: "success" 19637 }, 19638 [ 19639 [ 19640 "core/paragraph", 19641 { 19642 content: '<mark style="background-color:rgba(0, 0, 0, 0);color:#345C00" class="has-inline-color">' + (0, import_i18n66.__)("Your form has been submitted successfully") + "</mark>" 19643 } 19644 ] 19645 ] 19646 ]; 19647 var formSubmissionNotificationError = [ 19648 "core/form-submission-notification", 19649 { 19650 type: "error" 19651 }, 19652 [ 19653 [ 19654 "core/paragraph", 19655 { 19656 content: '<mark style="background-color:rgba(0, 0, 0, 0);color:#CF2E2E" class="has-inline-color">' + (0, import_i18n66.__)("There was an error submitting your form.") + "</mark>" 19657 } 19658 ] 19659 ] 19660 ]; 19661 19662 // packages/block-library/build-module/form/edit.js 19663 var import_jsx_runtime233 = __toESM(require_jsx_runtime()); 19664 var TEMPLATE5 = [ 19665 formSubmissionNotificationSuccess, 19666 formSubmissionNotificationError, 19667 [ 19668 "core/form-input", 19669 { 19670 type: "text", 19671 label: (0, import_i18n67.__)("Name"), 19672 required: true 19673 } 19674 ], 19675 [ 19676 "core/form-input", 19677 { 19678 type: "email", 19679 label: (0, import_i18n67.__)("Email"), 19680 required: true 19681 } 19682 ], 19683 [ 19684 "core/form-input", 19685 { 19686 type: "textarea", 19687 label: (0, import_i18n67.__)("Comment"), 19688 required: true 19689 } 19690 ], 19691 ["core/form-submit-button", {}] 19692 ]; 19693 var Edit13 = ({ attributes: attributes3, setAttributes, clientId }) => { 19694 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 19695 const resetAllSettings = () => { 19696 setAttributes({ 19697 submissionMethod: "email", 19698 email: void 0, 19699 action: void 0, 19700 method: "post" 19701 }); 19702 }; 19703 const { action, method, email, submissionMethod } = attributes3; 19704 const blockProps = (0, import_block_editor82.useBlockProps)(); 19705 const { hasInnerBlocks } = (0, import_data33.useSelect)( 19706 (select9) => { 19707 const { getBlock } = select9(import_block_editor82.store); 19708 const block = getBlock(clientId); 19709 return { 19710 hasInnerBlocks: !!(block && block.innerBlocks.length) 19711 }; 19712 }, 19713 [clientId] 19714 ); 19715 const innerBlocksProps = (0, import_block_editor82.useInnerBlocksProps)(blockProps, { 19716 template: TEMPLATE5, 19717 renderAppender: hasInnerBlocks ? void 0 : import_block_editor82.InnerBlocks.ButtonBlockAppender 19718 }); 19719 return /* @__PURE__ */ (0, import_jsx_runtime233.jsxs)(import_jsx_runtime233.Fragment, { children: [ 19720 /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(import_block_editor82.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime233.jsxs)( 19721 import_components43.__experimentalToolsPanel, 19722 { 19723 dropdownMenuProps, 19724 label: (0, import_i18n67.__)("Settings"), 19725 resetAll: resetAllSettings, 19726 children: [ 19727 /* @__PURE__ */ (0, import_jsx_runtime233.jsx)( 19728 import_components43.__experimentalToolsPanelItem, 19729 { 19730 hasValue: () => submissionMethod !== "email", 19731 label: (0, import_i18n67.__)("Submissions method"), 19732 onDeselect: () => setAttributes({ 19733 submissionMethod: "email" 19734 }), 19735 isShownByDefault: true, 19736 children: /* @__PURE__ */ (0, import_jsx_runtime233.jsx)( 19737 import_components43.SelectControl, 19738 { 19739 __next40pxDefaultSize: true, 19740 label: (0, import_i18n67.__)("Submissions method"), 19741 options: [ 19742 // TODO: Allow plugins to add their own submission methods. 19743 { 19744 label: (0, import_i18n67.__)("Send email"), 19745 value: "email" 19746 }, 19747 { 19748 label: (0, import_i18n67.__)("- Custom -"), 19749 value: "custom" 19750 } 19751 ], 19752 value: submissionMethod, 19753 onChange: (value) => setAttributes({ submissionMethod: value }), 19754 help: submissionMethod === "custom" ? (0, import_i18n67.__)( 19755 'Select the method to use for form submissions. Additional options for the "custom" mode can be found in the "Advanced" section.' 19756 ) : (0, import_i18n67.__)( 19757 "Select the method to use for form submissions." 19758 ) 19759 } 19760 ) 19761 } 19762 ), 19763 submissionMethod === "email" && /* @__PURE__ */ (0, import_jsx_runtime233.jsx)( 19764 import_components43.__experimentalToolsPanelItem, 19765 { 19766 hasValue: () => !!email, 19767 label: (0, import_i18n67.__)("Email for form submissions"), 19768 onDeselect: () => setAttributes({ 19769 email: void 0, 19770 action: void 0, 19771 method: "post" 19772 }), 19773 isShownByDefault: true, 19774 children: /* @__PURE__ */ (0, import_jsx_runtime233.jsx)( 19775 import_components43.TextControl, 19776 { 19777 __next40pxDefaultSize: true, 19778 autoComplete: "off", 19779 label: (0, import_i18n67.__)("Email for form submissions"), 19780 value: email || "", 19781 required: true, 19782 onChange: (value) => { 19783 setAttributes({ email: value }); 19784 setAttributes({ 19785 action: `mailto:$value}` 19786 }); 19787 setAttributes({ method: "post" }); 19788 }, 19789 help: (0, import_i18n67.__)( 19790 "The email address where form submissions will be sent. Separate multiple email addresses with a comma." 19791 ), 19792 type: "email" 19793 } 19794 ) 19795 } 19796 ) 19797 ] 19798 } 19799 ) }), 19800 submissionMethod !== "email" && /* @__PURE__ */ (0, import_jsx_runtime233.jsxs)(import_block_editor82.InspectorControls, { group: "advanced", children: [ 19801 /* @__PURE__ */ (0, import_jsx_runtime233.jsx)( 19802 import_components43.SelectControl, 19803 { 19804 __next40pxDefaultSize: true, 19805 label: (0, import_i18n67.__)("Method"), 19806 options: [ 19807 { label: "Get", value: "get" }, 19808 { label: "Post", value: "post" } 19809 ], 19810 value: method, 19811 onChange: (value) => setAttributes({ method: value }), 19812 help: (0, import_i18n67.__)( 19813 "Select the method to use for form submissions." 19814 ) 19815 } 19816 ), 19817 /* @__PURE__ */ (0, import_jsx_runtime233.jsx)( 19818 import_components43.TextControl, 19819 { 19820 __next40pxDefaultSize: true, 19821 autoComplete: "off", 19822 label: (0, import_i18n67.__)("Form action"), 19823 value: action, 19824 onChange: (newVal) => { 19825 setAttributes({ 19826 action: newVal 19827 }); 19828 }, 19829 help: (0, import_i18n67.__)( 19830 "The URL where the form should be submitted." 19831 ), 19832 type: "url" 19833 } 19834 ) 19835 ] }), 19836 /* @__PURE__ */ (0, import_jsx_runtime233.jsx)( 19837 "form", 19838 { 19839 ...innerBlocksProps, 19840 encType: submissionMethod === "email" ? "text/plain" : null 19841 } 19842 ) 19843 ] }); 19844 }; 19845 var edit_default11 = Edit13; 19846 19847 // packages/block-library/build-module/form/block.json 19848 var block_default34 = { 19849 $schema: "https://schemas.wp.org/trunk/block.json", 19850 apiVersion: 3, 19851 __experimental: true, 19852 name: "core/form", 19853 title: "Form", 19854 category: "common", 19855 allowedBlocks: [ 19856 "core/paragraph", 19857 "core/heading", 19858 "core/form-input", 19859 "core/form-submit-button", 19860 "core/form-submission-notification", 19861 "core/group", 19862 "core/columns" 19863 ], 19864 description: "A form.", 19865 keywords: ["container", "wrapper", "row", "section"], 19866 textdomain: "default", 19867 icon: "feedback", 19868 attributes: { 19869 submissionMethod: { 19870 type: "string", 19871 default: "email" 19872 }, 19873 method: { 19874 type: "string", 19875 default: "post" 19876 }, 19877 action: { 19878 type: "string" 19879 }, 19880 email: { 19881 type: "string" 19882 } 19883 }, 19884 supports: { 19885 anchor: true, 19886 color: { 19887 gradients: true, 19888 link: true, 19889 __experimentalDefaultControls: { 19890 background: true, 19891 text: true, 19892 link: true 19893 } 19894 }, 19895 spacing: { 19896 margin: true, 19897 padding: true 19898 }, 19899 typography: { 19900 fontSize: true, 19901 lineHeight: true, 19902 __experimentalFontFamily: true, 19903 __experimentalTextDecoration: true, 19904 __experimentalFontStyle: true, 19905 __experimentalFontWeight: true, 19906 __experimentalLetterSpacing: true, 19907 __experimentalTextTransform: true, 19908 __experimentalDefaultControls: { 19909 fontSize: true 19910 } 19911 } 19912 } 19913 }; 19914 19915 // packages/block-library/build-module/form/save.js 19916 var import_block_editor83 = __toESM(require_block_editor()); 19917 var import_jsx_runtime234 = __toESM(require_jsx_runtime()); 19918 function save18({ attributes: attributes3 }) { 19919 const blockProps = import_block_editor83.useBlockProps.save(); 19920 const { submissionMethod } = attributes3; 19921 return /* @__PURE__ */ (0, import_jsx_runtime234.jsx)( 19922 "form", 19923 { 19924 ...blockProps, 19925 encType: submissionMethod === "email" ? "text/plain" : null, 19926 children: /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(import_block_editor83.InnerBlocks.Content, {}) 19927 } 19928 ); 19929 } 19930 19931 // packages/block-library/build-module/form/variations.js 19932 var import_i18n68 = __toESM(require_i18n()); 19933 var variations5 = [ 19934 { 19935 name: "comment-form", 19936 title: (0, import_i18n68.__)("Experimental Comment form"), 19937 description: (0, import_i18n68.__)("A comment form for posts and pages."), 19938 attributes: { 19939 submissionMethod: "custom", 19940 action: "{SITE_URL}/wp-comments-post.php", 19941 method: "post", 19942 anchor: "comment-form" 19943 }, 19944 isDefault: false, 19945 innerBlocks: [ 19946 [ 19947 "core/form-input", 19948 { 19949 type: "text", 19950 name: "author", 19951 label: (0, import_i18n68.__)("Name"), 19952 required: true, 19953 visibilityPermissions: "logged-out" 19954 } 19955 ], 19956 [ 19957 "core/form-input", 19958 { 19959 type: "email", 19960 name: "email", 19961 label: (0, import_i18n68.__)("Email"), 19962 required: true, 19963 visibilityPermissions: "logged-out" 19964 } 19965 ], 19966 [ 19967 "core/form-input", 19968 { 19969 type: "textarea", 19970 name: "comment", 19971 label: (0, import_i18n68.__)("Comment"), 19972 required: true, 19973 visibilityPermissions: "all" 19974 } 19975 ], 19976 ["core/form-submit-button", {}] 19977 ], 19978 scope: ["inserter", "transform"], 19979 isActive: (blockAttributes8) => !blockAttributes8?.type || blockAttributes8?.type === "text" 19980 }, 19981 { 19982 name: "wp-privacy-form", 19983 title: (0, import_i18n68.__)("Experimental Privacy Request Form"), 19984 keywords: ["GDPR"], 19985 description: (0, import_i18n68.__)("A form to request data exports and/or deletion."), 19986 attributes: { 19987 submissionMethod: "custom", 19988 action: "", 19989 method: "post", 19990 anchor: "gdpr-form" 19991 }, 19992 isDefault: false, 19993 innerBlocks: [ 19994 formSubmissionNotificationSuccess, 19995 formSubmissionNotificationError, 19996 [ 19997 "core/paragraph", 19998 { 19999 content: (0, import_i18n68.__)( 20000 "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." 20001 ) 20002 } 20003 ], 20004 [ 20005 "core/form-input", 20006 { 20007 type: "email", 20008 name: "email", 20009 label: (0, import_i18n68.__)("Enter your email address."), 20010 required: true, 20011 visibilityPermissions: "all" 20012 } 20013 ], 20014 [ 20015 "core/form-input", 20016 { 20017 type: "checkbox", 20018 name: "export_personal_data", 20019 label: (0, import_i18n68.__)("Request data export"), 20020 required: false, 20021 visibilityPermissions: "all" 20022 } 20023 ], 20024 [ 20025 "core/form-input", 20026 { 20027 type: "checkbox", 20028 name: "remove_personal_data", 20029 label: (0, import_i18n68.__)("Request data deletion"), 20030 required: false, 20031 visibilityPermissions: "all" 20032 } 20033 ], 20034 ["core/form-submit-button", {}], 20035 [ 20036 "core/form-input", 20037 { 20038 type: "hidden", 20039 name: "wp-action", 20040 value: "wp_privacy_send_request" 20041 } 20042 ], 20043 [ 20044 "core/form-input", 20045 { 20046 type: "hidden", 20047 name: "wp-privacy-request", 20048 value: "1" 20049 } 20050 ] 20051 ], 20052 scope: ["inserter", "transform"], 20053 isActive: (blockAttributes8) => !blockAttributes8?.type || blockAttributes8?.type === "text" 20054 } 20055 ]; 20056 var variations_default5 = variations5; 20057 20058 // packages/block-library/build-module/form/deprecated.js 20059 var import_block_editor84 = __toESM(require_block_editor()); 20060 var import_jsx_runtime235 = __toESM(require_jsx_runtime()); 20061 var v110 = { 20062 // The block supports here are deliberately empty despite this 20063 // deprecated version of the block having adopted block supports. 20064 // The attributes added by these supports have been manually 20065 // added to this deprecated version's attributes definition so 20066 // that the data isn't lost on migration. All this is so that the 20067 // automatic application of block support classes doesn't occur 20068 // as this version of the block had a bug that overrode those 20069 // classes. If those block support classes are applied during the 20070 // deprecation process, this deprecation doesn't match and won't 20071 // run. 20072 // @see https://github.com/WordPress/gutenberg/pull/55755 20073 supports: {}, 20074 attributes: { 20075 submissionMethod: { 20076 type: "string", 20077 default: "email" 20078 }, 20079 method: { 20080 type: "string", 20081 default: "post" 20082 }, 20083 action: { 20084 type: "string" 20085 }, 20086 email: { 20087 type: "string" 20088 }, 20089 // The following attributes have been added to match the block 20090 // supports at the time of the deprecation. See above for details. 20091 anchor: { 20092 type: "string", 20093 source: "attribute", 20094 attribute: "id", 20095 selector: "*" 20096 }, 20097 backgroundColor: { 20098 type: "string" 20099 }, 20100 textColor: { 20101 type: "string" 20102 }, 20103 gradient: { 20104 type: "string" 20105 }, 20106 style: { 20107 type: "object" 20108 }, 20109 fontFamily: { 20110 type: "string" 20111 }, 20112 fontSize: { 20113 type: "string" 20114 } 20115 }, 20116 save({ attributes: attributes3 }) { 20117 const { submissionMethod } = attributes3; 20118 const colorProps = (0, import_block_editor84.__experimentalGetColorClassesAndStyles)(attributes3); 20119 const typographyProps = (0, import_block_editor84.getTypographyClassesAndStyles)(attributes3); 20120 const spacingProps = (0, import_block_editor84.__experimentalGetSpacingClassesAndStyles)(attributes3); 20121 const blockProps = import_block_editor84.useBlockProps.save({ 20122 // In this deprecated version, the block support is deliberately empty. 20123 // As a result, the useBlockProps.save() does not output style or id attributes, 20124 // so we apply them explicitly here. 20125 style: { 20126 ...colorProps.style, 20127 ...typographyProps.style, 20128 ...spacingProps.style 20129 }, 20130 id: attributes3.anchor 20131 }); 20132 return /* @__PURE__ */ (0, import_jsx_runtime235.jsx)( 20133 "form", 20134 { 20135 ...blockProps, 20136 className: "wp-block-form", 20137 encType: submissionMethod === "email" ? "text/plain" : null, 20138 children: /* @__PURE__ */ (0, import_jsx_runtime235.jsx)(import_block_editor84.InnerBlocks.Content, {}) 20139 } 20140 ); 20141 } 20142 }; 20143 var deprecated_default14 = [v110]; 20144 20145 // packages/block-library/build-module/form/index.js 20146 var import_hooks26 = __toESM(require_hooks()); 20147 var { name: name34 } = block_default34; 20148 var settings34 = { 20149 edit: edit_default11, 20150 save: save18, 20151 deprecated: deprecated_default14, 20152 variations: variations_default5, 20153 example: {} 20154 }; 20155 var init34 = () => { 20156 const DISALLOWED_PARENTS = ["core/form"]; 20157 (0, import_hooks26.addFilter)( 20158 "blockEditor.__unstableCanInsertBlockType", 20159 "core/block-library/preventInsertingFormIntoAnotherForm", 20160 (canInsert, blockType, rootClientId, { getBlock, getBlockParentsByBlockName }) => { 20161 if (blockType.name !== "core/form") { 20162 return canInsert; 20163 } 20164 for (const disallowedParentType of DISALLOWED_PARENTS) { 20165 const hasDisallowedParent = getBlock(rootClientId)?.name === disallowedParentType || getBlockParentsByBlockName( 20166 rootClientId, 20167 disallowedParentType 20168 ).length; 20169 if (hasDisallowedParent) { 20170 return false; 20171 } 20172 } 20173 return true; 20174 } 20175 ); 20176 return initBlock({ name: name34, metadata: block_default34, settings: settings34 }); 20177 }; 20178 20179 // packages/block-library/build-module/form-input/index.js 20180 var form_input_exports = {}; 20181 __export(form_input_exports, { 20182 init: () => init35, 20183 metadata: () => block_default35, 20184 name: () => name35, 20185 settings: () => settings35 20186 }); 20187 20188 // packages/block-library/build-module/form-input/deprecated.js 20189 var import_remove_accents = __toESM(require_remove_accents()); 20190 var import_block_editor85 = __toESM(require_block_editor()); 20191 var import_dom = __toESM(require_dom()); 20192 var import_jsx_runtime236 = __toESM(require_jsx_runtime()); 20193 var getNameFromLabelV1 = (content) => { 20194 return (0, import_remove_accents.default)((0, import_dom.__unstableStripHTML)(content)).replace(/[^\p{L}\p{N}]+/gu, "-").toLowerCase().replace(/(^-+)|(-+$)/g, ""); 20195 }; 20196 var v24 = { 20197 attributes: { 20198 type: { 20199 type: "string", 20200 default: "text" 20201 }, 20202 name: { 20203 type: "string" 20204 }, 20205 label: { 20206 type: "string", 20207 default: "Label", 20208 selector: ".wp-block-form-input__label-content", 20209 source: "html", 20210 role: "content" 20211 }, 20212 inlineLabel: { 20213 type: "boolean", 20214 default: false 20215 }, 20216 required: { 20217 type: "boolean", 20218 default: false, 20219 selector: ".wp-block-form-input__input", 20220 source: "attribute", 20221 attribute: "required" 20222 }, 20223 placeholder: { 20224 type: "string", 20225 selector: ".wp-block-form-input__input", 20226 source: "attribute", 20227 attribute: "placeholder", 20228 role: "content" 20229 }, 20230 value: { 20231 type: "string", 20232 default: "", 20233 selector: "input", 20234 source: "attribute", 20235 attribute: "value" 20236 }, 20237 visibilityPermissions: { 20238 type: "string", 20239 default: "all" 20240 } 20241 }, 20242 supports: { 20243 anchor: true, 20244 reusable: false, 20245 spacing: { 20246 margin: ["top", "bottom"] 20247 }, 20248 __experimentalBorder: { 20249 radius: true, 20250 __experimentalSkipSerialization: true, 20251 __experimentalDefaultControls: { 20252 radius: true 20253 } 20254 } 20255 }, 20256 save({ attributes: attributes3 }) { 20257 const { type, name: name117, label, inlineLabel, required, placeholder: placeholder2, value } = attributes3; 20258 const borderProps = (0, import_block_editor85.__experimentalGetBorderClassesAndStyles)(attributes3); 20259 const colorProps = (0, import_block_editor85.__experimentalGetColorClassesAndStyles)(attributes3); 20260 const inputStyle = { 20261 ...borderProps.style, 20262 ...colorProps.style 20263 }; 20264 const inputClasses = clsx_default( 20265 "wp-block-form-input__input", 20266 colorProps.className, 20267 borderProps.className 20268 ); 20269 const TagName2 = type === "textarea" ? "textarea" : "input"; 20270 const blockProps = import_block_editor85.useBlockProps.save(); 20271 if ("hidden" === type) { 20272 return /* @__PURE__ */ (0, import_jsx_runtime236.jsx)("input", { type, name: name117, value }); 20273 } 20274 return /* @__PURE__ */ (0, import_jsx_runtime236.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime236.jsxs)( 20275 "label", 20276 { 20277 className: clsx_default("wp-block-form-input__label", { 20278 "is-label-inline": inlineLabel 20279 }), 20280 children: [ 20281 /* @__PURE__ */ (0, import_jsx_runtime236.jsx)("span", { className: "wp-block-form-input__label-content", children: /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(import_block_editor85.RichText.Content, { value: label }) }), 20282 /* @__PURE__ */ (0, import_jsx_runtime236.jsx)( 20283 TagName2, 20284 { 20285 className: inputClasses, 20286 type: "textarea" === type ? void 0 : type, 20287 name: name117 || getNameFromLabelV1(label), 20288 required, 20289 "aria-required": required, 20290 placeholder: placeholder2 || void 0, 20291 style: inputStyle 20292 } 20293 ) 20294 ] 20295 } 20296 ) }); 20297 } 20298 }; 20299 var v111 = { 20300 attributes: { 20301 type: { 20302 type: "string", 20303 default: "text" 20304 }, 20305 name: { 20306 type: "string" 20307 }, 20308 label: { 20309 type: "string", 20310 default: "Label", 20311 selector: ".wp-block-form-input__label-content", 20312 source: "html", 20313 role: "content" 20314 }, 20315 inlineLabel: { 20316 type: "boolean", 20317 default: false 20318 }, 20319 required: { 20320 type: "boolean", 20321 default: false, 20322 selector: ".wp-block-form-input__input", 20323 source: "attribute", 20324 attribute: "required" 20325 }, 20326 placeholder: { 20327 type: "string", 20328 selector: ".wp-block-form-input__input", 20329 source: "attribute", 20330 attribute: "placeholder", 20331 role: "content" 20332 }, 20333 value: { 20334 type: "string", 20335 default: "", 20336 selector: "input", 20337 source: "attribute", 20338 attribute: "value" 20339 }, 20340 visibilityPermissions: { 20341 type: "string", 20342 default: "all" 20343 } 20344 }, 20345 supports: { 20346 className: false, 20347 anchor: true, 20348 reusable: false, 20349 spacing: { 20350 margin: ["top", "bottom"] 20351 }, 20352 __experimentalBorder: { 20353 radius: true, 20354 __experimentalSkipSerialization: true, 20355 __experimentalDefaultControls: { 20356 radius: true 20357 } 20358 } 20359 }, 20360 save({ attributes: attributes3 }) { 20361 const { type, name: name117, label, inlineLabel, required, placeholder: placeholder2, value } = attributes3; 20362 const borderProps = (0, import_block_editor85.__experimentalGetBorderClassesAndStyles)(attributes3); 20363 const colorProps = (0, import_block_editor85.__experimentalGetColorClassesAndStyles)(attributes3); 20364 const inputStyle = { 20365 ...borderProps.style, 20366 ...colorProps.style 20367 }; 20368 const inputClasses = clsx_default( 20369 "wp-block-form-input__input", 20370 colorProps.className, 20371 borderProps.className 20372 ); 20373 const TagName2 = type === "textarea" ? "textarea" : "input"; 20374 if ("hidden" === type) { 20375 return /* @__PURE__ */ (0, import_jsx_runtime236.jsx)("input", { type, name: name117, value }); 20376 } 20377 return /* @__PURE__ */ (0, import_jsx_runtime236.jsxs)( 20378 "label", 20379 { 20380 className: clsx_default("wp-block-form-input__label", { 20381 "is-label-inline": inlineLabel 20382 }), 20383 children: [ 20384 /* @__PURE__ */ (0, import_jsx_runtime236.jsx)("span", { className: "wp-block-form-input__label-content", children: /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(import_block_editor85.RichText.Content, { value: label }) }), 20385 /* @__PURE__ */ (0, import_jsx_runtime236.jsx)( 20386 TagName2, 20387 { 20388 className: inputClasses, 20389 type: "textarea" === type ? void 0 : type, 20390 name: name117 || getNameFromLabelV1(label), 20391 required, 20392 "aria-required": required, 20393 placeholder: placeholder2 || void 0, 20394 style: inputStyle 20395 } 20396 ) 20397 ] 20398 } 20399 ); 20400 } 20401 }; 20402 var deprecated7 = [v24, v111]; 20403 var deprecated_default15 = deprecated7; 20404 20405 // packages/block-library/build-module/form-input/edit.js 20406 var import_i18n69 = __toESM(require_i18n()); 20407 var import_block_editor86 = __toESM(require_block_editor()); 20408 var import_components44 = __toESM(require_components()); 20409 var import_element31 = __toESM(require_element()); 20410 var import_jsx_runtime237 = __toESM(require_jsx_runtime()); 20411 function InputFieldBlock({ attributes: attributes3, setAttributes, className }) { 20412 const { type, name: name117, label, inlineLabel, required, placeholder: placeholder2, value } = attributes3; 20413 const blockProps = (0, import_block_editor86.useBlockProps)(); 20414 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 20415 const ref = (0, import_element31.useRef)(); 20416 const TagName2 = type === "textarea" ? "textarea" : "input"; 20417 const borderProps = (0, import_block_editor86.__experimentalUseBorderProps)(attributes3); 20418 const colorProps = (0, import_block_editor86.__experimentalUseColorProps)(attributes3); 20419 if (ref.current) { 20420 ref.current.focus(); 20421 } 20422 const isCheckboxOrRadio = type === "checkbox" || type === "radio"; 20423 const controls = /* @__PURE__ */ (0, import_jsx_runtime237.jsxs)(import_jsx_runtime237.Fragment, { children: [ 20424 "hidden" !== type && /* @__PURE__ */ (0, import_jsx_runtime237.jsx)(import_block_editor86.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime237.jsxs)( 20425 import_components44.__experimentalToolsPanel, 20426 { 20427 label: (0, import_i18n69.__)("Settings"), 20428 resetAll: () => { 20429 setAttributes({ 20430 inlineLabel: false, 20431 required: false 20432 }); 20433 }, 20434 dropdownMenuProps, 20435 children: [ 20436 "checkbox" !== type && /* @__PURE__ */ (0, import_jsx_runtime237.jsx)( 20437 import_components44.__experimentalToolsPanelItem, 20438 { 20439 label: (0, import_i18n69.__)("Inline label"), 20440 hasValue: () => !!inlineLabel, 20441 onDeselect: () => setAttributes({ inlineLabel: false }), 20442 isShownByDefault: true, 20443 children: /* @__PURE__ */ (0, import_jsx_runtime237.jsx)( 20444 import_components44.CheckboxControl, 20445 { 20446 label: (0, import_i18n69.__)("Inline label"), 20447 checked: inlineLabel, 20448 onChange: (newVal) => { 20449 setAttributes({ 20450 inlineLabel: newVal 20451 }); 20452 } 20453 } 20454 ) 20455 } 20456 ), 20457 /* @__PURE__ */ (0, import_jsx_runtime237.jsx)( 20458 import_components44.__experimentalToolsPanelItem, 20459 { 20460 label: (0, import_i18n69.__)("Required"), 20461 hasValue: () => !!required, 20462 onDeselect: () => setAttributes({ required: false }), 20463 isShownByDefault: true, 20464 children: /* @__PURE__ */ (0, import_jsx_runtime237.jsx)( 20465 import_components44.CheckboxControl, 20466 { 20467 label: (0, import_i18n69.__)("Required"), 20468 checked: required, 20469 onChange: (newVal) => { 20470 setAttributes({ 20471 required: newVal 20472 }); 20473 } 20474 } 20475 ) 20476 } 20477 ) 20478 ] 20479 } 20480 ) }), 20481 /* @__PURE__ */ (0, import_jsx_runtime237.jsx)(import_block_editor86.InspectorControls, { group: "advanced", children: /* @__PURE__ */ (0, import_jsx_runtime237.jsx)( 20482 import_components44.TextControl, 20483 { 20484 __next40pxDefaultSize: true, 20485 autoComplete: "off", 20486 label: (0, import_i18n69.__)("Name"), 20487 value: name117, 20488 onChange: (newVal) => { 20489 setAttributes({ 20490 name: newVal 20491 }); 20492 }, 20493 help: (0, import_i18n69.__)( 20494 'Affects the "name" attribute of the input element, and is used as a name for the form submission results.' 20495 ) 20496 } 20497 ) }) 20498 ] }); 20499 const content = /* @__PURE__ */ (0, import_jsx_runtime237.jsx)( 20500 import_block_editor86.RichText, 20501 { 20502 tagName: "span", 20503 className: "wp-block-form-input__label-content", 20504 value: label, 20505 onChange: (newLabel) => setAttributes({ label: newLabel }), 20506 "aria-label": label ? (0, import_i18n69.__)("Label") : (0, import_i18n69.__)("Empty label"), 20507 "data-empty": !label, 20508 placeholder: (0, import_i18n69.__)("Type the label for this input") 20509 } 20510 ); 20511 if ("hidden" === type) { 20512 return /* @__PURE__ */ (0, import_jsx_runtime237.jsxs)(import_jsx_runtime237.Fragment, { children: [ 20513 controls, 20514 /* @__PURE__ */ (0, import_jsx_runtime237.jsx)( 20515 "input", 20516 { 20517 type: "hidden", 20518 className: clsx_default( 20519 className, 20520 "wp-block-form-input__input", 20521 colorProps.className, 20522 borderProps.className 20523 ), 20524 "aria-label": (0, import_i18n69.__)("Value"), 20525 value, 20526 onChange: (event) => setAttributes({ value: event.target.value }) 20527 } 20528 ) 20529 ] }); 20530 } 20531 return /* @__PURE__ */ (0, import_jsx_runtime237.jsxs)("div", { ...blockProps, children: [ 20532 controls, 20533 /* @__PURE__ */ (0, import_jsx_runtime237.jsxs)( 20534 "span", 20535 { 20536 className: clsx_default("wp-block-form-input__label", { 20537 "is-label-inline": inlineLabel || "checkbox" === type 20538 }), 20539 children: [ 20540 !isCheckboxOrRadio && content, 20541 /* @__PURE__ */ (0, import_jsx_runtime237.jsx)( 20542 TagName2, 20543 { 20544 type: "textarea" === type ? void 0 : type, 20545 className: clsx_default( 20546 className, 20547 "wp-block-form-input__input", 20548 colorProps.className, 20549 borderProps.className 20550 ), 20551 "aria-label": (0, import_i18n69.__)("Optional placeholder text"), 20552 placeholder: placeholder2 ? void 0 : (0, import_i18n69.__)("Optional placeholder\u2026"), 20553 value: placeholder2, 20554 onChange: (event) => setAttributes({ placeholder: event.target.value }), 20555 "aria-required": required, 20556 style: { 20557 ...borderProps.style, 20558 ...colorProps.style 20559 } 20560 } 20561 ), 20562 isCheckboxOrRadio && content 20563 ] 20564 } 20565 ) 20566 ] }); 20567 } 20568 var edit_default12 = InputFieldBlock; 20569 20570 // packages/block-library/build-module/form-input/block.json 20571 var block_default35 = { 20572 $schema: "https://schemas.wp.org/trunk/block.json", 20573 apiVersion: 3, 20574 __experimental: true, 20575 name: "core/form-input", 20576 title: "Input Field", 20577 category: "common", 20578 ancestor: ["core/form"], 20579 description: "The basic building block for forms.", 20580 keywords: ["input", "form"], 20581 textdomain: "default", 20582 icon: "forms", 20583 attributes: { 20584 type: { 20585 type: "string", 20586 default: "text" 20587 }, 20588 name: { 20589 type: "string" 20590 }, 20591 label: { 20592 type: "rich-text", 20593 default: "Label", 20594 selector: ".wp-block-form-input__label-content", 20595 source: "rich-text", 20596 role: "content" 20597 }, 20598 inlineLabel: { 20599 type: "boolean", 20600 default: false 20601 }, 20602 required: { 20603 type: "boolean", 20604 default: false, 20605 selector: ".wp-block-form-input__input", 20606 source: "attribute", 20607 attribute: "required" 20608 }, 20609 placeholder: { 20610 type: "string", 20611 selector: ".wp-block-form-input__input", 20612 source: "attribute", 20613 attribute: "placeholder", 20614 role: "content" 20615 }, 20616 value: { 20617 type: "string", 20618 default: "", 20619 selector: "input", 20620 source: "attribute", 20621 attribute: "value" 20622 }, 20623 visibilityPermissions: { 20624 type: "string", 20625 default: "all" 20626 } 20627 }, 20628 supports: { 20629 anchor: true, 20630 reusable: false, 20631 spacing: { 20632 margin: ["top", "bottom"] 20633 }, 20634 __experimentalBorder: { 20635 radius: true, 20636 __experimentalSkipSerialization: true, 20637 __experimentalDefaultControls: { 20638 radius: true 20639 } 20640 } 20641 }, 20642 style: ["wp-block-form-input"] 20643 }; 20644 20645 // packages/block-library/build-module/form-input/save.js 20646 var import_remove_accents2 = __toESM(require_remove_accents()); 20647 var import_block_editor87 = __toESM(require_block_editor()); 20648 var import_dom2 = __toESM(require_dom()); 20649 var import_jsx_runtime238 = __toESM(require_jsx_runtime()); 20650 var getNameFromLabel = (content) => { 20651 return (0, import_remove_accents2.default)((0, import_dom2.__unstableStripHTML)(content)).replace(/[^\p{L}\p{N}]+/gu, "-").toLowerCase().replace(/(^-+)|(-+$)/g, ""); 20652 }; 20653 function save19({ attributes: attributes3 }) { 20654 const { type, name: name117, label, inlineLabel, required, placeholder: placeholder2, value } = attributes3; 20655 const borderProps = (0, import_block_editor87.__experimentalGetBorderClassesAndStyles)(attributes3); 20656 const colorProps = (0, import_block_editor87.__experimentalGetColorClassesAndStyles)(attributes3); 20657 const inputStyle = { 20658 ...borderProps.style, 20659 ...colorProps.style 20660 }; 20661 const inputClasses = clsx_default( 20662 "wp-block-form-input__input", 20663 colorProps.className, 20664 borderProps.className 20665 ); 20666 const TagName2 = type === "textarea" ? "textarea" : "input"; 20667 const blockProps = import_block_editor87.useBlockProps.save(); 20668 const isCheckboxOrRadio = type === "checkbox" || type === "radio"; 20669 if ("hidden" === type) { 20670 return /* @__PURE__ */ (0, import_jsx_runtime238.jsx)("input", { type, name: name117, value }); 20671 } 20672 return /* @__PURE__ */ (0, import_jsx_runtime238.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime238.jsxs)( 20673 "label", 20674 { 20675 className: clsx_default("wp-block-form-input__label", { 20676 "is-label-inline": inlineLabel 20677 }), 20678 children: [ 20679 !isCheckboxOrRadio && /* @__PURE__ */ (0, import_jsx_runtime238.jsx)("span", { className: "wp-block-form-input__label-content", children: /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(import_block_editor87.RichText.Content, { value: label }) }), 20680 /* @__PURE__ */ (0, import_jsx_runtime238.jsx)( 20681 TagName2, 20682 { 20683 className: inputClasses, 20684 type: "textarea" === type ? void 0 : type, 20685 name: name117 || getNameFromLabel(label), 20686 required, 20687 "aria-required": required, 20688 placeholder: placeholder2 || void 0, 20689 style: inputStyle 20690 } 20691 ), 20692 isCheckboxOrRadio && /* @__PURE__ */ (0, import_jsx_runtime238.jsx)("span", { className: "wp-block-form-input__label-content", children: /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(import_block_editor87.RichText.Content, { value: label }) }) 20693 ] 20694 } 20695 ) }); 20696 } 20697 20698 // packages/block-library/build-module/form-input/variations.js 20699 var import_i18n70 = __toESM(require_i18n()); 20700 var variations6 = [ 20701 { 20702 name: "text", 20703 title: (0, import_i18n70.__)("Text Input"), 20704 icon: "edit-page", 20705 description: (0, import_i18n70.__)("A generic text input."), 20706 attributes: { type: "text" }, 20707 isDefault: true, 20708 scope: ["inserter", "transform"], 20709 isActive: (blockAttributes8) => !blockAttributes8?.type || blockAttributes8?.type === "text" 20710 }, 20711 { 20712 name: "textarea", 20713 title: (0, import_i18n70.__)("Textarea Input"), 20714 icon: "testimonial", 20715 description: (0, import_i18n70.__)( 20716 "A textarea input to allow entering multiple lines of text." 20717 ), 20718 attributes: { type: "textarea" }, 20719 isDefault: true, 20720 scope: ["inserter", "transform"], 20721 isActive: (blockAttributes8) => blockAttributes8?.type === "textarea" 20722 }, 20723 { 20724 name: "checkbox", 20725 title: (0, import_i18n70.__)("Checkbox Input"), 20726 description: (0, import_i18n70.__)("A simple checkbox input."), 20727 icon: "forms", 20728 attributes: { type: "checkbox", inlineLabel: true }, 20729 isDefault: true, 20730 scope: ["inserter", "transform"], 20731 isActive: (blockAttributes8) => blockAttributes8?.type === "checkbox" 20732 }, 20733 { 20734 name: "email", 20735 title: (0, import_i18n70.__)("Email Input"), 20736 icon: "email", 20737 description: (0, import_i18n70.__)("Used for email addresses."), 20738 attributes: { type: "email" }, 20739 isDefault: true, 20740 scope: ["inserter", "transform"], 20741 isActive: (blockAttributes8) => blockAttributes8?.type === "email" 20742 }, 20743 { 20744 name: "url", 20745 title: (0, import_i18n70.__)("URL Input"), 20746 icon: "admin-site", 20747 description: (0, import_i18n70.__)("Used for URLs."), 20748 attributes: { type: "url" }, 20749 isDefault: true, 20750 scope: ["inserter", "transform"], 20751 isActive: (blockAttributes8) => blockAttributes8?.type === "url" 20752 }, 20753 { 20754 name: "tel", 20755 title: (0, import_i18n70.__)("Telephone Input"), 20756 icon: "phone", 20757 description: (0, import_i18n70.__)("Used for phone numbers."), 20758 attributes: { type: "tel" }, 20759 isDefault: true, 20760 scope: ["inserter", "transform"], 20761 isActive: (blockAttributes8) => blockAttributes8?.type === "tel" 20762 }, 20763 { 20764 name: "number", 20765 title: (0, import_i18n70.__)("Number Input"), 20766 icon: "edit-page", 20767 description: (0, import_i18n70.__)("A numeric input."), 20768 attributes: { type: "number" }, 20769 isDefault: true, 20770 scope: ["inserter", "transform"], 20771 isActive: (blockAttributes8) => blockAttributes8?.type === "number" 20772 } 20773 ]; 20774 var variations_default6 = variations6; 20775 20776 // packages/block-library/build-module/form-input/index.js 20777 var { name: name35 } = block_default35; 20778 var settings35 = { 20779 deprecated: deprecated_default15, 20780 edit: edit_default12, 20781 save: save19, 20782 variations: variations_default6, 20783 example: {} 20784 }; 20785 var init35 = () => initBlock({ name: name35, metadata: block_default35, settings: settings35 }); 20786 20787 // packages/block-library/build-module/form-submit-button/index.js 20788 var form_submit_button_exports = {}; 20789 __export(form_submit_button_exports, { 20790 init: () => init36, 20791 metadata: () => block_default36, 20792 name: () => name36, 20793 settings: () => settings36 20794 }); 20795 20796 // packages/block-library/build-module/form-submit-button/edit.js 20797 var import_i18n71 = __toESM(require_i18n()); 20798 var import_block_editor88 = __toESM(require_block_editor()); 20799 var import_jsx_runtime239 = __toESM(require_jsx_runtime()); 20800 var TEMPLATE6 = [ 20801 [ 20802 "core/buttons", 20803 {}, 20804 [ 20805 [ 20806 "core/button", 20807 { 20808 text: (0, import_i18n71.__)("Submit"), 20809 tagName: "button", 20810 type: "submit" 20811 } 20812 ] 20813 ] 20814 ] 20815 ]; 20816 var Edit14 = () => { 20817 const blockProps = (0, import_block_editor88.useBlockProps)(); 20818 const innerBlocksProps = (0, import_block_editor88.useInnerBlocksProps)(blockProps, { 20819 template: TEMPLATE6, 20820 templateLock: "all" 20821 }); 20822 return /* @__PURE__ */ (0, import_jsx_runtime239.jsx)("div", { className: "wp-block-form-submit-wrapper", ...innerBlocksProps }); 20823 }; 20824 var edit_default13 = Edit14; 20825 20826 // packages/block-library/build-module/form-submit-button/block.json 20827 var block_default36 = { 20828 $schema: "https://schemas.wp.org/trunk/block.json", 20829 apiVersion: 3, 20830 __experimental: true, 20831 name: "core/form-submit-button", 20832 title: "Form Submit Button", 20833 category: "common", 20834 icon: "button", 20835 ancestor: ["core/form"], 20836 allowedBlocks: ["core/buttons", "core/button"], 20837 description: "A submission button for forms.", 20838 keywords: ["submit", "button", "form"], 20839 textdomain: "default", 20840 style: ["wp-block-form-submit-button"] 20841 }; 20842 20843 // packages/block-library/build-module/form-submit-button/save.js 20844 var import_block_editor89 = __toESM(require_block_editor()); 20845 var import_jsx_runtime240 = __toESM(require_jsx_runtime()); 20846 function save20() { 20847 const blockProps = import_block_editor89.useBlockProps.save(); 20848 return /* @__PURE__ */ (0, import_jsx_runtime240.jsx)("div", { className: "wp-block-form-submit-wrapper", ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(import_block_editor89.InnerBlocks.Content, {}) }); 20849 } 20850 20851 // packages/block-library/build-module/form-submit-button/index.js 20852 var { name: name36 } = block_default36; 20853 var settings36 = { 20854 edit: edit_default13, 20855 save: save20, 20856 example: {} 20857 }; 20858 var init36 = () => initBlock({ name: name36, metadata: block_default36, settings: settings36 }); 20859 20860 // packages/block-library/build-module/form-submission-notification/index.js 20861 var form_submission_notification_exports = {}; 20862 __export(form_submission_notification_exports, { 20863 init: () => init37, 20864 metadata: () => block_default37, 20865 name: () => name37, 20866 settings: () => settings37 20867 }); 20868 20869 // packages/block-library/build-module/form-submission-notification/edit.js 20870 var import_i18n72 = __toESM(require_i18n()); 20871 var import_block_editor90 = __toESM(require_block_editor()); 20872 var import_data34 = __toESM(require_data()); 20873 var import_jsx_runtime241 = __toESM(require_jsx_runtime()); 20874 var TEMPLATE7 = [ 20875 [ 20876 "core/paragraph", 20877 { 20878 content: (0, import_i18n72.__)( 20879 "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." 20880 ) 20881 } 20882 ] 20883 ]; 20884 var Edit15 = ({ attributes: attributes3, clientId }) => { 20885 const { type } = attributes3; 20886 const blockProps = (0, import_block_editor90.useBlockProps)({ 20887 className: clsx_default("wp-block-form-submission-notification", { 20888 [`form-notification-type-$type}`]: type 20889 }) 20890 }); 20891 const { hasInnerBlocks } = (0, import_data34.useSelect)( 20892 (select9) => { 20893 const { getBlock } = select9(import_block_editor90.store); 20894 const block = getBlock(clientId); 20895 return { 20896 hasInnerBlocks: !!(block && block.innerBlocks.length) 20897 }; 20898 }, 20899 [clientId] 20900 ); 20901 const innerBlocksProps = (0, import_block_editor90.useInnerBlocksProps)(blockProps, { 20902 template: TEMPLATE7, 20903 renderAppender: hasInnerBlocks ? void 0 : import_block_editor90.InnerBlocks.ButtonBlockAppender 20904 }); 20905 return /* @__PURE__ */ (0, import_jsx_runtime241.jsx)( 20906 "div", 20907 { 20908 ...innerBlocksProps, 20909 "data-message-success": (0, import_i18n72.__)("Submission success notification"), 20910 "data-message-error": (0, import_i18n72.__)("Submission error notification") 20911 } 20912 ); 20913 }; 20914 var edit_default14 = Edit15; 20915 20916 // packages/block-library/build-module/form-submission-notification/block.json 20917 var block_default37 = { 20918 $schema: "https://schemas.wp.org/trunk/block.json", 20919 apiVersion: 3, 20920 __experimental: true, 20921 name: "core/form-submission-notification", 20922 title: "Form Submission Notification", 20923 category: "common", 20924 ancestor: ["core/form"], 20925 description: "Provide a notification message after the form has been submitted.", 20926 keywords: ["form", "feedback", "notification", "message"], 20927 textdomain: "default", 20928 icon: "feedback", 20929 attributes: { 20930 type: { 20931 type: "string", 20932 default: "success" 20933 } 20934 } 20935 }; 20936 20937 // packages/block-library/build-module/form-submission-notification/save.js 20938 var import_block_editor91 = __toESM(require_block_editor()); 20939 var import_jsx_runtime242 = __toESM(require_jsx_runtime()); 20940 function save21({ attributes: attributes3 }) { 20941 const { type } = attributes3; 20942 return /* @__PURE__ */ (0, import_jsx_runtime242.jsx)( 20943 "div", 20944 { 20945 ...import_block_editor91.useInnerBlocksProps.save( 20946 import_block_editor91.useBlockProps.save({ 20947 className: clsx_default("wp-block-form-submission-notification", { 20948 [`form-notification-type-$type}`]: type 20949 }) 20950 }) 20951 ) 20952 } 20953 ); 20954 } 20955 20956 // packages/block-library/build-module/form-submission-notification/variations.js 20957 var import_i18n73 = __toESM(require_i18n()); 20958 var variations7 = [ 20959 { 20960 name: "form-submission-success", 20961 title: (0, import_i18n73.__)("Form Submission Success"), 20962 description: (0, import_i18n73.__)("Success message for form submissions."), 20963 attributes: { 20964 type: "success" 20965 }, 20966 isDefault: true, 20967 innerBlocks: [ 20968 [ 20969 "core/paragraph", 20970 { 20971 content: (0, import_i18n73.__)("Your form has been submitted successfully."), 20972 backgroundColor: "#00D084", 20973 textColor: "#000000", 20974 style: { 20975 elements: { link: { color: { text: "#000000" } } } 20976 } 20977 } 20978 ] 20979 ], 20980 scope: ["inserter", "transform"], 20981 isActive: (blockAttributes8) => !blockAttributes8?.type || blockAttributes8?.type === "success" 20982 }, 20983 { 20984 name: "form-submission-error", 20985 title: (0, import_i18n73.__)("Form Submission Error"), 20986 description: (0, import_i18n73.__)("Error/failure message for form submissions."), 20987 attributes: { 20988 type: "error" 20989 }, 20990 isDefault: false, 20991 innerBlocks: [ 20992 [ 20993 "core/paragraph", 20994 { 20995 content: (0, import_i18n73.__)("There was an error submitting your form."), 20996 backgroundColor: "#CF2E2E", 20997 textColor: "#FFFFFF", 20998 style: { 20999 elements: { link: { color: { text: "#FFFFFF" } } } 21000 } 21001 } 21002 ] 21003 ], 21004 scope: ["inserter", "transform"], 21005 isActive: (blockAttributes8) => !blockAttributes8?.type || blockAttributes8?.type === "error" 21006 } 21007 ]; 21008 var variations_default7 = variations7; 21009 21010 // packages/block-library/build-module/form-submission-notification/index.js 21011 var { name: name37 } = block_default37; 21012 var settings37 = { 21013 icon: group_default, 21014 edit: edit_default14, 21015 save: save21, 21016 variations: variations_default7, 21017 example: {} 21018 }; 21019 var init37 = () => initBlock({ name: name37, metadata: block_default37, settings: settings37 }); 21020 21021 // packages/block-library/build-module/gallery/index.js 21022 var gallery_exports = {}; 21023 __export(gallery_exports, { 21024 init: () => init38, 21025 metadata: () => block_default38, 21026 name: () => name38, 21027 settings: () => settings38 21028 }); 21029 21030 // packages/block-library/build-module/gallery/deprecated.js 21031 var import_block_editor92 = __toESM(require_block_editor()); 21032 var import_blocks29 = __toESM(require_blocks()); 21033 21034 // packages/block-library/build-module/gallery/constants.js 21035 var LINK_DESTINATION_NONE = "none"; 21036 var LINK_DESTINATION_MEDIA = "media"; 21037 var LINK_DESTINATION_LIGHTBOX = "lightbox"; 21038 var LINK_DESTINATION_ATTACHMENT = "attachment"; 21039 var LINK_DESTINATION_MEDIA_WP_CORE = "file"; 21040 var LINK_DESTINATION_ATTACHMENT_WP_CORE = "post"; 21041 var DEFAULT_MEDIA_SIZE_SLUG2 = "large"; 21042 21043 // packages/block-library/build-module/gallery/deprecated.js 21044 var import_jsx_runtime243 = __toESM(require_jsx_runtime()); 21045 var DEPRECATED_LINK_DESTINATION_MEDIA = "file"; 21046 var DEPRECATED_LINK_DESTINATION_ATTACHMENT = "post"; 21047 function defaultColumnsNumberV1(attributes3) { 21048 return Math.min(3, attributes3?.images?.length); 21049 } 21050 function getHrefAndDestination(image, destination) { 21051 switch (destination) { 21052 case DEPRECATED_LINK_DESTINATION_MEDIA: 21053 return { 21054 href: image?.source_url || image?.url, 21055 linkDestination: LINK_DESTINATION_MEDIA 21056 }; 21057 case DEPRECATED_LINK_DESTINATION_ATTACHMENT: 21058 return { 21059 href: image?.link, 21060 linkDestination: LINK_DESTINATION_ATTACHMENT 21061 }; 21062 case LINK_DESTINATION_MEDIA: 21063 return { 21064 href: image?.source_url || image?.url, 21065 linkDestination: LINK_DESTINATION_MEDIA 21066 }; 21067 case LINK_DESTINATION_ATTACHMENT: 21068 return { 21069 href: image?.link, 21070 linkDestination: LINK_DESTINATION_ATTACHMENT 21071 }; 21072 case LINK_DESTINATION_NONE: 21073 return { 21074 href: void 0, 21075 linkDestination: LINK_DESTINATION_NONE 21076 }; 21077 } 21078 return {}; 21079 } 21080 function runV2Migration(attributes3) { 21081 let linkTo = attributes3.linkTo ? attributes3.linkTo : "none"; 21082 if (linkTo === "post") { 21083 linkTo = "attachment"; 21084 } else if (linkTo === "file") { 21085 linkTo = "media"; 21086 } 21087 const imageBlocks = attributes3.images.map((image) => { 21088 return getImageBlock(image, attributes3.sizeSlug, linkTo); 21089 }); 21090 const { images, ids, ...restAttributes } = attributes3; 21091 return [ 21092 { 21093 ...restAttributes, 21094 linkTo, 21095 allowResize: false 21096 }, 21097 imageBlocks 21098 ]; 21099 } 21100 function getImageBlock(image, sizeSlug, linkTo) { 21101 return (0, import_blocks29.createBlock)("core/image", { 21102 ...image.id && { id: parseInt(image.id) }, 21103 url: image.url, 21104 alt: image.alt, 21105 caption: image.caption, 21106 sizeSlug, 21107 ...getHrefAndDestination(image, linkTo) 21108 }); 21109 } 21110 var v72 = { 21111 attributes: { 21112 images: { 21113 type: "array", 21114 default: [], 21115 source: "query", 21116 selector: ".blocks-gallery-item", 21117 query: { 21118 url: { 21119 type: "string", 21120 source: "attribute", 21121 selector: "img", 21122 attribute: "src" 21123 }, 21124 fullUrl: { 21125 type: "string", 21126 source: "attribute", 21127 selector: "img", 21128 attribute: "data-full-url" 21129 }, 21130 link: { 21131 type: "string", 21132 source: "attribute", 21133 selector: "img", 21134 attribute: "data-link" 21135 }, 21136 alt: { 21137 type: "string", 21138 source: "attribute", 21139 selector: "img", 21140 attribute: "alt", 21141 default: "" 21142 }, 21143 id: { 21144 type: "string", 21145 source: "attribute", 21146 selector: "img", 21147 attribute: "data-id" 21148 }, 21149 caption: { 21150 type: "string", 21151 source: "html", 21152 selector: ".blocks-gallery-item__caption" 21153 } 21154 } 21155 }, 21156 ids: { 21157 type: "array", 21158 items: { 21159 type: "number" 21160 }, 21161 default: [] 21162 }, 21163 shortCodeTransforms: { 21164 type: "array", 21165 default: [], 21166 items: { 21167 type: "object" 21168 } 21169 }, 21170 columns: { 21171 type: "number", 21172 minimum: 1, 21173 maximum: 8 21174 }, 21175 caption: { 21176 type: "string", 21177 source: "html", 21178 selector: ".blocks-gallery-caption" 21179 }, 21180 imageCrop: { 21181 type: "boolean", 21182 default: true 21183 }, 21184 fixedHeight: { 21185 type: "boolean", 21186 default: true 21187 }, 21188 linkTarget: { 21189 type: "string" 21190 }, 21191 linkTo: { 21192 type: "string" 21193 }, 21194 sizeSlug: { 21195 type: "string", 21196 default: "large" 21197 }, 21198 allowResize: { 21199 type: "boolean", 21200 default: false 21201 } 21202 }, 21203 save({ attributes: attributes3 }) { 21204 const { caption, columns, imageCrop } = attributes3; 21205 const className = clsx_default("has-nested-images", { 21206 [`columns-$columns}`]: columns !== void 0, 21207 [`columns-default`]: columns === void 0, 21208 "is-cropped": imageCrop 21209 }); 21210 const blockProps = import_block_editor92.useBlockProps.save({ className }); 21211 const innerBlocksProps = import_block_editor92.useInnerBlocksProps.save(blockProps); 21212 return /* @__PURE__ */ (0, import_jsx_runtime243.jsxs)("figure", { ...innerBlocksProps, children: [ 21213 innerBlocksProps.children, 21214 !import_block_editor92.RichText.isEmpty(caption) && /* @__PURE__ */ (0, import_jsx_runtime243.jsx)( 21215 import_block_editor92.RichText.Content, 21216 { 21217 tagName: "figcaption", 21218 className: "blocks-gallery-caption", 21219 value: caption 21220 } 21221 ) 21222 ] }); 21223 } 21224 }; 21225 var v62 = { 21226 attributes: { 21227 images: { 21228 type: "array", 21229 default: [], 21230 source: "query", 21231 selector: ".blocks-gallery-item", 21232 query: { 21233 url: { 21234 type: "string", 21235 source: "attribute", 21236 selector: "img", 21237 attribute: "src" 21238 }, 21239 fullUrl: { 21240 type: "string", 21241 source: "attribute", 21242 selector: "img", 21243 attribute: "data-full-url" 21244 }, 21245 link: { 21246 type: "string", 21247 source: "attribute", 21248 selector: "img", 21249 attribute: "data-link" 21250 }, 21251 alt: { 21252 type: "string", 21253 source: "attribute", 21254 selector: "img", 21255 attribute: "alt", 21256 default: "" 21257 }, 21258 id: { 21259 type: "string", 21260 source: "attribute", 21261 selector: "img", 21262 attribute: "data-id" 21263 }, 21264 caption: { 21265 type: "string", 21266 source: "html", 21267 selector: ".blocks-gallery-item__caption" 21268 } 21269 } 21270 }, 21271 ids: { 21272 type: "array", 21273 items: { 21274 type: "number" 21275 }, 21276 default: [] 21277 }, 21278 columns: { 21279 type: "number", 21280 minimum: 1, 21281 maximum: 8 21282 }, 21283 caption: { 21284 type: "string", 21285 source: "html", 21286 selector: ".blocks-gallery-caption" 21287 }, 21288 imageCrop: { 21289 type: "boolean", 21290 default: true 21291 }, 21292 fixedHeight: { 21293 type: "boolean", 21294 default: true 21295 }, 21296 linkTo: { 21297 type: "string" 21298 }, 21299 sizeSlug: { 21300 type: "string", 21301 default: "large" 21302 } 21303 }, 21304 supports: { 21305 anchor: true, 21306 align: true 21307 }, 21308 save({ attributes: attributes3 }) { 21309 const { 21310 images, 21311 columns = defaultColumnsNumberV1(attributes3), 21312 imageCrop, 21313 caption, 21314 linkTo 21315 } = attributes3; 21316 const className = `columns-$columns} $imageCrop ? "is-cropped" : ""}`; 21317 return /* @__PURE__ */ (0, import_jsx_runtime243.jsxs)("figure", { ...import_block_editor92.useBlockProps.save({ className }), children: [ 21318 /* @__PURE__ */ (0, import_jsx_runtime243.jsx)("ul", { className: "blocks-gallery-grid", children: images.map((image) => { 21319 let href; 21320 switch (linkTo) { 21321 case DEPRECATED_LINK_DESTINATION_MEDIA: 21322 href = image.fullUrl || image.url; 21323 break; 21324 case DEPRECATED_LINK_DESTINATION_ATTACHMENT: 21325 href = image.link; 21326 break; 21327 } 21328 const img = /* @__PURE__ */ (0, import_jsx_runtime243.jsx)( 21329 "img", 21330 { 21331 src: image.url, 21332 alt: image.alt, 21333 "data-id": image.id, 21334 "data-full-url": image.fullUrl, 21335 "data-link": image.link, 21336 className: image.id ? `wp-image-$image.id}` : null 21337 } 21338 ); 21339 return /* @__PURE__ */ (0, import_jsx_runtime243.jsx)( 21340 "li", 21341 { 21342 className: "blocks-gallery-item", 21343 children: /* @__PURE__ */ (0, import_jsx_runtime243.jsxs)("figure", { children: [ 21344 href ? /* @__PURE__ */ (0, import_jsx_runtime243.jsx)("a", { href, children: img }) : img, 21345 !import_block_editor92.RichText.isEmpty(image.caption) && /* @__PURE__ */ (0, import_jsx_runtime243.jsx)( 21346 import_block_editor92.RichText.Content, 21347 { 21348 tagName: "figcaption", 21349 className: "blocks-gallery-item__caption", 21350 value: image.caption 21351 } 21352 ) 21353 ] }) 21354 }, 21355 image.id || image.url 21356 ); 21357 }) }), 21358 !import_block_editor92.RichText.isEmpty(caption) && /* @__PURE__ */ (0, import_jsx_runtime243.jsx)( 21359 import_block_editor92.RichText.Content, 21360 { 21361 tagName: "figcaption", 21362 className: "blocks-gallery-caption", 21363 value: caption 21364 } 21365 ) 21366 ] }); 21367 }, 21368 migrate(attributes3) { 21369 return runV2Migration(attributes3); 21370 } 21371 }; 21372 var v52 = { 21373 attributes: { 21374 images: { 21375 type: "array", 21376 default: [], 21377 source: "query", 21378 selector: ".blocks-gallery-item", 21379 query: { 21380 url: { 21381 type: "string", 21382 source: "attribute", 21383 selector: "img", 21384 attribute: "src" 21385 }, 21386 fullUrl: { 21387 type: "string", 21388 source: "attribute", 21389 selector: "img", 21390 attribute: "data-full-url" 21391 }, 21392 link: { 21393 type: "string", 21394 source: "attribute", 21395 selector: "img", 21396 attribute: "data-link" 21397 }, 21398 alt: { 21399 type: "string", 21400 source: "attribute", 21401 selector: "img", 21402 attribute: "alt", 21403 default: "" 21404 }, 21405 id: { 21406 type: "string", 21407 source: "attribute", 21408 selector: "img", 21409 attribute: "data-id" 21410 }, 21411 caption: { 21412 type: "string", 21413 source: "html", 21414 selector: ".blocks-gallery-item__caption" 21415 } 21416 } 21417 }, 21418 ids: { 21419 type: "array", 21420 items: { 21421 type: "number" 21422 }, 21423 default: [] 21424 }, 21425 columns: { 21426 type: "number", 21427 minimum: 1, 21428 maximum: 8 21429 }, 21430 caption: { 21431 type: "string", 21432 source: "html", 21433 selector: ".blocks-gallery-caption" 21434 }, 21435 imageCrop: { 21436 type: "boolean", 21437 default: true 21438 }, 21439 linkTo: { 21440 type: "string", 21441 default: "none" 21442 }, 21443 sizeSlug: { 21444 type: "string", 21445 default: "large" 21446 } 21447 }, 21448 supports: { 21449 align: true 21450 }, 21451 isEligible({ linkTo }) { 21452 return !linkTo || linkTo === "attachment" || linkTo === "media"; 21453 }, 21454 migrate(attributes3) { 21455 return runV2Migration(attributes3); 21456 }, 21457 save({ attributes: attributes3 }) { 21458 const { 21459 images, 21460 columns = defaultColumnsNumberV1(attributes3), 21461 imageCrop, 21462 caption, 21463 linkTo 21464 } = attributes3; 21465 return /* @__PURE__ */ (0, import_jsx_runtime243.jsxs)( 21466 "figure", 21467 { 21468 className: `columns-$columns} $imageCrop ? "is-cropped" : ""}`, 21469 children: [ 21470 /* @__PURE__ */ (0, import_jsx_runtime243.jsx)("ul", { className: "blocks-gallery-grid", children: images.map((image) => { 21471 let href; 21472 switch (linkTo) { 21473 case "media": 21474 href = image.fullUrl || image.url; 21475 break; 21476 case "attachment": 21477 href = image.link; 21478 break; 21479 } 21480 const img = /* @__PURE__ */ (0, import_jsx_runtime243.jsx)( 21481 "img", 21482 { 21483 src: image.url, 21484 alt: image.alt, 21485 "data-id": image.id, 21486 "data-full-url": image.fullUrl, 21487 "data-link": image.link, 21488 className: image.id ? `wp-image-$image.id}` : null 21489 } 21490 ); 21491 return /* @__PURE__ */ (0, import_jsx_runtime243.jsx)( 21492 "li", 21493 { 21494 className: "blocks-gallery-item", 21495 children: /* @__PURE__ */ (0, import_jsx_runtime243.jsxs)("figure", { children: [ 21496 href ? /* @__PURE__ */ (0, import_jsx_runtime243.jsx)("a", { href, children: img }) : img, 21497 !import_block_editor92.RichText.isEmpty(image.caption) && /* @__PURE__ */ (0, import_jsx_runtime243.jsx)( 21498 import_block_editor92.RichText.Content, 21499 { 21500 tagName: "figcaption", 21501 className: "blocks-gallery-item__caption", 21502 value: image.caption 21503 } 21504 ) 21505 ] }) 21506 }, 21507 image.id || image.url 21508 ); 21509 }) }), 21510 !import_block_editor92.RichText.isEmpty(caption) && /* @__PURE__ */ (0, import_jsx_runtime243.jsx)( 21511 import_block_editor92.RichText.Content, 21512 { 21513 tagName: "figcaption", 21514 className: "blocks-gallery-caption", 21515 value: caption 21516 } 21517 ) 21518 ] 21519 } 21520 ); 21521 } 21522 }; 21523 var v42 = { 21524 attributes: { 21525 images: { 21526 type: "array", 21527 default: [], 21528 source: "query", 21529 selector: ".blocks-gallery-item", 21530 query: { 21531 url: { 21532 source: "attribute", 21533 selector: "img", 21534 attribute: "src" 21535 }, 21536 fullUrl: { 21537 source: "attribute", 21538 selector: "img", 21539 attribute: "data-full-url" 21540 }, 21541 link: { 21542 source: "attribute", 21543 selector: "img", 21544 attribute: "data-link" 21545 }, 21546 alt: { 21547 source: "attribute", 21548 selector: "img", 21549 attribute: "alt", 21550 default: "" 21551 }, 21552 id: { 21553 source: "attribute", 21554 selector: "img", 21555 attribute: "data-id" 21556 }, 21557 caption: { 21558 type: "string", 21559 source: "html", 21560 selector: ".blocks-gallery-item__caption" 21561 } 21562 } 21563 }, 21564 ids: { 21565 type: "array", 21566 default: [] 21567 }, 21568 columns: { 21569 type: "number" 21570 }, 21571 caption: { 21572 type: "string", 21573 source: "html", 21574 selector: ".blocks-gallery-caption" 21575 }, 21576 imageCrop: { 21577 type: "boolean", 21578 default: true 21579 }, 21580 linkTo: { 21581 type: "string", 21582 default: "none" 21583 } 21584 }, 21585 supports: { 21586 align: true 21587 }, 21588 isEligible({ ids }) { 21589 return ids && ids.some((id) => typeof id === "string"); 21590 }, 21591 migrate(attributes3) { 21592 return runV2Migration(attributes3); 21593 }, 21594 save({ attributes: attributes3 }) { 21595 const { 21596 images, 21597 columns = defaultColumnsNumberV1(attributes3), 21598 imageCrop, 21599 caption, 21600 linkTo 21601 } = attributes3; 21602 return /* @__PURE__ */ (0, import_jsx_runtime243.jsxs)( 21603 "figure", 21604 { 21605 className: `columns-$columns} $imageCrop ? "is-cropped" : ""}`, 21606 children: [ 21607 /* @__PURE__ */ (0, import_jsx_runtime243.jsx)("ul", { className: "blocks-gallery-grid", children: images.map((image) => { 21608 let href; 21609 switch (linkTo) { 21610 case "media": 21611 href = image.fullUrl || image.url; 21612 break; 21613 case "attachment": 21614 href = image.link; 21615 break; 21616 } 21617 const img = /* @__PURE__ */ (0, import_jsx_runtime243.jsx)( 21618 "img", 21619 { 21620 src: image.url, 21621 alt: image.alt, 21622 "data-id": image.id, 21623 "data-full-url": image.fullUrl, 21624 "data-link": image.link, 21625 className: image.id ? `wp-image-$image.id}` : null 21626 } 21627 ); 21628 return /* @__PURE__ */ (0, import_jsx_runtime243.jsx)( 21629 "li", 21630 { 21631 className: "blocks-gallery-item", 21632 children: /* @__PURE__ */ (0, import_jsx_runtime243.jsxs)("figure", { children: [ 21633 href ? /* @__PURE__ */ (0, import_jsx_runtime243.jsx)("a", { href, children: img }) : img, 21634 !import_block_editor92.RichText.isEmpty(image.caption) && /* @__PURE__ */ (0, import_jsx_runtime243.jsx)( 21635 import_block_editor92.RichText.Content, 21636 { 21637 tagName: "figcaption", 21638 className: "blocks-gallery-item__caption", 21639 value: image.caption 21640 } 21641 ) 21642 ] }) 21643 }, 21644 image.id || image.url 21645 ); 21646 }) }), 21647 !import_block_editor92.RichText.isEmpty(caption) && /* @__PURE__ */ (0, import_jsx_runtime243.jsx)( 21648 import_block_editor92.RichText.Content, 21649 { 21650 tagName: "figcaption", 21651 className: "blocks-gallery-caption", 21652 value: caption 21653 } 21654 ) 21655 ] 21656 } 21657 ); 21658 } 21659 }; 21660 var v33 = { 21661 attributes: { 21662 images: { 21663 type: "array", 21664 default: [], 21665 source: "query", 21666 selector: "ul.wp-block-gallery .blocks-gallery-item", 21667 query: { 21668 url: { 21669 source: "attribute", 21670 selector: "img", 21671 attribute: "src" 21672 }, 21673 fullUrl: { 21674 source: "attribute", 21675 selector: "img", 21676 attribute: "data-full-url" 21677 }, 21678 alt: { 21679 source: "attribute", 21680 selector: "img", 21681 attribute: "alt", 21682 default: "" 21683 }, 21684 id: { 21685 source: "attribute", 21686 selector: "img", 21687 attribute: "data-id" 21688 }, 21689 link: { 21690 source: "attribute", 21691 selector: "img", 21692 attribute: "data-link" 21693 }, 21694 caption: { 21695 type: "string", 21696 source: "html", 21697 selector: "figcaption" 21698 } 21699 } 21700 }, 21701 ids: { 21702 type: "array", 21703 default: [] 21704 }, 21705 columns: { 21706 type: "number" 21707 }, 21708 imageCrop: { 21709 type: "boolean", 21710 default: true 21711 }, 21712 linkTo: { 21713 type: "string", 21714 default: "none" 21715 } 21716 }, 21717 supports: { 21718 align: true 21719 }, 21720 save({ attributes: attributes3 }) { 21721 const { 21722 images, 21723 columns = defaultColumnsNumberV1(attributes3), 21724 imageCrop, 21725 linkTo 21726 } = attributes3; 21727 return /* @__PURE__ */ (0, import_jsx_runtime243.jsx)( 21728 "ul", 21729 { 21730 className: `columns-$columns} $imageCrop ? "is-cropped" : ""}`, 21731 children: images.map((image) => { 21732 let href; 21733 switch (linkTo) { 21734 case "media": 21735 href = image.fullUrl || image.url; 21736 break; 21737 case "attachment": 21738 href = image.link; 21739 break; 21740 } 21741 const img = /* @__PURE__ */ (0, import_jsx_runtime243.jsx)( 21742 "img", 21743 { 21744 src: image.url, 21745 alt: image.alt, 21746 "data-id": image.id, 21747 "data-full-url": image.fullUrl, 21748 "data-link": image.link, 21749 className: image.id ? `wp-image-$image.id}` : null 21750 } 21751 ); 21752 return /* @__PURE__ */ (0, import_jsx_runtime243.jsx)( 21753 "li", 21754 { 21755 className: "blocks-gallery-item", 21756 children: /* @__PURE__ */ (0, import_jsx_runtime243.jsxs)("figure", { children: [ 21757 href ? /* @__PURE__ */ (0, import_jsx_runtime243.jsx)("a", { href, children: img }) : img, 21758 image.caption && image.caption.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime243.jsx)( 21759 import_block_editor92.RichText.Content, 21760 { 21761 tagName: "figcaption", 21762 value: image.caption 21763 } 21764 ) 21765 ] }) 21766 }, 21767 image.id || image.url 21768 ); 21769 }) 21770 } 21771 ); 21772 }, 21773 migrate(attributes3) { 21774 return runV2Migration(attributes3); 21775 } 21776 }; 21777 var v25 = { 21778 attributes: { 21779 images: { 21780 type: "array", 21781 default: [], 21782 source: "query", 21783 selector: "ul.wp-block-gallery .blocks-gallery-item", 21784 query: { 21785 url: { 21786 source: "attribute", 21787 selector: "img", 21788 attribute: "src" 21789 }, 21790 alt: { 21791 source: "attribute", 21792 selector: "img", 21793 attribute: "alt", 21794 default: "" 21795 }, 21796 id: { 21797 source: "attribute", 21798 selector: "img", 21799 attribute: "data-id" 21800 }, 21801 link: { 21802 source: "attribute", 21803 selector: "img", 21804 attribute: "data-link" 21805 }, 21806 caption: { 21807 type: "string", 21808 source: "html", 21809 selector: "figcaption" 21810 } 21811 } 21812 }, 21813 columns: { 21814 type: "number" 21815 }, 21816 imageCrop: { 21817 type: "boolean", 21818 default: true 21819 }, 21820 linkTo: { 21821 type: "string", 21822 default: "none" 21823 } 21824 }, 21825 isEligible({ images, ids }) { 21826 return images && images.length > 0 && (!ids && images || ids && images && ids.length !== images.length || images.some((id, index) => { 21827 if (!id && ids[index] !== null) { 21828 return true; 21829 } 21830 return parseInt(id, 10) !== ids[index]; 21831 })); 21832 }, 21833 migrate(attributes3) { 21834 return runV2Migration(attributes3); 21835 }, 21836 supports: { 21837 align: true 21838 }, 21839 save({ attributes: attributes3 }) { 21840 const { 21841 images, 21842 columns = defaultColumnsNumberV1(attributes3), 21843 imageCrop, 21844 linkTo 21845 } = attributes3; 21846 return /* @__PURE__ */ (0, import_jsx_runtime243.jsx)( 21847 "ul", 21848 { 21849 className: `columns-$columns} $imageCrop ? "is-cropped" : ""}`, 21850 children: images.map((image) => { 21851 let href; 21852 switch (linkTo) { 21853 case "media": 21854 href = image.url; 21855 break; 21856 case "attachment": 21857 href = image.link; 21858 break; 21859 } 21860 const img = /* @__PURE__ */ (0, import_jsx_runtime243.jsx)( 21861 "img", 21862 { 21863 src: image.url, 21864 alt: image.alt, 21865 "data-id": image.id, 21866 "data-link": image.link, 21867 className: image.id ? `wp-image-$image.id}` : null 21868 } 21869 ); 21870 return /* @__PURE__ */ (0, import_jsx_runtime243.jsx)( 21871 "li", 21872 { 21873 className: "blocks-gallery-item", 21874 children: /* @__PURE__ */ (0, import_jsx_runtime243.jsxs)("figure", { children: [ 21875 href ? /* @__PURE__ */ (0, import_jsx_runtime243.jsx)("a", { href, children: img }) : img, 21876 image.caption && image.caption.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime243.jsx)( 21877 import_block_editor92.RichText.Content, 21878 { 21879 tagName: "figcaption", 21880 value: image.caption 21881 } 21882 ) 21883 ] }) 21884 }, 21885 image.id || image.url 21886 ); 21887 }) 21888 } 21889 ); 21890 } 21891 }; 21892 var v113 = { 21893 attributes: { 21894 images: { 21895 type: "array", 21896 default: [], 21897 source: "query", 21898 selector: "div.wp-block-gallery figure.blocks-gallery-image img", 21899 query: { 21900 url: { 21901 source: "attribute", 21902 attribute: "src" 21903 }, 21904 alt: { 21905 source: "attribute", 21906 attribute: "alt", 21907 default: "" 21908 }, 21909 id: { 21910 source: "attribute", 21911 attribute: "data-id" 21912 } 21913 } 21914 }, 21915 columns: { 21916 type: "number" 21917 }, 21918 imageCrop: { 21919 type: "boolean", 21920 default: true 21921 }, 21922 linkTo: { 21923 type: "string", 21924 default: "none" 21925 }, 21926 align: { 21927 type: "string", 21928 default: "none" 21929 } 21930 }, 21931 supports: { 21932 align: true 21933 }, 21934 save({ attributes: attributes3 }) { 21935 const { 21936 images, 21937 columns = defaultColumnsNumberV1(attributes3), 21938 align, 21939 imageCrop, 21940 linkTo 21941 } = attributes3; 21942 const className = clsx_default(`columns-$columns}`, { 21943 alignnone: align === "none", 21944 "is-cropped": imageCrop 21945 }); 21946 return /* @__PURE__ */ (0, import_jsx_runtime243.jsx)("div", { className, children: images.map((image) => { 21947 let href; 21948 switch (linkTo) { 21949 case "media": 21950 href = image.url; 21951 break; 21952 case "attachment": 21953 href = image.link; 21954 break; 21955 } 21956 const img = /* @__PURE__ */ (0, import_jsx_runtime243.jsx)( 21957 "img", 21958 { 21959 src: image.url, 21960 alt: image.alt, 21961 "data-id": image.id 21962 } 21963 ); 21964 return /* @__PURE__ */ (0, import_jsx_runtime243.jsx)( 21965 "figure", 21966 { 21967 className: "blocks-gallery-image", 21968 children: href ? /* @__PURE__ */ (0, import_jsx_runtime243.jsx)("a", { href, children: img }) : img 21969 }, 21970 image.id || image.url 21971 ); 21972 }) }); 21973 }, 21974 migrate(attributes3) { 21975 return runV2Migration(attributes3); 21976 } 21977 }; 21978 var deprecated_default16 = [v72, v62, v52, v42, v33, v25, v113]; 21979 21980 // packages/block-library/build-module/gallery/edit.js 21981 var import_components45 = __toESM(require_components()); 21982 var import_block_editor95 = __toESM(require_block_editor()); 21983 var import_element34 = __toESM(require_element()); 21984 var import_i18n75 = __toESM(require_i18n()); 21985 var import_data36 = __toESM(require_data()); 21986 var import_primitives150 = __toESM(require_primitives()); 21987 var import_blocks30 = __toESM(require_blocks()); 21988 var import_blob9 = __toESM(require_blob()); 21989 var import_notices6 = __toESM(require_notices()); 21990 21991 // packages/block-library/build-module/gallery/shared-icon.js 21992 var import_block_editor93 = __toESM(require_block_editor()); 21993 var import_jsx_runtime244 = __toESM(require_jsx_runtime()); 21994 var sharedIcon = /* @__PURE__ */ (0, import_jsx_runtime244.jsx)(import_block_editor93.BlockIcon, { icon: gallery_default }); 21995 21996 // packages/block-library/build-module/gallery/shared.js 21997 function defaultColumnsNumber(imageCount) { 21998 return imageCount ? Math.min(3, imageCount) : 3; 21999 } 22000 var pickRelevantMediaFiles = (image, sizeSlug = "large") => { 22001 const imageProps = Object.fromEntries( 22002 Object.entries(image ?? {}).filter( 22003 ([key]) => ["alt", "id", "link"].includes(key) 22004 ) 22005 ); 22006 imageProps.url = image?.sizes?.[sizeSlug]?.url || image?.media_details?.sizes?.[sizeSlug]?.source_url || image?.url || image?.source_url; 22007 const fullUrl = image?.sizes?.full?.url || image?.media_details?.sizes?.full?.source_url; 22008 if (fullUrl) { 22009 imageProps.fullUrl = fullUrl; 22010 } 22011 return imageProps; 22012 }; 22013 22014 // packages/block-library/build-module/image/constants.js 22015 var MIN_SIZE2 = 20; 22016 var LINK_DESTINATION_NONE2 = "none"; 22017 var LINK_DESTINATION_MEDIA2 = "media"; 22018 var LINK_DESTINATION_ATTACHMENT2 = "attachment"; 22019 var LINK_DESTINATION_CUSTOM = "custom"; 22020 var NEW_TAB_REL2 = ["noreferrer", "noopener"]; 22021 var ALLOWED_MEDIA_TYPES3 = ["image"]; 22022 var SIZED_LAYOUTS = ["flex", "grid"]; 22023 var DEFAULT_MEDIA_SIZE_SLUG3 = "full"; 22024 22025 // packages/block-library/build-module/gallery/utils.js 22026 function getHrefAndDestination2(image, galleryDestination, imageDestination, attributes3, lightboxSetting) { 22027 switch (imageDestination ? imageDestination : galleryDestination) { 22028 case LINK_DESTINATION_MEDIA_WP_CORE: 22029 case LINK_DESTINATION_MEDIA: 22030 return { 22031 href: image?.source_url || image?.url, 22032 linkDestination: LINK_DESTINATION_MEDIA2, 22033 lightbox: lightboxSetting?.enabled ? { ...attributes3?.lightbox, enabled: false } : void 0 22034 }; 22035 case LINK_DESTINATION_ATTACHMENT_WP_CORE: 22036 case LINK_DESTINATION_ATTACHMENT: 22037 return { 22038 href: image?.link, 22039 linkDestination: LINK_DESTINATION_ATTACHMENT2, 22040 lightbox: lightboxSetting?.enabled ? { ...attributes3?.lightbox, enabled: false } : void 0 22041 }; 22042 case LINK_DESTINATION_LIGHTBOX: 22043 return { 22044 href: void 0, 22045 lightbox: !lightboxSetting?.enabled ? { ...attributes3?.lightbox, enabled: true } : void 0, 22046 linkDestination: LINK_DESTINATION_NONE2 22047 }; 22048 case LINK_DESTINATION_NONE: 22049 return { 22050 href: void 0, 22051 linkDestination: LINK_DESTINATION_NONE2, 22052 lightbox: void 0 22053 }; 22054 } 22055 return {}; 22056 } 22057 22058 // packages/block-library/build-module/image/utils.js 22059 function evalAspectRatio(value) { 22060 const [width, height = 1] = value.split("/").map(Number); 22061 const aspectRatio = width / height; 22062 return aspectRatio === Infinity || aspectRatio === 0 ? NaN : aspectRatio; 22063 } 22064 function removeNewTabRel(currentRel) { 22065 let newRel = currentRel; 22066 if (currentRel !== void 0 && newRel) { 22067 NEW_TAB_REL2.forEach((relVal) => { 22068 const regExp = new RegExp("\\b" + relVal + "\\b", "gi"); 22069 newRel = newRel.replace(regExp, ""); 22070 }); 22071 if (newRel !== currentRel) { 22072 newRel = newRel.trim(); 22073 } 22074 if (!newRel) { 22075 newRel = void 0; 22076 } 22077 } 22078 return newRel; 22079 } 22080 function getUpdatedLinkTargetSettings(value, { rel }) { 22081 const linkTarget = value ? "_blank" : void 0; 22082 let updatedRel; 22083 if (!linkTarget && !rel) { 22084 updatedRel = void 0; 22085 } else { 22086 updatedRel = removeNewTabRel(rel); 22087 } 22088 return { 22089 linkTarget, 22090 rel: updatedRel 22091 }; 22092 } 22093 function getImageSizeAttributes(image, size) { 22094 const url = image?.media_details?.sizes?.[size]?.source_url; 22095 if (url) { 22096 return { url, width: void 0, height: void 0, sizeSlug: size }; 22097 } 22098 return {}; 22099 } 22100 function isValidFileType(file) { 22101 return ALLOWED_MEDIA_TYPES3.some( 22102 (mediaType) => file.type.indexOf(mediaType) === 0 22103 ); 22104 } 22105 22106 // packages/block-library/build-module/gallery/gallery.js 22107 var import_i18n74 = __toESM(require_i18n()); 22108 var import_primitives149 = __toESM(require_primitives()); 22109 var import_jsx_runtime245 = __toESM(require_jsx_runtime()); 22110 function Gallery(props) { 22111 const { 22112 attributes: attributes3, 22113 isSelected, 22114 setAttributes, 22115 mediaPlaceholder, 22116 insertBlocksAfter, 22117 blockProps, 22118 __unstableLayoutClassNames: layoutClassNames, 22119 isContentLocked, 22120 multiGallerySelection 22121 } = props; 22122 const { align, columns, imageCrop } = attributes3; 22123 return /* @__PURE__ */ (0, import_jsx_runtime245.jsxs)( 22124 "figure", 22125 { 22126 ...blockProps, 22127 className: clsx_default( 22128 blockProps.className, 22129 layoutClassNames, 22130 "blocks-gallery-grid", 22131 { 22132 [`align$align}`]: align, 22133 [`columns-$columns}`]: columns !== void 0, 22134 [`columns-default`]: columns === void 0, 22135 "is-cropped": imageCrop 22136 } 22137 ), 22138 children: [ 22139 blockProps.children, 22140 isSelected && !blockProps.children && /* @__PURE__ */ (0, import_jsx_runtime245.jsx)(import_primitives149.View, { className: "blocks-gallery-media-placeholder-wrapper", children: mediaPlaceholder }), 22141 /* @__PURE__ */ (0, import_jsx_runtime245.jsx)( 22142 Caption, 22143 { 22144 attributes: attributes3, 22145 setAttributes, 22146 isSelected, 22147 insertBlocksAfter, 22148 showToolbarButton: !multiGallerySelection && !isContentLocked, 22149 className: "blocks-gallery-caption", 22150 label: (0, import_i18n74.__)("Gallery caption text"), 22151 placeholder: (0, import_i18n74.__)("Add gallery caption") 22152 } 22153 ) 22154 ] 22155 } 22156 ); 22157 } 22158 22159 // packages/block-library/build-module/gallery/use-image-sizes.js 22160 var import_element32 = __toESM(require_element()); 22161 function useImageSizes(images, isSelected, getSettings2) { 22162 return (0, import_element32.useMemo)(() => getImageSizing(), [images, isSelected]); 22163 function getImageSizing() { 22164 if (!images || images.length === 0) { 22165 return; 22166 } 22167 const { imageSizes } = getSettings2(); 22168 let resizedImages = {}; 22169 if (isSelected) { 22170 resizedImages = images.reduce((currentResizedImages, img) => { 22171 if (!img.id) { 22172 return currentResizedImages; 22173 } 22174 const sizes = imageSizes.reduce((currentSizes, size) => { 22175 const defaultUrl = img.sizes?.[size.slug]?.url; 22176 const mediaDetailsUrl = img.media_details?.sizes?.[size.slug]?.source_url; 22177 return { 22178 ...currentSizes, 22179 [size.slug]: defaultUrl || mediaDetailsUrl 22180 }; 22181 }, {}); 22182 return { 22183 ...currentResizedImages, 22184 [parseInt(img.id, 10)]: sizes 22185 }; 22186 }, {}); 22187 } 22188 const resizedImageSizes = Object.values(resizedImages); 22189 return imageSizes.filter( 22190 ({ slug }) => resizedImageSizes.some((sizes) => sizes[slug]) 22191 ).map(({ name: name117, slug }) => ({ value: slug, label: name117 })); 22192 } 22193 } 22194 22195 // packages/block-library/build-module/gallery/use-get-new-images.js 22196 var import_element33 = __toESM(require_element()); 22197 function useGetNewImages(images, imageData) { 22198 const [currentImages, setCurrentImages] = (0, import_element33.useState)([]); 22199 return (0, import_element33.useMemo)(() => getNewImages(), [images, imageData]); 22200 function getNewImages() { 22201 let imagesUpdated = false; 22202 const newCurrentImages = currentImages.filter( 22203 (currentImg) => images.find((img) => { 22204 return currentImg.clientId === img.clientId; 22205 }) 22206 ); 22207 if (newCurrentImages.length < currentImages.length) { 22208 imagesUpdated = true; 22209 } 22210 images.forEach((image) => { 22211 if (image.fromSavedContent && !newCurrentImages.find( 22212 (currentImage) => currentImage.id === image.id 22213 )) { 22214 imagesUpdated = true; 22215 newCurrentImages.push(image); 22216 } 22217 }); 22218 const newImages = images.filter( 22219 (image) => !newCurrentImages.find( 22220 (currentImage) => image.clientId && currentImage.clientId === image.clientId 22221 ) && imageData?.find((img) => img.id === image.id) && !image.fromSavedContent 22222 ); 22223 if (imagesUpdated || newImages?.length > 0) { 22224 setCurrentImages([...newCurrentImages, ...newImages]); 22225 } 22226 return newImages.length > 0 ? newImages : null; 22227 } 22228 } 22229 22230 // packages/block-library/build-module/gallery/use-get-media.js 22231 var import_data35 = __toESM(require_data()); 22232 var import_core_data20 = __toESM(require_core_data()); 22233 var EMPTY_IMAGE_MEDIA = []; 22234 function useGetMedia(innerBlockImages) { 22235 return (0, import_data35.useSelect)( 22236 (select9) => { 22237 const imageIds = innerBlockImages.map((imageBlock) => imageBlock.attributes.id).filter((id) => id !== void 0); 22238 if (imageIds.length === 0) { 22239 return EMPTY_IMAGE_MEDIA; 22240 } 22241 return select9(import_core_data20.store).getEntityRecords( 22242 "postType", 22243 "attachment", 22244 { 22245 include: imageIds.join(","), 22246 per_page: -1, 22247 orderby: "include" 22248 } 22249 ) ?? EMPTY_IMAGE_MEDIA; 22250 }, 22251 [innerBlockImages] 22252 ); 22253 } 22254 22255 // packages/block-library/build-module/gallery/gap-styles.js 22256 var import_block_editor94 = __toESM(require_block_editor()); 22257 function GapStyles({ blockGap, clientId }) { 22258 const fallbackValue = `var( --wp--style--gallery-gap-default, var( --gallery-block--gutter-size, var( --wp--style--block-gap, 0.5em ) ) )`; 22259 let gapValue = fallbackValue; 22260 let column = fallbackValue; 22261 let row; 22262 if (!!blockGap) { 22263 row = typeof blockGap === "string" ? (0, import_block_editor94.__experimentalGetGapCSSValue)(blockGap) : (0, import_block_editor94.__experimentalGetGapCSSValue)(blockGap?.top) || fallbackValue; 22264 column = typeof blockGap === "string" ? (0, import_block_editor94.__experimentalGetGapCSSValue)(blockGap) : (0, import_block_editor94.__experimentalGetGapCSSValue)(blockGap?.left) || fallbackValue; 22265 gapValue = row === column ? row : `$row} $column}`; 22266 } 22267 const gap = `#block-$clientId} { 22268 --wp--style--unstable-gallery-gap: $column === "0" ? "0px" : column}; 22269 gap: $gapValue} 22270 }`; 22271 (0, import_block_editor94.useStyleOverride)({ css: gap }); 22272 return null; 22273 } 22274 22275 // packages/block-library/build-module/gallery/edit.js 22276 var import_jsx_runtime246 = __toESM(require_jsx_runtime()); 22277 var MAX_COLUMNS = 8; 22278 var LINK_OPTIONS = [ 22279 { 22280 icon: custom_link_default, 22281 label: (0, import_i18n75.__)("Link images to attachment pages"), 22282 value: LINK_DESTINATION_ATTACHMENT, 22283 noticeText: (0, import_i18n75.__)("Attachment Pages") 22284 }, 22285 { 22286 icon: image_default, 22287 label: (0, import_i18n75.__)("Link images to media files"), 22288 value: LINK_DESTINATION_MEDIA, 22289 noticeText: (0, import_i18n75.__)("Media Files") 22290 }, 22291 { 22292 icon: fullscreen_default, 22293 label: (0, import_i18n75.__)("Enlarge on click"), 22294 value: LINK_DESTINATION_LIGHTBOX, 22295 noticeText: (0, import_i18n75.__)("Lightbox effect"), 22296 infoText: (0, import_i18n75.__)("Scale images with a lightbox effect") 22297 }, 22298 { 22299 icon: link_off_default, 22300 label: (0, import_i18n75._x)("None", "Media item link option"), 22301 value: LINK_DESTINATION_NONE, 22302 noticeText: (0, import_i18n75.__)("None") 22303 } 22304 ]; 22305 var ALLOWED_MEDIA_TYPES4 = ["image"]; 22306 var PLACEHOLDER_TEXT = import_element34.Platform.isNative ? (0, import_i18n75.__)("Add media") : (0, import_i18n75.__)("Drag and drop images, upload, or choose from your library."); 22307 var MOBILE_CONTROL_PROPS_RANGE_CONTROL = import_element34.Platform.isNative ? { type: "stepper" } : {}; 22308 var DEFAULT_BLOCK3 = { name: "core/image" }; 22309 var EMPTY_ARRAY = []; 22310 function GalleryEdit(props) { 22311 const { 22312 setAttributes, 22313 attributes: attributes3, 22314 className, 22315 clientId, 22316 isSelected, 22317 insertBlocksAfter, 22318 isContentLocked, 22319 onFocus 22320 } = props; 22321 const [lightboxSetting, defaultRatios, themeRatios, showDefaultRatios] = (0, import_block_editor95.useSettings)( 22322 "blocks.core/image.lightbox", 22323 "dimensions.aspectRatios.default", 22324 "dimensions.aspectRatios.theme", 22325 "dimensions.defaultAspectRatios" 22326 ); 22327 const linkOptions = !lightboxSetting?.allowEditing ? LINK_OPTIONS.filter( 22328 (option) => option.value !== LINK_DESTINATION_LIGHTBOX 22329 ) : LINK_OPTIONS; 22330 const { 22331 columns, 22332 imageCrop, 22333 randomOrder, 22334 linkTarget, 22335 linkTo, 22336 sizeSlug, 22337 aspectRatio 22338 } = attributes3; 22339 const { 22340 __unstableMarkNextChangeAsNotPersistent, 22341 replaceInnerBlocks, 22342 updateBlockAttributes, 22343 selectBlock 22344 } = (0, import_data36.useDispatch)(import_block_editor95.store); 22345 const { createSuccessNotice, createErrorNotice } = (0, import_data36.useDispatch)(import_notices6.store); 22346 const { 22347 getBlock, 22348 getSettings: getSettings2, 22349 innerBlockImages, 22350 blockWasJustInserted, 22351 multiGallerySelection 22352 } = (0, import_data36.useSelect)( 22353 (select9) => { 22354 const { 22355 getBlockName, 22356 getMultiSelectedBlockClientIds, 22357 getSettings: _getSettings, 22358 getBlock: _getBlock, 22359 wasBlockJustInserted 22360 } = select9(import_block_editor95.store); 22361 const multiSelectedClientIds = getMultiSelectedBlockClientIds(); 22362 return { 22363 getBlock: _getBlock, 22364 getSettings: _getSettings, 22365 innerBlockImages: _getBlock(clientId)?.innerBlocks ?? EMPTY_ARRAY, 22366 blockWasJustInserted: wasBlockJustInserted( 22367 clientId, 22368 "inserter_menu" 22369 ), 22370 multiGallerySelection: multiSelectedClientIds.length && multiSelectedClientIds.every( 22371 (_clientId) => getBlockName(_clientId) === "core/gallery" 22372 ) 22373 }; 22374 }, 22375 [clientId] 22376 ); 22377 const images = (0, import_element34.useMemo)( 22378 () => innerBlockImages?.map((block) => ({ 22379 clientId: block.clientId, 22380 id: block.attributes.id, 22381 url: block.attributes.url, 22382 attributes: block.attributes, 22383 fromSavedContent: Boolean(block.originalContent) 22384 })), 22385 [innerBlockImages] 22386 ); 22387 const imageData = useGetMedia(innerBlockImages); 22388 const newImages = useGetNewImages(images, imageData); 22389 const themeOptions = themeRatios?.map(({ name: name117, ratio }) => ({ 22390 label: name117, 22391 value: ratio 22392 })); 22393 const defaultOptions = defaultRatios?.map(({ name: name117, ratio }) => ({ 22394 label: name117, 22395 value: ratio 22396 })); 22397 const aspectRatioOptions = [ 22398 { 22399 label: (0, import_i18n75._x)( 22400 "Original", 22401 "Aspect ratio option for dimensions control" 22402 ), 22403 value: "auto" 22404 }, 22405 ...showDefaultRatios ? defaultOptions || [] : [], 22406 ...themeOptions || [] 22407 ]; 22408 (0, import_element34.useEffect)(() => { 22409 newImages?.forEach((newImage) => { 22410 __unstableMarkNextChangeAsNotPersistent(); 22411 updateBlockAttributes(newImage.clientId, { 22412 ...buildImageAttributes(newImage.attributes), 22413 id: newImage.id, 22414 align: void 0 22415 }); 22416 }); 22417 }, [newImages]); 22418 const imageSizeOptions = useImageSizes( 22419 imageData, 22420 isSelected, 22421 getSettings2 22422 ); 22423 function buildImageAttributes(imageAttributes) { 22424 const image = imageAttributes.id ? imageData.find(({ id }) => id === imageAttributes.id) : null; 22425 let newClassName; 22426 if (imageAttributes.className && imageAttributes.className !== "") { 22427 newClassName = imageAttributes.className; 22428 } 22429 let newLinkTarget; 22430 if (imageAttributes.linkTarget || imageAttributes.rel) { 22431 newLinkTarget = { 22432 linkTarget: imageAttributes.linkTarget, 22433 rel: imageAttributes.rel 22434 }; 22435 } else { 22436 newLinkTarget = getUpdatedLinkTargetSettings( 22437 linkTarget, 22438 attributes3 22439 ); 22440 } 22441 return { 22442 ...pickRelevantMediaFiles(image, sizeSlug), 22443 ...getHrefAndDestination2( 22444 image, 22445 linkTo, 22446 imageAttributes?.linkDestination 22447 ), 22448 ...newLinkTarget, 22449 className: newClassName, 22450 sizeSlug, 22451 caption: imageAttributes.caption.length > 0 ? imageAttributes.caption : image.caption?.raw, 22452 alt: imageAttributes.alt || image.alt_text, 22453 aspectRatio: aspectRatio === "auto" ? void 0 : aspectRatio 22454 }; 22455 } 22456 function isValidFileType2(file) { 22457 const nativeFileData = import_element34.Platform.isNative && file.id ? imageData.find(({ id }) => id === file.id) : null; 22458 const mediaTypeSelector = nativeFileData ? nativeFileData?.media_type : file.type; 22459 return ALLOWED_MEDIA_TYPES4.some( 22460 (mediaType) => mediaTypeSelector?.indexOf(mediaType) === 0 22461 ) || file.blob; 22462 } 22463 function updateImages(selectedImages) { 22464 const newFileUploads = Object.prototype.toString.call(selectedImages) === "[object FileList]"; 22465 const imageArray = newFileUploads ? Array.from(selectedImages).map((file) => { 22466 if (!file.url) { 22467 return { 22468 blob: (0, import_blob9.createBlobURL)(file) 22469 }; 22470 } 22471 return file; 22472 }) : selectedImages; 22473 if (!imageArray.every(isValidFileType2)) { 22474 createErrorNotice( 22475 (0, import_i18n75.__)( 22476 "If uploading to a gallery all files need to be image formats" 22477 ), 22478 { id: "gallery-upload-invalid-file", type: "snackbar" } 22479 ); 22480 } 22481 const processedImages = imageArray.filter((file) => file.url || isValidFileType2(file)).map((file) => { 22482 if (!file.url) { 22483 return { 22484 blob: file.blob || (0, import_blob9.createBlobURL)(file) 22485 }; 22486 } 22487 return file; 22488 }); 22489 const newOrderMap = processedImages.reduce( 22490 (result, image, index) => (result[image.id] = index, result), 22491 {} 22492 ); 22493 const existingImageBlocks = !newFileUploads ? innerBlockImages.filter( 22494 (block) => processedImages.find( 22495 (img) => img.id === block.attributes.id 22496 ) 22497 ) : innerBlockImages; 22498 const newImageList = processedImages.filter( 22499 (img) => !existingImageBlocks.find( 22500 (existingImg) => img.id === existingImg.attributes.id 22501 ) 22502 ); 22503 const newBlocks = newImageList.map((image) => { 22504 return (0, import_blocks30.createBlock)("core/image", { 22505 id: image.id, 22506 blob: image.blob, 22507 url: image.url, 22508 caption: image.caption, 22509 alt: image.alt 22510 }); 22511 }); 22512 replaceInnerBlocks( 22513 clientId, 22514 existingImageBlocks.concat(newBlocks).sort( 22515 (a2, b2) => newOrderMap[a2.attributes.id] - newOrderMap[b2.attributes.id] 22516 ) 22517 ); 22518 if (newBlocks?.length > 0) { 22519 selectBlock(newBlocks[0].clientId); 22520 } 22521 } 22522 function onUploadError(message) { 22523 createErrorNotice(message, { type: "snackbar" }); 22524 } 22525 function setLinkTo(value) { 22526 setAttributes({ linkTo: value }); 22527 const changedAttributes = {}; 22528 const blocks = []; 22529 getBlock(clientId).innerBlocks.forEach((block) => { 22530 blocks.push(block.clientId); 22531 const image = block.attributes.id ? imageData.find(({ id }) => id === block.attributes.id) : null; 22532 changedAttributes[block.clientId] = getHrefAndDestination2( 22533 image, 22534 value, 22535 false, 22536 block.attributes, 22537 lightboxSetting 22538 ); 22539 }); 22540 updateBlockAttributes(blocks, changedAttributes, { 22541 uniqueByBlock: true 22542 }); 22543 const linkToText = [...linkOptions].find( 22544 (linkType) => linkType.value === value 22545 ); 22546 createSuccessNotice( 22547 (0, import_i18n75.sprintf)( 22548 /* translators: %s: image size settings */ 22549 (0, import_i18n75.__)("All gallery image links updated to: %s"), 22550 linkToText.noticeText 22551 ), 22552 { 22553 id: "gallery-attributes-linkTo", 22554 type: "snackbar" 22555 } 22556 ); 22557 } 22558 function setColumnsNumber(value) { 22559 setAttributes({ columns: value }); 22560 } 22561 function toggleImageCrop() { 22562 setAttributes({ imageCrop: !imageCrop }); 22563 } 22564 function toggleRandomOrder() { 22565 setAttributes({ randomOrder: !randomOrder }); 22566 } 22567 function toggleOpenInNewTab(openInNewTab) { 22568 const newLinkTarget = openInNewTab ? "_blank" : void 0; 22569 setAttributes({ linkTarget: newLinkTarget }); 22570 const changedAttributes = {}; 22571 const blocks = []; 22572 getBlock(clientId).innerBlocks.forEach((block) => { 22573 blocks.push(block.clientId); 22574 changedAttributes[block.clientId] = getUpdatedLinkTargetSettings( 22575 newLinkTarget, 22576 block.attributes 22577 ); 22578 }); 22579 updateBlockAttributes(blocks, changedAttributes, { 22580 uniqueByBlock: true 22581 }); 22582 const noticeText = openInNewTab ? (0, import_i18n75.__)("All gallery images updated to open in new tab") : (0, import_i18n75.__)("All gallery images updated to not open in new tab"); 22583 createSuccessNotice(noticeText, { 22584 id: "gallery-attributes-openInNewTab", 22585 type: "snackbar" 22586 }); 22587 } 22588 function updateImagesSize(newSizeSlug) { 22589 setAttributes({ sizeSlug: newSizeSlug }); 22590 const changedAttributes = {}; 22591 const blocks = []; 22592 getBlock(clientId).innerBlocks.forEach((block) => { 22593 blocks.push(block.clientId); 22594 const image = block.attributes.id ? imageData.find(({ id }) => id === block.attributes.id) : null; 22595 changedAttributes[block.clientId] = getImageSizeAttributes( 22596 image, 22597 newSizeSlug 22598 ); 22599 }); 22600 updateBlockAttributes(blocks, changedAttributes, { 22601 uniqueByBlock: true 22602 }); 22603 const imageSize = imageSizeOptions.find( 22604 (size) => size.value === newSizeSlug 22605 ); 22606 createSuccessNotice( 22607 (0, import_i18n75.sprintf)( 22608 /* translators: %s: image size settings */ 22609 (0, import_i18n75.__)("All gallery image sizes updated to: %s"), 22610 imageSize?.label ?? newSizeSlug 22611 ), 22612 { 22613 id: "gallery-attributes-sizeSlug", 22614 type: "snackbar" 22615 } 22616 ); 22617 } 22618 function setAspectRatio(value) { 22619 setAttributes({ aspectRatio: value }); 22620 const changedAttributes = {}; 22621 const blocks = []; 22622 getBlock(clientId).innerBlocks.forEach((block) => { 22623 blocks.push(block.clientId); 22624 changedAttributes[block.clientId] = { 22625 aspectRatio: value === "auto" ? void 0 : value 22626 }; 22627 }); 22628 updateBlockAttributes(blocks, changedAttributes, true); 22629 const aspectRatioText = aspectRatioOptions.find( 22630 (option) => option.value === value 22631 ); 22632 createSuccessNotice( 22633 (0, import_i18n75.sprintf)( 22634 /* translators: %s: aspect ratio setting */ 22635 (0, import_i18n75.__)("All gallery images updated to aspect ratio: %s"), 22636 aspectRatioText?.label || value 22637 ), 22638 { 22639 id: "gallery-attributes-aspectRatio", 22640 type: "snackbar" 22641 } 22642 ); 22643 } 22644 (0, import_element34.useEffect)(() => { 22645 if (!linkTo) { 22646 __unstableMarkNextChangeAsNotPersistent(); 22647 setAttributes({ 22648 linkTo: window?.wp?.media?.view?.settings?.defaultProps?.link || LINK_DESTINATION_NONE 22649 }); 22650 } 22651 }, [linkTo]); 22652 const hasImages = !!images.length; 22653 const hasImageIds = hasImages && images.some((image) => !!image.id); 22654 const imagesUploading = images.some( 22655 (img) => !import_element34.Platform.isNative ? !img.id && img.url?.indexOf("blob:") === 0 : img.url?.indexOf("file:") === 0 22656 ); 22657 const mediaPlaceholderProps = import_element34.Platform.select({ 22658 web: { 22659 addToGallery: false, 22660 disableMediaButtons: imagesUploading, 22661 value: {} 22662 }, 22663 native: { 22664 addToGallery: hasImageIds, 22665 isAppender: hasImages, 22666 disableMediaButtons: hasImages && !isSelected || imagesUploading, 22667 value: hasImageIds ? images : {}, 22668 autoOpenMediaUpload: !hasImages && isSelected && blockWasJustInserted, 22669 onFocus 22670 } 22671 }); 22672 const mediaPlaceholder = /* @__PURE__ */ (0, import_jsx_runtime246.jsx)( 22673 import_block_editor95.MediaPlaceholder, 22674 { 22675 handleUpload: false, 22676 icon: sharedIcon, 22677 labels: { 22678 title: (0, import_i18n75.__)("Gallery"), 22679 instructions: PLACEHOLDER_TEXT 22680 }, 22681 onSelect: updateImages, 22682 allowedTypes: ALLOWED_MEDIA_TYPES4, 22683 multiple: true, 22684 onError: onUploadError, 22685 ...mediaPlaceholderProps 22686 } 22687 ); 22688 const blockProps = (0, import_block_editor95.useBlockProps)({ 22689 className: clsx_default(className, "has-nested-images") 22690 }); 22691 const nativeInnerBlockProps = import_element34.Platform.isNative && { 22692 marginHorizontal: 0, 22693 marginVertical: 0 22694 }; 22695 const innerBlocksProps = (0, import_block_editor95.useInnerBlocksProps)(blockProps, { 22696 defaultBlock: DEFAULT_BLOCK3, 22697 directInsert: true, 22698 orientation: "horizontal", 22699 renderAppender: false, 22700 ...nativeInnerBlockProps 22701 }); 22702 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 22703 if (!hasImages) { 22704 return /* @__PURE__ */ (0, import_jsx_runtime246.jsxs)(import_primitives150.View, { ...innerBlocksProps, children: [ 22705 innerBlocksProps.children, 22706 mediaPlaceholder 22707 ] }); 22708 } 22709 const hasLinkTo = linkTo && linkTo !== "none"; 22710 return /* @__PURE__ */ (0, import_jsx_runtime246.jsxs)(import_jsx_runtime246.Fragment, { children: [ 22711 /* @__PURE__ */ (0, import_jsx_runtime246.jsxs)(import_block_editor95.InspectorControls, { children: [ 22712 import_element34.Platform.isWeb && /* @__PURE__ */ (0, import_jsx_runtime246.jsxs)( 22713 import_components45.__experimentalToolsPanel, 22714 { 22715 label: (0, import_i18n75.__)("Settings"), 22716 resetAll: () => { 22717 setAttributes({ 22718 columns: void 0, 22719 imageCrop: true, 22720 randomOrder: false 22721 }); 22722 setAspectRatio("auto"); 22723 if (sizeSlug !== DEFAULT_MEDIA_SIZE_SLUG2) { 22724 updateImagesSize(DEFAULT_MEDIA_SIZE_SLUG2); 22725 } 22726 if (linkTarget) { 22727 toggleOpenInNewTab(false); 22728 } 22729 }, 22730 dropdownMenuProps, 22731 children: [ 22732 images.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime246.jsx)( 22733 import_components45.__experimentalToolsPanelItem, 22734 { 22735 isShownByDefault: true, 22736 label: (0, import_i18n75.__)("Columns"), 22737 hasValue: () => !!columns && columns !== images.length, 22738 onDeselect: () => setColumnsNumber(void 0), 22739 children: /* @__PURE__ */ (0, import_jsx_runtime246.jsx)( 22740 import_components45.RangeControl, 22741 { 22742 label: (0, import_i18n75.__)("Columns"), 22743 value: columns ? columns : defaultColumnsNumber( 22744 images.length 22745 ), 22746 onChange: setColumnsNumber, 22747 min: 1, 22748 max: Math.min( 22749 MAX_COLUMNS, 22750 images.length 22751 ), 22752 required: true, 22753 __next40pxDefaultSize: true 22754 } 22755 ) 22756 } 22757 ), 22758 imageSizeOptions?.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime246.jsx)( 22759 import_components45.__experimentalToolsPanelItem, 22760 { 22761 isShownByDefault: true, 22762 label: (0, import_i18n75.__)("Resolution"), 22763 hasValue: () => sizeSlug !== DEFAULT_MEDIA_SIZE_SLUG2, 22764 onDeselect: () => updateImagesSize(DEFAULT_MEDIA_SIZE_SLUG2), 22765 children: /* @__PURE__ */ (0, import_jsx_runtime246.jsx)( 22766 import_components45.SelectControl, 22767 { 22768 label: (0, import_i18n75.__)("Resolution"), 22769 help: (0, import_i18n75.__)( 22770 "Select the size of the source images." 22771 ), 22772 value: sizeSlug, 22773 options: imageSizeOptions, 22774 onChange: updateImagesSize, 22775 hideCancelButton: true, 22776 size: "__unstable-large" 22777 } 22778 ) 22779 } 22780 ), 22781 /* @__PURE__ */ (0, import_jsx_runtime246.jsx)( 22782 import_components45.__experimentalToolsPanelItem, 22783 { 22784 isShownByDefault: true, 22785 label: (0, import_i18n75.__)("Crop images to fit"), 22786 hasValue: () => !imageCrop, 22787 onDeselect: () => setAttributes({ imageCrop: true }), 22788 children: /* @__PURE__ */ (0, import_jsx_runtime246.jsx)( 22789 import_components45.ToggleControl, 22790 { 22791 label: (0, import_i18n75.__)("Crop images to fit"), 22792 checked: !!imageCrop, 22793 onChange: toggleImageCrop 22794 } 22795 ) 22796 } 22797 ), 22798 /* @__PURE__ */ (0, import_jsx_runtime246.jsx)( 22799 import_components45.__experimentalToolsPanelItem, 22800 { 22801 isShownByDefault: true, 22802 label: (0, import_i18n75.__)("Randomize order"), 22803 hasValue: () => !!randomOrder, 22804 onDeselect: () => setAttributes({ randomOrder: false }), 22805 children: /* @__PURE__ */ (0, import_jsx_runtime246.jsx)( 22806 import_components45.ToggleControl, 22807 { 22808 label: (0, import_i18n75.__)("Randomize order"), 22809 checked: !!randomOrder, 22810 onChange: toggleRandomOrder 22811 } 22812 ) 22813 } 22814 ), 22815 hasLinkTo && /* @__PURE__ */ (0, import_jsx_runtime246.jsx)( 22816 import_components45.__experimentalToolsPanelItem, 22817 { 22818 isShownByDefault: true, 22819 label: (0, import_i18n75.__)("Open images in new tab"), 22820 hasValue: () => !!linkTarget, 22821 onDeselect: () => toggleOpenInNewTab(false), 22822 children: /* @__PURE__ */ (0, import_jsx_runtime246.jsx)( 22823 import_components45.ToggleControl, 22824 { 22825 label: (0, import_i18n75.__)("Open images in new tab"), 22826 checked: linkTarget === "_blank", 22827 onChange: toggleOpenInNewTab 22828 } 22829 ) 22830 } 22831 ), 22832 aspectRatioOptions.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime246.jsx)( 22833 import_components45.__experimentalToolsPanelItem, 22834 { 22835 hasValue: () => !!aspectRatio && aspectRatio !== "auto", 22836 label: (0, import_i18n75.__)("Aspect ratio"), 22837 onDeselect: () => setAspectRatio("auto"), 22838 isShownByDefault: true, 22839 children: /* @__PURE__ */ (0, import_jsx_runtime246.jsx)( 22840 import_components45.SelectControl, 22841 { 22842 __next40pxDefaultSize: true, 22843 label: (0, import_i18n75.__)("Aspect ratio"), 22844 help: (0, import_i18n75.__)( 22845 "Set a consistent aspect ratio for all images in the gallery." 22846 ), 22847 value: aspectRatio, 22848 options: aspectRatioOptions, 22849 onChange: setAspectRatio 22850 } 22851 ) 22852 } 22853 ) 22854 ] 22855 } 22856 ), 22857 import_element34.Platform.isNative && /* @__PURE__ */ (0, import_jsx_runtime246.jsxs)(import_components45.PanelBody, { title: (0, import_i18n75.__)("Settings"), children: [ 22858 images.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime246.jsx)( 22859 import_components45.RangeControl, 22860 { 22861 label: (0, import_i18n75.__)("Columns"), 22862 value: columns ? columns : defaultColumnsNumber(images.length), 22863 onChange: setColumnsNumber, 22864 min: 1, 22865 max: Math.min(MAX_COLUMNS, images.length), 22866 ...MOBILE_CONTROL_PROPS_RANGE_CONTROL, 22867 required: true, 22868 __next40pxDefaultSize: true 22869 } 22870 ), 22871 imageSizeOptions?.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime246.jsx)( 22872 import_components45.SelectControl, 22873 { 22874 label: (0, import_i18n75.__)("Resolution"), 22875 help: (0, import_i18n75.__)( 22876 "Select the size of the source images." 22877 ), 22878 value: sizeSlug, 22879 options: imageSizeOptions, 22880 onChange: updateImagesSize, 22881 hideCancelButton: true, 22882 size: "__unstable-large" 22883 } 22884 ), 22885 /* @__PURE__ */ (0, import_jsx_runtime246.jsx)( 22886 import_components45.SelectControl, 22887 { 22888 label: (0, import_i18n75.__)("Link"), 22889 value: linkTo, 22890 onChange: setLinkTo, 22891 options: linkOptions, 22892 hideCancelButton: true, 22893 size: "__unstable-large" 22894 } 22895 ), 22896 /* @__PURE__ */ (0, import_jsx_runtime246.jsx)( 22897 import_components45.ToggleControl, 22898 { 22899 label: (0, import_i18n75.__)("Crop images to fit"), 22900 checked: !!imageCrop, 22901 onChange: toggleImageCrop 22902 } 22903 ), 22904 /* @__PURE__ */ (0, import_jsx_runtime246.jsx)( 22905 import_components45.ToggleControl, 22906 { 22907 label: (0, import_i18n75.__)("Randomize order"), 22908 checked: !!randomOrder, 22909 onChange: toggleRandomOrder 22910 } 22911 ), 22912 hasLinkTo && /* @__PURE__ */ (0, import_jsx_runtime246.jsx)( 22913 import_components45.ToggleControl, 22914 { 22915 label: (0, import_i18n75.__)("Open images in new tab"), 22916 checked: linkTarget === "_blank", 22917 onChange: toggleOpenInNewTab 22918 } 22919 ), 22920 aspectRatioOptions.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime246.jsx)( 22921 import_components45.SelectControl, 22922 { 22923 label: (0, import_i18n75.__)("Aspect Ratio"), 22924 help: (0, import_i18n75.__)( 22925 "Set a consistent aspect ratio for all images in the gallery." 22926 ), 22927 value: aspectRatio, 22928 options: aspectRatioOptions, 22929 onChange: setAspectRatio, 22930 hideCancelButton: true, 22931 size: "__unstable-large" 22932 } 22933 ) 22934 ] }) 22935 ] }), 22936 import_element34.Platform.isWeb ? /* @__PURE__ */ (0, import_jsx_runtime246.jsx)(import_block_editor95.BlockControls, { group: "block", children: /* @__PURE__ */ (0, import_jsx_runtime246.jsx)( 22937 import_components45.ToolbarDropdownMenu, 22938 { 22939 icon: link_default, 22940 label: (0, import_i18n75.__)("Link"), 22941 children: ({ onClose }) => /* @__PURE__ */ (0, import_jsx_runtime246.jsx)(import_components45.MenuGroup, { children: linkOptions.map((linkItem) => { 22942 const isOptionSelected = linkTo === linkItem.value; 22943 return /* @__PURE__ */ (0, import_jsx_runtime246.jsx)( 22944 import_components45.MenuItem, 22945 { 22946 isSelected: isOptionSelected, 22947 className: clsx_default( 22948 "components-dropdown-menu__menu-item", 22949 { 22950 "is-active": isOptionSelected 22951 } 22952 ), 22953 iconPosition: "left", 22954 icon: linkItem.icon, 22955 onClick: () => { 22956 setLinkTo(linkItem.value); 22957 onClose(); 22958 }, 22959 role: "menuitemradio", 22960 info: linkItem.infoText, 22961 children: linkItem.label 22962 }, 22963 linkItem.value 22964 ); 22965 }) }) 22966 } 22967 ) }) : null, 22968 import_element34.Platform.isWeb && /* @__PURE__ */ (0, import_jsx_runtime246.jsxs)(import_jsx_runtime246.Fragment, { children: [ 22969 !multiGallerySelection && /* @__PURE__ */ (0, import_jsx_runtime246.jsx)(import_block_editor95.BlockControls, { group: "other", children: /* @__PURE__ */ (0, import_jsx_runtime246.jsx)( 22970 import_block_editor95.MediaReplaceFlow, 22971 { 22972 allowedTypes: ALLOWED_MEDIA_TYPES4, 22973 handleUpload: false, 22974 onSelect: updateImages, 22975 name: (0, import_i18n75.__)("Add"), 22976 multiple: true, 22977 mediaIds: images.filter((image) => image.id).map((image) => image.id), 22978 addToGallery: hasImageIds 22979 } 22980 ) }), 22981 /* @__PURE__ */ (0, import_jsx_runtime246.jsx)( 22982 GapStyles, 22983 { 22984 blockGap: attributes3.style?.spacing?.blockGap, 22985 clientId 22986 } 22987 ) 22988 ] }), 22989 /* @__PURE__ */ (0, import_jsx_runtime246.jsx)( 22990 Gallery, 22991 { 22992 ...props, 22993 isContentLocked, 22994 images, 22995 mediaPlaceholder: !hasImages || import_element34.Platform.isNative ? mediaPlaceholder : void 0, 22996 blockProps: innerBlocksProps, 22997 insertBlocksAfter, 22998 multiGallerySelection 22999 } 23000 ) 23001 ] }); 23002 } 23003 23004 // packages/block-library/build-module/gallery/block.json 23005 var block_default38 = { 23006 $schema: "https://schemas.wp.org/trunk/block.json", 23007 apiVersion: 3, 23008 name: "core/gallery", 23009 title: "Gallery", 23010 category: "media", 23011 allowedBlocks: ["core/image"], 23012 description: "Display multiple images in a rich gallery.", 23013 keywords: ["images", "photos"], 23014 textdomain: "default", 23015 attributes: { 23016 images: { 23017 type: "array", 23018 default: [], 23019 source: "query", 23020 selector: ".blocks-gallery-item", 23021 query: { 23022 url: { 23023 type: "string", 23024 source: "attribute", 23025 selector: "img", 23026 attribute: "src" 23027 }, 23028 fullUrl: { 23029 type: "string", 23030 source: "attribute", 23031 selector: "img", 23032 attribute: "data-full-url" 23033 }, 23034 link: { 23035 type: "string", 23036 source: "attribute", 23037 selector: "img", 23038 attribute: "data-link" 23039 }, 23040 alt: { 23041 type: "string", 23042 source: "attribute", 23043 selector: "img", 23044 attribute: "alt", 23045 default: "" 23046 }, 23047 id: { 23048 type: "string", 23049 source: "attribute", 23050 selector: "img", 23051 attribute: "data-id" 23052 }, 23053 caption: { 23054 type: "rich-text", 23055 source: "rich-text", 23056 selector: ".blocks-gallery-item__caption" 23057 } 23058 } 23059 }, 23060 ids: { 23061 type: "array", 23062 items: { 23063 type: "number" 23064 }, 23065 default: [] 23066 }, 23067 shortCodeTransforms: { 23068 type: "array", 23069 items: { 23070 type: "object" 23071 }, 23072 default: [] 23073 }, 23074 columns: { 23075 type: "number", 23076 minimum: 1, 23077 maximum: 8 23078 }, 23079 caption: { 23080 type: "rich-text", 23081 source: "rich-text", 23082 selector: ".blocks-gallery-caption", 23083 role: "content" 23084 }, 23085 imageCrop: { 23086 type: "boolean", 23087 default: true 23088 }, 23089 randomOrder: { 23090 type: "boolean", 23091 default: false 23092 }, 23093 fixedHeight: { 23094 type: "boolean", 23095 default: true 23096 }, 23097 linkTarget: { 23098 type: "string" 23099 }, 23100 linkTo: { 23101 type: "string" 23102 }, 23103 sizeSlug: { 23104 type: "string", 23105 default: "large" 23106 }, 23107 allowResize: { 23108 type: "boolean", 23109 default: false 23110 }, 23111 aspectRatio: { 23112 type: "string", 23113 default: "auto" 23114 } 23115 }, 23116 providesContext: { 23117 allowResize: "allowResize", 23118 imageCrop: "imageCrop", 23119 fixedHeight: "fixedHeight" 23120 }, 23121 supports: { 23122 anchor: true, 23123 align: true, 23124 __experimentalBorder: { 23125 radius: true, 23126 color: true, 23127 width: true, 23128 style: true, 23129 __experimentalDefaultControls: { 23130 color: true, 23131 radius: true 23132 } 23133 }, 23134 html: false, 23135 units: ["px", "em", "rem", "vh", "vw"], 23136 spacing: { 23137 margin: true, 23138 padding: true, 23139 blockGap: ["horizontal", "vertical"], 23140 __experimentalSkipSerialization: ["blockGap"], 23141 __experimentalDefaultControls: { 23142 blockGap: true, 23143 margin: false, 23144 padding: false 23145 } 23146 }, 23147 color: { 23148 text: false, 23149 background: true, 23150 gradients: true 23151 }, 23152 layout: { 23153 allowSwitching: false, 23154 allowInheriting: false, 23155 allowEditing: false, 23156 default: { 23157 type: "flex" 23158 } 23159 }, 23160 interactivity: { 23161 clientNavigation: true 23162 } 23163 }, 23164 editorStyle: "wp-block-gallery-editor", 23165 style: "wp-block-gallery" 23166 }; 23167 23168 // packages/block-library/build-module/gallery/save.js 23169 var import_block_editor96 = __toESM(require_block_editor()); 23170 var import_jsx_runtime247 = __toESM(require_jsx_runtime()); 23171 function saveWithInnerBlocks({ attributes: attributes3 }) { 23172 const { caption, columns, imageCrop } = attributes3; 23173 const className = clsx_default("has-nested-images", { 23174 [`columns-$columns}`]: columns !== void 0, 23175 [`columns-default`]: columns === void 0, 23176 "is-cropped": imageCrop 23177 }); 23178 const blockProps = import_block_editor96.useBlockProps.save({ className }); 23179 const innerBlocksProps = import_block_editor96.useInnerBlocksProps.save(blockProps); 23180 return /* @__PURE__ */ (0, import_jsx_runtime247.jsxs)("figure", { ...innerBlocksProps, children: [ 23181 innerBlocksProps.children, 23182 !import_block_editor96.RichText.isEmpty(caption) && /* @__PURE__ */ (0, import_jsx_runtime247.jsx)( 23183 import_block_editor96.RichText.Content, 23184 { 23185 tagName: "figcaption", 23186 className: clsx_default( 23187 "blocks-gallery-caption", 23188 (0, import_block_editor96.__experimentalGetElementClassName)("caption") 23189 ), 23190 value: caption 23191 } 23192 ) 23193 ] }); 23194 } 23195 23196 // packages/block-library/build-module/gallery/transforms.js 23197 var import_blocks31 = __toESM(require_blocks()); 23198 var import_blob10 = __toESM(require_blob()); 23199 var import_hooks29 = __toESM(require_hooks()); 23200 var parseShortcodeIds = (ids) => { 23201 if (!ids) { 23202 return []; 23203 } 23204 return ids.split(",").map((id) => parseInt(id, 10)); 23205 }; 23206 function updateThirdPartyTransformToGallery(block) { 23207 if (block.name === "core/gallery" && block.attributes?.images.length > 0) { 23208 const innerBlocks = block.attributes.images.map( 23209 ({ url, id, alt }) => { 23210 return (0, import_blocks31.createBlock)("core/image", { 23211 url, 23212 id: id ? parseInt(id, 10) : null, 23213 alt, 23214 sizeSlug: block.attributes.sizeSlug, 23215 linkDestination: block.attributes.linkDestination 23216 }); 23217 } 23218 ); 23219 delete block.attributes.ids; 23220 delete block.attributes.images; 23221 block.innerBlocks = innerBlocks; 23222 } 23223 return block; 23224 } 23225 (0, import_hooks29.addFilter)( 23226 "blocks.switchToBlockType.transformedBlock", 23227 "core/gallery/update-third-party-transform-to", 23228 updateThirdPartyTransformToGallery 23229 ); 23230 function updateThirdPartyTransformFromGallery(toBlock, fromBlocks) { 23231 const from = Array.isArray(fromBlocks) ? fromBlocks : [fromBlocks]; 23232 const galleryBlock = from.find( 23233 (transformedBlock) => transformedBlock.name === "core/gallery" && transformedBlock.innerBlocks.length > 0 && !transformedBlock.attributes.images?.length > 0 && !toBlock.name.includes("core/") 23234 ); 23235 if (galleryBlock) { 23236 const images = galleryBlock.innerBlocks.map( 23237 ({ attributes: { url, id, alt } }) => ({ 23238 url, 23239 id: id ? parseInt(id, 10) : null, 23240 alt 23241 }) 23242 ); 23243 const ids = images.map(({ id }) => id); 23244 galleryBlock.attributes.images = images; 23245 galleryBlock.attributes.ids = ids; 23246 } 23247 return toBlock; 23248 } 23249 (0, import_hooks29.addFilter)( 23250 "blocks.switchToBlockType.transformedBlock", 23251 "core/gallery/update-third-party-transform-from", 23252 updateThirdPartyTransformFromGallery 23253 ); 23254 var transforms9 = { 23255 from: [ 23256 { 23257 type: "block", 23258 isMultiBlock: true, 23259 blocks: ["core/image"], 23260 transform: (attributes3) => { 23261 let { align, sizeSlug } = attributes3[0]; 23262 align = attributes3.every( 23263 (attribute) => attribute.align === align 23264 ) ? align : void 0; 23265 sizeSlug = attributes3.every( 23266 (attribute) => attribute.sizeSlug === sizeSlug 23267 ) ? sizeSlug : void 0; 23268 const validImages = attributes3.filter(({ url }) => url); 23269 const innerBlocks = validImages.map((image) => { 23270 image.width = void 0; 23271 image.height = void 0; 23272 return (0, import_blocks31.createBlock)("core/image", image); 23273 }); 23274 return (0, import_blocks31.createBlock)( 23275 "core/gallery", 23276 { 23277 align, 23278 sizeSlug 23279 }, 23280 innerBlocks 23281 ); 23282 } 23283 }, 23284 { 23285 type: "shortcode", 23286 tag: "gallery", 23287 transform({ named: { ids, columns = 3, link, orderby, size } }) { 23288 const imageIds = parseShortcodeIds(ids).map( 23289 (id) => parseInt(id, 10) 23290 ); 23291 let linkTo = LINK_DESTINATION_NONE; 23292 if (link === "post") { 23293 linkTo = LINK_DESTINATION_ATTACHMENT; 23294 } else if (link === "file") { 23295 linkTo = LINK_DESTINATION_MEDIA; 23296 } 23297 const galleryBlock = (0, import_blocks31.createBlock)( 23298 "core/gallery", 23299 { 23300 columns: parseInt(columns, 10), 23301 linkTo, 23302 randomOrder: orderby === "rand", 23303 ...size && { sizeSlug: size } 23304 }, 23305 imageIds.map( 23306 (imageId) => (0, import_blocks31.createBlock)("core/image", { 23307 id: imageId, 23308 ...size && { sizeSlug: size } 23309 }) 23310 ) 23311 ); 23312 return galleryBlock; 23313 }, 23314 isMatch({ named }) { 23315 return void 0 !== named.ids; 23316 } 23317 }, 23318 { 23319 // When created by drag and dropping multiple files on an insertion point. Because multiple 23320 // files must not be transformed to a gallery when dropped within a gallery there is another transform 23321 // within the image block to handle that case. Therefore this transform has to have priority 1 23322 // set so that it overrides the image block transformation when multiple images are dropped outside 23323 // of a gallery block. 23324 type: "files", 23325 priority: 1, 23326 isMatch(files) { 23327 return files.length !== 1 && files.every( 23328 (file) => file.type.indexOf("image/") === 0 23329 ); 23330 }, 23331 transform(files) { 23332 const innerBlocks = files.map( 23333 (file) => (0, import_blocks31.createBlock)("core/image", { 23334 blob: (0, import_blob10.createBlobURL)(file) 23335 }) 23336 ); 23337 return (0, import_blocks31.createBlock)("core/gallery", {}, innerBlocks); 23338 } 23339 } 23340 ], 23341 to: [ 23342 { 23343 type: "block", 23344 blocks: ["core/image"], 23345 transform: ({ align }, innerBlocks) => { 23346 if (innerBlocks.length > 0) { 23347 return innerBlocks.map( 23348 ({ 23349 attributes: { 23350 url, 23351 alt, 23352 caption, 23353 title, 23354 href, 23355 rel, 23356 linkClass, 23357 id, 23358 sizeSlug: imageSizeSlug, 23359 linkDestination, 23360 linkTarget, 23361 anchor, 23362 className 23363 } 23364 }) => (0, import_blocks31.createBlock)("core/image", { 23365 align, 23366 url, 23367 alt, 23368 caption, 23369 title, 23370 href, 23371 rel, 23372 linkClass, 23373 id, 23374 sizeSlug: imageSizeSlug, 23375 linkDestination, 23376 linkTarget, 23377 anchor, 23378 className 23379 }) 23380 ); 23381 } 23382 return (0, import_blocks31.createBlock)("core/image", { align }); 23383 } 23384 } 23385 ] 23386 }; 23387 var transforms_default10 = transforms9; 23388 23389 // packages/block-library/build-module/gallery/index.js 23390 var { name: name38 } = block_default38; 23391 var settings38 = { 23392 icon: gallery_default, 23393 example: { 23394 attributes: { 23395 columns: 2 23396 }, 23397 innerBlocks: [ 23398 { 23399 name: "core/image", 23400 attributes: { 23401 url: "https://s.w.org/images/core/5.3/Glacial_lakes%2C_Bhutan.jpg" 23402 } 23403 }, 23404 { 23405 name: "core/image", 23406 attributes: { 23407 url: "https://s.w.org/images/core/5.3/Sediment_off_the_Yucatan_Peninsula.jpg" 23408 } 23409 } 23410 ] 23411 }, 23412 transforms: transforms_default10, 23413 edit: GalleryEdit, 23414 save: saveWithInnerBlocks, 23415 deprecated: deprecated_default16 23416 }; 23417 var init38 = () => initBlock({ name: name38, metadata: block_default38, settings: settings38 }); 23418 23419 // packages/block-library/build-module/group/index.js 23420 var group_exports = {}; 23421 __export(group_exports, { 23422 init: () => init39, 23423 metadata: () => block_default39, 23424 name: () => name39, 23425 settings: () => settings39 23426 }); 23427 var import_i18n79 = __toESM(require_i18n()); 23428 23429 // packages/block-library/build-module/group/deprecated.js 23430 var import_block_editor97 = __toESM(require_block_editor()); 23431 var import_jsx_runtime248 = __toESM(require_jsx_runtime()); 23432 var migrateAttributes = (attributes3) => { 23433 if (!attributes3.tagName) { 23434 attributes3 = { 23435 ...attributes3, 23436 tagName: "div" 23437 }; 23438 } 23439 if (!attributes3.customTextColor && !attributes3.customBackgroundColor) { 23440 return attributes3; 23441 } 23442 const style2 = { color: {} }; 23443 if (attributes3.customTextColor) { 23444 style2.color.text = attributes3.customTextColor; 23445 } 23446 if (attributes3.customBackgroundColor) { 23447 style2.color.background = attributes3.customBackgroundColor; 23448 } 23449 const { customTextColor, customBackgroundColor, ...restAttributes } = attributes3; 23450 return { 23451 ...restAttributes, 23452 style: style2 23453 }; 23454 }; 23455 var deprecated8 = [ 23456 // Version with default layout. 23457 { 23458 attributes: { 23459 tagName: { 23460 type: "string", 23461 default: "div" 23462 }, 23463 templateLock: { 23464 type: ["string", "boolean"], 23465 enum: ["all", "insert", false] 23466 } 23467 }, 23468 supports: { 23469 __experimentalOnEnter: true, 23470 __experimentalSettings: true, 23471 align: ["wide", "full"], 23472 anchor: true, 23473 ariaLabel: true, 23474 html: false, 23475 color: { 23476 gradients: true, 23477 link: true, 23478 __experimentalDefaultControls: { 23479 background: true, 23480 text: true 23481 } 23482 }, 23483 spacing: { 23484 margin: ["top", "bottom"], 23485 padding: true, 23486 blockGap: true, 23487 __experimentalDefaultControls: { 23488 padding: true, 23489 blockGap: true 23490 } 23491 }, 23492 __experimentalBorder: { 23493 color: true, 23494 radius: true, 23495 style: true, 23496 width: true, 23497 __experimentalDefaultControls: { 23498 color: true, 23499 radius: true, 23500 style: true, 23501 width: true 23502 } 23503 }, 23504 typography: { 23505 fontSize: true, 23506 lineHeight: true, 23507 __experimentalFontStyle: true, 23508 __experimentalFontWeight: true, 23509 __experimentalLetterSpacing: true, 23510 __experimentalTextTransform: true, 23511 __experimentalDefaultControls: { 23512 fontSize: true 23513 } 23514 }, 23515 layout: true 23516 }, 23517 save({ attributes: { tagName: Tag } }) { 23518 return /* @__PURE__ */ (0, import_jsx_runtime248.jsx)(Tag, { ...import_block_editor97.useInnerBlocksProps.save(import_block_editor97.useBlockProps.save()) }); 23519 }, 23520 isEligible: ({ layout }) => layout?.inherit || layout?.contentSize && layout?.type !== "constrained", 23521 migrate: (attributes3) => { 23522 const { layout = null } = attributes3; 23523 if (layout?.inherit || layout?.contentSize) { 23524 return { 23525 ...attributes3, 23526 layout: { 23527 ...layout, 23528 type: "constrained" 23529 } 23530 }; 23531 } 23532 } 23533 }, 23534 // Version of the block with the double div. 23535 { 23536 attributes: { 23537 tagName: { 23538 type: "string", 23539 default: "div" 23540 }, 23541 templateLock: { 23542 type: ["string", "boolean"], 23543 enum: ["all", "insert", false] 23544 } 23545 }, 23546 supports: { 23547 align: ["wide", "full"], 23548 anchor: true, 23549 color: { 23550 gradients: true, 23551 link: true 23552 }, 23553 spacing: { 23554 padding: true 23555 }, 23556 __experimentalBorder: { 23557 radius: true 23558 } 23559 }, 23560 save({ attributes: attributes3 }) { 23561 const { tagName: Tag } = attributes3; 23562 return /* @__PURE__ */ (0, import_jsx_runtime248.jsx)(Tag, { ...import_block_editor97.useBlockProps.save(), children: /* @__PURE__ */ (0, import_jsx_runtime248.jsx)("div", { className: "wp-block-group__inner-container", children: /* @__PURE__ */ (0, import_jsx_runtime248.jsx)(import_block_editor97.InnerBlocks.Content, {}) }) }); 23563 } 23564 }, 23565 // Version of the block without global styles support 23566 { 23567 attributes: { 23568 backgroundColor: { 23569 type: "string" 23570 }, 23571 customBackgroundColor: { 23572 type: "string" 23573 }, 23574 textColor: { 23575 type: "string" 23576 }, 23577 customTextColor: { 23578 type: "string" 23579 } 23580 }, 23581 supports: { 23582 align: ["wide", "full"], 23583 anchor: true, 23584 html: false 23585 }, 23586 migrate: migrateAttributes, 23587 save({ attributes: attributes3 }) { 23588 const { 23589 backgroundColor, 23590 customBackgroundColor, 23591 textColor, 23592 customTextColor 23593 } = attributes3; 23594 const backgroundClass = (0, import_block_editor97.getColorClassName)( 23595 "background-color", 23596 backgroundColor 23597 ); 23598 const textClass = (0, import_block_editor97.getColorClassName)("color", textColor); 23599 const className = clsx_default(backgroundClass, textClass, { 23600 "has-text-color": textColor || customTextColor, 23601 "has-background": backgroundColor || customBackgroundColor 23602 }); 23603 const styles = { 23604 backgroundColor: backgroundClass ? void 0 : customBackgroundColor, 23605 color: textClass ? void 0 : customTextColor 23606 }; 23607 return /* @__PURE__ */ (0, import_jsx_runtime248.jsx)("div", { className, style: styles, children: /* @__PURE__ */ (0, import_jsx_runtime248.jsx)("div", { className: "wp-block-group__inner-container", children: /* @__PURE__ */ (0, import_jsx_runtime248.jsx)(import_block_editor97.InnerBlocks.Content, {}) }) }); 23608 } 23609 }, 23610 // Version of the group block with a bug that made text color class not applied. 23611 { 23612 attributes: { 23613 backgroundColor: { 23614 type: "string" 23615 }, 23616 customBackgroundColor: { 23617 type: "string" 23618 }, 23619 textColor: { 23620 type: "string" 23621 }, 23622 customTextColor: { 23623 type: "string" 23624 } 23625 }, 23626 migrate: migrateAttributes, 23627 supports: { 23628 align: ["wide", "full"], 23629 anchor: true, 23630 html: false 23631 }, 23632 save({ attributes: attributes3 }) { 23633 const { 23634 backgroundColor, 23635 customBackgroundColor, 23636 textColor, 23637 customTextColor 23638 } = attributes3; 23639 const backgroundClass = (0, import_block_editor97.getColorClassName)( 23640 "background-color", 23641 backgroundColor 23642 ); 23643 const textClass = (0, import_block_editor97.getColorClassName)("color", textColor); 23644 const className = clsx_default(backgroundClass, { 23645 "has-text-color": textColor || customTextColor, 23646 "has-background": backgroundColor || customBackgroundColor 23647 }); 23648 const styles = { 23649 backgroundColor: backgroundClass ? void 0 : customBackgroundColor, 23650 color: textClass ? void 0 : customTextColor 23651 }; 23652 return /* @__PURE__ */ (0, import_jsx_runtime248.jsx)("div", { className, style: styles, children: /* @__PURE__ */ (0, import_jsx_runtime248.jsx)("div", { className: "wp-block-group__inner-container", children: /* @__PURE__ */ (0, import_jsx_runtime248.jsx)(import_block_editor97.InnerBlocks.Content, {}) }) }); 23653 } 23654 }, 23655 // v1 of group block. Deprecated to add an inner-container div around `InnerBlocks.Content`. 23656 { 23657 attributes: { 23658 backgroundColor: { 23659 type: "string" 23660 }, 23661 customBackgroundColor: { 23662 type: "string" 23663 } 23664 }, 23665 supports: { 23666 align: ["wide", "full"], 23667 anchor: true, 23668 html: false 23669 }, 23670 migrate: migrateAttributes, 23671 save({ attributes: attributes3 }) { 23672 const { backgroundColor, customBackgroundColor } = attributes3; 23673 const backgroundClass = (0, import_block_editor97.getColorClassName)( 23674 "background-color", 23675 backgroundColor 23676 ); 23677 const className = clsx_default(backgroundClass, { 23678 "has-background": backgroundColor || customBackgroundColor 23679 }); 23680 const styles = { 23681 backgroundColor: backgroundClass ? void 0 : customBackgroundColor 23682 }; 23683 return /* @__PURE__ */ (0, import_jsx_runtime248.jsx)("div", { className, style: styles, children: /* @__PURE__ */ (0, import_jsx_runtime248.jsx)(import_block_editor97.InnerBlocks.Content, {}) }); 23684 } 23685 } 23686 ]; 23687 var deprecated_default17 = deprecated8; 23688 23689 // packages/block-library/build-module/group/edit.js 23690 var import_data38 = __toESM(require_data()); 23691 var import_block_editor99 = __toESM(require_block_editor()); 23692 var import_element36 = __toESM(require_element()); 23693 var import_i18n77 = __toESM(require_i18n()); 23694 var import_primitives151 = __toESM(require_primitives()); 23695 23696 // packages/block-library/build-module/group/placeholder.js 23697 var import_data37 = __toESM(require_data()); 23698 var import_block_editor98 = __toESM(require_block_editor()); 23699 var import_i18n76 = __toESM(require_i18n()); 23700 var import_blocks32 = __toESM(require_blocks()); 23701 var import_components46 = __toESM(require_components()); 23702 var import_element35 = __toESM(require_element()); 23703 var import_jsx_runtime249 = __toESM(require_jsx_runtime()); 23704 var getGroupPlaceholderIcons = (name117 = "group") => { 23705 const icons = { 23706 group: /* @__PURE__ */ (0, import_jsx_runtime249.jsx)( 23707 import_components46.SVG, 23708 { 23709 xmlns: "http://www.w3.org/2000/svg", 23710 width: "48", 23711 height: "48", 23712 viewBox: "0 0 48 48", 23713 children: /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(import_components46.Path, { d: "M0 10a2 2 0 0 1 2-2h44a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Z" }) 23714 } 23715 ), 23716 "group-row": /* @__PURE__ */ (0, import_jsx_runtime249.jsx)( 23717 import_components46.SVG, 23718 { 23719 xmlns: "http://www.w3.org/2000/svg", 23720 width: "48", 23721 height: "48", 23722 viewBox: "0 0 48 48", 23723 children: /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(import_components46.Path, { d: "M0 10a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm25 0a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H27a2 2 0 0 1-2-2V10Z" }) 23724 } 23725 ), 23726 "group-stack": /* @__PURE__ */ (0, import_jsx_runtime249.jsx)( 23727 import_components46.SVG, 23728 { 23729 xmlns: "http://www.w3.org/2000/svg", 23730 width: "48", 23731 height: "48", 23732 viewBox: "0 0 48 48", 23733 children: /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(import_components46.Path, { 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" }) 23734 } 23735 ), 23736 "group-grid": /* @__PURE__ */ (0, import_jsx_runtime249.jsx)( 23737 import_components46.SVG, 23738 { 23739 xmlns: "http://www.w3.org/2000/svg", 23740 width: "48", 23741 height: "48", 23742 viewBox: "0 0 48 48", 23743 children: /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(import_components46.Path, { 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" }) 23744 } 23745 ) 23746 }; 23747 return icons?.[name117]; 23748 }; 23749 function useShouldShowPlaceHolder({ 23750 attributes: attributes3 = { 23751 style: void 0, 23752 backgroundColor: void 0, 23753 textColor: void 0, 23754 fontSize: void 0 23755 }, 23756 usedLayoutType = "", 23757 hasInnerBlocks = false 23758 }) { 23759 const { style: style2, backgroundColor, textColor, fontSize } = attributes3; 23760 const [showPlaceholder, setShowPlaceholder] = (0, import_element35.useState)( 23761 !hasInnerBlocks && !backgroundColor && !fontSize && !textColor && !style2 && usedLayoutType !== "flex" && usedLayoutType !== "grid" 23762 ); 23763 (0, import_element35.useEffect)(() => { 23764 if (!!hasInnerBlocks || !!backgroundColor || !!fontSize || !!textColor || !!style2 || usedLayoutType === "flex") { 23765 setShowPlaceholder(false); 23766 } 23767 }, [ 23768 backgroundColor, 23769 fontSize, 23770 textColor, 23771 style2, 23772 usedLayoutType, 23773 hasInnerBlocks 23774 ]); 23775 return [showPlaceholder, setShowPlaceholder]; 23776 } 23777 function GroupPlaceHolder({ name: name117, onSelect }) { 23778 const variations18 = (0, import_data37.useSelect)( 23779 (select9) => select9(import_blocks32.store).getBlockVariations(name117, "block"), 23780 [name117] 23781 ); 23782 const blockProps = (0, import_block_editor98.useBlockProps)({ 23783 className: "wp-block-group__placeholder" 23784 }); 23785 (0, import_element35.useEffect)(() => { 23786 if (variations18 && variations18.length === 1) { 23787 onSelect(variations18[0]); 23788 } 23789 }, [onSelect, variations18]); 23790 return /* @__PURE__ */ (0, import_jsx_runtime249.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime249.jsx)( 23791 import_components46.Placeholder, 23792 { 23793 instructions: (0, import_i18n76.__)("Group blocks together. Select a layout:"), 23794 children: /* @__PURE__ */ (0, import_jsx_runtime249.jsx)( 23795 "ul", 23796 { 23797 role: "list", 23798 className: "wp-block-group-placeholder__variations", 23799 "aria-label": (0, import_i18n76.__)("Block variations"), 23800 children: variations18.map((variation) => /* @__PURE__ */ (0, import_jsx_runtime249.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime249.jsx)( 23801 import_components46.Button, 23802 { 23803 __next40pxDefaultSize: true, 23804 variant: "tertiary", 23805 icon: getGroupPlaceholderIcons( 23806 variation.name 23807 ), 23808 iconSize: 48, 23809 onClick: () => onSelect(variation), 23810 className: "wp-block-group-placeholder__variation-button", 23811 label: `$variation.title}: $variation.description}` 23812 } 23813 ) }, variation.name)) 23814 } 23815 ) 23816 } 23817 ) }); 23818 } 23819 var placeholder_default = GroupPlaceHolder; 23820 23821 // packages/block-library/build-module/group/edit.js 23822 var import_jsx_runtime250 = __toESM(require_jsx_runtime()); 23823 var { HTMLElementControl: HTMLElementControl4 } = unlock(import_block_editor99.privateApis); 23824 function GroupEditControls({ tagName, onSelectTagName, clientId }) { 23825 return /* @__PURE__ */ (0, import_jsx_runtime250.jsx)(import_block_editor99.InspectorControls, { group: "advanced", children: /* @__PURE__ */ (0, import_jsx_runtime250.jsx)( 23826 HTMLElementControl4, 23827 { 23828 tagName, 23829 onChange: onSelectTagName, 23830 clientId, 23831 options: [ 23832 { label: (0, import_i18n77.__)("Default (<div>)"), value: "div" }, 23833 { label: "<header>", value: "header" }, 23834 { label: "<main>", value: "main" }, 23835 { label: "<section>", value: "section" }, 23836 { label: "<article>", value: "article" }, 23837 { label: "<aside>", value: "aside" }, 23838 { label: "<footer>", value: "footer" } 23839 ] 23840 } 23841 ) }); 23842 } 23843 function GroupEdit({ attributes: attributes3, name: name117, setAttributes, clientId }) { 23844 const { hasInnerBlocks, themeSupportsLayout } = (0, import_data38.useSelect)( 23845 (select9) => { 23846 const { getBlock, getSettings: getSettings2 } = select9(import_block_editor99.store); 23847 const block = getBlock(clientId); 23848 return { 23849 hasInnerBlocks: !!(block && block.innerBlocks.length), 23850 themeSupportsLayout: getSettings2()?.supportsLayout 23851 }; 23852 }, 23853 [clientId] 23854 ); 23855 const { 23856 tagName: TagName2 = "div", 23857 templateLock, 23858 allowedBlocks, 23859 layout = {} 23860 } = attributes3; 23861 const { type = "default" } = layout; 23862 const layoutSupportEnabled = themeSupportsLayout || type === "flex" || type === "grid"; 23863 const ref = (0, import_element36.useRef)(); 23864 const blockProps = (0, import_block_editor99.useBlockProps)({ ref }); 23865 const [showPlaceholder, setShowPlaceholder] = useShouldShowPlaceHolder({ 23866 attributes: attributes3, 23867 usedLayoutType: type, 23868 hasInnerBlocks 23869 }); 23870 let renderAppender; 23871 if (showPlaceholder) { 23872 renderAppender = false; 23873 } else if (!hasInnerBlocks) { 23874 renderAppender = import_block_editor99.InnerBlocks.ButtonBlockAppender; 23875 } 23876 const innerBlocksProps = (0, import_block_editor99.useInnerBlocksProps)( 23877 layoutSupportEnabled ? blockProps : { className: "wp-block-group__inner-container" }, 23878 { 23879 dropZoneElement: ref.current, 23880 templateLock, 23881 allowedBlocks, 23882 renderAppender 23883 } 23884 ); 23885 const { selectBlock } = (0, import_data38.useDispatch)(import_block_editor99.store); 23886 const selectVariation = (nextVariation) => { 23887 setAttributes(nextVariation.attributes); 23888 selectBlock(clientId, -1); 23889 setShowPlaceholder(false); 23890 }; 23891 return /* @__PURE__ */ (0, import_jsx_runtime250.jsxs)(import_jsx_runtime250.Fragment, { children: [ 23892 /* @__PURE__ */ (0, import_jsx_runtime250.jsx)( 23893 GroupEditControls, 23894 { 23895 tagName: TagName2, 23896 onSelectTagName: (value) => setAttributes({ tagName: value }), 23897 clientId 23898 } 23899 ), 23900 showPlaceholder && /* @__PURE__ */ (0, import_jsx_runtime250.jsxs)(import_primitives151.View, { children: [ 23901 innerBlocksProps.children, 23902 /* @__PURE__ */ (0, import_jsx_runtime250.jsx)( 23903 placeholder_default, 23904 { 23905 name: name117, 23906 onSelect: selectVariation 23907 } 23908 ) 23909 ] }), 23910 layoutSupportEnabled && !showPlaceholder && /* @__PURE__ */ (0, import_jsx_runtime250.jsx)(TagName2, { ...innerBlocksProps }), 23911 !layoutSupportEnabled && !showPlaceholder && /* @__PURE__ */ (0, import_jsx_runtime250.jsx)(TagName2, { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime250.jsx)("div", { ...innerBlocksProps }) }) 23912 ] }); 23913 } 23914 var edit_default15 = GroupEdit; 23915 23916 // packages/block-library/build-module/group/block.json 23917 var block_default39 = { 23918 $schema: "https://schemas.wp.org/trunk/block.json", 23919 apiVersion: 3, 23920 name: "core/group", 23921 title: "Group", 23922 category: "design", 23923 description: "Gather blocks in a layout container.", 23924 keywords: ["container", "wrapper", "row", "section"], 23925 textdomain: "default", 23926 attributes: { 23927 tagName: { 23928 type: "string", 23929 default: "div" 23930 }, 23931 templateLock: { 23932 type: ["string", "boolean"], 23933 enum: ["all", "insert", "contentOnly", false] 23934 } 23935 }, 23936 supports: { 23937 __experimentalOnEnter: true, 23938 __experimentalOnMerge: true, 23939 __experimentalSettings: true, 23940 align: ["wide", "full"], 23941 anchor: true, 23942 ariaLabel: true, 23943 html: false, 23944 background: { 23945 backgroundImage: true, 23946 backgroundSize: true, 23947 __experimentalDefaultControls: { 23948 backgroundImage: true 23949 } 23950 }, 23951 color: { 23952 gradients: true, 23953 heading: true, 23954 button: true, 23955 link: true, 23956 __experimentalDefaultControls: { 23957 background: true, 23958 text: true 23959 } 23960 }, 23961 shadow: true, 23962 spacing: { 23963 margin: ["top", "bottom"], 23964 padding: true, 23965 blockGap: true, 23966 __experimentalDefaultControls: { 23967 padding: true, 23968 blockGap: true 23969 } 23970 }, 23971 dimensions: { 23972 minHeight: true 23973 }, 23974 __experimentalBorder: { 23975 color: true, 23976 radius: true, 23977 style: true, 23978 width: true, 23979 __experimentalDefaultControls: { 23980 color: true, 23981 radius: true, 23982 style: true, 23983 width: true 23984 } 23985 }, 23986 position: { 23987 sticky: true 23988 }, 23989 typography: { 23990 fontSize: true, 23991 lineHeight: true, 23992 __experimentalFontFamily: true, 23993 __experimentalFontWeight: true, 23994 __experimentalFontStyle: true, 23995 __experimentalTextTransform: true, 23996 __experimentalTextDecoration: true, 23997 __experimentalLetterSpacing: true, 23998 __experimentalDefaultControls: { 23999 fontSize: true 24000 } 24001 }, 24002 layout: { 24003 allowSizingOnChildren: true 24004 }, 24005 interactivity: { 24006 clientNavigation: true 24007 }, 24008 allowedBlocks: true 24009 }, 24010 editorStyle: "wp-block-group-editor", 24011 style: "wp-block-group" 24012 }; 24013 24014 // packages/block-library/build-module/group/save.js 24015 var import_block_editor100 = __toESM(require_block_editor()); 24016 var import_jsx_runtime251 = __toESM(require_jsx_runtime()); 24017 function save22({ attributes: { tagName: Tag } }) { 24018 return /* @__PURE__ */ (0, import_jsx_runtime251.jsx)(Tag, { ...import_block_editor100.useInnerBlocksProps.save(import_block_editor100.useBlockProps.save()) }); 24019 } 24020 24021 // packages/block-library/build-module/group/transforms.js 24022 var import_blocks33 = __toESM(require_blocks()); 24023 var transforms10 = { 24024 from: [ 24025 { 24026 type: "block", 24027 isMultiBlock: true, 24028 blocks: ["*"], 24029 __experimentalConvert(blocks) { 24030 const alignments = ["wide", "full"]; 24031 const widestAlignment = blocks.reduce( 24032 (accumulator, block) => { 24033 const { align } = block.attributes; 24034 return alignments.indexOf(align) > alignments.indexOf(accumulator) ? align : accumulator; 24035 }, 24036 void 0 24037 ); 24038 const groupInnerBlocks = blocks.map((block) => { 24039 return (0, import_blocks33.createBlock)( 24040 block.name, 24041 block.attributes, 24042 block.innerBlocks 24043 ); 24044 }); 24045 return (0, import_blocks33.createBlock)( 24046 "core/group", 24047 { 24048 align: widestAlignment, 24049 layout: { type: "constrained" } 24050 }, 24051 groupInnerBlocks 24052 ); 24053 } 24054 } 24055 ] 24056 }; 24057 var transforms_default11 = transforms10; 24058 24059 // packages/block-library/build-module/group/variations.js 24060 var import_i18n78 = __toESM(require_i18n()); 24061 var example = { 24062 innerBlocks: [ 24063 { 24064 name: "core/paragraph", 24065 attributes: { 24066 content: (0, import_i18n78.__)("One.") 24067 } 24068 }, 24069 { 24070 name: "core/paragraph", 24071 attributes: { 24072 content: (0, import_i18n78.__)("Two.") 24073 } 24074 }, 24075 { 24076 name: "core/paragraph", 24077 attributes: { 24078 content: (0, import_i18n78.__)("Three.") 24079 } 24080 }, 24081 { 24082 name: "core/paragraph", 24083 attributes: { 24084 content: (0, import_i18n78.__)("Four.") 24085 } 24086 }, 24087 { 24088 name: "core/paragraph", 24089 attributes: { 24090 content: (0, import_i18n78.__)("Five.") 24091 } 24092 }, 24093 { 24094 name: "core/paragraph", 24095 attributes: { 24096 content: (0, import_i18n78.__)("Six.") 24097 } 24098 } 24099 ] 24100 }; 24101 var variations8 = [ 24102 { 24103 name: "group", 24104 title: (0, import_i18n78.__)("Group"), 24105 description: (0, import_i18n78.__)("Gather blocks in a container."), 24106 attributes: { layout: { type: "constrained" } }, 24107 isDefault: true, 24108 scope: ["block", "inserter", "transform"], 24109 icon: group_default 24110 }, 24111 { 24112 name: "group-row", 24113 title: (0, import_i18n78._x)("Row", "single horizontal line"), 24114 description: (0, import_i18n78.__)("Arrange blocks horizontally."), 24115 attributes: { layout: { type: "flex", flexWrap: "nowrap" } }, 24116 scope: ["block", "inserter", "transform"], 24117 isActive: ["layout.type"], 24118 icon: row_default, 24119 example 24120 }, 24121 { 24122 name: "group-stack", 24123 title: (0, import_i18n78.__)("Stack"), 24124 description: (0, import_i18n78.__)("Arrange blocks vertically."), 24125 attributes: { layout: { type: "flex", orientation: "vertical" } }, 24126 scope: ["block", "inserter", "transform"], 24127 isActive: ["layout.type", "layout.orientation"], 24128 icon: stack_default, 24129 example 24130 }, 24131 { 24132 name: "group-grid", 24133 title: (0, import_i18n78.__)("Grid"), 24134 description: (0, import_i18n78.__)("Arrange blocks in a grid."), 24135 attributes: { layout: { type: "grid" } }, 24136 scope: ["block", "inserter", "transform"], 24137 isActive: ["layout.type"], 24138 icon: grid_default, 24139 example 24140 } 24141 ]; 24142 var variations_default8 = variations8; 24143 24144 // packages/block-library/build-module/group/index.js 24145 var { name: name39 } = block_default39; 24146 var settings39 = { 24147 icon: group_default, 24148 example: { 24149 attributes: { 24150 layout: { 24151 type: "constrained", 24152 justifyContent: "center" 24153 }, 24154 style: { 24155 spacing: { 24156 padding: { 24157 top: "4em", 24158 right: "3em", 24159 bottom: "4em", 24160 left: "3em" 24161 } 24162 } 24163 } 24164 }, 24165 innerBlocks: [ 24166 { 24167 name: "core/heading", 24168 attributes: { 24169 content: (0, import_i18n79.__)("La Mancha"), 24170 textAlign: "center" 24171 } 24172 }, 24173 { 24174 name: "core/paragraph", 24175 attributes: { 24176 style: { 24177 typography: { 24178 textAlign: "center" 24179 } 24180 }, 24181 content: (0, import_i18n79.__)( 24182 "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." 24183 ) 24184 } 24185 }, 24186 { 24187 name: "core/spacer", 24188 attributes: { 24189 height: "10px" 24190 } 24191 }, 24192 { 24193 name: "core/button", 24194 attributes: { 24195 text: (0, import_i18n79.__)("Read more") 24196 } 24197 } 24198 ], 24199 viewportWidth: 600 24200 }, 24201 transforms: transforms_default11, 24202 edit: edit_default15, 24203 save: save22, 24204 deprecated: deprecated_default17, 24205 variations: variations_default8 24206 }; 24207 var init39 = () => initBlock({ name: name39, metadata: block_default39, settings: settings39 }); 24208 24209 // packages/block-library/build-module/heading/index.js 24210 var heading_exports = {}; 24211 __export(heading_exports, { 24212 init: () => init40, 24213 metadata: () => block_default40, 24214 name: () => name40, 24215 settings: () => settings40 24216 }); 24217 var import_i18n82 = __toESM(require_i18n()); 24218 var import_blocks35 = __toESM(require_blocks()); 24219 24220 // packages/block-library/build-module/heading/deprecated.js 24221 var import_block_editor101 = __toESM(require_block_editor()); 24222 var import_jsx_runtime252 = __toESM(require_jsx_runtime()); 24223 var blockSupports = { 24224 className: false, 24225 anchor: true 24226 }; 24227 var blockAttributes4 = { 24228 align: { 24229 type: "string" 24230 }, 24231 content: { 24232 type: "string", 24233 source: "html", 24234 selector: "h1,h2,h3,h4,h5,h6", 24235 default: "" 24236 }, 24237 level: { 24238 type: "number", 24239 default: 2 24240 }, 24241 placeholder: { 24242 type: "string" 24243 } 24244 }; 24245 var migrateCustomColors2 = (attributes3) => { 24246 if (!attributes3.customTextColor) { 24247 return attributes3; 24248 } 24249 const style2 = { 24250 color: { 24251 text: attributes3.customTextColor 24252 } 24253 }; 24254 const { customTextColor, ...restAttributes } = attributes3; 24255 return { 24256 ...restAttributes, 24257 style: style2 24258 }; 24259 }; 24260 var TEXT_ALIGN_OPTIONS = ["left", "right", "center"]; 24261 var migrateTextAlign = (attributes3) => { 24262 const { align, ...rest } = attributes3; 24263 return TEXT_ALIGN_OPTIONS.includes(align) ? { ...rest, textAlign: align } : attributes3; 24264 }; 24265 var v114 = { 24266 supports: blockSupports, 24267 attributes: { 24268 ...blockAttributes4, 24269 customTextColor: { 24270 type: "string" 24271 }, 24272 textColor: { 24273 type: "string" 24274 } 24275 }, 24276 migrate: (attributes3) => migrateCustomColors2(migrateTextAlign(attributes3)), 24277 save({ attributes: attributes3 }) { 24278 const { align, level, content, textColor, customTextColor } = attributes3; 24279 const tagName = "h" + level; 24280 const textClass = (0, import_block_editor101.getColorClassName)("color", textColor); 24281 const className = clsx_default({ 24282 [textClass]: textClass 24283 }); 24284 return /* @__PURE__ */ (0, import_jsx_runtime252.jsx)( 24285 import_block_editor101.RichText.Content, 24286 { 24287 className: className ? className : void 0, 24288 tagName, 24289 style: { 24290 textAlign: align, 24291 color: textClass ? void 0 : customTextColor 24292 }, 24293 value: content 24294 } 24295 ); 24296 } 24297 }; 24298 var v26 = { 24299 attributes: { 24300 ...blockAttributes4, 24301 customTextColor: { 24302 type: "string" 24303 }, 24304 textColor: { 24305 type: "string" 24306 } 24307 }, 24308 migrate: (attributes3) => migrateCustomColors2(migrateTextAlign(attributes3)), 24309 save({ attributes: attributes3 }) { 24310 const { align, content, customTextColor, level, textColor } = attributes3; 24311 const tagName = "h" + level; 24312 const textClass = (0, import_block_editor101.getColorClassName)("color", textColor); 24313 const className = clsx_default({ 24314 [textClass]: textClass, 24315 [`has-text-align-$align}`]: align 24316 }); 24317 return /* @__PURE__ */ (0, import_jsx_runtime252.jsx)( 24318 import_block_editor101.RichText.Content, 24319 { 24320 className: className ? className : void 0, 24321 tagName, 24322 style: { 24323 color: textClass ? void 0 : customTextColor 24324 }, 24325 value: content 24326 } 24327 ); 24328 }, 24329 supports: blockSupports 24330 }; 24331 var v34 = { 24332 supports: blockSupports, 24333 attributes: { 24334 ...blockAttributes4, 24335 customTextColor: { 24336 type: "string" 24337 }, 24338 textColor: { 24339 type: "string" 24340 } 24341 }, 24342 migrate: (attributes3) => migrateCustomColors2(migrateTextAlign(attributes3)), 24343 save({ attributes: attributes3 }) { 24344 const { align, content, customTextColor, level, textColor } = attributes3; 24345 const tagName = "h" + level; 24346 const textClass = (0, import_block_editor101.getColorClassName)("color", textColor); 24347 const className = clsx_default({ 24348 [textClass]: textClass, 24349 "has-text-color": textColor || customTextColor, 24350 [`has-text-align-$align}`]: align 24351 }); 24352 return /* @__PURE__ */ (0, import_jsx_runtime252.jsx)( 24353 import_block_editor101.RichText.Content, 24354 { 24355 className: className ? className : void 0, 24356 tagName, 24357 style: { 24358 color: textClass ? void 0 : customTextColor 24359 }, 24360 value: content 24361 } 24362 ); 24363 } 24364 }; 24365 var v43 = { 24366 supports: { 24367 align: ["wide", "full"], 24368 anchor: true, 24369 className: false, 24370 color: { link: true }, 24371 fontSize: true, 24372 lineHeight: true, 24373 __experimentalSelector: { 24374 "core/heading/h1": "h1", 24375 "core/heading/h2": "h2", 24376 "core/heading/h3": "h3", 24377 "core/heading/h4": "h4", 24378 "core/heading/h5": "h5", 24379 "core/heading/h6": "h6" 24380 }, 24381 __unstablePasteTextInline: true 24382 }, 24383 attributes: blockAttributes4, 24384 isEligible: ({ align }) => TEXT_ALIGN_OPTIONS.includes(align), 24385 migrate: migrateTextAlign, 24386 save({ attributes: attributes3 }) { 24387 const { align, content, level } = attributes3; 24388 const TagName2 = "h" + level; 24389 const className = clsx_default({ 24390 [`has-text-align-$align}`]: align 24391 }); 24392 return /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(TagName2, { ...import_block_editor101.useBlockProps.save({ className }), children: /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(import_block_editor101.RichText.Content, { value: content }) }); 24393 } 24394 }; 24395 var v53 = { 24396 supports: { 24397 align: ["wide", "full"], 24398 anchor: true, 24399 className: false, 24400 color: { 24401 gradients: true, 24402 link: true, 24403 __experimentalDefaultControls: { 24404 background: true, 24405 text: true 24406 } 24407 }, 24408 spacing: { 24409 margin: true, 24410 padding: true 24411 }, 24412 typography: { 24413 fontSize: true, 24414 lineHeight: true, 24415 __experimentalFontFamily: true, 24416 __experimentalFontStyle: true, 24417 __experimentalFontWeight: true, 24418 __experimentalLetterSpacing: true, 24419 __experimentalTextTransform: true, 24420 __experimentalTextDecoration: true, 24421 __experimentalDefaultControls: { 24422 fontSize: true, 24423 fontAppearance: true, 24424 textTransform: true 24425 } 24426 }, 24427 __experimentalSelector: "h1,h2,h3,h4,h5,h6", 24428 __unstablePasteTextInline: true, 24429 __experimentalSlashInserter: true 24430 }, 24431 attributes: { 24432 textAlign: { 24433 type: "string" 24434 }, 24435 content: { 24436 type: "string", 24437 source: "html", 24438 selector: "h1,h2,h3,h4,h5,h6", 24439 default: "", 24440 role: "content" 24441 }, 24442 level: { 24443 type: "number", 24444 default: 2 24445 }, 24446 placeholder: { 24447 type: "string" 24448 } 24449 }, 24450 save({ attributes: attributes3 }) { 24451 const { textAlign, content, level } = attributes3; 24452 const TagName2 = "h" + level; 24453 const className = clsx_default({ 24454 [`has-text-align-$textAlign}`]: textAlign 24455 }); 24456 return /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(TagName2, { ...import_block_editor101.useBlockProps.save({ className }), children: /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(import_block_editor101.RichText.Content, { value: content }) }); 24457 } 24458 }; 24459 var deprecated9 = [v53, v43, v34, v26, v114]; 24460 var deprecated_default18 = deprecated9; 24461 24462 // packages/block-library/build-module/heading/edit.js 24463 var import_i18n80 = __toESM(require_i18n()); 24464 var import_element37 = __toESM(require_element()); 24465 var import_data39 = __toESM(require_data()); 24466 var import_block_editor102 = __toESM(require_block_editor()); 24467 24468 // packages/block-library/build-module/heading/autogenerate-anchors.js 24469 var import_remove_accents3 = __toESM(require_remove_accents()); 24470 var anchors = {}; 24471 var getTextWithoutMarkup = (text) => { 24472 const dummyElement = document.createElement("div"); 24473 dummyElement.innerHTML = text; 24474 return dummyElement.innerText; 24475 }; 24476 var getSlug = (content) => { 24477 return (0, import_remove_accents3.default)(getTextWithoutMarkup(content)).replace(/[^\p{L}\p{N}]+/gu, "-").toLowerCase().replace(/(^-+)|(-+$)/g, ""); 24478 }; 24479 var generateAnchor = (clientId, content) => { 24480 const slug = getSlug(content); 24481 if ("" === slug) { 24482 return null; 24483 } 24484 delete anchors[clientId]; 24485 let anchor = slug; 24486 let i2 = 0; 24487 while (Object.values(anchors).includes(anchor)) { 24488 i2 += 1; 24489 anchor = slug + "-" + i2; 24490 } 24491 return anchor; 24492 }; 24493 var setAnchor = (clientId, anchor) => { 24494 anchors[clientId] = anchor; 24495 }; 24496 24497 // packages/block-library/build-module/heading/edit.js 24498 var import_jsx_runtime253 = __toESM(require_jsx_runtime()); 24499 function HeadingEdit({ 24500 attributes: attributes3, 24501 setAttributes, 24502 mergeBlocks, 24503 onReplace, 24504 style: style2, 24505 clientId 24506 }) { 24507 const { textAlign, content, level, placeholder: placeholder2, anchor } = attributes3; 24508 const tagName = "h" + level; 24509 const blockProps = (0, import_block_editor102.useBlockProps)({ 24510 className: clsx_default({ 24511 [`has-text-align-$textAlign}`]: textAlign 24512 }), 24513 style: style2 24514 }); 24515 const blockEditingMode = (0, import_block_editor102.useBlockEditingMode)(); 24516 const { canGenerateAnchors } = (0, import_data39.useSelect)((select9) => { 24517 const { getGlobalBlockCount, getSettings: getSettings2 } = select9(import_block_editor102.store); 24518 const settings116 = getSettings2(); 24519 return { 24520 canGenerateAnchors: !!settings116.generateAnchors || getGlobalBlockCount("core/table-of-contents") > 0 24521 }; 24522 }, []); 24523 const { __unstableMarkNextChangeAsNotPersistent } = (0, import_data39.useDispatch)(import_block_editor102.store); 24524 (0, import_element37.useEffect)(() => { 24525 if (!canGenerateAnchors) { 24526 return; 24527 } 24528 if (!anchor && content) { 24529 __unstableMarkNextChangeAsNotPersistent(); 24530 setAttributes({ 24531 anchor: generateAnchor(clientId, content) 24532 }); 24533 } 24534 setAnchor(clientId, anchor); 24535 return () => setAnchor(clientId, null); 24536 }, [anchor, content, clientId, canGenerateAnchors]); 24537 const onContentChange = (value) => { 24538 const newAttrs = { content: value }; 24539 if (canGenerateAnchors && (!anchor || !value || generateAnchor(clientId, content) === anchor)) { 24540 newAttrs.anchor = generateAnchor(clientId, value); 24541 } 24542 setAttributes(newAttrs); 24543 }; 24544 return /* @__PURE__ */ (0, import_jsx_runtime253.jsxs)(import_jsx_runtime253.Fragment, { children: [ 24545 blockEditingMode === "default" && /* @__PURE__ */ (0, import_jsx_runtime253.jsx)(import_block_editor102.BlockControls, { group: "block", children: /* @__PURE__ */ (0, import_jsx_runtime253.jsx)( 24546 import_block_editor102.AlignmentControl, 24547 { 24548 value: textAlign, 24549 onChange: (nextAlign) => { 24550 setAttributes({ textAlign: nextAlign }); 24551 } 24552 } 24553 ) }), 24554 /* @__PURE__ */ (0, import_jsx_runtime253.jsx)( 24555 import_block_editor102.RichText, 24556 { 24557 identifier: "content", 24558 tagName, 24559 value: content, 24560 onChange: onContentChange, 24561 onMerge: mergeBlocks, 24562 onReplace, 24563 onRemove: () => onReplace([]), 24564 placeholder: placeholder2 || (0, import_i18n80.__)("Heading"), 24565 textAlign, 24566 ...import_element37.Platform.isNative && { deleteEnter: true }, 24567 ...blockProps 24568 } 24569 ) 24570 ] }); 24571 } 24572 var edit_default16 = HeadingEdit; 24573 24574 // packages/block-library/build-module/heading/block.json 24575 var block_default40 = { 24576 $schema: "https://schemas.wp.org/trunk/block.json", 24577 apiVersion: 3, 24578 name: "core/heading", 24579 title: "Heading", 24580 category: "text", 24581 description: "Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content.", 24582 keywords: ["title", "subtitle"], 24583 textdomain: "default", 24584 attributes: { 24585 textAlign: { 24586 type: "string" 24587 }, 24588 content: { 24589 type: "rich-text", 24590 source: "rich-text", 24591 selector: "h1,h2,h3,h4,h5,h6", 24592 role: "content" 24593 }, 24594 level: { 24595 type: "number", 24596 default: 2 24597 }, 24598 levelOptions: { 24599 type: "array" 24600 }, 24601 placeholder: { 24602 type: "string" 24603 } 24604 }, 24605 supports: { 24606 align: ["wide", "full"], 24607 anchor: true, 24608 className: true, 24609 splitting: true, 24610 __experimentalBorder: { 24611 color: true, 24612 radius: true, 24613 style: true, 24614 width: true 24615 }, 24616 color: { 24617 gradients: true, 24618 link: true, 24619 __experimentalDefaultControls: { 24620 background: true, 24621 text: true 24622 } 24623 }, 24624 spacing: { 24625 margin: true, 24626 padding: true, 24627 __experimentalDefaultControls: { 24628 margin: false, 24629 padding: false 24630 } 24631 }, 24632 typography: { 24633 fontSize: true, 24634 lineHeight: true, 24635 __experimentalFontFamily: true, 24636 __experimentalFontStyle: true, 24637 __experimentalFontWeight: true, 24638 __experimentalLetterSpacing: true, 24639 __experimentalTextTransform: true, 24640 __experimentalTextDecoration: true, 24641 __experimentalWritingMode: true, 24642 fitText: true, 24643 __experimentalDefaultControls: { 24644 fontSize: true 24645 } 24646 }, 24647 __unstablePasteTextInline: true, 24648 __experimentalSlashInserter: true, 24649 interactivity: { 24650 clientNavigation: true 24651 } 24652 }, 24653 editorStyle: "wp-block-heading-editor", 24654 style: "wp-block-heading" 24655 }; 24656 24657 // packages/block-library/build-module/heading/save.js 24658 var import_block_editor103 = __toESM(require_block_editor()); 24659 var import_jsx_runtime254 = __toESM(require_jsx_runtime()); 24660 function save23({ attributes: attributes3 }) { 24661 const { textAlign, content, level } = attributes3; 24662 const TagName2 = "h" + level; 24663 const className = clsx_default({ 24664 [`has-text-align-$textAlign}`]: textAlign 24665 }); 24666 return /* @__PURE__ */ (0, import_jsx_runtime254.jsx)(TagName2, { ...import_block_editor103.useBlockProps.save({ className }), children: /* @__PURE__ */ (0, import_jsx_runtime254.jsx)(import_block_editor103.RichText.Content, { value: content }) }); 24667 } 24668 24669 // packages/block-library/build-module/heading/transforms.js 24670 var import_blocks34 = __toESM(require_blocks()); 24671 24672 // packages/block-library/build-module/heading/shared.js 24673 function getLevelFromHeadingNodeName(nodeName) { 24674 return Number(nodeName.substr(1)); 24675 } 24676 24677 // packages/block-library/build-module/heading/transforms.js 24678 var transforms11 = { 24679 from: [ 24680 { 24681 type: "block", 24682 isMultiBlock: true, 24683 blocks: ["core/paragraph"], 24684 transform: (attributes3) => attributes3.map((_attributes) => { 24685 const { content, anchor, style: style2 } = _attributes; 24686 const textAlign = style2?.typography?.textAlign; 24687 return (0, import_blocks34.createBlock)("core/heading", { 24688 ...getTransformedAttributes( 24689 _attributes, 24690 "core/heading", 24691 ({ content: contentBinding }) => ({ 24692 content: contentBinding 24693 }) 24694 ), 24695 content, 24696 anchor, 24697 textAlign 24698 }); 24699 }) 24700 }, 24701 { 24702 type: "raw", 24703 selector: "h1,h2,h3,h4,h5,h6", 24704 schema: ({ phrasingContentSchema, isPaste }) => { 24705 const schema2 = { 24706 children: phrasingContentSchema, 24707 attributes: isPaste ? [] : ["style", "id"] 24708 }; 24709 return { 24710 h1: schema2, 24711 h2: schema2, 24712 h3: schema2, 24713 h4: schema2, 24714 h5: schema2, 24715 h6: schema2 24716 }; 24717 }, 24718 transform(node) { 24719 const attributes3 = (0, import_blocks34.getBlockAttributes)( 24720 "core/heading", 24721 node.outerHTML 24722 ); 24723 const { textAlign } = node.style || {}; 24724 attributes3.level = getLevelFromHeadingNodeName(node.nodeName); 24725 if (textAlign === "left" || textAlign === "center" || textAlign === "right") { 24726 attributes3.align = textAlign; 24727 } 24728 return (0, import_blocks34.createBlock)("core/heading", attributes3); 24729 } 24730 }, 24731 ...[1, 2, 3, 4, 5, 6].map((level) => ({ 24732 type: "prefix", 24733 prefix: Array(level + 1).join("#"), 24734 transform(content) { 24735 return (0, import_blocks34.createBlock)("core/heading", { 24736 level, 24737 content 24738 }); 24739 } 24740 })), 24741 ...[1, 2, 3, 4, 5, 6].map((level) => ({ 24742 type: "enter", 24743 regExp: new RegExp(`^/(h|H)$level}$`), 24744 transform: () => (0, import_blocks34.createBlock)("core/heading", { level }) 24745 })) 24746 ], 24747 to: [ 24748 { 24749 type: "block", 24750 isMultiBlock: true, 24751 blocks: ["core/paragraph"], 24752 transform: (attributes3) => attributes3.map((_attributes) => { 24753 const { content, textAlign } = _attributes; 24754 return (0, import_blocks34.createBlock)("core/paragraph", { 24755 ...getTransformedAttributes( 24756 _attributes, 24757 "core/paragraph", 24758 ({ content: contentBinding }) => ({ 24759 content: contentBinding 24760 }) 24761 ), 24762 content, 24763 ...textAlign && { 24764 style: { 24765 typography: { 24766 textAlign 24767 } 24768 } 24769 } 24770 }); 24771 }) 24772 } 24773 ] 24774 }; 24775 var transforms_default12 = transforms11; 24776 24777 // packages/block-library/build-module/heading/variations.js 24778 var import_i18n81 = __toESM(require_i18n()); 24779 var LEVEL_ICONS = [ 24780 heading_level_1_default, 24781 heading_level_2_default, 24782 heading_level_3_default, 24783 heading_level_4_default, 24784 heading_level_5_default, 24785 heading_level_6_default 24786 ]; 24787 var variations9 = [ 24788 ...[1, 2, 3, 4, 5, 6].map((level) => ({ 24789 name: `h$level}`, 24790 title: (0, import_i18n81.sprintf)( 24791 /* translators: %d: heading level e.g: "1", "2", "3" */ 24792 (0, import_i18n81.__)("Heading %d"), 24793 level 24794 ), 24795 description: (0, import_i18n81.__)( 24796 "Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content." 24797 ), 24798 icon: LEVEL_ICONS[level - 1], 24799 attributes: { level }, 24800 scope: ["block", "transform"], 24801 keywords: [`h$level}`], 24802 isActive: (blockAttributes8) => blockAttributes8.level === level 24803 })) 24804 ]; 24805 var variations_default9 = variations9; 24806 24807 // packages/block-library/build-module/heading/index.js 24808 var { fieldsKey: fieldsKey7, formKey: formKey7 } = unlock(import_blocks35.privateApis); 24809 var { name: name40 } = block_default40; 24810 var settings40 = { 24811 icon: heading_default, 24812 example: { 24813 attributes: { 24814 content: (0, import_i18n82.__)("Code is Poetry"), 24815 level: 2, 24816 textAlign: "center" 24817 } 24818 }, 24819 __experimentalLabel(attributes3, { context }) { 24820 const { content, level } = attributes3; 24821 const customName = attributes3?.metadata?.name; 24822 const hasContent = content?.trim().length > 0; 24823 if (context === "list-view" && (customName || hasContent)) { 24824 return customName || content; 24825 } 24826 if (context === "accessibility") { 24827 return !hasContent ? (0, import_i18n82.sprintf)( 24828 /* translators: accessibility text. %s: heading level. */ 24829 (0, import_i18n82.__)("Level %s. Empty."), 24830 level 24831 ) : (0, import_i18n82.sprintf)( 24832 /* translators: accessibility text. 1: heading level. 2: heading content. */ 24833 (0, import_i18n82.__)("Level %1$s. %2$s"), 24834 level, 24835 content 24836 ); 24837 } 24838 }, 24839 transforms: transforms_default12, 24840 deprecated: deprecated_default18, 24841 merge(attributes3, attributesToMerge) { 24842 return { 24843 content: (attributes3.content || "") + (attributesToMerge.content || "") 24844 }; 24845 }, 24846 edit: edit_default16, 24847 save: save23, 24848 variations: variations_default9 24849 }; 24850 if (window.__experimentalContentOnlyInspectorFields) { 24851 settings40[fieldsKey7] = [ 24852 { 24853 id: "content", 24854 label: (0, import_i18n82.__)("Content"), 24855 type: "richtext" 24856 } 24857 ]; 24858 settings40[formKey7] = { 24859 fields: ["content"] 24860 }; 24861 } 24862 var init40 = () => { 24863 const block = initBlock({ name: name40, metadata: block_default40, settings: settings40 }); 24864 const levelOptions = (0, import_blocks35.getBlockType)(name40)?.attributes?.levelOptions?.default; 24865 if (levelOptions) { 24866 [1, 2, 3, 4, 5, 6].forEach((level) => { 24867 if (!levelOptions.includes(level)) { 24868 (0, import_blocks35.unregisterBlockVariation)(name40, `h$level}`); 24869 } 24870 }); 24871 } 24872 return block; 24873 }; 24874 24875 // packages/block-library/build-module/home-link/index.js 24876 var home_link_exports = {}; 24877 __export(home_link_exports, { 24878 init: () => init41, 24879 metadata: () => block_default41, 24880 name: () => name41, 24881 settings: () => settings41 24882 }); 24883 var import_i18n84 = __toESM(require_i18n()); 24884 24885 // packages/block-library/build-module/home-link/block.json 24886 var block_default41 = { 24887 $schema: "https://schemas.wp.org/trunk/block.json", 24888 apiVersion: 3, 24889 name: "core/home-link", 24890 category: "design", 24891 parent: ["core/navigation"], 24892 title: "Home Link", 24893 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.", 24894 textdomain: "default", 24895 attributes: { 24896 label: { 24897 type: "string", 24898 role: "content" 24899 } 24900 }, 24901 usesContext: [ 24902 "textColor", 24903 "customTextColor", 24904 "backgroundColor", 24905 "customBackgroundColor", 24906 "fontSize", 24907 "customFontSize", 24908 "style" 24909 ], 24910 supports: { 24911 reusable: false, 24912 html: false, 24913 typography: { 24914 fontSize: true, 24915 lineHeight: true, 24916 __experimentalFontFamily: true, 24917 __experimentalFontWeight: true, 24918 __experimentalFontStyle: true, 24919 __experimentalTextTransform: true, 24920 __experimentalTextDecoration: true, 24921 __experimentalLetterSpacing: true, 24922 __experimentalDefaultControls: { 24923 fontSize: true 24924 } 24925 }, 24926 interactivity: { 24927 clientNavigation: true 24928 } 24929 }, 24930 editorStyle: "wp-block-home-link-editor", 24931 style: "wp-block-home-link" 24932 }; 24933 24934 // packages/block-library/build-module/home-link/edit.js 24935 var import_block_editor104 = __toESM(require_block_editor()); 24936 var import_i18n83 = __toESM(require_i18n()); 24937 var import_data40 = __toESM(require_data()); 24938 var import_core_data21 = __toESM(require_core_data()); 24939 var import_jsx_runtime255 = __toESM(require_jsx_runtime()); 24940 var preventDefault = (event) => event.preventDefault(); 24941 function HomeEdit({ attributes: attributes3, setAttributes, context }) { 24942 const homeUrl = (0, import_data40.useSelect)((select9) => { 24943 return select9(import_core_data21.store).getEntityRecord("root", "__unstableBase")?.home; 24944 }, []); 24945 const { textColor, backgroundColor, style: style2 } = context; 24946 const blockProps = (0, import_block_editor104.useBlockProps)({ 24947 className: clsx_default("wp-block-navigation-item", { 24948 "has-text-color": !!textColor || !!style2?.color?.text, 24949 [`has-$textColor}-color`]: !!textColor, 24950 "has-background": !!backgroundColor || !!style2?.color?.background, 24951 [`has-$backgroundColor}-background-color`]: !!backgroundColor 24952 }), 24953 style: { 24954 color: style2?.color?.text, 24955 backgroundColor: style2?.color?.background 24956 } 24957 }); 24958 return /* @__PURE__ */ (0, import_jsx_runtime255.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime255.jsx)( 24959 "a", 24960 { 24961 className: "wp-block-home-link__content wp-block-navigation-item__content", 24962 href: homeUrl, 24963 onClick: preventDefault, 24964 children: /* @__PURE__ */ (0, import_jsx_runtime255.jsx)( 24965 import_block_editor104.RichText, 24966 { 24967 identifier: "label", 24968 className: "wp-block-home-link__label", 24969 value: attributes3.label ?? (0, import_i18n83.__)("Home"), 24970 onChange: (labelValue) => { 24971 setAttributes({ label: labelValue }); 24972 }, 24973 "aria-label": (0, import_i18n83.__)("Home link text"), 24974 placeholder: (0, import_i18n83.__)("Add home link"), 24975 withoutInteractiveFormatting: true 24976 } 24977 ) 24978 } 24979 ) }); 24980 } 24981 24982 // packages/block-library/build-module/home-link/save.js 24983 var import_block_editor105 = __toESM(require_block_editor()); 24984 var import_jsx_runtime256 = __toESM(require_jsx_runtime()); 24985 function save24() { 24986 return /* @__PURE__ */ (0, import_jsx_runtime256.jsx)(import_block_editor105.InnerBlocks.Content, {}); 24987 } 24988 24989 // packages/block-library/build-module/home-link/index.js 24990 var { name: name41 } = block_default41; 24991 var settings41 = { 24992 icon: home_default, 24993 edit: HomeEdit, 24994 save: save24, 24995 example: { 24996 attributes: { 24997 label: (0, import_i18n84._x)("Home Link", "block example") 24998 } 24999 } 25000 }; 25001 var init41 = () => initBlock({ name: name41, metadata: block_default41, settings: settings41 }); 25002 25003 // packages/block-library/build-module/html/index.js 25004 var html_exports = {}; 25005 __export(html_exports, { 25006 init: () => init42, 25007 metadata: () => block_default42, 25008 name: () => name42, 25009 settings: () => settings42 25010 }); 25011 var import_i18n88 = __toESM(require_i18n()); 25012 25013 // packages/block-library/build-module/html/edit.js 25014 var import_i18n87 = __toESM(require_i18n()); 25015 var import_element40 = __toESM(require_element()); 25016 var import_block_editor108 = __toESM(require_block_editor()); 25017 var import_components49 = __toESM(require_components()); 25018 25019 // packages/block-library/build-module/html/preview.js 25020 var import_element38 = __toESM(require_element()); 25021 var import_block_editor106 = __toESM(require_block_editor()); 25022 var import_components47 = __toESM(require_components()); 25023 var import_data41 = __toESM(require_data()); 25024 var import_i18n85 = __toESM(require_i18n()); 25025 var import_jsx_runtime257 = __toESM(require_jsx_runtime()); 25026 var DEFAULT_STYLES = ` 25027 html,body,:root { 25028 margin: 0 !important; 25029 padding: 0 !important; 25030 overflow: visible !important; 25031 min-height: auto !important; 25032 } 25033 `; 25034 function HTMLEditPreview({ content, isSelected }) { 25035 const settingStyles = (0, import_data41.useSelect)( 25036 (select9) => select9(import_block_editor106.store).getSettings().styles, 25037 [] 25038 ); 25039 const styles = (0, import_element38.useMemo)( 25040 () => [ 25041 DEFAULT_STYLES, 25042 ...(0, import_block_editor106.transformStyles)( 25043 (settingStyles ?? []).filter((style2) => style2.css) 25044 ) 25045 ], 25046 [settingStyles] 25047 ); 25048 return /* @__PURE__ */ (0, import_jsx_runtime257.jsxs)(import_jsx_runtime257.Fragment, { children: [ 25049 /* @__PURE__ */ (0, import_jsx_runtime257.jsx)( 25050 import_components47.SandBox, 25051 { 25052 html: content, 25053 styles, 25054 title: (0, import_i18n85.__)("Custom HTML Preview"), 25055 tabIndex: -1 25056 } 25057 ), 25058 !isSelected && /* @__PURE__ */ (0, import_jsx_runtime257.jsx)("div", { className: "block-library-html__preview-overlay" }) 25059 ] }); 25060 } 25061 25062 // packages/block-library/build-module/html/modal.js 25063 var import_i18n86 = __toESM(require_i18n()); 25064 var import_element39 = __toESM(require_element()); 25065 var import_data42 = __toESM(require_data()); 25066 var import_components48 = __toESM(require_components()); 25067 var import_block_editor107 = __toESM(require_block_editor()); 25068 25069 // packages/block-library/build-module/html/utils.js 25070 function parseContent(content = "") { 25071 if (!content || !content.trim()) { 25072 return { html: "", css: "", js: "" }; 25073 } 25074 const doc = document.implementation.createHTMLDocument(""); 25075 doc.body.innerHTML = content; 25076 const styleTag = doc.body.querySelector( 25077 'style[data-wp-block-html="css"]' 25078 ); 25079 const css = styleTag ? styleTag.textContent.trim() : ""; 25080 if (styleTag) { 25081 styleTag.remove(); 25082 } 25083 const scriptTag = doc.body.querySelector( 25084 'script[data-wp-block-html="js"]' 25085 ); 25086 const js = scriptTag ? scriptTag.textContent.trim() : ""; 25087 if (scriptTag) { 25088 scriptTag.remove(); 25089 } 25090 const html = doc.body.innerHTML.trim(); 25091 return { html, css, js }; 25092 } 25093 function serializeContent({ html = "", css = "", js = "" }) { 25094 const parts = []; 25095 if (css.trim()) { 25096 parts.push(`<style data-wp-block-html="css"> 25097 $css} 25098 </style>`); 25099 } 25100 if (js.trim()) { 25101 parts.push(`<script data-wp-block-html="js"> 25102 $js} 25103 <\/script>`); 25104 } 25105 if (html.trim()) { 25106 parts.push(html); 25107 } 25108 return parts.join("\n\n"); 25109 } 25110 25111 // packages/block-library/build-module/html/modal.js 25112 var import_jsx_runtime258 = __toESM(require_jsx_runtime()); 25113 var { Tabs } = unlock(import_components48.privateApis); 25114 function HTMLEditModal({ 25115 isOpen, 25116 onRequestClose, 25117 content, 25118 setAttributes 25119 }) { 25120 const { html, css, js } = parseContent(content); 25121 const [editedHtml, setEditedHtml] = (0, import_element39.useState)(html); 25122 const [editedCss, setEditedCss] = (0, import_element39.useState)(css); 25123 const [editedJs, setEditedJs] = (0, import_element39.useState)(js); 25124 const [isDirty, setIsDirty] = (0, import_element39.useState)(false); 25125 const [showUnsavedWarning, setShowUnsavedWarning] = (0, import_element39.useState)(false); 25126 const [isFullscreen, setIsFullscreen] = (0, import_element39.useState)(false); 25127 const { canUserUseUnfilteredHTML } = (0, import_data42.useSelect)((select9) => { 25128 const settings116 = select9(import_block_editor107.store).getSettings(); 25129 return { 25130 canUserUseUnfilteredHTML: settings116.__experimentalCanUserUseUnfilteredHTML 25131 }; 25132 }, []); 25133 const hasRestrictedContent = !canUserUseUnfilteredHTML && (css.trim() || js.trim()); 25134 if (!isOpen) { 25135 return null; 25136 } 25137 const handleHtmlChange = (value) => { 25138 setEditedHtml(value); 25139 setIsDirty(true); 25140 }; 25141 const handleCssChange = (value) => { 25142 setEditedCss(value); 25143 setIsDirty(true); 25144 }; 25145 const handleJsChange = (value) => { 25146 setEditedJs(value); 25147 setIsDirty(true); 25148 }; 25149 const handleUpdate = () => { 25150 setAttributes({ 25151 content: serializeContent({ 25152 html: editedHtml, 25153 css: canUserUseUnfilteredHTML ? editedCss : "", 25154 js: canUserUseUnfilteredHTML ? editedJs : "" 25155 }) 25156 }); 25157 setIsDirty(false); 25158 }; 25159 const handleCancel = () => { 25160 setIsDirty(false); 25161 onRequestClose(); 25162 }; 25163 const handleRequestClose = () => { 25164 if (isDirty) { 25165 setShowUnsavedWarning(true); 25166 } else { 25167 onRequestClose(); 25168 } 25169 }; 25170 const handleDiscardChanges = () => { 25171 setShowUnsavedWarning(false); 25172 onRequestClose(); 25173 }; 25174 const handleContinueEditing = () => { 25175 setShowUnsavedWarning(false); 25176 }; 25177 const handleUpdateAndClose = () => { 25178 handleUpdate(); 25179 onRequestClose(); 25180 }; 25181 const toggleFullscreen = () => { 25182 setIsFullscreen((prevState) => !prevState); 25183 }; 25184 return /* @__PURE__ */ (0, import_jsx_runtime258.jsxs)(import_jsx_runtime258.Fragment, { children: [ 25185 /* @__PURE__ */ (0, import_jsx_runtime258.jsx)( 25186 import_components48.Modal, 25187 { 25188 title: (0, import_i18n86.__)("Edit HTML"), 25189 onRequestClose: handleRequestClose, 25190 className: "block-library-html__modal", 25191 size: "large", 25192 isDismissible: false, 25193 shouldCloseOnClickOutside: !isDirty, 25194 shouldCloseOnEsc: !isDirty, 25195 isFullScreen: isFullscreen, 25196 __experimentalHideHeader: true, 25197 children: /* @__PURE__ */ (0, import_jsx_runtime258.jsx)(Tabs, { orientation: "horizontal", defaultTabId: "html", children: /* @__PURE__ */ (0, import_jsx_runtime258.jsxs)( 25198 import_components48.__experimentalGrid, 25199 { 25200 columns: 1, 25201 templateRows: "auto 1fr auto", 25202 gap: 4, 25203 style: { height: "100%" }, 25204 children: [ 25205 /* @__PURE__ */ (0, import_jsx_runtime258.jsxs)( 25206 import_components48.__experimentalHStack, 25207 { 25208 justify: "space-between", 25209 className: "block-library-html__modal-header", 25210 children: [ 25211 /* @__PURE__ */ (0, import_jsx_runtime258.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime258.jsxs)(Tabs.TabList, { children: [ 25212 /* @__PURE__ */ (0, import_jsx_runtime258.jsx)(Tabs.Tab, { tabId: "html", children: "HTML" }), 25213 canUserUseUnfilteredHTML && /* @__PURE__ */ (0, import_jsx_runtime258.jsx)(Tabs.Tab, { tabId: "css", children: "CSS" }), 25214 canUserUseUnfilteredHTML && /* @__PURE__ */ (0, import_jsx_runtime258.jsx)(Tabs.Tab, { tabId: "js", children: (0, import_i18n86.__)("JavaScript") }) 25215 ] }) }), 25216 /* @__PURE__ */ (0, import_jsx_runtime258.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime258.jsx)( 25217 import_components48.Button, 25218 { 25219 __next40pxDefaultSize: true, 25220 icon: isFullscreen ? square_default : fullscreen_default, 25221 label: (0, import_i18n86.__)("Enable/disable fullscreen"), 25222 onClick: toggleFullscreen, 25223 variant: "tertiary" 25224 } 25225 ) }) 25226 ] 25227 } 25228 ), 25229 hasRestrictedContent && /* @__PURE__ */ (0, import_jsx_runtime258.jsx)( 25230 import_components48.Notice, 25231 { 25232 status: "warning", 25233 isDismissible: false, 25234 className: "block-library-html__modal-notice", 25235 children: (0, import_i18n86.__)( 25236 "This block contains CSS or JavaScript that will be removed when you save because you do not have permission to use unfiltered HTML." 25237 ) 25238 } 25239 ), 25240 /* @__PURE__ */ (0, import_jsx_runtime258.jsxs)( 25241 import_components48.__experimentalHStack, 25242 { 25243 alignment: "stretch", 25244 justify: "flex-start", 25245 spacing: 4, 25246 className: "block-library-html__modal-tabs", 25247 children: [ 25248 /* @__PURE__ */ (0, import_jsx_runtime258.jsxs)("div", { className: "block-library-html__modal-content", children: [ 25249 /* @__PURE__ */ (0, import_jsx_runtime258.jsx)( 25250 Tabs.TabPanel, 25251 { 25252 tabId: "html", 25253 focusable: false, 25254 className: "block-library-html__modal-tab", 25255 children: /* @__PURE__ */ (0, import_jsx_runtime258.jsx)( 25256 import_block_editor107.PlainText, 25257 { 25258 value: editedHtml, 25259 onChange: handleHtmlChange, 25260 placeholder: (0, import_i18n86.__)("Write HTML\u2026"), 25261 "aria-label": (0, import_i18n86.__)("HTML"), 25262 className: "block-library-html__modal-editor" 25263 } 25264 ) 25265 } 25266 ), 25267 canUserUseUnfilteredHTML && /* @__PURE__ */ (0, import_jsx_runtime258.jsx)( 25268 Tabs.TabPanel, 25269 { 25270 tabId: "css", 25271 focusable: false, 25272 className: "block-library-html__modal-tab", 25273 children: /* @__PURE__ */ (0, import_jsx_runtime258.jsx)( 25274 import_block_editor107.PlainText, 25275 { 25276 value: editedCss, 25277 onChange: handleCssChange, 25278 placeholder: (0, import_i18n86.__)("Write CSS\u2026"), 25279 "aria-label": (0, import_i18n86.__)("CSS"), 25280 className: "block-library-html__modal-editor" 25281 } 25282 ) 25283 } 25284 ), 25285 canUserUseUnfilteredHTML && /* @__PURE__ */ (0, import_jsx_runtime258.jsx)( 25286 Tabs.TabPanel, 25287 { 25288 tabId: "js", 25289 focusable: false, 25290 className: "block-library-html__modal-tab", 25291 children: /* @__PURE__ */ (0, import_jsx_runtime258.jsx)( 25292 import_block_editor107.PlainText, 25293 { 25294 value: editedJs, 25295 onChange: handleJsChange, 25296 placeholder: (0, import_i18n86.__)( 25297 "Write JavaScript\u2026" 25298 ), 25299 "aria-label": (0, import_i18n86.__)("JavaScript"), 25300 className: "block-library-html__modal-editor" 25301 } 25302 ) 25303 } 25304 ) 25305 ] }), 25306 /* @__PURE__ */ (0, import_jsx_runtime258.jsx)("div", { className: "block-library-html__preview", children: /* @__PURE__ */ (0, import_jsx_runtime258.jsx)( 25307 HTMLEditPreview, 25308 { 25309 content: serializeContent({ 25310 html: editedHtml, 25311 css: editedCss, 25312 js: editedJs 25313 }) 25314 } 25315 ) }) 25316 ] 25317 } 25318 ), 25319 /* @__PURE__ */ (0, import_jsx_runtime258.jsxs)( 25320 import_components48.__experimentalHStack, 25321 { 25322 alignment: "center", 25323 justify: "flex-end", 25324 spacing: 4, 25325 className: "block-library-html__modal-footer", 25326 children: [ 25327 /* @__PURE__ */ (0, import_jsx_runtime258.jsx)( 25328 import_components48.Button, 25329 { 25330 __next40pxDefaultSize: true, 25331 variant: "tertiary", 25332 onClick: handleCancel, 25333 children: (0, import_i18n86.__)("Cancel") 25334 } 25335 ), 25336 /* @__PURE__ */ (0, import_jsx_runtime258.jsx)( 25337 import_components48.Button, 25338 { 25339 __next40pxDefaultSize: true, 25340 variant: "primary", 25341 onClick: handleUpdateAndClose, 25342 children: (0, import_i18n86.__)("Update") 25343 } 25344 ) 25345 ] 25346 } 25347 ) 25348 ] 25349 } 25350 ) }) 25351 } 25352 ), 25353 showUnsavedWarning && /* @__PURE__ */ (0, import_jsx_runtime258.jsxs)( 25354 import_components48.Modal, 25355 { 25356 title: (0, import_i18n86.__)("Unsaved changes"), 25357 onRequestClose: handleContinueEditing, 25358 size: "medium", 25359 children: [ 25360 /* @__PURE__ */ (0, import_jsx_runtime258.jsx)("p", { children: (0, import_i18n86.__)( 25361 "You have unsaved changes. What would you like to do?" 25362 ) }), 25363 /* @__PURE__ */ (0, import_jsx_runtime258.jsxs)(import_components48.Flex, { direction: "row", justify: "flex-end", gap: 2, children: [ 25364 /* @__PURE__ */ (0, import_jsx_runtime258.jsx)( 25365 import_components48.Button, 25366 { 25367 __next40pxDefaultSize: true, 25368 variant: "secondary", 25369 onClick: handleDiscardChanges, 25370 children: (0, import_i18n86.__)("Discard unsaved changes") 25371 } 25372 ), 25373 /* @__PURE__ */ (0, import_jsx_runtime258.jsx)( 25374 import_components48.Button, 25375 { 25376 __next40pxDefaultSize: true, 25377 variant: "secondary", 25378 onClick: handleContinueEditing, 25379 children: (0, import_i18n86.__)("Continue editing") 25380 } 25381 ), 25382 /* @__PURE__ */ (0, import_jsx_runtime258.jsx)( 25383 import_components48.Button, 25384 { 25385 __next40pxDefaultSize: true, 25386 variant: "primary", 25387 onClick: handleUpdateAndClose, 25388 children: (0, import_i18n86.__)("Update and close") 25389 } 25390 ) 25391 ] }) 25392 ] 25393 } 25394 ) 25395 ] }); 25396 } 25397 25398 // packages/block-library/build-module/html/edit.js 25399 var import_jsx_runtime259 = __toESM(require_jsx_runtime()); 25400 function HTMLEdit({ attributes: attributes3, setAttributes, isSelected }) { 25401 const [isModalOpen, setIsModalOpen] = (0, import_element40.useState)(false); 25402 const blockProps = (0, import_block_editor108.useBlockProps)({ 25403 className: "block-library-html__edit" 25404 }); 25405 if (!attributes3.content?.trim()) { 25406 return /* @__PURE__ */ (0, import_jsx_runtime259.jsxs)("div", { ...blockProps, children: [ 25407 /* @__PURE__ */ (0, import_jsx_runtime259.jsx)( 25408 import_components49.Placeholder, 25409 { 25410 icon: /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(import_block_editor108.BlockIcon, { icon: code_default }), 25411 label: (0, import_i18n87.__)("Custom HTML"), 25412 instructions: (0, import_i18n87.__)( 25413 "Add custom HTML code and preview how it looks." 25414 ), 25415 children: /* @__PURE__ */ (0, import_jsx_runtime259.jsx)( 25416 import_components49.Button, 25417 { 25418 __next40pxDefaultSize: true, 25419 variant: "primary", 25420 onClick: () => setIsModalOpen(true), 25421 children: (0, import_i18n87.__)("Edit HTML") 25422 } 25423 ) 25424 } 25425 ), 25426 /* @__PURE__ */ (0, import_jsx_runtime259.jsx)( 25427 HTMLEditModal, 25428 { 25429 isOpen: isModalOpen, 25430 onRequestClose: () => setIsModalOpen(false), 25431 content: attributes3.content, 25432 setAttributes 25433 } 25434 ) 25435 ] }); 25436 } 25437 return /* @__PURE__ */ (0, import_jsx_runtime259.jsxs)("div", { ...blockProps, children: [ 25438 /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(import_block_editor108.BlockControls, { children: /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(import_components49.ToolbarGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(import_components49.ToolbarButton, { onClick: () => setIsModalOpen(true), children: (0, import_i18n87.__)("Edit code") }) }) }), 25439 /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(import_block_editor108.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime259.jsx)( 25440 import_components49.__experimentalVStack, 25441 { 25442 className: "block-editor-block-inspector-edit-contents", 25443 expanded: true, 25444 children: /* @__PURE__ */ (0, import_jsx_runtime259.jsx)( 25445 import_components49.Button, 25446 { 25447 className: "block-editor-block-inspector-edit-contents__button", 25448 __next40pxDefaultSize: true, 25449 variant: "secondary", 25450 onClick: () => setIsModalOpen(true), 25451 children: (0, import_i18n87.__)("Edit code") 25452 } 25453 ) 25454 } 25455 ) }), 25456 /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(HTMLEditPreview, { content: attributes3.content, isSelected }), 25457 /* @__PURE__ */ (0, import_jsx_runtime259.jsx)( 25458 HTMLEditModal, 25459 { 25460 isOpen: isModalOpen, 25461 onRequestClose: () => setIsModalOpen(false), 25462 content: attributes3.content, 25463 setAttributes 25464 } 25465 ) 25466 ] }); 25467 } 25468 25469 // packages/block-library/build-module/html/block.json 25470 var block_default42 = { 25471 $schema: "https://schemas.wp.org/trunk/block.json", 25472 apiVersion: 3, 25473 name: "core/html", 25474 title: "Custom HTML", 25475 category: "widgets", 25476 description: "Add custom HTML code and preview it as you edit.", 25477 keywords: ["embed"], 25478 textdomain: "default", 25479 attributes: { 25480 content: { 25481 type: "string", 25482 source: "raw", 25483 role: "content" 25484 } 25485 }, 25486 supports: { 25487 customClassName: false, 25488 className: false, 25489 html: false, 25490 interactivity: { 25491 clientNavigation: true 25492 } 25493 }, 25494 editorStyle: "wp-block-html-editor" 25495 }; 25496 25497 // packages/block-library/build-module/html/save.js 25498 var import_element41 = __toESM(require_element()); 25499 var import_jsx_runtime260 = __toESM(require_jsx_runtime()); 25500 function save25({ attributes: attributes3 }) { 25501 return /* @__PURE__ */ (0, import_jsx_runtime260.jsx)(import_element41.RawHTML, { children: attributes3.content }); 25502 } 25503 25504 // packages/block-library/build-module/html/transforms.js 25505 var import_blocks36 = __toESM(require_blocks()); 25506 var import_rich_text3 = __toESM(require_rich_text()); 25507 var transforms12 = { 25508 from: [ 25509 { 25510 type: "block", 25511 blocks: ["core/code"], 25512 transform: ({ content: html }) => { 25513 return (0, import_blocks36.createBlock)("core/html", { 25514 // The code block may output HTML formatting, so convert it 25515 // to plain text. 25516 content: (0, import_rich_text3.create)({ html }).text 25517 }); 25518 } 25519 } 25520 ] 25521 }; 25522 var transforms_default13 = transforms12; 25523 25524 // packages/block-library/build-module/html/index.js 25525 var { name: name42 } = block_default42; 25526 var settings42 = { 25527 icon: html_default, 25528 example: { 25529 attributes: { 25530 content: "<marquee>" + (0, import_i18n88.__)("Welcome to the wonderful world of blocks\u2026") + "</marquee>" 25531 } 25532 }, 25533 edit: HTMLEdit, 25534 save: save25, 25535 transforms: transforms_default13 25536 }; 25537 var init42 = () => initBlock({ name: name42, metadata: block_default42, settings: settings42 }); 25538 25539 // packages/block-library/build-module/image/index.js 25540 var image_exports = {}; 25541 __export(image_exports, { 25542 init: () => init43, 25543 metadata: () => block_default43, 25544 name: () => name43, 25545 settings: () => settings43 25546 }); 25547 var import_i18n91 = __toESM(require_i18n()); 25548 var import_blocks40 = __toESM(require_blocks()); 25549 25550 // packages/block-library/build-module/image/deprecated.js 25551 var import_block_editor109 = __toESM(require_block_editor()); 25552 var import_jsx_runtime261 = __toESM(require_jsx_runtime()); 25553 var v115 = { 25554 attributes: { 25555 url: { 25556 type: "string", 25557 source: "attribute", 25558 selector: "img", 25559 attribute: "src" 25560 }, 25561 alt: { 25562 type: "string", 25563 source: "attribute", 25564 selector: "img", 25565 attribute: "alt", 25566 default: "" 25567 }, 25568 caption: { 25569 type: "array", 25570 source: "children", 25571 selector: "figcaption" 25572 }, 25573 href: { 25574 type: "string", 25575 source: "attribute", 25576 selector: "a", 25577 attribute: "href" 25578 }, 25579 id: { 25580 type: "number" 25581 }, 25582 align: { 25583 type: "string" 25584 }, 25585 width: { 25586 type: "number" 25587 }, 25588 height: { 25589 type: "number" 25590 } 25591 }, 25592 save({ attributes: attributes3 }) { 25593 const { url, alt, caption, align, href, width, height } = attributes3; 25594 const extraImageProps = width || height ? { width, height } : {}; 25595 const image = /* @__PURE__ */ (0, import_jsx_runtime261.jsx)("img", { src: url, alt, ...extraImageProps }); 25596 let figureStyle = {}; 25597 if (width) { 25598 figureStyle = { width }; 25599 } else if (align === "left" || align === "right") { 25600 figureStyle = { maxWidth: "50%" }; 25601 } 25602 return /* @__PURE__ */ (0, import_jsx_runtime261.jsxs)( 25603 "figure", 25604 { 25605 className: align ? `align$align}` : null, 25606 style: figureStyle, 25607 children: [ 25608 href ? /* @__PURE__ */ (0, import_jsx_runtime261.jsx)("a", { href, children: image }) : image, 25609 !import_block_editor109.RichText.isEmpty(caption) && /* @__PURE__ */ (0, import_jsx_runtime261.jsx)(import_block_editor109.RichText.Content, { tagName: "figcaption", value: caption }) 25610 ] 25611 } 25612 ); 25613 } 25614 }; 25615 var v27 = { 25616 attributes: { 25617 url: { 25618 type: "string", 25619 source: "attribute", 25620 selector: "img", 25621 attribute: "src" 25622 }, 25623 alt: { 25624 type: "string", 25625 source: "attribute", 25626 selector: "img", 25627 attribute: "alt", 25628 default: "" 25629 }, 25630 caption: { 25631 type: "array", 25632 source: "children", 25633 selector: "figcaption" 25634 }, 25635 href: { 25636 type: "string", 25637 source: "attribute", 25638 selector: "a", 25639 attribute: "href" 25640 }, 25641 id: { 25642 type: "number" 25643 }, 25644 align: { 25645 type: "string" 25646 }, 25647 width: { 25648 type: "number" 25649 }, 25650 height: { 25651 type: "number" 25652 } 25653 }, 25654 save({ attributes: attributes3 }) { 25655 const { url, alt, caption, align, href, width, height, id } = attributes3; 25656 const image = /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 25657 "img", 25658 { 25659 src: url, 25660 alt, 25661 className: id ? `wp-image-$id}` : null, 25662 width, 25663 height 25664 } 25665 ); 25666 return /* @__PURE__ */ (0, import_jsx_runtime261.jsxs)("figure", { className: align ? `align$align}` : null, children: [ 25667 href ? /* @__PURE__ */ (0, import_jsx_runtime261.jsx)("a", { href, children: image }) : image, 25668 !import_block_editor109.RichText.isEmpty(caption) && /* @__PURE__ */ (0, import_jsx_runtime261.jsx)(import_block_editor109.RichText.Content, { tagName: "figcaption", value: caption }) 25669 ] }); 25670 } 25671 }; 25672 var v35 = { 25673 attributes: { 25674 url: { 25675 type: "string", 25676 source: "attribute", 25677 selector: "img", 25678 attribute: "src" 25679 }, 25680 alt: { 25681 type: "string", 25682 source: "attribute", 25683 selector: "img", 25684 attribute: "alt", 25685 default: "" 25686 }, 25687 caption: { 25688 type: "array", 25689 source: "children", 25690 selector: "figcaption" 25691 }, 25692 href: { 25693 type: "string", 25694 source: "attribute", 25695 selector: "figure > a", 25696 attribute: "href" 25697 }, 25698 id: { 25699 type: "number" 25700 }, 25701 align: { 25702 type: "string" 25703 }, 25704 width: { 25705 type: "number" 25706 }, 25707 height: { 25708 type: "number" 25709 }, 25710 linkDestination: { 25711 type: "string", 25712 default: "none" 25713 } 25714 }, 25715 save({ attributes: attributes3 }) { 25716 const { url, alt, caption, align, href, width, height, id } = attributes3; 25717 const classes = clsx_default({ 25718 [`align$align}`]: align, 25719 "is-resized": width || height 25720 }); 25721 const image = /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 25722 "img", 25723 { 25724 src: url, 25725 alt, 25726 className: id ? `wp-image-$id}` : null, 25727 width, 25728 height 25729 } 25730 ); 25731 return /* @__PURE__ */ (0, import_jsx_runtime261.jsxs)("figure", { className: classes, children: [ 25732 href ? /* @__PURE__ */ (0, import_jsx_runtime261.jsx)("a", { href, children: image }) : image, 25733 !import_block_editor109.RichText.isEmpty(caption) && /* @__PURE__ */ (0, import_jsx_runtime261.jsx)(import_block_editor109.RichText.Content, { tagName: "figcaption", value: caption }) 25734 ] }); 25735 } 25736 }; 25737 var v44 = { 25738 attributes: { 25739 align: { 25740 type: "string" 25741 }, 25742 url: { 25743 type: "string", 25744 source: "attribute", 25745 selector: "img", 25746 attribute: "src" 25747 }, 25748 alt: { 25749 type: "string", 25750 source: "attribute", 25751 selector: "img", 25752 attribute: "alt", 25753 default: "" 25754 }, 25755 caption: { 25756 type: "string", 25757 source: "html", 25758 selector: "figcaption" 25759 }, 25760 title: { 25761 type: "string", 25762 source: "attribute", 25763 selector: "img", 25764 attribute: "title" 25765 }, 25766 href: { 25767 type: "string", 25768 source: "attribute", 25769 selector: "figure > a", 25770 attribute: "href" 25771 }, 25772 rel: { 25773 type: "string", 25774 source: "attribute", 25775 selector: "figure > a", 25776 attribute: "rel" 25777 }, 25778 linkClass: { 25779 type: "string", 25780 source: "attribute", 25781 selector: "figure > a", 25782 attribute: "class" 25783 }, 25784 id: { 25785 type: "number" 25786 }, 25787 width: { 25788 type: "number" 25789 }, 25790 height: { 25791 type: "number" 25792 }, 25793 sizeSlug: { 25794 type: "string" 25795 }, 25796 linkDestination: { 25797 type: "string" 25798 }, 25799 linkTarget: { 25800 type: "string", 25801 source: "attribute", 25802 selector: "figure > a", 25803 attribute: "target" 25804 } 25805 }, 25806 supports: { 25807 anchor: true 25808 }, 25809 save({ attributes: attributes3 }) { 25810 const { 25811 url, 25812 alt, 25813 caption, 25814 align, 25815 href, 25816 rel, 25817 linkClass, 25818 width, 25819 height, 25820 id, 25821 linkTarget, 25822 sizeSlug, 25823 title 25824 } = attributes3; 25825 const newRel = !rel ? void 0 : rel; 25826 const classes = clsx_default({ 25827 [`align$align}`]: align, 25828 [`size-$sizeSlug}`]: sizeSlug, 25829 "is-resized": width || height 25830 }); 25831 const image = /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 25832 "img", 25833 { 25834 src: url, 25835 alt, 25836 className: id ? `wp-image-$id}` : null, 25837 width, 25838 height, 25839 title 25840 } 25841 ); 25842 const figure = /* @__PURE__ */ (0, import_jsx_runtime261.jsxs)(import_jsx_runtime261.Fragment, { children: [ 25843 href ? /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 25844 "a", 25845 { 25846 className: linkClass, 25847 href, 25848 target: linkTarget, 25849 rel: newRel, 25850 children: image 25851 } 25852 ) : image, 25853 !import_block_editor109.RichText.isEmpty(caption) && /* @__PURE__ */ (0, import_jsx_runtime261.jsx)(import_block_editor109.RichText.Content, { tagName: "figcaption", value: caption }) 25854 ] }); 25855 if ("left" === align || "right" === align || "center" === align) { 25856 return /* @__PURE__ */ (0, import_jsx_runtime261.jsx)("div", { ...import_block_editor109.useBlockProps.save(), children: /* @__PURE__ */ (0, import_jsx_runtime261.jsx)("figure", { className: classes, children: figure }) }); 25857 } 25858 return /* @__PURE__ */ (0, import_jsx_runtime261.jsx)("figure", { ...import_block_editor109.useBlockProps.save({ className: classes }), children: figure }); 25859 } 25860 }; 25861 var v54 = { 25862 attributes: { 25863 align: { 25864 type: "string" 25865 }, 25866 url: { 25867 type: "string", 25868 source: "attribute", 25869 selector: "img", 25870 attribute: "src" 25871 }, 25872 alt: { 25873 type: "string", 25874 source: "attribute", 25875 selector: "img", 25876 attribute: "alt", 25877 default: "" 25878 }, 25879 caption: { 25880 type: "string", 25881 source: "html", 25882 selector: "figcaption" 25883 }, 25884 title: { 25885 type: "string", 25886 source: "attribute", 25887 selector: "img", 25888 attribute: "title" 25889 }, 25890 href: { 25891 type: "string", 25892 source: "attribute", 25893 selector: "figure > a", 25894 attribute: "href" 25895 }, 25896 rel: { 25897 type: "string", 25898 source: "attribute", 25899 selector: "figure > a", 25900 attribute: "rel" 25901 }, 25902 linkClass: { 25903 type: "string", 25904 source: "attribute", 25905 selector: "figure > a", 25906 attribute: "class" 25907 }, 25908 id: { 25909 type: "number" 25910 }, 25911 width: { 25912 type: "number" 25913 }, 25914 height: { 25915 type: "number" 25916 }, 25917 sizeSlug: { 25918 type: "string" 25919 }, 25920 linkDestination: { 25921 type: "string" 25922 }, 25923 linkTarget: { 25924 type: "string", 25925 source: "attribute", 25926 selector: "figure > a", 25927 attribute: "target" 25928 } 25929 }, 25930 supports: { 25931 anchor: true, 25932 color: { 25933 __experimentalDuotone: "img", 25934 text: false, 25935 background: false 25936 }, 25937 __experimentalBorder: { 25938 radius: true, 25939 __experimentalDefaultControls: { 25940 radius: true 25941 } 25942 }, 25943 __experimentalStyle: { 25944 spacing: { 25945 margin: "0 0 1em 0" 25946 } 25947 } 25948 }, 25949 save({ attributes: attributes3 }) { 25950 const { 25951 url, 25952 alt, 25953 caption, 25954 align, 25955 href, 25956 rel, 25957 linkClass, 25958 width, 25959 height, 25960 id, 25961 linkTarget, 25962 sizeSlug, 25963 title 25964 } = attributes3; 25965 const newRel = !rel ? void 0 : rel; 25966 const classes = clsx_default({ 25967 [`align$align}`]: align, 25968 [`size-$sizeSlug}`]: sizeSlug, 25969 "is-resized": width || height 25970 }); 25971 const image = /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 25972 "img", 25973 { 25974 src: url, 25975 alt, 25976 className: id ? `wp-image-$id}` : null, 25977 width, 25978 height, 25979 title 25980 } 25981 ); 25982 const figure = /* @__PURE__ */ (0, import_jsx_runtime261.jsxs)(import_jsx_runtime261.Fragment, { children: [ 25983 href ? /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 25984 "a", 25985 { 25986 className: linkClass, 25987 href, 25988 target: linkTarget, 25989 rel: newRel, 25990 children: image 25991 } 25992 ) : image, 25993 !import_block_editor109.RichText.isEmpty(caption) && /* @__PURE__ */ (0, import_jsx_runtime261.jsx)(import_block_editor109.RichText.Content, { tagName: "figcaption", value: caption }) 25994 ] }); 25995 return /* @__PURE__ */ (0, import_jsx_runtime261.jsx)("figure", { ...import_block_editor109.useBlockProps.save({ className: classes }), children: figure }); 25996 } 25997 }; 25998 var v63 = { 25999 attributes: { 26000 align: { 26001 type: "string" 26002 }, 26003 url: { 26004 type: "string", 26005 source: "attribute", 26006 selector: "img", 26007 attribute: "src", 26008 role: "content" 26009 }, 26010 alt: { 26011 type: "string", 26012 source: "attribute", 26013 selector: "img", 26014 attribute: "alt", 26015 default: "", 26016 role: "content" 26017 }, 26018 caption: { 26019 type: "string", 26020 source: "html", 26021 selector: "figcaption", 26022 role: "content" 26023 }, 26024 title: { 26025 type: "string", 26026 source: "attribute", 26027 selector: "img", 26028 attribute: "title", 26029 role: "content" 26030 }, 26031 href: { 26032 type: "string", 26033 source: "attribute", 26034 selector: "figure > a", 26035 attribute: "href", 26036 role: "content" 26037 }, 26038 rel: { 26039 type: "string", 26040 source: "attribute", 26041 selector: "figure > a", 26042 attribute: "rel" 26043 }, 26044 linkClass: { 26045 type: "string", 26046 source: "attribute", 26047 selector: "figure > a", 26048 attribute: "class" 26049 }, 26050 id: { 26051 type: "number", 26052 role: "content" 26053 }, 26054 width: { 26055 type: "number" 26056 }, 26057 height: { 26058 type: "number" 26059 }, 26060 aspectRatio: { 26061 type: "string" 26062 }, 26063 scale: { 26064 type: "string" 26065 }, 26066 sizeSlug: { 26067 type: "string" 26068 }, 26069 linkDestination: { 26070 type: "string" 26071 }, 26072 linkTarget: { 26073 type: "string", 26074 source: "attribute", 26075 selector: "figure > a", 26076 attribute: "target" 26077 } 26078 }, 26079 supports: { 26080 anchor: true, 26081 color: { 26082 text: false, 26083 background: false 26084 }, 26085 filter: { 26086 duotone: true 26087 }, 26088 __experimentalBorder: { 26089 color: true, 26090 radius: true, 26091 width: true, 26092 __experimentalSkipSerialization: true, 26093 __experimentalDefaultControls: { 26094 color: true, 26095 radius: true, 26096 width: true 26097 } 26098 } 26099 }, 26100 migrate(attributes3) { 26101 const { height, width } = attributes3; 26102 return { 26103 ...attributes3, 26104 width: typeof width === "number" ? `$width}px` : width, 26105 height: typeof height === "number" ? `$height}px` : height 26106 }; 26107 }, 26108 save({ attributes: attributes3 }) { 26109 const { 26110 url, 26111 alt, 26112 caption, 26113 align, 26114 href, 26115 rel, 26116 linkClass, 26117 width, 26118 height, 26119 aspectRatio, 26120 scale, 26121 id, 26122 linkTarget, 26123 sizeSlug, 26124 title 26125 } = attributes3; 26126 const newRel = !rel ? void 0 : rel; 26127 const borderProps = (0, import_block_editor109.__experimentalGetBorderClassesAndStyles)(attributes3); 26128 const classes = clsx_default({ 26129 [`align$align}`]: align, 26130 [`size-$sizeSlug}`]: sizeSlug, 26131 "is-resized": width || height, 26132 "has-custom-border": !!borderProps.className || borderProps.style && Object.keys(borderProps.style).length > 0 26133 }); 26134 const imageClasses = clsx_default(borderProps.className, { 26135 [`wp-image-$id}`]: !!id 26136 }); 26137 const image = /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 26138 "img", 26139 { 26140 src: url, 26141 alt, 26142 className: imageClasses || void 0, 26143 style: { 26144 ...borderProps.style, 26145 aspectRatio, 26146 objectFit: scale 26147 }, 26148 width, 26149 height, 26150 title 26151 } 26152 ); 26153 const figure = /* @__PURE__ */ (0, import_jsx_runtime261.jsxs)(import_jsx_runtime261.Fragment, { children: [ 26154 href ? /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 26155 "a", 26156 { 26157 className: linkClass, 26158 href, 26159 target: linkTarget, 26160 rel: newRel, 26161 children: image 26162 } 26163 ) : image, 26164 !import_block_editor109.RichText.isEmpty(caption) && /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 26165 import_block_editor109.RichText.Content, 26166 { 26167 className: (0, import_block_editor109.__experimentalGetElementClassName)( 26168 "caption" 26169 ), 26170 tagName: "figcaption", 26171 value: caption 26172 } 26173 ) 26174 ] }); 26175 return /* @__PURE__ */ (0, import_jsx_runtime261.jsx)("figure", { ...import_block_editor109.useBlockProps.save({ className: classes }), children: figure }); 26176 } 26177 }; 26178 var v73 = { 26179 attributes: { 26180 align: { 26181 type: "string" 26182 }, 26183 url: { 26184 type: "string", 26185 source: "attribute", 26186 selector: "img", 26187 attribute: "src", 26188 role: "content" 26189 }, 26190 alt: { 26191 type: "string", 26192 source: "attribute", 26193 selector: "img", 26194 attribute: "alt", 26195 default: "", 26196 role: "content" 26197 }, 26198 caption: { 26199 type: "string", 26200 source: "html", 26201 selector: "figcaption", 26202 role: "content" 26203 }, 26204 title: { 26205 type: "string", 26206 source: "attribute", 26207 selector: "img", 26208 attribute: "title", 26209 role: "content" 26210 }, 26211 href: { 26212 type: "string", 26213 source: "attribute", 26214 selector: "figure > a", 26215 attribute: "href", 26216 role: "content" 26217 }, 26218 rel: { 26219 type: "string", 26220 source: "attribute", 26221 selector: "figure > a", 26222 attribute: "rel" 26223 }, 26224 linkClass: { 26225 type: "string", 26226 source: "attribute", 26227 selector: "figure > a", 26228 attribute: "class" 26229 }, 26230 id: { 26231 type: "number", 26232 role: "content" 26233 }, 26234 width: { 26235 type: "number" 26236 }, 26237 height: { 26238 type: "number" 26239 }, 26240 aspectRatio: { 26241 type: "string" 26242 }, 26243 scale: { 26244 type: "string" 26245 }, 26246 sizeSlug: { 26247 type: "string" 26248 }, 26249 linkDestination: { 26250 type: "string" 26251 }, 26252 linkTarget: { 26253 type: "string", 26254 source: "attribute", 26255 selector: "figure > a", 26256 attribute: "target" 26257 } 26258 }, 26259 supports: { 26260 anchor: true, 26261 color: { 26262 text: false, 26263 background: false 26264 }, 26265 filter: { 26266 duotone: true 26267 }, 26268 __experimentalBorder: { 26269 color: true, 26270 radius: true, 26271 width: true, 26272 __experimentalSkipSerialization: true, 26273 __experimentalDefaultControls: { 26274 color: true, 26275 radius: true, 26276 width: true 26277 } 26278 } 26279 }, 26280 migrate({ width, height, ...attributes3 }) { 26281 return { 26282 ...attributes3, 26283 width: `$width}px`, 26284 height: `$height}px` 26285 }; 26286 }, 26287 save({ attributes: attributes3 }) { 26288 const { 26289 url, 26290 alt, 26291 caption, 26292 align, 26293 href, 26294 rel, 26295 linkClass, 26296 width, 26297 height, 26298 aspectRatio, 26299 scale, 26300 id, 26301 linkTarget, 26302 sizeSlug, 26303 title 26304 } = attributes3; 26305 const newRel = !rel ? void 0 : rel; 26306 const borderProps = (0, import_block_editor109.__experimentalGetBorderClassesAndStyles)(attributes3); 26307 const classes = clsx_default({ 26308 [`align$align}`]: align, 26309 [`size-$sizeSlug}`]: sizeSlug, 26310 "is-resized": width || height, 26311 "has-custom-border": !!borderProps.className || borderProps.style && Object.keys(borderProps.style).length > 0 26312 }); 26313 const imageClasses = clsx_default(borderProps.className, { 26314 [`wp-image-$id}`]: !!id 26315 }); 26316 const image = /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 26317 "img", 26318 { 26319 src: url, 26320 alt, 26321 className: imageClasses || void 0, 26322 style: { 26323 ...borderProps.style, 26324 aspectRatio, 26325 objectFit: scale, 26326 width, 26327 height 26328 }, 26329 width, 26330 height, 26331 title 26332 } 26333 ); 26334 const figure = /* @__PURE__ */ (0, import_jsx_runtime261.jsxs)(import_jsx_runtime261.Fragment, { children: [ 26335 href ? /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 26336 "a", 26337 { 26338 className: linkClass, 26339 href, 26340 target: linkTarget, 26341 rel: newRel, 26342 children: image 26343 } 26344 ) : image, 26345 !import_block_editor109.RichText.isEmpty(caption) && /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 26346 import_block_editor109.RichText.Content, 26347 { 26348 className: (0, import_block_editor109.__experimentalGetElementClassName)( 26349 "caption" 26350 ), 26351 tagName: "figcaption", 26352 value: caption 26353 } 26354 ) 26355 ] }); 26356 return /* @__PURE__ */ (0, import_jsx_runtime261.jsx)("figure", { ...import_block_editor109.useBlockProps.save({ className: classes }), children: figure }); 26357 } 26358 }; 26359 var v82 = { 26360 attributes: { 26361 align: { 26362 type: "string" 26363 }, 26364 behaviors: { 26365 type: "object" 26366 }, 26367 url: { 26368 type: "string", 26369 source: "attribute", 26370 selector: "img", 26371 attribute: "src", 26372 role: "content" 26373 }, 26374 alt: { 26375 type: "string", 26376 source: "attribute", 26377 selector: "img", 26378 attribute: "alt", 26379 default: "", 26380 role: "content" 26381 }, 26382 caption: { 26383 type: "string", 26384 source: "html", 26385 selector: "figcaption", 26386 role: "content" 26387 }, 26388 title: { 26389 type: "string", 26390 source: "attribute", 26391 selector: "img", 26392 attribute: "title", 26393 role: "content" 26394 }, 26395 href: { 26396 type: "string", 26397 source: "attribute", 26398 selector: "figure > a", 26399 attribute: "href", 26400 role: "content" 26401 }, 26402 rel: { 26403 type: "string", 26404 source: "attribute", 26405 selector: "figure > a", 26406 attribute: "rel" 26407 }, 26408 linkClass: { 26409 type: "string", 26410 source: "attribute", 26411 selector: "figure > a", 26412 attribute: "class" 26413 }, 26414 id: { 26415 type: "number", 26416 role: "content" 26417 }, 26418 width: { 26419 type: "string" 26420 }, 26421 height: { 26422 type: "string" 26423 }, 26424 aspectRatio: { 26425 type: "string" 26426 }, 26427 scale: { 26428 type: "string" 26429 }, 26430 sizeSlug: { 26431 type: "string" 26432 }, 26433 linkDestination: { 26434 type: "string" 26435 }, 26436 linkTarget: { 26437 type: "string", 26438 source: "attribute", 26439 selector: "figure > a", 26440 attribute: "target" 26441 } 26442 }, 26443 supports: { 26444 anchor: true, 26445 color: { 26446 text: false, 26447 background: false 26448 }, 26449 filter: { 26450 duotone: true 26451 }, 26452 __experimentalBorder: { 26453 color: true, 26454 radius: true, 26455 width: true, 26456 __experimentalSkipSerialization: true, 26457 __experimentalDefaultControls: { 26458 color: true, 26459 radius: true, 26460 width: true 26461 } 26462 } 26463 }, 26464 migrate({ width, height, ...attributes3 }) { 26465 if (!attributes3.behaviors?.lightbox) { 26466 return attributes3; 26467 } 26468 const { 26469 behaviors: { 26470 lightbox: { enabled } 26471 } 26472 } = attributes3; 26473 const newAttributes = { 26474 ...attributes3, 26475 lightbox: { 26476 enabled 26477 } 26478 }; 26479 delete newAttributes.behaviors; 26480 return newAttributes; 26481 }, 26482 isEligible(attributes3) { 26483 return !!attributes3.behaviors; 26484 }, 26485 save({ attributes: attributes3 }) { 26486 const { 26487 url, 26488 alt, 26489 caption, 26490 align, 26491 href, 26492 rel, 26493 linkClass, 26494 width, 26495 height, 26496 aspectRatio, 26497 scale, 26498 id, 26499 linkTarget, 26500 sizeSlug, 26501 title 26502 } = attributes3; 26503 const newRel = !rel ? void 0 : rel; 26504 const borderProps = (0, import_block_editor109.__experimentalGetBorderClassesAndStyles)(attributes3); 26505 const classes = clsx_default({ 26506 [`align$align}`]: align, 26507 [`size-$sizeSlug}`]: sizeSlug, 26508 "is-resized": width || height, 26509 "has-custom-border": !!borderProps.className || borderProps.style && Object.keys(borderProps.style).length > 0 26510 }); 26511 const imageClasses = clsx_default(borderProps.className, { 26512 [`wp-image-$id}`]: !!id 26513 }); 26514 const image = /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 26515 "img", 26516 { 26517 src: url, 26518 alt, 26519 className: imageClasses || void 0, 26520 style: { 26521 ...borderProps.style, 26522 aspectRatio, 26523 objectFit: scale, 26524 width, 26525 height 26526 }, 26527 title 26528 } 26529 ); 26530 const figure = /* @__PURE__ */ (0, import_jsx_runtime261.jsxs)(import_jsx_runtime261.Fragment, { children: [ 26531 href ? /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 26532 "a", 26533 { 26534 className: linkClass, 26535 href, 26536 target: linkTarget, 26537 rel: newRel, 26538 children: image 26539 } 26540 ) : image, 26541 !import_block_editor109.RichText.isEmpty(caption) && /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 26542 import_block_editor109.RichText.Content, 26543 { 26544 className: (0, import_block_editor109.__experimentalGetElementClassName)( 26545 "caption" 26546 ), 26547 tagName: "figcaption", 26548 value: caption 26549 } 26550 ) 26551 ] }); 26552 return /* @__PURE__ */ (0, import_jsx_runtime261.jsx)("figure", { ...import_block_editor109.useBlockProps.save({ className: classes }), children: figure }); 26553 } 26554 }; 26555 var deprecated_default19 = [v82, v73, v63, v54, v44, v35, v27, v115]; 26556 26557 // packages/block-library/build-module/image/edit.js 26558 var import_blob12 = __toESM(require_blob()); 26559 var import_blocks38 = __toESM(require_blocks()); 26560 var import_components51 = __toESM(require_components()); 26561 var import_data44 = __toESM(require_data()); 26562 var import_block_editor111 = __toESM(require_block_editor()); 26563 var import_element44 = __toESM(require_element()); 26564 var import_i18n90 = __toESM(require_i18n()); 26565 var import_notices8 = __toESM(require_notices()); 26566 var import_compose20 = __toESM(require_compose()); 26567 26568 // packages/block-library/build-module/image/image.js 26569 var import_blob11 = __toESM(require_blob()); 26570 var import_components50 = __toESM(require_components()); 26571 var import_compose18 = __toESM(require_compose()); 26572 var import_data43 = __toESM(require_data()); 26573 var import_block_editor110 = __toESM(require_block_editor()); 26574 var import_element42 = __toESM(require_element()); 26575 var import_i18n89 = __toESM(require_i18n()); 26576 var import_url9 = __toESM(require_url()); 26577 var import_blocks37 = __toESM(require_blocks()); 26578 var import_notices7 = __toESM(require_notices()); 26579 var import_core_data22 = __toESM(require_core_data()); 26580 var import_jsx_runtime262 = __toESM(require_jsx_runtime()); 26581 var { DimensionsTool, ResolutionTool: ResolutionTool2 } = unlock(import_block_editor110.privateApis); 26582 var scaleOptions = [ 26583 { 26584 value: "cover", 26585 label: (0, import_i18n89._x)("Cover", "Scale option for dimensions control"), 26586 help: (0, import_i18n89.__)("Image covers the space evenly.") 26587 }, 26588 { 26589 value: "contain", 26590 label: (0, import_i18n89._x)("Contain", "Scale option for dimensions control"), 26591 help: (0, import_i18n89.__)("Image is contained without distortion.") 26592 } 26593 ]; 26594 var WRITEMODE_POPOVER_PROPS = { 26595 placement: "bottom-start" 26596 }; 26597 var ImageWrapper = ({ href, children }) => { 26598 if (!href) { 26599 return children; 26600 } 26601 return /* @__PURE__ */ (0, import_jsx_runtime262.jsx)( 26602 "a", 26603 { 26604 href, 26605 onClick: (event) => event.preventDefault(), 26606 "aria-disabled": true, 26607 style: { 26608 // When the Image block is linked, 26609 // it's wrapped with a disabled <a /> tag. 26610 // Restore cursor style so it doesn't appear 'clickable' 26611 // and remove pointer events. Safari needs the display property. 26612 pointerEvents: "none", 26613 cursor: "default", 26614 display: "inline" 26615 }, 26616 children 26617 } 26618 ); 26619 }; 26620 function ContentOnlyControls({ 26621 attributes: attributes3, 26622 setAttributes, 26623 lockAltControls, 26624 lockAltControlsMessage, 26625 lockTitleControls, 26626 lockTitleControlsMessage 26627 }) { 26628 const [popoverAnchor, setPopoverAnchor] = (0, import_element42.useState)(null); 26629 const [isAltDialogOpen, setIsAltDialogOpen] = (0, import_element42.useState)(false); 26630 const [isTitleDialogOpen, setIsTitleDialogOpen] = (0, import_element42.useState)(false); 26631 return /* @__PURE__ */ (0, import_jsx_runtime262.jsxs)(import_jsx_runtime262.Fragment, { children: [ 26632 /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(import_components50.ToolbarItem, { ref: setPopoverAnchor, children: (toggleProps) => /* @__PURE__ */ (0, import_jsx_runtime262.jsx)( 26633 import_components50.DropdownMenu, 26634 { 26635 icon: chevron_down_default, 26636 label: (0, import_i18n89.__)("More"), 26637 toggleProps: { 26638 ...toggleProps, 26639 description: (0, import_i18n89.__)("Displays more controls.") 26640 }, 26641 popoverProps: WRITEMODE_POPOVER_PROPS, 26642 children: ({ onClose }) => /* @__PURE__ */ (0, import_jsx_runtime262.jsxs)(import_jsx_runtime262.Fragment, { children: [ 26643 /* @__PURE__ */ (0, import_jsx_runtime262.jsx)( 26644 import_components50.MenuItem, 26645 { 26646 onClick: () => { 26647 setIsAltDialogOpen(true); 26648 onClose(); 26649 }, 26650 "aria-haspopup": "dialog", 26651 children: (0, import_i18n89._x)( 26652 "Alternative text", 26653 "Alternative text for an image. Block toolbar label, a low character count is preferred." 26654 ) 26655 } 26656 ), 26657 /* @__PURE__ */ (0, import_jsx_runtime262.jsx)( 26658 import_components50.MenuItem, 26659 { 26660 onClick: () => { 26661 setIsTitleDialogOpen(true); 26662 onClose(); 26663 }, 26664 "aria-haspopup": "dialog", 26665 children: (0, import_i18n89.__)("Title text") 26666 } 26667 ) 26668 ] }) 26669 } 26670 ) }), 26671 isAltDialogOpen && /* @__PURE__ */ (0, import_jsx_runtime262.jsx)( 26672 import_components50.Popover, 26673 { 26674 placement: "bottom-start", 26675 anchor: popoverAnchor, 26676 onClose: () => setIsAltDialogOpen(false), 26677 offset: 13, 26678 variant: "toolbar", 26679 children: /* @__PURE__ */ (0, import_jsx_runtime262.jsx)("div", { className: "wp-block-image__toolbar_content_textarea__container", children: /* @__PURE__ */ (0, import_jsx_runtime262.jsx)( 26680 import_components50.TextareaControl, 26681 { 26682 className: "wp-block-image__toolbar_content_textarea", 26683 label: (0, import_i18n89.__)("Alternative text"), 26684 value: attributes3.alt || "", 26685 onChange: (value) => setAttributes({ alt: value }), 26686 disabled: lockAltControls, 26687 help: lockAltControls ? /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(import_jsx_runtime262.Fragment, { children: lockAltControlsMessage }) : /* @__PURE__ */ (0, import_jsx_runtime262.jsxs)(import_jsx_runtime262.Fragment, { children: [ 26688 /* @__PURE__ */ (0, import_jsx_runtime262.jsx)( 26689 import_components50.ExternalLink, 26690 { 26691 href: ( 26692 // translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations. 26693 (0, import_i18n89.__)( 26694 "https://www.w3.org/WAI/tutorials/images/decision-tree/" 26695 ) 26696 ), 26697 children: (0, import_i18n89.__)( 26698 "Describe the purpose of the image." 26699 ) 26700 } 26701 ), 26702 /* @__PURE__ */ (0, import_jsx_runtime262.jsx)("br", {}), 26703 (0, import_i18n89.__)("Leave empty if decorative.") 26704 ] }) 26705 } 26706 ) }) 26707 } 26708 ), 26709 isTitleDialogOpen && /* @__PURE__ */ (0, import_jsx_runtime262.jsx)( 26710 import_components50.Popover, 26711 { 26712 placement: "bottom-start", 26713 anchor: popoverAnchor, 26714 onClose: () => setIsTitleDialogOpen(false), 26715 offset: 13, 26716 variant: "toolbar", 26717 children: /* @__PURE__ */ (0, import_jsx_runtime262.jsx)("div", { className: "wp-block-image__toolbar_content_textarea__container", children: /* @__PURE__ */ (0, import_jsx_runtime262.jsx)( 26718 import_components50.TextControl, 26719 { 26720 __next40pxDefaultSize: true, 26721 className: "wp-block-image__toolbar_content_textarea", 26722 label: (0, import_i18n89.__)("Title attribute"), 26723 value: attributes3.title || "", 26724 onChange: (value) => setAttributes({ 26725 title: value 26726 }), 26727 disabled: lockTitleControls, 26728 help: lockTitleControls ? /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(import_jsx_runtime262.Fragment, { children: lockTitleControlsMessage }) : /* @__PURE__ */ (0, import_jsx_runtime262.jsxs)(import_jsx_runtime262.Fragment, { children: [ 26729 (0, import_i18n89.__)( 26730 "Describe the role of this image on the page." 26731 ), 26732 /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(import_components50.ExternalLink, { href: "https://www.w3.org/TR/html52/dom.html#the-title-attribute", children: (0, import_i18n89.__)( 26733 "(Note: many devices and browsers do not display this text.)" 26734 ) }) 26735 ] }) 26736 } 26737 ) }) 26738 } 26739 ) 26740 ] }); 26741 } 26742 function Image2({ 26743 temporaryURL, 26744 attributes: attributes3, 26745 setAttributes, 26746 isSingleSelected, 26747 insertBlocksAfter, 26748 onReplace, 26749 onSelectImage, 26750 onSelectURL, 26751 onUploadError, 26752 context, 26753 clientId, 26754 blockEditingMode, 26755 parentLayoutType, 26756 maxContentWidth 26757 }) { 26758 const { 26759 url = "", 26760 alt, 26761 align, 26762 id, 26763 href, 26764 rel, 26765 linkClass, 26766 linkDestination, 26767 title, 26768 width, 26769 height, 26770 aspectRatio, 26771 scale, 26772 linkTarget, 26773 sizeSlug, 26774 lightbox, 26775 metadata 26776 } = attributes3; 26777 const [imageElement, setImageElement] = (0, import_element42.useState)(); 26778 const [resizeDelta, setResizeDelta] = (0, import_element42.useState)(null); 26779 const [pixelSize, setPixelSize] = (0, import_element42.useState)({}); 26780 const [offsetTop, setOffsetTop] = (0, import_element42.useState)(0); 26781 const setResizeObserved = (0, import_compose18.useResizeObserver)(([entry]) => { 26782 if (!resizeDelta) { 26783 const [box] = entry.borderBoxSize; 26784 setPixelSize({ width: box.inlineSize, height: box.blockSize }); 26785 } 26786 setOffsetTop(entry.target.offsetTop); 26787 }); 26788 const effectResizeableBoxPlacement = (0, import_element42.useCallback)(() => { 26789 setOffsetTop(imageElement?.offsetTop ?? 0); 26790 }, [imageElement]); 26791 const setRefs = (0, import_compose18.useMergeRefs)([setImageElement, setResizeObserved]); 26792 const { allowResize = true } = context; 26793 const image = (0, import_data43.useSelect)( 26794 (select9) => id && isSingleSelected ? select9(import_core_data22.store).getEntityRecord( 26795 "postType", 26796 "attachment", 26797 id, 26798 { context: "view" } 26799 ) : null, 26800 [id, isSingleSelected] 26801 ); 26802 const { canInsertCover, imageEditing, imageSizes, maxWidth } = (0, import_data43.useSelect)( 26803 (select9) => { 26804 const { getBlockRootClientId, canInsertBlockType, getSettings: getSettings22 } = select9(import_block_editor110.store); 26805 const rootClientId = getBlockRootClientId(clientId); 26806 const settings116 = getSettings22(); 26807 return { 26808 imageEditing: settings116.imageEditing, 26809 imageSizes: settings116.imageSizes, 26810 maxWidth: settings116.maxWidth, 26811 canInsertCover: canInsertBlockType( 26812 "core/cover", 26813 rootClientId 26814 ) 26815 }; 26816 }, 26817 [clientId] 26818 ); 26819 const { getBlock, getSettings: getSettings2 } = (0, import_data43.useSelect)(import_block_editor110.store); 26820 const { replaceBlocks, toggleSelection } = (0, import_data43.useDispatch)(import_block_editor110.store); 26821 const { createErrorNotice, createSuccessNotice } = (0, import_data43.useDispatch)(import_notices7.store); 26822 const { editEntityRecord } = (0, import_data43.useDispatch)(import_core_data22.store); 26823 const isLargeViewport = (0, import_compose18.useViewportMatch)("medium"); 26824 const isWideAligned = ["wide", "full"].includes(align); 26825 const [ 26826 { loadedNaturalWidth, loadedNaturalHeight }, 26827 setLoadedNaturalSize 26828 ] = (0, import_element42.useState)({}); 26829 const [isEditingImage, setIsEditingImage] = (0, import_element42.useState)(false); 26830 const [externalBlob, setExternalBlob] = (0, import_element42.useState)(); 26831 const [hasImageErrored, setHasImageErrored] = (0, import_element42.useState)(false); 26832 const hasNonContentControls = blockEditingMode === "default"; 26833 const isContentOnlyMode = blockEditingMode === "contentOnly"; 26834 const isResizable = allowResize && hasNonContentControls && !isWideAligned && isLargeViewport; 26835 const imageSizeOptions = imageSizes.filter( 26836 ({ slug }) => image?.media_details?.sizes?.[slug]?.source_url 26837 ).map(({ name: name117, slug }) => ({ value: slug, label: name117 })); 26838 (0, import_element42.useEffect)(() => { 26839 if (!isExternalImage(id, url) || !isSingleSelected || !getSettings2().mediaUpload) { 26840 setExternalBlob(); 26841 return; 26842 } 26843 if (externalBlob) { 26844 return; 26845 } 26846 window.fetch(url.includes("?") ? url : url + "?").then((response) => response.blob()).then((blob) => setExternalBlob(blob)).catch(() => { 26847 }); 26848 }, [id, url, isSingleSelected, externalBlob, getSettings2]); 26849 const { naturalWidth, naturalHeight } = (0, import_element42.useMemo)(() => { 26850 return { 26851 naturalWidth: imageElement?.naturalWidth || loadedNaturalWidth || void 0, 26852 naturalHeight: imageElement?.naturalHeight || loadedNaturalHeight || void 0 26853 }; 26854 }, [loadedNaturalWidth, loadedNaturalHeight, imageElement?.complete]); 26855 function onImageError() { 26856 setHasImageErrored(true); 26857 const embedBlock = createUpgradedEmbedBlock({ attributes: { url } }); 26858 if (void 0 !== embedBlock) { 26859 onReplace(embedBlock); 26860 } 26861 } 26862 function onImageLoad(event) { 26863 setHasImageErrored(false); 26864 setLoadedNaturalSize({ 26865 loadedNaturalWidth: event.target?.naturalWidth, 26866 loadedNaturalHeight: event.target?.naturalHeight 26867 }); 26868 } 26869 function onSetHref(props) { 26870 setAttributes(props); 26871 } 26872 function onSetLightbox(enable) { 26873 if (enable && !lightboxSetting?.enabled) { 26874 setAttributes({ 26875 lightbox: { enabled: true } 26876 }); 26877 } else if (!enable && lightboxSetting?.enabled) { 26878 setAttributes({ 26879 lightbox: { enabled: false } 26880 }); 26881 } else { 26882 setAttributes({ 26883 lightbox: void 0 26884 }); 26885 } 26886 } 26887 function resetLightbox() { 26888 if (lightboxSetting?.enabled && lightboxSetting?.allowEditing) { 26889 setAttributes({ 26890 lightbox: { enabled: false } 26891 }); 26892 } else { 26893 setAttributes({ 26894 lightbox: void 0 26895 }); 26896 } 26897 } 26898 function onSetTitle(value) { 26899 setAttributes({ title: value }); 26900 } 26901 function updateAlt(newAlt) { 26902 setAttributes({ alt: newAlt }); 26903 } 26904 function updateImage(newSizeSlug) { 26905 const newUrl = image?.media_details?.sizes?.[newSizeSlug]?.source_url; 26906 if (!newUrl) { 26907 return null; 26908 } 26909 setAttributes({ 26910 url: newUrl, 26911 sizeSlug: newSizeSlug 26912 }); 26913 } 26914 function uploadExternal() { 26915 const { mediaUpload } = getSettings2(); 26916 if (!mediaUpload) { 26917 return; 26918 } 26919 mediaUpload({ 26920 filesList: [externalBlob], 26921 onFileChange([img2]) { 26922 onSelectImage(img2); 26923 if ((0, import_blob11.isBlobURL)(img2.url)) { 26924 return; 26925 } 26926 setExternalBlob(); 26927 createSuccessNotice((0, import_i18n89.__)("Image uploaded."), { 26928 type: "snackbar" 26929 }); 26930 }, 26931 allowedTypes: ALLOWED_MEDIA_TYPES3, 26932 onError(message) { 26933 createErrorNotice(message, { type: "snackbar" }); 26934 } 26935 }); 26936 } 26937 (0, import_element42.useEffect)(() => { 26938 if (!isSingleSelected) { 26939 setIsEditingImage(false); 26940 } 26941 }, [isSingleSelected]); 26942 const canEditImage = id && naturalWidth && naturalHeight && imageEditing; 26943 const allowCrop = isSingleSelected && canEditImage && !isEditingImage && !isContentOnlyMode; 26944 function switchToCover() { 26945 replaceBlocks( 26946 clientId, 26947 (0, import_blocks37.switchToBlockType)(getBlock(clientId), "core/cover") 26948 ); 26949 } 26950 const dimensionsUnitsOptions = (0, import_components50.__experimentalUseCustomUnits)({ 26951 availableUnits: ["px"] 26952 }); 26953 const [lightboxSetting] = (0, import_block_editor110.useSettings)("lightbox"); 26954 const showLightboxSetting = ( 26955 // If a block-level override is set, we should give users the option to 26956 // remove that override, even if the lightbox UI is disabled in the settings. 26957 !!lightbox && lightbox?.enabled !== lightboxSetting?.enabled || lightboxSetting?.allowEditing 26958 ); 26959 const lightboxChecked = !!lightbox?.enabled || !lightbox && !!lightboxSetting?.enabled; 26960 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 26961 const dimensionsControl = isResizable && (SIZED_LAYOUTS.includes(parentLayoutType) ? /* @__PURE__ */ (0, import_jsx_runtime262.jsx)( 26962 DimensionsTool, 26963 { 26964 value: { aspectRatio }, 26965 onChange: ({ aspectRatio: newAspectRatio }) => { 26966 setAttributes({ 26967 aspectRatio: newAspectRatio, 26968 scale: "cover" 26969 }); 26970 }, 26971 defaultAspectRatio: "auto", 26972 tools: ["aspectRatio"] 26973 } 26974 ) : /* @__PURE__ */ (0, import_jsx_runtime262.jsx)( 26975 DimensionsTool, 26976 { 26977 value: { width, height, scale, aspectRatio }, 26978 onChange: ({ 26979 width: newWidth, 26980 height: newHeight, 26981 scale: newScale, 26982 aspectRatio: newAspectRatio 26983 }) => { 26984 setAttributes({ 26985 // CSS includes `height: auto`, but we need 26986 // `width: auto` to fix the aspect ratio when 26987 // only height is set due to the width and 26988 // height attributes set via the server. 26989 width: !newWidth && newHeight ? "auto" : newWidth, 26990 height: newHeight, 26991 scale: newScale, 26992 aspectRatio: newAspectRatio 26993 }); 26994 }, 26995 defaultScale: "cover", 26996 defaultAspectRatio: "auto", 26997 scaleOptions, 26998 unitsOptions: dimensionsUnitsOptions 26999 } 27000 )); 27001 const resetAll = () => { 27002 setAttributes({ 27003 alt: void 0, 27004 width: void 0, 27005 height: void 0, 27006 scale: void 0, 27007 aspectRatio: void 0, 27008 lightbox: void 0 27009 }); 27010 updateImage(DEFAULT_MEDIA_SIZE_SLUG3); 27011 }; 27012 const sizeControls = /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(import_block_editor110.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime262.jsx)( 27013 import_components50.__experimentalToolsPanel, 27014 { 27015 label: (0, import_i18n89.__)("Settings"), 27016 resetAll, 27017 dropdownMenuProps, 27018 children: dimensionsControl 27019 } 27020 ) }); 27021 const arePatternOverridesEnabled = metadata?.bindings?.__default?.source === "core/pattern-overrides"; 27022 const { 27023 lockUrlControls = false, 27024 lockHrefControls = false, 27025 lockAltControls = false, 27026 lockAltControlsMessage, 27027 lockTitleControls = false, 27028 lockTitleControlsMessage, 27029 hideCaptionControls = false 27030 } = (0, import_data43.useSelect)( 27031 (select9) => { 27032 if (!isSingleSelected) { 27033 return {}; 27034 } 27035 const { 27036 url: urlBinding, 27037 alt: altBinding, 27038 title: titleBinding, 27039 caption: captionBinding 27040 } = metadata?.bindings || {}; 27041 const hasParentPattern = !!context["pattern/overrides"]; 27042 const urlBindingSource = (0, import_blocks37.getBlockBindingsSource)( 27043 urlBinding?.source 27044 ); 27045 const altBindingSource = (0, import_blocks37.getBlockBindingsSource)( 27046 altBinding?.source 27047 ); 27048 const titleBindingSource = (0, import_blocks37.getBlockBindingsSource)( 27049 titleBinding?.source 27050 ); 27051 return { 27052 lockUrlControls: !!urlBinding && !urlBindingSource?.canUserEditValue?.({ 27053 select: select9, 27054 context, 27055 args: urlBinding?.args 27056 }), 27057 lockHrefControls: ( 27058 // Disable editing the link of the URL if the image is inside a pattern instance. 27059 // This is a temporary solution until we support overriding the link on the frontend. 27060 hasParentPattern || arePatternOverridesEnabled 27061 ), 27062 hideCaptionControls: !!captionBinding, 27063 lockAltControls: !!altBinding && !altBindingSource?.canUserEditValue?.({ 27064 select: select9, 27065 context, 27066 args: altBinding?.args 27067 }), 27068 lockAltControlsMessage: altBindingSource?.label ? (0, import_i18n89.sprintf)( 27069 /* translators: %s: Label of the bindings source. */ 27070 (0, import_i18n89.__)("Connected to %s"), 27071 altBindingSource.label 27072 ) : (0, import_i18n89.__)("Connected to dynamic data"), 27073 lockTitleControls: !!titleBinding && !titleBindingSource?.canUserEditValue?.({ 27074 select: select9, 27075 context, 27076 args: titleBinding?.args 27077 }), 27078 lockTitleControlsMessage: titleBindingSource?.label ? (0, import_i18n89.sprintf)( 27079 /* translators: %s: Label of the bindings source. */ 27080 (0, import_i18n89.__)("Connected to %s"), 27081 titleBindingSource.label 27082 ) : (0, import_i18n89.__)("Connected to dynamic data") 27083 }; 27084 }, 27085 [ 27086 arePatternOverridesEnabled, 27087 context, 27088 isSingleSelected, 27089 metadata?.bindings 27090 ] 27091 ); 27092 const showUrlInput = isSingleSelected && !isEditingImage && !lockHrefControls && !lockUrlControls; 27093 const showCoverControls = isSingleSelected && canInsertCover && !isContentOnlyMode; 27094 const showBlockControls = showUrlInput || allowCrop || showCoverControls; 27095 const mediaReplaceFlow = isSingleSelected && !isEditingImage && !lockUrlControls && // For contentOnly mode, put this button in its own area so it has borders around it. 27096 /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(import_block_editor110.BlockControls, { group: isContentOnlyMode ? "inline" : "other", children: /* @__PURE__ */ (0, import_jsx_runtime262.jsx)( 27097 import_block_editor110.MediaReplaceFlow, 27098 { 27099 mediaId: id, 27100 mediaURL: url, 27101 allowedTypes: ALLOWED_MEDIA_TYPES3, 27102 onSelect: onSelectImage, 27103 onSelectURL, 27104 onError: onUploadError, 27105 name: !url ? (0, import_i18n89.__)("Add image") : (0, import_i18n89.__)("Replace"), 27106 onReset: () => onSelectImage(void 0) 27107 } 27108 ) }); 27109 const controls = /* @__PURE__ */ (0, import_jsx_runtime262.jsxs)(import_jsx_runtime262.Fragment, { children: [ 27110 showBlockControls && /* @__PURE__ */ (0, import_jsx_runtime262.jsxs)(import_block_editor110.BlockControls, { group: "block", children: [ 27111 showUrlInput && /* @__PURE__ */ (0, import_jsx_runtime262.jsx)( 27112 import_block_editor110.__experimentalImageURLInputUI, 27113 { 27114 url: href || "", 27115 onChangeUrl: onSetHref, 27116 linkDestination, 27117 mediaUrl: image && image.source_url || url, 27118 mediaLink: image && image.link, 27119 linkTarget, 27120 linkClass, 27121 rel, 27122 showLightboxSetting, 27123 lightboxEnabled: lightboxChecked, 27124 onSetLightbox, 27125 resetLightbox 27126 } 27127 ), 27128 allowCrop && /* @__PURE__ */ (0, import_jsx_runtime262.jsx)( 27129 import_components50.ToolbarButton, 27130 { 27131 onClick: () => setIsEditingImage(true), 27132 icon: crop_default, 27133 label: (0, import_i18n89.__)("Crop") 27134 } 27135 ), 27136 showCoverControls && /* @__PURE__ */ (0, import_jsx_runtime262.jsx)( 27137 import_components50.ToolbarButton, 27138 { 27139 icon: overlay_text_default, 27140 label: (0, import_i18n89.__)("Add text over image"), 27141 onClick: switchToCover 27142 } 27143 ) 27144 ] }), 27145 isSingleSelected && externalBlob && /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(import_block_editor110.BlockControls, { children: /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(import_components50.ToolbarGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime262.jsx)( 27146 import_components50.ToolbarButton, 27147 { 27148 onClick: uploadExternal, 27149 icon: upload_default, 27150 label: (0, import_i18n89.__)("Upload to Media Library") 27151 } 27152 ) }) }), 27153 isContentOnlyMode && // Add some extra controls for content attributes when content only mode is active. 27154 // With content only mode active, the inspector is hidden, so users need another way 27155 // to edit these attributes. 27156 /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(import_block_editor110.BlockControls, { group: "block", children: /* @__PURE__ */ (0, import_jsx_runtime262.jsx)( 27157 ContentOnlyControls, 27158 { 27159 attributes: attributes3, 27160 setAttributes, 27161 lockAltControls, 27162 lockAltControlsMessage, 27163 lockTitleControls, 27164 lockTitleControlsMessage 27165 } 27166 ) }), 27167 /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(import_block_editor110.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime262.jsxs)( 27168 import_components50.__experimentalToolsPanel, 27169 { 27170 label: (0, import_i18n89.__)("Settings"), 27171 resetAll, 27172 dropdownMenuProps, 27173 children: [ 27174 isSingleSelected && /* @__PURE__ */ (0, import_jsx_runtime262.jsx)( 27175 import_components50.__experimentalToolsPanelItem, 27176 { 27177 label: (0, import_i18n89.__)("Alternative text"), 27178 isShownByDefault: true, 27179 hasValue: () => !!alt, 27180 onDeselect: () => setAttributes({ alt: void 0 }), 27181 children: /* @__PURE__ */ (0, import_jsx_runtime262.jsx)( 27182 import_components50.TextareaControl, 27183 { 27184 label: (0, import_i18n89.__)("Alternative text"), 27185 value: alt || "", 27186 onChange: updateAlt, 27187 readOnly: lockAltControls, 27188 help: lockAltControls ? /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(import_jsx_runtime262.Fragment, { children: lockAltControlsMessage }) : /* @__PURE__ */ (0, import_jsx_runtime262.jsxs)(import_jsx_runtime262.Fragment, { children: [ 27189 /* @__PURE__ */ (0, import_jsx_runtime262.jsx)( 27190 import_components50.ExternalLink, 27191 { 27192 href: ( 27193 // translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations. 27194 (0, import_i18n89.__)( 27195 "https://www.w3.org/WAI/tutorials/images/decision-tree/" 27196 ) 27197 ), 27198 children: (0, import_i18n89.__)( 27199 "Describe the purpose of the image." 27200 ) 27201 } 27202 ), 27203 /* @__PURE__ */ (0, import_jsx_runtime262.jsx)("br", {}), 27204 (0, import_i18n89.__)( 27205 "Leave empty if decorative." 27206 ) 27207 ] }) 27208 } 27209 ) 27210 } 27211 ), 27212 dimensionsControl, 27213 !!imageSizeOptions.length && /* @__PURE__ */ (0, import_jsx_runtime262.jsx)( 27214 ResolutionTool2, 27215 { 27216 value: sizeSlug, 27217 defaultValue: DEFAULT_MEDIA_SIZE_SLUG3, 27218 onChange: updateImage, 27219 options: imageSizeOptions 27220 } 27221 ) 27222 ] 27223 } 27224 ) }), 27225 /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(import_block_editor110.InspectorControls, { group: "advanced", children: /* @__PURE__ */ (0, import_jsx_runtime262.jsx)( 27226 import_components50.TextControl, 27227 { 27228 __next40pxDefaultSize: true, 27229 label: (0, import_i18n89.__)("Title attribute"), 27230 value: title || "", 27231 onChange: onSetTitle, 27232 readOnly: lockTitleControls, 27233 help: lockTitleControls ? /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(import_jsx_runtime262.Fragment, { children: lockTitleControlsMessage }) : /* @__PURE__ */ (0, import_jsx_runtime262.jsxs)(import_jsx_runtime262.Fragment, { children: [ 27234 (0, import_i18n89.__)( 27235 "Describe the role of this image on the page." 27236 ), 27237 /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(import_components50.ExternalLink, { href: "https://www.w3.org/TR/html52/dom.html#the-title-attribute", children: (0, import_i18n89.__)( 27238 "(Note: many devices and browsers do not display this text.)" 27239 ) }) 27240 ] }) 27241 } 27242 ) }) 27243 ] }); 27244 const filename = (0, import_url9.getFilename)(url); 27245 let defaultedAlt; 27246 if (alt) { 27247 defaultedAlt = alt; 27248 } else if (filename) { 27249 defaultedAlt = (0, import_i18n89.sprintf)( 27250 /* translators: %s: file name */ 27251 (0, import_i18n89.__)("This image has an empty alt attribute; its file name is %s"), 27252 filename 27253 ); 27254 } else { 27255 defaultedAlt = (0, import_i18n89.__)("This image has an empty alt attribute"); 27256 } 27257 const borderProps = (0, import_block_editor110.__experimentalUseBorderProps)(attributes3); 27258 const shadowProps = (0, import_block_editor110.__experimentalGetShadowClassesAndStyles)(attributes3); 27259 const isRounded = attributes3.className?.includes("is-style-rounded"); 27260 const { postType, postId, queryId } = context; 27261 const isDescendentOfQueryLoop = Number.isFinite(queryId); 27262 let img = temporaryURL && hasImageErrored ? ( 27263 // Show a placeholder during upload when the blob URL can't be loaded. This can 27264 // happen when the user uploads a HEIC image in a browser that doesn't support them. 27265 /* @__PURE__ */ (0, import_jsx_runtime262.jsx)( 27266 import_components50.Placeholder, 27267 { 27268 className: "wp-block-image__placeholder", 27269 withIllustration: true, 27270 children: /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(import_components50.Spinner, {}) 27271 } 27272 ) 27273 ) : /* @__PURE__ */ (0, import_jsx_runtime262.jsxs)(import_jsx_runtime262.Fragment, { children: [ 27274 /* @__PURE__ */ (0, import_jsx_runtime262.jsx)( 27275 "img", 27276 { 27277 src: temporaryURL || url, 27278 alt: defaultedAlt, 27279 onError: onImageError, 27280 onLoad: onImageLoad, 27281 ref: setRefs, 27282 className: borderProps.className, 27283 width: naturalWidth, 27284 height: naturalHeight, 27285 style: { 27286 aspectRatio, 27287 ...resizeDelta ? { 27288 width: pixelSize.width + resizeDelta.width, 27289 height: pixelSize.height + resizeDelta.height 27290 } : { width, height }, 27291 objectFit: scale, 27292 ...borderProps.style, 27293 ...shadowProps.style 27294 } 27295 } 27296 ), 27297 temporaryURL && /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(import_components50.Spinner, {}) 27298 ] }); 27299 if (canEditImage && isEditingImage) { 27300 img = /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(ImageWrapper, { href, children: /* @__PURE__ */ (0, import_jsx_runtime262.jsx)( 27301 import_block_editor110.__experimentalImageEditor, 27302 { 27303 id, 27304 url, 27305 ...pixelSize, 27306 naturalHeight, 27307 naturalWidth, 27308 onSaveImage: (imageAttributes) => setAttributes(imageAttributes), 27309 onFinishEditing: () => { 27310 setIsEditingImage(false); 27311 }, 27312 borderProps: isRounded ? void 0 : borderProps 27313 } 27314 ) }); 27315 } else { 27316 img = /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(ImageWrapper, { href, children: img }); 27317 } 27318 let resizableBox; 27319 if (isResizable && isSingleSelected && !isEditingImage && !SIZED_LAYOUTS.includes(parentLayoutType)) { 27320 const numericRatio = aspectRatio && evalAspectRatio(aspectRatio); 27321 const customRatio = pixelSize.width / pixelSize.height; 27322 const naturalRatio = naturalWidth / naturalHeight; 27323 const ratio = numericRatio || customRatio || naturalRatio || 1; 27324 const minWidth = naturalWidth < naturalHeight ? MIN_SIZE2 : MIN_SIZE2 * ratio; 27325 const minHeight = naturalHeight < naturalWidth ? MIN_SIZE2 : MIN_SIZE2 / ratio; 27326 const maxWidthBuffer = maxWidth * 2.5; 27327 const maxResizeWidth = maxContentWidth || maxWidthBuffer; 27328 let showRightHandle = false; 27329 let showLeftHandle = false; 27330 if (align === "center") { 27331 showRightHandle = true; 27332 showLeftHandle = true; 27333 } else if ((0, import_i18n89.isRTL)()) { 27334 if (align === "left") { 27335 showRightHandle = true; 27336 } else { 27337 showLeftHandle = true; 27338 } 27339 } else { 27340 if (align === "right") { 27341 showLeftHandle = true; 27342 } else { 27343 showRightHandle = true; 27344 } 27345 } 27346 resizableBox = /* @__PURE__ */ (0, import_jsx_runtime262.jsx)( 27347 import_components50.ResizableBox, 27348 { 27349 ref: effectResizeableBoxPlacement, 27350 style: { 27351 position: "absolute", 27352 // To match the vertical-align: bottom of the img (from style.scss) 27353 // syncs the top with the img. This matters when the img height is 27354 // less than the line-height. 27355 inset: `$offsetTop}px 0 0 0` 27356 }, 27357 size: pixelSize, 27358 minWidth, 27359 maxWidth: maxResizeWidth, 27360 minHeight, 27361 maxHeight: maxResizeWidth / ratio, 27362 lockAspectRatio: ratio, 27363 enable: { 27364 top: false, 27365 right: showRightHandle, 27366 bottom: true, 27367 left: showLeftHandle 27368 }, 27369 onResizeStart: () => { 27370 toggleSelection(false); 27371 }, 27372 onResize: (event, direction, elt, delta) => { 27373 setResizeDelta(delta); 27374 }, 27375 onResizeStop: (event, direction, elt, delta) => { 27376 toggleSelection(true); 27377 setResizeDelta(null); 27378 setPixelSize((current) => ({ 27379 width: current.width + delta.width, 27380 height: current.height + delta.height 27381 })); 27382 if (maxContentWidth && // Only do this if the image is bigger than the container to prevent it from being squished. 27383 // TODO: Remove this check if the image support setting 100% width. 27384 naturalWidth >= maxContentWidth && Math.abs(elt.offsetWidth - maxContentWidth) < 10) { 27385 setAttributes({ 27386 width: void 0, 27387 height: void 0 27388 }); 27389 return; 27390 } 27391 setAttributes({ 27392 width: `$elt.offsetWidth}px`, 27393 height: "auto", 27394 aspectRatio: ratio === naturalRatio ? void 0 : String(ratio) 27395 }); 27396 }, 27397 resizeRatio: align === "center" ? 2 : 1 27398 } 27399 ); 27400 } 27401 if (!url && !temporaryURL) { 27402 return /* @__PURE__ */ (0, import_jsx_runtime262.jsxs)(import_jsx_runtime262.Fragment, { children: [ 27403 mediaReplaceFlow, 27404 metadata?.bindings ? controls : sizeControls 27405 ] }); 27406 } 27407 const setPostFeatureImage = () => { 27408 editEntityRecord("postType", postType, postId, { 27409 featured_media: id 27410 }); 27411 createSuccessNotice((0, import_i18n89.__)("Post featured image updated."), { 27412 type: "snackbar" 27413 }); 27414 }; 27415 const featuredImageControl = /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(import_block_editor110.BlockSettingsMenuControls, { children: ({ selectedClientIds }) => selectedClientIds.length === 1 && !isDescendentOfQueryLoop && postId && id && clientId === selectedClientIds[0] && /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(import_components50.MenuItem, { onClick: setPostFeatureImage, children: (0, import_i18n89.__)("Set as featured image") }) }); 27416 return /* @__PURE__ */ (0, import_jsx_runtime262.jsxs)(import_jsx_runtime262.Fragment, { children: [ 27417 mediaReplaceFlow, 27418 controls, 27419 featuredImageControl, 27420 img, 27421 resizableBox, 27422 /* @__PURE__ */ (0, import_jsx_runtime262.jsx)( 27423 Caption, 27424 { 27425 attributes: attributes3, 27426 setAttributes, 27427 isSelected: isSingleSelected, 27428 insertBlocksAfter, 27429 label: (0, import_i18n89.__)("Image caption text"), 27430 showToolbarButton: isSingleSelected && (hasNonContentControls || isContentOnlyMode) && !hideCaptionControls 27431 } 27432 ) 27433 ] }); 27434 } 27435 27436 // packages/block-library/build-module/image/use-max-width-observer.js 27437 var import_element43 = __toESM(require_element()); 27438 var import_compose19 = __toESM(require_compose()); 27439 var import_jsx_runtime263 = __toESM(require_jsx_runtime()); 27440 function useMaxWidthObserver() { 27441 const [contentResizeListener, { width }] = (0, import_compose19.useResizeObserver)(); 27442 const observerRef = (0, import_element43.useRef)(); 27443 const maxWidthObserver = /* @__PURE__ */ (0, import_jsx_runtime263.jsx)( 27444 "div", 27445 { 27446 className: "wp-block", 27447 "aria-hidden": "true", 27448 style: { 27449 position: "absolute", 27450 inset: 0, 27451 width: "100%", 27452 height: 0, 27453 margin: 0 27454 }, 27455 ref: observerRef, 27456 children: contentResizeListener 27457 } 27458 ); 27459 return [maxWidthObserver, width]; 27460 } 27461 27462 // packages/block-library/build-module/image/edit.js 27463 var import_jsx_runtime264 = __toESM(require_jsx_runtime()); 27464 var pickRelevantMediaFiles2 = (image, size) => { 27465 const imageProps = Object.fromEntries( 27466 Object.entries(image ?? {}).filter( 27467 ([key]) => ["alt", "id", "link", "caption"].includes(key) 27468 ) 27469 ); 27470 imageProps.url = image?.sizes?.[size]?.url || image?.media_details?.sizes?.[size]?.source_url || image.url; 27471 return imageProps; 27472 }; 27473 var isExternalImage = (id, url) => url && !id && !(0, import_blob12.isBlobURL)(url); 27474 function hasSize(image, size) { 27475 return "url" in (image?.sizes?.[size] ?? {}) || "source_url" in (image?.media_details?.sizes?.[size] ?? {}); 27476 } 27477 function ImageEdit({ 27478 attributes: attributes3, 27479 setAttributes, 27480 isSelected: isSingleSelected, 27481 className, 27482 insertBlocksAfter, 27483 onReplace, 27484 context, 27485 clientId, 27486 __unstableParentLayout: parentLayout 27487 }) { 27488 const { 27489 url = "", 27490 caption, 27491 id, 27492 width, 27493 height, 27494 sizeSlug, 27495 aspectRatio, 27496 scale, 27497 align, 27498 metadata 27499 } = attributes3; 27500 const [temporaryURL, setTemporaryURL] = (0, import_element44.useState)(attributes3.blob); 27501 const containerRef = (0, import_element44.useRef)(); 27502 const layoutType = parentLayout?.type || parentLayout?.default?.type; 27503 const isMaxWidthContainerWidth = !layoutType || layoutType !== "flex" && layoutType !== "grid"; 27504 const [maxWidthObserver, maxContentWidth] = useMaxWidthObserver(); 27505 const [placeholderResizeListener, { width: placeholderWidth }] = (0, import_compose20.useResizeObserver)(); 27506 const isSmallContainer = placeholderWidth && placeholderWidth < 160; 27507 const captionRef = (0, import_element44.useRef)(); 27508 (0, import_element44.useEffect)(() => { 27509 captionRef.current = caption; 27510 }, [caption]); 27511 const { __unstableMarkNextChangeAsNotPersistent, replaceBlock } = (0, import_data44.useDispatch)(import_block_editor111.store); 27512 (0, import_element44.useEffect)(() => { 27513 if (["wide", "full"].includes(align)) { 27514 __unstableMarkNextChangeAsNotPersistent(); 27515 setAttributes({ 27516 width: void 0, 27517 height: void 0, 27518 aspectRatio: void 0, 27519 scale: void 0 27520 }); 27521 } 27522 }, [__unstableMarkNextChangeAsNotPersistent, align, setAttributes]); 27523 const { 27524 getSettings: getSettings2, 27525 getBlockRootClientId, 27526 getBlockName, 27527 canInsertBlockType 27528 } = (0, import_data44.useSelect)(import_block_editor111.store); 27529 const blockEditingMode = (0, import_block_editor111.useBlockEditingMode)(); 27530 const { createErrorNotice } = (0, import_data44.useDispatch)(import_notices8.store); 27531 function onUploadError(message) { 27532 createErrorNotice(message, { type: "snackbar" }); 27533 setAttributes({ 27534 src: void 0, 27535 id: void 0, 27536 url: void 0, 27537 blob: void 0 27538 }); 27539 } 27540 function onSelectImagesList(images) { 27541 const win = containerRef.current?.ownerDocument.defaultView; 27542 if (images.every((file) => file instanceof win.File)) { 27543 const files = images; 27544 const rootClientId = getBlockRootClientId(clientId); 27545 if (files.some((file) => !isValidFileType(file))) { 27546 createErrorNotice( 27547 (0, import_i18n90.__)( 27548 "If uploading to a gallery all files need to be image formats" 27549 ), 27550 { id: "gallery-upload-invalid-file", type: "snackbar" } 27551 ); 27552 } 27553 const imageBlocks = files.filter((file) => isValidFileType(file)).map( 27554 (file) => (0, import_blocks38.createBlock)("core/image", { 27555 blob: (0, import_blob12.createBlobURL)(file) 27556 }) 27557 ); 27558 if (getBlockName(rootClientId) === "core/gallery") { 27559 replaceBlock(clientId, imageBlocks); 27560 } else if (canInsertBlockType("core/gallery", rootClientId)) { 27561 const galleryBlock = (0, import_blocks38.createBlock)( 27562 "core/gallery", 27563 {}, 27564 imageBlocks 27565 ); 27566 replaceBlock(clientId, galleryBlock); 27567 } 27568 } 27569 } 27570 function onSelectImage(media) { 27571 if (Array.isArray(media)) { 27572 onSelectImagesList(media); 27573 return; 27574 } 27575 if (!media || !media.url) { 27576 setAttributes({ 27577 url: void 0, 27578 alt: void 0, 27579 id: void 0, 27580 title: void 0, 27581 caption: void 0, 27582 blob: void 0 27583 }); 27584 setTemporaryURL(); 27585 return; 27586 } 27587 if ((0, import_blob12.isBlobURL)(media.url)) { 27588 setTemporaryURL(media.url); 27589 return; 27590 } 27591 const { imageDefaultSize } = getSettings2(); 27592 let newSize = DEFAULT_MEDIA_SIZE_SLUG3; 27593 if (sizeSlug && hasSize(media, sizeSlug)) { 27594 newSize = sizeSlug; 27595 } else if (hasSize(media, imageDefaultSize)) { 27596 newSize = imageDefaultSize; 27597 } 27598 let mediaAttributes = pickRelevantMediaFiles2(media, newSize); 27599 if (typeof mediaAttributes.caption === "string" && mediaAttributes.caption.includes("\n")) { 27600 mediaAttributes.caption = mediaAttributes.caption.replace( 27601 /\n/g, 27602 "<br>" 27603 ); 27604 } 27605 if (captionRef.current && !mediaAttributes.caption) { 27606 const { caption: omittedCaption, ...restMediaAttributes } = mediaAttributes; 27607 mediaAttributes = restMediaAttributes; 27608 } 27609 let additionalAttributes; 27610 if (!media.id || media.id !== id) { 27611 additionalAttributes = { 27612 sizeSlug: newSize 27613 }; 27614 } 27615 let linkDestination = attributes3.linkDestination; 27616 if (!linkDestination) { 27617 switch (window?.wp?.media?.view?.settings?.defaultProps?.link || LINK_DESTINATION_NONE2) { 27618 case "file": 27619 case LINK_DESTINATION_MEDIA2: 27620 linkDestination = LINK_DESTINATION_MEDIA2; 27621 break; 27622 case "post": 27623 case LINK_DESTINATION_ATTACHMENT2: 27624 linkDestination = LINK_DESTINATION_ATTACHMENT2; 27625 break; 27626 case LINK_DESTINATION_CUSTOM: 27627 linkDestination = LINK_DESTINATION_CUSTOM; 27628 break; 27629 case LINK_DESTINATION_NONE2: 27630 linkDestination = LINK_DESTINATION_NONE2; 27631 break; 27632 } 27633 } 27634 let href; 27635 switch (linkDestination) { 27636 case LINK_DESTINATION_MEDIA2: 27637 href = media.url; 27638 break; 27639 case LINK_DESTINATION_ATTACHMENT2: 27640 href = media.link; 27641 break; 27642 } 27643 mediaAttributes.href = href; 27644 setAttributes({ 27645 blob: void 0, 27646 ...mediaAttributes, 27647 ...additionalAttributes, 27648 linkDestination 27649 }); 27650 setTemporaryURL(); 27651 } 27652 function onSelectURL(newURL) { 27653 if (newURL !== url) { 27654 setAttributes({ 27655 blob: void 0, 27656 url: newURL, 27657 id: void 0, 27658 sizeSlug: getSettings2().imageDefaultSize 27659 }); 27660 setTemporaryURL(); 27661 } 27662 } 27663 useUploadMediaFromBlobURL({ 27664 url: temporaryURL, 27665 allowedTypes: ALLOWED_MEDIA_TYPES3, 27666 onChange: onSelectImage, 27667 onError: onUploadError 27668 }); 27669 const isExternal = isExternalImage(id, url); 27670 const src = isExternal ? url : void 0; 27671 const mediaPreview = !!url && /* @__PURE__ */ (0, import_jsx_runtime264.jsx)( 27672 "img", 27673 { 27674 alt: (0, import_i18n90.__)("Edit image"), 27675 title: (0, import_i18n90.__)("Edit image"), 27676 className: "edit-image-preview", 27677 src: url 27678 } 27679 ); 27680 const borderProps = (0, import_block_editor111.__experimentalUseBorderProps)(attributes3); 27681 const shadowProps = (0, import_block_editor111.__experimentalGetShadowClassesAndStyles)(attributes3); 27682 const classes = clsx_default(className, { 27683 "is-transient": !!temporaryURL, 27684 "is-resized": !!width || !!height, 27685 [`size-$sizeSlug}`]: sizeSlug, 27686 "has-custom-border": !!borderProps.className || borderProps.style && Object.keys(borderProps.style).length > 0 27687 }); 27688 const blockProps = (0, import_block_editor111.useBlockProps)({ 27689 ref: containerRef, 27690 className: classes 27691 }); 27692 const { lockUrlControls = false, lockUrlControlsMessage } = (0, import_data44.useSelect)( 27693 (select9) => { 27694 if (!isSingleSelected) { 27695 return {}; 27696 } 27697 const blockBindingsSource = (0, import_blocks38.getBlockBindingsSource)( 27698 metadata?.bindings?.url?.source 27699 ); 27700 return { 27701 lockUrlControls: !!metadata?.bindings?.url && !blockBindingsSource?.canUserEditValue?.({ 27702 select: select9, 27703 context, 27704 args: metadata?.bindings?.url?.args 27705 }), 27706 lockUrlControlsMessage: blockBindingsSource?.label ? (0, import_i18n90.sprintf)( 27707 /* translators: %s: Label of the bindings source. */ 27708 (0, import_i18n90.__)("Connected to %s"), 27709 blockBindingsSource.label 27710 ) : (0, import_i18n90.__)("Connected to dynamic data") 27711 }; 27712 }, 27713 [context, isSingleSelected, metadata?.bindings?.url] 27714 ); 27715 const placeholder2 = (content) => { 27716 return /* @__PURE__ */ (0, import_jsx_runtime264.jsxs)( 27717 import_components51.Placeholder, 27718 { 27719 className: clsx_default("block-editor-media-placeholder", { 27720 [borderProps.className]: !!borderProps.className && !isSingleSelected 27721 }), 27722 icon: !isSmallContainer && (lockUrlControls ? plugins_default : image_default), 27723 withIllustration: !isSingleSelected || isSmallContainer, 27724 label: !isSmallContainer && (0, import_i18n90.__)("Image"), 27725 instructions: !lockUrlControls && !isSmallContainer && (0, import_i18n90.__)( 27726 "Drag and drop an image, upload, or choose from your library." 27727 ), 27728 style: { 27729 aspectRatio: !(width && height) && aspectRatio ? aspectRatio : void 0, 27730 width: height && aspectRatio ? "100%" : width, 27731 height: width && aspectRatio ? "100%" : height, 27732 objectFit: scale, 27733 ...borderProps.style, 27734 ...shadowProps.style 27735 }, 27736 children: [ 27737 lockUrlControls && !isSmallContainer && lockUrlControlsMessage, 27738 !lockUrlControls && !isSmallContainer && content, 27739 placeholderResizeListener 27740 ] 27741 } 27742 ); 27743 }; 27744 return /* @__PURE__ */ (0, import_jsx_runtime264.jsxs)(import_jsx_runtime264.Fragment, { children: [ 27745 /* @__PURE__ */ (0, import_jsx_runtime264.jsxs)("figure", { ...blockProps, children: [ 27746 /* @__PURE__ */ (0, import_jsx_runtime264.jsx)( 27747 Image2, 27748 { 27749 temporaryURL, 27750 attributes: attributes3, 27751 setAttributes, 27752 isSingleSelected, 27753 insertBlocksAfter, 27754 onReplace, 27755 onSelectImage, 27756 onSelectURL, 27757 onUploadError, 27758 context, 27759 clientId, 27760 blockEditingMode, 27761 parentLayoutType: layoutType, 27762 maxContentWidth 27763 } 27764 ), 27765 /* @__PURE__ */ (0, import_jsx_runtime264.jsx)( 27766 import_block_editor111.MediaPlaceholder, 27767 { 27768 icon: /* @__PURE__ */ (0, import_jsx_runtime264.jsx)(import_block_editor111.BlockIcon, { icon: image_default }), 27769 onSelect: onSelectImage, 27770 onSelectURL, 27771 onError: onUploadError, 27772 placeholder: placeholder2, 27773 allowedTypes: ALLOWED_MEDIA_TYPES3, 27774 handleUpload: (files) => files.length === 1, 27775 value: { id, src }, 27776 mediaPreview, 27777 disableMediaButtons: temporaryURL || url 27778 } 27779 ) 27780 ] }), 27781 // The listener cannot be placed as the first element as it will break the in-between inserter. 27782 // See https://github.com/WordPress/gutenberg/blob/71134165868298fc15e22896d0c28b41b3755ff7/packages/block-editor/src/components/block-list/use-in-between-inserter.js#L120 27783 isSingleSelected && isMaxWidthContainerWidth && maxWidthObserver 27784 ] }); 27785 } 27786 var edit_default17 = ImageEdit; 27787 27788 // packages/block-library/build-module/image/block.json 27789 var block_default43 = { 27790 $schema: "https://schemas.wp.org/trunk/block.json", 27791 apiVersion: 3, 27792 name: "core/image", 27793 title: "Image", 27794 category: "media", 27795 usesContext: [ 27796 "allowResize", 27797 "imageCrop", 27798 "fixedHeight", 27799 "postId", 27800 "postType", 27801 "queryId" 27802 ], 27803 description: "Insert an image to make a visual statement.", 27804 keywords: ["img", "photo", "picture"], 27805 textdomain: "default", 27806 attributes: { 27807 blob: { 27808 type: "string", 27809 role: "local" 27810 }, 27811 url: { 27812 type: "string", 27813 source: "attribute", 27814 selector: "img", 27815 attribute: "src", 27816 role: "content" 27817 }, 27818 alt: { 27819 type: "string", 27820 source: "attribute", 27821 selector: "img", 27822 attribute: "alt", 27823 default: "", 27824 role: "content" 27825 }, 27826 caption: { 27827 type: "rich-text", 27828 source: "rich-text", 27829 selector: "figcaption", 27830 role: "content" 27831 }, 27832 lightbox: { 27833 type: "object", 27834 enabled: { 27835 type: "boolean" 27836 } 27837 }, 27838 title: { 27839 type: "string", 27840 source: "attribute", 27841 selector: "img", 27842 attribute: "title", 27843 role: "content" 27844 }, 27845 href: { 27846 type: "string", 27847 source: "attribute", 27848 selector: "figure > a", 27849 attribute: "href", 27850 role: "content" 27851 }, 27852 rel: { 27853 type: "string", 27854 source: "attribute", 27855 selector: "figure > a", 27856 attribute: "rel" 27857 }, 27858 linkClass: { 27859 type: "string", 27860 source: "attribute", 27861 selector: "figure > a", 27862 attribute: "class" 27863 }, 27864 id: { 27865 type: "number", 27866 role: "content" 27867 }, 27868 width: { 27869 type: "string" 27870 }, 27871 height: { 27872 type: "string" 27873 }, 27874 aspectRatio: { 27875 type: "string" 27876 }, 27877 scale: { 27878 type: "string" 27879 }, 27880 sizeSlug: { 27881 type: "string" 27882 }, 27883 linkDestination: { 27884 type: "string" 27885 }, 27886 linkTarget: { 27887 type: "string", 27888 source: "attribute", 27889 selector: "figure > a", 27890 attribute: "target" 27891 } 27892 }, 27893 supports: { 27894 interactivity: true, 27895 align: ["left", "center", "right", "wide", "full"], 27896 anchor: true, 27897 color: { 27898 text: false, 27899 background: false 27900 }, 27901 filter: { 27902 duotone: true 27903 }, 27904 spacing: { 27905 margin: true 27906 }, 27907 __experimentalBorder: { 27908 color: true, 27909 radius: true, 27910 width: true, 27911 __experimentalSkipSerialization: true, 27912 __experimentalDefaultControls: { 27913 color: true, 27914 radius: true, 27915 width: true 27916 } 27917 }, 27918 shadow: { 27919 __experimentalSkipSerialization: true 27920 } 27921 }, 27922 selectors: { 27923 border: ".wp-block-image img, .wp-block-image .wp-block-image__crop-area, .wp-block-image .components-placeholder", 27924 shadow: ".wp-block-image img, .wp-block-image .wp-block-image__crop-area, .wp-block-image .components-placeholder", 27925 filter: { 27926 duotone: ".wp-block-image img, .wp-block-image .components-placeholder" 27927 } 27928 }, 27929 styles: [ 27930 { 27931 name: "default", 27932 label: "Default", 27933 isDefault: true 27934 }, 27935 { name: "rounded", label: "Rounded" } 27936 ], 27937 editorStyle: "wp-block-image-editor", 27938 style: "wp-block-image" 27939 }; 27940 27941 // packages/block-library/build-module/image/save.js 27942 var import_block_editor112 = __toESM(require_block_editor()); 27943 var import_jsx_runtime265 = __toESM(require_jsx_runtime()); 27944 function save26({ attributes: attributes3 }) { 27945 const { 27946 url, 27947 alt, 27948 caption, 27949 align, 27950 href, 27951 rel, 27952 linkClass, 27953 width, 27954 height, 27955 aspectRatio, 27956 scale, 27957 id, 27958 linkTarget, 27959 sizeSlug, 27960 title, 27961 metadata: { bindings = {} } = {} 27962 } = attributes3; 27963 const newRel = !rel ? void 0 : rel; 27964 const borderProps = (0, import_block_editor112.__experimentalGetBorderClassesAndStyles)(attributes3); 27965 const shadowProps = (0, import_block_editor112.__experimentalGetShadowClassesAndStyles)(attributes3); 27966 const classes = clsx_default({ 27967 // All other align classes are handled by block supports. 27968 // `{ align: 'none' }` is unique to transforms for the image block. 27969 alignnone: "none" === align, 27970 [`size-$sizeSlug}`]: sizeSlug, 27971 "is-resized": width || height, 27972 "has-custom-border": !!borderProps.className || borderProps.style && Object.keys(borderProps.style).length > 0 27973 }); 27974 const imageClasses = clsx_default(borderProps.className, { 27975 [`wp-image-$id}`]: !!id 27976 }); 27977 const image = /* @__PURE__ */ (0, import_jsx_runtime265.jsx)( 27978 "img", 27979 { 27980 src: url, 27981 alt, 27982 className: imageClasses || void 0, 27983 style: { 27984 ...borderProps.style, 27985 ...shadowProps.style, 27986 aspectRatio, 27987 objectFit: scale, 27988 width, 27989 height 27990 }, 27991 title 27992 } 27993 ); 27994 const displayCaption = !import_block_editor112.RichText.isEmpty(caption) || bindings.caption || bindings?.__default?.source === "core/pattern-overrides"; 27995 const figure = /* @__PURE__ */ (0, import_jsx_runtime265.jsxs)(import_jsx_runtime265.Fragment, { children: [ 27996 href ? /* @__PURE__ */ (0, import_jsx_runtime265.jsx)( 27997 "a", 27998 { 27999 className: linkClass, 28000 href, 28001 target: linkTarget, 28002 rel: newRel, 28003 children: image 28004 } 28005 ) : image, 28006 displayCaption && /* @__PURE__ */ (0, import_jsx_runtime265.jsx)( 28007 import_block_editor112.RichText.Content, 28008 { 28009 className: (0, import_block_editor112.__experimentalGetElementClassName)("caption"), 28010 tagName: "figcaption", 28011 value: caption 28012 } 28013 ) 28014 ] }); 28015 return /* @__PURE__ */ (0, import_jsx_runtime265.jsx)("figure", { ...import_block_editor112.useBlockProps.save({ className: classes }), children: figure }); 28016 } 28017 28018 // packages/block-library/build-module/image/transforms.js 28019 var import_blob13 = __toESM(require_blob()); 28020 var import_blocks39 = __toESM(require_blocks()); 28021 function stripFirstImage(attributes3, { shortcode }) { 28022 const { body } = document.implementation.createHTMLDocument(""); 28023 body.innerHTML = shortcode.content; 28024 let nodeToRemove = body.querySelector("img"); 28025 while (nodeToRemove && nodeToRemove.parentNode && nodeToRemove.parentNode !== body) { 28026 nodeToRemove = nodeToRemove.parentNode; 28027 } 28028 if (nodeToRemove) { 28029 nodeToRemove.parentNode.removeChild(nodeToRemove); 28030 } 28031 return body.innerHTML.trim(); 28032 } 28033 function getFirstAnchorAttributeFormHTML(html, attributeName) { 28034 const { body } = document.implementation.createHTMLDocument(""); 28035 body.innerHTML = html; 28036 const { firstElementChild } = body; 28037 if (firstElementChild && firstElementChild.nodeName === "A") { 28038 return firstElementChild.getAttribute(attributeName) || void 0; 28039 } 28040 } 28041 var imageSchema = { 28042 img: { 28043 attributes: ["src", "alt", "title"], 28044 classes: [ 28045 "alignleft", 28046 "aligncenter", 28047 "alignright", 28048 "alignnone", 28049 /^wp-image-\d+$/ 28050 ] 28051 } 28052 }; 28053 var schema = ({ phrasingContentSchema }) => ({ 28054 figure: { 28055 require: ["img"], 28056 children: { 28057 ...imageSchema, 28058 a: { 28059 attributes: ["href", "rel", "target"], 28060 classes: ["*"], 28061 children: imageSchema 28062 }, 28063 figcaption: { 28064 children: phrasingContentSchema 28065 } 28066 } 28067 } 28068 }); 28069 var transforms13 = { 28070 from: [ 28071 { 28072 type: "raw", 28073 isMatch: (node) => node.nodeName === "FIGURE" && !!node.querySelector("img"), 28074 schema, 28075 transform: (node) => { 28076 const className = node.className + " " + node.querySelector("img").className; 28077 const alignMatches = /(?:^|\s)align(left|center|right)(?:$|\s)/.exec( 28078 className 28079 ); 28080 const anchor = node.id === "" ? void 0 : node.id; 28081 const align = alignMatches ? alignMatches[1] : void 0; 28082 const idMatches = /(?:^|\s)wp-image-(\d+)(?:$|\s)/.exec( 28083 className 28084 ); 28085 const id = idMatches ? Number(idMatches[1]) : void 0; 28086 const anchorElement = node.querySelector("a"); 28087 const linkDestination = anchorElement && anchorElement.href ? "custom" : void 0; 28088 const href = anchorElement && anchorElement.href ? anchorElement.href : void 0; 28089 const rel = anchorElement && anchorElement.rel ? anchorElement.rel : void 0; 28090 const linkClass = anchorElement && anchorElement.className ? anchorElement.className : void 0; 28091 const attributes3 = (0, import_blocks39.getBlockAttributes)( 28092 "core/image", 28093 node.outerHTML, 28094 { 28095 align, 28096 id, 28097 linkDestination, 28098 href, 28099 rel, 28100 linkClass, 28101 anchor 28102 } 28103 ); 28104 if ((0, import_blob13.isBlobURL)(attributes3.url)) { 28105 attributes3.blob = attributes3.url; 28106 delete attributes3.url; 28107 } 28108 return (0, import_blocks39.createBlock)("core/image", attributes3); 28109 } 28110 }, 28111 { 28112 // Note: when dragging and dropping multiple files onto a gallery this overrides the 28113 // gallery transform in order to add new images to the gallery instead of 28114 // creating a new gallery. 28115 type: "files", 28116 isMatch(files) { 28117 return files.every( 28118 (file) => file.type.indexOf("image/") === 0 28119 ); 28120 }, 28121 transform(files) { 28122 const blocks = files.map((file) => { 28123 return (0, import_blocks39.createBlock)("core/image", { 28124 blob: (0, import_blob13.createBlobURL)(file) 28125 }); 28126 }); 28127 return blocks; 28128 } 28129 }, 28130 { 28131 type: "shortcode", 28132 tag: "caption", 28133 attributes: { 28134 url: { 28135 type: "string", 28136 source: "attribute", 28137 attribute: "src", 28138 selector: "img" 28139 }, 28140 alt: { 28141 type: "string", 28142 source: "attribute", 28143 attribute: "alt", 28144 selector: "img" 28145 }, 28146 caption: { 28147 shortcode: stripFirstImage 28148 }, 28149 href: { 28150 shortcode: (attributes3, { shortcode }) => { 28151 return getFirstAnchorAttributeFormHTML( 28152 shortcode.content, 28153 "href" 28154 ); 28155 } 28156 }, 28157 rel: { 28158 shortcode: (attributes3, { shortcode }) => { 28159 return getFirstAnchorAttributeFormHTML( 28160 shortcode.content, 28161 "rel" 28162 ); 28163 } 28164 }, 28165 linkClass: { 28166 shortcode: (attributes3, { shortcode }) => { 28167 return getFirstAnchorAttributeFormHTML( 28168 shortcode.content, 28169 "class" 28170 ); 28171 } 28172 }, 28173 id: { 28174 type: "number", 28175 shortcode: ({ named: { id } }) => { 28176 if (!id) { 28177 return; 28178 } 28179 return parseInt(id.replace("attachment_", ""), 10); 28180 } 28181 }, 28182 align: { 28183 type: "string", 28184 shortcode: ({ named: { align = "alignnone" } }) => { 28185 return align.replace("align", ""); 28186 } 28187 } 28188 } 28189 } 28190 ] 28191 }; 28192 var transforms_default14 = transforms13; 28193 28194 // packages/block-library/build-module/image/index.js 28195 var { fieldsKey: fieldsKey8, formKey: formKey8 } = unlock(import_blocks40.privateApis); 28196 var { name: name43 } = block_default43; 28197 var settings43 = { 28198 icon: image_default, 28199 example: { 28200 attributes: { 28201 sizeSlug: "large", 28202 url: "https://s.w.org/images/core/5.3/MtBlanc1.jpg", 28203 // translators: Caption accompanying an image of the Mont Blanc, which serves as an example for the Image block. 28204 caption: (0, import_i18n91.__)("Mont Blanc appears\u2014still, snowy, and serene.") 28205 } 28206 }, 28207 __experimentalLabel(attributes3, { context }) { 28208 const customName = attributes3?.metadata?.name; 28209 if (context === "list-view" && customName) { 28210 return customName; 28211 } 28212 if (context === "accessibility") { 28213 const { caption, alt, url } = attributes3; 28214 if (!url) { 28215 return (0, import_i18n91.__)("Empty"); 28216 } 28217 if (!alt) { 28218 return caption || ""; 28219 } 28220 return alt + (caption ? ". " + caption : ""); 28221 } 28222 }, 28223 getEditWrapperProps(attributes3) { 28224 return { 28225 "data-align": attributes3.align 28226 }; 28227 }, 28228 transforms: transforms_default14, 28229 edit: edit_default17, 28230 save: save26, 28231 deprecated: deprecated_default19 28232 }; 28233 if (window.__experimentalContentOnlyInspectorFields) { 28234 settings43[fieldsKey8] = [ 28235 { 28236 id: "image", 28237 label: (0, import_i18n91.__)("Image"), 28238 type: "media", 28239 mapping: { 28240 id: "id", 28241 url: "url", 28242 caption: "caption", 28243 alt: "alt" 28244 }, 28245 args: { 28246 allowedTypes: ["image"], 28247 multiple: false 28248 } 28249 }, 28250 { 28251 id: "link", 28252 label: (0, import_i18n91.__)("Link"), 28253 type: "link", 28254 mapping: { 28255 url: "href", 28256 rel: "rel", 28257 linkTarget: "linkTarget", 28258 destination: "linkDestination" 28259 } 28260 }, 28261 { 28262 id: "caption", 28263 label: (0, import_i18n91.__)("Caption"), 28264 type: "richtext" 28265 }, 28266 { 28267 id: "alt", 28268 label: (0, import_i18n91.__)("Alt text"), 28269 type: "text" 28270 } 28271 ]; 28272 settings43[formKey8] = { 28273 fields: ["image"] 28274 }; 28275 } 28276 var init43 = () => initBlock({ name: name43, metadata: block_default43, settings: settings43 }); 28277 28278 // packages/block-library/build-module/latest-comments/index.js 28279 var latest_comments_exports = {}; 28280 __export(latest_comments_exports, { 28281 init: () => init44, 28282 metadata: () => block_default44, 28283 name: () => name44, 28284 settings: () => settings44 28285 }); 28286 28287 // packages/block-library/build-module/latest-comments/block.json 28288 var block_default44 = { 28289 $schema: "https://schemas.wp.org/trunk/block.json", 28290 apiVersion: 3, 28291 name: "core/latest-comments", 28292 title: "Latest Comments", 28293 category: "widgets", 28294 description: "Display a list of your most recent comments.", 28295 keywords: ["recent comments"], 28296 textdomain: "default", 28297 attributes: { 28298 commentsToShow: { 28299 type: "number", 28300 default: 5, 28301 minimum: 1, 28302 maximum: 100 28303 }, 28304 displayAvatar: { 28305 type: "boolean", 28306 default: true 28307 }, 28308 displayDate: { 28309 type: "boolean", 28310 default: true 28311 }, 28312 displayContent: { 28313 type: "string", 28314 default: "excerpt", 28315 enum: ["none", "excerpt", "full"] 28316 } 28317 }, 28318 supports: { 28319 align: true, 28320 color: { 28321 gradients: true, 28322 link: true, 28323 __experimentalDefaultControls: { 28324 background: true, 28325 text: true, 28326 link: true 28327 } 28328 }, 28329 html: false, 28330 spacing: { 28331 margin: true, 28332 padding: true 28333 }, 28334 typography: { 28335 fontSize: true, 28336 lineHeight: true, 28337 __experimentalFontFamily: true, 28338 __experimentalFontWeight: true, 28339 __experimentalFontStyle: true, 28340 __experimentalTextTransform: true, 28341 __experimentalTextDecoration: true, 28342 __experimentalLetterSpacing: true, 28343 __experimentalDefaultControls: { 28344 fontSize: true 28345 } 28346 }, 28347 interactivity: { 28348 clientNavigation: true 28349 } 28350 }, 28351 editorStyle: "wp-block-latest-comments-editor", 28352 style: "wp-block-latest-comments" 28353 }; 28354 28355 // packages/block-library/build-module/latest-comments/edit.js 28356 var import_block_editor113 = __toESM(require_block_editor()); 28357 var import_components52 = __toESM(require_components()); 28358 var import_server_side_render4 = __toESM(require_server_side_render()); 28359 var import_i18n92 = __toESM(require_i18n()); 28360 var import_jsx_runtime266 = __toESM(require_jsx_runtime()); 28361 var MIN_COMMENTS = 1; 28362 var MAX_COMMENTS = 100; 28363 function LatestComments({ attributes: attributes3, setAttributes }) { 28364 const { commentsToShow, displayAvatar, displayDate, displayContent } = attributes3; 28365 const serverSideAttributes = { 28366 ...attributes3, 28367 style: { 28368 ...attributes3?.style, 28369 spacing: void 0 28370 } 28371 }; 28372 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 28373 return /* @__PURE__ */ (0, import_jsx_runtime266.jsxs)("div", { ...(0, import_block_editor113.useBlockProps)(), children: [ 28374 /* @__PURE__ */ (0, import_jsx_runtime266.jsx)(import_block_editor113.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime266.jsxs)( 28375 import_components52.__experimentalToolsPanel, 28376 { 28377 label: (0, import_i18n92.__)("Settings"), 28378 resetAll: () => { 28379 setAttributes({ 28380 commentsToShow: 5, 28381 displayAvatar: true, 28382 displayDate: true, 28383 displayContent: "excerpt" 28384 }); 28385 }, 28386 dropdownMenuProps, 28387 children: [ 28388 /* @__PURE__ */ (0, import_jsx_runtime266.jsx)( 28389 import_components52.__experimentalToolsPanelItem, 28390 { 28391 hasValue: () => !displayAvatar, 28392 label: (0, import_i18n92.__)("Display avatar"), 28393 onDeselect: () => setAttributes({ displayAvatar: true }), 28394 isShownByDefault: true, 28395 children: /* @__PURE__ */ (0, import_jsx_runtime266.jsx)( 28396 import_components52.ToggleControl, 28397 { 28398 label: (0, import_i18n92.__)("Display avatar"), 28399 checked: displayAvatar, 28400 onChange: () => setAttributes({ 28401 displayAvatar: !displayAvatar 28402 }) 28403 } 28404 ) 28405 } 28406 ), 28407 /* @__PURE__ */ (0, import_jsx_runtime266.jsx)( 28408 import_components52.__experimentalToolsPanelItem, 28409 { 28410 hasValue: () => !displayDate, 28411 label: (0, import_i18n92.__)("Display date"), 28412 onDeselect: () => setAttributes({ displayDate: true }), 28413 isShownByDefault: true, 28414 children: /* @__PURE__ */ (0, import_jsx_runtime266.jsx)( 28415 import_components52.ToggleControl, 28416 { 28417 label: (0, import_i18n92.__)("Display date"), 28418 checked: displayDate, 28419 onChange: () => setAttributes({ displayDate: !displayDate }) 28420 } 28421 ) 28422 } 28423 ), 28424 /* @__PURE__ */ (0, import_jsx_runtime266.jsx)( 28425 import_components52.__experimentalToolsPanelItem, 28426 { 28427 hasValue: () => displayContent !== "excerpt", 28428 label: (0, import_i18n92.__)("Display content"), 28429 onDeselect: () => setAttributes({ displayContent: "excerpt" }), 28430 isShownByDefault: true, 28431 children: /* @__PURE__ */ (0, import_jsx_runtime266.jsx)( 28432 import_components52.SelectControl, 28433 { 28434 __next40pxDefaultSize: true, 28435 label: (0, import_i18n92.__)("Display content"), 28436 value: displayContent, 28437 options: [ 28438 { label: (0, import_i18n92.__)("No content"), value: "none" }, 28439 { label: (0, import_i18n92.__)("Excerpt"), value: "excerpt" }, 28440 { label: (0, import_i18n92.__)("Full content"), value: "full" } 28441 ], 28442 onChange: (value) => setAttributes({ 28443 displayContent: value 28444 }) 28445 } 28446 ) 28447 } 28448 ), 28449 /* @__PURE__ */ (0, import_jsx_runtime266.jsx)( 28450 import_components52.__experimentalToolsPanelItem, 28451 { 28452 hasValue: () => commentsToShow !== 5, 28453 label: (0, import_i18n92.__)("Number of comments"), 28454 onDeselect: () => setAttributes({ commentsToShow: 5 }), 28455 isShownByDefault: true, 28456 children: /* @__PURE__ */ (0, import_jsx_runtime266.jsx)( 28457 import_components52.RangeControl, 28458 { 28459 __next40pxDefaultSize: true, 28460 label: (0, import_i18n92.__)("Number of comments"), 28461 value: commentsToShow, 28462 onChange: (value) => setAttributes({ commentsToShow: value }), 28463 min: MIN_COMMENTS, 28464 max: MAX_COMMENTS, 28465 required: true 28466 } 28467 ) 28468 } 28469 ) 28470 ] 28471 } 28472 ) }), 28473 /* @__PURE__ */ (0, import_jsx_runtime266.jsx)(import_components52.Disabled, { children: /* @__PURE__ */ (0, import_jsx_runtime266.jsx)( 28474 import_server_side_render4.default, 28475 { 28476 block: "core/latest-comments", 28477 attributes: serverSideAttributes, 28478 urlQueryArgs: { _locale: "site" } 28479 } 28480 ) }) 28481 ] }); 28482 } 28483 28484 // packages/block-library/build-module/latest-comments/deprecated.js 28485 var v116 = { 28486 attributes: { 28487 commentsToShow: { 28488 type: "number", 28489 default: 5, 28490 minimum: 1, 28491 maximum: 100 28492 }, 28493 displayAvatar: { 28494 type: "boolean", 28495 default: true 28496 }, 28497 displayDate: { 28498 type: "boolean", 28499 default: true 28500 }, 28501 displayExcerpt: { 28502 type: "boolean", 28503 default: true 28504 } 28505 }, 28506 isEligible(attributes3) { 28507 return attributes3?.displayExcerpt === false; 28508 }, 28509 migrate(attributes3) { 28510 return { 28511 ...attributes3, 28512 displayContent: attributes3.displayExcerpt ? "excerpt" : "none" 28513 }; 28514 } 28515 }; 28516 var deprecated_default20 = [v116]; 28517 28518 // packages/block-library/build-module/latest-comments/index.js 28519 var { name: name44 } = block_default44; 28520 var settings44 = { 28521 icon: comment_default, 28522 example: {}, 28523 edit: LatestComments, 28524 deprecated: deprecated_default20 28525 }; 28526 var init44 = () => initBlock({ name: name44, metadata: block_default44, settings: settings44 }); 28527 28528 // packages/block-library/build-module/latest-posts/index.js 28529 var latest_posts_exports = {}; 28530 __export(latest_posts_exports, { 28531 init: () => init45, 28532 metadata: () => block_default45, 28533 name: () => name45, 28534 settings: () => settings45 28535 }); 28536 28537 // packages/block-library/build-module/latest-posts/block.json 28538 var block_default45 = { 28539 $schema: "https://schemas.wp.org/trunk/block.json", 28540 apiVersion: 3, 28541 name: "core/latest-posts", 28542 title: "Latest Posts", 28543 category: "widgets", 28544 description: "Display a list of your most recent posts.", 28545 keywords: ["recent posts"], 28546 textdomain: "default", 28547 attributes: { 28548 categories: { 28549 type: "array", 28550 items: { 28551 type: "object" 28552 } 28553 }, 28554 selectedAuthor: { 28555 type: "number" 28556 }, 28557 postsToShow: { 28558 type: "number", 28559 default: 5 28560 }, 28561 displayPostContent: { 28562 type: "boolean", 28563 default: false 28564 }, 28565 displayPostContentRadio: { 28566 type: "string", 28567 default: "excerpt" 28568 }, 28569 excerptLength: { 28570 type: "number", 28571 default: 55 28572 }, 28573 displayAuthor: { 28574 type: "boolean", 28575 default: false 28576 }, 28577 displayPostDate: { 28578 type: "boolean", 28579 default: false 28580 }, 28581 postLayout: { 28582 type: "string", 28583 default: "list" 28584 }, 28585 columns: { 28586 type: "number", 28587 default: 3 28588 }, 28589 order: { 28590 type: "string", 28591 default: "desc" 28592 }, 28593 orderBy: { 28594 type: "string", 28595 default: "date" 28596 }, 28597 displayFeaturedImage: { 28598 type: "boolean", 28599 default: false 28600 }, 28601 featuredImageAlign: { 28602 type: "string", 28603 enum: ["left", "center", "right"] 28604 }, 28605 featuredImageSizeSlug: { 28606 type: "string", 28607 default: "thumbnail" 28608 }, 28609 featuredImageSizeWidth: { 28610 type: "number", 28611 default: null 28612 }, 28613 featuredImageSizeHeight: { 28614 type: "number", 28615 default: null 28616 }, 28617 addLinkToFeaturedImage: { 28618 type: "boolean", 28619 default: false 28620 } 28621 }, 28622 supports: { 28623 align: true, 28624 html: false, 28625 color: { 28626 gradients: true, 28627 link: true, 28628 __experimentalDefaultControls: { 28629 background: true, 28630 text: true, 28631 link: true 28632 } 28633 }, 28634 spacing: { 28635 margin: true, 28636 padding: true 28637 }, 28638 typography: { 28639 fontSize: true, 28640 lineHeight: true, 28641 __experimentalFontFamily: true, 28642 __experimentalFontWeight: true, 28643 __experimentalFontStyle: true, 28644 __experimentalTextTransform: true, 28645 __experimentalTextDecoration: true, 28646 __experimentalLetterSpacing: true, 28647 __experimentalDefaultControls: { 28648 fontSize: true 28649 } 28650 }, 28651 __experimentalBorder: { 28652 radius: true, 28653 color: true, 28654 width: true, 28655 style: true, 28656 __experimentalDefaultControls: { 28657 radius: true, 28658 color: true, 28659 width: true, 28660 style: true 28661 } 28662 }, 28663 interactivity: { 28664 clientNavigation: true 28665 } 28666 }, 28667 editorStyle: "wp-block-latest-posts-editor", 28668 style: "wp-block-latest-posts" 28669 }; 28670 28671 // packages/block-library/build-module/latest-posts/deprecated.js 28672 var { attributes: attributes2 } = block_default45; 28673 var deprecated_default21 = [ 28674 { 28675 attributes: { 28676 ...attributes2, 28677 categories: { 28678 type: "string" 28679 } 28680 }, 28681 supports: { 28682 align: true, 28683 html: false 28684 }, 28685 migrate: (oldAttributes) => { 28686 return { 28687 ...oldAttributes, 28688 categories: [{ id: Number(oldAttributes.categories) }] 28689 }; 28690 }, 28691 isEligible: ({ categories }) => categories && "string" === typeof categories, 28692 save: () => null 28693 } 28694 ]; 28695 28696 // packages/block-library/build-module/latest-posts/edit.js 28697 var import_components53 = __toESM(require_components()); 28698 var import_i18n93 = __toESM(require_i18n()); 28699 var import_date2 = __toESM(require_date()); 28700 var import_block_editor114 = __toESM(require_block_editor()); 28701 var import_data45 = __toESM(require_data()); 28702 var import_core_data23 = __toESM(require_core_data()); 28703 var import_notices9 = __toESM(require_notices()); 28704 var import_compose21 = __toESM(require_compose()); 28705 var import_element45 = __toESM(require_element()); 28706 28707 // packages/block-library/build-module/latest-posts/constants.js 28708 var MIN_EXCERPT_LENGTH = 10; 28709 var MAX_EXCERPT_LENGTH = 100; 28710 var MAX_POSTS_COLUMNS = 6; 28711 var DEFAULT_EXCERPT_LENGTH = 55; 28712 28713 // packages/block-library/build-module/latest-posts/edit.js 28714 var import_jsx_runtime267 = __toESM(require_jsx_runtime()); 28715 var CATEGORIES_LIST_QUERY = { 28716 per_page: -1, 28717 _fields: "id,name", 28718 context: "view" 28719 }; 28720 var USERS_LIST_QUERY = { 28721 per_page: -1, 28722 has_published_posts: ["post"], 28723 context: "view" 28724 }; 28725 var imageAlignmentOptions = [ 28726 { 28727 value: "none", 28728 icon: align_none_default, 28729 label: (0, import_i18n93.__)("None") 28730 }, 28731 { 28732 value: "left", 28733 icon: position_left_default, 28734 label: (0, import_i18n93.__)("Left") 28735 }, 28736 { 28737 value: "center", 28738 icon: position_center_default, 28739 label: (0, import_i18n93.__)("Center") 28740 }, 28741 { 28742 value: "right", 28743 icon: position_right_default, 28744 label: (0, import_i18n93.__)("Right") 28745 } 28746 ]; 28747 function getFeaturedImageDetails(post, size) { 28748 const image = post._embedded?.["wp:featuredmedia"]?.["0"]; 28749 return { 28750 url: image?.media_details?.sizes?.[size]?.source_url ?? image?.source_url, 28751 alt: image?.alt_text 28752 }; 28753 } 28754 function getCurrentAuthor(post) { 28755 return post._embedded?.author?.[0]; 28756 } 28757 function Controls({ attributes: attributes3, setAttributes, postCount }) { 28758 const { 28759 postsToShow, 28760 order, 28761 orderBy, 28762 categories, 28763 selectedAuthor, 28764 displayFeaturedImage, 28765 displayPostContentRadio, 28766 displayPostContent, 28767 displayPostDate, 28768 displayAuthor, 28769 postLayout, 28770 columns, 28771 excerptLength, 28772 featuredImageAlign, 28773 featuredImageSizeSlug, 28774 featuredImageSizeWidth, 28775 featuredImageSizeHeight, 28776 addLinkToFeaturedImage 28777 } = attributes3; 28778 const { 28779 imageSizes, 28780 defaultImageWidth, 28781 defaultImageHeight, 28782 categoriesList, 28783 authorList 28784 } = (0, import_data45.useSelect)( 28785 (select9) => { 28786 const { getEntityRecords, getUsers } = select9(import_core_data23.store); 28787 const settings116 = select9(import_block_editor114.store).getSettings(); 28788 return { 28789 defaultImageWidth: settings116.imageDimensions?.[featuredImageSizeSlug]?.width ?? 0, 28790 defaultImageHeight: settings116.imageDimensions?.[featuredImageSizeSlug]?.height ?? 0, 28791 imageSizes: settings116.imageSizes, 28792 categoriesList: getEntityRecords( 28793 "taxonomy", 28794 "category", 28795 CATEGORIES_LIST_QUERY 28796 ), 28797 authorList: getUsers(USERS_LIST_QUERY) 28798 }; 28799 }, 28800 [featuredImageSizeSlug] 28801 ); 28802 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 28803 const imageSizeOptions = imageSizes.filter(({ slug }) => slug !== "full").map(({ name: name117, slug }) => ({ 28804 value: slug, 28805 label: name117 28806 })); 28807 const categorySuggestions = categoriesList?.reduce( 28808 (accumulator, category) => ({ 28809 ...accumulator, 28810 [category.name]: category 28811 }), 28812 {} 28813 ) ?? {}; 28814 const selectCategories = (tokens) => { 28815 const hasNoSuggestion = tokens.some( 28816 (token) => typeof token === "string" && !categorySuggestions[token] 28817 ); 28818 if (hasNoSuggestion) { 28819 return; 28820 } 28821 const allCategories = tokens.map((token) => { 28822 return typeof token === "string" ? categorySuggestions[token] : token; 28823 }); 28824 if (allCategories.includes(null)) { 28825 return false; 28826 } 28827 setAttributes({ categories: allCategories }); 28828 }; 28829 return /* @__PURE__ */ (0, import_jsx_runtime267.jsxs)(import_jsx_runtime267.Fragment, { children: [ 28830 /* @__PURE__ */ (0, import_jsx_runtime267.jsxs)( 28831 import_components53.__experimentalToolsPanel, 28832 { 28833 label: (0, import_i18n93.__)("Post content"), 28834 resetAll: () => setAttributes({ 28835 displayPostContent: false, 28836 displayPostContentRadio: "excerpt", 28837 excerptLength: DEFAULT_EXCERPT_LENGTH 28838 }), 28839 dropdownMenuProps, 28840 children: [ 28841 /* @__PURE__ */ (0, import_jsx_runtime267.jsx)( 28842 import_components53.__experimentalToolsPanelItem, 28843 { 28844 hasValue: () => !!displayPostContent, 28845 label: (0, import_i18n93.__)("Display post content"), 28846 onDeselect: () => setAttributes({ displayPostContent: false }), 28847 isShownByDefault: true, 28848 children: /* @__PURE__ */ (0, import_jsx_runtime267.jsx)( 28849 import_components53.ToggleControl, 28850 { 28851 label: (0, import_i18n93.__)("Display post content"), 28852 checked: displayPostContent, 28853 onChange: (value) => setAttributes({ displayPostContent: value }) 28854 } 28855 ) 28856 } 28857 ), 28858 displayPostContent && /* @__PURE__ */ (0, import_jsx_runtime267.jsx)( 28859 import_components53.__experimentalToolsPanelItem, 28860 { 28861 hasValue: () => displayPostContentRadio !== "excerpt", 28862 label: (0, import_i18n93.__)("Content length"), 28863 onDeselect: () => setAttributes({ 28864 displayPostContentRadio: "excerpt" 28865 }), 28866 isShownByDefault: true, 28867 children: /* @__PURE__ */ (0, import_jsx_runtime267.jsx)( 28868 import_components53.RadioControl, 28869 { 28870 label: (0, import_i18n93.__)("Content length"), 28871 selected: displayPostContentRadio, 28872 options: [ 28873 { label: (0, import_i18n93.__)("Excerpt"), value: "excerpt" }, 28874 { 28875 label: (0, import_i18n93.__)("Full post"), 28876 value: "full_post" 28877 } 28878 ], 28879 onChange: (value) => setAttributes({ 28880 displayPostContentRadio: value 28881 }) 28882 } 28883 ) 28884 } 28885 ), 28886 displayPostContent && displayPostContentRadio === "excerpt" && /* @__PURE__ */ (0, import_jsx_runtime267.jsx)( 28887 import_components53.__experimentalToolsPanelItem, 28888 { 28889 hasValue: () => excerptLength !== DEFAULT_EXCERPT_LENGTH, 28890 label: (0, import_i18n93.__)("Max number of words"), 28891 onDeselect: () => setAttributes({ 28892 excerptLength: DEFAULT_EXCERPT_LENGTH 28893 }), 28894 isShownByDefault: true, 28895 children: /* @__PURE__ */ (0, import_jsx_runtime267.jsx)( 28896 import_components53.RangeControl, 28897 { 28898 __next40pxDefaultSize: true, 28899 label: (0, import_i18n93.__)("Max number of words"), 28900 value: excerptLength, 28901 onChange: (value) => setAttributes({ excerptLength: value }), 28902 min: MIN_EXCERPT_LENGTH, 28903 max: MAX_EXCERPT_LENGTH 28904 } 28905 ) 28906 } 28907 ) 28908 ] 28909 } 28910 ), 28911 /* @__PURE__ */ (0, import_jsx_runtime267.jsxs)( 28912 import_components53.__experimentalToolsPanel, 28913 { 28914 label: (0, import_i18n93.__)("Post meta"), 28915 resetAll: () => setAttributes({ 28916 displayAuthor: false, 28917 displayPostDate: false 28918 }), 28919 dropdownMenuProps, 28920 children: [ 28921 /* @__PURE__ */ (0, import_jsx_runtime267.jsx)( 28922 import_components53.__experimentalToolsPanelItem, 28923 { 28924 hasValue: () => !!displayAuthor, 28925 label: (0, import_i18n93.__)("Display author name"), 28926 onDeselect: () => setAttributes({ displayAuthor: false }), 28927 isShownByDefault: true, 28928 children: /* @__PURE__ */ (0, import_jsx_runtime267.jsx)( 28929 import_components53.ToggleControl, 28930 { 28931 label: (0, import_i18n93.__)("Display author name"), 28932 checked: displayAuthor, 28933 onChange: (value) => setAttributes({ displayAuthor: value }) 28934 } 28935 ) 28936 } 28937 ), 28938 /* @__PURE__ */ (0, import_jsx_runtime267.jsx)( 28939 import_components53.__experimentalToolsPanelItem, 28940 { 28941 hasValue: () => !!displayPostDate, 28942 label: (0, import_i18n93.__)("Display post date"), 28943 onDeselect: () => setAttributes({ displayPostDate: false }), 28944 isShownByDefault: true, 28945 children: /* @__PURE__ */ (0, import_jsx_runtime267.jsx)( 28946 import_components53.ToggleControl, 28947 { 28948 label: (0, import_i18n93.__)("Display post date"), 28949 checked: displayPostDate, 28950 onChange: (value) => setAttributes({ displayPostDate: value }) 28951 } 28952 ) 28953 } 28954 ) 28955 ] 28956 } 28957 ), 28958 /* @__PURE__ */ (0, import_jsx_runtime267.jsxs)( 28959 import_components53.__experimentalToolsPanel, 28960 { 28961 label: (0, import_i18n93.__)("Featured image"), 28962 resetAll: () => setAttributes({ 28963 displayFeaturedImage: false, 28964 featuredImageAlign: void 0, 28965 featuredImageSizeSlug: "thumbnail", 28966 featuredImageSizeWidth: null, 28967 featuredImageSizeHeight: null, 28968 addLinkToFeaturedImage: false 28969 }), 28970 dropdownMenuProps, 28971 children: [ 28972 /* @__PURE__ */ (0, import_jsx_runtime267.jsx)( 28973 import_components53.__experimentalToolsPanelItem, 28974 { 28975 hasValue: () => !!displayFeaturedImage, 28976 label: (0, import_i18n93.__)("Display featured image"), 28977 onDeselect: () => setAttributes({ displayFeaturedImage: false }), 28978 isShownByDefault: true, 28979 children: /* @__PURE__ */ (0, import_jsx_runtime267.jsx)( 28980 import_components53.ToggleControl, 28981 { 28982 label: (0, import_i18n93.__)("Display featured image"), 28983 checked: displayFeaturedImage, 28984 onChange: (value) => setAttributes({ displayFeaturedImage: value }) 28985 } 28986 ) 28987 } 28988 ), 28989 displayFeaturedImage && /* @__PURE__ */ (0, import_jsx_runtime267.jsxs)(import_jsx_runtime267.Fragment, { children: [ 28990 /* @__PURE__ */ (0, import_jsx_runtime267.jsx)( 28991 import_components53.__experimentalToolsPanelItem, 28992 { 28993 hasValue: () => featuredImageSizeSlug !== "thumbnail" || featuredImageSizeWidth !== null || featuredImageSizeHeight !== null, 28994 label: (0, import_i18n93.__)("Image size"), 28995 onDeselect: () => setAttributes({ 28996 featuredImageSizeSlug: "thumbnail", 28997 featuredImageSizeWidth: null, 28998 featuredImageSizeHeight: null 28999 }), 29000 isShownByDefault: true, 29001 children: /* @__PURE__ */ (0, import_jsx_runtime267.jsx)( 29002 import_block_editor114.__experimentalImageSizeControl, 29003 { 29004 onChange: (value) => { 29005 const newAttrs = {}; 29006 if (value.hasOwnProperty("width")) { 29007 newAttrs.featuredImageSizeWidth = value.width; 29008 } 29009 if (value.hasOwnProperty("height")) { 29010 newAttrs.featuredImageSizeHeight = value.height; 29011 } 29012 setAttributes(newAttrs); 29013 }, 29014 slug: featuredImageSizeSlug, 29015 width: featuredImageSizeWidth, 29016 height: featuredImageSizeHeight, 29017 imageWidth: defaultImageWidth, 29018 imageHeight: defaultImageHeight, 29019 imageSizeOptions, 29020 imageSizeHelp: (0, import_i18n93.__)( 29021 "Select the size of the source image." 29022 ), 29023 onChangeImage: (value) => setAttributes({ 29024 featuredImageSizeSlug: value, 29025 featuredImageSizeWidth: void 0, 29026 featuredImageSizeHeight: void 0 29027 }) 29028 } 29029 ) 29030 } 29031 ), 29032 /* @__PURE__ */ (0, import_jsx_runtime267.jsx)( 29033 import_components53.__experimentalToolsPanelItem, 29034 { 29035 hasValue: () => !!featuredImageAlign, 29036 label: (0, import_i18n93.__)("Image alignment"), 29037 onDeselect: () => setAttributes({ 29038 featuredImageAlign: void 0 29039 }), 29040 isShownByDefault: true, 29041 children: /* @__PURE__ */ (0, import_jsx_runtime267.jsx)( 29042 import_components53.__experimentalToggleGroupControl, 29043 { 29044 className: "editor-latest-posts-image-alignment-control", 29045 __next40pxDefaultSize: true, 29046 label: (0, import_i18n93.__)("Image alignment"), 29047 value: featuredImageAlign || "none", 29048 onChange: (value) => setAttributes({ 29049 featuredImageAlign: value !== "none" ? value : void 0 29050 }), 29051 children: imageAlignmentOptions.map( 29052 ({ value, icon, label }) => { 29053 return /* @__PURE__ */ (0, import_jsx_runtime267.jsx)( 29054 import_components53.__experimentalToggleGroupControlOptionIcon, 29055 { 29056 value, 29057 icon, 29058 label 29059 }, 29060 value 29061 ); 29062 } 29063 ) 29064 } 29065 ) 29066 } 29067 ), 29068 /* @__PURE__ */ (0, import_jsx_runtime267.jsx)( 29069 import_components53.__experimentalToolsPanelItem, 29070 { 29071 hasValue: () => !!addLinkToFeaturedImage, 29072 label: (0, import_i18n93.__)("Add link to featured image"), 29073 onDeselect: () => setAttributes({ 29074 addLinkToFeaturedImage: false 29075 }), 29076 isShownByDefault: true, 29077 children: /* @__PURE__ */ (0, import_jsx_runtime267.jsx)( 29078 import_components53.ToggleControl, 29079 { 29080 label: (0, import_i18n93.__)("Add link to featured image"), 29081 checked: addLinkToFeaturedImage, 29082 onChange: (value) => setAttributes({ 29083 addLinkToFeaturedImage: value 29084 }) 29085 } 29086 ) 29087 } 29088 ) 29089 ] }) 29090 ] 29091 } 29092 ), 29093 /* @__PURE__ */ (0, import_jsx_runtime267.jsxs)( 29094 import_components53.__experimentalToolsPanel, 29095 { 29096 label: (0, import_i18n93.__)("Sorting and filtering"), 29097 resetAll: () => setAttributes({ 29098 order: "desc", 29099 orderBy: "date", 29100 postsToShow: 5, 29101 categories: void 0, 29102 selectedAuthor: void 0, 29103 columns: 3 29104 }), 29105 dropdownMenuProps, 29106 children: [ 29107 /* @__PURE__ */ (0, import_jsx_runtime267.jsx)( 29108 import_components53.__experimentalToolsPanelItem, 29109 { 29110 hasValue: () => order !== "desc" || orderBy !== "date" || postsToShow !== 5 || categories?.length > 0 || !!selectedAuthor, 29111 label: (0, import_i18n93.__)("Sort and filter"), 29112 onDeselect: () => setAttributes({ 29113 order: "desc", 29114 orderBy: "date", 29115 postsToShow: 5, 29116 categories: void 0, 29117 selectedAuthor: void 0 29118 }), 29119 isShownByDefault: true, 29120 children: /* @__PURE__ */ (0, import_jsx_runtime267.jsx)( 29121 import_components53.QueryControls, 29122 { 29123 ...{ order, orderBy }, 29124 numberOfItems: postsToShow, 29125 onOrderChange: (value) => setAttributes({ order: value }), 29126 onOrderByChange: (value) => setAttributes({ orderBy: value }), 29127 onNumberOfItemsChange: (value) => setAttributes({ postsToShow: value }), 29128 categorySuggestions, 29129 onCategoryChange: selectCategories, 29130 selectedCategories: categories, 29131 onAuthorChange: (value) => setAttributes({ 29132 selectedAuthor: "" !== value ? Number(value) : void 0 29133 }), 29134 authorList: authorList ?? [], 29135 selectedAuthorId: selectedAuthor 29136 } 29137 ) 29138 } 29139 ), 29140 postLayout === "grid" && /* @__PURE__ */ (0, import_jsx_runtime267.jsx)( 29141 import_components53.__experimentalToolsPanelItem, 29142 { 29143 hasValue: () => columns !== 3, 29144 label: (0, import_i18n93.__)("Columns"), 29145 onDeselect: () => setAttributes({ 29146 columns: 3 29147 }), 29148 isShownByDefault: true, 29149 children: /* @__PURE__ */ (0, import_jsx_runtime267.jsx)( 29150 import_components53.RangeControl, 29151 { 29152 __next40pxDefaultSize: true, 29153 label: (0, import_i18n93.__)("Columns"), 29154 value: columns, 29155 onChange: (value) => setAttributes({ columns: value }), 29156 min: 2, 29157 max: !postCount ? MAX_POSTS_COLUMNS : Math.min(MAX_POSTS_COLUMNS, postCount), 29158 required: true 29159 } 29160 ) 29161 } 29162 ) 29163 ] 29164 } 29165 ) 29166 ] }); 29167 } 29168 function LatestPostsEdit({ attributes: attributes3, setAttributes }) { 29169 const instanceId = (0, import_compose21.useInstanceId)(LatestPostsEdit); 29170 const { 29171 postsToShow, 29172 order, 29173 orderBy, 29174 categories, 29175 selectedAuthor, 29176 displayFeaturedImage, 29177 displayPostContentRadio, 29178 displayPostContent, 29179 displayPostDate, 29180 displayAuthor, 29181 postLayout, 29182 columns, 29183 excerptLength, 29184 featuredImageAlign, 29185 featuredImageSizeSlug, 29186 featuredImageSizeWidth, 29187 featuredImageSizeHeight, 29188 addLinkToFeaturedImage 29189 } = attributes3; 29190 const { latestPosts } = (0, import_data45.useSelect)( 29191 (select9) => { 29192 const { getEntityRecords } = select9(import_core_data23.store); 29193 const catIds = categories && categories.length > 0 ? categories.map((cat) => cat.id) : []; 29194 const latestPostsQuery = Object.fromEntries( 29195 Object.entries({ 29196 categories: catIds, 29197 author: selectedAuthor, 29198 order, 29199 orderby: orderBy, 29200 per_page: postsToShow, 29201 _embed: "author,wp:featuredmedia", 29202 ignore_sticky: true 29203 }).filter(([, value]) => typeof value !== "undefined") 29204 ); 29205 return { 29206 latestPosts: getEntityRecords( 29207 "postType", 29208 "post", 29209 latestPostsQuery 29210 ) 29211 }; 29212 }, 29213 [postsToShow, order, orderBy, categories, selectedAuthor] 29214 ); 29215 const { createWarningNotice } = (0, import_data45.useDispatch)(import_notices9.store); 29216 const showRedirectionPreventedNotice = (event) => { 29217 event.preventDefault(); 29218 createWarningNotice((0, import_i18n93.__)("Links are disabled in the editor."), { 29219 id: `block-library/core/latest-posts/redirection-prevented/$instanceId}`, 29220 type: "snackbar" 29221 }); 29222 }; 29223 const hasPosts = !!latestPosts?.length; 29224 const inspectorControls = /* @__PURE__ */ (0, import_jsx_runtime267.jsx)(import_block_editor114.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime267.jsx)( 29225 Controls, 29226 { 29227 attributes: attributes3, 29228 setAttributes, 29229 postCount: latestPosts?.length ?? 0 29230 } 29231 ) }); 29232 const blockProps = (0, import_block_editor114.useBlockProps)({ 29233 className: clsx_default({ 29234 "wp-block-latest-posts__list": true, 29235 "is-grid": postLayout === "grid", 29236 "has-dates": displayPostDate, 29237 "has-author": displayAuthor, 29238 [`columns-$columns}`]: postLayout === "grid" 29239 }) 29240 }); 29241 if (!hasPosts) { 29242 return /* @__PURE__ */ (0, import_jsx_runtime267.jsxs)("div", { ...blockProps, children: [ 29243 inspectorControls, 29244 /* @__PURE__ */ (0, import_jsx_runtime267.jsx)(import_components53.Placeholder, { icon: pin_default, label: (0, import_i18n93.__)("Latest Posts"), children: !Array.isArray(latestPosts) ? /* @__PURE__ */ (0, import_jsx_runtime267.jsx)(import_components53.Spinner, {}) : (0, import_i18n93.__)("No posts found.") }) 29245 ] }); 29246 } 29247 const displayPosts = latestPosts.length > postsToShow ? latestPosts.slice(0, postsToShow) : latestPosts; 29248 const layoutControls = [ 29249 { 29250 icon: list_default, 29251 title: (0, import_i18n93._x)("List view", "Latest posts block display setting"), 29252 onClick: () => setAttributes({ postLayout: "list" }), 29253 isActive: postLayout === "list" 29254 }, 29255 { 29256 icon: grid_default, 29257 title: (0, import_i18n93._x)("Grid view", "Latest posts block display setting"), 29258 onClick: () => setAttributes({ postLayout: "grid" }), 29259 isActive: postLayout === "grid" 29260 } 29261 ]; 29262 const dateFormat = (0, import_date2.getSettings)().formats.date; 29263 return /* @__PURE__ */ (0, import_jsx_runtime267.jsxs)(import_jsx_runtime267.Fragment, { children: [ 29264 inspectorControls, 29265 /* @__PURE__ */ (0, import_jsx_runtime267.jsx)(import_block_editor114.BlockControls, { children: /* @__PURE__ */ (0, import_jsx_runtime267.jsx)(import_components53.ToolbarGroup, { controls: layoutControls }) }), 29266 /* @__PURE__ */ (0, import_jsx_runtime267.jsx)("ul", { ...blockProps, children: displayPosts.map((post) => { 29267 const titleTrimmed = post.title.rendered.trim(); 29268 let excerpt = post.excerpt.rendered; 29269 const currentAuthor = getCurrentAuthor(post); 29270 const excerptElement = document.createElement("div"); 29271 excerptElement.innerHTML = excerpt; 29272 excerpt = excerptElement.textContent || excerptElement.innerText || ""; 29273 const { url: imageSourceUrl, alt: featuredImageAlt } = getFeaturedImageDetails(post, featuredImageSizeSlug); 29274 const imageClasses = clsx_default({ 29275 "wp-block-latest-posts__featured-image": true, 29276 [`align$featuredImageAlign}`]: !!featuredImageAlign 29277 }); 29278 const renderFeaturedImage = displayFeaturedImage && imageSourceUrl; 29279 const featuredImage = renderFeaturedImage && /* @__PURE__ */ (0, import_jsx_runtime267.jsx)( 29280 "img", 29281 { 29282 src: imageSourceUrl, 29283 alt: featuredImageAlt, 29284 style: { 29285 maxWidth: featuredImageSizeWidth, 29286 maxHeight: featuredImageSizeHeight 29287 } 29288 } 29289 ); 29290 const needsReadMore = excerptLength < excerpt.trim().split(" ").length && post.excerpt.raw === ""; 29291 const postExcerpt = needsReadMore ? /* @__PURE__ */ (0, import_jsx_runtime267.jsxs)(import_jsx_runtime267.Fragment, { children: [ 29292 excerpt.trim().split(" ", excerptLength).join(" "), 29293 (0, import_element45.createInterpolateElement)( 29294 (0, import_i18n93.sprintf)( 29295 /* translators: 1: Hidden accessibility text: Post title */ 29296 (0, import_i18n93.__)( 29297 "\u2026 <a>Read more<span>: %1$s</span></a>" 29298 ), 29299 titleTrimmed || (0, import_i18n93.__)("(no title)") 29300 ), 29301 { 29302 a: ( 29303 // eslint-disable-next-line jsx-a11y/anchor-has-content 29304 /* @__PURE__ */ (0, import_jsx_runtime267.jsx)( 29305 "a", 29306 { 29307 className: "wp-block-latest-posts__read-more", 29308 href: post.link, 29309 rel: "noopener noreferrer", 29310 onClick: showRedirectionPreventedNotice 29311 } 29312 ) 29313 ), 29314 span: /* @__PURE__ */ (0, import_jsx_runtime267.jsx)("span", { className: "screen-reader-text" }) 29315 } 29316 ) 29317 ] }) : excerpt; 29318 return /* @__PURE__ */ (0, import_jsx_runtime267.jsxs)("li", { children: [ 29319 renderFeaturedImage && /* @__PURE__ */ (0, import_jsx_runtime267.jsx)("div", { className: imageClasses, children: addLinkToFeaturedImage ? /* @__PURE__ */ (0, import_jsx_runtime267.jsx)( 29320 "a", 29321 { 29322 href: post.link, 29323 onClick: showRedirectionPreventedNotice, 29324 children: featuredImage 29325 } 29326 ) : featuredImage }), 29327 /* @__PURE__ */ (0, import_jsx_runtime267.jsx)( 29328 "a", 29329 { 29330 className: "wp-block-latest-posts__post-title", 29331 href: post.link, 29332 dangerouslySetInnerHTML: !!titleTrimmed ? { 29333 __html: titleTrimmed 29334 } : void 0, 29335 onClick: showRedirectionPreventedNotice, 29336 children: !titleTrimmed ? (0, import_i18n93.__)("(no title)") : null 29337 } 29338 ), 29339 displayAuthor && currentAuthor && /* @__PURE__ */ (0, import_jsx_runtime267.jsx)("div", { className: "wp-block-latest-posts__post-author", children: (0, import_i18n93.sprintf)( 29340 /* translators: byline. %s: author. */ 29341 (0, import_i18n93.__)("by %s"), 29342 currentAuthor.name 29343 ) }), 29344 displayPostDate && post.date_gmt && /* @__PURE__ */ (0, import_jsx_runtime267.jsx)( 29345 "time", 29346 { 29347 dateTime: (0, import_date2.format)("c", post.date_gmt), 29348 className: "wp-block-latest-posts__post-date", 29349 children: (0, import_date2.dateI18n)(dateFormat, post.date_gmt) 29350 } 29351 ), 29352 displayPostContent && displayPostContentRadio === "excerpt" && /* @__PURE__ */ (0, import_jsx_runtime267.jsx)("div", { className: "wp-block-latest-posts__post-excerpt", children: postExcerpt }), 29353 displayPostContent && displayPostContentRadio === "full_post" && /* @__PURE__ */ (0, import_jsx_runtime267.jsx)( 29354 "div", 29355 { 29356 className: "wp-block-latest-posts__post-full-content", 29357 dangerouslySetInnerHTML: { 29358 __html: post.content.raw.trim() 29359 } 29360 } 29361 ) 29362 ] }, post.id); 29363 }) }) 29364 ] }); 29365 } 29366 29367 // packages/block-library/build-module/latest-posts/index.js 29368 var { name: name45 } = block_default45; 29369 var settings45 = { 29370 icon: post_list_default, 29371 example: {}, 29372 edit: LatestPostsEdit, 29373 deprecated: deprecated_default21 29374 }; 29375 var init45 = () => initBlock({ name: name45, metadata: block_default45, settings: settings45 }); 29376 29377 // packages/block-library/build-module/list/index.js 29378 var list_exports = {}; 29379 __export(list_exports, { 29380 init: () => init46, 29381 metadata: () => block_default46, 29382 name: () => name46, 29383 settings: () => settings46 29384 }); 29385 var import_i18n96 = __toESM(require_i18n()); 29386 29387 // packages/block-library/build-module/list/deprecated.js 29388 var import_block_editor115 = __toESM(require_block_editor()); 29389 29390 // packages/block-library/build-module/list/utils.js 29391 var import_blocks41 = __toESM(require_blocks()); 29392 var LIST_STYLES = { 29393 A: "upper-alpha", 29394 a: "lower-alpha", 29395 I: "upper-roman", 29396 i: "lower-roman" 29397 }; 29398 function createListBlockFromDOMElement(listElement) { 29399 const type = listElement.getAttribute("type"); 29400 const listAttributes = { 29401 ordered: "OL" === listElement.tagName, 29402 anchor: listElement.id ? listElement.id : void 0, 29403 start: listElement.getAttribute("start") ? parseInt(listElement.getAttribute("start"), 10) : void 0, 29404 reversed: listElement.hasAttribute("reversed") ? true : void 0, 29405 type: type && LIST_STYLES[type] ? LIST_STYLES[type] : void 0 29406 }; 29407 const innerBlocks = Array.from(listElement.children).map( 29408 (listItem) => { 29409 const children = Array.from(listItem.childNodes).filter( 29410 (node) => node.nodeType !== node.TEXT_NODE || node.textContent.trim().length !== 0 29411 ); 29412 children.reverse(); 29413 const [nestedList, ...nodes] = children; 29414 const hasNestedList = nestedList?.tagName === "UL" || nestedList?.tagName === "OL"; 29415 if (!hasNestedList) { 29416 return (0, import_blocks41.createBlock)("core/list-item", { 29417 content: listItem.innerHTML 29418 }); 29419 } 29420 const htmlNodes = nodes.map((node) => { 29421 if (node.nodeType === node.TEXT_NODE) { 29422 return node.textContent; 29423 } 29424 return node.outerHTML; 29425 }); 29426 htmlNodes.reverse(); 29427 const childAttributes = { 29428 content: htmlNodes.join("").trim() 29429 }; 29430 const childInnerBlocks = [ 29431 createListBlockFromDOMElement(nestedList) 29432 ]; 29433 return (0, import_blocks41.createBlock)( 29434 "core/list-item", 29435 childAttributes, 29436 childInnerBlocks 29437 ); 29438 } 29439 ); 29440 return (0, import_blocks41.createBlock)("core/list", listAttributes, innerBlocks); 29441 } 29442 function migrateToListV2(attributes3) { 29443 const { values, start, reversed, ordered, type, ...otherAttributes } = attributes3; 29444 const list = document.createElement(ordered ? "ol" : "ul"); 29445 list.innerHTML = values; 29446 if (start) { 29447 list.setAttribute("start", start); 29448 } 29449 if (reversed) { 29450 list.setAttribute("reversed", true); 29451 } 29452 if (type) { 29453 list.setAttribute("type", type); 29454 } 29455 const [listBlock] = (0, import_blocks41.rawHandler)({ HTML: list.outerHTML }); 29456 return [ 29457 { ...otherAttributes, ...listBlock.attributes }, 29458 listBlock.innerBlocks 29459 ]; 29460 } 29461 function migrateTypeToInlineStyle(attributes3) { 29462 const { type } = attributes3; 29463 if (type && LIST_STYLES[type]) { 29464 return { 29465 ...attributes3, 29466 type: LIST_STYLES[type] 29467 }; 29468 } 29469 return attributes3; 29470 } 29471 29472 // packages/block-library/build-module/list/deprecated.js 29473 var import_jsx_runtime268 = __toESM(require_jsx_runtime()); 29474 var v0 = { 29475 attributes: { 29476 ordered: { 29477 type: "boolean", 29478 default: false, 29479 role: "content" 29480 }, 29481 values: { 29482 type: "string", 29483 source: "html", 29484 selector: "ol,ul", 29485 multiline: "li", 29486 __unstableMultilineWrapperTags: ["ol", "ul"], 29487 default: "", 29488 role: "content" 29489 }, 29490 type: { 29491 type: "string" 29492 }, 29493 start: { 29494 type: "number" 29495 }, 29496 reversed: { 29497 type: "boolean" 29498 }, 29499 placeholder: { 29500 type: "string" 29501 } 29502 }, 29503 supports: { 29504 anchor: true, 29505 className: false, 29506 typography: { 29507 fontSize: true, 29508 __experimentalFontFamily: true 29509 }, 29510 color: { 29511 gradients: true, 29512 link: true 29513 }, 29514 __unstablePasteTextInline: true, 29515 __experimentalSelector: "ol,ul", 29516 __experimentalSlashInserter: true 29517 }, 29518 save({ attributes: attributes3 }) { 29519 const { ordered, values, type, reversed, start } = attributes3; 29520 const TagName2 = ordered ? "ol" : "ul"; 29521 return /* @__PURE__ */ (0, import_jsx_runtime268.jsx)(TagName2, { ...import_block_editor115.useBlockProps.save({ type, reversed, start }), children: /* @__PURE__ */ (0, import_jsx_runtime268.jsx)(import_block_editor115.RichText.Content, { value: values, multiline: "li" }) }); 29522 }, 29523 migrate: migrate_font_family_default, 29524 isEligible({ style: style2 }) { 29525 return style2?.typography?.fontFamily; 29526 } 29527 }; 29528 var v117 = { 29529 attributes: { 29530 ordered: { 29531 type: "boolean", 29532 default: false, 29533 role: "content" 29534 }, 29535 values: { 29536 type: "string", 29537 source: "html", 29538 selector: "ol,ul", 29539 multiline: "li", 29540 __unstableMultilineWrapperTags: ["ol", "ul"], 29541 default: "", 29542 role: "content" 29543 }, 29544 type: { 29545 type: "string" 29546 }, 29547 start: { 29548 type: "number" 29549 }, 29550 reversed: { 29551 type: "boolean" 29552 }, 29553 placeholder: { 29554 type: "string" 29555 } 29556 }, 29557 supports: { 29558 anchor: true, 29559 className: false, 29560 typography: { 29561 fontSize: true, 29562 __experimentalFontFamily: true, 29563 lineHeight: true, 29564 __experimentalFontStyle: true, 29565 __experimentalFontWeight: true, 29566 __experimentalLetterSpacing: true, 29567 __experimentalTextTransform: true, 29568 __experimentalDefaultControls: { 29569 fontSize: true 29570 } 29571 }, 29572 color: { 29573 gradients: true, 29574 link: true, 29575 __experimentalDefaultControls: { 29576 background: true, 29577 text: true 29578 } 29579 }, 29580 __unstablePasteTextInline: true, 29581 __experimentalSelector: "ol,ul", 29582 __experimentalSlashInserter: true 29583 }, 29584 save({ attributes: attributes3 }) { 29585 const { ordered, values, type, reversed, start } = attributes3; 29586 const TagName2 = ordered ? "ol" : "ul"; 29587 return /* @__PURE__ */ (0, import_jsx_runtime268.jsx)(TagName2, { ...import_block_editor115.useBlockProps.save({ type, reversed, start }), children: /* @__PURE__ */ (0, import_jsx_runtime268.jsx)(import_block_editor115.RichText.Content, { value: values, multiline: "li" }) }); 29588 }, 29589 migrate: migrateToListV2 29590 }; 29591 var v28 = { 29592 attributes: { 29593 ordered: { 29594 type: "boolean", 29595 default: false, 29596 role: "content" 29597 }, 29598 values: { 29599 type: "string", 29600 source: "html", 29601 selector: "ol,ul", 29602 multiline: "li", 29603 __unstableMultilineWrapperTags: ["ol", "ul"], 29604 default: "", 29605 role: "content" 29606 }, 29607 type: { 29608 type: "string" 29609 }, 29610 start: { 29611 type: "number" 29612 }, 29613 reversed: { 29614 type: "boolean" 29615 }, 29616 placeholder: { 29617 type: "string" 29618 } 29619 }, 29620 supports: { 29621 anchor: true, 29622 className: false, 29623 typography: { 29624 fontSize: true, 29625 lineHeight: true, 29626 __experimentalFontFamily: true, 29627 __experimentalFontWeight: true, 29628 __experimentalFontStyle: true, 29629 __experimentalTextTransform: true, 29630 __experimentalTextDecoration: true, 29631 __experimentalLetterSpacing: true, 29632 __experimentalDefaultControls: { 29633 fontSize: true 29634 } 29635 }, 29636 color: { 29637 gradients: true, 29638 link: true, 29639 __experimentalDefaultControls: { 29640 background: true, 29641 text: true 29642 } 29643 }, 29644 spacing: { 29645 margin: true, 29646 padding: true, 29647 __experimentalDefaultControls: { 29648 margin: false, 29649 padding: false 29650 } 29651 }, 29652 __unstablePasteTextInline: true, 29653 __experimentalSelector: "ol,ul", 29654 __experimentalSlashInserter: true 29655 }, 29656 isEligible({ type }) { 29657 return !!type; 29658 }, 29659 save({ attributes: attributes3 }) { 29660 const { ordered, type, reversed, start } = attributes3; 29661 const TagName2 = ordered ? "ol" : "ul"; 29662 return /* @__PURE__ */ (0, import_jsx_runtime268.jsx)(TagName2, { ...import_block_editor115.useBlockProps.save({ type, reversed, start }), children: /* @__PURE__ */ (0, import_jsx_runtime268.jsx)(import_block_editor115.InnerBlocks.Content, {}) }); 29663 }, 29664 migrate: migrateTypeToInlineStyle 29665 }; 29666 var v36 = { 29667 attributes: { 29668 ordered: { 29669 type: "boolean", 29670 default: false, 29671 role: "content" 29672 }, 29673 values: { 29674 type: "string", 29675 source: "html", 29676 selector: "ol,ul", 29677 multiline: "li", 29678 __unstableMultilineWrapperTags: ["ol", "ul"], 29679 default: "", 29680 role: "content" 29681 }, 29682 type: { 29683 type: "string" 29684 }, 29685 start: { 29686 type: "number" 29687 }, 29688 reversed: { 29689 type: "boolean" 29690 }, 29691 placeholder: { 29692 type: "string" 29693 } 29694 }, 29695 supports: { 29696 anchor: true, 29697 className: false, 29698 typography: { 29699 fontSize: true, 29700 lineHeight: true, 29701 __experimentalFontFamily: true, 29702 __experimentalFontWeight: true, 29703 __experimentalFontStyle: true, 29704 __experimentalTextTransform: true, 29705 __experimentalTextDecoration: true, 29706 __experimentalLetterSpacing: true, 29707 __experimentalDefaultControls: { 29708 fontSize: true 29709 } 29710 }, 29711 color: { 29712 gradients: true, 29713 link: true, 29714 __experimentalDefaultControls: { 29715 background: true, 29716 text: true 29717 } 29718 }, 29719 spacing: { 29720 margin: true, 29721 padding: true, 29722 __experimentalDefaultControls: { 29723 margin: false, 29724 padding: false 29725 } 29726 }, 29727 __unstablePasteTextInline: true, 29728 __experimentalSelector: "ol,ul", 29729 __experimentalOnMerge: "true", 29730 __experimentalSlashInserter: true 29731 }, 29732 save({ attributes: attributes3 }) { 29733 const { ordered, type, reversed, start } = attributes3; 29734 const TagName2 = ordered ? "ol" : "ul"; 29735 return /* @__PURE__ */ (0, import_jsx_runtime268.jsx)( 29736 TagName2, 29737 { 29738 ...import_block_editor115.useBlockProps.save({ 29739 reversed, 29740 start, 29741 style: { 29742 listStyleType: ordered && type !== "decimal" ? type : void 0 29743 } 29744 }), 29745 children: /* @__PURE__ */ (0, import_jsx_runtime268.jsx)(import_block_editor115.InnerBlocks.Content, {}) 29746 } 29747 ); 29748 } 29749 }; 29750 var deprecated_default22 = [v36, v28, v117, v0]; 29751 29752 // packages/block-library/build-module/list/edit.js 29753 var import_block_editor117 = __toESM(require_block_editor()); 29754 var import_components55 = __toESM(require_components()); 29755 var import_data46 = __toESM(require_data()); 29756 var import_i18n95 = __toESM(require_i18n()); 29757 var import_blocks42 = __toESM(require_blocks()); 29758 var import_element48 = __toESM(require_element()); 29759 var import_deprecated23 = __toESM(require_deprecated()); 29760 29761 // packages/block-library/build-module/list/ordered-list-settings.js 29762 var import_i18n94 = __toESM(require_i18n()); 29763 var import_block_editor116 = __toESM(require_block_editor()); 29764 var import_components54 = __toESM(require_components()); 29765 var import_element46 = __toESM(require_element()); 29766 var import_jsx_runtime269 = __toESM(require_jsx_runtime()); 29767 var LIST_STYLE_OPTIONS = [ 29768 { 29769 label: (0, import_i18n94.__)("Numbers"), 29770 value: "decimal" 29771 }, 29772 { 29773 label: (0, import_i18n94.__)("Uppercase letters"), 29774 value: "upper-alpha" 29775 }, 29776 { 29777 label: (0, import_i18n94.__)("Lowercase letters"), 29778 value: "lower-alpha" 29779 }, 29780 { 29781 label: (0, import_i18n94.__)("Uppercase Roman numerals"), 29782 value: "upper-roman" 29783 }, 29784 { 29785 label: (0, import_i18n94.__)("Lowercase Roman numerals"), 29786 value: "lower-roman" 29787 } 29788 ]; 29789 var OrderedListSettings = ({ setAttributes, reversed, start, type }) => { 29790 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 29791 return /* @__PURE__ */ (0, import_jsx_runtime269.jsx)(import_block_editor116.InspectorControls, { children: import_element46.Platform.isNative ? /* @__PURE__ */ (0, import_jsx_runtime269.jsxs)(import_components54.PanelBody, { title: (0, import_i18n94.__)("Settings"), children: [ 29792 /* @__PURE__ */ (0, import_jsx_runtime269.jsx)( 29793 import_components54.SelectControl, 29794 { 29795 __next40pxDefaultSize: true, 29796 label: (0, import_i18n94.__)("List style"), 29797 options: LIST_STYLE_OPTIONS, 29798 value: type, 29799 onChange: (newValue) => setAttributes({ type: newValue }) 29800 } 29801 ), 29802 /* @__PURE__ */ (0, import_jsx_runtime269.jsx)( 29803 import_components54.TextControl, 29804 { 29805 __next40pxDefaultSize: true, 29806 label: (0, import_i18n94.__)("Start value"), 29807 type: "number", 29808 onChange: (value) => { 29809 const int = parseInt(value, 10); 29810 setAttributes({ 29811 // It should be possible to unset the value, 29812 // e.g. with an empty string. 29813 start: isNaN(int) ? void 0 : int 29814 }); 29815 }, 29816 value: Number.isInteger(start) ? start.toString(10) : "", 29817 step: "1" 29818 } 29819 ), 29820 /* @__PURE__ */ (0, import_jsx_runtime269.jsx)( 29821 import_components54.ToggleControl, 29822 { 29823 label: (0, import_i18n94.__)("Reverse order"), 29824 checked: reversed || false, 29825 onChange: (value) => { 29826 setAttributes({ 29827 // Unset the attribute if not reversed. 29828 reversed: value || void 0 29829 }); 29830 } 29831 } 29832 ) 29833 ] }) : /* @__PURE__ */ (0, import_jsx_runtime269.jsxs)( 29834 import_components54.__experimentalToolsPanel, 29835 { 29836 label: (0, import_i18n94.__)("Settings"), 29837 resetAll: () => { 29838 setAttributes({ 29839 type: void 0, 29840 start: void 0, 29841 reversed: void 0 29842 }); 29843 }, 29844 dropdownMenuProps, 29845 children: [ 29846 /* @__PURE__ */ (0, import_jsx_runtime269.jsx)( 29847 import_components54.__experimentalToolsPanelItem, 29848 { 29849 label: (0, import_i18n94.__)("List style"), 29850 isShownByDefault: true, 29851 hasValue: () => !!type, 29852 onDeselect: () => setAttributes({ 29853 type: void 0 29854 }), 29855 children: /* @__PURE__ */ (0, import_jsx_runtime269.jsx)( 29856 import_components54.SelectControl, 29857 { 29858 __next40pxDefaultSize: true, 29859 label: (0, import_i18n94.__)("List style"), 29860 options: LIST_STYLE_OPTIONS, 29861 value: type || "decimal", 29862 onChange: (newValue) => setAttributes({ type: newValue }) 29863 } 29864 ) 29865 } 29866 ), 29867 /* @__PURE__ */ (0, import_jsx_runtime269.jsx)( 29868 import_components54.__experimentalToolsPanelItem, 29869 { 29870 label: (0, import_i18n94.__)("Start value"), 29871 isShownByDefault: true, 29872 hasValue: () => !!start, 29873 onDeselect: () => setAttributes({ 29874 start: void 0 29875 }), 29876 children: /* @__PURE__ */ (0, import_jsx_runtime269.jsx)( 29877 import_components54.TextControl, 29878 { 29879 __next40pxDefaultSize: true, 29880 label: (0, import_i18n94.__)("Start value"), 29881 type: "number", 29882 onChange: (value) => { 29883 const int = parseInt(value, 10); 29884 setAttributes({ 29885 // It should be possible to unset the value, 29886 // e.g. with an empty string. 29887 start: isNaN(int) ? void 0 : int 29888 }); 29889 }, 29890 value: Number.isInteger(start) ? start.toString(10) : "", 29891 step: "1" 29892 } 29893 ) 29894 } 29895 ), 29896 /* @__PURE__ */ (0, import_jsx_runtime269.jsx)( 29897 import_components54.__experimentalToolsPanelItem, 29898 { 29899 label: (0, import_i18n94.__)("Reverse order"), 29900 isShownByDefault: true, 29901 hasValue: () => !!reversed, 29902 onDeselect: () => setAttributes({ 29903 reversed: void 0 29904 }), 29905 children: /* @__PURE__ */ (0, import_jsx_runtime269.jsx)( 29906 import_components54.ToggleControl, 29907 { 29908 label: (0, import_i18n94.__)("Reverse order"), 29909 checked: reversed || false, 29910 onChange: (value) => { 29911 setAttributes({ 29912 // Unset the attribute if not reversed. 29913 reversed: value || void 0 29914 }); 29915 } 29916 } 29917 ) 29918 } 29919 ) 29920 ] 29921 } 29922 ) }); 29923 }; 29924 var ordered_list_settings_default = OrderedListSettings; 29925 29926 // packages/block-library/build-module/list/tag-name.js 29927 var import_element47 = __toESM(require_element()); 29928 var import_jsx_runtime270 = __toESM(require_jsx_runtime()); 29929 function TagName(props, ref) { 29930 const { ordered, ...extraProps } = props; 29931 const Tag = ordered ? "ol" : "ul"; 29932 return /* @__PURE__ */ (0, import_jsx_runtime270.jsx)(Tag, { ref, ...extraProps }); 29933 } 29934 var tag_name_default = (0, import_element47.forwardRef)(TagName); 29935 29936 // packages/block-library/build-module/list/edit.js 29937 var import_jsx_runtime271 = __toESM(require_jsx_runtime()); 29938 var DEFAULT_BLOCK4 = { 29939 name: "core/list-item" 29940 }; 29941 var TEMPLATE8 = [["core/list-item"]]; 29942 var NATIVE_MARGIN_SPACING = 8; 29943 function useMigrateOnLoad(attributes3, clientId) { 29944 const registry = (0, import_data46.useRegistry)(); 29945 const { updateBlockAttributes, replaceInnerBlocks } = (0, import_data46.useDispatch)(import_block_editor117.store); 29946 (0, import_element48.useEffect)(() => { 29947 if (!attributes3.values) { 29948 return; 29949 } 29950 const [newAttributes, newInnerBlocks] = migrateToListV2(attributes3); 29951 (0, import_deprecated23.default)("Value attribute on the list block", { 29952 since: "6.0", 29953 version: "6.5", 29954 alternative: "inner blocks" 29955 }); 29956 registry.batch(() => { 29957 updateBlockAttributes(clientId, newAttributes); 29958 replaceInnerBlocks(clientId, newInnerBlocks); 29959 }); 29960 }, [attributes3.values]); 29961 } 29962 function useOutdentList(clientId) { 29963 const { replaceBlocks, selectionChange } = (0, import_data46.useDispatch)(import_block_editor117.store); 29964 const { getBlockRootClientId, getBlockAttributes: getBlockAttributes4, getBlock } = (0, import_data46.useSelect)(import_block_editor117.store); 29965 return (0, import_element48.useCallback)(() => { 29966 const parentBlockId = getBlockRootClientId(clientId); 29967 const parentBlockAttributes = getBlockAttributes4(parentBlockId); 29968 const newParentBlock = (0, import_blocks42.createBlock)( 29969 "core/list-item", 29970 parentBlockAttributes 29971 ); 29972 const { innerBlocks } = getBlock(clientId); 29973 replaceBlocks([parentBlockId], [newParentBlock, ...innerBlocks]); 29974 selectionChange(innerBlocks[innerBlocks.length - 1].clientId); 29975 }, [clientId]); 29976 } 29977 function IndentUI({ clientId }) { 29978 const outdentList = useOutdentList(clientId); 29979 const canOutdent = (0, import_data46.useSelect)( 29980 (select9) => { 29981 const { getBlockRootClientId, getBlockName } = select9(import_block_editor117.store); 29982 return getBlockName(getBlockRootClientId(clientId)) === "core/list-item"; 29983 }, 29984 [clientId] 29985 ); 29986 return /* @__PURE__ */ (0, import_jsx_runtime271.jsx)(import_jsx_runtime271.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime271.jsx)( 29987 import_components55.ToolbarButton, 29988 { 29989 icon: (0, import_i18n95.isRTL)() ? format_outdent_rtl_default : format_outdent_default, 29990 title: (0, import_i18n95.__)("Outdent"), 29991 description: (0, import_i18n95.__)("Outdent list item"), 29992 disabled: !canOutdent, 29993 onClick: outdentList 29994 } 29995 ) }); 29996 } 29997 function Edit16({ attributes: attributes3, setAttributes, clientId, style: style2 }) { 29998 const { ordered, type, reversed, start } = attributes3; 29999 const blockProps = (0, import_block_editor117.useBlockProps)({ 30000 style: { 30001 ...import_element48.Platform.isNative && style2, 30002 listStyleType: ordered && type !== "decimal" ? type : void 0 30003 } 30004 }); 30005 const innerBlocksProps = (0, import_block_editor117.useInnerBlocksProps)(blockProps, { 30006 defaultBlock: DEFAULT_BLOCK4, 30007 directInsert: true, 30008 template: TEMPLATE8, 30009 templateLock: false, 30010 templateInsertUpdatesSelection: true, 30011 ...import_element48.Platform.isNative && { 30012 marginVertical: NATIVE_MARGIN_SPACING, 30013 marginHorizontal: NATIVE_MARGIN_SPACING, 30014 renderAppender: false 30015 }, 30016 __experimentalCaptureToolbars: true 30017 }); 30018 useMigrateOnLoad(attributes3, clientId); 30019 const controls = /* @__PURE__ */ (0, import_jsx_runtime271.jsxs)(import_block_editor117.BlockControls, { group: "block", children: [ 30020 /* @__PURE__ */ (0, import_jsx_runtime271.jsx)( 30021 import_components55.ToolbarButton, 30022 { 30023 icon: (0, import_i18n95.isRTL)() ? format_list_bullets_rtl_default : format_list_bullets_default, 30024 title: (0, import_i18n95.__)("Unordered"), 30025 description: (0, import_i18n95.__)("Convert to unordered list"), 30026 isActive: ordered === false, 30027 onClick: () => { 30028 setAttributes({ ordered: false }); 30029 } 30030 } 30031 ), 30032 /* @__PURE__ */ (0, import_jsx_runtime271.jsx)( 30033 import_components55.ToolbarButton, 30034 { 30035 icon: (0, import_i18n95.isRTL)() ? format_list_numbered_rtl_default : format_list_numbered_default, 30036 title: (0, import_i18n95.__)("Ordered"), 30037 description: (0, import_i18n95.__)("Convert to ordered list"), 30038 isActive: ordered === true, 30039 onClick: () => { 30040 setAttributes({ ordered: true }); 30041 } 30042 } 30043 ), 30044 /* @__PURE__ */ (0, import_jsx_runtime271.jsx)(IndentUI, { clientId }) 30045 ] }); 30046 return /* @__PURE__ */ (0, import_jsx_runtime271.jsxs)(import_jsx_runtime271.Fragment, { children: [ 30047 /* @__PURE__ */ (0, import_jsx_runtime271.jsx)( 30048 tag_name_default, 30049 { 30050 ordered, 30051 reversed, 30052 start, 30053 ...innerBlocksProps 30054 } 30055 ), 30056 controls, 30057 ordered && /* @__PURE__ */ (0, import_jsx_runtime271.jsx)( 30058 ordered_list_settings_default, 30059 { 30060 ...{ 30061 setAttributes, 30062 reversed, 30063 start, 30064 type 30065 } 30066 } 30067 ) 30068 ] }); 30069 } 30070 30071 // packages/block-library/build-module/list/block.json 30072 var block_default46 = { 30073 $schema: "https://schemas.wp.org/trunk/block.json", 30074 apiVersion: 3, 30075 name: "core/list", 30076 title: "List", 30077 category: "text", 30078 allowedBlocks: ["core/list-item"], 30079 description: "An organized collection of items displayed in a specific order.", 30080 keywords: ["bullet list", "ordered list", "numbered list"], 30081 textdomain: "default", 30082 attributes: { 30083 ordered: { 30084 type: "boolean", 30085 default: false, 30086 role: "content" 30087 }, 30088 values: { 30089 type: "string", 30090 source: "html", 30091 selector: "ol,ul", 30092 multiline: "li", 30093 default: "", 30094 role: "content" 30095 }, 30096 type: { 30097 type: "string" 30098 }, 30099 start: { 30100 type: "number" 30101 }, 30102 reversed: { 30103 type: "boolean" 30104 }, 30105 placeholder: { 30106 type: "string" 30107 } 30108 }, 30109 supports: { 30110 anchor: true, 30111 html: false, 30112 __experimentalBorder: { 30113 color: true, 30114 radius: true, 30115 style: true, 30116 width: true 30117 }, 30118 typography: { 30119 fontSize: true, 30120 lineHeight: true, 30121 __experimentalFontFamily: true, 30122 __experimentalFontWeight: true, 30123 __experimentalFontStyle: true, 30124 __experimentalTextTransform: true, 30125 __experimentalTextDecoration: true, 30126 __experimentalLetterSpacing: true, 30127 __experimentalDefaultControls: { 30128 fontSize: true 30129 } 30130 }, 30131 color: { 30132 gradients: true, 30133 link: true, 30134 __experimentalDefaultControls: { 30135 background: true, 30136 text: true 30137 } 30138 }, 30139 spacing: { 30140 margin: true, 30141 padding: true, 30142 __experimentalDefaultControls: { 30143 margin: false, 30144 padding: false 30145 } 30146 }, 30147 __unstablePasteTextInline: true, 30148 __experimentalOnMerge: true, 30149 __experimentalSlashInserter: true, 30150 interactivity: { 30151 clientNavigation: true 30152 } 30153 }, 30154 selectors: { 30155 border: ".wp-block-list:not(.wp-block-list .wp-block-list)" 30156 }, 30157 editorStyle: "wp-block-list-editor", 30158 style: "wp-block-list" 30159 }; 30160 30161 // packages/block-library/build-module/list/save.js 30162 var import_block_editor118 = __toESM(require_block_editor()); 30163 var import_jsx_runtime272 = __toESM(require_jsx_runtime()); 30164 function save27({ attributes: attributes3 }) { 30165 const { ordered, type, reversed, start } = attributes3; 30166 const TagName2 = ordered ? "ol" : "ul"; 30167 return /* @__PURE__ */ (0, import_jsx_runtime272.jsx)( 30168 TagName2, 30169 { 30170 ...import_block_editor118.useBlockProps.save({ 30171 reversed, 30172 start, 30173 style: { 30174 listStyleType: ordered && type !== "decimal" ? type : void 0 30175 } 30176 }), 30177 children: /* @__PURE__ */ (0, import_jsx_runtime272.jsx)(import_block_editor118.InnerBlocks.Content, {}) 30178 } 30179 ); 30180 } 30181 30182 // packages/block-library/build-module/list/transforms.js 30183 var import_blocks43 = __toESM(require_blocks()); 30184 var import_rich_text4 = __toESM(require_rich_text()); 30185 function getListContentSchema({ phrasingContentSchema }) { 30186 const listContentSchema = { 30187 ...phrasingContentSchema, 30188 ul: {}, 30189 ol: { attributes: ["type", "start", "reversed"] } 30190 }; 30191 ["ul", "ol"].forEach((tag) => { 30192 listContentSchema[tag].children = { 30193 li: { 30194 children: listContentSchema 30195 } 30196 }; 30197 }); 30198 return listContentSchema; 30199 } 30200 function getListContentFlat(blocks) { 30201 return blocks.flatMap(({ name: name117, attributes: attributes3, innerBlocks = [] }) => { 30202 if (name117 === "core/list-item") { 30203 return [attributes3.content, ...getListContentFlat(innerBlocks)]; 30204 } 30205 return getListContentFlat(innerBlocks); 30206 }); 30207 } 30208 var transforms14 = { 30209 from: [ 30210 { 30211 type: "block", 30212 isMultiBlock: true, 30213 blocks: ["core/paragraph", "core/heading"], 30214 transform: (blockAttributes8) => { 30215 let childBlocks = []; 30216 if (blockAttributes8.length > 1) { 30217 childBlocks = blockAttributes8.map(({ content }) => { 30218 return (0, import_blocks43.createBlock)("core/list-item", { content }); 30219 }); 30220 } else if (blockAttributes8.length === 1) { 30221 const value = (0, import_rich_text4.create)({ 30222 html: blockAttributes8[0].content 30223 }); 30224 childBlocks = (0, import_rich_text4.split)(value, "\n").map((result) => { 30225 return (0, import_blocks43.createBlock)("core/list-item", { 30226 content: (0, import_rich_text4.toHTMLString)({ value: result }) 30227 }); 30228 }); 30229 } 30230 return (0, import_blocks43.createBlock)( 30231 "core/list", 30232 { 30233 anchor: blockAttributes8.anchor 30234 }, 30235 childBlocks 30236 ); 30237 } 30238 }, 30239 { 30240 type: "raw", 30241 selector: "ol,ul", 30242 schema: (args) => ({ 30243 ol: getListContentSchema(args).ol, 30244 ul: getListContentSchema(args).ul 30245 }), 30246 transform: createListBlockFromDOMElement 30247 }, 30248 ...["*", "-"].map((prefix) => ({ 30249 type: "prefix", 30250 prefix, 30251 transform(content) { 30252 return (0, import_blocks43.createBlock)("core/list", {}, [ 30253 (0, import_blocks43.createBlock)("core/list-item", { content }) 30254 ]); 30255 } 30256 })), 30257 ...["1.", "1)"].map((prefix) => ({ 30258 type: "prefix", 30259 prefix, 30260 transform(content) { 30261 return (0, import_blocks43.createBlock)( 30262 "core/list", 30263 { 30264 ordered: true 30265 }, 30266 [(0, import_blocks43.createBlock)("core/list-item", { content })] 30267 ); 30268 } 30269 })) 30270 ], 30271 to: [ 30272 ...["core/paragraph", "core/heading"].map((block) => ({ 30273 type: "block", 30274 blocks: [block], 30275 transform: (_attributes, childBlocks) => { 30276 return getListContentFlat(childBlocks).map( 30277 (content) => (0, import_blocks43.createBlock)(block, { 30278 content 30279 }) 30280 ); 30281 } 30282 })) 30283 ] 30284 }; 30285 var transforms_default15 = transforms14; 30286 30287 // packages/block-library/build-module/list/index.js 30288 var { name: name46 } = block_default46; 30289 var settings46 = { 30290 icon: list_default, 30291 example: { 30292 innerBlocks: [ 30293 { 30294 name: "core/list-item", 30295 attributes: { content: (0, import_i18n96.__)("Alice.") } 30296 }, 30297 { 30298 name: "core/list-item", 30299 attributes: { content: (0, import_i18n96.__)("The White Rabbit.") } 30300 }, 30301 { 30302 name: "core/list-item", 30303 attributes: { content: (0, import_i18n96.__)("The Cheshire Cat.") } 30304 }, 30305 { 30306 name: "core/list-item", 30307 attributes: { content: (0, import_i18n96.__)("The Mad Hatter.") } 30308 }, 30309 { 30310 name: "core/list-item", 30311 attributes: { content: (0, import_i18n96.__)("The Queen of Hearts.") } 30312 } 30313 ] 30314 }, 30315 transforms: transforms_default15, 30316 edit: Edit16, 30317 save: save27, 30318 deprecated: deprecated_default22 30319 }; 30320 var init46 = () => initBlock({ name: name46, metadata: block_default46, settings: settings46 }); 30321 30322 // packages/block-library/build-module/math/index.js 30323 var math_exports = {}; 30324 __export(math_exports, { 30325 init: () => init47, 30326 metadata: () => block_default47, 30327 name: () => name47, 30328 settings: () => settings47 30329 }); 30330 30331 // packages/block-library/build-module/math/edit.js 30332 var import_i18n97 = __toESM(require_i18n()); 30333 var import_block_editor119 = __toESM(require_block_editor()); 30334 var import_components56 = __toESM(require_components()); 30335 var import_element49 = __toESM(require_element()); 30336 var import_data47 = __toESM(require_data()); 30337 var import_a11y = __toESM(require_a11y()); 30338 var import_jsx_runtime273 = __toESM(require_jsx_runtime()); 30339 var { Badge } = unlock(import_components56.privateApis); 30340 function MathEdit({ attributes: attributes3, setAttributes, isSelected }) { 30341 const { latex, mathML } = attributes3; 30342 const [blockRef, setBlockRef] = (0, import_element49.useState)(); 30343 const [error, setError] = (0, import_element49.useState)(null); 30344 const [latexToMathML, setLatexToMathML] = (0, import_element49.useState)(); 30345 const initialLatex = (0, import_element49.useRef)(latex); 30346 const { __unstableMarkNextChangeAsNotPersistent } = (0, import_data47.useDispatch)(import_block_editor119.store); 30347 (0, import_element49.useEffect)(() => { 30348 import("@wordpress/latex-to-mathml").then((module) => { 30349 setLatexToMathML(() => module.default); 30350 if (initialLatex.current) { 30351 __unstableMarkNextChangeAsNotPersistent(); 30352 setAttributes({ 30353 mathML: module.default(initialLatex.current, { 30354 displayMode: true 30355 }) 30356 }); 30357 } 30358 }); 30359 }, [ 30360 initialLatex, 30361 setAttributes, 30362 __unstableMarkNextChangeAsNotPersistent 30363 ]); 30364 const blockProps = (0, import_block_editor119.useBlockProps)({ 30365 ref: setBlockRef, 30366 position: "relative" 30367 }); 30368 return /* @__PURE__ */ (0, import_jsx_runtime273.jsxs)("div", { ...blockProps, children: [ 30369 mathML ? /* @__PURE__ */ (0, import_jsx_runtime273.jsx)( 30370 "math", 30371 { 30372 display: "block", 30373 dangerouslySetInnerHTML: { __html: mathML } 30374 } 30375 ) : "\u200B", 30376 isSelected && /* @__PURE__ */ (0, import_jsx_runtime273.jsx)( 30377 import_components56.Popover, 30378 { 30379 placement: "bottom-start", 30380 offset: 8, 30381 anchor: blockRef, 30382 focusOnMount: false, 30383 __unstableSlotName: "__unstable-block-tools-after", 30384 children: /* @__PURE__ */ (0, import_jsx_runtime273.jsx)("div", { style: { padding: "4px", minWidth: "300px" }, children: /* @__PURE__ */ (0, import_jsx_runtime273.jsxs)(import_components56.__experimentalVStack, { spacing: 1, children: [ 30385 /* @__PURE__ */ (0, import_jsx_runtime273.jsx)( 30386 import_components56.TextareaControl, 30387 { 30388 __next40pxDefaultSize: true, 30389 label: (0, import_i18n97.__)("LaTeX math syntax"), 30390 hideLabelFromVision: true, 30391 value: latex, 30392 className: "wp-block-math__textarea-control", 30393 onChange: (newLatex) => { 30394 if (!latexToMathML) { 30395 setAttributes({ latex: newLatex }); 30396 return; 30397 } 30398 let newMathML = ""; 30399 try { 30400 newMathML = latexToMathML(newLatex, { 30401 displayMode: true 30402 }); 30403 setError(null); 30404 } catch (err) { 30405 setError(err.message); 30406 (0, import_a11y.speak)( 30407 (0, import_i18n97.sprintf)( 30408 /* translators: %s: error message returned when parsing LaTeX. */ 30409 (0, import_i18n97.__)( 30410 "Error parsing mathematical expression: %s" 30411 ), 30412 err.message 30413 ) 30414 ); 30415 } 30416 setAttributes({ 30417 mathML: newMathML, 30418 latex: newLatex 30419 }); 30420 }, 30421 placeholder: (0, import_i18n97.__)("e.g., x^2, \\frac{a}{b}") 30422 } 30423 ), 30424 error && /* @__PURE__ */ (0, import_jsx_runtime273.jsxs)(import_jsx_runtime273.Fragment, { children: [ 30425 /* @__PURE__ */ (0, import_jsx_runtime273.jsx)( 30426 Badge, 30427 { 30428 intent: "error", 30429 className: "wp-block-math__error", 30430 children: (0, import_i18n97.sprintf)( 30431 /* translators: %s: error message returned when parsing LaTeX. */ 30432 (0, import_i18n97.__)("Error: %s"), 30433 error 30434 ) 30435 } 30436 ), 30437 /* @__PURE__ */ (0, import_jsx_runtime273.jsx)("style", { children: ".wp-block-math__error .components-badge__content{white-space:normal}" }) 30438 ] }) 30439 ] }) }) 30440 } 30441 ) 30442 ] }); 30443 } 30444 30445 // packages/block-library/build-module/math/block.json 30446 var block_default47 = { 30447 $schema: "https://schemas.wp.org/trunk/block.json", 30448 apiVersion: 3, 30449 name: "core/math", 30450 title: "Math", 30451 category: "text", 30452 description: "Display mathematical notation using LaTeX.", 30453 keywords: ["equation", "formula", "latex", "mathematics"], 30454 textdomain: "default", 30455 supports: { 30456 html: false, 30457 __experimentalBorder: { 30458 color: true, 30459 radius: true, 30460 style: true, 30461 width: true 30462 }, 30463 color: { 30464 gradients: true, 30465 __experimentalDefaultControls: { 30466 background: true, 30467 text: true 30468 } 30469 }, 30470 spacing: { 30471 margin: true, 30472 padding: true, 30473 __experimentalDefaultControls: { 30474 margin: false, 30475 padding: false 30476 } 30477 }, 30478 typography: { 30479 fontSize: true, 30480 __experimentalDefaultControls: { 30481 fontSize: true 30482 } 30483 } 30484 }, 30485 attributes: { 30486 latex: { 30487 type: "string", 30488 role: "content" 30489 }, 30490 mathML: { 30491 type: "string", 30492 source: "html", 30493 selector: "math" 30494 } 30495 } 30496 }; 30497 30498 // packages/block-library/build-module/math/save.js 30499 var import_block_editor120 = __toESM(require_block_editor()); 30500 var import_jsx_runtime274 = __toESM(require_jsx_runtime()); 30501 function save28({ attributes: attributes3 }) { 30502 const { latex, mathML } = attributes3; 30503 if (!latex) { 30504 return null; 30505 } 30506 return /* @__PURE__ */ (0, import_jsx_runtime274.jsx)("div", { ...import_block_editor120.useBlockProps.save(), children: /* @__PURE__ */ (0, import_jsx_runtime274.jsx)( 30507 "math", 30508 { 30509 display: "block", 30510 dangerouslySetInnerHTML: { __html: mathML } 30511 } 30512 ) }); 30513 } 30514 30515 // packages/block-library/build-module/math/deprecated.js 30516 var import_block_editor121 = __toESM(require_block_editor()); 30517 var import_jsx_runtime275 = __toESM(require_jsx_runtime()); 30518 var v118 = { 30519 attributes: { 30520 latex: { 30521 type: "string", 30522 role: "content" 30523 }, 30524 mathML: { 30525 type: "string", 30526 source: "html", 30527 selector: "math" 30528 } 30529 }, 30530 save({ attributes: attributes3 }) { 30531 const { latex, mathML } = attributes3; 30532 if (!latex) { 30533 return null; 30534 } 30535 return /* @__PURE__ */ (0, import_jsx_runtime275.jsx)( 30536 "math", 30537 { 30538 ...import_block_editor121.useBlockProps.save(), 30539 display: "block", 30540 dangerouslySetInnerHTML: { __html: mathML } 30541 } 30542 ); 30543 } 30544 }; 30545 var deprecated_default23 = [v118]; 30546 30547 // packages/block-library/build-module/math/index.js 30548 var { name: name47 } = block_default47; 30549 var settings47 = { 30550 icon: math_default, 30551 example: { 30552 attributes: { 30553 latex: "x = \\frac{-b \\pm \\sqrt{b^2-4ac}}{2a}", 30554 mathML: '<semantics><mrow><mi>x</mi><mo>=</mo><mfrac><mrow><mo lspace="0em" rspace="0em">\u2212</mo><mi>b</mi><mo>\xB1</mo><msqrt><mrow><msup><mi>b</mi><mn>2</mn></msup><mo>\u2212</mo><mn>4</mn><mi>a</mi><mi>c</mi></mrow></msqrt></mrow><mrow><mn>2</mn><mi>a</mi></mrow></mfrac></mrow><annotation encoding="application/x-tex">x = \\frac{-b \\pm \\sqrt{b^2-4ac}}{2a}</annotation></semantics>' 30555 }, 30556 viewportWidth: 300 30557 }, 30558 edit: MathEdit, 30559 save: save28, 30560 deprecated: deprecated_default23 30561 }; 30562 var init47 = () => initBlock({ name: name47, metadata: block_default47, settings: settings47 }); 30563 30564 // packages/block-library/build-module/list-item/index.js 30565 var list_item_exports = {}; 30566 __export(list_item_exports, { 30567 init: () => init48, 30568 metadata: () => block_default48, 30569 name: () => name48, 30570 settings: () => settings48 30571 }); 30572 var import_i18n99 = __toESM(require_i18n()); 30573 var import_block_editor129 = __toESM(require_block_editor()); 30574 var import_blocks49 = __toESM(require_blocks()); 30575 30576 // packages/block-library/build-module/list-item/block.json 30577 var block_default48 = { 30578 $schema: "https://schemas.wp.org/trunk/block.json", 30579 apiVersion: 3, 30580 name: "core/list-item", 30581 title: "List Item", 30582 category: "text", 30583 parent: ["core/list"], 30584 allowedBlocks: ["core/list"], 30585 description: "An individual item within a list.", 30586 textdomain: "default", 30587 attributes: { 30588 placeholder: { 30589 type: "string" 30590 }, 30591 content: { 30592 type: "rich-text", 30593 source: "rich-text", 30594 selector: "li", 30595 role: "content" 30596 } 30597 }, 30598 supports: { 30599 anchor: true, 30600 className: false, 30601 splitting: true, 30602 __experimentalBorder: { 30603 color: true, 30604 radius: true, 30605 style: true, 30606 width: true 30607 }, 30608 color: { 30609 gradients: true, 30610 link: true, 30611 background: true, 30612 __experimentalDefaultControls: { 30613 text: true 30614 } 30615 }, 30616 spacing: { 30617 margin: true, 30618 padding: true, 30619 __experimentalDefaultControls: { 30620 margin: false, 30621 padding: false 30622 } 30623 }, 30624 typography: { 30625 fontSize: true, 30626 lineHeight: true, 30627 __experimentalFontFamily: true, 30628 __experimentalFontWeight: true, 30629 __experimentalFontStyle: true, 30630 __experimentalTextTransform: true, 30631 __experimentalTextDecoration: true, 30632 __experimentalLetterSpacing: true, 30633 __experimentalDefaultControls: { 30634 fontSize: true 30635 } 30636 }, 30637 interactivity: { 30638 clientNavigation: true 30639 } 30640 }, 30641 selectors: { 30642 root: ".wp-block-list > li", 30643 border: ".wp-block-list:not(.wp-block-list .wp-block-list) > li" 30644 } 30645 }; 30646 30647 // packages/block-library/build-module/list-item/edit.js 30648 var import_block_editor127 = __toESM(require_block_editor()); 30649 var import_i18n98 = __toESM(require_i18n()); 30650 var import_components57 = __toESM(require_components()); 30651 var import_compose24 = __toESM(require_compose()); 30652 var import_data53 = __toESM(require_data()); 30653 var import_keycodes5 = __toESM(require_keycodes()); 30654 30655 // packages/block-library/build-module/list-item/hooks/use-outdent-list-item.js 30656 var import_element50 = __toESM(require_element()); 30657 var import_data48 = __toESM(require_data()); 30658 var import_block_editor122 = __toESM(require_block_editor()); 30659 var import_blocks44 = __toESM(require_blocks()); 30660 function useOutdentListItem() { 30661 const registry = (0, import_data48.useRegistry)(); 30662 const { 30663 moveBlocksToPosition, 30664 removeBlock, 30665 insertBlock, 30666 updateBlockListSettings 30667 } = (0, import_data48.useDispatch)(import_block_editor122.store); 30668 const { 30669 getBlockRootClientId, 30670 getBlockName, 30671 getBlockOrder, 30672 getBlockIndex, 30673 getSelectedBlockClientIds, 30674 getBlock, 30675 getBlockListSettings 30676 } = (0, import_data48.useSelect)(import_block_editor122.store); 30677 function getParentListItemId(id) { 30678 const listId = getBlockRootClientId(id); 30679 const parentListItemId = getBlockRootClientId(listId); 30680 if (!parentListItemId) { 30681 return; 30682 } 30683 if (getBlockName(parentListItemId) !== "core/list-item") { 30684 return; 30685 } 30686 return parentListItemId; 30687 } 30688 return (0, import_element50.useCallback)((clientIds = getSelectedBlockClientIds()) => { 30689 if (!Array.isArray(clientIds)) { 30690 clientIds = [clientIds]; 30691 } 30692 if (!clientIds.length) { 30693 return; 30694 } 30695 const firstClientId = clientIds[0]; 30696 if (getBlockName(firstClientId) !== "core/list-item") { 30697 return; 30698 } 30699 const parentListItemId = getParentListItemId(firstClientId); 30700 if (!parentListItemId) { 30701 return; 30702 } 30703 const parentListId = getBlockRootClientId(firstClientId); 30704 const lastClientId = clientIds[clientIds.length - 1]; 30705 const order = getBlockOrder(parentListId); 30706 const followingListItems = order.slice( 30707 getBlockIndex(lastClientId) + 1 30708 ); 30709 registry.batch(() => { 30710 if (followingListItems.length) { 30711 let nestedListId = getBlockOrder(firstClientId)[0]; 30712 if (!nestedListId) { 30713 const nestedListBlock = (0, import_blocks44.cloneBlock)( 30714 getBlock(parentListId), 30715 {}, 30716 [] 30717 ); 30718 nestedListId = nestedListBlock.clientId; 30719 insertBlock(nestedListBlock, 0, firstClientId, false); 30720 updateBlockListSettings( 30721 nestedListId, 30722 getBlockListSettings(parentListId) 30723 ); 30724 } 30725 moveBlocksToPosition( 30726 followingListItems, 30727 parentListId, 30728 nestedListId 30729 ); 30730 } 30731 moveBlocksToPosition( 30732 clientIds, 30733 parentListId, 30734 getBlockRootClientId(parentListItemId), 30735 getBlockIndex(parentListItemId) + 1 30736 ); 30737 if (!getBlockOrder(parentListId).length) { 30738 const shouldSelectParent = false; 30739 removeBlock(parentListId, shouldSelectParent); 30740 } 30741 }); 30742 return true; 30743 }, []); 30744 } 30745 30746 // packages/block-library/build-module/list-item/hooks/use-indent-list-item.js 30747 var import_element51 = __toESM(require_element()); 30748 var import_data49 = __toESM(require_data()); 30749 var import_block_editor123 = __toESM(require_block_editor()); 30750 var import_blocks45 = __toESM(require_blocks()); 30751 function useIndentListItem(clientId) { 30752 const { replaceBlocks, selectionChange, multiSelect } = (0, import_data49.useDispatch)(import_block_editor123.store); 30753 const { 30754 getBlock, 30755 getPreviousBlockClientId, 30756 getSelectionStart, 30757 getSelectionEnd, 30758 hasMultiSelection, 30759 getMultiSelectedBlockClientIds 30760 } = (0, import_data49.useSelect)(import_block_editor123.store); 30761 return (0, import_element51.useCallback)(() => { 30762 const _hasMultiSelection = hasMultiSelection(); 30763 const clientIds = _hasMultiSelection ? getMultiSelectedBlockClientIds() : [clientId]; 30764 const clonedBlocks = clientIds.map( 30765 (_clientId) => (0, import_blocks45.cloneBlock)(getBlock(_clientId)) 30766 ); 30767 const previousSiblingId = getPreviousBlockClientId(clientId); 30768 const newListItem = (0, import_blocks45.cloneBlock)(getBlock(previousSiblingId)); 30769 if (!newListItem.innerBlocks?.length) { 30770 newListItem.innerBlocks = [(0, import_blocks45.createBlock)("core/list")]; 30771 } 30772 newListItem.innerBlocks[newListItem.innerBlocks.length - 1].innerBlocks.push(...clonedBlocks); 30773 const selectionStart = getSelectionStart(); 30774 const selectionEnd = getSelectionEnd(); 30775 replaceBlocks([previousSiblingId, ...clientIds], [newListItem]); 30776 if (!_hasMultiSelection) { 30777 selectionChange( 30778 clonedBlocks[0].clientId, 30779 selectionEnd.attributeKey, 30780 selectionEnd.clientId === selectionStart.clientId ? selectionStart.offset : selectionEnd.offset, 30781 selectionEnd.offset 30782 ); 30783 } else { 30784 multiSelect( 30785 clonedBlocks[0].clientId, 30786 clonedBlocks[clonedBlocks.length - 1].clientId 30787 ); 30788 } 30789 return true; 30790 }, [clientId]); 30791 } 30792 30793 // packages/block-library/build-module/list-item/hooks/use-enter.js 30794 var import_blocks46 = __toESM(require_blocks()); 30795 var import_element52 = __toESM(require_element()); 30796 var import_compose22 = __toESM(require_compose()); 30797 var import_keycodes3 = __toESM(require_keycodes()); 30798 var import_data50 = __toESM(require_data()); 30799 var import_block_editor124 = __toESM(require_block_editor()); 30800 function useEnter2(props) { 30801 const { replaceBlocks, selectionChange } = (0, import_data50.useDispatch)(import_block_editor124.store); 30802 const { getBlock, getBlockRootClientId, getBlockIndex, getBlockName } = (0, import_data50.useSelect)(import_block_editor124.store); 30803 const propsRef = (0, import_element52.useRef)(props); 30804 propsRef.current = props; 30805 const outdentListItem = useOutdentListItem(); 30806 return (0, import_compose22.useRefEffect)((element) => { 30807 function onKeyDown(event) { 30808 if (event.defaultPrevented || event.keyCode !== import_keycodes3.ENTER) { 30809 return; 30810 } 30811 const { content, clientId } = propsRef.current; 30812 if (content.length) { 30813 return; 30814 } 30815 event.preventDefault(); 30816 const canOutdent = getBlockName( 30817 getBlockRootClientId( 30818 getBlockRootClientId(propsRef.current.clientId) 30819 ) 30820 ) === "core/list-item"; 30821 if (canOutdent) { 30822 outdentListItem(); 30823 return; 30824 } 30825 const topParentListBlock = getBlock( 30826 getBlockRootClientId(clientId) 30827 ); 30828 const blockIndex = getBlockIndex(clientId); 30829 const head = (0, import_blocks46.cloneBlock)({ 30830 ...topParentListBlock, 30831 innerBlocks: topParentListBlock.innerBlocks.slice( 30832 0, 30833 blockIndex 30834 ) 30835 }); 30836 const middle = (0, import_blocks46.createBlock)((0, import_blocks46.getDefaultBlockName)()); 30837 const after = [ 30838 ...topParentListBlock.innerBlocks[blockIndex].innerBlocks[0]?.innerBlocks || [], 30839 ...topParentListBlock.innerBlocks.slice(blockIndex + 1) 30840 ]; 30841 const tail = after.length ? [ 30842 (0, import_blocks46.cloneBlock)({ 30843 ...topParentListBlock, 30844 innerBlocks: after 30845 }) 30846 ] : []; 30847 replaceBlocks( 30848 topParentListBlock.clientId, 30849 [head, middle, ...tail], 30850 1 30851 ); 30852 selectionChange(middle.clientId); 30853 } 30854 element.addEventListener("keydown", onKeyDown); 30855 return () => { 30856 element.removeEventListener("keydown", onKeyDown); 30857 }; 30858 }, []); 30859 } 30860 30861 // packages/block-library/build-module/list-item/hooks/use-space.js 30862 var import_compose23 = __toESM(require_compose()); 30863 var import_keycodes4 = __toESM(require_keycodes()); 30864 var import_block_editor125 = __toESM(require_block_editor()); 30865 var import_data51 = __toESM(require_data()); 30866 function useSpace(clientId) { 30867 const { getSelectionStart, getSelectionEnd, getBlockIndex } = (0, import_data51.useSelect)(import_block_editor125.store); 30868 const indentListItem = useIndentListItem(clientId); 30869 const outdentListItem = useOutdentListItem(); 30870 return (0, import_compose23.useRefEffect)( 30871 (element) => { 30872 function onKeyDown(event) { 30873 const { keyCode, shiftKey, altKey, metaKey, ctrlKey } = event; 30874 if (event.defaultPrevented || keyCode !== import_keycodes4.SPACE && keyCode !== import_keycodes4.TAB || // Only override when no modifiers are pressed. 30875 altKey || metaKey || ctrlKey) { 30876 return; 30877 } 30878 const selectionStart = getSelectionStart(); 30879 const selectionEnd = getSelectionEnd(); 30880 if (selectionStart.offset === 0 && selectionEnd.offset === 0) { 30881 if (shiftKey) { 30882 if (keyCode === import_keycodes4.TAB) { 30883 if (outdentListItem()) { 30884 event.preventDefault(); 30885 } 30886 } 30887 } else if (getBlockIndex(clientId) !== 0) { 30888 if (indentListItem()) { 30889 event.preventDefault(); 30890 } 30891 } 30892 } 30893 } 30894 element.addEventListener("keydown", onKeyDown); 30895 return () => { 30896 element.removeEventListener("keydown", onKeyDown); 30897 }; 30898 }, 30899 [clientId, indentListItem] 30900 ); 30901 } 30902 30903 // packages/block-library/build-module/list-item/hooks/use-merge.js 30904 var import_data52 = __toESM(require_data()); 30905 var import_block_editor126 = __toESM(require_block_editor()); 30906 var import_blocks47 = __toESM(require_blocks()); 30907 function useMerge(clientId, onMerge) { 30908 const registry = (0, import_data52.useRegistry)(); 30909 const { 30910 getPreviousBlockClientId, 30911 getNextBlockClientId, 30912 getBlockOrder, 30913 getBlockRootClientId, 30914 getBlockName, 30915 getBlock 30916 } = (0, import_data52.useSelect)(import_block_editor126.store); 30917 const { mergeBlocks, moveBlocksToPosition, removeBlock } = (0, import_data52.useDispatch)(import_block_editor126.store); 30918 const outdentListItem = useOutdentListItem(); 30919 function getTrailingId(id) { 30920 const order = getBlockOrder(id); 30921 if (!order.length) { 30922 return id; 30923 } 30924 return getTrailingId(order[order.length - 1]); 30925 } 30926 function getParentListItemId(id) { 30927 const listId = getBlockRootClientId(id); 30928 const parentListItemId = getBlockRootClientId(listId); 30929 if (!parentListItemId) { 30930 return; 30931 } 30932 if (getBlockName(parentListItemId) !== "core/list-item") { 30933 return; 30934 } 30935 return parentListItemId; 30936 } 30937 function _getNextId(id) { 30938 const next = getNextBlockClientId(id); 30939 if (next) { 30940 return next; 30941 } 30942 const parentListItemId = getParentListItemId(id); 30943 if (!parentListItemId) { 30944 return; 30945 } 30946 return _getNextId(parentListItemId); 30947 } 30948 function getNextId(id) { 30949 const order = getBlockOrder(id); 30950 if (!order.length) { 30951 return _getNextId(id); 30952 } 30953 return getBlockOrder(order[0])[0]; 30954 } 30955 return (forward) => { 30956 function mergeWithNested(clientIdA, clientIdB) { 30957 registry.batch(() => { 30958 const [nestedListClientId] = getBlockOrder(clientIdB); 30959 if (nestedListClientId) { 30960 if (getPreviousBlockClientId(clientIdB) === clientIdA && !getBlockOrder(clientIdA).length) { 30961 moveBlocksToPosition( 30962 [nestedListClientId], 30963 clientIdB, 30964 clientIdA 30965 ); 30966 } else { 30967 moveBlocksToPosition( 30968 getBlockOrder(nestedListClientId), 30969 nestedListClientId, 30970 getBlockRootClientId(clientIdA) 30971 ); 30972 } 30973 } 30974 mergeBlocks(clientIdA, clientIdB); 30975 }); 30976 } 30977 if (forward) { 30978 const nextBlockClientId = getNextId(clientId); 30979 if (!nextBlockClientId) { 30980 onMerge(forward); 30981 return; 30982 } 30983 if (getParentListItemId(nextBlockClientId)) { 30984 outdentListItem(nextBlockClientId); 30985 } else { 30986 mergeWithNested(clientId, nextBlockClientId); 30987 } 30988 } else { 30989 if (getParentListItemId(clientId)) { 30990 outdentListItem(clientId); 30991 return; 30992 } 30993 const previousBlockClientId = getPreviousBlockClientId(clientId); 30994 if (previousBlockClientId) { 30995 const trailingId = getTrailingId(previousBlockClientId); 30996 mergeWithNested(trailingId, clientId); 30997 return; 30998 } 30999 const blockOrder = getBlockOrder(clientId); 31000 if ((0, import_blocks47.isUnmodifiedBlock)(getBlock(clientId), "content") && blockOrder.length > 0) { 31001 registry.batch(() => { 31002 outdentListItem(getBlockOrder(blockOrder[0])); 31003 removeBlock(clientId, true); 31004 }); 31005 } else { 31006 onMerge(forward); 31007 } 31008 } 31009 }; 31010 } 31011 31012 // packages/block-library/build-module/list-item/edit.js 31013 var import_jsx_runtime276 = __toESM(require_jsx_runtime()); 31014 function IndentUI2({ clientId }) { 31015 const indentListItem = useIndentListItem(clientId); 31016 const outdentListItem = useOutdentListItem(); 31017 const { canIndent, canOutdent } = (0, import_data53.useSelect)( 31018 (select9) => { 31019 const { getBlockIndex, getBlockRootClientId, getBlockName } = select9(import_block_editor127.store); 31020 return { 31021 canIndent: getBlockIndex(clientId) > 0, 31022 canOutdent: getBlockName( 31023 getBlockRootClientId(getBlockRootClientId(clientId)) 31024 ) === "core/list-item" 31025 }; 31026 }, 31027 [clientId] 31028 ); 31029 return /* @__PURE__ */ (0, import_jsx_runtime276.jsxs)(import_jsx_runtime276.Fragment, { children: [ 31030 /* @__PURE__ */ (0, import_jsx_runtime276.jsx)( 31031 import_components57.ToolbarButton, 31032 { 31033 icon: (0, import_i18n98.isRTL)() ? format_outdent_rtl_default : format_outdent_default, 31034 title: (0, import_i18n98.__)("Outdent"), 31035 shortcut: import_keycodes5.displayShortcut.shift("Tab"), 31036 description: (0, import_i18n98.__)("Outdent list item"), 31037 disabled: !canOutdent, 31038 onClick: () => outdentListItem() 31039 } 31040 ), 31041 /* @__PURE__ */ (0, import_jsx_runtime276.jsx)( 31042 import_components57.ToolbarButton, 31043 { 31044 icon: (0, import_i18n98.isRTL)() ? format_indent_rtl_default : format_indent_default, 31045 title: (0, import_i18n98.__)("Indent"), 31046 shortcut: "Tab", 31047 description: (0, import_i18n98.__)("Indent list item"), 31048 disabled: !canIndent, 31049 onClick: () => indentListItem() 31050 } 31051 ) 31052 ] }); 31053 } 31054 function ListItemEdit({ 31055 attributes: attributes3, 31056 setAttributes, 31057 clientId, 31058 mergeBlocks 31059 }) { 31060 const { placeholder: placeholder2, content } = attributes3; 31061 const blockProps = (0, import_block_editor127.useBlockProps)(); 31062 const innerBlocksProps = (0, import_block_editor127.useInnerBlocksProps)(blockProps, { 31063 renderAppender: false, 31064 __unstableDisableDropZone: true 31065 }); 31066 const useEnterRef = useEnter2({ content, clientId }); 31067 const useSpaceRef = useSpace(clientId); 31068 const onMerge = useMerge(clientId, mergeBlocks); 31069 return /* @__PURE__ */ (0, import_jsx_runtime276.jsxs)(import_jsx_runtime276.Fragment, { children: [ 31070 /* @__PURE__ */ (0, import_jsx_runtime276.jsxs)("li", { ...innerBlocksProps, children: [ 31071 /* @__PURE__ */ (0, import_jsx_runtime276.jsx)( 31072 import_block_editor127.RichText, 31073 { 31074 ref: (0, import_compose24.useMergeRefs)([useEnterRef, useSpaceRef]), 31075 identifier: "content", 31076 tagName: "div", 31077 onChange: (nextContent) => setAttributes({ content: nextContent }), 31078 value: content, 31079 "aria-label": (0, import_i18n98.__)("List text"), 31080 placeholder: placeholder2 || (0, import_i18n98.__)("List"), 31081 onMerge 31082 } 31083 ), 31084 innerBlocksProps.children 31085 ] }), 31086 /* @__PURE__ */ (0, import_jsx_runtime276.jsx)(import_block_editor127.BlockControls, { group: "block", children: /* @__PURE__ */ (0, import_jsx_runtime276.jsx)(IndentUI2, { clientId }) }) 31087 ] }); 31088 } 31089 31090 // packages/block-library/build-module/list-item/save.js 31091 var import_block_editor128 = __toESM(require_block_editor()); 31092 var import_jsx_runtime277 = __toESM(require_jsx_runtime()); 31093 function save29({ attributes: attributes3 }) { 31094 return /* @__PURE__ */ (0, import_jsx_runtime277.jsxs)("li", { ...import_block_editor128.useBlockProps.save(), children: [ 31095 /* @__PURE__ */ (0, import_jsx_runtime277.jsx)(import_block_editor128.RichText.Content, { value: attributes3.content }), 31096 /* @__PURE__ */ (0, import_jsx_runtime277.jsx)(import_block_editor128.InnerBlocks.Content, {}) 31097 ] }); 31098 } 31099 31100 // packages/block-library/build-module/list-item/transforms.js 31101 var import_blocks48 = __toESM(require_blocks()); 31102 var transforms15 = { 31103 to: [ 31104 { 31105 type: "block", 31106 blocks: ["core/paragraph"], 31107 transform: (attributes3, innerBlocks = []) => [ 31108 (0, import_blocks48.createBlock)("core/paragraph", attributes3), 31109 ...innerBlocks.map((block) => (0, import_blocks48.cloneBlock)(block)) 31110 ] 31111 } 31112 ] 31113 }; 31114 var transforms_default16 = transforms15; 31115 31116 // packages/block-library/build-module/list-item/index.js 31117 var { fieldsKey: fieldsKey9, formKey: formKey9 } = unlock(import_blocks49.privateApis); 31118 var { name: name48 } = block_default48; 31119 var settings48 = { 31120 icon: list_item_default, 31121 edit: ListItemEdit, 31122 save: save29, 31123 merge(attributes3, attributesToMerge) { 31124 return { 31125 ...attributes3, 31126 content: attributes3.content + attributesToMerge.content 31127 }; 31128 }, 31129 transforms: transforms_default16, 31130 [unlock(import_block_editor129.privateApis).requiresWrapperOnCopy]: true 31131 }; 31132 if (window.__experimentalContentOnlyInspectorFields) { 31133 settings48[fieldsKey9] = [ 31134 { 31135 id: "content", 31136 label: (0, import_i18n99.__)("Content"), 31137 type: "richtext" 31138 } 31139 ]; 31140 settings48[formKey9] = { 31141 fields: ["content"] 31142 }; 31143 } 31144 var init48 = () => initBlock({ name: name48, metadata: block_default48, settings: settings48 }); 31145 31146 // packages/block-library/build-module/loginout/index.js 31147 var loginout_exports = {}; 31148 __export(loginout_exports, { 31149 init: () => init49, 31150 metadata: () => block_default49, 31151 name: () => name49, 31152 settings: () => settings49 31153 }); 31154 31155 // packages/block-library/build-module/loginout/edit.js 31156 var import_block_editor130 = __toESM(require_block_editor()); 31157 var import_components58 = __toESM(require_components()); 31158 var import_i18n100 = __toESM(require_i18n()); 31159 var import_jsx_runtime278 = __toESM(require_jsx_runtime()); 31160 function LoginOutEdit({ attributes: attributes3, setAttributes }) { 31161 const { displayLoginAsForm, redirectToCurrent } = attributes3; 31162 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 31163 return /* @__PURE__ */ (0, import_jsx_runtime278.jsxs)(import_jsx_runtime278.Fragment, { children: [ 31164 /* @__PURE__ */ (0, import_jsx_runtime278.jsx)(import_block_editor130.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime278.jsxs)( 31165 import_components58.__experimentalToolsPanel, 31166 { 31167 label: (0, import_i18n100.__)("Settings"), 31168 resetAll: () => { 31169 setAttributes({ 31170 displayLoginAsForm: false, 31171 redirectToCurrent: true 31172 }); 31173 }, 31174 dropdownMenuProps, 31175 children: [ 31176 /* @__PURE__ */ (0, import_jsx_runtime278.jsx)( 31177 import_components58.__experimentalToolsPanelItem, 31178 { 31179 label: (0, import_i18n100.__)("Display login as form"), 31180 isShownByDefault: true, 31181 hasValue: () => displayLoginAsForm, 31182 onDeselect: () => setAttributes({ displayLoginAsForm: false }), 31183 children: /* @__PURE__ */ (0, import_jsx_runtime278.jsx)( 31184 import_components58.ToggleControl, 31185 { 31186 label: (0, import_i18n100.__)("Display login as form"), 31187 checked: displayLoginAsForm, 31188 onChange: () => setAttributes({ 31189 displayLoginAsForm: !displayLoginAsForm 31190 }) 31191 } 31192 ) 31193 } 31194 ), 31195 /* @__PURE__ */ (0, import_jsx_runtime278.jsx)( 31196 import_components58.__experimentalToolsPanelItem, 31197 { 31198 label: (0, import_i18n100.__)("Redirect to current URL"), 31199 isShownByDefault: true, 31200 hasValue: () => !redirectToCurrent, 31201 onDeselect: () => setAttributes({ redirectToCurrent: true }), 31202 children: /* @__PURE__ */ (0, import_jsx_runtime278.jsx)( 31203 import_components58.ToggleControl, 31204 { 31205 label: (0, import_i18n100.__)("Redirect to current URL"), 31206 checked: redirectToCurrent, 31207 onChange: () => setAttributes({ 31208 redirectToCurrent: !redirectToCurrent 31209 }) 31210 } 31211 ) 31212 } 31213 ) 31214 ] 31215 } 31216 ) }), 31217 /* @__PURE__ */ (0, import_jsx_runtime278.jsx)( 31218 "div", 31219 { 31220 ...(0, import_block_editor130.useBlockProps)({ 31221 className: "logged-in" 31222 }), 31223 children: /* @__PURE__ */ (0, import_jsx_runtime278.jsx)("a", { href: "#login-pseudo-link", children: (0, import_i18n100.__)("Log out") }) 31224 } 31225 ) 31226 ] }); 31227 } 31228 31229 // packages/block-library/build-module/loginout/block.json 31230 var block_default49 = { 31231 $schema: "https://schemas.wp.org/trunk/block.json", 31232 apiVersion: 3, 31233 name: "core/loginout", 31234 title: "Login/out", 31235 category: "theme", 31236 description: "Show login & logout links.", 31237 keywords: ["login", "logout", "form"], 31238 textdomain: "default", 31239 attributes: { 31240 displayLoginAsForm: { 31241 type: "boolean", 31242 default: false 31243 }, 31244 redirectToCurrent: { 31245 type: "boolean", 31246 default: true 31247 } 31248 }, 31249 example: { 31250 viewportWidth: 350 31251 }, 31252 supports: { 31253 className: true, 31254 color: { 31255 background: true, 31256 text: false, 31257 gradients: true, 31258 link: true 31259 }, 31260 spacing: { 31261 margin: true, 31262 padding: true, 31263 __experimentalDefaultControls: { 31264 margin: false, 31265 padding: false 31266 } 31267 }, 31268 typography: { 31269 fontSize: true, 31270 lineHeight: true, 31271 __experimentalFontFamily: true, 31272 __experimentalFontWeight: true, 31273 __experimentalFontStyle: true, 31274 __experimentalTextTransform: true, 31275 __experimentalTextDecoration: true, 31276 __experimentalLetterSpacing: true, 31277 __experimentalDefaultControls: { 31278 fontSize: true 31279 } 31280 }, 31281 __experimentalBorder: { 31282 radius: true, 31283 color: true, 31284 width: true, 31285 style: true 31286 }, 31287 interactivity: { 31288 clientNavigation: true 31289 } 31290 }, 31291 style: "wp-block-loginout" 31292 }; 31293 31294 // packages/block-library/build-module/loginout/index.js 31295 var { name: name49 } = block_default49; 31296 var settings49 = { 31297 icon: login_default, 31298 edit: LoginOutEdit 31299 }; 31300 var init49 = () => initBlock({ name: name49, metadata: block_default49, settings: settings49 }); 31301 31302 // packages/block-library/build-module/media-text/index.js 31303 var media_text_exports = {}; 31304 __export(media_text_exports, { 31305 init: () => init50, 31306 metadata: () => block_default50, 31307 name: () => name50, 31308 settings: () => settings50 31309 }); 31310 var import_i18n104 = __toESM(require_i18n()); 31311 var import_blocks51 = __toESM(require_blocks()); 31312 31313 // packages/block-library/build-module/media-text/deprecated.js 31314 var import_block_editor131 = __toESM(require_block_editor()); 31315 var import_compose25 = __toESM(require_compose()); 31316 31317 // packages/block-library/build-module/media-text/constants.js 31318 var import_i18n101 = __toESM(require_i18n()); 31319 var DEFAULT_MEDIA_SIZE_SLUG4 = "full"; 31320 var WIDTH_CONSTRAINT_PERCENTAGE = 15; 31321 var LINK_DESTINATION_MEDIA3 = "media"; 31322 var LINK_DESTINATION_ATTACHMENT3 = "attachment"; 31323 var TEMPLATE9 = [ 31324 [ 31325 "core/paragraph", 31326 { 31327 placeholder: (0, import_i18n101._x)("Content\u2026", "content placeholder") 31328 } 31329 ] 31330 ]; 31331 31332 // packages/block-library/build-module/media-text/deprecated.js 31333 var import_jsx_runtime279 = __toESM(require_jsx_runtime()); 31334 var v1ToV5ImageFillStyles = (url, focalPoint) => { 31335 return url ? { 31336 backgroundImage: `url($url})`, 31337 backgroundPosition: focalPoint ? `$focalPoint.x * 100}% $focalPoint.y * 100}%` : `50% 50%` 31338 } : {}; 31339 }; 31340 var v6ToV7ImageFillStyles = (url, focalPoint) => { 31341 return url ? { 31342 backgroundImage: `url($url})`, 31343 backgroundPosition: focalPoint ? `$Math.round(focalPoint.x * 100)}% $Math.round( 31344 focalPoint.y * 100 31345 )}%` : `50% 50%` 31346 } : {}; 31347 }; 31348 var DEFAULT_MEDIA_WIDTH = 50; 31349 var noop = () => { 31350 }; 31351 var migrateCustomColors3 = (attributes3) => { 31352 if (!attributes3.customBackgroundColor) { 31353 return attributes3; 31354 } 31355 const style2 = { 31356 color: { 31357 background: attributes3.customBackgroundColor 31358 } 31359 }; 31360 const { customBackgroundColor, ...restAttributes } = attributes3; 31361 return { 31362 ...restAttributes, 31363 style: style2 31364 }; 31365 }; 31366 var migrateDefaultAlign = (attributes3) => { 31367 if (attributes3.align) { 31368 return attributes3; 31369 } 31370 return { 31371 ...attributes3, 31372 align: "wide" 31373 }; 31374 }; 31375 var v0Attributes = { 31376 align: { 31377 type: "string", 31378 default: "wide" 31379 }, 31380 mediaAlt: { 31381 type: "string", 31382 source: "attribute", 31383 selector: "figure img", 31384 attribute: "alt", 31385 default: "" 31386 }, 31387 mediaPosition: { 31388 type: "string", 31389 default: "left" 31390 }, 31391 mediaId: { 31392 type: "number" 31393 }, 31394 mediaType: { 31395 type: "string" 31396 }, 31397 mediaWidth: { 31398 type: "number", 31399 default: 50 31400 }, 31401 isStackedOnMobile: { 31402 type: "boolean", 31403 default: false 31404 } 31405 }; 31406 var v4ToV5BlockAttributes = { 31407 ...v0Attributes, 31408 isStackedOnMobile: { 31409 type: "boolean", 31410 default: true 31411 }, 31412 mediaUrl: { 31413 type: "string", 31414 source: "attribute", 31415 selector: "figure video,figure img", 31416 attribute: "src" 31417 }, 31418 mediaLink: { 31419 type: "string" 31420 }, 31421 linkDestination: { 31422 type: "string" 31423 }, 31424 linkTarget: { 31425 type: "string", 31426 source: "attribute", 31427 selector: "figure a", 31428 attribute: "target" 31429 }, 31430 href: { 31431 type: "string", 31432 source: "attribute", 31433 selector: "figure a", 31434 attribute: "href" 31435 }, 31436 rel: { 31437 type: "string", 31438 source: "attribute", 31439 selector: "figure a", 31440 attribute: "rel" 31441 }, 31442 linkClass: { 31443 type: "string", 31444 source: "attribute", 31445 selector: "figure a", 31446 attribute: "class" 31447 }, 31448 mediaSizeSlug: { 31449 type: "string" 31450 }, 31451 verticalAlignment: { 31452 type: "string" 31453 }, 31454 imageFill: { 31455 type: "boolean" 31456 }, 31457 focalPoint: { 31458 type: "object" 31459 } 31460 }; 31461 var v6Attributes = { 31462 ...v4ToV5BlockAttributes, 31463 mediaAlt: { 31464 type: "string", 31465 source: "attribute", 31466 selector: "figure img", 31467 attribute: "alt", 31468 default: "", 31469 role: "content" 31470 }, 31471 mediaId: { 31472 type: "number", 31473 role: "content" 31474 }, 31475 mediaUrl: { 31476 type: "string", 31477 source: "attribute", 31478 selector: "figure video,figure img", 31479 attribute: "src", 31480 role: "content" 31481 }, 31482 href: { 31483 type: "string", 31484 source: "attribute", 31485 selector: "figure a", 31486 attribute: "href", 31487 role: "content" 31488 }, 31489 mediaType: { 31490 type: "string", 31491 role: "content" 31492 } 31493 }; 31494 var v7Attributes = { 31495 ...v6Attributes, 31496 align: { 31497 type: "string", 31498 // v7 changed the default for the `align` attribute. 31499 default: "none" 31500 }, 31501 // New attribute. 31502 useFeaturedImage: { 31503 type: "boolean", 31504 default: false 31505 } 31506 }; 31507 var v4ToV5Supports = { 31508 anchor: true, 31509 align: ["wide", "full"], 31510 html: false, 31511 color: { 31512 gradients: true, 31513 link: true 31514 } 31515 }; 31516 var v6Supports = { 31517 ...v4ToV5Supports, 31518 color: { 31519 gradients: true, 31520 link: true, 31521 __experimentalDefaultControls: { 31522 background: true, 31523 text: true 31524 } 31525 }, 31526 spacing: { 31527 margin: true, 31528 padding: true 31529 }, 31530 typography: { 31531 fontSize: true, 31532 lineHeight: true, 31533 __experimentalFontFamily: true, 31534 __experimentalFontWeight: true, 31535 __experimentalFontStyle: true, 31536 __experimentalTextTransform: true, 31537 __experimentalTextDecoration: true, 31538 __experimentalLetterSpacing: true, 31539 __experimentalDefaultControls: { 31540 fontSize: true 31541 } 31542 } 31543 }; 31544 var v7Supports = { 31545 ...v6Supports, 31546 __experimentalBorder: { 31547 color: true, 31548 radius: true, 31549 style: true, 31550 width: true, 31551 __experimentalDefaultControls: { 31552 color: true, 31553 radius: true, 31554 style: true, 31555 width: true 31556 } 31557 }, 31558 color: { 31559 gradients: true, 31560 heading: true, 31561 link: true, 31562 __experimentalDefaultControls: { 31563 background: true, 31564 text: true 31565 } 31566 }, 31567 interactivity: { 31568 clientNavigation: true 31569 } 31570 }; 31571 var v74 = { 31572 attributes: v7Attributes, 31573 supports: v7Supports, 31574 usesContext: ["postId", "postType"], 31575 save({ attributes: attributes3 }) { 31576 const { 31577 isStackedOnMobile, 31578 mediaAlt, 31579 mediaPosition: mediaPosition2, 31580 mediaType, 31581 mediaUrl, 31582 mediaWidth, 31583 mediaId, 31584 verticalAlignment, 31585 imageFill, 31586 focalPoint, 31587 linkClass, 31588 href, 31589 linkTarget, 31590 rel 31591 } = attributes3; 31592 const mediaSizeSlug = attributes3.mediaSizeSlug || DEFAULT_MEDIA_SIZE_SLUG4; 31593 const newRel = !rel ? void 0 : rel; 31594 const imageClasses = clsx_default({ 31595 [`wp-image-$mediaId}`]: mediaId && mediaType === "image", 31596 [`size-$mediaSizeSlug}`]: mediaId && mediaType === "image" 31597 }); 31598 let image = mediaUrl ? /* @__PURE__ */ (0, import_jsx_runtime279.jsx)( 31599 "img", 31600 { 31601 src: mediaUrl, 31602 alt: mediaAlt, 31603 className: imageClasses || null 31604 } 31605 ) : null; 31606 if (href) { 31607 image = /* @__PURE__ */ (0, import_jsx_runtime279.jsx)( 31608 "a", 31609 { 31610 className: linkClass, 31611 href, 31612 target: linkTarget, 31613 rel: newRel, 31614 children: image 31615 } 31616 ); 31617 } 31618 const mediaTypeRenders = { 31619 image: () => image, 31620 video: () => /* @__PURE__ */ (0, import_jsx_runtime279.jsx)("video", { controls: true, src: mediaUrl }) 31621 }; 31622 const className = clsx_default({ 31623 "has-media-on-the-right": "right" === mediaPosition2, 31624 "is-stacked-on-mobile": isStackedOnMobile, 31625 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment, 31626 "is-image-fill": imageFill 31627 }); 31628 const backgroundStyles = imageFill ? v6ToV7ImageFillStyles(mediaUrl, focalPoint) : {}; 31629 let gridTemplateColumns; 31630 if (mediaWidth !== DEFAULT_MEDIA_WIDTH) { 31631 gridTemplateColumns = "right" === mediaPosition2 ? `auto $mediaWidth}%` : `$mediaWidth}% auto`; 31632 } 31633 const style2 = { 31634 gridTemplateColumns 31635 }; 31636 if ("right" === mediaPosition2) { 31637 return /* @__PURE__ */ (0, import_jsx_runtime279.jsxs)("div", { ...import_block_editor131.useBlockProps.save({ className, style: style2 }), children: [ 31638 /* @__PURE__ */ (0, import_jsx_runtime279.jsx)( 31639 "div", 31640 { 31641 ...import_block_editor131.useInnerBlocksProps.save({ 31642 className: "wp-block-media-text__content" 31643 }) 31644 } 31645 ), 31646 /* @__PURE__ */ (0, import_jsx_runtime279.jsx)( 31647 "figure", 31648 { 31649 className: "wp-block-media-text__media", 31650 style: backgroundStyles, 31651 children: (mediaTypeRenders[mediaType] || noop)() 31652 } 31653 ) 31654 ] }); 31655 } 31656 return /* @__PURE__ */ (0, import_jsx_runtime279.jsxs)("div", { ...import_block_editor131.useBlockProps.save({ className, style: style2 }), children: [ 31657 /* @__PURE__ */ (0, import_jsx_runtime279.jsx)( 31658 "figure", 31659 { 31660 className: "wp-block-media-text__media", 31661 style: backgroundStyles, 31662 children: (mediaTypeRenders[mediaType] || noop)() 31663 } 31664 ), 31665 /* @__PURE__ */ (0, import_jsx_runtime279.jsx)( 31666 "div", 31667 { 31668 ...import_block_editor131.useInnerBlocksProps.save({ 31669 className: "wp-block-media-text__content" 31670 }) 31671 } 31672 ) 31673 ] }); 31674 } 31675 }; 31676 var v64 = { 31677 attributes: v6Attributes, 31678 supports: v6Supports, 31679 save({ attributes: attributes3 }) { 31680 const { 31681 isStackedOnMobile, 31682 mediaAlt, 31683 mediaPosition: mediaPosition2, 31684 mediaType, 31685 mediaUrl, 31686 mediaWidth, 31687 mediaId, 31688 verticalAlignment, 31689 imageFill, 31690 focalPoint, 31691 linkClass, 31692 href, 31693 linkTarget, 31694 rel 31695 } = attributes3; 31696 const mediaSizeSlug = attributes3.mediaSizeSlug || DEFAULT_MEDIA_SIZE_SLUG4; 31697 const newRel = !rel ? void 0 : rel; 31698 const imageClasses = clsx_default({ 31699 [`wp-image-$mediaId}`]: mediaId && mediaType === "image", 31700 [`size-$mediaSizeSlug}`]: mediaId && mediaType === "image" 31701 }); 31702 let image = /* @__PURE__ */ (0, import_jsx_runtime279.jsx)( 31703 "img", 31704 { 31705 src: mediaUrl, 31706 alt: mediaAlt, 31707 className: imageClasses || null 31708 } 31709 ); 31710 if (href) { 31711 image = /* @__PURE__ */ (0, import_jsx_runtime279.jsx)( 31712 "a", 31713 { 31714 className: linkClass, 31715 href, 31716 target: linkTarget, 31717 rel: newRel, 31718 children: image 31719 } 31720 ); 31721 } 31722 const mediaTypeRenders = { 31723 image: () => image, 31724 video: () => /* @__PURE__ */ (0, import_jsx_runtime279.jsx)("video", { controls: true, src: mediaUrl }) 31725 }; 31726 const className = clsx_default({ 31727 "has-media-on-the-right": "right" === mediaPosition2, 31728 "is-stacked-on-mobile": isStackedOnMobile, 31729 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment, 31730 "is-image-fill": imageFill 31731 }); 31732 const backgroundStyles = imageFill ? v6ToV7ImageFillStyles(mediaUrl, focalPoint) : {}; 31733 let gridTemplateColumns; 31734 if (mediaWidth !== DEFAULT_MEDIA_WIDTH) { 31735 gridTemplateColumns = "right" === mediaPosition2 ? `auto $mediaWidth}%` : `$mediaWidth}% auto`; 31736 } 31737 const style2 = { 31738 gridTemplateColumns 31739 }; 31740 if ("right" === mediaPosition2) { 31741 return /* @__PURE__ */ (0, import_jsx_runtime279.jsxs)("div", { ...import_block_editor131.useBlockProps.save({ className, style: style2 }), children: [ 31742 /* @__PURE__ */ (0, import_jsx_runtime279.jsx)( 31743 "div", 31744 { 31745 ...import_block_editor131.useInnerBlocksProps.save({ 31746 className: "wp-block-media-text__content" 31747 }) 31748 } 31749 ), 31750 /* @__PURE__ */ (0, import_jsx_runtime279.jsx)( 31751 "figure", 31752 { 31753 className: "wp-block-media-text__media", 31754 style: backgroundStyles, 31755 children: (mediaTypeRenders[mediaType] || noop)() 31756 } 31757 ) 31758 ] }); 31759 } 31760 return /* @__PURE__ */ (0, import_jsx_runtime279.jsxs)("div", { ...import_block_editor131.useBlockProps.save({ className, style: style2 }), children: [ 31761 /* @__PURE__ */ (0, import_jsx_runtime279.jsx)( 31762 "figure", 31763 { 31764 className: "wp-block-media-text__media", 31765 style: backgroundStyles, 31766 children: (mediaTypeRenders[mediaType] || noop)() 31767 } 31768 ), 31769 /* @__PURE__ */ (0, import_jsx_runtime279.jsx)( 31770 "div", 31771 { 31772 ...import_block_editor131.useInnerBlocksProps.save({ 31773 className: "wp-block-media-text__content" 31774 }) 31775 } 31776 ) 31777 ] }); 31778 }, 31779 migrate: migrateDefaultAlign, 31780 isEligible(attributes3, innerBlocks, { block }) { 31781 const { attributes: finalizedAttributes } = block; 31782 return attributes3.align === void 0 && !!finalizedAttributes.className?.includes("alignwide"); 31783 } 31784 }; 31785 var v55 = { 31786 attributes: v4ToV5BlockAttributes, 31787 supports: v4ToV5Supports, 31788 save({ attributes: attributes3 }) { 31789 const { 31790 isStackedOnMobile, 31791 mediaAlt, 31792 mediaPosition: mediaPosition2, 31793 mediaType, 31794 mediaUrl, 31795 mediaWidth, 31796 mediaId, 31797 verticalAlignment, 31798 imageFill, 31799 focalPoint, 31800 linkClass, 31801 href, 31802 linkTarget, 31803 rel 31804 } = attributes3; 31805 const mediaSizeSlug = attributes3.mediaSizeSlug || DEFAULT_MEDIA_SIZE_SLUG4; 31806 const newRel = !rel ? void 0 : rel; 31807 const imageClasses = clsx_default({ 31808 [`wp-image-$mediaId}`]: mediaId && mediaType === "image", 31809 [`size-$mediaSizeSlug}`]: mediaId && mediaType === "image" 31810 }); 31811 let image = /* @__PURE__ */ (0, import_jsx_runtime279.jsx)( 31812 "img", 31813 { 31814 src: mediaUrl, 31815 alt: mediaAlt, 31816 className: imageClasses || null 31817 } 31818 ); 31819 if (href) { 31820 image = /* @__PURE__ */ (0, import_jsx_runtime279.jsx)( 31821 "a", 31822 { 31823 className: linkClass, 31824 href, 31825 target: linkTarget, 31826 rel: newRel, 31827 children: image 31828 } 31829 ); 31830 } 31831 const mediaTypeRenders = { 31832 image: () => image, 31833 video: () => /* @__PURE__ */ (0, import_jsx_runtime279.jsx)("video", { controls: true, src: mediaUrl }) 31834 }; 31835 const className = clsx_default({ 31836 "has-media-on-the-right": "right" === mediaPosition2, 31837 "is-stacked-on-mobile": isStackedOnMobile, 31838 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment, 31839 "is-image-fill": imageFill 31840 }); 31841 const backgroundStyles = imageFill ? v1ToV5ImageFillStyles(mediaUrl, focalPoint) : {}; 31842 let gridTemplateColumns; 31843 if (mediaWidth !== DEFAULT_MEDIA_WIDTH) { 31844 gridTemplateColumns = "right" === mediaPosition2 ? `auto $mediaWidth}%` : `$mediaWidth}% auto`; 31845 } 31846 const style2 = { 31847 gridTemplateColumns 31848 }; 31849 if ("right" === mediaPosition2) { 31850 return /* @__PURE__ */ (0, import_jsx_runtime279.jsxs)("div", { ...import_block_editor131.useBlockProps.save({ className, style: style2 }), children: [ 31851 /* @__PURE__ */ (0, import_jsx_runtime279.jsx)( 31852 "div", 31853 { 31854 ...import_block_editor131.useInnerBlocksProps.save({ 31855 className: "wp-block-media-text__content" 31856 }) 31857 } 31858 ), 31859 /* @__PURE__ */ (0, import_jsx_runtime279.jsx)( 31860 "figure", 31861 { 31862 className: "wp-block-media-text__media", 31863 style: backgroundStyles, 31864 children: (mediaTypeRenders[mediaType] || noop)() 31865 } 31866 ) 31867 ] }); 31868 } 31869 return /* @__PURE__ */ (0, import_jsx_runtime279.jsxs)("div", { ...import_block_editor131.useBlockProps.save({ className, style: style2 }), children: [ 31870 /* @__PURE__ */ (0, import_jsx_runtime279.jsx)( 31871 "figure", 31872 { 31873 className: "wp-block-media-text__media", 31874 style: backgroundStyles, 31875 children: (mediaTypeRenders[mediaType] || noop)() 31876 } 31877 ), 31878 /* @__PURE__ */ (0, import_jsx_runtime279.jsx)( 31879 "div", 31880 { 31881 ...import_block_editor131.useInnerBlocksProps.save({ 31882 className: "wp-block-media-text__content" 31883 }) 31884 } 31885 ) 31886 ] }); 31887 }, 31888 migrate: migrateDefaultAlign 31889 }; 31890 var v45 = { 31891 attributes: v4ToV5BlockAttributes, 31892 supports: v4ToV5Supports, 31893 save({ attributes: attributes3 }) { 31894 const { 31895 isStackedOnMobile, 31896 mediaAlt, 31897 mediaPosition: mediaPosition2, 31898 mediaType, 31899 mediaUrl, 31900 mediaWidth, 31901 mediaId, 31902 verticalAlignment, 31903 imageFill, 31904 focalPoint, 31905 linkClass, 31906 href, 31907 linkTarget, 31908 rel 31909 } = attributes3; 31910 const mediaSizeSlug = attributes3.mediaSizeSlug || DEFAULT_MEDIA_SIZE_SLUG4; 31911 const newRel = !rel ? void 0 : rel; 31912 const imageClasses = clsx_default({ 31913 [`wp-image-$mediaId}`]: mediaId && mediaType === "image", 31914 [`size-$mediaSizeSlug}`]: mediaId && mediaType === "image" 31915 }); 31916 let image = /* @__PURE__ */ (0, import_jsx_runtime279.jsx)( 31917 "img", 31918 { 31919 src: mediaUrl, 31920 alt: mediaAlt, 31921 className: imageClasses || null 31922 } 31923 ); 31924 if (href) { 31925 image = /* @__PURE__ */ (0, import_jsx_runtime279.jsx)( 31926 "a", 31927 { 31928 className: linkClass, 31929 href, 31930 target: linkTarget, 31931 rel: newRel, 31932 children: image 31933 } 31934 ); 31935 } 31936 const mediaTypeRenders = { 31937 image: () => image, 31938 video: () => /* @__PURE__ */ (0, import_jsx_runtime279.jsx)("video", { controls: true, src: mediaUrl }) 31939 }; 31940 const className = clsx_default({ 31941 "has-media-on-the-right": "right" === mediaPosition2, 31942 "is-stacked-on-mobile": isStackedOnMobile, 31943 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment, 31944 "is-image-fill": imageFill 31945 }); 31946 const backgroundStyles = imageFill ? v1ToV5ImageFillStyles(mediaUrl, focalPoint) : {}; 31947 let gridTemplateColumns; 31948 if (mediaWidth !== DEFAULT_MEDIA_WIDTH) { 31949 gridTemplateColumns = "right" === mediaPosition2 ? `auto $mediaWidth}%` : `$mediaWidth}% auto`; 31950 } 31951 const style2 = { 31952 gridTemplateColumns 31953 }; 31954 return /* @__PURE__ */ (0, import_jsx_runtime279.jsxs)("div", { ...import_block_editor131.useBlockProps.save({ className, style: style2 }), children: [ 31955 /* @__PURE__ */ (0, import_jsx_runtime279.jsx)( 31956 "figure", 31957 { 31958 className: "wp-block-media-text__media", 31959 style: backgroundStyles, 31960 children: (mediaTypeRenders[mediaType] || noop)() 31961 } 31962 ), 31963 /* @__PURE__ */ (0, import_jsx_runtime279.jsx)( 31964 "div", 31965 { 31966 ...import_block_editor131.useInnerBlocksProps.save({ 31967 className: "wp-block-media-text__content" 31968 }) 31969 } 31970 ) 31971 ] }); 31972 }, 31973 migrate: migrateDefaultAlign 31974 }; 31975 var v37 = { 31976 attributes: { 31977 ...v0Attributes, 31978 isStackedOnMobile: { 31979 type: "boolean", 31980 default: true 31981 }, 31982 backgroundColor: { 31983 type: "string" 31984 }, 31985 customBackgroundColor: { 31986 type: "string" 31987 }, 31988 mediaLink: { 31989 type: "string" 31990 }, 31991 linkDestination: { 31992 type: "string" 31993 }, 31994 linkTarget: { 31995 type: "string", 31996 source: "attribute", 31997 selector: "figure a", 31998 attribute: "target" 31999 }, 32000 href: { 32001 type: "string", 32002 source: "attribute", 32003 selector: "figure a", 32004 attribute: "href" 32005 }, 32006 rel: { 32007 type: "string", 32008 source: "attribute", 32009 selector: "figure a", 32010 attribute: "rel" 32011 }, 32012 linkClass: { 32013 type: "string", 32014 source: "attribute", 32015 selector: "figure a", 32016 attribute: "class" 32017 }, 32018 verticalAlignment: { 32019 type: "string" 32020 }, 32021 imageFill: { 32022 type: "boolean" 32023 }, 32024 focalPoint: { 32025 type: "object" 32026 } 32027 }, 32028 migrate: (0, import_compose25.compose)(migrateCustomColors3, migrateDefaultAlign), 32029 save({ attributes: attributes3 }) { 32030 const { 32031 backgroundColor, 32032 customBackgroundColor, 32033 isStackedOnMobile, 32034 mediaAlt, 32035 mediaPosition: mediaPosition2, 32036 mediaType, 32037 mediaUrl, 32038 mediaWidth, 32039 mediaId, 32040 verticalAlignment, 32041 imageFill, 32042 focalPoint, 32043 linkClass, 32044 href, 32045 linkTarget, 32046 rel 32047 } = attributes3; 32048 const newRel = !rel ? void 0 : rel; 32049 let image = /* @__PURE__ */ (0, import_jsx_runtime279.jsx)( 32050 "img", 32051 { 32052 src: mediaUrl, 32053 alt: mediaAlt, 32054 className: mediaId && mediaType === "image" ? `wp-image-$mediaId}` : null 32055 } 32056 ); 32057 if (href) { 32058 image = /* @__PURE__ */ (0, import_jsx_runtime279.jsx)( 32059 "a", 32060 { 32061 className: linkClass, 32062 href, 32063 target: linkTarget, 32064 rel: newRel, 32065 children: image 32066 } 32067 ); 32068 } 32069 const mediaTypeRenders = { 32070 image: () => image, 32071 video: () => /* @__PURE__ */ (0, import_jsx_runtime279.jsx)("video", { controls: true, src: mediaUrl }) 32072 }; 32073 const backgroundClass = (0, import_block_editor131.getColorClassName)( 32074 "background-color", 32075 backgroundColor 32076 ); 32077 const className = clsx_default({ 32078 "has-media-on-the-right": "right" === mediaPosition2, 32079 "has-background": backgroundClass || customBackgroundColor, 32080 [backgroundClass]: backgroundClass, 32081 "is-stacked-on-mobile": isStackedOnMobile, 32082 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment, 32083 "is-image-fill": imageFill 32084 }); 32085 const backgroundStyles = imageFill ? v1ToV5ImageFillStyles(mediaUrl, focalPoint) : {}; 32086 let gridTemplateColumns; 32087 if (mediaWidth !== DEFAULT_MEDIA_WIDTH) { 32088 gridTemplateColumns = "right" === mediaPosition2 ? `auto $mediaWidth}%` : `$mediaWidth}% auto`; 32089 } 32090 const style2 = { 32091 backgroundColor: backgroundClass ? void 0 : customBackgroundColor, 32092 gridTemplateColumns 32093 }; 32094 return /* @__PURE__ */ (0, import_jsx_runtime279.jsxs)("div", { className, style: style2, children: [ 32095 /* @__PURE__ */ (0, import_jsx_runtime279.jsx)( 32096 "figure", 32097 { 32098 className: "wp-block-media-text__media", 32099 style: backgroundStyles, 32100 children: (mediaTypeRenders[mediaType] || noop)() 32101 } 32102 ), 32103 /* @__PURE__ */ (0, import_jsx_runtime279.jsx)("div", { className: "wp-block-media-text__content", children: /* @__PURE__ */ (0, import_jsx_runtime279.jsx)(import_block_editor131.InnerBlocks.Content, {}) }) 32104 ] }); 32105 } 32106 }; 32107 var v29 = { 32108 attributes: { 32109 ...v0Attributes, 32110 backgroundColor: { 32111 type: "string" 32112 }, 32113 customBackgroundColor: { 32114 type: "string" 32115 }, 32116 mediaUrl: { 32117 type: "string", 32118 source: "attribute", 32119 selector: "figure video,figure img", 32120 attribute: "src" 32121 }, 32122 verticalAlignment: { 32123 type: "string" 32124 }, 32125 imageFill: { 32126 type: "boolean" 32127 }, 32128 focalPoint: { 32129 type: "object" 32130 } 32131 }, 32132 migrate: (0, import_compose25.compose)(migrateCustomColors3, migrateDefaultAlign), 32133 save({ attributes: attributes3 }) { 32134 const { 32135 backgroundColor, 32136 customBackgroundColor, 32137 isStackedOnMobile, 32138 mediaAlt, 32139 mediaPosition: mediaPosition2, 32140 mediaType, 32141 mediaUrl, 32142 mediaWidth, 32143 mediaId, 32144 verticalAlignment, 32145 imageFill, 32146 focalPoint 32147 } = attributes3; 32148 const mediaTypeRenders = { 32149 image: () => /* @__PURE__ */ (0, import_jsx_runtime279.jsx)( 32150 "img", 32151 { 32152 src: mediaUrl, 32153 alt: mediaAlt, 32154 className: mediaId && mediaType === "image" ? `wp-image-$mediaId}` : null 32155 } 32156 ), 32157 video: () => /* @__PURE__ */ (0, import_jsx_runtime279.jsx)("video", { controls: true, src: mediaUrl }) 32158 }; 32159 const backgroundClass = (0, import_block_editor131.getColorClassName)( 32160 "background-color", 32161 backgroundColor 32162 ); 32163 const className = clsx_default({ 32164 "has-media-on-the-right": "right" === mediaPosition2, 32165 [backgroundClass]: backgroundClass, 32166 "is-stacked-on-mobile": isStackedOnMobile, 32167 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment, 32168 "is-image-fill": imageFill 32169 }); 32170 const backgroundStyles = imageFill ? v1ToV5ImageFillStyles(mediaUrl, focalPoint) : {}; 32171 let gridTemplateColumns; 32172 if (mediaWidth !== DEFAULT_MEDIA_WIDTH) { 32173 gridTemplateColumns = "right" === mediaPosition2 ? `auto $mediaWidth}%` : `$mediaWidth}% auto`; 32174 } 32175 const style2 = { 32176 backgroundColor: backgroundClass ? void 0 : customBackgroundColor, 32177 gridTemplateColumns 32178 }; 32179 return /* @__PURE__ */ (0, import_jsx_runtime279.jsxs)("div", { className, style: style2, children: [ 32180 /* @__PURE__ */ (0, import_jsx_runtime279.jsx)( 32181 "figure", 32182 { 32183 className: "wp-block-media-text__media", 32184 style: backgroundStyles, 32185 children: (mediaTypeRenders[mediaType] || noop)() 32186 } 32187 ), 32188 /* @__PURE__ */ (0, import_jsx_runtime279.jsx)("div", { className: "wp-block-media-text__content", children: /* @__PURE__ */ (0, import_jsx_runtime279.jsx)(import_block_editor131.InnerBlocks.Content, {}) }) 32189 ] }); 32190 } 32191 }; 32192 var v119 = { 32193 attributes: { 32194 ...v0Attributes, 32195 backgroundColor: { 32196 type: "string" 32197 }, 32198 customBackgroundColor: { 32199 type: "string" 32200 }, 32201 mediaUrl: { 32202 type: "string", 32203 source: "attribute", 32204 selector: "figure video,figure img", 32205 attribute: "src" 32206 } 32207 }, 32208 migrate: migrateDefaultAlign, 32209 save({ attributes: attributes3 }) { 32210 const { 32211 backgroundColor, 32212 customBackgroundColor, 32213 isStackedOnMobile, 32214 mediaAlt, 32215 mediaPosition: mediaPosition2, 32216 mediaType, 32217 mediaUrl, 32218 mediaWidth 32219 } = attributes3; 32220 const mediaTypeRenders = { 32221 image: () => /* @__PURE__ */ (0, import_jsx_runtime279.jsx)("img", { src: mediaUrl, alt: mediaAlt }), 32222 video: () => /* @__PURE__ */ (0, import_jsx_runtime279.jsx)("video", { controls: true, src: mediaUrl }) 32223 }; 32224 const backgroundClass = (0, import_block_editor131.getColorClassName)( 32225 "background-color", 32226 backgroundColor 32227 ); 32228 const className = clsx_default({ 32229 "has-media-on-the-right": "right" === mediaPosition2, 32230 [backgroundClass]: backgroundClass, 32231 "is-stacked-on-mobile": isStackedOnMobile 32232 }); 32233 let gridTemplateColumns; 32234 if (mediaWidth !== DEFAULT_MEDIA_WIDTH) { 32235 gridTemplateColumns = "right" === mediaPosition2 ? `auto $mediaWidth}%` : `$mediaWidth}% auto`; 32236 } 32237 const style2 = { 32238 backgroundColor: backgroundClass ? void 0 : customBackgroundColor, 32239 gridTemplateColumns 32240 }; 32241 return /* @__PURE__ */ (0, import_jsx_runtime279.jsxs)("div", { className, style: style2, children: [ 32242 /* @__PURE__ */ (0, import_jsx_runtime279.jsx)("figure", { className: "wp-block-media-text__media", children: (mediaTypeRenders[mediaType] || noop)() }), 32243 /* @__PURE__ */ (0, import_jsx_runtime279.jsx)("div", { className: "wp-block-media-text__content", children: /* @__PURE__ */ (0, import_jsx_runtime279.jsx)(import_block_editor131.InnerBlocks.Content, {}) }) 32244 ] }); 32245 } 32246 }; 32247 var deprecated_default24 = [v74, v64, v55, v45, v37, v29, v119]; 32248 32249 // packages/block-library/build-module/media-text/edit.js 32250 var import_i18n103 = __toESM(require_i18n()); 32251 var import_data55 = __toESM(require_data()); 32252 var import_element54 = __toESM(require_element()); 32253 var import_block_editor133 = __toESM(require_block_editor()); 32254 var import_components60 = __toESM(require_components()); 32255 var import_blob15 = __toESM(require_blob()); 32256 var import_core_data24 = __toESM(require_core_data()); 32257 32258 // packages/block-library/build-module/media-text/media-container.js 32259 var import_components59 = __toESM(require_components()); 32260 var import_block_editor132 = __toESM(require_block_editor()); 32261 var import_i18n102 = __toESM(require_i18n()); 32262 var import_compose26 = __toESM(require_compose()); 32263 var import_data54 = __toESM(require_data()); 32264 var import_element53 = __toESM(require_element()); 32265 var import_blob14 = __toESM(require_blob()); 32266 var import_notices10 = __toESM(require_notices()); 32267 32268 // packages/block-library/build-module/media-text/image-fill.js 32269 function imageFillStyles(url, focalPoint) { 32270 return url ? { 32271 objectPosition: focalPoint ? `$Math.round(focalPoint.x * 100)}% $Math.round( 32272 focalPoint.y * 100 32273 )}%` : `50% 50%` 32274 } : {}; 32275 } 32276 32277 // packages/block-library/build-module/media-text/media-container.js 32278 var import_jsx_runtime280 = __toESM(require_jsx_runtime()); 32279 var ALLOWED_MEDIA_TYPES5 = ["image", "video"]; 32280 var noop2 = () => { 32281 }; 32282 var ResizableBoxContainer = (0, import_element53.forwardRef)( 32283 ({ isSelected, isStackedOnMobile, ...props }, ref) => { 32284 const isMobile = (0, import_compose26.useViewportMatch)("small", "<"); 32285 return /* @__PURE__ */ (0, import_jsx_runtime280.jsx)( 32286 import_components59.ResizableBox, 32287 { 32288 ref, 32289 showHandle: isSelected && (!isMobile || !isStackedOnMobile), 32290 ...props 32291 } 32292 ); 32293 } 32294 ); 32295 function ToolbarEditButton({ 32296 mediaId, 32297 mediaUrl, 32298 onSelectMedia, 32299 toggleUseFeaturedImage, 32300 useFeaturedImage 32301 }) { 32302 return /* @__PURE__ */ (0, import_jsx_runtime280.jsx)(import_block_editor132.BlockControls, { group: "other", children: /* @__PURE__ */ (0, import_jsx_runtime280.jsx)( 32303 import_block_editor132.MediaReplaceFlow, 32304 { 32305 mediaId, 32306 mediaURL: mediaUrl, 32307 allowedTypes: ALLOWED_MEDIA_TYPES5, 32308 onSelect: onSelectMedia, 32309 onToggleFeaturedImage: toggleUseFeaturedImage, 32310 useFeaturedImage, 32311 onReset: () => onSelectMedia(void 0) 32312 } 32313 ) }); 32314 } 32315 function PlaceholderContainer({ 32316 className, 32317 mediaUrl, 32318 onSelectMedia, 32319 toggleUseFeaturedImage 32320 }) { 32321 const { createErrorNotice } = (0, import_data54.useDispatch)(import_notices10.store); 32322 const onUploadError = (message) => { 32323 createErrorNotice(message, { type: "snackbar" }); 32324 }; 32325 return /* @__PURE__ */ (0, import_jsx_runtime280.jsx)( 32326 import_block_editor132.MediaPlaceholder, 32327 { 32328 icon: /* @__PURE__ */ (0, import_jsx_runtime280.jsx)(import_block_editor132.BlockIcon, { icon: media_default }), 32329 labels: { 32330 title: (0, import_i18n102.__)("Media area") 32331 }, 32332 className, 32333 onSelect: onSelectMedia, 32334 onToggleFeaturedImage: toggleUseFeaturedImage, 32335 allowedTypes: ALLOWED_MEDIA_TYPES5, 32336 onError: onUploadError, 32337 disableMediaButtons: mediaUrl 32338 } 32339 ); 32340 } 32341 function MediaContainer(props, ref) { 32342 const { 32343 className, 32344 commitWidthChange, 32345 focalPoint, 32346 imageFill, 32347 isSelected, 32348 isStackedOnMobile, 32349 mediaAlt, 32350 mediaId, 32351 mediaPosition: mediaPosition2, 32352 mediaType, 32353 mediaUrl, 32354 mediaWidth, 32355 onSelectMedia, 32356 onWidthChange, 32357 enableResize, 32358 toggleUseFeaturedImage, 32359 useFeaturedImage, 32360 featuredImageURL, 32361 featuredImageAlt, 32362 refMedia 32363 } = props; 32364 const isTemporaryMedia2 = !mediaId && (0, import_blob14.isBlobURL)(mediaUrl); 32365 const { toggleSelection } = (0, import_data54.useDispatch)(import_block_editor132.store); 32366 if (mediaUrl || featuredImageURL || useFeaturedImage) { 32367 const onResizeStart = () => { 32368 toggleSelection(false); 32369 }; 32370 const onResize = (event, direction, elt) => { 32371 onWidthChange(parseInt(elt.style.width)); 32372 }; 32373 const onResizeStop = (event, direction, elt) => { 32374 toggleSelection(true); 32375 commitWidthChange(parseInt(elt.style.width)); 32376 }; 32377 const enablePositions = { 32378 right: enableResize && mediaPosition2 === "left", 32379 left: enableResize && mediaPosition2 === "right" 32380 }; 32381 const positionStyles = mediaType === "image" && imageFill ? imageFillStyles(mediaUrl || featuredImageURL, focalPoint) : {}; 32382 const mediaTypeRenderers = { 32383 image: () => useFeaturedImage && featuredImageURL ? /* @__PURE__ */ (0, import_jsx_runtime280.jsx)( 32384 "img", 32385 { 32386 ref: refMedia, 32387 src: featuredImageURL, 32388 alt: featuredImageAlt, 32389 style: positionStyles 32390 } 32391 ) : mediaUrl && /* @__PURE__ */ (0, import_jsx_runtime280.jsx)( 32392 "img", 32393 { 32394 ref: refMedia, 32395 src: mediaUrl, 32396 alt: mediaAlt, 32397 style: positionStyles 32398 } 32399 ), 32400 video: () => /* @__PURE__ */ (0, import_jsx_runtime280.jsx)("video", { controls: true, ref: refMedia, src: mediaUrl }) 32401 }; 32402 return /* @__PURE__ */ (0, import_jsx_runtime280.jsxs)( 32403 ResizableBoxContainer, 32404 { 32405 as: "figure", 32406 className: clsx_default( 32407 className, 32408 "editor-media-container__resizer", 32409 { "is-transient": isTemporaryMedia2 } 32410 ), 32411 size: { width: mediaWidth + "%" }, 32412 minWidth: "10%", 32413 maxWidth: "100%", 32414 enable: enablePositions, 32415 onResizeStart, 32416 onResize, 32417 onResizeStop, 32418 axis: "x", 32419 isSelected, 32420 isStackedOnMobile, 32421 ref, 32422 children: [ 32423 /* @__PURE__ */ (0, import_jsx_runtime280.jsx)( 32424 ToolbarEditButton, 32425 { 32426 onSelectMedia, 32427 mediaUrl: useFeaturedImage && featuredImageURL ? featuredImageURL : mediaUrl, 32428 mediaId, 32429 toggleUseFeaturedImage, 32430 useFeaturedImage 32431 } 32432 ), 32433 (mediaTypeRenderers[mediaType] || noop2)(), 32434 isTemporaryMedia2 && /* @__PURE__ */ (0, import_jsx_runtime280.jsx)(import_components59.Spinner, {}), 32435 !useFeaturedImage && /* @__PURE__ */ (0, import_jsx_runtime280.jsx)(PlaceholderContainer, { ...props }), 32436 !featuredImageURL && useFeaturedImage && /* @__PURE__ */ (0, import_jsx_runtime280.jsx)( 32437 import_components59.Placeholder, 32438 { 32439 className: "wp-block-media-text--placeholder-image", 32440 style: positionStyles, 32441 withIllustration: true 32442 } 32443 ) 32444 ] 32445 } 32446 ); 32447 } 32448 return /* @__PURE__ */ (0, import_jsx_runtime280.jsx)(PlaceholderContainer, { ...props }); 32449 } 32450 var media_container_default = (0, import_element53.forwardRef)(MediaContainer); 32451 32452 // packages/block-library/build-module/media-text/edit.js 32453 var import_jsx_runtime281 = __toESM(require_jsx_runtime()); 32454 var { ResolutionTool: ResolutionTool3 } = unlock(import_block_editor133.privateApis); 32455 var applyWidthConstraints = (width) => Math.max( 32456 WIDTH_CONSTRAINT_PERCENTAGE, 32457 Math.min(width, 100 - WIDTH_CONSTRAINT_PERCENTAGE) 32458 ); 32459 function getImageSourceUrlBySizeSlug(image, slug) { 32460 return image?.media_details?.sizes?.[slug]?.source_url; 32461 } 32462 function attributesFromMedia2({ 32463 attributes: { linkDestination, href }, 32464 setAttributes 32465 }) { 32466 return (media) => { 32467 if (!media || !media.url) { 32468 setAttributes({ 32469 mediaAlt: void 0, 32470 mediaId: void 0, 32471 mediaType: void 0, 32472 mediaUrl: void 0, 32473 mediaLink: void 0, 32474 href: void 0, 32475 focalPoint: void 0, 32476 useFeaturedImage: false 32477 }); 32478 return; 32479 } 32480 if ((0, import_blob15.isBlobURL)(media.url)) { 32481 media.type = (0, import_blob15.getBlobTypeByURL)(media.url); 32482 } 32483 let mediaType; 32484 let src; 32485 if (media.media_type) { 32486 if (media.media_type === "image") { 32487 mediaType = "image"; 32488 } else { 32489 mediaType = "video"; 32490 } 32491 } else { 32492 mediaType = media.type; 32493 } 32494 if (mediaType === "image") { 32495 src = media.sizes?.large?.url || media.media_details?.sizes?.large?.source_url; 32496 } 32497 let newHref = href; 32498 if (linkDestination === LINK_DESTINATION_MEDIA3) { 32499 newHref = media.url; 32500 } 32501 if (linkDestination === LINK_DESTINATION_ATTACHMENT3) { 32502 newHref = media.link; 32503 } 32504 setAttributes({ 32505 mediaAlt: media.alt, 32506 mediaId: media.id, 32507 mediaType, 32508 mediaUrl: src || media.url, 32509 mediaLink: media.link || void 0, 32510 href: newHref, 32511 focalPoint: void 0, 32512 useFeaturedImage: false 32513 }); 32514 }; 32515 } 32516 function MediaTextResolutionTool({ image, value, onChange }) { 32517 const { imageSizes } = (0, import_data55.useSelect)((select9) => { 32518 const { getSettings: getSettings2 } = select9(import_block_editor133.store); 32519 return { 32520 imageSizes: getSettings2().imageSizes 32521 }; 32522 }, []); 32523 if (!imageSizes?.length) { 32524 return null; 32525 } 32526 const imageSizeOptions = imageSizes.filter(({ slug }) => getImageSourceUrlBySizeSlug(image, slug)).map(({ name: name117, slug }) => ({ value: slug, label: name117 })); 32527 return /* @__PURE__ */ (0, import_jsx_runtime281.jsx)( 32528 ResolutionTool3, 32529 { 32530 value, 32531 defaultValue: DEFAULT_MEDIA_SIZE_SLUG4, 32532 options: imageSizeOptions, 32533 onChange 32534 } 32535 ); 32536 } 32537 function MediaTextEdit({ 32538 attributes: attributes3, 32539 isSelected, 32540 setAttributes, 32541 context: { postId, postType } 32542 }) { 32543 const { 32544 focalPoint, 32545 href, 32546 imageFill, 32547 isStackedOnMobile, 32548 linkClass, 32549 linkDestination, 32550 linkTarget, 32551 mediaAlt, 32552 mediaId, 32553 mediaPosition: mediaPosition2, 32554 mediaType, 32555 mediaUrl, 32556 mediaWidth, 32557 mediaSizeSlug, 32558 rel, 32559 verticalAlignment, 32560 allowedBlocks, 32561 useFeaturedImage 32562 } = attributes3; 32563 const [featuredImage] = (0, import_core_data24.useEntityProp)( 32564 "postType", 32565 postType, 32566 "featured_media", 32567 postId 32568 ); 32569 const { featuredImageMedia } = (0, import_data55.useSelect)( 32570 (select9) => { 32571 return { 32572 featuredImageMedia: featuredImage && useFeaturedImage ? select9(import_core_data24.store).getEntityRecord( 32573 "postType", 32574 "attachment", 32575 featuredImage, 32576 { 32577 context: "view" 32578 } 32579 ) : void 0 32580 }; 32581 }, 32582 [featuredImage, useFeaturedImage] 32583 ); 32584 const { image } = (0, import_data55.useSelect)( 32585 (select9) => { 32586 return { 32587 image: mediaId && isSelected ? select9(import_core_data24.store).getEntityRecord( 32588 "postType", 32589 "attachment", 32590 mediaId, 32591 { 32592 context: "view" 32593 } 32594 ) : null 32595 }; 32596 }, 32597 [isSelected, mediaId] 32598 ); 32599 const featuredImageURL = useFeaturedImage ? featuredImageMedia?.source_url : ""; 32600 const featuredImageAlt = useFeaturedImage ? featuredImageMedia?.alt_text : ""; 32601 const toggleUseFeaturedImage = () => { 32602 setAttributes({ 32603 imageFill: false, 32604 mediaType: "image", 32605 mediaId: void 0, 32606 mediaUrl: void 0, 32607 mediaAlt: void 0, 32608 mediaLink: void 0, 32609 linkDestination: void 0, 32610 linkTarget: void 0, 32611 linkClass: void 0, 32612 rel: void 0, 32613 href: void 0, 32614 useFeaturedImage: !useFeaturedImage 32615 }); 32616 }; 32617 const refMedia = (0, import_element54.useRef)(); 32618 const imperativeFocalPointPreview = (value) => { 32619 const { style: style22 } = refMedia.current; 32620 const { x: x2, y: y2 } = value; 32621 style22.objectPosition = `$x2 * 100}% $y2 * 100}%`; 32622 }; 32623 const [temporaryMediaWidth, setTemporaryMediaWidth] = (0, import_element54.useState)(null); 32624 const onSelectMedia = attributesFromMedia2({ attributes: attributes3, setAttributes }); 32625 const onSetHref = (props) => { 32626 setAttributes(props); 32627 }; 32628 const onWidthChange = (width) => { 32629 setTemporaryMediaWidth(applyWidthConstraints(width)); 32630 }; 32631 const commitWidthChange = (width) => { 32632 setAttributes({ 32633 mediaWidth: applyWidthConstraints(width) 32634 }); 32635 setTemporaryMediaWidth(null); 32636 }; 32637 const classNames = clsx_default({ 32638 "has-media-on-the-right": "right" === mediaPosition2, 32639 "is-selected": isSelected, 32640 "is-stacked-on-mobile": isStackedOnMobile, 32641 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment, 32642 "is-image-fill-element": imageFill 32643 }); 32644 const widthString = `$temporaryMediaWidth || mediaWidth}%`; 32645 const gridTemplateColumns = "right" === mediaPosition2 ? `1fr $widthString}` : `$widthString} 1fr`; 32646 const style2 = { 32647 gridTemplateColumns, 32648 msGridColumns: gridTemplateColumns 32649 }; 32650 const onMediaAltChange = (newMediaAlt) => { 32651 setAttributes({ mediaAlt: newMediaAlt }); 32652 }; 32653 const onVerticalAlignmentChange = (alignment) => { 32654 setAttributes({ verticalAlignment: alignment }); 32655 }; 32656 const updateImage = (newMediaSizeSlug) => { 32657 const newUrl = getImageSourceUrlBySizeSlug(image, newMediaSizeSlug); 32658 if (!newUrl) { 32659 return null; 32660 } 32661 setAttributes({ 32662 mediaUrl: newUrl, 32663 mediaSizeSlug: newMediaSizeSlug 32664 }); 32665 }; 32666 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 32667 const mediaTextGeneralSettings = /* @__PURE__ */ (0, import_jsx_runtime281.jsxs)( 32668 import_components60.__experimentalToolsPanel, 32669 { 32670 label: (0, import_i18n103.__)("Settings"), 32671 resetAll: () => { 32672 setAttributes({ 32673 isStackedOnMobile: true, 32674 imageFill: false, 32675 mediaAlt: "", 32676 focalPoint: void 0, 32677 mediaWidth: 50 32678 }); 32679 updateImage(DEFAULT_MEDIA_SIZE_SLUG4); 32680 }, 32681 dropdownMenuProps, 32682 children: [ 32683 /* @__PURE__ */ (0, import_jsx_runtime281.jsx)( 32684 import_components60.__experimentalToolsPanelItem, 32685 { 32686 label: (0, import_i18n103.__)("Media width"), 32687 isShownByDefault: true, 32688 hasValue: () => mediaWidth !== 50, 32689 onDeselect: () => setAttributes({ mediaWidth: 50 }), 32690 children: /* @__PURE__ */ (0, import_jsx_runtime281.jsx)( 32691 import_components60.RangeControl, 32692 { 32693 __next40pxDefaultSize: true, 32694 label: (0, import_i18n103.__)("Media width"), 32695 value: temporaryMediaWidth || mediaWidth, 32696 onChange: commitWidthChange, 32697 min: WIDTH_CONSTRAINT_PERCENTAGE, 32698 max: 100 - WIDTH_CONSTRAINT_PERCENTAGE 32699 } 32700 ) 32701 } 32702 ), 32703 /* @__PURE__ */ (0, import_jsx_runtime281.jsx)( 32704 import_components60.__experimentalToolsPanelItem, 32705 { 32706 label: (0, import_i18n103.__)("Stack on mobile"), 32707 isShownByDefault: true, 32708 hasValue: () => !isStackedOnMobile, 32709 onDeselect: () => setAttributes({ isStackedOnMobile: true }), 32710 children: /* @__PURE__ */ (0, import_jsx_runtime281.jsx)( 32711 import_components60.ToggleControl, 32712 { 32713 label: (0, import_i18n103.__)("Stack on mobile"), 32714 checked: isStackedOnMobile, 32715 onChange: () => setAttributes({ 32716 isStackedOnMobile: !isStackedOnMobile 32717 }) 32718 } 32719 ) 32720 } 32721 ), 32722 mediaType === "image" && /* @__PURE__ */ (0, import_jsx_runtime281.jsx)( 32723 import_components60.__experimentalToolsPanelItem, 32724 { 32725 label: (0, import_i18n103.__)("Crop image to fill"), 32726 isShownByDefault: true, 32727 hasValue: () => !!imageFill, 32728 onDeselect: () => setAttributes({ imageFill: false }), 32729 children: /* @__PURE__ */ (0, import_jsx_runtime281.jsx)( 32730 import_components60.ToggleControl, 32731 { 32732 label: (0, import_i18n103.__)("Crop image to fill"), 32733 checked: !!imageFill, 32734 onChange: () => setAttributes({ 32735 imageFill: !imageFill 32736 }) 32737 } 32738 ) 32739 } 32740 ), 32741 imageFill && (mediaUrl || featuredImageURL) && mediaType === "image" && /* @__PURE__ */ (0, import_jsx_runtime281.jsx)( 32742 import_components60.__experimentalToolsPanelItem, 32743 { 32744 label: (0, import_i18n103.__)("Focal point"), 32745 isShownByDefault: true, 32746 hasValue: () => !!focalPoint, 32747 onDeselect: () => setAttributes({ focalPoint: void 0 }), 32748 children: /* @__PURE__ */ (0, import_jsx_runtime281.jsx)( 32749 import_components60.FocalPointPicker, 32750 { 32751 label: (0, import_i18n103.__)("Focal point"), 32752 url: useFeaturedImage && featuredImageURL ? featuredImageURL : mediaUrl, 32753 value: focalPoint, 32754 onChange: (value) => setAttributes({ focalPoint: value }), 32755 onDragStart: imperativeFocalPointPreview, 32756 onDrag: imperativeFocalPointPreview 32757 } 32758 ) 32759 } 32760 ), 32761 mediaType === "image" && mediaUrl && !useFeaturedImage && /* @__PURE__ */ (0, import_jsx_runtime281.jsx)( 32762 import_components60.__experimentalToolsPanelItem, 32763 { 32764 label: (0, import_i18n103.__)("Alternative text"), 32765 isShownByDefault: true, 32766 hasValue: () => !!mediaAlt, 32767 onDeselect: () => setAttributes({ mediaAlt: "" }), 32768 children: /* @__PURE__ */ (0, import_jsx_runtime281.jsx)( 32769 import_components60.TextareaControl, 32770 { 32771 label: (0, import_i18n103.__)("Alternative text"), 32772 value: mediaAlt, 32773 onChange: onMediaAltChange, 32774 help: /* @__PURE__ */ (0, import_jsx_runtime281.jsxs)(import_jsx_runtime281.Fragment, { children: [ 32775 /* @__PURE__ */ (0, import_jsx_runtime281.jsx)( 32776 import_components60.ExternalLink, 32777 { 32778 href: ( 32779 // translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations. 32780 (0, import_i18n103.__)( 32781 "https://www.w3.org/WAI/tutorials/images/decision-tree/" 32782 ) 32783 ), 32784 children: (0, import_i18n103.__)( 32785 "Describe the purpose of the image." 32786 ) 32787 } 32788 ), 32789 /* @__PURE__ */ (0, import_jsx_runtime281.jsx)("br", {}), 32790 (0, import_i18n103.__)("Leave empty if decorative.") 32791 ] }) 32792 } 32793 ) 32794 } 32795 ), 32796 mediaType === "image" && !useFeaturedImage && /* @__PURE__ */ (0, import_jsx_runtime281.jsx)( 32797 MediaTextResolutionTool, 32798 { 32799 image, 32800 value: mediaSizeSlug, 32801 onChange: updateImage 32802 } 32803 ) 32804 ] 32805 } 32806 ); 32807 const blockProps = (0, import_block_editor133.useBlockProps)({ 32808 className: classNames, 32809 style: style2 32810 }); 32811 const innerBlocksProps = (0, import_block_editor133.useInnerBlocksProps)( 32812 { className: "wp-block-media-text__content" }, 32813 { template: TEMPLATE9, allowedBlocks } 32814 ); 32815 const blockEditingMode = (0, import_block_editor133.useBlockEditingMode)(); 32816 return /* @__PURE__ */ (0, import_jsx_runtime281.jsxs)(import_jsx_runtime281.Fragment, { children: [ 32817 /* @__PURE__ */ (0, import_jsx_runtime281.jsx)(import_block_editor133.InspectorControls, { children: mediaTextGeneralSettings }), 32818 /* @__PURE__ */ (0, import_jsx_runtime281.jsxs)(import_block_editor133.BlockControls, { group: "block", children: [ 32819 blockEditingMode === "default" && /* @__PURE__ */ (0, import_jsx_runtime281.jsxs)(import_jsx_runtime281.Fragment, { children: [ 32820 /* @__PURE__ */ (0, import_jsx_runtime281.jsx)( 32821 import_block_editor133.BlockVerticalAlignmentControl, 32822 { 32823 onChange: onVerticalAlignmentChange, 32824 value: verticalAlignment 32825 } 32826 ), 32827 /* @__PURE__ */ (0, import_jsx_runtime281.jsx)( 32828 import_components60.ToolbarButton, 32829 { 32830 icon: pull_left_default, 32831 title: (0, import_i18n103.__)("Show media on left"), 32832 isActive: mediaPosition2 === "left", 32833 onClick: () => setAttributes({ mediaPosition: "left" }) 32834 } 32835 ), 32836 /* @__PURE__ */ (0, import_jsx_runtime281.jsx)( 32837 import_components60.ToolbarButton, 32838 { 32839 icon: pull_right_default, 32840 title: (0, import_i18n103.__)("Show media on right"), 32841 isActive: mediaPosition2 === "right", 32842 onClick: () => setAttributes({ mediaPosition: "right" }) 32843 } 32844 ) 32845 ] }), 32846 mediaType === "image" && !useFeaturedImage && /* @__PURE__ */ (0, import_jsx_runtime281.jsx)( 32847 import_block_editor133.__experimentalImageURLInputUI, 32848 { 32849 url: href || "", 32850 onChangeUrl: onSetHref, 32851 linkDestination, 32852 mediaType, 32853 mediaUrl: image && image.source_url, 32854 mediaLink: image && image.link, 32855 linkTarget, 32856 linkClass, 32857 rel 32858 } 32859 ) 32860 ] }), 32861 /* @__PURE__ */ (0, import_jsx_runtime281.jsxs)("div", { ...blockProps, children: [ 32862 mediaPosition2 === "right" && /* @__PURE__ */ (0, import_jsx_runtime281.jsx)("div", { ...innerBlocksProps }), 32863 /* @__PURE__ */ (0, import_jsx_runtime281.jsx)( 32864 media_container_default, 32865 { 32866 className: "wp-block-media-text__media", 32867 onSelectMedia, 32868 onWidthChange, 32869 commitWidthChange, 32870 refMedia, 32871 enableResize: blockEditingMode === "default", 32872 toggleUseFeaturedImage, 32873 ...{ 32874 focalPoint, 32875 imageFill, 32876 isSelected, 32877 isStackedOnMobile, 32878 mediaAlt, 32879 mediaId, 32880 mediaPosition: mediaPosition2, 32881 mediaType, 32882 mediaUrl, 32883 mediaWidth, 32884 useFeaturedImage, 32885 featuredImageURL, 32886 featuredImageAlt 32887 } 32888 } 32889 ), 32890 mediaPosition2 !== "right" && /* @__PURE__ */ (0, import_jsx_runtime281.jsx)("div", { ...innerBlocksProps }) 32891 ] }) 32892 ] }); 32893 } 32894 var edit_default18 = MediaTextEdit; 32895 32896 // packages/block-library/build-module/media-text/block.json 32897 var block_default50 = { 32898 $schema: "https://schemas.wp.org/trunk/block.json", 32899 apiVersion: 3, 32900 name: "core/media-text", 32901 title: "Media & Text", 32902 category: "media", 32903 description: "Set media and words side-by-side for a richer layout.", 32904 keywords: ["image", "video"], 32905 textdomain: "default", 32906 attributes: { 32907 align: { 32908 type: "string", 32909 default: "none" 32910 }, 32911 mediaAlt: { 32912 type: "string", 32913 source: "attribute", 32914 selector: "figure img", 32915 attribute: "alt", 32916 default: "", 32917 role: "content" 32918 }, 32919 mediaPosition: { 32920 type: "string", 32921 default: "left" 32922 }, 32923 mediaId: { 32924 type: "number", 32925 role: "content" 32926 }, 32927 mediaUrl: { 32928 type: "string", 32929 source: "attribute", 32930 selector: "figure video,figure img", 32931 attribute: "src", 32932 role: "content" 32933 }, 32934 mediaLink: { 32935 type: "string" 32936 }, 32937 linkDestination: { 32938 type: "string" 32939 }, 32940 linkTarget: { 32941 type: "string", 32942 source: "attribute", 32943 selector: "figure a", 32944 attribute: "target" 32945 }, 32946 href: { 32947 type: "string", 32948 source: "attribute", 32949 selector: "figure a", 32950 attribute: "href", 32951 role: "content" 32952 }, 32953 rel: { 32954 type: "string", 32955 source: "attribute", 32956 selector: "figure a", 32957 attribute: "rel" 32958 }, 32959 linkClass: { 32960 type: "string", 32961 source: "attribute", 32962 selector: "figure a", 32963 attribute: "class" 32964 }, 32965 mediaType: { 32966 type: "string", 32967 role: "content" 32968 }, 32969 mediaWidth: { 32970 type: "number", 32971 default: 50 32972 }, 32973 mediaSizeSlug: { 32974 type: "string" 32975 }, 32976 isStackedOnMobile: { 32977 type: "boolean", 32978 default: true 32979 }, 32980 verticalAlignment: { 32981 type: "string" 32982 }, 32983 imageFill: { 32984 type: "boolean" 32985 }, 32986 focalPoint: { 32987 type: "object" 32988 }, 32989 useFeaturedImage: { 32990 type: "boolean", 32991 default: false 32992 } 32993 }, 32994 usesContext: ["postId", "postType"], 32995 supports: { 32996 anchor: true, 32997 align: ["wide", "full"], 32998 html: false, 32999 __experimentalBorder: { 33000 color: true, 33001 radius: true, 33002 style: true, 33003 width: true, 33004 __experimentalDefaultControls: { 33005 color: true, 33006 radius: true, 33007 style: true, 33008 width: true 33009 } 33010 }, 33011 color: { 33012 gradients: true, 33013 heading: true, 33014 link: true, 33015 __experimentalDefaultControls: { 33016 background: true, 33017 text: true 33018 } 33019 }, 33020 spacing: { 33021 margin: true, 33022 padding: true 33023 }, 33024 typography: { 33025 fontSize: true, 33026 lineHeight: true, 33027 __experimentalFontFamily: true, 33028 __experimentalFontWeight: true, 33029 __experimentalFontStyle: true, 33030 __experimentalTextTransform: true, 33031 __experimentalTextDecoration: true, 33032 __experimentalLetterSpacing: true, 33033 __experimentalDefaultControls: { 33034 fontSize: true 33035 } 33036 }, 33037 interactivity: { 33038 clientNavigation: true 33039 }, 33040 allowedBlocks: true 33041 }, 33042 editorStyle: "wp-block-media-text-editor", 33043 style: "wp-block-media-text" 33044 }; 33045 33046 // packages/block-library/build-module/media-text/save.js 33047 var import_block_editor134 = __toESM(require_block_editor()); 33048 var import_jsx_runtime282 = __toESM(require_jsx_runtime()); 33049 var DEFAULT_MEDIA_WIDTH2 = 50; 33050 var noop3 = () => { 33051 }; 33052 function save30({ attributes: attributes3 }) { 33053 const { 33054 isStackedOnMobile, 33055 mediaAlt, 33056 mediaPosition: mediaPosition2, 33057 mediaType, 33058 mediaUrl, 33059 mediaWidth, 33060 mediaId, 33061 verticalAlignment, 33062 imageFill, 33063 focalPoint, 33064 linkClass, 33065 href, 33066 linkTarget, 33067 rel 33068 } = attributes3; 33069 const mediaSizeSlug = attributes3.mediaSizeSlug || DEFAULT_MEDIA_SIZE_SLUG4; 33070 const newRel = !rel ? void 0 : rel; 33071 const imageClasses = clsx_default({ 33072 [`wp-image-$mediaId}`]: mediaId && mediaType === "image", 33073 [`size-$mediaSizeSlug}`]: mediaId && mediaType === "image" 33074 }); 33075 const positionStyles = imageFill ? imageFillStyles(mediaUrl, focalPoint) : {}; 33076 let image = mediaUrl ? /* @__PURE__ */ (0, import_jsx_runtime282.jsx)( 33077 "img", 33078 { 33079 src: mediaUrl, 33080 alt: mediaAlt, 33081 className: imageClasses || null, 33082 style: positionStyles 33083 } 33084 ) : null; 33085 if (href) { 33086 image = /* @__PURE__ */ (0, import_jsx_runtime282.jsx)( 33087 "a", 33088 { 33089 className: linkClass, 33090 href, 33091 target: linkTarget, 33092 rel: newRel, 33093 children: image 33094 } 33095 ); 33096 } 33097 const mediaTypeRenders = { 33098 image: () => image, 33099 video: () => /* @__PURE__ */ (0, import_jsx_runtime282.jsx)("video", { controls: true, src: mediaUrl }) 33100 }; 33101 const className = clsx_default({ 33102 "has-media-on-the-right": "right" === mediaPosition2, 33103 "is-stacked-on-mobile": isStackedOnMobile, 33104 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment, 33105 "is-image-fill-element": imageFill 33106 }); 33107 let gridTemplateColumns; 33108 if (mediaWidth !== DEFAULT_MEDIA_WIDTH2) { 33109 gridTemplateColumns = "right" === mediaPosition2 ? `auto $mediaWidth}%` : `$mediaWidth}% auto`; 33110 } 33111 const style2 = { 33112 gridTemplateColumns 33113 }; 33114 if ("right" === mediaPosition2) { 33115 return /* @__PURE__ */ (0, import_jsx_runtime282.jsxs)("div", { ...import_block_editor134.useBlockProps.save({ className, style: style2 }), children: [ 33116 /* @__PURE__ */ (0, import_jsx_runtime282.jsx)( 33117 "div", 33118 { 33119 ...import_block_editor134.useInnerBlocksProps.save({ 33120 className: "wp-block-media-text__content" 33121 }) 33122 } 33123 ), 33124 /* @__PURE__ */ (0, import_jsx_runtime282.jsx)("figure", { className: "wp-block-media-text__media", children: (mediaTypeRenders[mediaType] || noop3)() }) 33125 ] }); 33126 } 33127 return /* @__PURE__ */ (0, import_jsx_runtime282.jsxs)("div", { ...import_block_editor134.useBlockProps.save({ className, style: style2 }), children: [ 33128 /* @__PURE__ */ (0, import_jsx_runtime282.jsx)("figure", { className: "wp-block-media-text__media", children: (mediaTypeRenders[mediaType] || noop3)() }), 33129 /* @__PURE__ */ (0, import_jsx_runtime282.jsx)( 33130 "div", 33131 { 33132 ...import_block_editor134.useInnerBlocksProps.save({ 33133 className: "wp-block-media-text__content" 33134 }) 33135 } 33136 ) 33137 ] }); 33138 } 33139 33140 // packages/block-library/build-module/media-text/transforms.js 33141 var import_blocks50 = __toESM(require_blocks()); 33142 var transforms16 = { 33143 from: [ 33144 { 33145 type: "block", 33146 blocks: ["core/image"], 33147 transform: ({ alt, url, id, anchor }) => (0, import_blocks50.createBlock)("core/media-text", { 33148 mediaAlt: alt, 33149 mediaId: id, 33150 mediaUrl: url, 33151 mediaType: "image", 33152 anchor 33153 }) 33154 }, 33155 { 33156 type: "block", 33157 blocks: ["core/video"], 33158 transform: ({ src, id, anchor }) => (0, import_blocks50.createBlock)("core/media-text", { 33159 mediaId: id, 33160 mediaUrl: src, 33161 mediaType: "video", 33162 anchor 33163 }) 33164 }, 33165 { 33166 type: "block", 33167 blocks: ["core/cover"], 33168 transform: ({ 33169 align, 33170 alt, 33171 anchor, 33172 backgroundType, 33173 customGradient, 33174 customOverlayColor, 33175 gradient, 33176 id, 33177 overlayColor, 33178 style: style2, 33179 textColor, 33180 url, 33181 useFeaturedImage 33182 }, innerBlocks) => { 33183 let additionalAttributes = {}; 33184 if (customGradient) { 33185 additionalAttributes = { 33186 style: { 33187 color: { 33188 gradient: customGradient 33189 } 33190 } 33191 }; 33192 } else if (customOverlayColor) { 33193 additionalAttributes = { 33194 style: { 33195 color: { 33196 background: customOverlayColor 33197 } 33198 } 33199 }; 33200 } 33201 if (style2?.color?.text) { 33202 additionalAttributes.style = { 33203 color: { 33204 ...additionalAttributes.style?.color, 33205 text: style2.color.text 33206 } 33207 }; 33208 } 33209 return (0, import_blocks50.createBlock)( 33210 "core/media-text", 33211 { 33212 align, 33213 anchor, 33214 backgroundColor: overlayColor, 33215 gradient, 33216 mediaAlt: alt, 33217 mediaId: id, 33218 mediaType: backgroundType, 33219 mediaUrl: url, 33220 textColor, 33221 useFeaturedImage, 33222 ...additionalAttributes 33223 }, 33224 innerBlocks 33225 ); 33226 } 33227 } 33228 ], 33229 to: [ 33230 { 33231 type: "block", 33232 blocks: ["core/image"], 33233 isMatch: ({ mediaType, mediaUrl }) => { 33234 return !mediaUrl || mediaType === "image"; 33235 }, 33236 transform: ({ mediaAlt, mediaId, mediaUrl, anchor }) => { 33237 return (0, import_blocks50.createBlock)("core/image", { 33238 alt: mediaAlt, 33239 id: mediaId, 33240 url: mediaUrl, 33241 anchor 33242 }); 33243 } 33244 }, 33245 { 33246 type: "block", 33247 blocks: ["core/video"], 33248 isMatch: ({ mediaType, mediaUrl }) => { 33249 return !mediaUrl || mediaType === "video"; 33250 }, 33251 transform: ({ mediaId, mediaUrl, anchor }) => { 33252 return (0, import_blocks50.createBlock)("core/video", { 33253 id: mediaId, 33254 src: mediaUrl, 33255 anchor 33256 }); 33257 } 33258 }, 33259 { 33260 type: "block", 33261 blocks: ["core/cover"], 33262 transform: ({ 33263 align, 33264 anchor, 33265 backgroundColor, 33266 focalPoint, 33267 gradient, 33268 mediaAlt, 33269 mediaId, 33270 mediaType, 33271 mediaUrl, 33272 style: style2, 33273 textColor, 33274 useFeaturedImage 33275 }, innerBlocks) => { 33276 const additionalAttributes = {}; 33277 if (style2?.color?.gradient) { 33278 additionalAttributes.customGradient = style2.color.gradient; 33279 } else if (style2?.color?.background) { 33280 additionalAttributes.customOverlayColor = style2.color.background; 33281 } 33282 if (style2?.color?.text) { 33283 additionalAttributes.style = { 33284 color: { text: style2.color.text } 33285 }; 33286 } 33287 const coverAttributes = { 33288 align, 33289 alt: mediaAlt, 33290 anchor, 33291 backgroundType: mediaType, 33292 dimRatio: !!mediaUrl || useFeaturedImage ? 50 : 100, 33293 focalPoint, 33294 gradient, 33295 id: mediaId, 33296 overlayColor: backgroundColor, 33297 textColor, 33298 url: mediaUrl, 33299 useFeaturedImage, 33300 ...additionalAttributes 33301 }; 33302 return (0, import_blocks50.createBlock)( 33303 "core/cover", 33304 coverAttributes, 33305 innerBlocks 33306 ); 33307 } 33308 } 33309 ] 33310 }; 33311 var transforms_default17 = transforms16; 33312 33313 // packages/block-library/build-module/media-text/index.js 33314 var { fieldsKey: fieldsKey10, formKey: formKey10 } = unlock(import_blocks51.privateApis); 33315 var { name: name50 } = block_default50; 33316 var settings50 = { 33317 icon: media_and_text_default, 33318 example: { 33319 viewportWidth: 601, 33320 // Columns collapse "@media (max-width: 600px)". 33321 attributes: { 33322 mediaType: "image", 33323 mediaUrl: "https://s.w.org/images/core/5.3/Biologia_Centrali-Americana_-_Cantorchilus_semibadius_1902.jpg" 33324 }, 33325 innerBlocks: [ 33326 { 33327 name: "core/paragraph", 33328 attributes: { 33329 content: (0, import_i18n104.__)( 33330 "The wren<br>Earns his living<br>Noiselessly." 33331 ) 33332 } 33333 }, 33334 { 33335 name: "core/paragraph", 33336 attributes: { 33337 content: (0, import_i18n104.__)("\u2014 Kobayashi Issa (\u4E00\u8336)") 33338 } 33339 } 33340 ] 33341 }, 33342 transforms: transforms_default17, 33343 edit: edit_default18, 33344 save: save30, 33345 deprecated: deprecated_default24 33346 }; 33347 if (window.__experimentalContentOnlyInspectorFields) { 33348 settings50[fieldsKey10] = [ 33349 { 33350 id: "media", 33351 label: (0, import_i18n104.__)("Media"), 33352 type: "media", 33353 mapping: { 33354 id: "mediaId", 33355 type: "mediaType", 33356 url: "mediaUrl", 33357 link: "mediaLink" 33358 }, 33359 args: { 33360 allowedTypes: ["image", "video"], 33361 multiple: false 33362 } 33363 }, 33364 { 33365 id: "link", 33366 label: (0, import_i18n104.__)("Link"), 33367 type: "link", 33368 mapping: { 33369 url: "href", 33370 rel: "rel", 33371 linkTarget: "linkTarget" 33372 } 33373 } 33374 ]; 33375 settings50[formKey10] = { 33376 fields: ["media"] 33377 }; 33378 } 33379 var init50 = () => initBlock({ name: name50, metadata: block_default50, settings: settings50 }); 33380 33381 // packages/block-library/build-module/missing/index.js 33382 var missing_exports = {}; 33383 __export(missing_exports, { 33384 init: () => init51, 33385 metadata: () => block_default51, 33386 name: () => name51, 33387 settings: () => settings51 33388 }); 33389 var import_blocks53 = __toESM(require_blocks()); 33390 33391 // packages/block-library/build-module/missing/edit.js 33392 var import_i18n105 = __toESM(require_i18n()); 33393 var import_element55 = __toESM(require_element()); 33394 var import_components61 = __toESM(require_components()); 33395 var import_blocks52 = __toESM(require_blocks()); 33396 var import_data56 = __toESM(require_data()); 33397 var import_block_editor135 = __toESM(require_block_editor()); 33398 var import_dom3 = __toESM(require_dom()); 33399 var import_jsx_runtime283 = __toESM(require_jsx_runtime()); 33400 function MissingEdit({ attributes: attributes3, clientId }) { 33401 const { originalName, originalUndelimitedContent } = attributes3; 33402 const hasContent = !!originalUndelimitedContent; 33403 const { hasFreeformBlock, hasHTMLBlock } = (0, import_data56.useSelect)( 33404 (select9) => { 33405 const { canInsertBlockType, getBlockRootClientId } = select9(import_block_editor135.store); 33406 return { 33407 hasFreeformBlock: canInsertBlockType( 33408 "core/freeform", 33409 getBlockRootClientId(clientId) 33410 ), 33411 hasHTMLBlock: canInsertBlockType( 33412 "core/html", 33413 getBlockRootClientId(clientId) 33414 ) 33415 }; 33416 }, 33417 [clientId] 33418 ); 33419 const { replaceBlock } = (0, import_data56.useDispatch)(import_block_editor135.store); 33420 function convertToHTML() { 33421 replaceBlock( 33422 clientId, 33423 (0, import_blocks52.createBlock)("core/html", { 33424 content: originalUndelimitedContent 33425 }) 33426 ); 33427 } 33428 const actions = []; 33429 let messageHTML; 33430 const convertToHtmlButton = /* @__PURE__ */ (0, import_jsx_runtime283.jsx)( 33431 import_components61.Button, 33432 { 33433 __next40pxDefaultSize: true, 33434 onClick: convertToHTML, 33435 variant: "primary", 33436 children: (0, import_i18n105.__)("Keep as HTML") 33437 }, 33438 "convert" 33439 ); 33440 if (hasContent && !hasFreeformBlock && (!originalName || originalName === "core/freeform")) { 33441 if (hasHTMLBlock) { 33442 messageHTML = (0, import_i18n105.__)( 33443 "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, if you have unsaved changes, you can save them and refresh to use the Classic block." 33444 ); 33445 actions.push(convertToHtmlButton); 33446 } else { 33447 messageHTML = (0, import_i18n105.__)( 33448 "It appears you are trying to use the deprecated Classic block. You can leave this block intact, or remove it entirely. Alternatively, if you have unsaved changes, you can save them and refresh to use the Classic block." 33449 ); 33450 } 33451 } else if (hasContent && hasHTMLBlock) { 33452 messageHTML = (0, import_i18n105.sprintf)( 33453 /* translators: %s: block name */ 33454 (0, import_i18n105.__)( 33455 'Your site doesn\u2019t include support for the "%s" block. You can leave it as-is, convert it to custom HTML, or remove it.' 33456 ), 33457 originalName 33458 ); 33459 actions.push(convertToHtmlButton); 33460 } else { 33461 messageHTML = (0, import_i18n105.sprintf)( 33462 /* translators: %s: block name */ 33463 (0, import_i18n105.__)( 33464 'Your site doesn\u2019t include support for the "%s" block. You can leave it as-is or remove it.' 33465 ), 33466 originalName 33467 ); 33468 } 33469 return /* @__PURE__ */ (0, import_jsx_runtime283.jsxs)("div", { ...(0, import_block_editor135.useBlockProps)({ className: "has-warning" }), children: [ 33470 /* @__PURE__ */ (0, import_jsx_runtime283.jsx)(import_block_editor135.Warning, { actions, children: messageHTML }), 33471 /* @__PURE__ */ (0, import_jsx_runtime283.jsx)(import_element55.RawHTML, { children: (0, import_dom3.safeHTML)(originalUndelimitedContent) }) 33472 ] }); 33473 } 33474 33475 // packages/block-library/build-module/missing/block.json 33476 var block_default51 = { 33477 $schema: "https://schemas.wp.org/trunk/block.json", 33478 apiVersion: 3, 33479 name: "core/missing", 33480 title: "Unsupported", 33481 category: "text", 33482 description: "Your site doesn\u2019t include support for this block.", 33483 textdomain: "default", 33484 attributes: { 33485 originalName: { 33486 type: "string" 33487 }, 33488 originalUndelimitedContent: { 33489 type: "string" 33490 }, 33491 originalContent: { 33492 type: "string", 33493 source: "raw" 33494 } 33495 }, 33496 supports: { 33497 className: false, 33498 customClassName: false, 33499 inserter: false, 33500 html: false, 33501 lock: false, 33502 reusable: false, 33503 renaming: false, 33504 visibility: false, 33505 interactivity: { 33506 clientNavigation: true 33507 } 33508 } 33509 }; 33510 33511 // packages/block-library/build-module/missing/save.js 33512 var import_element56 = __toESM(require_element()); 33513 var import_jsx_runtime284 = __toESM(require_jsx_runtime()); 33514 function save31({ attributes: attributes3 }) { 33515 return /* @__PURE__ */ (0, import_jsx_runtime284.jsx)(import_element56.RawHTML, { children: attributes3.originalContent }); 33516 } 33517 33518 // packages/block-library/build-module/missing/index.js 33519 var { name: name51 } = block_default51; 33520 var settings51 = { 33521 name: name51, 33522 __experimentalLabel(attributes3, { context }) { 33523 if (context === "accessibility") { 33524 const { originalName } = attributes3; 33525 const originalBlockType = originalName ? (0, import_blocks53.getBlockType)(originalName) : void 0; 33526 if (originalBlockType) { 33527 return originalBlockType.settings.title || originalName; 33528 } 33529 return ""; 33530 } 33531 }, 33532 edit: MissingEdit, 33533 save: save31 33534 }; 33535 var init51 = () => initBlock({ name: name51, metadata: block_default51, settings: settings51 }); 33536 33537 // packages/block-library/build-module/more/index.js 33538 var more_exports = {}; 33539 __export(more_exports, { 33540 init: () => init52, 33541 metadata: () => block_default52, 33542 name: () => name52, 33543 settings: () => settings52 33544 }); 33545 var import_i18n107 = __toESM(require_i18n()); 33546 var import_blocks56 = __toESM(require_blocks()); 33547 33548 // packages/block-library/build-module/more/edit.js 33549 var import_i18n106 = __toESM(require_i18n()); 33550 var import_components62 = __toESM(require_components()); 33551 var import_block_editor136 = __toESM(require_block_editor()); 33552 var import_blocks54 = __toESM(require_blocks()); 33553 var import_jsx_runtime285 = __toESM(require_jsx_runtime()); 33554 var DEFAULT_TEXT = (0, import_i18n106.__)("Read more"); 33555 function MoreEdit({ 33556 attributes: { customText, noTeaser }, 33557 insertBlocksAfter, 33558 setAttributes 33559 }) { 33560 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 33561 return /* @__PURE__ */ (0, import_jsx_runtime285.jsxs)(import_jsx_runtime285.Fragment, { children: [ 33562 /* @__PURE__ */ (0, import_jsx_runtime285.jsx)(import_block_editor136.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime285.jsx)( 33563 import_components62.__experimentalToolsPanel, 33564 { 33565 label: (0, import_i18n106.__)("Settings"), 33566 resetAll: () => { 33567 setAttributes({ 33568 noTeaser: false 33569 }); 33570 }, 33571 dropdownMenuProps, 33572 children: /* @__PURE__ */ (0, import_jsx_runtime285.jsx)( 33573 import_components62.__experimentalToolsPanelItem, 33574 { 33575 label: (0, import_i18n106.__)("Hide excerpt"), 33576 isShownByDefault: true, 33577 hasValue: () => noTeaser, 33578 onDeselect: () => setAttributes({ noTeaser: false }), 33579 children: /* @__PURE__ */ (0, import_jsx_runtime285.jsx)( 33580 import_components62.ToggleControl, 33581 { 33582 label: (0, import_i18n106.__)( 33583 "Hide the excerpt on the full content page" 33584 ), 33585 checked: !!noTeaser, 33586 onChange: () => setAttributes({ noTeaser: !noTeaser }), 33587 help: (checked) => checked ? (0, import_i18n106.__)("The excerpt is hidden.") : (0, import_i18n106.__)("The excerpt is visible.") 33588 } 33589 ) 33590 } 33591 ) 33592 } 33593 ) }), 33594 /* @__PURE__ */ (0, import_jsx_runtime285.jsx)("div", { ...(0, import_block_editor136.useBlockProps)(), children: /* @__PURE__ */ (0, import_jsx_runtime285.jsx)( 33595 import_block_editor136.PlainText, 33596 { 33597 __experimentalVersion: 2, 33598 tagName: "span", 33599 "aria-label": (0, import_i18n106.__)('"Read more" text'), 33600 value: customText, 33601 placeholder: DEFAULT_TEXT, 33602 onChange: (value) => setAttributes({ customText: value }), 33603 disableLineBreaks: true, 33604 __unstableOnSplitAtEnd: () => insertBlocksAfter( 33605 (0, import_blocks54.createBlock)((0, import_blocks54.getDefaultBlockName)()) 33606 ) 33607 } 33608 ) }) 33609 ] }); 33610 } 33611 33612 // packages/block-library/build-module/more/block.json 33613 var block_default52 = { 33614 $schema: "https://schemas.wp.org/trunk/block.json", 33615 apiVersion: 3, 33616 name: "core/more", 33617 title: "More", 33618 category: "design", 33619 description: "Content before this block will be shown in the excerpt on your archives page.", 33620 keywords: ["read more"], 33621 textdomain: "default", 33622 attributes: { 33623 customText: { 33624 type: "string", 33625 default: "", 33626 role: "content" 33627 }, 33628 noTeaser: { 33629 type: "boolean", 33630 default: false 33631 } 33632 }, 33633 supports: { 33634 customClassName: false, 33635 className: false, 33636 html: false, 33637 multiple: false, 33638 interactivity: { 33639 clientNavigation: true 33640 } 33641 }, 33642 editorStyle: "wp-block-more-editor" 33643 }; 33644 33645 // packages/block-library/build-module/more/save.js 33646 var import_element57 = __toESM(require_element()); 33647 var import_jsx_runtime286 = __toESM(require_jsx_runtime()); 33648 function save32({ attributes: { customText, noTeaser } }) { 33649 const moreTag = customText ? `<!--more $customText}-->` : "<!--more-->"; 33650 const noTeaserTag = noTeaser ? "<!--noteaser-->" : ""; 33651 return /* @__PURE__ */ (0, import_jsx_runtime286.jsx)(import_element57.RawHTML, { children: [moreTag, noTeaserTag].filter(Boolean).join("\n") }); 33652 } 33653 33654 // packages/block-library/build-module/more/transforms.js 33655 var import_blocks55 = __toESM(require_blocks()); 33656 var transforms17 = { 33657 from: [ 33658 { 33659 type: "raw", 33660 schema: { 33661 "wp-block": { attributes: ["data-block"] } 33662 }, 33663 isMatch: (node) => node.dataset && node.dataset.block === "core/more", 33664 transform(node) { 33665 const { customText, noTeaser } = node.dataset; 33666 const attrs = {}; 33667 if (customText) { 33668 attrs.customText = customText; 33669 } 33670 if (noTeaser === "") { 33671 attrs.noTeaser = true; 33672 } 33673 return (0, import_blocks55.createBlock)("core/more", attrs); 33674 } 33675 } 33676 ] 33677 }; 33678 var transforms_default18 = transforms17; 33679 33680 // packages/block-library/build-module/more/index.js 33681 var { fieldsKey: fieldsKey11, formKey: formKey11 } = unlock(import_blocks56.privateApis); 33682 var { name: name52 } = block_default52; 33683 var settings52 = { 33684 icon: more_default, 33685 example: {}, 33686 __experimentalLabel(attributes3, { context }) { 33687 const customName = attributes3?.metadata?.name; 33688 if (context === "list-view" && customName) { 33689 return customName; 33690 } 33691 if (context === "accessibility") { 33692 return attributes3.customText; 33693 } 33694 }, 33695 transforms: transforms_default18, 33696 edit: MoreEdit, 33697 save: save32 33698 }; 33699 if (window.__experimentalContentOnlyInspectorFields) { 33700 settings52[fieldsKey11] = [ 33701 { 33702 id: "customText", 33703 label: (0, import_i18n107.__)("Content"), 33704 type: "richtext" 33705 } 33706 ]; 33707 settings52[formKey11] = { 33708 fields: ["customText"] 33709 }; 33710 } 33711 var init52 = () => initBlock({ name: name52, metadata: block_default52, settings: settings52 }); 33712 33713 // packages/block-library/build-module/navigation/index.js 33714 var navigation_exports = {}; 33715 __export(navigation_exports, { 33716 init: () => init53, 33717 metadata: () => block_default53, 33718 name: () => name53, 33719 settings: () => settings53 33720 }); 33721 var import_i18n135 = __toESM(require_i18n()); 33722 var import_data77 = __toESM(require_data()); 33723 var import_core_data44 = __toESM(require_core_data()); 33724 var import_html_entities6 = __toESM(require_html_entities()); 33725 33726 // packages/block-library/build-module/navigation/block.json 33727 var block_default53 = { 33728 $schema: "https://schemas.wp.org/trunk/block.json", 33729 apiVersion: 3, 33730 name: "core/navigation", 33731 title: "Navigation", 33732 category: "theme", 33733 allowedBlocks: [ 33734 "core/navigation-link", 33735 "core/search", 33736 "core/social-links", 33737 "core/page-list", 33738 "core/spacer", 33739 "core/home-link", 33740 "core/site-title", 33741 "core/site-logo", 33742 "core/navigation-submenu", 33743 "core/loginout", 33744 "core/buttons" 33745 ], 33746 description: "A collection of blocks that allow visitors to get around your site.", 33747 keywords: ["menu", "navigation", "links"], 33748 textdomain: "default", 33749 attributes: { 33750 ref: { 33751 type: "number" 33752 }, 33753 textColor: { 33754 type: "string" 33755 }, 33756 customTextColor: { 33757 type: "string" 33758 }, 33759 rgbTextColor: { 33760 type: "string" 33761 }, 33762 backgroundColor: { 33763 type: "string" 33764 }, 33765 customBackgroundColor: { 33766 type: "string" 33767 }, 33768 rgbBackgroundColor: { 33769 type: "string" 33770 }, 33771 showSubmenuIcon: { 33772 type: "boolean", 33773 default: true 33774 }, 33775 openSubmenusOnClick: { 33776 type: "boolean", 33777 default: false 33778 }, 33779 overlayMenu: { 33780 type: "string", 33781 default: "mobile" 33782 }, 33783 overlay: { 33784 type: "string" 33785 }, 33786 icon: { 33787 type: "string", 33788 default: "handle" 33789 }, 33790 hasIcon: { 33791 type: "boolean", 33792 default: true 33793 }, 33794 __unstableLocation: { 33795 type: "string" 33796 }, 33797 overlayBackgroundColor: { 33798 type: "string" 33799 }, 33800 customOverlayBackgroundColor: { 33801 type: "string" 33802 }, 33803 overlayTextColor: { 33804 type: "string" 33805 }, 33806 customOverlayTextColor: { 33807 type: "string" 33808 }, 33809 maxNestingLevel: { 33810 type: "number", 33811 default: 5 33812 }, 33813 templateLock: { 33814 type: ["string", "boolean"], 33815 enum: ["all", "insert", "contentOnly", false] 33816 } 33817 }, 33818 providesContext: { 33819 textColor: "textColor", 33820 customTextColor: "customTextColor", 33821 backgroundColor: "backgroundColor", 33822 customBackgroundColor: "customBackgroundColor", 33823 overlayTextColor: "overlayTextColor", 33824 customOverlayTextColor: "customOverlayTextColor", 33825 overlayBackgroundColor: "overlayBackgroundColor", 33826 customOverlayBackgroundColor: "customOverlayBackgroundColor", 33827 fontSize: "fontSize", 33828 customFontSize: "customFontSize", 33829 showSubmenuIcon: "showSubmenuIcon", 33830 openSubmenusOnClick: "openSubmenusOnClick", 33831 style: "style", 33832 maxNestingLevel: "maxNestingLevel" 33833 }, 33834 supports: { 33835 align: ["wide", "full"], 33836 ariaLabel: true, 33837 contentRole: true, 33838 html: false, 33839 inserter: true, 33840 typography: { 33841 fontSize: true, 33842 lineHeight: true, 33843 __experimentalFontStyle: true, 33844 __experimentalFontWeight: true, 33845 __experimentalTextTransform: true, 33846 __experimentalFontFamily: true, 33847 __experimentalLetterSpacing: true, 33848 __experimentalTextDecoration: true, 33849 __experimentalSkipSerialization: ["textDecoration"], 33850 __experimentalDefaultControls: { 33851 fontSize: true 33852 } 33853 }, 33854 spacing: { 33855 blockGap: true, 33856 units: ["px", "em", "rem", "vh", "vw"], 33857 __experimentalDefaultControls: { 33858 blockGap: true 33859 } 33860 }, 33861 layout: { 33862 allowSwitching: false, 33863 allowInheriting: false, 33864 allowVerticalAlignment: false, 33865 allowSizingOnChildren: true, 33866 default: { 33867 type: "flex" 33868 } 33869 }, 33870 interactivity: true, 33871 renaming: false 33872 }, 33873 editorStyle: "wp-block-navigation-editor", 33874 style: "wp-block-navigation" 33875 }; 33876 33877 // packages/block-library/build-module/navigation/edit/index.js 33878 var import_element74 = __toESM(require_element()); 33879 var import_block_editor151 = __toESM(require_block_editor()); 33880 var import_core_data43 = __toESM(require_core_data()); 33881 var import_data76 = __toESM(require_data()); 33882 var import_components85 = __toESM(require_components()); 33883 var import_i18n134 = __toESM(require_i18n()); 33884 var import_a11y3 = __toESM(require_a11y()); 33885 var import_blocks60 = __toESM(require_blocks()); 33886 var import_compose29 = __toESM(require_compose()); 33887 33888 // packages/block-library/build-module/navigation/use-navigation-menu.js 33889 var import_core_data25 = __toESM(require_core_data()); 33890 var import_data57 = __toESM(require_data()); 33891 33892 // packages/block-library/build-module/navigation/constants.js 33893 var DEFAULT_BLOCK5 = { 33894 name: "core/navigation-link", 33895 attributes: { 33896 kind: "post-type", 33897 type: "page" 33898 } 33899 }; 33900 var PRIORITIZED_INSERTER_BLOCKS = [ 33901 "core/navigation-link/page", 33902 "core/navigation-link" 33903 ]; 33904 var PRELOADED_NAVIGATION_MENUS_QUERY = { 33905 per_page: 100, 33906 status: ["publish", "draft"], 33907 order: "desc", 33908 orderby: "date" 33909 }; 33910 var SELECT_NAVIGATION_MENUS_ARGS = [ 33911 "postType", 33912 "wp_navigation", 33913 PRELOADED_NAVIGATION_MENUS_QUERY 33914 ]; 33915 33916 // packages/block-library/build-module/navigation/use-navigation-menu.js 33917 function useNavigationMenu(ref) { 33918 const permissions = (0, import_core_data25.useResourcePermissions)({ 33919 kind: "postType", 33920 name: "wp_navigation", 33921 id: ref 33922 }); 33923 const { 33924 navigationMenu, 33925 isNavigationMenuResolved, 33926 isNavigationMenuMissing 33927 } = (0, import_data57.useSelect)( 33928 (select9) => { 33929 return selectExistingMenu(select9, ref); 33930 }, 33931 [ref] 33932 ); 33933 const { 33934 // Can the user create navigation menus? 33935 canCreate: canCreateNavigationMenus, 33936 // Can the user update the specific navigation menu with the given post ID? 33937 canUpdate: canUpdateNavigationMenu, 33938 // Can the user delete the specific navigation menu with the given post ID? 33939 canDelete: canDeleteNavigationMenu, 33940 isResolving: isResolvingPermissions, 33941 hasResolved: hasResolvedPermissions 33942 } = permissions; 33943 const { 33944 records: navigationMenus, 33945 isResolving: isResolvingNavigationMenus, 33946 hasResolved: hasResolvedNavigationMenus 33947 } = (0, import_core_data25.useEntityRecords)( 33948 "postType", 33949 `wp_navigation`, 33950 PRELOADED_NAVIGATION_MENUS_QUERY 33951 ); 33952 const canSwitchNavigationMenu = ref ? navigationMenus?.length > 1 : navigationMenus?.length > 0; 33953 return { 33954 navigationMenu, 33955 isNavigationMenuResolved, 33956 isNavigationMenuMissing, 33957 navigationMenus, 33958 isResolvingNavigationMenus, 33959 hasResolvedNavigationMenus, 33960 canSwitchNavigationMenu, 33961 canUserCreateNavigationMenus: canCreateNavigationMenus, 33962 isResolvingCanUserCreateNavigationMenus: isResolvingPermissions, 33963 hasResolvedCanUserCreateNavigationMenus: hasResolvedPermissions, 33964 canUserUpdateNavigationMenu: canUpdateNavigationMenu, 33965 hasResolvedCanUserUpdateNavigationMenu: ref ? hasResolvedPermissions : void 0, 33966 canUserDeleteNavigationMenu: canDeleteNavigationMenu, 33967 hasResolvedCanUserDeleteNavigationMenu: ref ? hasResolvedPermissions : void 0 33968 }; 33969 } 33970 function selectExistingMenu(select9, ref) { 33971 if (!ref) { 33972 return { 33973 isNavigationMenuResolved: false, 33974 isNavigationMenuMissing: true 33975 }; 33976 } 33977 const { getEntityRecord, getEditedEntityRecord, hasFinishedResolution } = select9(import_core_data25.store); 33978 const args = ["postType", "wp_navigation", ref]; 33979 const navigationMenu = getEntityRecord(...args); 33980 const editedNavigationMenu = getEditedEntityRecord(...args); 33981 const hasResolvedNavigationMenu = hasFinishedResolution( 33982 "getEditedEntityRecord", 33983 args 33984 ); 33985 const isNavigationMenuPublishedOrDraft = editedNavigationMenu.status === "publish" || editedNavigationMenu.status === "draft"; 33986 return { 33987 isNavigationMenuResolved: hasResolvedNavigationMenu, 33988 isNavigationMenuMissing: hasResolvedNavigationMenu && (!navigationMenu || !isNavigationMenuPublishedOrDraft), 33989 // getEditedEntityRecord will return the post regardless of status. 33990 // Therefore if the found post is not published then we should ignore it. 33991 navigationMenu: isNavigationMenuPublishedOrDraft ? editedNavigationMenu : null 33992 }; 33993 } 33994 33995 // packages/block-library/build-module/navigation/use-navigation-entities.js 33996 var import_core_data26 = __toESM(require_core_data()); 33997 function useNavigationEntities(menuId) { 33998 const { 33999 records: menus, 34000 isResolving: isResolvingMenus, 34001 hasResolved: hasResolvedMenus 34002 } = (0, import_core_data26.useEntityRecords)("root", "menu", { per_page: -1, context: "view" }); 34003 const { 34004 records: pages, 34005 isResolving: isResolvingPages, 34006 hasResolved: hasResolvedPages 34007 } = (0, import_core_data26.useEntityRecords)("postType", "page", { 34008 parent: 0, 34009 order: "asc", 34010 orderby: "id", 34011 per_page: -1, 34012 context: "view" 34013 }); 34014 const { records: menuItems, hasResolved: hasResolvedMenuItems } = (0, import_core_data26.useEntityRecords)( 34015 "root", 34016 "menuItem", 34017 { 34018 menus: menuId, 34019 per_page: -1, 34020 context: "view" 34021 }, 34022 { enabled: !!menuId } 34023 ); 34024 return { 34025 pages, 34026 isResolvingPages, 34027 hasResolvedPages, 34028 hasPages: !!(hasResolvedPages && pages?.length), 34029 menus, 34030 isResolvingMenus, 34031 hasResolvedMenus, 34032 hasMenus: !!(hasResolvedMenus && menus?.length), 34033 menuItems, 34034 hasResolvedMenuItems 34035 }; 34036 } 34037 34038 // packages/block-library/build-module/navigation/edit/placeholder/index.js 34039 var import_components64 = __toESM(require_components()); 34040 var import_i18n110 = __toESM(require_i18n()); 34041 var import_a11y2 = __toESM(require_a11y()); 34042 var import_element59 = __toESM(require_element()); 34043 34044 // packages/block-library/build-module/navigation/edit/placeholder/placeholder-preview.js 34045 var import_i18n108 = __toESM(require_i18n()); 34046 var import_jsx_runtime287 = __toESM(require_jsx_runtime()); 34047 var PlaceholderPreview = ({ isVisible = true }) => { 34048 return /* @__PURE__ */ (0, import_jsx_runtime287.jsx)( 34049 "div", 34050 { 34051 "aria-hidden": !isVisible ? true : void 0, 34052 className: "wp-block-navigation-placeholder__preview", 34053 children: /* @__PURE__ */ (0, import_jsx_runtime287.jsxs)("div", { className: "wp-block-navigation-placeholder__actions__indicator", children: [ 34054 /* @__PURE__ */ (0, import_jsx_runtime287.jsx)(icon_default5, { icon: navigation_default }), 34055 (0, import_i18n108.__)("Navigation") 34056 ] }) 34057 } 34058 ); 34059 }; 34060 var placeholder_preview_default = PlaceholderPreview; 34061 34062 // packages/block-library/build-module/navigation/edit/navigation-menu-selector.js 34063 var import_components63 = __toESM(require_components()); 34064 var import_i18n109 = __toESM(require_i18n()); 34065 var import_html_entities3 = __toESM(require_html_entities()); 34066 var import_element58 = __toESM(require_element()); 34067 var import_core_data27 = __toESM(require_core_data()); 34068 var import_jsx_runtime288 = __toESM(require_jsx_runtime()); 34069 function buildMenuLabel(title, id, status) { 34070 if (!title) { 34071 return (0, import_i18n109.sprintf)((0, import_i18n109.__)("(no title %s)"), id); 34072 } 34073 if (status === "publish") { 34074 return (0, import_html_entities3.decodeEntities)(title); 34075 } 34076 return (0, import_i18n109.sprintf)( 34077 // translators: 1: title of the menu. 2: status of the menu (draft, pending, etc.). 34078 (0, import_i18n109.__)("%1$s (%2$s)"), 34079 (0, import_html_entities3.decodeEntities)(title), 34080 status 34081 ); 34082 } 34083 function NavigationMenuSelector({ 34084 currentMenuId, 34085 onSelectNavigationMenu, 34086 onSelectClassicMenu, 34087 onCreateNew, 34088 actionLabel: actionLabel2, 34089 createNavigationMenuIsSuccess, 34090 createNavigationMenuIsError 34091 }) { 34092 const createActionLabel = (0, import_i18n109.__)("Create from '%s'"); 34093 const [isUpdatingMenuRef, setIsUpdatingMenuRef] = (0, import_element58.useState)(false); 34094 actionLabel2 = actionLabel2 || createActionLabel; 34095 const { menus: classicMenus } = useNavigationEntities(); 34096 const { 34097 navigationMenus, 34098 isResolvingNavigationMenus, 34099 hasResolvedNavigationMenus, 34100 canUserCreateNavigationMenus, 34101 canSwitchNavigationMenu, 34102 isNavigationMenuMissing 34103 } = useNavigationMenu(currentMenuId); 34104 const [currentTitle] = (0, import_core_data27.useEntityProp)( 34105 "postType", 34106 "wp_navigation", 34107 "title" 34108 ); 34109 const menuChoices = (0, import_element58.useMemo)(() => { 34110 return navigationMenus?.map(({ id, title, status }, index) => { 34111 const label = buildMenuLabel( 34112 title?.rendered, 34113 index + 1, 34114 status 34115 ); 34116 return { 34117 value: id, 34118 label, 34119 ariaLabel: (0, import_i18n109.sprintf)(actionLabel2, label), 34120 disabled: isUpdatingMenuRef || isResolvingNavigationMenus || !hasResolvedNavigationMenus 34121 }; 34122 }) || []; 34123 }, [ 34124 navigationMenus, 34125 actionLabel2, 34126 isResolvingNavigationMenus, 34127 hasResolvedNavigationMenus, 34128 isUpdatingMenuRef 34129 ]); 34130 const hasNavigationMenus = !!navigationMenus?.length; 34131 const hasClassicMenus = !!classicMenus?.length; 34132 const showNavigationMenus = !!canSwitchNavigationMenu; 34133 const showClassicMenus = !!canUserCreateNavigationMenus; 34134 const noMenuSelected = hasNavigationMenus && !currentMenuId; 34135 const noBlockMenus = !hasNavigationMenus && hasResolvedNavigationMenus; 34136 const menuUnavailable = hasResolvedNavigationMenus && currentMenuId === null; 34137 const navMenuHasBeenDeleted = currentMenuId && isNavigationMenuMissing; 34138 let selectorLabel = ""; 34139 if (isResolvingNavigationMenus) { 34140 selectorLabel = (0, import_i18n109.__)("Loading\u2026"); 34141 } else if (noMenuSelected || noBlockMenus || menuUnavailable || navMenuHasBeenDeleted) { 34142 selectorLabel = (0, import_i18n109.__)("Choose or create a Navigation Menu"); 34143 } else { 34144 selectorLabel = currentTitle; 34145 } 34146 (0, import_element58.useEffect)(() => { 34147 if (isUpdatingMenuRef && (createNavigationMenuIsSuccess || createNavigationMenuIsError)) { 34148 setIsUpdatingMenuRef(false); 34149 } 34150 }, [ 34151 hasResolvedNavigationMenus, 34152 createNavigationMenuIsSuccess, 34153 canUserCreateNavigationMenus, 34154 createNavigationMenuIsError, 34155 isUpdatingMenuRef, 34156 menuUnavailable, 34157 noBlockMenus, 34158 noMenuSelected 34159 ]); 34160 const NavigationMenuSelectorDropdown = /* @__PURE__ */ (0, import_jsx_runtime288.jsx)( 34161 import_components63.DropdownMenu, 34162 { 34163 label: selectorLabel, 34164 icon: more_vertical_default, 34165 toggleProps: { size: "small" }, 34166 children: ({ onClose }) => /* @__PURE__ */ (0, import_jsx_runtime288.jsxs)(import_jsx_runtime288.Fragment, { children: [ 34167 showNavigationMenus && hasNavigationMenus && /* @__PURE__ */ (0, import_jsx_runtime288.jsx)(import_components63.MenuGroup, { label: (0, import_i18n109.__)("Menus"), children: /* @__PURE__ */ (0, import_jsx_runtime288.jsx)( 34168 import_components63.MenuItemsChoice, 34169 { 34170 value: currentMenuId, 34171 onSelect: (menuId) => { 34172 onSelectNavigationMenu(menuId); 34173 onClose(); 34174 }, 34175 choices: menuChoices 34176 } 34177 ) }), 34178 showClassicMenus && hasClassicMenus && /* @__PURE__ */ (0, import_jsx_runtime288.jsx)(import_components63.MenuGroup, { label: (0, import_i18n109.__)("Import Classic Menus"), children: classicMenus?.map((menu) => { 34179 const label = (0, import_html_entities3.decodeEntities)(menu.name); 34180 return /* @__PURE__ */ (0, import_jsx_runtime288.jsx)( 34181 import_components63.MenuItem, 34182 { 34183 onClick: async () => { 34184 setIsUpdatingMenuRef(true); 34185 await onSelectClassicMenu(menu); 34186 setIsUpdatingMenuRef(false); 34187 onClose(); 34188 }, 34189 "aria-label": (0, import_i18n109.sprintf)( 34190 createActionLabel, 34191 label 34192 ), 34193 disabled: isUpdatingMenuRef || isResolvingNavigationMenus || !hasResolvedNavigationMenus, 34194 children: label 34195 }, 34196 menu.id 34197 ); 34198 }) }), 34199 canUserCreateNavigationMenus && /* @__PURE__ */ (0, import_jsx_runtime288.jsx)(import_components63.MenuGroup, { label: (0, import_i18n109.__)("Tools"), children: /* @__PURE__ */ (0, import_jsx_runtime288.jsx)( 34200 import_components63.MenuItem, 34201 { 34202 onClick: async () => { 34203 setIsUpdatingMenuRef(true); 34204 await onCreateNew(); 34205 setIsUpdatingMenuRef(false); 34206 onClose(); 34207 }, 34208 disabled: isUpdatingMenuRef || isResolvingNavigationMenus || !hasResolvedNavigationMenus, 34209 children: (0, import_i18n109.__)("Create new Menu") 34210 } 34211 ) }) 34212 ] }) 34213 } 34214 ); 34215 return NavigationMenuSelectorDropdown; 34216 } 34217 var navigation_menu_selector_default = NavigationMenuSelector; 34218 34219 // packages/block-library/build-module/navigation/edit/placeholder/index.js 34220 var import_jsx_runtime289 = __toESM(require_jsx_runtime()); 34221 function NavigationPlaceholder({ 34222 isSelected, 34223 currentMenuId, 34224 clientId, 34225 canUserCreateNavigationMenus = false, 34226 isResolvingCanUserCreateNavigationMenus, 34227 onSelectNavigationMenu, 34228 onSelectClassicMenu, 34229 onCreateEmpty 34230 }) { 34231 const { isResolvingMenus, hasResolvedMenus } = useNavigationEntities(); 34232 (0, import_element59.useEffect)(() => { 34233 if (!isSelected) { 34234 return; 34235 } 34236 if (isResolvingMenus) { 34237 (0, import_a11y2.speak)((0, import_i18n110.__)("Loading navigation block setup options\u2026")); 34238 } 34239 if (hasResolvedMenus) { 34240 (0, import_a11y2.speak)((0, import_i18n110.__)("Navigation block setup options ready.")); 34241 } 34242 }, [hasResolvedMenus, isResolvingMenus, isSelected]); 34243 const isResolvingActions = isResolvingMenus && isResolvingCanUserCreateNavigationMenus; 34244 return /* @__PURE__ */ (0, import_jsx_runtime289.jsx)(import_jsx_runtime289.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime289.jsxs)(import_components64.Placeholder, { className: "wp-block-navigation-placeholder", children: [ 34245 /* @__PURE__ */ (0, import_jsx_runtime289.jsx)(placeholder_preview_default, { isVisible: !isSelected }), 34246 /* @__PURE__ */ (0, import_jsx_runtime289.jsx)( 34247 "div", 34248 { 34249 "aria-hidden": !isSelected ? true : void 0, 34250 className: "wp-block-navigation-placeholder__controls", 34251 children: /* @__PURE__ */ (0, import_jsx_runtime289.jsxs)("div", { className: "wp-block-navigation-placeholder__actions", children: [ 34252 /* @__PURE__ */ (0, import_jsx_runtime289.jsxs)("div", { className: "wp-block-navigation-placeholder__actions__indicator", children: [ 34253 /* @__PURE__ */ (0, import_jsx_runtime289.jsx)(icon_default5, { icon: navigation_default }), 34254 " ", 34255 (0, import_i18n110.__)("Navigation") 34256 ] }), 34257 /* @__PURE__ */ (0, import_jsx_runtime289.jsx)("hr", {}), 34258 isResolvingActions && /* @__PURE__ */ (0, import_jsx_runtime289.jsx)(import_components64.Spinner, {}), 34259 /* @__PURE__ */ (0, import_jsx_runtime289.jsx)( 34260 navigation_menu_selector_default, 34261 { 34262 currentMenuId, 34263 clientId, 34264 onSelectNavigationMenu, 34265 onSelectClassicMenu 34266 } 34267 ), 34268 /* @__PURE__ */ (0, import_jsx_runtime289.jsx)("hr", {}), 34269 canUserCreateNavigationMenus && /* @__PURE__ */ (0, import_jsx_runtime289.jsx)( 34270 import_components64.Button, 34271 { 34272 __next40pxDefaultSize: true, 34273 variant: "tertiary", 34274 onClick: onCreateEmpty, 34275 children: (0, import_i18n110.__)("Start empty") 34276 } 34277 ) 34278 ] }) 34279 } 34280 ) 34281 ] }) }); 34282 } 34283 34284 // packages/block-library/build-module/navigation/edit/responsive-wrapper.js 34285 var import_components65 = __toESM(require_components()); 34286 var import_i18n111 = __toESM(require_i18n()); 34287 var import_block_editor137 = __toESM(require_block_editor()); 34288 34289 // packages/block-library/build-module/navigation/edit/overlay-menu-icon.js 34290 var import_primitives152 = __toESM(require_primitives()); 34291 var import_jsx_runtime290 = __toESM(require_jsx_runtime()); 34292 function OverlayMenuIcon({ icon }) { 34293 if (icon === "menu") { 34294 return /* @__PURE__ */ (0, import_jsx_runtime290.jsx)(icon_default5, { icon: menu_default }); 34295 } 34296 return /* @__PURE__ */ (0, import_jsx_runtime290.jsxs)( 34297 import_primitives152.SVG, 34298 { 34299 xmlns: "http://www.w3.org/2000/svg", 34300 viewBox: "0 0 24 24", 34301 width: "24", 34302 height: "24", 34303 "aria-hidden": "true", 34304 focusable: "false", 34305 children: [ 34306 /* @__PURE__ */ (0, import_jsx_runtime290.jsx)(import_primitives152.Rect, { x: "4", y: "7.5", width: "16", height: "1.5" }), 34307 /* @__PURE__ */ (0, import_jsx_runtime290.jsx)(import_primitives152.Rect, { x: "4", y: "15", width: "16", height: "1.5" }) 34308 ] 34309 } 34310 ); 34311 } 34312 34313 // packages/block-library/build-module/navigation/edit/responsive-wrapper.js 34314 var import_jsx_runtime291 = __toESM(require_jsx_runtime()); 34315 function ResponsiveWrapper({ 34316 children, 34317 id, 34318 isOpen, 34319 isResponsive, 34320 onToggle, 34321 isHiddenByDefault, 34322 overlayBackgroundColor, 34323 overlayTextColor, 34324 hasIcon, 34325 icon, 34326 overlay, 34327 onNavigateToEntityRecord 34328 }) { 34329 if (!isResponsive) { 34330 return children; 34331 } 34332 const responsiveContainerClasses = clsx_default( 34333 "wp-block-navigation__responsive-container", 34334 { 34335 "has-text-color": !!overlayTextColor.color || !!overlayTextColor?.class, 34336 [(0, import_block_editor137.getColorClassName)("color", overlayTextColor?.slug)]: !!overlayTextColor?.slug, 34337 "has-background": !!overlayBackgroundColor.color || overlayBackgroundColor?.class, 34338 [(0, import_block_editor137.getColorClassName)( 34339 "background-color", 34340 overlayBackgroundColor?.slug 34341 )]: !!overlayBackgroundColor?.slug, 34342 "is-menu-open": isOpen, 34343 "hidden-by-default": isHiddenByDefault 34344 } 34345 ); 34346 const styles = { 34347 color: !overlayTextColor?.slug && overlayTextColor?.color, 34348 backgroundColor: !overlayBackgroundColor?.slug && overlayBackgroundColor?.color && overlayBackgroundColor.color 34349 }; 34350 const openButtonClasses = clsx_default( 34351 "wp-block-navigation__responsive-container-open", 34352 { "always-shown": isHiddenByDefault } 34353 ); 34354 const modalId = `$id}-modal`; 34355 const dialogProps = { 34356 className: "wp-block-navigation__responsive-dialog", 34357 ...isOpen && { 34358 role: "dialog", 34359 "aria-modal": true, 34360 "aria-label": (0, import_i18n111.__)("Menu") 34361 } 34362 }; 34363 const handleToggleClick = () => { 34364 if (overlay && onNavigateToEntityRecord) { 34365 onNavigateToEntityRecord({ 34366 postId: overlay, 34367 postType: "wp_template_part" 34368 }); 34369 return; 34370 } 34371 onToggle(true); 34372 }; 34373 return /* @__PURE__ */ (0, import_jsx_runtime291.jsxs)(import_jsx_runtime291.Fragment, { children: [ 34374 !isOpen && /* @__PURE__ */ (0, import_jsx_runtime291.jsxs)( 34375 import_components65.Button, 34376 { 34377 __next40pxDefaultSize: true, 34378 "aria-haspopup": "true", 34379 "aria-label": hasIcon && (0, import_i18n111.__)("Open menu"), 34380 className: openButtonClasses, 34381 onClick: handleToggleClick, 34382 children: [ 34383 hasIcon && /* @__PURE__ */ (0, import_jsx_runtime291.jsx)(OverlayMenuIcon, { icon }), 34384 !hasIcon && (0, import_i18n111.__)("Menu") 34385 ] 34386 } 34387 ), 34388 /* @__PURE__ */ (0, import_jsx_runtime291.jsx)( 34389 "div", 34390 { 34391 className: responsiveContainerClasses, 34392 style: styles, 34393 id: modalId, 34394 children: /* @__PURE__ */ (0, import_jsx_runtime291.jsx)( 34395 "div", 34396 { 34397 className: "wp-block-navigation__responsive-close", 34398 tabIndex: "-1", 34399 children: /* @__PURE__ */ (0, import_jsx_runtime291.jsxs)("div", { ...dialogProps, children: [ 34400 /* @__PURE__ */ (0, import_jsx_runtime291.jsxs)( 34401 import_components65.Button, 34402 { 34403 __next40pxDefaultSize: true, 34404 className: "wp-block-navigation__responsive-container-close", 34405 "aria-label": hasIcon && (0, import_i18n111.__)("Close menu"), 34406 onClick: () => onToggle(false), 34407 children: [ 34408 hasIcon && /* @__PURE__ */ (0, import_jsx_runtime291.jsx)(icon_default5, { icon: close_default }), 34409 !hasIcon && (0, import_i18n111.__)("Close") 34410 ] 34411 } 34412 ), 34413 /* @__PURE__ */ (0, import_jsx_runtime291.jsx)( 34414 "div", 34415 { 34416 className: "wp-block-navigation__responsive-container-content", 34417 id: `$modalId}-content`, 34418 children 34419 } 34420 ) 34421 ] }) 34422 } 34423 ) 34424 } 34425 ) 34426 ] }); 34427 } 34428 34429 // packages/block-library/build-module/navigation/edit/inner-blocks.js 34430 var import_core_data28 = __toESM(require_core_data()); 34431 var import_block_editor138 = __toESM(require_block_editor()); 34432 var import_data58 = __toESM(require_data()); 34433 var import_element60 = __toESM(require_element()); 34434 var import_jsx_runtime292 = __toESM(require_jsx_runtime()); 34435 function NavigationInnerBlocks({ 34436 clientId, 34437 hasCustomPlaceholder, 34438 orientation, 34439 templateLock 34440 }) { 34441 const { 34442 isImmediateParentOfSelectedBlock, 34443 selectedBlockHasChildren, 34444 isSelected, 34445 hasSelectedDescendant 34446 } = (0, import_data58.useSelect)( 34447 (select9) => { 34448 const { 34449 getBlockCount, 34450 hasSelectedInnerBlock, 34451 getSelectedBlockClientId 34452 } = select9(import_block_editor138.store); 34453 const selectedBlockId = getSelectedBlockClientId(); 34454 return { 34455 isImmediateParentOfSelectedBlock: hasSelectedInnerBlock( 34456 clientId, 34457 false 34458 ), 34459 selectedBlockHasChildren: !!getBlockCount(selectedBlockId), 34460 hasSelectedDescendant: hasSelectedInnerBlock(clientId, true), 34461 // This prop is already available but computing it here ensures it's 34462 // fresh compared to isImmediateParentOfSelectedBlock. 34463 isSelected: selectedBlockId === clientId 34464 }; 34465 }, 34466 [clientId] 34467 ); 34468 const [blocks, onInput, onChange] = (0, import_core_data28.useEntityBlockEditor)( 34469 "postType", 34470 "wp_navigation" 34471 ); 34472 const parentOrChildHasSelection = isSelected || isImmediateParentOfSelectedBlock && !selectedBlockHasChildren; 34473 const placeholder2 = (0, import_element60.useMemo)(() => /* @__PURE__ */ (0, import_jsx_runtime292.jsx)(placeholder_preview_default, {}), []); 34474 const hasMenuItems = !!blocks?.length; 34475 const showPlaceholder = !hasCustomPlaceholder && !hasMenuItems && !isSelected; 34476 const innerBlocksProps = (0, import_block_editor138.useInnerBlocksProps)( 34477 { 34478 className: "wp-block-navigation__container" 34479 }, 34480 { 34481 value: blocks, 34482 onInput, 34483 onChange, 34484 prioritizedInserterBlocks: PRIORITIZED_INSERTER_BLOCKS, 34485 defaultBlock: DEFAULT_BLOCK5, 34486 directInsert: true, 34487 orientation, 34488 templateLock, 34489 // As an exception to other blocks which feature nesting, show 34490 // the block appender even when a child block is selected. 34491 // This should be a temporary fix, to be replaced by improvements to 34492 // the sibling inserter. 34493 // See https://github.com/WordPress/gutenberg/issues/37572. 34494 renderAppender: isSelected || isImmediateParentOfSelectedBlock && !selectedBlockHasChildren || hasSelectedDescendant || // Show the appender while dragging to allow inserting element between item and the appender. 34495 parentOrChildHasSelection ? import_block_editor138.InnerBlocks.ButtonBlockAppender : false, 34496 placeholder: showPlaceholder ? placeholder2 : void 0, 34497 __experimentalCaptureToolbars: true, 34498 __unstableDisableLayoutClassNames: true 34499 } 34500 ); 34501 return /* @__PURE__ */ (0, import_jsx_runtime292.jsx)("div", { ...innerBlocksProps }); 34502 } 34503 34504 // packages/block-library/build-module/navigation/edit/navigation-menu-name-control.js 34505 var import_components66 = __toESM(require_components()); 34506 var import_core_data29 = __toESM(require_core_data()); 34507 var import_i18n112 = __toESM(require_i18n()); 34508 var import_jsx_runtime293 = __toESM(require_jsx_runtime()); 34509 function NavigationMenuNameControl() { 34510 const [title, updateTitle] = (0, import_core_data29.useEntityProp)( 34511 "postType", 34512 "wp_navigation", 34513 "title" 34514 ); 34515 return /* @__PURE__ */ (0, import_jsx_runtime293.jsx)( 34516 import_components66.TextControl, 34517 { 34518 __next40pxDefaultSize: true, 34519 label: (0, import_i18n112.__)("Menu name"), 34520 value: title, 34521 onChange: updateTitle 34522 } 34523 ); 34524 } 34525 34526 // packages/block-library/build-module/navigation/edit/unsaved-inner-blocks.js 34527 var import_block_editor139 = __toESM(require_block_editor()); 34528 var import_components67 = __toESM(require_components()); 34529 var import_core_data30 = __toESM(require_core_data()); 34530 var import_data59 = __toESM(require_data()); 34531 var import_element61 = __toESM(require_element()); 34532 34533 // packages/block-library/build-module/navigation/edit/are-blocks-dirty.js 34534 function areBlocksDirty(originalBlocks, blocks) { 34535 return !isDeepEqual(originalBlocks, blocks, (prop, x2) => { 34536 if (x2?.name === "core/page-list" && prop === "innerBlocks") { 34537 return true; 34538 } 34539 }); 34540 } 34541 var isDeepEqual = (x2, y2, shouldSkip) => { 34542 if (x2 === y2) { 34543 return true; 34544 } else if (typeof x2 === "object" && x2 !== null && x2 !== void 0 && typeof y2 === "object" && y2 !== null && y2 !== void 0) { 34545 if (Object.keys(x2).length !== Object.keys(y2).length) { 34546 return false; 34547 } 34548 for (const prop in x2) { 34549 if (y2.hasOwnProperty(prop)) { 34550 if (shouldSkip && shouldSkip(prop, x2)) { 34551 return true; 34552 } 34553 if (!isDeepEqual(x2[prop], y2[prop], shouldSkip)) { 34554 return false; 34555 } 34556 } else { 34557 return false; 34558 } 34559 } 34560 return true; 34561 } 34562 return false; 34563 }; 34564 34565 // packages/block-library/build-module/navigation/edit/unsaved-inner-blocks.js 34566 var import_jsx_runtime294 = __toESM(require_jsx_runtime()); 34567 var EMPTY_OBJECT = {}; 34568 function UnsavedInnerBlocks({ 34569 blocks, 34570 createNavigationMenu, 34571 hasSelection 34572 }) { 34573 const originalBlocksRef = (0, import_element61.useRef)(); 34574 (0, import_element61.useEffect)(() => { 34575 if (!originalBlocksRef?.current) { 34576 originalBlocksRef.current = blocks; 34577 } 34578 }, [blocks]); 34579 const innerBlocksAreDirty = areBlocksDirty( 34580 originalBlocksRef?.current, 34581 blocks 34582 ); 34583 const isDisabled = (0, import_element61.useContext)(import_components67.Disabled.Context); 34584 const innerBlocksProps = (0, import_block_editor139.useInnerBlocksProps)( 34585 { 34586 className: "wp-block-navigation__container" 34587 }, 34588 { 34589 renderAppender: hasSelection ? void 0 : false, 34590 defaultBlock: DEFAULT_BLOCK5, 34591 directInsert: true 34592 } 34593 ); 34594 const { isSaving, hasResolvedAllNavigationMenus } = (0, import_data59.useSelect)( 34595 (select9) => { 34596 if (isDisabled) { 34597 return EMPTY_OBJECT; 34598 } 34599 const { hasFinishedResolution, isSavingEntityRecord } = select9(import_core_data30.store); 34600 return { 34601 isSaving: isSavingEntityRecord("postType", "wp_navigation"), 34602 hasResolvedAllNavigationMenus: hasFinishedResolution( 34603 "getEntityRecords", 34604 SELECT_NAVIGATION_MENUS_ARGS 34605 ) 34606 }; 34607 }, 34608 [isDisabled] 34609 ); 34610 (0, import_element61.useEffect)(() => { 34611 if (isDisabled || isSaving || !hasResolvedAllNavigationMenus || !hasSelection || !innerBlocksAreDirty) { 34612 return; 34613 } 34614 createNavigationMenu(null, blocks); 34615 }, [ 34616 blocks, 34617 createNavigationMenu, 34618 isDisabled, 34619 isSaving, 34620 hasResolvedAllNavigationMenus, 34621 innerBlocksAreDirty, 34622 hasSelection 34623 ]); 34624 const Wrapper = isSaving ? import_components67.Disabled : "div"; 34625 return /* @__PURE__ */ (0, import_jsx_runtime294.jsx)(Wrapper, { ...innerBlocksProps }); 34626 } 34627 34628 // packages/block-library/build-module/navigation/edit/navigation-menu-delete-control.js 34629 var import_components68 = __toESM(require_components()); 34630 var import_core_data31 = __toESM(require_core_data()); 34631 var import_data60 = __toESM(require_data()); 34632 var import_element62 = __toESM(require_element()); 34633 var import_i18n113 = __toESM(require_i18n()); 34634 var import_jsx_runtime295 = __toESM(require_jsx_runtime()); 34635 function NavigationMenuDeleteControl({ onDelete }) { 34636 const [isConfirmDialogVisible, setIsConfirmDialogVisible] = (0, import_element62.useState)(false); 34637 const id = (0, import_core_data31.useEntityId)("postType", "wp_navigation"); 34638 const { deleteEntityRecord } = (0, import_data60.useDispatch)(import_core_data31.store); 34639 return /* @__PURE__ */ (0, import_jsx_runtime295.jsxs)(import_jsx_runtime295.Fragment, { children: [ 34640 /* @__PURE__ */ (0, import_jsx_runtime295.jsx)( 34641 import_components68.Button, 34642 { 34643 __next40pxDefaultSize: true, 34644 className: "wp-block-navigation-delete-menu-button", 34645 variant: "secondary", 34646 isDestructive: true, 34647 onClick: () => { 34648 setIsConfirmDialogVisible(true); 34649 }, 34650 children: (0, import_i18n113.__)("Delete menu") 34651 } 34652 ), 34653 isConfirmDialogVisible && /* @__PURE__ */ (0, import_jsx_runtime295.jsx)( 34654 import_components68.__experimentalConfirmDialog, 34655 { 34656 isOpen: true, 34657 onConfirm: () => { 34658 deleteEntityRecord("postType", "wp_navigation", id, { 34659 force: true 34660 }); 34661 onDelete(); 34662 }, 34663 onCancel: () => { 34664 setIsConfirmDialogVisible(false); 34665 }, 34666 confirmButtonText: (0, import_i18n113.__)("Delete"), 34667 size: "medium", 34668 children: (0, import_i18n113.__)( 34669 "Are you sure you want to delete this Navigation Menu?" 34670 ) 34671 } 34672 ) 34673 ] }); 34674 } 34675 34676 // packages/block-library/build-module/navigation/edit/use-navigation-notice.js 34677 var import_element63 = __toESM(require_element()); 34678 var import_data61 = __toESM(require_data()); 34679 var import_notices11 = __toESM(require_notices()); 34680 function useNavigationNotice({ name: name117, message = "" } = {}) { 34681 const noticeRef = (0, import_element63.useRef)(); 34682 const { createWarningNotice, removeNotice } = (0, import_data61.useDispatch)(import_notices11.store); 34683 const showNotice = (0, import_element63.useCallback)( 34684 (customMsg) => { 34685 if (noticeRef.current) { 34686 return; 34687 } 34688 noticeRef.current = name117; 34689 createWarningNotice(customMsg || message, { 34690 id: noticeRef.current, 34691 type: "snackbar" 34692 }); 34693 }, 34694 [noticeRef, createWarningNotice, message, name117] 34695 ); 34696 const hideNotice = (0, import_element63.useCallback)(() => { 34697 if (!noticeRef.current) { 34698 return; 34699 } 34700 removeNotice(noticeRef.current); 34701 noticeRef.current = null; 34702 }, [noticeRef, removeNotice]); 34703 return [showNotice, hideNotice]; 34704 } 34705 var use_navigation_notice_default = useNavigationNotice; 34706 34707 // packages/block-library/build-module/navigation/edit/overlay-menu-preview.js 34708 var import_components69 = __toESM(require_components()); 34709 var import_i18n114 = __toESM(require_i18n()); 34710 var import_jsx_runtime296 = __toESM(require_jsx_runtime()); 34711 function OverlayMenuPreview({ setAttributes, hasIcon, icon }) { 34712 return /* @__PURE__ */ (0, import_jsx_runtime296.jsxs)(import_jsx_runtime296.Fragment, { children: [ 34713 /* @__PURE__ */ (0, import_jsx_runtime296.jsx)( 34714 import_components69.__experimentalToolsPanelItem, 34715 { 34716 label: (0, import_i18n114.__)("Show icon button"), 34717 isShownByDefault: true, 34718 hasValue: () => !hasIcon, 34719 onDeselect: () => setAttributes({ hasIcon: true }), 34720 children: /* @__PURE__ */ (0, import_jsx_runtime296.jsx)( 34721 import_components69.ToggleControl, 34722 { 34723 label: (0, import_i18n114.__)("Show icon button"), 34724 help: (0, import_i18n114.__)( 34725 "Configure the visual appearance of the button that toggles the overlay menu." 34726 ), 34727 onChange: (value) => setAttributes({ hasIcon: value }), 34728 checked: hasIcon 34729 } 34730 ) 34731 } 34732 ), 34733 /* @__PURE__ */ (0, import_jsx_runtime296.jsx)( 34734 import_components69.__experimentalToolsPanelItem, 34735 { 34736 label: (0, import_i18n114.__)("Icon"), 34737 isShownByDefault: true, 34738 hasValue: () => icon !== "handle", 34739 onDeselect: () => setAttributes({ icon: "handle" }), 34740 children: /* @__PURE__ */ (0, import_jsx_runtime296.jsxs)( 34741 import_components69.__experimentalToggleGroupControl, 34742 { 34743 __next40pxDefaultSize: true, 34744 className: "wp-block-navigation__overlay-menu-icon-toggle-group", 34745 label: (0, import_i18n114.__)("Icon"), 34746 value: icon, 34747 onChange: (value) => setAttributes({ icon: value }), 34748 isBlock: true, 34749 children: [ 34750 /* @__PURE__ */ (0, import_jsx_runtime296.jsx)( 34751 import_components69.__experimentalToggleGroupControlOption, 34752 { 34753 value: "handle", 34754 "aria-label": (0, import_i18n114.__)("handle"), 34755 label: /* @__PURE__ */ (0, import_jsx_runtime296.jsx)(OverlayMenuIcon, { icon: "handle" }) 34756 } 34757 ), 34758 /* @__PURE__ */ (0, import_jsx_runtime296.jsx)( 34759 import_components69.__experimentalToggleGroupControlOption, 34760 { 34761 value: "menu", 34762 "aria-label": (0, import_i18n114.__)("menu"), 34763 label: /* @__PURE__ */ (0, import_jsx_runtime296.jsx)(OverlayMenuIcon, { icon: "menu" }) 34764 } 34765 ) 34766 ] 34767 } 34768 ) 34769 } 34770 ) 34771 ] }); 34772 } 34773 34774 // packages/block-library/build-module/navigation/edit/overlay-panel.js 34775 var import_components74 = __toESM(require_components()); 34776 var import_i18n120 = __toESM(require_i18n()); 34777 34778 // packages/block-library/build-module/navigation/edit/overlay-template-part-selector.js 34779 var import_element65 = __toESM(require_element()); 34780 var import_core_data33 = __toESM(require_core_data()); 34781 var import_data63 = __toESM(require_data()); 34782 var import_components70 = __toESM(require_components()); 34783 var import_i18n116 = __toESM(require_i18n()); 34784 var import_html_entities4 = __toESM(require_html_entities()); 34785 var import_notices12 = __toESM(require_notices()); 34786 34787 // packages/block-library/build-module/template-part/edit/utils/create-template-part-id.js 34788 function createTemplatePartId(theme, slug) { 34789 return theme && slug ? theme + "//" + slug : null; 34790 } 34791 34792 // packages/block-library/build-module/navigation/edit/use-create-overlay.js 34793 var import_element64 = __toESM(require_element()); 34794 var import_data62 = __toESM(require_data()); 34795 var import_core_data32 = __toESM(require_core_data()); 34796 var import_i18n115 = __toESM(require_i18n()); 34797 34798 // node_modules/tslib/tslib.es6.mjs 34799 var __assign = function() { 34800 __assign = Object.assign || function __assign2(t2) { 34801 for (var s2, i2 = 1, n2 = arguments.length; i2 < n2; i2++) { 34802 s2 = arguments[i2]; 34803 for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2)) t2[p2] = s2[p2]; 34804 } 34805 return t2; 34806 }; 34807 return __assign.apply(this, arguments); 34808 }; 34809 34810 // node_modules/lower-case/dist.es2015/index.js 34811 function lowerCase(str) { 34812 return str.toLowerCase(); 34813 } 34814 34815 // node_modules/no-case/dist.es2015/index.js 34816 var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g]; 34817 var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi; 34818 function noCase(input, options2) { 34819 if (options2 === void 0) { 34820 options2 = {}; 34821 } 34822 var _a = options2.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options2.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options2.transform, transform = _c === void 0 ? lowerCase : _c, _d = options2.delimiter, delimiter = _d === void 0 ? " " : _d; 34823 var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0"); 34824 var start = 0; 34825 var end = result.length; 34826 while (result.charAt(start) === "\0") 34827 start++; 34828 while (result.charAt(end - 1) === "\0") 34829 end--; 34830 return result.slice(start, end).split("\0").map(transform).join(delimiter); 34831 } 34832 function replace(input, re, value) { 34833 if (re instanceof RegExp) 34834 return input.replace(re, value); 34835 return re.reduce(function(input2, re2) { 34836 return input2.replace(re2, value); 34837 }, input); 34838 } 34839 34840 // node_modules/upper-case-first/dist.es2015/index.js 34841 function upperCaseFirst(input) { 34842 return input.charAt(0).toUpperCase() + input.substr(1); 34843 } 34844 34845 // node_modules/capital-case/dist.es2015/index.js 34846 function capitalCaseTransform(input) { 34847 return upperCaseFirst(input.toLowerCase()); 34848 } 34849 function capitalCase(input, options2) { 34850 if (options2 === void 0) { 34851 options2 = {}; 34852 } 34853 return noCase(input, __assign({ delimiter: " ", transform: capitalCaseTransform }, options2)); 34854 } 34855 34856 // node_modules/dot-case/dist.es2015/index.js 34857 function dotCase(input, options2) { 34858 if (options2 === void 0) { 34859 options2 = {}; 34860 } 34861 return noCase(input, __assign({ delimiter: "." }, options2)); 34862 } 34863 34864 // node_modules/param-case/dist.es2015/index.js 34865 function paramCase(input, options2) { 34866 if (options2 === void 0) { 34867 options2 = {}; 34868 } 34869 return dotCase(input, __assign({ delimiter: "-" }, options2)); 34870 } 34871 34872 // packages/block-library/build-module/navigation/edit/utils.js 34873 function getComputedStyle(node) { 34874 return node.ownerDocument.defaultView.getComputedStyle(node); 34875 } 34876 function detectColors(colorsDetectionElement, setColor, setBackground) { 34877 if (!colorsDetectionElement) { 34878 return; 34879 } 34880 setColor(getComputedStyle(colorsDetectionElement).color); 34881 let backgroundColorNode = colorsDetectionElement; 34882 let backgroundColor = getComputedStyle(backgroundColorNode).backgroundColor; 34883 while (backgroundColor === "rgba(0, 0, 0, 0)" && backgroundColorNode.parentNode && backgroundColorNode.parentNode.nodeType === backgroundColorNode.parentNode.ELEMENT_NODE) { 34884 backgroundColorNode = backgroundColorNode.parentNode; 34885 backgroundColor = getComputedStyle(backgroundColorNode).backgroundColor; 34886 } 34887 setBackground(backgroundColor); 34888 } 34889 function getColors(context, isSubMenu) { 34890 const { 34891 textColor, 34892 customTextColor, 34893 backgroundColor, 34894 customBackgroundColor, 34895 overlayTextColor, 34896 customOverlayTextColor, 34897 overlayBackgroundColor, 34898 customOverlayBackgroundColor, 34899 style: style2 34900 } = context; 34901 const colors = {}; 34902 if (isSubMenu && !!customOverlayTextColor) { 34903 colors.customTextColor = customOverlayTextColor; 34904 } else if (isSubMenu && !!overlayTextColor) { 34905 colors.textColor = overlayTextColor; 34906 } else if (!!customTextColor) { 34907 colors.customTextColor = customTextColor; 34908 } else if (!!textColor) { 34909 colors.textColor = textColor; 34910 } else if (!!style2?.color?.text) { 34911 colors.customTextColor = style2.color.text; 34912 } 34913 if (isSubMenu && !!customOverlayBackgroundColor) { 34914 colors.customBackgroundColor = customOverlayBackgroundColor; 34915 } else if (isSubMenu && !!overlayBackgroundColor) { 34916 colors.backgroundColor = overlayBackgroundColor; 34917 } else if (!!customBackgroundColor) { 34918 colors.customBackgroundColor = customBackgroundColor; 34919 } else if (!!backgroundColor) { 34920 colors.backgroundColor = backgroundColor; 34921 } else if (!!style2?.color?.background) { 34922 colors.customTextColor = style2.color.background; 34923 } 34924 return colors; 34925 } 34926 function getNavigationChildBlockProps(innerBlocksColors) { 34927 return { 34928 className: clsx_default("wp-block-navigation__submenu-container", { 34929 "has-text-color": !!(innerBlocksColors.textColor || innerBlocksColors.customTextColor), 34930 [`has-$innerBlocksColors.textColor}-color`]: !!innerBlocksColors.textColor, 34931 "has-background": !!(innerBlocksColors.backgroundColor || innerBlocksColors.customBackgroundColor), 34932 [`has-$innerBlocksColors.backgroundColor}-background-color`]: !!innerBlocksColors.backgroundColor 34933 }), 34934 style: { 34935 color: innerBlocksColors.customTextColor, 34936 backgroundColor: innerBlocksColors.customBackgroundColor 34937 } 34938 }; 34939 } 34940 var getUniqueTemplatePartTitle = (title, templateParts) => { 34941 const lowercaseTitle = title.toLowerCase(); 34942 const existingTitles = templateParts.map( 34943 (templatePart) => templatePart.title.rendered.toLowerCase() 34944 ); 34945 if (!existingTitles.includes(lowercaseTitle)) { 34946 return title; 34947 } 34948 let suffix = 2; 34949 while (existingTitles.includes(`$lowercaseTitle} $suffix}`)) { 34950 suffix++; 34951 } 34952 return `$title} $suffix}`; 34953 }; 34954 var getCleanTemplatePartSlug = (title) => { 34955 return paramCase(title).replace(/[^\w-]+/g, "") || "wp-custom-part"; 34956 }; 34957 34958 // packages/block-library/build-module/navigation/edit/use-create-overlay.js 34959 function useCreateOverlayTemplatePart(overlayTemplateParts) { 34960 const { saveEntityRecord } = (0, import_data62.useDispatch)(import_core_data32.store); 34961 const createOverlayTemplatePart = (0, import_element64.useCallback)(async () => { 34962 const templatePartsWithTitles = overlayTemplateParts.filter( 34963 (templatePart2) => templatePart2.title?.rendered 34964 ); 34965 const uniqueTitle = getUniqueTemplatePartTitle( 34966 (0, import_i18n115.__)("Overlay"), 34967 templatePartsWithTitles 34968 ); 34969 const cleanSlug = getCleanTemplatePartSlug(uniqueTitle); 34970 const templatePart = await saveEntityRecord( 34971 "postType", 34972 "wp_template_part", 34973 { 34974 slug: cleanSlug, 34975 title: uniqueTitle, 34976 area: "overlay" 34977 }, 34978 { throwOnError: true } 34979 ); 34980 return templatePart; 34981 }, [overlayTemplateParts, saveEntityRecord]); 34982 return createOverlayTemplatePart; 34983 } 34984 34985 // packages/block-library/build-module/navigation/edit/overlay-template-part-selector.js 34986 var import_jsx_runtime297 = __toESM(require_jsx_runtime()); 34987 function OverlayTemplatePartSelector({ 34988 overlay, 34989 setAttributes, 34990 onNavigateToEntityRecord 34991 }) { 34992 const { 34993 records: templateParts, 34994 isResolving, 34995 hasResolved 34996 } = (0, import_core_data33.useEntityRecords)("postType", "wp_template_part", { 34997 per_page: -1 34998 }); 34999 const { createErrorNotice } = (0, import_data63.useDispatch)(import_notices12.store); 35000 const [isCreating, setIsCreating] = (0, import_element65.useState)(false); 35001 const overlayTemplateParts = (0, import_element65.useMemo)(() => { 35002 if (!templateParts) { 35003 return []; 35004 } 35005 return templateParts.filter( 35006 (templatePart) => templatePart.area === "overlay" 35007 ); 35008 }, [templateParts]); 35009 const createOverlayTemplatePart = useCreateOverlayTemplatePart(overlayTemplateParts); 35010 const options2 = (0, import_element65.useMemo)(() => { 35011 const baseOptions = [ 35012 { 35013 label: (0, import_i18n116.__)("None (default)"), 35014 value: "" 35015 } 35016 ]; 35017 if (!hasResolved || isResolving) { 35018 return baseOptions; 35019 } 35020 const templatePartOptions = overlayTemplateParts.map( 35021 (templatePart) => { 35022 const templatePartId = createTemplatePartId( 35023 templatePart.theme, 35024 templatePart.slug 35025 ); 35026 const label = templatePart.title?.rendered ? (0, import_html_entities4.decodeEntities)(templatePart.title.rendered) : templatePart.slug; 35027 return { 35028 label, 35029 value: templatePartId 35030 }; 35031 } 35032 ); 35033 return [...baseOptions, ...templatePartOptions]; 35034 }, [overlayTemplateParts, hasResolved, isResolving]); 35035 const selectedTemplatePart = (0, import_element65.useMemo)(() => { 35036 if (!overlay || !overlayTemplateParts) { 35037 return null; 35038 } 35039 return overlayTemplateParts.find((templatePart) => { 35040 const templatePartId = createTemplatePartId( 35041 templatePart.theme, 35042 templatePart.slug 35043 ); 35044 return templatePartId === overlay; 35045 }); 35046 }, [overlay, overlayTemplateParts]); 35047 const handleSelectChange = (value) => { 35048 setAttributes({ 35049 overlay: value || void 0 35050 }); 35051 }; 35052 const handleEditClick = () => { 35053 if (!overlay || !onNavigateToEntityRecord) { 35054 return; 35055 } 35056 onNavigateToEntityRecord({ 35057 postId: overlay, 35058 postType: "wp_template_part" 35059 }); 35060 }; 35061 const handleCreateOverlay = (0, import_element65.useCallback)(async () => { 35062 try { 35063 setIsCreating(true); 35064 const templatePart = await createOverlayTemplatePart(); 35065 setAttributes({ 35066 overlay: templatePart.id 35067 }); 35068 if (onNavigateToEntityRecord) { 35069 onNavigateToEntityRecord({ 35070 postId: templatePart.id, 35071 postType: "wp_template_part" 35072 }); 35073 } 35074 } catch (error) { 35075 const errorMessage = error instanceof Error && "code" in error && error.message && error.code !== "unknown_error" ? error.message : (0, import_i18n116.__)("An error occurred while creating the overlay."); 35076 createErrorNotice(errorMessage, { type: "snackbar" }); 35077 } finally { 35078 setIsCreating(false); 35079 } 35080 }, [ 35081 createOverlayTemplatePart, 35082 setAttributes, 35083 onNavigateToEntityRecord, 35084 createErrorNotice 35085 ]); 35086 const isCreateButtonDisabled = isResolving || isCreating; 35087 const helpText = (0, import_element65.useMemo)(() => { 35088 if (overlayTemplateParts.length === 0 && hasResolved) { 35089 return (0, import_i18n116.__)("No overlays found."); 35090 } 35091 return (0, import_i18n116.__)("Select an overlay for navigation."); 35092 }, [overlayTemplateParts.length, hasResolved]); 35093 const editButtonLabel = (0, import_element65.useMemo)(() => { 35094 return selectedTemplatePart ? (0, import_i18n116.sprintf)( 35095 /* translators: %s: Overlay title. */ 35096 (0, import_i18n116.__)("Edit overlay: %s"), 35097 selectedTemplatePart.title?.rendered ? (0, import_html_entities4.decodeEntities)(selectedTemplatePart.title.rendered) : selectedTemplatePart.slug 35098 ) : (0, import_i18n116.__)("Edit overlay"); 35099 }, [selectedTemplatePart]); 35100 return /* @__PURE__ */ (0, import_jsx_runtime297.jsxs)("div", { className: "wp-block-navigation__overlay-selector", children: [ 35101 /* @__PURE__ */ (0, import_jsx_runtime297.jsx)( 35102 import_components70.Button, 35103 { 35104 size: "small", 35105 icon: plus_default, 35106 onClick: handleCreateOverlay, 35107 disabled: isCreateButtonDisabled, 35108 accessibleWhenDisabled: true, 35109 isBusy: isCreating, 35110 label: (0, import_i18n116.__)("Create new overlay template"), 35111 showTooltip: true, 35112 className: "wp-block-navigation__overlay-create-button" 35113 } 35114 ), 35115 /* @__PURE__ */ (0, import_jsx_runtime297.jsxs)(import_components70.__experimentalHStack, { alignment: "flex-start", children: [ 35116 /* @__PURE__ */ (0, import_jsx_runtime297.jsx)(import_components70.FlexBlock, { children: /* @__PURE__ */ (0, import_jsx_runtime297.jsx)( 35117 import_components70.SelectControl, 35118 { 35119 __next40pxDefaultSize: true, 35120 __nextHasNoMarginBottom: true, 35121 label: (0, import_i18n116.__)("Overlay template"), 35122 value: overlay || "", 35123 options: options2, 35124 onChange: handleSelectChange, 35125 disabled: isResolving, 35126 accessibleWhenDisabled: true, 35127 help: helpText 35128 } 35129 ) }), 35130 overlay && hasResolved && selectedTemplatePart && /* @__PURE__ */ (0, import_jsx_runtime297.jsx)(import_components70.FlexItem, { children: /* @__PURE__ */ (0, import_jsx_runtime297.jsx)( 35131 import_components70.Button, 35132 { 35133 __next40pxDefaultSize: true, 35134 variant: "secondary", 35135 onClick: handleEditClick, 35136 disabled: !onNavigateToEntityRecord, 35137 accessibleWhenDisabled: true, 35138 label: editButtonLabel, 35139 showTooltip: true, 35140 className: "wp-block-navigation__overlay-edit-button", 35141 children: (0, import_i18n116.__)("Edit") 35142 } 35143 ) }) 35144 ] }) 35145 ] }); 35146 } 35147 35148 // packages/block-library/build-module/navigation/edit/overlay-visibility-control.js 35149 var import_components71 = __toESM(require_components()); 35150 var import_i18n117 = __toESM(require_i18n()); 35151 var import_jsx_runtime298 = __toESM(require_jsx_runtime()); 35152 function OverlayVisibilityControl({ 35153 overlayMenu, 35154 setAttributes 35155 }) { 35156 return /* @__PURE__ */ (0, import_jsx_runtime298.jsxs)( 35157 import_components71.__experimentalToggleGroupControl, 35158 { 35159 __next40pxDefaultSize: true, 35160 label: (0, import_i18n117.__)("Overlay Visibility"), 35161 "aria-label": (0, import_i18n117.__)("Configure overlay visibility"), 35162 value: overlayMenu, 35163 help: (0, import_i18n117.__)( 35164 "Collapses the navigation options in a menu icon opening an overlay." 35165 ), 35166 onChange: (value) => setAttributes({ overlayMenu: value }), 35167 isBlock: true, 35168 children: [ 35169 /* @__PURE__ */ (0, import_jsx_runtime298.jsx)(import_components71.__experimentalToggleGroupControlOption, { value: "never", label: (0, import_i18n117.__)("Off") }), 35170 /* @__PURE__ */ (0, import_jsx_runtime298.jsx)(import_components71.__experimentalToggleGroupControlOption, { value: "mobile", label: (0, import_i18n117.__)("Mobile") }), 35171 /* @__PURE__ */ (0, import_jsx_runtime298.jsx)(import_components71.__experimentalToggleGroupControlOption, { value: "always", label: (0, import_i18n117.__)("Always") }) 35172 ] 35173 } 35174 ); 35175 } 35176 35177 // packages/block-library/build-module/navigation/edit/overlay-menu-preview-button.js 35178 var import_components73 = __toESM(require_components()); 35179 var import_i18n119 = __toESM(require_i18n()); 35180 35181 // packages/block-library/build-module/navigation/edit/overlay-menu-preview-controls.js 35182 var import_components72 = __toESM(require_components()); 35183 var import_i18n118 = __toESM(require_i18n()); 35184 var import_jsx_runtime299 = __toESM(require_jsx_runtime()); 35185 function OverlayMenuPreviewControls({ 35186 hasIcon, 35187 icon, 35188 setAttributes 35189 }) { 35190 return /* @__PURE__ */ (0, import_jsx_runtime299.jsxs)(import_components72.__experimentalVStack, { spacing: 4, children: [ 35191 /* @__PURE__ */ (0, import_jsx_runtime299.jsx)( 35192 import_components72.ToggleControl, 35193 { 35194 label: (0, import_i18n118.__)("Show icon button"), 35195 help: (0, import_i18n118.__)( 35196 "Configure the visual appearance of the button that toggles the overlay menu." 35197 ), 35198 onChange: (value) => setAttributes({ hasIcon: value }), 35199 checked: hasIcon 35200 } 35201 ), 35202 /* @__PURE__ */ (0, import_jsx_runtime299.jsxs)( 35203 import_components72.__experimentalToggleGroupControl, 35204 { 35205 __next40pxDefaultSize: true, 35206 className: "wp-block-navigation__overlay-menu-icon-toggle-group", 35207 label: (0, import_i18n118.__)("Icon"), 35208 value: icon, 35209 onChange: (value) => setAttributes({ icon: value }), 35210 isBlock: true, 35211 children: [ 35212 /* @__PURE__ */ (0, import_jsx_runtime299.jsx)( 35213 import_components72.__experimentalToggleGroupControlOption, 35214 { 35215 value: "handle", 35216 "aria-label": (0, import_i18n118.__)("handle"), 35217 label: /* @__PURE__ */ (0, import_jsx_runtime299.jsx)(OverlayMenuIcon, { icon: "handle" }) 35218 } 35219 ), 35220 /* @__PURE__ */ (0, import_jsx_runtime299.jsx)( 35221 import_components72.__experimentalToggleGroupControlOption, 35222 { 35223 value: "menu", 35224 "aria-label": (0, import_i18n118.__)("menu"), 35225 label: /* @__PURE__ */ (0, import_jsx_runtime299.jsx)(OverlayMenuIcon, { icon: "menu" }) 35226 } 35227 ) 35228 ] 35229 } 35230 ) 35231 ] }); 35232 } 35233 35234 // packages/block-library/build-module/navigation/edit/overlay-menu-preview-button.js 35235 var import_jsx_runtime300 = __toESM(require_jsx_runtime()); 35236 function OverlayMenuPreviewButton({ 35237 isResponsive, 35238 overlayMenuPreview, 35239 setOverlayMenuPreview, 35240 hasIcon, 35241 icon, 35242 setAttributes, 35243 overlayMenuPreviewClasses, 35244 overlayMenuPreviewId, 35245 containerStyle 35246 }) { 35247 if (!isResponsive) { 35248 return null; 35249 } 35250 return /* @__PURE__ */ (0, import_jsx_runtime300.jsxs)(import_jsx_runtime300.Fragment, { children: [ 35251 /* @__PURE__ */ (0, import_jsx_runtime300.jsxs)( 35252 import_components73.Button, 35253 { 35254 __next40pxDefaultSize: true, 35255 className: overlayMenuPreviewClasses, 35256 onClick: () => setOverlayMenuPreview(!overlayMenuPreview), 35257 "aria-label": (0, import_i18n119.__)("Overlay menu controls"), 35258 "aria-controls": overlayMenuPreviewId, 35259 "aria-expanded": overlayMenuPreview, 35260 children: [ 35261 hasIcon && /* @__PURE__ */ (0, import_jsx_runtime300.jsxs)(import_jsx_runtime300.Fragment, { children: [ 35262 /* @__PURE__ */ (0, import_jsx_runtime300.jsx)(OverlayMenuIcon, { icon }), 35263 /* @__PURE__ */ (0, import_jsx_runtime300.jsx)(icon_default5, { icon: close_default }) 35264 ] }), 35265 !hasIcon && /* @__PURE__ */ (0, import_jsx_runtime300.jsxs)(import_jsx_runtime300.Fragment, { children: [ 35266 /* @__PURE__ */ (0, import_jsx_runtime300.jsx)("span", { children: (0, import_i18n119.__)("Menu") }), 35267 /* @__PURE__ */ (0, import_jsx_runtime300.jsx)("span", { children: (0, import_i18n119.__)("Close") }) 35268 ] }) 35269 ] 35270 } 35271 ), 35272 overlayMenuPreview && /* @__PURE__ */ (0, import_jsx_runtime300.jsx)( 35273 import_components73.__experimentalVStack, 35274 { 35275 id: overlayMenuPreviewId, 35276 spacing: 4, 35277 style: containerStyle, 35278 children: /* @__PURE__ */ (0, import_jsx_runtime300.jsx)( 35279 OverlayMenuPreviewControls, 35280 { 35281 hasIcon, 35282 icon, 35283 setAttributes 35284 } 35285 ) 35286 } 35287 ) 35288 ] }); 35289 } 35290 35291 // packages/block-library/build-module/navigation/edit/overlay-panel.js 35292 var import_jsx_runtime301 = __toESM(require_jsx_runtime()); 35293 function OverlayPanel({ 35294 overlayMenu, 35295 overlay, 35296 setAttributes, 35297 onNavigateToEntityRecord, 35298 overlayMenuPreview, 35299 setOverlayMenuPreview, 35300 hasIcon, 35301 icon, 35302 overlayMenuPreviewClasses, 35303 overlayMenuPreviewId, 35304 isResponsive 35305 }) { 35306 return /* @__PURE__ */ (0, import_jsx_runtime301.jsx)(import_components74.PanelBody, { title: (0, import_i18n120.__)("Overlay"), initialOpen: true, children: /* @__PURE__ */ (0, import_jsx_runtime301.jsxs)(import_components74.__experimentalVStack, { spacing: 4, children: [ 35307 /* @__PURE__ */ (0, import_jsx_runtime301.jsx)( 35308 OverlayVisibilityControl, 35309 { 35310 overlayMenu, 35311 setAttributes 35312 } 35313 ), 35314 overlayMenu !== "never" && /* @__PURE__ */ (0, import_jsx_runtime301.jsx)( 35315 OverlayMenuPreviewButton, 35316 { 35317 isResponsive, 35318 overlayMenuPreview, 35319 setOverlayMenuPreview, 35320 hasIcon, 35321 icon, 35322 setAttributes, 35323 overlayMenuPreviewClasses, 35324 overlayMenuPreviewId 35325 } 35326 ), 35327 overlayMenu !== "never" && /* @__PURE__ */ (0, import_jsx_runtime301.jsx)( 35328 OverlayTemplatePartSelector, 35329 { 35330 overlay, 35331 setAttributes, 35332 onNavigateToEntityRecord 35333 } 35334 ) 35335 ] }) }); 35336 } 35337 35338 // packages/block-library/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js 35339 var import_data65 = __toESM(require_data()); 35340 var import_core_data35 = __toESM(require_core_data()); 35341 var import_element67 = __toESM(require_element()); 35342 var import_i18n121 = __toESM(require_i18n()); 35343 35344 // packages/block-library/build-module/navigation/menu-items-to-blocks.js 35345 var import_blocks57 = __toESM(require_blocks()); 35346 var import_hooks39 = __toESM(require_hooks()); 35347 35348 // packages/block-library/build-module/navigation-link/shared/use-entity-binding.js 35349 var import_element66 = __toESM(require_element()); 35350 var import_block_editor140 = __toESM(require_block_editor()); 35351 var import_data64 = __toESM(require_data()); 35352 var import_core_data34 = __toESM(require_core_data()); 35353 function buildNavigationLinkEntityBinding(kind) { 35354 if (kind === void 0) { 35355 throw new Error( 35356 'buildNavigationLinkEntityBinding requires a kind parameter. Only "post-type" and "taxonomy" are supported.' 35357 ); 35358 } 35359 if (kind !== "post-type" && kind !== "taxonomy") { 35360 throw new Error( 35361 `Invalid kind "$kind}" provided to buildNavigationLinkEntityBinding. Only 'post-type' and 'taxonomy' are supported.` 35362 ); 35363 } 35364 const source = kind === "taxonomy" ? "core/term-data" : "core/post-data"; 35365 return { 35366 url: { 35367 source, 35368 args: { 35369 field: "link" 35370 } 35371 } 35372 }; 35373 } 35374 function useEntityBinding({ clientId, attributes: attributes3 }) { 35375 const { updateBlockBindings } = (0, import_block_editor140.useBlockBindingsUtils)(clientId); 35376 const { metadata, id, kind, type } = attributes3; 35377 const blockEditingMode = (0, import_block_editor140.useBlockEditingMode)(); 35378 const hasUrlBinding = !!metadata?.bindings?.url && !!id; 35379 const expectedSource = kind === "post-type" ? "core/post-data" : "core/term-data"; 35380 const hasCorrectBinding = hasUrlBinding && metadata?.bindings?.url?.source === expectedSource; 35381 const { isBoundEntityAvailable, entityRecord } = (0, import_data64.useSelect)( 35382 (select9) => { 35383 if (!hasCorrectBinding || !id) { 35384 return { isBoundEntityAvailable: false, entityRecord: null }; 35385 } 35386 const isPostType = kind === "post-type"; 35387 const isTaxonomy = kind === "taxonomy"; 35388 if (!isPostType && !isTaxonomy) { 35389 return { isBoundEntityAvailable: false, entityRecord: null }; 35390 } 35391 if (blockEditingMode === "disabled") { 35392 return { isBoundEntityAvailable: true, entityRecord: null }; 35393 } 35394 const { getEntityRecord, hasFinishedResolution } = select9(import_core_data34.store); 35395 const entityType = isTaxonomy ? "taxonomy" : "postType"; 35396 const typeForAPI = type === "tag" ? "post_tag" : type; 35397 const record = getEntityRecord(entityType, typeForAPI, id); 35398 const hasResolved = hasFinishedResolution("getEntityRecord", [ 35399 entityType, 35400 typeForAPI, 35401 id 35402 ]); 35403 const isAvailable = hasResolved ? record !== void 0 : true; 35404 return { 35405 isBoundEntityAvailable: isAvailable, 35406 entityRecord: record || null 35407 }; 35408 }, 35409 [kind, type, id, hasCorrectBinding, blockEditingMode] 35410 ); 35411 const clearBinding = (0, import_element66.useCallback)(() => { 35412 if (hasUrlBinding) { 35413 updateBlockBindings({ url: void 0 }); 35414 } 35415 }, [updateBlockBindings, hasUrlBinding]); 35416 const createBinding = (0, import_element66.useCallback)( 35417 (updatedAttributes) => { 35418 const kindToUse = updatedAttributes?.kind ?? kind; 35419 if (!kindToUse) { 35420 return; 35421 } 35422 try { 35423 const binding = buildNavigationLinkEntityBinding(kindToUse); 35424 updateBlockBindings(binding); 35425 } catch (error) { 35426 console.warn( 35427 "Failed to create entity binding:", 35428 error.message 35429 ); 35430 } 35431 }, 35432 [updateBlockBindings, kind] 35433 ); 35434 return { 35435 hasUrlBinding: hasCorrectBinding, 35436 isBoundEntityAvailable, 35437 entityRecord, 35438 clearBinding, 35439 createBinding 35440 }; 35441 } 35442 35443 // packages/block-library/build-module/navigation/menu-items-to-blocks.js 35444 function menuItemsToBlocks(menuItems) { 35445 if (!menuItems) { 35446 return null; 35447 } 35448 const menuTree = createDataTree(menuItems); 35449 const blocks = mapMenuItemsToBlocks(menuTree); 35450 return (0, import_hooks39.applyFilters)( 35451 "blocks.navigation.__unstableMenuItemsToBlocks", 35452 blocks, 35453 menuItems 35454 ); 35455 } 35456 function mapMenuItemsToBlocks(menuItems, level = 0) { 35457 let mapping = {}; 35458 const sortedItems = [...menuItems].sort( 35459 (a2, b2) => a2.menu_order - b2.menu_order 35460 ); 35461 const innerBlocks = sortedItems.map((menuItem) => { 35462 if (menuItem.type === "block") { 35463 const [block2] = (0, import_blocks57.parse)(menuItem.content.raw); 35464 if (!block2) { 35465 return (0, import_blocks57.createBlock)("core/freeform", { 35466 content: menuItem.content 35467 }); 35468 } 35469 return block2; 35470 } 35471 const blockType = menuItem.children?.length ? "core/navigation-submenu" : "core/navigation-link"; 35472 const attributes3 = menuItemToBlockAttributes( 35473 menuItem, 35474 blockType, 35475 level 35476 ); 35477 const { 35478 innerBlocks: nestedBlocks = [], 35479 // alias to avoid shadowing 35480 mapping: nestedMapping = {} 35481 // alias to avoid shadowing 35482 } = menuItem.children?.length ? mapMenuItemsToBlocks(menuItem.children, level + 1) : {}; 35483 mapping = { 35484 ...mapping, 35485 ...nestedMapping 35486 }; 35487 const block = (0, import_blocks57.createBlock)(blockType, attributes3, nestedBlocks); 35488 mapping[menuItem.id] = block.clientId; 35489 return block; 35490 }); 35491 return { 35492 innerBlocks, 35493 mapping 35494 }; 35495 } 35496 function menuItemToBlockAttributes({ 35497 title: menuItemTitleField, 35498 xfn, 35499 classes, 35500 // eslint-disable-next-line camelcase 35501 attr_title, 35502 object, 35503 // eslint-disable-next-line camelcase 35504 object_id, 35505 description, 35506 url, 35507 type: menuItemTypeField, 35508 target 35509 }, blockType, level) { 35510 if (object && object === "post_tag") { 35511 object = "tag"; 35512 } 35513 const inferredKind = menuItemTypeField?.replace("_", "-") || "custom"; 35514 return { 35515 label: menuItemTitleField?.rendered || "", 35516 ...object?.length && { 35517 type: object 35518 }, 35519 kind: inferredKind, 35520 url: url || "", 35521 ...xfn?.length && xfn.join(" ").trim() && { 35522 rel: xfn.join(" ").trim() 35523 }, 35524 ...classes?.length && classes.join(" ").trim() && { 35525 className: classes.join(" ").trim() 35526 }, 35527 /* eslint-disable camelcase */ 35528 ...attr_title?.length && { 35529 title: attr_title 35530 }, 35531 ...object_id && (inferredKind === "post-type" || inferredKind === "taxonomy") && { 35532 id: object_id, 35533 metadata: { 35534 bindings: buildNavigationLinkEntityBinding(inferredKind) 35535 } 35536 }, 35537 /* eslint-enable camelcase */ 35538 ...description?.length && { 35539 description 35540 }, 35541 ...target === "_blank" && { 35542 opensInNewTab: true 35543 }, 35544 ...blockType === "core/navigation-submenu" && { 35545 isTopLevelItem: level === 0 35546 }, 35547 ...blockType === "core/navigation-link" && { 35548 isTopLevelLink: level === 0 35549 } 35550 }; 35551 } 35552 function createDataTree(dataset, id = "id", relation = "parent") { 35553 const hashTable = /* @__PURE__ */ Object.create(null); 35554 const dataTree = []; 35555 for (const data of dataset) { 35556 hashTable[data[id]] = { 35557 ...data, 35558 children: [] 35559 }; 35560 if (data[relation]) { 35561 hashTable[data[relation]] = hashTable[data[relation]] || {}; 35562 hashTable[data[relation]].children = hashTable[data[relation]].children || []; 35563 hashTable[data[relation]].children.push( 35564 hashTable[data[id]] 35565 ); 35566 } else { 35567 dataTree.push(hashTable[data[id]]); 35568 } 35569 } 35570 return dataTree; 35571 } 35572 35573 // packages/block-library/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js 35574 var CLASSIC_MENU_CONVERSION_SUCCESS = "success"; 35575 var CLASSIC_MENU_CONVERSION_ERROR = "error"; 35576 var CLASSIC_MENU_CONVERSION_PENDING = "pending"; 35577 var CLASSIC_MENU_CONVERSION_IDLE = "idle"; 35578 var classicMenuBeingConvertedId = null; 35579 function useConvertClassicToBlockMenu(createNavigationMenu, { throwOnError = false } = {}) { 35580 const registry = (0, import_data65.useRegistry)(); 35581 const { editEntityRecord } = (0, import_data65.useDispatch)(import_core_data35.store); 35582 const [status, setStatus] = (0, import_element67.useState)(CLASSIC_MENU_CONVERSION_IDLE); 35583 const [error, setError] = (0, import_element67.useState)(null); 35584 const convertClassicMenuToBlockMenu = (0, import_element67.useCallback)( 35585 async (menuId, menuName, postStatus = "publish") => { 35586 let navigationMenu; 35587 let classicMenuItems; 35588 try { 35589 classicMenuItems = await registry.resolveSelect(import_core_data35.store).getMenuItems({ 35590 menus: menuId, 35591 per_page: -1, 35592 context: "view" 35593 }); 35594 } catch (err) { 35595 throw new Error( 35596 (0, import_i18n121.sprintf)( 35597 // translators: %s: The name of a menu (e.g. Header menu). 35598 (0, import_i18n121.__)(`Unable to fetch classic menu "%s" from API.`), 35599 menuName 35600 ), 35601 { 35602 cause: err 35603 } 35604 ); 35605 } 35606 if (classicMenuItems === null) { 35607 throw new Error( 35608 (0, import_i18n121.sprintf)( 35609 // translators: %s: The name of a menu (e.g. Header menu). 35610 (0, import_i18n121.__)(`Unable to fetch classic menu "%s" from API.`), 35611 menuName 35612 ) 35613 ); 35614 } 35615 const { innerBlocks } = menuItemsToBlocks(classicMenuItems); 35616 try { 35617 navigationMenu = await createNavigationMenu( 35618 menuName, 35619 innerBlocks, 35620 postStatus 35621 ); 35622 await editEntityRecord( 35623 "postType", 35624 "wp_navigation", 35625 navigationMenu.id, 35626 { 35627 status: "publish" 35628 }, 35629 { throwOnError: true } 35630 ); 35631 } catch (err) { 35632 throw new Error( 35633 (0, import_i18n121.sprintf)( 35634 // translators: %s: The name of a menu (e.g. Header menu). 35635 (0, import_i18n121.__)(`Unable to create Navigation Menu "%s".`), 35636 menuName 35637 ), 35638 { 35639 cause: err 35640 } 35641 ); 35642 } 35643 return navigationMenu; 35644 }, 35645 [createNavigationMenu, editEntityRecord, registry] 35646 ); 35647 const convert = (0, import_element67.useCallback)( 35648 async (menuId, menuName, postStatus) => { 35649 if (classicMenuBeingConvertedId === menuId) { 35650 return; 35651 } 35652 classicMenuBeingConvertedId = menuId; 35653 if (!menuId || !menuName) { 35654 setError("Unable to convert menu. Missing menu details."); 35655 setStatus(CLASSIC_MENU_CONVERSION_ERROR); 35656 return; 35657 } 35658 setStatus(CLASSIC_MENU_CONVERSION_PENDING); 35659 setError(null); 35660 return await convertClassicMenuToBlockMenu( 35661 menuId, 35662 menuName, 35663 postStatus 35664 ).then((navigationMenu) => { 35665 setStatus(CLASSIC_MENU_CONVERSION_SUCCESS); 35666 classicMenuBeingConvertedId = null; 35667 return navigationMenu; 35668 }).catch((err) => { 35669 setError(err?.message); 35670 setStatus(CLASSIC_MENU_CONVERSION_ERROR); 35671 classicMenuBeingConvertedId = null; 35672 if (throwOnError) { 35673 throw new Error( 35674 (0, import_i18n121.sprintf)( 35675 // translators: %s: The name of a menu (e.g. Header menu). 35676 (0, import_i18n121.__)(`Unable to create Navigation Menu "%s".`), 35677 menuName 35678 ), 35679 { 35680 cause: err 35681 } 35682 ); 35683 } 35684 }); 35685 }, 35686 [convertClassicMenuToBlockMenu, throwOnError] 35687 ); 35688 return { 35689 convert, 35690 status, 35691 error 35692 }; 35693 } 35694 var use_convert_classic_menu_to_block_menu_default = useConvertClassicToBlockMenu; 35695 35696 // packages/block-library/build-module/navigation/edit/use-create-navigation-menu.js 35697 var import_blocks58 = __toESM(require_blocks()); 35698 var import_core_data38 = __toESM(require_core_data()); 35699 var import_data68 = __toESM(require_data()); 35700 var import_element69 = __toESM(require_element()); 35701 35702 // packages/block-library/build-module/navigation/edit/use-generate-default-navigation-title.js 35703 var import_components75 = __toESM(require_components()); 35704 var import_core_data37 = __toESM(require_core_data()); 35705 var import_data67 = __toESM(require_data()); 35706 var import_element68 = __toESM(require_element()); 35707 var import_i18n122 = __toESM(require_i18n()); 35708 35709 // packages/block-library/build-module/navigation/use-template-part-area-label.js 35710 var import_block_editor141 = __toESM(require_block_editor()); 35711 var import_core_data36 = __toESM(require_core_data()); 35712 var import_data66 = __toESM(require_data()); 35713 35714 // packages/block-library/build-module/template-part/edit/utils/get-template-part-icon.js 35715 var getTemplatePartIcon = (areaOrIconName) => { 35716 if ("header" === areaOrIconName) { 35717 return header_default; 35718 } else if ("footer" === areaOrIconName) { 35719 return footer_default; 35720 } else if ("sidebar" === areaOrIconName) { 35721 return sidebar_default; 35722 } else if ("overlay" === areaOrIconName) { 35723 return table_column_after_default; 35724 } 35725 if ("menu" === areaOrIconName) { 35726 return table_column_after_default; 35727 } 35728 return symbol_filled_default; 35729 }; 35730 35731 // packages/block-library/build-module/navigation/use-template-part-area-label.js 35732 function useTemplatePartAreaLabel(clientId) { 35733 return (0, import_data66.useSelect)( 35734 (select9) => { 35735 if (!clientId) { 35736 return; 35737 } 35738 const { getBlock, getBlockParentsByBlockName } = select9(import_block_editor141.store); 35739 const withAscendingResults = true; 35740 const parentTemplatePartClientIds = getBlockParentsByBlockName( 35741 clientId, 35742 "core/template-part", 35743 withAscendingResults 35744 ); 35745 if (!parentTemplatePartClientIds?.length) { 35746 return; 35747 } 35748 const { getCurrentTheme, getEditedEntityRecord } = select9(import_core_data36.store); 35749 const currentTheme = getCurrentTheme(); 35750 const defaultTemplatePartAreas = currentTheme?.default_template_part_areas || []; 35751 const definedAreas = defaultTemplatePartAreas.map((item) => ({ 35752 ...item, 35753 icon: getTemplatePartIcon(item.icon) 35754 })); 35755 for (const templatePartClientId of parentTemplatePartClientIds) { 35756 const templatePartBlock = getBlock(templatePartClientId); 35757 const { theme = currentTheme?.stylesheet, slug } = templatePartBlock.attributes; 35758 const templatePartEntityId = createTemplatePartId( 35759 theme, 35760 slug 35761 ); 35762 const templatePartEntity = getEditedEntityRecord( 35763 "postType", 35764 "wp_template_part", 35765 templatePartEntityId 35766 ); 35767 if (templatePartEntity?.area) { 35768 return definedAreas.find( 35769 (definedArea) => definedArea.area !== "uncategorized" && definedArea.area === templatePartEntity.area 35770 )?.label; 35771 } 35772 } 35773 }, 35774 [clientId] 35775 ); 35776 } 35777 35778 // packages/block-library/build-module/navigation/edit/use-generate-default-navigation-title.js 35779 var DRAFT_MENU_PARAMS = [ 35780 "postType", 35781 "wp_navigation", 35782 { status: "draft", per_page: -1 } 35783 ]; 35784 var PUBLISHED_MENU_PARAMS = [ 35785 "postType", 35786 "wp_navigation", 35787 { per_page: -1, status: "publish" } 35788 ]; 35789 function useGenerateDefaultNavigationTitle(clientId) { 35790 const isDisabled = (0, import_element68.useContext)(import_components75.Disabled.Context); 35791 const area = useTemplatePartAreaLabel(isDisabled ? void 0 : clientId); 35792 const registry = (0, import_data67.useRegistry)(); 35793 return (0, import_element68.useCallback)(async () => { 35794 if (isDisabled) { 35795 return ""; 35796 } 35797 const { getEntityRecords } = registry.resolveSelect(import_core_data37.store); 35798 const [draftNavigationMenus, navigationMenus] = await Promise.all([ 35799 getEntityRecords(...DRAFT_MENU_PARAMS), 35800 getEntityRecords(...PUBLISHED_MENU_PARAMS) 35801 ]); 35802 const title = area ? (0, import_i18n122.sprintf)( 35803 // translators: %s: the name of a menu (e.g. Header menu). 35804 (0, import_i18n122.__)("%s menu"), 35805 area 35806 ) : ( 35807 // translators: 'menu' as in website navigation menu. 35808 (0, import_i18n122.__)("Menu") 35809 ); 35810 const matchingMenuTitleCount = [ 35811 ...draftNavigationMenus, 35812 ...navigationMenus 35813 ].reduce( 35814 (count, menu) => menu?.title?.raw?.startsWith(title) ? count + 1 : count, 35815 0 35816 ); 35817 const titleWithCount = matchingMenuTitleCount > 0 ? `$title} $matchingMenuTitleCount + 1}` : title; 35818 return titleWithCount || ""; 35819 }, [isDisabled, area, registry]); 35820 } 35821 35822 // packages/block-library/build-module/navigation/edit/use-create-navigation-menu.js 35823 var CREATE_NAVIGATION_MENU_SUCCESS = "success"; 35824 var CREATE_NAVIGATION_MENU_ERROR = "error"; 35825 var CREATE_NAVIGATION_MENU_PENDING = "pending"; 35826 var CREATE_NAVIGATION_MENU_IDLE = "idle"; 35827 function useCreateNavigationMenu(clientId) { 35828 const [status, setStatus] = (0, import_element69.useState)(CREATE_NAVIGATION_MENU_IDLE); 35829 const [value, setValue] = (0, import_element69.useState)(null); 35830 const [error, setError] = (0, import_element69.useState)(null); 35831 const { saveEntityRecord, editEntityRecord } = (0, import_data68.useDispatch)(import_core_data38.store); 35832 const generateDefaultTitle = useGenerateDefaultNavigationTitle(clientId); 35833 const create4 = (0, import_element69.useCallback)( 35834 async (title = null, blocks = [], postStatus) => { 35835 if (title && typeof title !== "string") { 35836 setError( 35837 "Invalid title supplied when creating Navigation Menu." 35838 ); 35839 setStatus(CREATE_NAVIGATION_MENU_ERROR); 35840 throw new Error( 35841 `Value of supplied title argument was not a string.` 35842 ); 35843 } 35844 setStatus(CREATE_NAVIGATION_MENU_PENDING); 35845 setValue(null); 35846 setError(null); 35847 if (!title) { 35848 title = await generateDefaultTitle().catch((err) => { 35849 setError(err?.message); 35850 setStatus(CREATE_NAVIGATION_MENU_ERROR); 35851 throw new Error( 35852 "Failed to create title when saving new Navigation Menu.", 35853 { 35854 cause: err 35855 } 35856 ); 35857 }); 35858 } 35859 const record = { 35860 title, 35861 content: (0, import_blocks58.serialize)(blocks), 35862 status: postStatus 35863 }; 35864 return saveEntityRecord("postType", "wp_navigation", record).then((response) => { 35865 setValue(response); 35866 setStatus(CREATE_NAVIGATION_MENU_SUCCESS); 35867 if (postStatus !== "publish") { 35868 editEntityRecord( 35869 "postType", 35870 "wp_navigation", 35871 response.id, 35872 { status: "publish" } 35873 ); 35874 } 35875 return response; 35876 }).catch((err) => { 35877 setError(err?.message); 35878 setStatus(CREATE_NAVIGATION_MENU_ERROR); 35879 throw new Error("Unable to save new Navigation Menu", { 35880 cause: err 35881 }); 35882 }); 35883 }, 35884 [saveEntityRecord, editEntityRecord, generateDefaultTitle] 35885 ); 35886 return { 35887 create: create4, 35888 status, 35889 value, 35890 error, 35891 isIdle: status === CREATE_NAVIGATION_MENU_IDLE, 35892 isPending: status === CREATE_NAVIGATION_MENU_PENDING, 35893 isSuccess: status === CREATE_NAVIGATION_MENU_SUCCESS, 35894 isError: status === CREATE_NAVIGATION_MENU_ERROR 35895 }; 35896 } 35897 35898 // packages/block-library/build-module/navigation/edit/use-inner-blocks.js 35899 var import_data69 = __toESM(require_data()); 35900 var import_block_editor142 = __toESM(require_block_editor()); 35901 var EMPTY_ARRAY2 = []; 35902 function useInnerBlocks(clientId) { 35903 return (0, import_data69.useSelect)( 35904 (select9) => { 35905 const { getBlock, getBlocks, hasSelectedInnerBlock } = select9(import_block_editor142.store); 35906 const _uncontrolledInnerBlocks = getBlock(clientId).innerBlocks; 35907 const _hasUncontrolledInnerBlocks = !!_uncontrolledInnerBlocks?.length; 35908 const _controlledInnerBlocks = _hasUncontrolledInnerBlocks ? EMPTY_ARRAY2 : getBlocks(clientId); 35909 return { 35910 innerBlocks: _hasUncontrolledInnerBlocks ? _uncontrolledInnerBlocks : _controlledInnerBlocks, 35911 hasUncontrolledInnerBlocks: _hasUncontrolledInnerBlocks, 35912 uncontrolledInnerBlocks: _uncontrolledInnerBlocks, 35913 controlledInnerBlocks: _controlledInnerBlocks, 35914 isInnerBlockSelected: hasSelectedInnerBlock(clientId, true) 35915 }; 35916 }, 35917 [clientId] 35918 ); 35919 } 35920 35921 // packages/block-library/build-module/navigation/edit/manage-menus-button.js 35922 var import_url10 = __toESM(require_url()); 35923 var import_components76 = __toESM(require_components()); 35924 var import_i18n123 = __toESM(require_i18n()); 35925 var import_jsx_runtime302 = __toESM(require_jsx_runtime()); 35926 var ManageMenusButton = ({ 35927 className = "", 35928 disabled, 35929 isMenuItem = false 35930 }) => { 35931 let ComponentName = import_components76.Button; 35932 if (isMenuItem) { 35933 ComponentName = import_components76.MenuItem; 35934 } 35935 return /* @__PURE__ */ (0, import_jsx_runtime302.jsx)( 35936 ComponentName, 35937 { 35938 variant: "link", 35939 disabled, 35940 className, 35941 href: (0, import_url10.addQueryArgs)("edit.php", { 35942 post_type: "wp_navigation" 35943 }), 35944 children: (0, import_i18n123.__)("Manage menus") 35945 } 35946 ); 35947 }; 35948 var manage_menus_button_default = ManageMenusButton; 35949 35950 // packages/block-library/build-module/navigation/edit/menu-inspector-controls.js 35951 var import_block_editor150 = __toESM(require_block_editor()); 35952 var import_components83 = __toESM(require_components()); 35953 var import_data75 = __toESM(require_data()); 35954 var import_i18n132 = __toESM(require_i18n()); 35955 35956 // packages/block-library/build-module/navigation/edit/deleted-navigation-warning.js 35957 var import_block_editor143 = __toESM(require_block_editor()); 35958 var import_components77 = __toESM(require_components()); 35959 var import_i18n124 = __toESM(require_i18n()); 35960 var import_element70 = __toESM(require_element()); 35961 var import_jsx_runtime303 = __toESM(require_jsx_runtime()); 35962 function DeletedNavigationWarning({ onCreateNew, isNotice = false }) { 35963 const [isButtonDisabled, setIsButtonDisabled] = (0, import_element70.useState)(false); 35964 const handleButtonClick = () => { 35965 setIsButtonDisabled(true); 35966 onCreateNew(); 35967 }; 35968 const message = (0, import_element70.createInterpolateElement)( 35969 (0, import_i18n124.__)( 35970 "Navigation Menu has been deleted or is unavailable. <button>Create a new Menu?</button>" 35971 ), 35972 { 35973 button: /* @__PURE__ */ (0, import_jsx_runtime303.jsx)( 35974 import_components77.Button, 35975 { 35976 __next40pxDefaultSize: true, 35977 onClick: handleButtonClick, 35978 variant: "link", 35979 disabled: isButtonDisabled, 35980 accessibleWhenDisabled: true 35981 } 35982 ) 35983 } 35984 ); 35985 return isNotice ? /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(import_components77.Notice, { status: "warning", isDismissible: false, children: message }) : /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(import_block_editor143.Warning, { children: message }); 35986 } 35987 var deleted_navigation_warning_default = DeletedNavigationWarning; 35988 35989 // packages/block-library/build-module/navigation/edit/leaf-more-menu.js 35990 var import_blocks59 = __toESM(require_blocks()); 35991 var import_components78 = __toESM(require_components()); 35992 var import_data70 = __toESM(require_data()); 35993 var import_i18n125 = __toESM(require_i18n()); 35994 var import_block_editor144 = __toESM(require_block_editor()); 35995 var import_jsx_runtime304 = __toESM(require_jsx_runtime()); 35996 var POPOVER_PROPS = { 35997 className: "block-editor-block-settings-menu__popover", 35998 placement: "bottom-start" 35999 }; 36000 var BLOCKS_THAT_CAN_BE_CONVERTED_TO_SUBMENU = [ 36001 "core/navigation-link", 36002 "core/navigation-submenu" 36003 ]; 36004 function AddSubmenuItem({ 36005 block, 36006 onClose, 36007 expandedState, 36008 expand, 36009 setInsertedBlock 36010 }) { 36011 const { insertBlock, replaceBlock, replaceInnerBlocks } = (0, import_data70.useDispatch)(import_block_editor144.store); 36012 const clientId = block.clientId; 36013 const isDisabled = !BLOCKS_THAT_CAN_BE_CONVERTED_TO_SUBMENU.includes( 36014 block.name 36015 ); 36016 return /* @__PURE__ */ (0, import_jsx_runtime304.jsx)( 36017 import_components78.MenuItem, 36018 { 36019 icon: add_submenu_default, 36020 disabled: isDisabled, 36021 onClick: () => { 36022 const updateSelectionOnInsert = false; 36023 const newLink = (0, import_blocks59.createBlock)( 36024 DEFAULT_BLOCK5.name, 36025 DEFAULT_BLOCK5.attributes 36026 ); 36027 if (block.name === "core/navigation-submenu") { 36028 insertBlock( 36029 newLink, 36030 block.innerBlocks.length, 36031 clientId, 36032 updateSelectionOnInsert 36033 ); 36034 } else { 36035 const newSubmenu = (0, import_blocks59.createBlock)( 36036 "core/navigation-submenu", 36037 block.attributes, 36038 block.innerBlocks 36039 ); 36040 replaceBlock(clientId, newSubmenu); 36041 replaceInnerBlocks( 36042 newSubmenu.clientId, 36043 [newLink], 36044 updateSelectionOnInsert 36045 ); 36046 } 36047 setInsertedBlock(newLink); 36048 if (!expandedState[block.clientId]) { 36049 expand(block.clientId); 36050 } 36051 onClose(); 36052 }, 36053 children: (0, import_i18n125.__)("Add submenu link") 36054 } 36055 ); 36056 } 36057 function LeafMoreMenu(props) { 36058 const { block } = props; 36059 const { clientId } = block; 36060 const { moveBlocksDown, moveBlocksUp, removeBlocks } = (0, import_data70.useDispatch)(import_block_editor144.store); 36061 const removeLabel = (0, import_i18n125.sprintf)( 36062 /* translators: %s: block name */ 36063 (0, import_i18n125.__)("Remove %s"), 36064 (0, import_block_editor144.BlockTitle)({ clientId, maximumLength: 25 }) 36065 ); 36066 const rootClientId = (0, import_data70.useSelect)( 36067 (select9) => { 36068 const { getBlockRootClientId } = select9(import_block_editor144.store); 36069 return getBlockRootClientId(clientId); 36070 }, 36071 [clientId] 36072 ); 36073 return /* @__PURE__ */ (0, import_jsx_runtime304.jsx)( 36074 import_components78.DropdownMenu, 36075 { 36076 icon: more_vertical_default, 36077 label: (0, import_i18n125.__)("Options"), 36078 className: "block-editor-block-settings-menu", 36079 popoverProps: POPOVER_PROPS, 36080 noIcons: true, 36081 ...props, 36082 children: ({ onClose }) => /* @__PURE__ */ (0, import_jsx_runtime304.jsxs)(import_jsx_runtime304.Fragment, { children: [ 36083 /* @__PURE__ */ (0, import_jsx_runtime304.jsxs)(import_components78.MenuGroup, { children: [ 36084 /* @__PURE__ */ (0, import_jsx_runtime304.jsx)( 36085 import_components78.MenuItem, 36086 { 36087 icon: chevron_up_default, 36088 onClick: () => { 36089 moveBlocksUp([clientId], rootClientId); 36090 onClose(); 36091 }, 36092 children: (0, import_i18n125.__)("Move up") 36093 } 36094 ), 36095 /* @__PURE__ */ (0, import_jsx_runtime304.jsx)( 36096 import_components78.MenuItem, 36097 { 36098 icon: chevron_down_default, 36099 onClick: () => { 36100 moveBlocksDown([clientId], rootClientId); 36101 onClose(); 36102 }, 36103 children: (0, import_i18n125.__)("Move down") 36104 } 36105 ), 36106 /* @__PURE__ */ (0, import_jsx_runtime304.jsx)( 36107 AddSubmenuItem, 36108 { 36109 block, 36110 onClose, 36111 expandedState: props.expandedState, 36112 expand: props.expand, 36113 setInsertedBlock: props.setInsertedBlock 36114 } 36115 ) 36116 ] }), 36117 /* @__PURE__ */ (0, import_jsx_runtime304.jsx)(import_components78.MenuGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime304.jsx)( 36118 import_components78.MenuItem, 36119 { 36120 onClick: () => { 36121 removeBlocks([clientId], false); 36122 onClose(); 36123 }, 36124 children: removeLabel 36125 } 36126 ) }) 36127 ] }) 36128 } 36129 ); 36130 } 36131 36132 // packages/block-library/build-module/navigation-link/shared/controls.js 36133 var import_components82 = __toESM(require_components()); 36134 var import_i18n131 = __toESM(require_i18n()); 36135 var import_dom5 = __toESM(require_dom()); 36136 var import_block_editor149 = __toESM(require_block_editor()); 36137 var import_data74 = __toESM(require_data()); 36138 var import_core_data41 = __toESM(require_core_data()); 36139 36140 // packages/block-library/build-module/navigation-link/shared/use-handle-link-change.js 36141 var import_element71 = __toESM(require_element()); 36142 var import_data71 = __toESM(require_data()); 36143 var import_block_editor145 = __toESM(require_block_editor()); 36144 36145 // packages/block-library/build-module/navigation-link/shared/update-attributes.js 36146 var import_escape_html = __toESM(require_escape_html()); 36147 var import_url11 = __toESM(require_url()); 36148 var shouldSeverEntityLink = (originalUrl, newUrl) => { 36149 if (!originalUrl || !newUrl) { 36150 return false; 36151 } 36152 const normalizePath = (path) => { 36153 if (!path) { 36154 return ""; 36155 } 36156 return path.replace(/\/+$/, ""); 36157 }; 36158 const createUrlObject = (url, baseUrl = null) => { 36159 try { 36160 const base = baseUrl || (typeof window !== "undefined" ? window.location.origin : "https://wordpress.org"); 36161 return new URL(url, base); 36162 } catch (error) { 36163 return null; 36164 } 36165 }; 36166 const originalUrlObj = createUrlObject(originalUrl); 36167 if (!originalUrlObj) { 36168 return true; 36169 } 36170 const newUrlObj = createUrlObject(newUrl, originalUrl); 36171 if (!newUrlObj) { 36172 return true; 36173 } 36174 const originalHostname = originalUrlObj.hostname; 36175 const newHostname = newUrlObj.hostname; 36176 const originalPath = normalizePath((0, import_url11.getPath)(originalUrlObj.toString())); 36177 const newPath = normalizePath((0, import_url11.getPath)(newUrlObj.toString())); 36178 if (originalHostname !== newHostname || originalPath !== newPath) { 36179 return true; 36180 } 36181 const originalP = originalUrlObj.searchParams.get("p"); 36182 const newP = newUrlObj.searchParams.get("p"); 36183 if (originalP && newP && originalP !== newP) { 36184 return true; 36185 } 36186 const originalPageId = originalUrlObj.searchParams.get("page_id"); 36187 const newPageId = newUrlObj.searchParams.get("page_id"); 36188 if (originalPageId && newPageId && originalPageId !== newPageId) { 36189 return true; 36190 } 36191 if (originalP && newPageId || originalPageId && newP) { 36192 return true; 36193 } 36194 return false; 36195 }; 36196 var updateAttributes = (updatedValue = {}, setAttributes, blockAttributes8 = {}) => { 36197 const { 36198 label: originalLabel = "", 36199 kind: originalKind = "", 36200 type: originalType = "" 36201 } = blockAttributes8; 36202 const { 36203 title: newLabel = "", 36204 // the title of any provided Post. 36205 label: newLabelFromLabel = "", 36206 // alternative to title 36207 url: newUrl, 36208 opensInNewTab, 36209 id: newID, 36210 kind: newKind = originalKind, 36211 type: newType = originalType 36212 } = updatedValue; 36213 const finalNewLabel = newLabel || newLabelFromLabel; 36214 const newLabelWithoutHttp = finalNewLabel.replace(/http(s?):\/\//gi, ""); 36215 const newUrlWithoutHttp = newUrl?.replace(/http(s?):\/\//gi, "") ?? ""; 36216 const useNewLabel = finalNewLabel && finalNewLabel !== originalLabel && // LinkControl without the title field relies 36217 // on the check below. Specifically, it assumes that 36218 // the URL is the same as a title. 36219 // This logic a) looks suspicious and b) should really 36220 // live in the LinkControl and not here. It's a great 36221 // candidate for future refactoring. 36222 newLabelWithoutHttp !== newUrlWithoutHttp; 36223 const label = useNewLabel ? (0, import_escape_html.escapeHTML)(finalNewLabel) : originalLabel || (0, import_escape_html.escapeHTML)(newUrlWithoutHttp); 36224 const type = newType === "post_tag" ? "tag" : newType.replace("-", "_"); 36225 const isBuiltInType = ["post", "page", "tag", "category"].indexOf(type) > -1; 36226 const isCustomLink = !newKind && !isBuiltInType || newKind === "custom"; 36227 const kind = isCustomLink ? "custom" : newKind; 36228 const attributes3 = { 36229 // Passed `url` may already be encoded. To prevent double encoding, decodeURI is executed to revert to the original string. 36230 ...newUrl !== void 0 ? { url: newUrl ? encodeURI((0, import_url11.safeDecodeURI)(newUrl)) : newUrl } : {}, 36231 ...label && { label }, 36232 ...void 0 !== opensInNewTab && { opensInNewTab }, 36233 ...kind && { kind }, 36234 ...type && type !== "URL" && { type } 36235 }; 36236 if (newUrl && !newID && blockAttributes8.id) { 36237 const shouldSever = shouldSeverEntityLink( 36238 blockAttributes8.url, 36239 newUrl 36240 ); 36241 if (shouldSever) { 36242 attributes3.id = void 0; 36243 attributes3.kind = "custom"; 36244 attributes3.type = "custom"; 36245 } 36246 } else if (newID && Number.isInteger(newID)) { 36247 attributes3.id = newID; 36248 } else if (blockAttributes8.id) { 36249 attributes3.kind = kind; 36250 attributes3.type = type; 36251 } 36252 setAttributes(attributes3); 36253 const finalId = "id" in attributes3 ? attributes3.id : blockAttributes8.id; 36254 const finalKind = "kind" in attributes3 ? attributes3.kind : blockAttributes8.kind; 36255 return { 36256 isEntityLink: !!finalId && finalKind !== "custom", 36257 attributes: attributes3 36258 // Return the computed attributes object 36259 }; 36260 }; 36261 36262 // packages/block-library/build-module/navigation-link/shared/use-handle-link-change.js 36263 function useHandleLinkChange({ clientId, attributes: attributes3, setAttributes }) { 36264 const { updateBlockAttributes } = (0, import_data71.useDispatch)(import_block_editor145.store); 36265 const { hasUrlBinding, createBinding, clearBinding } = useEntityBinding({ 36266 clientId, 36267 attributes: attributes3 36268 }); 36269 return (0, import_element71.useCallback)( 36270 (updatedLink) => { 36271 if (!updatedLink) { 36272 return; 36273 } 36274 const attrs = { 36275 url: updatedLink.url, 36276 kind: updatedLink.kind, 36277 type: updatedLink.type, 36278 id: updatedLink.id 36279 }; 36280 if (!attributes3.label || attributes3.label === "") { 36281 attrs.title = updatedLink.title; 36282 } 36283 const willBeCustomLink = !updatedLink.id && hasUrlBinding; 36284 if (willBeCustomLink) { 36285 clearBinding(); 36286 updateBlockAttributes(clientId, { 36287 url: updatedLink.url, 36288 kind: "custom", 36289 type: "custom", 36290 id: void 0 36291 }); 36292 } else { 36293 const { isEntityLink, attributes: updatedAttributes } = updateAttributes(attrs, setAttributes, attributes3); 36294 if (isEntityLink) { 36295 createBinding(updatedAttributes); 36296 } else { 36297 clearBinding(); 36298 } 36299 } 36300 }, 36301 [ 36302 attributes3, 36303 clientId, 36304 hasUrlBinding, 36305 createBinding, 36306 clearBinding, 36307 setAttributes, 36308 updateBlockAttributes 36309 ] 36310 ); 36311 } 36312 36313 // packages/block-library/build-module/navigation-link/link-ui/index.js 36314 var import_dom4 = __toESM(require_dom()); 36315 var import_components81 = __toESM(require_components()); 36316 var import_i18n129 = __toESM(require_i18n()); 36317 var import_block_editor147 = __toESM(require_block_editor()); 36318 var import_element73 = __toESM(require_element()); 36319 var import_core_data40 = __toESM(require_core_data()); 36320 var import_compose28 = __toESM(require_compose()); 36321 36322 // packages/block-library/build-module/navigation-link/link-ui/page-creator.js 36323 var import_components80 = __toESM(require_components()); 36324 var import_i18n127 = __toESM(require_i18n()); 36325 var import_data72 = __toESM(require_data()); 36326 var import_core_data39 = __toESM(require_core_data()); 36327 var import_notices13 = __toESM(require_notices()); 36328 var import_html_entities5 = __toESM(require_html_entities()); 36329 var import_element72 = __toESM(require_element()); 36330 36331 // packages/block-library/build-module/navigation-link/link-ui/dialog-wrapper.js 36332 var import_components79 = __toESM(require_components()); 36333 var import_i18n126 = __toESM(require_i18n()); 36334 var import_compose27 = __toESM(require_compose()); 36335 var import_jsx_runtime305 = __toESM(require_jsx_runtime()); 36336 function BackButton({ className, onBack }) { 36337 return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)( 36338 import_components79.Button, 36339 { 36340 className, 36341 icon: (0, import_i18n126.isRTL)() ? chevron_right_small_default : chevron_left_small_default, 36342 onClick: (e2) => { 36343 e2.preventDefault(); 36344 onBack(); 36345 }, 36346 size: "small", 36347 children: (0, import_i18n126.__)("Back") 36348 } 36349 ); 36350 } 36351 function DialogWrapper({ className, title, description, onBack, children }) { 36352 const dialogTitleId = (0, import_compose27.useInstanceId)( 36353 DialogWrapper, 36354 "link-ui-dialog-title" 36355 ); 36356 const dialogDescriptionId = (0, import_compose27.useInstanceId)( 36357 DialogWrapper, 36358 "link-ui-dialog-description" 36359 ); 36360 const focusOnMountRef = (0, import_compose27.useFocusOnMount)("firstElement"); 36361 const backButtonClassName = `$className}__back`; 36362 return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)( 36363 "div", 36364 { 36365 className, 36366 role: "dialog", 36367 "aria-labelledby": dialogTitleId, 36368 "aria-describedby": dialogDescriptionId, 36369 ref: focusOnMountRef, 36370 children: [ 36371 /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)(import_components79.VisuallyHidden, { children: [ 36372 /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("h2", { id: dialogTitleId, children: title }), 36373 /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("p", { id: dialogDescriptionId, children: description }) 36374 ] }), 36375 /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(BackButton, { className: backButtonClassName, onBack }), 36376 children 36377 ] 36378 } 36379 ); 36380 } 36381 var dialog_wrapper_default = DialogWrapper; 36382 36383 // packages/block-library/build-module/navigation-link/link-ui/page-creator.js 36384 var import_jsx_runtime306 = __toESM(require_jsx_runtime()); 36385 function LinkUIPageCreator({ 36386 postType, 36387 onBack, 36388 onPageCreated, 36389 initialTitle = "" 36390 }) { 36391 const [title, setTitle] = (0, import_element72.useState)(initialTitle); 36392 const [shouldPublish, setShouldPublish] = (0, import_element72.useState)(false); 36393 const isTitleValid = title.trim().length > 0; 36394 const { lastError, isSaving } = (0, import_data72.useSelect)( 36395 (select9) => ({ 36396 lastError: select9(import_core_data39.store).getLastEntitySaveError( 36397 "postType", 36398 postType 36399 ), 36400 isSaving: select9(import_core_data39.store).isSavingEntityRecord( 36401 "postType", 36402 postType 36403 ) 36404 }), 36405 [postType] 36406 ); 36407 const { saveEntityRecord } = (0, import_data72.useDispatch)(import_core_data39.store); 36408 const { createSuccessNotice, createErrorNotice } = (0, import_data72.useDispatch)(import_notices13.store); 36409 async function createPage(event) { 36410 event.preventDefault(); 36411 if (isSaving || !isTitleValid) { 36412 return; 36413 } 36414 try { 36415 const savedRecord = await saveEntityRecord( 36416 "postType", 36417 postType, 36418 { 36419 title, 36420 status: shouldPublish ? "publish" : "draft" 36421 }, 36422 { throwOnError: true } 36423 ); 36424 if (savedRecord) { 36425 const pageLink = { 36426 id: savedRecord.id, 36427 type: postType, 36428 title: (0, import_html_entities5.decodeEntities)(savedRecord.title.rendered), 36429 url: savedRecord.link, 36430 kind: "post-type" 36431 }; 36432 createSuccessNotice( 36433 (0, import_i18n127.sprintf)( 36434 // translators: %s: the name of the new page being created. 36435 (0, import_i18n127.__)("%s page created successfully."), 36436 (0, import_html_entities5.decodeEntities)(savedRecord.title.rendered) 36437 ), 36438 { 36439 type: "snackbar", 36440 id: "page-created-success" 36441 } 36442 ); 36443 onPageCreated(pageLink); 36444 } 36445 } catch (error) { 36446 createErrorNotice( 36447 (0, import_i18n127.__)("Failed to create page. Please try again."), 36448 { 36449 type: "snackbar", 36450 id: "page-created-error" 36451 } 36452 ); 36453 } 36454 } 36455 const isSubmitDisabled = isSaving || !isTitleValid; 36456 return /* @__PURE__ */ (0, import_jsx_runtime306.jsx)( 36457 dialog_wrapper_default, 36458 { 36459 className: "link-ui-page-creator", 36460 title: (0, import_i18n127.__)("Create page"), 36461 description: (0, import_i18n127.__)("Create a new page to add to your Navigation."), 36462 onBack, 36463 children: /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(import_components80.__experimentalVStack, { className: "link-ui-page-creator__inner", spacing: 4, children: /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("form", { onSubmit: createPage, children: /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)(import_components80.__experimentalVStack, { spacing: 4, children: [ 36464 /* @__PURE__ */ (0, import_jsx_runtime306.jsx)( 36465 import_components80.TextControl, 36466 { 36467 __next40pxDefaultSize: true, 36468 label: (0, import_i18n127.__)("Title"), 36469 onChange: setTitle, 36470 placeholder: (0, import_i18n127.__)("No title"), 36471 value: title 36472 } 36473 ), 36474 /* @__PURE__ */ (0, import_jsx_runtime306.jsx)( 36475 import_components80.CheckboxControl, 36476 { 36477 label: (0, import_i18n127.__)("Publish immediately"), 36478 help: (0, import_i18n127.__)( 36479 "If unchecked, the page will be created as a draft." 36480 ), 36481 checked: shouldPublish, 36482 onChange: setShouldPublish 36483 } 36484 ), 36485 lastError && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(import_components80.Notice, { status: "error", isDismissible: false, children: lastError.message }), 36486 /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)(import_components80.__experimentalHStack, { spacing: 2, justify: "flex-end", children: [ 36487 /* @__PURE__ */ (0, import_jsx_runtime306.jsx)( 36488 import_components80.Button, 36489 { 36490 __next40pxDefaultSize: true, 36491 variant: "tertiary", 36492 onClick: onBack, 36493 disabled: isSaving, 36494 accessibleWhenDisabled: true, 36495 children: (0, import_i18n127.__)("Cancel") 36496 } 36497 ), 36498 /* @__PURE__ */ (0, import_jsx_runtime306.jsx)( 36499 import_components80.Button, 36500 { 36501 __next40pxDefaultSize: true, 36502 variant: "primary", 36503 type: "submit", 36504 isBusy: isSaving, 36505 "aria-disabled": isSubmitDisabled, 36506 children: (0, import_i18n127.__)("Create page") 36507 } 36508 ) 36509 ] }) 36510 ] }) }) }) 36511 } 36512 ); 36513 } 36514 36515 // packages/block-library/build-module/navigation-link/link-ui/block-inserter.js 36516 var import_i18n128 = __toESM(require_i18n()); 36517 var import_data73 = __toESM(require_data()); 36518 var import_block_editor146 = __toESM(require_block_editor()); 36519 var import_jsx_runtime307 = __toESM(require_jsx_runtime()); 36520 var { PrivateQuickInserter: QuickInserter } = unlock( 36521 import_block_editor146.privateApis 36522 ); 36523 function LinkUIBlockInserter({ clientId, onBack, onBlockInsert }) { 36524 const { rootBlockClientId } = (0, import_data73.useSelect)( 36525 (select9) => { 36526 const { getBlockRootClientId } = select9(import_block_editor146.store); 36527 return { 36528 rootBlockClientId: getBlockRootClientId(clientId) 36529 }; 36530 }, 36531 [clientId] 36532 ); 36533 if (!clientId) { 36534 return null; 36535 } 36536 return /* @__PURE__ */ (0, import_jsx_runtime307.jsx)( 36537 dialog_wrapper_default, 36538 { 36539 className: "link-ui-block-inserter", 36540 title: (0, import_i18n128.__)("Add block"), 36541 description: (0, import_i18n128.__)("Choose a block to add to your Navigation."), 36542 onBack, 36543 children: /* @__PURE__ */ (0, import_jsx_runtime307.jsx)( 36544 QuickInserter, 36545 { 36546 rootClientId: rootBlockClientId, 36547 clientId, 36548 isAppender: false, 36549 prioritizePatterns: false, 36550 selectBlockOnInsert: !onBlockInsert, 36551 onSelect: onBlockInsert ? onBlockInsert : void 0, 36552 hasSearch: false 36553 } 36554 ) 36555 } 36556 ); 36557 } 36558 var block_inserter_default = LinkUIBlockInserter; 36559 36560 // packages/block-library/build-module/navigation-link/link-ui/index.js 36561 var import_jsx_runtime308 = __toESM(require_jsx_runtime()); 36562 function getSuggestionsQuery(type, kind) { 36563 switch (type) { 36564 case "post": 36565 case "page": 36566 return { type: "post", subtype: type }; 36567 case "category": 36568 return { type: "term", subtype: "category" }; 36569 case "tag": 36570 return { type: "term", subtype: "post_tag" }; 36571 case "post_format": 36572 return { type: "post-format" }; 36573 default: 36574 if (kind === "taxonomy") { 36575 return { type: "term", subtype: type }; 36576 } 36577 if (kind === "post-type") { 36578 return { type: "post", subtype: type }; 36579 } 36580 return { 36581 // for custom link which has no type 36582 // always show pages as initial suggestions 36583 initialSuggestionsSearchOptions: { 36584 type: "post", 36585 subtype: "page", 36586 perPage: 20 36587 } 36588 }; 36589 } 36590 } 36591 function UnforwardedLinkUI(props, ref) { 36592 const { label, url, opensInNewTab, type, kind, id } = props.link; 36593 const { clientId } = props; 36594 const postType = type || "page"; 36595 const [addingBlock, setAddingBlock] = (0, import_element73.useState)(false); 36596 const [addingPage, setAddingPage] = (0, import_element73.useState)(false); 36597 const [shouldFocusPane, setShouldFocusPane] = (0, import_element73.useState)(null); 36598 const linkControlWrapperRef = (0, import_element73.useRef)(); 36599 const addPageButtonRef = (0, import_element73.useRef)(); 36600 const addBlockButtonRef = (0, import_element73.useRef)(); 36601 const permissions = (0, import_core_data40.useResourcePermissions)({ 36602 kind: "postType", 36603 name: postType 36604 }); 36605 const { isBoundEntityAvailable } = useEntityBinding({ 36606 clientId, 36607 attributes: props.link 36608 }); 36609 const link = (0, import_element73.useMemo)( 36610 () => ({ 36611 url, 36612 opensInNewTab, 36613 title: label && (0, import_dom4.__unstableStripHTML)(label), 36614 kind, 36615 type, 36616 id 36617 }), 36618 [label, opensInNewTab, url, kind, type, id] 36619 ); 36620 const handlePageCreated = (pageLink) => { 36621 props.onChange(pageLink); 36622 setAddingPage(false); 36623 setShouldFocusPane(true); 36624 }; 36625 const dialogTitleId = (0, import_compose28.useInstanceId)( 36626 LinkUI, 36627 "link-ui-link-control__title" 36628 ); 36629 const dialogDescriptionId = (0, import_compose28.useInstanceId)( 36630 LinkUI, 36631 "link-ui-link-control__description" 36632 ); 36633 (0, import_element73.useEffect)(() => { 36634 if (shouldFocusPane && linkControlWrapperRef.current) { 36635 if (shouldFocusPane?.current) { 36636 shouldFocusPane.current.focus(); 36637 } else { 36638 const tabbableElements = import_dom4.focus.tabbable.find( 36639 linkControlWrapperRef.current 36640 ); 36641 const nextFocusTarget = tabbableElements[0] || linkControlWrapperRef.current; 36642 nextFocusTarget.focus(); 36643 } 36644 setShouldFocusPane(false); 36645 } 36646 }, [shouldFocusPane]); 36647 const blockEditingMode = (0, import_block_editor147.useBlockEditingMode)(); 36648 return /* @__PURE__ */ (0, import_jsx_runtime308.jsxs)( 36649 import_components81.Popover, 36650 { 36651 ref, 36652 placement: "bottom", 36653 onClose: props.onClose, 36654 anchor: props.anchor, 36655 shift: true, 36656 children: [ 36657 !addingBlock && !addingPage && /* @__PURE__ */ (0, import_jsx_runtime308.jsxs)( 36658 "div", 36659 { 36660 ref: linkControlWrapperRef, 36661 role: "dialog", 36662 "aria-labelledby": dialogTitleId, 36663 "aria-describedby": dialogDescriptionId, 36664 children: [ 36665 /* @__PURE__ */ (0, import_jsx_runtime308.jsxs)(import_components81.VisuallyHidden, { children: [ 36666 /* @__PURE__ */ (0, import_jsx_runtime308.jsx)("h2", { id: dialogTitleId, children: (0, import_i18n129.__)("Add link") }), 36667 /* @__PURE__ */ (0, import_jsx_runtime308.jsx)("p", { id: dialogDescriptionId, children: (0, import_i18n129.__)( 36668 "Search for and add a link to your Navigation." 36669 ) }) 36670 ] }), 36671 /* @__PURE__ */ (0, import_jsx_runtime308.jsx)( 36672 import_block_editor147.LinkControl, 36673 { 36674 hasTextControl: true, 36675 hasRichPreviews: true, 36676 value: link, 36677 showInitialSuggestions: true, 36678 withCreateSuggestion: false, 36679 noDirectEntry: !!type, 36680 noURLSuggestion: !!type, 36681 suggestionsQuery: getSuggestionsQuery(type, kind), 36682 onChange: props.onChange, 36683 onRemove: props.onRemove, 36684 onCancel: props.onCancel, 36685 handleEntities: isBoundEntityAvailable, 36686 forceIsEditingLink: link?.url ? false : void 0, 36687 renderControlBottom: () => { 36688 if (link?.url?.length) { 36689 return null; 36690 } 36691 return /* @__PURE__ */ (0, import_jsx_runtime308.jsx)( 36692 LinkUITools, 36693 { 36694 addPageButtonRef, 36695 addBlockButtonRef, 36696 setAddingBlock: () => { 36697 setAddingBlock(true); 36698 }, 36699 setAddingPage: () => { 36700 setAddingPage(true); 36701 }, 36702 canAddPage: permissions?.canCreate && type === "page", 36703 canAddBlock: blockEditingMode === "default" 36704 } 36705 ); 36706 } 36707 } 36708 ) 36709 ] 36710 } 36711 ), 36712 addingBlock && /* @__PURE__ */ (0, import_jsx_runtime308.jsx)( 36713 block_inserter_default, 36714 { 36715 clientId: props.clientId, 36716 onBack: () => { 36717 setAddingBlock(false); 36718 setShouldFocusPane(addBlockButtonRef); 36719 }, 36720 onBlockInsert: props?.onBlockInsert 36721 } 36722 ), 36723 addingPage && /* @__PURE__ */ (0, import_jsx_runtime308.jsx)( 36724 LinkUIPageCreator, 36725 { 36726 postType, 36727 onBack: () => { 36728 setAddingPage(false); 36729 setShouldFocusPane(addPageButtonRef); 36730 }, 36731 onPageCreated: handlePageCreated, 36732 initialTitle: link?.url || "" 36733 } 36734 ) 36735 ] 36736 } 36737 ); 36738 } 36739 var LinkUI = (0, import_element73.forwardRef)(UnforwardedLinkUI); 36740 var LinkUITools = ({ 36741 addPageButtonRef, 36742 addBlockButtonRef, 36743 setAddingBlock, 36744 setAddingPage, 36745 canAddPage, 36746 canAddBlock 36747 }) => { 36748 const blockInserterAriaRole = "listbox"; 36749 if (!canAddPage && !canAddBlock) { 36750 return null; 36751 } 36752 return /* @__PURE__ */ (0, import_jsx_runtime308.jsxs)(import_components81.__experimentalVStack, { spacing: 0, className: "link-ui-tools", children: [ 36753 canAddPage && /* @__PURE__ */ (0, import_jsx_runtime308.jsx)( 36754 import_components81.Button, 36755 { 36756 __next40pxDefaultSize: true, 36757 ref: addPageButtonRef, 36758 icon: plus_default, 36759 onClick: (e2) => { 36760 e2.preventDefault(); 36761 setAddingPage(true); 36762 }, 36763 "aria-haspopup": blockInserterAriaRole, 36764 children: (0, import_i18n129.__)("Create page") 36765 } 36766 ), 36767 canAddBlock && /* @__PURE__ */ (0, import_jsx_runtime308.jsx)( 36768 import_components81.Button, 36769 { 36770 __next40pxDefaultSize: true, 36771 ref: addBlockButtonRef, 36772 icon: plus_default, 36773 onClick: (e2) => { 36774 e2.preventDefault(); 36775 setAddingBlock(true); 36776 }, 36777 "aria-haspopup": blockInserterAriaRole, 36778 children: (0, import_i18n129.__)("Add block") 36779 } 36780 ) 36781 ] }); 36782 }; 36783 36784 // packages/block-library/build-module/navigation-link/shared/use-link-preview.js 36785 var import_i18n130 = __toESM(require_i18n()); 36786 var import_url12 = __toESM(require_url()); 36787 var import_block_editor148 = __toESM(require_block_editor()); 36788 var { useRemoteUrlData } = unlock(import_block_editor148.privateApis); 36789 function capitalize(str) { 36790 return str.charAt(0).toUpperCase() + str.slice(1); 36791 } 36792 function computeDisplayUrl(url) { 36793 if (!url) { 36794 return { displayUrl: "", isExternal: false }; 36795 } 36796 let displayUrl = (0, import_url12.safeDecodeURI)(url); 36797 let isExternal = false; 36798 try { 36799 const linkUrl = new URL(url); 36800 const siteUrl = window.location.origin; 36801 if (linkUrl.origin === siteUrl) { 36802 let path = linkUrl.pathname + linkUrl.search + linkUrl.hash; 36803 if (path.endsWith("/") && path.length > 1) { 36804 path = path.slice(0, -1); 36805 } 36806 displayUrl = path; 36807 } else { 36808 isExternal = true; 36809 } 36810 } catch (e2) { 36811 displayUrl = (0, import_url12.safeDecodeURI)(url); 36812 } 36813 return { displayUrl, isExternal }; 36814 } 36815 function computeBadges({ 36816 url, 36817 type, 36818 isExternal, 36819 entityStatus, 36820 hasBinding, 36821 isEntityAvailable 36822 }) { 36823 const badges = []; 36824 if (url) { 36825 if (isExternal) { 36826 badges.push({ 36827 label: (0, import_i18n130.__)("External link"), 36828 intent: "default" 36829 }); 36830 } else if (type) { 36831 badges.push({ label: capitalize(type), intent: "default" }); 36832 } 36833 } 36834 if (!url) { 36835 badges.push({ label: (0, import_i18n130.__)("No link selected"), intent: "error" }); 36836 } else if (hasBinding && !isEntityAvailable) { 36837 badges.push({ label: (0, import_i18n130.__)("Deleted"), intent: "error" }); 36838 } else if (entityStatus) { 36839 const statusMap = { 36840 publish: { label: (0, import_i18n130.__)("Published"), intent: "success" }, 36841 future: { label: (0, import_i18n130.__)("Scheduled"), intent: "warning" }, 36842 draft: { label: (0, import_i18n130.__)("Draft"), intent: "warning" }, 36843 pending: { label: (0, import_i18n130.__)("Pending"), intent: "warning" }, 36844 private: { label: (0, import_i18n130.__)("Private"), intent: "default" }, 36845 trash: { label: (0, import_i18n130.__)("Trash"), intent: "error" } 36846 }; 36847 const badge = statusMap[entityStatus]; 36848 if (badge) { 36849 badges.push(badge); 36850 } 36851 } 36852 return badges; 36853 } 36854 function useLinkPreview({ 36855 url, 36856 title, 36857 image, 36858 type, 36859 entityStatus, 36860 hasBinding, 36861 isEntityAvailable 36862 }) { 36863 const { richData } = useRemoteUrlData(title ? null : url); 36864 const { displayUrl, isExternal } = computeDisplayUrl(url); 36865 const badges = computeBadges({ 36866 url, 36867 type, 36868 isExternal, 36869 entityStatus, 36870 hasBinding, 36871 isEntityAvailable 36872 }); 36873 const displayTitle = url ? title || richData?.title || (0, import_url12.safeDecodeURI)(url) : (0, import_i18n130.__)("Add link"); 36874 return { 36875 title: displayTitle, 36876 url: displayUrl, 36877 image, 36878 badges 36879 }; 36880 } 36881 36882 // packages/block-library/build-module/navigation-link/shared/controls.js 36883 var import_jsx_runtime309 = __toESM(require_jsx_runtime()); 36884 var { LinkPicker } = unlock(import_block_editor149.privateApis); 36885 function getEntityTypeName(type, kind) { 36886 if (kind === "post-type") { 36887 switch (type) { 36888 case "post": 36889 return (0, import_i18n131.__)("post"); 36890 case "page": 36891 return (0, import_i18n131.__)("page"); 36892 default: 36893 return type || (0, import_i18n131.__)("post"); 36894 } 36895 } 36896 if (kind === "taxonomy") { 36897 switch (type) { 36898 case "category": 36899 return (0, import_i18n131.__)("category"); 36900 case "tag": 36901 return (0, import_i18n131.__)("tag"); 36902 default: 36903 return type || (0, import_i18n131.__)("term"); 36904 } 36905 } 36906 return type || (0, import_i18n131.__)("item"); 36907 } 36908 function Controls2({ attributes: attributes3, setAttributes, clientId }) { 36909 const { label, url, description, rel, opensInNewTab } = attributes3; 36910 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 36911 const { hasUrlBinding, isBoundEntityAvailable, entityRecord } = useEntityBinding({ 36912 clientId, 36913 attributes: attributes3 36914 }); 36915 const needsHelpText = hasUrlBinding; 36916 const helpText = isBoundEntityAvailable ? BindingHelpText({ 36917 type: attributes3.type, 36918 kind: attributes3.kind 36919 }) : MissingEntityHelpText({ 36920 type: attributes3.type, 36921 kind: attributes3.kind 36922 }); 36923 const handleLinkChange = useHandleLinkChange({ 36924 clientId, 36925 attributes: attributes3, 36926 setAttributes 36927 }); 36928 const linkTitle = entityRecord?.title?.rendered || entityRecord?.title || entityRecord?.name; 36929 const linkImage = (0, import_data74.useSelect)( 36930 (select9) => { 36931 if (!entityRecord?.featured_media) { 36932 return null; 36933 } 36934 const { getEntityRecord } = select9(import_core_data41.store); 36935 const media = getEntityRecord( 36936 "postType", 36937 "attachment", 36938 entityRecord.featured_media 36939 ); 36940 return media?.media_details?.sizes?.thumbnail?.source_url || media?.media_details?.sizes?.medium?.source_url || media?.source_url || null; 36941 }, 36942 [entityRecord?.featured_media] 36943 ); 36944 const preview = useLinkPreview({ 36945 url, 36946 title: linkTitle, 36947 image: linkImage, 36948 type: attributes3.type, 36949 entityStatus: entityRecord?.status, 36950 hasBinding: hasUrlBinding, 36951 isEntityAvailable: isBoundEntityAvailable 36952 }); 36953 return /* @__PURE__ */ (0, import_jsx_runtime309.jsxs)( 36954 import_components82.__experimentalToolsPanel, 36955 { 36956 label: (0, import_i18n131.__)("Settings"), 36957 resetAll: () => { 36958 setAttributes({ 36959 label: "", 36960 url: "", 36961 description: "", 36962 rel: "", 36963 opensInNewTab: false 36964 }); 36965 }, 36966 dropdownMenuProps, 36967 children: [ 36968 /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 36969 import_components82.__experimentalToolsPanelItem, 36970 { 36971 hasValue: () => !!label, 36972 label: (0, import_i18n131.__)("Text"), 36973 onDeselect: () => setAttributes({ label: "" }), 36974 isShownByDefault: true, 36975 children: /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 36976 import_components82.TextControl, 36977 { 36978 __next40pxDefaultSize: true, 36979 label: (0, import_i18n131.__)("Text"), 36980 value: label ? (0, import_dom5.__unstableStripHTML)(label) : "", 36981 onChange: (labelValue) => { 36982 setAttributes({ label: labelValue }); 36983 }, 36984 autoComplete: "off" 36985 } 36986 ) 36987 } 36988 ), 36989 /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 36990 import_components82.__experimentalToolsPanelItem, 36991 { 36992 hasValue: () => !!url, 36993 label: (0, import_i18n131.__)("Link to"), 36994 onDeselect: () => setAttributes({ url: "" }), 36995 isShownByDefault: true, 36996 children: /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 36997 LinkPicker, 36998 { 36999 preview, 37000 onSelect: handleLinkChange, 37001 suggestionsQuery: getSuggestionsQuery( 37002 attributes3.type, 37003 attributes3.kind 37004 ), 37005 label: (0, import_i18n131.__)("Link to"), 37006 help: needsHelpText ? helpText : void 0 37007 } 37008 ) 37009 } 37010 ), 37011 /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 37012 import_components82.__experimentalToolsPanelItem, 37013 { 37014 hasValue: () => !!opensInNewTab, 37015 label: (0, import_i18n131.__)("Open in new tab"), 37016 onDeselect: () => setAttributes({ opensInNewTab: false }), 37017 isShownByDefault: true, 37018 children: /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 37019 import_components82.CheckboxControl, 37020 { 37021 label: (0, import_i18n131.__)("Open in new tab"), 37022 checked: opensInNewTab, 37023 onChange: (value) => setAttributes({ opensInNewTab: value }) 37024 } 37025 ) 37026 } 37027 ), 37028 /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 37029 import_components82.__experimentalToolsPanelItem, 37030 { 37031 hasValue: () => !!description, 37032 label: (0, import_i18n131.__)("Description"), 37033 onDeselect: () => setAttributes({ description: "" }), 37034 isShownByDefault: true, 37035 children: /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 37036 import_components82.TextareaControl, 37037 { 37038 label: (0, import_i18n131.__)("Description"), 37039 value: description || "", 37040 onChange: (descriptionValue) => { 37041 setAttributes({ description: descriptionValue }); 37042 }, 37043 help: (0, import_i18n131.__)( 37044 "The description will be displayed in the menu if the current theme supports it." 37045 ) 37046 } 37047 ) 37048 } 37049 ), 37050 /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 37051 import_components82.__experimentalToolsPanelItem, 37052 { 37053 hasValue: () => !!rel, 37054 label: (0, import_i18n131.__)("Rel attribute"), 37055 onDeselect: () => setAttributes({ rel: "" }), 37056 isShownByDefault: true, 37057 children: /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 37058 import_components82.TextControl, 37059 { 37060 __next40pxDefaultSize: true, 37061 label: (0, import_i18n131.__)("Rel attribute"), 37062 value: rel || "", 37063 onChange: (relValue) => { 37064 setAttributes({ rel: relValue }); 37065 }, 37066 autoComplete: "off", 37067 help: (0, import_i18n131.__)( 37068 "The relationship of the linked URL as space-separated link types." 37069 ) 37070 } 37071 ) 37072 } 37073 ) 37074 ] 37075 } 37076 ); 37077 } 37078 function BindingHelpText({ type, kind }) { 37079 const entityType = getEntityTypeName(type, kind); 37080 return (0, import_i18n131.sprintf)( 37081 /* translators: %s is the entity type (e.g., "page", "post", "category") */ 37082 (0, import_i18n131.__)("Synced with the selected %s."), 37083 entityType 37084 ); 37085 } 37086 function MissingEntityHelpText({ type, kind }) { 37087 const entityType = getEntityTypeName(type, kind); 37088 return (0, import_i18n131.sprintf)( 37089 /* translators: %s is the entity type (e.g., "page", "post", "category") */ 37090 (0, import_i18n131.__)("Synced %s is missing. Please update or remove this link."), 37091 entityType 37092 ); 37093 } 37094 37095 // packages/block-library/build-module/navigation/edit/menu-inspector-controls.js 37096 var import_jsx_runtime310 = __toESM(require_jsx_runtime()); 37097 var actionLabel = ( 37098 /* translators: %s: The name of a menu. */ 37099 (0, import_i18n132.__)("Switch to '%s'") 37100 ); 37101 var BLOCKS_WITH_LINK_UI_SUPPORT = [ 37102 "core/navigation-link", 37103 "core/navigation-submenu" 37104 ]; 37105 var { PrivateListView } = unlock(import_block_editor150.privateApis); 37106 function AdditionalBlockContent({ block, insertedBlock, setInsertedBlock }) { 37107 const { updateBlockAttributes, removeBlock } = (0, import_data75.useDispatch)(import_block_editor150.store); 37108 const supportsLinkControls = BLOCKS_WITH_LINK_UI_SUPPORT?.includes( 37109 insertedBlock?.name 37110 ); 37111 const blockWasJustInserted = insertedBlock?.clientId === block.clientId; 37112 const showLinkControls = supportsLinkControls && blockWasJustInserted; 37113 const { createBinding, clearBinding } = useEntityBinding({ 37114 clientId: insertedBlock?.clientId, 37115 attributes: insertedBlock?.attributes || {} 37116 }); 37117 if (!showLinkControls) { 37118 return null; 37119 } 37120 const cleanupInsertedBlock = () => { 37121 const shouldAutoSelectBlock = false; 37122 if (!insertedBlock?.attributes?.url && insertedBlock?.clientId) { 37123 removeBlock(insertedBlock.clientId, shouldAutoSelectBlock); 37124 } 37125 setInsertedBlock(null); 37126 }; 37127 const setInsertedBlockAttributes = (_insertedBlockClientId) => (_updatedAttributes) => { 37128 if (!_insertedBlockClientId) { 37129 return; 37130 } 37131 updateBlockAttributes(_insertedBlockClientId, _updatedAttributes); 37132 }; 37133 const handleSetInsertedBlock = (newBlock) => { 37134 const shouldAutoSelectBlock = false; 37135 if (insertedBlock?.clientId && newBlock) { 37136 removeBlock(insertedBlock.clientId, shouldAutoSelectBlock); 37137 } 37138 setInsertedBlock(newBlock); 37139 }; 37140 return /* @__PURE__ */ (0, import_jsx_runtime310.jsx)( 37141 LinkUI, 37142 { 37143 clientId: insertedBlock?.clientId, 37144 link: insertedBlock?.attributes, 37145 onBlockInsert: handleSetInsertedBlock, 37146 onClose: () => { 37147 cleanupInsertedBlock(); 37148 }, 37149 onChange: (updatedValue) => { 37150 const { isEntityLink, attributes: updatedAttributes } = updateAttributes( 37151 updatedValue, 37152 setInsertedBlockAttributes(insertedBlock?.clientId), 37153 insertedBlock?.attributes 37154 ); 37155 if (isEntityLink) { 37156 createBinding(updatedAttributes); 37157 } else { 37158 clearBinding(); 37159 } 37160 setInsertedBlock(null); 37161 } 37162 } 37163 ); 37164 } 37165 var MainContent = ({ 37166 clientId, 37167 currentMenuId, 37168 isLoading, 37169 isNavigationMenuMissing, 37170 onCreateNew 37171 }) => { 37172 const hasChildren = (0, import_data75.useSelect)( 37173 (select9) => { 37174 return !!select9(import_block_editor150.store).getBlockCount(clientId); 37175 }, 37176 [clientId] 37177 ); 37178 const { navigationMenu } = useNavigationMenu(currentMenuId); 37179 if (currentMenuId && isNavigationMenuMissing) { 37180 return /* @__PURE__ */ (0, import_jsx_runtime310.jsx)(deleted_navigation_warning_default, { onCreateNew, isNotice: true }); 37181 } 37182 if (isLoading) { 37183 return /* @__PURE__ */ (0, import_jsx_runtime310.jsx)(import_components83.Spinner, {}); 37184 } 37185 const description = navigationMenu ? (0, import_i18n132.sprintf)( 37186 /* translators: %s: The name of a menu. */ 37187 (0, import_i18n132.__)("Structure for Navigation Menu: %s"), 37188 navigationMenu?.title || (0, import_i18n132.__)("Untitled menu") 37189 ) : (0, import_i18n132.__)( 37190 "You have not yet created any menus. Displaying a list of your Pages" 37191 ); 37192 return /* @__PURE__ */ (0, import_jsx_runtime310.jsxs)("div", { className: "wp-block-navigation__menu-inspector-controls", children: [ 37193 !hasChildren && /* @__PURE__ */ (0, import_jsx_runtime310.jsx)("p", { className: "wp-block-navigation__menu-inspector-controls__empty-message", children: (0, import_i18n132.__)("This Navigation Menu is empty.") }), 37194 /* @__PURE__ */ (0, import_jsx_runtime310.jsx)( 37195 PrivateListView, 37196 { 37197 rootClientId: clientId, 37198 isExpanded: true, 37199 description, 37200 showAppender: true, 37201 blockSettingsMenu: LeafMoreMenu, 37202 additionalBlockContent: AdditionalBlockContent 37203 } 37204 ) 37205 ] }); 37206 }; 37207 var MenuInspectorControls = (props) => { 37208 const { 37209 createNavigationMenuIsSuccess, 37210 createNavigationMenuIsError, 37211 currentMenuId = null, 37212 onCreateNew, 37213 onSelectClassicMenu, 37214 onSelectNavigationMenu, 37215 isManageMenusButtonDisabled, 37216 blockEditingMode 37217 } = props; 37218 return /* @__PURE__ */ (0, import_jsx_runtime310.jsx)(import_block_editor150.InspectorControls, { group: "list", children: /* @__PURE__ */ (0, import_jsx_runtime310.jsxs)(import_components83.PanelBody, { title: null, children: [ 37219 /* @__PURE__ */ (0, import_jsx_runtime310.jsxs)(import_components83.__experimentalHStack, { className: "wp-block-navigation-off-canvas-editor__header", children: [ 37220 /* @__PURE__ */ (0, import_jsx_runtime310.jsx)( 37221 import_components83.__experimentalHeading, 37222 { 37223 className: "wp-block-navigation-off-canvas-editor__title", 37224 level: 2, 37225 children: (0, import_i18n132.__)("Menu") 37226 } 37227 ), 37228 blockEditingMode === "default" && /* @__PURE__ */ (0, import_jsx_runtime310.jsx)( 37229 navigation_menu_selector_default, 37230 { 37231 currentMenuId, 37232 onSelectClassicMenu, 37233 onSelectNavigationMenu, 37234 onCreateNew, 37235 createNavigationMenuIsSuccess, 37236 createNavigationMenuIsError, 37237 actionLabel, 37238 isManageMenusButtonDisabled 37239 } 37240 ) 37241 ] }), 37242 /* @__PURE__ */ (0, import_jsx_runtime310.jsx)(MainContent, { ...props }) 37243 ] }) }); 37244 }; 37245 var menu_inspector_controls_default = MenuInspectorControls; 37246 37247 // packages/block-library/build-module/navigation/edit/accessible-description.js 37248 var import_components84 = __toESM(require_components()); 37249 var import_jsx_runtime311 = __toESM(require_jsx_runtime()); 37250 function AccessibleDescription({ id, children }) { 37251 return /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(import_components84.VisuallyHidden, { children: /* @__PURE__ */ (0, import_jsx_runtime311.jsx)("div", { id, className: "wp-block-navigation__description", children }) }); 37252 } 37253 37254 // packages/block-library/build-module/navigation/edit/accessible-menu-description.js 37255 var import_core_data42 = __toESM(require_core_data()); 37256 var import_i18n133 = __toESM(require_i18n()); 37257 var import_jsx_runtime312 = __toESM(require_jsx_runtime()); 37258 function AccessibleMenuDescription({ id }) { 37259 const [menuTitle] = (0, import_core_data42.useEntityProp)("postType", "wp_navigation", "title"); 37260 const description = (0, import_i18n133.sprintf)((0, import_i18n133.__)(`Navigation Menu: "%s"`), menuTitle); 37261 return /* @__PURE__ */ (0, import_jsx_runtime312.jsx)(AccessibleDescription, { id, children: description }); 37262 } 37263 37264 // packages/block-library/build-module/navigation/edit/index.js 37265 var import_jsx_runtime313 = __toESM(require_jsx_runtime()); 37266 function NavigationAddPageButton({ clientId }) { 37267 const { insertBlock } = (0, import_data76.useDispatch)(import_block_editor151.store); 37268 const { getBlockCount } = (0, import_data76.useSelect)(import_block_editor151.store); 37269 const onAddPage = (0, import_element74.useCallback)(() => { 37270 const blockCount = getBlockCount(clientId); 37271 const newBlock = (0, import_blocks60.createBlock)(DEFAULT_BLOCK5.name, { 37272 kind: DEFAULT_BLOCK5.attributes.kind, 37273 type: DEFAULT_BLOCK5.attributes.type 37274 }); 37275 insertBlock(newBlock, blockCount, clientId); 37276 }, [clientId, insertBlock, getBlockCount]); 37277 return /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(import_block_editor151.BlockControls, { children: /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(import_components85.ToolbarGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime313.jsx)( 37278 import_components85.ToolbarButton, 37279 { 37280 name: "add-page", 37281 icon: page_default, 37282 onClick: onAddPage, 37283 children: (0, import_i18n134.__)("Add page") 37284 } 37285 ) }) }); 37286 } 37287 function ColorTools({ 37288 textColor, 37289 setTextColor, 37290 backgroundColor, 37291 setBackgroundColor, 37292 overlayTextColor, 37293 setOverlayTextColor, 37294 overlayBackgroundColor, 37295 setOverlayBackgroundColor, 37296 clientId, 37297 navRef 37298 }) { 37299 const [detectedBackgroundColor, setDetectedBackgroundColor] = (0, import_element74.useState)(); 37300 const [detectedColor, setDetectedColor] = (0, import_element74.useState)(); 37301 const [ 37302 detectedOverlayBackgroundColor, 37303 setDetectedOverlayBackgroundColor 37304 ] = (0, import_element74.useState)(); 37305 const [detectedOverlayColor, setDetectedOverlayColor] = (0, import_element74.useState)(); 37306 const enableContrastChecking = import_element74.Platform.OS === "web"; 37307 (0, import_element74.useEffect)(() => { 37308 if (!enableContrastChecking) { 37309 return; 37310 } 37311 detectColors( 37312 navRef.current, 37313 setDetectedColor, 37314 setDetectedBackgroundColor 37315 ); 37316 const subMenuElement = navRef.current?.querySelector( 37317 '[data-type="core/navigation-submenu"] [data-type="core/navigation-link"]' 37318 ); 37319 if (!subMenuElement) { 37320 return; 37321 } 37322 if (overlayTextColor.color || overlayBackgroundColor.color) { 37323 detectColors( 37324 subMenuElement, 37325 setDetectedOverlayColor, 37326 setDetectedOverlayBackgroundColor 37327 ); 37328 } 37329 }, [ 37330 enableContrastChecking, 37331 overlayTextColor.color, 37332 overlayBackgroundColor.color, 37333 navRef 37334 ]); 37335 const colorGradientSettings = (0, import_block_editor151.__experimentalUseMultipleOriginColorsAndGradients)(); 37336 if (!colorGradientSettings.hasColorsOrGradients) { 37337 return null; 37338 } 37339 return /* @__PURE__ */ (0, import_jsx_runtime313.jsxs)(import_jsx_runtime313.Fragment, { children: [ 37340 /* @__PURE__ */ (0, import_jsx_runtime313.jsx)( 37341 import_block_editor151.__experimentalColorGradientSettingsDropdown, 37342 { 37343 __experimentalIsRenderedInSidebar: true, 37344 settings: [ 37345 { 37346 colorValue: textColor.color, 37347 label: (0, import_i18n134.__)("Text"), 37348 onColorChange: setTextColor, 37349 resetAllFilter: () => setTextColor(), 37350 clearable: true, 37351 enableAlpha: true 37352 }, 37353 { 37354 colorValue: backgroundColor.color, 37355 label: (0, import_i18n134.__)("Background"), 37356 onColorChange: setBackgroundColor, 37357 resetAllFilter: () => setBackgroundColor(), 37358 clearable: true, 37359 enableAlpha: true 37360 }, 37361 { 37362 colorValue: overlayTextColor.color, 37363 label: (0, import_i18n134.__)("Submenu & overlay text"), 37364 onColorChange: setOverlayTextColor, 37365 resetAllFilter: () => setOverlayTextColor(), 37366 clearable: true, 37367 enableAlpha: true 37368 }, 37369 { 37370 colorValue: overlayBackgroundColor.color, 37371 label: (0, import_i18n134.__)("Submenu & overlay background"), 37372 onColorChange: setOverlayBackgroundColor, 37373 resetAllFilter: () => setOverlayBackgroundColor(), 37374 clearable: true, 37375 enableAlpha: true 37376 } 37377 ], 37378 panelId: clientId, 37379 ...colorGradientSettings, 37380 gradients: [], 37381 disableCustomGradients: true 37382 } 37383 ), 37384 enableContrastChecking && /* @__PURE__ */ (0, import_jsx_runtime313.jsxs)(import_jsx_runtime313.Fragment, { children: [ 37385 /* @__PURE__ */ (0, import_jsx_runtime313.jsx)( 37386 import_block_editor151.ContrastChecker, 37387 { 37388 backgroundColor: detectedBackgroundColor, 37389 textColor: detectedColor 37390 } 37391 ), 37392 /* @__PURE__ */ (0, import_jsx_runtime313.jsx)( 37393 import_block_editor151.ContrastChecker, 37394 { 37395 backgroundColor: detectedOverlayBackgroundColor, 37396 textColor: detectedOverlayColor 37397 } 37398 ) 37399 ] }) 37400 ] }); 37401 } 37402 function Navigation({ 37403 attributes: attributes3, 37404 setAttributes, 37405 clientId, 37406 isSelected, 37407 className, 37408 backgroundColor, 37409 setBackgroundColor, 37410 textColor, 37411 setTextColor, 37412 overlayBackgroundColor, 37413 setOverlayBackgroundColor, 37414 overlayTextColor, 37415 setOverlayTextColor, 37416 // These props are used by the navigation editor to override specific 37417 // navigation block settings. 37418 hasSubmenuIndicatorSetting = true, 37419 customPlaceholder: CustomPlaceholder = null, 37420 __unstableLayoutClassNames: layoutClassNames 37421 }) { 37422 const { 37423 openSubmenusOnClick, 37424 overlayMenu, 37425 overlay, 37426 showSubmenuIcon, 37427 templateLock, 37428 layout: { 37429 justifyContent, 37430 orientation = "horizontal", 37431 flexWrap = "wrap" 37432 } = {}, 37433 hasIcon, 37434 icon = "handle" 37435 } = attributes3; 37436 const ref = attributes3.ref; 37437 const setRef = (0, import_element74.useCallback)( 37438 (postId) => { 37439 setAttributes({ ref: postId }); 37440 }, 37441 [setAttributes] 37442 ); 37443 const recursionId = `navigationMenu/$ref}`; 37444 const hasAlreadyRendered = (0, import_block_editor151.useHasRecursion)(recursionId); 37445 const blockEditingMode = (0, import_block_editor151.useBlockEditingMode)(); 37446 const { onNavigateToEntityRecord } = (0, import_data76.useSelect)((select9) => { 37447 const { getSettings: getSettings2 } = select9(import_block_editor151.store); 37448 const settings116 = getSettings2(); 37449 return { 37450 onNavigateToEntityRecord: settings116?.onNavigateToEntityRecord 37451 }; 37452 }, []); 37453 const isOverlayExperimentEnabled = typeof window !== "undefined" && window.__experimentalNavigationOverlays === true; 37454 const { menus: classicMenus } = useNavigationEntities(); 37455 const [showNavigationMenuStatusNotice, hideNavigationMenuStatusNotice] = use_navigation_notice_default({ 37456 name: "block-library/core/navigation/status" 37457 }); 37458 const [showClassicMenuConversionNotice, hideClassicMenuConversionNotice] = use_navigation_notice_default({ 37459 name: "block-library/core/navigation/classic-menu-conversion" 37460 }); 37461 const [ 37462 showNavigationMenuPermissionsNotice, 37463 hideNavigationMenuPermissionsNotice 37464 ] = use_navigation_notice_default({ 37465 name: "block-library/core/navigation/permissions/update" 37466 }); 37467 const { 37468 create: createNavigationMenu, 37469 status: createNavigationMenuStatus, 37470 error: createNavigationMenuError, 37471 value: createNavigationMenuPost, 37472 isPending: isCreatingNavigationMenu, 37473 isSuccess: createNavigationMenuIsSuccess, 37474 isError: createNavigationMenuIsError 37475 } = useCreateNavigationMenu(clientId); 37476 const createUntitledEmptyNavigationMenu = async () => { 37477 await createNavigationMenu(""); 37478 }; 37479 const { 37480 hasUncontrolledInnerBlocks, 37481 uncontrolledInnerBlocks, 37482 isInnerBlockSelected, 37483 innerBlocks 37484 } = useInnerBlocks(clientId); 37485 const hasSubmenus = !!innerBlocks.find( 37486 (block) => block.name === "core/navigation-submenu" 37487 ); 37488 const { 37489 replaceInnerBlocks, 37490 selectBlock, 37491 __unstableMarkNextChangeAsNotPersistent 37492 } = (0, import_data76.useDispatch)(import_block_editor151.store); 37493 const [isResponsiveMenuOpen, setResponsiveMenuVisibility] = (0, import_element74.useState)(false); 37494 const [overlayMenuPreview, setOverlayMenuPreview] = (0, import_element74.useState)(false); 37495 const { 37496 hasResolvedNavigationMenus, 37497 isNavigationMenuResolved, 37498 isNavigationMenuMissing, 37499 canUserUpdateNavigationMenu, 37500 hasResolvedCanUserUpdateNavigationMenu, 37501 canUserDeleteNavigationMenu, 37502 hasResolvedCanUserDeleteNavigationMenu, 37503 canUserCreateNavigationMenus, 37504 isResolvingCanUserCreateNavigationMenus, 37505 hasResolvedCanUserCreateNavigationMenus 37506 } = useNavigationMenu(ref); 37507 const navMenuResolvedButMissing = hasResolvedNavigationMenus && isNavigationMenuMissing; 37508 const { 37509 convert: convertClassicMenu, 37510 status: classicMenuConversionStatus, 37511 error: classicMenuConversionError 37512 } = use_convert_classic_menu_to_block_menu_default(createNavigationMenu); 37513 const isConvertingClassicMenu = classicMenuConversionStatus === CLASSIC_MENU_CONVERSION_PENDING; 37514 const handleUpdateMenu = (0, import_element74.useCallback)( 37515 (menuId, options2 = { focusNavigationBlock: false }) => { 37516 const { focusNavigationBlock } = options2; 37517 setRef(menuId); 37518 if (focusNavigationBlock) { 37519 selectBlock(clientId); 37520 } 37521 }, 37522 [selectBlock, clientId, setRef] 37523 ); 37524 const isEntityAvailable = !isNavigationMenuMissing && isNavigationMenuResolved; 37525 const hasUnsavedBlocks = hasUncontrolledInnerBlocks && !isEntityAvailable; 37526 const { getNavigationFallbackId } = unlock((0, import_data76.useSelect)(import_core_data43.store)); 37527 const navigationFallbackId = !(ref || hasUnsavedBlocks) ? getNavigationFallbackId() : null; 37528 (0, import_element74.useEffect)(() => { 37529 if (ref || hasUnsavedBlocks || !navigationFallbackId) { 37530 return; 37531 } 37532 __unstableMarkNextChangeAsNotPersistent(); 37533 setRef(navigationFallbackId); 37534 }, [ 37535 ref, 37536 setRef, 37537 hasUnsavedBlocks, 37538 navigationFallbackId, 37539 __unstableMarkNextChangeAsNotPersistent 37540 ]); 37541 const navRef = (0, import_element74.useRef)(); 37542 const TagName2 = "nav"; 37543 const isPlaceholder = !ref && !isCreatingNavigationMenu && !isConvertingClassicMenu && hasResolvedNavigationMenus && classicMenus?.length === 0 && !hasUncontrolledInnerBlocks; 37544 const isLoading = !hasResolvedNavigationMenus || isCreatingNavigationMenu || isConvertingClassicMenu || !!(ref && !isEntityAvailable && !isConvertingClassicMenu); 37545 const textDecoration = attributes3.style?.typography?.textDecoration; 37546 const hasBlockOverlay = (0, import_data76.useSelect)( 37547 (select9) => select9(import_block_editor151.store).__unstableHasActiveBlockOverlayActive( 37548 clientId 37549 ), 37550 [clientId] 37551 ); 37552 const isResponsive = "never" !== overlayMenu; 37553 const blockProps = (0, import_block_editor151.useBlockProps)({ 37554 ref: navRef, 37555 className: clsx_default( 37556 className, 37557 { 37558 "items-justified-right": justifyContent === "right", 37559 "items-justified-space-between": justifyContent === "space-between", 37560 "items-justified-left": justifyContent === "left", 37561 "items-justified-center": justifyContent === "center", 37562 "is-vertical": orientation === "vertical", 37563 "no-wrap": flexWrap === "nowrap", 37564 "is-responsive": isResponsive, 37565 "has-text-color": !!textColor.color || !!textColor?.class, 37566 [(0, import_block_editor151.getColorClassName)("color", textColor?.slug)]: !!textColor?.slug, 37567 "has-background": !!backgroundColor.color || backgroundColor.class, 37568 [(0, import_block_editor151.getColorClassName)( 37569 "background-color", 37570 backgroundColor?.slug 37571 )]: !!backgroundColor?.slug, 37572 [`has-text-decoration-$textDecoration}`]: textDecoration, 37573 "block-editor-block-content-overlay": hasBlockOverlay 37574 }, 37575 layoutClassNames 37576 ), 37577 style: { 37578 color: !textColor?.slug && textColor?.color, 37579 backgroundColor: !backgroundColor?.slug && backgroundColor?.color 37580 } 37581 }); 37582 const onSelectClassicMenu = async (classicMenu) => { 37583 return convertClassicMenu(classicMenu.id, classicMenu.name, "draft"); 37584 }; 37585 const onSelectNavigationMenu = (menuId) => { 37586 handleUpdateMenu(menuId); 37587 }; 37588 (0, import_element74.useEffect)(() => { 37589 hideNavigationMenuStatusNotice(); 37590 if (isCreatingNavigationMenu) { 37591 (0, import_a11y3.speak)((0, import_i18n134.__)(`Creating Navigation Menu.`)); 37592 } 37593 if (createNavigationMenuIsSuccess) { 37594 handleUpdateMenu(createNavigationMenuPost?.id, { 37595 focusNavigationBlock: true 37596 }); 37597 showNavigationMenuStatusNotice( 37598 (0, import_i18n134.__)(`Navigation Menu successfully created.`) 37599 ); 37600 } 37601 if (createNavigationMenuIsError) { 37602 showNavigationMenuStatusNotice( 37603 (0, import_i18n134.__)("Failed to create Navigation Menu.") 37604 ); 37605 } 37606 }, [ 37607 createNavigationMenuStatus, 37608 createNavigationMenuError, 37609 createNavigationMenuPost?.id, 37610 createNavigationMenuIsError, 37611 createNavigationMenuIsSuccess, 37612 isCreatingNavigationMenu, 37613 handleUpdateMenu, 37614 hideNavigationMenuStatusNotice, 37615 showNavigationMenuStatusNotice 37616 ]); 37617 (0, import_element74.useEffect)(() => { 37618 hideClassicMenuConversionNotice(); 37619 if (classicMenuConversionStatus === CLASSIC_MENU_CONVERSION_PENDING) { 37620 (0, import_a11y3.speak)((0, import_i18n134.__)("Classic menu importing.")); 37621 } 37622 if (classicMenuConversionStatus === CLASSIC_MENU_CONVERSION_SUCCESS) { 37623 showClassicMenuConversionNotice( 37624 (0, import_i18n134.__)("Classic menu imported successfully.") 37625 ); 37626 handleUpdateMenu(createNavigationMenuPost?.id, { 37627 focusNavigationBlock: true 37628 }); 37629 } 37630 if (classicMenuConversionStatus === CLASSIC_MENU_CONVERSION_ERROR) { 37631 showClassicMenuConversionNotice( 37632 (0, import_i18n134.__)("Classic menu import failed.") 37633 ); 37634 } 37635 }, [ 37636 classicMenuConversionStatus, 37637 classicMenuConversionError, 37638 hideClassicMenuConversionNotice, 37639 showClassicMenuConversionNotice, 37640 createNavigationMenuPost?.id, 37641 handleUpdateMenu 37642 ]); 37643 (0, import_element74.useEffect)(() => { 37644 if (!isSelected && !isInnerBlockSelected) { 37645 hideNavigationMenuPermissionsNotice(); 37646 } 37647 if (isSelected || isInnerBlockSelected) { 37648 if (ref && !navMenuResolvedButMissing && hasResolvedCanUserUpdateNavigationMenu && !canUserUpdateNavigationMenu) { 37649 showNavigationMenuPermissionsNotice( 37650 (0, import_i18n134.__)( 37651 "You do not have permission to edit this Menu. Any changes made will not be saved." 37652 ) 37653 ); 37654 } 37655 if (!ref && hasResolvedCanUserCreateNavigationMenus && !canUserCreateNavigationMenus) { 37656 showNavigationMenuPermissionsNotice( 37657 (0, import_i18n134.__)( 37658 "You do not have permission to create Navigation Menus." 37659 ) 37660 ); 37661 } 37662 } 37663 }, [ 37664 isSelected, 37665 isInnerBlockSelected, 37666 canUserUpdateNavigationMenu, 37667 hasResolvedCanUserUpdateNavigationMenu, 37668 canUserCreateNavigationMenus, 37669 hasResolvedCanUserCreateNavigationMenus, 37670 ref, 37671 hideNavigationMenuPermissionsNotice, 37672 showNavigationMenuPermissionsNotice, 37673 navMenuResolvedButMissing 37674 ]); 37675 const hasManagePermissions = canUserCreateNavigationMenus || canUserUpdateNavigationMenu; 37676 const overlayMenuPreviewClasses = clsx_default( 37677 "wp-block-navigation__overlay-menu-preview", 37678 { open: overlayMenuPreview } 37679 ); 37680 const submenuAccessibilityNotice = !showSubmenuIcon && !openSubmenusOnClick ? (0, import_i18n134.__)( 37681 '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.' 37682 ) : ""; 37683 const isFirstRender = (0, import_element74.useRef)(true); 37684 (0, import_element74.useEffect)(() => { 37685 if (!isFirstRender.current && submenuAccessibilityNotice) { 37686 (0, import_a11y3.speak)(submenuAccessibilityNotice); 37687 } 37688 isFirstRender.current = false; 37689 }, [submenuAccessibilityNotice]); 37690 const overlayMenuPreviewId = (0, import_compose29.useInstanceId)( 37691 OverlayMenuPreview, 37692 `overlay-menu-preview` 37693 ); 37694 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 37695 const stylingInspectorControls = /* @__PURE__ */ (0, import_jsx_runtime313.jsxs)(import_jsx_runtime313.Fragment, { children: [ 37696 /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(import_block_editor151.InspectorControls, { children: hasSubmenuIndicatorSetting && /* @__PURE__ */ (0, import_jsx_runtime313.jsxs)( 37697 import_components85.__experimentalToolsPanel, 37698 { 37699 label: (0, import_i18n134.__)("Display"), 37700 resetAll: () => { 37701 setAttributes({ 37702 showSubmenuIcon: true, 37703 openSubmenusOnClick: false, 37704 overlayMenu: "mobile", 37705 hasIcon: true, 37706 icon: "handle" 37707 }); 37708 }, 37709 dropdownMenuProps, 37710 children: [ 37711 !isOverlayExperimentEnabled && /* @__PURE__ */ (0, import_jsx_runtime313.jsxs)(import_jsx_runtime313.Fragment, { children: [ 37712 isResponsive && /* @__PURE__ */ (0, import_jsx_runtime313.jsx)( 37713 OverlayMenuPreviewButton, 37714 { 37715 isResponsive, 37716 overlayMenuPreview, 37717 setOverlayMenuPreview, 37718 hasIcon, 37719 icon, 37720 setAttributes, 37721 overlayMenuPreviewClasses, 37722 overlayMenuPreviewId, 37723 containerStyle: { 37724 gridColumn: "span 2" 37725 } 37726 } 37727 ), 37728 /* @__PURE__ */ (0, import_jsx_runtime313.jsx)( 37729 import_components85.__experimentalToolsPanelItem, 37730 { 37731 hasValue: () => overlayMenu !== "mobile", 37732 label: (0, import_i18n134.__)("Overlay Visibility"), 37733 onDeselect: () => setAttributes({ 37734 overlayMenu: "mobile" 37735 }), 37736 isShownByDefault: true, 37737 children: /* @__PURE__ */ (0, import_jsx_runtime313.jsx)( 37738 OverlayVisibilityControl, 37739 { 37740 overlayMenu, 37741 setAttributes 37742 } 37743 ) 37744 } 37745 ) 37746 ] }), 37747 hasSubmenus && /* @__PURE__ */ (0, import_jsx_runtime313.jsxs)(import_jsx_runtime313.Fragment, { children: [ 37748 /* @__PURE__ */ (0, import_jsx_runtime313.jsx)("h3", { className: "wp-block-navigation__submenu-header", children: (0, import_i18n134.__)("Submenus") }), 37749 /* @__PURE__ */ (0, import_jsx_runtime313.jsx)( 37750 import_components85.__experimentalToolsPanelItem, 37751 { 37752 hasValue: () => openSubmenusOnClick, 37753 label: (0, import_i18n134.__)("Open on click"), 37754 onDeselect: () => setAttributes({ 37755 openSubmenusOnClick: false, 37756 showSubmenuIcon: true 37757 }), 37758 isShownByDefault: true, 37759 children: /* @__PURE__ */ (0, import_jsx_runtime313.jsx)( 37760 import_components85.ToggleControl, 37761 { 37762 checked: openSubmenusOnClick, 37763 onChange: (value) => { 37764 setAttributes({ 37765 openSubmenusOnClick: value, 37766 ...value && { 37767 showSubmenuIcon: true 37768 } 37769 // Make sure arrows are shown when we toggle this on. 37770 }); 37771 }, 37772 label: (0, import_i18n134.__)("Open on click") 37773 } 37774 ) 37775 } 37776 ), 37777 /* @__PURE__ */ (0, import_jsx_runtime313.jsx)( 37778 import_components85.__experimentalToolsPanelItem, 37779 { 37780 hasValue: () => !showSubmenuIcon, 37781 label: (0, import_i18n134.__)("Show arrow"), 37782 onDeselect: () => setAttributes({ 37783 showSubmenuIcon: true 37784 }), 37785 isDisabled: attributes3.openSubmenusOnClick, 37786 isShownByDefault: true, 37787 children: /* @__PURE__ */ (0, import_jsx_runtime313.jsx)( 37788 import_components85.ToggleControl, 37789 { 37790 checked: showSubmenuIcon, 37791 onChange: (value) => { 37792 setAttributes({ 37793 showSubmenuIcon: value 37794 }); 37795 }, 37796 disabled: attributes3.openSubmenusOnClick, 37797 label: (0, import_i18n134.__)("Show arrow") 37798 } 37799 ) 37800 } 37801 ), 37802 submenuAccessibilityNotice && /* @__PURE__ */ (0, import_jsx_runtime313.jsx)( 37803 import_components85.Notice, 37804 { 37805 spokenMessage: null, 37806 status: "warning", 37807 isDismissible: false, 37808 className: "wp-block-navigation__submenu-accessibility-notice", 37809 children: submenuAccessibilityNotice 37810 } 37811 ) 37812 ] }) 37813 ] 37814 } 37815 ) }), 37816 isOverlayExperimentEnabled && /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(import_block_editor151.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime313.jsx)( 37817 OverlayPanel, 37818 { 37819 overlayMenu, 37820 overlay, 37821 setAttributes, 37822 onNavigateToEntityRecord, 37823 overlayMenuPreview, 37824 setOverlayMenuPreview, 37825 hasIcon, 37826 icon, 37827 overlayMenuPreviewClasses, 37828 overlayMenuPreviewId, 37829 isResponsive 37830 } 37831 ) }), 37832 /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(import_block_editor151.InspectorControls, { group: "color", children: /* @__PURE__ */ (0, import_jsx_runtime313.jsx)( 37833 ColorTools, 37834 { 37835 textColor, 37836 setTextColor, 37837 backgroundColor, 37838 setBackgroundColor, 37839 overlayTextColor, 37840 setOverlayTextColor, 37841 overlayBackgroundColor, 37842 setOverlayBackgroundColor, 37843 clientId, 37844 navRef 37845 } 37846 ) }) 37847 ] }); 37848 const accessibleDescriptionId = `$clientId}-desc`; 37849 const isHiddenByDefault = "always" === overlayMenu; 37850 const isManageMenusButtonDisabled = !hasManagePermissions || !hasResolvedNavigationMenus; 37851 if (hasUnsavedBlocks && !isCreatingNavigationMenu) { 37852 return /* @__PURE__ */ (0, import_jsx_runtime313.jsxs)( 37853 TagName2, 37854 { 37855 ...blockProps, 37856 "aria-describedby": !isPlaceholder ? accessibleDescriptionId : void 0, 37857 children: [ 37858 /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(AccessibleDescription, { id: accessibleDescriptionId, children: (0, import_i18n134.__)("Unsaved Navigation Menu.") }), 37859 /* @__PURE__ */ (0, import_jsx_runtime313.jsx)( 37860 menu_inspector_controls_default, 37861 { 37862 clientId, 37863 createNavigationMenuIsSuccess, 37864 createNavigationMenuIsError, 37865 currentMenuId: ref, 37866 isNavigationMenuMissing, 37867 isManageMenusButtonDisabled, 37868 onCreateNew: createUntitledEmptyNavigationMenu, 37869 onSelectClassicMenu, 37870 onSelectNavigationMenu, 37871 isLoading, 37872 blockEditingMode 37873 } 37874 ), 37875 blockEditingMode === "default" && stylingInspectorControls, 37876 /* @__PURE__ */ (0, import_jsx_runtime313.jsx)( 37877 ResponsiveWrapper, 37878 { 37879 id: clientId, 37880 onToggle: setResponsiveMenuVisibility, 37881 isOpen: isResponsiveMenuOpen, 37882 hasIcon, 37883 icon, 37884 isResponsive, 37885 isHiddenByDefault, 37886 overlayBackgroundColor, 37887 overlayTextColor, 37888 overlay, 37889 onNavigateToEntityRecord, 37890 children: /* @__PURE__ */ (0, import_jsx_runtime313.jsx)( 37891 UnsavedInnerBlocks, 37892 { 37893 createNavigationMenu, 37894 blocks: uncontrolledInnerBlocks, 37895 hasSelection: isSelected || isInnerBlockSelected 37896 } 37897 ) 37898 } 37899 ) 37900 ] 37901 } 37902 ); 37903 } 37904 if (ref && isNavigationMenuMissing) { 37905 return /* @__PURE__ */ (0, import_jsx_runtime313.jsxs)(TagName2, { ...blockProps, children: [ 37906 /* @__PURE__ */ (0, import_jsx_runtime313.jsx)( 37907 menu_inspector_controls_default, 37908 { 37909 clientId, 37910 createNavigationMenuIsSuccess, 37911 createNavigationMenuIsError, 37912 currentMenuId: ref, 37913 isNavigationMenuMissing, 37914 isManageMenusButtonDisabled, 37915 onCreateNew: createUntitledEmptyNavigationMenu, 37916 onSelectClassicMenu, 37917 onSelectNavigationMenu, 37918 isLoading, 37919 blockEditingMode 37920 } 37921 ), 37922 /* @__PURE__ */ (0, import_jsx_runtime313.jsx)( 37923 deleted_navigation_warning_default, 37924 { 37925 onCreateNew: createUntitledEmptyNavigationMenu 37926 } 37927 ) 37928 ] }); 37929 } 37930 if (isEntityAvailable && hasAlreadyRendered) { 37931 return /* @__PURE__ */ (0, import_jsx_runtime313.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(import_block_editor151.Warning, { children: (0, import_i18n134.__)("Block cannot be rendered inside itself.") }) }); 37932 } 37933 const PlaceholderComponent = CustomPlaceholder ? CustomPlaceholder : NavigationPlaceholder; 37934 if (isPlaceholder && CustomPlaceholder) { 37935 return /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(TagName2, { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime313.jsx)( 37936 PlaceholderComponent, 37937 { 37938 isSelected, 37939 currentMenuId: ref, 37940 clientId, 37941 canUserCreateNavigationMenus, 37942 isResolvingCanUserCreateNavigationMenus, 37943 onSelectNavigationMenu, 37944 onSelectClassicMenu, 37945 onCreateEmpty: createUntitledEmptyNavigationMenu 37946 } 37947 ) }); 37948 } 37949 return /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(import_core_data43.EntityProvider, { kind: "postType", type: "wp_navigation", id: ref, children: /* @__PURE__ */ (0, import_jsx_runtime313.jsxs)(import_block_editor151.RecursionProvider, { uniqueId: recursionId, children: [ 37950 /* @__PURE__ */ (0, import_jsx_runtime313.jsx)( 37951 menu_inspector_controls_default, 37952 { 37953 clientId, 37954 createNavigationMenuIsSuccess, 37955 createNavigationMenuIsError, 37956 currentMenuId: ref, 37957 isNavigationMenuMissing, 37958 isManageMenusButtonDisabled, 37959 onCreateNew: createUntitledEmptyNavigationMenu, 37960 onSelectClassicMenu, 37961 onSelectNavigationMenu, 37962 isLoading, 37963 blockEditingMode 37964 } 37965 ), 37966 blockEditingMode === "default" && stylingInspectorControls, 37967 blockEditingMode === "contentOnly" && isEntityAvailable && /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(NavigationAddPageButton, { clientId }), 37968 blockEditingMode === "default" && isEntityAvailable && /* @__PURE__ */ (0, import_jsx_runtime313.jsxs)(import_block_editor151.InspectorControls, { group: "advanced", children: [ 37969 hasResolvedCanUserUpdateNavigationMenu && canUserUpdateNavigationMenu && /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(NavigationMenuNameControl, {}), 37970 hasResolvedCanUserDeleteNavigationMenu && canUserDeleteNavigationMenu && /* @__PURE__ */ (0, import_jsx_runtime313.jsx)( 37971 NavigationMenuDeleteControl, 37972 { 37973 onDelete: () => { 37974 replaceInnerBlocks(clientId, []); 37975 showNavigationMenuStatusNotice( 37976 (0, import_i18n134.__)( 37977 "Navigation Menu successfully deleted." 37978 ) 37979 ); 37980 } 37981 } 37982 ), 37983 /* @__PURE__ */ (0, import_jsx_runtime313.jsx)( 37984 manage_menus_button_default, 37985 { 37986 disabled: isManageMenusButtonDisabled, 37987 className: "wp-block-navigation-manage-menus-button" 37988 } 37989 ) 37990 ] }), 37991 /* @__PURE__ */ (0, import_jsx_runtime313.jsxs)( 37992 TagName2, 37993 { 37994 ...blockProps, 37995 "aria-describedby": !isPlaceholder && !isLoading ? accessibleDescriptionId : void 0, 37996 children: [ 37997 isLoading && !isHiddenByDefault && /* @__PURE__ */ (0, import_jsx_runtime313.jsx)("div", { className: "wp-block-navigation__loading-indicator-container", children: /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(import_components85.Spinner, { className: "wp-block-navigation__loading-indicator" }) }), 37998 (!isLoading || isHiddenByDefault) && /* @__PURE__ */ (0, import_jsx_runtime313.jsxs)(import_jsx_runtime313.Fragment, { children: [ 37999 /* @__PURE__ */ (0, import_jsx_runtime313.jsx)( 38000 AccessibleMenuDescription, 38001 { 38002 id: accessibleDescriptionId 38003 } 38004 ), 38005 /* @__PURE__ */ (0, import_jsx_runtime313.jsx)( 38006 ResponsiveWrapper, 38007 { 38008 id: clientId, 38009 onToggle: setResponsiveMenuVisibility, 38010 hasIcon, 38011 icon, 38012 isOpen: isResponsiveMenuOpen, 38013 isResponsive, 38014 isHiddenByDefault, 38015 overlayBackgroundColor, 38016 overlayTextColor, 38017 overlay, 38018 onNavigateToEntityRecord, 38019 children: isEntityAvailable && /* @__PURE__ */ (0, import_jsx_runtime313.jsx)( 38020 NavigationInnerBlocks, 38021 { 38022 clientId, 38023 hasCustomPlaceholder: !!CustomPlaceholder, 38024 templateLock, 38025 orientation 38026 } 38027 ) 38028 } 38029 ) 38030 ] }) 38031 ] 38032 } 38033 ) 38034 ] }) }); 38035 } 38036 var edit_default19 = (0, import_block_editor151.withColors)( 38037 { textColor: "color" }, 38038 { backgroundColor: "color" }, 38039 { overlayBackgroundColor: "color" }, 38040 { overlayTextColor: "color" } 38041 )(Navigation); 38042 38043 // packages/block-library/build-module/navigation/save.js 38044 var import_block_editor152 = __toESM(require_block_editor()); 38045 var import_jsx_runtime314 = __toESM(require_jsx_runtime()); 38046 function save33({ attributes: attributes3 }) { 38047 if (attributes3.ref) { 38048 return; 38049 } 38050 return /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(import_block_editor152.InnerBlocks.Content, {}); 38051 } 38052 38053 // packages/block-library/build-module/navigation/deprecated.js 38054 var import_block_editor153 = __toESM(require_block_editor()); 38055 var import_compose30 = __toESM(require_compose()); 38056 var import_jsx_runtime315 = __toESM(require_jsx_runtime()); 38057 var TYPOGRAPHY_PRESET_DEPRECATION_MAP = { 38058 fontStyle: "var:preset|font-style|", 38059 fontWeight: "var:preset|font-weight|", 38060 textDecoration: "var:preset|text-decoration|", 38061 textTransform: "var:preset|text-transform|" 38062 }; 38063 var migrateIdToRef = ({ navigationMenuId, ...attributes3 }) => { 38064 return { 38065 ...attributes3, 38066 ref: navigationMenuId 38067 }; 38068 }; 38069 var migrateWithLayout2 = (attributes3) => { 38070 if (!!attributes3.layout) { 38071 return attributes3; 38072 } 38073 const { itemsJustification, orientation, ...updatedAttributes } = attributes3; 38074 if (itemsJustification || orientation) { 38075 Object.assign(updatedAttributes, { 38076 layout: { 38077 type: "flex", 38078 ...itemsJustification && { 38079 justifyContent: itemsJustification 38080 }, 38081 ...orientation && { orientation } 38082 } 38083 }); 38084 } 38085 return updatedAttributes; 38086 }; 38087 var v65 = { 38088 attributes: { 38089 navigationMenuId: { 38090 type: "number" 38091 }, 38092 textColor: { 38093 type: "string" 38094 }, 38095 customTextColor: { 38096 type: "string" 38097 }, 38098 rgbTextColor: { 38099 type: "string" 38100 }, 38101 backgroundColor: { 38102 type: "string" 38103 }, 38104 customBackgroundColor: { 38105 type: "string" 38106 }, 38107 rgbBackgroundColor: { 38108 type: "string" 38109 }, 38110 showSubmenuIcon: { 38111 type: "boolean", 38112 default: true 38113 }, 38114 openSubmenusOnClick: { 38115 type: "boolean", 38116 default: false 38117 }, 38118 overlayMenu: { 38119 type: "string", 38120 default: "mobile" 38121 }, 38122 __unstableLocation: { 38123 type: "string" 38124 }, 38125 overlayBackgroundColor: { 38126 type: "string" 38127 }, 38128 customOverlayBackgroundColor: { 38129 type: "string" 38130 }, 38131 overlayTextColor: { 38132 type: "string" 38133 }, 38134 customOverlayTextColor: { 38135 type: "string" 38136 } 38137 }, 38138 supports: { 38139 align: ["wide", "full"], 38140 anchor: true, 38141 html: false, 38142 inserter: true, 38143 typography: { 38144 fontSize: true, 38145 lineHeight: true, 38146 __experimentalFontStyle: true, 38147 __experimentalFontWeight: true, 38148 __experimentalTextTransform: true, 38149 __experimentalFontFamily: true, 38150 __experimentalTextDecoration: true, 38151 __experimentalDefaultControls: { 38152 fontSize: true 38153 } 38154 }, 38155 spacing: { 38156 blockGap: true, 38157 units: ["px", "em", "rem", "vh", "vw"], 38158 __experimentalDefaultControls: { 38159 blockGap: true 38160 } 38161 }, 38162 layout: { 38163 allowSwitching: false, 38164 allowInheriting: false, 38165 default: { 38166 type: "flex" 38167 } 38168 } 38169 }, 38170 save() { 38171 return /* @__PURE__ */ (0, import_jsx_runtime315.jsx)(import_block_editor153.InnerBlocks.Content, {}); 38172 }, 38173 isEligible: ({ navigationMenuId }) => !!navigationMenuId, 38174 migrate: migrateIdToRef 38175 }; 38176 var v56 = { 38177 attributes: { 38178 navigationMenuId: { 38179 type: "number" 38180 }, 38181 orientation: { 38182 type: "string", 38183 default: "horizontal" 38184 }, 38185 textColor: { 38186 type: "string" 38187 }, 38188 customTextColor: { 38189 type: "string" 38190 }, 38191 rgbTextColor: { 38192 type: "string" 38193 }, 38194 backgroundColor: { 38195 type: "string" 38196 }, 38197 customBackgroundColor: { 38198 type: "string" 38199 }, 38200 rgbBackgroundColor: { 38201 type: "string" 38202 }, 38203 itemsJustification: { 38204 type: "string" 38205 }, 38206 showSubmenuIcon: { 38207 type: "boolean", 38208 default: true 38209 }, 38210 openSubmenusOnClick: { 38211 type: "boolean", 38212 default: false 38213 }, 38214 overlayMenu: { 38215 type: "string", 38216 default: "never" 38217 }, 38218 __unstableLocation: { 38219 type: "string" 38220 }, 38221 overlayBackgroundColor: { 38222 type: "string" 38223 }, 38224 customOverlayBackgroundColor: { 38225 type: "string" 38226 }, 38227 overlayTextColor: { 38228 type: "string" 38229 }, 38230 customOverlayTextColor: { 38231 type: "string" 38232 } 38233 }, 38234 supports: { 38235 align: ["wide", "full"], 38236 anchor: true, 38237 html: false, 38238 inserter: true, 38239 typography: { 38240 fontSize: true, 38241 lineHeight: true, 38242 __experimentalFontStyle: true, 38243 __experimentalFontWeight: true, 38244 __experimentalTextTransform: true, 38245 __experimentalFontFamily: true, 38246 __experimentalTextDecoration: true, 38247 __experimentalDefaultControls: { 38248 fontSize: true 38249 } 38250 }, 38251 spacing: { 38252 blockGap: true, 38253 units: ["px", "em", "rem", "vh", "vw"], 38254 __experimentalDefaultControls: { 38255 blockGap: true 38256 } 38257 } 38258 }, 38259 save() { 38260 return /* @__PURE__ */ (0, import_jsx_runtime315.jsx)(import_block_editor153.InnerBlocks.Content, {}); 38261 }, 38262 isEligible: ({ itemsJustification, orientation }) => !!itemsJustification || !!orientation, 38263 migrate: (0, import_compose30.compose)(migrateIdToRef, migrateWithLayout2) 38264 }; 38265 var v46 = { 38266 attributes: { 38267 orientation: { 38268 type: "string", 38269 default: "horizontal" 38270 }, 38271 textColor: { 38272 type: "string" 38273 }, 38274 customTextColor: { 38275 type: "string" 38276 }, 38277 rgbTextColor: { 38278 type: "string" 38279 }, 38280 backgroundColor: { 38281 type: "string" 38282 }, 38283 customBackgroundColor: { 38284 type: "string" 38285 }, 38286 rgbBackgroundColor: { 38287 type: "string" 38288 }, 38289 itemsJustification: { 38290 type: "string" 38291 }, 38292 showSubmenuIcon: { 38293 type: "boolean", 38294 default: true 38295 }, 38296 openSubmenusOnClick: { 38297 type: "boolean", 38298 default: false 38299 }, 38300 overlayMenu: { 38301 type: "string", 38302 default: "never" 38303 }, 38304 __unstableLocation: { 38305 type: "string" 38306 }, 38307 overlayBackgroundColor: { 38308 type: "string" 38309 }, 38310 customOverlayBackgroundColor: { 38311 type: "string" 38312 }, 38313 overlayTextColor: { 38314 type: "string" 38315 }, 38316 customOverlayTextColor: { 38317 type: "string" 38318 } 38319 }, 38320 supports: { 38321 align: ["wide", "full"], 38322 anchor: true, 38323 html: false, 38324 inserter: true, 38325 typography: { 38326 fontSize: true, 38327 lineHeight: true, 38328 __experimentalFontStyle: true, 38329 __experimentalFontWeight: true, 38330 __experimentalTextTransform: true, 38331 __experimentalFontFamily: true, 38332 __experimentalTextDecoration: true 38333 }, 38334 spacing: { 38335 blockGap: true, 38336 units: ["px", "em", "rem", "vh", "vw"], 38337 __experimentalDefaultControls: { 38338 blockGap: true 38339 } 38340 } 38341 }, 38342 save() { 38343 return /* @__PURE__ */ (0, import_jsx_runtime315.jsx)(import_block_editor153.InnerBlocks.Content, {}); 38344 }, 38345 migrate: (0, import_compose30.compose)(migrateIdToRef, migrateWithLayout2, migrate_font_family_default), 38346 isEligible({ style: style2 }) { 38347 return style2?.typography?.fontFamily; 38348 } 38349 }; 38350 var migrateIsResponsive = function(attributes3) { 38351 delete attributes3.isResponsive; 38352 return { 38353 ...attributes3, 38354 overlayMenu: "mobile" 38355 }; 38356 }; 38357 var migrateTypographyPresets = function(attributes3) { 38358 return { 38359 ...attributes3, 38360 style: { 38361 ...attributes3.style, 38362 typography: Object.fromEntries( 38363 Object.entries(attributes3.style.typography ?? {}).map( 38364 ([key, value]) => { 38365 const prefix = TYPOGRAPHY_PRESET_DEPRECATION_MAP[key]; 38366 if (prefix && value.startsWith(prefix)) { 38367 const newValue = value.slice(prefix.length); 38368 if ("textDecoration" === key && "strikethrough" === newValue) { 38369 return [key, "line-through"]; 38370 } 38371 return [key, newValue]; 38372 } 38373 return [key, value]; 38374 } 38375 ) 38376 ) 38377 } 38378 }; 38379 }; 38380 var deprecated11 = [ 38381 v65, 38382 v56, 38383 v46, 38384 // Remove `isResponsive` attribute. 38385 { 38386 attributes: { 38387 orientation: { 38388 type: "string", 38389 default: "horizontal" 38390 }, 38391 textColor: { 38392 type: "string" 38393 }, 38394 customTextColor: { 38395 type: "string" 38396 }, 38397 rgbTextColor: { 38398 type: "string" 38399 }, 38400 backgroundColor: { 38401 type: "string" 38402 }, 38403 customBackgroundColor: { 38404 type: "string" 38405 }, 38406 rgbBackgroundColor: { 38407 type: "string" 38408 }, 38409 itemsJustification: { 38410 type: "string" 38411 }, 38412 showSubmenuIcon: { 38413 type: "boolean", 38414 default: true 38415 }, 38416 openSubmenusOnClick: { 38417 type: "boolean", 38418 default: false 38419 }, 38420 isResponsive: { 38421 type: "boolean", 38422 default: "false" 38423 }, 38424 __unstableLocation: { 38425 type: "string" 38426 }, 38427 overlayBackgroundColor: { 38428 type: "string" 38429 }, 38430 customOverlayBackgroundColor: { 38431 type: "string" 38432 }, 38433 overlayTextColor: { 38434 type: "string" 38435 }, 38436 customOverlayTextColor: { 38437 type: "string" 38438 } 38439 }, 38440 supports: { 38441 align: ["wide", "full"], 38442 anchor: true, 38443 html: false, 38444 inserter: true, 38445 typography: { 38446 fontSize: true, 38447 lineHeight: true, 38448 __experimentalFontStyle: true, 38449 __experimentalFontWeight: true, 38450 __experimentalTextTransform: true, 38451 __experimentalFontFamily: true, 38452 __experimentalTextDecoration: true 38453 } 38454 }, 38455 isEligible(attributes3) { 38456 return attributes3.isResponsive; 38457 }, 38458 migrate: (0, import_compose30.compose)( 38459 migrateIdToRef, 38460 migrateWithLayout2, 38461 migrate_font_family_default, 38462 migrateIsResponsive 38463 ), 38464 save() { 38465 return /* @__PURE__ */ (0, import_jsx_runtime315.jsx)(import_block_editor153.InnerBlocks.Content, {}); 38466 } 38467 }, 38468 { 38469 attributes: { 38470 orientation: { 38471 type: "string" 38472 }, 38473 textColor: { 38474 type: "string" 38475 }, 38476 customTextColor: { 38477 type: "string" 38478 }, 38479 rgbTextColor: { 38480 type: "string" 38481 }, 38482 backgroundColor: { 38483 type: "string" 38484 }, 38485 customBackgroundColor: { 38486 type: "string" 38487 }, 38488 rgbBackgroundColor: { 38489 type: "string" 38490 }, 38491 itemsJustification: { 38492 type: "string" 38493 }, 38494 showSubmenuIcon: { 38495 type: "boolean", 38496 default: true 38497 } 38498 }, 38499 supports: { 38500 align: ["wide", "full"], 38501 anchor: true, 38502 html: false, 38503 inserter: true, 38504 fontSize: true, 38505 __experimentalFontStyle: true, 38506 __experimentalFontWeight: true, 38507 __experimentalTextTransform: true, 38508 color: true, 38509 __experimentalFontFamily: true, 38510 __experimentalTextDecoration: true 38511 }, 38512 save() { 38513 return /* @__PURE__ */ (0, import_jsx_runtime315.jsx)(import_block_editor153.InnerBlocks.Content, {}); 38514 }, 38515 isEligible(attributes3) { 38516 if (!attributes3.style || !attributes3.style.typography) { 38517 return false; 38518 } 38519 for (const styleAttribute in TYPOGRAPHY_PRESET_DEPRECATION_MAP) { 38520 const attributeValue = attributes3.style.typography[styleAttribute]; 38521 if (attributeValue && attributeValue.startsWith( 38522 TYPOGRAPHY_PRESET_DEPRECATION_MAP[styleAttribute] 38523 )) { 38524 return true; 38525 } 38526 } 38527 return false; 38528 }, 38529 migrate: (0, import_compose30.compose)( 38530 migrateIdToRef, 38531 migrateWithLayout2, 38532 migrate_font_family_default, 38533 migrateTypographyPresets 38534 ) 38535 }, 38536 { 38537 attributes: { 38538 className: { 38539 type: "string" 38540 }, 38541 textColor: { 38542 type: "string" 38543 }, 38544 rgbTextColor: { 38545 type: "string" 38546 }, 38547 backgroundColor: { 38548 type: "string" 38549 }, 38550 rgbBackgroundColor: { 38551 type: "string" 38552 }, 38553 fontSize: { 38554 type: "string" 38555 }, 38556 customFontSize: { 38557 type: "number" 38558 }, 38559 itemsJustification: { 38560 type: "string" 38561 }, 38562 showSubmenuIcon: { 38563 type: "boolean" 38564 } 38565 }, 38566 isEligible(attribute) { 38567 return attribute.rgbTextColor || attribute.rgbBackgroundColor; 38568 }, 38569 supports: { 38570 align: ["wide", "full"], 38571 anchor: true, 38572 html: false, 38573 inserter: true 38574 }, 38575 migrate: (0, import_compose30.compose)(migrateIdToRef, (attributes3) => { 38576 const { rgbTextColor, rgbBackgroundColor, ...restAttributes } = attributes3; 38577 return { 38578 ...restAttributes, 38579 customTextColor: attributes3.textColor ? void 0 : attributes3.rgbTextColor, 38580 customBackgroundColor: attributes3.backgroundColor ? void 0 : attributes3.rgbBackgroundColor 38581 }; 38582 }), 38583 save() { 38584 return /* @__PURE__ */ (0, import_jsx_runtime315.jsx)(import_block_editor153.InnerBlocks.Content, {}); 38585 } 38586 } 38587 ]; 38588 var deprecated_default25 = deprecated11; 38589 38590 // packages/block-library/build-module/navigation/index.js 38591 var { name: name53 } = block_default53; 38592 var settings53 = { 38593 icon: navigation_default, 38594 example: { 38595 attributes: { 38596 overlayMenu: "never" 38597 }, 38598 innerBlocks: [ 38599 { 38600 name: "core/navigation-link", 38601 attributes: { 38602 // translators: 'Home' as in a website's home page. 38603 label: (0, import_i18n135.__)("Home"), 38604 url: "https://make.wordpress.org/" 38605 } 38606 }, 38607 { 38608 name: "core/navigation-link", 38609 attributes: { 38610 // translators: 'About' as in a website's about page. 38611 label: (0, import_i18n135.__)("About"), 38612 url: "https://make.wordpress.org/" 38613 } 38614 }, 38615 { 38616 name: "core/navigation-link", 38617 attributes: { 38618 // translators: 'Contact' as in a website's contact page. 38619 label: (0, import_i18n135.__)("Contact"), 38620 url: "https://make.wordpress.org/" 38621 } 38622 } 38623 ] 38624 }, 38625 edit: edit_default19, 38626 save: save33, 38627 __experimentalLabel: ({ ref }) => { 38628 if (!ref) { 38629 return; 38630 } 38631 const navigation = (0, import_data77.select)(import_core_data44.store).getEditedEntityRecord( 38632 "postType", 38633 "wp_navigation", 38634 ref 38635 ); 38636 if (!navigation?.title) { 38637 return; 38638 } 38639 return (0, import_html_entities6.decodeEntities)(navigation.title); 38640 }, 38641 deprecated: deprecated_default25 38642 }; 38643 var init53 = () => initBlock({ name: name53, metadata: block_default53, settings: settings53 }); 38644 38645 // packages/block-library/build-module/navigation-link/index.js 38646 var navigation_link_exports = {}; 38647 __export(navigation_link_exports, { 38648 init: () => init54, 38649 metadata: () => block_default54, 38650 name: () => name54, 38651 settings: () => settings54 38652 }); 38653 var import_i18n137 = __toESM(require_i18n()); 38654 var import_block_editor156 = __toESM(require_block_editor()); 38655 var import_hooks42 = __toESM(require_hooks()); 38656 var import_blocks63 = __toESM(require_blocks()); 38657 38658 // packages/block-library/build-module/navigation-link/block.json 38659 var block_default54 = { 38660 $schema: "https://schemas.wp.org/trunk/block.json", 38661 apiVersion: 3, 38662 name: "core/navigation-link", 38663 title: "Custom Link", 38664 category: "design", 38665 parent: ["core/navigation"], 38666 allowedBlocks: [ 38667 "core/navigation-link", 38668 "core/navigation-submenu", 38669 "core/page-list" 38670 ], 38671 description: "Add a page, link, or another item to your navigation.", 38672 textdomain: "default", 38673 attributes: { 38674 label: { 38675 type: "string", 38676 role: "content" 38677 }, 38678 type: { 38679 type: "string" 38680 }, 38681 description: { 38682 type: "string" 38683 }, 38684 rel: { 38685 type: "string" 38686 }, 38687 id: { 38688 type: "number" 38689 }, 38690 opensInNewTab: { 38691 type: "boolean", 38692 default: false 38693 }, 38694 url: { 38695 type: "string", 38696 role: "content" 38697 }, 38698 title: { 38699 type: "string" 38700 }, 38701 kind: { 38702 type: "string" 38703 }, 38704 isTopLevelLink: { 38705 type: "boolean" 38706 } 38707 }, 38708 usesContext: [ 38709 "textColor", 38710 "customTextColor", 38711 "backgroundColor", 38712 "customBackgroundColor", 38713 "overlayTextColor", 38714 "customOverlayTextColor", 38715 "overlayBackgroundColor", 38716 "customOverlayBackgroundColor", 38717 "fontSize", 38718 "customFontSize", 38719 "showSubmenuIcon", 38720 "maxNestingLevel", 38721 "style" 38722 ], 38723 supports: { 38724 reusable: false, 38725 html: false, 38726 __experimentalSlashInserter: true, 38727 typography: { 38728 fontSize: true, 38729 lineHeight: true, 38730 __experimentalFontFamily: true, 38731 __experimentalFontWeight: true, 38732 __experimentalFontStyle: true, 38733 __experimentalTextTransform: true, 38734 __experimentalTextDecoration: true, 38735 __experimentalLetterSpacing: true, 38736 __experimentalDefaultControls: { 38737 fontSize: true 38738 } 38739 }, 38740 renaming: false, 38741 interactivity: { 38742 clientNavigation: true 38743 } 38744 }, 38745 editorStyle: "wp-block-navigation-link-editor", 38746 style: "wp-block-navigation-link" 38747 }; 38748 38749 // packages/block-library/build-module/navigation-link/edit.js 38750 var import_blocks61 = __toESM(require_blocks()); 38751 var import_data78 = __toESM(require_data()); 38752 var import_components86 = __toESM(require_components()); 38753 var import_keycodes6 = __toESM(require_keycodes()); 38754 var import_i18n136 = __toESM(require_i18n()); 38755 var import_block_editor154 = __toESM(require_block_editor()); 38756 var import_url13 = __toESM(require_url()); 38757 var import_element75 = __toESM(require_element()); 38758 var import_html_entities7 = __toESM(require_html_entities()); 38759 var import_core_data45 = __toESM(require_core_data()); 38760 var import_compose31 = __toESM(require_compose()); 38761 var import_jsx_runtime316 = __toESM(require_jsx_runtime()); 38762 var DEFAULT_BLOCK6 = { name: "core/navigation-link" }; 38763 var NESTING_BLOCK_NAMES = [ 38764 "core/navigation-link", 38765 "core/navigation-submenu" 38766 ]; 38767 var useIsDraggingWithin = (elementRef) => { 38768 const [isDraggingWithin, setIsDraggingWithin] = (0, import_element75.useState)(false); 38769 (0, import_element75.useEffect)(() => { 38770 const { ownerDocument } = elementRef.current; 38771 function handleDragStart(event) { 38772 handleDragEnter(event); 38773 } 38774 function handleDragEnd() { 38775 setIsDraggingWithin(false); 38776 } 38777 function handleDragEnter(event) { 38778 if (elementRef.current.contains(event.target)) { 38779 setIsDraggingWithin(true); 38780 } else { 38781 setIsDraggingWithin(false); 38782 } 38783 } 38784 ownerDocument.addEventListener("dragstart", handleDragStart); 38785 ownerDocument.addEventListener("dragend", handleDragEnd); 38786 ownerDocument.addEventListener("dragenter", handleDragEnter); 38787 return () => { 38788 ownerDocument.removeEventListener("dragstart", handleDragStart); 38789 ownerDocument.removeEventListener("dragend", handleDragEnd); 38790 ownerDocument.removeEventListener("dragenter", handleDragEnter); 38791 }; 38792 }, [elementRef]); 38793 return isDraggingWithin; 38794 }; 38795 var useIsInvalidLink = (kind, type, id, enabled) => { 38796 const isPostType = kind === "post-type" || type === "post" || type === "page"; 38797 const hasId = Number.isInteger(id); 38798 const blockEditingMode = (0, import_block_editor154.useBlockEditingMode)(); 38799 const { postStatus, isDeleted } = (0, import_data78.useSelect)( 38800 (select9) => { 38801 if (!isPostType) { 38802 return { postStatus: null, isDeleted: false }; 38803 } 38804 if (blockEditingMode === "disabled" || !enabled) { 38805 return { postStatus: null, isDeleted: false }; 38806 } 38807 const { getEntityRecord, hasFinishedResolution } = select9(import_core_data45.store); 38808 const entityRecord = getEntityRecord("postType", type, id); 38809 const hasResolved = hasFinishedResolution("getEntityRecord", [ 38810 "postType", 38811 type, 38812 id 38813 ]); 38814 const deleted = hasResolved && entityRecord === void 0; 38815 return { 38816 postStatus: entityRecord?.status, 38817 isDeleted: deleted 38818 }; 38819 }, 38820 [isPostType, blockEditingMode, enabled, type, id] 38821 ); 38822 const isInvalid = isPostType && hasId && (isDeleted || postStatus && "trash" === postStatus); 38823 const isDraft = "draft" === postStatus; 38824 return [isInvalid, isDraft]; 38825 }; 38826 function getMissingText(type) { 38827 let missingText = ""; 38828 switch (type) { 38829 case "post": 38830 missingText = (0, import_i18n136.__)("Select post"); 38831 break; 38832 case "page": 38833 missingText = (0, import_i18n136.__)("Select page"); 38834 break; 38835 case "category": 38836 missingText = (0, import_i18n136.__)("Select category"); 38837 break; 38838 case "tag": 38839 missingText = (0, import_i18n136.__)("Select tag"); 38840 break; 38841 default: 38842 missingText = (0, import_i18n136.__)("Add link"); 38843 } 38844 return missingText; 38845 } 38846 function NavigationLinkEdit({ 38847 attributes: attributes3, 38848 isSelected, 38849 setAttributes, 38850 insertBlocksAfter, 38851 mergeBlocks, 38852 onReplace, 38853 context, 38854 clientId 38855 }) { 38856 const { id, label, type, url, description, kind, metadata } = attributes3; 38857 const { maxNestingLevel } = context; 38858 const { 38859 replaceBlock, 38860 __unstableMarkNextChangeAsNotPersistent, 38861 selectBlock 38862 } = (0, import_data78.useDispatch)(import_block_editor154.store); 38863 const [isLinkOpen, setIsLinkOpen] = (0, import_element75.useState)(isSelected && !url); 38864 const [popoverAnchor, setPopoverAnchor] = (0, import_element75.useState)(null); 38865 const listItemRef = (0, import_element75.useRef)(null); 38866 const isDraggingWithin = useIsDraggingWithin(listItemRef); 38867 const itemLabelPlaceholder = (0, import_i18n136.__)("Add label\u2026"); 38868 const ref = (0, import_element75.useRef)(); 38869 const linkUIref = (0, import_element75.useRef)(); 38870 const isNewLink = (0, import_element75.useRef)(label === void 0); 38871 const shouldSelectSubmenuAppenderOnClose = (0, import_element75.useRef)(false); 38872 const { 38873 isAtMaxNesting, 38874 isTopLevelLink, 38875 isParentOfSelectedBlock, 38876 hasChildren, 38877 validateLinkStatus, 38878 parentBlockClientId, 38879 isSubmenu 38880 } = (0, import_data78.useSelect)( 38881 (select9) => { 38882 const { 38883 getBlockCount, 38884 getBlockName, 38885 getBlockRootClientId, 38886 hasSelectedInnerBlock, 38887 getBlockParentsByBlockName, 38888 getSelectedBlockClientId 38889 } = select9(import_block_editor154.store); 38890 const rootClientId = getBlockRootClientId(clientId); 38891 const parentBlockName = getBlockName(rootClientId); 38892 const isTopLevel = parentBlockName === "core/navigation"; 38893 const selectedBlockClientId = getSelectedBlockClientId(); 38894 const rootNavigationClientId = isTopLevel ? rootClientId : getBlockParentsByBlockName( 38895 clientId, 38896 "core/navigation" 38897 )[0]; 38898 const parentBlockId = parentBlockName === "core/navigation-submenu" ? rootClientId : rootNavigationClientId; 38899 const enableLinkStatusValidation = selectedBlockClientId === rootNavigationClientId || hasSelectedInnerBlock(rootNavigationClientId, true); 38900 return { 38901 isAtMaxNesting: getBlockParentsByBlockName(clientId, NESTING_BLOCK_NAMES).length >= maxNestingLevel, 38902 isTopLevelLink: isTopLevel, 38903 isParentOfSelectedBlock: hasSelectedInnerBlock( 38904 clientId, 38905 true 38906 ), 38907 hasChildren: !!getBlockCount(clientId), 38908 validateLinkStatus: enableLinkStatusValidation, 38909 parentBlockClientId: parentBlockId, 38910 isSubmenu: parentBlockName === "core/navigation-submenu" 38911 }; 38912 }, 38913 [clientId, maxNestingLevel] 38914 ); 38915 const { getBlocks } = (0, import_data78.useSelect)(import_block_editor154.store); 38916 const { hasUrlBinding, isBoundEntityAvailable } = useEntityBinding({ 38917 clientId, 38918 attributes: attributes3 38919 }); 38920 const handleLinkChange = useHandleLinkChange({ 38921 clientId, 38922 attributes: attributes3, 38923 setAttributes 38924 }); 38925 const [isInvalid, isDraft] = useIsInvalidLink( 38926 kind, 38927 type, 38928 id, 38929 validateLinkStatus 38930 ); 38931 const transformToSubmenu = (0, import_element75.useCallback)(() => { 38932 let innerBlocks = getBlocks(clientId); 38933 if (innerBlocks.length === 0) { 38934 innerBlocks = [(0, import_blocks61.createBlock)("core/navigation-link")]; 38935 selectBlock(innerBlocks[0].clientId); 38936 } 38937 const newSubmenu = (0, import_blocks61.createBlock)( 38938 "core/navigation-submenu", 38939 attributes3, 38940 innerBlocks 38941 ); 38942 replaceBlock(clientId, newSubmenu); 38943 }, [getBlocks, clientId, selectBlock, replaceBlock, attributes3]); 38944 (0, import_element75.useEffect)(() => { 38945 if (isNewLink.current && isSelected) { 38946 selectBlock(parentBlockClientId); 38947 } 38948 }, []); 38949 (0, import_element75.useEffect)(() => { 38950 if (hasChildren) { 38951 __unstableMarkNextChangeAsNotPersistent(); 38952 transformToSubmenu(); 38953 } 38954 }, [ 38955 hasChildren, 38956 __unstableMarkNextChangeAsNotPersistent, 38957 transformToSubmenu 38958 ]); 38959 (0, import_element75.useEffect)(() => { 38960 if (!isNewLink.current || !url || !isLinkOpen) { 38961 return; 38962 } 38963 isNewLink.current = false; 38964 if ((0, import_url13.isURL)((0, import_url13.prependHTTP)(label)) && /^.+\.[a-z]+/.test(label)) { 38965 selectLabelText(); 38966 } else { 38967 selectBlock(clientId, null); 38968 if (isSubmenu) { 38969 const parentBlocks = getBlocks(parentBlockClientId); 38970 if (parentBlocks.length === 1 && parentBlocks[0].clientId === clientId) { 38971 shouldSelectSubmenuAppenderOnClose.current = true; 38972 } 38973 } 38974 } 38975 }, [url, isLinkOpen, isNewLink, label]); 38976 function selectLabelText() { 38977 ref.current.focus(); 38978 const { ownerDocument } = ref.current; 38979 const { defaultView } = ownerDocument; 38980 const selection = defaultView.getSelection(); 38981 const range = ownerDocument.createRange(); 38982 range.selectNodeContents(ref.current); 38983 selection.removeAllRanges(); 38984 selection.addRange(range); 38985 } 38986 function removeLink() { 38987 setAttributes({ 38988 url: void 0, 38989 label: void 0, 38990 id: void 0, 38991 kind: void 0, 38992 type: void 0, 38993 opensInNewTab: false 38994 }); 38995 setIsLinkOpen(false); 38996 } 38997 const { 38998 textColor, 38999 customTextColor, 39000 backgroundColor, 39001 customBackgroundColor 39002 } = getColors(context, !isTopLevelLink); 39003 function onKeyDown(event) { 39004 if (import_keycodes6.isKeyboardEvent.primary(event, "k")) { 39005 event.preventDefault(); 39006 event.stopPropagation(); 39007 setIsLinkOpen(true); 39008 } 39009 } 39010 const instanceId = (0, import_compose31.useInstanceId)(NavigationLinkEdit); 39011 const hasMissingEntity = hasUrlBinding && !isBoundEntityAvailable; 39012 const missingEntityDescriptionId = hasMissingEntity ? (0, import_i18n136.sprintf)("navigation-link-edit-%d-desc", instanceId) : void 0; 39013 const blockProps = (0, import_block_editor154.useBlockProps)({ 39014 ref: (0, import_compose31.useMergeRefs)([setPopoverAnchor, listItemRef]), 39015 className: clsx_default("wp-block-navigation-item", { 39016 "is-editing": isSelected || isParentOfSelectedBlock, 39017 "is-dragging-within": isDraggingWithin, 39018 "has-link": !!url, 39019 "has-child": hasChildren, 39020 "has-text-color": !!textColor || !!customTextColor, 39021 [(0, import_block_editor154.getColorClassName)("color", textColor)]: !!textColor, 39022 "has-background": !!backgroundColor || customBackgroundColor, 39023 [(0, import_block_editor154.getColorClassName)("background-color", backgroundColor)]: !!backgroundColor 39024 }), 39025 "aria-describedby": missingEntityDescriptionId, 39026 "aria-invalid": hasMissingEntity, 39027 style: { 39028 color: !textColor && customTextColor, 39029 backgroundColor: !backgroundColor && customBackgroundColor 39030 }, 39031 onKeyDown 39032 }); 39033 const innerBlocksProps = (0, import_block_editor154.useInnerBlocksProps)( 39034 { 39035 ...blockProps, 39036 className: "remove-outline" 39037 // Remove the outline from the inner blocks container. 39038 }, 39039 { 39040 defaultBlock: DEFAULT_BLOCK6, 39041 directInsert: true, 39042 renderAppender: false 39043 } 39044 ); 39045 const needsValidLink = !url && !(hasUrlBinding && isBoundEntityAvailable) || isInvalid || isDraft || hasUrlBinding && !isBoundEntityAvailable; 39046 if (needsValidLink) { 39047 blockProps.onClick = () => { 39048 setIsLinkOpen(true); 39049 }; 39050 } 39051 const classes = clsx_default("wp-block-navigation-item__content", { 39052 "wp-block-navigation-link__placeholder": needsValidLink 39053 }); 39054 const missingText = getMissingText(type); 39055 const placeholderText = `($isInvalid ? (0, import_i18n136.__)("Invalid") : (0, import_i18n136.__)("Draft")})`; 39056 return /* @__PURE__ */ (0, import_jsx_runtime316.jsxs)(import_jsx_runtime316.Fragment, { children: [ 39057 /* @__PURE__ */ (0, import_jsx_runtime316.jsx)(import_block_editor154.BlockControls, { children: /* @__PURE__ */ (0, import_jsx_runtime316.jsxs)(import_components86.ToolbarGroup, { children: [ 39058 /* @__PURE__ */ (0, import_jsx_runtime316.jsx)( 39059 import_components86.ToolbarButton, 39060 { 39061 name: "link", 39062 icon: link_default, 39063 title: (0, import_i18n136.__)("Link"), 39064 shortcut: import_keycodes6.displayShortcut.primary("k"), 39065 onClick: () => { 39066 setIsLinkOpen(true); 39067 } 39068 } 39069 ), 39070 !isAtMaxNesting && /* @__PURE__ */ (0, import_jsx_runtime316.jsx)( 39071 import_components86.ToolbarButton, 39072 { 39073 name: "submenu", 39074 icon: add_submenu_default, 39075 title: (0, import_i18n136.__)("Add submenu"), 39076 onClick: transformToSubmenu 39077 } 39078 ) 39079 ] }) }), 39080 /* @__PURE__ */ (0, import_jsx_runtime316.jsx)(import_block_editor154.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime316.jsx)( 39081 Controls2, 39082 { 39083 attributes: attributes3, 39084 setAttributes, 39085 clientId 39086 } 39087 ) }), 39088 /* @__PURE__ */ (0, import_jsx_runtime316.jsxs)("div", { ...blockProps, children: [ 39089 hasMissingEntity && /* @__PURE__ */ (0, import_jsx_runtime316.jsx)(import_components86.VisuallyHidden, { id: missingEntityDescriptionId, children: /* @__PURE__ */ (0, import_jsx_runtime316.jsx)(MissingEntityHelpText, { type, kind }) }), 39090 /* @__PURE__ */ (0, import_jsx_runtime316.jsxs)("a", { className: classes, children: [ 39091 !url && !metadata?.bindings?.url ? /* @__PURE__ */ (0, import_jsx_runtime316.jsx)("div", { className: "wp-block-navigation-link__placeholder-text", children: /* @__PURE__ */ (0, import_jsx_runtime316.jsx)("span", { children: missingText }) }) : /* @__PURE__ */ (0, import_jsx_runtime316.jsxs)(import_jsx_runtime316.Fragment, { children: [ 39092 !isInvalid && !isDraft && /* @__PURE__ */ (0, import_jsx_runtime316.jsxs)(import_jsx_runtime316.Fragment, { children: [ 39093 /* @__PURE__ */ (0, import_jsx_runtime316.jsx)( 39094 import_block_editor154.RichText, 39095 { 39096 ref, 39097 identifier: "label", 39098 className: "wp-block-navigation-item__label", 39099 value: label, 39100 onChange: (labelValue) => setAttributes({ 39101 label: labelValue 39102 }), 39103 onMerge: mergeBlocks, 39104 onReplace, 39105 __unstableOnSplitAtEnd: () => insertBlocksAfter( 39106 (0, import_blocks61.createBlock)( 39107 "core/navigation-link" 39108 ) 39109 ), 39110 "aria-label": (0, import_i18n136.__)( 39111 "Navigation link text" 39112 ), 39113 placeholder: itemLabelPlaceholder, 39114 withoutInteractiveFormatting: true 39115 } 39116 ), 39117 description && /* @__PURE__ */ (0, import_jsx_runtime316.jsx)("span", { className: "wp-block-navigation-item__description", children: description }) 39118 ] }), 39119 (isInvalid || isDraft) && /* @__PURE__ */ (0, import_jsx_runtime316.jsx)( 39120 "div", 39121 { 39122 className: clsx_default( 39123 "wp-block-navigation-link__placeholder-text", 39124 "wp-block-navigation-link__label", 39125 { 39126 "is-invalid": isInvalid, 39127 "is-draft": isDraft 39128 } 39129 ), 39130 children: /* @__PURE__ */ (0, import_jsx_runtime316.jsx)("span", { 39131 // Some attributes are stored in an escaped form. It's a legacy issue. 39132 // Ideally they would be stored in a raw, unescaped form. 39133 // Unescape is used here to "recover" the escaped characters 39134 // so they display without encoding. 39135 // See `updateAttributes` for more details. 39136 children: `${(0, import_html_entities7.decodeEntities)(label)} $isInvalid || isDraft ? placeholderText : ""}`.trim() 39137 }) 39138 } 39139 ) 39140 ] }), 39141 isLinkOpen && /* @__PURE__ */ (0, import_jsx_runtime316.jsx)( 39142 LinkUI, 39143 { 39144 ref: linkUIref, 39145 clientId, 39146 link: attributes3, 39147 onClose: () => { 39148 setIsLinkOpen(false); 39149 if (!url && !hasUrlBinding) { 39150 onReplace([]); 39151 return; 39152 } 39153 if (shouldSelectSubmenuAppenderOnClose.current) { 39154 shouldSelectSubmenuAppenderOnClose.current = false; 39155 if (listItemRef.current?.nextElementSibling) { 39156 const appenderButton = listItemRef.current.nextElementSibling.querySelector( 39157 ".block-editor-button-block-appender" 39158 ); 39159 if (appenderButton) { 39160 appenderButton.focus(); 39161 } 39162 } 39163 } 39164 }, 39165 anchor: popoverAnchor, 39166 onRemove: removeLink, 39167 onChange: handleLinkChange 39168 } 39169 ) 39170 ] }), 39171 /* @__PURE__ */ (0, import_jsx_runtime316.jsx)("div", { ...innerBlocksProps }) 39172 ] }) 39173 ] }); 39174 } 39175 39176 // packages/block-library/build-module/navigation-link/save.js 39177 var import_block_editor155 = __toESM(require_block_editor()); 39178 var import_jsx_runtime317 = __toESM(require_jsx_runtime()); 39179 function save34() { 39180 return /* @__PURE__ */ (0, import_jsx_runtime317.jsx)(import_block_editor155.InnerBlocks.Content, {}); 39181 } 39182 39183 // packages/block-library/build-module/navigation-link/hooks.js 39184 function getIcon(variationName) { 39185 switch (variationName) { 39186 case "post": 39187 return post_list_default; 39188 case "page": 39189 return page_default; 39190 case "tag": 39191 return tag_default; 39192 case "category": 39193 return category_default; 39194 default: 39195 return custom_post_type_default; 39196 } 39197 } 39198 function enhanceNavigationLinkVariations(settings116, name117) { 39199 if (name117 !== "core/navigation-link") { 39200 return settings116; 39201 } 39202 if (settings116.variations) { 39203 const isActive = (blockAttributes8, variationAttributes) => { 39204 return blockAttributes8.type === variationAttributes.type; 39205 }; 39206 const variations18 = settings116.variations.map((variation) => { 39207 return { 39208 ...variation, 39209 ...!variation.icon && { 39210 icon: getIcon(variation.name) 39211 }, 39212 ...!variation.isActive && { 39213 isActive 39214 } 39215 }; 39216 }); 39217 return { 39218 ...settings116, 39219 variations: variations18 39220 }; 39221 } 39222 return settings116; 39223 } 39224 39225 // packages/block-library/build-module/navigation-link/transforms.js 39226 var import_blocks62 = __toESM(require_blocks()); 39227 var transforms18 = { 39228 from: [ 39229 { 39230 type: "block", 39231 blocks: ["core/site-logo"], 39232 transform: () => { 39233 return (0, import_blocks62.createBlock)("core/navigation-link"); 39234 } 39235 }, 39236 { 39237 type: "block", 39238 blocks: ["core/spacer"], 39239 transform: () => { 39240 return (0, import_blocks62.createBlock)("core/navigation-link"); 39241 } 39242 }, 39243 { 39244 type: "block", 39245 blocks: ["core/home-link"], 39246 transform: () => { 39247 return (0, import_blocks62.createBlock)("core/navigation-link"); 39248 } 39249 }, 39250 { 39251 type: "block", 39252 blocks: ["core/social-links"], 39253 transform: () => { 39254 return (0, import_blocks62.createBlock)("core/navigation-link"); 39255 } 39256 }, 39257 { 39258 type: "block", 39259 blocks: ["core/search"], 39260 transform: () => { 39261 return (0, import_blocks62.createBlock)("core/navigation-link"); 39262 } 39263 }, 39264 { 39265 type: "block", 39266 blocks: ["core/page-list"], 39267 transform: () => { 39268 return (0, import_blocks62.createBlock)("core/navigation-link"); 39269 } 39270 }, 39271 { 39272 type: "block", 39273 blocks: ["core/buttons"], 39274 transform: () => { 39275 return (0, import_blocks62.createBlock)("core/navigation-link"); 39276 } 39277 } 39278 ], 39279 to: [ 39280 { 39281 type: "block", 39282 blocks: ["core/navigation-submenu"], 39283 transform: (attributes3, innerBlocks) => (0, import_blocks62.createBlock)( 39284 "core/navigation-submenu", 39285 attributes3, 39286 innerBlocks 39287 ) 39288 }, 39289 { 39290 type: "block", 39291 blocks: ["core/spacer"], 39292 transform: () => { 39293 return (0, import_blocks62.createBlock)("core/spacer"); 39294 } 39295 }, 39296 { 39297 type: "block", 39298 blocks: ["core/site-logo"], 39299 transform: () => { 39300 return (0, import_blocks62.createBlock)("core/site-logo"); 39301 } 39302 }, 39303 { 39304 type: "block", 39305 blocks: ["core/home-link"], 39306 transform: () => { 39307 return (0, import_blocks62.createBlock)("core/home-link"); 39308 } 39309 }, 39310 { 39311 type: "block", 39312 blocks: ["core/social-links"], 39313 transform: () => { 39314 return (0, import_blocks62.createBlock)("core/social-links"); 39315 } 39316 }, 39317 { 39318 type: "block", 39319 blocks: ["core/search"], 39320 transform: () => { 39321 return (0, import_blocks62.createBlock)("core/search", { 39322 showLabel: false, 39323 buttonUseIcon: true, 39324 buttonPosition: "button-inside" 39325 }); 39326 } 39327 }, 39328 { 39329 type: "block", 39330 blocks: ["core/page-list"], 39331 transform: () => { 39332 return (0, import_blocks62.createBlock)("core/page-list"); 39333 } 39334 }, 39335 { 39336 type: "block", 39337 blocks: ["core/buttons"], 39338 transform: ({ label, url, rel, title, opensInNewTab }) => { 39339 return (0, import_blocks62.createBlock)("core/buttons", {}, [ 39340 (0, import_blocks62.createBlock)("core/button", { 39341 text: label, 39342 url, 39343 rel, 39344 title, 39345 linkTarget: opensInNewTab ? "_blank" : void 0 39346 }) 39347 ]); 39348 } 39349 } 39350 ] 39351 }; 39352 var transforms_default19 = transforms18; 39353 39354 // packages/block-library/build-module/navigation-link/index.js 39355 var import_jsx_runtime318 = __toESM(require_jsx_runtime()); 39356 var { fieldsKey: fieldsKey12, formKey: formKey12 } = unlock(import_blocks63.privateApis); 39357 var { name: name54 } = block_default54; 39358 var settings54 = { 39359 icon: custom_link_default, 39360 __experimentalLabel: ({ label }) => label, 39361 merge(leftAttributes, { label: rightLabel = "" }) { 39362 return { 39363 ...leftAttributes, 39364 label: leftAttributes.label + rightLabel 39365 }; 39366 }, 39367 edit: NavigationLinkEdit, 39368 save: save34, 39369 example: { 39370 attributes: { 39371 label: (0, import_i18n137._x)("Example Link", "navigation link preview example"), 39372 url: "https://example.com" 39373 } 39374 }, 39375 deprecated: [ 39376 { 39377 isEligible(attributes3) { 39378 return attributes3.nofollow; 39379 }, 39380 attributes: { 39381 label: { 39382 type: "string" 39383 }, 39384 type: { 39385 type: "string" 39386 }, 39387 nofollow: { 39388 type: "boolean" 39389 }, 39390 description: { 39391 type: "string" 39392 }, 39393 id: { 39394 type: "number" 39395 }, 39396 opensInNewTab: { 39397 type: "boolean", 39398 default: false 39399 }, 39400 url: { 39401 type: "string" 39402 } 39403 }, 39404 migrate({ nofollow, ...rest }) { 39405 return { 39406 rel: nofollow ? "nofollow" : "", 39407 ...rest 39408 }; 39409 }, 39410 save() { 39411 return /* @__PURE__ */ (0, import_jsx_runtime318.jsx)(import_block_editor156.InnerBlocks.Content, {}); 39412 } 39413 } 39414 ], 39415 transforms: transforms_default19 39416 }; 39417 if (window.__experimentalContentOnlyInspectorFields) { 39418 settings54[fieldsKey12] = [ 39419 { 39420 id: "label", 39421 label: (0, import_i18n137.__)("Label"), 39422 type: "richtext" 39423 }, 39424 { 39425 id: "link", 39426 label: (0, import_i18n137.__)("Link"), 39427 type: "link", 39428 mapping: { 39429 href: "url", 39430 rel: "rel" 39431 // TODO - opens in new tab? id? 39432 } 39433 } 39434 ]; 39435 settings54[formKey12] = { 39436 fields: ["label"] 39437 }; 39438 } 39439 var init54 = () => { 39440 (0, import_hooks42.addFilter)( 39441 "blocks.registerBlockType", 39442 "core/navigation-link", 39443 enhanceNavigationLinkVariations 39444 ); 39445 return initBlock({ name: name54, metadata: block_default54, settings: settings54 }); 39446 }; 39447 39448 // packages/block-library/build-module/navigation-submenu/index.js 39449 var navigation_submenu_exports = {}; 39450 __export(navigation_submenu_exports, { 39451 init: () => init55, 39452 metadata: () => block_default55, 39453 name: () => name55, 39454 settings: () => settings55 39455 }); 39456 var import_i18n139 = __toESM(require_i18n()); 39457 var import_blocks66 = __toESM(require_blocks()); 39458 39459 // packages/block-library/build-module/navigation-submenu/block.json 39460 var block_default55 = { 39461 $schema: "https://schemas.wp.org/trunk/block.json", 39462 apiVersion: 3, 39463 name: "core/navigation-submenu", 39464 title: "Submenu", 39465 category: "design", 39466 parent: ["core/navigation"], 39467 description: "Add a submenu to your navigation.", 39468 textdomain: "default", 39469 attributes: { 39470 label: { 39471 type: "string", 39472 role: "content" 39473 }, 39474 type: { 39475 type: "string" 39476 }, 39477 description: { 39478 type: "string" 39479 }, 39480 rel: { 39481 type: "string" 39482 }, 39483 id: { 39484 type: "number" 39485 }, 39486 opensInNewTab: { 39487 type: "boolean", 39488 default: false 39489 }, 39490 url: { 39491 type: "string", 39492 role: "content" 39493 }, 39494 title: { 39495 type: "string" 39496 }, 39497 kind: { 39498 type: "string" 39499 }, 39500 isTopLevelItem: { 39501 type: "boolean" 39502 } 39503 }, 39504 usesContext: [ 39505 "textColor", 39506 "customTextColor", 39507 "backgroundColor", 39508 "customBackgroundColor", 39509 "overlayTextColor", 39510 "customOverlayTextColor", 39511 "overlayBackgroundColor", 39512 "customOverlayBackgroundColor", 39513 "fontSize", 39514 "customFontSize", 39515 "showSubmenuIcon", 39516 "maxNestingLevel", 39517 "openSubmenusOnClick", 39518 "style" 39519 ], 39520 supports: { 39521 reusable: false, 39522 html: false, 39523 typography: { 39524 fontSize: true, 39525 lineHeight: true, 39526 __experimentalFontFamily: true, 39527 __experimentalFontWeight: true, 39528 __experimentalFontStyle: true, 39529 __experimentalTextTransform: true, 39530 __experimentalTextDecoration: true, 39531 __experimentalLetterSpacing: true, 39532 __experimentalDefaultControls: { 39533 fontSize: true 39534 } 39535 }, 39536 interactivity: { 39537 clientNavigation: true 39538 } 39539 }, 39540 editorStyle: "wp-block-navigation-submenu-editor", 39541 style: "wp-block-navigation-submenu" 39542 }; 39543 39544 // packages/block-library/build-module/navigation-submenu/edit.js 39545 var import_data79 = __toESM(require_data()); 39546 var import_components88 = __toESM(require_components()); 39547 var import_keycodes7 = __toESM(require_keycodes()); 39548 var import_i18n138 = __toESM(require_i18n()); 39549 var import_block_editor157 = __toESM(require_block_editor()); 39550 var import_url14 = __toESM(require_url()); 39551 var import_element76 = __toESM(require_element()); 39552 var import_a11y4 = __toESM(require_a11y()); 39553 var import_blocks64 = __toESM(require_blocks()); 39554 var import_compose32 = __toESM(require_compose()); 39555 39556 // packages/block-library/build-module/navigation-submenu/icons.js 39557 var import_components87 = __toESM(require_components()); 39558 var import_jsx_runtime319 = __toESM(require_jsx_runtime()); 39559 var ItemSubmenuIcon = () => /* @__PURE__ */ (0, import_jsx_runtime319.jsx)( 39560 import_components87.SVG, 39561 { 39562 xmlns: "http://www.w3.org/2000/svg", 39563 width: "12", 39564 height: "12", 39565 viewBox: "0 0 12 12", 39566 fill: "none", 39567 children: /* @__PURE__ */ (0, import_jsx_runtime319.jsx)(import_components87.Path, { d: "M1.50002 4L6.00002 8L10.5 4", strokeWidth: "1.5" }) 39568 } 39569 ); 39570 39571 // packages/block-library/build-module/navigation-submenu/edit.js 39572 var import_jsx_runtime320 = __toESM(require_jsx_runtime()); 39573 var ALLOWED_BLOCKS = [ 39574 "core/navigation-link", 39575 "core/navigation-submenu", 39576 "core/page-list" 39577 ]; 39578 var useIsDraggingWithin2 = (elementRef) => { 39579 const [isDraggingWithin, setIsDraggingWithin] = (0, import_element76.useState)(false); 39580 (0, import_element76.useEffect)(() => { 39581 const { ownerDocument } = elementRef.current; 39582 function handleDragStart(event) { 39583 handleDragEnter(event); 39584 } 39585 function handleDragEnd() { 39586 setIsDraggingWithin(false); 39587 } 39588 function handleDragEnter(event) { 39589 if (elementRef.current.contains(event.target)) { 39590 setIsDraggingWithin(true); 39591 } else { 39592 setIsDraggingWithin(false); 39593 } 39594 } 39595 ownerDocument.addEventListener("dragstart", handleDragStart); 39596 ownerDocument.addEventListener("dragend", handleDragEnd); 39597 ownerDocument.addEventListener("dragenter", handleDragEnter); 39598 return () => { 39599 ownerDocument.removeEventListener("dragstart", handleDragStart); 39600 ownerDocument.removeEventListener("dragend", handleDragEnd); 39601 ownerDocument.removeEventListener("dragenter", handleDragEnter); 39602 }; 39603 }, []); 39604 return isDraggingWithin; 39605 }; 39606 function NavigationSubmenuEdit({ 39607 attributes: attributes3, 39608 isSelected, 39609 setAttributes, 39610 mergeBlocks, 39611 onReplace, 39612 context, 39613 clientId 39614 }) { 39615 const { label, url, description } = attributes3; 39616 const { 39617 showSubmenuIcon, 39618 maxNestingLevel, 39619 openSubmenusOnClick: contextOpenSubmenusOnClick 39620 } = context; 39621 const blockEditingMode = (0, import_block_editor157.useBlockEditingMode)(); 39622 const openSubmenusOnClick = blockEditingMode !== "default" ? true : contextOpenSubmenusOnClick; 39623 const { clearBinding, createBinding } = useEntityBinding({ 39624 clientId, 39625 attributes: attributes3 39626 }); 39627 const { __unstableMarkNextChangeAsNotPersistent, replaceBlock } = (0, import_data79.useDispatch)(import_block_editor157.store); 39628 const [isLinkOpen, setIsLinkOpen] = (0, import_element76.useState)(false); 39629 const [popoverAnchor, setPopoverAnchor] = (0, import_element76.useState)(null); 39630 const listItemRef = (0, import_element76.useRef)(null); 39631 const isDraggingWithin = useIsDraggingWithin2(listItemRef); 39632 const itemLabelPlaceholder = (0, import_i18n138.__)("Add text\u2026"); 39633 const ref = (0, import_element76.useRef)(); 39634 const { 39635 parentCount, 39636 isParentOfSelectedBlock, 39637 isImmediateParentOfSelectedBlock, 39638 hasChildren, 39639 selectedBlockHasChildren, 39640 onlyDescendantIsEmptyLink 39641 } = (0, import_data79.useSelect)( 39642 (select9) => { 39643 const { 39644 hasSelectedInnerBlock, 39645 getSelectedBlockClientId, 39646 getBlockParentsByBlockName, 39647 getBlock, 39648 getBlockCount, 39649 getBlockOrder 39650 } = select9(import_block_editor157.store); 39651 let _onlyDescendantIsEmptyLink; 39652 const selectedBlockId = getSelectedBlockClientId(); 39653 const selectedBlockChildren = getBlockOrder(selectedBlockId); 39654 if (selectedBlockChildren?.length === 1) { 39655 const singleBlock = getBlock(selectedBlockChildren[0]); 39656 _onlyDescendantIsEmptyLink = singleBlock?.name === "core/navigation-link" && !singleBlock?.attributes?.label; 39657 } 39658 return { 39659 parentCount: getBlockParentsByBlockName( 39660 clientId, 39661 "core/navigation-submenu" 39662 ).length, 39663 isParentOfSelectedBlock: hasSelectedInnerBlock( 39664 clientId, 39665 true 39666 ), 39667 isImmediateParentOfSelectedBlock: hasSelectedInnerBlock( 39668 clientId, 39669 false 39670 ), 39671 hasChildren: !!getBlockCount(clientId), 39672 selectedBlockHasChildren: !!selectedBlockChildren?.length, 39673 onlyDescendantIsEmptyLink: _onlyDescendantIsEmptyLink 39674 }; 39675 }, 39676 [clientId] 39677 ); 39678 const prevHasChildren = (0, import_compose32.usePrevious)(hasChildren); 39679 (0, import_element76.useEffect)(() => { 39680 if (!openSubmenusOnClick && !url) { 39681 setIsLinkOpen(true); 39682 } 39683 }, []); 39684 (0, import_element76.useEffect)(() => { 39685 if (!isSelected) { 39686 setIsLinkOpen(false); 39687 } 39688 }, [isSelected]); 39689 (0, import_element76.useEffect)(() => { 39690 if (isLinkOpen && url) { 39691 if ((0, import_url14.isURL)((0, import_url14.prependHTTP)(label)) && /^.+\.[a-z]+/.test(label)) { 39692 selectLabelText(); 39693 } 39694 } 39695 }, [url]); 39696 function selectLabelText() { 39697 ref.current.focus(); 39698 const { ownerDocument } = ref.current; 39699 const { defaultView } = ownerDocument; 39700 const selection = defaultView.getSelection(); 39701 const range = ownerDocument.createRange(); 39702 range.selectNodeContents(ref.current); 39703 selection.removeAllRanges(); 39704 selection.addRange(range); 39705 } 39706 const { 39707 textColor, 39708 customTextColor, 39709 backgroundColor, 39710 customBackgroundColor 39711 } = getColors(context, parentCount > 0); 39712 function onKeyDown(event) { 39713 if (import_keycodes7.isKeyboardEvent.primary(event, "k")) { 39714 event.preventDefault(); 39715 event.stopPropagation(); 39716 setIsLinkOpen(true); 39717 } 39718 } 39719 const blockProps = (0, import_block_editor157.useBlockProps)({ 39720 ref: (0, import_compose32.useMergeRefs)([setPopoverAnchor, listItemRef]), 39721 className: clsx_default("wp-block-navigation-item", { 39722 "is-editing": isSelected || isParentOfSelectedBlock, 39723 "is-dragging-within": isDraggingWithin, 39724 "has-link": !!url, 39725 "has-child": hasChildren, 39726 "has-text-color": !!textColor || !!customTextColor, 39727 [(0, import_block_editor157.getColorClassName)("color", textColor)]: !!textColor, 39728 "has-background": !!backgroundColor || customBackgroundColor, 39729 [(0, import_block_editor157.getColorClassName)("background-color", backgroundColor)]: !!backgroundColor, 39730 "open-on-click": openSubmenusOnClick 39731 }), 39732 style: { 39733 color: !textColor && customTextColor, 39734 backgroundColor: !backgroundColor && customBackgroundColor 39735 }, 39736 onKeyDown 39737 }); 39738 const innerBlocksColors = getColors(context, true); 39739 const allowedBlocks = parentCount >= maxNestingLevel ? ALLOWED_BLOCKS.filter( 39740 (blockName) => blockName !== "core/navigation-submenu" 39741 ) : ALLOWED_BLOCKS; 39742 const navigationChildBlockProps = getNavigationChildBlockProps(innerBlocksColors); 39743 const innerBlocksProps = (0, import_block_editor157.useInnerBlocksProps)(navigationChildBlockProps, { 39744 allowedBlocks, 39745 defaultBlock: DEFAULT_BLOCK5, 39746 directInsert: true, 39747 // Ensure block toolbar is not too far removed from item 39748 // being edited. 39749 // see: https://github.com/WordPress/gutenberg/pull/34615. 39750 __experimentalCaptureToolbars: true, 39751 renderAppender: isSelected || isImmediateParentOfSelectedBlock && !selectedBlockHasChildren || // Show the appender while dragging to allow inserting element between item and the appender. 39752 hasChildren ? import_block_editor157.InnerBlocks.ButtonBlockAppender : false 39753 }); 39754 const ParentElement = openSubmenusOnClick ? "button" : "a"; 39755 function transformToLink() { 39756 const newLinkBlock = (0, import_blocks64.createBlock)("core/navigation-link", attributes3); 39757 replaceBlock(clientId, newLinkBlock); 39758 } 39759 (0, import_element76.useEffect)(() => { 39760 if (!hasChildren && prevHasChildren) { 39761 __unstableMarkNextChangeAsNotPersistent(); 39762 transformToLink(); 39763 } 39764 }, [hasChildren, prevHasChildren]); 39765 const canConvertToLink = !selectedBlockHasChildren || onlyDescendantIsEmptyLink; 39766 return /* @__PURE__ */ (0, import_jsx_runtime320.jsxs)(import_jsx_runtime320.Fragment, { children: [ 39767 /* @__PURE__ */ (0, import_jsx_runtime320.jsx)(import_block_editor157.BlockControls, { children: /* @__PURE__ */ (0, import_jsx_runtime320.jsxs)(import_components88.ToolbarGroup, { children: [ 39768 !openSubmenusOnClick && /* @__PURE__ */ (0, import_jsx_runtime320.jsx)( 39769 import_components88.ToolbarButton, 39770 { 39771 name: "link", 39772 icon: link_default, 39773 title: (0, import_i18n138.__)("Link"), 39774 shortcut: import_keycodes7.displayShortcut.primary("k"), 39775 onClick: () => { 39776 setIsLinkOpen(true); 39777 } 39778 } 39779 ), 39780 /* @__PURE__ */ (0, import_jsx_runtime320.jsx)( 39781 import_components88.ToolbarButton, 39782 { 39783 name: "revert", 39784 icon: remove_submenu_default, 39785 title: (0, import_i18n138.__)("Convert to Link"), 39786 onClick: transformToLink, 39787 className: "wp-block-navigation__submenu__revert", 39788 disabled: !canConvertToLink 39789 } 39790 ) 39791 ] }) }), 39792 /* @__PURE__ */ (0, import_jsx_runtime320.jsx)(import_block_editor157.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime320.jsx)( 39793 Controls2, 39794 { 39795 attributes: attributes3, 39796 setAttributes, 39797 clientId 39798 } 39799 ) }), 39800 /* @__PURE__ */ (0, import_jsx_runtime320.jsxs)("div", { ...blockProps, children: [ 39801 /* @__PURE__ */ (0, import_jsx_runtime320.jsxs)(ParentElement, { className: "wp-block-navigation-item__content", children: [ 39802 /* @__PURE__ */ (0, import_jsx_runtime320.jsx)( 39803 import_block_editor157.RichText, 39804 { 39805 ref, 39806 identifier: "label", 39807 className: "wp-block-navigation-item__label", 39808 value: label, 39809 onChange: (labelValue) => setAttributes({ label: labelValue }), 39810 onMerge: mergeBlocks, 39811 onReplace, 39812 "aria-label": (0, import_i18n138.__)("Navigation link text"), 39813 placeholder: itemLabelPlaceholder, 39814 withoutInteractiveFormatting: true, 39815 onClick: () => { 39816 if (!openSubmenusOnClick && !url) { 39817 setIsLinkOpen(true); 39818 } 39819 } 39820 } 39821 ), 39822 description && /* @__PURE__ */ (0, import_jsx_runtime320.jsx)("span", { className: "wp-block-navigation-item__description", children: description }), 39823 !openSubmenusOnClick && isLinkOpen && /* @__PURE__ */ (0, import_jsx_runtime320.jsx)( 39824 LinkUI, 39825 { 39826 clientId, 39827 link: attributes3, 39828 onClose: () => { 39829 setIsLinkOpen(false); 39830 }, 39831 anchor: popoverAnchor, 39832 onRemove: () => { 39833 setAttributes({ url: "" }); 39834 (0, import_a11y4.speak)((0, import_i18n138.__)("Link removed."), "assertive"); 39835 }, 39836 onChange: (updatedValue) => { 39837 const { 39838 isEntityLink, 39839 attributes: updatedAttributes 39840 } = updateAttributes( 39841 updatedValue, 39842 setAttributes, 39843 attributes3 39844 ); 39845 if (isEntityLink) { 39846 createBinding(updatedAttributes); 39847 } else { 39848 clearBinding(); 39849 } 39850 } 39851 } 39852 ) 39853 ] }), 39854 (showSubmenuIcon || openSubmenusOnClick) && /* @__PURE__ */ (0, import_jsx_runtime320.jsx)("span", { className: "wp-block-navigation__submenu-icon", children: /* @__PURE__ */ (0, import_jsx_runtime320.jsx)(ItemSubmenuIcon, {}) }), 39855 /* @__PURE__ */ (0, import_jsx_runtime320.jsx)("div", { ...innerBlocksProps }) 39856 ] }) 39857 ] }); 39858 } 39859 39860 // packages/block-library/build-module/navigation-submenu/save.js 39861 var import_block_editor158 = __toESM(require_block_editor()); 39862 var import_jsx_runtime321 = __toESM(require_jsx_runtime()); 39863 function save35() { 39864 return /* @__PURE__ */ (0, import_jsx_runtime321.jsx)(import_block_editor158.InnerBlocks.Content, {}); 39865 } 39866 39867 // packages/block-library/build-module/navigation-submenu/transforms.js 39868 var import_blocks65 = __toESM(require_blocks()); 39869 var transforms19 = { 39870 to: [ 39871 { 39872 type: "block", 39873 blocks: ["core/navigation-link"], 39874 isMatch: (attributes3, block) => block?.innerBlocks?.length === 0, 39875 transform: (attributes3) => (0, import_blocks65.createBlock)("core/navigation-link", attributes3) 39876 }, 39877 { 39878 type: "block", 39879 blocks: ["core/spacer"], 39880 isMatch: (attributes3, block) => block?.innerBlocks?.length === 0, 39881 transform: () => { 39882 return (0, import_blocks65.createBlock)("core/spacer"); 39883 } 39884 }, 39885 { 39886 type: "block", 39887 blocks: ["core/site-logo"], 39888 isMatch: (attributes3, block) => block?.innerBlocks?.length === 0, 39889 transform: () => { 39890 return (0, import_blocks65.createBlock)("core/site-logo"); 39891 } 39892 }, 39893 { 39894 type: "block", 39895 blocks: ["core/home-link"], 39896 isMatch: (attributes3, block) => block?.innerBlocks?.length === 0, 39897 transform: () => { 39898 return (0, import_blocks65.createBlock)("core/home-link"); 39899 } 39900 }, 39901 { 39902 type: "block", 39903 blocks: ["core/social-links"], 39904 isMatch: (attributes3, block) => block?.innerBlocks?.length === 0, 39905 transform: () => { 39906 return (0, import_blocks65.createBlock)("core/social-links"); 39907 } 39908 }, 39909 { 39910 type: "block", 39911 blocks: ["core/search"], 39912 isMatch: (attributes3, block) => block?.innerBlocks?.length === 0, 39913 transform: () => { 39914 return (0, import_blocks65.createBlock)("core/search"); 39915 } 39916 } 39917 ] 39918 }; 39919 var transforms_default20 = transforms19; 39920 39921 // packages/block-library/build-module/navigation-submenu/index.js 39922 var { fieldsKey: fieldsKey13, formKey: formKey13 } = unlock(import_blocks66.privateApis); 39923 var { name: name55 } = block_default55; 39924 var settings55 = { 39925 icon: ({ context }) => { 39926 if (context === "list-view") { 39927 return page_default; 39928 } 39929 return add_submenu_default; 39930 }, 39931 __experimentalLabel(attributes3, { context }) { 39932 const { label } = attributes3; 39933 const customName = attributes3?.metadata?.name; 39934 if (context === "list-view" && (customName || label)) { 39935 return attributes3?.metadata?.name || label; 39936 } 39937 return label; 39938 }, 39939 edit: NavigationSubmenuEdit, 39940 example: { 39941 attributes: { 39942 label: (0, import_i18n139._x)("About", "Example link text for Navigation Submenu"), 39943 type: "page" 39944 } 39945 }, 39946 save: save35, 39947 transforms: transforms_default20 39948 }; 39949 if (window.__experimentalContentOnlyInspectorFields) { 39950 settings55[fieldsKey13] = [ 39951 { 39952 id: "label", 39953 label: (0, import_i18n139.__)("Label"), 39954 type: "richtext" 39955 }, 39956 { 39957 id: "link", 39958 label: (0, import_i18n139.__)("Link"), 39959 type: "link", 39960 mapping: { 39961 href: "url", 39962 rel: "rel" 39963 // TODO - opens in new tab? id? 39964 } 39965 } 39966 ]; 39967 settings55[formKey13] = { 39968 fields: ["label"] 39969 }; 39970 } 39971 var init55 = () => initBlock({ name: name55, metadata: block_default55, settings: settings55 }); 39972 39973 // packages/block-library/build-module/nextpage/index.js 39974 var nextpage_exports = {}; 39975 __export(nextpage_exports, { 39976 init: () => init56, 39977 metadata: () => block_default56, 39978 name: () => name56, 39979 settings: () => settings56 39980 }); 39981 39982 // packages/block-library/build-module/nextpage/edit.js 39983 var import_i18n140 = __toESM(require_i18n()); 39984 var import_block_editor159 = __toESM(require_block_editor()); 39985 var import_jsx_runtime322 = __toESM(require_jsx_runtime()); 39986 function NextPageEdit() { 39987 return /* @__PURE__ */ (0, import_jsx_runtime322.jsx)("div", { ...(0, import_block_editor159.useBlockProps)(), children: /* @__PURE__ */ (0, import_jsx_runtime322.jsx)("span", { children: (0, import_i18n140.__)("Page break") }) }); 39988 } 39989 39990 // packages/block-library/build-module/nextpage/block.json 39991 var block_default56 = { 39992 $schema: "https://schemas.wp.org/trunk/block.json", 39993 apiVersion: 3, 39994 name: "core/nextpage", 39995 title: "Page Break", 39996 category: "design", 39997 description: "Separate your content into a multi-page experience.", 39998 keywords: ["next page", "pagination"], 39999 parent: ["core/post-content"], 40000 textdomain: "default", 40001 supports: { 40002 customClassName: false, 40003 className: false, 40004 html: false, 40005 interactivity: { 40006 clientNavigation: true 40007 } 40008 }, 40009 editorStyle: "wp-block-nextpage-editor" 40010 }; 40011 40012 // packages/block-library/build-module/nextpage/save.js 40013 var import_element77 = __toESM(require_element()); 40014 var import_jsx_runtime323 = __toESM(require_jsx_runtime()); 40015 function save36() { 40016 return /* @__PURE__ */ (0, import_jsx_runtime323.jsx)(import_element77.RawHTML, { children: "<!--nextpage-->" }); 40017 } 40018 40019 // packages/block-library/build-module/nextpage/transforms.js 40020 var import_blocks67 = __toESM(require_blocks()); 40021 var transforms20 = { 40022 from: [ 40023 { 40024 type: "raw", 40025 schema: { 40026 "wp-block": { attributes: ["data-block"] } 40027 }, 40028 isMatch: (node) => node.dataset && node.dataset.block === "core/nextpage", 40029 transform() { 40030 return (0, import_blocks67.createBlock)("core/nextpage", {}); 40031 } 40032 } 40033 ] 40034 }; 40035 var transforms_default21 = transforms20; 40036 40037 // packages/block-library/build-module/nextpage/index.js 40038 var { name: name56 } = block_default56; 40039 var settings56 = { 40040 icon: page_break_default, 40041 example: {}, 40042 transforms: transforms_default21, 40043 edit: NextPageEdit, 40044 save: save36 40045 }; 40046 var init56 = () => initBlock({ name: name56, metadata: block_default56, settings: settings56 }); 40047 40048 // packages/block-library/build-module/navigation-overlay-close/index.js 40049 var navigation_overlay_close_exports = {}; 40050 __export(navigation_overlay_close_exports, { 40051 init: () => init57, 40052 metadata: () => block_default57, 40053 name: () => name57, 40054 settings: () => settings57 40055 }); 40056 var import_hooks45 = __toESM(require_hooks()); 40057 var import_data80 = __toESM(require_data()); 40058 var import_core_data46 = __toESM(require_core_data()); 40059 40060 // packages/block-library/build-module/navigation-overlay-close/edit.js 40061 var import_block_editor160 = __toESM(require_block_editor()); 40062 var import_components89 = __toESM(require_components()); 40063 var import_i18n141 = __toESM(require_i18n()); 40064 var import_jsx_runtime324 = __toESM(require_jsx_runtime()); 40065 function NavigationOverlayCloseEdit({ 40066 attributes: attributes3, 40067 setAttributes 40068 }) { 40069 const { displayMode, text } = attributes3; 40070 const showIcon = displayMode === "icon" || displayMode === "both"; 40071 const showText = displayMode === "text" || displayMode === "both"; 40072 const blockProps = (0, import_block_editor160.useBlockProps)({ 40073 className: "wp-block-navigation-overlay-close" 40074 }); 40075 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 40076 return /* @__PURE__ */ (0, import_jsx_runtime324.jsxs)(import_jsx_runtime324.Fragment, { children: [ 40077 /* @__PURE__ */ (0, import_jsx_runtime324.jsx)(import_block_editor160.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime324.jsx)( 40078 import_components89.__experimentalToolsPanel, 40079 { 40080 label: (0, import_i18n141.__)("Settings"), 40081 resetAll: () => setAttributes({ displayMode: "icon" }), 40082 dropdownMenuProps, 40083 children: /* @__PURE__ */ (0, import_jsx_runtime324.jsx)( 40084 import_components89.__experimentalToolsPanelItem, 40085 { 40086 label: (0, import_i18n141.__)("Display Mode"), 40087 isShownByDefault: true, 40088 hasValue: () => displayMode !== "icon", 40089 onDeselect: () => setAttributes({ displayMode: "icon" }), 40090 children: /* @__PURE__ */ (0, import_jsx_runtime324.jsxs)( 40091 import_components89.__experimentalToggleGroupControl, 40092 { 40093 label: (0, import_i18n141.__)("Display Mode"), 40094 value: displayMode, 40095 onChange: (value) => setAttributes({ displayMode: value }), 40096 isBlock: true, 40097 __next40pxDefaultSize: true, 40098 children: [ 40099 /* @__PURE__ */ (0, import_jsx_runtime324.jsx)( 40100 import_components89.__experimentalToggleGroupControlOption, 40101 { 40102 value: "icon", 40103 label: (0, import_i18n141.__)("Icon") 40104 } 40105 ), 40106 /* @__PURE__ */ (0, import_jsx_runtime324.jsx)( 40107 import_components89.__experimentalToggleGroupControlOption, 40108 { 40109 value: "text", 40110 label: (0, import_i18n141.__)("Text") 40111 } 40112 ), 40113 /* @__PURE__ */ (0, import_jsx_runtime324.jsx)( 40114 import_components89.__experimentalToggleGroupControlOption, 40115 { 40116 value: "both", 40117 label: (0, import_i18n141.__)("Both") 40118 } 40119 ) 40120 ] 40121 } 40122 ) 40123 } 40124 ) 40125 } 40126 ) }), 40127 /* @__PURE__ */ (0, import_jsx_runtime324.jsxs)( 40128 "button", 40129 { 40130 ...blockProps, 40131 type: "button", 40132 "aria-label": !showText ? (0, import_i18n141.__)("Close") : void 0, 40133 children: [ 40134 showIcon && /* @__PURE__ */ (0, import_jsx_runtime324.jsx)(icon_default5, { icon: close_default }), 40135 showText && /* @__PURE__ */ (0, import_jsx_runtime324.jsx)( 40136 import_block_editor160.RichText, 40137 { 40138 identifier: "text", 40139 value: text, 40140 onChange: (value) => setAttributes({ text: value }), 40141 placeholder: (0, import_i18n141.__)("Close"), 40142 withoutInteractiveFormatting: true, 40143 tagName: "span", 40144 className: "wp-block-navigation-overlay-close__text", 40145 allowedFormats: ["core/bold", "core/italic"] 40146 } 40147 ) 40148 ] 40149 } 40150 ) 40151 ] }); 40152 } 40153 40154 // packages/block-library/build-module/navigation-overlay-close/block.json 40155 var block_default57 = { 40156 $schema: "https://schemas.wp.org/trunk/block.json", 40157 __experimental: true, 40158 apiVersion: 3, 40159 name: "core/navigation-overlay-close", 40160 title: "Navigation Overlay Close", 40161 category: "design", 40162 description: "A customizable button to close overlays.", 40163 keywords: ["close", "overlay", "navigation", "menu"], 40164 textdomain: "default", 40165 attributes: { 40166 displayMode: { 40167 type: "string", 40168 enum: ["icon", "text", "both"], 40169 default: "icon" 40170 }, 40171 text: { 40172 type: "rich-text", 40173 source: "rich-text", 40174 selector: "span", 40175 default: "Close" 40176 } 40177 }, 40178 supports: { 40179 color: { 40180 gradients: false, 40181 __experimentalDefaultControls: { 40182 background: true, 40183 text: true 40184 } 40185 }, 40186 spacing: { 40187 padding: true, 40188 __experimentalDefaultControls: { 40189 padding: true 40190 } 40191 }, 40192 typography: { 40193 fontSize: true, 40194 lineHeight: true, 40195 __experimentalFontFamily: true, 40196 __experimentalFontWeight: true, 40197 __experimentalFontStyle: true, 40198 __experimentalTextTransform: true, 40199 __experimentalTextDecoration: true, 40200 __experimentalLetterSpacing: true, 40201 __experimentalDefaultControls: { 40202 fontSize: true 40203 } 40204 } 40205 }, 40206 style: "wp-block-navigation-overlay-close" 40207 }; 40208 40209 // packages/block-library/build-module/navigation-overlay-close/save.js 40210 var import_block_editor161 = __toESM(require_block_editor()); 40211 var import_jsx_runtime325 = __toESM(require_jsx_runtime()); 40212 var saveBlockProps = import_block_editor161.useBlockProps.save; 40213 function NavigationOverlayCloseSave({ attributes: attributes3 }) { 40214 const { displayMode, text } = attributes3; 40215 const showIcon = displayMode === "icon" || displayMode === "both"; 40216 const showText = displayMode === "text" || displayMode === "both"; 40217 const blockProps = saveBlockProps({ 40218 className: "wp-block-navigation-overlay-close" 40219 }); 40220 return /* @__PURE__ */ (0, import_jsx_runtime325.jsxs)( 40221 "button", 40222 { 40223 ...blockProps, 40224 type: "button", 40225 "aria-label": !showText ? "Close" : void 0, 40226 children: [ 40227 showIcon && /* @__PURE__ */ (0, import_jsx_runtime325.jsx)( 40228 "svg", 40229 { 40230 xmlns: "http://www.w3.org/2000/svg", 40231 viewBox: "0 0 24 24", 40232 width: "24", 40233 height: "24", 40234 "aria-hidden": "true", 40235 focusable: "false", 40236 children: /* @__PURE__ */ (0, import_jsx_runtime325.jsx)("path", { d: "M13 11.8l6.1-6.3-1.1-1-6.1 6.2-6.1-6.2-1.1 1 6.1 6.3-6.5 6.7 1.1 1 6.5-6.6 6.5 6.6 1.1-1z" }) 40237 } 40238 ), 40239 showText && /* @__PURE__ */ (0, import_jsx_runtime325.jsx)( 40240 import_block_editor161.RichText.Content, 40241 { 40242 tagName: "span", 40243 value: text, 40244 className: "wp-block-navigation-overlay-close__text" 40245 } 40246 ) 40247 ] 40248 } 40249 ); 40250 } 40251 40252 // packages/block-library/build-module/navigation-overlay-close/icon.js 40253 var import_primitives153 = __toESM(require_primitives()); 40254 var import_jsx_runtime326 = __toESM(require_jsx_runtime()); 40255 var icon_default6 = /* @__PURE__ */ (0, import_jsx_runtime326.jsx)(import_primitives153.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime326.jsx)(import_primitives153.Path, { 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.5v12ZM15 8l-3 3-3-3-1.1 1.1 3 3-3 3L9 16.2l3-3 3 3 1.1-1.1-3-3 3-3L15 8Z" }) }); 40256 40257 // packages/block-library/build-module/navigation-overlay-close/index.js 40258 var { name: name57 } = block_default57; 40259 var settings57 = { 40260 icon: icon_default6, 40261 edit: NavigationOverlayCloseEdit, 40262 save: NavigationOverlayCloseSave 40263 }; 40264 function isWithinOverlay() { 40265 const editorStore = (0, import_data80.select)("core/editor"); 40266 if (!editorStore) { 40267 return false; 40268 } 40269 const { getCurrentPostType, getCurrentPostId } = editorStore; 40270 const { getEditedEntityRecord } = (0, import_data80.select)(import_core_data46.store); 40271 const postType = getCurrentPostType(); 40272 const postId = getCurrentPostId(); 40273 if (postType === "wp_template_part" && postId) { 40274 const templatePartEntity = getEditedEntityRecord( 40275 "postType", 40276 "wp_template_part", 40277 postId 40278 ); 40279 return templatePartEntity?.area === "overlay"; 40280 } 40281 return false; 40282 } 40283 var init57 = () => { 40284 (0, import_hooks45.addFilter)( 40285 "blockEditor.__unstableCanInsertBlockType", 40286 "core/navigation-overlay-close/restrict-to-overlay-template-parts", 40287 (canInsert, blockType) => { 40288 if (blockType.name !== "core/navigation-overlay-close") { 40289 return canInsert; 40290 } 40291 if (!canInsert) { 40292 return canInsert; 40293 } 40294 return isWithinOverlay(); 40295 } 40296 ); 40297 return initBlock({ name: name57, metadata: block_default57, settings: settings57 }); 40298 }; 40299 40300 // packages/block-library/build-module/pattern/index.js 40301 var pattern_exports = {}; 40302 __export(pattern_exports, { 40303 init: () => init58, 40304 metadata: () => block_default58, 40305 name: () => name58, 40306 settings: () => settings58 40307 }); 40308 40309 // packages/block-library/build-module/pattern/block.json 40310 var block_default58 = { 40311 $schema: "https://schemas.wp.org/trunk/block.json", 40312 apiVersion: 3, 40313 name: "core/pattern", 40314 title: "Pattern Placeholder", 40315 category: "theme", 40316 description: "Show a block pattern.", 40317 supports: { 40318 html: false, 40319 inserter: false, 40320 renaming: false, 40321 visibility: false, 40322 interactivity: { 40323 clientNavigation: true 40324 } 40325 }, 40326 textdomain: "default", 40327 attributes: { 40328 slug: { 40329 type: "string" 40330 } 40331 } 40332 }; 40333 40334 // packages/block-library/build-module/pattern/edit.js 40335 var import_blocks68 = __toESM(require_blocks()); 40336 var import_data82 = __toESM(require_data()); 40337 var import_element78 = __toESM(require_element()); 40338 var import_block_editor162 = __toESM(require_block_editor()); 40339 var import_core_data47 = __toESM(require_core_data()); 40340 var import_i18n142 = __toESM(require_i18n()); 40341 40342 // packages/block-library/build-module/pattern/recursion-detector.js 40343 var import_data81 = __toESM(require_data()); 40344 var cachedParsers = /* @__PURE__ */ new WeakMap(); 40345 function useParsePatternDependencies() { 40346 const registry = (0, import_data81.useRegistry)(); 40347 if (!cachedParsers.has(registry)) { 40348 const deps = /* @__PURE__ */ new Map(); 40349 cachedParsers.set( 40350 registry, 40351 parsePatternDependencies.bind(null, deps) 40352 ); 40353 } 40354 return cachedParsers.get(registry); 40355 } 40356 function parsePatternDependencies(deps, { name: name117, blocks }) { 40357 const queue = [...blocks]; 40358 while (queue.length) { 40359 const block = queue.shift(); 40360 for (const innerBlock of block.innerBlocks ?? []) { 40361 queue.unshift(innerBlock); 40362 } 40363 if (block.name === "core/pattern") { 40364 registerDependency(deps, name117, block.attributes.slug); 40365 } 40366 } 40367 } 40368 function registerDependency(deps, a2, b2) { 40369 if (!deps.has(a2)) { 40370 deps.set(a2, /* @__PURE__ */ new Set()); 40371 } 40372 deps.get(a2).add(b2); 40373 if (hasCycle(deps, a2)) { 40374 throw new TypeError( 40375 `Pattern $a2} has a circular dependency and cannot be rendered.` 40376 ); 40377 } 40378 } 40379 function hasCycle(deps, slug, visitedNodes = /* @__PURE__ */ new Set(), currentPath = /* @__PURE__ */ new Set()) { 40380 visitedNodes.add(slug); 40381 currentPath.add(slug); 40382 const dependencies = deps.get(slug) ?? /* @__PURE__ */ new Set(); 40383 for (const dependency of dependencies) { 40384 if (!visitedNodes.has(dependency)) { 40385 if (hasCycle(deps, dependency, visitedNodes, currentPath)) { 40386 return true; 40387 } 40388 } else if (currentPath.has(dependency)) { 40389 return true; 40390 } 40391 } 40392 currentPath.delete(slug); 40393 return false; 40394 } 40395 40396 // packages/block-library/build-module/pattern/edit.js 40397 var import_jsx_runtime327 = __toESM(require_jsx_runtime()); 40398 var PatternEdit = ({ attributes: attributes3, clientId }) => { 40399 const registry = (0, import_data82.useRegistry)(); 40400 const selectedPattern = (0, import_data82.useSelect)( 40401 (select9) => select9(import_block_editor162.store).__experimentalGetParsedPattern( 40402 attributes3.slug 40403 ), 40404 [attributes3.slug] 40405 ); 40406 const currentThemeStylesheet = (0, import_data82.useSelect)( 40407 (select9) => select9(import_core_data47.store).getCurrentTheme()?.stylesheet, 40408 [] 40409 ); 40410 const { 40411 replaceBlocks, 40412 setBlockEditingMode, 40413 __unstableMarkNextChangeAsNotPersistent 40414 } = (0, import_data82.useDispatch)(import_block_editor162.store); 40415 const { getBlockRootClientId, getBlockEditingMode } = (0, import_data82.useSelect)(import_block_editor162.store); 40416 const [hasRecursionError, setHasRecursionError] = (0, import_element78.useState)(false); 40417 const parsePatternDependencies2 = useParsePatternDependencies(); 40418 function injectThemeAttributeInBlockTemplateContent(block) { 40419 if (block.innerBlocks.find( 40420 (innerBlock) => innerBlock.name === "core/template-part" 40421 )) { 40422 block.innerBlocks = block.innerBlocks.map((innerBlock) => { 40423 if (innerBlock.name === "core/template-part" && innerBlock.attributes.theme === void 0) { 40424 innerBlock.attributes.theme = currentThemeStylesheet; 40425 } 40426 return innerBlock; 40427 }); 40428 } 40429 if (block.name === "core/template-part" && block.attributes.theme === void 0) { 40430 block.attributes.theme = currentThemeStylesheet; 40431 } 40432 return block; 40433 } 40434 (0, import_element78.useEffect)(() => { 40435 if (!hasRecursionError && selectedPattern?.blocks) { 40436 try { 40437 parsePatternDependencies2(selectedPattern); 40438 } catch (error) { 40439 setHasRecursionError(true); 40440 return; 40441 } 40442 window.queueMicrotask(() => { 40443 const rootClientId = getBlockRootClientId(clientId); 40444 const clonedBlocks = selectedPattern.blocks.map( 40445 (block) => (0, import_blocks68.cloneBlock)( 40446 injectThemeAttributeInBlockTemplateContent(block) 40447 ) 40448 ); 40449 if (clonedBlocks.length === 1 && selectedPattern.categories?.length > 0) { 40450 clonedBlocks[0].attributes = { 40451 ...clonedBlocks[0].attributes, 40452 metadata: { 40453 ...clonedBlocks[0].attributes.metadata, 40454 categories: selectedPattern.categories, 40455 patternName: selectedPattern.name, 40456 name: clonedBlocks[0].attributes.metadata.name || selectedPattern.title 40457 } 40458 }; 40459 } 40460 const rootEditingMode = getBlockEditingMode(rootClientId); 40461 registry.batch(() => { 40462 __unstableMarkNextChangeAsNotPersistent(); 40463 setBlockEditingMode(rootClientId, "default"); 40464 __unstableMarkNextChangeAsNotPersistent(); 40465 replaceBlocks(clientId, clonedBlocks); 40466 __unstableMarkNextChangeAsNotPersistent(); 40467 setBlockEditingMode(rootClientId, rootEditingMode); 40468 }); 40469 }); 40470 } 40471 }, [ 40472 clientId, 40473 hasRecursionError, 40474 selectedPattern, 40475 __unstableMarkNextChangeAsNotPersistent, 40476 replaceBlocks, 40477 getBlockEditingMode, 40478 setBlockEditingMode, 40479 getBlockRootClientId 40480 ]); 40481 const props = (0, import_block_editor162.useBlockProps)(); 40482 if (hasRecursionError) { 40483 return /* @__PURE__ */ (0, import_jsx_runtime327.jsx)("div", { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(import_block_editor162.Warning, { children: (0, import_i18n142.sprintf)( 40484 // translators: A warning in which %s is the name of a pattern. 40485 (0, import_i18n142.__)('Pattern "%s" cannot be rendered inside itself.'), 40486 selectedPattern?.name 40487 ) }) }); 40488 } 40489 return /* @__PURE__ */ (0, import_jsx_runtime327.jsx)("div", { ...props }); 40490 }; 40491 var edit_default20 = PatternEdit; 40492 40493 // packages/block-library/build-module/pattern/index.js 40494 var { name: name58 } = block_default58; 40495 var settings58 = { 40496 edit: edit_default20 40497 }; 40498 var init58 = () => initBlock({ name: name58, metadata: block_default58, settings: settings58 }); 40499 40500 // packages/block-library/build-module/page-list/index.js 40501 var page_list_exports = {}; 40502 __export(page_list_exports, { 40503 init: () => init59, 40504 metadata: () => block_default59, 40505 name: () => name59, 40506 settings: () => settings59 40507 }); 40508 40509 // packages/block-library/build-module/page-list/block.json 40510 var block_default59 = { 40511 $schema: "https://schemas.wp.org/trunk/block.json", 40512 apiVersion: 3, 40513 name: "core/page-list", 40514 title: "Page List", 40515 category: "widgets", 40516 allowedBlocks: ["core/page-list-item"], 40517 description: "Display a list of all pages.", 40518 keywords: ["menu", "navigation"], 40519 textdomain: "default", 40520 attributes: { 40521 parentPageID: { 40522 type: "integer", 40523 default: 0 40524 }, 40525 isNested: { 40526 type: "boolean", 40527 default: false 40528 } 40529 }, 40530 usesContext: [ 40531 "textColor", 40532 "customTextColor", 40533 "backgroundColor", 40534 "customBackgroundColor", 40535 "overlayTextColor", 40536 "customOverlayTextColor", 40537 "overlayBackgroundColor", 40538 "customOverlayBackgroundColor", 40539 "fontSize", 40540 "customFontSize", 40541 "showSubmenuIcon", 40542 "style", 40543 "openSubmenusOnClick" 40544 ], 40545 supports: { 40546 reusable: false, 40547 html: false, 40548 typography: { 40549 fontSize: true, 40550 lineHeight: true, 40551 __experimentalFontFamily: true, 40552 __experimentalFontWeight: true, 40553 __experimentalFontStyle: true, 40554 __experimentalTextTransform: true, 40555 __experimentalTextDecoration: true, 40556 __experimentalLetterSpacing: true, 40557 __experimentalDefaultControls: { 40558 fontSize: true 40559 } 40560 }, 40561 interactivity: { 40562 clientNavigation: true 40563 }, 40564 color: { 40565 text: true, 40566 background: true, 40567 link: true, 40568 gradients: true, 40569 __experimentalDefaultControls: { 40570 background: true, 40571 text: true, 40572 link: true 40573 } 40574 }, 40575 __experimentalBorder: { 40576 radius: true, 40577 color: true, 40578 width: true, 40579 style: true 40580 }, 40581 spacing: { 40582 padding: true, 40583 margin: true, 40584 __experimentalDefaultControls: { 40585 padding: false, 40586 margin: false 40587 } 40588 }, 40589 contentRole: true 40590 }, 40591 editorStyle: "wp-block-page-list-editor", 40592 style: "wp-block-page-list" 40593 }; 40594 40595 // packages/block-library/build-module/page-list/edit.js 40596 var import_blocks70 = __toESM(require_blocks()); 40597 var import_block_editor164 = __toESM(require_block_editor()); 40598 var import_components91 = __toESM(require_components()); 40599 var import_i18n144 = __toESM(require_i18n()); 40600 var import_element79 = __toESM(require_element()); 40601 var import_core_data48 = __toESM(require_core_data()); 40602 var import_data84 = __toESM(require_data()); 40603 40604 // packages/block-library/build-module/page-list/use-convert-to-navigation-links.js 40605 var import_blocks69 = __toESM(require_blocks()); 40606 var import_data83 = __toESM(require_data()); 40607 var import_block_editor163 = __toESM(require_block_editor()); 40608 function createNavigationLinks(pages = []) { 40609 const POST_TYPE_KIND = "post-type"; 40610 const linkMap = {}; 40611 const navigationLinks = []; 40612 pages.forEach(({ id, title, link: url, type, parent }) => { 40613 const innerBlocks = linkMap[id]?.innerBlocks ?? []; 40614 linkMap[id] = (0, import_blocks69.createBlock)( 40615 "core/navigation-link", 40616 { 40617 id, 40618 label: title.rendered, 40619 url, 40620 type, 40621 kind: POST_TYPE_KIND, 40622 metadata: { 40623 bindings: buildNavigationLinkEntityBinding(POST_TYPE_KIND) 40624 } 40625 }, 40626 innerBlocks 40627 ); 40628 if (!parent) { 40629 navigationLinks.push(linkMap[id]); 40630 } else { 40631 if (!linkMap[parent]) { 40632 linkMap[parent] = { innerBlocks: [] }; 40633 } 40634 const parentLinkInnerBlocks = linkMap[parent].innerBlocks; 40635 parentLinkInnerBlocks.push(linkMap[id]); 40636 } 40637 }); 40638 return navigationLinks; 40639 } 40640 function findNavigationLinkById(navigationLinks, id) { 40641 for (const navigationLink of navigationLinks) { 40642 if (navigationLink.attributes.id === id) { 40643 return navigationLink; 40644 } 40645 if (navigationLink.innerBlocks && navigationLink.innerBlocks.length) { 40646 const foundNavigationLink = findNavigationLinkById( 40647 navigationLink.innerBlocks, 40648 id 40649 ); 40650 if (foundNavigationLink) { 40651 return foundNavigationLink; 40652 } 40653 } 40654 } 40655 return null; 40656 } 40657 function convertToNavigationLinks(pages = [], parentPageID = null) { 40658 let navigationLinks = createNavigationLinks(pages); 40659 if (parentPageID) { 40660 const parentPage = findNavigationLinkById( 40661 navigationLinks, 40662 parentPageID 40663 ); 40664 if (parentPage && parentPage.innerBlocks) { 40665 navigationLinks = parentPage.innerBlocks; 40666 } 40667 } 40668 const transformSubmenus = (listOfLinks) => { 40669 listOfLinks.forEach((block, index, listOfLinksArray) => { 40670 const { attributes: attributes3, innerBlocks } = block; 40671 if (innerBlocks.length !== 0) { 40672 transformSubmenus(innerBlocks); 40673 const transformedBlock = (0, import_blocks69.createBlock)( 40674 "core/navigation-submenu", 40675 attributes3, 40676 innerBlocks 40677 ); 40678 listOfLinksArray[index] = transformedBlock; 40679 } 40680 }); 40681 }; 40682 transformSubmenus(navigationLinks); 40683 return navigationLinks; 40684 } 40685 function useConvertToNavigationLinks({ 40686 clientId, 40687 pages, 40688 parentClientId, 40689 parentPageID 40690 }) { 40691 const { replaceBlock, selectBlock } = (0, import_data83.useDispatch)(import_block_editor163.store); 40692 return () => { 40693 const navigationLinks = convertToNavigationLinks(pages, parentPageID); 40694 replaceBlock(clientId, navigationLinks); 40695 selectBlock(parentClientId); 40696 }; 40697 } 40698 40699 // packages/block-library/build-module/page-list/convert-to-links-modal.js 40700 var import_components90 = __toESM(require_components()); 40701 var import_compose33 = __toESM(require_compose()); 40702 var import_i18n143 = __toESM(require_i18n()); 40703 var import_jsx_runtime328 = __toESM(require_jsx_runtime()); 40704 var convertDescription = (0, import_i18n143.__)( 40705 "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." 40706 ); 40707 function ConvertToLinksModal({ onClick, onClose, disabled }) { 40708 return /* @__PURE__ */ (0, import_jsx_runtime328.jsxs)( 40709 import_components90.Modal, 40710 { 40711 onRequestClose: onClose, 40712 title: (0, import_i18n143.__)("Edit Page List"), 40713 className: "wp-block-page-list-modal", 40714 aria: { 40715 describedby: (0, import_compose33.useInstanceId)( 40716 ConvertToLinksModal, 40717 "wp-block-page-list-modal__description" 40718 ) 40719 }, 40720 children: [ 40721 /* @__PURE__ */ (0, import_jsx_runtime328.jsx)( 40722 "p", 40723 { 40724 id: (0, import_compose33.useInstanceId)( 40725 ConvertToLinksModal, 40726 "wp-block-page-list-modal__description" 40727 ), 40728 children: convertDescription 40729 } 40730 ), 40731 /* @__PURE__ */ (0, import_jsx_runtime328.jsxs)("div", { className: "wp-block-page-list-modal-buttons", children: [ 40732 /* @__PURE__ */ (0, import_jsx_runtime328.jsx)( 40733 import_components90.Button, 40734 { 40735 __next40pxDefaultSize: true, 40736 variant: "tertiary", 40737 onClick: onClose, 40738 children: (0, import_i18n143.__)("Cancel") 40739 } 40740 ), 40741 /* @__PURE__ */ (0, import_jsx_runtime328.jsx)( 40742 import_components90.Button, 40743 { 40744 __next40pxDefaultSize: true, 40745 variant: "primary", 40746 accessibleWhenDisabled: true, 40747 disabled, 40748 onClick, 40749 children: (0, import_i18n143.__)("Edit") 40750 } 40751 ) 40752 ] }) 40753 ] 40754 } 40755 ); 40756 } 40757 40758 // packages/block-library/build-module/page-list/edit.js 40759 var import_jsx_runtime329 = __toESM(require_jsx_runtime()); 40760 var MAX_PAGE_COUNT = 100; 40761 var NOOP = () => { 40762 }; 40763 function BlockContent({ 40764 blockProps, 40765 innerBlocksProps, 40766 hasResolvedPages, 40767 blockList, 40768 pages, 40769 parentPageID 40770 }) { 40771 if (!hasResolvedPages) { 40772 return /* @__PURE__ */ (0, import_jsx_runtime329.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime329.jsx)("div", { className: "wp-block-page-list__loading-indicator-container", children: /* @__PURE__ */ (0, import_jsx_runtime329.jsx)(import_components91.Spinner, { className: "wp-block-page-list__loading-indicator" }) }) }); 40773 } 40774 if (pages === null) { 40775 return /* @__PURE__ */ (0, import_jsx_runtime329.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime329.jsx)(import_components91.Notice, { status: "warning", isDismissible: false, children: (0, import_i18n144.__)("Page List: Cannot retrieve Pages.") }) }); 40776 } 40777 if (pages.length === 0) { 40778 return /* @__PURE__ */ (0, import_jsx_runtime329.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime329.jsx)(import_components91.Notice, { status: "info", isDismissible: false, children: (0, import_i18n144.__)("Page List: Cannot retrieve Pages.") }) }); 40779 } 40780 if (blockList.length === 0) { 40781 const parentPageDetails = pages.find( 40782 (page) => page.id === parentPageID 40783 ); 40784 if (parentPageDetails?.title?.rendered) { 40785 return /* @__PURE__ */ (0, import_jsx_runtime329.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime329.jsx)(import_block_editor164.Warning, { children: (0, import_i18n144.sprintf)( 40786 // translators: %s: Page title. 40787 (0, import_i18n144.__)('Page List: "%s" page has no children.'), 40788 parentPageDetails.title.rendered 40789 ) }) }); 40790 } 40791 return /* @__PURE__ */ (0, import_jsx_runtime329.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime329.jsx)(import_components91.Notice, { status: "warning", isDismissible: false, children: (0, import_i18n144.__)("Page List: Cannot retrieve Pages.") }) }); 40792 } 40793 if (pages.length > 0) { 40794 return /* @__PURE__ */ (0, import_jsx_runtime329.jsx)("ul", { ...innerBlocksProps }); 40795 } 40796 } 40797 function PageListEdit({ 40798 context, 40799 clientId, 40800 attributes: attributes3, 40801 setAttributes 40802 }) { 40803 const { parentPageID } = attributes3; 40804 const [isOpen, setOpen] = (0, import_element79.useState)(false); 40805 const openModal = (0, import_element79.useCallback)(() => setOpen(true), []); 40806 const closeModal = () => setOpen(false); 40807 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 40808 const { records: pages, hasResolved: hasResolvedPages } = (0, import_core_data48.useEntityRecords)( 40809 "postType", 40810 "page", 40811 { 40812 per_page: MAX_PAGE_COUNT, 40813 _fields: ["id", "link", "menu_order", "parent", "title", "type"], 40814 // TODO: When https://core.trac.wordpress.org/ticket/39037 REST API support for multiple orderby 40815 // values is resolved, update 'orderby' to [ 'menu_order', 'post_title' ] to provide a consistent 40816 // sort. 40817 orderby: "menu_order", 40818 order: "asc" 40819 } 40820 ); 40821 const allowConvertToLinks = "showSubmenuIcon" in context && pages?.length > 0 && pages?.length <= MAX_PAGE_COUNT; 40822 const pagesByParentId = (0, import_element79.useMemo)(() => { 40823 if (pages === null) { 40824 return /* @__PURE__ */ new Map(); 40825 } 40826 const sortedPages = pages.sort((a2, b2) => { 40827 if (a2.menu_order === b2.menu_order) { 40828 return a2.title.rendered.localeCompare(b2.title.rendered); 40829 } 40830 return a2.menu_order - b2.menu_order; 40831 }); 40832 return sortedPages.reduce((accumulator, page) => { 40833 const { parent } = page; 40834 if (accumulator.has(parent)) { 40835 accumulator.get(parent).push(page); 40836 } else { 40837 accumulator.set(parent, [page]); 40838 } 40839 return accumulator; 40840 }, /* @__PURE__ */ new Map()); 40841 }, [pages]); 40842 const blockProps = (0, import_block_editor164.useBlockProps)({ 40843 className: clsx_default("wp-block-page-list", { 40844 "has-text-color": !!context.textColor, 40845 [(0, import_block_editor164.getColorClassName)("color", context.textColor)]: !!context.textColor, 40846 "has-background": !!context.backgroundColor, 40847 [(0, import_block_editor164.getColorClassName)( 40848 "background-color", 40849 context.backgroundColor 40850 )]: !!context.backgroundColor 40851 }), 40852 style: { ...context.style?.color } 40853 }); 40854 const pagesTree = (0, import_element79.useMemo)( 40855 function makePagesTree(parentId = 0, level = 0) { 40856 const childPages = pagesByParentId.get(parentId); 40857 if (!childPages?.length) { 40858 return []; 40859 } 40860 return childPages.reduce((tree, page) => { 40861 const hasChildren = pagesByParentId.has(page.id); 40862 const item = { 40863 value: page.id, 40864 label: "\u2014 ".repeat(level) + page.title.rendered, 40865 rawName: page.title.rendered 40866 }; 40867 tree.push(item); 40868 if (hasChildren) { 40869 tree.push(...makePagesTree(page.id, level + 1)); 40870 } 40871 return tree; 40872 }, []); 40873 }, 40874 [pagesByParentId] 40875 ); 40876 const blockList = (0, import_element79.useMemo)( 40877 function getBlockList(parentId = parentPageID) { 40878 const childPages = pagesByParentId.get(parentId); 40879 if (!childPages?.length) { 40880 return []; 40881 } 40882 return childPages.reduce((template, page) => { 40883 const hasChildren = pagesByParentId.has(page.id); 40884 const pageProps = { 40885 id: page.id, 40886 label: ( 40887 // translators: displayed when a page has an empty title. 40888 page.title?.rendered?.trim() !== "" ? page.title?.rendered : (0, import_i18n144.__)("(no title)") 40889 ), 40890 title: ( 40891 // translators: displayed when a page has an empty title. 40892 page.title?.rendered?.trim() !== "" ? page.title?.rendered : (0, import_i18n144.__)("(no title)") 40893 ), 40894 link: page.url, 40895 hasChildren 40896 }; 40897 let item = null; 40898 const children = getBlockList(page.id); 40899 item = (0, import_blocks70.createBlock)( 40900 "core/page-list-item", 40901 pageProps, 40902 children 40903 ); 40904 template.push(item); 40905 return template; 40906 }, []); 40907 }, 40908 [pagesByParentId, parentPageID] 40909 ); 40910 const { 40911 isNested, 40912 hasSelectedChild, 40913 parentClientId, 40914 hasDraggedChild, 40915 isChildOfNavigation 40916 } = (0, import_data84.useSelect)( 40917 (select9) => { 40918 const { 40919 getBlockParentsByBlockName, 40920 hasSelectedInnerBlock, 40921 hasDraggedInnerBlock 40922 } = select9(import_block_editor164.store); 40923 const blockParents = getBlockParentsByBlockName( 40924 clientId, 40925 "core/navigation-submenu", 40926 true 40927 ); 40928 const navigationBlockParents = getBlockParentsByBlockName( 40929 clientId, 40930 "core/navigation", 40931 true 40932 ); 40933 return { 40934 isNested: blockParents.length > 0, 40935 isChildOfNavigation: navigationBlockParents.length > 0, 40936 hasSelectedChild: hasSelectedInnerBlock(clientId, true), 40937 hasDraggedChild: hasDraggedInnerBlock(clientId, true), 40938 parentClientId: navigationBlockParents[0] 40939 }; 40940 }, 40941 [clientId] 40942 ); 40943 const convertToNavigationLinks2 = useConvertToNavigationLinks({ 40944 clientId, 40945 pages, 40946 parentClientId, 40947 parentPageID 40948 }); 40949 const innerBlocksProps = (0, import_block_editor164.useInnerBlocksProps)(blockProps, { 40950 renderAppender: false, 40951 __unstableDisableDropZone: true, 40952 templateLock: isChildOfNavigation ? false : "all", 40953 onInput: NOOP, 40954 onChange: NOOP, 40955 value: blockList 40956 }); 40957 const { selectBlock } = (0, import_data84.useDispatch)(import_block_editor164.store); 40958 (0, import_element79.useEffect)(() => { 40959 if (hasSelectedChild || hasDraggedChild) { 40960 openModal(); 40961 selectBlock(parentClientId); 40962 } 40963 }, [ 40964 hasSelectedChild, 40965 hasDraggedChild, 40966 parentClientId, 40967 selectBlock, 40968 openModal 40969 ]); 40970 (0, import_element79.useEffect)(() => { 40971 setAttributes({ isNested }); 40972 }, [isNested, setAttributes]); 40973 return /* @__PURE__ */ (0, import_jsx_runtime329.jsxs)(import_jsx_runtime329.Fragment, { children: [ 40974 (pagesTree.length > 0 || allowConvertToLinks) && /* @__PURE__ */ (0, import_jsx_runtime329.jsx)(import_block_editor164.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime329.jsxs)( 40975 import_components91.__experimentalToolsPanel, 40976 { 40977 label: (0, import_i18n144.__)("Settings"), 40978 resetAll: () => { 40979 setAttributes({ parentPageID: 0 }); 40980 }, 40981 dropdownMenuProps, 40982 children: [ 40983 pagesTree.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime329.jsx)( 40984 import_components91.__experimentalToolsPanelItem, 40985 { 40986 label: (0, import_i18n144.__)("Parent Page"), 40987 hasValue: () => parentPageID !== 0, 40988 onDeselect: () => setAttributes({ parentPageID: 0 }), 40989 isShownByDefault: true, 40990 children: /* @__PURE__ */ (0, import_jsx_runtime329.jsx)( 40991 import_components91.ComboboxControl, 40992 { 40993 __next40pxDefaultSize: true, 40994 className: "editor-page-attributes__parent", 40995 label: (0, import_i18n144.__)("Parent"), 40996 value: parentPageID, 40997 options: pagesTree, 40998 onChange: (value) => setAttributes({ 40999 parentPageID: value ?? 0 41000 }), 41001 help: (0, import_i18n144.__)( 41002 "Choose a page to show only its subpages." 41003 ) 41004 } 41005 ) 41006 } 41007 ), 41008 allowConvertToLinks && /* @__PURE__ */ (0, import_jsx_runtime329.jsxs)("div", { style: { gridColumn: "1 / -1" }, children: [ 41009 /* @__PURE__ */ (0, import_jsx_runtime329.jsx)("p", { children: convertDescription }), 41010 /* @__PURE__ */ (0, import_jsx_runtime329.jsx)( 41011 import_components91.Button, 41012 { 41013 __next40pxDefaultSize: true, 41014 variant: "primary", 41015 accessibleWhenDisabled: true, 41016 disabled: !hasResolvedPages, 41017 onClick: convertToNavigationLinks2, 41018 children: (0, import_i18n144.__)("Edit") 41019 } 41020 ) 41021 ] }) 41022 ] 41023 } 41024 ) }), 41025 allowConvertToLinks && /* @__PURE__ */ (0, import_jsx_runtime329.jsxs)(import_jsx_runtime329.Fragment, { children: [ 41026 /* @__PURE__ */ (0, import_jsx_runtime329.jsx)(import_block_editor164.BlockControls, { group: "other", children: /* @__PURE__ */ (0, import_jsx_runtime329.jsx)( 41027 import_components91.ToolbarButton, 41028 { 41029 title: (0, import_i18n144.__)("Edit"), 41030 onClick: openModal, 41031 children: (0, import_i18n144.__)("Edit") 41032 } 41033 ) }), 41034 isOpen && /* @__PURE__ */ (0, import_jsx_runtime329.jsx)( 41035 ConvertToLinksModal, 41036 { 41037 onClick: convertToNavigationLinks2, 41038 onClose: closeModal, 41039 disabled: !hasResolvedPages 41040 } 41041 ) 41042 ] }), 41043 /* @__PURE__ */ (0, import_jsx_runtime329.jsx)( 41044 BlockContent, 41045 { 41046 blockProps, 41047 innerBlocksProps, 41048 hasResolvedPages, 41049 blockList, 41050 pages, 41051 parentPageID 41052 } 41053 ) 41054 ] }); 41055 } 41056 41057 // packages/block-library/build-module/page-list/index.js 41058 var { name: name59 } = block_default59; 41059 var settings59 = { 41060 icon: pages_default, 41061 example: {}, 41062 edit: PageListEdit 41063 }; 41064 var init59 = () => initBlock({ name: name59, metadata: block_default59, settings: settings59 }); 41065 41066 // packages/block-library/build-module/page-list-item/index.js 41067 var page_list_item_exports = {}; 41068 __export(page_list_item_exports, { 41069 init: () => init60, 41070 metadata: () => block_default60, 41071 name: () => name60, 41072 settings: () => settings60 41073 }); 41074 41075 // packages/block-library/build-module/page-list-item/block.json 41076 var block_default60 = { 41077 $schema: "https://schemas.wp.org/trunk/block.json", 41078 apiVersion: 3, 41079 name: "core/page-list-item", 41080 title: "Page List Item", 41081 category: "widgets", 41082 parent: ["core/page-list"], 41083 description: "Displays a page inside a list of all pages.", 41084 keywords: ["page", "menu", "navigation"], 41085 textdomain: "default", 41086 attributes: { 41087 id: { 41088 type: "number" 41089 }, 41090 label: { 41091 type: "string" 41092 }, 41093 title: { 41094 type: "string" 41095 }, 41096 link: { 41097 type: "string" 41098 }, 41099 hasChildren: { 41100 type: "boolean" 41101 } 41102 }, 41103 usesContext: [ 41104 "textColor", 41105 "customTextColor", 41106 "backgroundColor", 41107 "customBackgroundColor", 41108 "overlayTextColor", 41109 "customOverlayTextColor", 41110 "overlayBackgroundColor", 41111 "customOverlayBackgroundColor", 41112 "fontSize", 41113 "customFontSize", 41114 "showSubmenuIcon", 41115 "style", 41116 "openSubmenusOnClick" 41117 ], 41118 supports: { 41119 reusable: false, 41120 html: false, 41121 lock: false, 41122 inserter: false, 41123 __experimentalToolbar: false, 41124 interactivity: { 41125 clientNavigation: true 41126 } 41127 }, 41128 editorStyle: "wp-block-page-list-editor", 41129 style: "wp-block-page-list" 41130 }; 41131 41132 // packages/block-library/build-module/page-list-item/edit.js 41133 var import_block_editor165 = __toESM(require_block_editor()); 41134 var import_data85 = __toESM(require_data()); 41135 var import_core_data49 = __toESM(require_core_data()); 41136 var import_element80 = __toESM(require_element()); 41137 var import_dom6 = __toESM(require_dom()); 41138 41139 // packages/block-library/build-module/navigation-link/icons.js 41140 var import_components92 = __toESM(require_components()); 41141 var import_jsx_runtime330 = __toESM(require_jsx_runtime()); 41142 var ItemSubmenuIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime330.jsx)( 41143 import_components92.SVG, 41144 { 41145 xmlns: "http://www.w3.org/2000/svg", 41146 width: "12", 41147 height: "12", 41148 viewBox: "0 0 12 12", 41149 fill: "none", 41150 children: /* @__PURE__ */ (0, import_jsx_runtime330.jsx)(import_components92.Path, { d: "M1.50002 4L6.00002 8L10.5 4", strokeWidth: "1.5" }) 41151 } 41152 ); 41153 41154 // packages/block-library/build-module/page-list-item/edit.js 41155 var import_jsx_runtime331 = __toESM(require_jsx_runtime()); 41156 function useFrontPageId() { 41157 return (0, import_data85.useSelect)((select9) => { 41158 const canReadSettings = select9(import_core_data49.store).canUser("read", { 41159 kind: "root", 41160 name: "site" 41161 }); 41162 if (!canReadSettings) { 41163 return void 0; 41164 } 41165 const site = select9(import_core_data49.store).getEntityRecord("root", "site"); 41166 return site?.show_on_front === "page" && site?.page_on_front; 41167 }, []); 41168 } 41169 function PageListItemEdit({ context, attributes: attributes3 }) { 41170 const { id, label, link, hasChildren, title } = attributes3; 41171 const isNavigationChild = "showSubmenuIcon" in context; 41172 const frontPageId = useFrontPageId(); 41173 const innerBlocksColors = getColors(context, true); 41174 const navigationChildBlockProps = getNavigationChildBlockProps(innerBlocksColors); 41175 const blockProps = (0, import_block_editor165.useBlockProps)(navigationChildBlockProps, { 41176 className: "wp-block-pages-list__item" 41177 }); 41178 const innerBlocksProps = (0, import_block_editor165.useInnerBlocksProps)(blockProps); 41179 return /* @__PURE__ */ (0, import_jsx_runtime331.jsxs)( 41180 "li", 41181 { 41182 className: clsx_default("wp-block-pages-list__item", { 41183 "has-child": hasChildren, 41184 "wp-block-navigation-item": isNavigationChild, 41185 "open-on-click": context.openSubmenusOnClick, 41186 "open-on-hover-click": !context.openSubmenusOnClick && context.showSubmenuIcon, 41187 "menu-item-home": id === frontPageId 41188 }), 41189 children: [ 41190 hasChildren && context.openSubmenusOnClick ? /* @__PURE__ */ (0, import_jsx_runtime331.jsxs)(import_jsx_runtime331.Fragment, { children: [ 41191 /* @__PURE__ */ (0, import_jsx_runtime331.jsx)( 41192 "button", 41193 { 41194 type: "button", 41195 className: "wp-block-navigation-item__content wp-block-navigation-submenu__toggle", 41196 "aria-expanded": "false", 41197 children: /* @__PURE__ */ (0, import_jsx_runtime331.jsx)(import_element80.RawHTML, { children: (0, import_dom6.safeHTML)(label) }) 41198 } 41199 ), 41200 /* @__PURE__ */ (0, import_jsx_runtime331.jsx)("span", { className: "wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon", children: /* @__PURE__ */ (0, import_jsx_runtime331.jsx)(ItemSubmenuIcon2, {}) }) 41201 ] }) : /* @__PURE__ */ (0, import_jsx_runtime331.jsx)( 41202 "a", 41203 { 41204 className: clsx_default("wp-block-pages-list__item__link", { 41205 "wp-block-navigation-item__content": isNavigationChild 41206 }), 41207 href: link, 41208 children: /* @__PURE__ */ (0, import_jsx_runtime331.jsx)(import_element80.RawHTML, { children: (0, import_dom6.safeHTML)(title) }) 41209 } 41210 ), 41211 hasChildren && /* @__PURE__ */ (0, import_jsx_runtime331.jsxs)(import_jsx_runtime331.Fragment, { children: [ 41212 !context.openSubmenusOnClick && context.showSubmenuIcon && /* @__PURE__ */ (0, import_jsx_runtime331.jsx)( 41213 "button", 41214 { 41215 className: "wp-block-navigation-item__content wp-block-navigation-submenu__toggle wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon", 41216 "aria-expanded": "false", 41217 type: "button", 41218 children: /* @__PURE__ */ (0, import_jsx_runtime331.jsx)(ItemSubmenuIcon2, {}) 41219 } 41220 ), 41221 /* @__PURE__ */ (0, import_jsx_runtime331.jsx)("ul", { ...innerBlocksProps }) 41222 ] }) 41223 ] 41224 }, 41225 id 41226 ); 41227 } 41228 41229 // packages/block-library/build-module/page-list-item/index.js 41230 var { name: name60 } = block_default60; 41231 var settings60 = { 41232 __experimentalLabel: ({ label }) => label, 41233 icon: page_default, 41234 example: {}, 41235 edit: PageListItemEdit 41236 }; 41237 var init60 = () => initBlock({ name: name60, metadata: block_default60, settings: settings60 }); 41238 41239 // packages/block-library/build-module/paragraph/index.js 41240 var paragraph_exports = {}; 41241 __export(paragraph_exports, { 41242 init: () => init61, 41243 metadata: () => block_default61, 41244 name: () => name62, 41245 settings: () => settings61 41246 }); 41247 var import_i18n148 = __toESM(require_i18n()); 41248 var import_blocks74 = __toESM(require_blocks()); 41249 41250 // packages/block-library/build-module/paragraph/deprecated.js 41251 var import_element81 = __toESM(require_element()); 41252 var import_block_editor166 = __toESM(require_block_editor()); 41253 var import_i18n145 = __toESM(require_i18n()); 41254 var import_jsx_runtime332 = __toESM(require_jsx_runtime()); 41255 var supports2 = { 41256 className: false 41257 }; 41258 var blockAttributes5 = { 41259 align: { 41260 type: "string" 41261 }, 41262 content: { 41263 type: "string", 41264 source: "html", 41265 selector: "p", 41266 default: "" 41267 }, 41268 dropCap: { 41269 type: "boolean", 41270 default: false 41271 }, 41272 placeholder: { 41273 type: "string" 41274 }, 41275 textColor: { 41276 type: "string" 41277 }, 41278 backgroundColor: { 41279 type: "string" 41280 }, 41281 fontSize: { 41282 type: "string" 41283 }, 41284 direction: { 41285 type: "string", 41286 enum: ["ltr", "rtl"] 41287 }, 41288 style: { 41289 type: "object" 41290 } 41291 }; 41292 var migrateCustomColorsAndFontSizes = (attributes3) => { 41293 if (!attributes3.customTextColor && !attributes3.customBackgroundColor && !attributes3.customFontSize) { 41294 return attributes3; 41295 } 41296 const style2 = {}; 41297 if (attributes3.customTextColor || attributes3.customBackgroundColor) { 41298 style2.color = {}; 41299 } 41300 if (attributes3.customTextColor) { 41301 style2.color.text = attributes3.customTextColor; 41302 } 41303 if (attributes3.customBackgroundColor) { 41304 style2.color.background = attributes3.customBackgroundColor; 41305 } 41306 if (attributes3.customFontSize) { 41307 style2.typography = { fontSize: attributes3.customFontSize }; 41308 } 41309 const { 41310 customTextColor, 41311 customBackgroundColor, 41312 customFontSize, 41313 ...restAttributes 41314 } = attributes3; 41315 return { 41316 ...restAttributes, 41317 style: style2 41318 }; 41319 }; 41320 var migrateTextAlign2 = (attributes3) => { 41321 const { align, ...restAttributes } = attributes3; 41322 if (!align) { 41323 return attributes3; 41324 } 41325 return { 41326 ...restAttributes, 41327 style: { 41328 ...attributes3.style, 41329 typography: { 41330 ...attributes3.style?.typography, 41331 textAlign: align 41332 } 41333 } 41334 }; 41335 }; 41336 var { style, ...restBlockAttributes } = blockAttributes5; 41337 var deprecated12 = [ 41338 // Version with `align` attribute. 41339 { 41340 supports: { 41341 className: false, 41342 typography: { 41343 fontSize: true 41344 } 41345 }, 41346 attributes: blockAttributes5, 41347 isEligible(attributes3) { 41348 return !!attributes3.align || !!attributes3.className?.match( 41349 /\bhas-text-align-(left|center|right)\b/ 41350 ); 41351 }, 41352 save({ attributes: attributes3 }) { 41353 const { align, content, dropCap, direction } = attributes3; 41354 const className = clsx_default({ 41355 "has-drop-cap": align === ((0, import_i18n145.isRTL)() ? "left" : "right") || align === "center" ? false : dropCap, 41356 [`has-text-align-$align}`]: align 41357 }); 41358 return /* @__PURE__ */ (0, import_jsx_runtime332.jsx)("p", { ...import_block_editor166.useBlockProps.save({ className, dir: direction }), children: /* @__PURE__ */ (0, import_jsx_runtime332.jsx)(import_block_editor166.RichText.Content, { value: content }) }); 41359 }, 41360 migrate: migrateTextAlign2 41361 }, 41362 // Version without drop cap on aligned text. 41363 { 41364 supports: supports2, 41365 attributes: { 41366 ...restBlockAttributes, 41367 customTextColor: { 41368 type: "string" 41369 }, 41370 customBackgroundColor: { 41371 type: "string" 41372 }, 41373 customFontSize: { 41374 type: "number" 41375 } 41376 }, 41377 migrate: migrateTextAlign2, 41378 save({ attributes: attributes3 }) { 41379 const { align, content, dropCap, direction } = attributes3; 41380 const className = clsx_default({ 41381 "has-drop-cap": align === ((0, import_i18n145.isRTL)() ? "left" : "right") || align === "center" ? false : dropCap, 41382 [`has-text-align-$align}`]: align 41383 }); 41384 return /* @__PURE__ */ (0, import_jsx_runtime332.jsx)("p", { ...import_block_editor166.useBlockProps.save({ className, dir: direction }), children: /* @__PURE__ */ (0, import_jsx_runtime332.jsx)(import_block_editor166.RichText.Content, { value: content }) }); 41385 } 41386 }, 41387 { 41388 supports: supports2, 41389 attributes: { 41390 ...restBlockAttributes, 41391 customTextColor: { 41392 type: "string" 41393 }, 41394 customBackgroundColor: { 41395 type: "string" 41396 }, 41397 customFontSize: { 41398 type: "number" 41399 } 41400 }, 41401 migrate(attributes3) { 41402 return migrateCustomColorsAndFontSizes( 41403 migrateTextAlign2(attributes3) 41404 ); 41405 }, 41406 save({ attributes: attributes3 }) { 41407 const { 41408 align, 41409 content, 41410 dropCap, 41411 backgroundColor, 41412 textColor, 41413 customBackgroundColor, 41414 customTextColor, 41415 fontSize, 41416 customFontSize, 41417 direction 41418 } = attributes3; 41419 const textClass = (0, import_block_editor166.getColorClassName)("color", textColor); 41420 const backgroundClass = (0, import_block_editor166.getColorClassName)( 41421 "background-color", 41422 backgroundColor 41423 ); 41424 const fontSizeClass = (0, import_block_editor166.getFontSizeClass)(fontSize); 41425 const className = clsx_default({ 41426 "has-text-color": textColor || customTextColor, 41427 "has-background": backgroundColor || customBackgroundColor, 41428 "has-drop-cap": dropCap, 41429 [`has-text-align-$align}`]: align, 41430 [fontSizeClass]: fontSizeClass, 41431 [textClass]: textClass, 41432 [backgroundClass]: backgroundClass 41433 }); 41434 const styles = { 41435 backgroundColor: backgroundClass ? void 0 : customBackgroundColor, 41436 color: textClass ? void 0 : customTextColor, 41437 fontSize: fontSizeClass ? void 0 : customFontSize 41438 }; 41439 return /* @__PURE__ */ (0, import_jsx_runtime332.jsx)( 41440 import_block_editor166.RichText.Content, 41441 { 41442 tagName: "p", 41443 style: styles, 41444 className: className ? className : void 0, 41445 value: content, 41446 dir: direction 41447 } 41448 ); 41449 } 41450 }, 41451 { 41452 supports: supports2, 41453 attributes: { 41454 ...restBlockAttributes, 41455 customTextColor: { 41456 type: "string" 41457 }, 41458 customBackgroundColor: { 41459 type: "string" 41460 }, 41461 customFontSize: { 41462 type: "number" 41463 } 41464 }, 41465 migrate(attributes3) { 41466 return migrateCustomColorsAndFontSizes( 41467 migrateTextAlign2(attributes3) 41468 ); 41469 }, 41470 save({ attributes: attributes3 }) { 41471 const { 41472 align, 41473 content, 41474 dropCap, 41475 backgroundColor, 41476 textColor, 41477 customBackgroundColor, 41478 customTextColor, 41479 fontSize, 41480 customFontSize, 41481 direction 41482 } = attributes3; 41483 const textClass = (0, import_block_editor166.getColorClassName)("color", textColor); 41484 const backgroundClass = (0, import_block_editor166.getColorClassName)( 41485 "background-color", 41486 backgroundColor 41487 ); 41488 const fontSizeClass = (0, import_block_editor166.getFontSizeClass)(fontSize); 41489 const className = clsx_default({ 41490 "has-text-color": textColor || customTextColor, 41491 "has-background": backgroundColor || customBackgroundColor, 41492 "has-drop-cap": dropCap, 41493 [fontSizeClass]: fontSizeClass, 41494 [textClass]: textClass, 41495 [backgroundClass]: backgroundClass 41496 }); 41497 const styles = { 41498 backgroundColor: backgroundClass ? void 0 : customBackgroundColor, 41499 color: textClass ? void 0 : customTextColor, 41500 fontSize: fontSizeClass ? void 0 : customFontSize, 41501 textAlign: align 41502 }; 41503 return /* @__PURE__ */ (0, import_jsx_runtime332.jsx)( 41504 import_block_editor166.RichText.Content, 41505 { 41506 tagName: "p", 41507 style: styles, 41508 className: className ? className : void 0, 41509 value: content, 41510 dir: direction 41511 } 41512 ); 41513 } 41514 }, 41515 { 41516 supports: supports2, 41517 attributes: { 41518 ...restBlockAttributes, 41519 customTextColor: { 41520 type: "string" 41521 }, 41522 customBackgroundColor: { 41523 type: "string" 41524 }, 41525 customFontSize: { 41526 type: "number" 41527 }, 41528 width: { 41529 type: "string" 41530 } 41531 }, 41532 migrate(attributes3) { 41533 return migrateCustomColorsAndFontSizes( 41534 migrateTextAlign2(attributes3) 41535 ); 41536 }, 41537 save({ attributes: attributes3 }) { 41538 const { 41539 width, 41540 align, 41541 content, 41542 dropCap, 41543 backgroundColor, 41544 textColor, 41545 customBackgroundColor, 41546 customTextColor, 41547 fontSize, 41548 customFontSize 41549 } = attributes3; 41550 const textClass = (0, import_block_editor166.getColorClassName)("color", textColor); 41551 const backgroundClass = (0, import_block_editor166.getColorClassName)( 41552 "background-color", 41553 backgroundColor 41554 ); 41555 const fontSizeClass = fontSize && `is-$fontSize}-text`; 41556 const className = clsx_default({ 41557 [`align$width}`]: width, 41558 "has-background": backgroundColor || customBackgroundColor, 41559 "has-drop-cap": dropCap, 41560 [fontSizeClass]: fontSizeClass, 41561 [textClass]: textClass, 41562 [backgroundClass]: backgroundClass 41563 }); 41564 const styles = { 41565 backgroundColor: backgroundClass ? void 0 : customBackgroundColor, 41566 color: textClass ? void 0 : customTextColor, 41567 fontSize: fontSizeClass ? void 0 : customFontSize, 41568 textAlign: align 41569 }; 41570 return /* @__PURE__ */ (0, import_jsx_runtime332.jsx)( 41571 import_block_editor166.RichText.Content, 41572 { 41573 tagName: "p", 41574 style: styles, 41575 className: className ? className : void 0, 41576 value: content 41577 } 41578 ); 41579 } 41580 }, 41581 { 41582 supports: supports2, 41583 attributes: { 41584 ...restBlockAttributes, 41585 fontSize: { 41586 type: "number" 41587 } 41588 }, 41589 save({ attributes: attributes3 }) { 41590 const { 41591 width, 41592 align, 41593 content, 41594 dropCap, 41595 backgroundColor, 41596 textColor, 41597 fontSize 41598 } = attributes3; 41599 const className = clsx_default({ 41600 [`align$width}`]: width, 41601 "has-background": backgroundColor, 41602 "has-drop-cap": dropCap 41603 }); 41604 const styles = { 41605 backgroundColor, 41606 color: textColor, 41607 fontSize, 41608 textAlign: align 41609 }; 41610 return /* @__PURE__ */ (0, import_jsx_runtime332.jsx)( 41611 "p", 41612 { 41613 style: styles, 41614 className: className ? className : void 0, 41615 children: content 41616 } 41617 ); 41618 }, 41619 migrate(attributes3) { 41620 return migrateCustomColorsAndFontSizes( 41621 migrateTextAlign2({ 41622 ...attributes3, 41623 customFontSize: Number.isFinite(attributes3.fontSize) ? attributes3.fontSize : void 0, 41624 customTextColor: attributes3.textColor && "#" === attributes3.textColor[0] ? attributes3.textColor : void 0, 41625 customBackgroundColor: attributes3.backgroundColor && "#" === attributes3.backgroundColor[0] ? attributes3.backgroundColor : void 0 41626 }) 41627 ); 41628 } 41629 }, 41630 { 41631 supports: supports2, 41632 attributes: { 41633 ...blockAttributes5, 41634 content: { 41635 type: "string", 41636 source: "html", 41637 default: "" 41638 } 41639 }, 41640 save({ attributes: attributes3 }) { 41641 return /* @__PURE__ */ (0, import_jsx_runtime332.jsx)(import_element81.RawHTML, { children: attributes3.content }); 41642 }, 41643 migrate: (attributes3) => attributes3 41644 } 41645 ]; 41646 var deprecated_default26 = deprecated12; 41647 41648 // packages/block-library/build-module/paragraph/edit.js 41649 var import_i18n146 = __toESM(require_i18n()); 41650 var import_components93 = __toESM(require_components()); 41651 var import_block_editor169 = __toESM(require_block_editor()); 41652 var import_blocks72 = __toESM(require_blocks()); 41653 41654 // packages/block-library/build-module/paragraph/use-enter.js 41655 var import_element82 = __toESM(require_element()); 41656 var import_compose34 = __toESM(require_compose()); 41657 var import_keycodes8 = __toESM(require_keycodes()); 41658 var import_data86 = __toESM(require_data()); 41659 var import_block_editor167 = __toESM(require_block_editor()); 41660 var import_blocks71 = __toESM(require_blocks()); 41661 function useOnEnter(props) { 41662 const { batch } = (0, import_data86.useRegistry)(); 41663 const { 41664 moveBlocksToPosition, 41665 replaceInnerBlocks, 41666 duplicateBlocks, 41667 insertBlock 41668 } = (0, import_data86.useDispatch)(import_block_editor167.store); 41669 const { 41670 getBlockRootClientId, 41671 getBlockIndex, 41672 getBlockOrder, 41673 getBlockName, 41674 getBlock, 41675 getNextBlockClientId, 41676 canInsertBlockType 41677 } = (0, import_data86.useSelect)(import_block_editor167.store); 41678 const propsRef = (0, import_element82.useRef)(props); 41679 propsRef.current = props; 41680 return (0, import_compose34.useRefEffect)((element) => { 41681 function onKeyDown(event) { 41682 if (event.defaultPrevented) { 41683 return; 41684 } 41685 if (event.keyCode !== import_keycodes8.ENTER) { 41686 return; 41687 } 41688 const { content, clientId } = propsRef.current; 41689 if (content.length) { 41690 return; 41691 } 41692 const wrapperClientId = getBlockRootClientId(clientId); 41693 if (!(0, import_blocks71.hasBlockSupport)( 41694 getBlockName(wrapperClientId), 41695 "__experimentalOnEnter", 41696 false 41697 )) { 41698 return; 41699 } 41700 const order = getBlockOrder(wrapperClientId); 41701 const position = order.indexOf(clientId); 41702 if (position === order.length - 1) { 41703 let newWrapperClientId = wrapperClientId; 41704 while (!canInsertBlockType( 41705 getBlockName(clientId), 41706 getBlockRootClientId(newWrapperClientId) 41707 )) { 41708 newWrapperClientId = getBlockRootClientId(newWrapperClientId); 41709 } 41710 if (typeof newWrapperClientId === "string") { 41711 event.preventDefault(); 41712 moveBlocksToPosition( 41713 [clientId], 41714 wrapperClientId, 41715 getBlockRootClientId(newWrapperClientId), 41716 getBlockIndex(newWrapperClientId) + 1 41717 ); 41718 } 41719 return; 41720 } 41721 const defaultBlockName = (0, import_blocks71.getDefaultBlockName)(); 41722 if (!canInsertBlockType( 41723 defaultBlockName, 41724 getBlockRootClientId(wrapperClientId) 41725 )) { 41726 return; 41727 } 41728 event.preventDefault(); 41729 const wrapperBlock = getBlock(wrapperClientId); 41730 batch(() => { 41731 duplicateBlocks([wrapperClientId]); 41732 const blockIndex = getBlockIndex(wrapperClientId); 41733 replaceInnerBlocks( 41734 wrapperClientId, 41735 wrapperBlock.innerBlocks.slice(0, position) 41736 ); 41737 replaceInnerBlocks( 41738 getNextBlockClientId(wrapperClientId), 41739 wrapperBlock.innerBlocks.slice(position + 1) 41740 ); 41741 insertBlock( 41742 (0, import_blocks71.createBlock)(defaultBlockName), 41743 blockIndex + 1, 41744 getBlockRootClientId(wrapperClientId), 41745 true 41746 ); 41747 }); 41748 } 41749 element.addEventListener("keydown", onKeyDown); 41750 return () => { 41751 element.removeEventListener("keydown", onKeyDown); 41752 }; 41753 }, []); 41754 } 41755 41756 // packages/block-library/build-module/paragraph/deprecated-attributes.js 41757 var import_compose35 = __toESM(require_compose()); 41758 var import_element83 = __toESM(require_element()); 41759 var import_deprecated28 = __toESM(require_deprecated()); 41760 var import_data87 = __toESM(require_data()); 41761 var import_block_editor168 = __toESM(require_block_editor()); 41762 function useDeprecatedAlign(align, style2, setAttributes) { 41763 const { __unstableMarkNextChangeAsNotPersistent } = (0, import_data87.useDispatch)(import_block_editor168.store); 41764 const updateStyleWithAlign = (0, import_compose35.useEvent)(() => { 41765 (0, import_deprecated28.default)("align attribute in paragraph block", { 41766 alternative: "style.typography.textAlign", 41767 since: "7.0" 41768 }); 41769 __unstableMarkNextChangeAsNotPersistent(); 41770 setAttributes({ 41771 style: { 41772 ...style2, 41773 typography: { 41774 ...style2?.typography, 41775 textAlign: align 41776 } 41777 } 41778 }); 41779 }); 41780 const lastUpdatedAlignRef = (0, import_element83.useRef)(); 41781 (0, import_element83.useEffect)(() => { 41782 if (align === "full" || align === "wide" || align === lastUpdatedAlignRef.current) { 41783 return; 41784 } 41785 lastUpdatedAlignRef.current = align; 41786 updateStyleWithAlign(); 41787 }, [align, updateStyleWithAlign]); 41788 } 41789 41790 // packages/block-library/build-module/paragraph/edit.js 41791 var import_jsx_runtime333 = __toESM(require_jsx_runtime()); 41792 function ParagraphRTLControl({ direction, setDirection }) { 41793 return (0, import_i18n146.isRTL)() && /* @__PURE__ */ (0, import_jsx_runtime333.jsx)( 41794 import_components93.ToolbarButton, 41795 { 41796 icon: format_ltr_default, 41797 title: (0, import_i18n146._x)("Left to right", "editor button"), 41798 isActive: direction === "ltr", 41799 onClick: () => { 41800 setDirection(direction === "ltr" ? void 0 : "ltr"); 41801 } 41802 } 41803 ); 41804 } 41805 function hasDropCapDisabled(align) { 41806 return align === ((0, import_i18n146.isRTL)() ? "left" : "right") || align === "center"; 41807 } 41808 function DropCapControl({ clientId, attributes: attributes3, setAttributes, name: name117 }) { 41809 const [isDropCapFeatureEnabled] = (0, import_block_editor169.useSettings)("typography.dropCap"); 41810 if (!isDropCapFeatureEnabled) { 41811 return null; 41812 } 41813 const { style: style2, dropCap } = attributes3; 41814 const textAlign = style2?.typography?.textAlign; 41815 let helpText; 41816 if (hasDropCapDisabled(textAlign)) { 41817 helpText = (0, import_i18n146.__)("Not available for aligned text."); 41818 } else if (dropCap) { 41819 helpText = (0, import_i18n146.__)("Showing large initial letter."); 41820 } else { 41821 helpText = (0, import_i18n146.__)("Show a large initial letter."); 41822 } 41823 const isDropCapControlEnabledByDefault = (0, import_blocks72.getBlockSupport)( 41824 name117, 41825 "typography.defaultControls.dropCap", 41826 false 41827 ); 41828 return /* @__PURE__ */ (0, import_jsx_runtime333.jsx)(import_block_editor169.InspectorControls, { group: "typography", children: /* @__PURE__ */ (0, import_jsx_runtime333.jsx)( 41829 import_components93.__experimentalToolsPanelItem, 41830 { 41831 hasValue: () => !!dropCap, 41832 label: (0, import_i18n146.__)("Drop cap"), 41833 isShownByDefault: isDropCapControlEnabledByDefault, 41834 onDeselect: () => setAttributes({ dropCap: false }), 41835 resetAllFilter: () => ({ dropCap: false }), 41836 panelId: clientId, 41837 children: /* @__PURE__ */ (0, import_jsx_runtime333.jsx)( 41838 import_components93.ToggleControl, 41839 { 41840 label: (0, import_i18n146.__)("Drop cap"), 41841 checked: !!dropCap, 41842 onChange: () => setAttributes({ dropCap: !dropCap }), 41843 help: helpText, 41844 disabled: hasDropCapDisabled(textAlign) 41845 } 41846 ) 41847 } 41848 ) }); 41849 } 41850 function ParagraphBlock({ 41851 attributes: attributes3, 41852 mergeBlocks, 41853 onReplace, 41854 onRemove, 41855 setAttributes, 41856 clientId, 41857 isSelected: isSingleSelected, 41858 name: name117 41859 }) { 41860 const { content, direction, dropCap, placeholder: placeholder2, style: style2 } = attributes3; 41861 const textAlign = style2?.typography?.textAlign; 41862 useDeprecatedAlign(attributes3.align, style2, setAttributes); 41863 const blockProps = (0, import_block_editor169.useBlockProps)({ 41864 ref: useOnEnter({ clientId, content }), 41865 className: clsx_default({ 41866 "has-drop-cap": hasDropCapDisabled(textAlign) ? false : dropCap 41867 }), 41868 style: { direction } 41869 }); 41870 const blockEditingMode = (0, import_block_editor169.useBlockEditingMode)(); 41871 return /* @__PURE__ */ (0, import_jsx_runtime333.jsxs)(import_jsx_runtime333.Fragment, { children: [ 41872 blockEditingMode === "default" && /* @__PURE__ */ (0, import_jsx_runtime333.jsx)(import_block_editor169.BlockControls, { group: "block", children: /* @__PURE__ */ (0, import_jsx_runtime333.jsx)( 41873 ParagraphRTLControl, 41874 { 41875 direction, 41876 setDirection: (newDirection) => setAttributes({ direction: newDirection }) 41877 } 41878 ) }), 41879 isSingleSelected && /* @__PURE__ */ (0, import_jsx_runtime333.jsx)( 41880 DropCapControl, 41881 { 41882 name: name117, 41883 clientId, 41884 attributes: attributes3, 41885 setAttributes 41886 } 41887 ), 41888 /* @__PURE__ */ (0, import_jsx_runtime333.jsx)( 41889 import_block_editor169.RichText, 41890 { 41891 identifier: "content", 41892 tagName: "p", 41893 ...blockProps, 41894 value: content, 41895 onChange: (newContent) => setAttributes({ content: newContent }), 41896 onMerge: mergeBlocks, 41897 onReplace, 41898 onRemove, 41899 "aria-label": import_block_editor169.RichText.isEmpty(content) ? (0, import_i18n146.__)( 41900 "Empty block; start writing or type forward slash to choose a block" 41901 ) : (0, import_i18n146.__)("Block: Paragraph"), 41902 "data-empty": import_block_editor169.RichText.isEmpty(content), 41903 placeholder: placeholder2 || (0, import_i18n146.__)("Type / to choose a block"), 41904 "data-custom-placeholder": placeholder2 ? true : void 0, 41905 __unstableEmbedURLOnPaste: true, 41906 __unstableAllowPrefixTransformations: true 41907 } 41908 ) 41909 ] }); 41910 } 41911 var edit_default21 = ParagraphBlock; 41912 41913 // packages/block-library/build-module/paragraph/block.json 41914 var name61 = "core/paragraph"; 41915 var block_default61 = { 41916 $schema: "https://schemas.wp.org/trunk/block.json", 41917 apiVersion: 3, 41918 name: name61, 41919 title: "Paragraph", 41920 category: "text", 41921 description: "Start with the basic building block of all narrative.", 41922 keywords: ["text"], 41923 textdomain: "default", 41924 attributes: { 41925 content: { 41926 type: "rich-text", 41927 source: "rich-text", 41928 selector: "p", 41929 role: "content" 41930 }, 41931 dropCap: { 41932 type: "boolean", 41933 default: false 41934 }, 41935 placeholder: { 41936 type: "string" 41937 }, 41938 direction: { 41939 type: "string", 41940 enum: ["ltr", "rtl"] 41941 } 41942 }, 41943 supports: { 41944 align: ["wide", "full"], 41945 splitting: true, 41946 anchor: true, 41947 className: false, 41948 __experimentalBorder: { 41949 color: true, 41950 radius: true, 41951 style: true, 41952 width: true 41953 }, 41954 color: { 41955 gradients: true, 41956 link: true, 41957 __experimentalDefaultControls: { 41958 background: true, 41959 text: true 41960 } 41961 }, 41962 spacing: { 41963 margin: true, 41964 padding: true, 41965 __experimentalDefaultControls: { 41966 margin: false, 41967 padding: false 41968 } 41969 }, 41970 typography: { 41971 fontSize: true, 41972 lineHeight: true, 41973 textAlign: true, 41974 __experimentalFontFamily: true, 41975 __experimentalTextDecoration: true, 41976 __experimentalFontStyle: true, 41977 __experimentalFontWeight: true, 41978 __experimentalLetterSpacing: true, 41979 __experimentalTextTransform: true, 41980 __experimentalWritingMode: true, 41981 fitText: true, 41982 __experimentalDefaultControls: { 41983 fontSize: true 41984 } 41985 }, 41986 __experimentalSelector: "p", 41987 __unstablePasteTextInline: true, 41988 interactivity: { 41989 clientNavigation: true 41990 } 41991 }, 41992 editorStyle: "wp-block-paragraph-editor", 41993 style: "wp-block-paragraph" 41994 }; 41995 41996 // packages/block-library/build-module/paragraph/save.js 41997 var import_block_editor170 = __toESM(require_block_editor()); 41998 var import_i18n147 = __toESM(require_i18n()); 41999 var import_jsx_runtime334 = __toESM(require_jsx_runtime()); 42000 function save37({ attributes: attributes3 }) { 42001 const { content, dropCap, direction, style: style2 } = attributes3; 42002 const textAlign = style2?.typography?.textAlign; 42003 const className = clsx_default({ 42004 "has-drop-cap": textAlign === ((0, import_i18n147.isRTL)() ? "left" : "right") || textAlign === "center" ? false : dropCap 42005 }); 42006 return /* @__PURE__ */ (0, import_jsx_runtime334.jsx)("p", { ...import_block_editor170.useBlockProps.save({ className, dir: direction }), children: /* @__PURE__ */ (0, import_jsx_runtime334.jsx)(import_block_editor170.RichText.Content, { value: content }) }); 42007 } 42008 42009 // packages/block-library/build-module/paragraph/transforms.js 42010 var import_blocks73 = __toESM(require_blocks()); 42011 var transforms21 = { 42012 from: [ 42013 { 42014 type: "raw", 42015 // Paragraph is a fallback and should be matched last. 42016 priority: 20, 42017 selector: "p", 42018 schema: ({ phrasingContentSchema, isPaste }) => ({ 42019 p: { 42020 children: phrasingContentSchema, 42021 attributes: isPaste ? [] : ["style", "id"] 42022 } 42023 }), 42024 transform(node) { 42025 const attributes3 = (0, import_blocks73.getBlockAttributes)(name61, node.outerHTML); 42026 const { textAlign } = node.style || {}; 42027 if (textAlign === "left" || textAlign === "center" || textAlign === "right") { 42028 attributes3.style = { 42029 ...attributes3.style, 42030 typography: { 42031 ...attributes3.style?.typography, 42032 textAlign 42033 } 42034 }; 42035 } 42036 return (0, import_blocks73.createBlock)(name61, attributes3); 42037 } 42038 } 42039 ] 42040 }; 42041 var transforms_default22 = transforms21; 42042 42043 // packages/block-library/build-module/paragraph/index.js 42044 var { fieldsKey: fieldsKey14, formKey: formKey14 } = unlock(import_blocks74.privateApis); 42045 var { name: name62 } = block_default61; 42046 var settings61 = { 42047 icon: paragraph_default, 42048 example: { 42049 attributes: { 42050 content: (0, import_i18n148.__)( 42051 "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." 42052 ) 42053 } 42054 }, 42055 __experimentalLabel(attributes3, { context }) { 42056 const customName = attributes3?.metadata?.name; 42057 if (context === "list-view" && customName) { 42058 return customName; 42059 } 42060 if (context === "accessibility") { 42061 if (customName) { 42062 return customName; 42063 } 42064 const { content } = attributes3; 42065 return !content || content.length === 0 ? (0, import_i18n148.__)("Empty") : content; 42066 } 42067 }, 42068 transforms: transforms_default22, 42069 deprecated: deprecated_default26, 42070 merge(attributes3, attributesToMerge) { 42071 return { 42072 content: (attributes3.content || "") + (attributesToMerge.content || "") 42073 }; 42074 }, 42075 edit: edit_default21, 42076 save: save37 42077 }; 42078 if (window.__experimentalContentOnlyInspectorFields) { 42079 settings61[fieldsKey14] = [ 42080 { 42081 id: "content", 42082 label: (0, import_i18n148.__)("Content"), 42083 type: "richtext" 42084 } 42085 ]; 42086 settings61[formKey14] = { 42087 fields: ["content"] 42088 }; 42089 } 42090 var init61 = () => initBlock({ name: name62, metadata: block_default61, settings: settings61 }); 42091 42092 // packages/block-library/build-module/post-author/index.js 42093 var post_author_exports = {}; 42094 __export(post_author_exports, { 42095 init: () => init62, 42096 metadata: () => block_default62, 42097 name: () => name63, 42098 settings: () => settings62 42099 }); 42100 var import_i18n150 = __toESM(require_i18n()); 42101 42102 // packages/block-library/build-module/post-author/block.json 42103 var block_default62 = { 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 __experimentalDefaultControls: { 42164 background: true, 42165 text: true 42166 } 42167 }, 42168 interactivity: { 42169 clientNavigation: true 42170 }, 42171 __experimentalBorder: { 42172 radius: true, 42173 color: true, 42174 width: true, 42175 style: true, 42176 __experimentalDefaultControls: { 42177 radius: true, 42178 color: true, 42179 width: true, 42180 style: true 42181 } 42182 }, 42183 filter: { 42184 duotone: true 42185 } 42186 }, 42187 selectors: { 42188 filter: { 42189 duotone: ".wp-block-post-author .wp-block-post-author__avatar img" 42190 } 42191 }, 42192 editorStyle: "wp-block-post-author-editor", 42193 style: "wp-block-post-author" 42194 }; 42195 42196 // packages/block-library/build-module/post-author/edit.js 42197 var import_block_editor171 = __toESM(require_block_editor()); 42198 var import_components94 = __toESM(require_components()); 42199 var import_compose36 = __toESM(require_compose()); 42200 var import_core_data50 = __toESM(require_core_data()); 42201 var import_data88 = __toESM(require_data()); 42202 var import_element84 = __toESM(require_element()); 42203 var import_html_entities8 = __toESM(require_html_entities()); 42204 var import_i18n149 = __toESM(require_i18n()); 42205 var import_jsx_runtime335 = __toESM(require_jsx_runtime()); 42206 var AUTHORS_QUERY2 = { 42207 who: "authors", 42208 per_page: 100, 42209 _fields: "id,name", 42210 context: "view" 42211 }; 42212 function AuthorCombobox({ value, onChange }) { 42213 const [filterValue, setFilterValue] = (0, import_element84.useState)(""); 42214 const { authors, isLoading } = (0, import_data88.useSelect)( 42215 (select9) => { 42216 const { getUsers, isResolving } = select9(import_core_data50.store); 42217 const query = { ...AUTHORS_QUERY2 }; 42218 if (filterValue) { 42219 query.search = filterValue; 42220 query.search_columns = ["name"]; 42221 } 42222 return { 42223 authors: getUsers(query), 42224 isLoading: isResolving("getUsers", [query]) 42225 }; 42226 }, 42227 [filterValue] 42228 ); 42229 const authorOptions = (0, import_element84.useMemo)(() => { 42230 const fetchedAuthors = (authors ?? []).map((author) => { 42231 return { 42232 value: author.id, 42233 label: (0, import_html_entities8.decodeEntities)(author.name) 42234 }; 42235 }); 42236 const foundAuthor = fetchedAuthors.findIndex( 42237 (fetchedAuthor) => value?.id === fetchedAuthor.value 42238 ); 42239 let currentAuthor = []; 42240 if (foundAuthor < 0 && value) { 42241 currentAuthor = [ 42242 { 42243 value: value.id, 42244 label: (0, import_html_entities8.decodeEntities)(value.name) 42245 } 42246 ]; 42247 } else if (foundAuthor < 0 && !value) { 42248 currentAuthor = [ 42249 { 42250 value: 0, 42251 label: (0, import_i18n149.__)("(No author)") 42252 } 42253 ]; 42254 } 42255 return [...currentAuthor, ...fetchedAuthors]; 42256 }, [authors, value]); 42257 return /* @__PURE__ */ (0, import_jsx_runtime335.jsx)( 42258 import_components94.ComboboxControl, 42259 { 42260 __next40pxDefaultSize: true, 42261 label: (0, import_i18n149.__)("Author"), 42262 options: authorOptions, 42263 value: value?.id, 42264 onFilterValueChange: (0, import_compose36.debounce)(setFilterValue, 300), 42265 onChange, 42266 allowReset: false, 42267 isLoading 42268 } 42269 ); 42270 } 42271 function PostAuthorEdit({ 42272 isSelected, 42273 context: { postType, postId, queryId }, 42274 attributes: attributes3, 42275 setAttributes 42276 }) { 42277 const isDescendentOfQueryLoop = Number.isFinite(queryId); 42278 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 42279 const defaultAvatar = useDefaultAvatar(); 42280 const { authorDetails, canAssignAuthor, supportsAuthor } = (0, import_data88.useSelect)( 42281 (select9) => { 42282 const { getEditedEntityRecord, getUser, getPostType } = select9(import_core_data50.store); 42283 const currentPost = getEditedEntityRecord( 42284 "postType", 42285 postType, 42286 postId 42287 ); 42288 const authorId = currentPost?.author; 42289 return { 42290 authorDetails: authorId ? getUser(authorId, { context: "view" }) : null, 42291 supportsAuthor: getPostType(postType)?.supports?.author ?? false, 42292 canAssignAuthor: currentPost?._links?.["wp:action-assign-author"] ? true : false 42293 }; 42294 }, 42295 [postType, postId] 42296 ); 42297 const { editEntityRecord } = (0, import_data88.useDispatch)(import_core_data50.store); 42298 const { 42299 textAlign, 42300 showAvatar, 42301 showBio, 42302 byline, 42303 isLink, 42304 linkTarget, 42305 avatarSize 42306 } = attributes3; 42307 const avatarSizes = []; 42308 const authorName = authorDetails?.name || (0, import_i18n149.__)("Post Author"); 42309 if (authorDetails?.avatar_urls) { 42310 Object.keys(authorDetails.avatar_urls).forEach((size) => { 42311 avatarSizes.push({ 42312 value: size, 42313 label: `$size} x $size}` 42314 }); 42315 }); 42316 } 42317 const blockProps = (0, import_block_editor171.useBlockProps)({ 42318 className: clsx_default({ 42319 [`has-text-align-$textAlign}`]: textAlign 42320 }) 42321 }); 42322 const handleSelect = (nextAuthorId) => { 42323 editEntityRecord("postType", postType, postId, { 42324 author: nextAuthorId 42325 }); 42326 }; 42327 const showAuthorControl = !!postId && !isDescendentOfQueryLoop && canAssignAuthor; 42328 if (!supportsAuthor && postType !== void 0) { 42329 return /* @__PURE__ */ (0, import_jsx_runtime335.jsx)("div", { ...blockProps, children: (0, import_i18n149.sprintf)( 42330 // translators: %s: Name of the post type e.g: "post". 42331 (0, import_i18n149.__)("This post type (%s) does not support the author."), 42332 postType 42333 ) }); 42334 } 42335 return /* @__PURE__ */ (0, import_jsx_runtime335.jsxs)(import_jsx_runtime335.Fragment, { children: [ 42336 /* @__PURE__ */ (0, import_jsx_runtime335.jsx)(import_block_editor171.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime335.jsxs)( 42337 import_components94.__experimentalToolsPanel, 42338 { 42339 label: (0, import_i18n149.__)("Settings"), 42340 resetAll: () => { 42341 setAttributes({ 42342 avatarSize: 48, 42343 showAvatar: true, 42344 isLink: false, 42345 linkTarget: "_self" 42346 }); 42347 }, 42348 dropdownMenuProps, 42349 children: [ 42350 showAuthorControl && /* @__PURE__ */ (0, import_jsx_runtime335.jsx)("div", { style: { gridColumn: "1 / -1" }, children: /* @__PURE__ */ (0, import_jsx_runtime335.jsx)( 42351 AuthorCombobox, 42352 { 42353 value: authorDetails, 42354 onChange: handleSelect 42355 } 42356 ) }), 42357 /* @__PURE__ */ (0, import_jsx_runtime335.jsx)( 42358 import_components94.__experimentalToolsPanelItem, 42359 { 42360 label: (0, import_i18n149.__)("Show avatar"), 42361 isShownByDefault: true, 42362 hasValue: () => !showAvatar, 42363 onDeselect: () => setAttributes({ showAvatar: true }), 42364 children: /* @__PURE__ */ (0, import_jsx_runtime335.jsx)( 42365 import_components94.ToggleControl, 42366 { 42367 label: (0, import_i18n149.__)("Show avatar"), 42368 checked: showAvatar, 42369 onChange: () => setAttributes({ 42370 showAvatar: !showAvatar 42371 }) 42372 } 42373 ) 42374 } 42375 ), 42376 showAvatar && /* @__PURE__ */ (0, import_jsx_runtime335.jsx)( 42377 import_components94.__experimentalToolsPanelItem, 42378 { 42379 label: (0, import_i18n149.__)("Avatar size"), 42380 isShownByDefault: true, 42381 hasValue: () => avatarSize !== 48, 42382 onDeselect: () => setAttributes({ avatarSize: 48 }), 42383 children: /* @__PURE__ */ (0, import_jsx_runtime335.jsx)( 42384 import_components94.SelectControl, 42385 { 42386 __next40pxDefaultSize: true, 42387 label: (0, import_i18n149.__)("Avatar size"), 42388 value: avatarSize, 42389 options: avatarSizes, 42390 onChange: (size) => { 42391 setAttributes({ 42392 avatarSize: Number(size) 42393 }); 42394 } 42395 } 42396 ) 42397 } 42398 ), 42399 /* @__PURE__ */ (0, import_jsx_runtime335.jsx)( 42400 import_components94.__experimentalToolsPanelItem, 42401 { 42402 label: (0, import_i18n149.__)("Show bio"), 42403 isShownByDefault: true, 42404 hasValue: () => !!showBio, 42405 onDeselect: () => setAttributes({ showBio: void 0 }), 42406 children: /* @__PURE__ */ (0, import_jsx_runtime335.jsx)( 42407 import_components94.ToggleControl, 42408 { 42409 label: (0, import_i18n149.__)("Show bio"), 42410 checked: !!showBio, 42411 onChange: () => setAttributes({ showBio: !showBio }) 42412 } 42413 ) 42414 } 42415 ), 42416 /* @__PURE__ */ (0, import_jsx_runtime335.jsx)( 42417 import_components94.__experimentalToolsPanelItem, 42418 { 42419 label: (0, import_i18n149.__)("Link author name to author page"), 42420 isShownByDefault: true, 42421 hasValue: () => !!isLink, 42422 onDeselect: () => setAttributes({ isLink: false }), 42423 children: /* @__PURE__ */ (0, import_jsx_runtime335.jsx)( 42424 import_components94.ToggleControl, 42425 { 42426 label: (0, import_i18n149.__)("Link author name to author page"), 42427 checked: isLink, 42428 onChange: () => setAttributes({ isLink: !isLink }) 42429 } 42430 ) 42431 } 42432 ), 42433 isLink && /* @__PURE__ */ (0, import_jsx_runtime335.jsx)( 42434 import_components94.__experimentalToolsPanelItem, 42435 { 42436 label: (0, import_i18n149.__)("Link target"), 42437 isShownByDefault: true, 42438 hasValue: () => linkTarget !== "_self", 42439 onDeselect: () => setAttributes({ linkTarget: "_self" }), 42440 children: /* @__PURE__ */ (0, import_jsx_runtime335.jsx)( 42441 import_components94.ToggleControl, 42442 { 42443 label: (0, import_i18n149.__)("Open in new tab"), 42444 onChange: (value) => setAttributes({ 42445 linkTarget: value ? "_blank" : "_self" 42446 }), 42447 checked: linkTarget === "_blank" 42448 } 42449 ) 42450 } 42451 ) 42452 ] 42453 } 42454 ) }), 42455 /* @__PURE__ */ (0, import_jsx_runtime335.jsx)(import_block_editor171.BlockControls, { group: "block", children: /* @__PURE__ */ (0, import_jsx_runtime335.jsx)( 42456 import_block_editor171.AlignmentControl, 42457 { 42458 value: textAlign, 42459 onChange: (nextAlign) => { 42460 setAttributes({ textAlign: nextAlign }); 42461 } 42462 } 42463 ) }), 42464 /* @__PURE__ */ (0, import_jsx_runtime335.jsxs)("div", { ...blockProps, children: [ 42465 showAvatar && /* @__PURE__ */ (0, import_jsx_runtime335.jsx)("div", { className: "wp-block-post-author__avatar", children: /* @__PURE__ */ (0, import_jsx_runtime335.jsx)( 42466 "img", 42467 { 42468 width: avatarSize, 42469 src: authorDetails?.avatar_urls?.[avatarSize] || defaultAvatar, 42470 alt: authorDetails?.name || (0, import_i18n149.__)("Default Avatar") 42471 } 42472 ) }), 42473 /* @__PURE__ */ (0, import_jsx_runtime335.jsxs)("div", { className: "wp-block-post-author__content", children: [ 42474 (!import_block_editor171.RichText.isEmpty(byline) || isSelected) && /* @__PURE__ */ (0, import_jsx_runtime335.jsx)( 42475 import_block_editor171.RichText, 42476 { 42477 identifier: "byline", 42478 className: "wp-block-post-author__byline", 42479 "aria-label": (0, import_i18n149.__)("Post author byline text"), 42480 placeholder: (0, import_i18n149.__)("Write byline\u2026"), 42481 value: byline, 42482 onChange: (value) => setAttributes({ byline: value }) 42483 } 42484 ), 42485 /* @__PURE__ */ (0, import_jsx_runtime335.jsx)("p", { className: "wp-block-post-author__name", children: isLink ? /* @__PURE__ */ (0, import_jsx_runtime335.jsx)( 42486 "a", 42487 { 42488 href: "#post-author-pseudo-link", 42489 onClick: (event) => event.preventDefault(), 42490 children: authorName 42491 } 42492 ) : authorName }), 42493 showBio && /* @__PURE__ */ (0, import_jsx_runtime335.jsx)( 42494 "p", 42495 { 42496 className: "wp-block-post-author__bio", 42497 dangerouslySetInnerHTML: { 42498 __html: authorDetails?.description 42499 } 42500 } 42501 ) 42502 ] }) 42503 ] }) 42504 ] }); 42505 } 42506 var edit_default22 = PostAuthorEdit; 42507 42508 // packages/block-library/build-module/post-author/index.js 42509 var { name: name63 } = block_default62; 42510 var settings62 = { 42511 icon: post_author_default, 42512 example: { 42513 viewportWidth: 350, 42514 attributes: { 42515 showBio: true, 42516 byline: (0, import_i18n150.__)("Posted by") 42517 } 42518 }, 42519 edit: edit_default22 42520 }; 42521 var init62 = () => initBlock({ name: name63, metadata: block_default62, settings: settings62 }); 42522 42523 // packages/block-library/build-module/post-author-name/index.js 42524 var post_author_name_exports = {}; 42525 __export(post_author_name_exports, { 42526 init: () => init63, 42527 metadata: () => block_default63, 42528 name: () => name64, 42529 settings: () => settings63 42530 }); 42531 42532 // packages/block-library/build-module/post-author-name/block.json 42533 var block_default63 = { 42534 $schema: "https://schemas.wp.org/trunk/block.json", 42535 apiVersion: 3, 42536 name: "core/post-author-name", 42537 title: "Author Name", 42538 category: "theme", 42539 description: "The author name.", 42540 textdomain: "default", 42541 attributes: { 42542 textAlign: { 42543 type: "string" 42544 }, 42545 isLink: { 42546 type: "boolean", 42547 default: false, 42548 role: "content" 42549 }, 42550 linkTarget: { 42551 type: "string", 42552 default: "_self", 42553 role: "content" 42554 } 42555 }, 42556 usesContext: ["postType", "postId"], 42557 example: { 42558 viewportWidth: 350 42559 }, 42560 supports: { 42561 html: false, 42562 spacing: { 42563 margin: true, 42564 padding: true 42565 }, 42566 color: { 42567 gradients: true, 42568 link: true, 42569 __experimentalDefaultControls: { 42570 background: true, 42571 text: true, 42572 link: true 42573 } 42574 }, 42575 typography: { 42576 fontSize: true, 42577 lineHeight: true, 42578 __experimentalFontFamily: true, 42579 __experimentalFontWeight: true, 42580 __experimentalFontStyle: true, 42581 __experimentalTextTransform: true, 42582 __experimentalTextDecoration: true, 42583 __experimentalLetterSpacing: true, 42584 __experimentalDefaultControls: { 42585 fontSize: true 42586 } 42587 }, 42588 interactivity: { 42589 clientNavigation: true 42590 }, 42591 __experimentalBorder: { 42592 radius: true, 42593 color: true, 42594 width: true, 42595 style: true, 42596 __experimentalDefaultControls: { 42597 radius: true, 42598 color: true, 42599 width: true, 42600 style: true 42601 } 42602 } 42603 }, 42604 style: "wp-block-post-author-name" 42605 }; 42606 42607 // packages/block-library/build-module/post-author-name/edit.js 42608 var import_block_editor172 = __toESM(require_block_editor()); 42609 var import_data89 = __toESM(require_data()); 42610 var import_i18n151 = __toESM(require_i18n()); 42611 var import_core_data51 = __toESM(require_core_data()); 42612 var import_components95 = __toESM(require_components()); 42613 var import_jsx_runtime336 = __toESM(require_jsx_runtime()); 42614 function PostAuthorNameEdit({ 42615 context: { postType, postId }, 42616 attributes: { textAlign, isLink, linkTarget }, 42617 setAttributes 42618 }) { 42619 const { authorName, supportsAuthor } = (0, import_data89.useSelect)( 42620 (select9) => { 42621 const { getEditedEntityRecord, getUser, getPostType } = select9(import_core_data51.store); 42622 const _authorId = getEditedEntityRecord( 42623 "postType", 42624 postType, 42625 postId 42626 )?.author; 42627 return { 42628 authorName: _authorId ? getUser(_authorId) : null, 42629 supportsAuthor: getPostType(postType)?.supports?.author ?? false 42630 }; 42631 }, 42632 [postType, postId] 42633 ); 42634 const blockProps = (0, import_block_editor172.useBlockProps)({ 42635 className: clsx_default({ 42636 [`has-text-align-$textAlign}`]: textAlign 42637 }) 42638 }); 42639 const displayName = authorName?.name || (0, import_i18n151.__)("Author Name"); 42640 const displayAuthor = isLink ? /* @__PURE__ */ (0, import_jsx_runtime336.jsx)( 42641 "a", 42642 { 42643 href: "#author-pseudo-link", 42644 onClick: (event) => event.preventDefault(), 42645 className: "wp-block-post-author-name__link", 42646 children: displayName 42647 } 42648 ) : displayName; 42649 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 42650 return /* @__PURE__ */ (0, import_jsx_runtime336.jsxs)(import_jsx_runtime336.Fragment, { children: [ 42651 /* @__PURE__ */ (0, import_jsx_runtime336.jsx)(import_block_editor172.BlockControls, { group: "block", children: /* @__PURE__ */ (0, import_jsx_runtime336.jsx)( 42652 import_block_editor172.AlignmentControl, 42653 { 42654 value: textAlign, 42655 onChange: (nextAlign) => { 42656 setAttributes({ textAlign: nextAlign }); 42657 } 42658 } 42659 ) }), 42660 /* @__PURE__ */ (0, import_jsx_runtime336.jsx)(import_block_editor172.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime336.jsxs)( 42661 import_components95.__experimentalToolsPanel, 42662 { 42663 label: (0, import_i18n151.__)("Settings"), 42664 resetAll: () => { 42665 setAttributes({ 42666 isLink: false, 42667 linkTarget: "_self" 42668 }); 42669 }, 42670 dropdownMenuProps, 42671 children: [ 42672 /* @__PURE__ */ (0, import_jsx_runtime336.jsx)( 42673 import_components95.__experimentalToolsPanelItem, 42674 { 42675 label: (0, import_i18n151.__)("Link to author archive"), 42676 isShownByDefault: true, 42677 hasValue: () => isLink, 42678 onDeselect: () => setAttributes({ isLink: false }), 42679 children: /* @__PURE__ */ (0, import_jsx_runtime336.jsx)( 42680 import_components95.ToggleControl, 42681 { 42682 label: (0, import_i18n151.__)("Link to author archive"), 42683 onChange: () => setAttributes({ isLink: !isLink }), 42684 checked: isLink 42685 } 42686 ) 42687 } 42688 ), 42689 isLink && /* @__PURE__ */ (0, import_jsx_runtime336.jsx)( 42690 import_components95.__experimentalToolsPanelItem, 42691 { 42692 label: (0, import_i18n151.__)("Open in new tab"), 42693 isShownByDefault: true, 42694 hasValue: () => linkTarget !== "_self", 42695 onDeselect: () => setAttributes({ linkTarget: "_self" }), 42696 children: /* @__PURE__ */ (0, import_jsx_runtime336.jsx)( 42697 import_components95.ToggleControl, 42698 { 42699 label: (0, import_i18n151.__)("Open in new tab"), 42700 onChange: (value) => setAttributes({ 42701 linkTarget: value ? "_blank" : "_self" 42702 }), 42703 checked: linkTarget === "_blank" 42704 } 42705 ) 42706 } 42707 ) 42708 ] 42709 } 42710 ) }), 42711 /* @__PURE__ */ (0, import_jsx_runtime336.jsx)("div", { ...blockProps, children: !supportsAuthor && postType !== void 0 ? (0, import_i18n151.sprintf)( 42712 // translators: %s: Name of the post type e.g: "post". 42713 (0, import_i18n151.__)( 42714 "This post type (%s) does not support the author." 42715 ), 42716 postType 42717 ) : displayAuthor }) 42718 ] }); 42719 } 42720 var edit_default23 = PostAuthorNameEdit; 42721 42722 // packages/block-library/build-module/post-author-name/transforms.js 42723 var import_blocks75 = __toESM(require_blocks()); 42724 var transforms22 = { 42725 from: [ 42726 { 42727 type: "block", 42728 blocks: ["core/post-author"], 42729 transform: ({ textAlign }) => (0, import_blocks75.createBlock)("core/post-author-name", { textAlign }) 42730 } 42731 ], 42732 to: [ 42733 { 42734 type: "block", 42735 blocks: ["core/post-author"], 42736 transform: ({ textAlign }) => (0, import_blocks75.createBlock)("core/post-author", { textAlign }) 42737 } 42738 ] 42739 }; 42740 var transforms_default23 = transforms22; 42741 42742 // packages/block-library/build-module/post-author-name/index.js 42743 var { name: name64 } = block_default63; 42744 var settings63 = { 42745 icon: post_author_default, 42746 transforms: transforms_default23, 42747 edit: edit_default23 42748 }; 42749 var init63 = () => initBlock({ name: name64, metadata: block_default63, settings: settings63 }); 42750 42751 // packages/block-library/build-module/post-author-biography/index.js 42752 var post_author_biography_exports = {}; 42753 __export(post_author_biography_exports, { 42754 init: () => init64, 42755 metadata: () => block_default64, 42756 name: () => name65, 42757 settings: () => settings64 42758 }); 42759 42760 // packages/block-library/build-module/post-author-biography/block.json 42761 var block_default64 = { 42762 $schema: "https://schemas.wp.org/trunk/block.json", 42763 apiVersion: 3, 42764 name: "core/post-author-biography", 42765 title: "Author Biography", 42766 category: "theme", 42767 description: "The author biography.", 42768 textdomain: "default", 42769 attributes: { 42770 textAlign: { 42771 type: "string" 42772 } 42773 }, 42774 usesContext: ["postType", "postId"], 42775 example: { 42776 viewportWidth: 350 42777 }, 42778 supports: { 42779 spacing: { 42780 margin: true, 42781 padding: true 42782 }, 42783 color: { 42784 gradients: true, 42785 link: true, 42786 __experimentalDefaultControls: { 42787 background: true, 42788 text: true 42789 } 42790 }, 42791 typography: { 42792 fontSize: true, 42793 lineHeight: true, 42794 __experimentalFontFamily: true, 42795 __experimentalFontWeight: true, 42796 __experimentalFontStyle: true, 42797 __experimentalTextTransform: true, 42798 __experimentalTextDecoration: true, 42799 __experimentalLetterSpacing: true, 42800 __experimentalDefaultControls: { 42801 fontSize: true 42802 } 42803 }, 42804 interactivity: { 42805 clientNavigation: true 42806 }, 42807 __experimentalBorder: { 42808 radius: true, 42809 color: true, 42810 width: true, 42811 style: true, 42812 __experimentalDefaultControls: { 42813 radius: true, 42814 color: true, 42815 width: true, 42816 style: true 42817 } 42818 } 42819 }, 42820 style: "wp-block-post-author-biography" 42821 }; 42822 42823 // packages/block-library/build-module/post-author-biography/edit.js 42824 var import_block_editor173 = __toESM(require_block_editor()); 42825 var import_data90 = __toESM(require_data()); 42826 var import_i18n152 = __toESM(require_i18n()); 42827 var import_core_data52 = __toESM(require_core_data()); 42828 var import_jsx_runtime337 = __toESM(require_jsx_runtime()); 42829 function PostAuthorBiographyEdit({ 42830 context: { postType, postId }, 42831 attributes: { textAlign }, 42832 setAttributes 42833 }) { 42834 const { authorDetails } = (0, import_data90.useSelect)( 42835 (select9) => { 42836 const { getEditedEntityRecord, getUser } = select9(import_core_data52.store); 42837 const _authorId = getEditedEntityRecord( 42838 "postType", 42839 postType, 42840 postId 42841 )?.author; 42842 return { 42843 authorDetails: _authorId ? getUser(_authorId) : null 42844 }; 42845 }, 42846 [postType, postId] 42847 ); 42848 const blockProps = (0, import_block_editor173.useBlockProps)({ 42849 className: clsx_default({ 42850 [`has-text-align-$textAlign}`]: textAlign 42851 }) 42852 }); 42853 const displayAuthorBiography = authorDetails?.description || (0, import_i18n152.__)("Author Biography"); 42854 return /* @__PURE__ */ (0, import_jsx_runtime337.jsxs)(import_jsx_runtime337.Fragment, { children: [ 42855 /* @__PURE__ */ (0, import_jsx_runtime337.jsx)(import_block_editor173.BlockControls, { group: "block", children: /* @__PURE__ */ (0, import_jsx_runtime337.jsx)( 42856 import_block_editor173.AlignmentControl, 42857 { 42858 value: textAlign, 42859 onChange: (nextAlign) => { 42860 setAttributes({ textAlign: nextAlign }); 42861 } 42862 } 42863 ) }), 42864 /* @__PURE__ */ (0, import_jsx_runtime337.jsx)( 42865 "div", 42866 { 42867 ...blockProps, 42868 dangerouslySetInnerHTML: { __html: displayAuthorBiography } 42869 } 42870 ) 42871 ] }); 42872 } 42873 var edit_default24 = PostAuthorBiographyEdit; 42874 42875 // packages/block-library/build-module/post-author-biography/index.js 42876 var { name: name65 } = block_default64; 42877 var settings64 = { 42878 icon: post_author_default, 42879 edit: edit_default24 42880 }; 42881 var init64 = () => initBlock({ name: name65, metadata: block_default64, settings: settings64 }); 42882 42883 // packages/block-library/build-module/post-comment/index.js 42884 var post_comment_exports = {}; 42885 __export(post_comment_exports, { 42886 init: () => init65, 42887 metadata: () => block_default65, 42888 name: () => name66, 42889 settings: () => settings65 42890 }); 42891 42892 // packages/block-library/build-module/post-comment/block.json 42893 var block_default65 = { 42894 $schema: "https://schemas.wp.org/trunk/block.json", 42895 apiVersion: 3, 42896 __experimental: "fse", 42897 name: "core/post-comment", 42898 title: "Comment (deprecated)", 42899 category: "theme", 42900 allowedBlocks: [ 42901 "core/avatar", 42902 "core/comment-author-name", 42903 "core/comment-content", 42904 "core/comment-date", 42905 "core/comment-edit-link", 42906 "core/comment-reply-link" 42907 ], 42908 description: "This block is deprecated. Please use the Comments block instead.", 42909 textdomain: "default", 42910 attributes: { 42911 commentId: { 42912 type: "number" 42913 } 42914 }, 42915 providesContext: { 42916 commentId: "commentId" 42917 }, 42918 supports: { 42919 html: false, 42920 inserter: false, 42921 interactivity: { 42922 clientNavigation: true 42923 } 42924 } 42925 }; 42926 42927 // packages/block-library/build-module/post-comment/edit.js 42928 var import_i18n153 = __toESM(require_i18n()); 42929 var import_components96 = __toESM(require_components()); 42930 var import_element85 = __toESM(require_element()); 42931 var import_block_editor174 = __toESM(require_block_editor()); 42932 var import_jsx_runtime338 = __toESM(require_jsx_runtime()); 42933 var TEMPLATE10 = [ 42934 ["core/avatar"], 42935 ["core/comment-author-name"], 42936 ["core/comment-date"], 42937 ["core/comment-content"], 42938 ["core/comment-reply-link"], 42939 ["core/comment-edit-link"] 42940 ]; 42941 function Edit17({ attributes: { commentId }, setAttributes }) { 42942 const [commentIdInput, setCommentIdInput] = (0, import_element85.useState)(commentId); 42943 const blockProps = (0, import_block_editor174.useBlockProps)(); 42944 const innerBlocksProps = (0, import_block_editor174.useInnerBlocksProps)(blockProps, { 42945 template: TEMPLATE10 42946 }); 42947 if (!commentId) { 42948 return /* @__PURE__ */ (0, import_jsx_runtime338.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime338.jsxs)( 42949 import_components96.Placeholder, 42950 { 42951 icon: block_default_default, 42952 label: (0, import_i18n153._x)("Post Comment", "block title"), 42953 instructions: (0, import_i18n153.__)( 42954 "To show a comment, input the comment ID." 42955 ), 42956 children: [ 42957 /* @__PURE__ */ (0, import_jsx_runtime338.jsx)( 42958 import_components96.TextControl, 42959 { 42960 __next40pxDefaultSize: true, 42961 value: commentId, 42962 onChange: (val) => setCommentIdInput(parseInt(val)) 42963 } 42964 ), 42965 /* @__PURE__ */ (0, import_jsx_runtime338.jsx)( 42966 import_components96.Button, 42967 { 42968 __next40pxDefaultSize: true, 42969 variant: "primary", 42970 onClick: () => { 42971 setAttributes({ commentId: commentIdInput }); 42972 }, 42973 children: (0, import_i18n153.__)("Save") 42974 } 42975 ) 42976 ] 42977 } 42978 ) }); 42979 } 42980 return /* @__PURE__ */ (0, import_jsx_runtime338.jsx)("div", { ...innerBlocksProps }); 42981 } 42982 42983 // packages/block-library/build-module/post-comment/save.js 42984 var import_block_editor175 = __toESM(require_block_editor()); 42985 var import_jsx_runtime339 = __toESM(require_jsx_runtime()); 42986 function save38() { 42987 const blockProps = import_block_editor175.useBlockProps.save(); 42988 const innerBlocksProps = import_block_editor175.useInnerBlocksProps.save(blockProps); 42989 return /* @__PURE__ */ (0, import_jsx_runtime339.jsx)("div", { ...innerBlocksProps }); 42990 } 42991 42992 // packages/block-library/build-module/post-comment/index.js 42993 var { name: name66 } = block_default65; 42994 var settings65 = { 42995 icon: comment_default, 42996 edit: Edit17, 42997 save: save38 42998 }; 42999 var init65 = () => initBlock({ name: name66, metadata: block_default65, settings: settings65 }); 43000 43001 // packages/block-library/build-module/post-comments-count/index.js 43002 var post_comments_count_exports = {}; 43003 __export(post_comments_count_exports, { 43004 init: () => init66, 43005 metadata: () => block_default66, 43006 name: () => name67, 43007 settings: () => settings66 43008 }); 43009 43010 // packages/block-library/build-module/post-comments-count/block.json 43011 var block_default66 = { 43012 $schema: "https://schemas.wp.org/trunk/block.json", 43013 apiVersion: 3, 43014 name: "core/post-comments-count", 43015 title: "Comments Count", 43016 category: "theme", 43017 description: "Display a post's comments count.", 43018 textdomain: "default", 43019 attributes: { 43020 textAlign: { 43021 type: "string" 43022 } 43023 }, 43024 usesContext: ["postId"], 43025 example: { 43026 viewportWidth: 350 43027 }, 43028 supports: { 43029 html: false, 43030 color: { 43031 gradients: true, 43032 __experimentalDefaultControls: { 43033 background: true, 43034 text: true 43035 } 43036 }, 43037 spacing: { 43038 margin: true, 43039 padding: true 43040 }, 43041 typography: { 43042 fontSize: true, 43043 lineHeight: true, 43044 __experimentalFontFamily: true, 43045 __experimentalFontWeight: true, 43046 __experimentalFontStyle: true, 43047 __experimentalTextTransform: true, 43048 __experimentalTextDecoration: true, 43049 __experimentalLetterSpacing: true, 43050 __experimentalDefaultControls: { 43051 fontSize: true 43052 } 43053 }, 43054 __experimentalBorder: { 43055 radius: true, 43056 color: true, 43057 width: true, 43058 style: true 43059 }, 43060 interactivity: { 43061 clientNavigation: true 43062 } 43063 }, 43064 style: "wp-block-post-comments-count" 43065 }; 43066 43067 // packages/block-library/build-module/post-comments-count/edit.js 43068 var import_block_editor176 = __toESM(require_block_editor()); 43069 var import_element86 = __toESM(require_element()); 43070 var import_api_fetch3 = __toESM(require_api_fetch()); 43071 var import_url15 = __toESM(require_url()); 43072 var import_jsx_runtime340 = __toESM(require_jsx_runtime()); 43073 function PostCommentsCountEdit({ 43074 attributes: attributes3, 43075 context, 43076 setAttributes 43077 }) { 43078 const { textAlign } = attributes3; 43079 const { postId } = context; 43080 const [commentsCount, setCommentsCount] = (0, import_element86.useState)(); 43081 const blockProps = (0, import_block_editor176.useBlockProps)({ 43082 className: clsx_default({ 43083 [`has-text-align-$textAlign}`]: textAlign 43084 }) 43085 }); 43086 (0, import_element86.useEffect)(() => { 43087 if (!postId) { 43088 return; 43089 } 43090 const currentPostId = postId; 43091 (0, import_api_fetch3.default)({ 43092 path: (0, import_url15.addQueryArgs)("/wp/v2/comments", { 43093 post: postId 43094 }), 43095 parse: false 43096 }).then((res) => { 43097 if (currentPostId === postId) { 43098 setCommentsCount(res.headers.get("X-WP-Total")); 43099 } 43100 }); 43101 }, [postId]); 43102 const hasPostAndComments = postId && commentsCount !== void 0; 43103 const blockStyles = { 43104 ...blockProps.style, 43105 textDecoration: hasPostAndComments ? blockProps.style?.textDecoration : void 0 43106 }; 43107 return /* @__PURE__ */ (0, import_jsx_runtime340.jsxs)(import_jsx_runtime340.Fragment, { children: [ 43108 /* @__PURE__ */ (0, import_jsx_runtime340.jsx)(import_block_editor176.BlockControls, { group: "block", children: /* @__PURE__ */ (0, import_jsx_runtime340.jsx)( 43109 import_block_editor176.AlignmentControl, 43110 { 43111 value: textAlign, 43112 onChange: (nextAlign) => { 43113 setAttributes({ textAlign: nextAlign }); 43114 } 43115 } 43116 ) }), 43117 /* @__PURE__ */ (0, import_jsx_runtime340.jsx)("div", { ...blockProps, style: blockStyles, children: hasPostAndComments ? commentsCount : "0" }) 43118 ] }); 43119 } 43120 43121 // packages/block-library/build-module/post-comments-count/transforms.js 43122 var import_blocks76 = __toESM(require_blocks()); 43123 var transforms23 = { 43124 to: [ 43125 { 43126 type: "block", 43127 blocks: ["core/post-comments-link"], 43128 transform: ({ textAlign }) => { 43129 return (0, import_blocks76.createBlock)("core/post-comments-link", { 43130 textAlign 43131 }); 43132 } 43133 } 43134 ] 43135 }; 43136 var transforms_default24 = transforms23; 43137 43138 // packages/block-library/build-module/post-comments-count/index.js 43139 var { name: name67 } = block_default66; 43140 var settings66 = { 43141 icon: post_comments_count_default, 43142 edit: PostCommentsCountEdit, 43143 transforms: transforms_default24 43144 }; 43145 var init66 = () => initBlock({ name: name67, metadata: block_default66, settings: settings66 }); 43146 43147 // packages/block-library/build-module/post-comments-form/index.js 43148 var post_comments_form_exports = {}; 43149 __export(post_comments_form_exports, { 43150 init: () => init67, 43151 metadata: () => block_default67, 43152 name: () => name68, 43153 settings: () => settings67 43154 }); 43155 43156 // packages/block-library/build-module/post-comments-form/block.json 43157 var block_default67 = { 43158 $schema: "https://schemas.wp.org/trunk/block.json", 43159 apiVersion: 3, 43160 name: "core/post-comments-form", 43161 title: "Comments Form", 43162 category: "theme", 43163 description: "Display a post's comments form.", 43164 textdomain: "default", 43165 attributes: { 43166 textAlign: { 43167 type: "string" 43168 } 43169 }, 43170 usesContext: ["postId", "postType"], 43171 supports: { 43172 html: false, 43173 color: { 43174 gradients: true, 43175 heading: true, 43176 link: true, 43177 __experimentalDefaultControls: { 43178 background: true, 43179 text: true 43180 } 43181 }, 43182 spacing: { 43183 margin: true, 43184 padding: true 43185 }, 43186 typography: { 43187 fontSize: true, 43188 lineHeight: true, 43189 __experimentalFontStyle: true, 43190 __experimentalFontWeight: true, 43191 __experimentalLetterSpacing: true, 43192 __experimentalTextTransform: true, 43193 __experimentalDefaultControls: { 43194 fontSize: true 43195 } 43196 }, 43197 __experimentalBorder: { 43198 radius: true, 43199 color: true, 43200 width: true, 43201 style: true, 43202 __experimentalDefaultControls: { 43203 radius: true, 43204 color: true, 43205 width: true, 43206 style: true 43207 } 43208 } 43209 }, 43210 editorStyle: "wp-block-post-comments-form-editor", 43211 style: [ 43212 "wp-block-post-comments-form", 43213 "wp-block-buttons", 43214 "wp-block-button" 43215 ], 43216 example: { 43217 attributes: { 43218 textAlign: "center" 43219 } 43220 } 43221 }; 43222 43223 // packages/block-library/build-module/post-comments-form/edit.js 43224 var import_block_editor177 = __toESM(require_block_editor()); 43225 var import_components97 = __toESM(require_components()); 43226 var import_compose37 = __toESM(require_compose()); 43227 var import_i18n154 = __toESM(require_i18n()); 43228 var import_jsx_runtime341 = __toESM(require_jsx_runtime()); 43229 function PostCommentsFormEdit({ 43230 attributes: attributes3, 43231 context, 43232 setAttributes 43233 }) { 43234 const { textAlign } = attributes3; 43235 const { postId, postType } = context; 43236 const instanceId = (0, import_compose37.useInstanceId)(PostCommentsFormEdit); 43237 const instanceIdDesc = (0, import_i18n154.sprintf)("comments-form-edit-%d-desc", instanceId); 43238 const blockProps = (0, import_block_editor177.useBlockProps)({ 43239 className: clsx_default({ 43240 [`has-text-align-$textAlign}`]: textAlign 43241 }), 43242 "aria-describedby": instanceIdDesc 43243 }); 43244 return /* @__PURE__ */ (0, import_jsx_runtime341.jsxs)(import_jsx_runtime341.Fragment, { children: [ 43245 /* @__PURE__ */ (0, import_jsx_runtime341.jsx)(import_block_editor177.BlockControls, { group: "block", children: /* @__PURE__ */ (0, import_jsx_runtime341.jsx)( 43246 import_block_editor177.AlignmentControl, 43247 { 43248 value: textAlign, 43249 onChange: (nextAlign) => { 43250 setAttributes({ textAlign: nextAlign }); 43251 } 43252 } 43253 ) }), 43254 /* @__PURE__ */ (0, import_jsx_runtime341.jsxs)("div", { ...blockProps, children: [ 43255 /* @__PURE__ */ (0, import_jsx_runtime341.jsx)(form_default, { postId, postType }), 43256 /* @__PURE__ */ (0, import_jsx_runtime341.jsx)(import_components97.VisuallyHidden, { id: instanceIdDesc, children: (0, import_i18n154.__)("Comments form disabled in editor.") }) 43257 ] }) 43258 ] }); 43259 } 43260 43261 // packages/block-library/build-module/post-comments-form/index.js 43262 var { name: name68 } = block_default67; 43263 var settings67 = { 43264 icon: post_comments_form_default, 43265 edit: PostCommentsFormEdit 43266 }; 43267 var init67 = () => initBlock({ name: name68, metadata: block_default67, settings: settings67 }); 43268 43269 // packages/block-library/build-module/post-comments-link/index.js 43270 var post_comments_link_exports = {}; 43271 __export(post_comments_link_exports, { 43272 init: () => init68, 43273 metadata: () => block_default68, 43274 name: () => name69, 43275 settings: () => settings68 43276 }); 43277 43278 // packages/block-library/build-module/post-comments-link/block.json 43279 var block_default68 = { 43280 $schema: "https://schemas.wp.org/trunk/block.json", 43281 apiVersion: 3, 43282 name: "core/post-comments-link", 43283 title: "Comments Link", 43284 category: "theme", 43285 description: "Displays the link to the current post comments.", 43286 textdomain: "default", 43287 usesContext: ["postType", "postId"], 43288 attributes: { 43289 textAlign: { 43290 type: "string" 43291 } 43292 }, 43293 example: { 43294 viewportWidth: 350 43295 }, 43296 supports: { 43297 html: false, 43298 color: { 43299 link: true, 43300 text: false, 43301 __experimentalDefaultControls: { 43302 background: true, 43303 link: true 43304 } 43305 }, 43306 spacing: { 43307 margin: true, 43308 padding: true 43309 }, 43310 typography: { 43311 fontSize: true, 43312 lineHeight: true, 43313 __experimentalFontFamily: true, 43314 __experimentalFontWeight: true, 43315 __experimentalFontStyle: true, 43316 __experimentalTextTransform: true, 43317 __experimentalTextDecoration: true, 43318 __experimentalLetterSpacing: true, 43319 __experimentalDefaultControls: { 43320 fontSize: true 43321 } 43322 }, 43323 interactivity: { 43324 clientNavigation: true 43325 }, 43326 __experimentalBorder: { 43327 radius: true, 43328 color: true, 43329 width: true, 43330 style: true, 43331 __experimentalDefaultControls: { 43332 radius: true, 43333 color: true, 43334 width: true, 43335 style: true 43336 } 43337 } 43338 }, 43339 style: "wp-block-post-comments-link" 43340 }; 43341 43342 // packages/block-library/build-module/post-comments-link/edit.js 43343 var import_block_editor178 = __toESM(require_block_editor()); 43344 var import_element87 = __toESM(require_element()); 43345 var import_data91 = __toESM(require_data()); 43346 var import_api_fetch4 = __toESM(require_api_fetch()); 43347 var import_url16 = __toESM(require_url()); 43348 var import_i18n155 = __toESM(require_i18n()); 43349 var import_core_data53 = __toESM(require_core_data()); 43350 var import_jsx_runtime342 = __toESM(require_jsx_runtime()); 43351 function PostCommentsLinkEdit({ context, attributes: attributes3, setAttributes }) { 43352 const { textAlign } = attributes3; 43353 const { postType, postId } = context; 43354 const [commentsCount, setCommentsCount] = (0, import_element87.useState)(); 43355 const blockProps = (0, import_block_editor178.useBlockProps)({ 43356 className: clsx_default({ 43357 [`has-text-align-$textAlign}`]: textAlign 43358 }) 43359 }); 43360 (0, import_element87.useEffect)(() => { 43361 if (!postId) { 43362 return; 43363 } 43364 const currentPostId = postId; 43365 (0, import_api_fetch4.default)({ 43366 path: (0, import_url16.addQueryArgs)("/wp/v2/comments", { 43367 post: postId 43368 }), 43369 parse: false 43370 }).then((res) => { 43371 if (currentPostId === postId) { 43372 setCommentsCount(res.headers.get("X-WP-Total")); 43373 } 43374 }); 43375 }, [postId]); 43376 const post = (0, import_data91.useSelect)( 43377 (select9) => select9(import_core_data53.store).getEditedEntityRecord( 43378 "postType", 43379 postType, 43380 postId 43381 ), 43382 [postType, postId] 43383 ); 43384 let commentsText; 43385 if (commentsCount !== void 0) { 43386 const commentsNumber = parseInt(commentsCount); 43387 if (commentsNumber === 0) { 43388 commentsText = (0, import_i18n155.__)("No comments"); 43389 } else { 43390 commentsText = (0, import_i18n155.sprintf)( 43391 /* translators: %s: Number of comments */ 43392 (0, import_i18n155._n)("%s comment", "%s comments", commentsNumber), 43393 commentsNumber.toLocaleString() 43394 ); 43395 } 43396 } 43397 return /* @__PURE__ */ (0, import_jsx_runtime342.jsxs)(import_jsx_runtime342.Fragment, { children: [ 43398 /* @__PURE__ */ (0, import_jsx_runtime342.jsx)(import_block_editor178.BlockControls, { group: "block", children: /* @__PURE__ */ (0, import_jsx_runtime342.jsx)( 43399 import_block_editor178.AlignmentControl, 43400 { 43401 value: textAlign, 43402 onChange: (nextAlign) => { 43403 setAttributes({ textAlign: nextAlign }); 43404 } 43405 } 43406 ) }), 43407 /* @__PURE__ */ (0, import_jsx_runtime342.jsx)("div", { ...blockProps, children: post?.link && commentsText !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime342.jsx)( 43408 "a", 43409 { 43410 href: post?.link + "#comments", 43411 onClick: (event) => event.preventDefault(), 43412 children: commentsText 43413 } 43414 ) : /* @__PURE__ */ (0, import_jsx_runtime342.jsx)( 43415 "a", 43416 { 43417 href: "#post-comments-link-pseudo-link", 43418 onClick: (event) => event.preventDefault(), 43419 children: (0, import_i18n155.__)("No comments") 43420 } 43421 ) }) 43422 ] }); 43423 } 43424 var edit_default25 = PostCommentsLinkEdit; 43425 43426 // packages/block-library/build-module/post-comments-link/transforms.js 43427 var import_blocks77 = __toESM(require_blocks()); 43428 var transforms24 = { 43429 to: [ 43430 { 43431 type: "block", 43432 blocks: ["core/post-comments-count"], 43433 transform: ({ textAlign }) => { 43434 return (0, import_blocks77.createBlock)("core/post-comments-count", { 43435 textAlign 43436 }); 43437 } 43438 } 43439 ] 43440 }; 43441 var transforms_default25 = transforms24; 43442 43443 // packages/block-library/build-module/post-comments-link/index.js 43444 var { name: name69 } = block_default68; 43445 var settings68 = { 43446 edit: edit_default25, 43447 icon: post_comments_count_default, 43448 transforms: transforms_default25 43449 }; 43450 var init68 = () => initBlock({ name: name69, metadata: block_default68, settings: settings68 }); 43451 43452 // packages/block-library/build-module/post-content/index.js 43453 var post_content_exports = {}; 43454 __export(post_content_exports, { 43455 init: () => init69, 43456 metadata: () => block_default69, 43457 name: () => name70, 43458 settings: () => settings69 43459 }); 43460 43461 // packages/block-library/build-module/post-content/block.json 43462 var block_default69 = { 43463 $schema: "https://schemas.wp.org/trunk/block.json", 43464 apiVersion: 3, 43465 name: "core/post-content", 43466 title: "Content", 43467 category: "theme", 43468 description: "Displays the contents of a post or page.", 43469 textdomain: "default", 43470 usesContext: ["postId", "postType", "queryId"], 43471 attributes: { 43472 tagName: { 43473 type: "string", 43474 default: "div" 43475 } 43476 }, 43477 example: { 43478 viewportWidth: 350 43479 }, 43480 supports: { 43481 align: ["wide", "full"], 43482 html: false, 43483 layout: true, 43484 background: { 43485 backgroundImage: true, 43486 backgroundSize: true, 43487 __experimentalDefaultControls: { 43488 backgroundImage: true 43489 } 43490 }, 43491 dimensions: { 43492 minHeight: true 43493 }, 43494 spacing: { 43495 blockGap: true, 43496 padding: true, 43497 margin: true, 43498 __experimentalDefaultControls: { 43499 margin: false, 43500 padding: false 43501 } 43502 }, 43503 color: { 43504 gradients: true, 43505 heading: true, 43506 link: true, 43507 __experimentalDefaultControls: { 43508 background: false, 43509 text: false 43510 } 43511 }, 43512 typography: { 43513 fontSize: true, 43514 lineHeight: true, 43515 __experimentalFontFamily: true, 43516 __experimentalFontWeight: true, 43517 __experimentalFontStyle: true, 43518 __experimentalTextTransform: true, 43519 __experimentalTextDecoration: true, 43520 __experimentalLetterSpacing: true, 43521 __experimentalDefaultControls: { 43522 fontSize: true 43523 } 43524 }, 43525 interactivity: { 43526 clientNavigation: true 43527 }, 43528 __experimentalBorder: { 43529 radius: true, 43530 color: true, 43531 width: true, 43532 style: true, 43533 __experimentalDefaultControls: { 43534 radius: true, 43535 color: true, 43536 width: true, 43537 style: true 43538 } 43539 } 43540 }, 43541 style: "wp-block-post-content", 43542 editorStyle: "wp-block-post-content-editor" 43543 }; 43544 43545 // packages/block-library/build-module/post-content/edit.js 43546 var import_i18n156 = __toESM(require_i18n()); 43547 var import_block_editor179 = __toESM(require_block_editor()); 43548 var import_blocks78 = __toESM(require_blocks()); 43549 var import_core_data54 = __toESM(require_core_data()); 43550 var import_data92 = __toESM(require_data()); 43551 var import_element88 = __toESM(require_element()); 43552 var import_jsx_runtime343 = __toESM(require_jsx_runtime()); 43553 var { HTMLElementControl: HTMLElementControl5 } = unlock(import_block_editor179.privateApis); 43554 function ReadOnlyContent({ 43555 parentLayout, 43556 layoutClassNames, 43557 userCanEdit, 43558 postType, 43559 postId, 43560 tagName: TagName2 = "div" 43561 }) { 43562 const [, , content] = (0, import_core_data54.useEntityProp)( 43563 "postType", 43564 postType, 43565 "content", 43566 postId 43567 ); 43568 const blockProps = (0, import_block_editor179.useBlockProps)({ className: layoutClassNames }); 43569 const blocks = (0, import_element88.useMemo)(() => { 43570 return content?.raw ? (0, import_blocks78.parse)(content.raw) : []; 43571 }, [content?.raw]); 43572 const blockPreviewProps = (0, import_block_editor179.__experimentalUseBlockPreview)({ 43573 blocks, 43574 props: blockProps, 43575 layout: parentLayout 43576 }); 43577 if (userCanEdit) { 43578 return /* @__PURE__ */ (0, import_jsx_runtime343.jsx)("div", { ...blockPreviewProps }); 43579 } 43580 return content?.protected ? /* @__PURE__ */ (0, import_jsx_runtime343.jsx)(TagName2, { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime343.jsx)(import_block_editor179.Warning, { children: (0, import_i18n156.__)("This content is password protected.") }) }) : /* @__PURE__ */ (0, import_jsx_runtime343.jsx)( 43581 TagName2, 43582 { 43583 ...blockProps, 43584 dangerouslySetInnerHTML: { __html: content?.rendered } 43585 } 43586 ); 43587 } 43588 function EditableContent({ context = {}, tagName: TagName2 = "div" }) { 43589 const { postType, postId } = context; 43590 const [blocks, onInput, onChange] = (0, import_core_data54.useEntityBlockEditor)( 43591 "postType", 43592 postType, 43593 { id: postId } 43594 ); 43595 const entityRecord = (0, import_data92.useSelect)( 43596 (select9) => { 43597 return select9(import_core_data54.store).getEntityRecord( 43598 "postType", 43599 postType, 43600 postId 43601 ); 43602 }, 43603 [postType, postId] 43604 ); 43605 const hasInnerBlocks = !!entityRecord?.content?.raw || blocks?.length; 43606 const initialInnerBlocks = [["core/paragraph"]]; 43607 const props = (0, import_block_editor179.useInnerBlocksProps)( 43608 (0, import_block_editor179.useBlockProps)({ className: "entry-content" }), 43609 { 43610 value: blocks, 43611 onInput, 43612 onChange, 43613 template: !hasInnerBlocks ? initialInnerBlocks : void 0 43614 } 43615 ); 43616 return /* @__PURE__ */ (0, import_jsx_runtime343.jsx)(TagName2, { ...props }); 43617 } 43618 function Content(props) { 43619 const { 43620 context: { queryId, postType, postId } = {}, 43621 layoutClassNames, 43622 tagName 43623 } = props; 43624 const userCanEdit = useCanEditEntity("postType", postType, postId); 43625 if (userCanEdit === void 0) { 43626 return null; 43627 } 43628 const isDescendentOfQueryLoop = Number.isFinite(queryId); 43629 const isEditable = userCanEdit && !isDescendentOfQueryLoop; 43630 return isEditable ? /* @__PURE__ */ (0, import_jsx_runtime343.jsx)(EditableContent, { ...props }) : /* @__PURE__ */ (0, import_jsx_runtime343.jsx)( 43631 ReadOnlyContent, 43632 { 43633 parentLayout: props.parentLayout, 43634 layoutClassNames, 43635 userCanEdit, 43636 postType, 43637 postId, 43638 tagName 43639 } 43640 ); 43641 } 43642 function Placeholder15({ layoutClassNames }) { 43643 const blockProps = (0, import_block_editor179.useBlockProps)({ className: layoutClassNames }); 43644 return /* @__PURE__ */ (0, import_jsx_runtime343.jsxs)("div", { ...blockProps, children: [ 43645 /* @__PURE__ */ (0, import_jsx_runtime343.jsx)("p", { children: (0, import_i18n156.__)( 43646 "This is the Content block, it will display all the blocks in any single post or page." 43647 ) }), 43648 /* @__PURE__ */ (0, import_jsx_runtime343.jsx)("p", { children: (0, import_i18n156.__)( 43649 "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." 43650 ) }), 43651 /* @__PURE__ */ (0, import_jsx_runtime343.jsx)("p", { children: (0, import_i18n156.__)( 43652 "If there are any Custom Post Types registered at your site, the Content block can display the contents of those entries as well." 43653 ) }) 43654 ] }); 43655 } 43656 function RecursionError() { 43657 const blockProps = (0, import_block_editor179.useBlockProps)(); 43658 return /* @__PURE__ */ (0, import_jsx_runtime343.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime343.jsx)(import_block_editor179.Warning, { children: (0, import_i18n156.__)("Block cannot be rendered inside itself.") }) }); 43659 } 43660 function PostContentEditControls({ tagName, onSelectTagName, clientId }) { 43661 return /* @__PURE__ */ (0, import_jsx_runtime343.jsx)(import_block_editor179.InspectorControls, { group: "advanced", children: /* @__PURE__ */ (0, import_jsx_runtime343.jsx)( 43662 HTMLElementControl5, 43663 { 43664 tagName, 43665 onChange: onSelectTagName, 43666 clientId, 43667 options: [ 43668 { label: (0, import_i18n156.__)("Default (<div>)"), value: "div" }, 43669 { label: "<main>", value: "main" }, 43670 { label: "<section>", value: "section" }, 43671 { label: "<article>", value: "article" } 43672 ] 43673 } 43674 ) }); 43675 } 43676 function PostContentEdit({ 43677 context, 43678 attributes: { tagName = "div" }, 43679 setAttributes, 43680 clientId, 43681 __unstableLayoutClassNames: layoutClassNames, 43682 __unstableParentLayout: parentLayout 43683 }) { 43684 const { postId: contextPostId, postType: contextPostType } = context; 43685 const hasAlreadyRendered = (0, import_block_editor179.useHasRecursion)(contextPostId); 43686 if (contextPostId && contextPostType && hasAlreadyRendered) { 43687 return /* @__PURE__ */ (0, import_jsx_runtime343.jsx)(RecursionError, {}); 43688 } 43689 const handleSelectTagName = (value) => { 43690 setAttributes({ tagName: value }); 43691 }; 43692 return /* @__PURE__ */ (0, import_jsx_runtime343.jsxs)(import_jsx_runtime343.Fragment, { children: [ 43693 /* @__PURE__ */ (0, import_jsx_runtime343.jsx)( 43694 PostContentEditControls, 43695 { 43696 tagName, 43697 onSelectTagName: handleSelectTagName, 43698 clientId 43699 } 43700 ), 43701 /* @__PURE__ */ (0, import_jsx_runtime343.jsx)(import_block_editor179.RecursionProvider, { uniqueId: contextPostId, children: contextPostId && contextPostType ? /* @__PURE__ */ (0, import_jsx_runtime343.jsx)( 43702 Content, 43703 { 43704 context, 43705 parentLayout, 43706 layoutClassNames 43707 } 43708 ) : /* @__PURE__ */ (0, import_jsx_runtime343.jsx)(Placeholder15, { layoutClassNames }) }) 43709 ] }); 43710 } 43711 43712 // packages/block-library/build-module/post-content/index.js 43713 var { name: name70 } = block_default69; 43714 var settings69 = { 43715 icon: post_content_default, 43716 edit: PostContentEdit 43717 }; 43718 var init69 = () => initBlock({ name: name70, metadata: block_default69, settings: settings69 }); 43719 43720 // packages/block-library/build-module/post-date/index.js 43721 var post_date_exports = {}; 43722 __export(post_date_exports, { 43723 init: () => init70, 43724 metadata: () => block_default70, 43725 name: () => name71, 43726 settings: () => settings70 43727 }); 43728 43729 // packages/block-library/build-module/post-date/block.json 43730 var block_default70 = { 43731 $schema: "https://schemas.wp.org/trunk/block.json", 43732 apiVersion: 3, 43733 name: "core/post-date", 43734 title: "Date", 43735 category: "theme", 43736 description: "Display a custom date.", 43737 textdomain: "default", 43738 attributes: { 43739 datetime: { 43740 type: "string", 43741 role: "content" 43742 }, 43743 textAlign: { 43744 type: "string" 43745 }, 43746 format: { 43747 type: "string" 43748 }, 43749 isLink: { 43750 type: "boolean", 43751 default: false, 43752 role: "content" 43753 } 43754 }, 43755 usesContext: ["postId", "postType", "queryId"], 43756 example: { 43757 viewportWidth: 350 43758 }, 43759 supports: { 43760 html: false, 43761 color: { 43762 gradients: true, 43763 link: true, 43764 __experimentalDefaultControls: { 43765 background: true, 43766 text: true, 43767 link: true 43768 } 43769 }, 43770 spacing: { 43771 margin: true, 43772 padding: true 43773 }, 43774 typography: { 43775 fontSize: true, 43776 lineHeight: true, 43777 __experimentalFontFamily: true, 43778 __experimentalFontWeight: true, 43779 __experimentalFontStyle: true, 43780 __experimentalTextTransform: true, 43781 __experimentalTextDecoration: true, 43782 __experimentalLetterSpacing: true, 43783 __experimentalDefaultControls: { 43784 fontSize: true 43785 } 43786 }, 43787 interactivity: { 43788 clientNavigation: true 43789 }, 43790 __experimentalBorder: { 43791 radius: true, 43792 color: true, 43793 width: true, 43794 style: true, 43795 __experimentalDefaultControls: { 43796 radius: true, 43797 color: true, 43798 width: true, 43799 style: true 43800 } 43801 } 43802 } 43803 }; 43804 43805 // packages/block-library/build-module/post-date/edit.js 43806 var import_core_data55 = __toESM(require_core_data()); 43807 var import_element89 = __toESM(require_element()); 43808 var import_date3 = __toESM(require_date()); 43809 var import_block_editor180 = __toESM(require_block_editor()); 43810 var import_components98 = __toESM(require_components()); 43811 var import_i18n157 = __toESM(require_i18n()); 43812 var import_keycodes9 = __toESM(require_keycodes()); 43813 var import_data93 = __toESM(require_data()); 43814 var import_blocks79 = __toESM(require_blocks()); 43815 var import_jsx_runtime344 = __toESM(require_jsx_runtime()); 43816 function PostDateEdit({ 43817 attributes: attributes3, 43818 context: { postType: postTypeSlug, queryId }, 43819 setAttributes, 43820 name: name117 43821 }) { 43822 const { datetime, textAlign, format: format3, isLink } = attributes3; 43823 const blockProps = (0, import_block_editor180.useBlockProps)({ 43824 className: clsx_default({ 43825 [`has-text-align-$textAlign}`]: textAlign 43826 }) 43827 }); 43828 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 43829 const [popoverAnchor, setPopoverAnchor] = (0, import_element89.useState)(null); 43830 const popoverProps = (0, import_element89.useMemo)( 43831 () => ({ anchor: popoverAnchor }), 43832 [popoverAnchor] 43833 ); 43834 const { __unstableMarkNextChangeAsNotPersistent } = (0, import_data93.useDispatch)(import_block_editor180.store); 43835 (0, import_element89.useEffect)(() => { 43836 if (datetime === void 0) { 43837 __unstableMarkNextChangeAsNotPersistent(); 43838 setAttributes({ datetime: /* @__PURE__ */ new Date() }); 43839 } 43840 }, [datetime]); 43841 const isDescendentOfQueryLoop = Number.isFinite(queryId); 43842 const dateSettings = (0, import_date3.getSettings)(); 43843 const { 43844 postType, 43845 siteFormat = dateSettings.formats.date, 43846 siteTimeFormat = dateSettings.formats.time 43847 } = (0, import_data93.useSelect)( 43848 (select9) => { 43849 const { getPostType, getEntityRecord } = select9(import_core_data55.store); 43850 const siteSettings = getEntityRecord("root", "site"); 43851 return { 43852 siteFormat: siteSettings?.date_format, 43853 siteTimeFormat: siteSettings?.time_format, 43854 postType: postTypeSlug ? getPostType(postTypeSlug) : null 43855 }; 43856 }, 43857 [postTypeSlug] 43858 ); 43859 const activeBlockVariationName = (0, import_data93.useSelect)( 43860 (select9) => select9(import_blocks79.store).getActiveBlockVariation(name117, attributes3)?.name, 43861 [name117, attributes3] 43862 ); 43863 const blockEditingMode = (0, import_block_editor180.useBlockEditingMode)(); 43864 let postDate2 = /* @__PURE__ */ (0, import_jsx_runtime344.jsx)("time", { dateTime: (0, import_date3.dateI18n)("c", datetime), ref: setPopoverAnchor, children: format3 === "human-diff" ? (0, import_date3.humanTimeDiff)(datetime) : (0, import_date3.dateI18n)(format3 || siteFormat, datetime) }); 43865 if (isLink && datetime) { 43866 postDate2 = /* @__PURE__ */ (0, import_jsx_runtime344.jsx)( 43867 "a", 43868 { 43869 href: "#post-date-pseudo-link", 43870 onClick: (event) => event.preventDefault(), 43871 children: postDate2 43872 } 43873 ); 43874 } 43875 return /* @__PURE__ */ (0, import_jsx_runtime344.jsxs)(import_jsx_runtime344.Fragment, { children: [ 43876 (blockEditingMode === "default" || !isDescendentOfQueryLoop) && /* @__PURE__ */ (0, import_jsx_runtime344.jsxs)(import_block_editor180.BlockControls, { group: "block", children: [ 43877 /* @__PURE__ */ (0, import_jsx_runtime344.jsx)( 43878 import_block_editor180.AlignmentControl, 43879 { 43880 value: textAlign, 43881 onChange: (nextAlign) => { 43882 setAttributes({ textAlign: nextAlign }); 43883 } 43884 } 43885 ), 43886 activeBlockVariationName !== "post-date-modified" && (!isDescendentOfQueryLoop || !activeBlockVariationName) && /* @__PURE__ */ (0, import_jsx_runtime344.jsx)(import_components98.ToolbarGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime344.jsx)( 43887 import_components98.Dropdown, 43888 { 43889 popoverProps, 43890 renderContent: ({ onClose }) => /* @__PURE__ */ (0, import_jsx_runtime344.jsx)( 43891 import_block_editor180.__experimentalPublishDateTimePicker, 43892 { 43893 title: activeBlockVariationName === "post-date" ? (0, import_i18n157.__)("Publish Date") : (0, import_i18n157.__)("Date"), 43894 currentDate: datetime, 43895 onChange: (newDatetime) => setAttributes({ 43896 datetime: newDatetime 43897 }), 43898 is12Hour: is12HourFormat( 43899 siteTimeFormat 43900 ), 43901 onClose, 43902 dateOrder: ( 43903 /* translators: Order of day, month, and year. Available formats are 'dmy', 'mdy', and 'ymd'. */ 43904 (0, import_i18n157._x)("dmy", "date order") 43905 ) 43906 } 43907 ), 43908 renderToggle: ({ isOpen, onToggle }) => { 43909 const openOnArrowDown = (event) => { 43910 if (!isOpen && event.keyCode === import_keycodes9.DOWN) { 43911 event.preventDefault(); 43912 onToggle(); 43913 } 43914 }; 43915 return /* @__PURE__ */ (0, import_jsx_runtime344.jsx)( 43916 import_components98.ToolbarButton, 43917 { 43918 "aria-expanded": isOpen, 43919 icon: pencil_default, 43920 title: (0, import_i18n157.__)("Change Date"), 43921 onClick: onToggle, 43922 onKeyDown: openOnArrowDown 43923 } 43924 ); 43925 } 43926 } 43927 ) }) 43928 ] }), 43929 /* @__PURE__ */ (0, import_jsx_runtime344.jsx)(import_block_editor180.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime344.jsxs)( 43930 import_components98.__experimentalToolsPanel, 43931 { 43932 label: (0, import_i18n157.__)("Settings"), 43933 resetAll: () => { 43934 setAttributes({ 43935 datetime: void 0, 43936 format: void 0, 43937 isLink: false 43938 }); 43939 }, 43940 dropdownMenuProps, 43941 children: [ 43942 /* @__PURE__ */ (0, import_jsx_runtime344.jsx)( 43943 import_components98.__experimentalToolsPanelItem, 43944 { 43945 hasValue: () => !!format3, 43946 label: (0, import_i18n157.__)("Date Format"), 43947 onDeselect: () => setAttributes({ format: void 0 }), 43948 isShownByDefault: true, 43949 children: /* @__PURE__ */ (0, import_jsx_runtime344.jsx)( 43950 import_block_editor180.__experimentalDateFormatPicker, 43951 { 43952 format: format3, 43953 defaultFormat: siteFormat, 43954 onChange: (nextFormat) => setAttributes({ format: nextFormat }) 43955 } 43956 ) 43957 } 43958 ), 43959 /* @__PURE__ */ (0, import_jsx_runtime344.jsx)( 43960 import_components98.__experimentalToolsPanelItem, 43961 { 43962 hasValue: () => isLink !== false, 43963 label: postType?.labels.singular_name ? (0, import_i18n157.sprintf)( 43964 // translators: %s: Name of the post type e.g: "post". 43965 (0, import_i18n157.__)("Link to %s"), 43966 postType.labels.singular_name.toLowerCase() 43967 ) : (0, import_i18n157.__)("Link to post"), 43968 onDeselect: () => setAttributes({ isLink: false }), 43969 isShownByDefault: true, 43970 children: /* @__PURE__ */ (0, import_jsx_runtime344.jsx)( 43971 import_components98.ToggleControl, 43972 { 43973 label: postType?.labels.singular_name ? (0, import_i18n157.sprintf)( 43974 // translators: %s: Name of the post type e.g: "post". 43975 (0, import_i18n157.__)("Link to %s"), 43976 postType.labels.singular_name.toLowerCase() 43977 ) : (0, import_i18n157.__)("Link to post"), 43978 onChange: () => setAttributes({ isLink: !isLink }), 43979 checked: isLink 43980 } 43981 ) 43982 } 43983 ) 43984 ] 43985 } 43986 ) }), 43987 /* @__PURE__ */ (0, import_jsx_runtime344.jsx)("div", { ...blockProps, children: postDate2 }) 43988 ] }); 43989 } 43990 function is12HourFormat(format3) { 43991 return /(?:^|[^\\])[aAgh]/.test(format3); 43992 } 43993 43994 // packages/block-library/build-module/post-date/deprecated.js 43995 var v38 = { 43996 attributes: { 43997 datetime: { 43998 type: "string", 43999 role: "content" 44000 }, 44001 textAlign: { 44002 type: "string" 44003 }, 44004 format: { 44005 type: "string" 44006 }, 44007 isLink: { 44008 type: "boolean", 44009 default: false, 44010 role: "content" 44011 } 44012 }, 44013 supports: { 44014 html: false, 44015 color: { 44016 gradients: true, 44017 link: true, 44018 __experimentalDefaultControls: { 44019 background: true, 44020 text: true, 44021 link: true 44022 } 44023 }, 44024 spacing: { 44025 margin: true, 44026 padding: true 44027 }, 44028 typography: { 44029 fontSize: true, 44030 lineHeight: true, 44031 __experimentalFontFamily: true, 44032 __experimentalFontWeight: true, 44033 __experimentalFontStyle: true, 44034 __experimentalTextTransform: true, 44035 __experimentalTextDecoration: true, 44036 __experimentalLetterSpacing: true, 44037 __experimentalDefaultControls: { 44038 fontSize: true 44039 } 44040 }, 44041 interactivity: { 44042 clientNavigation: true 44043 }, 44044 __experimentalBorder: { 44045 radius: true, 44046 color: true, 44047 width: true, 44048 style: true, 44049 __experimentalDefaultControls: { 44050 radius: true, 44051 color: true, 44052 width: true, 44053 style: true 44054 } 44055 } 44056 }, 44057 save() { 44058 return null; 44059 }, 44060 migrate({ 44061 metadata: { 44062 bindings: { 44063 datetime: { 44064 source, 44065 args: { key, ...otherArgs } 44066 }, 44067 ...otherBindings 44068 }, 44069 ...otherMetadata 44070 }, 44071 ...otherAttributes 44072 }) { 44073 return { 44074 metadata: { 44075 bindings: { 44076 datetime: { 44077 source, 44078 args: { field: key, ...otherArgs } 44079 }, 44080 ...otherBindings 44081 }, 44082 ...otherMetadata 44083 }, 44084 ...otherAttributes 44085 }; 44086 }, 44087 isEligible(attributes3) { 44088 return attributes3?.metadata?.bindings?.datetime?.source === "core/post-data" && !!attributes3?.metadata?.bindings?.datetime?.args?.key; 44089 } 44090 }; 44091 var v210 = { 44092 attributes: { 44093 textAlign: { 44094 type: "string" 44095 }, 44096 format: { 44097 type: "string" 44098 }, 44099 isLink: { 44100 type: "boolean", 44101 default: false, 44102 role: "content" 44103 }, 44104 displayType: { 44105 type: "string", 44106 default: "date" 44107 } 44108 }, 44109 supports: { 44110 html: false, 44111 color: { 44112 gradients: true, 44113 link: true, 44114 __experimentalDefaultControls: { 44115 background: true, 44116 text: true, 44117 link: true 44118 } 44119 }, 44120 spacing: { 44121 margin: true, 44122 padding: true 44123 }, 44124 typography: { 44125 fontSize: true, 44126 lineHeight: true, 44127 __experimentalFontFamily: true, 44128 __experimentalFontWeight: true, 44129 __experimentalFontStyle: true, 44130 __experimentalTextTransform: true, 44131 __experimentalTextDecoration: true, 44132 __experimentalLetterSpacing: true, 44133 __experimentalDefaultControls: { 44134 fontSize: true 44135 } 44136 }, 44137 interactivity: { 44138 clientNavigation: true 44139 }, 44140 __experimentalBorder: { 44141 radius: true, 44142 color: true, 44143 width: true, 44144 style: true, 44145 __experimentalDefaultControls: { 44146 radius: true, 44147 color: true, 44148 width: true, 44149 style: true 44150 } 44151 } 44152 }, 44153 save() { 44154 return null; 44155 }, 44156 migrate({ className, displayType, metadata, ...otherAttributes }) { 44157 if (displayType === "date" || displayType === "modified") { 44158 if (displayType === "modified") { 44159 className = clsx_default( 44160 className, 44161 "wp-block-post-date__modified-date" 44162 ); 44163 } 44164 return { 44165 ...otherAttributes, 44166 className, 44167 metadata: { 44168 ...metadata, 44169 bindings: { 44170 datetime: { 44171 source: "core/post-data", 44172 args: { field: displayType } 44173 } 44174 } 44175 } 44176 }; 44177 } 44178 }, 44179 isEligible(attributes3) { 44180 return !attributes3.datetime && !attributes3?.metadata?.bindings?.datetime; 44181 } 44182 }; 44183 var v120 = { 44184 attributes: { 44185 textAlign: { 44186 type: "string" 44187 }, 44188 format: { 44189 type: "string" 44190 }, 44191 isLink: { 44192 type: "boolean", 44193 default: false 44194 } 44195 }, 44196 supports: { 44197 html: false, 44198 color: { 44199 gradients: true, 44200 link: true 44201 }, 44202 typography: { 44203 fontSize: true, 44204 lineHeight: true, 44205 __experimentalFontFamily: true, 44206 __experimentalFontWeight: true, 44207 __experimentalFontStyle: true, 44208 __experimentalTextTransform: true, 44209 __experimentalLetterSpacing: true 44210 } 44211 }, 44212 save() { 44213 return null; 44214 }, 44215 migrate: migrate_font_family_default, 44216 isEligible({ style: style2 }) { 44217 return style2?.typography?.fontFamily; 44218 } 44219 }; 44220 var deprecated_default27 = [v38, v210, v120]; 44221 44222 // packages/block-library/build-module/post-date/variations.js 44223 var import_i18n158 = __toESM(require_i18n()); 44224 var variations10 = [ 44225 { 44226 name: "post-date", 44227 title: (0, import_i18n158.__)("Post Date"), 44228 description: (0, import_i18n158.__)("Display a post's publish date."), 44229 attributes: { 44230 metadata: { 44231 bindings: { 44232 datetime: { 44233 source: "core/post-data", 44234 args: { field: "date" } 44235 } 44236 } 44237 } 44238 }, 44239 scope: ["inserter", "transform"], 44240 isActive: (blockAttributes8) => blockAttributes8?.metadata?.bindings?.datetime?.source === "core/post-data" && blockAttributes8?.metadata?.bindings?.datetime?.args?.field === "date" 44241 }, 44242 { 44243 name: "post-date-modified", 44244 title: (0, import_i18n158.__)("Modified Date"), 44245 description: (0, import_i18n158.__)("Display a post's last updated date."), 44246 attributes: { 44247 metadata: { 44248 bindings: { 44249 datetime: { 44250 source: "core/post-data", 44251 args: { field: "modified" } 44252 } 44253 } 44254 }, 44255 className: "wp-block-post-date__modified-date" 44256 }, 44257 scope: ["inserter", "transform"], 44258 isActive: (blockAttributes8) => blockAttributes8?.metadata?.bindings?.datetime?.source === "core/post-data" && blockAttributes8?.metadata?.bindings?.datetime?.args?.field === "modified" 44259 } 44260 ]; 44261 var variations_default10 = variations10; 44262 44263 // packages/block-library/build-module/post-date/index.js 44264 var { name: name71 } = block_default70; 44265 var settings70 = { 44266 icon: post_date_default, 44267 edit: PostDateEdit, 44268 deprecated: deprecated_default27, 44269 variations: variations_default10 44270 }; 44271 var init70 = () => initBlock({ name: name71, metadata: block_default70, settings: settings70 }); 44272 44273 // packages/block-library/build-module/post-excerpt/index.js 44274 var post_excerpt_exports = {}; 44275 __export(post_excerpt_exports, { 44276 init: () => init71, 44277 metadata: () => block_default71, 44278 name: () => name72, 44279 settings: () => settings71 44280 }); 44281 44282 // packages/block-library/build-module/post-excerpt/block.json 44283 var block_default71 = { 44284 $schema: "https://schemas.wp.org/trunk/block.json", 44285 apiVersion: 3, 44286 name: "core/post-excerpt", 44287 title: "Excerpt", 44288 category: "theme", 44289 description: "Display the excerpt.", 44290 textdomain: "default", 44291 attributes: { 44292 textAlign: { 44293 type: "string" 44294 }, 44295 moreText: { 44296 type: "string", 44297 role: "content" 44298 }, 44299 showMoreOnNewLine: { 44300 type: "boolean", 44301 default: true 44302 }, 44303 excerptLength: { 44304 type: "number", 44305 default: 55 44306 } 44307 }, 44308 usesContext: ["postId", "postType", "queryId"], 44309 example: { 44310 viewportWidth: 350 44311 }, 44312 supports: { 44313 html: false, 44314 color: { 44315 gradients: true, 44316 link: true, 44317 __experimentalDefaultControls: { 44318 background: true, 44319 text: true, 44320 link: true 44321 } 44322 }, 44323 spacing: { 44324 margin: true, 44325 padding: true 44326 }, 44327 typography: { 44328 fontSize: true, 44329 lineHeight: true, 44330 __experimentalFontFamily: true, 44331 __experimentalFontWeight: true, 44332 __experimentalFontStyle: true, 44333 __experimentalTextTransform: true, 44334 __experimentalTextDecoration: true, 44335 __experimentalLetterSpacing: true, 44336 __experimentalDefaultControls: { 44337 fontSize: true 44338 } 44339 }, 44340 interactivity: { 44341 clientNavigation: true 44342 }, 44343 __experimentalBorder: { 44344 radius: true, 44345 color: true, 44346 width: true, 44347 style: true, 44348 __experimentalDefaultControls: { 44349 radius: true, 44350 color: true, 44351 width: true, 44352 style: true 44353 } 44354 } 44355 }, 44356 editorStyle: "wp-block-post-excerpt-editor", 44357 style: "wp-block-post-excerpt" 44358 }; 44359 44360 // packages/block-library/build-module/post-excerpt/edit.js 44361 var import_core_data56 = __toESM(require_core_data()); 44362 var import_element90 = __toESM(require_element()); 44363 var import_block_editor181 = __toESM(require_block_editor()); 44364 var import_components99 = __toESM(require_components()); 44365 var import_i18n159 = __toESM(require_i18n()); 44366 var import_data94 = __toESM(require_data()); 44367 var import_jsx_runtime345 = __toESM(require_jsx_runtime()); 44368 var ELLIPSIS = "\u2026"; 44369 function PostExcerptEditor({ 44370 attributes: { textAlign, moreText, showMoreOnNewLine, excerptLength }, 44371 setAttributes, 44372 isSelected, 44373 context: { postId, postType, queryId } 44374 }) { 44375 const blockEditingMode = (0, import_block_editor181.useBlockEditingMode)(); 44376 const showControls = blockEditingMode === "default"; 44377 const isDescendentOfQueryLoop = Number.isFinite(queryId); 44378 const userCanEdit = useCanEditEntity("postType", postType, postId); 44379 const [ 44380 rawExcerpt, 44381 setExcerpt, 44382 { rendered: renderedExcerpt, protected: isProtected } = {} 44383 ] = (0, import_core_data56.useEntityProp)("postType", postType, "excerpt", postId); 44384 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 44385 const postTypeSupportsExcerpts = (0, import_data94.useSelect)( 44386 (select9) => { 44387 if (postType === "page") { 44388 return true; 44389 } 44390 return !!select9(import_core_data56.store).getPostType(postType)?.supports?.excerpt; 44391 }, 44392 [postType] 44393 ); 44394 const isEditable = userCanEdit && !isDescendentOfQueryLoop && postTypeSupportsExcerpts; 44395 const blockProps = (0, import_block_editor181.useBlockProps)({ 44396 className: clsx_default({ 44397 [`has-text-align-$textAlign}`]: textAlign 44398 }) 44399 }); 44400 const wordCountType = (0, import_i18n159._x)("words", "Word count type. Do not translate!"); 44401 const strippedRenderedExcerpt = (0, import_element90.useMemo)(() => { 44402 if (!renderedExcerpt) { 44403 return ""; 44404 } 44405 const document2 = new window.DOMParser().parseFromString( 44406 renderedExcerpt, 44407 "text/html" 44408 ); 44409 return document2.body.textContent || document2.body.innerText || ""; 44410 }, [renderedExcerpt]); 44411 if (!postType || !postId) { 44412 return /* @__PURE__ */ (0, import_jsx_runtime345.jsxs)(import_jsx_runtime345.Fragment, { children: [ 44413 /* @__PURE__ */ (0, import_jsx_runtime345.jsx)(import_block_editor181.BlockControls, { children: /* @__PURE__ */ (0, import_jsx_runtime345.jsx)( 44414 import_block_editor181.AlignmentToolbar, 44415 { 44416 value: textAlign, 44417 onChange: (newAlign) => setAttributes({ textAlign: newAlign }) 44418 } 44419 ) }), 44420 /* @__PURE__ */ (0, import_jsx_runtime345.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime345.jsx)("p", { children: (0, import_i18n159.__)("This block will display the excerpt.") }) }) 44421 ] }); 44422 } 44423 if (isProtected && !userCanEdit) { 44424 return /* @__PURE__ */ (0, import_jsx_runtime345.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime345.jsx)(import_block_editor181.Warning, { children: (0, import_i18n159.__)( 44425 "The content is currently protected and does not have the available excerpt." 44426 ) }) }); 44427 } 44428 const readMoreLink = /* @__PURE__ */ (0, import_jsx_runtime345.jsx)( 44429 import_block_editor181.RichText, 44430 { 44431 identifier: "moreText", 44432 className: "wp-block-post-excerpt__more-link", 44433 tagName: "a", 44434 "aria-label": (0, import_i18n159.__)("\u201CRead more\u201D link text"), 44435 placeholder: (0, import_i18n159.__)('Add "read more" link text'), 44436 value: moreText, 44437 onChange: (newMoreText) => setAttributes({ moreText: newMoreText }), 44438 withoutInteractiveFormatting: true 44439 } 44440 ); 44441 const excerptClassName = clsx_default("wp-block-post-excerpt__excerpt", { 44442 "is-inline": !showMoreOnNewLine 44443 }); 44444 const rawOrRenderedExcerpt = (rawExcerpt || strippedRenderedExcerpt).trim(); 44445 let trimmedExcerpt = ""; 44446 if (wordCountType === "words") { 44447 trimmedExcerpt = rawOrRenderedExcerpt.split(" ", excerptLength).join(" "); 44448 } else if (wordCountType === "characters_excluding_spaces") { 44449 const excerptWithSpaces = rawOrRenderedExcerpt.split("", excerptLength).join(""); 44450 const numberOfSpaces = excerptWithSpaces.length - excerptWithSpaces.replaceAll(" ", "").length; 44451 trimmedExcerpt = rawOrRenderedExcerpt.split("", excerptLength + numberOfSpaces).join(""); 44452 } else if (wordCountType === "characters_including_spaces") { 44453 trimmedExcerpt = rawOrRenderedExcerpt.split("", excerptLength).join(""); 44454 } 44455 const isTrimmed = trimmedExcerpt !== rawOrRenderedExcerpt; 44456 const excerptContent = isEditable ? /* @__PURE__ */ (0, import_jsx_runtime345.jsx)( 44457 import_block_editor181.RichText, 44458 { 44459 className: excerptClassName, 44460 "aria-label": (0, import_i18n159.__)("Excerpt text"), 44461 value: isSelected ? rawOrRenderedExcerpt : (!isTrimmed ? rawOrRenderedExcerpt : trimmedExcerpt + ELLIPSIS) || (0, import_i18n159.__)("No excerpt found"), 44462 onChange: setExcerpt, 44463 tagName: "p" 44464 } 44465 ) : /* @__PURE__ */ (0, import_jsx_runtime345.jsx)("p", { className: excerptClassName, children: !isTrimmed ? rawOrRenderedExcerpt || (0, import_i18n159.__)("No excerpt found") : trimmedExcerpt + ELLIPSIS }); 44466 return /* @__PURE__ */ (0, import_jsx_runtime345.jsxs)(import_jsx_runtime345.Fragment, { children: [ 44467 showControls && /* @__PURE__ */ (0, import_jsx_runtime345.jsx)(import_block_editor181.BlockControls, { children: /* @__PURE__ */ (0, import_jsx_runtime345.jsx)( 44468 import_block_editor181.AlignmentToolbar, 44469 { 44470 value: textAlign, 44471 onChange: (newAlign) => setAttributes({ textAlign: newAlign }) 44472 } 44473 ) }), 44474 /* @__PURE__ */ (0, import_jsx_runtime345.jsx)(import_block_editor181.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime345.jsxs)( 44475 import_components99.__experimentalToolsPanel, 44476 { 44477 label: (0, import_i18n159.__)("Settings"), 44478 resetAll: () => { 44479 setAttributes({ 44480 showMoreOnNewLine: true, 44481 excerptLength: 55 44482 }); 44483 }, 44484 dropdownMenuProps, 44485 children: [ 44486 /* @__PURE__ */ (0, import_jsx_runtime345.jsx)( 44487 import_components99.__experimentalToolsPanelItem, 44488 { 44489 hasValue: () => showMoreOnNewLine !== true, 44490 label: (0, import_i18n159.__)("Show link on new line"), 44491 onDeselect: () => setAttributes({ showMoreOnNewLine: true }), 44492 isShownByDefault: true, 44493 children: /* @__PURE__ */ (0, import_jsx_runtime345.jsx)( 44494 import_components99.ToggleControl, 44495 { 44496 label: (0, import_i18n159.__)("Show link on new line"), 44497 checked: showMoreOnNewLine, 44498 onChange: (newShowMoreOnNewLine) => setAttributes({ 44499 showMoreOnNewLine: newShowMoreOnNewLine 44500 }) 44501 } 44502 ) 44503 } 44504 ), 44505 /* @__PURE__ */ (0, import_jsx_runtime345.jsx)( 44506 import_components99.__experimentalToolsPanelItem, 44507 { 44508 hasValue: () => excerptLength !== 55, 44509 label: (0, import_i18n159.__)("Max number of words"), 44510 onDeselect: () => setAttributes({ excerptLength: 55 }), 44511 isShownByDefault: true, 44512 children: /* @__PURE__ */ (0, import_jsx_runtime345.jsx)( 44513 import_components99.RangeControl, 44514 { 44515 __next40pxDefaultSize: true, 44516 label: (0, import_i18n159.__)("Max number of words"), 44517 value: excerptLength, 44518 onChange: (value) => { 44519 setAttributes({ excerptLength: value }); 44520 }, 44521 min: "10", 44522 max: "100" 44523 } 44524 ) 44525 } 44526 ) 44527 ] 44528 } 44529 ) }), 44530 /* @__PURE__ */ (0, import_jsx_runtime345.jsxs)("div", { ...blockProps, children: [ 44531 excerptContent, 44532 !showMoreOnNewLine && " ", 44533 showMoreOnNewLine ? /* @__PURE__ */ (0, import_jsx_runtime345.jsx)("p", { className: "wp-block-post-excerpt__more-text", children: readMoreLink }) : readMoreLink 44534 ] }) 44535 ] }); 44536 } 44537 44538 // packages/block-library/build-module/post-excerpt/transforms.js 44539 var import_blocks80 = __toESM(require_blocks()); 44540 var transforms25 = { 44541 from: [ 44542 { 44543 type: "block", 44544 blocks: ["core/post-content"], 44545 transform: () => (0, import_blocks80.createBlock)("core/post-excerpt") 44546 } 44547 ], 44548 to: [ 44549 { 44550 type: "block", 44551 blocks: ["core/post-content"], 44552 transform: () => (0, import_blocks80.createBlock)("core/post-content") 44553 } 44554 ] 44555 }; 44556 var transforms_default26 = transforms25; 44557 44558 // packages/block-library/build-module/post-excerpt/index.js 44559 var { name: name72 } = block_default71; 44560 var settings71 = { 44561 icon: post_excerpt_default, 44562 transforms: transforms_default26, 44563 edit: PostExcerptEditor 44564 }; 44565 var init71 = () => initBlock({ name: name72, metadata: block_default71, settings: settings71 }); 44566 44567 // packages/block-library/build-module/post-featured-image/index.js 44568 var post_featured_image_exports = {}; 44569 __export(post_featured_image_exports, { 44570 init: () => init72, 44571 metadata: () => block_default72, 44572 name: () => name73, 44573 settings: () => settings72 44574 }); 44575 44576 // packages/block-library/build-module/post-featured-image/block.json 44577 var block_default72 = { 44578 $schema: "https://schemas.wp.org/trunk/block.json", 44579 apiVersion: 3, 44580 name: "core/post-featured-image", 44581 title: "Featured Image", 44582 category: "theme", 44583 description: "Display a post's featured image.", 44584 textdomain: "default", 44585 attributes: { 44586 isLink: { 44587 type: "boolean", 44588 default: false, 44589 role: "content" 44590 }, 44591 aspectRatio: { 44592 type: "string" 44593 }, 44594 width: { 44595 type: "string" 44596 }, 44597 height: { 44598 type: "string" 44599 }, 44600 scale: { 44601 type: "string", 44602 default: "cover" 44603 }, 44604 sizeSlug: { 44605 type: "string" 44606 }, 44607 rel: { 44608 type: "string", 44609 attribute: "rel", 44610 default: "", 44611 role: "content" 44612 }, 44613 linkTarget: { 44614 type: "string", 44615 default: "_self", 44616 role: "content" 44617 }, 44618 overlayColor: { 44619 type: "string" 44620 }, 44621 customOverlayColor: { 44622 type: "string" 44623 }, 44624 dimRatio: { 44625 type: "number", 44626 default: 0 44627 }, 44628 gradient: { 44629 type: "string" 44630 }, 44631 customGradient: { 44632 type: "string" 44633 }, 44634 useFirstImageFromPost: { 44635 type: "boolean", 44636 default: false 44637 } 44638 }, 44639 usesContext: ["postId", "postType", "queryId"], 44640 example: { 44641 viewportWidth: 350 44642 }, 44643 supports: { 44644 align: ["left", "right", "center", "wide", "full"], 44645 color: { 44646 text: false, 44647 background: false 44648 }, 44649 __experimentalBorder: { 44650 color: true, 44651 radius: true, 44652 width: true, 44653 __experimentalSkipSerialization: true, 44654 __experimentalDefaultControls: { 44655 color: true, 44656 radius: true, 44657 width: true 44658 } 44659 }, 44660 filter: { 44661 duotone: true 44662 }, 44663 shadow: { 44664 __experimentalSkipSerialization: true 44665 }, 44666 html: false, 44667 spacing: { 44668 margin: true, 44669 padding: true 44670 }, 44671 interactivity: { 44672 clientNavigation: true 44673 } 44674 }, 44675 selectors: { 44676 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", 44677 shadow: ".wp-block-post-featured-image img, .wp-block-post-featured-image .components-placeholder", 44678 filter: { 44679 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" 44680 } 44681 }, 44682 editorStyle: "wp-block-post-featured-image-editor", 44683 style: "wp-block-post-featured-image" 44684 }; 44685 44686 // packages/block-library/build-module/post-featured-image/edit.js 44687 var import_blob16 = __toESM(require_blob()); 44688 var import_core_data57 = __toESM(require_core_data()); 44689 var import_data95 = __toESM(require_data()); 44690 var import_components102 = __toESM(require_components()); 44691 var import_block_editor185 = __toESM(require_block_editor()); 44692 var import_element91 = __toESM(require_element()); 44693 var import_i18n162 = __toESM(require_i18n()); 44694 var import_notices14 = __toESM(require_notices()); 44695 44696 // packages/block-library/build-module/post-featured-image/dimension-controls.js 44697 var import_i18n160 = __toESM(require_i18n()); 44698 var import_components100 = __toESM(require_components()); 44699 var import_block_editor182 = __toESM(require_block_editor()); 44700 var import_jsx_runtime346 = __toESM(require_jsx_runtime()); 44701 var SCALE_OPTIONS = /* @__PURE__ */ (0, import_jsx_runtime346.jsxs)(import_jsx_runtime346.Fragment, { children: [ 44702 /* @__PURE__ */ (0, import_jsx_runtime346.jsx)( 44703 import_components100.__experimentalToggleGroupControlOption, 44704 { 44705 value: "cover", 44706 label: (0, import_i18n160._x)("Cover", "Scale option for Image dimension control") 44707 } 44708 ), 44709 /* @__PURE__ */ (0, import_jsx_runtime346.jsx)( 44710 import_components100.__experimentalToggleGroupControlOption, 44711 { 44712 value: "contain", 44713 label: (0, import_i18n160._x)( 44714 "Contain", 44715 "Scale option for Image dimension control" 44716 ) 44717 } 44718 ), 44719 /* @__PURE__ */ (0, import_jsx_runtime346.jsx)( 44720 import_components100.__experimentalToggleGroupControlOption, 44721 { 44722 value: "fill", 44723 label: (0, import_i18n160._x)("Fill", "Scale option for Image dimension control") 44724 } 44725 ) 44726 ] }); 44727 var DEFAULT_SCALE = "cover"; 44728 var scaleHelp = { 44729 cover: (0, import_i18n160.__)( 44730 "Image is scaled and cropped to fill the entire space without being distorted." 44731 ), 44732 contain: (0, import_i18n160.__)( 44733 "Image is scaled to fill the space without clipping nor distorting." 44734 ), 44735 fill: (0, import_i18n160.__)( 44736 "Image will be stretched and distorted to completely fill the space." 44737 ) 44738 }; 44739 var DimensionControls = ({ 44740 clientId, 44741 attributes: { aspectRatio, width, height, scale }, 44742 setAttributes 44743 }) => { 44744 const [availableUnits, defaultRatios, themeRatios, showDefaultRatios] = (0, import_block_editor182.useSettings)( 44745 "spacing.units", 44746 "dimensions.aspectRatios.default", 44747 "dimensions.aspectRatios.theme", 44748 "dimensions.defaultAspectRatios" 44749 ); 44750 const units = (0, import_components100.__experimentalUseCustomUnits)({ 44751 availableUnits: availableUnits || ["px", "%", "vw", "em", "rem"] 44752 }); 44753 const onDimensionChange = (dimension, nextValue) => { 44754 const parsedValue = parseFloat(nextValue); 44755 if (isNaN(parsedValue) && nextValue) { 44756 return; 44757 } 44758 setAttributes({ 44759 [dimension]: parsedValue < 0 ? "0" : nextValue 44760 }); 44761 }; 44762 const scaleLabel = (0, import_i18n160._x)("Scale", "Image scaling options"); 44763 const showScaleControl = height || aspectRatio && aspectRatio !== "auto"; 44764 const themeOptions = themeRatios?.map(({ name: name117, ratio }) => ({ 44765 label: name117, 44766 value: ratio 44767 })); 44768 const defaultOptions = defaultRatios?.map(({ name: name117, ratio }) => ({ 44769 label: name117, 44770 value: ratio 44771 })); 44772 const aspectRatioOptions = [ 44773 { 44774 label: (0, import_i18n160._x)( 44775 "Original", 44776 "Aspect ratio option for dimensions control" 44777 ), 44778 value: "auto" 44779 }, 44780 ...showDefaultRatios ? defaultOptions : [], 44781 ...themeOptions ? themeOptions : [] 44782 ]; 44783 return /* @__PURE__ */ (0, import_jsx_runtime346.jsxs)(import_jsx_runtime346.Fragment, { children: [ 44784 /* @__PURE__ */ (0, import_jsx_runtime346.jsx)( 44785 import_components100.__experimentalToolsPanelItem, 44786 { 44787 hasValue: () => !!aspectRatio, 44788 label: (0, import_i18n160.__)("Aspect ratio"), 44789 onDeselect: () => setAttributes({ aspectRatio: void 0 }), 44790 resetAllFilter: () => ({ 44791 aspectRatio: void 0 44792 }), 44793 isShownByDefault: true, 44794 panelId: clientId, 44795 children: /* @__PURE__ */ (0, import_jsx_runtime346.jsx)( 44796 import_components100.SelectControl, 44797 { 44798 __next40pxDefaultSize: true, 44799 label: (0, import_i18n160.__)("Aspect ratio"), 44800 value: aspectRatio, 44801 options: aspectRatioOptions, 44802 onChange: (nextAspectRatio) => setAttributes({ aspectRatio: nextAspectRatio }) 44803 } 44804 ) 44805 } 44806 ), 44807 /* @__PURE__ */ (0, import_jsx_runtime346.jsx)( 44808 import_components100.__experimentalToolsPanelItem, 44809 { 44810 className: "single-column", 44811 hasValue: () => !!height, 44812 label: (0, import_i18n160.__)("Height"), 44813 onDeselect: () => setAttributes({ height: void 0 }), 44814 resetAllFilter: () => ({ 44815 height: void 0 44816 }), 44817 isShownByDefault: true, 44818 panelId: clientId, 44819 children: /* @__PURE__ */ (0, import_jsx_runtime346.jsx)( 44820 import_components100.__experimentalUnitControl, 44821 { 44822 __next40pxDefaultSize: true, 44823 label: (0, import_i18n160.__)("Height"), 44824 labelPosition: "top", 44825 value: height || "", 44826 min: 0, 44827 onChange: (nextHeight) => onDimensionChange("height", nextHeight), 44828 units 44829 } 44830 ) 44831 } 44832 ), 44833 /* @__PURE__ */ (0, import_jsx_runtime346.jsx)( 44834 import_components100.__experimentalToolsPanelItem, 44835 { 44836 className: "single-column", 44837 hasValue: () => !!width, 44838 label: (0, import_i18n160.__)("Width"), 44839 onDeselect: () => setAttributes({ width: void 0 }), 44840 resetAllFilter: () => ({ 44841 width: void 0 44842 }), 44843 isShownByDefault: true, 44844 panelId: clientId, 44845 children: /* @__PURE__ */ (0, import_jsx_runtime346.jsx)( 44846 import_components100.__experimentalUnitControl, 44847 { 44848 __next40pxDefaultSize: true, 44849 label: (0, import_i18n160.__)("Width"), 44850 labelPosition: "top", 44851 value: width || "", 44852 min: 0, 44853 onChange: (nextWidth) => onDimensionChange("width", nextWidth), 44854 units 44855 } 44856 ) 44857 } 44858 ), 44859 showScaleControl && /* @__PURE__ */ (0, import_jsx_runtime346.jsx)( 44860 import_components100.__experimentalToolsPanelItem, 44861 { 44862 hasValue: () => !!scale && scale !== DEFAULT_SCALE, 44863 label: scaleLabel, 44864 onDeselect: () => setAttributes({ 44865 scale: DEFAULT_SCALE 44866 }), 44867 resetAllFilter: () => ({ 44868 scale: DEFAULT_SCALE 44869 }), 44870 isShownByDefault: true, 44871 panelId: clientId, 44872 children: /* @__PURE__ */ (0, import_jsx_runtime346.jsx)( 44873 import_components100.__experimentalToggleGroupControl, 44874 { 44875 __next40pxDefaultSize: true, 44876 label: scaleLabel, 44877 value: scale, 44878 help: scaleHelp[scale], 44879 onChange: (value) => setAttributes({ 44880 scale: value 44881 }), 44882 isBlock: true, 44883 children: SCALE_OPTIONS 44884 } 44885 ) 44886 } 44887 ) 44888 ] }); 44889 }; 44890 var dimension_controls_default = DimensionControls; 44891 44892 // packages/block-library/build-module/post-featured-image/overlay-controls.js 44893 var import_components101 = __toESM(require_components()); 44894 var import_block_editor183 = __toESM(require_block_editor()); 44895 var import_compose38 = __toESM(require_compose()); 44896 var import_i18n161 = __toESM(require_i18n()); 44897 var import_jsx_runtime347 = __toESM(require_jsx_runtime()); 44898 var Overlay = ({ 44899 clientId, 44900 attributes: attributes3, 44901 setAttributes, 44902 overlayColor, 44903 setOverlayColor 44904 }) => { 44905 const { dimRatio } = attributes3; 44906 const { gradientValue, setGradient } = (0, import_block_editor183.__experimentalUseGradient)(); 44907 const colorGradientSettings = (0, import_block_editor183.__experimentalUseMultipleOriginColorsAndGradients)(); 44908 if (!colorGradientSettings.hasColorsOrGradients) { 44909 return null; 44910 } 44911 return /* @__PURE__ */ (0, import_jsx_runtime347.jsxs)(import_jsx_runtime347.Fragment, { children: [ 44912 /* @__PURE__ */ (0, import_jsx_runtime347.jsx)( 44913 import_block_editor183.__experimentalColorGradientSettingsDropdown, 44914 { 44915 __experimentalIsRenderedInSidebar: true, 44916 settings: [ 44917 { 44918 colorValue: overlayColor.color, 44919 gradientValue, 44920 label: (0, import_i18n161.__)("Overlay"), 44921 onColorChange: setOverlayColor, 44922 onGradientChange: setGradient, 44923 isShownByDefault: true, 44924 resetAllFilter: () => ({ 44925 overlayColor: void 0, 44926 customOverlayColor: void 0, 44927 gradient: void 0, 44928 customGradient: void 0 44929 }), 44930 clearable: true 44931 } 44932 ], 44933 panelId: clientId, 44934 ...colorGradientSettings 44935 } 44936 ), 44937 /* @__PURE__ */ (0, import_jsx_runtime347.jsx)( 44938 import_components101.__experimentalToolsPanelItem, 44939 { 44940 hasValue: () => dimRatio !== void 0, 44941 label: (0, import_i18n161.__)("Overlay opacity"), 44942 onDeselect: () => setAttributes({ dimRatio: 0 }), 44943 resetAllFilter: () => ({ 44944 dimRatio: 0 44945 }), 44946 isShownByDefault: true, 44947 panelId: clientId, 44948 children: /* @__PURE__ */ (0, import_jsx_runtime347.jsx)( 44949 import_components101.RangeControl, 44950 { 44951 label: (0, import_i18n161.__)("Overlay opacity"), 44952 value: dimRatio, 44953 onChange: (newDimRatio) => setAttributes({ 44954 dimRatio: newDimRatio 44955 }), 44956 min: 0, 44957 max: 100, 44958 step: 10, 44959 required: true, 44960 __next40pxDefaultSize: true 44961 } 44962 ) 44963 } 44964 ) 44965 ] }); 44966 }; 44967 var overlay_controls_default = (0, import_compose38.compose)([ 44968 (0, import_block_editor183.withColors)({ overlayColor: "background-color" }) 44969 ])(Overlay); 44970 44971 // packages/block-library/build-module/post-featured-image/overlay.js 44972 var import_block_editor184 = __toESM(require_block_editor()); 44973 var import_compose39 = __toESM(require_compose()); 44974 44975 // packages/block-library/build-module/post-featured-image/utils.js 44976 function dimRatioToClass2(ratio) { 44977 return ratio === void 0 ? null : "has-background-dim-" + 10 * Math.round(ratio / 10); 44978 } 44979 44980 // packages/block-library/build-module/post-featured-image/overlay.js 44981 var import_jsx_runtime348 = __toESM(require_jsx_runtime()); 44982 var Overlay2 = ({ attributes: attributes3, overlayColor }) => { 44983 const { dimRatio } = attributes3; 44984 const { gradientClass, gradientValue } = (0, import_block_editor184.__experimentalUseGradient)(); 44985 const colorGradientSettings = (0, import_block_editor184.__experimentalUseMultipleOriginColorsAndGradients)(); 44986 const borderProps = (0, import_block_editor184.__experimentalUseBorderProps)(attributes3); 44987 const overlayStyles = { 44988 backgroundColor: overlayColor.color, 44989 backgroundImage: gradientValue, 44990 ...borderProps.style 44991 }; 44992 if (!colorGradientSettings.hasColorsOrGradients || !dimRatio) { 44993 return null; 44994 } 44995 return /* @__PURE__ */ (0, import_jsx_runtime348.jsx)( 44996 "span", 44997 { 44998 "aria-hidden": "true", 44999 className: clsx_default( 45000 "wp-block-post-featured-image__overlay", 45001 dimRatioToClass2(dimRatio), 45002 { 45003 [overlayColor.class]: overlayColor.class, 45004 "has-background-dim": dimRatio !== void 0, 45005 "has-background-gradient": gradientValue, 45006 [gradientClass]: gradientClass 45007 }, 45008 borderProps.className 45009 ), 45010 style: overlayStyles 45011 } 45012 ); 45013 }; 45014 var overlay_default = (0, import_compose39.compose)([ 45015 (0, import_block_editor184.withColors)({ overlayColor: "background-color" }) 45016 ])(Overlay2); 45017 45018 // packages/block-library/build-module/post-featured-image/edit.js 45019 var import_jsx_runtime349 = __toESM(require_jsx_runtime()); 45020 var ALLOWED_MEDIA_TYPES6 = ["image"]; 45021 var { ResolutionTool: ResolutionTool4 } = unlock(import_block_editor185.privateApis); 45022 var DEFAULT_MEDIA_SIZE_SLUG5 = "full"; 45023 function FeaturedImageResolutionTool({ image, value, onChange }) { 45024 const { imageSizes } = (0, import_data95.useSelect)((select9) => { 45025 const { getSettings: getSettings2 } = select9(import_block_editor185.store); 45026 return { 45027 imageSizes: getSettings2().imageSizes 45028 }; 45029 }, []); 45030 if (!imageSizes?.length) { 45031 return null; 45032 } 45033 const imageSizeOptions = imageSizes.filter( 45034 ({ slug }) => image?.media_details?.sizes?.[slug]?.source_url 45035 ).map(({ name: name117, slug }) => ({ value: slug, label: name117 })); 45036 return /* @__PURE__ */ (0, import_jsx_runtime349.jsx)( 45037 ResolutionTool4, 45038 { 45039 value, 45040 defaultValue: DEFAULT_MEDIA_SIZE_SLUG5, 45041 options: imageSizeOptions, 45042 onChange 45043 } 45044 ); 45045 } 45046 function PostFeaturedImageEdit({ 45047 clientId, 45048 attributes: attributes3, 45049 setAttributes, 45050 context: { postId, postType: postTypeSlug, queryId } 45051 }) { 45052 const isDescendentOfQueryLoop = Number.isFinite(queryId); 45053 const { 45054 isLink, 45055 aspectRatio, 45056 height, 45057 width, 45058 scale, 45059 sizeSlug, 45060 rel, 45061 linkTarget, 45062 useFirstImageFromPost 45063 } = attributes3; 45064 const [temporaryURL, setTemporaryURL] = (0, import_element91.useState)(); 45065 const [storedFeaturedImage, setFeaturedImage] = (0, import_core_data57.useEntityProp)( 45066 "postType", 45067 postTypeSlug, 45068 "featured_media", 45069 postId 45070 ); 45071 const [postContent] = (0, import_core_data57.useEntityProp)( 45072 "postType", 45073 postTypeSlug, 45074 "content", 45075 postId 45076 ); 45077 const featuredImage = (0, import_element91.useMemo)(() => { 45078 if (storedFeaturedImage) { 45079 return storedFeaturedImage; 45080 } 45081 if (!useFirstImageFromPost) { 45082 return; 45083 } 45084 const imageOpener = /<!--\s+wp:(?:core\/)?image\s+(?<attrs>{(?:(?:[^}]+|}+(?=})|(?!}\s+\/?-->).)*)?}\s+)?-->/.exec( 45085 postContent 45086 ); 45087 const imageId = imageOpener?.groups?.attrs && JSON.parse(imageOpener.groups.attrs)?.id; 45088 return imageId; 45089 }, [storedFeaturedImage, useFirstImageFromPost, postContent]); 45090 const { media, postType, postPermalink } = (0, import_data95.useSelect)( 45091 (select9) => { 45092 const { getEntityRecord, getPostType, getEditedEntityRecord } = select9(import_core_data57.store); 45093 return { 45094 media: featuredImage && getEntityRecord("postType", "attachment", featuredImage, { 45095 context: "view" 45096 }), 45097 postType: postTypeSlug && getPostType(postTypeSlug), 45098 postPermalink: getEditedEntityRecord( 45099 "postType", 45100 postTypeSlug, 45101 postId 45102 )?.link 45103 }; 45104 }, 45105 [featuredImage, postTypeSlug, postId] 45106 ); 45107 const mediaUrl = media?.media_details?.sizes?.[sizeSlug]?.source_url || media?.source_url; 45108 const blockProps = (0, import_block_editor185.useBlockProps)({ 45109 style: { width, height, aspectRatio }, 45110 className: clsx_default({ 45111 "is-transient": temporaryURL 45112 }) 45113 }); 45114 const borderProps = (0, import_block_editor185.__experimentalUseBorderProps)(attributes3); 45115 const shadowProps = (0, import_block_editor185.__experimentalGetShadowClassesAndStyles)(attributes3); 45116 const blockEditingMode = (0, import_block_editor185.useBlockEditingMode)(); 45117 const placeholder2 = (content) => { 45118 return /* @__PURE__ */ (0, import_jsx_runtime349.jsx)( 45119 import_components102.Placeholder, 45120 { 45121 className: clsx_default( 45122 "block-editor-media-placeholder", 45123 borderProps.className 45124 ), 45125 withIllustration: true, 45126 style: { 45127 height: !!aspectRatio && "100%", 45128 width: !!aspectRatio && "100%", 45129 ...borderProps.style, 45130 ...shadowProps.style 45131 }, 45132 children: content 45133 } 45134 ); 45135 }; 45136 const onSelectImage = (value) => { 45137 if (value?.id) { 45138 setFeaturedImage(value.id); 45139 } 45140 if (value?.url && (0, import_blob16.isBlobURL)(value.url)) { 45141 setTemporaryURL(value.url); 45142 } 45143 }; 45144 const onResetImage = () => { 45145 setAttributes({ 45146 isLink: false, 45147 linkTarget: "_self", 45148 rel: "", 45149 sizeSlug: void 0 45150 }); 45151 setFeaturedImage(0); 45152 }; 45153 (0, import_element91.useEffect)(() => { 45154 if (mediaUrl && temporaryURL) { 45155 setTemporaryURL(); 45156 } 45157 }, [mediaUrl, temporaryURL]); 45158 const { createErrorNotice } = (0, import_data95.useDispatch)(import_notices14.store); 45159 const onUploadError = (message) => { 45160 createErrorNotice(message, { type: "snackbar" }); 45161 setTemporaryURL(); 45162 }; 45163 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 45164 const controls = blockEditingMode === "default" && /* @__PURE__ */ (0, import_jsx_runtime349.jsxs)(import_jsx_runtime349.Fragment, { children: [ 45165 /* @__PURE__ */ (0, import_jsx_runtime349.jsx)(import_block_editor185.InspectorControls, { group: "color", children: /* @__PURE__ */ (0, import_jsx_runtime349.jsx)( 45166 overlay_controls_default, 45167 { 45168 attributes: attributes3, 45169 setAttributes, 45170 clientId 45171 } 45172 ) }), 45173 /* @__PURE__ */ (0, import_jsx_runtime349.jsx)(import_block_editor185.InspectorControls, { group: "dimensions", children: /* @__PURE__ */ (0, import_jsx_runtime349.jsx)( 45174 dimension_controls_default, 45175 { 45176 clientId, 45177 attributes: attributes3, 45178 setAttributes, 45179 media 45180 } 45181 ) }), 45182 (featuredImage || isDescendentOfQueryLoop || !postId) && /* @__PURE__ */ (0, import_jsx_runtime349.jsx)(import_block_editor185.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime349.jsxs)( 45183 import_components102.__experimentalToolsPanel, 45184 { 45185 label: (0, import_i18n162.__)("Settings"), 45186 resetAll: () => { 45187 setAttributes({ 45188 isLink: false, 45189 linkTarget: "_self", 45190 rel: "", 45191 sizeSlug: DEFAULT_MEDIA_SIZE_SLUG5 45192 }); 45193 }, 45194 dropdownMenuProps, 45195 children: [ 45196 /* @__PURE__ */ (0, import_jsx_runtime349.jsx)( 45197 import_components102.__experimentalToolsPanelItem, 45198 { 45199 label: postType?.labels.singular_name ? (0, import_i18n162.sprintf)( 45200 // translators: %s: Name of the post type e.g: "post". 45201 (0, import_i18n162.__)("Link to %s"), 45202 postType.labels.singular_name 45203 ) : (0, import_i18n162.__)("Link to post"), 45204 isShownByDefault: true, 45205 hasValue: () => !!isLink, 45206 onDeselect: () => setAttributes({ 45207 isLink: false 45208 }), 45209 children: /* @__PURE__ */ (0, import_jsx_runtime349.jsx)( 45210 import_components102.ToggleControl, 45211 { 45212 label: postType?.labels.singular_name ? (0, import_i18n162.sprintf)( 45213 // translators: %s: Name of the post type e.g: "post". 45214 (0, import_i18n162.__)("Link to %s"), 45215 postType.labels.singular_name 45216 ) : (0, import_i18n162.__)("Link to post"), 45217 onChange: () => setAttributes({ isLink: !isLink }), 45218 checked: isLink 45219 } 45220 ) 45221 } 45222 ), 45223 isLink && /* @__PURE__ */ (0, import_jsx_runtime349.jsx)( 45224 import_components102.__experimentalToolsPanelItem, 45225 { 45226 label: (0, import_i18n162.__)("Open in new tab"), 45227 isShownByDefault: true, 45228 hasValue: () => "_self" !== linkTarget, 45229 onDeselect: () => setAttributes({ 45230 linkTarget: "_self" 45231 }), 45232 children: /* @__PURE__ */ (0, import_jsx_runtime349.jsx)( 45233 import_components102.ToggleControl, 45234 { 45235 label: (0, import_i18n162.__)("Open in new tab"), 45236 onChange: (value) => setAttributes({ 45237 linkTarget: value ? "_blank" : "_self" 45238 }), 45239 checked: linkTarget === "_blank" 45240 } 45241 ) 45242 } 45243 ), 45244 isLink && /* @__PURE__ */ (0, import_jsx_runtime349.jsx)( 45245 import_components102.__experimentalToolsPanelItem, 45246 { 45247 label: (0, import_i18n162.__)("Link relation"), 45248 isShownByDefault: true, 45249 hasValue: () => !!rel, 45250 onDeselect: () => setAttributes({ 45251 rel: "" 45252 }), 45253 children: /* @__PURE__ */ (0, import_jsx_runtime349.jsx)( 45254 import_components102.TextControl, 45255 { 45256 __next40pxDefaultSize: true, 45257 label: (0, import_i18n162.__)("Link relation"), 45258 help: (0, import_element91.createInterpolateElement)( 45259 (0, import_i18n162.__)( 45260 "The <a>Link Relation</a> attribute defines the relationship between a linked resource and the current document." 45261 ), 45262 { 45263 a: /* @__PURE__ */ (0, import_jsx_runtime349.jsx)(import_components102.ExternalLink, { href: "https://developer.mozilla.org/docs/Web/HTML/Attributes/rel" }) 45264 } 45265 ), 45266 value: rel, 45267 onChange: (newRel) => setAttributes({ rel: newRel }) 45268 } 45269 ) 45270 } 45271 ), 45272 !!media && /* @__PURE__ */ (0, import_jsx_runtime349.jsx)( 45273 FeaturedImageResolutionTool, 45274 { 45275 image: media, 45276 value: sizeSlug, 45277 onChange: (nextSizeSlug) => setAttributes({ sizeSlug: nextSizeSlug }) 45278 } 45279 ) 45280 ] 45281 } 45282 ) }) 45283 ] }); 45284 let image; 45285 if (!featuredImage && (isDescendentOfQueryLoop || !postId)) { 45286 return /* @__PURE__ */ (0, import_jsx_runtime349.jsxs)(import_jsx_runtime349.Fragment, { children: [ 45287 controls, 45288 /* @__PURE__ */ (0, import_jsx_runtime349.jsxs)("div", { ...blockProps, children: [ 45289 !!isLink ? /* @__PURE__ */ (0, import_jsx_runtime349.jsx)("a", { href: postPermalink, target: linkTarget, children: placeholder2() }) : placeholder2(), 45290 /* @__PURE__ */ (0, import_jsx_runtime349.jsx)( 45291 overlay_default, 45292 { 45293 attributes: attributes3, 45294 setAttributes, 45295 clientId 45296 } 45297 ) 45298 ] }) 45299 ] }); 45300 } 45301 const label = (0, import_i18n162.__)("Add a featured image"); 45302 const imageStyles = { 45303 ...borderProps.style, 45304 ...shadowProps.style, 45305 height: aspectRatio ? "100%" : height, 45306 width: !!aspectRatio && "100%", 45307 objectFit: !!(height || aspectRatio) && scale 45308 }; 45309 if (!featuredImage && !temporaryURL) { 45310 image = /* @__PURE__ */ (0, import_jsx_runtime349.jsx)( 45311 import_block_editor185.MediaPlaceholder, 45312 { 45313 onSelect: onSelectImage, 45314 accept: "image/*", 45315 allowedTypes: ALLOWED_MEDIA_TYPES6, 45316 onError: onUploadError, 45317 placeholder: placeholder2, 45318 mediaLibraryButton: ({ open }) => { 45319 return /* @__PURE__ */ (0, import_jsx_runtime349.jsx)( 45320 import_components102.Button, 45321 { 45322 __next40pxDefaultSize: true, 45323 icon: upload_default, 45324 variant: "primary", 45325 label, 45326 showTooltip: true, 45327 tooltipPosition: "top center", 45328 onClick: () => { 45329 open(); 45330 } 45331 } 45332 ); 45333 } 45334 } 45335 ); 45336 } else { 45337 image = !media && !temporaryURL ? placeholder2() : /* @__PURE__ */ (0, import_jsx_runtime349.jsxs)(import_jsx_runtime349.Fragment, { children: [ 45338 /* @__PURE__ */ (0, import_jsx_runtime349.jsx)( 45339 "img", 45340 { 45341 className: borderProps.className, 45342 src: temporaryURL || mediaUrl, 45343 alt: media && media?.alt_text ? (0, import_i18n162.sprintf)( 45344 // translators: %s: The image's alt text. 45345 (0, import_i18n162.__)("Featured image: %s"), 45346 media.alt_text 45347 ) : (0, import_i18n162.__)("Featured image"), 45348 style: imageStyles 45349 } 45350 ), 45351 temporaryURL && /* @__PURE__ */ (0, import_jsx_runtime349.jsx)(import_components102.Spinner, {}) 45352 ] }); 45353 } 45354 return /* @__PURE__ */ (0, import_jsx_runtime349.jsxs)(import_jsx_runtime349.Fragment, { children: [ 45355 !temporaryURL && controls, 45356 !!media && !isDescendentOfQueryLoop && /* @__PURE__ */ (0, import_jsx_runtime349.jsx)(import_block_editor185.BlockControls, { group: "other", children: /* @__PURE__ */ (0, import_jsx_runtime349.jsx)( 45357 import_block_editor185.MediaReplaceFlow, 45358 { 45359 mediaId: featuredImage, 45360 mediaURL: mediaUrl, 45361 allowedTypes: ALLOWED_MEDIA_TYPES6, 45362 accept: "image/*", 45363 onSelect: onSelectImage, 45364 onError: onUploadError, 45365 onReset: onResetImage 45366 } 45367 ) }), 45368 /* @__PURE__ */ (0, import_jsx_runtime349.jsxs)("figure", { ...blockProps, children: [ 45369 !!isLink ? /* @__PURE__ */ (0, import_jsx_runtime349.jsx)("a", { href: postPermalink, target: linkTarget, children: image }) : image, 45370 /* @__PURE__ */ (0, import_jsx_runtime349.jsx)( 45371 overlay_default, 45372 { 45373 attributes: attributes3, 45374 setAttributes, 45375 clientId 45376 } 45377 ) 45378 ] }) 45379 ] }); 45380 } 45381 45382 // packages/block-library/build-module/post-featured-image/index.js 45383 var { name: name73 } = block_default72; 45384 var settings72 = { 45385 icon: post_featured_image_default, 45386 edit: PostFeaturedImageEdit 45387 }; 45388 var init72 = () => initBlock({ name: name73, metadata: block_default72, settings: settings72 }); 45389 45390 // packages/block-library/build-module/post-navigation-link/index.js 45391 var post_navigation_link_exports = {}; 45392 __export(post_navigation_link_exports, { 45393 init: () => init73, 45394 metadata: () => block_default73, 45395 name: () => name74, 45396 settings: () => settings73 45397 }); 45398 var import_i18n165 = __toESM(require_i18n()); 45399 45400 // packages/block-library/build-module/post-navigation-link/block.json 45401 var block_default73 = { 45402 $schema: "https://schemas.wp.org/trunk/block.json", 45403 apiVersion: 3, 45404 name: "core/post-navigation-link", 45405 title: "Post Navigation Link", 45406 category: "theme", 45407 description: "Displays the next or previous post link that is adjacent to the current post.", 45408 textdomain: "default", 45409 attributes: { 45410 textAlign: { 45411 type: "string" 45412 }, 45413 type: { 45414 type: "string", 45415 default: "next" 45416 }, 45417 label: { 45418 type: "string", 45419 role: "content" 45420 }, 45421 showTitle: { 45422 type: "boolean", 45423 default: false 45424 }, 45425 linkLabel: { 45426 type: "boolean", 45427 default: false 45428 }, 45429 arrow: { 45430 type: "string", 45431 default: "none" 45432 }, 45433 taxonomy: { 45434 type: "string", 45435 default: "" 45436 } 45437 }, 45438 usesContext: ["postType"], 45439 supports: { 45440 reusable: false, 45441 html: false, 45442 color: { 45443 link: true 45444 }, 45445 typography: { 45446 fontSize: true, 45447 lineHeight: true, 45448 __experimentalFontFamily: true, 45449 __experimentalFontWeight: true, 45450 __experimentalFontStyle: true, 45451 __experimentalTextTransform: true, 45452 __experimentalTextDecoration: true, 45453 __experimentalLetterSpacing: true, 45454 __experimentalWritingMode: true, 45455 __experimentalDefaultControls: { 45456 fontSize: true 45457 } 45458 }, 45459 interactivity: { 45460 clientNavigation: true 45461 } 45462 }, 45463 style: "wp-block-post-navigation-link" 45464 }; 45465 45466 // packages/block-library/build-module/post-navigation-link/edit.js 45467 var import_components103 = __toESM(require_components()); 45468 var import_block_editor186 = __toESM(require_block_editor()); 45469 var import_i18n163 = __toESM(require_i18n()); 45470 var import_data96 = __toESM(require_data()); 45471 var import_core_data58 = __toESM(require_core_data()); 45472 var import_jsx_runtime350 = __toESM(require_jsx_runtime()); 45473 function PostNavigationLinkEdit({ 45474 context: { postType }, 45475 attributes: { 45476 type, 45477 label, 45478 showTitle, 45479 textAlign, 45480 linkLabel, 45481 arrow, 45482 taxonomy 45483 }, 45484 setAttributes 45485 }) { 45486 const blockEditingMode = (0, import_block_editor186.useBlockEditingMode)(); 45487 const showControls = blockEditingMode === "default"; 45488 const isNext = type === "next"; 45489 let placeholder2 = isNext ? (0, import_i18n163.__)("Next") : (0, import_i18n163.__)("Previous"); 45490 const arrowMap5 = { 45491 none: "", 45492 arrow: isNext ? "\u2192" : "\u2190", 45493 chevron: isNext ? "\xBB" : "\xAB" 45494 }; 45495 const displayArrow = arrowMap5[arrow]; 45496 if (showTitle) { 45497 placeholder2 = isNext ? ( 45498 /* translators: Label before for next and previous post. There is a space after the colon. */ 45499 (0, import_i18n163.__)("Next: ") 45500 ) : ( 45501 /* translators: Label before for next and previous post. There is a space after the colon. */ 45502 (0, import_i18n163.__)("Previous: ") 45503 ); 45504 } 45505 const ariaLabel = isNext ? (0, import_i18n163.__)("Next post") : (0, import_i18n163.__)("Previous post"); 45506 const blockProps = (0, import_block_editor186.useBlockProps)({ 45507 className: clsx_default({ 45508 [`has-text-align-$textAlign}`]: textAlign 45509 }) 45510 }); 45511 const taxonomies = (0, import_data96.useSelect)( 45512 (select9) => { 45513 const { getTaxonomies } = select9(import_core_data58.store); 45514 const filteredTaxonomies = getTaxonomies({ 45515 type: postType, 45516 per_page: -1 45517 }); 45518 return filteredTaxonomies; 45519 }, 45520 [postType] 45521 ); 45522 const getTaxonomyOptions = () => { 45523 const selectOption = { 45524 label: (0, import_i18n163.__)("Unfiltered"), 45525 value: "" 45526 }; 45527 const taxonomyOptions = (taxonomies ?? []).filter(({ visibility }) => !!visibility?.publicly_queryable).map((item) => { 45528 return { 45529 value: item.slug, 45530 label: item.name 45531 }; 45532 }); 45533 return [selectOption, ...taxonomyOptions]; 45534 }; 45535 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 45536 return /* @__PURE__ */ (0, import_jsx_runtime350.jsxs)(import_jsx_runtime350.Fragment, { children: [ 45537 /* @__PURE__ */ (0, import_jsx_runtime350.jsx)(import_block_editor186.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime350.jsxs)( 45538 import_components103.__experimentalToolsPanel, 45539 { 45540 label: (0, import_i18n163.__)("Settings"), 45541 resetAll: () => { 45542 setAttributes({ 45543 showTitle: false, 45544 linkLabel: false, 45545 arrow: "none" 45546 }); 45547 }, 45548 dropdownMenuProps, 45549 children: [ 45550 /* @__PURE__ */ (0, import_jsx_runtime350.jsx)( 45551 import_components103.__experimentalToolsPanelItem, 45552 { 45553 label: (0, import_i18n163.__)("Display the title as a link"), 45554 isShownByDefault: true, 45555 hasValue: () => showTitle, 45556 onDeselect: () => setAttributes({ showTitle: false }), 45557 children: /* @__PURE__ */ (0, import_jsx_runtime350.jsx)( 45558 import_components103.ToggleControl, 45559 { 45560 label: (0, import_i18n163.__)("Display the title as a link"), 45561 help: (0, import_i18n163.__)( 45562 "If you have entered a custom label, it will be prepended before the title." 45563 ), 45564 checked: !!showTitle, 45565 onChange: () => setAttributes({ 45566 showTitle: !showTitle 45567 }) 45568 } 45569 ) 45570 } 45571 ), 45572 showTitle && /* @__PURE__ */ (0, import_jsx_runtime350.jsx)( 45573 import_components103.__experimentalToolsPanelItem, 45574 { 45575 label: (0, import_i18n163.__)( 45576 "Include the label as part of the link" 45577 ), 45578 isShownByDefault: true, 45579 hasValue: () => !!linkLabel, 45580 onDeselect: () => setAttributes({ linkLabel: false }), 45581 children: /* @__PURE__ */ (0, import_jsx_runtime350.jsx)( 45582 import_components103.ToggleControl, 45583 { 45584 label: (0, import_i18n163.__)( 45585 "Include the label as part of the link" 45586 ), 45587 checked: !!linkLabel, 45588 onChange: () => setAttributes({ 45589 linkLabel: !linkLabel 45590 }) 45591 } 45592 ) 45593 } 45594 ), 45595 /* @__PURE__ */ (0, import_jsx_runtime350.jsx)( 45596 import_components103.__experimentalToolsPanelItem, 45597 { 45598 label: (0, import_i18n163.__)("Arrow"), 45599 isShownByDefault: true, 45600 hasValue: () => arrow !== "none", 45601 onDeselect: () => setAttributes({ arrow: "none" }), 45602 children: /* @__PURE__ */ (0, import_jsx_runtime350.jsxs)( 45603 import_components103.__experimentalToggleGroupControl, 45604 { 45605 __next40pxDefaultSize: true, 45606 label: (0, import_i18n163.__)("Arrow"), 45607 value: arrow, 45608 onChange: (value) => { 45609 setAttributes({ arrow: value }); 45610 }, 45611 help: (0, import_i18n163.__)( 45612 "A decorative arrow for the next and previous link." 45613 ), 45614 isBlock: true, 45615 children: [ 45616 /* @__PURE__ */ (0, import_jsx_runtime350.jsx)( 45617 import_components103.__experimentalToggleGroupControlOption, 45618 { 45619 value: "none", 45620 label: (0, import_i18n163._x)( 45621 "None", 45622 "Arrow option for Next/Previous link" 45623 ) 45624 } 45625 ), 45626 /* @__PURE__ */ (0, import_jsx_runtime350.jsx)( 45627 import_components103.__experimentalToggleGroupControlOption, 45628 { 45629 value: "arrow", 45630 label: (0, import_i18n163._x)( 45631 "Arrow", 45632 "Arrow option for Next/Previous link" 45633 ) 45634 } 45635 ), 45636 /* @__PURE__ */ (0, import_jsx_runtime350.jsx)( 45637 import_components103.__experimentalToggleGroupControlOption, 45638 { 45639 value: "chevron", 45640 label: (0, import_i18n163._x)( 45641 "Chevron", 45642 "Arrow option for Next/Previous link" 45643 ) 45644 } 45645 ) 45646 ] 45647 } 45648 ) 45649 } 45650 ) 45651 ] 45652 } 45653 ) }), 45654 /* @__PURE__ */ (0, import_jsx_runtime350.jsx)(import_block_editor186.InspectorControls, { group: "advanced", children: /* @__PURE__ */ (0, import_jsx_runtime350.jsx)( 45655 import_components103.SelectControl, 45656 { 45657 __next40pxDefaultSize: true, 45658 label: (0, import_i18n163.__)("Filter by taxonomy"), 45659 value: taxonomy, 45660 options: getTaxonomyOptions(), 45661 onChange: (value) => setAttributes({ 45662 taxonomy: value 45663 }), 45664 help: (0, import_i18n163.__)( 45665 "Only link to posts that have the same taxonomy terms as the current post. For example the same tags or categories." 45666 ) 45667 } 45668 ) }), 45669 showControls && /* @__PURE__ */ (0, import_jsx_runtime350.jsx)(import_block_editor186.BlockControls, { children: /* @__PURE__ */ (0, import_jsx_runtime350.jsx)( 45670 import_block_editor186.AlignmentToolbar, 45671 { 45672 value: textAlign, 45673 onChange: (nextAlign) => { 45674 setAttributes({ textAlign: nextAlign }); 45675 } 45676 } 45677 ) }), 45678 /* @__PURE__ */ (0, import_jsx_runtime350.jsxs)("div", { ...blockProps, children: [ 45679 !isNext && displayArrow && /* @__PURE__ */ (0, import_jsx_runtime350.jsx)( 45680 "span", 45681 { 45682 className: `wp-block-post-navigation-link__arrow-previous is-arrow-$arrow}`, 45683 children: displayArrow 45684 } 45685 ), 45686 /* @__PURE__ */ (0, import_jsx_runtime350.jsx)( 45687 import_block_editor186.RichText, 45688 { 45689 tagName: "a", 45690 identifier: "label", 45691 "aria-label": ariaLabel, 45692 placeholder: placeholder2, 45693 value: label, 45694 withoutInteractiveFormatting: true, 45695 onChange: (newLabel) => setAttributes({ label: newLabel }) 45696 } 45697 ), 45698 showTitle && /* @__PURE__ */ (0, import_jsx_runtime350.jsx)( 45699 "a", 45700 { 45701 href: "#post-navigation-pseudo-link", 45702 onClick: (event) => event.preventDefault(), 45703 children: (0, import_i18n163.__)("An example title") 45704 } 45705 ), 45706 isNext && displayArrow && /* @__PURE__ */ (0, import_jsx_runtime350.jsx)( 45707 "span", 45708 { 45709 className: `wp-block-post-navigation-link__arrow-next is-arrow-$arrow}`, 45710 "aria-hidden": true, 45711 children: displayArrow 45712 } 45713 ) 45714 ] }) 45715 ] }); 45716 } 45717 45718 // packages/block-library/build-module/post-navigation-link/variations.js 45719 var import_i18n164 = __toESM(require_i18n()); 45720 var variations11 = [ 45721 { 45722 name: "post-previous", 45723 title: (0, import_i18n164.__)("Previous Post"), 45724 description: (0, import_i18n164.__)( 45725 "Displays the post link that precedes the current post." 45726 ), 45727 icon: previous_default, 45728 attributes: { type: "previous" }, 45729 scope: ["inserter", "transform"], 45730 example: { 45731 attributes: { 45732 label: (0, import_i18n164.__)("Previous post"), 45733 arrow: "arrow" 45734 } 45735 } 45736 }, 45737 { 45738 isDefault: true, 45739 name: "post-next", 45740 title: (0, import_i18n164.__)("Next Post"), 45741 description: (0, import_i18n164.__)( 45742 "Displays the post link that follows the current post." 45743 ), 45744 icon: next_default, 45745 attributes: { type: "next" }, 45746 scope: ["inserter", "transform"], 45747 example: { 45748 attributes: { 45749 label: (0, import_i18n164.__)("Next post"), 45750 arrow: "arrow" 45751 } 45752 } 45753 } 45754 ]; 45755 variations11.forEach((variation) => { 45756 if (variation.isActive) { 45757 return; 45758 } 45759 variation.isActive = (blockAttributes8, variationAttributes) => blockAttributes8.type === variationAttributes.type; 45760 }); 45761 var variations_default11 = variations11; 45762 45763 // packages/block-library/build-module/post-navigation-link/index.js 45764 var { name: name74 } = block_default73; 45765 var settings73 = { 45766 edit: PostNavigationLinkEdit, 45767 variations: variations_default11, 45768 example: { 45769 attributes: { 45770 label: (0, import_i18n165.__)("Next post"), 45771 arrow: "arrow" 45772 } 45773 } 45774 }; 45775 var init73 = () => initBlock({ name: name74, metadata: block_default73, settings: settings73 }); 45776 45777 // packages/block-library/build-module/post-template/index.js 45778 var post_template_exports = {}; 45779 __export(post_template_exports, { 45780 init: () => init74, 45781 metadata: () => block_default74, 45782 name: () => name75, 45783 settings: () => settings74 45784 }); 45785 45786 // packages/block-library/build-module/post-template/block.json 45787 var block_default74 = { 45788 $schema: "https://schemas.wp.org/trunk/block.json", 45789 apiVersion: 3, 45790 name: "core/post-template", 45791 title: "Post Template", 45792 category: "theme", 45793 ancestor: ["core/query"], 45794 description: "Contains the block elements used to render a post, like the title, date, featured image, content or excerpt, and more.", 45795 textdomain: "default", 45796 usesContext: [ 45797 "queryId", 45798 "query", 45799 "displayLayout", 45800 "templateSlug", 45801 "previewPostType", 45802 "enhancedPagination", 45803 "postType" 45804 ], 45805 supports: { 45806 reusable: false, 45807 html: false, 45808 align: ["wide", "full"], 45809 layout: true, 45810 color: { 45811 gradients: true, 45812 link: true, 45813 __experimentalDefaultControls: { 45814 background: true, 45815 text: true 45816 } 45817 }, 45818 typography: { 45819 fontSize: true, 45820 lineHeight: true, 45821 __experimentalFontFamily: true, 45822 __experimentalFontWeight: true, 45823 __experimentalFontStyle: true, 45824 __experimentalTextTransform: true, 45825 __experimentalTextDecoration: true, 45826 __experimentalLetterSpacing: true, 45827 __experimentalDefaultControls: { 45828 fontSize: true 45829 } 45830 }, 45831 spacing: { 45832 margin: true, 45833 padding: true, 45834 blockGap: { 45835 __experimentalDefault: "1.25em" 45836 }, 45837 __experimentalDefaultControls: { 45838 blockGap: true, 45839 padding: false, 45840 margin: false 45841 } 45842 }, 45843 interactivity: { 45844 clientNavigation: true 45845 }, 45846 __experimentalBorder: { 45847 radius: true, 45848 color: true, 45849 width: true, 45850 style: true 45851 } 45852 }, 45853 style: "wp-block-post-template", 45854 editorStyle: "wp-block-post-template-editor" 45855 }; 45856 45857 // packages/block-library/build-module/post-template/edit.js 45858 var import_element92 = __toESM(require_element()); 45859 var import_data97 = __toESM(require_data()); 45860 var import_i18n166 = __toESM(require_i18n()); 45861 var import_block_editor187 = __toESM(require_block_editor()); 45862 var import_components104 = __toESM(require_components()); 45863 var import_core_data59 = __toESM(require_core_data()); 45864 var import_jsx_runtime351 = __toESM(require_jsx_runtime()); 45865 var TEMPLATE11 = [ 45866 ["core/post-title"], 45867 [ 45868 "core/post-date", 45869 { 45870 metadata: { 45871 bindings: { 45872 datetime: { 45873 source: "core/post-data", 45874 args: { field: "date" } 45875 } 45876 } 45877 } 45878 } 45879 ], 45880 ["core/post-excerpt"] 45881 ]; 45882 function PostTemplateInnerBlocks({ classList }) { 45883 const innerBlocksProps = (0, import_block_editor187.useInnerBlocksProps)( 45884 { className: clsx_default("wp-block-post", classList) }, 45885 { template: TEMPLATE11, __unstableDisableLayoutClassNames: true } 45886 ); 45887 return /* @__PURE__ */ (0, import_jsx_runtime351.jsx)("li", { ...innerBlocksProps }); 45888 } 45889 function PostTemplateBlockPreview({ 45890 blocks, 45891 blockContextId, 45892 classList, 45893 isHidden, 45894 setActiveBlockContextId 45895 }) { 45896 const blockPreviewProps = (0, import_block_editor187.__experimentalUseBlockPreview)({ 45897 blocks, 45898 props: { 45899 className: clsx_default("wp-block-post", classList) 45900 } 45901 }); 45902 const handleOnClick = () => { 45903 setActiveBlockContextId(blockContextId); 45904 }; 45905 const style2 = { 45906 display: isHidden ? "none" : void 0 45907 }; 45908 return /* @__PURE__ */ (0, import_jsx_runtime351.jsx)( 45909 "li", 45910 { 45911 ...blockPreviewProps, 45912 tabIndex: 0, 45913 role: "button", 45914 onClick: handleOnClick, 45915 onKeyPress: handleOnClick, 45916 style: style2 45917 } 45918 ); 45919 } 45920 var MemoizedPostTemplateBlockPreview = (0, import_element92.memo)(PostTemplateBlockPreview); 45921 function PostTemplateEdit({ 45922 setAttributes, 45923 clientId, 45924 context: { 45925 query: { 45926 perPage, 45927 offset = 0, 45928 postType, 45929 order, 45930 orderBy, 45931 author, 45932 search, 45933 exclude, 45934 sticky, 45935 inherit, 45936 taxQuery, 45937 parents, 45938 pages, 45939 format: format3, 45940 // We gather extra query args to pass to the REST API call. 45941 // This way extenders of Query Loop can add their own query args, 45942 // and have accurate previews in the editor. 45943 // Noting though that these args should either be supported by the 45944 // REST API or be handled by custom REST filters like `rest_{$this->post_type}_query`. 45945 ...restQueryArgs 45946 } = {}, 45947 templateSlug, 45948 previewPostType 45949 }, 45950 attributes: { layout }, 45951 __unstableLayoutClassNames 45952 }) { 45953 const { type: layoutType, columnCount = 3 } = layout || {}; 45954 const [activeBlockContextId, setActiveBlockContextId] = (0, import_element92.useState)(); 45955 const { posts, blocks } = (0, import_data97.useSelect)( 45956 (select9) => { 45957 const { getEntityRecords, getTaxonomies } = select9(import_core_data59.store); 45958 const { getBlocks } = select9(import_block_editor187.store); 45959 const templateCategory = inherit && templateSlug?.startsWith("category-") && getEntityRecords("taxonomy", "category", { 45960 context: "view", 45961 per_page: 1, 45962 _fields: ["id"], 45963 slug: templateSlug.replace("category-", "") 45964 }); 45965 const templateTag = inherit && templateSlug?.startsWith("tag-") && getEntityRecords("taxonomy", "post_tag", { 45966 context: "view", 45967 per_page: 1, 45968 _fields: ["id"], 45969 slug: templateSlug.replace("tag-", "") 45970 }); 45971 const query = { 45972 offset: offset || 0, 45973 order, 45974 orderby: orderBy 45975 }; 45976 if (taxQuery && !inherit) { 45977 const taxonomies = getTaxonomies({ 45978 type: postType, 45979 per_page: -1, 45980 context: "view" 45981 }); 45982 const buildTaxQuery = (terms, suffix = "") => { 45983 return Object.entries(terms || {}).reduce( 45984 (accumulator, [taxonomySlug, termIds]) => { 45985 const taxonomy = taxonomies?.find( 45986 ({ slug }) => slug === taxonomySlug 45987 ); 45988 if (taxonomy?.rest_base && termIds?.length) { 45989 accumulator[taxonomy.rest_base + suffix] = termIds; 45990 } 45991 return accumulator; 45992 }, 45993 {} 45994 ); 45995 }; 45996 const builtTaxQuery = buildTaxQuery(taxQuery.include); 45997 if (taxQuery.exclude) { 45998 Object.assign( 45999 builtTaxQuery, 46000 buildTaxQuery(taxQuery.exclude, "_exclude") 46001 ); 46002 } 46003 if (!!Object.keys(builtTaxQuery).length) { 46004 Object.assign(query, builtTaxQuery); 46005 } 46006 } 46007 if (perPage) { 46008 query.per_page = perPage; 46009 } 46010 if (author) { 46011 query.author = author; 46012 } 46013 if (search) { 46014 query.search = search; 46015 } 46016 if (exclude?.length) { 46017 query.exclude = exclude; 46018 } 46019 if (parents?.length) { 46020 query.parent = parents; 46021 } 46022 if (format3?.length) { 46023 query.format = format3; 46024 } 46025 if (["exclude", "only"].includes(sticky)) { 46026 query.sticky = sticky === "only"; 46027 } 46028 if (["", "ignore"].includes(sticky)) { 46029 delete query.sticky; 46030 query.ignore_sticky = sticky === "ignore"; 46031 } 46032 let currentPostType = postType; 46033 if (inherit) { 46034 if (templateSlug?.startsWith("archive-")) { 46035 query.postType = templateSlug.replace("archive-", ""); 46036 currentPostType = query.postType; 46037 } else if (templateCategory) { 46038 query.categories = templateCategory[0]?.id; 46039 } else if (templateTag) { 46040 query.tags = templateTag[0]?.id; 46041 } else if (templateSlug?.startsWith("taxonomy-post_format")) { 46042 query.format = templateSlug.replace( 46043 "taxonomy-post_format-post-format-", 46044 "" 46045 ); 46046 } 46047 } 46048 const usedPostType = previewPostType || currentPostType; 46049 return { 46050 posts: getEntityRecords("postType", usedPostType, { 46051 ...query, 46052 ...restQueryArgs 46053 }), 46054 blocks: getBlocks(clientId) 46055 }; 46056 }, 46057 [ 46058 perPage, 46059 offset, 46060 order, 46061 orderBy, 46062 clientId, 46063 author, 46064 search, 46065 postType, 46066 exclude, 46067 sticky, 46068 inherit, 46069 templateSlug, 46070 taxQuery, 46071 parents, 46072 format3, 46073 restQueryArgs, 46074 previewPostType 46075 ] 46076 ); 46077 const blockContexts = (0, import_element92.useMemo)( 46078 () => posts?.map((post) => ({ 46079 postType: post.type, 46080 postId: post.id, 46081 classList: post.class_list ?? "" 46082 })), 46083 [posts] 46084 ); 46085 const blockProps = (0, import_block_editor187.useBlockProps)({ 46086 className: clsx_default(__unstableLayoutClassNames, { 46087 [`columns-$columnCount}`]: layoutType === "grid" && columnCount 46088 // Ensure column count is flagged via classname for backwards compatibility. 46089 }) 46090 }); 46091 if (!posts) { 46092 return /* @__PURE__ */ (0, import_jsx_runtime351.jsx)("p", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime351.jsx)(import_components104.Spinner, {}) }); 46093 } 46094 if (!posts.length) { 46095 return /* @__PURE__ */ (0, import_jsx_runtime351.jsxs)("p", { ...blockProps, children: [ 46096 " ", 46097 (0, import_i18n166.__)("No results found.") 46098 ] }); 46099 } 46100 const setDisplayLayout = (newDisplayLayout) => setAttributes({ 46101 layout: { ...layout, ...newDisplayLayout } 46102 }); 46103 const displayLayoutControls = [ 46104 { 46105 icon: list_default, 46106 title: (0, import_i18n166._x)("List view", "Post template block display setting"), 46107 onClick: () => setDisplayLayout({ type: "default" }), 46108 isActive: layoutType === "default" || layoutType === "constrained" 46109 }, 46110 { 46111 icon: grid_default, 46112 title: (0, import_i18n166._x)("Grid view", "Post template block display setting"), 46113 onClick: () => setDisplayLayout({ 46114 type: "grid", 46115 columnCount 46116 }), 46117 isActive: layoutType === "grid" 46118 } 46119 ]; 46120 return /* @__PURE__ */ (0, import_jsx_runtime351.jsxs)(import_jsx_runtime351.Fragment, { children: [ 46121 /* @__PURE__ */ (0, import_jsx_runtime351.jsx)(import_block_editor187.BlockControls, { children: /* @__PURE__ */ (0, import_jsx_runtime351.jsx)(import_components104.ToolbarGroup, { controls: displayLayoutControls }) }), 46122 /* @__PURE__ */ (0, import_jsx_runtime351.jsx)("ul", { ...blockProps, children: blockContexts && blockContexts.map((blockContext) => /* @__PURE__ */ (0, import_jsx_runtime351.jsxs)( 46123 import_block_editor187.BlockContextProvider, 46124 { 46125 value: blockContext, 46126 children: [ 46127 blockContext.postId === (activeBlockContextId || blockContexts[0]?.postId) ? /* @__PURE__ */ (0, import_jsx_runtime351.jsx)( 46128 PostTemplateInnerBlocks, 46129 { 46130 classList: blockContext.classList 46131 } 46132 ) : null, 46133 /* @__PURE__ */ (0, import_jsx_runtime351.jsx)( 46134 MemoizedPostTemplateBlockPreview, 46135 { 46136 blocks, 46137 blockContextId: blockContext.postId, 46138 classList: blockContext.classList, 46139 setActiveBlockContextId, 46140 isHidden: blockContext.postId === (activeBlockContextId || blockContexts[0]?.postId) 46141 } 46142 ) 46143 ] 46144 }, 46145 blockContext.postId 46146 )) }) 46147 ] }); 46148 } 46149 46150 // packages/block-library/build-module/post-template/save.js 46151 var import_block_editor188 = __toESM(require_block_editor()); 46152 var import_jsx_runtime352 = __toESM(require_jsx_runtime()); 46153 function PostTemplateSave() { 46154 return /* @__PURE__ */ (0, import_jsx_runtime352.jsx)(import_block_editor188.InnerBlocks.Content, {}); 46155 } 46156 46157 // packages/block-library/build-module/post-template/index.js 46158 var { name: name75 } = block_default74; 46159 var settings74 = { 46160 icon: layout_default, 46161 edit: PostTemplateEdit, 46162 save: PostTemplateSave 46163 }; 46164 var init74 = () => initBlock({ name: name75, metadata: block_default74, settings: settings74 }); 46165 46166 // packages/block-library/build-module/post-terms/index.js 46167 var post_terms_exports = {}; 46168 __export(post_terms_exports, { 46169 init: () => init75, 46170 metadata: () => block_default75, 46171 name: () => name76, 46172 settings: () => settings75 46173 }); 46174 var import_hooks54 = __toESM(require_hooks()); 46175 46176 // packages/block-library/build-module/post-terms/block.json 46177 var block_default75 = { 46178 $schema: "https://schemas.wp.org/trunk/block.json", 46179 apiVersion: 3, 46180 name: "core/post-terms", 46181 title: "Post Terms", 46182 category: "theme", 46183 description: "Post terms.", 46184 textdomain: "default", 46185 attributes: { 46186 term: { 46187 type: "string" 46188 }, 46189 textAlign: { 46190 type: "string" 46191 }, 46192 separator: { 46193 type: "string", 46194 default: ", " 46195 }, 46196 prefix: { 46197 type: "string", 46198 default: "", 46199 role: "content" 46200 }, 46201 suffix: { 46202 type: "string", 46203 default: "", 46204 role: "content" 46205 } 46206 }, 46207 usesContext: ["postId", "postType"], 46208 example: { 46209 viewportWidth: 350 46210 }, 46211 supports: { 46212 html: false, 46213 color: { 46214 gradients: true, 46215 link: true, 46216 __experimentalDefaultControls: { 46217 background: true, 46218 text: true, 46219 link: true 46220 } 46221 }, 46222 spacing: { 46223 margin: true, 46224 padding: true 46225 }, 46226 typography: { 46227 fontSize: true, 46228 lineHeight: true, 46229 __experimentalFontFamily: true, 46230 __experimentalFontWeight: true, 46231 __experimentalFontStyle: true, 46232 __experimentalTextTransform: true, 46233 __experimentalTextDecoration: true, 46234 __experimentalLetterSpacing: true, 46235 __experimentalDefaultControls: { 46236 fontSize: true 46237 } 46238 }, 46239 interactivity: { 46240 clientNavigation: true 46241 }, 46242 __experimentalBorder: { 46243 radius: true, 46244 color: true, 46245 width: true, 46246 style: true, 46247 __experimentalDefaultControls: { 46248 radius: true, 46249 color: true, 46250 width: true, 46251 style: true 46252 } 46253 } 46254 }, 46255 style: "wp-block-post-terms" 46256 }; 46257 46258 // packages/block-library/build-module/post-terms/edit.js 46259 var import_block_editor189 = __toESM(require_block_editor()); 46260 var import_blocks81 = __toESM(require_blocks()); 46261 var import_components105 = __toESM(require_components()); 46262 var import_data99 = __toESM(require_data()); 46263 var import_html_entities9 = __toESM(require_html_entities()); 46264 var import_i18n167 = __toESM(require_i18n()); 46265 var import_core_data61 = __toESM(require_core_data()); 46266 46267 // packages/block-library/build-module/post-terms/use-post-terms.js 46268 var import_core_data60 = __toESM(require_core_data()); 46269 var import_data98 = __toESM(require_data()); 46270 var EMPTY_ARRAY3 = []; 46271 function usePostTerms({ postId, term }) { 46272 const { slug } = term; 46273 return (0, import_data98.useSelect)( 46274 (select9) => { 46275 const visible = term?.visibility?.publicly_queryable; 46276 if (!visible) { 46277 return { 46278 postTerms: EMPTY_ARRAY3, 46279 isLoading: false, 46280 hasPostTerms: false 46281 }; 46282 } 46283 const { getEntityRecords, isResolving } = select9(import_core_data60.store); 46284 const taxonomyArgs = [ 46285 "taxonomy", 46286 slug, 46287 { 46288 post: postId, 46289 per_page: -1, 46290 context: "view" 46291 } 46292 ]; 46293 const terms = getEntityRecords(...taxonomyArgs); 46294 return { 46295 postTerms: terms, 46296 isLoading: isResolving("getEntityRecords", taxonomyArgs), 46297 hasPostTerms: !!terms?.length 46298 }; 46299 }, 46300 [postId, term?.visibility?.publicly_queryable, slug] 46301 ); 46302 } 46303 46304 // packages/block-library/build-module/post-terms/edit.js 46305 var import_jsx_runtime353 = __toESM(require_jsx_runtime()); 46306 var ALLOWED_FORMATS = [ 46307 "core/bold", 46308 "core/image", 46309 "core/italic", 46310 "core/link", 46311 "core/strikethrough", 46312 "core/text-color" 46313 ]; 46314 function PostTermsEdit({ 46315 attributes: attributes3, 46316 clientId, 46317 context, 46318 isSelected, 46319 setAttributes, 46320 insertBlocksAfter 46321 }) { 46322 const { term, textAlign, separator, prefix, suffix } = attributes3; 46323 const { postId, postType } = context; 46324 const blockEditingMode = (0, import_block_editor189.useBlockEditingMode)(); 46325 const showControls = blockEditingMode === "default"; 46326 const selectedTerm = (0, import_data99.useSelect)( 46327 (select9) => { 46328 if (!term) { 46329 return {}; 46330 } 46331 const { getTaxonomy } = select9(import_core_data61.store); 46332 const taxonomy = getTaxonomy(term); 46333 return taxonomy?.visibility?.publicly_queryable ? taxonomy : {}; 46334 }, 46335 [term] 46336 ); 46337 const { postTerms, hasPostTerms, isLoading } = usePostTerms({ 46338 postId, 46339 term: selectedTerm 46340 }); 46341 const hasPost = postId && postType; 46342 const blockInformation = (0, import_block_editor189.useBlockDisplayInformation)(clientId); 46343 const blockProps = (0, import_block_editor189.useBlockProps)({ 46344 className: clsx_default({ 46345 [`has-text-align-$textAlign}`]: textAlign, 46346 [`taxonomy-$term}`]: term 46347 }) 46348 }); 46349 return /* @__PURE__ */ (0, import_jsx_runtime353.jsxs)(import_jsx_runtime353.Fragment, { children: [ 46350 showControls && /* @__PURE__ */ (0, import_jsx_runtime353.jsx)(import_block_editor189.BlockControls, { children: /* @__PURE__ */ (0, import_jsx_runtime353.jsx)( 46351 import_block_editor189.AlignmentToolbar, 46352 { 46353 value: textAlign, 46354 onChange: (nextAlign) => { 46355 setAttributes({ textAlign: nextAlign }); 46356 } 46357 } 46358 ) }), 46359 /* @__PURE__ */ (0, import_jsx_runtime353.jsx)(import_block_editor189.InspectorControls, { group: "advanced", children: /* @__PURE__ */ (0, import_jsx_runtime353.jsx)( 46360 import_components105.TextControl, 46361 { 46362 __next40pxDefaultSize: true, 46363 autoComplete: "off", 46364 label: (0, import_i18n167.__)("Separator"), 46365 value: separator || "", 46366 onChange: (nextValue) => { 46367 setAttributes({ separator: nextValue }); 46368 }, 46369 help: (0, import_i18n167.__)("Enter character(s) used to separate terms.") 46370 } 46371 ) }), 46372 /* @__PURE__ */ (0, import_jsx_runtime353.jsxs)("div", { ...blockProps, children: [ 46373 isLoading && hasPost && /* @__PURE__ */ (0, import_jsx_runtime353.jsx)(import_components105.Spinner, {}), 46374 !isLoading && (isSelected || prefix) && /* @__PURE__ */ (0, import_jsx_runtime353.jsx)( 46375 import_block_editor189.RichText, 46376 { 46377 identifier: "prefix", 46378 allowedFormats: ALLOWED_FORMATS, 46379 className: "wp-block-post-terms__prefix", 46380 "aria-label": (0, import_i18n167.__)("Prefix"), 46381 placeholder: (0, import_i18n167.__)("Prefix") + " ", 46382 value: prefix, 46383 onChange: (value) => setAttributes({ prefix: value }), 46384 tagName: "span" 46385 } 46386 ), 46387 (!hasPost || !term) && /* @__PURE__ */ (0, import_jsx_runtime353.jsx)("span", { children: blockInformation.title }), 46388 hasPost && !isLoading && hasPostTerms && postTerms.map((postTerm) => /* @__PURE__ */ (0, import_jsx_runtime353.jsx)( 46389 "a", 46390 { 46391 href: postTerm.link, 46392 onClick: (event) => event.preventDefault(), 46393 rel: "tag", 46394 children: (0, import_html_entities9.decodeEntities)(postTerm.name) 46395 }, 46396 postTerm.id 46397 )).reduce((prev, curr) => /* @__PURE__ */ (0, import_jsx_runtime353.jsxs)(import_jsx_runtime353.Fragment, { children: [ 46398 prev, 46399 /* @__PURE__ */ (0, import_jsx_runtime353.jsx)("span", { className: "wp-block-post-terms__separator", children: separator || " " }), 46400 curr 46401 ] })), 46402 hasPost && !isLoading && !hasPostTerms && (selectedTerm?.labels?.no_terms || (0, import_i18n167.__)("Term items not found.")), 46403 !isLoading && (isSelected || suffix) && /* @__PURE__ */ (0, import_jsx_runtime353.jsx)( 46404 import_block_editor189.RichText, 46405 { 46406 identifier: "suffix", 46407 allowedFormats: ALLOWED_FORMATS, 46408 className: "wp-block-post-terms__suffix", 46409 "aria-label": (0, import_i18n167.__)("Suffix"), 46410 placeholder: " " + (0, import_i18n167.__)("Suffix"), 46411 value: suffix, 46412 onChange: (value) => setAttributes({ suffix: value }), 46413 tagName: "span", 46414 __unstableOnSplitAtEnd: () => insertBlocksAfter( 46415 (0, import_blocks81.createBlock)((0, import_blocks81.getDefaultBlockName)()) 46416 ) 46417 } 46418 ) 46419 ] }) 46420 ] }); 46421 } 46422 46423 // packages/block-library/build-module/post-terms/hooks.js 46424 var variationIconMap = { 46425 category: post_categories_default, 46426 post_tag: post_terms_default 46427 }; 46428 function enhanceVariations(settings116, name117) { 46429 if (name117 !== "core/post-terms") { 46430 return settings116; 46431 } 46432 const variations18 = settings116.variations.map((variation) => ({ 46433 ...variation, 46434 ...{ 46435 icon: variationIconMap[variation.name] ?? post_categories_default 46436 } 46437 })); 46438 return { 46439 ...settings116, 46440 variations: variations18 46441 }; 46442 } 46443 46444 // packages/block-library/build-module/post-terms/index.js 46445 var { name: name76 } = block_default75; 46446 var settings75 = { 46447 icon: post_categories_default, 46448 edit: PostTermsEdit 46449 }; 46450 var init75 = () => { 46451 (0, import_hooks54.addFilter)( 46452 "blocks.registerBlockType", 46453 "core/template-part", 46454 enhanceVariations 46455 ); 46456 return initBlock({ name: name76, metadata: block_default75, settings: settings75 }); 46457 }; 46458 46459 // packages/block-library/build-module/post-time-to-read/index.js 46460 var post_time_to_read_exports = {}; 46461 __export(post_time_to_read_exports, { 46462 init: () => init76, 46463 metadata: () => block_default76, 46464 name: () => name77, 46465 settings: () => settings76 46466 }); 46467 46468 // packages/block-library/build-module/post-time-to-read/block.json 46469 var block_default76 = { 46470 $schema: "https://schemas.wp.org/trunk/block.json", 46471 apiVersion: 3, 46472 name: "core/post-time-to-read", 46473 title: "Time to Read", 46474 category: "theme", 46475 description: "Show minutes required to finish reading the post. Can also show a word count.", 46476 textdomain: "default", 46477 usesContext: ["postId", "postType"], 46478 attributes: { 46479 textAlign: { 46480 type: "string" 46481 }, 46482 displayAsRange: { 46483 type: "boolean", 46484 default: true 46485 }, 46486 displayMode: { 46487 type: "string", 46488 default: "time" 46489 }, 46490 averageReadingSpeed: { 46491 type: "number", 46492 default: 189 46493 } 46494 }, 46495 supports: { 46496 color: { 46497 gradients: true, 46498 __experimentalDefaultControls: { 46499 background: true, 46500 text: true 46501 } 46502 }, 46503 html: false, 46504 spacing: { 46505 margin: true, 46506 padding: true, 46507 __experimentalDefaultControls: { 46508 margin: false, 46509 padding: false 46510 } 46511 }, 46512 typography: { 46513 fontSize: true, 46514 lineHeight: true, 46515 __experimentalFontFamily: true, 46516 __experimentalFontWeight: true, 46517 __experimentalFontStyle: true, 46518 __experimentalTextTransform: true, 46519 __experimentalTextDecoration: true, 46520 __experimentalLetterSpacing: true, 46521 __experimentalDefaultControls: { 46522 fontSize: true 46523 } 46524 }, 46525 interactivity: { 46526 clientNavigation: true 46527 }, 46528 __experimentalBorder: { 46529 radius: true, 46530 color: true, 46531 width: true, 46532 style: true 46533 } 46534 } 46535 }; 46536 46537 // packages/block-library/build-module/post-time-to-read/edit.js 46538 var import_i18n168 = __toESM(require_i18n()); 46539 var import_element93 = __toESM(require_element()); 46540 var import_block_editor190 = __toESM(require_block_editor()); 46541 var import_components106 = __toESM(require_components()); 46542 var import_blocks82 = __toESM(require_blocks()); 46543 var import_core_data62 = __toESM(require_core_data()); 46544 var import_wordcount = __toESM(require_wordcount()); 46545 var import_jsx_runtime354 = __toESM(require_jsx_runtime()); 46546 function PostTimeToReadEdit({ attributes: attributes3, setAttributes, context }) { 46547 const { textAlign, displayAsRange, displayMode, averageReadingSpeed } = attributes3; 46548 const { postId, postType } = context; 46549 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 46550 const [contentStructure] = (0, import_core_data62.useEntityProp)( 46551 "postType", 46552 postType, 46553 "content", 46554 postId 46555 ); 46556 const [blocks] = (0, import_core_data62.useEntityBlockEditor)("postType", postType, { 46557 id: postId 46558 }); 46559 const displayString = (0, import_element93.useMemo)(() => { 46560 let content; 46561 if (contentStructure instanceof Function) { 46562 content = contentStructure({ blocks }); 46563 } else if (blocks) { 46564 content = (0, import_blocks82.__unstableSerializeAndClean)(blocks); 46565 } else { 46566 content = contentStructure; 46567 } 46568 const wordCountType = (0, import_i18n168._x)( 46569 "words", 46570 "Word count type. Do not translate!" 46571 ); 46572 const totalWords = (0, import_wordcount.count)(content || "", wordCountType); 46573 if (displayMode === "time") { 46574 if (displayAsRange) { 46575 let maxMinutes = Math.max( 46576 1, 46577 Math.round(totalWords / averageReadingSpeed * 1.2) 46578 ); 46579 const minMinutes = Math.max( 46580 1, 46581 Math.round(totalWords / averageReadingSpeed * 0.8) 46582 ); 46583 if (minMinutes === maxMinutes) { 46584 maxMinutes = maxMinutes + 1; 46585 } 46586 const rangeLabel = (0, import_i18n168._x)( 46587 "%1$s\u2013%2$s minutes", 46588 "Range of minutes to read" 46589 ); 46590 return (0, import_i18n168.sprintf)(rangeLabel, minMinutes, maxMinutes); 46591 } 46592 const minutesToRead = Math.max( 46593 1, 46594 Math.round(totalWords / averageReadingSpeed) 46595 ); 46596 return (0, import_i18n168.sprintf)( 46597 /* translators: %s: the number of minutes to read the post. */ 46598 (0, import_i18n168._n)("%s minute", "%s minutes", minutesToRead), 46599 minutesToRead 46600 ); 46601 } 46602 if (displayMode === "words") { 46603 return wordCountType === "words" ? (0, import_i18n168.sprintf)( 46604 /* translators: %s: the number of words in the post. */ 46605 (0, import_i18n168._n)("%s word", "%s words", totalWords), 46606 totalWords.toLocaleString() 46607 ) : (0, import_i18n168.sprintf)( 46608 /* translators: %s: the number of characters in the post. */ 46609 (0, import_i18n168._n)("%s character", "%s characters", totalWords), 46610 totalWords.toLocaleString() 46611 ); 46612 } 46613 }, [ 46614 contentStructure, 46615 blocks, 46616 displayAsRange, 46617 displayMode, 46618 averageReadingSpeed 46619 ]); 46620 const blockProps = (0, import_block_editor190.useBlockProps)({ 46621 className: clsx_default({ 46622 [`has-text-align-$textAlign}`]: textAlign 46623 }) 46624 }); 46625 return /* @__PURE__ */ (0, import_jsx_runtime354.jsxs)(import_jsx_runtime354.Fragment, { children: [ 46626 /* @__PURE__ */ (0, import_jsx_runtime354.jsx)(import_block_editor190.BlockControls, { group: "block", children: /* @__PURE__ */ (0, import_jsx_runtime354.jsx)( 46627 import_block_editor190.AlignmentControl, 46628 { 46629 value: textAlign, 46630 onChange: (nextAlign) => { 46631 setAttributes({ textAlign: nextAlign }); 46632 } 46633 } 46634 ) }), 46635 displayMode === "time" && /* @__PURE__ */ (0, import_jsx_runtime354.jsx)(import_block_editor190.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime354.jsx)( 46636 import_components106.__experimentalToolsPanel, 46637 { 46638 label: (0, import_i18n168.__)("Settings"), 46639 resetAll: () => { 46640 setAttributes({ 46641 displayAsRange: true 46642 }); 46643 }, 46644 dropdownMenuProps, 46645 children: /* @__PURE__ */ (0, import_jsx_runtime354.jsx)( 46646 import_components106.__experimentalToolsPanelItem, 46647 { 46648 isShownByDefault: true, 46649 label: (0, import_i18n168._x)( 46650 "Display as range", 46651 "Turns reading time range display on or off" 46652 ), 46653 hasValue: () => !displayAsRange, 46654 onDeselect: () => { 46655 setAttributes({ 46656 displayAsRange: true 46657 }); 46658 }, 46659 children: /* @__PURE__ */ (0, import_jsx_runtime354.jsx)( 46660 import_components106.ToggleControl, 46661 { 46662 label: (0, import_i18n168.__)("Display as range"), 46663 checked: !!displayAsRange, 46664 onChange: () => setAttributes({ 46665 displayAsRange: !displayAsRange 46666 }) 46667 } 46668 ) 46669 } 46670 ) 46671 } 46672 ) }), 46673 /* @__PURE__ */ (0, import_jsx_runtime354.jsx)("div", { ...blockProps, children: displayString }) 46674 ] }); 46675 } 46676 var edit_default26 = PostTimeToReadEdit; 46677 46678 // packages/block-library/build-module/post-time-to-read/variations.js 46679 var import_i18n169 = __toESM(require_i18n()); 46680 var variations12 = [ 46681 { 46682 name: "time-to-read", 46683 title: (0, import_i18n169.__)("Time to Read"), 46684 description: (0, import_i18n169.__)("Show minutes required to finish reading the post."), 46685 attributes: { 46686 displayMode: "time" 46687 }, 46688 scope: ["inserter", "transform"], 46689 isActive: (blockAttributes8) => blockAttributes8?.displayMode === "time", 46690 icon: time_to_read_default, 46691 isDefault: true 46692 }, 46693 { 46694 name: "word-count", 46695 title: (0, import_i18n169.__)("Word Count"), 46696 description: (0, import_i18n169.__)("Show the number of words in the post."), 46697 attributes: { 46698 displayMode: "words" 46699 }, 46700 scope: ["inserter", "transform"], 46701 isActive: (blockAttributes8) => blockAttributes8?.displayMode === "words", 46702 icon: word_count_default 46703 } 46704 ]; 46705 var variations_default12 = variations12; 46706 46707 // packages/block-library/build-module/post-time-to-read/index.js 46708 var { name: name77 } = block_default76; 46709 var settings76 = { 46710 icon: time_to_read_default, 46711 edit: edit_default26, 46712 variations: variations_default12, 46713 example: {} 46714 }; 46715 var init76 = () => initBlock({ name: name77, metadata: block_default76, settings: settings76 }); 46716 46717 // packages/block-library/build-module/post-title/index.js 46718 var post_title_exports = {}; 46719 __export(post_title_exports, { 46720 init: () => init77, 46721 metadata: () => block_default77, 46722 name: () => name78, 46723 settings: () => settings77 46724 }); 46725 46726 // packages/block-library/build-module/post-title/block.json 46727 var block_default77 = { 46728 $schema: "https://schemas.wp.org/trunk/block.json", 46729 apiVersion: 3, 46730 name: "core/post-title", 46731 title: "Title", 46732 category: "theme", 46733 description: "Displays the title of a post, page, or any other content-type.", 46734 textdomain: "default", 46735 usesContext: ["postId", "postType", "queryId"], 46736 attributes: { 46737 textAlign: { 46738 type: "string" 46739 }, 46740 level: { 46741 type: "number", 46742 default: 2 46743 }, 46744 levelOptions: { 46745 type: "array" 46746 }, 46747 isLink: { 46748 type: "boolean", 46749 default: false, 46750 role: "content" 46751 }, 46752 rel: { 46753 type: "string", 46754 attribute: "rel", 46755 default: "", 46756 role: "content" 46757 }, 46758 linkTarget: { 46759 type: "string", 46760 default: "_self", 46761 role: "content" 46762 } 46763 }, 46764 example: { 46765 viewportWidth: 350 46766 }, 46767 supports: { 46768 align: ["wide", "full"], 46769 html: false, 46770 color: { 46771 gradients: true, 46772 link: true, 46773 __experimentalDefaultControls: { 46774 background: true, 46775 text: true, 46776 link: true 46777 } 46778 }, 46779 spacing: { 46780 margin: true, 46781 padding: true 46782 }, 46783 typography: { 46784 fontSize: true, 46785 lineHeight: true, 46786 __experimentalFontFamily: true, 46787 __experimentalFontWeight: true, 46788 __experimentalFontStyle: true, 46789 __experimentalTextTransform: true, 46790 __experimentalTextDecoration: true, 46791 __experimentalLetterSpacing: true, 46792 __experimentalDefaultControls: { 46793 fontSize: true 46794 } 46795 }, 46796 interactivity: { 46797 clientNavigation: true 46798 }, 46799 __experimentalBorder: { 46800 radius: true, 46801 color: true, 46802 width: true, 46803 style: true, 46804 __experimentalDefaultControls: { 46805 radius: true, 46806 color: true, 46807 width: true, 46808 style: true 46809 } 46810 } 46811 }, 46812 style: "wp-block-post-title" 46813 }; 46814 46815 // packages/block-library/build-module/post-title/edit.js 46816 var import_block_editor191 = __toESM(require_block_editor()); 46817 var import_components107 = __toESM(require_components()); 46818 var import_i18n170 = __toESM(require_i18n()); 46819 var import_blocks83 = __toESM(require_blocks()); 46820 var import_core_data63 = __toESM(require_core_data()); 46821 var import_data100 = __toESM(require_data()); 46822 var import_element94 = __toESM(require_element()); 46823 var import_jsx_runtime355 = __toESM(require_jsx_runtime()); 46824 function PostTitleEdit({ 46825 attributes: { level, levelOptions, textAlign, isLink, rel, linkTarget }, 46826 setAttributes, 46827 context: { postType, postId, queryId }, 46828 insertBlocksAfter 46829 }) { 46830 const TagName2 = level === 0 ? "p" : `h$level}`; 46831 const isDescendentOfQueryLoop = Number.isFinite(queryId); 46832 const userCanEdit = (0, import_data100.useSelect)( 46833 (select9) => { 46834 if (isDescendentOfQueryLoop) { 46835 return false; 46836 } 46837 return select9(import_core_data63.store).canUser("update", { 46838 kind: "postType", 46839 name: postType, 46840 id: postId 46841 }); 46842 }, 46843 [isDescendentOfQueryLoop, postType, postId] 46844 ); 46845 const [rawTitle = "", setTitle, fullTitle] = (0, import_core_data63.useEntityProp)( 46846 "postType", 46847 postType, 46848 "title", 46849 postId 46850 ); 46851 const [link] = (0, import_core_data63.useEntityProp)("postType", postType, "link", postId); 46852 const onSplitAtEnd = () => { 46853 insertBlocksAfter((0, import_blocks83.createBlock)((0, import_blocks83.getDefaultBlockName)())); 46854 }; 46855 const blockProps = (0, import_block_editor191.useBlockProps)({ 46856 className: clsx_default({ 46857 [`has-text-align-$textAlign}`]: textAlign 46858 }) 46859 }); 46860 const blockEditingMode = (0, import_block_editor191.useBlockEditingMode)(); 46861 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 46862 let titleElement = /* @__PURE__ */ (0, import_jsx_runtime355.jsx)(TagName2, { ...blockProps, children: (0, import_i18n170.__)("Title") }); 46863 if (postType && postId) { 46864 titleElement = userCanEdit ? /* @__PURE__ */ (0, import_jsx_runtime355.jsx)( 46865 import_block_editor191.PlainText, 46866 { 46867 tagName: TagName2, 46868 placeholder: (0, import_i18n170.__)("(no title)"), 46869 value: rawTitle, 46870 onChange: setTitle, 46871 __experimentalVersion: 2, 46872 __unstableOnSplitAtEnd: onSplitAtEnd, 46873 ...blockProps 46874 } 46875 ) : /* @__PURE__ */ (0, import_jsx_runtime355.jsx)( 46876 TagName2, 46877 { 46878 ...blockProps, 46879 dangerouslySetInnerHTML: { 46880 __html: fullTitle?.rendered || (0, import_i18n170.__)("(no title)") 46881 } 46882 } 46883 ); 46884 } 46885 if (isLink && postType && postId) { 46886 titleElement = userCanEdit ? /* @__PURE__ */ (0, import_jsx_runtime355.jsx)(TagName2, { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime355.jsx)( 46887 import_block_editor191.PlainText, 46888 { 46889 tagName: "a", 46890 href: link, 46891 target: linkTarget, 46892 rel, 46893 placeholder: !rawTitle.length ? (0, import_i18n170.__)("(no title)") : null, 46894 value: rawTitle, 46895 onChange: setTitle, 46896 __experimentalVersion: 2, 46897 __unstableOnSplitAtEnd: onSplitAtEnd 46898 } 46899 ) }) : /* @__PURE__ */ (0, import_jsx_runtime355.jsx)(TagName2, { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime355.jsx)( 46900 "a", 46901 { 46902 href: link, 46903 target: linkTarget, 46904 rel, 46905 onClick: (event) => event.preventDefault(), 46906 dangerouslySetInnerHTML: { 46907 __html: fullTitle?.rendered || (0, import_i18n170.__)("(no title)") 46908 } 46909 } 46910 ) }); 46911 } 46912 return /* @__PURE__ */ (0, import_jsx_runtime355.jsxs)(import_jsx_runtime355.Fragment, { children: [ 46913 blockEditingMode === "default" && /* @__PURE__ */ (0, import_jsx_runtime355.jsxs)(import_jsx_runtime355.Fragment, { children: [ 46914 /* @__PURE__ */ (0, import_jsx_runtime355.jsxs)(import_block_editor191.BlockControls, { group: "block", children: [ 46915 /* @__PURE__ */ (0, import_jsx_runtime355.jsx)( 46916 import_block_editor191.HeadingLevelDropdown, 46917 { 46918 value: level, 46919 options: levelOptions, 46920 onChange: (newLevel) => setAttributes({ level: newLevel }) 46921 } 46922 ), 46923 /* @__PURE__ */ (0, import_jsx_runtime355.jsx)( 46924 import_block_editor191.AlignmentControl, 46925 { 46926 value: textAlign, 46927 onChange: (nextAlign) => { 46928 setAttributes({ textAlign: nextAlign }); 46929 } 46930 } 46931 ) 46932 ] }), 46933 /* @__PURE__ */ (0, import_jsx_runtime355.jsx)(import_block_editor191.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime355.jsxs)( 46934 import_components107.__experimentalToolsPanel, 46935 { 46936 label: (0, import_i18n170.__)("Settings"), 46937 resetAll: () => { 46938 setAttributes({ 46939 rel: "", 46940 linkTarget: "_self", 46941 isLink: false 46942 }); 46943 }, 46944 dropdownMenuProps, 46945 children: [ 46946 /* @__PURE__ */ (0, import_jsx_runtime355.jsx)( 46947 import_components107.__experimentalToolsPanelItem, 46948 { 46949 label: (0, import_i18n170.__)("Make title a link"), 46950 isShownByDefault: true, 46951 hasValue: () => isLink, 46952 onDeselect: () => setAttributes({ isLink: false }), 46953 children: /* @__PURE__ */ (0, import_jsx_runtime355.jsx)( 46954 import_components107.ToggleControl, 46955 { 46956 label: (0, import_i18n170.__)("Make title a link"), 46957 onChange: () => setAttributes({ isLink: !isLink }), 46958 checked: isLink 46959 } 46960 ) 46961 } 46962 ), 46963 isLink && /* @__PURE__ */ (0, import_jsx_runtime355.jsxs)(import_jsx_runtime355.Fragment, { children: [ 46964 /* @__PURE__ */ (0, import_jsx_runtime355.jsx)( 46965 import_components107.__experimentalToolsPanelItem, 46966 { 46967 label: (0, import_i18n170.__)("Open in new tab"), 46968 isShownByDefault: true, 46969 hasValue: () => linkTarget === "_blank", 46970 onDeselect: () => setAttributes({ 46971 linkTarget: "_self" 46972 }), 46973 children: /* @__PURE__ */ (0, import_jsx_runtime355.jsx)( 46974 import_components107.ToggleControl, 46975 { 46976 label: (0, import_i18n170.__)("Open in new tab"), 46977 onChange: (value) => setAttributes({ 46978 linkTarget: value ? "_blank" : "_self" 46979 }), 46980 checked: linkTarget === "_blank" 46981 } 46982 ) 46983 } 46984 ), 46985 /* @__PURE__ */ (0, import_jsx_runtime355.jsx)( 46986 import_components107.__experimentalToolsPanelItem, 46987 { 46988 label: (0, import_i18n170.__)("Link relation"), 46989 isShownByDefault: true, 46990 hasValue: () => !!rel, 46991 onDeselect: () => setAttributes({ rel: "" }), 46992 children: /* @__PURE__ */ (0, import_jsx_runtime355.jsx)( 46993 import_components107.TextControl, 46994 { 46995 __next40pxDefaultSize: true, 46996 label: (0, import_i18n170.__)("Link relation"), 46997 help: (0, import_element94.createInterpolateElement)( 46998 (0, import_i18n170.__)( 46999 "The <a>Link Relation</a> attribute defines the relationship between a linked resource and the current document." 47000 ), 47001 { 47002 a: /* @__PURE__ */ (0, import_jsx_runtime355.jsx)(import_components107.ExternalLink, { href: "https://developer.mozilla.org/docs/Web/HTML/Attributes/rel" }) 47003 } 47004 ), 47005 value: rel, 47006 onChange: (newRel) => setAttributes({ rel: newRel }) 47007 } 47008 ) 47009 } 47010 ) 47011 ] }) 47012 ] 47013 } 47014 ) }) 47015 ] }), 47016 titleElement 47017 ] }); 47018 } 47019 47020 // packages/block-library/build-module/post-title/deprecated.js 47021 var v121 = { 47022 attributes: { 47023 textAlign: { 47024 type: "string" 47025 }, 47026 level: { 47027 type: "number", 47028 default: 2 47029 }, 47030 isLink: { 47031 type: "boolean", 47032 default: false 47033 }, 47034 rel: { 47035 type: "string", 47036 attribute: "rel", 47037 default: "" 47038 }, 47039 linkTarget: { 47040 type: "string", 47041 default: "_self" 47042 } 47043 }, 47044 supports: { 47045 align: ["wide", "full"], 47046 html: false, 47047 color: { 47048 gradients: true, 47049 link: true 47050 }, 47051 spacing: { 47052 margin: true 47053 }, 47054 typography: { 47055 fontSize: true, 47056 lineHeight: true, 47057 __experimentalFontFamily: true, 47058 __experimentalFontWeight: true, 47059 __experimentalFontStyle: true, 47060 __experimentalTextTransform: true 47061 } 47062 }, 47063 save() { 47064 return null; 47065 }, 47066 migrate: migrate_font_family_default, 47067 isEligible({ style: style2 }) { 47068 return style2?.typography?.fontFamily; 47069 } 47070 }; 47071 var deprecated_default28 = [v121]; 47072 47073 // packages/block-library/build-module/post-title/index.js 47074 var { name: name78 } = block_default77; 47075 var settings77 = { 47076 icon: title_default, 47077 edit: PostTitleEdit, 47078 deprecated: deprecated_default28 47079 }; 47080 var init77 = () => initBlock({ name: name78, metadata: block_default77, settings: settings77 }); 47081 47082 // packages/block-library/build-module/preformatted/index.js 47083 var preformatted_exports = {}; 47084 __export(preformatted_exports, { 47085 init: () => init78, 47086 metadata: () => block_default78, 47087 name: () => name79, 47088 settings: () => settings78 47089 }); 47090 var import_i18n172 = __toESM(require_i18n()); 47091 var import_blocks86 = __toESM(require_blocks()); 47092 47093 // packages/block-library/build-module/preformatted/edit.js 47094 var import_i18n171 = __toESM(require_i18n()); 47095 var import_block_editor192 = __toESM(require_block_editor()); 47096 var import_blocks84 = __toESM(require_blocks()); 47097 var import_jsx_runtime356 = __toESM(require_jsx_runtime()); 47098 function PreformattedEdit({ 47099 attributes: attributes3, 47100 mergeBlocks, 47101 setAttributes, 47102 onRemove, 47103 insertBlocksAfter, 47104 style: style2 47105 }) { 47106 const { content } = attributes3; 47107 const blockProps = (0, import_block_editor192.useBlockProps)({ style: style2 }); 47108 return /* @__PURE__ */ (0, import_jsx_runtime356.jsx)( 47109 import_block_editor192.RichText, 47110 { 47111 tagName: "pre", 47112 identifier: "content", 47113 preserveWhiteSpace: true, 47114 value: content, 47115 onChange: (nextContent) => { 47116 setAttributes({ 47117 content: nextContent 47118 }); 47119 }, 47120 onRemove, 47121 "aria-label": (0, import_i18n171.__)("Preformatted text"), 47122 placeholder: (0, import_i18n171.__)("Write preformatted text\u2026"), 47123 onMerge: mergeBlocks, 47124 ...blockProps, 47125 __unstablePastePlainText: true, 47126 __unstableOnSplitAtDoubleLineEnd: () => insertBlocksAfter((0, import_blocks84.createBlock)((0, import_blocks84.getDefaultBlockName)())) 47127 } 47128 ); 47129 } 47130 47131 // packages/block-library/build-module/preformatted/block.json 47132 var block_default78 = { 47133 $schema: "https://schemas.wp.org/trunk/block.json", 47134 apiVersion: 3, 47135 name: "core/preformatted", 47136 title: "Preformatted", 47137 category: "text", 47138 description: "Add text that respects your spacing and tabs, and also allows styling.", 47139 textdomain: "default", 47140 attributes: { 47141 content: { 47142 type: "rich-text", 47143 source: "rich-text", 47144 selector: "pre", 47145 __unstablePreserveWhiteSpace: true, 47146 role: "content" 47147 } 47148 }, 47149 supports: { 47150 anchor: true, 47151 color: { 47152 gradients: true, 47153 __experimentalDefaultControls: { 47154 background: true, 47155 text: true 47156 } 47157 }, 47158 spacing: { 47159 padding: true, 47160 margin: true 47161 }, 47162 typography: { 47163 fontSize: true, 47164 lineHeight: true, 47165 __experimentalFontFamily: true, 47166 __experimentalFontWeight: true, 47167 __experimentalFontStyle: true, 47168 __experimentalTextTransform: true, 47169 __experimentalTextDecoration: true, 47170 __experimentalLetterSpacing: true, 47171 __experimentalDefaultControls: { 47172 fontSize: true 47173 } 47174 }, 47175 interactivity: { 47176 clientNavigation: true 47177 }, 47178 __experimentalBorder: { 47179 radius: true, 47180 color: true, 47181 width: true, 47182 style: true, 47183 __experimentalDefaultControls: { 47184 radius: true, 47185 color: true, 47186 width: true, 47187 style: true 47188 } 47189 } 47190 }, 47191 style: "wp-block-preformatted" 47192 }; 47193 47194 // packages/block-library/build-module/preformatted/save.js 47195 var import_block_editor193 = __toESM(require_block_editor()); 47196 var import_jsx_runtime357 = __toESM(require_jsx_runtime()); 47197 function save39({ attributes: attributes3 }) { 47198 const { content } = attributes3; 47199 return /* @__PURE__ */ (0, import_jsx_runtime357.jsx)("pre", { ...import_block_editor193.useBlockProps.save(), children: /* @__PURE__ */ (0, import_jsx_runtime357.jsx)(import_block_editor193.RichText.Content, { value: content }) }); 47200 } 47201 47202 // packages/block-library/build-module/preformatted/transforms.js 47203 var import_blocks85 = __toESM(require_blocks()); 47204 var transforms26 = { 47205 from: [ 47206 { 47207 type: "block", 47208 blocks: ["core/code", "core/paragraph", "core/verse"], 47209 transform: ({ content, anchor }) => (0, import_blocks85.createBlock)("core/preformatted", { 47210 content, 47211 anchor 47212 }) 47213 }, 47214 { 47215 type: "raw", 47216 isMatch: (node) => node.nodeName === "PRE" && !(node.children.length === 1 && node.firstChild.nodeName === "CODE"), 47217 schema: ({ phrasingContentSchema }) => ({ 47218 pre: { 47219 children: phrasingContentSchema 47220 } 47221 }) 47222 } 47223 ], 47224 to: [ 47225 { 47226 type: "block", 47227 blocks: ["core/paragraph"], 47228 transform: (attributes3) => (0, import_blocks85.createBlock)("core/paragraph", attributes3) 47229 }, 47230 { 47231 type: "block", 47232 blocks: ["core/code"], 47233 transform: (attributes3) => (0, import_blocks85.createBlock)("core/code", attributes3) 47234 }, 47235 { 47236 type: "block", 47237 blocks: ["core/verse"], 47238 transform: (attributes3) => (0, import_blocks85.createBlock)("core/verse", attributes3) 47239 } 47240 ] 47241 }; 47242 var transforms_default27 = transforms26; 47243 47244 // packages/block-library/build-module/preformatted/index.js 47245 var { fieldsKey: fieldsKey15, formKey: formKey15 } = unlock(import_blocks86.privateApis); 47246 var { name: name79 } = block_default78; 47247 var settings78 = { 47248 icon: preformatted_default, 47249 example: { 47250 attributes: { 47251 /* eslint-disable @wordpress/i18n-no-collapsible-whitespace */ 47252 // translators: Sample content for the Preformatted block. Can be replaced with a more locale-adequate work. 47253 content: (0, import_i18n172.__)( 47254 "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;" 47255 ) 47256 /* eslint-enable @wordpress/i18n-no-collapsible-whitespace */ 47257 } 47258 }, 47259 transforms: transforms_default27, 47260 edit: PreformattedEdit, 47261 save: save39, 47262 merge(attributes3, attributesToMerge) { 47263 return { 47264 content: attributes3.content + "\n\n" + attributesToMerge.content 47265 }; 47266 } 47267 }; 47268 if (window.__experimentalContentOnlyInspectorFields) { 47269 settings78[fieldsKey15] = [ 47270 { 47271 id: "content", 47272 label: (0, import_i18n172.__)("Content"), 47273 type: "richtext" 47274 } 47275 ]; 47276 settings78[formKey15] = { 47277 fields: ["content"] 47278 }; 47279 } 47280 var init78 = () => initBlock({ name: name79, metadata: block_default78, settings: settings78 }); 47281 47282 // packages/block-library/build-module/pullquote/index.js 47283 var pullquote_exports = {}; 47284 __export(pullquote_exports, { 47285 init: () => init79, 47286 metadata: () => block_default79, 47287 name: () => name80, 47288 settings: () => settings79 47289 }); 47290 var import_i18n174 = __toESM(require_i18n()); 47291 var import_blocks89 = __toESM(require_blocks()); 47292 47293 // packages/block-library/build-module/pullquote/deprecated.js 47294 var import_block_editor194 = __toESM(require_block_editor()); 47295 var import_data101 = __toESM(require_data()); 47296 47297 // packages/block-library/build-module/pullquote/shared.js 47298 var SOLID_COLOR_CLASS = `is-style-solid-color`; 47299 47300 // packages/block-library/build-module/pullquote/deprecated.js 47301 var import_jsx_runtime358 = __toESM(require_jsx_runtime()); 47302 var blockAttributes6 = { 47303 value: { 47304 type: "string", 47305 source: "html", 47306 selector: "blockquote", 47307 multiline: "p" 47308 }, 47309 citation: { 47310 type: "string", 47311 source: "html", 47312 selector: "cite", 47313 default: "" 47314 }, 47315 mainColor: { 47316 type: "string" 47317 }, 47318 customMainColor: { 47319 type: "string" 47320 }, 47321 textColor: { 47322 type: "string" 47323 }, 47324 customTextColor: { 47325 type: "string" 47326 } 47327 }; 47328 function parseBorderColor(styleString) { 47329 if (!styleString) { 47330 return; 47331 } 47332 const matches = styleString.match(/border-color:([^;]+)[;]?/); 47333 if (matches && matches[1]) { 47334 return matches[1]; 47335 } 47336 } 47337 function multilineToInline(value) { 47338 value = value || `<p></p>`; 47339 const padded = `</p>$value}<p>`; 47340 const values = padded.split(`</p><p>`); 47341 values.shift(); 47342 values.pop(); 47343 return values.join("<br>"); 47344 } 47345 var v57 = { 47346 attributes: { 47347 value: { 47348 type: "string", 47349 source: "html", 47350 selector: "blockquote", 47351 multiline: "p", 47352 role: "content" 47353 }, 47354 citation: { 47355 type: "string", 47356 source: "html", 47357 selector: "cite", 47358 default: "", 47359 role: "content" 47360 }, 47361 textAlign: { 47362 type: "string" 47363 } 47364 }, 47365 save({ attributes: attributes3 }) { 47366 const { textAlign, citation, value } = attributes3; 47367 const shouldShowCitation = !import_block_editor194.RichText.isEmpty(citation); 47368 return /* @__PURE__ */ (0, import_jsx_runtime358.jsx)( 47369 "figure", 47370 { 47371 ...import_block_editor194.useBlockProps.save({ 47372 className: clsx_default({ 47373 [`has-text-align-$textAlign}`]: textAlign 47374 }) 47375 }), 47376 children: /* @__PURE__ */ (0, import_jsx_runtime358.jsxs)("blockquote", { children: [ 47377 /* @__PURE__ */ (0, import_jsx_runtime358.jsx)(import_block_editor194.RichText.Content, { value, multiline: true }), 47378 shouldShowCitation && /* @__PURE__ */ (0, import_jsx_runtime358.jsx)(import_block_editor194.RichText.Content, { tagName: "cite", value: citation }) 47379 ] }) 47380 } 47381 ); 47382 }, 47383 migrate({ value, ...attributes3 }) { 47384 return { 47385 value: multilineToInline(value), 47386 ...attributes3 47387 }; 47388 } 47389 }; 47390 var v47 = { 47391 attributes: { 47392 ...blockAttributes6 47393 }, 47394 save({ attributes: attributes3 }) { 47395 const { 47396 mainColor, 47397 customMainColor, 47398 customTextColor, 47399 textColor, 47400 value, 47401 citation, 47402 className 47403 } = attributes3; 47404 const isSolidColorStyle = className?.includes(SOLID_COLOR_CLASS); 47405 let figureClasses, figureStyles; 47406 if (isSolidColorStyle) { 47407 const backgroundClass = (0, import_block_editor194.getColorClassName)( 47408 "background-color", 47409 mainColor 47410 ); 47411 figureClasses = clsx_default({ 47412 "has-background": backgroundClass || customMainColor, 47413 [backgroundClass]: backgroundClass 47414 }); 47415 figureStyles = { 47416 backgroundColor: backgroundClass ? void 0 : customMainColor 47417 }; 47418 } else if (customMainColor) { 47419 figureStyles = { 47420 borderColor: customMainColor 47421 }; 47422 } 47423 const blockquoteTextColorClass = (0, import_block_editor194.getColorClassName)( 47424 "color", 47425 textColor 47426 ); 47427 const blockquoteClasses = clsx_default({ 47428 "has-text-color": textColor || customTextColor, 47429 [blockquoteTextColorClass]: blockquoteTextColorClass 47430 }); 47431 const blockquoteStyles = blockquoteTextColorClass ? void 0 : { color: customTextColor }; 47432 return /* @__PURE__ */ (0, import_jsx_runtime358.jsx)( 47433 "figure", 47434 { 47435 ...import_block_editor194.useBlockProps.save({ 47436 className: figureClasses, 47437 style: figureStyles 47438 }), 47439 children: /* @__PURE__ */ (0, import_jsx_runtime358.jsxs)( 47440 "blockquote", 47441 { 47442 className: blockquoteClasses, 47443 style: blockquoteStyles, 47444 children: [ 47445 /* @__PURE__ */ (0, import_jsx_runtime358.jsx)(import_block_editor194.RichText.Content, { value, multiline: true }), 47446 !import_block_editor194.RichText.isEmpty(citation) && /* @__PURE__ */ (0, import_jsx_runtime358.jsx)(import_block_editor194.RichText.Content, { tagName: "cite", value: citation }) 47447 ] 47448 } 47449 ) 47450 } 47451 ); 47452 }, 47453 migrate({ 47454 value, 47455 className, 47456 mainColor, 47457 customMainColor, 47458 customTextColor, 47459 ...attributes3 47460 }) { 47461 const isSolidColorStyle = className?.includes(SOLID_COLOR_CLASS); 47462 let style2; 47463 if (customMainColor) { 47464 if (!isSolidColorStyle) { 47465 style2 = { 47466 border: { 47467 color: customMainColor 47468 } 47469 }; 47470 } else { 47471 style2 = { 47472 color: { 47473 background: customMainColor 47474 } 47475 }; 47476 } 47477 } 47478 if (customTextColor && style2) { 47479 style2.color = { 47480 ...style2.color, 47481 text: customTextColor 47482 }; 47483 } 47484 return { 47485 value: multilineToInline(value), 47486 className, 47487 backgroundColor: isSolidColorStyle ? mainColor : void 0, 47488 borderColor: isSolidColorStyle ? void 0 : mainColor, 47489 textAlign: isSolidColorStyle ? "left" : void 0, 47490 style: style2, 47491 ...attributes3 47492 }; 47493 } 47494 }; 47495 var v39 = { 47496 attributes: { 47497 ...blockAttributes6, 47498 // figureStyle is an attribute that never existed. 47499 // We are using it as a way to access the styles previously applied to the figure. 47500 figureStyle: { 47501 source: "attribute", 47502 selector: "figure", 47503 attribute: "style" 47504 } 47505 }, 47506 save({ attributes: attributes3 }) { 47507 const { 47508 mainColor, 47509 customMainColor, 47510 textColor, 47511 customTextColor, 47512 value, 47513 citation, 47514 className, 47515 figureStyle 47516 } = attributes3; 47517 const isSolidColorStyle = className?.includes(SOLID_COLOR_CLASS); 47518 let figureClasses, figureStyles; 47519 if (isSolidColorStyle) { 47520 const backgroundClass = (0, import_block_editor194.getColorClassName)( 47521 "background-color", 47522 mainColor 47523 ); 47524 figureClasses = clsx_default({ 47525 "has-background": backgroundClass || customMainColor, 47526 [backgroundClass]: backgroundClass 47527 }); 47528 figureStyles = { 47529 backgroundColor: backgroundClass ? void 0 : customMainColor 47530 }; 47531 } else if (customMainColor) { 47532 figureStyles = { 47533 borderColor: customMainColor 47534 }; 47535 } else if (mainColor) { 47536 const borderColor = parseBorderColor(figureStyle); 47537 figureStyles = { 47538 borderColor 47539 }; 47540 } 47541 const blockquoteTextColorClass = (0, import_block_editor194.getColorClassName)( 47542 "color", 47543 textColor 47544 ); 47545 const blockquoteClasses = (textColor || customTextColor) && clsx_default("has-text-color", { 47546 [blockquoteTextColorClass]: blockquoteTextColorClass 47547 }); 47548 const blockquoteStyles = blockquoteTextColorClass ? void 0 : { color: customTextColor }; 47549 return /* @__PURE__ */ (0, import_jsx_runtime358.jsx)("figure", { className: figureClasses, style: figureStyles, children: /* @__PURE__ */ (0, import_jsx_runtime358.jsxs)( 47550 "blockquote", 47551 { 47552 className: blockquoteClasses, 47553 style: blockquoteStyles, 47554 children: [ 47555 /* @__PURE__ */ (0, import_jsx_runtime358.jsx)(import_block_editor194.RichText.Content, { value, multiline: true }), 47556 !import_block_editor194.RichText.isEmpty(citation) && /* @__PURE__ */ (0, import_jsx_runtime358.jsx)(import_block_editor194.RichText.Content, { tagName: "cite", value: citation }) 47557 ] 47558 } 47559 ) }); 47560 }, 47561 migrate({ 47562 value, 47563 className, 47564 figureStyle, 47565 mainColor, 47566 customMainColor, 47567 customTextColor, 47568 ...attributes3 47569 }) { 47570 const isSolidColorStyle = className?.includes(SOLID_COLOR_CLASS); 47571 let style2; 47572 if (customMainColor) { 47573 if (!isSolidColorStyle) { 47574 style2 = { 47575 border: { 47576 color: customMainColor 47577 } 47578 }; 47579 } else { 47580 style2 = { 47581 color: { 47582 background: customMainColor 47583 } 47584 }; 47585 } 47586 } 47587 if (customTextColor && style2) { 47588 style2.color = { 47589 ...style2.color, 47590 text: customTextColor 47591 }; 47592 } 47593 if (!isSolidColorStyle && mainColor && figureStyle) { 47594 const borderColor = parseBorderColor(figureStyle); 47595 if (borderColor) { 47596 return { 47597 value: multilineToInline(value), 47598 ...attributes3, 47599 className, 47600 // Block supports: Set style.border.color if a deprecated block has `mainColor`, inline border CSS and is not a solid color style. 47601 style: { 47602 border: { 47603 color: borderColor 47604 } 47605 } 47606 }; 47607 } 47608 } 47609 return { 47610 value: multilineToInline(value), 47611 className, 47612 backgroundColor: isSolidColorStyle ? mainColor : void 0, 47613 borderColor: isSolidColorStyle ? void 0 : mainColor, 47614 textAlign: isSolidColorStyle ? "left" : void 0, 47615 style: style2, 47616 ...attributes3 47617 }; 47618 } 47619 }; 47620 var v211 = { 47621 attributes: blockAttributes6, 47622 save({ attributes: attributes3 }) { 47623 const { 47624 mainColor, 47625 customMainColor, 47626 textColor, 47627 customTextColor, 47628 value, 47629 citation, 47630 className 47631 } = attributes3; 47632 const isSolidColorStyle = className?.includes(SOLID_COLOR_CLASS); 47633 let figureClass, figureStyles; 47634 if (isSolidColorStyle) { 47635 figureClass = (0, import_block_editor194.getColorClassName)("background-color", mainColor); 47636 if (!figureClass) { 47637 figureStyles = { 47638 backgroundColor: customMainColor 47639 }; 47640 } 47641 } else if (customMainColor) { 47642 figureStyles = { 47643 borderColor: customMainColor 47644 }; 47645 } else if (mainColor) { 47646 const colors = (0, import_data101.select)(import_block_editor194.store).getSettings().colors ?? []; 47647 const colorObject = (0, import_block_editor194.getColorObjectByAttributeValues)( 47648 colors, 47649 mainColor 47650 ); 47651 figureStyles = { 47652 borderColor: colorObject.color 47653 }; 47654 } 47655 const blockquoteTextColorClass = (0, import_block_editor194.getColorClassName)( 47656 "color", 47657 textColor 47658 ); 47659 const blockquoteClasses = textColor || customTextColor ? clsx_default("has-text-color", { 47660 [blockquoteTextColorClass]: blockquoteTextColorClass 47661 }) : void 0; 47662 const blockquoteStyle = blockquoteTextColorClass ? void 0 : { color: customTextColor }; 47663 return /* @__PURE__ */ (0, import_jsx_runtime358.jsx)("figure", { className: figureClass, style: figureStyles, children: /* @__PURE__ */ (0, import_jsx_runtime358.jsxs)( 47664 "blockquote", 47665 { 47666 className: blockquoteClasses, 47667 style: blockquoteStyle, 47668 children: [ 47669 /* @__PURE__ */ (0, import_jsx_runtime358.jsx)(import_block_editor194.RichText.Content, { value, multiline: true }), 47670 !import_block_editor194.RichText.isEmpty(citation) && /* @__PURE__ */ (0, import_jsx_runtime358.jsx)(import_block_editor194.RichText.Content, { tagName: "cite", value: citation }) 47671 ] 47672 } 47673 ) }); 47674 }, 47675 migrate({ 47676 value, 47677 className, 47678 mainColor, 47679 customMainColor, 47680 customTextColor, 47681 ...attributes3 47682 }) { 47683 const isSolidColorStyle = className?.includes(SOLID_COLOR_CLASS); 47684 let style2 = {}; 47685 if (customMainColor) { 47686 if (!isSolidColorStyle) { 47687 style2 = { 47688 border: { 47689 color: customMainColor 47690 } 47691 }; 47692 } else { 47693 style2 = { 47694 color: { 47695 background: customMainColor 47696 } 47697 }; 47698 } 47699 } 47700 if (customTextColor && style2) { 47701 style2.color = { 47702 ...style2.color, 47703 text: customTextColor 47704 }; 47705 } 47706 return { 47707 value: multilineToInline(value), 47708 className, 47709 backgroundColor: isSolidColorStyle ? mainColor : void 0, 47710 borderColor: isSolidColorStyle ? void 0 : mainColor, 47711 textAlign: isSolidColorStyle ? "left" : void 0, 47712 style: style2, 47713 ...attributes3 47714 }; 47715 } 47716 }; 47717 var v123 = { 47718 attributes: { 47719 ...blockAttributes6 47720 }, 47721 save({ attributes: attributes3 }) { 47722 const { value, citation } = attributes3; 47723 return /* @__PURE__ */ (0, import_jsx_runtime358.jsxs)("blockquote", { children: [ 47724 /* @__PURE__ */ (0, import_jsx_runtime358.jsx)(import_block_editor194.RichText.Content, { value, multiline: true }), 47725 !import_block_editor194.RichText.isEmpty(citation) && /* @__PURE__ */ (0, import_jsx_runtime358.jsx)(import_block_editor194.RichText.Content, { tagName: "cite", value: citation }) 47726 ] }); 47727 }, 47728 migrate({ value, ...attributes3 }) { 47729 return { 47730 value: multilineToInline(value), 47731 ...attributes3 47732 }; 47733 } 47734 }; 47735 var v02 = { 47736 attributes: { 47737 ...blockAttributes6, 47738 citation: { 47739 type: "string", 47740 source: "html", 47741 selector: "footer" 47742 }, 47743 align: { 47744 type: "string", 47745 default: "none" 47746 } 47747 }, 47748 save({ attributes: attributes3 }) { 47749 const { value, citation, align } = attributes3; 47750 return /* @__PURE__ */ (0, import_jsx_runtime358.jsxs)("blockquote", { className: `align$align}`, children: [ 47751 /* @__PURE__ */ (0, import_jsx_runtime358.jsx)(import_block_editor194.RichText.Content, { value, multiline: true }), 47752 !import_block_editor194.RichText.isEmpty(citation) && /* @__PURE__ */ (0, import_jsx_runtime358.jsx)(import_block_editor194.RichText.Content, { tagName: "footer", value: citation }) 47753 ] }); 47754 }, 47755 migrate({ value, ...attributes3 }) { 47756 return { 47757 value: multilineToInline(value), 47758 ...attributes3 47759 }; 47760 } 47761 }; 47762 var deprecated_default29 = [v57, v47, v39, v211, v123, v02]; 47763 47764 // packages/block-library/build-module/pullquote/edit.js 47765 var import_i18n173 = __toESM(require_i18n()); 47766 var import_block_editor195 = __toESM(require_block_editor()); 47767 var import_blocks87 = __toESM(require_blocks()); 47768 var import_element95 = __toESM(require_element()); 47769 47770 // packages/block-library/build-module/pullquote/figure.js 47771 var Figure = "figure"; 47772 47773 // packages/block-library/build-module/pullquote/blockquote.js 47774 var BlockQuote = "blockquote"; 47775 47776 // packages/block-library/build-module/pullquote/edit.js 47777 var import_jsx_runtime359 = __toESM(require_jsx_runtime()); 47778 var isWebPlatform = import_element95.Platform.OS === "web"; 47779 function PullQuoteEdit({ 47780 attributes: attributes3, 47781 setAttributes, 47782 isSelected, 47783 insertBlocksAfter 47784 }) { 47785 const { textAlign, citation, value } = attributes3; 47786 const blockProps = (0, import_block_editor195.useBlockProps)({ 47787 className: clsx_default({ 47788 [`has-text-align-$textAlign}`]: textAlign 47789 }) 47790 }); 47791 const shouldShowCitation = !import_block_editor195.RichText.isEmpty(citation) || isSelected; 47792 return /* @__PURE__ */ (0, import_jsx_runtime359.jsxs)(import_jsx_runtime359.Fragment, { children: [ 47793 /* @__PURE__ */ (0, import_jsx_runtime359.jsx)(import_block_editor195.BlockControls, { group: "block", children: /* @__PURE__ */ (0, import_jsx_runtime359.jsx)( 47794 import_block_editor195.AlignmentControl, 47795 { 47796 value: textAlign, 47797 onChange: (nextAlign) => { 47798 setAttributes({ textAlign: nextAlign }); 47799 } 47800 } 47801 ) }), 47802 /* @__PURE__ */ (0, import_jsx_runtime359.jsx)(Figure, { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime359.jsxs)(BlockQuote, { children: [ 47803 /* @__PURE__ */ (0, import_jsx_runtime359.jsx)( 47804 import_block_editor195.RichText, 47805 { 47806 identifier: "value", 47807 tagName: "p", 47808 value, 47809 onChange: (nextValue) => setAttributes({ 47810 value: nextValue 47811 }), 47812 "aria-label": (0, import_i18n173.__)("Pullquote text"), 47813 placeholder: ( 47814 // translators: placeholder text used for the quote 47815 (0, import_i18n173.__)("Add quote") 47816 ), 47817 textAlign: "center" 47818 } 47819 ), 47820 shouldShowCitation && /* @__PURE__ */ (0, import_jsx_runtime359.jsx)( 47821 import_block_editor195.RichText, 47822 { 47823 identifier: "citation", 47824 tagName: isWebPlatform ? "cite" : void 0, 47825 style: { display: "block" }, 47826 value: citation, 47827 "aria-label": (0, import_i18n173.__)("Pullquote citation text"), 47828 placeholder: ( 47829 // translators: placeholder text used for the citation 47830 (0, import_i18n173.__)("Add citation") 47831 ), 47832 onChange: (nextCitation) => setAttributes({ 47833 citation: nextCitation 47834 }), 47835 className: "wp-block-pullquote__citation", 47836 __unstableMobileNoFocusOnMount: true, 47837 textAlign: "center", 47838 __unstableOnSplitAtEnd: () => insertBlocksAfter( 47839 (0, import_blocks87.createBlock)((0, import_blocks87.getDefaultBlockName)()) 47840 ) 47841 } 47842 ) 47843 ] }) }) 47844 ] }); 47845 } 47846 var edit_default27 = PullQuoteEdit; 47847 47848 // packages/block-library/build-module/pullquote/block.json 47849 var block_default79 = { 47850 $schema: "https://schemas.wp.org/trunk/block.json", 47851 apiVersion: 3, 47852 name: "core/pullquote", 47853 title: "Pullquote (deprecated)", 47854 category: "text", 47855 description: "This block is deprecated. Please use the Quote block instead.", 47856 textdomain: "default", 47857 attributes: { 47858 value: { 47859 type: "rich-text", 47860 source: "rich-text", 47861 selector: "p", 47862 role: "content" 47863 }, 47864 citation: { 47865 type: "rich-text", 47866 source: "rich-text", 47867 selector: "cite", 47868 role: "content" 47869 }, 47870 textAlign: { 47871 type: "string" 47872 } 47873 }, 47874 supports: { 47875 anchor: true, 47876 align: ["left", "right", "wide", "full"], 47877 background: { 47878 backgroundImage: true, 47879 backgroundSize: true, 47880 __experimentalDefaultControls: { 47881 backgroundImage: true 47882 } 47883 }, 47884 color: { 47885 gradients: true, 47886 background: true, 47887 link: true, 47888 __experimentalDefaultControls: { 47889 background: true, 47890 text: true 47891 } 47892 }, 47893 dimensions: { 47894 minHeight: true, 47895 __experimentalDefaultControls: { 47896 minHeight: false 47897 } 47898 }, 47899 inserter: false, 47900 spacing: { 47901 margin: true, 47902 padding: true 47903 }, 47904 typography: { 47905 fontSize: true, 47906 lineHeight: true, 47907 __experimentalFontFamily: true, 47908 __experimentalFontWeight: true, 47909 __experimentalFontStyle: true, 47910 __experimentalTextTransform: true, 47911 __experimentalTextDecoration: true, 47912 __experimentalLetterSpacing: true, 47913 __experimentalDefaultControls: { 47914 fontSize: true 47915 } 47916 }, 47917 __experimentalBorder: { 47918 color: true, 47919 radius: true, 47920 style: true, 47921 width: true, 47922 __experimentalDefaultControls: { 47923 color: true, 47924 radius: true, 47925 style: true, 47926 width: true 47927 } 47928 }, 47929 __experimentalStyle: { 47930 typography: { 47931 fontSize: "1.5em", 47932 lineHeight: "1.6" 47933 } 47934 }, 47935 interactivity: { 47936 clientNavigation: true 47937 } 47938 }, 47939 editorStyle: "wp-block-pullquote-editor", 47940 style: "wp-block-pullquote" 47941 }; 47942 47943 // packages/block-library/build-module/pullquote/save.js 47944 var import_block_editor196 = __toESM(require_block_editor()); 47945 var import_jsx_runtime360 = __toESM(require_jsx_runtime()); 47946 function save40({ attributes: attributes3 }) { 47947 const { textAlign, citation, value } = attributes3; 47948 const shouldShowCitation = !import_block_editor196.RichText.isEmpty(citation); 47949 return /* @__PURE__ */ (0, import_jsx_runtime360.jsx)( 47950 "figure", 47951 { 47952 ...import_block_editor196.useBlockProps.save({ 47953 className: clsx_default({ 47954 [`has-text-align-$textAlign}`]: textAlign 47955 }) 47956 }), 47957 children: /* @__PURE__ */ (0, import_jsx_runtime360.jsxs)("blockquote", { children: [ 47958 /* @__PURE__ */ (0, import_jsx_runtime360.jsx)(import_block_editor196.RichText.Content, { tagName: "p", value }), 47959 shouldShowCitation && /* @__PURE__ */ (0, import_jsx_runtime360.jsx)(import_block_editor196.RichText.Content, { tagName: "cite", value: citation }) 47960 ] }) 47961 } 47962 ); 47963 } 47964 47965 // packages/block-library/build-module/pullquote/transforms.js 47966 var import_blocks88 = __toESM(require_blocks()); 47967 var transforms27 = { 47968 to: [ 47969 { 47970 type: "block", 47971 blocks: ["core/paragraph"], 47972 transform: ({ value, citation }) => { 47973 const paragraphs = []; 47974 if (value) { 47975 paragraphs.push( 47976 (0, import_blocks88.createBlock)("core/paragraph", { 47977 content: value 47978 }) 47979 ); 47980 } 47981 if (citation) { 47982 paragraphs.push( 47983 (0, import_blocks88.createBlock)("core/paragraph", { 47984 content: citation 47985 }) 47986 ); 47987 } 47988 if (paragraphs.length === 0) { 47989 return (0, import_blocks88.createBlock)("core/paragraph", { 47990 content: "" 47991 }); 47992 } 47993 return paragraphs; 47994 } 47995 }, 47996 { 47997 type: "block", 47998 blocks: ["core/heading"], 47999 transform: ({ value, citation }) => { 48000 if (!value) { 48001 return (0, import_blocks88.createBlock)("core/heading", { 48002 content: citation 48003 }); 48004 } 48005 const headingBlock = (0, import_blocks88.createBlock)("core/heading", { 48006 content: value 48007 }); 48008 if (!citation) { 48009 return headingBlock; 48010 } 48011 return [ 48012 headingBlock, 48013 (0, import_blocks88.createBlock)("core/heading", { 48014 content: citation 48015 }) 48016 ]; 48017 } 48018 } 48019 ] 48020 }; 48021 var transforms_default28 = transforms27; 48022 48023 // packages/block-library/build-module/pullquote/index.js 48024 var { fieldsKey: fieldsKey16, formKey: formKey16 } = unlock(import_blocks89.privateApis); 48025 var { name: name80 } = block_default79; 48026 var settings79 = { 48027 icon: pullquote_default, 48028 example: { 48029 attributes: { 48030 value: ( 48031 // translators: Quote serving as example for the Pullquote block. Attributed to Matt Mullenweg. 48032 (0, import_i18n174.__)( 48033 "One of the hardest things to do in technology is disrupt yourself." 48034 ) 48035 ), 48036 citation: (0, import_i18n174.__)("Matt Mullenweg") 48037 } 48038 }, 48039 transforms: transforms_default28, 48040 edit: edit_default27, 48041 save: save40, 48042 deprecated: deprecated_default29 48043 }; 48044 if (window.__experimentalContentOnlyInspectorFields) { 48045 settings79[fieldsKey16] = [ 48046 { 48047 id: "value", 48048 label: (0, import_i18n174.__)("Content"), 48049 type: "richtext" 48050 }, 48051 { 48052 id: "citation", 48053 label: (0, import_i18n174.__)("Citation"), 48054 type: "richtext" 48055 } 48056 ]; 48057 settings79[formKey16] = { 48058 fields: ["value"] 48059 }; 48060 } 48061 var init79 = () => initBlock({ name: name80, metadata: block_default79, settings: settings79 }); 48062 48063 // packages/block-library/build-module/query/index.js 48064 var query_exports = {}; 48065 __export(query_exports, { 48066 init: () => init80, 48067 metadata: () => block_default80, 48068 name: () => name81, 48069 settings: () => settings80 48070 }); 48071 48072 // packages/block-library/build-module/query/block.json 48073 var block_default80 = { 48074 $schema: "https://schemas.wp.org/trunk/block.json", 48075 apiVersion: 3, 48076 name: "core/query", 48077 title: "Query Loop", 48078 category: "theme", 48079 description: "An advanced block that allows displaying post types based on different query parameters and visual configurations.", 48080 keywords: ["posts", "list", "blog", "blogs", "custom post types"], 48081 textdomain: "default", 48082 attributes: { 48083 queryId: { 48084 type: "number" 48085 }, 48086 query: { 48087 type: "object", 48088 default: { 48089 perPage: null, 48090 pages: 0, 48091 offset: 0, 48092 postType: "post", 48093 order: "desc", 48094 orderBy: "date", 48095 author: "", 48096 search: "", 48097 exclude: [], 48098 sticky: "", 48099 inherit: true, 48100 taxQuery: null, 48101 parents: [], 48102 format: [] 48103 } 48104 }, 48105 tagName: { 48106 type: "string", 48107 default: "div" 48108 }, 48109 namespace: { 48110 type: "string" 48111 }, 48112 enhancedPagination: { 48113 type: "boolean", 48114 default: false 48115 } 48116 }, 48117 usesContext: ["templateSlug"], 48118 providesContext: { 48119 queryId: "queryId", 48120 query: "query", 48121 displayLayout: "displayLayout", 48122 enhancedPagination: "enhancedPagination" 48123 }, 48124 supports: { 48125 align: ["wide", "full"], 48126 html: false, 48127 layout: true, 48128 interactivity: true, 48129 contentRole: true 48130 }, 48131 editorStyle: "wp-block-query-editor" 48132 }; 48133 48134 // packages/block-library/build-module/query/edit/index.js 48135 var import_data111 = __toESM(require_data()); 48136 var import_element104 = __toESM(require_element()); 48137 var import_block_editor201 = __toESM(require_block_editor()); 48138 48139 // packages/block-library/build-module/query/edit/query-content.js 48140 var import_data109 = __toESM(require_data()); 48141 var import_compose43 = __toESM(require_compose()); 48142 var import_element102 = __toESM(require_element()); 48143 var import_block_editor199 = __toESM(require_block_editor()); 48144 var import_i18n190 = __toESM(require_i18n()); 48145 var import_core_data70 = __toESM(require_core_data()); 48146 48147 // packages/block-library/build-module/query/edit/inspector-controls/enhanced-pagination-control.js 48148 var import_components108 = __toESM(require_components()); 48149 var import_i18n176 = __toESM(require_i18n()); 48150 48151 // packages/block-library/build-module/query/utils.js 48152 var import_data102 = __toESM(require_data()); 48153 var import_element96 = __toESM(require_element()); 48154 var import_core_data64 = __toESM(require_core_data()); 48155 var import_block_editor197 = __toESM(require_block_editor()); 48156 var import_html_entities10 = __toESM(require_html_entities()); 48157 var import_i18n175 = __toESM(require_i18n()); 48158 var import_blocks90 = __toESM(require_blocks()); 48159 var getEntitiesInfo = (entities) => { 48160 const mapping = entities?.reduce( 48161 (accumulator, entity) => { 48162 const { mapById, mapByName, names } = accumulator; 48163 mapById[entity.id] = entity; 48164 mapByName[entity.name] = entity; 48165 names.push(entity.name); 48166 return accumulator; 48167 }, 48168 { mapById: {}, mapByName: {}, names: [] } 48169 ); 48170 return { 48171 entities, 48172 ...mapping 48173 }; 48174 }; 48175 var getValueFromObjectPath = (object, path) => { 48176 const normalizedPath = path.split("."); 48177 let value = object; 48178 normalizedPath.forEach((fieldName) => { 48179 value = value?.[fieldName]; 48180 }); 48181 return value; 48182 }; 48183 var mapToIHasNameAndId = (entities, path) => { 48184 return (entities || []).map((entity) => ({ 48185 ...entity, 48186 name: (0, import_html_entities10.decodeEntities)(getValueFromObjectPath(entity, path)) 48187 })); 48188 }; 48189 var usePostTypes = () => { 48190 const postTypes = (0, import_data102.useSelect)((select9) => { 48191 const { getPostTypes } = select9(import_core_data64.store); 48192 const excludedPostTypes = ["attachment"]; 48193 const filteredPostTypes = getPostTypes({ per_page: -1 })?.filter( 48194 ({ viewable, slug }) => viewable && !excludedPostTypes.includes(slug) 48195 ); 48196 return filteredPostTypes; 48197 }, []); 48198 const postTypesTaxonomiesMap = (0, import_element96.useMemo)(() => { 48199 if (!postTypes?.length) { 48200 return; 48201 } 48202 return postTypes.reduce((accumulator, type) => { 48203 accumulator[type.slug] = type.taxonomies; 48204 return accumulator; 48205 }, {}); 48206 }, [postTypes]); 48207 const postTypesSelectOptions = (0, import_element96.useMemo)( 48208 () => (postTypes || []).map(({ labels, slug }) => ({ 48209 label: labels.singular_name, 48210 value: slug 48211 })), 48212 [postTypes] 48213 ); 48214 const postTypeFormatSupportMap = (0, import_element96.useMemo)(() => { 48215 if (!postTypes?.length) { 48216 return {}; 48217 } 48218 return postTypes.reduce((accumulator, type) => { 48219 accumulator[type.slug] = type.supports?.["post-formats"] || false; 48220 return accumulator; 48221 }, {}); 48222 }, [postTypes]); 48223 return { 48224 postTypesTaxonomiesMap, 48225 postTypesSelectOptions, 48226 postTypeFormatSupportMap 48227 }; 48228 }; 48229 var useTaxonomies = (postType) => { 48230 const taxonomies = (0, import_data102.useSelect)( 48231 (select9) => { 48232 const { getTaxonomies, getPostType } = select9(import_core_data64.store); 48233 if (getPostType(postType)?.taxonomies?.length > 0) { 48234 return getTaxonomies({ 48235 type: postType, 48236 per_page: -1 48237 }); 48238 } 48239 return []; 48240 }, 48241 [postType] 48242 ); 48243 return (0, import_element96.useMemo)(() => { 48244 return taxonomies?.filter( 48245 ({ visibility }) => !!visibility?.publicly_queryable 48246 ); 48247 }, [taxonomies]); 48248 }; 48249 function useIsPostTypeHierarchical(postType) { 48250 return (0, import_data102.useSelect)( 48251 (select9) => { 48252 const type = select9(import_core_data64.store).getPostType(postType); 48253 return type?.viewable && type?.hierarchical; 48254 }, 48255 [postType] 48256 ); 48257 } 48258 function useOrderByOptions(postType) { 48259 const supportsCustomOrder = (0, import_data102.useSelect)( 48260 (select9) => { 48261 const type = select9(import_core_data64.store).getPostType(postType); 48262 return !!type?.supports?.["page-attributes"]; 48263 }, 48264 [postType] 48265 ); 48266 return (0, import_element96.useMemo)(() => { 48267 const orderByOptions = [ 48268 { 48269 label: (0, import_i18n175.__)("Newest to oldest"), 48270 value: "date/desc" 48271 }, 48272 { 48273 label: (0, import_i18n175.__)("Oldest to newest"), 48274 value: "date/asc" 48275 }, 48276 { 48277 /* translators: Label for ordering posts by title in ascending order. */ 48278 label: (0, import_i18n175.__)("A \u2192 Z"), 48279 value: "title/asc" 48280 }, 48281 { 48282 /* translators: Label for ordering posts by title in descending order. */ 48283 label: (0, import_i18n175.__)("Z \u2192 A"), 48284 value: "title/desc" 48285 } 48286 ]; 48287 if (supportsCustomOrder) { 48288 orderByOptions.push( 48289 { 48290 /* translators: Label for ordering posts by ascending menu order. */ 48291 label: (0, import_i18n175.__)("Ascending by order"), 48292 value: "menu_order/asc" 48293 }, 48294 { 48295 /* translators: Label for ordering posts by descending menu order. */ 48296 label: (0, import_i18n175.__)("Descending by order"), 48297 value: "menu_order/desc" 48298 } 48299 ); 48300 } 48301 return orderByOptions; 48302 }, [supportsCustomOrder]); 48303 } 48304 function useAllowedControls(attributes3) { 48305 return (0, import_data102.useSelect)( 48306 (select9) => select9(import_blocks90.store).getActiveBlockVariation( 48307 "core/query", 48308 attributes3 48309 )?.allowedControls, 48310 [attributes3] 48311 ); 48312 } 48313 function isControlAllowed(allowedControls, key) { 48314 if (!allowedControls) { 48315 return true; 48316 } 48317 return allowedControls.includes(key); 48318 } 48319 var getTransformedBlocksFromPattern = (blocks, queryBlockAttributes) => { 48320 const { 48321 query: { postType, inherit }, 48322 namespace 48323 } = queryBlockAttributes; 48324 const clonedBlocks = blocks.map((block) => (0, import_blocks90.cloneBlock)(block)); 48325 const queryClientIds = []; 48326 const blocksQueue = [...clonedBlocks]; 48327 while (blocksQueue.length > 0) { 48328 const block = blocksQueue.shift(); 48329 if (block.name === "core/query") { 48330 block.attributes.query = { 48331 ...block.attributes.query, 48332 postType, 48333 inherit 48334 }; 48335 if (namespace) { 48336 block.attributes.namespace = namespace; 48337 } 48338 queryClientIds.push(block.clientId); 48339 } 48340 block.innerBlocks?.forEach((innerBlock) => { 48341 blocksQueue.push(innerBlock); 48342 }); 48343 } 48344 return { newBlocks: clonedBlocks, queryClientIds }; 48345 }; 48346 function useBlockNameForPatterns(clientId, attributes3) { 48347 return (0, import_data102.useSelect)( 48348 (select9) => { 48349 const activeVariationName = select9( 48350 import_blocks90.store 48351 ).getActiveBlockVariation("core/query", attributes3)?.name; 48352 if (!activeVariationName) { 48353 return "core/query"; 48354 } 48355 const { getBlockRootClientId, getPatternsByBlockTypes } = select9(import_block_editor197.store); 48356 const rootClientId = getBlockRootClientId(clientId); 48357 const activePatterns = getPatternsByBlockTypes( 48358 `core/query/$activeVariationName}`, 48359 rootClientId 48360 ); 48361 return activePatterns.length > 0 ? `core/query/$activeVariationName}` : "core/query"; 48362 }, 48363 [clientId, attributes3] 48364 ); 48365 } 48366 function useScopedBlockVariations(attributes3) { 48367 const { activeVariationName, blockVariations } = (0, import_data102.useSelect)( 48368 (select9) => { 48369 const { getActiveBlockVariation, getBlockVariations: getBlockVariations3 } = select9(import_blocks90.store); 48370 return { 48371 activeVariationName: getActiveBlockVariation( 48372 "core/query", 48373 attributes3 48374 )?.name, 48375 blockVariations: getBlockVariations3("core/query", "block") 48376 }; 48377 }, 48378 [attributes3] 48379 ); 48380 const variations18 = (0, import_element96.useMemo)(() => { 48381 const isNotConnected = (variation) => !variation.attributes?.namespace; 48382 if (!activeVariationName) { 48383 return blockVariations.filter(isNotConnected); 48384 } 48385 const connectedVariations = blockVariations.filter( 48386 (variation) => variation.attributes?.namespace?.includes(activeVariationName) 48387 ); 48388 if (!!connectedVariations.length) { 48389 return connectedVariations; 48390 } 48391 return blockVariations.filter(isNotConnected); 48392 }, [activeVariationName, blockVariations]); 48393 return variations18; 48394 } 48395 var usePatterns = (clientId, name117) => { 48396 return (0, import_data102.useSelect)( 48397 (select9) => { 48398 const { getBlockRootClientId, getPatternsByBlockTypes } = select9(import_block_editor197.store); 48399 const rootClientId = getBlockRootClientId(clientId); 48400 return getPatternsByBlockTypes(name117, rootClientId); 48401 }, 48402 [name117, clientId] 48403 ); 48404 }; 48405 var useUnsupportedBlocks = (clientId) => { 48406 return (0, import_data102.useSelect)( 48407 (select9) => { 48408 const { getClientIdsOfDescendants, getBlockName } = select9(import_block_editor197.store); 48409 return getClientIdsOfDescendants(clientId).some( 48410 (descendantClientId) => { 48411 const blockName = getBlockName(descendantClientId); 48412 const blockSupportsInteractivity = Object.is( 48413 (0, import_blocks90.getBlockSupport)(blockName, "interactivity"), 48414 true 48415 ); 48416 const blockSupportsInteractivityClientNavigation = (0, import_blocks90.getBlockSupport)( 48417 blockName, 48418 "interactivity.clientNavigation" 48419 ); 48420 return !blockSupportsInteractivity && !blockSupportsInteractivityClientNavigation; 48421 } 48422 ); 48423 }, 48424 [clientId] 48425 ); 48426 }; 48427 function getQueryContextFromTemplate(templateSlug) { 48428 if (!templateSlug) { 48429 return { isSingular: true }; 48430 } 48431 let isSingular = false; 48432 let templateType = templateSlug === "wp" ? "custom" : templateSlug; 48433 const singularTemplates = ["404", "blank", "single", "page", "custom"]; 48434 const templateTypeFromSlug = templateSlug.includes("-") ? templateSlug.split("-", 1)[0] : templateSlug; 48435 const queryFromTemplateSlug = templateSlug.includes("-") ? templateSlug.split("-").slice(1).join("-") : ""; 48436 if (queryFromTemplateSlug) { 48437 templateType = templateTypeFromSlug; 48438 } 48439 isSingular = singularTemplates.includes(templateType); 48440 return { isSingular, templateType }; 48441 } 48442 48443 // packages/block-library/build-module/query/edit/inspector-controls/enhanced-pagination-control.js 48444 var import_jsx_runtime361 = __toESM(require_jsx_runtime()); 48445 function EnhancedPaginationControl({ 48446 enhancedPagination, 48447 setAttributes, 48448 clientId 48449 }) { 48450 const hasUnsupportedBlocks = useUnsupportedBlocks(clientId); 48451 let help = (0, import_i18n176.__)( 48452 "Reload the full page\u2014instead of just the posts list\u2014when visitors navigate between pages." 48453 ); 48454 if (hasUnsupportedBlocks) { 48455 help = (0, import_i18n176.__)( 48456 "Enhancement disabled because there are non-compatible blocks inside the Query block." 48457 ); 48458 } 48459 return /* @__PURE__ */ (0, import_jsx_runtime361.jsx)(import_jsx_runtime361.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime361.jsx)( 48460 import_components108.ToggleControl, 48461 { 48462 label: (0, import_i18n176.__)("Reload full page"), 48463 help, 48464 checked: !enhancedPagination, 48465 disabled: hasUnsupportedBlocks, 48466 onChange: (value) => { 48467 setAttributes({ 48468 enhancedPagination: !value 48469 }); 48470 } 48471 } 48472 ) }); 48473 } 48474 48475 // packages/block-library/build-module/query/edit/inspector-controls/index.js 48476 var import_components118 = __toESM(require_components()); 48477 var import_data107 = __toESM(require_data()); 48478 var import_core_data69 = __toESM(require_core_data()); 48479 var import_i18n186 = __toESM(require_i18n()); 48480 var import_compose42 = __toESM(require_compose()); 48481 var import_element99 = __toESM(require_element()); 48482 48483 // packages/block-library/build-module/query/edit/inspector-controls/order-control.js 48484 var import_components109 = __toESM(require_components()); 48485 var import_i18n177 = __toESM(require_i18n()); 48486 var import_jsx_runtime362 = __toESM(require_jsx_runtime()); 48487 var defaultOrderByOptions = [ 48488 { 48489 label: (0, import_i18n177.__)("Newest to oldest"), 48490 value: "date/desc" 48491 }, 48492 { 48493 label: (0, import_i18n177.__)("Oldest to newest"), 48494 value: "date/asc" 48495 }, 48496 { 48497 /* translators: Label for ordering posts by title in ascending order. */ 48498 label: (0, import_i18n177.__)("A \u2192 Z"), 48499 value: "title/asc" 48500 }, 48501 { 48502 /* translators: Label for ordering posts by title in descending order. */ 48503 label: (0, import_i18n177.__)("Z \u2192 A"), 48504 value: "title/desc" 48505 } 48506 ]; 48507 function OrderControl({ 48508 order, 48509 orderBy, 48510 orderByOptions = defaultOrderByOptions, 48511 onChange 48512 }) { 48513 return /* @__PURE__ */ (0, import_jsx_runtime362.jsx)( 48514 import_components109.SelectControl, 48515 { 48516 __next40pxDefaultSize: true, 48517 label: (0, import_i18n177.__)("Order by"), 48518 value: `$orderBy}/$order}`, 48519 options: orderByOptions, 48520 onChange: (value) => { 48521 const [newOrderBy, newOrder] = value.split("/"); 48522 onChange({ order: newOrder, orderBy: newOrderBy }); 48523 } 48524 } 48525 ); 48526 } 48527 var order_control_default = OrderControl; 48528 48529 // packages/block-library/build-module/query/edit/inspector-controls/author-control.js 48530 var import_i18n178 = __toESM(require_i18n()); 48531 var import_components110 = __toESM(require_components()); 48532 var import_data103 = __toESM(require_data()); 48533 var import_core_data65 = __toESM(require_core_data()); 48534 var import_jsx_runtime363 = __toESM(require_jsx_runtime()); 48535 var AUTHORS_QUERY3 = { 48536 who: "authors", 48537 per_page: -1, 48538 _fields: "id,name", 48539 context: "view" 48540 }; 48541 function AuthorControl({ value, onChange }) { 48542 const authorsList = (0, import_data103.useSelect)((select9) => { 48543 const { getUsers } = select9(import_core_data65.store); 48544 return getUsers(AUTHORS_QUERY3); 48545 }, []); 48546 if (!authorsList) { 48547 return null; 48548 } 48549 const authorsInfo = getEntitiesInfo(authorsList); 48550 const normalizedValue = !value ? [] : value.toString().split(","); 48551 const sanitizedValue = normalizedValue.reduce( 48552 (accumulator, authorId) => { 48553 const author = authorsInfo.mapById[authorId]; 48554 if (author) { 48555 accumulator.push({ 48556 id: authorId, 48557 value: author.name 48558 }); 48559 } 48560 return accumulator; 48561 }, 48562 [] 48563 ); 48564 const getIdByValue = (entitiesMappedByName, authorValue) => { 48565 const id = authorValue?.id || entitiesMappedByName[authorValue]?.id; 48566 if (id) { 48567 return id; 48568 } 48569 }; 48570 const onAuthorChange = (newValue) => { 48571 const ids = Array.from( 48572 newValue.reduce((accumulator, author) => { 48573 const id = getIdByValue(authorsInfo.mapByName, author); 48574 if (id) { 48575 accumulator.add(id); 48576 } 48577 return accumulator; 48578 }, /* @__PURE__ */ new Set()) 48579 ); 48580 onChange({ author: ids.join(",") }); 48581 }; 48582 return /* @__PURE__ */ (0, import_jsx_runtime363.jsx)( 48583 import_components110.FormTokenField, 48584 { 48585 label: (0, import_i18n178.__)("Authors"), 48586 value: sanitizedValue, 48587 suggestions: authorsInfo.names, 48588 onChange: onAuthorChange, 48589 __experimentalShowHowTo: false, 48590 __next40pxDefaultSize: true 48591 } 48592 ); 48593 } 48594 var author_control_default = AuthorControl; 48595 48596 // packages/block-library/build-module/query/edit/inspector-controls/parent-control.js 48597 var import_i18n179 = __toESM(require_i18n()); 48598 var import_components111 = __toESM(require_components()); 48599 var import_data104 = __toESM(require_data()); 48600 var import_core_data66 = __toESM(require_core_data()); 48601 var import_element97 = __toESM(require_element()); 48602 var import_compose40 = __toESM(require_compose()); 48603 var import_jsx_runtime364 = __toESM(require_jsx_runtime()); 48604 var EMPTY_ARRAY4 = []; 48605 var BASE_QUERY = { 48606 order: "asc", 48607 _fields: "id,title", 48608 context: "view" 48609 }; 48610 function ParentControl({ parents, postType, onChange }) { 48611 const [search, setSearch] = (0, import_element97.useState)(""); 48612 const [value, setValue] = (0, import_element97.useState)(EMPTY_ARRAY4); 48613 const [suggestions, setSuggestions] = (0, import_element97.useState)(EMPTY_ARRAY4); 48614 const debouncedSearch = (0, import_compose40.useDebounce)(setSearch, 250); 48615 const { searchResults, searchHasResolved } = (0, import_data104.useSelect)( 48616 (select9) => { 48617 if (!search) { 48618 return { searchResults: EMPTY_ARRAY4, searchHasResolved: true }; 48619 } 48620 const { getEntityRecords, hasFinishedResolution } = select9(import_core_data66.store); 48621 const selectorArgs = [ 48622 "postType", 48623 postType, 48624 { 48625 ...BASE_QUERY, 48626 search, 48627 orderby: "relevance", 48628 exclude: parents, 48629 per_page: 20 48630 } 48631 ]; 48632 return { 48633 searchResults: getEntityRecords(...selectorArgs), 48634 searchHasResolved: hasFinishedResolution( 48635 "getEntityRecords", 48636 selectorArgs 48637 ) 48638 }; 48639 }, 48640 [search, postType, parents] 48641 ); 48642 const currentParents = (0, import_data104.useSelect)( 48643 (select9) => { 48644 if (!parents?.length) { 48645 return EMPTY_ARRAY4; 48646 } 48647 const { getEntityRecords } = select9(import_core_data66.store); 48648 return getEntityRecords("postType", postType, { 48649 ...BASE_QUERY, 48650 include: parents, 48651 per_page: parents.length 48652 }); 48653 }, 48654 [parents, postType] 48655 ); 48656 (0, import_element97.useEffect)(() => { 48657 if (!parents?.length) { 48658 setValue(EMPTY_ARRAY4); 48659 } 48660 if (!currentParents?.length) { 48661 return; 48662 } 48663 const currentParentsInfo = getEntitiesInfo( 48664 mapToIHasNameAndId(currentParents, "title.rendered") 48665 ); 48666 const sanitizedValue = parents.reduce((accumulator, id) => { 48667 const entity = currentParentsInfo.mapById[id]; 48668 if (entity) { 48669 accumulator.push({ 48670 id, 48671 value: entity.name 48672 }); 48673 } 48674 return accumulator; 48675 }, []); 48676 setValue(sanitizedValue); 48677 }, [parents, currentParents]); 48678 const entitiesInfo = (0, import_element97.useMemo)(() => { 48679 if (!searchResults?.length) { 48680 return EMPTY_ARRAY4; 48681 } 48682 return getEntitiesInfo( 48683 mapToIHasNameAndId(searchResults, "title.rendered") 48684 ); 48685 }, [searchResults]); 48686 (0, import_element97.useEffect)(() => { 48687 if (!searchHasResolved) { 48688 return; 48689 } 48690 setSuggestions(entitiesInfo.names); 48691 }, [entitiesInfo.names, searchHasResolved]); 48692 const getIdByValue = (entitiesMappedByName, entity) => { 48693 const id = entity?.id || entitiesMappedByName?.[entity]?.id; 48694 if (id) { 48695 return id; 48696 } 48697 }; 48698 const onParentChange = (newValue) => { 48699 const ids = Array.from( 48700 newValue.reduce((accumulator, entity) => { 48701 const id = getIdByValue(entitiesInfo.mapByName, entity); 48702 if (id) { 48703 accumulator.add(id); 48704 } 48705 return accumulator; 48706 }, /* @__PURE__ */ new Set()) 48707 ); 48708 setSuggestions(EMPTY_ARRAY4); 48709 onChange({ parents: ids }); 48710 }; 48711 return /* @__PURE__ */ (0, import_jsx_runtime364.jsx)( 48712 import_components111.FormTokenField, 48713 { 48714 __next40pxDefaultSize: true, 48715 label: (0, import_i18n179.__)("Parents"), 48716 value, 48717 onInputChange: debouncedSearch, 48718 suggestions, 48719 onChange: onParentChange, 48720 __experimentalShowHowTo: false 48721 } 48722 ); 48723 } 48724 var parent_control_default = ParentControl; 48725 48726 // packages/block-library/build-module/query/edit/inspector-controls/taxonomy-controls.js 48727 var import_components112 = __toESM(require_components()); 48728 var import_data105 = __toESM(require_data()); 48729 var import_core_data67 = __toESM(require_core_data()); 48730 var import_element98 = __toESM(require_element()); 48731 var import_compose41 = __toESM(require_compose()); 48732 var import_html_entities11 = __toESM(require_html_entities()); 48733 var import_i18n180 = __toESM(require_i18n()); 48734 var import_jsx_runtime365 = __toESM(require_jsx_runtime()); 48735 var EMPTY_ARRAY5 = []; 48736 var BASE_QUERY2 = { 48737 order: "asc", 48738 _fields: "id,name", 48739 context: "view" 48740 }; 48741 var getTermIdByTermValue = (terms, termValue) => { 48742 const termId = termValue?.id || terms?.find((term) => term.name === termValue)?.id; 48743 if (termId) { 48744 return termId; 48745 } 48746 const termValueLower = termValue.toLocaleLowerCase(); 48747 return terms?.find( 48748 (term) => term.name.toLocaleLowerCase() === termValueLower 48749 )?.id; 48750 }; 48751 function TaxonomyControls({ onChange, query }) { 48752 const { postType, taxQuery } = query; 48753 const taxonomies = useTaxonomies(postType); 48754 if (!taxonomies?.length) { 48755 return null; 48756 } 48757 return /* @__PURE__ */ (0, import_jsx_runtime365.jsx)(import_components112.__experimentalVStack, { spacing: 4, children: taxonomies.map((taxonomy) => { 48758 const includeTermIds = taxQuery?.include?.[taxonomy.slug] || []; 48759 const excludeTermIds = taxQuery?.exclude?.[taxonomy.slug] || []; 48760 const onChangeTaxQuery = (newTermIds, key) => { 48761 const newPartialTaxQuery = { 48762 ...taxQuery?.[key], 48763 [taxonomy.slug]: newTermIds 48764 }; 48765 if (!newTermIds.length) { 48766 delete newPartialTaxQuery[taxonomy.slug]; 48767 } 48768 const newTaxQuery = { 48769 ...taxQuery, 48770 [key]: !!Object.keys(newPartialTaxQuery).length ? newPartialTaxQuery : void 0 48771 }; 48772 onChange({ 48773 // Clean up `taxQuery` if all filters are removed. 48774 taxQuery: Object.values(newTaxQuery).every( 48775 (value) => !value 48776 ) ? void 0 : newTaxQuery 48777 }); 48778 }; 48779 return /* @__PURE__ */ (0, import_jsx_runtime365.jsxs)(import_element98.Fragment, { children: [ 48780 /* @__PURE__ */ (0, import_jsx_runtime365.jsx)( 48781 TaxonomyItem, 48782 { 48783 taxonomy, 48784 termIds: includeTermIds, 48785 oppositeTermIds: excludeTermIds, 48786 onChange: (value) => onChangeTaxQuery(value, "include"), 48787 label: taxonomy.name 48788 } 48789 ), 48790 /* @__PURE__ */ (0, import_jsx_runtime365.jsx)( 48791 TaxonomyItem, 48792 { 48793 taxonomy, 48794 termIds: excludeTermIds, 48795 oppositeTermIds: includeTermIds, 48796 onChange: (value) => onChangeTaxQuery(value, "exclude"), 48797 label: ( 48798 /* translators: %s: taxonomy name */ 48799 (0, import_i18n180.sprintf)((0, import_i18n180.__)("Exclude: %s"), taxonomy.name) 48800 ) 48801 } 48802 ) 48803 ] }, taxonomy.slug); 48804 }) }); 48805 } 48806 function TaxonomyItem({ 48807 taxonomy, 48808 termIds, 48809 oppositeTermIds, 48810 onChange, 48811 label 48812 }) { 48813 const [search, setSearch] = (0, import_element98.useState)(""); 48814 const [value, setValue] = (0, import_element98.useState)(EMPTY_ARRAY5); 48815 const [suggestions, setSuggestions] = (0, import_element98.useState)(EMPTY_ARRAY5); 48816 const debouncedSearch = (0, import_compose41.useDebounce)(setSearch, 250); 48817 const { searchResults, searchHasResolved } = (0, import_data105.useSelect)( 48818 (select9) => { 48819 if (!search) { 48820 return { searchResults: EMPTY_ARRAY5, searchHasResolved: true }; 48821 } 48822 const { getEntityRecords, hasFinishedResolution } = select9(import_core_data67.store); 48823 const combinedExclude = [...termIds, ...oppositeTermIds]; 48824 const selectorArgs = [ 48825 "taxonomy", 48826 taxonomy.slug, 48827 { 48828 ...BASE_QUERY2, 48829 search, 48830 orderby: "name", 48831 exclude: combinedExclude, 48832 per_page: 20 48833 } 48834 ]; 48835 return { 48836 searchResults: getEntityRecords(...selectorArgs), 48837 searchHasResolved: hasFinishedResolution( 48838 "getEntityRecords", 48839 selectorArgs 48840 ) 48841 }; 48842 }, 48843 [search, taxonomy.slug, termIds, oppositeTermIds] 48844 ); 48845 const existingTerms = (0, import_data105.useSelect)( 48846 (select9) => { 48847 if (!termIds?.length) { 48848 return EMPTY_ARRAY5; 48849 } 48850 const { getEntityRecords } = select9(import_core_data67.store); 48851 return getEntityRecords("taxonomy", taxonomy.slug, { 48852 ...BASE_QUERY2, 48853 include: termIds, 48854 per_page: termIds.length 48855 }); 48856 }, 48857 [taxonomy.slug, termIds] 48858 ); 48859 (0, import_element98.useEffect)(() => { 48860 if (!termIds?.length) { 48861 setValue(EMPTY_ARRAY5); 48862 } 48863 if (!existingTerms?.length) { 48864 return; 48865 } 48866 const sanitizedValue = termIds.reduce((accumulator, id) => { 48867 const entity = existingTerms.find((term) => term.id === id); 48868 if (entity) { 48869 accumulator.push({ 48870 id, 48871 value: entity.name 48872 }); 48873 } 48874 return accumulator; 48875 }, []); 48876 setValue(sanitizedValue); 48877 }, [termIds, existingTerms]); 48878 (0, import_element98.useEffect)(() => { 48879 if (!searchHasResolved) { 48880 return; 48881 } 48882 setSuggestions(searchResults.map((result) => result.name)); 48883 }, [searchResults, searchHasResolved]); 48884 const onTermsChange = (newTermValues) => { 48885 const newTermIds = /* @__PURE__ */ new Set(); 48886 for (const termValue of newTermValues) { 48887 const termId = getTermIdByTermValue(searchResults, termValue); 48888 if (termId) { 48889 newTermIds.add(termId); 48890 } 48891 } 48892 setSuggestions(EMPTY_ARRAY5); 48893 onChange(Array.from(newTermIds)); 48894 }; 48895 return /* @__PURE__ */ (0, import_jsx_runtime365.jsx)("div", { className: "block-library-query-inspector__taxonomy-control", children: /* @__PURE__ */ (0, import_jsx_runtime365.jsx)( 48896 import_components112.FormTokenField, 48897 { 48898 label, 48899 value, 48900 onInputChange: debouncedSearch, 48901 suggestions, 48902 displayTransform: import_html_entities11.decodeEntities, 48903 onChange: onTermsChange, 48904 __experimentalShowHowTo: false, 48905 __next40pxDefaultSize: true 48906 } 48907 ) }); 48908 } 48909 48910 // packages/block-library/build-module/query/edit/inspector-controls/format-controls.js 48911 var import_components113 = __toESM(require_components()); 48912 var import_data106 = __toESM(require_data()); 48913 var import_core_data68 = __toESM(require_core_data()); 48914 var import_i18n181 = __toESM(require_i18n()); 48915 var import_jsx_runtime366 = __toESM(require_jsx_runtime()); 48916 var POST_FORMATS = [ 48917 { value: "aside", label: (0, import_i18n181.__)("Aside") }, 48918 { value: "audio", label: (0, import_i18n181.__)("Audio") }, 48919 { value: "chat", label: (0, import_i18n181.__)("Chat") }, 48920 { value: "gallery", label: (0, import_i18n181.__)("Gallery") }, 48921 { value: "image", label: (0, import_i18n181.__)("Image") }, 48922 { value: "link", label: (0, import_i18n181.__)("Link") }, 48923 { value: "quote", label: (0, import_i18n181.__)("Quote") }, 48924 { value: "standard", label: (0, import_i18n181.__)("Standard") }, 48925 { value: "status", label: (0, import_i18n181.__)("Status") }, 48926 { value: "video", label: (0, import_i18n181.__)("Video") } 48927 ].sort((a2, b2) => { 48928 const normalizedA = a2.label.toUpperCase(); 48929 const normalizedB = b2.label.toUpperCase(); 48930 if (normalizedA < normalizedB) { 48931 return -1; 48932 } 48933 if (normalizedA > normalizedB) { 48934 return 1; 48935 } 48936 return 0; 48937 }); 48938 function formatNamesToValues(names, formats) { 48939 return names.map((name117) => { 48940 return formats.find( 48941 (item) => item.label.toLocaleLowerCase() === name117.toLocaleLowerCase() 48942 )?.value; 48943 }).filter(Boolean); 48944 } 48945 function FormatControls({ onChange, query: { format: format3 } }) { 48946 const normalizedFormats = Array.isArray(format3) ? format3 : [format3]; 48947 const { supportedFormats } = (0, import_data106.useSelect)((select9) => { 48948 const themeSupports = select9(import_core_data68.store).getThemeSupports(); 48949 return { 48950 supportedFormats: themeSupports.formats 48951 }; 48952 }, []); 48953 const formats = POST_FORMATS.filter( 48954 (item) => supportedFormats.includes(item.value) 48955 ); 48956 const values = normalizedFormats.map( 48957 (name117) => formats.find((item) => item.value === name117)?.label 48958 ).filter(Boolean); 48959 const suggestions = formats.filter((item) => !normalizedFormats.includes(item.value)).map((item) => item.label); 48960 return /* @__PURE__ */ (0, import_jsx_runtime366.jsx)( 48961 import_components113.FormTokenField, 48962 { 48963 label: (0, import_i18n181.__)("Formats"), 48964 value: values, 48965 suggestions, 48966 onChange: (newValues) => { 48967 onChange({ 48968 format: formatNamesToValues(newValues, formats) 48969 }); 48970 }, 48971 __experimentalShowHowTo: false, 48972 __experimentalExpandOnFocus: true, 48973 __next40pxDefaultSize: true 48974 } 48975 ); 48976 } 48977 48978 // packages/block-library/build-module/query/edit/inspector-controls/sticky-control.js 48979 var import_components114 = __toESM(require_components()); 48980 var import_i18n182 = __toESM(require_i18n()); 48981 var import_jsx_runtime367 = __toESM(require_jsx_runtime()); 48982 var stickyOptions = [ 48983 { label: (0, import_i18n182.__)("Include"), value: "" }, 48984 { label: (0, import_i18n182.__)("Ignore"), value: "ignore" }, 48985 { label: (0, import_i18n182.__)("Exclude"), value: "exclude" }, 48986 { label: (0, import_i18n182.__)("Only"), value: "only" } 48987 ]; 48988 function StickyControl({ value, onChange }) { 48989 return /* @__PURE__ */ (0, import_jsx_runtime367.jsx)( 48990 import_components114.SelectControl, 48991 { 48992 __next40pxDefaultSize: true, 48993 label: (0, import_i18n182.__)("Sticky posts"), 48994 options: stickyOptions, 48995 value, 48996 onChange, 48997 help: (0, import_i18n182.__)( 48998 "Sticky posts always appear first, regardless of their publish date." 48999 ) 49000 } 49001 ); 49002 } 49003 49004 // packages/block-library/build-module/query/edit/inspector-controls/per-page-control.js 49005 var import_components115 = __toESM(require_components()); 49006 var import_i18n183 = __toESM(require_i18n()); 49007 var import_jsx_runtime368 = __toESM(require_jsx_runtime()); 49008 var MIN_POSTS_PER_PAGE = 1; 49009 var MAX_POSTS_PER_PAGE = 100; 49010 var PerPageControl = ({ perPage, offset = 0, onChange }) => { 49011 return /* @__PURE__ */ (0, import_jsx_runtime368.jsx)( 49012 import_components115.RangeControl, 49013 { 49014 __next40pxDefaultSize: true, 49015 label: (0, import_i18n183.__)("Items per page"), 49016 min: MIN_POSTS_PER_PAGE, 49017 max: MAX_POSTS_PER_PAGE, 49018 onChange: (newPerPage) => { 49019 if (isNaN(newPerPage) || newPerPage < MIN_POSTS_PER_PAGE || newPerPage > MAX_POSTS_PER_PAGE) { 49020 return; 49021 } 49022 onChange({ perPage: newPerPage, offset }); 49023 }, 49024 value: parseInt(perPage, 10) 49025 } 49026 ); 49027 }; 49028 var per_page_control_default = PerPageControl; 49029 49030 // packages/block-library/build-module/query/edit/inspector-controls/offset-controls.js 49031 var import_components116 = __toESM(require_components()); 49032 var import_i18n184 = __toESM(require_i18n()); 49033 var import_jsx_runtime369 = __toESM(require_jsx_runtime()); 49034 var MIN_OFFSET = 0; 49035 var MAX_OFFSET = 100; 49036 var OffsetControl = ({ offset = 0, onChange }) => { 49037 return /* @__PURE__ */ (0, import_jsx_runtime369.jsx)( 49038 import_components116.__experimentalNumberControl, 49039 { 49040 __next40pxDefaultSize: true, 49041 label: (0, import_i18n184.__)("Offset"), 49042 value: offset, 49043 min: MIN_OFFSET, 49044 onChange: (newOffset) => { 49045 if (isNaN(newOffset) || newOffset < MIN_OFFSET || newOffset > MAX_OFFSET) { 49046 return; 49047 } 49048 onChange({ offset: newOffset }); 49049 } 49050 } 49051 ); 49052 }; 49053 var offset_controls_default = OffsetControl; 49054 49055 // packages/block-library/build-module/query/edit/inspector-controls/pages-control.js 49056 var import_components117 = __toESM(require_components()); 49057 var import_i18n185 = __toESM(require_i18n()); 49058 var import_jsx_runtime370 = __toESM(require_jsx_runtime()); 49059 var PagesControl = ({ pages, onChange }) => { 49060 return /* @__PURE__ */ (0, import_jsx_runtime370.jsx)( 49061 import_components117.__experimentalNumberControl, 49062 { 49063 __next40pxDefaultSize: true, 49064 label: (0, import_i18n185.__)("Max pages to show"), 49065 value: pages, 49066 min: 0, 49067 onChange: (newPages) => { 49068 if (isNaN(newPages) || newPages < 0) { 49069 return; 49070 } 49071 onChange({ pages: newPages }); 49072 }, 49073 help: (0, import_i18n185.__)( 49074 "Limit the pages you want to show, even if the query has more results. To show all pages use 0 (zero)." 49075 ) 49076 } 49077 ); 49078 }; 49079 var pages_control_default = PagesControl; 49080 49081 // packages/block-library/build-module/query/edit/inspector-controls/index.js 49082 var import_jsx_runtime371 = __toESM(require_jsx_runtime()); 49083 function QueryInspectorControls(props) { 49084 const { attributes: attributes3, setQuery, isSingular } = props; 49085 const { query } = attributes3; 49086 const { 49087 order, 49088 orderBy, 49089 author: authorIds, 49090 pages, 49091 postType, 49092 perPage, 49093 offset, 49094 sticky, 49095 inherit, 49096 taxQuery, 49097 parents, 49098 format: format3 49099 } = query; 49100 const allowedControls = useAllowedControls(attributes3); 49101 const showSticky = postType === "post"; 49102 const { 49103 postTypesTaxonomiesMap, 49104 postTypesSelectOptions, 49105 postTypeFormatSupportMap 49106 } = usePostTypes(); 49107 const taxonomies = useTaxonomies(postType); 49108 const isPostTypeHierarchical = useIsPostTypeHierarchical(postType); 49109 const onPostTypeChange = (newValue) => { 49110 const updateQuery = { postType: newValue }; 49111 const supportedTaxonomies = postTypesTaxonomiesMap[newValue]; 49112 if (!!supportedTaxonomies?.length && !!taxQuery) { 49113 const buildTaxQuery = (_taxQuery) => { 49114 return Object.entries(_taxQuery || {}).reduce( 49115 (accumulator, [taxonomy, terms]) => { 49116 if (supportedTaxonomies.includes(taxonomy)) { 49117 accumulator[taxonomy] = terms; 49118 } 49119 return accumulator; 49120 }, 49121 {} 49122 ); 49123 }; 49124 const updatedTaxQuery = {}; 49125 const builtIncludeTaxQuery = buildTaxQuery(taxQuery.include); 49126 if (!!Object.keys(builtIncludeTaxQuery).length) { 49127 updatedTaxQuery.include = builtIncludeTaxQuery; 49128 } 49129 const builtExcludeTaxQuery = buildTaxQuery(taxQuery.exclude); 49130 if (!!Object.keys(builtExcludeTaxQuery).length) { 49131 updatedTaxQuery.exclude = builtExcludeTaxQuery; 49132 } 49133 updateQuery.taxQuery = !!Object.keys(updatedTaxQuery).length ? updatedTaxQuery : void 0; 49134 } 49135 if (newValue !== "post") { 49136 updateQuery.sticky = ""; 49137 } 49138 updateQuery.parents = []; 49139 const hasFormatSupport = postTypeFormatSupportMap[newValue]; 49140 if (!hasFormatSupport) { 49141 updateQuery.format = []; 49142 } 49143 setQuery(updateQuery); 49144 }; 49145 const [querySearch, setQuerySearch] = (0, import_element99.useState)(query.search); 49146 const debouncedQuerySearch = (0, import_element99.useMemo)(() => { 49147 return (0, import_compose42.debounce)((newQuerySearch) => { 49148 setQuery({ search: newQuerySearch }); 49149 }, 250); 49150 }, [setQuery]); 49151 const orderByOptions = useOrderByOptions(postType); 49152 const showInheritControl = isControlAllowed(allowedControls, "inherit"); 49153 const showPostTypeControl = !inherit && isControlAllowed(allowedControls, "postType"); 49154 const postTypeControlLabel = (0, import_i18n186.__)("Post type"); 49155 const postTypeControlHelp = (0, import_i18n186.__)( 49156 "Select the type of content to display: posts, pages, or custom post types." 49157 ); 49158 const showOrderControl = !inherit && isControlAllowed(allowedControls, "order"); 49159 const showStickyControl = !inherit && showSticky && isControlAllowed(allowedControls, "sticky"); 49160 const showSettingsPanel = showInheritControl || showPostTypeControl || showOrderControl || showStickyControl; 49161 const showTaxControl = !!taxonomies?.length && isControlAllowed(allowedControls, "taxQuery"); 49162 const showAuthorControl = isControlAllowed(allowedControls, "author"); 49163 const showSearchControl = isControlAllowed(allowedControls, "search"); 49164 const showParentControl = isControlAllowed(allowedControls, "parents") && isPostTypeHierarchical; 49165 const postTypeHasFormatSupport = postTypeFormatSupportMap[postType]; 49166 const showFormatControl = (0, import_data107.useSelect)( 49167 (select9) => { 49168 if (!postTypeHasFormatSupport || !isControlAllowed(allowedControls, "format")) { 49169 return false; 49170 } 49171 const themeSupports = select9(import_core_data69.store).getThemeSupports(); 49172 return themeSupports.formats && themeSupports.formats.length > 0 && themeSupports.formats.some((type) => type !== "standard"); 49173 }, 49174 [allowedControls, postTypeHasFormatSupport] 49175 ); 49176 const showFiltersPanel = showTaxControl || showAuthorControl || showSearchControl || showParentControl || showFormatControl; 49177 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 49178 const showPostCountControl = isControlAllowed( 49179 allowedControls, 49180 "postCount" 49181 ); 49182 const showOffSetControl = isControlAllowed(allowedControls, "offset"); 49183 const showPagesControl = isControlAllowed(allowedControls, "pages"); 49184 const showDisplayPanel = showPostCountControl || showOffSetControl || showPagesControl; 49185 const hasInheritanceWarning = isSingular && inherit; 49186 return /* @__PURE__ */ (0, import_jsx_runtime371.jsxs)(import_jsx_runtime371.Fragment, { children: [ 49187 showSettingsPanel && /* @__PURE__ */ (0, import_jsx_runtime371.jsxs)( 49188 import_components118.__experimentalToolsPanel, 49189 { 49190 label: (0, import_i18n186.__)("Settings"), 49191 resetAll: () => { 49192 setQuery({ 49193 postType: "post", 49194 order: "desc", 49195 orderBy: "date", 49196 sticky: "", 49197 inherit: true 49198 }); 49199 }, 49200 dropdownMenuProps, 49201 children: [ 49202 showInheritControl && /* @__PURE__ */ (0, import_jsx_runtime371.jsx)( 49203 import_components118.__experimentalToolsPanelItem, 49204 { 49205 hasValue: () => !inherit, 49206 label: (0, import_i18n186.__)("Query type"), 49207 onDeselect: () => setQuery({ inherit: true }), 49208 isShownByDefault: true, 49209 children: /* @__PURE__ */ (0, import_jsx_runtime371.jsxs)(import_components118.__experimentalVStack, { spacing: 4, children: [ 49210 /* @__PURE__ */ (0, import_jsx_runtime371.jsxs)( 49211 import_components118.__experimentalToggleGroupControl, 49212 { 49213 __next40pxDefaultSize: true, 49214 label: (0, import_i18n186.__)("Query type"), 49215 isBlock: true, 49216 onChange: (value) => { 49217 setQuery({ 49218 inherit: value === "default" 49219 }); 49220 }, 49221 help: inherit ? (0, import_i18n186.__)( 49222 "Display a list of posts or custom post types based on the current template." 49223 ) : (0, import_i18n186.__)( 49224 "Display a list of posts or custom post types based on specific criteria." 49225 ), 49226 value: !!inherit ? "default" : "custom", 49227 children: [ 49228 /* @__PURE__ */ (0, import_jsx_runtime371.jsx)( 49229 import_components118.__experimentalToggleGroupControlOption, 49230 { 49231 value: "default", 49232 label: (0, import_i18n186.__)("Default") 49233 } 49234 ), 49235 /* @__PURE__ */ (0, import_jsx_runtime371.jsx)( 49236 import_components118.__experimentalToggleGroupControlOption, 49237 { 49238 value: "custom", 49239 label: (0, import_i18n186.__)("Custom") 49240 } 49241 ) 49242 ] 49243 } 49244 ), 49245 hasInheritanceWarning && /* @__PURE__ */ (0, import_jsx_runtime371.jsx)( 49246 import_components118.Notice, 49247 { 49248 status: "warning", 49249 isDismissible: false, 49250 children: (0, import_i18n186.__)( 49251 "Cannot inherit the current template query when placed inside the singular content (e.g., post, page, 404, blank)." 49252 ) 49253 } 49254 ) 49255 ] }) 49256 } 49257 ), 49258 showPostTypeControl && /* @__PURE__ */ (0, import_jsx_runtime371.jsx)( 49259 import_components118.__experimentalToolsPanelItem, 49260 { 49261 hasValue: () => postType !== "post", 49262 label: postTypeControlLabel, 49263 onDeselect: () => onPostTypeChange("post"), 49264 isShownByDefault: true, 49265 children: postTypesSelectOptions.length > 2 ? /* @__PURE__ */ (0, import_jsx_runtime371.jsx)( 49266 import_components118.SelectControl, 49267 { 49268 __next40pxDefaultSize: true, 49269 options: postTypesSelectOptions, 49270 value: postType, 49271 label: postTypeControlLabel, 49272 onChange: onPostTypeChange, 49273 help: postTypeControlHelp 49274 } 49275 ) : /* @__PURE__ */ (0, import_jsx_runtime371.jsx)( 49276 import_components118.__experimentalToggleGroupControl, 49277 { 49278 __next40pxDefaultSize: true, 49279 isBlock: true, 49280 value: postType, 49281 label: postTypeControlLabel, 49282 onChange: onPostTypeChange, 49283 help: postTypeControlHelp, 49284 children: postTypesSelectOptions.map( 49285 (option) => /* @__PURE__ */ (0, import_jsx_runtime371.jsx)( 49286 import_components118.__experimentalToggleGroupControlOption, 49287 { 49288 value: option.value, 49289 label: option.label 49290 }, 49291 option.value 49292 ) 49293 ) 49294 } 49295 ) 49296 } 49297 ), 49298 showOrderControl && /* @__PURE__ */ (0, import_jsx_runtime371.jsx)( 49299 import_components118.__experimentalToolsPanelItem, 49300 { 49301 hasValue: () => order !== "desc" || orderBy !== "date", 49302 label: (0, import_i18n186.__)("Order by"), 49303 onDeselect: () => setQuery({ order: "desc", orderBy: "date" }), 49304 isShownByDefault: true, 49305 children: /* @__PURE__ */ (0, import_jsx_runtime371.jsx)( 49306 order_control_default, 49307 { 49308 ...{ order, orderBy, orderByOptions }, 49309 onChange: setQuery 49310 } 49311 ) 49312 } 49313 ), 49314 showStickyControl && /* @__PURE__ */ (0, import_jsx_runtime371.jsx)( 49315 import_components118.__experimentalToolsPanelItem, 49316 { 49317 hasValue: () => !!sticky, 49318 label: (0, import_i18n186.__)("Sticky posts"), 49319 onDeselect: () => setQuery({ sticky: "" }), 49320 isShownByDefault: true, 49321 children: /* @__PURE__ */ (0, import_jsx_runtime371.jsx)( 49322 StickyControl, 49323 { 49324 value: sticky, 49325 onChange: (value) => setQuery({ sticky: value }) 49326 } 49327 ) 49328 } 49329 ) 49330 ] 49331 } 49332 ), 49333 !inherit && showDisplayPanel && /* @__PURE__ */ (0, import_jsx_runtime371.jsxs)( 49334 import_components118.__experimentalToolsPanel, 49335 { 49336 className: "block-library-query-toolspanel__display", 49337 label: (0, import_i18n186.__)("Display"), 49338 resetAll: () => { 49339 setQuery({ 49340 offset: 0, 49341 pages: 0 49342 }); 49343 }, 49344 dropdownMenuProps, 49345 children: [ 49346 /* @__PURE__ */ (0, import_jsx_runtime371.jsx)( 49347 import_components118.__experimentalToolsPanelItem, 49348 { 49349 label: (0, import_i18n186.__)("Items per page"), 49350 hasValue: () => perPage > 0, 49351 children: /* @__PURE__ */ (0, import_jsx_runtime371.jsx)( 49352 per_page_control_default, 49353 { 49354 perPage, 49355 offset, 49356 onChange: setQuery 49357 } 49358 ) 49359 } 49360 ), 49361 /* @__PURE__ */ (0, import_jsx_runtime371.jsx)( 49362 import_components118.__experimentalToolsPanelItem, 49363 { 49364 label: (0, import_i18n186.__)("Offset"), 49365 hasValue: () => offset > 0, 49366 onDeselect: () => setQuery({ offset: 0 }), 49367 children: /* @__PURE__ */ (0, import_jsx_runtime371.jsx)( 49368 offset_controls_default, 49369 { 49370 offset, 49371 onChange: setQuery 49372 } 49373 ) 49374 } 49375 ), 49376 /* @__PURE__ */ (0, import_jsx_runtime371.jsx)( 49377 import_components118.__experimentalToolsPanelItem, 49378 { 49379 label: (0, import_i18n186.__)("Max pages to show"), 49380 hasValue: () => pages > 0, 49381 onDeselect: () => setQuery({ pages: 0 }), 49382 children: /* @__PURE__ */ (0, import_jsx_runtime371.jsx)(pages_control_default, { pages, onChange: setQuery }) 49383 } 49384 ) 49385 ] 49386 } 49387 ), 49388 !inherit && showFiltersPanel && /* @__PURE__ */ (0, import_jsx_runtime371.jsxs)( 49389 import_components118.__experimentalToolsPanel, 49390 { 49391 className: "block-library-query-toolspanel__filters", 49392 label: (0, import_i18n186.__)("Filters"), 49393 resetAll: () => { 49394 setQuery({ 49395 author: "", 49396 parents: [], 49397 search: "", 49398 taxQuery: null, 49399 format: [] 49400 }); 49401 setQuerySearch(""); 49402 }, 49403 dropdownMenuProps, 49404 children: [ 49405 showTaxControl && /* @__PURE__ */ (0, import_jsx_runtime371.jsx)( 49406 import_components118.__experimentalToolsPanelItem, 49407 { 49408 label: (0, import_i18n186.__)("Taxonomies"), 49409 hasValue: () => Object.values(taxQuery || {}).some( 49410 (value) => Object.values(value || {}).some( 49411 (termIds) => !!termIds?.length 49412 ) 49413 ), 49414 onDeselect: () => setQuery({ taxQuery: null }), 49415 children: /* @__PURE__ */ (0, import_jsx_runtime371.jsx)( 49416 TaxonomyControls, 49417 { 49418 onChange: setQuery, 49419 query 49420 } 49421 ) 49422 } 49423 ), 49424 showAuthorControl && /* @__PURE__ */ (0, import_jsx_runtime371.jsx)( 49425 import_components118.__experimentalToolsPanelItem, 49426 { 49427 hasValue: () => !!authorIds, 49428 label: (0, import_i18n186.__)("Authors"), 49429 onDeselect: () => setQuery({ author: "" }), 49430 children: /* @__PURE__ */ (0, import_jsx_runtime371.jsx)( 49431 author_control_default, 49432 { 49433 value: authorIds, 49434 onChange: setQuery 49435 } 49436 ) 49437 } 49438 ), 49439 showSearchControl && /* @__PURE__ */ (0, import_jsx_runtime371.jsx)( 49440 import_components118.__experimentalToolsPanelItem, 49441 { 49442 hasValue: () => !!querySearch, 49443 label: (0, import_i18n186.__)("Keyword"), 49444 onDeselect: () => { 49445 setQuery({ search: "" }); 49446 setQuerySearch(""); 49447 }, 49448 children: /* @__PURE__ */ (0, import_jsx_runtime371.jsx)( 49449 import_components118.TextControl, 49450 { 49451 __next40pxDefaultSize: true, 49452 label: (0, import_i18n186.__)("Keyword"), 49453 value: querySearch, 49454 onChange: (newQuerySearch) => { 49455 debouncedQuerySearch(newQuerySearch); 49456 setQuerySearch(newQuerySearch); 49457 } 49458 } 49459 ) 49460 } 49461 ), 49462 showParentControl && /* @__PURE__ */ (0, import_jsx_runtime371.jsx)( 49463 import_components118.__experimentalToolsPanelItem, 49464 { 49465 hasValue: () => !!parents?.length, 49466 label: (0, import_i18n186.__)("Parents"), 49467 onDeselect: () => setQuery({ parents: [] }), 49468 children: /* @__PURE__ */ (0, import_jsx_runtime371.jsx)( 49469 parent_control_default, 49470 { 49471 parents, 49472 postType, 49473 onChange: setQuery 49474 } 49475 ) 49476 } 49477 ), 49478 showFormatControl && /* @__PURE__ */ (0, import_jsx_runtime371.jsx)( 49479 import_components118.__experimentalToolsPanelItem, 49480 { 49481 hasValue: () => !!format3?.length, 49482 label: (0, import_i18n186.__)("Formats"), 49483 onDeselect: () => setQuery({ format: [] }), 49484 children: /* @__PURE__ */ (0, import_jsx_runtime371.jsx)( 49485 FormatControls, 49486 { 49487 onChange: setQuery, 49488 query 49489 } 49490 ) 49491 } 49492 ) 49493 ] 49494 } 49495 ) 49496 ] }); 49497 } 49498 49499 // packages/block-library/build-module/query/edit/enhanced-pagination-modal.js 49500 var import_components119 = __toESM(require_components()); 49501 var import_i18n187 = __toESM(require_i18n()); 49502 var import_element100 = __toESM(require_element()); 49503 var import_jsx_runtime372 = __toESM(require_jsx_runtime()); 49504 var modalDescriptionId = "wp-block-query-enhanced-pagination-modal__description"; 49505 function EnhancedPaginationModal({ 49506 clientId, 49507 attributes: { enhancedPagination }, 49508 setAttributes 49509 }) { 49510 const [isOpen, setOpen] = (0, import_element100.useState)(false); 49511 const hasUnsupportedBlocks = useUnsupportedBlocks(clientId); 49512 (0, import_element100.useEffect)(() => { 49513 if (enhancedPagination && hasUnsupportedBlocks) { 49514 setAttributes({ enhancedPagination: false }); 49515 setOpen(true); 49516 } 49517 }, [enhancedPagination, hasUnsupportedBlocks, setAttributes]); 49518 const closeModal = () => { 49519 setOpen(false); 49520 }; 49521 const notice = (0, import_i18n187.__)( 49522 "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." 49523 ) + " " + (0, import_i18n187.__)( 49524 'If you still want to prevent full page reloads, remove that block, then disable "Reload full page" again in the Query Block settings.' 49525 ); 49526 return isOpen && /* @__PURE__ */ (0, import_jsx_runtime372.jsx)( 49527 import_components119.Modal, 49528 { 49529 title: (0, import_i18n187.__)("Query block: Reload full page enabled"), 49530 className: "wp-block-query__enhanced-pagination-modal", 49531 aria: { 49532 describedby: modalDescriptionId 49533 }, 49534 role: "alertdialog", 49535 focusOnMount: "firstElement", 49536 isDismissible: false, 49537 onRequestClose: closeModal, 49538 children: /* @__PURE__ */ (0, import_jsx_runtime372.jsxs)(import_components119.__experimentalVStack, { alignment: "right", spacing: 5, children: [ 49539 /* @__PURE__ */ (0, import_jsx_runtime372.jsx)("span", { id: modalDescriptionId, children: notice }), 49540 /* @__PURE__ */ (0, import_jsx_runtime372.jsx)( 49541 import_components119.Button, 49542 { 49543 __next40pxDefaultSize: true, 49544 variant: "primary", 49545 onClick: closeModal, 49546 children: (0, import_i18n187.__)("OK") 49547 } 49548 ) 49549 ] }) 49550 } 49551 ); 49552 } 49553 49554 // packages/block-library/build-module/query/edit/query-toolbar.js 49555 var import_components121 = __toESM(require_components()); 49556 var import_i18n189 = __toESM(require_i18n()); 49557 49558 // packages/block-library/build-module/query/edit/pattern-selection.js 49559 var import_element101 = __toESM(require_element()); 49560 var import_data108 = __toESM(require_data()); 49561 var import_components120 = __toESM(require_components()); 49562 var import_block_editor198 = __toESM(require_block_editor()); 49563 var import_i18n188 = __toESM(require_i18n()); 49564 49565 // packages/block-library/build-module/utils/search-patterns.js 49566 var import_remove_accents4 = __toESM(require_remove_accents()); 49567 function normalizeSearchInput(input = "") { 49568 input = (0, import_remove_accents4.default)(input); 49569 input = input.trim().toLowerCase(); 49570 return input; 49571 } 49572 function getPatternSearchRank(pattern, searchValue) { 49573 const normalizedSearchValue = normalizeSearchInput(searchValue); 49574 const normalizedTitle = normalizeSearchInput(pattern.title); 49575 let rank = 0; 49576 if (normalizedSearchValue === normalizedTitle) { 49577 rank += 30; 49578 } else if (normalizedTitle.startsWith(normalizedSearchValue)) { 49579 rank += 20; 49580 } else { 49581 const searchTerms = normalizedSearchValue.split(" "); 49582 const hasMatchedTerms = searchTerms.every( 49583 (searchTerm) => normalizedTitle.includes(searchTerm) 49584 ); 49585 if (hasMatchedTerms) { 49586 rank += 10; 49587 } 49588 } 49589 return rank; 49590 } 49591 function searchPatterns(patterns = [], searchValue = "") { 49592 if (!searchValue) { 49593 return patterns; 49594 } 49595 const rankedPatterns = patterns.map((pattern) => { 49596 return [pattern, getPatternSearchRank(pattern, searchValue)]; 49597 }).filter(([, rank]) => rank > 0); 49598 rankedPatterns.sort(([, rank1], [, rank2]) => rank2 - rank1); 49599 return rankedPatterns.map(([pattern]) => pattern); 49600 } 49601 49602 // packages/block-library/build-module/query/edit/pattern-selection.js 49603 var import_jsx_runtime373 = __toESM(require_jsx_runtime()); 49604 function PatternSelectionModal({ 49605 clientId, 49606 attributes: attributes3, 49607 setIsPatternSelectionModalOpen 49608 }) { 49609 return /* @__PURE__ */ (0, import_jsx_runtime373.jsx)( 49610 import_components120.Modal, 49611 { 49612 overlayClassName: "block-library-query-pattern__selection-modal", 49613 title: (0, import_i18n188.__)("Choose a pattern"), 49614 onRequestClose: () => setIsPatternSelectionModalOpen(false), 49615 isFullScreen: true, 49616 children: /* @__PURE__ */ (0, import_jsx_runtime373.jsx)(PatternSelection, { clientId, attributes: attributes3 }) 49617 } 49618 ); 49619 } 49620 function useBlockPatterns(clientId, attributes3) { 49621 const blockNameForPatterns = useBlockNameForPatterns( 49622 clientId, 49623 attributes3 49624 ); 49625 const allPatterns = usePatterns(clientId, blockNameForPatterns); 49626 const rootBlockPatterns = (0, import_element101.useMemo)(() => { 49627 return allPatterns.filter((pattern) => { 49628 return pattern.blocks?.[0]?.name === "core/query"; 49629 }); 49630 }, [allPatterns]); 49631 return rootBlockPatterns; 49632 } 49633 function PatternSelection({ 49634 clientId, 49635 attributes: attributes3, 49636 showTitlesAsTooltip = false, 49637 showSearch = true 49638 }) { 49639 const [searchValue, setSearchValue] = (0, import_element101.useState)(""); 49640 const { replaceBlock, selectBlock } = (0, import_data108.useDispatch)(import_block_editor198.store); 49641 const blockPatterns = useBlockPatterns(clientId, attributes3); 49642 const blockPreviewContext = (0, import_element101.useMemo)( 49643 () => ({ 49644 previewPostType: attributes3.query.postType 49645 }), 49646 [attributes3.query.postType] 49647 ); 49648 const filteredBlockPatterns = (0, import_element101.useMemo)(() => { 49649 return searchPatterns(blockPatterns, searchValue); 49650 }, [blockPatterns, searchValue]); 49651 const onBlockPatternSelect = (pattern, blocks) => { 49652 const { newBlocks, queryClientIds } = getTransformedBlocksFromPattern( 49653 blocks, 49654 attributes3 49655 ); 49656 replaceBlock(clientId, newBlocks); 49657 if (queryClientIds[0]) { 49658 selectBlock(queryClientIds[0]); 49659 } 49660 }; 49661 return /* @__PURE__ */ (0, import_jsx_runtime373.jsxs)("div", { className: "block-library-query-pattern__selection-content", children: [ 49662 showSearch && /* @__PURE__ */ (0, import_jsx_runtime373.jsx)("div", { className: "block-library-query-pattern__selection-search", children: /* @__PURE__ */ (0, import_jsx_runtime373.jsx)( 49663 import_components120.SearchControl, 49664 { 49665 onChange: setSearchValue, 49666 value: searchValue, 49667 label: (0, import_i18n188.__)("Search"), 49668 placeholder: (0, import_i18n188.__)("Search") 49669 } 49670 ) }), 49671 /* @__PURE__ */ (0, import_jsx_runtime373.jsx)(import_block_editor198.BlockContextProvider, { value: blockPreviewContext, children: /* @__PURE__ */ (0, import_jsx_runtime373.jsx)( 49672 import_block_editor198.__experimentalBlockPatternsList, 49673 { 49674 blockPatterns: filteredBlockPatterns, 49675 onClickPattern: onBlockPatternSelect, 49676 showTitlesAsTooltip 49677 } 49678 ) }) 49679 ] }); 49680 } 49681 49682 // packages/block-library/build-module/query/edit/query-toolbar.js 49683 var import_jsx_runtime374 = __toESM(require_jsx_runtime()); 49684 function QueryToolbar({ 49685 clientId, 49686 attributes: attributes3, 49687 hasInnerBlocks 49688 }) { 49689 const hasPatterns = useBlockPatterns(clientId, attributes3).length; 49690 if (!hasPatterns) { 49691 return null; 49692 } 49693 const buttonLabel = hasInnerBlocks ? (0, import_i18n189.__)("Change design") : (0, import_i18n189.__)("Choose pattern"); 49694 return /* @__PURE__ */ (0, import_jsx_runtime374.jsx)(import_components121.__experimentalDropdownContentWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime374.jsx)( 49695 import_components121.Dropdown, 49696 { 49697 contentClassName: "block-editor-block-settings-menu__popover", 49698 focusOnMount: "firstElement", 49699 expandOnMobile: true, 49700 renderToggle: ({ isOpen, onToggle }) => /* @__PURE__ */ (0, import_jsx_runtime374.jsx)( 49701 import_components121.ToolbarButton, 49702 { 49703 "aria-haspopup": "true", 49704 "aria-expanded": isOpen, 49705 onClick: onToggle, 49706 children: buttonLabel 49707 } 49708 ), 49709 renderContent: () => /* @__PURE__ */ (0, import_jsx_runtime374.jsx)( 49710 PatternSelection, 49711 { 49712 clientId, 49713 attributes: attributes3, 49714 showSearch: false, 49715 showTitlesAsTooltip: true 49716 } 49717 ) 49718 } 49719 ) }); 49720 } 49721 49722 // packages/block-library/build-module/query/edit/query-content.js 49723 var import_jsx_runtime375 = __toESM(require_jsx_runtime()); 49724 var { HTMLElementControl: HTMLElementControl6 } = unlock(import_block_editor199.privateApis); 49725 var DEFAULTS_POSTS_PER_PAGE = 3; 49726 var TEMPLATE12 = [["core/post-template"]]; 49727 function QueryContent({ 49728 attributes: attributes3, 49729 setAttributes, 49730 clientId, 49731 context, 49732 name: name117 49733 }) { 49734 const { 49735 queryId, 49736 query, 49737 enhancedPagination, 49738 tagName: TagName2 = "div", 49739 query: { inherit } = {} 49740 } = attributes3; 49741 const { templateSlug } = context; 49742 const { isSingular } = getQueryContextFromTemplate(templateSlug); 49743 const { __unstableMarkNextChangeAsNotPersistent } = (0, import_data109.useDispatch)(import_block_editor199.store); 49744 const instanceId = (0, import_compose43.useInstanceId)(QueryContent); 49745 const blockProps = (0, import_block_editor199.useBlockProps)(); 49746 const innerBlocksProps = (0, import_block_editor199.useInnerBlocksProps)(blockProps, { 49747 template: TEMPLATE12 49748 }); 49749 const { postsPerPage } = (0, import_data109.useSelect)((select9) => { 49750 const { getSettings: getSettings2 } = select9(import_block_editor199.store); 49751 const { getEntityRecord, getEntityRecordEdits, canUser } = select9(import_core_data70.store); 49752 const settingPerPage = canUser("read", { 49753 kind: "root", 49754 name: "site" 49755 }) ? +getEntityRecord("root", "site")?.posts_per_page : +getSettings2().postsPerPage; 49756 const editedSettingPerPage = +getEntityRecordEdits("root", "site")?.posts_per_page; 49757 return { 49758 postsPerPage: editedSettingPerPage || settingPerPage || DEFAULTS_POSTS_PER_PAGE 49759 }; 49760 }, []); 49761 const updateQuery = (0, import_element102.useCallback)( 49762 (newQuery) => setAttributes((prevAttributes) => ({ 49763 query: { ...prevAttributes.query, ...newQuery } 49764 })), 49765 [setAttributes] 49766 ); 49767 (0, import_element102.useEffect)(() => { 49768 const newQuery = {}; 49769 if (inherit && query.perPage !== postsPerPage) { 49770 newQuery.perPage = postsPerPage; 49771 } else if (!query.perPage && postsPerPage) { 49772 newQuery.perPage = postsPerPage; 49773 } 49774 if (!!Object.keys(newQuery).length) { 49775 __unstableMarkNextChangeAsNotPersistent(); 49776 updateQuery(newQuery); 49777 } 49778 }, [ 49779 query.perPage, 49780 inherit, 49781 postsPerPage, 49782 __unstableMarkNextChangeAsNotPersistent, 49783 updateQuery 49784 ]); 49785 (0, import_element102.useEffect)(() => { 49786 if (!Number.isFinite(queryId)) { 49787 __unstableMarkNextChangeAsNotPersistent(); 49788 setAttributes({ queryId: instanceId }); 49789 } 49790 }, [ 49791 queryId, 49792 instanceId, 49793 __unstableMarkNextChangeAsNotPersistent, 49794 setAttributes 49795 ]); 49796 return /* @__PURE__ */ (0, import_jsx_runtime375.jsxs)(import_jsx_runtime375.Fragment, { children: [ 49797 /* @__PURE__ */ (0, import_jsx_runtime375.jsx)(import_block_editor199.BlockControls, { group: "other", children: /* @__PURE__ */ (0, import_jsx_runtime375.jsx)( 49798 QueryToolbar, 49799 { 49800 clientId, 49801 attributes: attributes3, 49802 hasInnerBlocks: true 49803 } 49804 ) }), 49805 /* @__PURE__ */ (0, import_jsx_runtime375.jsx)( 49806 EnhancedPaginationModal, 49807 { 49808 attributes: attributes3, 49809 setAttributes, 49810 clientId 49811 } 49812 ), 49813 /* @__PURE__ */ (0, import_jsx_runtime375.jsx)(import_block_editor199.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime375.jsx)( 49814 QueryInspectorControls, 49815 { 49816 name: name117, 49817 attributes: attributes3, 49818 setQuery: updateQuery, 49819 setAttributes, 49820 clientId, 49821 isSingular 49822 } 49823 ) }), 49824 /* @__PURE__ */ (0, import_jsx_runtime375.jsxs)(import_block_editor199.InspectorControls, { group: "advanced", children: [ 49825 /* @__PURE__ */ (0, import_jsx_runtime375.jsx)( 49826 HTMLElementControl6, 49827 { 49828 tagName: TagName2, 49829 onChange: (value) => setAttributes({ tagName: value }), 49830 clientId, 49831 options: [ 49832 { label: (0, import_i18n190.__)("Default (<div>)"), value: "div" }, 49833 { label: "<main>", value: "main" }, 49834 { label: "<section>", value: "section" }, 49835 { label: "<aside>", value: "aside" } 49836 ] 49837 } 49838 ), 49839 /* @__PURE__ */ (0, import_jsx_runtime375.jsx)( 49840 EnhancedPaginationControl, 49841 { 49842 enhancedPagination, 49843 setAttributes, 49844 clientId 49845 } 49846 ) 49847 ] }), 49848 /* @__PURE__ */ (0, import_jsx_runtime375.jsx)(TagName2, { ...innerBlocksProps }) 49849 ] }); 49850 } 49851 49852 // packages/block-library/build-module/query/edit/query-placeholder.js 49853 var import_data110 = __toESM(require_data()); 49854 var import_blocks91 = __toESM(require_blocks()); 49855 var import_element103 = __toESM(require_element()); 49856 var import_block_editor200 = __toESM(require_block_editor()); 49857 var import_components122 = __toESM(require_components()); 49858 var import_i18n191 = __toESM(require_i18n()); 49859 var import_compose44 = __toESM(require_compose()); 49860 var import_jsx_runtime376 = __toESM(require_jsx_runtime()); 49861 function QueryPlaceholder({ 49862 attributes: attributes3, 49863 clientId, 49864 name: name117, 49865 openPatternSelectionModal 49866 }) { 49867 const [isStartingBlank, setIsStartingBlank] = (0, import_element103.useState)(false); 49868 const [containerWidth, setContainerWidth] = (0, import_element103.useState)(0); 49869 const resizeObserverRef = (0, import_compose44.useResizeObserver)(([entry]) => { 49870 setContainerWidth(entry.contentRect.width); 49871 }); 49872 const SMALL_CONTAINER_BREAKPOINT = 160; 49873 const isSmallContainer = containerWidth > 0 && containerWidth < SMALL_CONTAINER_BREAKPOINT; 49874 const { blockType, activeBlockVariation } = (0, import_data110.useSelect)( 49875 (select9) => { 49876 const { getActiveBlockVariation, getBlockType: getBlockType5 } = select9(import_blocks91.store); 49877 return { 49878 blockType: getBlockType5(name117), 49879 activeBlockVariation: getActiveBlockVariation( 49880 name117, 49881 attributes3 49882 ) 49883 }; 49884 }, 49885 [name117, attributes3] 49886 ); 49887 const hasPatterns = !!useBlockPatterns(clientId, attributes3).length; 49888 const icon = activeBlockVariation?.icon?.src || activeBlockVariation?.icon || blockType?.icon?.src; 49889 const label = activeBlockVariation?.title || blockType?.title; 49890 const blockProps = (0, import_block_editor200.useBlockProps)({ 49891 ref: resizeObserverRef 49892 }); 49893 if (isStartingBlank) { 49894 return /* @__PURE__ */ (0, import_jsx_runtime376.jsx)( 49895 QueryVariationPicker, 49896 { 49897 clientId, 49898 attributes: attributes3, 49899 icon, 49900 label 49901 } 49902 ); 49903 } 49904 return /* @__PURE__ */ (0, import_jsx_runtime376.jsxs)("div", { ...blockProps, children: [ 49905 /* @__PURE__ */ (0, import_jsx_runtime376.jsx)(import_block_editor200.BlockControls, { children: /* @__PURE__ */ (0, import_jsx_runtime376.jsx)( 49906 QueryToolbar, 49907 { 49908 clientId, 49909 attributes: attributes3, 49910 hasInnerBlocks: false 49911 } 49912 ) }), 49913 /* @__PURE__ */ (0, import_jsx_runtime376.jsxs)( 49914 import_components122.Placeholder, 49915 { 49916 className: "block-editor-media-placeholder", 49917 icon: !isSmallContainer && icon, 49918 label: !isSmallContainer && label, 49919 instructions: !isSmallContainer && (0, import_i18n191.__)("Choose a pattern for the query loop or start blank."), 49920 withIllustration: isSmallContainer, 49921 children: [ 49922 !!hasPatterns && !isSmallContainer && /* @__PURE__ */ (0, import_jsx_runtime376.jsx)( 49923 import_components122.Button, 49924 { 49925 __next40pxDefaultSize: true, 49926 variant: "primary", 49927 onClick: openPatternSelectionModal, 49928 children: (0, import_i18n191.__)("Choose") 49929 } 49930 ), 49931 !isSmallContainer && /* @__PURE__ */ (0, import_jsx_runtime376.jsx)( 49932 import_components122.Button, 49933 { 49934 __next40pxDefaultSize: true, 49935 variant: "secondary", 49936 onClick: () => { 49937 setIsStartingBlank(true); 49938 }, 49939 children: (0, import_i18n191.__)("Start blank") 49940 } 49941 ) 49942 ] 49943 } 49944 ) 49945 ] }); 49946 } 49947 function QueryVariationPicker({ clientId, attributes: attributes3, icon, label }) { 49948 const scopeVariations = useScopedBlockVariations(attributes3); 49949 const { replaceInnerBlocks } = (0, import_data110.useDispatch)(import_block_editor200.store); 49950 const blockProps = (0, import_block_editor200.useBlockProps)(); 49951 return /* @__PURE__ */ (0, import_jsx_runtime376.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime376.jsx)( 49952 import_block_editor200.__experimentalBlockVariationPicker, 49953 { 49954 icon, 49955 label, 49956 variations: scopeVariations, 49957 onSelect: (variation) => { 49958 if (variation.innerBlocks) { 49959 replaceInnerBlocks( 49960 clientId, 49961 (0, import_blocks91.createBlocksFromInnerBlocksTemplate)( 49962 variation.innerBlocks 49963 ), 49964 false 49965 ); 49966 } 49967 } 49968 } 49969 ) }); 49970 } 49971 49972 // packages/block-library/build-module/query/edit/index.js 49973 var import_jsx_runtime377 = __toESM(require_jsx_runtime()); 49974 var QueryEdit = (props) => { 49975 const { clientId, attributes: attributes3 } = props; 49976 const [isPatternSelectionModalOpen, setIsPatternSelectionModalOpen] = (0, import_element104.useState)(false); 49977 const hasInnerBlocks = (0, import_data111.useSelect)( 49978 (select9) => !!select9(import_block_editor201.store).getBlocks(clientId).length, 49979 [clientId] 49980 ); 49981 const Component = hasInnerBlocks ? QueryContent : QueryPlaceholder; 49982 return /* @__PURE__ */ (0, import_jsx_runtime377.jsxs)(import_jsx_runtime377.Fragment, { children: [ 49983 /* @__PURE__ */ (0, import_jsx_runtime377.jsx)( 49984 Component, 49985 { 49986 ...props, 49987 openPatternSelectionModal: () => setIsPatternSelectionModalOpen(true) 49988 } 49989 ), 49990 isPatternSelectionModalOpen && /* @__PURE__ */ (0, import_jsx_runtime377.jsx)( 49991 PatternSelectionModal, 49992 { 49993 clientId, 49994 attributes: attributes3, 49995 setIsPatternSelectionModalOpen 49996 } 49997 ) 49998 ] }); 49999 }; 50000 var edit_default28 = QueryEdit; 50001 50002 // packages/block-library/build-module/query/save.js 50003 var import_block_editor202 = __toESM(require_block_editor()); 50004 var import_jsx_runtime378 = __toESM(require_jsx_runtime()); 50005 function save41({ attributes: { tagName: Tag = "div" } }) { 50006 const blockProps = import_block_editor202.useBlockProps.save(); 50007 const innerBlocksProps = import_block_editor202.useInnerBlocksProps.save(blockProps); 50008 return /* @__PURE__ */ (0, import_jsx_runtime378.jsx)(Tag, { ...innerBlocksProps }); 50009 } 50010 50011 // packages/block-library/build-module/query/variations.js 50012 var import_i18n192 = __toESM(require_i18n()); 50013 50014 // packages/block-library/build-module/query/icons.js 50015 var import_components123 = __toESM(require_components()); 50016 var import_jsx_runtime379 = __toESM(require_jsx_runtime()); 50017 var titleDate = /* @__PURE__ */ (0, import_jsx_runtime379.jsx)(import_components123.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 48 48", children: /* @__PURE__ */ (0, import_jsx_runtime379.jsx)(import_components123.Path, { d: "M41 9H7v3h34V9zm-22 5H7v1h12v-1zM7 26h12v1H7v-1zm34-5H7v3h34v-3zM7 38h12v1H7v-1zm34-5H7v3h34v-3z" }) }); 50018 var titleExcerpt = /* @__PURE__ */ (0, import_jsx_runtime379.jsx)(import_components123.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 48 48", children: /* @__PURE__ */ (0, import_jsx_runtime379.jsx)(import_components123.Path, { d: "M41 9H7v3h34V9zm-4 5H7v1h30v-1zm4 3H7v1h34v-1zM7 20h30v1H7v-1zm0 12h30v1H7v-1zm34 3H7v1h34v-1zM7 38h30v1H7v-1zm34-11H7v3h34v-3z" }) }); 50019 var titleDateExcerpt = /* @__PURE__ */ (0, import_jsx_runtime379.jsx)(import_components123.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 48 48", children: /* @__PURE__ */ (0, import_jsx_runtime379.jsx)(import_components123.Path, { d: "M41 9H7v3h34V9zm-22 5H7v1h12v-1zm22 3H7v1h34v-1zM7 20h34v1H7v-1zm0 12h12v1H7v-1zm34 3H7v1h34v-1zM7 38h34v1H7v-1zm34-11H7v3h34v-3z" }) }); 50020 var imageDateTitle = /* @__PURE__ */ (0, import_jsx_runtime379.jsx)(import_components123.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 48 48", children: /* @__PURE__ */ (0, import_jsx_runtime379.jsx)(import_components123.Path, { d: "M7 9h34v6H7V9zm12 8H7v1h12v-1zm18 3H7v1h30v-1zm0 18H7v1h30v-1zM7 35h12v1H7v-1zm34-8H7v6h34v-6z" }) }); 50021 50022 // packages/block-library/build-module/query/variations.js 50023 var postDate = [ 50024 "core/post-date", 50025 { 50026 metadata: { 50027 bindings: { 50028 datetime: { 50029 source: "core/post-data", 50030 args: { field: "date" } 50031 } 50032 } 50033 } 50034 } 50035 ]; 50036 var variations13 = [ 50037 { 50038 name: "title-date", 50039 title: (0, import_i18n192.__)("Title & Date"), 50040 icon: titleDate, 50041 attributes: {}, 50042 innerBlocks: [ 50043 ["core/post-template", {}, [["core/post-title"], postDate]], 50044 ["core/query-pagination"], 50045 ["core/query-no-results"] 50046 ], 50047 scope: ["block"] 50048 }, 50049 { 50050 name: "title-excerpt", 50051 title: (0, import_i18n192.__)("Title & Excerpt"), 50052 icon: titleExcerpt, 50053 attributes: {}, 50054 innerBlocks: [ 50055 [ 50056 "core/post-template", 50057 {}, 50058 [["core/post-title"], ["core/post-excerpt"]] 50059 ], 50060 ["core/query-pagination"], 50061 ["core/query-no-results"] 50062 ], 50063 scope: ["block"] 50064 }, 50065 { 50066 name: "title-date-excerpt", 50067 title: (0, import_i18n192.__)("Title, Date, & Excerpt"), 50068 icon: titleDateExcerpt, 50069 attributes: {}, 50070 innerBlocks: [ 50071 [ 50072 "core/post-template", 50073 {}, 50074 [["core/post-title"], postDate, ["core/post-excerpt"]] 50075 ], 50076 ["core/query-pagination"], 50077 ["core/query-no-results"] 50078 ], 50079 scope: ["block"] 50080 }, 50081 { 50082 name: "image-date-title", 50083 title: (0, import_i18n192.__)("Image, Date, & Title"), 50084 icon: imageDateTitle, 50085 attributes: {}, 50086 innerBlocks: [ 50087 [ 50088 "core/post-template", 50089 {}, 50090 [ 50091 ["core/post-featured-image"], 50092 postDate, 50093 ["core/post-title"] 50094 ] 50095 ], 50096 ["core/query-pagination"], 50097 ["core/query-no-results"] 50098 ], 50099 scope: ["block"] 50100 } 50101 ]; 50102 var variations_default13 = variations13; 50103 50104 // packages/block-library/build-module/query/deprecated.js 50105 var import_blocks92 = __toESM(require_blocks()); 50106 var import_block_editor203 = __toESM(require_block_editor()); 50107 var import_jsx_runtime380 = __toESM(require_jsx_runtime()); 50108 var { cleanEmptyObject: cleanEmptyObject5 } = unlock(import_block_editor203.privateApis); 50109 var migrateToTaxQuery = (attributes3) => { 50110 const { query } = attributes3; 50111 const { categoryIds, tagIds, taxQuery, ...newQuery } = query; 50112 if (!!categoryIds?.length || !!tagIds?.length) { 50113 newQuery.taxQuery = { 50114 include: { 50115 category: !!categoryIds?.length ? categoryIds : void 0, 50116 post_tag: !!tagIds?.length ? tagIds : void 0 50117 } 50118 }; 50119 } 50120 if (!!Object.keys(taxQuery || {}).length) { 50121 newQuery.taxQuery = { include: taxQuery }; 50122 } 50123 return { 50124 ...attributes3, 50125 query: newQuery 50126 }; 50127 }; 50128 var migrateColors = (attributes3, innerBlocks) => { 50129 const { style: style2, backgroundColor, gradient, textColor, ...newAttributes } = attributes3; 50130 const hasColorStyles = backgroundColor || gradient || textColor || style2?.color || style2?.elements?.link; 50131 if (!hasColorStyles) { 50132 return [attributes3, innerBlocks]; 50133 } 50134 if (style2) { 50135 newAttributes.style = cleanEmptyObject5({ 50136 ...style2, 50137 color: void 0, 50138 elements: { 50139 ...style2.elements, 50140 link: void 0 50141 } 50142 }); 50143 } 50144 if (hasSingleInnerGroupBlock(innerBlocks)) { 50145 const groupBlock = innerBlocks[0]; 50146 const hasStyles = style2?.color || style2?.elements?.link || groupBlock.attributes.style; 50147 const newStyles = hasStyles ? cleanEmptyObject5({ 50148 ...groupBlock.attributes.style, 50149 color: style2?.color, 50150 elements: style2?.elements?.link ? { link: style2?.elements?.link } : void 0 50151 }) : void 0; 50152 const updatedGroupBlock = (0, import_blocks92.createBlock)( 50153 "core/group", 50154 { 50155 ...groupBlock.attributes, 50156 backgroundColor, 50157 gradient, 50158 textColor, 50159 style: newStyles 50160 }, 50161 groupBlock.innerBlocks 50162 ); 50163 return [newAttributes, [updatedGroupBlock]]; 50164 } 50165 const newGroupBlock = (0, import_blocks92.createBlock)( 50166 "core/group", 50167 { 50168 backgroundColor, 50169 gradient, 50170 textColor, 50171 style: cleanEmptyObject5({ 50172 color: style2?.color, 50173 elements: style2?.elements?.link ? { link: style2?.elements?.link } : void 0 50174 }) 50175 }, 50176 innerBlocks 50177 ); 50178 return [newAttributes, [newGroupBlock]]; 50179 }; 50180 var hasSingleInnerGroupBlock = (innerBlocks = []) => innerBlocks.length === 1 && innerBlocks[0].name === "core/group"; 50181 var migrateToConstrainedLayout = (attributes3) => { 50182 const { layout = null } = attributes3; 50183 if (!layout) { 50184 return attributes3; 50185 } 50186 const { inherit = null, contentSize = null, ...newLayout } = layout; 50187 if (inherit || contentSize) { 50188 return { 50189 ...attributes3, 50190 layout: { 50191 ...newLayout, 50192 contentSize, 50193 type: "constrained" 50194 } 50195 }; 50196 } 50197 return attributes3; 50198 }; 50199 var findPostTemplateBlock = (innerBlocks = []) => { 50200 let foundBlock = null; 50201 for (const block of innerBlocks) { 50202 if (block.name === "core/post-template") { 50203 foundBlock = block; 50204 break; 50205 } else if (block.innerBlocks.length) { 50206 foundBlock = findPostTemplateBlock(block.innerBlocks); 50207 } 50208 } 50209 return foundBlock; 50210 }; 50211 var replacePostTemplateBlock = (innerBlocks = [], replacementBlock) => { 50212 innerBlocks.forEach((block, index) => { 50213 if (block.name === "core/post-template") { 50214 innerBlocks.splice(index, 1, replacementBlock); 50215 } else if (block.innerBlocks.length) { 50216 block.innerBlocks = replacePostTemplateBlock( 50217 block.innerBlocks, 50218 replacementBlock 50219 ); 50220 } 50221 }); 50222 return innerBlocks; 50223 }; 50224 var migrateDisplayLayout = (attributes3, innerBlocks) => { 50225 const { displayLayout = null, ...newAttributes } = attributes3; 50226 if (!displayLayout) { 50227 return [attributes3, innerBlocks]; 50228 } 50229 const postTemplateBlock = findPostTemplateBlock(innerBlocks); 50230 if (!postTemplateBlock) { 50231 return [attributes3, innerBlocks]; 50232 } 50233 const { type, columns } = displayLayout; 50234 const updatedLayoutType = type === "flex" ? "grid" : "default"; 50235 const newPostTemplateBlock = (0, import_blocks92.createBlock)( 50236 "core/post-template", 50237 { 50238 ...postTemplateBlock.attributes, 50239 layout: { 50240 type: updatedLayoutType, 50241 ...columns && { columnCount: columns } 50242 } 50243 }, 50244 postTemplateBlock.innerBlocks 50245 ); 50246 return [ 50247 newAttributes, 50248 replacePostTemplateBlock(innerBlocks, newPostTemplateBlock) 50249 ]; 50250 }; 50251 var v124 = { 50252 attributes: { 50253 queryId: { 50254 type: "number" 50255 }, 50256 query: { 50257 type: "object", 50258 default: { 50259 perPage: null, 50260 pages: 0, 50261 offset: 0, 50262 postType: "post", 50263 categoryIds: [], 50264 tagIds: [], 50265 order: "desc", 50266 orderBy: "date", 50267 author: "", 50268 search: "", 50269 exclude: [], 50270 sticky: "", 50271 inherit: true 50272 } 50273 }, 50274 layout: { 50275 type: "object", 50276 default: { 50277 type: "list" 50278 } 50279 } 50280 }, 50281 supports: { 50282 html: false 50283 }, 50284 migrate(attributes3, innerBlocks) { 50285 const withTaxQuery = migrateToTaxQuery(attributes3); 50286 const { layout, ...restWithTaxQuery } = withTaxQuery; 50287 const newAttributes = { 50288 ...restWithTaxQuery, 50289 displayLayout: withTaxQuery.layout 50290 }; 50291 return migrateDisplayLayout(newAttributes, innerBlocks); 50292 }, 50293 save() { 50294 return /* @__PURE__ */ (0, import_jsx_runtime380.jsx)(import_block_editor203.InnerBlocks.Content, {}); 50295 } 50296 }; 50297 var v212 = { 50298 attributes: { 50299 queryId: { 50300 type: "number" 50301 }, 50302 query: { 50303 type: "object", 50304 default: { 50305 perPage: null, 50306 pages: 0, 50307 offset: 0, 50308 postType: "post", 50309 categoryIds: [], 50310 tagIds: [], 50311 order: "desc", 50312 orderBy: "date", 50313 author: "", 50314 search: "", 50315 exclude: [], 50316 sticky: "", 50317 inherit: true 50318 } 50319 }, 50320 tagName: { 50321 type: "string", 50322 default: "div" 50323 }, 50324 displayLayout: { 50325 type: "object", 50326 default: { 50327 type: "list" 50328 } 50329 } 50330 }, 50331 supports: { 50332 align: ["wide", "full"], 50333 html: false, 50334 color: { 50335 gradients: true, 50336 link: true 50337 }, 50338 layout: true 50339 }, 50340 isEligible: ({ query: { categoryIds, tagIds } = {} }) => categoryIds || tagIds, 50341 migrate(attributes3, innerBlocks) { 50342 const withTaxQuery = migrateToTaxQuery(attributes3); 50343 const [withColorAttributes, withColorInnerBlocks] = migrateColors( 50344 withTaxQuery, 50345 innerBlocks 50346 ); 50347 const withConstrainedLayoutAttributes = migrateToConstrainedLayout(withColorAttributes); 50348 return migrateDisplayLayout( 50349 withConstrainedLayoutAttributes, 50350 withColorInnerBlocks 50351 ); 50352 }, 50353 save({ attributes: { tagName: Tag = "div" } }) { 50354 const blockProps = import_block_editor203.useBlockProps.save(); 50355 const innerBlocksProps = import_block_editor203.useInnerBlocksProps.save(blockProps); 50356 return /* @__PURE__ */ (0, import_jsx_runtime380.jsx)(Tag, { ...innerBlocksProps }); 50357 } 50358 }; 50359 var v310 = { 50360 attributes: { 50361 queryId: { 50362 type: "number" 50363 }, 50364 query: { 50365 type: "object", 50366 default: { 50367 perPage: null, 50368 pages: 0, 50369 offset: 0, 50370 postType: "post", 50371 order: "desc", 50372 orderBy: "date", 50373 author: "", 50374 search: "", 50375 exclude: [], 50376 sticky: "", 50377 inherit: true, 50378 taxQuery: null, 50379 parents: [] 50380 } 50381 }, 50382 tagName: { 50383 type: "string", 50384 default: "div" 50385 }, 50386 displayLayout: { 50387 type: "object", 50388 default: { 50389 type: "list" 50390 } 50391 }, 50392 namespace: { 50393 type: "string" 50394 } 50395 }, 50396 supports: { 50397 align: ["wide", "full"], 50398 html: false, 50399 color: { 50400 gradients: true, 50401 link: true, 50402 __experimentalDefaultControls: { 50403 background: true, 50404 text: true 50405 } 50406 }, 50407 layout: true 50408 }, 50409 isEligible(attributes3) { 50410 const { style: style2, backgroundColor, gradient, textColor } = attributes3; 50411 return backgroundColor || gradient || textColor || style2?.color || style2?.elements?.link; 50412 }, 50413 migrate(attributes3, innerBlocks) { 50414 const [withColorAttributes, withColorInnerBlocks] = migrateColors( 50415 attributes3, 50416 innerBlocks 50417 ); 50418 const withConstrainedLayoutAttributes = migrateToConstrainedLayout(withColorAttributes); 50419 return migrateDisplayLayout( 50420 withConstrainedLayoutAttributes, 50421 withColorInnerBlocks 50422 ); 50423 }, 50424 save({ attributes: { tagName: Tag = "div" } }) { 50425 const blockProps = import_block_editor203.useBlockProps.save(); 50426 const innerBlocksProps = import_block_editor203.useInnerBlocksProps.save(blockProps); 50427 return /* @__PURE__ */ (0, import_jsx_runtime380.jsx)(Tag, { ...innerBlocksProps }); 50428 } 50429 }; 50430 var v48 = { 50431 attributes: { 50432 queryId: { 50433 type: "number" 50434 }, 50435 query: { 50436 type: "object", 50437 default: { 50438 perPage: null, 50439 pages: 0, 50440 offset: 0, 50441 postType: "post", 50442 order: "desc", 50443 orderBy: "date", 50444 author: "", 50445 search: "", 50446 exclude: [], 50447 sticky: "", 50448 inherit: true, 50449 taxQuery: null, 50450 parents: [] 50451 } 50452 }, 50453 tagName: { 50454 type: "string", 50455 default: "div" 50456 }, 50457 displayLayout: { 50458 type: "object", 50459 default: { 50460 type: "list" 50461 } 50462 }, 50463 namespace: { 50464 type: "string" 50465 } 50466 }, 50467 supports: { 50468 align: ["wide", "full"], 50469 html: false, 50470 color: { 50471 gradients: true, 50472 link: true, 50473 __experimentalDefaultControls: { 50474 background: true, 50475 text: true 50476 } 50477 }, 50478 layout: true 50479 }, 50480 save({ attributes: { tagName: Tag = "div" } }) { 50481 const blockProps = import_block_editor203.useBlockProps.save(); 50482 const innerBlocksProps = import_block_editor203.useInnerBlocksProps.save(blockProps); 50483 return /* @__PURE__ */ (0, import_jsx_runtime380.jsx)(Tag, { ...innerBlocksProps }); 50484 }, 50485 isEligible: ({ layout }) => layout?.inherit || layout?.contentSize && layout?.type !== "constrained", 50486 migrate(attributes3, innerBlocks) { 50487 const withConstrainedLayoutAttributes = migrateToConstrainedLayout(attributes3); 50488 return migrateDisplayLayout( 50489 withConstrainedLayoutAttributes, 50490 innerBlocks 50491 ); 50492 } 50493 }; 50494 var v58 = { 50495 attributes: { 50496 queryId: { 50497 type: "number" 50498 }, 50499 query: { 50500 type: "object", 50501 default: { 50502 perPage: null, 50503 pages: 0, 50504 offset: 0, 50505 postType: "post", 50506 order: "desc", 50507 orderBy: "date", 50508 author: "", 50509 search: "", 50510 exclude: [], 50511 sticky: "", 50512 inherit: true, 50513 taxQuery: null, 50514 parents: [] 50515 } 50516 }, 50517 tagName: { 50518 type: "string", 50519 default: "div" 50520 }, 50521 displayLayout: { 50522 type: "object", 50523 default: { 50524 type: "list" 50525 } 50526 }, 50527 namespace: { 50528 type: "string" 50529 } 50530 }, 50531 supports: { 50532 align: ["wide", "full"], 50533 anchor: true, 50534 html: false, 50535 layout: true 50536 }, 50537 save({ attributes: { tagName: Tag = "div" } }) { 50538 const blockProps = import_block_editor203.useBlockProps.save(); 50539 const innerBlocksProps = import_block_editor203.useInnerBlocksProps.save(blockProps); 50540 return /* @__PURE__ */ (0, import_jsx_runtime380.jsx)(Tag, { ...innerBlocksProps }); 50541 }, 50542 isEligible: ({ displayLayout }) => { 50543 return !!displayLayout; 50544 }, 50545 migrate: migrateDisplayLayout 50546 }; 50547 var v66 = { 50548 attributes: { 50549 queryId: { 50550 type: "number" 50551 }, 50552 query: { 50553 type: "object", 50554 default: { 50555 perPage: null, 50556 pages: 0, 50557 offset: 0, 50558 postType: "post", 50559 order: "desc", 50560 orderBy: "date", 50561 author: "", 50562 search: "", 50563 exclude: [], 50564 sticky: "", 50565 inherit: true, 50566 taxQuery: null, 50567 parents: [], 50568 format: [] 50569 } 50570 }, 50571 tagName: { 50572 type: "string", 50573 default: "div" 50574 }, 50575 namespace: { 50576 type: "string" 50577 }, 50578 enhancedPagination: { 50579 type: "boolean", 50580 default: false 50581 } 50582 }, 50583 supports: { 50584 align: ["wide", "full"], 50585 html: false, 50586 layout: true, 50587 interactivity: true, 50588 contentRole: true 50589 }, 50590 save({ attributes: { tagName: Tag = "div" } }) { 50591 const blockProps = import_block_editor203.useBlockProps.save(); 50592 const innerBlocksProps = import_block_editor203.useInnerBlocksProps.save(blockProps); 50593 return /* @__PURE__ */ (0, import_jsx_runtime380.jsx)(Tag, { ...innerBlocksProps }); 50594 }, 50595 isEligible: ({ query: { taxQuery } = {} }) => !!taxQuery && Object.keys(taxQuery).some( 50596 (key) => !["include", "exclude"].includes(key) 50597 ), 50598 migrate(attributes3, innerBlocks) { 50599 const withTaxQuery = migrateToTaxQuery(attributes3); 50600 return migrateDisplayLayout(withTaxQuery, innerBlocks); 50601 } 50602 }; 50603 var deprecated14 = [v66, v58, v48, v310, v212, v124]; 50604 var deprecated_default30 = deprecated14; 50605 50606 // packages/block-library/build-module/query/index.js 50607 var { name: name81 } = block_default80; 50608 var settings80 = { 50609 icon: loop_default, 50610 edit: edit_default28, 50611 example: { 50612 viewportWidth: 650, 50613 attributes: { 50614 namespace: "core/posts-list", 50615 query: { 50616 perPage: 4, 50617 pages: 1, 50618 offset: 0, 50619 postType: "post", 50620 order: "desc", 50621 orderBy: "date", 50622 author: "", 50623 search: "", 50624 sticky: "exclude", 50625 inherit: false 50626 } 50627 }, 50628 innerBlocks: [ 50629 { 50630 name: "core/post-template", 50631 attributes: { 50632 layout: { 50633 type: "grid", 50634 columnCount: 2 50635 } 50636 }, 50637 innerBlocks: [ 50638 { 50639 name: "core/post-title" 50640 }, 50641 { 50642 name: "core/post-date", 50643 attributes: { 50644 metadata: { 50645 bindings: { 50646 datetime: { 50647 source: "core/post-data", 50648 args: { field: "date" } 50649 } 50650 } 50651 } 50652 } 50653 }, 50654 { 50655 name: "core/post-excerpt" 50656 } 50657 ] 50658 } 50659 ] 50660 }, 50661 save: save41, 50662 variations: variations_default13, 50663 deprecated: deprecated_default30 50664 }; 50665 var init80 = () => initBlock({ name: name81, metadata: block_default80, settings: settings80 }); 50666 50667 // packages/block-library/build-module/query-no-results/index.js 50668 var query_no_results_exports = {}; 50669 __export(query_no_results_exports, { 50670 init: () => init81, 50671 metadata: () => block_default81, 50672 name: () => name82, 50673 settings: () => settings81 50674 }); 50675 var import_i18n194 = __toESM(require_i18n()); 50676 50677 // packages/block-library/build-module/query-no-results/block.json 50678 var block_default81 = { 50679 $schema: "https://schemas.wp.org/trunk/block.json", 50680 apiVersion: 3, 50681 name: "core/query-no-results", 50682 title: "No Results", 50683 category: "theme", 50684 description: "Contains the block elements used to render content when no query results are found.", 50685 ancestor: ["core/query"], 50686 textdomain: "default", 50687 usesContext: ["queryId", "query"], 50688 supports: { 50689 align: true, 50690 reusable: false, 50691 html: false, 50692 color: { 50693 gradients: true, 50694 link: true 50695 }, 50696 typography: { 50697 fontSize: true, 50698 lineHeight: true, 50699 __experimentalFontFamily: true, 50700 __experimentalFontWeight: true, 50701 __experimentalFontStyle: true, 50702 __experimentalTextTransform: true, 50703 __experimentalTextDecoration: true, 50704 __experimentalLetterSpacing: true, 50705 __experimentalDefaultControls: { 50706 fontSize: true 50707 } 50708 }, 50709 interactivity: { 50710 clientNavigation: true 50711 } 50712 } 50713 }; 50714 50715 // packages/block-library/build-module/query-no-results/edit.js 50716 var import_block_editor204 = __toESM(require_block_editor()); 50717 var import_i18n193 = __toESM(require_i18n()); 50718 var import_jsx_runtime381 = __toESM(require_jsx_runtime()); 50719 var TEMPLATE13 = [ 50720 [ 50721 "core/paragraph", 50722 { 50723 placeholder: (0, import_i18n193.__)( 50724 "Add text or blocks that will display when a query returns no results." 50725 ) 50726 } 50727 ] 50728 ]; 50729 function QueryNoResultsEdit() { 50730 const blockProps = (0, import_block_editor204.useBlockProps)(); 50731 const innerBlocksProps = (0, import_block_editor204.useInnerBlocksProps)(blockProps, { 50732 template: TEMPLATE13 50733 }); 50734 return /* @__PURE__ */ (0, import_jsx_runtime381.jsx)("div", { ...innerBlocksProps }); 50735 } 50736 50737 // packages/block-library/build-module/query-no-results/save.js 50738 var import_block_editor205 = __toESM(require_block_editor()); 50739 var import_jsx_runtime382 = __toESM(require_jsx_runtime()); 50740 function save42() { 50741 return /* @__PURE__ */ (0, import_jsx_runtime382.jsx)(import_block_editor205.InnerBlocks.Content, {}); 50742 } 50743 50744 // packages/block-library/build-module/query-no-results/index.js 50745 var { name: name82 } = block_default81; 50746 var settings81 = { 50747 icon: loop_default, 50748 edit: QueryNoResultsEdit, 50749 save: save42, 50750 example: { 50751 innerBlocks: [ 50752 { 50753 name: "core/paragraph", 50754 attributes: { 50755 content: (0, import_i18n194.__)("No posts were found.") 50756 } 50757 } 50758 ] 50759 } 50760 }; 50761 var init81 = () => initBlock({ name: name82, metadata: block_default81, settings: settings81 }); 50762 50763 // packages/block-library/build-module/query-pagination/index.js 50764 var query_pagination_exports = {}; 50765 __export(query_pagination_exports, { 50766 init: () => init82, 50767 metadata: () => block_default82, 50768 name: () => name83, 50769 settings: () => settings82 50770 }); 50771 50772 // packages/block-library/build-module/query-pagination/block.json 50773 var block_default82 = { 50774 $schema: "https://schemas.wp.org/trunk/block.json", 50775 apiVersion: 3, 50776 name: "core/query-pagination", 50777 title: "Pagination", 50778 category: "theme", 50779 ancestor: ["core/query"], 50780 allowedBlocks: [ 50781 "core/query-pagination-previous", 50782 "core/query-pagination-numbers", 50783 "core/query-pagination-next" 50784 ], 50785 description: "Displays a paginated navigation to next/previous set of posts, when applicable.", 50786 textdomain: "default", 50787 attributes: { 50788 paginationArrow: { 50789 type: "string", 50790 default: "none" 50791 }, 50792 showLabel: { 50793 type: "boolean", 50794 default: true 50795 } 50796 }, 50797 usesContext: ["queryId", "query"], 50798 providesContext: { 50799 paginationArrow: "paginationArrow", 50800 showLabel: "showLabel" 50801 }, 50802 supports: { 50803 align: true, 50804 reusable: false, 50805 html: false, 50806 color: { 50807 gradients: true, 50808 link: true, 50809 __experimentalDefaultControls: { 50810 background: true, 50811 text: true, 50812 link: true 50813 } 50814 }, 50815 layout: { 50816 allowSwitching: false, 50817 allowInheriting: false, 50818 default: { 50819 type: "flex" 50820 } 50821 }, 50822 typography: { 50823 fontSize: true, 50824 lineHeight: true, 50825 __experimentalFontFamily: true, 50826 __experimentalFontWeight: true, 50827 __experimentalFontStyle: true, 50828 __experimentalTextTransform: true, 50829 __experimentalTextDecoration: true, 50830 __experimentalLetterSpacing: true, 50831 __experimentalDefaultControls: { 50832 fontSize: true 50833 } 50834 }, 50835 interactivity: { 50836 clientNavigation: true 50837 } 50838 }, 50839 editorStyle: "wp-block-query-pagination-editor", 50840 style: "wp-block-query-pagination" 50841 }; 50842 50843 // packages/block-library/build-module/query-pagination/edit.js 50844 var import_i18n197 = __toESM(require_i18n()); 50845 var import_block_editor206 = __toESM(require_block_editor()); 50846 var import_data112 = __toESM(require_data()); 50847 var import_components126 = __toESM(require_components()); 50848 var import_element105 = __toESM(require_element()); 50849 50850 // packages/block-library/build-module/query-pagination/query-pagination-arrow-controls.js 50851 var import_i18n195 = __toESM(require_i18n()); 50852 var import_components124 = __toESM(require_components()); 50853 var import_jsx_runtime383 = __toESM(require_jsx_runtime()); 50854 function QueryPaginationArrowControls({ value, onChange }) { 50855 return /* @__PURE__ */ (0, import_jsx_runtime383.jsxs)( 50856 import_components124.__experimentalToggleGroupControl, 50857 { 50858 __next40pxDefaultSize: true, 50859 label: (0, import_i18n195.__)("Arrow"), 50860 value, 50861 onChange, 50862 help: (0, import_i18n195.__)( 50863 "A decorative arrow appended to the next and previous page link." 50864 ), 50865 isBlock: true, 50866 children: [ 50867 /* @__PURE__ */ (0, import_jsx_runtime383.jsx)( 50868 import_components124.__experimentalToggleGroupControlOption, 50869 { 50870 value: "none", 50871 label: (0, import_i18n195._x)( 50872 "None", 50873 "Arrow option for Query Pagination Next/Previous blocks" 50874 ) 50875 } 50876 ), 50877 /* @__PURE__ */ (0, import_jsx_runtime383.jsx)( 50878 import_components124.__experimentalToggleGroupControlOption, 50879 { 50880 value: "arrow", 50881 label: (0, import_i18n195._x)( 50882 "Arrow", 50883 "Arrow option for Query Pagination Next/Previous blocks" 50884 ) 50885 } 50886 ), 50887 /* @__PURE__ */ (0, import_jsx_runtime383.jsx)( 50888 import_components124.__experimentalToggleGroupControlOption, 50889 { 50890 value: "chevron", 50891 label: (0, import_i18n195._x)( 50892 "Chevron", 50893 "Arrow option for Query Pagination Next/Previous blocks" 50894 ) 50895 } 50896 ) 50897 ] 50898 } 50899 ); 50900 } 50901 50902 // packages/block-library/build-module/query-pagination/query-pagination-label-control.js 50903 var import_i18n196 = __toESM(require_i18n()); 50904 var import_components125 = __toESM(require_components()); 50905 var import_jsx_runtime384 = __toESM(require_jsx_runtime()); 50906 function QueryPaginationLabelControl({ value, onChange }) { 50907 return /* @__PURE__ */ (0, import_jsx_runtime384.jsx)( 50908 import_components125.ToggleControl, 50909 { 50910 label: (0, import_i18n196.__)("Show label text"), 50911 help: (0, import_i18n196.__)('Make label text visible, e.g. "Next Page".'), 50912 onChange, 50913 checked: value === true 50914 } 50915 ); 50916 } 50917 50918 // packages/block-library/build-module/query-pagination/edit.js 50919 var import_jsx_runtime385 = __toESM(require_jsx_runtime()); 50920 var TEMPLATE14 = [ 50921 ["core/query-pagination-previous"], 50922 ["core/query-pagination-numbers"], 50923 ["core/query-pagination-next"] 50924 ]; 50925 function QueryPaginationEdit2({ 50926 attributes: { paginationArrow, showLabel }, 50927 setAttributes, 50928 clientId 50929 }) { 50930 const hasNextPreviousBlocks = (0, import_data112.useSelect)( 50931 (select9) => { 50932 const { getBlocks } = select9(import_block_editor206.store); 50933 const innerBlocks = getBlocks(clientId); 50934 return innerBlocks?.find((innerBlock) => { 50935 return [ 50936 "core/query-pagination-next", 50937 "core/query-pagination-previous" 50938 ].includes(innerBlock.name); 50939 }); 50940 }, 50941 [clientId] 50942 ); 50943 const { __unstableMarkNextChangeAsNotPersistent } = (0, import_data112.useDispatch)(import_block_editor206.store); 50944 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 50945 const blockProps = (0, import_block_editor206.useBlockProps)(); 50946 const innerBlocksProps = (0, import_block_editor206.useInnerBlocksProps)(blockProps, { 50947 template: TEMPLATE14 50948 }); 50949 (0, import_element105.useEffect)(() => { 50950 if (paginationArrow === "none" && !showLabel) { 50951 __unstableMarkNextChangeAsNotPersistent(); 50952 setAttributes({ showLabel: true }); 50953 } 50954 }, [ 50955 paginationArrow, 50956 setAttributes, 50957 showLabel, 50958 __unstableMarkNextChangeAsNotPersistent 50959 ]); 50960 return /* @__PURE__ */ (0, import_jsx_runtime385.jsxs)(import_jsx_runtime385.Fragment, { children: [ 50961 hasNextPreviousBlocks && /* @__PURE__ */ (0, import_jsx_runtime385.jsx)(import_block_editor206.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime385.jsxs)( 50962 import_components126.__experimentalToolsPanel, 50963 { 50964 label: (0, import_i18n197.__)("Settings"), 50965 resetAll: () => { 50966 setAttributes({ 50967 paginationArrow: "none", 50968 showLabel: true 50969 }); 50970 }, 50971 dropdownMenuProps, 50972 children: [ 50973 /* @__PURE__ */ (0, import_jsx_runtime385.jsx)( 50974 import_components126.__experimentalToolsPanelItem, 50975 { 50976 hasValue: () => paginationArrow !== "none", 50977 label: (0, import_i18n197.__)("Pagination arrow"), 50978 onDeselect: () => setAttributes({ paginationArrow: "none" }), 50979 isShownByDefault: true, 50980 children: /* @__PURE__ */ (0, import_jsx_runtime385.jsx)( 50981 QueryPaginationArrowControls, 50982 { 50983 value: paginationArrow, 50984 onChange: (value) => { 50985 setAttributes({ paginationArrow: value }); 50986 } 50987 } 50988 ) 50989 } 50990 ), 50991 paginationArrow !== "none" && /* @__PURE__ */ (0, import_jsx_runtime385.jsx)( 50992 import_components126.__experimentalToolsPanelItem, 50993 { 50994 hasValue: () => !showLabel, 50995 label: (0, import_i18n197.__)("Show text"), 50996 onDeselect: () => setAttributes({ showLabel: true }), 50997 isShownByDefault: true, 50998 children: /* @__PURE__ */ (0, import_jsx_runtime385.jsx)( 50999 QueryPaginationLabelControl, 51000 { 51001 value: showLabel, 51002 onChange: (value) => { 51003 setAttributes({ showLabel: value }); 51004 } 51005 } 51006 ) 51007 } 51008 ) 51009 ] 51010 } 51011 ) }), 51012 /* @__PURE__ */ (0, import_jsx_runtime385.jsx)("nav", { ...innerBlocksProps }) 51013 ] }); 51014 } 51015 51016 // packages/block-library/build-module/query-pagination/save.js 51017 var import_block_editor207 = __toESM(require_block_editor()); 51018 var import_jsx_runtime386 = __toESM(require_jsx_runtime()); 51019 function save43() { 51020 return /* @__PURE__ */ (0, import_jsx_runtime386.jsx)(import_block_editor207.InnerBlocks.Content, {}); 51021 } 51022 51023 // packages/block-library/build-module/query-pagination/deprecated.js 51024 var import_block_editor208 = __toESM(require_block_editor()); 51025 var import_jsx_runtime387 = __toESM(require_jsx_runtime()); 51026 var deprecated15 = [ 51027 // Version with wrapper `div` element. 51028 { 51029 save() { 51030 return /* @__PURE__ */ (0, import_jsx_runtime387.jsx)("div", { ...import_block_editor208.useBlockProps.save(), children: /* @__PURE__ */ (0, import_jsx_runtime387.jsx)(import_block_editor208.InnerBlocks.Content, {}) }); 51031 } 51032 } 51033 ]; 51034 var deprecated_default31 = deprecated15; 51035 51036 // packages/block-library/build-module/query-pagination/index.js 51037 var { name: name83 } = block_default82; 51038 var settings82 = { 51039 icon: query_pagination_default, 51040 edit: QueryPaginationEdit2, 51041 save: save43, 51042 deprecated: deprecated_default31 51043 }; 51044 var init82 = () => initBlock({ name: name83, metadata: block_default82, settings: settings82 }); 51045 51046 // packages/block-library/build-module/query-pagination-next/index.js 51047 var query_pagination_next_exports = {}; 51048 __export(query_pagination_next_exports, { 51049 init: () => init83, 51050 metadata: () => block_default83, 51051 name: () => name84, 51052 settings: () => settings83 51053 }); 51054 51055 // packages/block-library/build-module/query-pagination-next/block.json 51056 var block_default83 = { 51057 $schema: "https://schemas.wp.org/trunk/block.json", 51058 apiVersion: 3, 51059 name: "core/query-pagination-next", 51060 title: "Next Page", 51061 category: "theme", 51062 parent: ["core/query-pagination"], 51063 description: "Displays the next posts page link.", 51064 textdomain: "default", 51065 attributes: { 51066 label: { 51067 type: "string" 51068 } 51069 }, 51070 usesContext: [ 51071 "queryId", 51072 "query", 51073 "paginationArrow", 51074 "showLabel", 51075 "enhancedPagination" 51076 ], 51077 supports: { 51078 reusable: false, 51079 html: false, 51080 color: { 51081 gradients: true, 51082 text: false, 51083 __experimentalDefaultControls: { 51084 background: true 51085 } 51086 }, 51087 typography: { 51088 fontSize: true, 51089 lineHeight: true, 51090 __experimentalFontFamily: true, 51091 __experimentalFontWeight: true, 51092 __experimentalFontStyle: true, 51093 __experimentalTextTransform: true, 51094 __experimentalTextDecoration: true, 51095 __experimentalLetterSpacing: true, 51096 __experimentalDefaultControls: { 51097 fontSize: true 51098 } 51099 }, 51100 interactivity: { 51101 clientNavigation: true 51102 } 51103 } 51104 }; 51105 51106 // packages/block-library/build-module/query-pagination-next/edit.js 51107 var import_i18n198 = __toESM(require_i18n()); 51108 var import_block_editor209 = __toESM(require_block_editor()); 51109 var import_jsx_runtime388 = __toESM(require_jsx_runtime()); 51110 var arrowMap3 = { 51111 none: "", 51112 arrow: "\u2192", 51113 chevron: "\xBB" 51114 }; 51115 function QueryPaginationNextEdit({ 51116 attributes: { label }, 51117 setAttributes, 51118 context: { paginationArrow, showLabel } 51119 }) { 51120 const displayArrow = arrowMap3[paginationArrow]; 51121 return /* @__PURE__ */ (0, import_jsx_runtime388.jsxs)( 51122 "a", 51123 { 51124 href: "#pagination-next-pseudo-link", 51125 onClick: (event) => event.preventDefault(), 51126 ...(0, import_block_editor209.useBlockProps)(), 51127 children: [ 51128 showLabel && /* @__PURE__ */ (0, import_jsx_runtime388.jsx)( 51129 import_block_editor209.PlainText, 51130 { 51131 __experimentalVersion: 2, 51132 tagName: "span", 51133 "aria-label": (0, import_i18n198.__)("Next page link"), 51134 placeholder: (0, import_i18n198.__)("Next Page"), 51135 value: label, 51136 onChange: (newLabel) => setAttributes({ label: newLabel }) 51137 } 51138 ), 51139 displayArrow && /* @__PURE__ */ (0, import_jsx_runtime388.jsx)( 51140 "span", 51141 { 51142 className: `wp-block-query-pagination-next-arrow is-arrow-$paginationArrow}`, 51143 "aria-hidden": true, 51144 children: displayArrow 51145 } 51146 ) 51147 ] 51148 } 51149 ); 51150 } 51151 51152 // packages/block-library/build-module/query-pagination-next/index.js 51153 var { name: name84 } = block_default83; 51154 var settings83 = { 51155 icon: query_pagination_next_default, 51156 edit: QueryPaginationNextEdit 51157 }; 51158 var init83 = () => initBlock({ name: name84, metadata: block_default83, settings: settings83 }); 51159 51160 // packages/block-library/build-module/query-pagination-numbers/index.js 51161 var query_pagination_numbers_exports = {}; 51162 __export(query_pagination_numbers_exports, { 51163 init: () => init84, 51164 metadata: () => block_default84, 51165 name: () => name85, 51166 settings: () => settings84 51167 }); 51168 51169 // packages/block-library/build-module/query-pagination-numbers/block.json 51170 var block_default84 = { 51171 $schema: "https://schemas.wp.org/trunk/block.json", 51172 apiVersion: 3, 51173 name: "core/query-pagination-numbers", 51174 title: "Page Numbers", 51175 category: "theme", 51176 parent: ["core/query-pagination"], 51177 description: "Displays a list of page numbers for pagination.", 51178 textdomain: "default", 51179 attributes: { 51180 midSize: { 51181 type: "number", 51182 default: 2 51183 } 51184 }, 51185 usesContext: ["queryId", "query", "enhancedPagination"], 51186 supports: { 51187 reusable: false, 51188 html: false, 51189 color: { 51190 gradients: true, 51191 text: false, 51192 __experimentalDefaultControls: { 51193 background: true 51194 } 51195 }, 51196 typography: { 51197 fontSize: true, 51198 lineHeight: true, 51199 __experimentalFontFamily: true, 51200 __experimentalFontWeight: true, 51201 __experimentalFontStyle: true, 51202 __experimentalTextTransform: true, 51203 __experimentalTextDecoration: true, 51204 __experimentalLetterSpacing: true, 51205 __experimentalDefaultControls: { 51206 fontSize: true 51207 } 51208 }, 51209 interactivity: { 51210 clientNavigation: true 51211 } 51212 }, 51213 editorStyle: "wp-block-query-pagination-numbers-editor" 51214 }; 51215 51216 // packages/block-library/build-module/query-pagination-numbers/edit.js 51217 var import_i18n199 = __toESM(require_i18n()); 51218 var import_block_editor210 = __toESM(require_block_editor()); 51219 var import_components127 = __toESM(require_components()); 51220 var import_jsx_runtime389 = __toESM(require_jsx_runtime()); 51221 var createPaginationItem = (content, Tag = "a", extraClass = "") => /* @__PURE__ */ (0, import_jsx_runtime389.jsx)(Tag, { className: `page-numbers $extraClass}`, children: content }, content); 51222 var previewPaginationNumbers = (midSize) => { 51223 const paginationItems = []; 51224 for (let i2 = 1; i2 <= midSize; i2++) { 51225 paginationItems.push(createPaginationItem(i2)); 51226 } 51227 paginationItems.push( 51228 createPaginationItem(midSize + 1, "span", "current") 51229 ); 51230 for (let i2 = 1; i2 <= midSize; i2++) { 51231 paginationItems.push(createPaginationItem(midSize + 1 + i2)); 51232 } 51233 paginationItems.push(createPaginationItem("...", "span", "dots")); 51234 paginationItems.push(createPaginationItem(midSize * 2 + 3)); 51235 return /* @__PURE__ */ (0, import_jsx_runtime389.jsx)(import_jsx_runtime389.Fragment, { children: paginationItems }); 51236 }; 51237 function QueryPaginationNumbersEdit({ 51238 attributes: attributes3, 51239 setAttributes 51240 }) { 51241 const { midSize } = attributes3; 51242 const paginationNumbers = previewPaginationNumbers( 51243 parseInt(midSize, 10) 51244 ); 51245 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 51246 return /* @__PURE__ */ (0, import_jsx_runtime389.jsxs)(import_jsx_runtime389.Fragment, { children: [ 51247 /* @__PURE__ */ (0, import_jsx_runtime389.jsx)(import_block_editor210.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime389.jsx)( 51248 import_components127.__experimentalToolsPanel, 51249 { 51250 label: (0, import_i18n199.__)("Settings"), 51251 resetAll: () => setAttributes({ midSize: 2 }), 51252 dropdownMenuProps, 51253 children: /* @__PURE__ */ (0, import_jsx_runtime389.jsx)( 51254 import_components127.__experimentalToolsPanelItem, 51255 { 51256 label: (0, import_i18n199.__)("Number of links"), 51257 hasValue: () => midSize !== 2, 51258 onDeselect: () => setAttributes({ midSize: 2 }), 51259 isShownByDefault: true, 51260 children: /* @__PURE__ */ (0, import_jsx_runtime389.jsx)( 51261 import_components127.RangeControl, 51262 { 51263 __next40pxDefaultSize: true, 51264 label: (0, import_i18n199.__)("Number of links"), 51265 help: (0, import_i18n199.__)( 51266 "Specify how many links can appear before and after the current page number. Links to the first, current and last page are always visible." 51267 ), 51268 value: midSize, 51269 onChange: (value) => { 51270 setAttributes({ 51271 midSize: parseInt(value, 10) 51272 }); 51273 }, 51274 min: 0, 51275 max: 5, 51276 withInputField: false 51277 } 51278 ) 51279 } 51280 ) 51281 } 51282 ) }), 51283 /* @__PURE__ */ (0, import_jsx_runtime389.jsx)("div", { ...(0, import_block_editor210.useBlockProps)(), children: paginationNumbers }) 51284 ] }); 51285 } 51286 51287 // packages/block-library/build-module/query-pagination-numbers/index.js 51288 var { name: name85 } = block_default84; 51289 var settings84 = { 51290 icon: query_pagination_numbers_default, 51291 edit: QueryPaginationNumbersEdit, 51292 example: {} 51293 }; 51294 var init84 = () => initBlock({ name: name85, metadata: block_default84, settings: settings84 }); 51295 51296 // packages/block-library/build-module/query-pagination-previous/index.js 51297 var query_pagination_previous_exports = {}; 51298 __export(query_pagination_previous_exports, { 51299 init: () => init85, 51300 metadata: () => block_default85, 51301 name: () => name86, 51302 settings: () => settings85 51303 }); 51304 51305 // packages/block-library/build-module/query-pagination-previous/block.json 51306 var block_default85 = { 51307 $schema: "https://schemas.wp.org/trunk/block.json", 51308 apiVersion: 3, 51309 name: "core/query-pagination-previous", 51310 title: "Previous Page", 51311 category: "theme", 51312 parent: ["core/query-pagination"], 51313 description: "Displays the previous posts page link.", 51314 textdomain: "default", 51315 attributes: { 51316 label: { 51317 type: "string" 51318 } 51319 }, 51320 usesContext: [ 51321 "queryId", 51322 "query", 51323 "paginationArrow", 51324 "showLabel", 51325 "enhancedPagination" 51326 ], 51327 supports: { 51328 reusable: false, 51329 html: false, 51330 color: { 51331 gradients: true, 51332 text: false, 51333 __experimentalDefaultControls: { 51334 background: true 51335 } 51336 }, 51337 typography: { 51338 fontSize: true, 51339 lineHeight: true, 51340 __experimentalFontFamily: true, 51341 __experimentalFontWeight: true, 51342 __experimentalFontStyle: true, 51343 __experimentalTextTransform: true, 51344 __experimentalTextDecoration: true, 51345 __experimentalLetterSpacing: true, 51346 __experimentalDefaultControls: { 51347 fontSize: true 51348 } 51349 }, 51350 interactivity: { 51351 clientNavigation: true 51352 } 51353 } 51354 }; 51355 51356 // packages/block-library/build-module/query-pagination-previous/edit.js 51357 var import_i18n200 = __toESM(require_i18n()); 51358 var import_block_editor211 = __toESM(require_block_editor()); 51359 var import_jsx_runtime390 = __toESM(require_jsx_runtime()); 51360 var arrowMap4 = { 51361 none: "", 51362 arrow: "\u2190", 51363 chevron: "\xAB" 51364 }; 51365 function QueryPaginationPreviousEdit({ 51366 attributes: { label }, 51367 setAttributes, 51368 context: { paginationArrow, showLabel } 51369 }) { 51370 const displayArrow = arrowMap4[paginationArrow]; 51371 return /* @__PURE__ */ (0, import_jsx_runtime390.jsxs)( 51372 "a", 51373 { 51374 href: "#pagination-previous-pseudo-link", 51375 onClick: (event) => event.preventDefault(), 51376 ...(0, import_block_editor211.useBlockProps)(), 51377 children: [ 51378 displayArrow && /* @__PURE__ */ (0, import_jsx_runtime390.jsx)( 51379 "span", 51380 { 51381 className: `wp-block-query-pagination-previous-arrow is-arrow-$paginationArrow}`, 51382 "aria-hidden": true, 51383 children: displayArrow 51384 } 51385 ), 51386 showLabel && /* @__PURE__ */ (0, import_jsx_runtime390.jsx)( 51387 import_block_editor211.PlainText, 51388 { 51389 __experimentalVersion: 2, 51390 tagName: "span", 51391 "aria-label": (0, import_i18n200.__)("Previous page link"), 51392 placeholder: (0, import_i18n200.__)("Previous Page"), 51393 value: label, 51394 onChange: (newLabel) => setAttributes({ label: newLabel }) 51395 } 51396 ) 51397 ] 51398 } 51399 ); 51400 } 51401 51402 // packages/block-library/build-module/query-pagination-previous/index.js 51403 var { name: name86 } = block_default85; 51404 var settings85 = { 51405 icon: query_pagination_previous_default, 51406 edit: QueryPaginationPreviousEdit 51407 }; 51408 var init85 = () => initBlock({ name: name86, metadata: block_default85, settings: settings85 }); 51409 51410 // packages/block-library/build-module/query-title/index.js 51411 var query_title_exports = {}; 51412 __export(query_title_exports, { 51413 init: () => init86, 51414 metadata: () => block_default86, 51415 name: () => name87, 51416 settings: () => settings86 51417 }); 51418 51419 // packages/block-library/build-module/query-title/block.json 51420 var block_default86 = { 51421 $schema: "https://schemas.wp.org/trunk/block.json", 51422 apiVersion: 3, 51423 name: "core/query-title", 51424 title: "Query Title", 51425 category: "theme", 51426 description: "Display the query title.", 51427 textdomain: "default", 51428 attributes: { 51429 type: { 51430 type: "string" 51431 }, 51432 textAlign: { 51433 type: "string" 51434 }, 51435 level: { 51436 type: "number", 51437 default: 1 51438 }, 51439 levelOptions: { 51440 type: "array" 51441 }, 51442 showPrefix: { 51443 type: "boolean", 51444 default: true 51445 }, 51446 showSearchTerm: { 51447 type: "boolean", 51448 default: true 51449 } 51450 }, 51451 example: { 51452 attributes: { 51453 type: "search" 51454 } 51455 }, 51456 usesContext: ["query"], 51457 supports: { 51458 align: ["wide", "full"], 51459 html: false, 51460 color: { 51461 gradients: true, 51462 __experimentalDefaultControls: { 51463 background: true, 51464 text: true 51465 } 51466 }, 51467 spacing: { 51468 margin: true, 51469 padding: true 51470 }, 51471 typography: { 51472 fontSize: true, 51473 lineHeight: true, 51474 __experimentalFontFamily: true, 51475 __experimentalFontStyle: true, 51476 __experimentalFontWeight: true, 51477 __experimentalLetterSpacing: true, 51478 __experimentalTextTransform: true, 51479 __experimentalTextDecoration: true, 51480 __experimentalDefaultControls: { 51481 fontSize: true 51482 } 51483 }, 51484 interactivity: { 51485 clientNavigation: true 51486 }, 51487 __experimentalBorder: { 51488 radius: true, 51489 color: true, 51490 width: true, 51491 style: true, 51492 __experimentalDefaultControls: { 51493 radius: true, 51494 color: true, 51495 width: true, 51496 style: true 51497 } 51498 } 51499 }, 51500 style: "wp-block-query-title" 51501 }; 51502 51503 // packages/block-library/build-module/query-title/edit.js 51504 var import_block_editor212 = __toESM(require_block_editor()); 51505 var import_components128 = __toESM(require_components()); 51506 var import_i18n201 = __toESM(require_i18n()); 51507 51508 // packages/block-library/build-module/query-title/use-archive-label.js 51509 var import_core_data71 = __toESM(require_core_data()); 51510 var import_data113 = __toESM(require_data()); 51511 function useArchiveLabel() { 51512 const templateSlug = (0, import_data113.useSelect)((select9) => { 51513 const { getCurrentPostId, getCurrentPostType, getCurrentTemplateId } = select9("core/editor"); 51514 const currentPostType = getCurrentPostType(); 51515 const templateId = getCurrentTemplateId() || (currentPostType === "wp_template" ? getCurrentPostId() : null); 51516 return templateId ? select9(import_core_data71.store).getEditedEntityRecord( 51517 "postType", 51518 "wp_template", 51519 templateId 51520 )?.slug : null; 51521 }, []); 51522 const taxonomyMatches = templateSlug?.match( 51523 /^(category|tag|taxonomy-([^-]+))$|^(((category|tag)|taxonomy-([^-]+))-(.+))$/ 51524 ); 51525 let taxonomy; 51526 let term; 51527 let isAuthor = false; 51528 let authorSlug; 51529 if (taxonomyMatches) { 51530 if (taxonomyMatches[1]) { 51531 taxonomy = taxonomyMatches[2] ? taxonomyMatches[2] : taxonomyMatches[1]; 51532 } else if (taxonomyMatches[3]) { 51533 taxonomy = taxonomyMatches[6] ? taxonomyMatches[6] : taxonomyMatches[4]; 51534 term = taxonomyMatches[7]; 51535 } 51536 taxonomy = taxonomy === "tag" ? "post_tag" : taxonomy; 51537 } else { 51538 const authorMatches = templateSlug?.match(/^(author)$|^author-(.+)$/); 51539 if (authorMatches) { 51540 isAuthor = true; 51541 if (authorMatches[2]) { 51542 authorSlug = authorMatches[2]; 51543 } 51544 } 51545 } 51546 return (0, import_data113.useSelect)( 51547 (select9) => { 51548 const { getEntityRecords, getTaxonomy, getAuthors } = select9(import_core_data71.store); 51549 let archiveTypeLabel; 51550 let archiveNameLabel; 51551 if (taxonomy) { 51552 archiveTypeLabel = getTaxonomy(taxonomy)?.labels?.singular_name; 51553 } 51554 if (term) { 51555 const records = getEntityRecords("taxonomy", taxonomy, { 51556 slug: term, 51557 per_page: 1 51558 }); 51559 if (records && records[0]) { 51560 archiveNameLabel = records[0].name; 51561 } 51562 } 51563 if (isAuthor) { 51564 archiveTypeLabel = "Author"; 51565 if (authorSlug) { 51566 const authorRecords = getAuthors({ slug: authorSlug }); 51567 if (authorRecords && authorRecords[0]) { 51568 archiveNameLabel = authorRecords[0].name; 51569 } 51570 } 51571 } 51572 return { 51573 archiveTypeLabel, 51574 archiveNameLabel 51575 }; 51576 }, 51577 [authorSlug, isAuthor, taxonomy, term] 51578 ); 51579 } 51580 51581 // packages/block-library/build-module/query-title/use-post-type-label.js 51582 var import_core_data72 = __toESM(require_core_data()); 51583 var import_data114 = __toESM(require_data()); 51584 function usePostTypeLabel(contextPostType) { 51585 const currentPostType = (0, import_data114.useSelect)((select9) => { 51586 const { getCurrentPostType } = select9("core/editor"); 51587 return getCurrentPostType(); 51588 }, []); 51589 return (0, import_data114.useSelect)( 51590 (select9) => { 51591 const { getPostType } = select9(import_core_data72.store); 51592 const postTypeSlug = contextPostType || currentPostType; 51593 const postType = getPostType(postTypeSlug); 51594 return { 51595 postTypeLabel: postType ? postType.labels.singular_name : "" 51596 }; 51597 }, 51598 [contextPostType, currentPostType] 51599 ); 51600 } 51601 51602 // packages/block-library/build-module/query-title/edit.js 51603 var import_jsx_runtime391 = __toESM(require_jsx_runtime()); 51604 var SUPPORTED_TYPES = ["archive", "search", "post-type"]; 51605 function QueryTitleEdit({ 51606 attributes: { 51607 type, 51608 level, 51609 levelOptions, 51610 textAlign, 51611 showPrefix, 51612 showSearchTerm 51613 }, 51614 setAttributes, 51615 context: { query } 51616 }) { 51617 const { archiveTypeLabel, archiveNameLabel } = useArchiveLabel(); 51618 const { postTypeLabel } = usePostTypeLabel(query?.postType); 51619 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 51620 const TagName2 = level === 0 ? "p" : `h$level}`; 51621 const blockProps = (0, import_block_editor212.useBlockProps)({ 51622 className: clsx_default("wp-block-query-title__placeholder", { 51623 [`has-text-align-$textAlign}`]: textAlign 51624 }) 51625 }); 51626 if (!SUPPORTED_TYPES.includes(type)) { 51627 return /* @__PURE__ */ (0, import_jsx_runtime391.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime391.jsx)(import_block_editor212.Warning, { children: (0, import_i18n201.__)("Provided type is not supported.") }) }); 51628 } 51629 let titleElement; 51630 if (type === "archive") { 51631 let title; 51632 if (archiveTypeLabel) { 51633 if (showPrefix) { 51634 if (archiveNameLabel) { 51635 title = (0, import_i18n201.sprintf)( 51636 /* translators: 1: Archive type title e.g: "Category", 2: Label of the archive e.g: "Shoes" */ 51637 (0, import_i18n201._x)("%1$s: %2$s", "archive label"), 51638 archiveTypeLabel, 51639 archiveNameLabel 51640 ); 51641 } else { 51642 title = (0, import_i18n201.sprintf)( 51643 /* translators: %s: Archive type title e.g: "Category", "Tag"... */ 51644 (0, import_i18n201.__)("%s: Name"), 51645 archiveTypeLabel 51646 ); 51647 } 51648 } else if (archiveNameLabel) { 51649 title = archiveNameLabel; 51650 } else { 51651 title = (0, import_i18n201.sprintf)( 51652 /* translators: %s: Archive type title e.g: "Category", "Tag"... */ 51653 (0, import_i18n201.__)("%s name"), 51654 archiveTypeLabel 51655 ); 51656 } 51657 } else { 51658 title = showPrefix ? (0, import_i18n201.__)("Archive type: Name") : (0, import_i18n201.__)("Archive title"); 51659 } 51660 titleElement = /* @__PURE__ */ (0, import_jsx_runtime391.jsxs)(import_jsx_runtime391.Fragment, { children: [ 51661 /* @__PURE__ */ (0, import_jsx_runtime391.jsx)(import_block_editor212.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime391.jsx)( 51662 import_components128.__experimentalToolsPanel, 51663 { 51664 label: (0, import_i18n201.__)("Settings"), 51665 resetAll: () => setAttributes({ 51666 showPrefix: true 51667 }), 51668 dropdownMenuProps, 51669 children: /* @__PURE__ */ (0, import_jsx_runtime391.jsx)( 51670 import_components128.__experimentalToolsPanelItem, 51671 { 51672 hasValue: () => !showPrefix, 51673 label: (0, import_i18n201.__)("Show archive type in title"), 51674 onDeselect: () => setAttributes({ showPrefix: true }), 51675 isShownByDefault: true, 51676 children: /* @__PURE__ */ (0, import_jsx_runtime391.jsx)( 51677 import_components128.ToggleControl, 51678 { 51679 label: (0, import_i18n201.__)("Show archive type in title"), 51680 onChange: () => setAttributes({ 51681 showPrefix: !showPrefix 51682 }), 51683 checked: showPrefix 51684 } 51685 ) 51686 } 51687 ) 51688 } 51689 ) }), 51690 /* @__PURE__ */ (0, import_jsx_runtime391.jsx)(TagName2, { ...blockProps, children: title }) 51691 ] }); 51692 } 51693 if (type === "search") { 51694 titleElement = /* @__PURE__ */ (0, import_jsx_runtime391.jsxs)(import_jsx_runtime391.Fragment, { children: [ 51695 /* @__PURE__ */ (0, import_jsx_runtime391.jsx)(import_block_editor212.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime391.jsx)( 51696 import_components128.__experimentalToolsPanel, 51697 { 51698 label: (0, import_i18n201.__)("Settings"), 51699 resetAll: () => setAttributes({ 51700 showSearchTerm: true 51701 }), 51702 dropdownMenuProps, 51703 children: /* @__PURE__ */ (0, import_jsx_runtime391.jsx)( 51704 import_components128.__experimentalToolsPanelItem, 51705 { 51706 hasValue: () => !showSearchTerm, 51707 label: (0, import_i18n201.__)("Show search term in title"), 51708 onDeselect: () => setAttributes({ showSearchTerm: true }), 51709 isShownByDefault: true, 51710 children: /* @__PURE__ */ (0, import_jsx_runtime391.jsx)( 51711 import_components128.ToggleControl, 51712 { 51713 label: (0, import_i18n201.__)("Show search term in title"), 51714 onChange: () => setAttributes({ 51715 showSearchTerm: !showSearchTerm 51716 }), 51717 checked: showSearchTerm 51718 } 51719 ) 51720 } 51721 ) 51722 } 51723 ) }), 51724 /* @__PURE__ */ (0, import_jsx_runtime391.jsx)(TagName2, { ...blockProps, children: showSearchTerm ? (0, import_i18n201.__)("Search results for: \u201Csearch term\u201D") : (0, import_i18n201.__)("Search results") }) 51725 ] }); 51726 } 51727 if (type === "post-type") { 51728 let title; 51729 if (postTypeLabel) { 51730 if (showPrefix) { 51731 title = (0, import_i18n201.sprintf)( 51732 /* translators: %s: Singular post type name of the queried object */ 51733 (0, import_i18n201.__)('Post Type: "%s"'), 51734 postTypeLabel 51735 ); 51736 } else { 51737 title = postTypeLabel; 51738 } 51739 } else { 51740 title = showPrefix ? (0, import_i18n201.__)("Post Type: Name") : (0, import_i18n201.__)("Name"); 51741 } 51742 titleElement = /* @__PURE__ */ (0, import_jsx_runtime391.jsxs)(import_jsx_runtime391.Fragment, { children: [ 51743 /* @__PURE__ */ (0, import_jsx_runtime391.jsx)(import_block_editor212.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime391.jsx)( 51744 import_components128.__experimentalToolsPanel, 51745 { 51746 label: (0, import_i18n201.__)("Settings"), 51747 resetAll: () => setAttributes({ 51748 showPrefix: true 51749 }), 51750 dropdownMenuProps, 51751 children: /* @__PURE__ */ (0, import_jsx_runtime391.jsx)( 51752 import_components128.__experimentalToolsPanelItem, 51753 { 51754 hasValue: () => !showPrefix, 51755 label: (0, import_i18n201.__)("Show post type label"), 51756 onDeselect: () => setAttributes({ showPrefix: true }), 51757 isShownByDefault: true, 51758 children: /* @__PURE__ */ (0, import_jsx_runtime391.jsx)( 51759 import_components128.ToggleControl, 51760 { 51761 label: (0, import_i18n201.__)("Show post type label"), 51762 onChange: () => setAttributes({ 51763 showPrefix: !showPrefix 51764 }), 51765 checked: showPrefix 51766 } 51767 ) 51768 } 51769 ) 51770 } 51771 ) }), 51772 /* @__PURE__ */ (0, import_jsx_runtime391.jsx)(TagName2, { ...blockProps, children: title }) 51773 ] }); 51774 } 51775 return /* @__PURE__ */ (0, import_jsx_runtime391.jsxs)(import_jsx_runtime391.Fragment, { children: [ 51776 /* @__PURE__ */ (0, import_jsx_runtime391.jsxs)(import_block_editor212.BlockControls, { group: "block", children: [ 51777 /* @__PURE__ */ (0, import_jsx_runtime391.jsx)( 51778 import_block_editor212.HeadingLevelDropdown, 51779 { 51780 value: level, 51781 options: levelOptions, 51782 onChange: (newLevel) => setAttributes({ level: newLevel }) 51783 } 51784 ), 51785 /* @__PURE__ */ (0, import_jsx_runtime391.jsx)( 51786 import_block_editor212.AlignmentControl, 51787 { 51788 value: textAlign, 51789 onChange: (nextAlign) => { 51790 setAttributes({ textAlign: nextAlign }); 51791 } 51792 } 51793 ) 51794 ] }), 51795 titleElement 51796 ] }); 51797 } 51798 51799 // packages/block-library/build-module/query-title/variations.js 51800 var import_i18n202 = __toESM(require_i18n()); 51801 var variations14 = [ 51802 { 51803 isDefault: true, 51804 name: "archive-title", 51805 title: (0, import_i18n202.__)("Archive Title"), 51806 description: (0, import_i18n202.__)( 51807 "Display the archive title based on the queried object." 51808 ), 51809 icon: title_default, 51810 attributes: { 51811 type: "archive" 51812 }, 51813 scope: ["inserter"] 51814 }, 51815 { 51816 isDefault: false, 51817 name: "search-title", 51818 title: (0, import_i18n202.__)("Search Results Title"), 51819 description: (0, import_i18n202.__)( 51820 "Display the search results title based on the queried object." 51821 ), 51822 icon: title_default, 51823 attributes: { 51824 type: "search" 51825 }, 51826 scope: ["inserter"] 51827 }, 51828 { 51829 isDefault: false, 51830 name: "post-type-label", 51831 title: (0, import_i18n202.__)("Post Type Label"), 51832 description: (0, import_i18n202.__)( 51833 "Display the post type label based on the queried object." 51834 ), 51835 icon: title_default, 51836 attributes: { 51837 type: "post-type" 51838 }, 51839 scope: ["inserter"] 51840 } 51841 ]; 51842 variations14.forEach((variation) => { 51843 if (variation.isActive) { 51844 return; 51845 } 51846 variation.isActive = (blockAttributes8, variationAttributes) => blockAttributes8.type === variationAttributes.type; 51847 }); 51848 var variations_default14 = variations14; 51849 51850 // packages/block-library/build-module/query-title/deprecated.js 51851 var v125 = { 51852 attributes: { 51853 type: { 51854 type: "string" 51855 }, 51856 textAlign: { 51857 type: "string" 51858 }, 51859 level: { 51860 type: "number", 51861 default: 1 51862 } 51863 }, 51864 supports: { 51865 align: ["wide", "full"], 51866 html: false, 51867 color: { 51868 gradients: true 51869 }, 51870 spacing: { 51871 margin: true 51872 }, 51873 typography: { 51874 fontSize: true, 51875 lineHeight: true, 51876 __experimentalFontFamily: true 51877 } 51878 }, 51879 save() { 51880 return null; 51881 }, 51882 migrate: migrate_font_family_default, 51883 isEligible({ style: style2 }) { 51884 return style2?.typography?.fontFamily; 51885 } 51886 }; 51887 var deprecated_default32 = [v125]; 51888 51889 // packages/block-library/build-module/query-title/index.js 51890 var { name: name87 } = block_default86; 51891 var settings86 = { 51892 icon: title_default, 51893 edit: QueryTitleEdit, 51894 variations: variations_default14, 51895 deprecated: deprecated_default32 51896 }; 51897 var init86 = () => initBlock({ name: name87, metadata: block_default86, settings: settings86 }); 51898 51899 // packages/block-library/build-module/query-total/index.js 51900 var query_total_exports = {}; 51901 __export(query_total_exports, { 51902 init: () => init87, 51903 metadata: () => block_default87, 51904 name: () => name88, 51905 settings: () => settings87 51906 }); 51907 51908 // packages/block-library/build-module/query-total/block.json 51909 var block_default87 = { 51910 $schema: "https://schemas.wp.org/trunk/block.json", 51911 apiVersion: 3, 51912 name: "core/query-total", 51913 title: "Query Total", 51914 category: "theme", 51915 ancestor: ["core/query"], 51916 description: "Display the total number of results in a query.", 51917 textdomain: "default", 51918 attributes: { 51919 displayType: { 51920 type: "string", 51921 default: "total-results" 51922 } 51923 }, 51924 usesContext: ["queryId", "query"], 51925 supports: { 51926 align: ["wide", "full"], 51927 html: false, 51928 spacing: { 51929 margin: true, 51930 padding: true 51931 }, 51932 color: { 51933 gradients: true, 51934 __experimentalDefaultControls: { 51935 background: true, 51936 text: true 51937 } 51938 }, 51939 typography: { 51940 fontSize: true, 51941 lineHeight: true, 51942 __experimentalFontFamily: true, 51943 __experimentalFontWeight: true, 51944 __experimentalFontStyle: true, 51945 __experimentalTextTransform: true, 51946 __experimentalTextDecoration: true, 51947 __experimentalLetterSpacing: true, 51948 __experimentalDefaultControls: { 51949 fontSize: true 51950 } 51951 }, 51952 __experimentalBorder: { 51953 radius: true, 51954 color: true, 51955 width: true, 51956 style: true, 51957 __experimentalDefaultControls: { 51958 radius: true, 51959 color: true, 51960 width: true, 51961 style: true 51962 } 51963 }, 51964 interactivity: { 51965 clientNavigation: true 51966 } 51967 }, 51968 style: "wp-block-query-total" 51969 }; 51970 51971 // packages/block-library/build-module/query-total/edit.js 51972 var import_block_editor213 = __toESM(require_block_editor()); 51973 var import_components130 = __toESM(require_components()); 51974 var import_i18n203 = __toESM(require_i18n()); 51975 51976 // packages/block-library/build-module/query-total/icons.js 51977 var import_components129 = __toESM(require_components()); 51978 var import_jsx_runtime392 = __toESM(require_jsx_runtime()); 51979 var resultsFound = /* @__PURE__ */ (0, import_jsx_runtime392.jsx)( 51980 import_components129.SVG, 51981 { 51982 xmlns: "http://www.w3.org/2000/svg", 51983 viewBox: "0 0 24 24", 51984 width: "24", 51985 height: "24", 51986 "aria-hidden": "true", 51987 focusable: "false", 51988 children: /* @__PURE__ */ (0, import_jsx_runtime392.jsx)(import_components129.Path, { d: "M4 11h4v2H4v-2zm6 0h6v2h-6v-2zm8 0h2v2h-2v-2z" }) 51989 } 51990 ); 51991 var displayingResults = /* @__PURE__ */ (0, import_jsx_runtime392.jsx)( 51992 import_components129.SVG, 51993 { 51994 xmlns: "http://www.w3.org/2000/svg", 51995 viewBox: "0 0 24 24", 51996 width: "24", 51997 height: "24", 51998 "aria-hidden": "true", 51999 focusable: "false", 52000 children: /* @__PURE__ */ (0, import_jsx_runtime392.jsx)(import_components129.Path, { d: "M4 13h2v-2H4v2zm4 0h10v-2H8v2zm12 0h2v-2h-2v2z" }) 52001 } 52002 ); 52003 var queryTotal = /* @__PURE__ */ (0, import_jsx_runtime392.jsx)( 52004 import_components129.SVG, 52005 { 52006 xmlns: "http://www.w3.org/2000/svg", 52007 viewBox: "0 0 24 24", 52008 width: "24", 52009 height: "24", 52010 "aria-hidden": "true", 52011 focusable: "false", 52012 children: /* @__PURE__ */ (0, import_jsx_runtime392.jsx)(import_components129.Path, { 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" }) 52013 } 52014 ); 52015 52016 // packages/block-library/build-module/query-total/edit.js 52017 var import_jsx_runtime393 = __toESM(require_jsx_runtime()); 52018 function QueryTotalEdit({ attributes: attributes3, setAttributes }) { 52019 const { displayType } = attributes3; 52020 const blockProps = (0, import_block_editor213.useBlockProps)(); 52021 const getButtonPositionIcon = () => { 52022 switch (displayType) { 52023 case "total-results": 52024 return resultsFound; 52025 case "range-display": 52026 return displayingResults; 52027 } 52028 }; 52029 const buttonPositionControls = [ 52030 { 52031 role: "menuitemradio", 52032 title: (0, import_i18n203.__)("Total results"), 52033 isActive: displayType === "total-results", 52034 icon: resultsFound, 52035 onClick: () => { 52036 setAttributes({ displayType: "total-results" }); 52037 } 52038 }, 52039 { 52040 role: "menuitemradio", 52041 title: (0, import_i18n203.__)("Range display"), 52042 isActive: displayType === "range-display", 52043 icon: displayingResults, 52044 onClick: () => { 52045 setAttributes({ displayType: "range-display" }); 52046 } 52047 } 52048 ]; 52049 const controls = /* @__PURE__ */ (0, import_jsx_runtime393.jsx)(import_block_editor213.BlockControls, { children: /* @__PURE__ */ (0, import_jsx_runtime393.jsx)(import_components130.ToolbarGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime393.jsx)( 52050 import_components130.ToolbarDropdownMenu, 52051 { 52052 icon: getButtonPositionIcon(), 52053 label: (0, import_i18n203.__)("Change display type"), 52054 controls: buttonPositionControls 52055 } 52056 ) }) }); 52057 const renderDisplay = () => { 52058 if (displayType === "total-results") { 52059 return /* @__PURE__ */ (0, import_jsx_runtime393.jsx)(import_jsx_runtime393.Fragment, { children: (0, import_i18n203.__)("12 results found") }); 52060 } 52061 if (displayType === "range-display") { 52062 return /* @__PURE__ */ (0, import_jsx_runtime393.jsx)(import_jsx_runtime393.Fragment, { children: (0, import_i18n203.__)("Displaying 1 \u2013 10 of 12") }); 52063 } 52064 return null; 52065 }; 52066 return /* @__PURE__ */ (0, import_jsx_runtime393.jsxs)("div", { ...blockProps, children: [ 52067 controls, 52068 renderDisplay() 52069 ] }); 52070 } 52071 52072 // packages/block-library/build-module/query-total/index.js 52073 var { name: name88 } = block_default87; 52074 var settings87 = { 52075 icon: queryTotal, 52076 edit: QueryTotalEdit 52077 }; 52078 var init87 = () => initBlock({ name: name88, metadata: block_default87, settings: settings87 }); 52079 52080 // packages/block-library/build-module/quote/index.js 52081 var quote_exports = {}; 52082 __export(quote_exports, { 52083 init: () => init88, 52084 metadata: () => block_default88, 52085 name: () => name89, 52086 settings: () => settings88 52087 }); 52088 var import_i18n205 = __toESM(require_i18n()); 52089 52090 // packages/block-library/build-module/quote/deprecated.js 52091 var import_blocks93 = __toESM(require_blocks()); 52092 var import_block_editor214 = __toESM(require_block_editor()); 52093 var import_jsx_runtime394 = __toESM(require_jsx_runtime()); 52094 var migrateToQuoteV2 = (attributes3) => { 52095 const { value, ...restAttributes } = attributes3; 52096 return [ 52097 { 52098 ...restAttributes 52099 }, 52100 value ? (0, import_blocks93.parseWithAttributeSchema)(value, { 52101 type: "array", 52102 source: "query", 52103 selector: "p", 52104 query: { 52105 content: { 52106 type: "string", 52107 source: "html" 52108 } 52109 } 52110 }).map( 52111 ({ content }) => (0, import_blocks93.createBlock)("core/paragraph", { content }) 52112 ) : (0, import_blocks93.createBlock)("core/paragraph") 52113 ]; 52114 }; 52115 var TEXT_ALIGN_OPTIONS2 = ["left", "right", "center"]; 52116 var migrateTextAlign3 = (attributes3, innerBlocks) => { 52117 const { align, ...rest } = attributes3; 52118 const migratedAttributes = TEXT_ALIGN_OPTIONS2.includes(align) ? { ...rest, textAlign: align } : attributes3; 52119 return [migratedAttributes, innerBlocks]; 52120 }; 52121 var migrateLargeStyle = (attributes3, innerBlocks) => { 52122 return [ 52123 { 52124 ...attributes3, 52125 className: attributes3.className ? attributes3.className + " is-style-large" : "is-style-large" 52126 }, 52127 innerBlocks 52128 ]; 52129 }; 52130 var v49 = { 52131 attributes: { 52132 value: { 52133 type: "string", 52134 source: "html", 52135 selector: "blockquote", 52136 multiline: "p", 52137 default: "", 52138 role: "content" 52139 }, 52140 citation: { 52141 type: "string", 52142 source: "html", 52143 selector: "cite", 52144 default: "", 52145 role: "content" 52146 }, 52147 align: { 52148 type: "string" 52149 } 52150 }, 52151 supports: { 52152 anchor: true, 52153 html: false, 52154 __experimentalOnEnter: true, 52155 __experimentalOnMerge: true, 52156 typography: { 52157 fontSize: true, 52158 lineHeight: true, 52159 __experimentalFontFamily: true, 52160 __experimentalFontWeight: true, 52161 __experimentalFontStyle: true, 52162 __experimentalTextTransform: true, 52163 __experimentalTextDecoration: true, 52164 __experimentalLetterSpacing: true, 52165 __experimentalDefaultControls: { 52166 fontSize: true, 52167 fontAppearance: true 52168 } 52169 }, 52170 color: { 52171 gradients: true, 52172 heading: true, 52173 link: true, 52174 __experimentalDefaultControls: { 52175 background: true, 52176 text: true 52177 } 52178 } 52179 }, 52180 isEligible: ({ align }) => TEXT_ALIGN_OPTIONS2.includes(align), 52181 save({ attributes: attributes3 }) { 52182 const { align, citation } = attributes3; 52183 const className = clsx_default({ 52184 [`has-text-align-$align}`]: align 52185 }); 52186 return /* @__PURE__ */ (0, import_jsx_runtime394.jsxs)("blockquote", { ...import_block_editor214.useBlockProps.save({ className }), children: [ 52187 /* @__PURE__ */ (0, import_jsx_runtime394.jsx)(import_block_editor214.InnerBlocks.Content, {}), 52188 !import_block_editor214.RichText.isEmpty(citation) && /* @__PURE__ */ (0, import_jsx_runtime394.jsx)(import_block_editor214.RichText.Content, { tagName: "cite", value: citation }) 52189 ] }); 52190 }, 52191 migrate: migrateTextAlign3 52192 }; 52193 var v311 = { 52194 attributes: { 52195 value: { 52196 type: "string", 52197 source: "html", 52198 selector: "blockquote", 52199 multiline: "p", 52200 default: "", 52201 role: "content" 52202 }, 52203 citation: { 52204 type: "string", 52205 source: "html", 52206 selector: "cite", 52207 default: "", 52208 role: "content" 52209 }, 52210 align: { 52211 type: "string" 52212 } 52213 }, 52214 supports: { 52215 anchor: true, 52216 __experimentalSlashInserter: true, 52217 typography: { 52218 fontSize: true, 52219 lineHeight: true, 52220 __experimentalFontStyle: true, 52221 __experimentalFontWeight: true, 52222 __experimentalLetterSpacing: true, 52223 __experimentalTextTransform: true, 52224 __experimentalDefaultControls: { 52225 fontSize: true, 52226 fontAppearance: true 52227 } 52228 } 52229 }, 52230 save({ attributes: attributes3 }) { 52231 const { align, value, citation } = attributes3; 52232 const className = clsx_default({ 52233 [`has-text-align-$align}`]: align 52234 }); 52235 return /* @__PURE__ */ (0, import_jsx_runtime394.jsxs)("blockquote", { ...import_block_editor214.useBlockProps.save({ className }), children: [ 52236 /* @__PURE__ */ (0, import_jsx_runtime394.jsx)(import_block_editor214.RichText.Content, { multiline: true, value }), 52237 !import_block_editor214.RichText.isEmpty(citation) && /* @__PURE__ */ (0, import_jsx_runtime394.jsx)(import_block_editor214.RichText.Content, { tagName: "cite", value: citation }) 52238 ] }); 52239 }, 52240 migrate(attributes3) { 52241 return migrateTextAlign3(...migrateToQuoteV2(attributes3)); 52242 } 52243 }; 52244 var v213 = { 52245 attributes: { 52246 value: { 52247 type: "string", 52248 source: "html", 52249 selector: "blockquote", 52250 multiline: "p", 52251 default: "" 52252 }, 52253 citation: { 52254 type: "string", 52255 source: "html", 52256 selector: "cite", 52257 default: "" 52258 }, 52259 align: { 52260 type: "string" 52261 } 52262 }, 52263 migrate(attributes3) { 52264 return migrateTextAlign3(...migrateToQuoteV2(attributes3)); 52265 }, 52266 save({ attributes: attributes3 }) { 52267 const { align, value, citation } = attributes3; 52268 return /* @__PURE__ */ (0, import_jsx_runtime394.jsxs)("blockquote", { style: { textAlign: align ? align : null }, children: [ 52269 /* @__PURE__ */ (0, import_jsx_runtime394.jsx)(import_block_editor214.RichText.Content, { multiline: true, value }), 52270 !import_block_editor214.RichText.isEmpty(citation) && /* @__PURE__ */ (0, import_jsx_runtime394.jsx)(import_block_editor214.RichText.Content, { tagName: "cite", value: citation }) 52271 ] }); 52272 } 52273 }; 52274 var v126 = { 52275 attributes: { 52276 value: { 52277 type: "string", 52278 source: "html", 52279 selector: "blockquote", 52280 multiline: "p", 52281 default: "" 52282 }, 52283 citation: { 52284 type: "string", 52285 source: "html", 52286 selector: "cite", 52287 default: "" 52288 }, 52289 align: { 52290 type: "string" 52291 }, 52292 style: { 52293 type: "number", 52294 default: 1 52295 } 52296 }, 52297 migrate(attributes3) { 52298 if (attributes3.style === 2) { 52299 const { style: style2, ...restAttributes } = attributes3; 52300 return migrateTextAlign3( 52301 ...migrateLargeStyle(...migrateToQuoteV2(restAttributes)) 52302 ); 52303 } 52304 return migrateTextAlign3(...migrateToQuoteV2(attributes3)); 52305 }, 52306 save({ attributes: attributes3 }) { 52307 const { align, value, citation, style: style2 } = attributes3; 52308 return /* @__PURE__ */ (0, import_jsx_runtime394.jsxs)( 52309 "blockquote", 52310 { 52311 className: style2 === 2 ? "is-large" : "", 52312 style: { textAlign: align ? align : null }, 52313 children: [ 52314 /* @__PURE__ */ (0, import_jsx_runtime394.jsx)(import_block_editor214.RichText.Content, { multiline: true, value }), 52315 !import_block_editor214.RichText.isEmpty(citation) && /* @__PURE__ */ (0, import_jsx_runtime394.jsx)(import_block_editor214.RichText.Content, { tagName: "cite", value: citation }) 52316 ] 52317 } 52318 ); 52319 } 52320 }; 52321 var v03 = { 52322 attributes: { 52323 value: { 52324 type: "string", 52325 source: "html", 52326 selector: "blockquote", 52327 multiline: "p", 52328 default: "" 52329 }, 52330 citation: { 52331 type: "string", 52332 source: "html", 52333 selector: "footer", 52334 default: "" 52335 }, 52336 align: { 52337 type: "string" 52338 }, 52339 style: { 52340 type: "number", 52341 default: 1 52342 } 52343 }, 52344 migrate(attributes3) { 52345 if (!isNaN(parseInt(attributes3.style))) { 52346 const { style: style2, ...restAttributes } = attributes3; 52347 return migrateTextAlign3(...migrateToQuoteV2(restAttributes)); 52348 } 52349 return migrateTextAlign3(...migrateToQuoteV2(attributes3)); 52350 }, 52351 save({ attributes: attributes3 }) { 52352 const { align, value, citation, style: style2 } = attributes3; 52353 return /* @__PURE__ */ (0, import_jsx_runtime394.jsxs)( 52354 "blockquote", 52355 { 52356 className: `blocks-quote-style-$style2}`, 52357 style: { textAlign: align ? align : null }, 52358 children: [ 52359 /* @__PURE__ */ (0, import_jsx_runtime394.jsx)(import_block_editor214.RichText.Content, { multiline: true, value }), 52360 !import_block_editor214.RichText.isEmpty(citation) && /* @__PURE__ */ (0, import_jsx_runtime394.jsx)(import_block_editor214.RichText.Content, { tagName: "footer", value: citation }) 52361 ] 52362 } 52363 ); 52364 } 52365 }; 52366 var deprecated_default33 = [v49, v311, v213, v126, v03]; 52367 52368 // packages/block-library/build-module/quote/edit.js 52369 var import_i18n204 = __toESM(require_i18n()); 52370 var import_block_editor215 = __toESM(require_block_editor()); 52371 var import_components131 = __toESM(require_components()); 52372 var import_data115 = __toESM(require_data()); 52373 var import_element106 = __toESM(require_element()); 52374 var import_deprecated36 = __toESM(require_deprecated()); 52375 var import_jsx_runtime395 = __toESM(require_jsx_runtime()); 52376 var isWebPlatform2 = import_element106.Platform.OS === "web"; 52377 var TEMPLATE15 = [["core/paragraph", {}]]; 52378 var useMigrateOnLoad2 = (attributes3, clientId) => { 52379 const registry = (0, import_data115.useRegistry)(); 52380 const { updateBlockAttributes, replaceInnerBlocks } = (0, import_data115.useDispatch)(import_block_editor215.store); 52381 (0, import_element106.useEffect)(() => { 52382 if (!attributes3.value) { 52383 return; 52384 } 52385 const [newAttributes, newInnerBlocks] = migrateToQuoteV2(attributes3); 52386 (0, import_deprecated36.default)("Value attribute on the quote block", { 52387 since: "6.0", 52388 version: "6.5", 52389 alternative: "inner blocks" 52390 }); 52391 registry.batch(() => { 52392 updateBlockAttributes(clientId, newAttributes); 52393 replaceInnerBlocks(clientId, newInnerBlocks); 52394 }); 52395 }, [attributes3.value]); 52396 }; 52397 function QuoteEdit({ 52398 attributes: attributes3, 52399 setAttributes, 52400 insertBlocksAfter, 52401 clientId, 52402 className, 52403 style: style2, 52404 isSelected 52405 }) { 52406 const { textAlign, allowedBlocks } = attributes3; 52407 useMigrateOnLoad2(attributes3, clientId); 52408 const blockProps = (0, import_block_editor215.useBlockProps)({ 52409 className: clsx_default(className, { 52410 [`has-text-align-$textAlign}`]: textAlign 52411 }), 52412 ...!isWebPlatform2 && { style: style2 } 52413 }); 52414 const innerBlocksProps = (0, import_block_editor215.useInnerBlocksProps)(blockProps, { 52415 template: TEMPLATE15, 52416 templateInsertUpdatesSelection: true, 52417 __experimentalCaptureToolbars: true, 52418 renderAppender: false, 52419 allowedBlocks 52420 }); 52421 return /* @__PURE__ */ (0, import_jsx_runtime395.jsxs)(import_jsx_runtime395.Fragment, { children: [ 52422 /* @__PURE__ */ (0, import_jsx_runtime395.jsx)(import_block_editor215.BlockControls, { group: "block", children: /* @__PURE__ */ (0, import_jsx_runtime395.jsx)( 52423 import_block_editor215.AlignmentControl, 52424 { 52425 value: textAlign, 52426 onChange: (nextAlign) => { 52427 setAttributes({ textAlign: nextAlign }); 52428 } 52429 } 52430 ) }), 52431 /* @__PURE__ */ (0, import_jsx_runtime395.jsxs)(import_components131.BlockQuotation, { ...innerBlocksProps, children: [ 52432 innerBlocksProps.children, 52433 /* @__PURE__ */ (0, import_jsx_runtime395.jsx)( 52434 Caption, 52435 { 52436 attributeKey: "citation", 52437 tagName: isWebPlatform2 ? "cite" : "p", 52438 style: isWebPlatform2 && { display: "block" }, 52439 isSelected, 52440 attributes: attributes3, 52441 setAttributes, 52442 __unstableMobileNoFocusOnMount: true, 52443 icon: verse_default, 52444 label: (0, import_i18n204.__)("Quote citation"), 52445 placeholder: ( 52446 // translators: placeholder text used for the 52447 // citation 52448 (0, import_i18n204.__)("Add citation") 52449 ), 52450 addLabel: (0, import_i18n204.__)("Add citation"), 52451 removeLabel: (0, import_i18n204.__)("Remove citation"), 52452 excludeElementClassName: true, 52453 className: "wp-block-quote__citation", 52454 insertBlocksAfter, 52455 ...!isWebPlatform2 ? { textAlign } : {} 52456 } 52457 ) 52458 ] }) 52459 ] }); 52460 } 52461 52462 // packages/block-library/build-module/quote/block.json 52463 var block_default88 = { 52464 $schema: "https://schemas.wp.org/trunk/block.json", 52465 apiVersion: 3, 52466 name: "core/quote", 52467 title: "Quote", 52468 category: "text", 52469 description: 'Give quoted text visual emphasis. "In quoting others, we cite ourselves." \u2014 Julio Cort\xE1zar', 52470 keywords: ["blockquote", "cite"], 52471 textdomain: "default", 52472 attributes: { 52473 value: { 52474 type: "string", 52475 source: "html", 52476 selector: "blockquote", 52477 multiline: "p", 52478 default: "", 52479 role: "content" 52480 }, 52481 citation: { 52482 type: "rich-text", 52483 source: "rich-text", 52484 selector: "cite", 52485 role: "content" 52486 }, 52487 textAlign: { 52488 type: "string" 52489 } 52490 }, 52491 supports: { 52492 anchor: true, 52493 align: ["left", "right", "wide", "full"], 52494 html: false, 52495 background: { 52496 backgroundImage: true, 52497 backgroundSize: true, 52498 __experimentalDefaultControls: { 52499 backgroundImage: true 52500 } 52501 }, 52502 __experimentalBorder: { 52503 color: true, 52504 radius: true, 52505 style: true, 52506 width: true, 52507 __experimentalDefaultControls: { 52508 color: true, 52509 radius: true, 52510 style: true, 52511 width: true 52512 } 52513 }, 52514 dimensions: { 52515 minHeight: true, 52516 __experimentalDefaultControls: { 52517 minHeight: false 52518 } 52519 }, 52520 __experimentalOnEnter: true, 52521 __experimentalOnMerge: true, 52522 typography: { 52523 fontSize: true, 52524 lineHeight: true, 52525 __experimentalFontFamily: true, 52526 __experimentalFontWeight: true, 52527 __experimentalFontStyle: true, 52528 __experimentalTextTransform: true, 52529 __experimentalTextDecoration: true, 52530 __experimentalLetterSpacing: true, 52531 __experimentalDefaultControls: { 52532 fontSize: true 52533 } 52534 }, 52535 color: { 52536 gradients: true, 52537 heading: true, 52538 link: true, 52539 __experimentalDefaultControls: { 52540 background: true, 52541 text: true 52542 } 52543 }, 52544 layout: { 52545 allowEditing: false 52546 }, 52547 spacing: { 52548 blockGap: true, 52549 padding: true, 52550 margin: true 52551 }, 52552 interactivity: { 52553 clientNavigation: true 52554 }, 52555 allowedBlocks: true 52556 }, 52557 styles: [ 52558 { 52559 name: "default", 52560 label: "Default", 52561 isDefault: true 52562 }, 52563 { name: "plain", label: "Plain" } 52564 ], 52565 editorStyle: "wp-block-quote-editor", 52566 style: "wp-block-quote" 52567 }; 52568 52569 // packages/block-library/build-module/quote/save.js 52570 var import_block_editor216 = __toESM(require_block_editor()); 52571 var import_jsx_runtime396 = __toESM(require_jsx_runtime()); 52572 function save44({ attributes: attributes3 }) { 52573 const { textAlign, citation } = attributes3; 52574 const className = clsx_default({ 52575 [`has-text-align-$textAlign}`]: textAlign 52576 }); 52577 return /* @__PURE__ */ (0, import_jsx_runtime396.jsxs)("blockquote", { ...import_block_editor216.useBlockProps.save({ className }), children: [ 52578 /* @__PURE__ */ (0, import_jsx_runtime396.jsx)(import_block_editor216.InnerBlocks.Content, {}), 52579 !import_block_editor216.RichText.isEmpty(citation) && /* @__PURE__ */ (0, import_jsx_runtime396.jsx)(import_block_editor216.RichText.Content, { tagName: "cite", value: citation }) 52580 ] }); 52581 } 52582 52583 // packages/block-library/build-module/quote/transforms.js 52584 var import_block_editor217 = __toESM(require_block_editor()); 52585 var import_blocks94 = __toESM(require_blocks()); 52586 var transforms28 = { 52587 from: [ 52588 { 52589 type: "block", 52590 blocks: ["core/pullquote"], 52591 transform: ({ 52592 value, 52593 align, 52594 citation, 52595 anchor, 52596 fontSize, 52597 style: style2 52598 }) => { 52599 return (0, import_blocks94.createBlock)( 52600 "core/quote", 52601 { 52602 align, 52603 citation, 52604 anchor, 52605 fontSize, 52606 style: style2 52607 }, 52608 [(0, import_blocks94.createBlock)("core/paragraph", { content: value })] 52609 ); 52610 } 52611 }, 52612 { 52613 type: "prefix", 52614 prefix: ">", 52615 transform: (content) => (0, import_blocks94.createBlock)("core/quote", {}, [ 52616 (0, import_blocks94.createBlock)("core/paragraph", { content }) 52617 ]) 52618 }, 52619 { 52620 type: "raw", 52621 schema: () => ({ 52622 blockquote: { 52623 children: "*" 52624 } 52625 }), 52626 selector: "blockquote", 52627 transform: (node, handler) => { 52628 return (0, import_blocks94.createBlock)( 52629 "core/quote", 52630 // Don't try to parse any `cite` out of this content. 52631 // * There may be more than one cite. 52632 // * There may be more attribution text than just the cite. 52633 // * If the cite is nested in the quoted text, it's wrong to 52634 // remove it. 52635 {}, 52636 handler({ 52637 HTML: node.innerHTML, 52638 mode: "BLOCKS" 52639 }) 52640 ); 52641 } 52642 }, 52643 { 52644 type: "block", 52645 isMultiBlock: true, 52646 blocks: ["*"], 52647 isMatch: ({}, blocks) => { 52648 if (blocks.length === 1) { 52649 return [ 52650 "core/paragraph", 52651 "core/heading", 52652 "core/list", 52653 "core/pullquote" 52654 ].includes(blocks[0].name); 52655 } 52656 return !blocks.some(({ name: name117 }) => name117 === "core/quote"); 52657 }, 52658 __experimentalConvert: (blocks) => (0, import_blocks94.createBlock)( 52659 "core/quote", 52660 {}, 52661 blocks.map( 52662 (block) => (0, import_blocks94.createBlock)( 52663 block.name, 52664 block.attributes, 52665 block.innerBlocks 52666 ) 52667 ) 52668 ) 52669 } 52670 ], 52671 to: [ 52672 { 52673 type: "block", 52674 blocks: ["core/paragraph"], 52675 transform: ({ citation }, innerBlocks) => import_block_editor217.RichText.isEmpty(citation) ? innerBlocks : [ 52676 ...innerBlocks, 52677 (0, import_blocks94.createBlock)("core/paragraph", { 52678 content: citation 52679 }) 52680 ] 52681 }, 52682 { 52683 type: "block", 52684 blocks: ["core/group"], 52685 transform: ({ citation, anchor }, innerBlocks) => (0, import_blocks94.createBlock)( 52686 "core/group", 52687 { anchor }, 52688 import_block_editor217.RichText.isEmpty(citation) ? innerBlocks : [ 52689 ...innerBlocks, 52690 (0, import_blocks94.createBlock)("core/paragraph", { 52691 content: citation 52692 }) 52693 ] 52694 ) 52695 } 52696 ], 52697 ungroup: ({ citation }, innerBlocks) => import_block_editor217.RichText.isEmpty(citation) ? innerBlocks : [ 52698 ...innerBlocks, 52699 (0, import_blocks94.createBlock)("core/paragraph", { 52700 content: citation 52701 }) 52702 ] 52703 }; 52704 var transforms_default29 = transforms28; 52705 52706 // packages/block-library/build-module/quote/index.js 52707 var { name: name89 } = block_default88; 52708 var settings88 = { 52709 icon: quote_default, 52710 example: { 52711 attributes: { 52712 citation: (0, import_i18n205.__)("Julio Cort\xE1zar") 52713 }, 52714 innerBlocks: [ 52715 { 52716 name: "core/paragraph", 52717 attributes: { 52718 content: (0, import_i18n205.__)("In quoting others, we cite ourselves.") 52719 } 52720 } 52721 ] 52722 }, 52723 transforms: transforms_default29, 52724 edit: QuoteEdit, 52725 save: save44, 52726 deprecated: deprecated_default33 52727 }; 52728 var init88 = () => initBlock({ name: name89, metadata: block_default88, settings: settings88 }); 52729 52730 // packages/block-library/build-module/block/index.js 52731 var block_exports = {}; 52732 __export(block_exports, { 52733 init: () => init89, 52734 metadata: () => block_default89, 52735 name: () => name90, 52736 settings: () => settings89 52737 }); 52738 var import_core_data74 = __toESM(require_core_data()); 52739 var import_data117 = __toESM(require_data()); 52740 var import_html_entities12 = __toESM(require_html_entities()); 52741 52742 // packages/block-library/build-module/block/block.json 52743 var block_default89 = { 52744 $schema: "https://schemas.wp.org/trunk/block.json", 52745 apiVersion: 3, 52746 name: "core/block", 52747 title: "Pattern", 52748 category: "reusable", 52749 description: "Reuse this design across your site.", 52750 keywords: ["reusable"], 52751 textdomain: "default", 52752 attributes: { 52753 ref: { 52754 type: "number" 52755 }, 52756 content: { 52757 type: "object", 52758 default: {} 52759 } 52760 }, 52761 providesContext: { 52762 "pattern/overrides": "content" 52763 }, 52764 supports: { 52765 customClassName: false, 52766 html: false, 52767 inserter: false, 52768 renaming: false, 52769 interactivity: { 52770 clientNavigation: true 52771 } 52772 } 52773 }; 52774 52775 // packages/block-library/build-module/block/edit.js 52776 var import_data116 = __toESM(require_data()); 52777 var import_element107 = __toESM(require_element()); 52778 var import_core_data73 = __toESM(require_core_data()); 52779 var import_components132 = __toESM(require_components()); 52780 var import_i18n206 = __toESM(require_i18n()); 52781 var import_block_editor218 = __toESM(require_block_editor()); 52782 var import_patterns = __toESM(require_patterns()); 52783 var import_blocks95 = __toESM(require_blocks()); 52784 var import_jsx_runtime397 = __toESM(require_jsx_runtime()); 52785 var { useLayoutClasses } = unlock(import_block_editor218.privateApis); 52786 var { hasOverridableBlocks } = unlock(import_patterns.privateApis); 52787 var fullAlignments = ["full", "wide", "left", "right"]; 52788 var useInferredLayout = (blocks, parentLayout) => { 52789 const initialInferredAlignmentRef = (0, import_element107.useRef)(); 52790 return (0, import_element107.useMemo)(() => { 52791 if (!blocks?.length) { 52792 return {}; 52793 } 52794 let alignment = initialInferredAlignmentRef.current; 52795 if (alignment === void 0) { 52796 const isConstrained = parentLayout?.type === "constrained"; 52797 const hasFullAlignment = blocks.some( 52798 (block) => fullAlignments.includes(block.attributes.align) 52799 ); 52800 alignment = isConstrained && hasFullAlignment ? "full" : null; 52801 initialInferredAlignmentRef.current = alignment; 52802 } 52803 const layout = alignment ? parentLayout : void 0; 52804 return { alignment, layout }; 52805 }, [blocks, parentLayout]); 52806 }; 52807 function RecursionWarning() { 52808 const blockProps = (0, import_block_editor218.useBlockProps)(); 52809 return /* @__PURE__ */ (0, import_jsx_runtime397.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime397.jsx)(import_block_editor218.Warning, { children: (0, import_i18n206.__)("Block cannot be rendered inside itself.") }) }); 52810 } 52811 var NOOP2 = () => { 52812 }; 52813 function ReusableBlockEditRecursionWrapper(props) { 52814 const { ref } = props.attributes; 52815 const hasAlreadyRendered = (0, import_block_editor218.useHasRecursion)(ref); 52816 if (hasAlreadyRendered) { 52817 return /* @__PURE__ */ (0, import_jsx_runtime397.jsx)(RecursionWarning, {}); 52818 } 52819 return /* @__PURE__ */ (0, import_jsx_runtime397.jsx)(import_block_editor218.RecursionProvider, { uniqueId: ref, children: /* @__PURE__ */ (0, import_jsx_runtime397.jsx)(ReusableBlockEdit, { ...props }) }); 52820 } 52821 function ReusableBlockControl({ 52822 recordId, 52823 canOverrideBlocks, 52824 hasContent, 52825 handleEditOriginal, 52826 resetContent 52827 }) { 52828 const canUserEdit = (0, import_data116.useSelect)( 52829 (select9) => !!select9(import_core_data73.store).canUser("update", { 52830 kind: "postType", 52831 name: "wp_block", 52832 id: recordId 52833 }), 52834 [recordId] 52835 ); 52836 return /* @__PURE__ */ (0, import_jsx_runtime397.jsxs)(import_jsx_runtime397.Fragment, { children: [ 52837 canUserEdit && !!handleEditOriginal && /* @__PURE__ */ (0, import_jsx_runtime397.jsx)(import_block_editor218.BlockControls, { group: "other", children: /* @__PURE__ */ (0, import_jsx_runtime397.jsx)(import_components132.ToolbarGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime397.jsx)(import_components132.ToolbarButton, { onClick: handleEditOriginal, children: (0, import_i18n206.__)("Edit original") }) }) }), 52838 canOverrideBlocks && /* @__PURE__ */ (0, import_jsx_runtime397.jsx)(import_block_editor218.BlockControls, { group: "other", children: /* @__PURE__ */ (0, import_jsx_runtime397.jsx)(import_components132.ToolbarGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime397.jsx)( 52839 import_components132.ToolbarButton, 52840 { 52841 onClick: resetContent, 52842 disabled: !hasContent, 52843 children: (0, import_i18n206.__)("Reset") 52844 } 52845 ) }) }) 52846 ] }); 52847 } 52848 function ReusableBlockEdit({ 52849 name: name117, 52850 attributes: { ref, content }, 52851 __unstableParentLayout: parentLayout, 52852 setAttributes 52853 }) { 52854 const { record, hasResolved } = (0, import_core_data73.useEntityRecord)( 52855 "postType", 52856 "wp_block", 52857 ref 52858 ); 52859 const [blocks] = (0, import_core_data73.useEntityBlockEditor)("postType", "wp_block", { 52860 id: ref 52861 }); 52862 const isMissing = hasResolved && !record; 52863 const { __unstableMarkLastChangeAsPersistent } = (0, import_data116.useDispatch)(import_block_editor218.store); 52864 const { onNavigateToEntityRecord, hasPatternOverridesSource } = (0, import_data116.useSelect)( 52865 (select9) => { 52866 const { getSettings: getSettings2 } = select9(import_block_editor218.store); 52867 return { 52868 onNavigateToEntityRecord: getSettings2().onNavigateToEntityRecord, 52869 hasPatternOverridesSource: !!(0, import_blocks95.getBlockBindingsSource)( 52870 "core/pattern-overrides" 52871 ) 52872 }; 52873 }, 52874 [] 52875 ); 52876 const canOverrideBlocks = (0, import_element107.useMemo)( 52877 () => hasPatternOverridesSource && hasOverridableBlocks(blocks), 52878 [hasPatternOverridesSource, blocks] 52879 ); 52880 const { alignment, layout } = useInferredLayout(blocks, parentLayout); 52881 const layoutClasses = useLayoutClasses({ layout }, name117); 52882 const blockProps = (0, import_block_editor218.useBlockProps)({ 52883 className: clsx_default( 52884 "block-library-block__reusable-block-container", 52885 layout && layoutClasses, 52886 { [`align$alignment}`]: alignment } 52887 ) 52888 }); 52889 const innerBlocksProps = (0, import_block_editor218.useInnerBlocksProps)(blockProps, { 52890 layout, 52891 value: blocks, 52892 onInput: NOOP2, 52893 onChange: NOOP2, 52894 renderAppender: blocks?.length ? void 0 : import_block_editor218.InnerBlocks.ButtonBlockAppender 52895 }); 52896 const handleEditOriginal = () => { 52897 onNavigateToEntityRecord({ 52898 postId: ref, 52899 postType: "wp_block" 52900 }); 52901 }; 52902 const resetContent = () => { 52903 if (content) { 52904 __unstableMarkLastChangeAsPersistent(); 52905 setAttributes({ content: void 0 }); 52906 } 52907 }; 52908 let children = null; 52909 if (isMissing) { 52910 children = /* @__PURE__ */ (0, import_jsx_runtime397.jsx)(import_block_editor218.Warning, { children: (0, import_i18n206.__)("Block has been deleted or is unavailable.") }); 52911 } 52912 if (!hasResolved) { 52913 children = /* @__PURE__ */ (0, import_jsx_runtime397.jsx)(import_components132.Placeholder, { children: /* @__PURE__ */ (0, import_jsx_runtime397.jsx)(import_components132.Spinner, {}) }); 52914 } 52915 return /* @__PURE__ */ (0, import_jsx_runtime397.jsxs)(import_jsx_runtime397.Fragment, { children: [ 52916 hasResolved && !isMissing && /* @__PURE__ */ (0, import_jsx_runtime397.jsx)( 52917 ReusableBlockControl, 52918 { 52919 recordId: ref, 52920 canOverrideBlocks, 52921 hasContent: !!content, 52922 handleEditOriginal: onNavigateToEntityRecord ? handleEditOriginal : void 0, 52923 resetContent 52924 } 52925 ), 52926 children === null ? /* @__PURE__ */ (0, import_jsx_runtime397.jsx)("div", { ...innerBlocksProps }) : /* @__PURE__ */ (0, import_jsx_runtime397.jsx)("div", { ...blockProps, children }) 52927 ] }); 52928 } 52929 52930 // packages/block-library/build-module/block/deprecated.js 52931 var isObject = (obj) => typeof obj === "object" && !Array.isArray(obj) && obj !== null; 52932 var v214 = { 52933 attributes: { 52934 ref: { 52935 type: "number" 52936 }, 52937 content: { 52938 type: "object" 52939 } 52940 }, 52941 supports: { 52942 customClassName: false, 52943 html: false, 52944 inserter: false, 52945 renaming: false 52946 }, 52947 // Force this deprecation to run whenever there's a values sub-property that's an object. 52948 // 52949 // This could fail in the future if a block ever has binding to a `values` attribute. 52950 // Some extra protection is added to ensure `values` is an object, but this only reduces 52951 // the likelihood, it doesn't solve it completely. 52952 isEligible({ content }) { 52953 return !!content && Object.keys(content).every( 52954 (contentKey) => content[contentKey].values && isObject(content[contentKey].values) 52955 ); 52956 }, 52957 /* 52958 * Old attribute format: 52959 * content: { 52960 * "V98q_x": { 52961 * // The attribute values are now stored as a 'values' sub-property. 52962 * values: { content: 'My content value' }, 52963 * // ... additional metadata, like the block name can be stored here. 52964 * } 52965 * } 52966 * 52967 * New attribute format: 52968 * content: { 52969 * "V98q_x": { 52970 * content: 'My content value', 52971 * } 52972 * } 52973 */ 52974 migrate(attributes3) { 52975 const { content, ...retainedAttributes } = attributes3; 52976 if (content && Object.keys(content).length) { 52977 const updatedContent = { ...content }; 52978 for (const contentKey in content) { 52979 updatedContent[contentKey] = content[contentKey].values; 52980 } 52981 return { 52982 ...retainedAttributes, 52983 content: updatedContent 52984 }; 52985 } 52986 return attributes3; 52987 } 52988 }; 52989 var v127 = { 52990 attributes: { 52991 ref: { 52992 type: "number" 52993 }, 52994 overrides: { 52995 type: "object" 52996 } 52997 }, 52998 supports: { 52999 customClassName: false, 53000 html: false, 53001 inserter: false, 53002 renaming: false 53003 }, 53004 // Force this deprecation to run whenever there's an `overrides` object. 53005 isEligible({ overrides }) { 53006 return !!overrides; 53007 }, 53008 /* 53009 * Old attribute format: 53010 * overrides: { 53011 * // An key is an id that represents a block. 53012 * // The values are the attribute values of the block. 53013 * "V98q_x": { content: 'My content value' } 53014 * } 53015 * 53016 * New attribute format: 53017 * content: { 53018 * "V98q_x": { content: 'My content value' } 53019 * } 53020 * 53021 */ 53022 migrate(attributes3) { 53023 const { overrides, ...retainedAttributes } = attributes3; 53024 const content = {}; 53025 Object.keys(overrides).forEach((id) => { 53026 content[id] = overrides[id]; 53027 }); 53028 return { 53029 ...retainedAttributes, 53030 content 53031 }; 53032 } 53033 }; 53034 var deprecated_default34 = [v214, v127]; 53035 53036 // packages/block-library/build-module/block/index.js 53037 var { name: name90 } = block_default89; 53038 var settings89 = { 53039 deprecated: deprecated_default34, 53040 edit: ReusableBlockEditRecursionWrapper, 53041 icon: symbol_default, 53042 __experimentalLabel: ({ ref }) => { 53043 if (!ref) { 53044 return; 53045 } 53046 const entity = (0, import_data117.select)(import_core_data74.store).getEditedEntityRecord( 53047 "postType", 53048 "wp_block", 53049 ref 53050 ); 53051 if (!entity?.title) { 53052 return; 53053 } 53054 return (0, import_html_entities12.decodeEntities)(entity.title); 53055 } 53056 }; 53057 var init89 = () => initBlock({ name: name90, metadata: block_default89, settings: settings89 }); 53058 53059 // packages/block-library/build-module/read-more/index.js 53060 var read_more_exports = {}; 53061 __export(read_more_exports, { 53062 init: () => init90, 53063 metadata: () => block_default90, 53064 name: () => name91, 53065 settings: () => settings90 53066 }); 53067 var import_i18n208 = __toESM(require_i18n()); 53068 53069 // packages/block-library/build-module/read-more/block.json 53070 var block_default90 = { 53071 $schema: "https://schemas.wp.org/trunk/block.json", 53072 apiVersion: 3, 53073 name: "core/read-more", 53074 title: "Read More", 53075 category: "theme", 53076 description: "Displays the link of a post, page, or any other content-type.", 53077 textdomain: "default", 53078 attributes: { 53079 content: { 53080 type: "string", 53081 role: "content" 53082 }, 53083 linkTarget: { 53084 type: "string", 53085 default: "_self" 53086 } 53087 }, 53088 usesContext: ["postId"], 53089 supports: { 53090 html: false, 53091 color: { 53092 gradients: true, 53093 text: true 53094 }, 53095 typography: { 53096 fontSize: true, 53097 lineHeight: true, 53098 __experimentalFontFamily: true, 53099 __experimentalFontWeight: true, 53100 __experimentalFontStyle: true, 53101 __experimentalTextTransform: true, 53102 __experimentalLetterSpacing: true, 53103 __experimentalTextDecoration: true, 53104 __experimentalDefaultControls: { 53105 fontSize: true, 53106 textDecoration: true 53107 } 53108 }, 53109 spacing: { 53110 margin: ["top", "bottom"], 53111 padding: true, 53112 __experimentalDefaultControls: { 53113 padding: true 53114 } 53115 }, 53116 __experimentalBorder: { 53117 color: true, 53118 radius: true, 53119 width: true, 53120 __experimentalDefaultControls: { 53121 width: true 53122 } 53123 }, 53124 interactivity: { 53125 clientNavigation: true 53126 } 53127 }, 53128 style: "wp-block-read-more" 53129 }; 53130 53131 // packages/block-library/build-module/read-more/edit.js 53132 var import_block_editor219 = __toESM(require_block_editor()); 53133 var import_components133 = __toESM(require_components()); 53134 var import_blocks96 = __toESM(require_blocks()); 53135 var import_i18n207 = __toESM(require_i18n()); 53136 var import_jsx_runtime398 = __toESM(require_jsx_runtime()); 53137 function ReadMore({ 53138 attributes: { content, linkTarget }, 53139 setAttributes, 53140 insertBlocksAfter 53141 }) { 53142 const blockProps = (0, import_block_editor219.useBlockProps)(); 53143 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 53144 return /* @__PURE__ */ (0, import_jsx_runtime398.jsxs)(import_jsx_runtime398.Fragment, { children: [ 53145 /* @__PURE__ */ (0, import_jsx_runtime398.jsx)(import_block_editor219.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime398.jsx)( 53146 import_components133.__experimentalToolsPanel, 53147 { 53148 label: (0, import_i18n207.__)("Settings"), 53149 resetAll: () => setAttributes({ linkTarget: "_self" }), 53150 dropdownMenuProps, 53151 children: /* @__PURE__ */ (0, import_jsx_runtime398.jsx)( 53152 import_components133.__experimentalToolsPanelItem, 53153 { 53154 label: (0, import_i18n207.__)("Open in new tab"), 53155 isShownByDefault: true, 53156 hasValue: () => linkTarget !== "_self", 53157 onDeselect: () => setAttributes({ linkTarget: "_self" }), 53158 children: /* @__PURE__ */ (0, import_jsx_runtime398.jsx)( 53159 import_components133.ToggleControl, 53160 { 53161 label: (0, import_i18n207.__)("Open in new tab"), 53162 onChange: (value) => setAttributes({ 53163 linkTarget: value ? "_blank" : "_self" 53164 }), 53165 checked: linkTarget === "_blank" 53166 } 53167 ) 53168 } 53169 ) 53170 } 53171 ) }), 53172 /* @__PURE__ */ (0, import_jsx_runtime398.jsx)( 53173 import_block_editor219.RichText, 53174 { 53175 identifier: "content", 53176 tagName: "a", 53177 "aria-label": (0, import_i18n207.__)("\u201CRead more\u201D link text"), 53178 placeholder: (0, import_i18n207.__)("Read more"), 53179 value: content, 53180 onChange: (newValue) => setAttributes({ content: newValue }), 53181 __unstableOnSplitAtEnd: () => insertBlocksAfter((0, import_blocks96.createBlock)((0, import_blocks96.getDefaultBlockName)())), 53182 withoutInteractiveFormatting: true, 53183 ...blockProps 53184 } 53185 ) 53186 ] }); 53187 } 53188 53189 // packages/block-library/build-module/read-more/index.js 53190 var { name: name91 } = block_default90; 53191 var settings90 = { 53192 icon: link_default, 53193 edit: ReadMore, 53194 example: { 53195 attributes: { 53196 content: (0, import_i18n208.__)("Read more") 53197 } 53198 } 53199 }; 53200 var init90 = () => initBlock({ name: name91, metadata: block_default90, settings: settings90 }); 53201 53202 // packages/block-library/build-module/rss/index.js 53203 var rss_exports = {}; 53204 __export(rss_exports, { 53205 init: () => init91, 53206 metadata: () => block_default91, 53207 name: () => name92, 53208 settings: () => settings91 53209 }); 53210 53211 // packages/block-library/build-module/rss/block.json 53212 var block_default91 = { 53213 $schema: "https://schemas.wp.org/trunk/block.json", 53214 apiVersion: 3, 53215 name: "core/rss", 53216 title: "RSS", 53217 category: "widgets", 53218 description: "Display entries from any RSS or Atom feed.", 53219 keywords: ["atom", "feed"], 53220 textdomain: "default", 53221 attributes: { 53222 columns: { 53223 type: "number", 53224 default: 2 53225 }, 53226 blockLayout: { 53227 type: "string", 53228 default: "list" 53229 }, 53230 feedURL: { 53231 type: "string", 53232 default: "", 53233 role: "content" 53234 }, 53235 itemsToShow: { 53236 type: "number", 53237 default: 5 53238 }, 53239 displayExcerpt: { 53240 type: "boolean", 53241 default: false 53242 }, 53243 displayAuthor: { 53244 type: "boolean", 53245 default: false 53246 }, 53247 displayDate: { 53248 type: "boolean", 53249 default: false 53250 }, 53251 excerptLength: { 53252 type: "number", 53253 default: 55 53254 }, 53255 openInNewTab: { 53256 type: "boolean", 53257 default: false 53258 }, 53259 rel: { 53260 type: "string" 53261 } 53262 }, 53263 supports: { 53264 align: true, 53265 html: false, 53266 interactivity: { 53267 clientNavigation: true 53268 }, 53269 __experimentalBorder: { 53270 radius: true, 53271 color: true, 53272 width: true, 53273 style: true 53274 }, 53275 spacing: { 53276 margin: true, 53277 padding: true, 53278 __experimentalDefaultControls: { 53279 padding: false, 53280 margin: false 53281 } 53282 }, 53283 color: { 53284 background: true, 53285 text: true, 53286 gradients: true, 53287 link: true 53288 } 53289 }, 53290 editorStyle: "wp-block-rss-editor", 53291 style: "wp-block-rss" 53292 }; 53293 53294 // packages/block-library/build-module/rss/edit.js 53295 var import_block_editor220 = __toESM(require_block_editor()); 53296 var import_components134 = __toESM(require_components()); 53297 var import_element108 = __toESM(require_element()); 53298 var import_i18n209 = __toESM(require_i18n()); 53299 var import_url17 = __toESM(require_url()); 53300 var import_server_side_render5 = __toESM(require_server_side_render()); 53301 var import_jsx_runtime399 = __toESM(require_jsx_runtime()); 53302 var DEFAULT_MIN_ITEMS = 1; 53303 var DEFAULT_MAX_ITEMS = 20; 53304 function RSSEdit({ attributes: attributes3, setAttributes }) { 53305 const [isEditing, setIsEditing] = (0, import_element108.useState)(!attributes3.feedURL); 53306 const { 53307 blockLayout, 53308 columns, 53309 displayAuthor, 53310 displayDate, 53311 displayExcerpt, 53312 excerptLength, 53313 feedURL, 53314 itemsToShow, 53315 openInNewTab, 53316 rel 53317 } = attributes3; 53318 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 53319 function toggleAttribute(propName) { 53320 return () => { 53321 const value = attributes3[propName]; 53322 setAttributes({ [propName]: !value }); 53323 }; 53324 } 53325 function onSubmitURL(event) { 53326 event.preventDefault(); 53327 if (feedURL) { 53328 setAttributes({ feedURL: (0, import_url17.prependHTTP)(feedURL) }); 53329 setIsEditing(false); 53330 } 53331 } 53332 const blockProps = (0, import_block_editor220.useBlockProps)(); 53333 const label = (0, import_i18n209.__)("RSS URL"); 53334 if (isEditing) { 53335 return /* @__PURE__ */ (0, import_jsx_runtime399.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime399.jsx)( 53336 import_components134.Placeholder, 53337 { 53338 icon: rss_default, 53339 label, 53340 instructions: (0, import_i18n209.__)( 53341 "Display entries from any RSS or Atom feed." 53342 ), 53343 children: /* @__PURE__ */ (0, import_jsx_runtime399.jsxs)( 53344 "form", 53345 { 53346 onSubmit: onSubmitURL, 53347 className: "wp-block-rss__placeholder-form", 53348 children: [ 53349 /* @__PURE__ */ (0, import_jsx_runtime399.jsx)( 53350 import_components134.__experimentalInputControl, 53351 { 53352 __next40pxDefaultSize: true, 53353 label, 53354 type: "url", 53355 hideLabelFromVision: true, 53356 placeholder: (0, import_i18n209.__)("Enter URL here\u2026"), 53357 value: feedURL, 53358 onChange: (value) => setAttributes({ feedURL: value }), 53359 className: "wp-block-rss__placeholder-input" 53360 } 53361 ), 53362 /* @__PURE__ */ (0, import_jsx_runtime399.jsx)( 53363 import_components134.Button, 53364 { 53365 __next40pxDefaultSize: true, 53366 variant: "primary", 53367 type: "submit", 53368 children: (0, import_i18n209.__)("Apply") 53369 } 53370 ) 53371 ] 53372 } 53373 ) 53374 } 53375 ) }); 53376 } 53377 const toolbarControls = [ 53378 { 53379 icon: pencil_default, 53380 title: (0, import_i18n209.__)("Edit RSS URL"), 53381 onClick: () => setIsEditing(true) 53382 }, 53383 { 53384 icon: list_default, 53385 title: (0, import_i18n209._x)("List view", "RSS block display setting"), 53386 onClick: () => setAttributes({ blockLayout: "list" }), 53387 isActive: blockLayout === "list" 53388 }, 53389 { 53390 icon: grid_default, 53391 title: (0, import_i18n209._x)("Grid view", "RSS block display setting"), 53392 onClick: () => setAttributes({ blockLayout: "grid" }), 53393 isActive: blockLayout === "grid" 53394 } 53395 ]; 53396 const serverSideAttributes = { 53397 ...attributes3, 53398 style: { 53399 ...attributes3?.style, 53400 border: void 0, 53401 spacing: void 0 53402 } 53403 }; 53404 return /* @__PURE__ */ (0, import_jsx_runtime399.jsxs)(import_jsx_runtime399.Fragment, { children: [ 53405 /* @__PURE__ */ (0, import_jsx_runtime399.jsx)(import_block_editor220.BlockControls, { children: /* @__PURE__ */ (0, import_jsx_runtime399.jsx)(import_components134.ToolbarGroup, { controls: toolbarControls }) }), 53406 /* @__PURE__ */ (0, import_jsx_runtime399.jsx)(import_block_editor220.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime399.jsxs)( 53407 import_components134.__experimentalToolsPanel, 53408 { 53409 label: (0, import_i18n209.__)("Settings"), 53410 resetAll: () => { 53411 setAttributes({ 53412 itemsToShow: 5, 53413 displayAuthor: false, 53414 displayDate: false, 53415 displayExcerpt: false, 53416 excerptLength: 55, 53417 columns: 2, 53418 openInNewTab: false 53419 }); 53420 }, 53421 dropdownMenuProps, 53422 children: [ 53423 /* @__PURE__ */ (0, import_jsx_runtime399.jsx)( 53424 import_components134.__experimentalToolsPanelItem, 53425 { 53426 label: (0, import_i18n209.__)("Number of items"), 53427 hasValue: () => itemsToShow !== 5, 53428 onDeselect: () => setAttributes({ itemsToShow: 5 }), 53429 isShownByDefault: true, 53430 children: /* @__PURE__ */ (0, import_jsx_runtime399.jsx)( 53431 import_components134.RangeControl, 53432 { 53433 __next40pxDefaultSize: true, 53434 label: (0, import_i18n209.__)("Number of items"), 53435 value: itemsToShow, 53436 onChange: (value) => setAttributes({ itemsToShow: value }), 53437 min: DEFAULT_MIN_ITEMS, 53438 max: DEFAULT_MAX_ITEMS, 53439 required: true 53440 } 53441 ) 53442 } 53443 ), 53444 /* @__PURE__ */ (0, import_jsx_runtime399.jsx)( 53445 import_components134.__experimentalToolsPanelItem, 53446 { 53447 label: (0, import_i18n209.__)("Display author"), 53448 hasValue: () => !!displayAuthor, 53449 onDeselect: () => setAttributes({ displayAuthor: false }), 53450 isShownByDefault: true, 53451 children: /* @__PURE__ */ (0, import_jsx_runtime399.jsx)( 53452 import_components134.ToggleControl, 53453 { 53454 label: (0, import_i18n209.__)("Display author"), 53455 checked: displayAuthor, 53456 onChange: toggleAttribute("displayAuthor") 53457 } 53458 ) 53459 } 53460 ), 53461 /* @__PURE__ */ (0, import_jsx_runtime399.jsx)( 53462 import_components134.__experimentalToolsPanelItem, 53463 { 53464 label: (0, import_i18n209.__)("Display date"), 53465 hasValue: () => !!displayDate, 53466 onDeselect: () => setAttributes({ displayDate: false }), 53467 isShownByDefault: true, 53468 children: /* @__PURE__ */ (0, import_jsx_runtime399.jsx)( 53469 import_components134.ToggleControl, 53470 { 53471 label: (0, import_i18n209.__)("Display date"), 53472 checked: displayDate, 53473 onChange: toggleAttribute("displayDate") 53474 } 53475 ) 53476 } 53477 ), 53478 /* @__PURE__ */ (0, import_jsx_runtime399.jsx)( 53479 import_components134.__experimentalToolsPanelItem, 53480 { 53481 label: (0, import_i18n209.__)("Display excerpt"), 53482 hasValue: () => !!displayExcerpt, 53483 onDeselect: () => setAttributes({ displayExcerpt: false }), 53484 isShownByDefault: true, 53485 children: /* @__PURE__ */ (0, import_jsx_runtime399.jsx)( 53486 import_components134.ToggleControl, 53487 { 53488 label: (0, import_i18n209.__)("Display excerpt"), 53489 checked: displayExcerpt, 53490 onChange: toggleAttribute("displayExcerpt") 53491 } 53492 ) 53493 } 53494 ), 53495 displayExcerpt && /* @__PURE__ */ (0, import_jsx_runtime399.jsx)( 53496 import_components134.__experimentalToolsPanelItem, 53497 { 53498 label: (0, import_i18n209.__)("Max number of words in excerpt"), 53499 hasValue: () => excerptLength !== 55, 53500 onDeselect: () => setAttributes({ excerptLength: 55 }), 53501 isShownByDefault: true, 53502 children: /* @__PURE__ */ (0, import_jsx_runtime399.jsx)( 53503 import_components134.RangeControl, 53504 { 53505 __next40pxDefaultSize: true, 53506 label: (0, import_i18n209.__)("Max number of words in excerpt"), 53507 value: excerptLength, 53508 onChange: (value) => setAttributes({ excerptLength: value }), 53509 min: 10, 53510 max: 100, 53511 required: true 53512 } 53513 ) 53514 } 53515 ), 53516 blockLayout === "grid" && /* @__PURE__ */ (0, import_jsx_runtime399.jsx)( 53517 import_components134.__experimentalToolsPanelItem, 53518 { 53519 label: (0, import_i18n209.__)("Columns"), 53520 hasValue: () => columns !== 2, 53521 onDeselect: () => setAttributes({ columns: 2 }), 53522 isShownByDefault: true, 53523 children: /* @__PURE__ */ (0, import_jsx_runtime399.jsx)( 53524 import_components134.RangeControl, 53525 { 53526 __next40pxDefaultSize: true, 53527 label: (0, import_i18n209.__)("Columns"), 53528 value: columns, 53529 onChange: (value) => setAttributes({ columns: value }), 53530 min: 2, 53531 max: 6, 53532 required: true 53533 } 53534 ) 53535 } 53536 ), 53537 /* @__PURE__ */ (0, import_jsx_runtime399.jsx)( 53538 import_components134.__experimentalToolsPanelItem, 53539 { 53540 label: (0, import_i18n209.__)("Open links in new tab"), 53541 hasValue: () => !!openInNewTab, 53542 onDeselect: () => setAttributes({ openInNewTab: false }), 53543 isShownByDefault: true, 53544 children: /* @__PURE__ */ (0, import_jsx_runtime399.jsx)( 53545 import_components134.ToggleControl, 53546 { 53547 label: (0, import_i18n209.__)("Open links in new tab"), 53548 checked: openInNewTab, 53549 onChange: (value) => setAttributes({ openInNewTab: value }) 53550 } 53551 ) 53552 } 53553 ) 53554 ] 53555 } 53556 ) }), 53557 /* @__PURE__ */ (0, import_jsx_runtime399.jsx)(import_block_editor220.InspectorControls, { group: "advanced", children: /* @__PURE__ */ (0, import_jsx_runtime399.jsx)( 53558 import_components134.TextControl, 53559 { 53560 __next40pxDefaultSize: true, 53561 label: (0, import_i18n209.__)("Link relation"), 53562 help: (0, import_element108.createInterpolateElement)( 53563 (0, import_i18n209.__)( 53564 "The <a>Link Relation</a> attribute defines the relationship between a linked resource and the current document." 53565 ), 53566 { 53567 a: /* @__PURE__ */ (0, import_jsx_runtime399.jsx)(import_components134.ExternalLink, { href: "https://developer.mozilla.org/docs/Web/HTML/Attributes/rel" }) 53568 } 53569 ), 53570 value: rel || "", 53571 onChange: (value) => setAttributes({ rel: value }) 53572 } 53573 ) }), 53574 /* @__PURE__ */ (0, import_jsx_runtime399.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime399.jsx)(import_components134.Disabled, { children: /* @__PURE__ */ (0, import_jsx_runtime399.jsx)( 53575 import_server_side_render5.default, 53576 { 53577 block: "core/rss", 53578 attributes: serverSideAttributes 53579 } 53580 ) }) }) 53581 ] }); 53582 } 53583 53584 // packages/block-library/build-module/rss/index.js 53585 var { name: name92 } = block_default91; 53586 var settings91 = { 53587 icon: rss_default, 53588 example: { 53589 attributes: { 53590 feedURL: "https://wordpress.org" 53591 } 53592 }, 53593 edit: RSSEdit 53594 }; 53595 var init91 = () => initBlock({ name: name92, metadata: block_default91, settings: settings91 }); 53596 53597 // packages/block-library/build-module/search/index.js 53598 var search_exports = {}; 53599 __export(search_exports, { 53600 init: () => init92, 53601 metadata: () => block_default92, 53602 name: () => name93, 53603 settings: () => settings92 53604 }); 53605 var import_i18n212 = __toESM(require_i18n()); 53606 var import_blocks97 = __toESM(require_blocks()); 53607 53608 // packages/block-library/build-module/search/block.json 53609 var block_default92 = { 53610 $schema: "https://schemas.wp.org/trunk/block.json", 53611 apiVersion: 3, 53612 name: "core/search", 53613 title: "Search", 53614 category: "widgets", 53615 description: "Help visitors find your content.", 53616 keywords: ["find"], 53617 textdomain: "default", 53618 attributes: { 53619 label: { 53620 type: "string", 53621 role: "content" 53622 }, 53623 showLabel: { 53624 type: "boolean", 53625 default: true 53626 }, 53627 placeholder: { 53628 type: "string", 53629 default: "", 53630 role: "content" 53631 }, 53632 width: { 53633 type: "number" 53634 }, 53635 widthUnit: { 53636 type: "string" 53637 }, 53638 buttonText: { 53639 type: "string", 53640 role: "content" 53641 }, 53642 buttonPosition: { 53643 type: "string", 53644 default: "button-outside" 53645 }, 53646 buttonUseIcon: { 53647 type: "boolean", 53648 default: false 53649 }, 53650 query: { 53651 type: "object", 53652 default: {} 53653 }, 53654 isSearchFieldHidden: { 53655 type: "boolean", 53656 default: false 53657 } 53658 }, 53659 supports: { 53660 align: ["left", "center", "right"], 53661 color: { 53662 gradients: true, 53663 __experimentalSkipSerialization: true, 53664 __experimentalDefaultControls: { 53665 background: true, 53666 text: true 53667 } 53668 }, 53669 interactivity: true, 53670 typography: { 53671 __experimentalSkipSerialization: true, 53672 __experimentalSelector: ".wp-block-search__label, .wp-block-search__input, .wp-block-search__button", 53673 fontSize: true, 53674 lineHeight: true, 53675 __experimentalFontFamily: true, 53676 __experimentalFontWeight: true, 53677 __experimentalFontStyle: true, 53678 __experimentalTextTransform: true, 53679 __experimentalTextDecoration: true, 53680 __experimentalLetterSpacing: true, 53681 __experimentalDefaultControls: { 53682 fontSize: true 53683 } 53684 }, 53685 __experimentalBorder: { 53686 color: true, 53687 radius: true, 53688 width: true, 53689 __experimentalSkipSerialization: true, 53690 __experimentalDefaultControls: { 53691 color: true, 53692 radius: true, 53693 width: true 53694 } 53695 }, 53696 spacing: { 53697 margin: true 53698 }, 53699 html: false 53700 }, 53701 editorStyle: "wp-block-search-editor", 53702 style: "wp-block-search" 53703 }; 53704 53705 // packages/block-library/build-module/search/edit.js 53706 var import_block_editor221 = __toESM(require_block_editor()); 53707 var import_data118 = __toESM(require_data()); 53708 var import_element109 = __toESM(require_element()); 53709 var import_components135 = __toESM(require_components()); 53710 var import_compose45 = __toESM(require_compose()); 53711 var import_i18n210 = __toESM(require_i18n()); 53712 var import_dom7 = __toESM(require_dom()); 53713 53714 // packages/block-library/build-module/search/utils.js 53715 var PC_WIDTH_DEFAULT = 50; 53716 var PX_WIDTH_DEFAULT = 350; 53717 var MIN_WIDTH = 220; 53718 function isPercentageUnit(unit) { 53719 return unit === "%"; 53720 } 53721 53722 // packages/block-library/build-module/search/edit.js 53723 var import_jsx_runtime400 = __toESM(require_jsx_runtime()); 53724 var DEFAULT_INNER_PADDING = "4px"; 53725 var PERCENTAGE_WIDTHS = [25, 50, 75, 100]; 53726 function SearchEdit({ 53727 className, 53728 attributes: attributes3, 53729 setAttributes, 53730 toggleSelection, 53731 isSelected, 53732 clientId 53733 }) { 53734 const { 53735 label, 53736 showLabel, 53737 placeholder: placeholder2, 53738 width, 53739 widthUnit, 53740 align, 53741 buttonText, 53742 buttonPosition, 53743 buttonUseIcon, 53744 isSearchFieldHidden, 53745 style: style2 53746 } = attributes3; 53747 const wasJustInsertedIntoNavigationBlock = (0, import_data118.useSelect)( 53748 (select9) => { 53749 const { getBlockParentsByBlockName, wasBlockJustInserted } = select9(import_block_editor221.store); 53750 return !!getBlockParentsByBlockName(clientId, "core/navigation")?.length && wasBlockJustInserted(clientId); 53751 }, 53752 [clientId] 53753 ); 53754 const { __unstableMarkNextChangeAsNotPersistent } = (0, import_data118.useDispatch)(import_block_editor221.store); 53755 (0, import_element109.useEffect)(() => { 53756 if (wasJustInsertedIntoNavigationBlock) { 53757 __unstableMarkNextChangeAsNotPersistent(); 53758 setAttributes({ 53759 showLabel: false, 53760 buttonUseIcon: true, 53761 buttonPosition: "button-inside" 53762 }); 53763 } 53764 }, [ 53765 __unstableMarkNextChangeAsNotPersistent, 53766 wasJustInsertedIntoNavigationBlock, 53767 setAttributes 53768 ]); 53769 const borderRadius = style2?.border?.radius; 53770 let borderProps = (0, import_block_editor221.__experimentalUseBorderProps)(attributes3); 53771 if (typeof borderRadius === "number") { 53772 borderProps = { 53773 ...borderProps, 53774 style: { 53775 ...borderProps.style, 53776 borderRadius: `$borderRadius}px` 53777 } 53778 }; 53779 } 53780 const colorProps = (0, import_block_editor221.__experimentalUseColorProps)(attributes3); 53781 const [fluidTypographySettings, layout] = (0, import_block_editor221.useSettings)( 53782 "typography.fluid", 53783 "layout" 53784 ); 53785 const typographyProps = (0, import_block_editor221.getTypographyClassesAndStyles)(attributes3, { 53786 typography: { 53787 fluid: fluidTypographySettings 53788 }, 53789 layout: { 53790 wideSize: layout?.wideSize 53791 } 53792 }); 53793 const unitControlInstanceId = (0, import_compose45.useInstanceId)(import_components135.__experimentalUnitControl); 53794 const unitControlInputId = `wp-block-search__width-$unitControlInstanceId}`; 53795 const isButtonPositionInside = "button-inside" === buttonPosition; 53796 const isButtonPositionOutside = "button-outside" === buttonPosition; 53797 const hasNoButton = "no-button" === buttonPosition; 53798 const hasOnlyButton = "button-only" === buttonPosition; 53799 const searchFieldRef = (0, import_element109.useRef)(); 53800 const buttonRef = (0, import_element109.useRef)(); 53801 const units = (0, import_components135.__experimentalUseCustomUnits)({ 53802 availableUnits: ["%", "px"], 53803 defaultValues: { "%": PC_WIDTH_DEFAULT, px: PX_WIDTH_DEFAULT } 53804 }); 53805 (0, import_element109.useEffect)(() => { 53806 if (hasOnlyButton && !isSelected) { 53807 setAttributes({ 53808 isSearchFieldHidden: true 53809 }); 53810 } 53811 }, [hasOnlyButton, isSelected, setAttributes]); 53812 (0, import_element109.useEffect)(() => { 53813 if (!hasOnlyButton || !isSelected) { 53814 return; 53815 } 53816 setAttributes({ 53817 isSearchFieldHidden: false 53818 }); 53819 }, [hasOnlyButton, isSelected, setAttributes, width]); 53820 const getBlockClassNames = () => { 53821 return clsx_default( 53822 className, 53823 isButtonPositionInside ? "wp-block-search__button-inside" : void 0, 53824 isButtonPositionOutside ? "wp-block-search__button-outside" : void 0, 53825 hasNoButton ? "wp-block-search__no-button" : void 0, 53826 hasOnlyButton ? "wp-block-search__button-only" : void 0, 53827 !buttonUseIcon && !hasNoButton ? "wp-block-search__text-button" : void 0, 53828 buttonUseIcon && !hasNoButton ? "wp-block-search__icon-button" : void 0, 53829 hasOnlyButton && isSearchFieldHidden ? "wp-block-search__searchfield-hidden" : void 0 53830 ); 53831 }; 53832 const buttonPositionControls = [ 53833 { 53834 label: (0, import_i18n210.__)("Button outside"), 53835 value: "button-outside" 53836 }, 53837 { 53838 label: (0, import_i18n210.__)("Button inside"), 53839 value: "button-inside" 53840 }, 53841 { 53842 label: (0, import_i18n210.__)("No button"), 53843 value: "no-button" 53844 }, 53845 { 53846 label: (0, import_i18n210.__)("Button only"), 53847 value: "button-only" 53848 } 53849 ]; 53850 const getResizableSides = () => { 53851 if (hasOnlyButton) { 53852 return {}; 53853 } 53854 return { 53855 right: align !== "right", 53856 left: align === "right" 53857 }; 53858 }; 53859 const renderTextField = () => { 53860 const textFieldClasses = clsx_default( 53861 "wp-block-search__input", 53862 isButtonPositionInside ? void 0 : borderProps.className, 53863 typographyProps.className 53864 ); 53865 const textFieldStyles = { 53866 ...isButtonPositionInside ? { 53867 borderRadius: borderProps.style?.borderRadius, 53868 borderTopLeftRadius: borderProps.style?.borderTopLeftRadius, 53869 borderTopRightRadius: borderProps.style?.borderTopRightRadius, 53870 borderBottomLeftRadius: borderProps.style?.borderBottomLeftRadius, 53871 borderBottomRightRadius: borderProps.style?.borderBottomRightRadius 53872 } : borderProps.style, 53873 ...typographyProps.style, 53874 textDecoration: void 0 53875 }; 53876 return /* @__PURE__ */ (0, import_jsx_runtime400.jsx)( 53877 "input", 53878 { 53879 type: "search", 53880 className: textFieldClasses, 53881 style: textFieldStyles, 53882 "aria-label": (0, import_i18n210.__)("Optional placeholder text"), 53883 placeholder: placeholder2 ? void 0 : (0, import_i18n210.__)("Optional placeholder\u2026"), 53884 value: placeholder2, 53885 onChange: (event) => setAttributes({ placeholder: event.target.value }), 53886 ref: searchFieldRef 53887 } 53888 ); 53889 }; 53890 const renderButton = () => { 53891 const buttonClasses = clsx_default( 53892 "wp-block-search__button", 53893 colorProps.className, 53894 typographyProps.className, 53895 isButtonPositionInside ? void 0 : borderProps.className, 53896 buttonUseIcon ? "has-icon" : void 0, 53897 (0, import_block_editor221.__experimentalGetElementClassName)("button") 53898 ); 53899 const buttonStyles = { 53900 ...colorProps.style, 53901 ...typographyProps.style, 53902 ...isButtonPositionInside ? { 53903 borderRadius: borderProps.style?.borderRadius, 53904 borderTopLeftRadius: borderProps.style?.borderTopLeftRadius, 53905 borderTopRightRadius: borderProps.style?.borderTopRightRadius, 53906 borderBottomLeftRadius: borderProps.style?.borderBottomLeftRadius, 53907 borderBottomRightRadius: borderProps.style?.borderBottomRightRadius 53908 } : borderProps.style 53909 }; 53910 const handleButtonClick = () => { 53911 if (hasOnlyButton) { 53912 setAttributes({ 53913 isSearchFieldHidden: !isSearchFieldHidden 53914 }); 53915 } 53916 }; 53917 return /* @__PURE__ */ (0, import_jsx_runtime400.jsxs)(import_jsx_runtime400.Fragment, { children: [ 53918 buttonUseIcon && /* @__PURE__ */ (0, import_jsx_runtime400.jsx)( 53919 "button", 53920 { 53921 type: "button", 53922 className: buttonClasses, 53923 style: buttonStyles, 53924 "aria-label": buttonText ? (0, import_dom7.__unstableStripHTML)(buttonText) : (0, import_i18n210.__)("Search"), 53925 onClick: handleButtonClick, 53926 ref: buttonRef, 53927 children: /* @__PURE__ */ (0, import_jsx_runtime400.jsx)(icon_default5, { icon: search_default }) 53928 } 53929 ), 53930 !buttonUseIcon && /* @__PURE__ */ (0, import_jsx_runtime400.jsx)( 53931 import_block_editor221.RichText, 53932 { 53933 identifier: "buttonText", 53934 className: buttonClasses, 53935 style: buttonStyles, 53936 "aria-label": (0, import_i18n210.__)("Button text"), 53937 placeholder: (0, import_i18n210.__)("Add button text\u2026"), 53938 withoutInteractiveFormatting: true, 53939 value: buttonText, 53940 onChange: (html) => setAttributes({ buttonText: html }), 53941 onClick: handleButtonClick 53942 } 53943 ) 53944 ] }); 53945 }; 53946 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 53947 const controls = /* @__PURE__ */ (0, import_jsx_runtime400.jsx)(import_jsx_runtime400.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime400.jsx)(import_block_editor221.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime400.jsxs)( 53948 import_components135.__experimentalToolsPanel, 53949 { 53950 label: (0, import_i18n210.__)("Settings"), 53951 resetAll: () => { 53952 setAttributes({ 53953 width: void 0, 53954 widthUnit: void 0, 53955 showLabel: true, 53956 buttonUseIcon: false, 53957 buttonPosition: "button-outside", 53958 isSearchFieldHidden: false 53959 }); 53960 }, 53961 dropdownMenuProps, 53962 children: [ 53963 /* @__PURE__ */ (0, import_jsx_runtime400.jsx)( 53964 import_components135.__experimentalToolsPanelItem, 53965 { 53966 hasValue: () => !showLabel, 53967 label: (0, import_i18n210.__)("Show label"), 53968 onDeselect: () => { 53969 setAttributes({ 53970 showLabel: true 53971 }); 53972 }, 53973 isShownByDefault: true, 53974 children: /* @__PURE__ */ (0, import_jsx_runtime400.jsx)( 53975 import_components135.ToggleControl, 53976 { 53977 checked: showLabel, 53978 label: (0, import_i18n210.__)("Show label"), 53979 onChange: (value) => setAttributes({ 53980 showLabel: value 53981 }) 53982 } 53983 ) 53984 } 53985 ), 53986 /* @__PURE__ */ (0, import_jsx_runtime400.jsx)( 53987 import_components135.__experimentalToolsPanelItem, 53988 { 53989 hasValue: () => buttonPosition !== "button-outside", 53990 label: (0, import_i18n210.__)("Button position"), 53991 onDeselect: () => { 53992 setAttributes({ 53993 buttonPosition: "button-outside", 53994 isSearchFieldHidden: false 53995 }); 53996 }, 53997 isShownByDefault: true, 53998 children: /* @__PURE__ */ (0, import_jsx_runtime400.jsx)( 53999 import_components135.SelectControl, 54000 { 54001 value: buttonPosition, 54002 __next40pxDefaultSize: true, 54003 label: (0, import_i18n210.__)("Button position"), 54004 onChange: (value) => { 54005 setAttributes({ 54006 buttonPosition: value, 54007 isSearchFieldHidden: value === "button-only" 54008 }); 54009 }, 54010 options: buttonPositionControls 54011 } 54012 ) 54013 } 54014 ), 54015 buttonPosition !== "no-button" && /* @__PURE__ */ (0, import_jsx_runtime400.jsx)( 54016 import_components135.__experimentalToolsPanelItem, 54017 { 54018 hasValue: () => !!buttonUseIcon, 54019 label: (0, import_i18n210.__)("Use button with icon"), 54020 onDeselect: () => { 54021 setAttributes({ 54022 buttonUseIcon: false 54023 }); 54024 }, 54025 isShownByDefault: true, 54026 children: /* @__PURE__ */ (0, import_jsx_runtime400.jsx)( 54027 import_components135.ToggleControl, 54028 { 54029 checked: buttonUseIcon, 54030 label: (0, import_i18n210.__)("Use button with icon"), 54031 onChange: (value) => setAttributes({ 54032 buttonUseIcon: value 54033 }) 54034 } 54035 ) 54036 } 54037 ), 54038 /* @__PURE__ */ (0, import_jsx_runtime400.jsx)( 54039 import_components135.__experimentalToolsPanelItem, 54040 { 54041 hasValue: () => !!width, 54042 label: (0, import_i18n210.__)("Width"), 54043 onDeselect: () => { 54044 setAttributes({ 54045 width: void 0, 54046 widthUnit: void 0 54047 }); 54048 }, 54049 isShownByDefault: true, 54050 children: /* @__PURE__ */ (0, import_jsx_runtime400.jsxs)(import_components135.__experimentalVStack, { children: [ 54051 /* @__PURE__ */ (0, import_jsx_runtime400.jsx)( 54052 import_components135.__experimentalUnitControl, 54053 { 54054 __next40pxDefaultSize: true, 54055 label: (0, import_i18n210.__)("Width"), 54056 id: unitControlInputId, 54057 min: isPercentageUnit(widthUnit) ? 0 : MIN_WIDTH, 54058 max: isPercentageUnit(widthUnit) ? 100 : void 0, 54059 step: 1, 54060 onChange: (newWidth) => { 54061 const parsedNewWidth = newWidth === "" ? void 0 : parseInt(newWidth, 10); 54062 setAttributes({ 54063 width: parsedNewWidth 54064 }); 54065 }, 54066 onUnitChange: (newUnit) => { 54067 setAttributes({ 54068 width: "%" === newUnit ? PC_WIDTH_DEFAULT : PX_WIDTH_DEFAULT, 54069 widthUnit: newUnit 54070 }); 54071 }, 54072 __unstableInputWidth: "80px", 54073 value: `$width}$widthUnit}`, 54074 units 54075 } 54076 ), 54077 /* @__PURE__ */ (0, import_jsx_runtime400.jsx)( 54078 import_components135.__experimentalToggleGroupControl, 54079 { 54080 label: (0, import_i18n210.__)("Percentage Width"), 54081 value: PERCENTAGE_WIDTHS.includes(width) && widthUnit === "%" ? width : void 0, 54082 hideLabelFromVision: true, 54083 onChange: (newWidth) => { 54084 setAttributes({ 54085 width: newWidth, 54086 widthUnit: "%" 54087 }); 54088 }, 54089 isBlock: true, 54090 __next40pxDefaultSize: true, 54091 children: PERCENTAGE_WIDTHS.map((widthValue) => { 54092 return /* @__PURE__ */ (0, import_jsx_runtime400.jsx)( 54093 import_components135.__experimentalToggleGroupControlOption, 54094 { 54095 value: widthValue, 54096 label: (0, import_i18n210.sprintf)( 54097 /* translators: %d: Percentage value. */ 54098 (0, import_i18n210.__)("%d%%"), 54099 widthValue 54100 ) 54101 }, 54102 widthValue 54103 ); 54104 }) 54105 } 54106 ) 54107 ] }) 54108 } 54109 ) 54110 ] 54111 } 54112 ) }) }); 54113 const isNonZeroBorderRadius = (radius) => radius !== void 0 && parseInt(radius, 10) !== 0; 54114 const padBorderRadius = (radius) => isNonZeroBorderRadius(radius) ? `calc($radius} + $DEFAULT_INNER_PADDING})` : void 0; 54115 const getWrapperStyles = () => { 54116 const styles = isButtonPositionInside ? borderProps.style : { 54117 borderRadius: borderProps.style?.borderRadius, 54118 borderTopLeftRadius: borderProps.style?.borderTopLeftRadius, 54119 borderTopRightRadius: borderProps.style?.borderTopRightRadius, 54120 borderBottomLeftRadius: borderProps.style?.borderBottomLeftRadius, 54121 borderBottomRightRadius: borderProps.style?.borderBottomRightRadius 54122 }; 54123 if (isButtonPositionInside) { 54124 if (typeof borderRadius === "object") { 54125 const { 54126 borderTopLeftRadius, 54127 borderTopRightRadius, 54128 borderBottomLeftRadius, 54129 borderBottomRightRadius 54130 } = borderProps.style; 54131 return { 54132 ...styles, 54133 borderTopLeftRadius: padBorderRadius(borderTopLeftRadius), 54134 borderTopRightRadius: padBorderRadius(borderTopRightRadius), 54135 borderBottomLeftRadius: padBorderRadius( 54136 borderBottomLeftRadius 54137 ), 54138 borderBottomRightRadius: padBorderRadius( 54139 borderBottomRightRadius 54140 ) 54141 }; 54142 } 54143 const radius = Number.isInteger(borderRadius) ? `$borderRadius}px` : borderRadius; 54144 styles.borderRadius = `calc($radius} + $DEFAULT_INNER_PADDING})`; 54145 } 54146 return styles; 54147 }; 54148 const blockProps = (0, import_block_editor221.useBlockProps)({ 54149 className: getBlockClassNames(), 54150 style: { 54151 ...typographyProps.style, 54152 // Input opts out of text decoration. 54153 textDecoration: void 0 54154 } 54155 }); 54156 const labelClassnames = clsx_default( 54157 "wp-block-search__label", 54158 typographyProps.className 54159 ); 54160 return /* @__PURE__ */ (0, import_jsx_runtime400.jsxs)("div", { ...blockProps, children: [ 54161 controls, 54162 showLabel && /* @__PURE__ */ (0, import_jsx_runtime400.jsx)( 54163 import_block_editor221.RichText, 54164 { 54165 identifier: "label", 54166 className: labelClassnames, 54167 "aria-label": (0, import_i18n210.__)("Label text"), 54168 placeholder: (0, import_i18n210.__)("Add label\u2026"), 54169 withoutInteractiveFormatting: true, 54170 value: label, 54171 onChange: (html) => setAttributes({ label: html }), 54172 style: typographyProps.style 54173 } 54174 ), 54175 /* @__PURE__ */ (0, import_jsx_runtime400.jsxs)( 54176 import_components135.ResizableBox, 54177 { 54178 size: { 54179 width: width === void 0 ? "auto" : `$width}$widthUnit}`, 54180 height: "auto" 54181 }, 54182 className: clsx_default( 54183 "wp-block-search__inside-wrapper", 54184 isButtonPositionInside ? borderProps.className : void 0 54185 ), 54186 style: getWrapperStyles(), 54187 minWidth: MIN_WIDTH, 54188 enable: getResizableSides(), 54189 onResizeStart: (event, direction, elt) => { 54190 setAttributes({ 54191 width: parseInt(elt.offsetWidth, 10), 54192 widthUnit: "px" 54193 }); 54194 toggleSelection(false); 54195 }, 54196 onResizeStop: (event, direction, elt, delta) => { 54197 setAttributes({ 54198 width: parseInt(width + delta.width, 10) 54199 }); 54200 toggleSelection(true); 54201 }, 54202 showHandle: isSelected, 54203 children: [ 54204 (isButtonPositionInside || isButtonPositionOutside || hasOnlyButton) && /* @__PURE__ */ (0, import_jsx_runtime400.jsxs)(import_jsx_runtime400.Fragment, { children: [ 54205 renderTextField(), 54206 renderButton() 54207 ] }), 54208 hasNoButton && renderTextField() 54209 ] 54210 } 54211 ) 54212 ] }); 54213 } 54214 54215 // packages/block-library/build-module/search/variations.js 54216 var import_i18n211 = __toESM(require_i18n()); 54217 var variations15 = [ 54218 { 54219 name: "default", 54220 isDefault: true, 54221 attributes: { buttonText: (0, import_i18n211.__)("Search"), label: (0, import_i18n211.__)("Search") } 54222 } 54223 ]; 54224 var variations_default15 = variations15; 54225 54226 // packages/block-library/build-module/search/index.js 54227 var { fieldsKey: fieldsKey17, formKey: formKey17 } = unlock(import_blocks97.privateApis); 54228 var { name: name93 } = block_default92; 54229 var settings92 = { 54230 icon: search_default, 54231 example: { 54232 attributes: { buttonText: (0, import_i18n212.__)("Search"), label: (0, import_i18n212.__)("Search") }, 54233 viewportWidth: 400 54234 }, 54235 variations: variations_default15, 54236 edit: SearchEdit 54237 }; 54238 if (window.__experimentalContentOnlyInspectorFields) { 54239 settings92[fieldsKey17] = [ 54240 { 54241 id: "label", 54242 label: (0, import_i18n212.__)("Label"), 54243 type: "richtext", 54244 shownByDefault: true 54245 }, 54246 { 54247 id: "buttonText", 54248 label: (0, import_i18n212.__)("Button text"), 54249 type: "richtext" 54250 }, 54251 { 54252 id: "placeholder", 54253 label: (0, import_i18n212.__)("Placeholder"), 54254 type: "richtext" 54255 } 54256 ]; 54257 settings92[formKey17] = { 54258 fields: ["label"] 54259 }; 54260 } 54261 var init92 = () => initBlock({ name: name93, metadata: block_default92, settings: settings92 }); 54262 54263 // packages/block-library/build-module/separator/index.js 54264 var separator_exports = {}; 54265 __export(separator_exports, { 54266 init: () => init93, 54267 metadata: () => block_default93, 54268 name: () => name94, 54269 settings: () => settings93 54270 }); 54271 54272 // packages/block-library/build-module/separator/edit.js 54273 var import_block_editor222 = __toESM(require_block_editor()); 54274 var import_components136 = __toESM(require_components()); 54275 var import_i18n213 = __toESM(require_i18n()); 54276 54277 // packages/block-library/build-module/separator/use-deprecated-opacity.js 54278 var import_element110 = __toESM(require_element()); 54279 var import_compose46 = __toESM(require_compose()); 54280 function useDeprecatedOpacity(opacity, currentColor, setAttributes) { 54281 const [deprecatedOpacityWithNoColor, setDeprecatedOpacityWithNoColor] = (0, import_element110.useState)(false); 54282 const previousColor = (0, import_compose46.usePrevious)(currentColor); 54283 (0, import_element110.useEffect)(() => { 54284 if (opacity === "css" && !currentColor && !previousColor) { 54285 setDeprecatedOpacityWithNoColor(true); 54286 } 54287 }, [currentColor, previousColor, opacity]); 54288 (0, import_element110.useEffect)(() => { 54289 if (opacity === "css" && (deprecatedOpacityWithNoColor && currentColor || previousColor && currentColor !== previousColor)) { 54290 setAttributes({ opacity: "alpha-channel" }); 54291 setDeprecatedOpacityWithNoColor(false); 54292 } 54293 }, [deprecatedOpacityWithNoColor, currentColor, previousColor]); 54294 } 54295 54296 // packages/block-library/build-module/separator/edit.js 54297 var import_jsx_runtime401 = __toESM(require_jsx_runtime()); 54298 var HtmlElementControl = ({ tagName, setAttributes }) => { 54299 return /* @__PURE__ */ (0, import_jsx_runtime401.jsx)( 54300 import_components136.SelectControl, 54301 { 54302 label: (0, import_i18n213.__)("HTML element"), 54303 value: tagName, 54304 onChange: (newValue) => setAttributes({ tagName: newValue }), 54305 options: [ 54306 { label: (0, import_i18n213.__)("Default (<hr>)"), value: "hr" }, 54307 { label: "<div>", value: "div" } 54308 ], 54309 help: tagName === "hr" ? (0, import_i18n213.__)( 54310 "Only select <hr> if the separator conveys important information and should be announced by screen readers." 54311 ) : (0, import_i18n213.__)( 54312 "The <div> element should only be used if the block is a design element with no semantic meaning." 54313 ), 54314 __next40pxDefaultSize: true 54315 } 54316 ); 54317 }; 54318 function SeparatorEdit({ attributes: attributes3, setAttributes }) { 54319 const { backgroundColor, opacity, style: style2, tagName } = attributes3; 54320 const colorProps = (0, import_block_editor222.__experimentalUseColorProps)(attributes3); 54321 const currentColor = colorProps?.style?.backgroundColor; 54322 const hasCustomColor = !!style2?.color?.background; 54323 useDeprecatedOpacity(opacity, currentColor, setAttributes); 54324 const colorClass = (0, import_block_editor222.getColorClassName)("color", backgroundColor); 54325 const className = clsx_default( 54326 { 54327 "has-text-color": backgroundColor || currentColor, 54328 [colorClass]: colorClass, 54329 "has-css-opacity": opacity === "css", 54330 "has-alpha-channel-opacity": opacity === "alpha-channel" 54331 }, 54332 colorProps.className 54333 ); 54334 const styles = { 54335 color: currentColor, 54336 backgroundColor: currentColor 54337 }; 54338 const Wrapper = tagName === "hr" ? import_components136.HorizontalRule : tagName; 54339 return /* @__PURE__ */ (0, import_jsx_runtime401.jsxs)(import_jsx_runtime401.Fragment, { children: [ 54340 /* @__PURE__ */ (0, import_jsx_runtime401.jsx)(import_block_editor222.InspectorControls, { group: "advanced", children: /* @__PURE__ */ (0, import_jsx_runtime401.jsx)( 54341 HtmlElementControl, 54342 { 54343 tagName, 54344 setAttributes 54345 } 54346 ) }), 54347 /* @__PURE__ */ (0, import_jsx_runtime401.jsx)( 54348 Wrapper, 54349 { 54350 ...(0, import_block_editor222.useBlockProps)({ 54351 className, 54352 style: hasCustomColor ? styles : void 0 54353 }) 54354 } 54355 ) 54356 ] }); 54357 } 54358 54359 // packages/block-library/build-module/separator/block.json 54360 var block_default93 = { 54361 $schema: "https://schemas.wp.org/trunk/block.json", 54362 apiVersion: 3, 54363 name: "core/separator", 54364 title: "Separator", 54365 category: "design", 54366 description: "Create a break between ideas or sections with a horizontal separator.", 54367 keywords: ["horizontal-line", "hr", "divider"], 54368 textdomain: "default", 54369 attributes: { 54370 opacity: { 54371 type: "string", 54372 default: "alpha-channel" 54373 }, 54374 tagName: { 54375 type: "string", 54376 enum: ["hr", "div"], 54377 default: "hr" 54378 } 54379 }, 54380 supports: { 54381 anchor: true, 54382 align: ["center", "wide", "full"], 54383 color: { 54384 enableContrastChecker: false, 54385 __experimentalSkipSerialization: true, 54386 gradients: true, 54387 background: true, 54388 text: false, 54389 __experimentalDefaultControls: { 54390 background: true 54391 } 54392 }, 54393 spacing: { 54394 margin: ["top", "bottom"] 54395 }, 54396 interactivity: { 54397 clientNavigation: true 54398 } 54399 }, 54400 styles: [ 54401 { name: "default", label: "Default", isDefault: true }, 54402 { name: "wide", label: "Wide Line" }, 54403 { name: "dots", label: "Dots" } 54404 ], 54405 editorStyle: "wp-block-separator-editor", 54406 style: "wp-block-separator" 54407 }; 54408 54409 // packages/block-library/build-module/separator/save.js 54410 var import_block_editor223 = __toESM(require_block_editor()); 54411 var import_jsx_runtime402 = __toESM(require_jsx_runtime()); 54412 function separatorSave({ attributes: attributes3 }) { 54413 const { backgroundColor, style: style2, opacity, tagName: Tag } = attributes3; 54414 const customColor = style2?.color?.background; 54415 const colorProps = (0, import_block_editor223.__experimentalGetColorClassesAndStyles)(attributes3); 54416 const colorClass = (0, import_block_editor223.getColorClassName)("color", backgroundColor); 54417 const className = clsx_default( 54418 { 54419 "has-text-color": backgroundColor || customColor, 54420 [colorClass]: colorClass, 54421 "has-css-opacity": opacity === "css", 54422 "has-alpha-channel-opacity": opacity === "alpha-channel" 54423 }, 54424 colorProps.className 54425 ); 54426 const styles = { 54427 backgroundColor: colorProps?.style?.backgroundColor, 54428 color: colorClass ? void 0 : customColor 54429 }; 54430 return /* @__PURE__ */ (0, import_jsx_runtime402.jsx)(Tag, { ...import_block_editor223.useBlockProps.save({ className, style: styles }) }); 54431 } 54432 54433 // packages/block-library/build-module/separator/transforms.js 54434 var import_blocks98 = __toESM(require_blocks()); 54435 var transforms29 = { 54436 from: [ 54437 { 54438 type: "enter", 54439 regExp: /^-{3,}$/, 54440 transform: () => (0, import_blocks98.createBlock)("core/separator") 54441 }, 54442 { 54443 type: "raw", 54444 selector: "hr", 54445 schema: { 54446 hr: {} 54447 } 54448 } 54449 ], 54450 to: [ 54451 { 54452 type: "block", 54453 blocks: ["core/spacer"], 54454 // Transform to Spacer. 54455 transform: ({ anchor }) => { 54456 return (0, import_blocks98.createBlock)("core/spacer", { 54457 anchor: anchor || void 0 54458 }); 54459 } 54460 } 54461 ] 54462 }; 54463 var transforms_default30 = transforms29; 54464 54465 // packages/block-library/build-module/separator/deprecated.js 54466 var import_block_editor224 = __toESM(require_block_editor()); 54467 var import_jsx_runtime403 = __toESM(require_jsx_runtime()); 54468 var v128 = { 54469 attributes: { 54470 color: { 54471 type: "string" 54472 }, 54473 customColor: { 54474 type: "string" 54475 } 54476 }, 54477 save({ attributes: attributes3 }) { 54478 const { color, customColor } = attributes3; 54479 const backgroundClass = (0, import_block_editor224.getColorClassName)("background-color", color); 54480 const colorClass = (0, import_block_editor224.getColorClassName)("color", color); 54481 const className = clsx_default({ 54482 "has-text-color has-background": color || customColor, 54483 [backgroundClass]: backgroundClass, 54484 [colorClass]: colorClass 54485 }); 54486 const style2 = { 54487 backgroundColor: backgroundClass ? void 0 : customColor, 54488 color: colorClass ? void 0 : customColor 54489 }; 54490 return /* @__PURE__ */ (0, import_jsx_runtime403.jsx)("hr", { ...import_block_editor224.useBlockProps.save({ className, style: style2 }) }); 54491 }, 54492 migrate(attributes3) { 54493 const { color, customColor, ...restAttributes } = attributes3; 54494 return { 54495 ...restAttributes, 54496 backgroundColor: color ? color : void 0, 54497 opacity: "css", 54498 style: customColor ? { color: { background: customColor } } : void 0, 54499 tagName: "hr" 54500 }; 54501 } 54502 }; 54503 var deprecated_default35 = [v128]; 54504 54505 // packages/block-library/build-module/separator/index.js 54506 var { name: name94 } = block_default93; 54507 var settings93 = { 54508 icon: separator_default, 54509 example: { 54510 attributes: { 54511 customColor: "#065174", 54512 className: "is-style-wide" 54513 } 54514 }, 54515 transforms: transforms_default30, 54516 edit: SeparatorEdit, 54517 save: separatorSave, 54518 deprecated: deprecated_default35 54519 }; 54520 var init93 = () => initBlock({ name: name94, metadata: block_default93, settings: settings93 }); 54521 54522 // packages/block-library/build-module/shortcode/index.js 54523 var shortcode_exports = {}; 54524 __export(shortcode_exports, { 54525 init: () => init94, 54526 metadata: () => block_default94, 54527 name: () => name95, 54528 settings: () => settings94 54529 }); 54530 54531 // packages/block-library/build-module/shortcode/edit.js 54532 var import_i18n214 = __toESM(require_i18n()); 54533 var import_block_editor225 = __toESM(require_block_editor()); 54534 var import_compose47 = __toESM(require_compose()); 54535 var import_components137 = __toESM(require_components()); 54536 var import_jsx_runtime404 = __toESM(require_jsx_runtime()); 54537 function ShortcodeEdit({ attributes: attributes3, setAttributes }) { 54538 const instanceId = (0, import_compose47.useInstanceId)(ShortcodeEdit); 54539 const inputId = `blocks-shortcode-input-$instanceId}`; 54540 return /* @__PURE__ */ (0, import_jsx_runtime404.jsx)("div", { ...(0, import_block_editor225.useBlockProps)(), children: /* @__PURE__ */ (0, import_jsx_runtime404.jsx)(import_components137.Placeholder, { icon: shortcode_default, label: (0, import_i18n214.__)("Shortcode"), children: /* @__PURE__ */ (0, import_jsx_runtime404.jsx)( 54541 import_block_editor225.PlainText, 54542 { 54543 className: "blocks-shortcode__textarea", 54544 id: inputId, 54545 value: attributes3.text, 54546 "aria-label": (0, import_i18n214.__)("Shortcode text"), 54547 placeholder: (0, import_i18n214.__)("Write shortcode here\u2026"), 54548 onChange: (text) => setAttributes({ text }) 54549 } 54550 ) }) }); 54551 } 54552 54553 // packages/block-library/build-module/shortcode/save.js 54554 var import_element111 = __toESM(require_element()); 54555 var import_jsx_runtime405 = __toESM(require_jsx_runtime()); 54556 function save45({ attributes: attributes3 }) { 54557 return /* @__PURE__ */ (0, import_jsx_runtime405.jsx)(import_element111.RawHTML, { children: attributes3.text }); 54558 } 54559 54560 // packages/block-library/build-module/shortcode/transforms.js 54561 var import_autop = __toESM(require_autop()); 54562 var transforms30 = { 54563 from: [ 54564 { 54565 type: "shortcode", 54566 // Per "Shortcode names should be all lowercase and use all 54567 // letters, but numbers and underscores should work fine too. 54568 // Be wary of using hyphens (dashes), you'll be better off not 54569 // using them." in https://codex.wordpress.org/Shortcode_API 54570 // Require that the first character be a letter. This notably 54571 // prevents footnote markings ([1]) from being caught as 54572 // shortcodes. 54573 tag: "[a-z][a-z0-9_-]*", 54574 attributes: { 54575 text: { 54576 type: "string", 54577 shortcode: (attrs, { content }) => { 54578 return (0, import_autop.removep)((0, import_autop.autop)(content)); 54579 } 54580 } 54581 }, 54582 priority: 20 54583 } 54584 ] 54585 }; 54586 var transforms_default31 = transforms30; 54587 54588 // packages/block-library/build-module/shortcode/block.json 54589 var block_default94 = { 54590 $schema: "https://schemas.wp.org/trunk/block.json", 54591 apiVersion: 3, 54592 name: "core/shortcode", 54593 title: "Shortcode", 54594 category: "widgets", 54595 description: "Insert additional custom elements with a WordPress shortcode.", 54596 textdomain: "default", 54597 attributes: { 54598 text: { 54599 type: "string", 54600 source: "raw", 54601 role: "content" 54602 } 54603 }, 54604 supports: { 54605 className: false, 54606 customClassName: false, 54607 html: false 54608 }, 54609 editorStyle: "wp-block-shortcode-editor" 54610 }; 54611 54612 // packages/block-library/build-module/shortcode/index.js 54613 var { name: name95 } = block_default94; 54614 var settings94 = { 54615 icon: shortcode_default, 54616 transforms: transforms_default31, 54617 edit: ShortcodeEdit, 54618 save: save45 54619 }; 54620 var init94 = () => initBlock({ name: name95, metadata: block_default94, settings: settings94 }); 54621 54622 // packages/block-library/build-module/site-logo/index.js 54623 var site_logo_exports = {}; 54624 __export(site_logo_exports, { 54625 init: () => init95, 54626 metadata: () => block_default95, 54627 name: () => name96, 54628 settings: () => settings95 54629 }); 54630 54631 // packages/block-library/build-module/site-logo/block.json 54632 var block_default95 = { 54633 $schema: "https://schemas.wp.org/trunk/block.json", 54634 apiVersion: 3, 54635 name: "core/site-logo", 54636 title: "Site Logo", 54637 category: "theme", 54638 description: "Display an image to represent this site. Update this block and the changes apply everywhere.", 54639 textdomain: "default", 54640 attributes: { 54641 width: { 54642 type: "number" 54643 }, 54644 isLink: { 54645 type: "boolean", 54646 default: true, 54647 role: "content" 54648 }, 54649 linkTarget: { 54650 type: "string", 54651 default: "_self", 54652 role: "content" 54653 }, 54654 shouldSyncIcon: { 54655 type: "boolean" 54656 } 54657 }, 54658 example: { 54659 viewportWidth: 500, 54660 attributes: { 54661 width: 350, 54662 className: "block-editor-block-types-list__site-logo-example" 54663 } 54664 }, 54665 supports: { 54666 html: false, 54667 align: true, 54668 alignWide: false, 54669 color: { 54670 text: false, 54671 background: false 54672 }, 54673 spacing: { 54674 margin: true, 54675 padding: true, 54676 __experimentalDefaultControls: { 54677 margin: false, 54678 padding: false 54679 } 54680 }, 54681 interactivity: { 54682 clientNavigation: true 54683 }, 54684 filter: { 54685 duotone: true 54686 } 54687 }, 54688 styles: [ 54689 { 54690 name: "default", 54691 label: "Default", 54692 isDefault: true 54693 }, 54694 { name: "rounded", label: "Rounded" } 54695 ], 54696 selectors: { 54697 filter: { 54698 duotone: ".wp-block-site-logo img, .wp-block-site-logo .components-placeholder__illustration, .wp-block-site-logo .components-placeholder::before" 54699 } 54700 }, 54701 editorStyle: "wp-block-site-logo-editor", 54702 style: "wp-block-site-logo" 54703 }; 54704 54705 // packages/block-library/build-module/site-logo/edit.js 54706 var import_blob17 = __toESM(require_blob()); 54707 var import_element112 = __toESM(require_element()); 54708 var import_i18n215 = __toESM(require_i18n()); 54709 var import_components138 = __toESM(require_components()); 54710 var import_compose48 = __toESM(require_compose()); 54711 var import_block_editor226 = __toESM(require_block_editor()); 54712 var import_data119 = __toESM(require_data()); 54713 var import_core_data75 = __toESM(require_core_data()); 54714 var import_notices15 = __toESM(require_notices()); 54715 var import_jsx_runtime406 = __toESM(require_jsx_runtime()); 54716 var ALLOWED_MEDIA_TYPES7 = ["image"]; 54717 var ACCEPT_MEDIA_STRING = "image/*"; 54718 var SiteLogo = ({ 54719 alt, 54720 attributes: { align, width, height, isLink, linkTarget, shouldSyncIcon }, 54721 isSelected, 54722 setAttributes, 54723 setLogo, 54724 logoUrl, 54725 siteUrl, 54726 logoId, 54727 iconId, 54728 setIcon, 54729 canUserEdit 54730 }) => { 54731 const isLargeViewport = (0, import_compose48.useViewportMatch)("medium"); 54732 const isWideAligned = ["wide", "full"].includes(align); 54733 const isResizable = !isWideAligned && isLargeViewport; 54734 const [{ naturalWidth, naturalHeight }, setNaturalSize] = (0, import_element112.useState)({}); 54735 const [isEditingImage, setIsEditingImage] = (0, import_element112.useState)(false); 54736 const { toggleSelection } = (0, import_data119.useDispatch)(import_block_editor226.store); 54737 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 54738 const blockEditingMode = (0, import_block_editor226.useBlockEditingMode)(); 54739 const isContentOnlyMode = blockEditingMode === "contentOnly"; 54740 const { imageEditing, maxWidth, title } = (0, import_data119.useSelect)((select9) => { 54741 const settings116 = select9(import_block_editor226.store).getSettings(); 54742 const siteEntities = select9(import_core_data75.store).getEntityRecord( 54743 "root", 54744 "__unstableBase" 54745 ); 54746 return { 54747 title: siteEntities?.name, 54748 imageEditing: settings116.imageEditing, 54749 maxWidth: settings116.maxWidth 54750 }; 54751 }, []); 54752 (0, import_element112.useEffect)(() => { 54753 if (shouldSyncIcon && logoId !== iconId) { 54754 setAttributes({ shouldSyncIcon: false }); 54755 } 54756 }, []); 54757 (0, import_element112.useEffect)(() => { 54758 if (!isSelected) { 54759 setIsEditingImage(false); 54760 } 54761 }, [isSelected]); 54762 function onResizeStart() { 54763 toggleSelection(false); 54764 } 54765 function onResizeStop() { 54766 toggleSelection(true); 54767 } 54768 const img = /* @__PURE__ */ (0, import_jsx_runtime406.jsxs)(import_jsx_runtime406.Fragment, { children: [ 54769 /* @__PURE__ */ (0, import_jsx_runtime406.jsx)( 54770 "img", 54771 { 54772 className: "custom-logo", 54773 src: logoUrl, 54774 alt, 54775 onLoad: (event) => { 54776 setNaturalSize({ 54777 naturalWidth: event.target.naturalWidth, 54778 naturalHeight: event.target.naturalHeight 54779 }); 54780 } 54781 } 54782 ), 54783 (0, import_blob17.isBlobURL)(logoUrl) && /* @__PURE__ */ (0, import_jsx_runtime406.jsx)(import_components138.Spinner, {}) 54784 ] }); 54785 let imgWrapper = img; 54786 if (isLink) { 54787 imgWrapper = /* @__PURE__ */ (0, import_jsx_runtime406.jsx)( 54788 "a", 54789 { 54790 href: siteUrl, 54791 className: "custom-logo-link", 54792 rel: "home", 54793 title, 54794 onClick: (event) => event.preventDefault(), 54795 children: img 54796 } 54797 ); 54798 } 54799 if (!isResizable || !naturalWidth || !naturalHeight) { 54800 return /* @__PURE__ */ (0, import_jsx_runtime406.jsx)("div", { style: { width, height }, children: imgWrapper }); 54801 } 54802 const defaultWidth = 120; 54803 const currentWidth = width || defaultWidth; 54804 const ratio = naturalWidth / naturalHeight; 54805 const currentHeight = currentWidth / ratio; 54806 const minWidth = naturalWidth < naturalHeight ? MIN_SIZE2 : Math.ceil(MIN_SIZE2 * ratio); 54807 const minHeight = naturalHeight < naturalWidth ? MIN_SIZE2 : Math.ceil(MIN_SIZE2 / ratio); 54808 const maxWidthBuffer = maxWidth * 2.5; 54809 let showRightHandle = false; 54810 let showLeftHandle = false; 54811 if (align === "center") { 54812 showRightHandle = true; 54813 showLeftHandle = true; 54814 } else if ((0, import_i18n215.isRTL)()) { 54815 if (align === "left") { 54816 showRightHandle = true; 54817 } else { 54818 showLeftHandle = true; 54819 } 54820 } else { 54821 if (align === "right") { 54822 showLeftHandle = true; 54823 } else { 54824 showRightHandle = true; 54825 } 54826 } 54827 const canEditImage = logoId && naturalWidth && naturalHeight && imageEditing; 54828 const shouldShowCropAndDimensions = !isContentOnlyMode; 54829 let imgEdit; 54830 if (canEditImage && isEditingImage) { 54831 imgEdit = /* @__PURE__ */ (0, import_jsx_runtime406.jsx)( 54832 import_block_editor226.__experimentalImageEditor, 54833 { 54834 id: logoId, 54835 url: logoUrl, 54836 width: currentWidth, 54837 height: currentHeight, 54838 naturalHeight, 54839 naturalWidth, 54840 onSaveImage: (imageAttributes) => { 54841 setLogo(imageAttributes.id); 54842 }, 54843 onFinishEditing: () => { 54844 setIsEditingImage(false); 54845 } 54846 } 54847 ); 54848 } else { 54849 imgEdit = /* @__PURE__ */ (0, import_jsx_runtime406.jsx)( 54850 import_components138.ResizableBox, 54851 { 54852 size: { 54853 width: currentWidth, 54854 height: currentHeight 54855 }, 54856 showHandle: isSelected && shouldShowCropAndDimensions, 54857 minWidth, 54858 maxWidth: maxWidthBuffer, 54859 minHeight, 54860 maxHeight: maxWidthBuffer / ratio, 54861 lockAspectRatio: true, 54862 enable: { 54863 top: false, 54864 right: showRightHandle, 54865 bottom: true, 54866 left: showLeftHandle 54867 }, 54868 onResizeStart, 54869 onResizeStop: (event, direction, elt, delta) => { 54870 onResizeStop(); 54871 setAttributes({ 54872 width: parseInt(currentWidth + delta.width, 10), 54873 height: parseInt(currentHeight + delta.height, 10) 54874 }); 54875 }, 54876 children: imgWrapper 54877 } 54878 ); 54879 } 54880 const shouldUseNewUrl = !window?.__experimentalUseCustomizerSiteLogoUrl; 54881 const siteIconSettingsUrl = shouldUseNewUrl ? siteUrl + "/wp-admin/options-general.php" : siteUrl + "/wp-admin/customize.php?autofocus[section]=title_tagline"; 54882 const syncSiteIconHelpText = (0, import_element112.createInterpolateElement)( 54883 (0, import_i18n215.__)( 54884 "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>." 54885 ), 54886 { 54887 a: ( 54888 // eslint-disable-next-line jsx-a11y/anchor-has-content 54889 /* @__PURE__ */ (0, import_jsx_runtime406.jsx)( 54890 "a", 54891 { 54892 href: siteIconSettingsUrl, 54893 target: "_blank", 54894 rel: "noopener noreferrer" 54895 } 54896 ) 54897 ) 54898 } 54899 ); 54900 return /* @__PURE__ */ (0, import_jsx_runtime406.jsxs)(import_jsx_runtime406.Fragment, { children: [ 54901 /* @__PURE__ */ (0, import_jsx_runtime406.jsx)(import_block_editor226.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime406.jsxs)( 54902 import_components138.__experimentalToolsPanel, 54903 { 54904 label: (0, import_i18n215.__)("Settings"), 54905 dropdownMenuProps, 54906 children: [ 54907 /* @__PURE__ */ (0, import_jsx_runtime406.jsx)( 54908 import_components138.__experimentalToolsPanelItem, 54909 { 54910 isShownByDefault: true, 54911 hasValue: () => !!width, 54912 label: (0, import_i18n215.__)("Image width"), 54913 onDeselect: () => setAttributes({ width: void 0 }), 54914 children: /* @__PURE__ */ (0, import_jsx_runtime406.jsx)( 54915 import_components138.RangeControl, 54916 { 54917 __next40pxDefaultSize: true, 54918 label: (0, import_i18n215.__)("Image width"), 54919 onChange: (newWidth) => setAttributes({ width: newWidth }), 54920 min: minWidth, 54921 max: maxWidthBuffer, 54922 initialPosition: Math.min( 54923 defaultWidth, 54924 maxWidthBuffer 54925 ), 54926 value: width || "", 54927 disabled: !isResizable 54928 } 54929 ) 54930 } 54931 ), 54932 /* @__PURE__ */ (0, import_jsx_runtime406.jsx)( 54933 import_components138.__experimentalToolsPanelItem, 54934 { 54935 isShownByDefault: true, 54936 hasValue: () => !isLink, 54937 label: (0, import_i18n215.__)("Link image to home"), 54938 onDeselect: () => setAttributes({ isLink: true }), 54939 children: /* @__PURE__ */ (0, import_jsx_runtime406.jsx)( 54940 import_components138.ToggleControl, 54941 { 54942 label: (0, import_i18n215.__)("Link image to home"), 54943 onChange: () => setAttributes({ isLink: !isLink }), 54944 checked: isLink 54945 } 54946 ) 54947 } 54948 ), 54949 isLink && /* @__PURE__ */ (0, import_jsx_runtime406.jsx)( 54950 import_components138.__experimentalToolsPanelItem, 54951 { 54952 isShownByDefault: true, 54953 hasValue: () => linkTarget === "_blank", 54954 label: (0, import_i18n215.__)("Open in new tab"), 54955 onDeselect: () => setAttributes({ linkTarget: "_self" }), 54956 children: /* @__PURE__ */ (0, import_jsx_runtime406.jsx)( 54957 import_components138.ToggleControl, 54958 { 54959 label: (0, import_i18n215.__)("Open in new tab"), 54960 onChange: (value) => setAttributes({ 54961 linkTarget: value ? "_blank" : "_self" 54962 }), 54963 checked: linkTarget === "_blank" 54964 } 54965 ) 54966 } 54967 ), 54968 canUserEdit && /* @__PURE__ */ (0, import_jsx_runtime406.jsx)( 54969 import_components138.__experimentalToolsPanelItem, 54970 { 54971 isShownByDefault: true, 54972 hasValue: () => !!shouldSyncIcon, 54973 label: (0, import_i18n215.__)("Use as Site Icon"), 54974 onDeselect: () => { 54975 setAttributes({ shouldSyncIcon: false }); 54976 setIcon(void 0); 54977 }, 54978 children: /* @__PURE__ */ (0, import_jsx_runtime406.jsx)( 54979 import_components138.ToggleControl, 54980 { 54981 label: (0, import_i18n215.__)("Use as Site Icon"), 54982 onChange: (value) => { 54983 setAttributes({ shouldSyncIcon: value }); 54984 setIcon(value ? logoId : void 0); 54985 }, 54986 checked: !!shouldSyncIcon, 54987 help: syncSiteIconHelpText 54988 } 54989 ) 54990 } 54991 ) 54992 ] 54993 } 54994 ) }), 54995 canEditImage && !isEditingImage && shouldShowCropAndDimensions && /* @__PURE__ */ (0, import_jsx_runtime406.jsx)(import_block_editor226.BlockControls, { group: "block", children: /* @__PURE__ */ (0, import_jsx_runtime406.jsx)( 54996 import_components138.ToolbarButton, 54997 { 54998 onClick: () => setIsEditingImage(true), 54999 icon: crop_default, 55000 label: (0, import_i18n215.__)("Crop") 55001 } 55002 ) }), 55003 imgEdit 55004 ] }); 55005 }; 55006 function SiteLogoReplaceFlow({ mediaURL, ...mediaReplaceProps }) { 55007 return /* @__PURE__ */ (0, import_jsx_runtime406.jsx)( 55008 import_block_editor226.MediaReplaceFlow, 55009 { 55010 ...mediaReplaceProps, 55011 mediaURL, 55012 allowedTypes: ALLOWED_MEDIA_TYPES7, 55013 accept: ACCEPT_MEDIA_STRING 55014 } 55015 ); 55016 } 55017 var InspectorLogoPreview = ({ media, itemGroupProps }) => { 55018 const { 55019 alt_text: alt, 55020 source_url: logoUrl, 55021 slug: logoSlug, 55022 media_details: logoMediaDetails 55023 } = media ?? {}; 55024 const logoLabel = logoMediaDetails?.sizes?.full?.file || logoSlug; 55025 return /* @__PURE__ */ (0, import_jsx_runtime406.jsx)(import_components138.__experimentalItemGroup, { ...itemGroupProps, as: "span", children: /* @__PURE__ */ (0, import_jsx_runtime406.jsxs)(import_components138.__experimentalHStack, { justify: "flex-start", as: "span", children: [ 55026 /* @__PURE__ */ (0, import_jsx_runtime406.jsx)("img", { src: logoUrl, alt }), 55027 /* @__PURE__ */ (0, import_jsx_runtime406.jsx)(import_components138.FlexItem, { as: "span", children: /* @__PURE__ */ (0, import_jsx_runtime406.jsx)( 55028 import_components138.__experimentalTruncate, 55029 { 55030 numberOfLines: 1, 55031 className: "block-library-site-logo__inspector-media-replace-title", 55032 children: logoLabel 55033 } 55034 ) }) 55035 ] }) }); 55036 }; 55037 function LogoEdit({ 55038 attributes: attributes3, 55039 className, 55040 setAttributes, 55041 isSelected 55042 }) { 55043 const { width, shouldSyncIcon } = attributes3; 55044 const { 55045 siteLogoId, 55046 canUserEdit, 55047 url, 55048 siteIconId, 55049 mediaItemData, 55050 isRequestingMediaItem 55051 } = (0, import_data119.useSelect)((select9) => { 55052 const { canUser, getEntityRecord, getEditedEntityRecord } = select9(import_core_data75.store); 55053 const _canUserEdit = canUser("update", { 55054 kind: "root", 55055 name: "site" 55056 }); 55057 const siteSettings = _canUserEdit ? getEditedEntityRecord("root", "site") : void 0; 55058 const siteData = getEntityRecord("root", "__unstableBase"); 55059 const _siteLogoId = _canUserEdit ? siteSettings?.site_logo : siteData?.site_logo; 55060 const _siteIconId = siteSettings?.site_icon; 55061 const mediaItem = _siteLogoId && select9(import_core_data75.store).getEntityRecord( 55062 "postType", 55063 "attachment", 55064 _siteLogoId, 55065 { 55066 context: "view" 55067 } 55068 ); 55069 const _isRequestingMediaItem = !!_siteLogoId && !select9(import_core_data75.store).hasFinishedResolution("getEntityRecord", [ 55070 "postType", 55071 "attachment", 55072 _siteLogoId, 55073 { context: "view" } 55074 ]); 55075 return { 55076 siteLogoId: _siteLogoId, 55077 canUserEdit: _canUserEdit, 55078 url: siteData?.home, 55079 mediaItemData: mediaItem, 55080 isRequestingMediaItem: _isRequestingMediaItem, 55081 siteIconId: _siteIconId 55082 }; 55083 }, []); 55084 const { getSettings: getSettings2 } = (0, import_data119.useSelect)(import_block_editor226.store); 55085 const [temporaryURL, setTemporaryURL] = (0, import_element112.useState)(); 55086 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 55087 const { editEntityRecord } = (0, import_data119.useDispatch)(import_core_data75.store); 55088 const setLogo = (newValue, shouldForceSync = false) => { 55089 if (shouldSyncIcon || shouldForceSync) { 55090 setIcon(newValue); 55091 } 55092 editEntityRecord("root", "site", void 0, { 55093 site_logo: newValue 55094 }); 55095 }; 55096 const setIcon = (newValue) => ( 55097 // The new value needs to be `null` to reset the Site Icon. 55098 editEntityRecord("root", "site", void 0, { 55099 site_icon: newValue ?? null 55100 }) 55101 ); 55102 const { alt_text: alt, source_url: logoUrl } = mediaItemData ?? {}; 55103 const onInitialSelectLogo = (media) => { 55104 if (shouldSyncIcon === void 0) { 55105 const shouldForceSync = !siteIconId; 55106 setAttributes({ shouldSyncIcon: shouldForceSync }); 55107 onSelectLogo(media, shouldForceSync); 55108 return; 55109 } 55110 onSelectLogo(media); 55111 }; 55112 const onSelectLogo = (media, shouldForceSync = false) => { 55113 if (!media) { 55114 return; 55115 } 55116 if (!media.id && media.url) { 55117 setTemporaryURL(media.url); 55118 setLogo(void 0); 55119 return; 55120 } 55121 setLogo(media.id, shouldForceSync); 55122 }; 55123 const onRemoveLogo = () => { 55124 setLogo(null); 55125 setAttributes({ width: void 0 }); 55126 }; 55127 const { createErrorNotice } = (0, import_data119.useDispatch)(import_notices15.store); 55128 const onUploadError = (message) => { 55129 createErrorNotice(message, { type: "snackbar" }); 55130 setTemporaryURL(); 55131 }; 55132 const onFilesDrop = (filesList) => { 55133 getSettings2().mediaUpload({ 55134 allowedTypes: ALLOWED_MEDIA_TYPES7, 55135 filesList, 55136 onFileChange([image]) { 55137 if ((0, import_blob17.isBlobURL)(image?.url)) { 55138 setTemporaryURL(image.url); 55139 return; 55140 } 55141 onInitialSelectLogo(image); 55142 }, 55143 onError: onUploadError, 55144 multiple: false 55145 }); 55146 }; 55147 const mediaReplaceFlowProps = { 55148 mediaURL: logoUrl, 55149 name: !logoUrl ? (0, import_i18n215.__)("Choose logo") : (0, import_i18n215.__)("Replace"), 55150 onSelect: onSelectLogo, 55151 onError: onUploadError, 55152 onReset: onRemoveLogo 55153 }; 55154 const controls = canUserEdit && /* @__PURE__ */ (0, import_jsx_runtime406.jsx)(import_block_editor226.BlockControls, { group: "other", children: /* @__PURE__ */ (0, import_jsx_runtime406.jsx)(SiteLogoReplaceFlow, { ...mediaReplaceFlowProps }) }); 55155 let logoImage; 55156 const isLoading = siteLogoId === void 0 || isRequestingMediaItem; 55157 if (isLoading) { 55158 logoImage = /* @__PURE__ */ (0, import_jsx_runtime406.jsx)(import_components138.Spinner, {}); 55159 } 55160 (0, import_element112.useEffect)(() => { 55161 if (logoUrl && temporaryURL) { 55162 setTemporaryURL(); 55163 } 55164 }, [logoUrl, temporaryURL]); 55165 if (!!logoUrl || !!temporaryURL) { 55166 logoImage = /* @__PURE__ */ (0, import_jsx_runtime406.jsxs)(import_jsx_runtime406.Fragment, { children: [ 55167 /* @__PURE__ */ (0, import_jsx_runtime406.jsx)( 55168 SiteLogo, 55169 { 55170 alt, 55171 attributes: attributes3, 55172 className, 55173 isSelected, 55174 setAttributes, 55175 logoUrl: temporaryURL || logoUrl, 55176 setLogo, 55177 logoId: mediaItemData?.id || siteLogoId, 55178 siteUrl: url, 55179 setIcon, 55180 iconId: siteIconId, 55181 canUserEdit 55182 } 55183 ), 55184 canUserEdit && /* @__PURE__ */ (0, import_jsx_runtime406.jsx)(import_components138.DropZone, { onFilesDrop }) 55185 ] }); 55186 } 55187 const placeholder2 = (content) => { 55188 const placeholderClassName = clsx_default( 55189 "block-editor-media-placeholder", 55190 className 55191 ); 55192 return /* @__PURE__ */ (0, import_jsx_runtime406.jsx)( 55193 import_components138.Placeholder, 55194 { 55195 className: placeholderClassName, 55196 preview: logoImage, 55197 withIllustration: true, 55198 style: { 55199 width 55200 }, 55201 children: content 55202 } 55203 ); 55204 }; 55205 const classes = clsx_default(className, { 55206 "is-default-size": !width, 55207 "is-transient": temporaryURL 55208 }); 55209 const blockProps = (0, import_block_editor226.useBlockProps)({ className: classes }); 55210 const mediaInspectorPanel = (canUserEdit || logoUrl) && /* @__PURE__ */ (0, import_jsx_runtime406.jsx)(import_block_editor226.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime406.jsx)( 55211 import_components138.__experimentalToolsPanel, 55212 { 55213 label: (0, import_i18n215.__)("Media"), 55214 dropdownMenuProps, 55215 children: !canUserEdit ? /* @__PURE__ */ (0, import_jsx_runtime406.jsx)( 55216 "div", 55217 { 55218 className: "block-library-site-logo__inspector-media-replace-container", 55219 style: { gridColumn: "1 / -1" }, 55220 children: /* @__PURE__ */ (0, import_jsx_runtime406.jsx)( 55221 InspectorLogoPreview, 55222 { 55223 media: mediaItemData, 55224 itemGroupProps: { 55225 isBordered: true, 55226 className: "block-library-site-logo__inspector-readonly-logo-preview" 55227 } 55228 } 55229 ) 55230 } 55231 ) : /* @__PURE__ */ (0, import_jsx_runtime406.jsx)( 55232 import_components138.__experimentalToolsPanelItem, 55233 { 55234 hasValue: () => !!logoUrl, 55235 label: (0, import_i18n215.__)("Logo"), 55236 isShownByDefault: true, 55237 children: /* @__PURE__ */ (0, import_jsx_runtime406.jsxs)("div", { className: "block-library-site-logo__inspector-media-replace-container", children: [ 55238 /* @__PURE__ */ (0, import_jsx_runtime406.jsx)( 55239 SiteLogoReplaceFlow, 55240 { 55241 ...mediaReplaceFlowProps, 55242 name: !!logoUrl ? /* @__PURE__ */ (0, import_jsx_runtime406.jsx)( 55243 InspectorLogoPreview, 55244 { 55245 media: mediaItemData 55246 } 55247 ) : (0, import_i18n215.__)("Choose logo"), 55248 renderToggle: (props) => /* @__PURE__ */ (0, import_jsx_runtime406.jsx)(import_components138.Button, { ...props, __next40pxDefaultSize: true, children: temporaryURL ? /* @__PURE__ */ (0, import_jsx_runtime406.jsx)(import_components138.Spinner, {}) : props.children }) 55249 } 55250 ), 55251 /* @__PURE__ */ (0, import_jsx_runtime406.jsx)(import_components138.DropZone, { onFilesDrop }) 55252 ] }) 55253 } 55254 ) 55255 } 55256 ) }); 55257 return /* @__PURE__ */ (0, import_jsx_runtime406.jsxs)("div", { ...blockProps, children: [ 55258 controls, 55259 mediaInspectorPanel, 55260 (!!logoUrl || !!temporaryURL) && logoImage, 55261 (isLoading || !temporaryURL && !logoUrl && !canUserEdit) && /* @__PURE__ */ (0, import_jsx_runtime406.jsx)(import_components138.Placeholder, { className: "site-logo_placeholder", withIllustration: true, children: isLoading && /* @__PURE__ */ (0, import_jsx_runtime406.jsx)("span", { className: "components-placeholder__preview", children: /* @__PURE__ */ (0, import_jsx_runtime406.jsx)(import_components138.Spinner, {}) }) }), 55262 !isLoading && !temporaryURL && !logoUrl && canUserEdit && /* @__PURE__ */ (0, import_jsx_runtime406.jsx)( 55263 import_block_editor226.MediaPlaceholder, 55264 { 55265 onSelect: onInitialSelectLogo, 55266 accept: ACCEPT_MEDIA_STRING, 55267 allowedTypes: ALLOWED_MEDIA_TYPES7, 55268 onError: onUploadError, 55269 placeholder: placeholder2, 55270 mediaLibraryButton: ({ open }) => { 55271 return /* @__PURE__ */ (0, import_jsx_runtime406.jsx)( 55272 import_components138.Button, 55273 { 55274 __next40pxDefaultSize: true, 55275 icon: upload_default, 55276 variant: "primary", 55277 label: (0, import_i18n215.__)("Choose logo"), 55278 showTooltip: true, 55279 tooltipPosition: "middle right", 55280 onClick: () => { 55281 open(); 55282 } 55283 } 55284 ); 55285 } 55286 } 55287 ) 55288 ] }); 55289 } 55290 55291 // packages/block-library/build-module/site-logo/transforms.js 55292 var import_blocks99 = __toESM(require_blocks()); 55293 var transforms31 = { 55294 to: [ 55295 { 55296 type: "block", 55297 blocks: ["core/site-title"], 55298 transform: ({ isLink, linkTarget }) => { 55299 return (0, import_blocks99.createBlock)("core/site-title", { 55300 isLink, 55301 linkTarget 55302 }); 55303 } 55304 } 55305 ] 55306 }; 55307 var transforms_default32 = transforms31; 55308 55309 // packages/block-library/build-module/site-logo/index.js 55310 var { name: name96 } = block_default95; 55311 var settings95 = { 55312 icon: site_logo_default, 55313 example: {}, 55314 edit: LogoEdit, 55315 transforms: transforms_default32 55316 }; 55317 var init95 = () => initBlock({ name: name96, metadata: block_default95, settings: settings95 }); 55318 55319 // packages/block-library/build-module/site-tagline/index.js 55320 var site_tagline_exports = {}; 55321 __export(site_tagline_exports, { 55322 init: () => init96, 55323 metadata: () => block_default96, 55324 name: () => name97, 55325 settings: () => settings96 55326 }); 55327 55328 // packages/block-library/build-module/site-tagline/block.json 55329 var block_default96 = { 55330 $schema: "https://schemas.wp.org/trunk/block.json", 55331 apiVersion: 3, 55332 name: "core/site-tagline", 55333 title: "Site Tagline", 55334 category: "theme", 55335 description: "Describe in a few words what this site is about. This is important for search results, sharing on social media, and gives overall clarity to visitors.", 55336 keywords: ["description"], 55337 textdomain: "default", 55338 attributes: { 55339 textAlign: { 55340 type: "string" 55341 }, 55342 level: { 55343 type: "number", 55344 default: 0 55345 }, 55346 levelOptions: { 55347 type: "array", 55348 default: [0, 1, 2, 3, 4, 5, 6] 55349 } 55350 }, 55351 example: { 55352 viewportWidth: 350, 55353 attributes: { 55354 textAlign: "center" 55355 } 55356 }, 55357 supports: { 55358 align: ["wide", "full"], 55359 html: false, 55360 color: { 55361 gradients: true, 55362 __experimentalDefaultControls: { 55363 background: true, 55364 text: true 55365 } 55366 }, 55367 contentRole: true, 55368 spacing: { 55369 margin: true, 55370 padding: true, 55371 __experimentalDefaultControls: { 55372 margin: false, 55373 padding: false 55374 } 55375 }, 55376 typography: { 55377 fontSize: true, 55378 lineHeight: true, 55379 __experimentalFontFamily: true, 55380 __experimentalTextTransform: true, 55381 __experimentalTextDecoration: true, 55382 __experimentalFontStyle: true, 55383 __experimentalFontWeight: true, 55384 __experimentalLetterSpacing: true, 55385 __experimentalWritingMode: true, 55386 __experimentalDefaultControls: { 55387 fontSize: true 55388 } 55389 }, 55390 interactivity: { 55391 clientNavigation: true 55392 }, 55393 __experimentalBorder: { 55394 radius: true, 55395 color: true, 55396 width: true, 55397 style: true 55398 } 55399 }, 55400 editorStyle: "wp-block-site-tagline-editor", 55401 style: "wp-block-site-tagline" 55402 }; 55403 55404 // packages/block-library/build-module/site-tagline/edit.js 55405 var import_data120 = __toESM(require_data()); 55406 var import_core_data76 = __toESM(require_core_data()); 55407 var import_block_editor227 = __toESM(require_block_editor()); 55408 var import_i18n216 = __toESM(require_i18n()); 55409 var import_blocks100 = __toESM(require_blocks()); 55410 var import_jsx_runtime407 = __toESM(require_jsx_runtime()); 55411 function SiteTaglineEdit({ 55412 attributes: attributes3, 55413 setAttributes, 55414 insertBlocksAfter 55415 }) { 55416 const { textAlign, level, levelOptions } = attributes3; 55417 const { canUserEdit, tagline } = (0, import_data120.useSelect)((select9) => { 55418 const { canUser, getEntityRecord, getEditedEntityRecord } = select9(import_core_data76.store); 55419 const canEdit = canUser("update", { 55420 kind: "root", 55421 name: "site" 55422 }); 55423 const settings116 = canEdit ? getEditedEntityRecord("root", "site") : {}; 55424 const readOnlySettings = getEntityRecord("root", "__unstableBase"); 55425 return { 55426 canUserEdit: canEdit, 55427 tagline: canEdit ? settings116?.description : readOnlySettings?.description 55428 }; 55429 }, []); 55430 const TagName2 = level === 0 ? "p" : `h$level}`; 55431 const { editEntityRecord } = (0, import_data120.useDispatch)(import_core_data76.store); 55432 function setTagline(newTagline) { 55433 editEntityRecord("root", "site", void 0, { 55434 description: newTagline 55435 }); 55436 } 55437 const blockProps = (0, import_block_editor227.useBlockProps)({ 55438 className: clsx_default({ 55439 [`has-text-align-$textAlign}`]: textAlign, 55440 "wp-block-site-tagline__placeholder": !canUserEdit && !tagline 55441 }) 55442 }); 55443 const siteTaglineContent = canUserEdit ? /* @__PURE__ */ (0, import_jsx_runtime407.jsx)( 55444 import_block_editor227.RichText, 55445 { 55446 allowedFormats: [], 55447 onChange: setTagline, 55448 "aria-label": (0, import_i18n216.__)("Site tagline text"), 55449 placeholder: (0, import_i18n216.__)("Write site tagline\u2026"), 55450 tagName: TagName2, 55451 value: tagline, 55452 disableLineBreaks: true, 55453 __unstableOnSplitAtEnd: () => insertBlocksAfter((0, import_blocks100.createBlock)((0, import_blocks100.getDefaultBlockName)())), 55454 ...blockProps 55455 } 55456 ) : /* @__PURE__ */ (0, import_jsx_runtime407.jsx)(TagName2, { ...blockProps, children: tagline || (0, import_i18n216.__)("Site Tagline placeholder") }); 55457 return /* @__PURE__ */ (0, import_jsx_runtime407.jsxs)(import_jsx_runtime407.Fragment, { children: [ 55458 /* @__PURE__ */ (0, import_jsx_runtime407.jsxs)(import_block_editor227.BlockControls, { group: "block", children: [ 55459 /* @__PURE__ */ (0, import_jsx_runtime407.jsx)( 55460 import_block_editor227.HeadingLevelDropdown, 55461 { 55462 value: level, 55463 options: levelOptions, 55464 onChange: (newLevel) => setAttributes({ level: newLevel }) 55465 } 55466 ), 55467 /* @__PURE__ */ (0, import_jsx_runtime407.jsx)( 55468 import_block_editor227.AlignmentControl, 55469 { 55470 onChange: (newAlign) => setAttributes({ textAlign: newAlign }), 55471 value: textAlign 55472 } 55473 ) 55474 ] }), 55475 siteTaglineContent 55476 ] }); 55477 } 55478 55479 // packages/block-library/build-module/site-tagline/icon.js 55480 var import_components139 = __toESM(require_components()); 55481 var import_jsx_runtime408 = __toESM(require_jsx_runtime()); 55482 var icon_default7 = /* @__PURE__ */ (0, import_jsx_runtime408.jsx)(import_components139.SVG, { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", children: /* @__PURE__ */ (0, import_jsx_runtime408.jsx)(import_components139.Path, { d: "M4 10.5h16V9H4v1.5ZM4 15h9v-1.5H4V15Z" }) }); 55483 55484 // packages/block-library/build-module/site-tagline/deprecated.js 55485 var v129 = { 55486 attributes: { 55487 textAlign: { 55488 type: "string" 55489 } 55490 }, 55491 supports: { 55492 align: ["wide", "full"], 55493 html: false, 55494 color: { 55495 gradients: true 55496 }, 55497 spacing: { 55498 margin: true, 55499 padding: true 55500 }, 55501 typography: { 55502 fontSize: true, 55503 lineHeight: true, 55504 __experimentalFontFamily: true, 55505 __experimentalTextTransform: true, 55506 __experimentalFontStyle: true, 55507 __experimentalFontWeight: true, 55508 __experimentalLetterSpacing: true 55509 } 55510 }, 55511 save() { 55512 return null; 55513 }, 55514 migrate: migrate_font_family_default, 55515 isEligible({ style: style2 }) { 55516 return style2?.typography?.fontFamily; 55517 } 55518 }; 55519 var deprecated_default36 = [v129]; 55520 55521 // packages/block-library/build-module/site-tagline/index.js 55522 var { name: name97 } = block_default96; 55523 var settings96 = { 55524 icon: icon_default7, 55525 edit: SiteTaglineEdit, 55526 deprecated: deprecated_default36 55527 }; 55528 var init96 = () => initBlock({ name: name97, metadata: block_default96, settings: settings96 }); 55529 55530 // packages/block-library/build-module/site-title/index.js 55531 var site_title_exports = {}; 55532 __export(site_title_exports, { 55533 init: () => init97, 55534 metadata: () => block_default97, 55535 name: () => name98, 55536 settings: () => settings97 55537 }); 55538 55539 // packages/block-library/build-module/site-title/block.json 55540 var block_default97 = { 55541 $schema: "https://schemas.wp.org/trunk/block.json", 55542 apiVersion: 3, 55543 name: "core/site-title", 55544 title: "Site Title", 55545 category: "theme", 55546 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.", 55547 textdomain: "default", 55548 attributes: { 55549 level: { 55550 type: "number", 55551 default: 1 55552 }, 55553 levelOptions: { 55554 type: "array", 55555 default: [0, 1, 2, 3, 4, 5, 6] 55556 }, 55557 textAlign: { 55558 type: "string" 55559 }, 55560 isLink: { 55561 type: "boolean", 55562 default: true, 55563 role: "content" 55564 }, 55565 linkTarget: { 55566 type: "string", 55567 default: "_self", 55568 role: "content" 55569 } 55570 }, 55571 example: { 55572 viewportWidth: 500 55573 }, 55574 supports: { 55575 align: ["wide", "full"], 55576 html: false, 55577 color: { 55578 gradients: true, 55579 link: true, 55580 __experimentalDefaultControls: { 55581 background: true, 55582 text: true, 55583 link: true 55584 } 55585 }, 55586 spacing: { 55587 padding: true, 55588 margin: true, 55589 __experimentalDefaultControls: { 55590 margin: false, 55591 padding: false 55592 } 55593 }, 55594 typography: { 55595 fontSize: true, 55596 lineHeight: true, 55597 __experimentalFontFamily: true, 55598 __experimentalTextTransform: true, 55599 __experimentalTextDecoration: true, 55600 __experimentalFontStyle: true, 55601 __experimentalFontWeight: true, 55602 __experimentalLetterSpacing: true, 55603 __experimentalWritingMode: true, 55604 __experimentalDefaultControls: { 55605 fontSize: true 55606 } 55607 }, 55608 interactivity: { 55609 clientNavigation: true 55610 }, 55611 __experimentalBorder: { 55612 radius: true, 55613 color: true, 55614 width: true, 55615 style: true 55616 } 55617 }, 55618 editorStyle: "wp-block-site-title-editor", 55619 style: "wp-block-site-title" 55620 }; 55621 55622 // packages/block-library/build-module/site-title/edit.js 55623 var import_data121 = __toESM(require_data()); 55624 var import_core_data77 = __toESM(require_core_data()); 55625 var import_i18n217 = __toESM(require_i18n()); 55626 var import_block_editor228 = __toESM(require_block_editor()); 55627 var import_components140 = __toESM(require_components()); 55628 var import_blocks101 = __toESM(require_blocks()); 55629 var import_html_entities13 = __toESM(require_html_entities()); 55630 var import_jsx_runtime409 = __toESM(require_jsx_runtime()); 55631 function SiteTitleEdit({ 55632 attributes: attributes3, 55633 setAttributes, 55634 insertBlocksAfter 55635 }) { 55636 const { level, levelOptions, textAlign, isLink, linkTarget } = attributes3; 55637 const { canUserEdit, title } = (0, import_data121.useSelect)((select9) => { 55638 const { canUser, getEntityRecord, getEditedEntityRecord } = select9(import_core_data77.store); 55639 const canEdit = canUser("update", { 55640 kind: "root", 55641 name: "site" 55642 }); 55643 const settings116 = canEdit ? getEditedEntityRecord("root", "site") : {}; 55644 const readOnlySettings = getEntityRecord("root", "__unstableBase"); 55645 return { 55646 canUserEdit: canEdit, 55647 title: canEdit ? settings116?.title : readOnlySettings?.name 55648 }; 55649 }, []); 55650 const { editEntityRecord } = (0, import_data121.useDispatch)(import_core_data77.store); 55651 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 55652 const blockEditingMode = (0, import_block_editor228.useBlockEditingMode)(); 55653 function setTitle(newTitle) { 55654 editEntityRecord("root", "site", void 0, { 55655 title: newTitle.trim() 55656 }); 55657 } 55658 const TagName2 = level === 0 ? "p" : `h$level}`; 55659 const blockProps = (0, import_block_editor228.useBlockProps)({ 55660 className: clsx_default({ 55661 [`has-text-align-$textAlign}`]: textAlign, 55662 "wp-block-site-title__placeholder": !canUserEdit && !title 55663 }) 55664 }); 55665 const siteTitleContent = canUserEdit ? /* @__PURE__ */ (0, import_jsx_runtime409.jsx)(TagName2, { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime409.jsx)( 55666 import_block_editor228.RichText, 55667 { 55668 tagName: isLink ? "a" : "span", 55669 href: isLink ? "#site-title-pseudo-link" : void 0, 55670 "aria-label": (0, import_i18n217.__)("Site title text"), 55671 placeholder: (0, import_i18n217.__)("Write site title\u2026"), 55672 value: title, 55673 onChange: setTitle, 55674 allowedFormats: [], 55675 disableLineBreaks: true, 55676 __unstableOnSplitAtEnd: () => insertBlocksAfter((0, import_blocks101.createBlock)((0, import_blocks101.getDefaultBlockName)())) 55677 } 55678 ) }) : /* @__PURE__ */ (0, import_jsx_runtime409.jsx)(TagName2, { ...blockProps, children: isLink ? /* @__PURE__ */ (0, import_jsx_runtime409.jsx)( 55679 "a", 55680 { 55681 href: "#site-title-pseudo-link", 55682 onClick: (event) => event.preventDefault(), 55683 children: (0, import_html_entities13.decodeEntities)(title) || (0, import_i18n217.__)("Site Title placeholder") 55684 } 55685 ) : /* @__PURE__ */ (0, import_jsx_runtime409.jsx)("span", { children: (0, import_html_entities13.decodeEntities)(title) || (0, import_i18n217.__)("Site Title placeholder") }) }); 55686 return /* @__PURE__ */ (0, import_jsx_runtime409.jsxs)(import_jsx_runtime409.Fragment, { children: [ 55687 blockEditingMode === "default" && /* @__PURE__ */ (0, import_jsx_runtime409.jsxs)(import_block_editor228.BlockControls, { group: "block", children: [ 55688 /* @__PURE__ */ (0, import_jsx_runtime409.jsx)( 55689 import_block_editor228.HeadingLevelDropdown, 55690 { 55691 value: level, 55692 options: levelOptions, 55693 onChange: (newLevel) => setAttributes({ level: newLevel }) 55694 } 55695 ), 55696 /* @__PURE__ */ (0, import_jsx_runtime409.jsx)( 55697 import_block_editor228.AlignmentControl, 55698 { 55699 value: textAlign, 55700 onChange: (nextAlign) => { 55701 setAttributes({ textAlign: nextAlign }); 55702 } 55703 } 55704 ) 55705 ] }), 55706 /* @__PURE__ */ (0, import_jsx_runtime409.jsx)(import_block_editor228.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime409.jsxs)( 55707 import_components140.__experimentalToolsPanel, 55708 { 55709 label: (0, import_i18n217.__)("Settings"), 55710 resetAll: () => { 55711 setAttributes({ 55712 isLink: true, 55713 linkTarget: "_self" 55714 }); 55715 }, 55716 dropdownMenuProps, 55717 children: [ 55718 /* @__PURE__ */ (0, import_jsx_runtime409.jsx)( 55719 import_components140.__experimentalToolsPanelItem, 55720 { 55721 hasValue: () => !isLink, 55722 label: (0, import_i18n217.__)("Make title link to home"), 55723 onDeselect: () => setAttributes({ isLink: true }), 55724 isShownByDefault: true, 55725 children: /* @__PURE__ */ (0, import_jsx_runtime409.jsx)( 55726 import_components140.ToggleControl, 55727 { 55728 label: (0, import_i18n217.__)("Make title link to home"), 55729 onChange: () => setAttributes({ isLink: !isLink }), 55730 checked: isLink 55731 } 55732 ) 55733 } 55734 ), 55735 isLink && /* @__PURE__ */ (0, import_jsx_runtime409.jsx)( 55736 import_components140.__experimentalToolsPanelItem, 55737 { 55738 hasValue: () => linkTarget !== "_self", 55739 label: (0, import_i18n217.__)("Open in new tab"), 55740 onDeselect: () => setAttributes({ linkTarget: "_self" }), 55741 isShownByDefault: true, 55742 children: /* @__PURE__ */ (0, import_jsx_runtime409.jsx)( 55743 import_components140.ToggleControl, 55744 { 55745 label: (0, import_i18n217.__)("Open in new tab"), 55746 onChange: (value) => setAttributes({ 55747 linkTarget: value ? "_blank" : "_self" 55748 }), 55749 checked: linkTarget === "_blank" 55750 } 55751 ) 55752 } 55753 ) 55754 ] 55755 } 55756 ) }), 55757 siteTitleContent 55758 ] }); 55759 } 55760 55761 // packages/block-library/build-module/site-title/deprecated.js 55762 var v130 = { 55763 attributes: { 55764 level: { 55765 type: "number", 55766 default: 1 55767 }, 55768 textAlign: { 55769 type: "string" 55770 }, 55771 isLink: { 55772 type: "boolean", 55773 default: true 55774 }, 55775 linkTarget: { 55776 type: "string", 55777 default: "_self" 55778 } 55779 }, 55780 supports: { 55781 align: ["wide", "full"], 55782 html: false, 55783 color: { 55784 gradients: true, 55785 link: true 55786 }, 55787 spacing: { 55788 padding: true, 55789 margin: true 55790 }, 55791 typography: { 55792 fontSize: true, 55793 lineHeight: true, 55794 __experimentalFontFamily: true, 55795 __experimentalTextTransform: true, 55796 __experimentalFontStyle: true, 55797 __experimentalFontWeight: true, 55798 __experimentalLetterSpacing: true 55799 } 55800 }, 55801 save() { 55802 return null; 55803 }, 55804 migrate: migrate_font_family_default, 55805 isEligible({ style: style2 }) { 55806 return style2?.typography?.fontFamily; 55807 } 55808 }; 55809 var deprecated_default37 = [v130]; 55810 55811 // packages/block-library/build-module/site-title/transforms.js 55812 var import_blocks102 = __toESM(require_blocks()); 55813 var transforms32 = { 55814 to: [ 55815 { 55816 type: "block", 55817 blocks: ["core/site-logo"], 55818 transform: ({ isLink, linkTarget }) => { 55819 return (0, import_blocks102.createBlock)("core/site-logo", { 55820 isLink, 55821 linkTarget 55822 }); 55823 } 55824 } 55825 ] 55826 }; 55827 var transforms_default33 = transforms32; 55828 55829 // packages/block-library/build-module/site-title/index.js 55830 var { name: name98 } = block_default97; 55831 var settings97 = { 55832 icon: map_marker_default, 55833 example: { 55834 viewportWidth: 350, 55835 attributes: { 55836 textAlign: "center" 55837 } 55838 }, 55839 edit: SiteTitleEdit, 55840 transforms: transforms_default33, 55841 deprecated: deprecated_default37 55842 }; 55843 var init97 = () => initBlock({ name: name98, metadata: block_default97, settings: settings97 }); 55844 55845 // packages/block-library/build-module/social-link/index.js 55846 var social_link_exports = {}; 55847 __export(social_link_exports, { 55848 init: () => init98, 55849 metadata: () => block_default98, 55850 name: () => name99, 55851 settings: () => settings98 55852 }); 55853 var import_i18n221 = __toESM(require_i18n()); 55854 var import_blocks104 = __toESM(require_blocks()); 55855 55856 // packages/block-library/build-module/social-link/edit.js 55857 var import_keycodes10 = __toESM(require_keycodes()); 55858 var import_data122 = __toESM(require_data()); 55859 var import_block_editor229 = __toESM(require_block_editor()); 55860 var import_element113 = __toESM(require_element()); 55861 var import_components141 = __toESM(require_components()); 55862 var import_compose49 = __toESM(require_compose()); 55863 var import_i18n219 = __toESM(require_i18n()); 55864 var import_blocks103 = __toESM(require_blocks()); 55865 55866 // packages/block-library/build-module/social-link/social-list.js 55867 var import_i18n218 = __toESM(require_i18n()); 55868 55869 // packages/block-library/build-module/social-link/icons/amazon.js 55870 var import_primitives154 = __toESM(require_primitives()); 55871 var import_jsx_runtime410 = __toESM(require_jsx_runtime()); 55872 var AmazonIcon = () => /* @__PURE__ */ (0, import_jsx_runtime410.jsx)(import_primitives154.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime410.jsx)(import_primitives154.Path, { 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" }) }); 55873 55874 // packages/block-library/build-module/social-link/icons/bandcamp.js 55875 var import_primitives155 = __toESM(require_primitives()); 55876 var import_jsx_runtime411 = __toESM(require_jsx_runtime()); 55877 var BandcampIcon = () => /* @__PURE__ */ (0, import_jsx_runtime411.jsx)(import_primitives155.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime411.jsx)(import_primitives155.Path, { d: "M15.27 17.289 3 17.289 8.73 6.711 21 6.711 15.27 17.289" }) }); 55878 55879 // packages/block-library/build-module/social-link/icons/behance.js 55880 var import_primitives156 = __toESM(require_primitives()); 55881 var import_jsx_runtime412 = __toESM(require_jsx_runtime()); 55882 var BehanceIcon = () => /* @__PURE__ */ (0, import_jsx_runtime412.jsx)(import_primitives156.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime412.jsx)(import_primitives156.Path, { 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" }) }); 55883 55884 // packages/block-library/build-module/social-link/icons/bluesky.js 55885 var import_primitives157 = __toESM(require_primitives()); 55886 var import_jsx_runtime413 = __toESM(require_jsx_runtime()); 55887 var BlueskyIcon = () => /* @__PURE__ */ (0, import_jsx_runtime413.jsx)(import_primitives157.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime413.jsx)(import_primitives157.Path, { 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" }) }); 55888 55889 // packages/block-library/build-module/social-link/icons/chain.js 55890 var import_primitives158 = __toESM(require_primitives()); 55891 var import_jsx_runtime414 = __toESM(require_jsx_runtime()); 55892 var ChainIcon = () => /* @__PURE__ */ (0, import_jsx_runtime414.jsx)(import_primitives158.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime414.jsx)(import_primitives158.Path, { d: "M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z" }) }); 55893 55894 // packages/block-library/build-module/social-link/icons/codepen.js 55895 var import_primitives159 = __toESM(require_primitives()); 55896 var import_jsx_runtime415 = __toESM(require_jsx_runtime()); 55897 var CodepenIcon = () => /* @__PURE__ */ (0, import_jsx_runtime415.jsx)(import_primitives159.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime415.jsx)(import_primitives159.Path, { 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" }) }); 55898 55899 // packages/block-library/build-module/social-link/icons/deviantart.js 55900 var import_primitives160 = __toESM(require_primitives()); 55901 var import_jsx_runtime416 = __toESM(require_jsx_runtime()); 55902 var DeviantArtIcon = () => /* @__PURE__ */ (0, import_jsx_runtime416.jsx)(import_primitives160.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime416.jsx)(import_primitives160.Path, { 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" }) }); 55903 55904 // packages/block-library/build-module/social-link/icons/discord.js 55905 var import_primitives161 = __toESM(require_primitives()); 55906 var import_jsx_runtime417 = __toESM(require_jsx_runtime()); 55907 var DiscordIcon = () => /* @__PURE__ */ (0, import_jsx_runtime417.jsx)(import_primitives161.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime417.jsx)(import_primitives161.Path, { d: "M20.317 4.369A19.88 19.88 0 0 0 15.894 3a14.145 14.145 0 0 0-.719 1.518 19.205 19.205 0 0 0-5.351 0A14.183 14.183 0 0 0 9.104 3 19.896 19.896 0 0 0 4.682 4.369a18.921 18.921 0 0 0-3.012 12.52 19.929 19.929 0 0 0 6.081 3.097c.487-.65.922-1.339 1.3-2.061a12.445 12.445 0 0 1-1.958-.896c.165-.12.326-.246.483-.374a12.445 12.445 0 0 0 8.946 0c.157.128.318.253.483.374-.627.371-1.281.683-1.958.896.379.722.813 1.41 1.3 2.061a19.94 19.94 0 0 0 6.081-3.097 18.921 18.921 0 0 0-3.012-12.52ZM8.12 15.233c-1.202 0-2.184-1.09-2.184-2.431 0-1.34.97-2.431 2.184-2.431 1.213 0 2.202 1.09 2.184 2.431 0 1.341-.97 2.431-2.184 2.431Zm7.757 0c-1.202 0-2.184-1.09-2.184-2.431 0-1.34.97-2.431 2.184-2.431 1.213 0 2.202 1.09 2.184 2.431 0 1.341-.97 2.431-2.184 2.431Z" }) }); 55908 55909 // packages/block-library/build-module/social-link/icons/dribbble.js 55910 var import_primitives162 = __toESM(require_primitives()); 55911 var import_jsx_runtime418 = __toESM(require_jsx_runtime()); 55912 var DribbbleIcon = () => /* @__PURE__ */ (0, import_jsx_runtime418.jsx)(import_primitives162.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime418.jsx)(import_primitives162.Path, { 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" }) }); 55913 55914 // packages/block-library/build-module/social-link/icons/dropbox.js 55915 var import_primitives163 = __toESM(require_primitives()); 55916 var import_jsx_runtime419 = __toESM(require_jsx_runtime()); 55917 var DropboxIcon = () => /* @__PURE__ */ (0, import_jsx_runtime419.jsx)(import_primitives163.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime419.jsx)(import_primitives163.Path, { 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" }) }); 55918 55919 // packages/block-library/build-module/social-link/icons/etsy.js 55920 var import_primitives164 = __toESM(require_primitives()); 55921 var import_jsx_runtime420 = __toESM(require_jsx_runtime()); 55922 var EtsyIcon = () => /* @__PURE__ */ (0, import_jsx_runtime420.jsx)(import_primitives164.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime420.jsx)(import_primitives164.Path, { 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" }) }); 55923 55924 // packages/block-library/build-module/social-link/icons/facebook.js 55925 var import_primitives165 = __toESM(require_primitives()); 55926 var import_jsx_runtime421 = __toESM(require_jsx_runtime()); 55927 var FacebookIcon = () => /* @__PURE__ */ (0, import_jsx_runtime421.jsx)(import_primitives165.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime421.jsx)(import_primitives165.Path, { 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" }) }); 55928 55929 // packages/block-library/build-module/social-link/icons/feed.js 55930 var import_primitives166 = __toESM(require_primitives()); 55931 var import_jsx_runtime422 = __toESM(require_jsx_runtime()); 55932 var FeedIcon = () => /* @__PURE__ */ (0, import_jsx_runtime422.jsx)(import_primitives166.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime422.jsx)(import_primitives166.Path, { 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" }) }); 55933 55934 // packages/block-library/build-module/social-link/icons/fivehundredpx.js 55935 var import_primitives167 = __toESM(require_primitives()); 55936 var import_jsx_runtime423 = __toESM(require_jsx_runtime()); 55937 var FivehundredpxIcon = () => /* @__PURE__ */ (0, import_jsx_runtime423.jsx)(import_primitives167.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime423.jsx)(import_primitives167.Path, { 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" }) }); 55938 55939 // packages/block-library/build-module/social-link/icons/flickr.js 55940 var import_primitives168 = __toESM(require_primitives()); 55941 var import_jsx_runtime424 = __toESM(require_jsx_runtime()); 55942 var FlickrIcon = () => /* @__PURE__ */ (0, import_jsx_runtime424.jsx)(import_primitives168.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime424.jsx)(import_primitives168.Path, { 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" }) }); 55943 55944 // packages/block-library/build-module/social-link/icons/foursquare.js 55945 var import_primitives169 = __toESM(require_primitives()); 55946 var import_jsx_runtime425 = __toESM(require_jsx_runtime()); 55947 var FoursquareIcon = () => /* @__PURE__ */ (0, import_jsx_runtime425.jsx)(import_primitives169.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime425.jsx)(import_primitives169.Path, { 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" }) }); 55948 55949 // packages/block-library/build-module/social-link/icons/goodreads.js 55950 var import_primitives170 = __toESM(require_primitives()); 55951 var import_jsx_runtime426 = __toESM(require_jsx_runtime()); 55952 var GoodreadsIcon = () => /* @__PURE__ */ (0, import_jsx_runtime426.jsx)(import_primitives170.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime426.jsx)(import_primitives170.Path, { 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" }) }); 55953 55954 // packages/block-library/build-module/social-link/icons/google.js 55955 var import_primitives171 = __toESM(require_primitives()); 55956 var import_jsx_runtime427 = __toESM(require_jsx_runtime()); 55957 var GoogleIcon = () => /* @__PURE__ */ (0, import_jsx_runtime427.jsx)(import_primitives171.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime427.jsx)(import_primitives171.Path, { 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" }) }); 55958 55959 // packages/block-library/build-module/social-link/icons/github.js 55960 var import_primitives172 = __toESM(require_primitives()); 55961 var import_jsx_runtime428 = __toESM(require_jsx_runtime()); 55962 var GitHubIcon = () => /* @__PURE__ */ (0, import_jsx_runtime428.jsx)(import_primitives172.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime428.jsx)(import_primitives172.Path, { 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" }) }); 55963 55964 // packages/block-library/build-module/social-link/icons/gravatar.js 55965 var import_primitives173 = __toESM(require_primitives()); 55966 var import_jsx_runtime429 = __toESM(require_jsx_runtime()); 55967 var GravatarIcon = () => /* @__PURE__ */ (0, import_jsx_runtime429.jsx)(import_primitives173.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime429.jsx)(import_primitives173.Path, { 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" }) }); 55968 55969 // packages/block-library/build-module/social-link/icons/instagram.js 55970 var import_primitives174 = __toESM(require_primitives()); 55971 var import_jsx_runtime430 = __toESM(require_jsx_runtime()); 55972 var InstagramIcon = () => /* @__PURE__ */ (0, import_jsx_runtime430.jsx)(import_primitives174.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime430.jsx)(import_primitives174.Path, { 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" }) }); 55973 55974 // packages/block-library/build-module/social-link/icons/lastfm.js 55975 var import_primitives175 = __toESM(require_primitives()); 55976 var import_jsx_runtime431 = __toESM(require_jsx_runtime()); 55977 var LastfmIcon = () => /* @__PURE__ */ (0, import_jsx_runtime431.jsx)(import_primitives175.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime431.jsx)(import_primitives175.Path, { 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" }) }); 55978 55979 // packages/block-library/build-module/social-link/icons/linkedin.js 55980 var import_primitives176 = __toESM(require_primitives()); 55981 var import_jsx_runtime432 = __toESM(require_jsx_runtime()); 55982 var LinkedInIcon = () => /* @__PURE__ */ (0, import_jsx_runtime432.jsx)(import_primitives176.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime432.jsx)(import_primitives176.Path, { 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" }) }); 55983 55984 // packages/block-library/build-module/social-link/icons/mail.js 55985 var import_primitives177 = __toESM(require_primitives()); 55986 var import_jsx_runtime433 = __toESM(require_jsx_runtime()); 55987 var MailIcon = () => /* @__PURE__ */ (0, import_jsx_runtime433.jsx)(import_primitives177.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime433.jsx)(import_primitives177.Path, { 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" }) }); 55988 55989 // packages/block-library/build-module/social-link/icons/mastodon.js 55990 var import_primitives178 = __toESM(require_primitives()); 55991 var import_jsx_runtime434 = __toESM(require_jsx_runtime()); 55992 var MastodonIcon = () => /* @__PURE__ */ (0, import_jsx_runtime434.jsx)(import_primitives178.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime434.jsx)(import_primitives178.Path, { 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" }) }); 55993 55994 // packages/block-library/build-module/social-link/icons/meetup.js 55995 var import_primitives179 = __toESM(require_primitives()); 55996 var import_jsx_runtime435 = __toESM(require_jsx_runtime()); 55997 var MeetupIcon = () => /* @__PURE__ */ (0, import_jsx_runtime435.jsx)(import_primitives179.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime435.jsx)(import_primitives179.Path, { 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" }) }); 55998 55999 // packages/block-library/build-module/social-link/icons/medium.js 56000 var import_primitives180 = __toESM(require_primitives()); 56001 var import_jsx_runtime436 = __toESM(require_jsx_runtime()); 56002 var MediumIcon = () => /* @__PURE__ */ (0, import_jsx_runtime436.jsx)(import_primitives180.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime436.jsx)(import_primitives180.Path, { 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" }) }); 56003 56004 // packages/block-library/build-module/social-link/icons/patreon.js 56005 var import_primitives181 = __toESM(require_primitives()); 56006 var import_jsx_runtime437 = __toESM(require_jsx_runtime()); 56007 var PatreonIcon = () => /* @__PURE__ */ (0, import_jsx_runtime437.jsx)(import_primitives181.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime437.jsx)(import_primitives181.Path, { 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" }) }); 56008 56009 // packages/block-library/build-module/social-link/icons/pinterest.js 56010 var import_primitives182 = __toESM(require_primitives()); 56011 var import_jsx_runtime438 = __toESM(require_jsx_runtime()); 56012 var PinterestIcon = () => /* @__PURE__ */ (0, import_jsx_runtime438.jsx)(import_primitives182.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime438.jsx)(import_primitives182.Path, { d: "M12.289,2C6.617,2,3.606,5.648,3.606,9.622c0,1.846,1.025,4.146,2.666,4.878c0.25,0.111,0.381,0.063,0.439-0.169 c0.044-0.175,0.267-1.029,0.365-1.428c0.032-0.128,0.017-0.237-0.091-0.362C6.445,11.911,6.01,10.75,6.01,9.668 c0-2.777,2.194-5.464,5.933-5.464c3.23,0,5.49,2.108,5.49,5.122c0,3.407-1.794,5.768-4.13,5.768c-1.291,0-2.257-1.021-1.948-2.277 c0.372-1.495,1.089-3.112,1.089-4.191c0-0.967-0.542-1.775-1.663-1.775c-1.319,0-2.379,1.309-2.379,3.059 c0,1.115,0.394,1.869,0.394,1.869s-1.302,5.279-1.54,6.261c-0.405,1.666,0.053,4.368,0.094,4.604 c0.021,0.126,0.167,0.169,0.25,0.063c0.129-0.165,1.699-2.419,2.142-4.051c0.158-0.59,0.817-2.995,0.817-2.995 c0.43,0.784,1.681,1.446,3.013,1.446c3.963,0,6.822-3.494,6.822-7.833C20.394,5.112,16.849,2,12.289,2" }) }); 56013 56014 // packages/block-library/build-module/social-link/icons/pocket.js 56015 var import_primitives183 = __toESM(require_primitives()); 56016 var import_jsx_runtime439 = __toESM(require_jsx_runtime()); 56017 var PocketIcon = () => /* @__PURE__ */ (0, import_jsx_runtime439.jsx)(import_primitives183.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime439.jsx)(import_primitives183.Path, { 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" }) }); 56018 56019 // packages/block-library/build-module/social-link/icons/reddit.js 56020 var import_primitives184 = __toESM(require_primitives()); 56021 var import_jsx_runtime440 = __toESM(require_jsx_runtime()); 56022 var RedditIcon = () => /* @__PURE__ */ (0, import_jsx_runtime440.jsx)(import_primitives184.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime440.jsx)(import_primitives184.Path, { 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" }) }); 56023 56024 // packages/block-library/build-module/social-link/icons/skype.js 56025 var import_primitives185 = __toESM(require_primitives()); 56026 var import_jsx_runtime441 = __toESM(require_jsx_runtime()); 56027 var SkypeIcon = () => /* @__PURE__ */ (0, import_jsx_runtime441.jsx)(import_primitives185.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime441.jsx)(import_primitives185.Path, { 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" }) }); 56028 56029 // packages/block-library/build-module/social-link/icons/snapchat.js 56030 var import_primitives186 = __toESM(require_primitives()); 56031 var import_jsx_runtime442 = __toESM(require_jsx_runtime()); 56032 var SnapchatIcon = () => /* @__PURE__ */ (0, import_jsx_runtime442.jsx)(import_primitives186.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime442.jsx)(import_primitives186.Path, { 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" }) }); 56033 56034 // packages/block-library/build-module/social-link/icons/soundcloud.js 56035 var import_primitives187 = __toESM(require_primitives()); 56036 var import_jsx_runtime443 = __toESM(require_jsx_runtime()); 56037 var SoundCloudIcon = () => /* @__PURE__ */ (0, import_jsx_runtime443.jsx)(import_primitives187.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime443.jsx)(import_primitives187.Path, { 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" }) }); 56038 56039 // packages/block-library/build-module/social-link/icons/spotify.js 56040 var import_primitives188 = __toESM(require_primitives()); 56041 var import_jsx_runtime444 = __toESM(require_jsx_runtime()); 56042 var SpotifyIcon = () => /* @__PURE__ */ (0, import_jsx_runtime444.jsx)(import_primitives188.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime444.jsx)(import_primitives188.Path, { 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" }) }); 56043 56044 // packages/block-library/build-module/social-link/icons/telegram.js 56045 var import_primitives189 = __toESM(require_primitives()); 56046 var import_jsx_runtime445 = __toESM(require_jsx_runtime()); 56047 var TelegramIcon = () => /* @__PURE__ */ (0, import_jsx_runtime445.jsx)(import_primitives189.SVG, { width: "24", height: "24", viewBox: "0 0 128 128", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime445.jsx)(import_primitives189.Path, { 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" }) }); 56048 56049 // packages/block-library/build-module/social-link/icons/threads.js 56050 var import_primitives190 = __toESM(require_primitives()); 56051 var import_jsx_runtime446 = __toESM(require_jsx_runtime()); 56052 var ThreadsIcon = () => /* @__PURE__ */ (0, import_jsx_runtime446.jsx)(import_primitives190.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime446.jsx)(import_primitives190.Path, { 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" }) }); 56053 56054 // packages/block-library/build-module/social-link/icons/tiktok.js 56055 var import_primitives191 = __toESM(require_primitives()); 56056 var import_jsx_runtime447 = __toESM(require_jsx_runtime()); 56057 var TiktokIcon = () => /* @__PURE__ */ (0, import_jsx_runtime447.jsx)(import_primitives191.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime447.jsx)(import_primitives191.Path, { d: "M12.4044 3.01519C13.4086 3 14.4072 3.009 15.4045 3C15.465 4.14812 15.8874 5.31762 16.7472 6.12935C17.6053 6.96134 18.819 7.34217 20 7.47099V10.4912C18.8933 10.4558 17.7814 10.2308 16.7771 9.76499C16.3397 9.57148 15.9323 9.32227 15.5334 9.06745C15.5283 11.2591 15.5426 13.4479 15.5191 15.6305C15.4592 16.679 15.1053 17.7225 14.4814 18.5866C13.4777 20.025 11.7356 20.9627 9.94635 20.992C8.84885 21.0533 7.7525 20.7608 6.81729 20.2219C5.26743 19.3286 4.17683 17.6933 4.01799 15.9382C3.99957 15.563 3.99324 15.1883 4.00878 14.8221C4.14691 13.395 4.86917 12.0297 5.99027 11.101C7.26101 10.0192 9.04107 9.50397 10.7078 9.80886C10.7233 10.9199 10.6778 12.0297 10.6778 13.1407C9.91643 12.9 9.02668 12.9675 8.36139 13.4192C7.87566 13.7269 7.50675 14.1983 7.31453 14.7316C7.15569 15.1118 7.20116 15.5343 7.21036 15.9382C7.3928 17.169 8.60368 18.2035 9.89628 18.0916C10.7532 18.0826 11.5745 17.5965 12.0211 16.8849C12.1655 16.6357 12.3273 16.3809 12.3359 16.0878C12.4113 14.7462 12.3814 13.4102 12.3906 12.0685C12.3969 9.04495 12.3814 6.02979 12.4049 3.01575L12.4044 3.01519Z" }) }); 56058 56059 // packages/block-library/build-module/social-link/icons/tumblr.js 56060 var import_primitives192 = __toESM(require_primitives()); 56061 var import_jsx_runtime448 = __toESM(require_jsx_runtime()); 56062 var TumblrIcon = () => /* @__PURE__ */ (0, import_jsx_runtime448.jsx)(import_primitives192.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime448.jsx)(import_primitives192.Path, { 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" }) }); 56063 56064 // packages/block-library/build-module/social-link/icons/twitch.js 56065 var import_primitives193 = __toESM(require_primitives()); 56066 var import_jsx_runtime449 = __toESM(require_jsx_runtime()); 56067 var TwitchIcon = () => /* @__PURE__ */ (0, import_jsx_runtime449.jsx)(import_primitives193.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime449.jsx)(import_primitives193.Path, { 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" }) }); 56068 56069 // packages/block-library/build-module/social-link/icons/twitter.js 56070 var import_primitives194 = __toESM(require_primitives()); 56071 var import_jsx_runtime450 = __toESM(require_jsx_runtime()); 56072 var TwitterIcon = () => /* @__PURE__ */ (0, import_jsx_runtime450.jsx)(import_primitives194.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime450.jsx)(import_primitives194.Path, { 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" }) }); 56073 56074 // packages/block-library/build-module/social-link/icons/vimeo.js 56075 var import_primitives195 = __toESM(require_primitives()); 56076 var import_jsx_runtime451 = __toESM(require_jsx_runtime()); 56077 var VimeoIcon = () => /* @__PURE__ */ (0, import_jsx_runtime451.jsx)(import_primitives195.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime451.jsx)(import_primitives195.Path, { 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" }) }); 56078 56079 // packages/block-library/build-module/social-link/icons/vk.js 56080 var import_primitives196 = __toESM(require_primitives()); 56081 var import_jsx_runtime452 = __toESM(require_jsx_runtime()); 56082 var VkIcon = () => /* @__PURE__ */ (0, import_jsx_runtime452.jsx)(import_primitives196.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime452.jsx)(import_primitives196.Path, { 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" }) }); 56083 56084 // packages/block-library/build-module/social-link/icons/whatsapp.js 56085 var import_primitives197 = __toESM(require_primitives()); 56086 var import_jsx_runtime453 = __toESM(require_jsx_runtime()); 56087 var WhatsAppIcon = () => /* @__PURE__ */ (0, import_jsx_runtime453.jsx)(import_primitives197.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime453.jsx)(import_primitives197.Path, { 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" }) }); 56088 56089 // packages/block-library/build-module/social-link/icons/wordpress.js 56090 var import_primitives198 = __toESM(require_primitives()); 56091 var import_jsx_runtime454 = __toESM(require_jsx_runtime()); 56092 var WordPressIcon = () => /* @__PURE__ */ (0, import_jsx_runtime454.jsx)( 56093 import_primitives198.SVG, 56094 { 56095 width: "24", 56096 height: "24", 56097 viewBox: "0 0 24 24", 56098 version: "1.1", 56099 xmlns: "http://www.w3.org/2000/svg", 56100 children: /* @__PURE__ */ (0, import_jsx_runtime454.jsx)(import_primitives198.Path, { 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" }) 56101 } 56102 ); 56103 56104 // packages/block-library/build-module/social-link/icons/x.js 56105 var import_primitives199 = __toESM(require_primitives()); 56106 var import_jsx_runtime455 = __toESM(require_jsx_runtime()); 56107 var XIcon = () => /* @__PURE__ */ (0, import_jsx_runtime455.jsx)(import_primitives199.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime455.jsx)(import_primitives199.Path, { 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" }) }); 56108 56109 // packages/block-library/build-module/social-link/icons/yelp.js 56110 var import_primitives200 = __toESM(require_primitives()); 56111 var import_jsx_runtime456 = __toESM(require_jsx_runtime()); 56112 var YelpIcon = () => /* @__PURE__ */ (0, import_jsx_runtime456.jsx)(import_primitives200.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime456.jsx)(import_primitives200.Path, { 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" }) }); 56113 56114 // packages/block-library/build-module/social-link/icons/youtube.js 56115 var import_primitives201 = __toESM(require_primitives()); 56116 var import_jsx_runtime457 = __toESM(require_jsx_runtime()); 56117 var YouTubeIcon = () => /* @__PURE__ */ (0, import_jsx_runtime457.jsx)(import_primitives201.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime457.jsx)(import_primitives201.Path, { 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" }) }); 56118 56119 // packages/block-library/build-module/social-link/social-list.js 56120 function getSocialService(variation) { 56121 if (!variation?.name) { 56122 return { 56123 icon: ChainIcon, 56124 label: (0, import_i18n218.__)("Social Icon") 56125 }; 56126 } 56127 return { 56128 icon: variation?.icon ?? ChainIcon, 56129 label: variation?.title ?? (0, import_i18n218.__)("Social Icon") 56130 }; 56131 } 56132 56133 // packages/block-library/build-module/social-link/edit.js 56134 var import_jsx_runtime458 = __toESM(require_jsx_runtime()); 56135 var SocialLinkURLPopover = ({ 56136 url, 56137 setAttributes, 56138 setPopover, 56139 popoverAnchor, 56140 clientId 56141 }) => { 56142 const { removeBlock } = (0, import_data122.useDispatch)(import_block_editor229.store); 56143 return /* @__PURE__ */ (0, import_jsx_runtime458.jsx)( 56144 import_block_editor229.URLPopover, 56145 { 56146 anchor: popoverAnchor, 56147 "aria-label": (0, import_i18n219.__)("Edit social link"), 56148 onClose: () => { 56149 setPopover(false); 56150 popoverAnchor?.focus(); 56151 }, 56152 children: /* @__PURE__ */ (0, import_jsx_runtime458.jsx)( 56153 "form", 56154 { 56155 className: "block-editor-url-popover__link-editor", 56156 onSubmit: (event) => { 56157 event.preventDefault(); 56158 setPopover(false); 56159 popoverAnchor?.focus(); 56160 }, 56161 children: /* @__PURE__ */ (0, import_jsx_runtime458.jsx)("div", { className: "block-editor-url-input", children: /* @__PURE__ */ (0, import_jsx_runtime458.jsx)( 56162 import_block_editor229.URLInput, 56163 { 56164 value: url, 56165 onChange: (nextURL) => setAttributes({ url: nextURL }), 56166 placeholder: (0, import_i18n219.__)("Enter social link"), 56167 label: (0, import_i18n219.__)("Enter social link"), 56168 hideLabelFromVision: true, 56169 disableSuggestions: true, 56170 onKeyDown: (event) => { 56171 if (!!url || event.defaultPrevented || ![import_keycodes10.BACKSPACE, import_keycodes10.DELETE].includes( 56172 event.keyCode 56173 )) { 56174 return; 56175 } 56176 removeBlock(clientId); 56177 }, 56178 suffix: /* @__PURE__ */ (0, import_jsx_runtime458.jsx)(import_components141.__experimentalInputControlSuffixWrapper, { variant: "control", children: /* @__PURE__ */ (0, import_jsx_runtime458.jsx)( 56179 import_components141.Button, 56180 { 56181 icon: keyboard_return_default, 56182 label: (0, import_i18n219.__)("Apply"), 56183 type: "submit", 56184 size: "small" 56185 } 56186 ) }) 56187 } 56188 ) }) 56189 } 56190 ) 56191 } 56192 ); 56193 }; 56194 var SocialLinkEdit = ({ 56195 attributes: attributes3, 56196 context, 56197 isSelected, 56198 setAttributes, 56199 clientId, 56200 name: name117 56201 }) => { 56202 const { url, service, label = "", rel } = attributes3; 56203 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 56204 const { 56205 showLabels, 56206 iconColor, 56207 iconColorValue, 56208 iconBackgroundColor, 56209 iconBackgroundColorValue 56210 } = context; 56211 const [showURLPopover, setPopover] = (0, import_element113.useState)(false); 56212 const wrapperClasses = clsx_default( 56213 "wp-social-link", 56214 // Manually adding this class for backwards compatibility of CSS when moving the 56215 // blockProps from the li to the button: https://github.com/WordPress/gutenberg/pull/64883 56216 "wp-block-social-link", 56217 "wp-social-link-" + service, 56218 { 56219 "wp-social-link__is-incomplete": !url, 56220 [`has-$iconColor}-color`]: iconColor, 56221 [`has-$iconBackgroundColor}-background-color`]: iconBackgroundColor 56222 } 56223 ); 56224 const [popoverAnchor, setPopoverAnchor] = (0, import_element113.useState)(null); 56225 const isContentOnlyMode = (0, import_block_editor229.useBlockEditingMode)() === "contentOnly"; 56226 const { activeVariation } = (0, import_data122.useSelect)( 56227 (select9) => { 56228 const { getActiveBlockVariation } = select9(import_blocks103.store); 56229 return { 56230 activeVariation: getActiveBlockVariation(name117, attributes3) 56231 }; 56232 }, 56233 [name117, attributes3] 56234 ); 56235 const { icon, label: socialLinkName } = getSocialService(activeVariation); 56236 const socialLinkText = label.trim() === "" ? socialLinkName : label; 56237 const ref = (0, import_element113.useRef)(); 56238 const blockProps = (0, import_block_editor229.useBlockProps)({ 56239 className: "wp-block-social-link-anchor", 56240 ref: (0, import_compose49.useMergeRefs)([setPopoverAnchor, ref]), 56241 onClick: () => setPopover(true), 56242 onKeyDown: (event) => { 56243 if (event.keyCode === import_keycodes10.ENTER) { 56244 event.preventDefault(); 56245 setPopover(true); 56246 } 56247 } 56248 }); 56249 return /* @__PURE__ */ (0, import_jsx_runtime458.jsxs)(import_jsx_runtime458.Fragment, { children: [ 56250 isContentOnlyMode && showLabels && // Add an extra control to modify the label attribute when content only mode is active. 56251 // With content only mode active, the inspector is hidden, so users need another way 56252 // to edit this attribute. 56253 /* @__PURE__ */ (0, import_jsx_runtime458.jsx)(import_block_editor229.BlockControls, { group: "other", children: /* @__PURE__ */ (0, import_jsx_runtime458.jsx)( 56254 import_components141.Dropdown, 56255 { 56256 popoverProps: { placement: "bottom-start" }, 56257 renderToggle: ({ isOpen, onToggle }) => /* @__PURE__ */ (0, import_jsx_runtime458.jsx)( 56258 import_components141.ToolbarButton, 56259 { 56260 onClick: onToggle, 56261 "aria-haspopup": "true", 56262 "aria-expanded": isOpen, 56263 children: (0, import_i18n219.__)("Text") 56264 } 56265 ), 56266 renderContent: () => /* @__PURE__ */ (0, import_jsx_runtime458.jsx)( 56267 import_components141.TextControl, 56268 { 56269 __next40pxDefaultSize: true, 56270 className: "wp-block-social-link__toolbar_content_text", 56271 label: (0, import_i18n219.__)("Text"), 56272 help: (0, import_i18n219.__)( 56273 "Provide a text label or use the default." 56274 ), 56275 value: label, 56276 onChange: (value) => setAttributes({ label: value }), 56277 placeholder: socialLinkName 56278 } 56279 ) 56280 } 56281 ) }), 56282 /* @__PURE__ */ (0, import_jsx_runtime458.jsx)(import_block_editor229.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime458.jsx)( 56283 import_components141.__experimentalToolsPanel, 56284 { 56285 label: (0, import_i18n219.__)("Settings"), 56286 resetAll: () => { 56287 setAttributes({ label: void 0 }); 56288 }, 56289 dropdownMenuProps, 56290 children: /* @__PURE__ */ (0, import_jsx_runtime458.jsx)( 56291 import_components141.__experimentalToolsPanelItem, 56292 { 56293 isShownByDefault: true, 56294 label: (0, import_i18n219.__)("Text"), 56295 hasValue: () => !!label, 56296 onDeselect: () => { 56297 setAttributes({ label: void 0 }); 56298 }, 56299 children: /* @__PURE__ */ (0, import_jsx_runtime458.jsx)( 56300 import_components141.TextControl, 56301 { 56302 __next40pxDefaultSize: true, 56303 label: (0, import_i18n219.__)("Text"), 56304 help: (0, import_i18n219.__)( 56305 "The text is visible when enabled from the parent Social Icons block." 56306 ), 56307 value: label, 56308 onChange: (value) => setAttributes({ label: value }), 56309 placeholder: socialLinkName 56310 } 56311 ) 56312 } 56313 ) 56314 } 56315 ) }), 56316 /* @__PURE__ */ (0, import_jsx_runtime458.jsx)(import_block_editor229.InspectorControls, { group: "advanced", children: /* @__PURE__ */ (0, import_jsx_runtime458.jsx)( 56317 import_components141.TextControl, 56318 { 56319 __next40pxDefaultSize: true, 56320 label: (0, import_i18n219.__)("Link relation"), 56321 help: (0, import_element113.createInterpolateElement)( 56322 (0, import_i18n219.__)( 56323 "The <a>Link Relation</a> attribute defines the relationship between a linked resource and the current document." 56324 ), 56325 { 56326 a: /* @__PURE__ */ (0, import_jsx_runtime458.jsx)(import_components141.ExternalLink, { href: "https://developer.mozilla.org/docs/Web/HTML/Attributes/rel" }) 56327 } 56328 ), 56329 value: rel || "", 56330 onChange: (value) => setAttributes({ rel: value }) 56331 } 56332 ) }), 56333 /* @__PURE__ */ (0, import_jsx_runtime458.jsxs)( 56334 "li", 56335 { 56336 role: "presentation", 56337 className: wrapperClasses, 56338 style: { 56339 color: iconColorValue, 56340 backgroundColor: iconBackgroundColorValue 56341 }, 56342 children: [ 56343 /* @__PURE__ */ (0, import_jsx_runtime458.jsxs)("button", { "aria-haspopup": "dialog", ...blockProps, role: "button", children: [ 56344 /* @__PURE__ */ (0, import_jsx_runtime458.jsx)(import_components141.Icon, { icon }), 56345 /* @__PURE__ */ (0, import_jsx_runtime458.jsx)( 56346 "span", 56347 { 56348 className: clsx_default("wp-block-social-link-label", { 56349 "screen-reader-text": !showLabels 56350 }), 56351 children: socialLinkText 56352 } 56353 ) 56354 ] }), 56355 isSelected && showURLPopover && /* @__PURE__ */ (0, import_jsx_runtime458.jsx)( 56356 SocialLinkURLPopover, 56357 { 56358 url, 56359 setAttributes, 56360 setPopover, 56361 popoverAnchor, 56362 clientId 56363 } 56364 ) 56365 ] 56366 } 56367 ) 56368 ] }); 56369 }; 56370 var edit_default29 = SocialLinkEdit; 56371 56372 // packages/block-library/build-module/social-link/block.json 56373 var block_default98 = { 56374 $schema: "https://schemas.wp.org/trunk/block.json", 56375 apiVersion: 3, 56376 name: "core/social-link", 56377 title: "Social Icon", 56378 category: "widgets", 56379 parent: ["core/social-links"], 56380 description: "Display an icon linking to a social profile or site.", 56381 textdomain: "default", 56382 attributes: { 56383 url: { 56384 type: "string", 56385 role: "content" 56386 }, 56387 service: { 56388 type: "string" 56389 }, 56390 label: { 56391 type: "string", 56392 role: "content" 56393 }, 56394 rel: { 56395 type: "string" 56396 } 56397 }, 56398 usesContext: [ 56399 "openInNewTab", 56400 "showLabels", 56401 "iconColor", 56402 "iconColorValue", 56403 "iconBackgroundColor", 56404 "iconBackgroundColorValue" 56405 ], 56406 supports: { 56407 reusable: false, 56408 html: false, 56409 interactivity: { 56410 clientNavigation: true 56411 } 56412 }, 56413 editorStyle: "wp-block-social-link-editor" 56414 }; 56415 56416 // packages/block-library/build-module/social-link/variations.js 56417 var import_i18n220 = __toESM(require_i18n()); 56418 var variations16 = [ 56419 { 56420 isDefault: true, 56421 name: "wordpress", 56422 attributes: { service: "wordpress" }, 56423 title: (0, import_i18n220._x)("WordPress", "social link block variation name"), 56424 icon: WordPressIcon 56425 }, 56426 { 56427 name: "fivehundredpx", 56428 attributes: { service: "fivehundredpx" }, 56429 title: (0, import_i18n220._x)("500px", "social link block variation name"), 56430 icon: FivehundredpxIcon 56431 }, 56432 { 56433 name: "amazon", 56434 attributes: { service: "amazon" }, 56435 title: (0, import_i18n220._x)("Amazon", "social link block variation name"), 56436 icon: AmazonIcon 56437 }, 56438 { 56439 name: "bandcamp", 56440 attributes: { service: "bandcamp" }, 56441 title: (0, import_i18n220._x)("Bandcamp", "social link block variation name"), 56442 icon: BandcampIcon 56443 }, 56444 { 56445 name: "behance", 56446 attributes: { service: "behance" }, 56447 title: (0, import_i18n220._x)("Behance", "social link block variation name"), 56448 icon: BehanceIcon 56449 }, 56450 { 56451 name: "bluesky", 56452 attributes: { service: "bluesky" }, 56453 title: (0, import_i18n220._x)("Bluesky", "social link block variation name"), 56454 icon: BlueskyIcon 56455 }, 56456 { 56457 name: "chain", 56458 attributes: { service: "chain" }, 56459 title: (0, import_i18n220._x)("Link", "social link block variation name"), 56460 icon: ChainIcon 56461 }, 56462 { 56463 name: "codepen", 56464 attributes: { service: "codepen" }, 56465 title: (0, import_i18n220._x)("CodePen", "social link block variation name"), 56466 icon: CodepenIcon 56467 }, 56468 { 56469 name: "deviantart", 56470 attributes: { service: "deviantart" }, 56471 title: (0, import_i18n220._x)("DeviantArt", "social link block variation name"), 56472 icon: DeviantArtIcon 56473 }, 56474 { 56475 name: "discord", 56476 attributes: { service: "discord" }, 56477 title: (0, import_i18n220._x)("Discord", "social link block variation name"), 56478 icon: DiscordIcon 56479 }, 56480 { 56481 name: "dribbble", 56482 attributes: { service: "dribbble" }, 56483 title: (0, import_i18n220._x)("Dribbble", "social link block variation name"), 56484 icon: DribbbleIcon 56485 }, 56486 { 56487 name: "dropbox", 56488 attributes: { service: "dropbox" }, 56489 title: (0, import_i18n220._x)("Dropbox", "social link block variation name"), 56490 icon: DropboxIcon 56491 }, 56492 { 56493 name: "etsy", 56494 attributes: { service: "etsy" }, 56495 title: (0, import_i18n220._x)("Etsy", "social link block variation name"), 56496 icon: EtsyIcon 56497 }, 56498 { 56499 name: "facebook", 56500 attributes: { service: "facebook" }, 56501 title: (0, import_i18n220._x)("Facebook", "social link block variation name"), 56502 icon: FacebookIcon 56503 }, 56504 { 56505 name: "feed", 56506 attributes: { service: "feed" }, 56507 title: (0, import_i18n220._x)("RSS Feed", "social link block variation name"), 56508 icon: FeedIcon 56509 }, 56510 { 56511 name: "flickr", 56512 attributes: { service: "flickr" }, 56513 title: (0, import_i18n220._x)("Flickr", "social link block variation name"), 56514 icon: FlickrIcon 56515 }, 56516 { 56517 name: "foursquare", 56518 attributes: { service: "foursquare" }, 56519 title: (0, import_i18n220._x)("Foursquare", "social link block variation name"), 56520 icon: FoursquareIcon 56521 }, 56522 { 56523 name: "goodreads", 56524 attributes: { service: "goodreads" }, 56525 title: (0, import_i18n220._x)("Goodreads", "social link block variation name"), 56526 icon: GoodreadsIcon 56527 }, 56528 { 56529 name: "google", 56530 attributes: { service: "google" }, 56531 title: (0, import_i18n220._x)("Google", "social link block variation name"), 56532 icon: GoogleIcon 56533 }, 56534 { 56535 name: "github", 56536 attributes: { service: "github" }, 56537 title: (0, import_i18n220._x)("GitHub", "social link block variation name"), 56538 icon: GitHubIcon 56539 }, 56540 { 56541 name: "gravatar", 56542 attributes: { service: "gravatar" }, 56543 title: (0, import_i18n220._x)("Gravatar", "social link block variation name"), 56544 icon: GravatarIcon 56545 }, 56546 { 56547 name: "instagram", 56548 attributes: { service: "instagram" }, 56549 title: (0, import_i18n220._x)("Instagram", "social link block variation name"), 56550 icon: InstagramIcon 56551 }, 56552 { 56553 name: "lastfm", 56554 attributes: { service: "lastfm" }, 56555 title: (0, import_i18n220._x)("Last.fm", "social link block variation name"), 56556 icon: LastfmIcon 56557 }, 56558 { 56559 name: "linkedin", 56560 attributes: { service: "linkedin" }, 56561 title: (0, import_i18n220._x)("LinkedIn", "social link block variation name"), 56562 icon: LinkedInIcon 56563 }, 56564 { 56565 name: "mail", 56566 attributes: { service: "mail" }, 56567 title: (0, import_i18n220._x)("Mail", "social link block variation name"), 56568 keywords: ["email", "e-mail"], 56569 icon: MailIcon 56570 }, 56571 { 56572 name: "mastodon", 56573 attributes: { service: "mastodon" }, 56574 title: (0, import_i18n220._x)("Mastodon", "social link block variation name"), 56575 icon: MastodonIcon 56576 }, 56577 { 56578 name: "meetup", 56579 attributes: { service: "meetup" }, 56580 title: (0, import_i18n220._x)("Meetup", "social link block variation name"), 56581 icon: MeetupIcon 56582 }, 56583 { 56584 name: "medium", 56585 attributes: { service: "medium" }, 56586 title: (0, import_i18n220._x)("Medium", "social link block variation name"), 56587 icon: MediumIcon 56588 }, 56589 { 56590 name: "patreon", 56591 attributes: { service: "patreon" }, 56592 title: (0, import_i18n220._x)("Patreon", "social link block variation name"), 56593 icon: PatreonIcon 56594 }, 56595 { 56596 name: "pinterest", 56597 attributes: { service: "pinterest" }, 56598 title: (0, import_i18n220._x)("Pinterest", "social link block variation name"), 56599 icon: PinterestIcon 56600 }, 56601 { 56602 name: "pocket", 56603 attributes: { service: "pocket" }, 56604 title: (0, import_i18n220._x)("Pocket", "social link block variation name"), 56605 icon: PocketIcon 56606 }, 56607 { 56608 name: "reddit", 56609 attributes: { service: "reddit" }, 56610 title: (0, import_i18n220._x)("Reddit", "social link block variation name"), 56611 icon: RedditIcon 56612 }, 56613 { 56614 name: "skype", 56615 attributes: { service: "skype" }, 56616 title: (0, import_i18n220._x)("Skype", "social link block variation name"), 56617 icon: SkypeIcon, 56618 // Deprecated: Skype service is no longer available. 56619 scope: [] 56620 }, 56621 { 56622 name: "snapchat", 56623 attributes: { service: "snapchat" }, 56624 title: (0, import_i18n220._x)("Snapchat", "social link block variation name"), 56625 icon: SnapchatIcon 56626 }, 56627 { 56628 name: "soundcloud", 56629 attributes: { service: "soundcloud" }, 56630 title: (0, import_i18n220._x)("SoundCloud", "social link block variation name"), 56631 icon: SoundCloudIcon 56632 }, 56633 { 56634 name: "spotify", 56635 attributes: { service: "spotify" }, 56636 title: (0, import_i18n220._x)("Spotify", "social link block variation name"), 56637 icon: SpotifyIcon 56638 }, 56639 { 56640 name: "telegram", 56641 attributes: { service: "telegram" }, 56642 title: (0, import_i18n220._x)("Telegram", "social link block variation name"), 56643 icon: TelegramIcon 56644 }, 56645 { 56646 name: "threads", 56647 attributes: { service: "threads" }, 56648 title: (0, import_i18n220._x)("Threads", "social link block variation name"), 56649 icon: ThreadsIcon 56650 }, 56651 { 56652 name: "tiktok", 56653 attributes: { service: "tiktok" }, 56654 title: (0, import_i18n220._x)("TikTok", "social link block variation name"), 56655 icon: TiktokIcon 56656 }, 56657 { 56658 name: "tumblr", 56659 attributes: { service: "tumblr" }, 56660 title: (0, import_i18n220._x)("Tumblr", "social link block variation name"), 56661 icon: TumblrIcon 56662 }, 56663 { 56664 name: "twitch", 56665 attributes: { service: "twitch" }, 56666 title: (0, import_i18n220._x)("Twitch", "social link block variation name"), 56667 icon: TwitchIcon 56668 }, 56669 { 56670 name: "twitter", 56671 attributes: { service: "twitter" }, 56672 title: (0, import_i18n220._x)("Twitter", "social link block variation name"), 56673 icon: TwitterIcon 56674 }, 56675 { 56676 name: "vimeo", 56677 attributes: { service: "vimeo" }, 56678 title: (0, import_i18n220._x)("Vimeo", "social link block variation name"), 56679 icon: VimeoIcon 56680 }, 56681 { 56682 name: "vk", 56683 attributes: { service: "vk" }, 56684 title: (0, import_i18n220._x)("VK", "social link block variation name"), 56685 icon: VkIcon 56686 }, 56687 { 56688 name: "whatsapp", 56689 attributes: { service: "whatsapp" }, 56690 title: (0, import_i18n220._x)("WhatsApp", "social link block variation name"), 56691 icon: WhatsAppIcon 56692 }, 56693 { 56694 name: "x", 56695 attributes: { service: "x" }, 56696 keywords: ["twitter"], 56697 title: (0, import_i18n220._x)("X", "social link block variation name"), 56698 icon: XIcon 56699 }, 56700 { 56701 name: "yelp", 56702 attributes: { service: "yelp" }, 56703 title: (0, import_i18n220._x)("Yelp", "social link block variation name"), 56704 icon: YelpIcon 56705 }, 56706 { 56707 name: "youtube", 56708 attributes: { service: "youtube" }, 56709 title: (0, import_i18n220._x)("YouTube", "social link block variation name"), 56710 icon: YouTubeIcon 56711 } 56712 ]; 56713 variations16.forEach((variation) => { 56714 if (variation.isActive) { 56715 return; 56716 } 56717 variation.isActive = (blockAttributes8, variationAttributes) => blockAttributes8.service === variationAttributes.service; 56718 }); 56719 var variations_default16 = variations16; 56720 56721 // packages/block-library/build-module/social-link/index.js 56722 var { fieldsKey: fieldsKey18, formKey: formKey18 } = unlock(import_blocks104.privateApis); 56723 var { name: name99 } = block_default98; 56724 var settings98 = { 56725 icon: share_default, 56726 edit: edit_default29, 56727 variations: variations_default16 56728 }; 56729 if (window.__experimentalContentOnlyInspectorFields) { 56730 settings98[fieldsKey18] = [ 56731 { 56732 id: "link", 56733 label: (0, import_i18n221.__)("Link"), 56734 type: "link", 56735 mapping: { 56736 href: "url", 56737 rel: "rel" 56738 } 56739 }, 56740 { 56741 id: "label", 56742 label: (0, import_i18n221.__)("Label"), 56743 type: "richtext" 56744 } 56745 ]; 56746 settings98[formKey18] = { 56747 fields: ["link"] 56748 }; 56749 } 56750 var init98 = () => initBlock({ name: name99, metadata: block_default98, settings: settings98 }); 56751 56752 // packages/block-library/build-module/social-links/index.js 56753 var social_links_exports = {}; 56754 __export(social_links_exports, { 56755 init: () => init99, 56756 metadata: () => block_default99, 56757 name: () => name100, 56758 settings: () => settings99 56759 }); 56760 56761 // packages/block-library/build-module/social-links/deprecated.js 56762 var import_block_editor230 = __toESM(require_block_editor()); 56763 var import_jsx_runtime459 = __toESM(require_jsx_runtime()); 56764 var migrateWithLayout3 = (attributes3) => { 56765 if (!!attributes3.layout) { 56766 return attributes3; 56767 } 56768 const { className } = attributes3; 56769 const prefix = `items-justified-`; 56770 const justifiedItemsRegex = new RegExp(`\\b$prefix}[^ ]*[ ]?\\b`, "g"); 56771 const newAttributes = { 56772 ...attributes3, 56773 className: className?.replace(justifiedItemsRegex, "").trim() 56774 }; 56775 const justifyContent = className?.match(justifiedItemsRegex)?.[0]?.trim(); 56776 if (justifyContent) { 56777 Object.assign(newAttributes, { 56778 layout: { 56779 type: "flex", 56780 justifyContent: justifyContent.slice(prefix.length) 56781 } 56782 }); 56783 } 56784 return newAttributes; 56785 }; 56786 var deprecated17 = [ 56787 // V1. Remove CSS variable use for colors. 56788 { 56789 attributes: { 56790 iconColor: { 56791 type: "string" 56792 }, 56793 customIconColor: { 56794 type: "string" 56795 }, 56796 iconColorValue: { 56797 type: "string" 56798 }, 56799 iconBackgroundColor: { 56800 type: "string" 56801 }, 56802 customIconBackgroundColor: { 56803 type: "string" 56804 }, 56805 iconBackgroundColorValue: { 56806 type: "string" 56807 }, 56808 openInNewTab: { 56809 type: "boolean", 56810 default: false 56811 }, 56812 size: { 56813 type: "string" 56814 } 56815 }, 56816 providesContext: { 56817 openInNewTab: "openInNewTab" 56818 }, 56819 supports: { 56820 align: ["left", "center", "right"], 56821 anchor: true 56822 }, 56823 migrate: migrateWithLayout3, 56824 save: (props) => { 56825 const { 56826 attributes: { 56827 iconBackgroundColorValue, 56828 iconColorValue, 56829 itemsJustification, 56830 size 56831 } 56832 } = props; 56833 const className = clsx_default(size, { 56834 "has-icon-color": iconColorValue, 56835 "has-icon-background-color": iconBackgroundColorValue, 56836 [`items-justified-$itemsJustification}`]: itemsJustification 56837 }); 56838 const style2 = { 56839 "--wp--social-links--icon-color": iconColorValue, 56840 "--wp--social-links--icon-background-color": iconBackgroundColorValue 56841 }; 56842 return /* @__PURE__ */ (0, import_jsx_runtime459.jsx)("ul", { ...import_block_editor230.useBlockProps.save({ className, style: style2 }), children: /* @__PURE__ */ (0, import_jsx_runtime459.jsx)(import_block_editor230.InnerBlocks.Content, {}) }); 56843 } 56844 } 56845 ]; 56846 var deprecated_default38 = deprecated17; 56847 56848 // packages/block-library/build-module/social-links/edit.js 56849 var import_element114 = __toESM(require_element()); 56850 var import_block_editor231 = __toESM(require_block_editor()); 56851 var import_components142 = __toESM(require_components()); 56852 var import_i18n222 = __toESM(require_i18n()); 56853 var import_data123 = __toESM(require_data()); 56854 var import_jsx_runtime460 = __toESM(require_jsx_runtime()); 56855 var sizeOptions = [ 56856 { label: (0, import_i18n222.__)("Default"), value: "" }, 56857 { label: (0, import_i18n222.__)("Small"), value: "has-small-icon-size" }, 56858 { label: (0, import_i18n222.__)("Normal"), value: "has-normal-icon-size" }, 56859 { label: (0, import_i18n222.__)("Large"), value: "has-large-icon-size" }, 56860 { label: (0, import_i18n222.__)("Huge"), value: "has-huge-icon-size" } 56861 ]; 56862 function SocialLinksEdit(props) { 56863 const { 56864 clientId, 56865 attributes: attributes3, 56866 iconBackgroundColor, 56867 iconColor, 56868 isSelected, 56869 setAttributes, 56870 setIconBackgroundColor, 56871 setIconColor 56872 } = props; 56873 const { 56874 iconBackgroundColorValue, 56875 iconColorValue, 56876 openInNewTab, 56877 showLabels, 56878 size 56879 } = attributes3; 56880 const { hasSocialIcons, hasSelectedChild } = (0, import_data123.useSelect)( 56881 (select9) => { 56882 const { getBlockCount, hasSelectedInnerBlock } = select9(import_block_editor231.store); 56883 return { 56884 hasSocialIcons: getBlockCount(clientId) > 0, 56885 hasSelectedChild: hasSelectedInnerBlock(clientId) 56886 }; 56887 }, 56888 [clientId] 56889 ); 56890 const hasAnySelected = isSelected || hasSelectedChild; 56891 const logosOnly = attributes3.className?.includes("is-style-logos-only"); 56892 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 56893 (0, import_element114.useEffect)(() => { 56894 if (logosOnly) { 56895 let restore; 56896 setAttributes((prev) => { 56897 restore = { 56898 iconBackgroundColor: prev.iconBackgroundColor, 56899 iconBackgroundColorValue: prev.iconBackgroundColorValue, 56900 customIconBackgroundColor: prev.customIconBackgroundColor 56901 }; 56902 return { 56903 iconBackgroundColor: void 0, 56904 iconBackgroundColorValue: void 0, 56905 customIconBackgroundColor: void 0 56906 }; 56907 }); 56908 return () => setAttributes({ ...restore }); 56909 } 56910 }, [logosOnly, setAttributes]); 56911 const className = clsx_default(size, { 56912 "has-visible-labels": showLabels, 56913 "has-icon-color": iconColor.color || iconColorValue, 56914 "has-icon-background-color": iconBackgroundColor.color || iconBackgroundColorValue 56915 }); 56916 const blockProps = (0, import_block_editor231.useBlockProps)({ className }); 56917 const innerBlocksProps = (0, import_block_editor231.useInnerBlocksProps)(blockProps, { 56918 templateLock: false, 56919 orientation: attributes3.layout?.orientation ?? "horizontal", 56920 __experimentalAppenderTagName: "li", 56921 renderAppender: !hasSocialIcons || hasAnySelected ? import_block_editor231.InnerBlocks.ButtonBlockAppender : void 0 56922 }); 56923 const colorSettings = [ 56924 { 56925 // Use custom attribute as fallback to prevent loss of named color selection when 56926 // switching themes to a new theme that does not have a matching named color. 56927 value: iconColor.color || iconColorValue, 56928 onChange: (colorValue) => { 56929 setIconColor(colorValue); 56930 setAttributes({ iconColorValue: colorValue }); 56931 }, 56932 label: (0, import_i18n222.__)("Icon color"), 56933 resetAllFilter: () => { 56934 setIconColor(void 0); 56935 setAttributes({ iconColorValue: void 0 }); 56936 } 56937 } 56938 ]; 56939 if (!logosOnly) { 56940 colorSettings.push({ 56941 // Use custom attribute as fallback to prevent loss of named color selection when 56942 // switching themes to a new theme that does not have a matching named color. 56943 value: iconBackgroundColor.color || iconBackgroundColorValue, 56944 onChange: (colorValue) => { 56945 setIconBackgroundColor(colorValue); 56946 setAttributes({ 56947 iconBackgroundColorValue: colorValue 56948 }); 56949 }, 56950 label: (0, import_i18n222.__)("Icon background"), 56951 resetAllFilter: () => { 56952 setIconBackgroundColor(void 0); 56953 setAttributes({ iconBackgroundColorValue: void 0 }); 56954 } 56955 }); 56956 } 56957 const colorGradientSettings = (0, import_block_editor231.__experimentalUseMultipleOriginColorsAndGradients)(); 56958 return /* @__PURE__ */ (0, import_jsx_runtime460.jsxs)(import_jsx_runtime460.Fragment, { children: [ 56959 /* @__PURE__ */ (0, import_jsx_runtime460.jsx)(import_block_editor231.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime460.jsxs)( 56960 import_components142.__experimentalToolsPanel, 56961 { 56962 label: (0, import_i18n222.__)("Settings"), 56963 resetAll: () => { 56964 setAttributes({ 56965 openInNewTab: false, 56966 showLabels: false, 56967 size: void 0 56968 }); 56969 }, 56970 dropdownMenuProps, 56971 children: [ 56972 /* @__PURE__ */ (0, import_jsx_runtime460.jsx)( 56973 import_components142.__experimentalToolsPanelItem, 56974 { 56975 isShownByDefault: true, 56976 hasValue: () => !!size, 56977 label: (0, import_i18n222.__)("Icon size"), 56978 onDeselect: () => setAttributes({ size: void 0 }), 56979 children: /* @__PURE__ */ (0, import_jsx_runtime460.jsx)( 56980 import_components142.SelectControl, 56981 { 56982 __next40pxDefaultSize: true, 56983 label: (0, import_i18n222.__)("Icon size"), 56984 onChange: (newSize) => { 56985 setAttributes({ 56986 size: newSize === "" ? void 0 : newSize 56987 }); 56988 }, 56989 value: size ?? "", 56990 options: sizeOptions 56991 } 56992 ) 56993 } 56994 ), 56995 /* @__PURE__ */ (0, import_jsx_runtime460.jsx)( 56996 import_components142.__experimentalToolsPanelItem, 56997 { 56998 isShownByDefault: true, 56999 label: (0, import_i18n222.__)("Show text"), 57000 hasValue: () => !!showLabels, 57001 onDeselect: () => setAttributes({ showLabels: false }), 57002 children: /* @__PURE__ */ (0, import_jsx_runtime460.jsx)( 57003 import_components142.ToggleControl, 57004 { 57005 label: (0, import_i18n222.__)("Show text"), 57006 checked: showLabels, 57007 onChange: () => setAttributes({ showLabels: !showLabels }) 57008 } 57009 ) 57010 } 57011 ), 57012 /* @__PURE__ */ (0, import_jsx_runtime460.jsx)( 57013 import_components142.__experimentalToolsPanelItem, 57014 { 57015 isShownByDefault: true, 57016 label: (0, import_i18n222.__)("Open links in new tab"), 57017 hasValue: () => !!openInNewTab, 57018 onDeselect: () => setAttributes({ openInNewTab: false }), 57019 children: /* @__PURE__ */ (0, import_jsx_runtime460.jsx)( 57020 import_components142.ToggleControl, 57021 { 57022 label: (0, import_i18n222.__)("Open links in new tab"), 57023 checked: openInNewTab, 57024 onChange: () => setAttributes({ 57025 openInNewTab: !openInNewTab 57026 }) 57027 } 57028 ) 57029 } 57030 ) 57031 ] 57032 } 57033 ) }), 57034 colorGradientSettings.hasColorsOrGradients && /* @__PURE__ */ (0, import_jsx_runtime460.jsxs)(import_block_editor231.InspectorControls, { group: "color", children: [ 57035 colorSettings.map( 57036 ({ onChange, label, value, resetAllFilter }) => /* @__PURE__ */ (0, import_jsx_runtime460.jsx)( 57037 import_block_editor231.__experimentalColorGradientSettingsDropdown, 57038 { 57039 __experimentalIsRenderedInSidebar: true, 57040 settings: [ 57041 { 57042 colorValue: value, 57043 label, 57044 onColorChange: onChange, 57045 isShownByDefault: true, 57046 resetAllFilter, 57047 enableAlpha: true, 57048 clearable: true 57049 } 57050 ], 57051 panelId: clientId, 57052 ...colorGradientSettings 57053 }, 57054 `social-links-color-$label}` 57055 ) 57056 ), 57057 !logosOnly && /* @__PURE__ */ (0, import_jsx_runtime460.jsx)( 57058 import_block_editor231.ContrastChecker, 57059 { 57060 ...{ 57061 textColor: iconColorValue, 57062 backgroundColor: iconBackgroundColorValue 57063 }, 57064 isLargeText: false 57065 } 57066 ) 57067 ] }), 57068 /* @__PURE__ */ (0, import_jsx_runtime460.jsx)("ul", { ...innerBlocksProps }) 57069 ] }); 57070 } 57071 var iconColorAttributes = { 57072 iconColor: "icon-color", 57073 iconBackgroundColor: "icon-background-color" 57074 }; 57075 var edit_default30 = (0, import_block_editor231.withColors)(iconColorAttributes)(SocialLinksEdit); 57076 57077 // packages/block-library/build-module/social-links/block.json 57078 var block_default99 = { 57079 $schema: "https://schemas.wp.org/trunk/block.json", 57080 apiVersion: 3, 57081 name: "core/social-links", 57082 title: "Social Icons", 57083 category: "widgets", 57084 allowedBlocks: ["core/social-link"], 57085 description: "Display icons linking to your social profiles or sites.", 57086 keywords: ["links"], 57087 textdomain: "default", 57088 attributes: { 57089 iconColor: { 57090 type: "string" 57091 }, 57092 customIconColor: { 57093 type: "string" 57094 }, 57095 iconColorValue: { 57096 type: "string" 57097 }, 57098 iconBackgroundColor: { 57099 type: "string" 57100 }, 57101 customIconBackgroundColor: { 57102 type: "string" 57103 }, 57104 iconBackgroundColorValue: { 57105 type: "string" 57106 }, 57107 openInNewTab: { 57108 type: "boolean", 57109 default: false 57110 }, 57111 showLabels: { 57112 type: "boolean", 57113 default: false 57114 }, 57115 size: { 57116 type: "string" 57117 } 57118 }, 57119 providesContext: { 57120 openInNewTab: "openInNewTab", 57121 showLabels: "showLabels", 57122 iconColor: "iconColor", 57123 iconColorValue: "iconColorValue", 57124 iconBackgroundColor: "iconBackgroundColor", 57125 iconBackgroundColorValue: "iconBackgroundColorValue" 57126 }, 57127 supports: { 57128 align: ["left", "center", "right"], 57129 anchor: true, 57130 html: false, 57131 __experimentalExposeControlsToChildren: true, 57132 layout: { 57133 allowSwitching: false, 57134 allowInheriting: false, 57135 allowVerticalAlignment: false, 57136 default: { 57137 type: "flex" 57138 } 57139 }, 57140 color: { 57141 enableContrastChecker: false, 57142 background: true, 57143 gradients: true, 57144 text: false, 57145 __experimentalDefaultControls: { 57146 background: false 57147 } 57148 }, 57149 spacing: { 57150 blockGap: ["horizontal", "vertical"], 57151 margin: true, 57152 padding: true, 57153 units: ["px", "em", "rem", "vh", "vw"], 57154 __experimentalDefaultControls: { 57155 blockGap: true, 57156 margin: true, 57157 padding: false 57158 } 57159 }, 57160 interactivity: { 57161 clientNavigation: true 57162 }, 57163 __experimentalBorder: { 57164 radius: true, 57165 color: true, 57166 width: true, 57167 style: true, 57168 __experimentalDefaultControls: { 57169 radius: true, 57170 color: true, 57171 width: true, 57172 style: true 57173 } 57174 }, 57175 contentRole: true 57176 }, 57177 styles: [ 57178 { name: "default", label: "Default", isDefault: true }, 57179 { name: "logos-only", label: "Logos Only" }, 57180 { name: "pill-shape", label: "Pill Shape" } 57181 ], 57182 editorStyle: "wp-block-social-links-editor", 57183 style: "wp-block-social-links" 57184 }; 57185 57186 // packages/block-library/build-module/social-links/save.js 57187 var import_block_editor232 = __toESM(require_block_editor()); 57188 var import_jsx_runtime461 = __toESM(require_jsx_runtime()); 57189 function save46(props) { 57190 const { 57191 attributes: { 57192 iconBackgroundColorValue, 57193 iconColorValue, 57194 showLabels, 57195 size 57196 } 57197 } = props; 57198 const className = clsx_default(size, { 57199 "has-visible-labels": showLabels, 57200 "has-icon-color": iconColorValue, 57201 "has-icon-background-color": iconBackgroundColorValue 57202 }); 57203 const blockProps = import_block_editor232.useBlockProps.save({ className }); 57204 const innerBlocksProps = import_block_editor232.useInnerBlocksProps.save(blockProps); 57205 return /* @__PURE__ */ (0, import_jsx_runtime461.jsx)("ul", { ...innerBlocksProps }); 57206 } 57207 57208 // packages/block-library/build-module/social-links/index.js 57209 var { name: name100 } = block_default99; 57210 var settings99 = { 57211 example: { 57212 innerBlocks: [ 57213 { 57214 name: "core/social-link", 57215 attributes: { 57216 service: "wordpress", 57217 url: "https://wordpress.org" 57218 } 57219 }, 57220 { 57221 name: "core/social-link", 57222 attributes: { 57223 service: "facebook", 57224 url: "https://www.facebook.com/WordPress/" 57225 } 57226 }, 57227 { 57228 name: "core/social-link", 57229 attributes: { 57230 service: "twitter", 57231 url: "https://twitter.com/WordPress" 57232 } 57233 } 57234 ] 57235 }, 57236 icon: share_default, 57237 edit: edit_default30, 57238 save: save46, 57239 deprecated: deprecated_default38 57240 }; 57241 var init99 = () => initBlock({ name: name100, metadata: block_default99, settings: settings99 }); 57242 57243 // packages/block-library/build-module/spacer/index.js 57244 var spacer_exports = {}; 57245 __export(spacer_exports, { 57246 init: () => init100, 57247 metadata: () => block_default100, 57248 name: () => name101, 57249 settings: () => settings100 57250 }); 57251 57252 // packages/block-library/build-module/spacer/deprecated.js 57253 var import_block_editor233 = __toESM(require_block_editor()); 57254 var import_jsx_runtime462 = __toESM(require_jsx_runtime()); 57255 var deprecated18 = [ 57256 { 57257 attributes: { 57258 height: { 57259 type: "number", 57260 default: 100 57261 }, 57262 width: { 57263 type: "number" 57264 } 57265 }, 57266 migrate(attributes3) { 57267 const { height, width } = attributes3; 57268 return { 57269 ...attributes3, 57270 width: width !== void 0 ? `$width}px` : void 0, 57271 height: height !== void 0 ? `$height}px` : void 0 57272 }; 57273 }, 57274 save({ attributes: attributes3 }) { 57275 return /* @__PURE__ */ (0, import_jsx_runtime462.jsx)( 57276 "div", 57277 { 57278 ...import_block_editor233.useBlockProps.save({ 57279 style: { 57280 height: attributes3.height, 57281 width: attributes3.width 57282 }, 57283 "aria-hidden": true 57284 }) 57285 } 57286 ); 57287 } 57288 } 57289 ]; 57290 var deprecated_default39 = deprecated18; 57291 57292 // packages/block-library/build-module/spacer/edit.js 57293 var import_block_editor235 = __toESM(require_block_editor()); 57294 var import_components144 = __toESM(require_components()); 57295 var import_element115 = __toESM(require_element()); 57296 var import_primitives203 = __toESM(require_primitives()); 57297 var import_data124 = __toESM(require_data()); 57298 57299 // packages/block-library/build-module/spacer/controls.js 57300 var import_i18n223 = __toESM(require_i18n()); 57301 var import_block_editor234 = __toESM(require_block_editor()); 57302 var import_components143 = __toESM(require_components()); 57303 var import_compose50 = __toESM(require_compose()); 57304 var import_primitives202 = __toESM(require_primitives()); 57305 57306 // packages/block-library/build-module/spacer/constants.js 57307 var MIN_SPACER_SIZE = 0; 57308 57309 // packages/block-library/build-module/spacer/controls.js 57310 var import_jsx_runtime463 = __toESM(require_jsx_runtime()); 57311 var { useSpacingSizes } = unlock(import_block_editor234.privateApis); 57312 function DimensionInput({ label, onChange, isResizing, value = "" }) { 57313 const inputId = (0, import_compose50.useInstanceId)(import_components143.__experimentalUnitControl, "block-spacer-height-input"); 57314 const spacingSizes = useSpacingSizes(); 57315 const [spacingUnits] = (0, import_block_editor234.useSettings)("spacing.units"); 57316 const availableUnits = spacingUnits ? spacingUnits.filter((unit) => unit !== "%") : ["px", "em", "rem", "vw", "vh"]; 57317 const units = (0, import_components143.__experimentalUseCustomUnits)({ 57318 availableUnits, 57319 defaultValues: { px: 100, em: 10, rem: 10, vw: 10, vh: 25 } 57320 }); 57321 const [parsedQuantity, parsedUnit] = (0, import_components143.__experimentalParseQuantityAndUnitFromRawValue)(value); 57322 const computedValue = (0, import_block_editor234.isValueSpacingPreset)(value) ? value : [parsedQuantity, isResizing ? "px" : parsedUnit].join(""); 57323 return /* @__PURE__ */ (0, import_jsx_runtime463.jsx)(import_jsx_runtime463.Fragment, { children: spacingSizes?.length < 2 ? /* @__PURE__ */ (0, import_jsx_runtime463.jsx)( 57324 import_components143.__experimentalUnitControl, 57325 { 57326 id: inputId, 57327 isResetValueOnUnitChange: true, 57328 min: MIN_SPACER_SIZE, 57329 onChange, 57330 value: computedValue, 57331 units, 57332 label, 57333 __next40pxDefaultSize: true 57334 } 57335 ) : /* @__PURE__ */ (0, import_jsx_runtime463.jsx)(import_primitives202.View, { className: "tools-panel-item-spacing", children: /* @__PURE__ */ (0, import_jsx_runtime463.jsx)( 57336 import_block_editor234.__experimentalSpacingSizesControl, 57337 { 57338 values: { all: computedValue }, 57339 onChange: ({ all }) => { 57340 onChange(all); 57341 }, 57342 label, 57343 sides: ["all"], 57344 units, 57345 allowReset: false, 57346 splitOnAxis: false, 57347 showSideInLabel: false 57348 } 57349 ) }) }); 57350 } 57351 function SpacerControls({ 57352 setAttributes, 57353 orientation, 57354 height, 57355 width, 57356 isResizing 57357 }) { 57358 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 57359 return /* @__PURE__ */ (0, import_jsx_runtime463.jsx)(import_block_editor234.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime463.jsxs)( 57360 import_components143.__experimentalToolsPanel, 57361 { 57362 label: (0, import_i18n223.__)("Settings"), 57363 resetAll: () => { 57364 setAttributes({ 57365 width: void 0, 57366 height: "100px" 57367 }); 57368 }, 57369 dropdownMenuProps, 57370 children: [ 57371 orientation === "horizontal" && /* @__PURE__ */ (0, import_jsx_runtime463.jsx)( 57372 import_components143.__experimentalToolsPanelItem, 57373 { 57374 label: (0, import_i18n223.__)("Width"), 57375 isShownByDefault: true, 57376 hasValue: () => width !== void 0, 57377 onDeselect: () => setAttributes({ width: void 0 }), 57378 children: /* @__PURE__ */ (0, import_jsx_runtime463.jsx)( 57379 DimensionInput, 57380 { 57381 label: (0, import_i18n223.__)("Width"), 57382 value: width, 57383 onChange: (nextWidth) => setAttributes({ width: nextWidth }), 57384 isResizing 57385 } 57386 ) 57387 } 57388 ), 57389 orientation !== "horizontal" && /* @__PURE__ */ (0, import_jsx_runtime463.jsx)( 57390 import_components143.__experimentalToolsPanelItem, 57391 { 57392 label: (0, import_i18n223.__)("Height"), 57393 isShownByDefault: true, 57394 hasValue: () => height !== "100px", 57395 onDeselect: () => setAttributes({ height: "100px" }), 57396 children: /* @__PURE__ */ (0, import_jsx_runtime463.jsx)( 57397 DimensionInput, 57398 { 57399 label: (0, import_i18n223.__)("Height"), 57400 value: height, 57401 onChange: (nextHeight) => setAttributes({ height: nextHeight }), 57402 isResizing 57403 } 57404 ) 57405 } 57406 ) 57407 ] 57408 } 57409 ) }); 57410 } 57411 57412 // packages/block-library/build-module/spacer/edit.js 57413 var import_jsx_runtime464 = __toESM(require_jsx_runtime()); 57414 var { useSpacingSizes: useSpacingSizes2 } = unlock(import_block_editor235.privateApis); 57415 var ResizableSpacer = ({ 57416 orientation, 57417 onResizeStart, 57418 onResize, 57419 onResizeStop, 57420 isSelected, 57421 isResizing, 57422 setIsResizing, 57423 ...props 57424 }) => { 57425 const getCurrentSize = (elt) => { 57426 return orientation === "horizontal" ? elt.clientWidth : elt.clientHeight; 57427 }; 57428 const getNextVal = (elt) => { 57429 return `$getCurrentSize(elt)}px`; 57430 }; 57431 return /* @__PURE__ */ (0, import_jsx_runtime464.jsx)( 57432 import_components144.ResizableBox, 57433 { 57434 className: clsx_default("block-library-spacer__resize-container", { 57435 "resize-horizontal": orientation === "horizontal", 57436 "is-resizing": isResizing, 57437 "is-selected": isSelected 57438 }), 57439 onResizeStart: (_event, _direction, elt) => { 57440 const nextVal = getNextVal(elt); 57441 onResizeStart(nextVal); 57442 onResize(nextVal); 57443 }, 57444 onResize: (_event, _direction, elt) => { 57445 onResize(getNextVal(elt)); 57446 if (!isResizing) { 57447 setIsResizing(true); 57448 } 57449 }, 57450 onResizeStop: (_event, _direction, elt) => { 57451 const nextVal = getCurrentSize(elt); 57452 onResizeStop(`$nextVal}px`); 57453 setIsResizing(false); 57454 }, 57455 __experimentalShowTooltip: true, 57456 __experimentalTooltipProps: { 57457 axis: orientation === "horizontal" ? "x" : "y", 57458 position: "corner", 57459 isVisible: isResizing 57460 }, 57461 showHandle: isSelected, 57462 ...props 57463 } 57464 ); 57465 }; 57466 var SpacerEdit = ({ 57467 attributes: attributes3, 57468 isSelected, 57469 setAttributes, 57470 toggleSelection, 57471 context, 57472 __unstableParentLayout: parentLayout, 57473 className 57474 }) => { 57475 const disableCustomSpacingSizes = (0, import_data124.useSelect)((select9) => { 57476 const editorSettings = select9(import_block_editor235.store).getSettings(); 57477 return editorSettings?.disableCustomSpacingSizes; 57478 }); 57479 const { orientation } = context; 57480 const { 57481 orientation: parentOrientation, 57482 type, 57483 default: { type: defaultType } = {} 57484 } = parentLayout || {}; 57485 const isFlexLayout = type === "flex" || !type && defaultType === "flex"; 57486 const inheritedOrientation = !parentOrientation && isFlexLayout ? "horizontal" : parentOrientation || orientation; 57487 const { height, width, style: blockStyle = {} } = attributes3; 57488 const { layout = {} } = blockStyle; 57489 const { selfStretch, flexSize } = layout; 57490 const spacingSizes = useSpacingSizes2(); 57491 const [isResizing, setIsResizing] = (0, import_element115.useState)(false); 57492 const [temporaryHeight, setTemporaryHeight] = (0, import_element115.useState)(null); 57493 const [temporaryWidth, setTemporaryWidth] = (0, import_element115.useState)(null); 57494 const onResizeStart = () => toggleSelection(false); 57495 const onResizeStop = () => toggleSelection(true); 57496 const { __unstableMarkNextChangeAsNotPersistent } = (0, import_data124.useDispatch)(import_block_editor235.store); 57497 const handleOnVerticalResizeStop = (newHeight) => { 57498 onResizeStop(); 57499 if (isFlexLayout) { 57500 setAttributes({ 57501 style: { 57502 ...blockStyle, 57503 layout: { 57504 ...layout, 57505 flexSize: newHeight, 57506 selfStretch: "fixed" 57507 } 57508 } 57509 }); 57510 } 57511 setAttributes({ height: newHeight }); 57512 setTemporaryHeight(null); 57513 }; 57514 const handleOnHorizontalResizeStop = (newWidth) => { 57515 onResizeStop(); 57516 if (isFlexLayout) { 57517 setAttributes({ 57518 style: { 57519 ...blockStyle, 57520 layout: { 57521 ...layout, 57522 flexSize: newWidth, 57523 selfStretch: "fixed" 57524 } 57525 } 57526 }); 57527 } 57528 setAttributes({ width: newWidth }); 57529 setTemporaryWidth(null); 57530 }; 57531 const getHeightForVerticalBlocks = () => { 57532 if (isFlexLayout) { 57533 return void 0; 57534 } 57535 return temporaryHeight || (0, import_block_editor235.getSpacingPresetCssVar)(height) || void 0; 57536 }; 57537 const getWidthForHorizontalBlocks = () => { 57538 if (isFlexLayout) { 57539 return void 0; 57540 } 57541 return temporaryWidth || (0, import_block_editor235.getSpacingPresetCssVar)(width) || void 0; 57542 }; 57543 const sizeConditionalOnOrientation = inheritedOrientation === "horizontal" ? temporaryWidth || flexSize : temporaryHeight || flexSize; 57544 const style2 = { 57545 height: inheritedOrientation === "horizontal" ? 24 : getHeightForVerticalBlocks(), 57546 width: inheritedOrientation === "horizontal" ? getWidthForHorizontalBlocks() : void 0, 57547 // In vertical flex containers, the spacer shrinks to nothing without a minimum width. 57548 minWidth: inheritedOrientation === "vertical" && isFlexLayout ? 48 : void 0, 57549 // Add flex-basis so temporary sizes are respected. 57550 flexBasis: isFlexLayout ? sizeConditionalOnOrientation : void 0, 57551 // Remove flex-grow when resizing. 57552 flexGrow: isFlexLayout && isResizing ? 0 : void 0 57553 }; 57554 const resizableBoxWithOrientation = (blockOrientation) => { 57555 if (blockOrientation === "horizontal") { 57556 return /* @__PURE__ */ (0, import_jsx_runtime464.jsx)( 57557 ResizableSpacer, 57558 { 57559 minWidth: MIN_SPACER_SIZE, 57560 enable: { 57561 top: false, 57562 right: true, 57563 bottom: false, 57564 left: false, 57565 topRight: false, 57566 bottomRight: false, 57567 bottomLeft: false, 57568 topLeft: false 57569 }, 57570 orientation: blockOrientation, 57571 onResizeStart, 57572 onResize: setTemporaryWidth, 57573 onResizeStop: handleOnHorizontalResizeStop, 57574 isSelected, 57575 isResizing, 57576 setIsResizing 57577 } 57578 ); 57579 } 57580 return /* @__PURE__ */ (0, import_jsx_runtime464.jsx)(import_jsx_runtime464.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime464.jsx)( 57581 ResizableSpacer, 57582 { 57583 minHeight: MIN_SPACER_SIZE, 57584 enable: { 57585 top: false, 57586 right: false, 57587 bottom: true, 57588 left: false, 57589 topRight: false, 57590 bottomRight: false, 57591 bottomLeft: false, 57592 topLeft: false 57593 }, 57594 orientation: blockOrientation, 57595 onResizeStart, 57596 onResize: setTemporaryHeight, 57597 onResizeStop: handleOnVerticalResizeStop, 57598 isSelected, 57599 isResizing, 57600 setIsResizing 57601 } 57602 ) }); 57603 }; 57604 (0, import_element115.useEffect)(() => { 57605 const setAttributesCovertly = (nextAttributes) => { 57606 __unstableMarkNextChangeAsNotPersistent(); 57607 setAttributes(nextAttributes); 57608 }; 57609 if (isFlexLayout && selfStretch !== "fill" && selfStretch !== "fit" && flexSize === void 0) { 57610 if (inheritedOrientation === "horizontal") { 57611 const newSize = (0, import_block_editor235.getCustomValueFromPreset)(width, spacingSizes) || (0, import_block_editor235.getCustomValueFromPreset)(height, spacingSizes) || "100px"; 57612 setAttributesCovertly({ 57613 width: "0px", 57614 style: { 57615 ...blockStyle, 57616 layout: { 57617 ...layout, 57618 flexSize: newSize, 57619 selfStretch: "fixed" 57620 } 57621 } 57622 }); 57623 } else { 57624 const newSize = (0, import_block_editor235.getCustomValueFromPreset)(height, spacingSizes) || (0, import_block_editor235.getCustomValueFromPreset)(width, spacingSizes) || "100px"; 57625 setAttributesCovertly({ 57626 height: "0px", 57627 style: { 57628 ...blockStyle, 57629 layout: { 57630 ...layout, 57631 flexSize: newSize, 57632 selfStretch: "fixed" 57633 } 57634 } 57635 }); 57636 } 57637 } else if (isFlexLayout && (selfStretch === "fill" || selfStretch === "fit")) { 57638 setAttributesCovertly( 57639 inheritedOrientation === "horizontal" ? { width: void 0 } : { height: void 0 } 57640 ); 57641 } else if (!isFlexLayout && (selfStretch || flexSize)) { 57642 setAttributesCovertly({ 57643 ...inheritedOrientation === "horizontal" ? { width: flexSize } : { height: flexSize }, 57644 style: { 57645 ...blockStyle, 57646 layout: { 57647 ...layout, 57648 flexSize: void 0, 57649 selfStretch: void 0 57650 } 57651 } 57652 }); 57653 } 57654 }, [ 57655 blockStyle, 57656 flexSize, 57657 height, 57658 inheritedOrientation, 57659 isFlexLayout, 57660 layout, 57661 selfStretch, 57662 setAttributes, 57663 spacingSizes, 57664 width, 57665 __unstableMarkNextChangeAsNotPersistent 57666 ]); 57667 const blockEditingMode = (0, import_block_editor235.useBlockEditingMode)(); 57668 return /* @__PURE__ */ (0, import_jsx_runtime464.jsxs)(import_jsx_runtime464.Fragment, { children: [ 57669 /* @__PURE__ */ (0, import_jsx_runtime464.jsx)( 57670 import_primitives203.View, 57671 { 57672 ...(0, import_block_editor235.useBlockProps)({ 57673 style: style2, 57674 className: clsx_default(className, { 57675 "custom-sizes-disabled": disableCustomSpacingSizes 57676 }) 57677 }), 57678 children: blockEditingMode === "default" && resizableBoxWithOrientation(inheritedOrientation) 57679 } 57680 ), 57681 !isFlexLayout && /* @__PURE__ */ (0, import_jsx_runtime464.jsx)( 57682 SpacerControls, 57683 { 57684 setAttributes, 57685 height: temporaryHeight || height, 57686 width: temporaryWidth || width, 57687 orientation: inheritedOrientation, 57688 isResizing 57689 } 57690 ) 57691 ] }); 57692 }; 57693 var edit_default31 = SpacerEdit; 57694 57695 // packages/block-library/build-module/spacer/block.json 57696 var block_default100 = { 57697 $schema: "https://schemas.wp.org/trunk/block.json", 57698 apiVersion: 3, 57699 name: "core/spacer", 57700 title: "Spacer", 57701 category: "design", 57702 description: "Add white space between blocks and customize its height.", 57703 textdomain: "default", 57704 attributes: { 57705 height: { 57706 type: "string", 57707 default: "100px" 57708 }, 57709 width: { 57710 type: "string" 57711 } 57712 }, 57713 usesContext: ["orientation"], 57714 supports: { 57715 anchor: true, 57716 spacing: { 57717 margin: ["top", "bottom"], 57718 __experimentalDefaultControls: { 57719 margin: true 57720 } 57721 }, 57722 interactivity: { 57723 clientNavigation: true 57724 } 57725 }, 57726 editorStyle: "wp-block-spacer-editor", 57727 style: "wp-block-spacer" 57728 }; 57729 57730 // packages/block-library/build-module/spacer/transforms.js 57731 var import_blocks105 = __toESM(require_blocks()); 57732 var transforms33 = { 57733 to: [ 57734 { 57735 type: "block", 57736 blocks: ["core/separator"], 57737 // Transform to Separator. 57738 transform: ({ anchor }) => { 57739 return (0, import_blocks105.createBlock)("core/separator", { 57740 anchor: anchor || void 0 57741 }); 57742 } 57743 } 57744 ] 57745 }; 57746 var transforms_default34 = transforms33; 57747 57748 // packages/block-library/build-module/spacer/save.js 57749 var import_block_editor236 = __toESM(require_block_editor()); 57750 var import_jsx_runtime465 = __toESM(require_jsx_runtime()); 57751 function save47({ attributes: attributes3 }) { 57752 const { height, width, style: style2 } = attributes3; 57753 const { layout: { selfStretch } = {} } = style2 || {}; 57754 const finalHeight = selfStretch === "fill" || selfStretch === "fit" ? void 0 : height; 57755 return /* @__PURE__ */ (0, import_jsx_runtime465.jsx)( 57756 "div", 57757 { 57758 ...import_block_editor236.useBlockProps.save({ 57759 style: { 57760 height: (0, import_block_editor236.getSpacingPresetCssVar)(finalHeight), 57761 width: (0, import_block_editor236.getSpacingPresetCssVar)(width) 57762 }, 57763 "aria-hidden": true 57764 }) 57765 } 57766 ); 57767 } 57768 57769 // packages/block-library/build-module/spacer/index.js 57770 var { name: name101 } = block_default100; 57771 var settings100 = { 57772 icon: resize_corner_n_e_default, 57773 transforms: transforms_default34, 57774 edit: edit_default31, 57775 save: save47, 57776 deprecated: deprecated_default39 57777 }; 57778 var init100 = () => initBlock({ name: name101, metadata: block_default100, settings: settings100 }); 57779 57780 // packages/block-library/build-module/tab/index.js 57781 var tab_exports = {}; 57782 __export(tab_exports, { 57783 init: () => init101, 57784 metadata: () => block_default101, 57785 name: () => name102, 57786 settings: () => settings101 57787 }); 57788 57789 // packages/block-library/build-module/tab/edit.js 57790 var import_i18n227 = __toESM(require_i18n()); 57791 var import_block_editor240 = __toESM(require_block_editor()); 57792 var import_data127 = __toESM(require_data()); 57793 var import_element117 = __toESM(require_element()); 57794 57795 // packages/block-library/build-module/tab/controls.js 57796 var import_block_editor238 = __toESM(require_block_editor()); 57797 var import_components146 = __toESM(require_components()); 57798 var import_i18n225 = __toESM(require_i18n()); 57799 var import_data126 = __toESM(require_data()); 57800 var import_html_entities14 = __toESM(require_html_entities()); 57801 57802 // packages/block-library/build-module/tab/add-tab-toolbar-control.js 57803 var import_blocks106 = __toESM(require_blocks()); 57804 var import_block_editor237 = __toESM(require_block_editor()); 57805 var import_components145 = __toESM(require_components()); 57806 var import_i18n224 = __toESM(require_i18n()); 57807 var import_data125 = __toESM(require_data()); 57808 var import_jsx_runtime466 = __toESM(require_jsx_runtime()); 57809 function AddTabToolbarControl({ attributes: attributes3, tabsClientId }) { 57810 const { insertBlock } = (0, import_data125.useDispatch)(import_block_editor237.store); 57811 const { className, fontFamily, fontSize } = attributes3; 57812 const addTab = () => { 57813 const newTabBlock = (0, import_blocks106.createBlock)("core/tab", { 57814 className, 57815 fontFamily, 57816 fontSize 57817 }); 57818 insertBlock(newTabBlock, void 0, tabsClientId); 57819 }; 57820 return /* @__PURE__ */ (0, import_jsx_runtime466.jsx)(import_block_editor237.BlockControls, { group: "block", children: /* @__PURE__ */ (0, import_jsx_runtime466.jsx)(import_components145.ToolbarGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime466.jsx)( 57821 import_components145.ToolbarButton, 57822 { 57823 className: "components-toolbar__control", 57824 label: (0, import_i18n224.__)("Add Tab"), 57825 onClick: addTab, 57826 showTooltip: true, 57827 text: (0, import_i18n224.__)("Add Tab") 57828 } 57829 ) }) }); 57830 } 57831 57832 // packages/block-library/build-module/tab/slug-from-label.js 57833 var import_url18 = __toESM(require_url()); 57834 function slugFromLabel(label, tabIndex) { 57835 const htmlDocument = new window.DOMParser().parseFromString( 57836 label, 57837 "text/html" 57838 ); 57839 if (htmlDocument.body?.textContent) { 57840 return (0, import_url18.cleanForSlug)(htmlDocument.body.textContent); 57841 } 57842 return `tab-panel-$tabIndex}`; 57843 } 57844 57845 // packages/block-library/build-module/tab/controls.js 57846 var import_jsx_runtime467 = __toESM(require_jsx_runtime()); 57847 function Controls3({ 57848 attributes: attributes3, 57849 setAttributes, 57850 tabsClientId, 57851 blockIndex, 57852 isDefaultTab 57853 }) { 57854 const { label } = attributes3; 57855 const { updateBlockAttributes } = (0, import_data126.useDispatch)(import_block_editor238.store); 57856 return /* @__PURE__ */ (0, import_jsx_runtime467.jsxs)(import_jsx_runtime467.Fragment, { children: [ 57857 /* @__PURE__ */ (0, import_jsx_runtime467.jsx)( 57858 AddTabToolbarControl, 57859 { 57860 tabsClientId, 57861 attributes: attributes3 57862 } 57863 ), 57864 /* @__PURE__ */ (0, import_jsx_runtime467.jsx)(import_block_editor238.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime467.jsxs)(import_components146.PanelBody, { title: (0, import_i18n225.__)("Tab Settings"), children: [ 57865 /* @__PURE__ */ (0, import_jsx_runtime467.jsx)( 57866 import_components146.TextControl, 57867 { 57868 label: (0, import_i18n225.__)("Tab Label"), 57869 value: (0, import_html_entities14.decodeEntities)(label), 57870 onChange: (value) => { 57871 setAttributes({ 57872 label: value, 57873 anchor: slugFromLabel(value, blockIndex) 57874 }); 57875 }, 57876 __next40pxDefaultSize: true 57877 } 57878 ), 57879 /* @__PURE__ */ (0, import_jsx_runtime467.jsx)( 57880 import_components146.ToggleControl, 57881 { 57882 label: (0, import_i18n225.__)("Default Tab"), 57883 checked: isDefaultTab, 57884 onChange: (value) => { 57885 updateBlockAttributes(tabsClientId, { 57886 activeTabIndex: value ? blockIndex : 0 57887 }); 57888 }, 57889 help: (0, import_i18n225.__)( 57890 "If toggled, this tab will be selected when the page loads." 57891 ) 57892 } 57893 ) 57894 ] }) }) 57895 ] }); 57896 } 57897 57898 // packages/block-library/build-module/tab/tabs-list.js 57899 var import_i18n226 = __toESM(require_i18n()); 57900 var import_block_editor239 = __toESM(require_block_editor()); 57901 var import_html_entities15 = __toESM(require_html_entities()); 57902 var import_element116 = __toESM(require_element()); 57903 var import_jsx_runtime468 = __toESM(require_jsx_runtime()); 57904 function StaticLabel({ label, index }) { 57905 if (label) { 57906 return /* @__PURE__ */ (0, import_jsx_runtime468.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime468.jsx)(import_element116.RawHTML, { children: (0, import_html_entities15.decodeEntities)(label) }) }); 57907 } 57908 return /* @__PURE__ */ (0, import_jsx_runtime468.jsx)("span", { children: (0, import_i18n226.sprintf)( 57909 /* translators: %d is the tab index + 1 */ 57910 (0, import_i18n226.__)("Tab %d"), 57911 index + 1 57912 ) }); 57913 } 57914 function TabsList({ 57915 siblingTabs, 57916 currentClientId, 57917 currentBlockIndex, 57918 currentLabel, 57919 tabItemColorProps, 57920 onSelectTab, 57921 onLabelChange, 57922 labelRef, 57923 focusRef, 57924 labelElementRef 57925 }) { 57926 return /* @__PURE__ */ (0, import_jsx_runtime468.jsx)("div", { role: "tablist", className: "tabs__list", children: siblingTabs.map((tab, index) => { 57927 const isCurrentTab = tab.clientId === currentClientId; 57928 const isSiblingTabActive = index === currentBlockIndex; 57929 const tabAttributes = tab.attributes || {}; 57930 const siblingLabel = tabAttributes.label || ""; 57931 const siblingAnchor = tabAttributes.anchor || slugFromLabel(siblingLabel, index); 57932 const siblingTabPanelId = siblingAnchor; 57933 const siblingTabLabelId = `$siblingTabPanelId}--tab`; 57934 return /* @__PURE__ */ (0, import_jsx_runtime468.jsx)( 57935 "button", 57936 { 57937 "aria-controls": siblingTabPanelId, 57938 "aria-selected": isSiblingTabActive, 57939 id: siblingTabLabelId, 57940 role: "tab", 57941 className: clsx_default( 57942 "tabs__tab-label", 57943 tabItemColorProps.className 57944 ), 57945 style: { 57946 ...tabItemColorProps.style 57947 }, 57948 tabIndex: isSiblingTabActive ? 0 : -1, 57949 onClick: (event) => { 57950 event.preventDefault(); 57951 onSelectTab(tab.clientId); 57952 }, 57953 onKeyDown: (event) => { 57954 if (event.key === "Enter" && !event.shiftKey) { 57955 event.preventDefault(); 57956 onSelectTab(tab.clientId); 57957 if (isCurrentTab) { 57958 const { requestAnimationFrame: requestAnimationFrame2 } = window; 57959 focusRef.current = requestAnimationFrame2( 57960 () => { 57961 labelElementRef.current?.focus(); 57962 } 57963 ); 57964 } 57965 } 57966 }, 57967 children: isCurrentTab ? /* @__PURE__ */ (0, import_jsx_runtime468.jsx)( 57968 import_block_editor239.RichText, 57969 { 57970 ref: labelRef, 57971 tagName: "span", 57972 withoutInteractiveFormatting: true, 57973 placeholder: (0, import_i18n226.sprintf)( 57974 /* translators: %d is the tab index + 1 */ 57975 (0, import_i18n226.__)("Tab %d\u2026"), 57976 currentBlockIndex + 1 57977 ), 57978 value: (0, import_html_entities15.decodeEntities)(currentLabel), 57979 onChange: onLabelChange 57980 } 57981 ) : /* @__PURE__ */ (0, import_jsx_runtime468.jsx)( 57982 StaticLabel, 57983 { 57984 label: siblingLabel, 57985 index 57986 } 57987 ) 57988 }, 57989 tab.clientId 57990 ); 57991 }) }); 57992 } 57993 57994 // packages/block-library/build-module/tab/edit.js 57995 var import_jsx_runtime469 = __toESM(require_jsx_runtime()); 57996 var TEMPLATE16 = [ 57997 [ 57998 "core/paragraph", 57999 { 58000 placeholder: (0, import_i18n227.__)("Type / to add a block to tab") 58001 } 58002 ] 58003 ]; 58004 var { requestAnimationFrame, cancelAnimationFrame } = window; 58005 function Edit18({ 58006 attributes: attributes3, 58007 clientId, 58008 isSelected, 58009 setAttributes, 58010 __unstableLayoutClassNames: layoutClassNames 58011 }) { 58012 const { selectBlock } = (0, import_data127.useDispatch)(import_block_editor240.store); 58013 const innerBlocksRef = (0, import_element117.useRef)(null); 58014 const focusRef = (0, import_element117.useRef)(); 58015 const [isInitialMount, setIsInitialMount] = (0, import_element117.useState)(true); 58016 const labelElementRef = (0, import_element117.useRef)(null); 58017 const { anchor, label } = attributes3; 58018 const labelRef = (0, import_element117.useCallback)( 58019 (node) => { 58020 labelElementRef.current = node; 58021 if (node && isInitialMount) { 58022 const animationId = requestAnimationFrame(() => { 58023 if (node) { 58024 node.focus(); 58025 } 58026 }); 58027 focusRef.current = animationId; 58028 setIsInitialMount(false); 58029 } 58030 }, 58031 [isInitialMount] 58032 ); 58033 (0, import_element117.useEffect)(() => { 58034 if (!label && !isInitialMount && labelElementRef.current) { 58035 const animationId = requestAnimationFrame(() => { 58036 if (labelElementRef.current) { 58037 labelElementRef.current.focus(); 58038 } 58039 }); 58040 focusRef.current = animationId; 58041 return () => cancelAnimationFrame(focusRef.current); 58042 } 58043 }, [label, isInitialMount]); 58044 (0, import_element117.useEffect)(() => { 58045 return () => { 58046 if (focusRef.current) { 58047 cancelAnimationFrame(focusRef.current); 58048 } 58049 }; 58050 }, []); 58051 const { 58052 blockIndex, 58053 hasInnerBlocksSelected, 58054 tabsHasSelectedBlock, 58055 tabsClientId, 58056 tabsAttributes, 58057 forceDisplay, 58058 isTabsClientSelected, 58059 isDefaultTab, 58060 siblingTabs 58061 } = (0, import_data127.useSelect)( 58062 (select9) => { 58063 const { 58064 getBlockRootClientId, 58065 getBlockIndex, 58066 isBlockSelected, 58067 hasSelectedInnerBlock, 58068 getBlockAttributes: getBlockAttributes4, 58069 getBlocks 58070 } = select9(import_block_editor240.store); 58071 const rootClientId = getBlockRootClientId(clientId); 58072 const hasTabSelected = hasSelectedInnerBlock(rootClientId, true); 58073 const rootAttributes = getBlockAttributes4(rootClientId); 58074 const { activeTabIndex } = rootAttributes; 58075 const _isTabsClientSelected = isBlockSelected(rootClientId); 58076 const _blockIndex = getBlockIndex(clientId); 58077 const _isDefaultTab = activeTabIndex === _blockIndex; 58078 const _hasInnerBlocksSelected = hasSelectedInnerBlock( 58079 clientId, 58080 true 58081 ); 58082 const _siblingTabs = getBlocks(rootClientId); 58083 return { 58084 blockIndex: _blockIndex, 58085 hasInnerBlocksSelected: _hasInnerBlocksSelected, 58086 tabsClientId: rootClientId, 58087 forceDisplay: _isDefaultTab && _isTabsClientSelected, 58088 tabsHasSelectedBlock: hasTabSelected, 58089 isTabsClientSelected: _isTabsClientSelected, 58090 isDefaultTab: _isDefaultTab, 58091 tabsAttributes: rootAttributes, 58092 siblingTabs: _siblingTabs 58093 }; 58094 }, 58095 [clientId] 58096 ); 58097 const isSelectedTab = (0, import_element117.useMemo)(() => { 58098 if (isSelected || hasInnerBlocksSelected || forceDisplay) { 58099 return true; 58100 } 58101 if (isDefaultTab && !isTabsClientSelected && !isSelected && !tabsHasSelectedBlock) { 58102 return true; 58103 } 58104 return false; 58105 }, [ 58106 isSelected, 58107 hasInnerBlocksSelected, 58108 forceDisplay, 58109 isDefaultTab, 58110 isTabsClientSelected, 58111 tabsHasSelectedBlock 58112 ]); 58113 const tabPanelId = (0, import_element117.useMemo)( 58114 () => anchor || slugFromLabel(label, blockIndex), 58115 [anchor, label, blockIndex] 58116 ); 58117 const tabLabelId = (0, import_element117.useMemo)(() => `$tabPanelId}--tab`, [tabPanelId]); 58118 const tabItemColorProps = (0, import_block_editor240.__experimentalUseColorProps)(tabsAttributes); 58119 const tabContentTypographyProps = (0, import_block_editor240.getTypographyClassesAndStyles)(attributes3); 58120 const blockProps = (0, import_block_editor240.useBlockProps)({ 58121 hidden: !isSelectedTab 58122 }); 58123 const innerBlocksProps = (0, import_block_editor240.useInnerBlocksProps)( 58124 { 58125 "aria-labelledby": tabLabelId, 58126 id: tabPanelId, 58127 role: "tabpanel", 58128 ref: innerBlocksRef, 58129 tabIndex: isSelectedTab ? 0 : -1, 58130 className: clsx_default( 58131 tabContentTypographyProps.className, 58132 "tabs__tab-editor-content", 58133 layoutClassNames 58134 ), 58135 style: { 58136 ...tabContentTypographyProps.style 58137 } 58138 }, 58139 { 58140 template: TEMPLATE16 58141 } 58142 ); 58143 return /* @__PURE__ */ (0, import_jsx_runtime469.jsx)(import_jsx_runtime469.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime469.jsxs)("div", { ...blockProps, children: [ 58144 /* @__PURE__ */ (0, import_jsx_runtime469.jsx)( 58145 Controls3, 58146 { 58147 attributes: attributes3, 58148 setAttributes, 58149 tabsClientId, 58150 blockIndex, 58151 isDefaultTab 58152 } 58153 ), 58154 isSelectedTab && /* @__PURE__ */ (0, import_jsx_runtime469.jsxs)(import_jsx_runtime469.Fragment, { children: [ 58155 /* @__PURE__ */ (0, import_jsx_runtime469.jsx)( 58156 TabsList, 58157 { 58158 siblingTabs, 58159 currentClientId: clientId, 58160 currentBlockIndex: blockIndex, 58161 currentLabel: label, 58162 tabItemColorProps, 58163 onSelectTab: selectBlock, 58164 onLabelChange: (value) => setAttributes({ 58165 label: value, 58166 anchor: slugFromLabel(value, blockIndex) 58167 }), 58168 labelRef, 58169 focusRef, 58170 labelElementRef 58171 } 58172 ), 58173 /* @__PURE__ */ (0, import_jsx_runtime469.jsx)("section", { ...innerBlocksProps }) 58174 ] }) 58175 ] }) }); 58176 } 58177 58178 // packages/block-library/build-module/tab/save.js 58179 var import_block_editor241 = __toESM(require_block_editor()); 58180 var import_jsx_runtime470 = __toESM(require_jsx_runtime()); 58181 function Save({ attributes: attributes3 }) { 58182 const { anchor } = attributes3; 58183 const tabPanelId = anchor; 58184 const blockProps = import_block_editor241.useBlockProps.save(); 58185 const innerBlocksProps = import_block_editor241.useInnerBlocksProps.save(blockProps); 58186 return /* @__PURE__ */ (0, import_jsx_runtime470.jsx)("section", { ...innerBlocksProps, id: tabPanelId }); 58187 } 58188 58189 // packages/block-library/build-module/tab/block.json 58190 var block_default101 = { 58191 $schema: "https://schemas.wp.org/trunk/block.json", 58192 __experimental: true, 58193 apiVersion: 3, 58194 name: "core/tab", 58195 title: "Tab", 58196 description: "Content for a tab in a tabbed interface.", 58197 version: "1.0.0", 58198 category: "design", 58199 textdomain: "default", 58200 attributes: { 58201 label: { 58202 type: "string", 58203 default: "" 58204 } 58205 }, 58206 parent: ["core/tabs"], 58207 supports: { 58208 anchor: true, 58209 html: false, 58210 reusable: false, 58211 layout: { 58212 allowSwitching: true, 58213 allowInheriting: false, 58214 allowVerticalAlignment: true, 58215 allowJustification: true, 58216 allowOrientation: true, 58217 allowSizingOnChildren: true 58218 }, 58219 spacing: { 58220 blockGap: true, 58221 padding: true, 58222 margin: false 58223 }, 58224 typography: { 58225 fontSize: true, 58226 __experimentalFontFamily: true, 58227 __experimentalDefaultControls: { 58228 fontSize: true, 58229 __experimentalFontFamily: true 58230 }, 58231 __experimentalSkipSerialization: true 58232 } 58233 }, 58234 providesContext: { 58235 "core/tab-label": "label" 58236 }, 58237 editorScript: "file:./index.js", 58238 style: "file:./style-index.css" 58239 }; 58240 58241 // packages/block-library/build-module/tab/icon.js 58242 var import_components147 = __toESM(require_components()); 58243 var import_jsx_runtime471 = __toESM(require_jsx_runtime()); 58244 var icon_default8 = /* @__PURE__ */ (0, import_jsx_runtime471.jsx)( 58245 import_components147.SVG, 58246 { 58247 width: "24", 58248 height: "24", 58249 viewBox: "0 0 24 24", 58250 xmlns: "http://www.w3.org/2000/svg", 58251 children: /* @__PURE__ */ (0, import_jsx_runtime471.jsx)( 58252 import_components147.Path, 58253 { 58254 fillRule: "evenodd", 58255 clipRule: "evenodd", 58256 d: "M5.5498 10.3501V6.3501H9.8498V10.3501H11.3498V6.1001C11.3498 5.40974 10.7902 4.8501 10.0998 4.8501H5.2998C4.60945 4.8501 4.0498 5.40974 4.0498 6.1001V10.3501H5.5498ZM20 12.6001H4V14.1001L20 14.1001V12.6001ZM14 17.1001H4V18.6001H14V17.1001Z" 58257 } 58258 ) 58259 } 58260 ); 58261 58262 // packages/block-library/build-module/tab/index.js 58263 var { name: name102 } = block_default101; 58264 var settings101 = { 58265 icon: icon_default8, 58266 edit: Edit18, 58267 save: Save 58268 }; 58269 var init101 = () => initBlock({ name: name102, metadata: block_default101, settings: settings101 }); 58270 58271 // packages/block-library/build-module/table/index.js 58272 var table_exports = {}; 58273 __export(table_exports, { 58274 init: () => init102, 58275 metadata: () => block_default102, 58276 name: () => name103, 58277 settings: () => settings102 58278 }); 58279 var import_i18n229 = __toESM(require_i18n()); 58280 58281 // packages/block-library/build-module/table/deprecated.js 58282 var import_block_editor242 = __toESM(require_block_editor()); 58283 var import_jsx_runtime472 = __toESM(require_jsx_runtime()); 58284 var oldColors = { 58285 "subtle-light-gray": "#f3f4f5", 58286 "subtle-pale-green": "#e9fbe5", 58287 "subtle-pale-blue": "#e7f5fe", 58288 "subtle-pale-pink": "#fcf0ef" 58289 }; 58290 var v4Query = { 58291 content: { 58292 type: "rich-text", 58293 source: "rich-text" 58294 }, 58295 tag: { 58296 type: "string", 58297 default: "td", 58298 source: "tag" 58299 }, 58300 scope: { 58301 type: "string", 58302 source: "attribute", 58303 attribute: "scope" 58304 }, 58305 align: { 58306 type: "string", 58307 source: "attribute", 58308 attribute: "data-align" 58309 }, 58310 colspan: { 58311 type: "string", 58312 source: "attribute", 58313 attribute: "colspan" 58314 }, 58315 rowspan: { 58316 type: "string", 58317 source: "attribute", 58318 attribute: "rowspan" 58319 } 58320 }; 58321 var v410 = { 58322 attributes: { 58323 hasFixedLayout: { 58324 type: "boolean", 58325 default: false 58326 }, 58327 caption: { 58328 type: "rich-text", 58329 source: "rich-text", 58330 selector: "figcaption" 58331 }, 58332 head: { 58333 type: "array", 58334 default: [], 58335 source: "query", 58336 selector: "thead tr", 58337 query: { 58338 cells: { 58339 type: "array", 58340 default: [], 58341 source: "query", 58342 selector: "td,th", 58343 query: v4Query 58344 } 58345 } 58346 }, 58347 body: { 58348 type: "array", 58349 default: [], 58350 source: "query", 58351 selector: "tbody tr", 58352 query: { 58353 cells: { 58354 type: "array", 58355 default: [], 58356 source: "query", 58357 selector: "td,th", 58358 query: v4Query 58359 } 58360 } 58361 }, 58362 foot: { 58363 type: "array", 58364 default: [], 58365 source: "query", 58366 selector: "tfoot tr", 58367 query: { 58368 cells: { 58369 type: "array", 58370 default: [], 58371 source: "query", 58372 selector: "td,th", 58373 query: v4Query 58374 } 58375 } 58376 } 58377 }, 58378 supports: { 58379 anchor: true, 58380 align: true, 58381 color: { 58382 __experimentalSkipSerialization: true, 58383 gradients: true, 58384 __experimentalDefaultControls: { 58385 background: true, 58386 text: true 58387 } 58388 }, 58389 spacing: { 58390 margin: true, 58391 padding: true, 58392 __experimentalDefaultControls: { 58393 margin: false, 58394 padding: false 58395 } 58396 }, 58397 typography: { 58398 fontSize: true, 58399 lineHeight: true, 58400 __experimentalFontFamily: true, 58401 __experimentalFontStyle: true, 58402 __experimentalFontWeight: true, 58403 __experimentalLetterSpacing: true, 58404 __experimentalTextTransform: true, 58405 __experimentalTextDecoration: true, 58406 __experimentalDefaultControls: { 58407 fontSize: true 58408 } 58409 }, 58410 __experimentalBorder: { 58411 __experimentalSkipSerialization: true, 58412 color: true, 58413 style: true, 58414 width: true, 58415 __experimentalDefaultControls: { 58416 color: true, 58417 style: true, 58418 width: true 58419 } 58420 }, 58421 __experimentalSelector: ".wp-block-table > table", 58422 interactivity: { 58423 clientNavigation: true 58424 } 58425 }, 58426 save({ attributes: attributes3 }) { 58427 const { hasFixedLayout, head, body, foot, caption } = attributes3; 58428 const isEmpty = !head.length && !body.length && !foot.length; 58429 if (isEmpty) { 58430 return null; 58431 } 58432 const colorProps = (0, import_block_editor242.__experimentalGetColorClassesAndStyles)(attributes3); 58433 const borderProps = (0, import_block_editor242.__experimentalGetBorderClassesAndStyles)(attributes3); 58434 const classes = clsx_default(colorProps.className, borderProps.className, { 58435 "has-fixed-layout": hasFixedLayout 58436 }); 58437 const hasCaption = !import_block_editor242.RichText.isEmpty(caption); 58438 const Section = ({ type, rows }) => { 58439 if (!rows.length) { 58440 return null; 58441 } 58442 const Tag = `t$type}`; 58443 return /* @__PURE__ */ (0, import_jsx_runtime472.jsx)(Tag, { children: rows.map(({ cells }, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime472.jsx)("tr", { children: cells.map( 58444 ({ 58445 content, 58446 tag, 58447 scope, 58448 align, 58449 colspan, 58450 rowspan 58451 }, cellIndex) => { 58452 const cellClasses = clsx_default({ 58453 [`has-text-align-$align}`]: align 58454 }); 58455 return /* @__PURE__ */ (0, import_jsx_runtime472.jsx)( 58456 import_block_editor242.RichText.Content, 58457 { 58458 className: cellClasses ? cellClasses : void 0, 58459 "data-align": align, 58460 tagName: tag, 58461 value: content, 58462 scope: tag === "th" ? scope : void 0, 58463 colSpan: colspan, 58464 rowSpan: rowspan 58465 }, 58466 cellIndex 58467 ); 58468 } 58469 ) }, rowIndex)) }); 58470 }; 58471 return /* @__PURE__ */ (0, import_jsx_runtime472.jsxs)("figure", { ...import_block_editor242.useBlockProps.save(), children: [ 58472 /* @__PURE__ */ (0, import_jsx_runtime472.jsxs)( 58473 "table", 58474 { 58475 className: classes === "" ? void 0 : classes, 58476 style: { ...colorProps.style, ...borderProps.style }, 58477 children: [ 58478 /* @__PURE__ */ (0, import_jsx_runtime472.jsx)(Section, { type: "head", rows: head }), 58479 /* @__PURE__ */ (0, import_jsx_runtime472.jsx)(Section, { type: "body", rows: body }), 58480 /* @__PURE__ */ (0, import_jsx_runtime472.jsx)(Section, { type: "foot", rows: foot }) 58481 ] 58482 } 58483 ), 58484 hasCaption && /* @__PURE__ */ (0, import_jsx_runtime472.jsx)( 58485 import_block_editor242.RichText.Content, 58486 { 58487 tagName: "figcaption", 58488 value: caption, 58489 className: (0, import_block_editor242.__experimentalGetElementClassName)( 58490 "caption" 58491 ) 58492 } 58493 ) 58494 ] }); 58495 } 58496 }; 58497 var v3Query = { 58498 content: { 58499 type: "string", 58500 source: "html" 58501 }, 58502 tag: { 58503 type: "string", 58504 default: "td", 58505 source: "tag" 58506 }, 58507 scope: { 58508 type: "string", 58509 source: "attribute", 58510 attribute: "scope" 58511 }, 58512 align: { 58513 type: "string", 58514 source: "attribute", 58515 attribute: "data-align" 58516 } 58517 }; 58518 var v312 = { 58519 attributes: { 58520 hasFixedLayout: { 58521 type: "boolean", 58522 default: false 58523 }, 58524 caption: { 58525 type: "string", 58526 source: "html", 58527 selector: "figcaption", 58528 default: "" 58529 }, 58530 head: { 58531 type: "array", 58532 default: [], 58533 source: "query", 58534 selector: "thead tr", 58535 query: { 58536 cells: { 58537 type: "array", 58538 default: [], 58539 source: "query", 58540 selector: "td,th", 58541 query: v3Query 58542 } 58543 } 58544 }, 58545 body: { 58546 type: "array", 58547 default: [], 58548 source: "query", 58549 selector: "tbody tr", 58550 query: { 58551 cells: { 58552 type: "array", 58553 default: [], 58554 source: "query", 58555 selector: "td,th", 58556 query: v3Query 58557 } 58558 } 58559 }, 58560 foot: { 58561 type: "array", 58562 default: [], 58563 source: "query", 58564 selector: "tfoot tr", 58565 query: { 58566 cells: { 58567 type: "array", 58568 default: [], 58569 source: "query", 58570 selector: "td,th", 58571 query: v3Query 58572 } 58573 } 58574 } 58575 }, 58576 supports: { 58577 anchor: true, 58578 align: true, 58579 color: { 58580 __experimentalSkipSerialization: true, 58581 gradients: true, 58582 __experimentalDefaultControls: { 58583 background: true, 58584 text: true 58585 } 58586 }, 58587 spacing: { 58588 margin: true, 58589 padding: true 58590 }, 58591 typography: { 58592 fontSize: true, 58593 lineHeight: true, 58594 __experimentalFontFamily: true, 58595 __experimentalFontStyle: true, 58596 __experimentalFontWeight: true, 58597 __experimentalLetterSpacing: true, 58598 __experimentalTextTransform: true, 58599 __experimentalTextDecoration: true, 58600 __experimentalDefaultControls: { 58601 fontSize: true 58602 } 58603 }, 58604 __experimentalBorder: { 58605 __experimentalSkipSerialization: true, 58606 color: true, 58607 style: true, 58608 width: true, 58609 __experimentalDefaultControls: { 58610 color: true, 58611 style: true, 58612 width: true 58613 } 58614 }, 58615 __experimentalSelector: ".wp-block-table > table" 58616 }, 58617 save({ attributes: attributes3 }) { 58618 const { hasFixedLayout, head, body, foot, caption } = attributes3; 58619 const isEmpty = !head.length && !body.length && !foot.length; 58620 if (isEmpty) { 58621 return null; 58622 } 58623 const colorProps = (0, import_block_editor242.__experimentalGetColorClassesAndStyles)(attributes3); 58624 const borderProps = (0, import_block_editor242.__experimentalGetBorderClassesAndStyles)(attributes3); 58625 const classes = clsx_default(colorProps.className, borderProps.className, { 58626 "has-fixed-layout": hasFixedLayout 58627 }); 58628 const hasCaption = !import_block_editor242.RichText.isEmpty(caption); 58629 const Section = ({ type, rows }) => { 58630 if (!rows.length) { 58631 return null; 58632 } 58633 const Tag = `t$type}`; 58634 return /* @__PURE__ */ (0, import_jsx_runtime472.jsx)(Tag, { children: rows.map(({ cells }, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime472.jsx)("tr", { children: cells.map( 58635 ({ content, tag, scope, align }, cellIndex) => { 58636 const cellClasses = clsx_default({ 58637 [`has-text-align-$align}`]: align 58638 }); 58639 return /* @__PURE__ */ (0, import_jsx_runtime472.jsx)( 58640 import_block_editor242.RichText.Content, 58641 { 58642 className: cellClasses ? cellClasses : void 0, 58643 "data-align": align, 58644 tagName: tag, 58645 value: content, 58646 scope: tag === "th" ? scope : void 0 58647 }, 58648 cellIndex 58649 ); 58650 } 58651 ) }, rowIndex)) }); 58652 }; 58653 return /* @__PURE__ */ (0, import_jsx_runtime472.jsxs)("figure", { ...import_block_editor242.useBlockProps.save(), children: [ 58654 /* @__PURE__ */ (0, import_jsx_runtime472.jsxs)( 58655 "table", 58656 { 58657 className: classes === "" ? void 0 : classes, 58658 style: { ...colorProps.style, ...borderProps.style }, 58659 children: [ 58660 /* @__PURE__ */ (0, import_jsx_runtime472.jsx)(Section, { type: "head", rows: head }), 58661 /* @__PURE__ */ (0, import_jsx_runtime472.jsx)(Section, { type: "body", rows: body }), 58662 /* @__PURE__ */ (0, import_jsx_runtime472.jsx)(Section, { type: "foot", rows: foot }) 58663 ] 58664 } 58665 ), 58666 hasCaption && /* @__PURE__ */ (0, import_jsx_runtime472.jsx)(import_block_editor242.RichText.Content, { tagName: "figcaption", value: caption }) 58667 ] }); 58668 } 58669 }; 58670 var v2Query = { 58671 content: { 58672 type: "string", 58673 source: "html" 58674 }, 58675 tag: { 58676 type: "string", 58677 default: "td", 58678 source: "tag" 58679 }, 58680 scope: { 58681 type: "string", 58682 source: "attribute", 58683 attribute: "scope" 58684 }, 58685 align: { 58686 type: "string", 58687 source: "attribute", 58688 attribute: "data-align" 58689 } 58690 }; 58691 var v215 = { 58692 attributes: { 58693 hasFixedLayout: { 58694 type: "boolean", 58695 default: false 58696 }, 58697 backgroundColor: { 58698 type: "string" 58699 }, 58700 caption: { 58701 type: "string", 58702 source: "html", 58703 selector: "figcaption", 58704 default: "" 58705 }, 58706 head: { 58707 type: "array", 58708 default: [], 58709 source: "query", 58710 selector: "thead tr", 58711 query: { 58712 cells: { 58713 type: "array", 58714 default: [], 58715 source: "query", 58716 selector: "td,th", 58717 query: v2Query 58718 } 58719 } 58720 }, 58721 body: { 58722 type: "array", 58723 default: [], 58724 source: "query", 58725 selector: "tbody tr", 58726 query: { 58727 cells: { 58728 type: "array", 58729 default: [], 58730 source: "query", 58731 selector: "td,th", 58732 query: v2Query 58733 } 58734 } 58735 }, 58736 foot: { 58737 type: "array", 58738 default: [], 58739 source: "query", 58740 selector: "tfoot tr", 58741 query: { 58742 cells: { 58743 type: "array", 58744 default: [], 58745 source: "query", 58746 selector: "td,th", 58747 query: v2Query 58748 } 58749 } 58750 } 58751 }, 58752 supports: { 58753 anchor: true, 58754 align: true, 58755 __experimentalSelector: ".wp-block-table > table" 58756 }, 58757 save: ({ attributes: attributes3 }) => { 58758 const { hasFixedLayout, head, body, foot, backgroundColor, caption } = attributes3; 58759 const isEmpty = !head.length && !body.length && !foot.length; 58760 if (isEmpty) { 58761 return null; 58762 } 58763 const backgroundClass = (0, import_block_editor242.getColorClassName)( 58764 "background-color", 58765 backgroundColor 58766 ); 58767 const classes = clsx_default(backgroundClass, { 58768 "has-fixed-layout": hasFixedLayout, 58769 "has-background": !!backgroundClass 58770 }); 58771 const hasCaption = !import_block_editor242.RichText.isEmpty(caption); 58772 const Section = ({ type, rows }) => { 58773 if (!rows.length) { 58774 return null; 58775 } 58776 const Tag = `t$type}`; 58777 return /* @__PURE__ */ (0, import_jsx_runtime472.jsx)(Tag, { children: rows.map(({ cells }, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime472.jsx)("tr", { children: cells.map( 58778 ({ content, tag, scope, align }, cellIndex) => { 58779 const cellClasses = clsx_default({ 58780 [`has-text-align-$align}`]: align 58781 }); 58782 return /* @__PURE__ */ (0, import_jsx_runtime472.jsx)( 58783 import_block_editor242.RichText.Content, 58784 { 58785 className: cellClasses ? cellClasses : void 0, 58786 "data-align": align, 58787 tagName: tag, 58788 value: content, 58789 scope: tag === "th" ? scope : void 0 58790 }, 58791 cellIndex 58792 ); 58793 } 58794 ) }, rowIndex)) }); 58795 }; 58796 return /* @__PURE__ */ (0, import_jsx_runtime472.jsxs)("figure", { ...import_block_editor242.useBlockProps.save(), children: [ 58797 /* @__PURE__ */ (0, import_jsx_runtime472.jsxs)("table", { className: classes === "" ? void 0 : classes, children: [ 58798 /* @__PURE__ */ (0, import_jsx_runtime472.jsx)(Section, { type: "head", rows: head }), 58799 /* @__PURE__ */ (0, import_jsx_runtime472.jsx)(Section, { type: "body", rows: body }), 58800 /* @__PURE__ */ (0, import_jsx_runtime472.jsx)(Section, { type: "foot", rows: foot }) 58801 ] }), 58802 hasCaption && /* @__PURE__ */ (0, import_jsx_runtime472.jsx)(import_block_editor242.RichText.Content, { tagName: "figcaption", value: caption }) 58803 ] }); 58804 }, 58805 isEligible: (attributes3) => { 58806 return attributes3.backgroundColor && attributes3.backgroundColor in oldColors && !attributes3.style; 58807 }, 58808 // This version is the first to introduce the style attribute to the 58809 // table block. As a result, we'll explicitly override that. 58810 migrate: (attributes3) => { 58811 return { 58812 ...attributes3, 58813 backgroundColor: void 0, 58814 style: { 58815 color: { 58816 background: oldColors[attributes3.backgroundColor] 58817 } 58818 } 58819 }; 58820 } 58821 }; 58822 var v1Query = { 58823 content: { 58824 type: "string", 58825 source: "html" 58826 }, 58827 tag: { 58828 type: "string", 58829 default: "td", 58830 source: "tag" 58831 }, 58832 scope: { 58833 type: "string", 58834 source: "attribute", 58835 attribute: "scope" 58836 } 58837 }; 58838 var v131 = { 58839 attributes: { 58840 hasFixedLayout: { 58841 type: "boolean", 58842 default: false 58843 }, 58844 backgroundColor: { 58845 type: "string" 58846 }, 58847 head: { 58848 type: "array", 58849 default: [], 58850 source: "query", 58851 selector: "thead tr", 58852 query: { 58853 cells: { 58854 type: "array", 58855 default: [], 58856 source: "query", 58857 selector: "td,th", 58858 query: v1Query 58859 } 58860 } 58861 }, 58862 body: { 58863 type: "array", 58864 default: [], 58865 source: "query", 58866 selector: "tbody tr", 58867 query: { 58868 cells: { 58869 type: "array", 58870 default: [], 58871 source: "query", 58872 selector: "td,th", 58873 query: v1Query 58874 } 58875 } 58876 }, 58877 foot: { 58878 type: "array", 58879 default: [], 58880 source: "query", 58881 selector: "tfoot tr", 58882 query: { 58883 cells: { 58884 type: "array", 58885 default: [], 58886 source: "query", 58887 selector: "td,th", 58888 query: v1Query 58889 } 58890 } 58891 } 58892 }, 58893 supports: { 58894 align: true 58895 }, 58896 save({ attributes: attributes3 }) { 58897 const { hasFixedLayout, head, body, foot, backgroundColor } = attributes3; 58898 const isEmpty = !head.length && !body.length && !foot.length; 58899 if (isEmpty) { 58900 return null; 58901 } 58902 const backgroundClass = (0, import_block_editor242.getColorClassName)( 58903 "background-color", 58904 backgroundColor 58905 ); 58906 const classes = clsx_default(backgroundClass, { 58907 "has-fixed-layout": hasFixedLayout, 58908 "has-background": !!backgroundClass 58909 }); 58910 const Section = ({ type, rows }) => { 58911 if (!rows.length) { 58912 return null; 58913 } 58914 const Tag = `t$type}`; 58915 return /* @__PURE__ */ (0, import_jsx_runtime472.jsx)(Tag, { children: rows.map(({ cells }, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime472.jsx)("tr", { children: cells.map( 58916 ({ content, tag, scope }, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime472.jsx)( 58917 import_block_editor242.RichText.Content, 58918 { 58919 tagName: tag, 58920 value: content, 58921 scope: tag === "th" ? scope : void 0 58922 }, 58923 cellIndex 58924 ) 58925 ) }, rowIndex)) }); 58926 }; 58927 return /* @__PURE__ */ (0, import_jsx_runtime472.jsxs)("table", { className: classes, children: [ 58928 /* @__PURE__ */ (0, import_jsx_runtime472.jsx)(Section, { type: "head", rows: head }), 58929 /* @__PURE__ */ (0, import_jsx_runtime472.jsx)(Section, { type: "body", rows: body }), 58930 /* @__PURE__ */ (0, import_jsx_runtime472.jsx)(Section, { type: "foot", rows: foot }) 58931 ] }); 58932 } 58933 }; 58934 var deprecated_default40 = [v410, v312, v215, v131]; 58935 58936 // packages/block-library/build-module/table/edit.js 58937 var import_element118 = __toESM(require_element()); 58938 var import_block_editor243 = __toESM(require_block_editor()); 58939 var import_i18n228 = __toESM(require_i18n()); 58940 var import_components148 = __toESM(require_components()); 58941 58942 // packages/block-library/build-module/table/state.js 58943 var INHERITED_COLUMN_ATTRIBUTES = ["align"]; 58944 function createTable({ rowCount, columnCount }) { 58945 return { 58946 body: Array.from({ length: rowCount }).map(() => ({ 58947 cells: Array.from({ length: columnCount }).map(() => ({ 58948 content: "", 58949 tag: "td" 58950 })) 58951 })) 58952 }; 58953 } 58954 function getFirstRow(state) { 58955 if (!isEmptyTableSection(state.head)) { 58956 return state.head[0]; 58957 } 58958 if (!isEmptyTableSection(state.body)) { 58959 return state.body[0]; 58960 } 58961 if (!isEmptyTableSection(state.foot)) { 58962 return state.foot[0]; 58963 } 58964 } 58965 function getCellAttribute(state, cellLocation, attributeName) { 58966 const { sectionName, rowIndex, columnIndex } = cellLocation; 58967 return state[sectionName]?.[rowIndex]?.cells?.[columnIndex]?.[attributeName]; 58968 } 58969 function updateSelectedCell(state, selection, updateCell) { 58970 if (!selection) { 58971 return state; 58972 } 58973 const tableSections = Object.fromEntries( 58974 Object.entries(state).filter( 58975 ([key]) => ["head", "body", "foot"].includes(key) 58976 ) 58977 ); 58978 const { sectionName: selectionSectionName, rowIndex: selectionRowIndex } = selection; 58979 return Object.fromEntries( 58980 Object.entries(tableSections).map(([sectionName, section]) => { 58981 if (selectionSectionName && selectionSectionName !== sectionName) { 58982 return [sectionName, section]; 58983 } 58984 return [ 58985 sectionName, 58986 section.map((row, rowIndex) => { 58987 if (selectionRowIndex && selectionRowIndex !== rowIndex) { 58988 return row; 58989 } 58990 return { 58991 cells: row.cells.map( 58992 (cellAttributes, columnIndex) => { 58993 const cellLocation = { 58994 sectionName, 58995 columnIndex, 58996 rowIndex 58997 }; 58998 if (!isCellSelected(cellLocation, selection)) { 58999 return cellAttributes; 59000 } 59001 return updateCell(cellAttributes); 59002 } 59003 ) 59004 }; 59005 }) 59006 ]; 59007 }) 59008 ); 59009 } 59010 function isCellSelected(cellLocation, selection) { 59011 if (!cellLocation || !selection) { 59012 return false; 59013 } 59014 switch (selection.type) { 59015 case "column": 59016 return selection.type === "column" && cellLocation.columnIndex === selection.columnIndex; 59017 case "cell": 59018 return selection.type === "cell" && cellLocation.sectionName === selection.sectionName && cellLocation.columnIndex === selection.columnIndex && cellLocation.rowIndex === selection.rowIndex; 59019 } 59020 } 59021 function insertRow(state, { sectionName, rowIndex, columnCount }) { 59022 const firstRow = getFirstRow(state); 59023 const cellCount = columnCount === void 0 ? firstRow?.cells?.length : columnCount; 59024 if (!cellCount) { 59025 return state; 59026 } 59027 return { 59028 [sectionName]: [ 59029 ...state[sectionName].slice(0, rowIndex), 59030 { 59031 cells: Array.from({ length: cellCount }).map( 59032 (_, index) => { 59033 const firstCellInColumn = firstRow?.cells?.[index] ?? {}; 59034 const inheritedAttributes = Object.fromEntries( 59035 Object.entries(firstCellInColumn).filter( 59036 ([key]) => INHERITED_COLUMN_ATTRIBUTES.includes(key) 59037 ) 59038 ); 59039 return { 59040 ...inheritedAttributes, 59041 content: "", 59042 tag: sectionName === "head" ? "th" : "td" 59043 }; 59044 } 59045 ) 59046 }, 59047 ...state[sectionName].slice(rowIndex) 59048 ] 59049 }; 59050 } 59051 function deleteRow(state, { sectionName, rowIndex }) { 59052 return { 59053 [sectionName]: state[sectionName].filter( 59054 (row, index) => index !== rowIndex 59055 ) 59056 }; 59057 } 59058 function insertColumn(state, { columnIndex }) { 59059 const tableSections = Object.fromEntries( 59060 Object.entries(state).filter( 59061 ([key]) => ["head", "body", "foot"].includes(key) 59062 ) 59063 ); 59064 return Object.fromEntries( 59065 Object.entries(tableSections).map(([sectionName, section]) => { 59066 if (isEmptyTableSection(section)) { 59067 return [sectionName, section]; 59068 } 59069 return [ 59070 sectionName, 59071 section.map((row) => { 59072 if (isEmptyRow(row) || row.cells.length < columnIndex) { 59073 return row; 59074 } 59075 return { 59076 cells: [ 59077 ...row.cells.slice(0, columnIndex), 59078 { 59079 content: "", 59080 tag: sectionName === "head" ? "th" : "td" 59081 }, 59082 ...row.cells.slice(columnIndex) 59083 ] 59084 }; 59085 }) 59086 ]; 59087 }) 59088 ); 59089 } 59090 function deleteColumn(state, { columnIndex }) { 59091 const tableSections = Object.fromEntries( 59092 Object.entries(state).filter( 59093 ([key]) => ["head", "body", "foot"].includes(key) 59094 ) 59095 ); 59096 return Object.fromEntries( 59097 Object.entries(tableSections).map(([sectionName, section]) => { 59098 if (isEmptyTableSection(section)) { 59099 return [sectionName, section]; 59100 } 59101 return [ 59102 sectionName, 59103 section.map((row) => ({ 59104 cells: row.cells.length >= columnIndex ? row.cells.filter( 59105 (cell, index) => index !== columnIndex 59106 ) : row.cells 59107 })).filter((row) => row.cells.length) 59108 ]; 59109 }) 59110 ); 59111 } 59112 function toggleSection(state, sectionName) { 59113 if (!isEmptyTableSection(state[sectionName])) { 59114 return { [sectionName]: [] }; 59115 } 59116 const columnCount = state.body?.[0]?.cells?.length ?? 1; 59117 return insertRow(state, { sectionName, rowIndex: 0, columnCount }); 59118 } 59119 function isEmptyTableSection(section) { 59120 return !section || !section.length || section.every(isEmptyRow); 59121 } 59122 function isEmptyRow(row) { 59123 return !(row.cells && row.cells.length); 59124 } 59125 59126 // packages/block-library/build-module/table/edit.js 59127 var import_jsx_runtime473 = __toESM(require_jsx_runtime()); 59128 var ALIGNMENT_CONTROLS = [ 59129 { 59130 icon: align_left_default, 59131 title: (0, import_i18n228.__)("Align column left"), 59132 align: "left" 59133 }, 59134 { 59135 icon: align_center_default, 59136 title: (0, import_i18n228.__)("Align column center"), 59137 align: "center" 59138 }, 59139 { 59140 icon: align_right_default, 59141 title: (0, import_i18n228.__)("Align column right"), 59142 align: "right" 59143 } 59144 ]; 59145 var cellAriaLabel = { 59146 head: (0, import_i18n228.__)("Header cell text"), 59147 body: (0, import_i18n228.__)("Body cell text"), 59148 foot: (0, import_i18n228.__)("Footer cell text") 59149 }; 59150 var placeholder = { 59151 head: (0, import_i18n228.__)("Header label"), 59152 foot: (0, import_i18n228.__)("Footer label") 59153 }; 59154 function TSection({ name: name117, ...props }) { 59155 const TagName2 = `t$name117}`; 59156 return /* @__PURE__ */ (0, import_jsx_runtime473.jsx)(TagName2, { ...props }); 59157 } 59158 function TableEdit({ 59159 attributes: attributes3, 59160 setAttributes, 59161 insertBlocksAfter, 59162 isSelected: isSingleSelected 59163 }) { 59164 const { hasFixedLayout, head, foot } = attributes3; 59165 const [initialRowCount, setInitialRowCount] = (0, import_element118.useState)(2); 59166 const [initialColumnCount, setInitialColumnCount] = (0, import_element118.useState)(2); 59167 const [selectedCell, setSelectedCell] = (0, import_element118.useState)(); 59168 const colorProps = (0, import_block_editor243.__experimentalUseColorProps)(attributes3); 59169 const borderProps = (0, import_block_editor243.__experimentalUseBorderProps)(attributes3); 59170 const blockEditingMode = (0, import_block_editor243.useBlockEditingMode)(); 59171 const tableRef = (0, import_element118.useRef)(); 59172 const [hasTableCreated, setHasTableCreated] = (0, import_element118.useState)(false); 59173 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 59174 function onChangeInitialColumnCount(count) { 59175 setInitialColumnCount(count); 59176 } 59177 function onChangeInitialRowCount(count) { 59178 setInitialRowCount(count); 59179 } 59180 function onCreateTable(event) { 59181 event.preventDefault(); 59182 setAttributes( 59183 createTable({ 59184 rowCount: parseInt(initialRowCount, 10) || 2, 59185 columnCount: parseInt(initialColumnCount, 10) || 2 59186 }) 59187 ); 59188 setHasTableCreated(true); 59189 } 59190 function onChangeFixedLayout() { 59191 setAttributes({ hasFixedLayout: !hasFixedLayout }); 59192 } 59193 const onChange = (0, import_element118.useCallback)( 59194 function(content) { 59195 if (!selectedCell) { 59196 return; 59197 } 59198 setAttributes( 59199 (currentAttributes) => updateSelectedCell( 59200 currentAttributes, 59201 selectedCell, 59202 (cellAttributes) => ({ 59203 ...cellAttributes, 59204 content 59205 }) 59206 ) 59207 ); 59208 }, 59209 [selectedCell, setAttributes] 59210 ); 59211 function onChangeColumnAlignment(align) { 59212 if (!selectedCell) { 59213 return; 59214 } 59215 const columnSelection = { 59216 type: "column", 59217 columnIndex: selectedCell.columnIndex 59218 }; 59219 const newAttributes = updateSelectedCell( 59220 attributes3, 59221 columnSelection, 59222 (cellAttributes) => ({ 59223 ...cellAttributes, 59224 align 59225 }) 59226 ); 59227 setAttributes(newAttributes); 59228 } 59229 function getCellAlignment() { 59230 if (!selectedCell) { 59231 return; 59232 } 59233 return getCellAttribute(attributes3, selectedCell, "align"); 59234 } 59235 function onToggleHeaderSection() { 59236 setAttributes(toggleSection(attributes3, "head")); 59237 } 59238 function onToggleFooterSection() { 59239 setAttributes(toggleSection(attributes3, "foot")); 59240 } 59241 function onInsertRow(delta) { 59242 if (!selectedCell) { 59243 return; 59244 } 59245 const { sectionName, rowIndex } = selectedCell; 59246 const newRowIndex = rowIndex + delta; 59247 setAttributes( 59248 insertRow(attributes3, { 59249 sectionName, 59250 rowIndex: newRowIndex 59251 }) 59252 ); 59253 setSelectedCell({ 59254 sectionName, 59255 rowIndex: newRowIndex, 59256 columnIndex: 0, 59257 type: "cell" 59258 }); 59259 } 59260 function onInsertRowBefore() { 59261 onInsertRow(0); 59262 } 59263 function onInsertRowAfter() { 59264 onInsertRow(1); 59265 } 59266 function onDeleteRow() { 59267 if (!selectedCell) { 59268 return; 59269 } 59270 const { sectionName, rowIndex } = selectedCell; 59271 setSelectedCell(); 59272 setAttributes(deleteRow(attributes3, { sectionName, rowIndex })); 59273 } 59274 function onInsertColumn(delta = 0) { 59275 if (!selectedCell) { 59276 return; 59277 } 59278 const { columnIndex } = selectedCell; 59279 const newColumnIndex = columnIndex + delta; 59280 setAttributes( 59281 insertColumn(attributes3, { 59282 columnIndex: newColumnIndex 59283 }) 59284 ); 59285 setSelectedCell({ 59286 rowIndex: 0, 59287 columnIndex: newColumnIndex, 59288 type: "cell" 59289 }); 59290 } 59291 function onInsertColumnBefore() { 59292 onInsertColumn(0); 59293 } 59294 function onInsertColumnAfter() { 59295 onInsertColumn(1); 59296 } 59297 function onDeleteColumn() { 59298 if (!selectedCell) { 59299 return; 59300 } 59301 const { sectionName, columnIndex } = selectedCell; 59302 setSelectedCell(); 59303 setAttributes( 59304 deleteColumn(attributes3, { sectionName, columnIndex }) 59305 ); 59306 } 59307 (0, import_element118.useEffect)(() => { 59308 if (!isSingleSelected) { 59309 setSelectedCell(); 59310 } 59311 }, [isSingleSelected]); 59312 (0, import_element118.useEffect)(() => { 59313 if (hasTableCreated) { 59314 tableRef?.current?.querySelector('td div[contentEditable="true"]')?.focus(); 59315 setHasTableCreated(false); 59316 } 59317 }, [hasTableCreated]); 59318 const sections = ["head", "body", "foot"].filter( 59319 (name117) => !isEmptyTableSection(attributes3[name117]) 59320 ); 59321 const tableControls = [ 59322 { 59323 icon: table_row_before_default, 59324 title: (0, import_i18n228.__)("Insert row before"), 59325 isDisabled: !selectedCell, 59326 onClick: onInsertRowBefore 59327 }, 59328 { 59329 icon: table_row_after_default, 59330 title: (0, import_i18n228.__)("Insert row after"), 59331 isDisabled: !selectedCell, 59332 onClick: onInsertRowAfter 59333 }, 59334 { 59335 icon: table_row_delete_default, 59336 title: (0, import_i18n228.__)("Delete row"), 59337 isDisabled: !selectedCell, 59338 onClick: onDeleteRow 59339 }, 59340 { 59341 icon: table_column_before_default, 59342 title: (0, import_i18n228.__)("Insert column before"), 59343 isDisabled: !selectedCell, 59344 onClick: onInsertColumnBefore 59345 }, 59346 { 59347 icon: table_column_after_default, 59348 title: (0, import_i18n228.__)("Insert column after"), 59349 isDisabled: !selectedCell, 59350 onClick: onInsertColumnAfter 59351 }, 59352 { 59353 icon: table_column_delete_default, 59354 title: (0, import_i18n228.__)("Delete column"), 59355 isDisabled: !selectedCell, 59356 onClick: onDeleteColumn 59357 } 59358 ]; 59359 const renderedSections = sections.map((name117) => /* @__PURE__ */ (0, import_jsx_runtime473.jsx)(TSection, { name: name117, children: attributes3[name117].map(({ cells }, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime473.jsx)("tr", { children: cells.map((cellProps, columnIndex) => { 59360 const isSelected = selectedCell?.sectionName === name117 && selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === columnIndex; 59361 return /* @__PURE__ */ (0, import_jsx_runtime473.jsx)( 59362 Cell, 59363 { 59364 name: name117, 59365 rowIndex, 59366 columnIndex, 59367 onChange: ( 59368 // Only pass the `onChange` handler to the selectedCell. 59369 // Cell components are memoized, so it's best to avoid 59370 // passing in a value that will cause all cells to re-render 59371 // whenever it changes. 59372 isSelected ? onChange : void 0 59373 ), 59374 setSelectedCell, 59375 ...cellProps 59376 }, 59377 columnIndex 59378 ); 59379 }) }, rowIndex)) }, name117)); 59380 const isEmpty = !sections.length; 59381 return /* @__PURE__ */ (0, import_jsx_runtime473.jsxs)("figure", { ...(0, import_block_editor243.useBlockProps)({ ref: tableRef }), children: [ 59382 !isEmpty && blockEditingMode === "default" && /* @__PURE__ */ (0, import_jsx_runtime473.jsxs)(import_jsx_runtime473.Fragment, { children: [ 59383 /* @__PURE__ */ (0, import_jsx_runtime473.jsx)(import_block_editor243.BlockControls, { group: "block", children: /* @__PURE__ */ (0, import_jsx_runtime473.jsx)( 59384 import_block_editor243.AlignmentControl, 59385 { 59386 label: (0, import_i18n228.__)("Change column alignment"), 59387 alignmentControls: ALIGNMENT_CONTROLS, 59388 value: getCellAlignment(), 59389 onChange: (nextAlign) => onChangeColumnAlignment(nextAlign) 59390 } 59391 ) }), 59392 /* @__PURE__ */ (0, import_jsx_runtime473.jsx)(import_block_editor243.BlockControls, { group: "other", children: /* @__PURE__ */ (0, import_jsx_runtime473.jsx)( 59393 import_components148.ToolbarDropdownMenu, 59394 { 59395 icon: table_default, 59396 label: (0, import_i18n228.__)("Edit table"), 59397 controls: tableControls 59398 } 59399 ) }) 59400 ] }), 59401 /* @__PURE__ */ (0, import_jsx_runtime473.jsx)(import_block_editor243.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime473.jsxs)( 59402 import_components148.__experimentalToolsPanel, 59403 { 59404 label: (0, import_i18n228.__)("Settings"), 59405 resetAll: () => { 59406 setAttributes({ 59407 hasFixedLayout: true, 59408 head: [], 59409 foot: [] 59410 }); 59411 }, 59412 dropdownMenuProps, 59413 children: [ 59414 /* @__PURE__ */ (0, import_jsx_runtime473.jsx)( 59415 import_components148.__experimentalToolsPanelItem, 59416 { 59417 hasValue: () => hasFixedLayout !== true, 59418 label: (0, import_i18n228.__)("Fixed width table cells"), 59419 onDeselect: () => setAttributes({ hasFixedLayout: true }), 59420 isShownByDefault: true, 59421 children: /* @__PURE__ */ (0, import_jsx_runtime473.jsx)( 59422 import_components148.ToggleControl, 59423 { 59424 label: (0, import_i18n228.__)("Fixed width table cells"), 59425 checked: !!hasFixedLayout, 59426 onChange: onChangeFixedLayout 59427 } 59428 ) 59429 } 59430 ), 59431 !isEmpty && /* @__PURE__ */ (0, import_jsx_runtime473.jsxs)(import_jsx_runtime473.Fragment, { children: [ 59432 /* @__PURE__ */ (0, import_jsx_runtime473.jsx)( 59433 import_components148.__experimentalToolsPanelItem, 59434 { 59435 hasValue: () => head && head.length, 59436 label: (0, import_i18n228.__)("Header section"), 59437 onDeselect: () => setAttributes({ head: [] }), 59438 isShownByDefault: true, 59439 children: /* @__PURE__ */ (0, import_jsx_runtime473.jsx)( 59440 import_components148.ToggleControl, 59441 { 59442 label: (0, import_i18n228.__)("Header section"), 59443 checked: !!(head && head.length), 59444 onChange: onToggleHeaderSection 59445 } 59446 ) 59447 } 59448 ), 59449 /* @__PURE__ */ (0, import_jsx_runtime473.jsx)( 59450 import_components148.__experimentalToolsPanelItem, 59451 { 59452 hasValue: () => foot && foot.length, 59453 label: (0, import_i18n228.__)("Footer section"), 59454 onDeselect: () => setAttributes({ foot: [] }), 59455 isShownByDefault: true, 59456 children: /* @__PURE__ */ (0, import_jsx_runtime473.jsx)( 59457 import_components148.ToggleControl, 59458 { 59459 label: (0, import_i18n228.__)("Footer section"), 59460 checked: !!(foot && foot.length), 59461 onChange: onToggleFooterSection 59462 } 59463 ) 59464 } 59465 ) 59466 ] }) 59467 ] 59468 } 59469 ) }), 59470 !isEmpty && /* @__PURE__ */ (0, import_jsx_runtime473.jsx)( 59471 "table", 59472 { 59473 className: clsx_default( 59474 colorProps.className, 59475 borderProps.className, 59476 { 59477 "has-fixed-layout": hasFixedLayout, 59478 // This is required in the editor only to overcome 59479 // the fact the editor rewrites individual border 59480 // widths into a shorthand format. 59481 "has-individual-borders": (0, import_components148.__experimentalHasSplitBorders)( 59482 attributes3?.style?.border 59483 ) 59484 } 59485 ), 59486 style: { ...colorProps.style, ...borderProps.style }, 59487 children: renderedSections 59488 } 59489 ), 59490 isEmpty ? /* @__PURE__ */ (0, import_jsx_runtime473.jsx)( 59491 import_components148.Placeholder, 59492 { 59493 label: (0, import_i18n228.__)("Table"), 59494 icon: /* @__PURE__ */ (0, import_jsx_runtime473.jsx)(import_block_editor243.BlockIcon, { icon: block_table_default, showColors: true }), 59495 instructions: (0, import_i18n228.__)("Insert a table for sharing data."), 59496 children: /* @__PURE__ */ (0, import_jsx_runtime473.jsxs)( 59497 "form", 59498 { 59499 className: "blocks-table__placeholder-form", 59500 onSubmit: onCreateTable, 59501 children: [ 59502 /* @__PURE__ */ (0, import_jsx_runtime473.jsx)( 59503 import_components148.TextControl, 59504 { 59505 __next40pxDefaultSize: true, 59506 type: "number", 59507 label: (0, import_i18n228.__)("Column count"), 59508 value: initialColumnCount, 59509 onChange: onChangeInitialColumnCount, 59510 min: "1", 59511 className: "blocks-table__placeholder-input" 59512 } 59513 ), 59514 /* @__PURE__ */ (0, import_jsx_runtime473.jsx)( 59515 import_components148.TextControl, 59516 { 59517 __next40pxDefaultSize: true, 59518 type: "number", 59519 label: (0, import_i18n228.__)("Row count"), 59520 value: initialRowCount, 59521 onChange: onChangeInitialRowCount, 59522 min: "1", 59523 className: "blocks-table__placeholder-input" 59524 } 59525 ), 59526 /* @__PURE__ */ (0, import_jsx_runtime473.jsx)( 59527 import_components148.Button, 59528 { 59529 __next40pxDefaultSize: true, 59530 variant: "primary", 59531 type: "submit", 59532 children: (0, import_i18n228.__)("Create Table") 59533 } 59534 ) 59535 ] 59536 } 59537 ) 59538 } 59539 ) : /* @__PURE__ */ (0, import_jsx_runtime473.jsx)( 59540 Caption, 59541 { 59542 attributes: attributes3, 59543 setAttributes, 59544 isSelected: isSingleSelected, 59545 insertBlocksAfter, 59546 label: (0, import_i18n228.__)("Table caption text"), 59547 showToolbarButton: isSingleSelected && blockEditingMode === "default" 59548 } 59549 ) 59550 ] }); 59551 } 59552 var Cell = (0, import_element118.memo)(function({ 59553 tag: CellTag, 59554 name: name117, 59555 scope, 59556 colspan, 59557 rowspan, 59558 rowIndex, 59559 columnIndex, 59560 align, 59561 content, 59562 onChange, 59563 setSelectedCell 59564 }) { 59565 return /* @__PURE__ */ (0, import_jsx_runtime473.jsx)( 59566 CellTag, 59567 { 59568 scope: CellTag === "th" ? scope : void 0, 59569 colSpan: colspan, 59570 rowSpan: rowspan, 59571 className: clsx_default( 59572 { 59573 [`has-text-align-$align}`]: align 59574 }, 59575 "wp-block-table__cell-content" 59576 ), 59577 children: /* @__PURE__ */ (0, import_jsx_runtime473.jsx)( 59578 import_block_editor243.RichText, 59579 { 59580 value: content, 59581 onChange, 59582 onFocus: () => { 59583 setSelectedCell({ 59584 sectionName: name117, 59585 rowIndex, 59586 columnIndex, 59587 type: "cell" 59588 }); 59589 }, 59590 "aria-label": cellAriaLabel[name117], 59591 placeholder: placeholder[name117] 59592 } 59593 ) 59594 } 59595 ); 59596 }); 59597 var edit_default32 = TableEdit; 59598 59599 // packages/block-library/build-module/table/block.json 59600 var block_default102 = { 59601 $schema: "https://schemas.wp.org/trunk/block.json", 59602 apiVersion: 3, 59603 name: "core/table", 59604 title: "Table", 59605 category: "text", 59606 description: "Create structured content in rows and columns to display information.", 59607 textdomain: "default", 59608 attributes: { 59609 hasFixedLayout: { 59610 type: "boolean", 59611 default: true 59612 }, 59613 caption: { 59614 type: "rich-text", 59615 source: "rich-text", 59616 selector: "figcaption", 59617 role: "content" 59618 }, 59619 head: { 59620 type: "array", 59621 default: [], 59622 source: "query", 59623 selector: "thead tr", 59624 query: { 59625 cells: { 59626 type: "array", 59627 default: [], 59628 source: "query", 59629 selector: "td,th", 59630 query: { 59631 content: { 59632 type: "rich-text", 59633 source: "rich-text", 59634 role: "content" 59635 }, 59636 tag: { 59637 type: "string", 59638 default: "td", 59639 source: "tag" 59640 }, 59641 scope: { 59642 type: "string", 59643 source: "attribute", 59644 attribute: "scope" 59645 }, 59646 align: { 59647 type: "string", 59648 source: "attribute", 59649 attribute: "data-align" 59650 }, 59651 colspan: { 59652 type: "string", 59653 source: "attribute", 59654 attribute: "colspan" 59655 }, 59656 rowspan: { 59657 type: "string", 59658 source: "attribute", 59659 attribute: "rowspan" 59660 } 59661 } 59662 } 59663 } 59664 }, 59665 body: { 59666 type: "array", 59667 default: [], 59668 source: "query", 59669 selector: "tbody tr", 59670 query: { 59671 cells: { 59672 type: "array", 59673 default: [], 59674 source: "query", 59675 selector: "td,th", 59676 query: { 59677 content: { 59678 type: "rich-text", 59679 source: "rich-text", 59680 role: "content" 59681 }, 59682 tag: { 59683 type: "string", 59684 default: "td", 59685 source: "tag" 59686 }, 59687 scope: { 59688 type: "string", 59689 source: "attribute", 59690 attribute: "scope" 59691 }, 59692 align: { 59693 type: "string", 59694 source: "attribute", 59695 attribute: "data-align" 59696 }, 59697 colspan: { 59698 type: "string", 59699 source: "attribute", 59700 attribute: "colspan" 59701 }, 59702 rowspan: { 59703 type: "string", 59704 source: "attribute", 59705 attribute: "rowspan" 59706 } 59707 } 59708 } 59709 } 59710 }, 59711 foot: { 59712 type: "array", 59713 default: [], 59714 source: "query", 59715 selector: "tfoot tr", 59716 query: { 59717 cells: { 59718 type: "array", 59719 default: [], 59720 source: "query", 59721 selector: "td,th", 59722 query: { 59723 content: { 59724 type: "rich-text", 59725 source: "rich-text", 59726 role: "content" 59727 }, 59728 tag: { 59729 type: "string", 59730 default: "td", 59731 source: "tag" 59732 }, 59733 scope: { 59734 type: "string", 59735 source: "attribute", 59736 attribute: "scope" 59737 }, 59738 align: { 59739 type: "string", 59740 source: "attribute", 59741 attribute: "data-align" 59742 }, 59743 colspan: { 59744 type: "string", 59745 source: "attribute", 59746 attribute: "colspan" 59747 }, 59748 rowspan: { 59749 type: "string", 59750 source: "attribute", 59751 attribute: "rowspan" 59752 } 59753 } 59754 } 59755 } 59756 } 59757 }, 59758 supports: { 59759 anchor: true, 59760 align: true, 59761 color: { 59762 __experimentalSkipSerialization: true, 59763 gradients: true, 59764 __experimentalDefaultControls: { 59765 background: true, 59766 text: true 59767 } 59768 }, 59769 spacing: { 59770 margin: true, 59771 padding: true, 59772 __experimentalDefaultControls: { 59773 margin: false, 59774 padding: false 59775 } 59776 }, 59777 typography: { 59778 fontSize: true, 59779 lineHeight: true, 59780 __experimentalFontFamily: true, 59781 __experimentalFontStyle: true, 59782 __experimentalFontWeight: true, 59783 __experimentalLetterSpacing: true, 59784 __experimentalTextTransform: true, 59785 __experimentalTextDecoration: true, 59786 __experimentalDefaultControls: { 59787 fontSize: true 59788 } 59789 }, 59790 __experimentalBorder: { 59791 __experimentalSkipSerialization: true, 59792 color: true, 59793 style: true, 59794 width: true, 59795 __experimentalDefaultControls: { 59796 color: true, 59797 style: true, 59798 width: true 59799 } 59800 }, 59801 interactivity: { 59802 clientNavigation: true 59803 } 59804 }, 59805 selectors: { 59806 root: ".wp-block-table > table", 59807 spacing: ".wp-block-table" 59808 }, 59809 styles: [ 59810 { 59811 name: "regular", 59812 label: "Default", 59813 isDefault: true 59814 }, 59815 { name: "stripes", label: "Stripes" } 59816 ], 59817 editorStyle: "wp-block-table-editor", 59818 style: "wp-block-table" 59819 }; 59820 59821 // packages/block-library/build-module/table/save.js 59822 var import_block_editor244 = __toESM(require_block_editor()); 59823 var import_jsx_runtime474 = __toESM(require_jsx_runtime()); 59824 function save48({ attributes: attributes3 }) { 59825 const { hasFixedLayout, head, body, foot, caption } = attributes3; 59826 const isEmpty = !head.length && !body.length && !foot.length; 59827 if (isEmpty) { 59828 return null; 59829 } 59830 const colorProps = (0, import_block_editor244.__experimentalGetColorClassesAndStyles)(attributes3); 59831 const borderProps = (0, import_block_editor244.__experimentalGetBorderClassesAndStyles)(attributes3); 59832 const classes = clsx_default(colorProps.className, borderProps.className, { 59833 "has-fixed-layout": hasFixedLayout 59834 }); 59835 const hasCaption = !import_block_editor244.RichText.isEmpty(caption); 59836 const Section = ({ type, rows }) => { 59837 if (!rows.length) { 59838 return null; 59839 } 59840 const Tag = `t$type}`; 59841 return /* @__PURE__ */ (0, import_jsx_runtime474.jsx)(Tag, { children: rows.map(({ cells }, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime474.jsx)("tr", { children: cells.map( 59842 ({ 59843 content, 59844 tag, 59845 scope, 59846 align, 59847 colspan, 59848 rowspan 59849 }, cellIndex) => { 59850 const cellClasses = clsx_default({ 59851 [`has-text-align-$align}`]: align 59852 }); 59853 return /* @__PURE__ */ (0, import_jsx_runtime474.jsx)( 59854 import_block_editor244.RichText.Content, 59855 { 59856 className: cellClasses ? cellClasses : void 0, 59857 "data-align": align, 59858 tagName: tag, 59859 value: content, 59860 scope: tag === "th" ? scope : void 0, 59861 colSpan: colspan, 59862 rowSpan: rowspan 59863 }, 59864 cellIndex 59865 ); 59866 } 59867 ) }, rowIndex)) }); 59868 }; 59869 return /* @__PURE__ */ (0, import_jsx_runtime474.jsxs)("figure", { ...import_block_editor244.useBlockProps.save(), children: [ 59870 /* @__PURE__ */ (0, import_jsx_runtime474.jsxs)( 59871 "table", 59872 { 59873 className: classes === "" ? void 0 : classes, 59874 style: { ...colorProps.style, ...borderProps.style }, 59875 children: [ 59876 /* @__PURE__ */ (0, import_jsx_runtime474.jsx)(Section, { type: "head", rows: head }), 59877 /* @__PURE__ */ (0, import_jsx_runtime474.jsx)(Section, { type: "body", rows: body }), 59878 /* @__PURE__ */ (0, import_jsx_runtime474.jsx)(Section, { type: "foot", rows: foot }) 59879 ] 59880 } 59881 ), 59882 hasCaption && /* @__PURE__ */ (0, import_jsx_runtime474.jsx)( 59883 import_block_editor244.RichText.Content, 59884 { 59885 tagName: "figcaption", 59886 value: caption, 59887 className: (0, import_block_editor244.__experimentalGetElementClassName)("caption") 59888 } 59889 ) 59890 ] }); 59891 } 59892 59893 // packages/block-library/build-module/table/transforms.js 59894 var import_blocks107 = __toESM(require_blocks()); 59895 59896 // packages/block-library/build-module/table/utils.js 59897 function normalizeRowColSpan(rowColSpan) { 59898 const parsedValue = parseInt(rowColSpan, 10); 59899 if (!Number.isInteger(parsedValue)) { 59900 return void 0; 59901 } 59902 return parsedValue < 0 || parsedValue === 1 ? void 0 : parsedValue.toString(); 59903 } 59904 59905 // packages/block-library/build-module/table/transforms.js 59906 var tableContentPasteSchema = ({ phrasingContentSchema }) => ({ 59907 tr: { 59908 allowEmpty: true, 59909 children: { 59910 th: { 59911 allowEmpty: true, 59912 children: phrasingContentSchema, 59913 attributes: ["scope", "colspan", "rowspan", "style"] 59914 }, 59915 td: { 59916 allowEmpty: true, 59917 children: phrasingContentSchema, 59918 attributes: ["colspan", "rowspan", "style"] 59919 } 59920 } 59921 } 59922 }); 59923 var tablePasteSchema = (args) => ({ 59924 table: { 59925 children: { 59926 thead: { 59927 allowEmpty: true, 59928 children: tableContentPasteSchema(args) 59929 }, 59930 tfoot: { 59931 allowEmpty: true, 59932 children: tableContentPasteSchema(args) 59933 }, 59934 tbody: { 59935 allowEmpty: true, 59936 children: tableContentPasteSchema(args) 59937 } 59938 } 59939 } 59940 }); 59941 var transforms34 = { 59942 from: [ 59943 { 59944 type: "raw", 59945 selector: "table", 59946 schema: tablePasteSchema, 59947 transform: (node) => { 59948 const attributes3 = Array.from(node.children).reduce( 59949 (sectionAcc, section) => { 59950 if (!section.children.length) { 59951 return sectionAcc; 59952 } 59953 const sectionName = section.nodeName.toLowerCase().slice(1); 59954 const sectionAttributes = Array.from( 59955 section.children 59956 ).reduce((rowAcc, row) => { 59957 if (!row.children.length) { 59958 return rowAcc; 59959 } 59960 const rowAttributes = Array.from( 59961 row.children 59962 ).reduce((colAcc, col) => { 59963 const rowspan = normalizeRowColSpan( 59964 col.getAttribute("rowspan") 59965 ); 59966 const colspan = normalizeRowColSpan( 59967 col.getAttribute("colspan") 59968 ); 59969 const { textAlign } = col.style || {}; 59970 let align; 59971 if (textAlign === "left" || textAlign === "center" || textAlign === "right") { 59972 align = textAlign; 59973 } 59974 colAcc.push({ 59975 tag: col.nodeName.toLowerCase(), 59976 content: col.innerHTML, 59977 rowspan, 59978 colspan, 59979 align 59980 }); 59981 return colAcc; 59982 }, []); 59983 rowAcc.push({ 59984 cells: rowAttributes 59985 }); 59986 return rowAcc; 59987 }, []); 59988 sectionAcc[sectionName] = sectionAttributes; 59989 return sectionAcc; 59990 }, 59991 {} 59992 ); 59993 return (0, import_blocks107.createBlock)("core/table", attributes3); 59994 } 59995 } 59996 ] 59997 }; 59998 var transforms_default35 = transforms34; 59999 60000 // packages/block-library/build-module/table/index.js 60001 var { name: name103 } = block_default102; 60002 var settings102 = { 60003 icon: block_table_default, 60004 example: { 60005 attributes: { 60006 head: [ 60007 { 60008 cells: [ 60009 { 60010 content: (0, import_i18n229.__)("Version"), 60011 tag: "th" 60012 }, 60013 { 60014 content: (0, import_i18n229.__)("Jazz Musician"), 60015 tag: "th" 60016 }, 60017 { 60018 content: (0, import_i18n229.__)("Release Date"), 60019 tag: "th" 60020 } 60021 ] 60022 } 60023 ], 60024 body: [ 60025 { 60026 cells: [ 60027 { 60028 content: "5.2", 60029 tag: "td" 60030 }, 60031 { 60032 content: (0, import_i18n229.__)("Jaco Pastorius"), 60033 tag: "td" 60034 }, 60035 { 60036 content: (0, import_i18n229.__)("May 7, 2019"), 60037 tag: "td" 60038 } 60039 ] 60040 }, 60041 { 60042 cells: [ 60043 { 60044 content: "5.1", 60045 tag: "td" 60046 }, 60047 { 60048 content: (0, import_i18n229.__)("Betty Carter"), 60049 tag: "td" 60050 }, 60051 { 60052 content: (0, import_i18n229.__)("February 21, 2019"), 60053 tag: "td" 60054 } 60055 ] 60056 }, 60057 { 60058 cells: [ 60059 { 60060 content: "5.0", 60061 tag: "td" 60062 }, 60063 { 60064 content: (0, import_i18n229.__)("Bebo Vald\xE9s"), 60065 tag: "td" 60066 }, 60067 { 60068 content: (0, import_i18n229.__)("December 6, 2018"), 60069 tag: "td" 60070 } 60071 ] 60072 } 60073 ] 60074 }, 60075 viewportWidth: 450 60076 }, 60077 transforms: transforms_default35, 60078 edit: edit_default32, 60079 save: save48, 60080 deprecated: deprecated_default40 60081 }; 60082 var init102 = () => initBlock({ name: name103, metadata: block_default102, settings: settings102 }); 60083 60084 // packages/block-library/build-module/table-of-contents/index.js 60085 var table_of_contents_exports = {}; 60086 __export(table_of_contents_exports, { 60087 init: () => init103, 60088 metadata: () => block_default103, 60089 name: () => name104, 60090 settings: () => settings103 60091 }); 60092 var import_i18n231 = __toESM(require_i18n()); 60093 60094 // packages/block-library/build-module/table-of-contents/block.json 60095 var block_default103 = { 60096 $schema: "https://schemas.wp.org/trunk/block.json", 60097 apiVersion: 3, 60098 __experimental: true, 60099 name: "core/table-of-contents", 60100 title: "Table of Contents", 60101 category: "design", 60102 description: "Summarize your post with a list of headings. Add HTML anchors to Heading blocks to link them here.", 60103 keywords: ["document outline", "summary"], 60104 textdomain: "default", 60105 attributes: { 60106 headings: { 60107 type: "array", 60108 items: { 60109 type: "object" 60110 }, 60111 default: [] 60112 }, 60113 onlyIncludeCurrentPage: { 60114 type: "boolean", 60115 default: false 60116 }, 60117 maxLevel: { 60118 type: "number" 60119 }, 60120 ordered: { 60121 type: "boolean", 60122 default: true 60123 } 60124 }, 60125 supports: { 60126 ariaLabel: true, 60127 html: false, 60128 color: { 60129 text: true, 60130 background: true, 60131 gradients: true, 60132 link: true 60133 }, 60134 spacing: { 60135 margin: true, 60136 padding: true 60137 }, 60138 typography: { 60139 fontSize: true, 60140 lineHeight: true, 60141 __experimentalFontFamily: true, 60142 __experimentalFontWeight: true, 60143 __experimentalFontStyle: true, 60144 __experimentalTextTransform: true, 60145 __experimentalTextDecoration: true, 60146 __experimentalLetterSpacing: true, 60147 __experimentalDefaultControls: { 60148 fontSize: true 60149 } 60150 }, 60151 interactivity: { 60152 clientNavigation: true 60153 }, 60154 __experimentalBorder: { 60155 radius: true, 60156 color: true, 60157 width: true, 60158 style: true, 60159 __experimentalDefaultControls: { 60160 radius: true, 60161 color: true, 60162 width: true, 60163 style: true 60164 } 60165 } 60166 }, 60167 style: "wp-block-table-of-contents" 60168 }; 60169 60170 // packages/block-library/build-module/table-of-contents/edit.js 60171 var import_block_editor246 = __toESM(require_block_editor()); 60172 var import_blocks108 = __toESM(require_blocks()); 60173 var import_components149 = __toESM(require_components()); 60174 var import_data129 = __toESM(require_data()); 60175 var import_element120 = __toESM(require_element()); 60176 var import_i18n230 = __toESM(require_i18n()); 60177 var import_compose51 = __toESM(require_compose()); 60178 var import_notices16 = __toESM(require_notices()); 60179 60180 // packages/block-library/build-module/table-of-contents/list.js 60181 var import_jsx_runtime475 = __toESM(require_jsx_runtime()); 60182 var ENTRY_CLASS_NAME = "wp-block-table-of-contents__entry"; 60183 function TableOfContentsList({ 60184 nestedHeadingList, 60185 disableLinkActivation, 60186 onClick, 60187 ordered = true 60188 }) { 60189 return /* @__PURE__ */ (0, import_jsx_runtime475.jsx)(import_jsx_runtime475.Fragment, { children: nestedHeadingList.map((node, index) => { 60190 const { content, link } = node.heading; 60191 const entry = link ? /* @__PURE__ */ (0, import_jsx_runtime475.jsx)( 60192 "a", 60193 { 60194 className: ENTRY_CLASS_NAME, 60195 href: link, 60196 "aria-disabled": disableLinkActivation || void 0, 60197 onClick: disableLinkActivation && "function" === typeof onClick ? onClick : void 0, 60198 children: content 60199 } 60200 ) : /* @__PURE__ */ (0, import_jsx_runtime475.jsx)("span", { className: ENTRY_CLASS_NAME, children: content }); 60201 const NestedListTag = ordered ? "ol" : "ul"; 60202 return /* @__PURE__ */ (0, import_jsx_runtime475.jsxs)("li", { children: [ 60203 entry, 60204 node.children ? /* @__PURE__ */ (0, import_jsx_runtime475.jsx)(NestedListTag, { children: /* @__PURE__ */ (0, import_jsx_runtime475.jsx)( 60205 TableOfContentsList, 60206 { 60207 nestedHeadingList: node.children, 60208 disableLinkActivation, 60209 onClick: disableLinkActivation && "function" === typeof onClick ? onClick : void 0, 60210 ordered 60211 } 60212 ) }) : null 60213 ] }, index); 60214 }) }); 60215 } 60216 60217 // packages/block-library/build-module/table-of-contents/utils.js 60218 function linearToNestedHeadingList(headingList) { 60219 const nestedHeadingList = []; 60220 headingList.forEach((heading, key) => { 60221 if (heading.content === "") { 60222 return; 60223 } 60224 if (heading.level === headingList[0].level) { 60225 if (headingList[key + 1]?.level > heading.level) { 60226 let endOfSlice = headingList.length; 60227 for (let i2 = key + 1; i2 < headingList.length; i2++) { 60228 if (headingList[i2].level === heading.level) { 60229 endOfSlice = i2; 60230 break; 60231 } 60232 } 60233 nestedHeadingList.push({ 60234 heading, 60235 children: linearToNestedHeadingList( 60236 headingList.slice(key + 1, endOfSlice) 60237 ) 60238 }); 60239 } else { 60240 nestedHeadingList.push({ 60241 heading, 60242 children: null 60243 }); 60244 } 60245 } 60246 }); 60247 return nestedHeadingList; 60248 } 60249 60250 // packages/block-library/build-module/table-of-contents/hooks.js 60251 var import_es6 = __toESM(require_es6()); 60252 var import_data128 = __toESM(require_data()); 60253 var import_dom8 = __toESM(require_dom()); 60254 var import_element119 = __toESM(require_element()); 60255 var import_url19 = __toESM(require_url()); 60256 var import_block_editor245 = __toESM(require_block_editor()); 60257 function getLatestHeadings(select9, clientId) { 60258 const { 60259 getBlockAttributes: getBlockAttributes4, 60260 getBlockName, 60261 getBlocksByName, 60262 getClientIdsOfDescendants 60263 } = select9(import_block_editor245.store); 60264 const permalink = select9("core/editor").getPermalink() ?? null; 60265 const isPaginated = getBlocksByName("core/nextpage").length !== 0; 60266 const { onlyIncludeCurrentPage, maxLevel } = getBlockAttributes4(clientId) ?? {}; 60267 const [postContentClientId = ""] = getBlocksByName("core/post-content"); 60268 const allBlockClientIds = getClientIdsOfDescendants(postContentClientId); 60269 let tocPage = 1; 60270 if (isPaginated && onlyIncludeCurrentPage) { 60271 const tocIndex = allBlockClientIds.indexOf(clientId); 60272 for (const [ 60273 blockIndex, 60274 blockClientId 60275 ] of allBlockClientIds.entries()) { 60276 if (blockIndex >= tocIndex) { 60277 break; 60278 } 60279 if (getBlockName(blockClientId) === "core/nextpage") { 60280 tocPage++; 60281 } 60282 } 60283 } 60284 const latestHeadings = []; 60285 let headingPage = 1; 60286 let headingPageLink = null; 60287 if (typeof permalink === "string") { 60288 headingPageLink = isPaginated ? (0, import_url19.addQueryArgs)(permalink, { page: headingPage }) : permalink; 60289 } 60290 for (const blockClientId of allBlockClientIds) { 60291 const blockName = getBlockName(blockClientId); 60292 if (blockName === "core/nextpage") { 60293 headingPage++; 60294 if (onlyIncludeCurrentPage && headingPage > tocPage) { 60295 break; 60296 } 60297 if (typeof permalink === "string") { 60298 headingPageLink = (0, import_url19.addQueryArgs)( 60299 (0, import_url19.removeQueryArgs)(permalink, ["page"]), 60300 { page: headingPage } 60301 ); 60302 } 60303 } else if (!onlyIncludeCurrentPage || headingPage === tocPage) { 60304 if (blockName === "core/heading") { 60305 const headingAttributes = getBlockAttributes4(blockClientId); 60306 if (maxLevel && headingAttributes.level > maxLevel) { 60307 continue; 60308 } 60309 const canBeLinked = typeof headingPageLink === "string" && typeof headingAttributes.anchor === "string" && headingAttributes.anchor !== ""; 60310 latestHeadings.push({ 60311 // Convert line breaks to spaces, and get rid of HTML tags in the headings. 60312 content: (0, import_dom8.__unstableStripHTML)( 60313 headingAttributes.content.replace( 60314 /(<br *\/?>)+/g, 60315 " " 60316 ) 60317 ), 60318 level: headingAttributes.level, 60319 link: canBeLinked ? `$headingPageLink}#${headingAttributes.anchor}` : null 60320 }); 60321 } 60322 } 60323 } 60324 return latestHeadings; 60325 } 60326 function observeCallback(select9, dispatch, clientId) { 60327 const { getBlockAttributes: getBlockAttributes4 } = select9(import_block_editor245.store); 60328 const { updateBlockAttributes, __unstableMarkNextChangeAsNotPersistent } = dispatch(import_block_editor245.store); 60329 const attributes3 = getBlockAttributes4(clientId); 60330 if (attributes3 === null) { 60331 return; 60332 } 60333 const headings = getLatestHeadings(select9, clientId); 60334 if (!(0, import_es6.default)(headings, attributes3.headings)) { 60335 window.queueMicrotask(() => { 60336 __unstableMarkNextChangeAsNotPersistent(); 60337 updateBlockAttributes(clientId, { headings }); 60338 }); 60339 } 60340 } 60341 function useObserveHeadings(clientId) { 60342 const registry = (0, import_data128.useRegistry)(); 60343 (0, import_element119.useEffect)(() => { 60344 return registry.subscribe( 60345 () => observeCallback(registry.select, registry.dispatch, clientId) 60346 ); 60347 }, [registry, clientId]); 60348 } 60349 60350 // packages/block-library/build-module/table-of-contents/edit.js 60351 var import_jsx_runtime476 = __toESM(require_jsx_runtime()); 60352 function TableOfContentsEdit({ 60353 attributes: { 60354 headings = [], 60355 onlyIncludeCurrentPage, 60356 maxLevel, 60357 ordered = true 60358 }, 60359 clientId, 60360 setAttributes 60361 }) { 60362 useObserveHeadings(clientId); 60363 const blockProps = (0, import_block_editor246.useBlockProps)(); 60364 const instanceId = (0, import_compose51.useInstanceId)( 60365 TableOfContentsEdit, 60366 "table-of-contents" 60367 ); 60368 const { createWarningNotice } = (0, import_data129.useDispatch)(import_notices16.store); 60369 const showRedirectionPreventedNotice = (event) => { 60370 event.preventDefault(); 60371 createWarningNotice((0, import_i18n230.__)("Links are disabled in the editor."), { 60372 id: `block-library/core/table-of-contents/redirection-prevented/$instanceId}`, 60373 type: "snackbar" 60374 }); 60375 }; 60376 const canInsertList = (0, import_data129.useSelect)( 60377 (select9) => { 60378 const { getBlockRootClientId, canInsertBlockType } = select9(import_block_editor246.store); 60379 const rootClientId = getBlockRootClientId(clientId); 60380 return canInsertBlockType("core/list", rootClientId); 60381 }, 60382 [clientId] 60383 ); 60384 const { replaceBlocks } = (0, import_data129.useDispatch)(import_block_editor246.store); 60385 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 60386 const headingTree = linearToNestedHeadingList(headings); 60387 const toolbarControls = /* @__PURE__ */ (0, import_jsx_runtime476.jsxs)(import_block_editor246.BlockControls, { children: [ 60388 /* @__PURE__ */ (0, import_jsx_runtime476.jsxs)(import_components149.ToolbarGroup, { children: [ 60389 /* @__PURE__ */ (0, import_jsx_runtime476.jsx)( 60390 import_components149.ToolbarButton, 60391 { 60392 icon: (0, import_i18n230.isRTL)() ? format_list_bullets_rtl_default : format_list_bullets_default, 60393 title: (0, import_i18n230.__)("Unordered"), 60394 description: (0, import_i18n230.__)("Convert to unordered list"), 60395 onClick: () => setAttributes({ ordered: false }), 60396 isActive: ordered === false 60397 } 60398 ), 60399 /* @__PURE__ */ (0, import_jsx_runtime476.jsx)( 60400 import_components149.ToolbarButton, 60401 { 60402 icon: (0, import_i18n230.isRTL)() ? format_list_numbered_rtl_default : format_list_numbered_default, 60403 title: (0, import_i18n230.__)("Ordered"), 60404 description: (0, import_i18n230.__)("Convert to ordered list"), 60405 onClick: () => setAttributes({ ordered: true }), 60406 isActive: ordered === true 60407 } 60408 ) 60409 ] }), 60410 canInsertList && /* @__PURE__ */ (0, import_jsx_runtime476.jsx)(import_components149.ToolbarGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime476.jsx)( 60411 import_components149.ToolbarButton, 60412 { 60413 onClick: () => replaceBlocks( 60414 clientId, 60415 (0, import_blocks108.createBlock)("core/list", { 60416 ordered, 60417 values: (0, import_element120.renderToString)( 60418 /* @__PURE__ */ (0, import_jsx_runtime476.jsx)( 60419 TableOfContentsList, 60420 { 60421 nestedHeadingList: headingTree, 60422 ordered 60423 } 60424 ) 60425 ) 60426 }) 60427 ), 60428 children: (0, import_i18n230.__)("Convert to static list") 60429 } 60430 ) }) 60431 ] }); 60432 const inspectorControls = /* @__PURE__ */ (0, import_jsx_runtime476.jsx)(import_block_editor246.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime476.jsxs)( 60433 import_components149.__experimentalToolsPanel, 60434 { 60435 label: (0, import_i18n230.__)("Settings"), 60436 resetAll: () => { 60437 setAttributes({ 60438 onlyIncludeCurrentPage: false, 60439 maxLevel: void 0, 60440 ordered: true 60441 }); 60442 }, 60443 dropdownMenuProps, 60444 children: [ 60445 /* @__PURE__ */ (0, import_jsx_runtime476.jsx)( 60446 import_components149.__experimentalToolsPanelItem, 60447 { 60448 hasValue: () => !!onlyIncludeCurrentPage, 60449 label: (0, import_i18n230.__)("Only include current page"), 60450 onDeselect: () => setAttributes({ onlyIncludeCurrentPage: false }), 60451 isShownByDefault: true, 60452 children: /* @__PURE__ */ (0, import_jsx_runtime476.jsx)( 60453 import_components149.ToggleControl, 60454 { 60455 label: (0, import_i18n230.__)("Only include current page"), 60456 checked: onlyIncludeCurrentPage, 60457 onChange: (value) => setAttributes({ onlyIncludeCurrentPage: value }), 60458 help: onlyIncludeCurrentPage ? (0, import_i18n230.__)( 60459 "Only including headings from the current page (if the post is paginated)." 60460 ) : (0, import_i18n230.__)( 60461 "Include headings from all pages (if the post is paginated)." 60462 ) 60463 } 60464 ) 60465 } 60466 ), 60467 /* @__PURE__ */ (0, import_jsx_runtime476.jsx)( 60468 import_components149.__experimentalToolsPanelItem, 60469 { 60470 hasValue: () => !!maxLevel, 60471 label: (0, import_i18n230.__)("Limit heading levels"), 60472 onDeselect: () => setAttributes({ maxLevel: void 0 }), 60473 isShownByDefault: true, 60474 children: /* @__PURE__ */ (0, import_jsx_runtime476.jsx)( 60475 import_components149.SelectControl, 60476 { 60477 __next40pxDefaultSize: true, 60478 label: (0, import_i18n230.__)("Include headings down to level"), 60479 value: maxLevel || "", 60480 options: [ 60481 { value: "", label: (0, import_i18n230.__)("All levels") }, 60482 { value: "1", label: (0, import_i18n230.__)("Heading 1") }, 60483 { value: "2", label: (0, import_i18n230.__)("Heading 2") }, 60484 { value: "3", label: (0, import_i18n230.__)("Heading 3") }, 60485 { value: "4", label: (0, import_i18n230.__)("Heading 4") }, 60486 { value: "5", label: (0, import_i18n230.__)("Heading 5") }, 60487 { value: "6", label: (0, import_i18n230.__)("Heading 6") } 60488 ], 60489 onChange: (value) => setAttributes({ 60490 maxLevel: value ? parseInt(value) : void 0 60491 }), 60492 help: !maxLevel ? (0, import_i18n230.__)( 60493 "Including all heading levels in the table of contents." 60494 ) : (0, import_i18n230.__)( 60495 "Only include headings up to and including this level." 60496 ) 60497 } 60498 ) 60499 } 60500 ) 60501 ] 60502 } 60503 ) }); 60504 if (headings.length === 0) { 60505 return /* @__PURE__ */ (0, import_jsx_runtime476.jsxs)(import_jsx_runtime476.Fragment, { children: [ 60506 /* @__PURE__ */ (0, import_jsx_runtime476.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime476.jsx)( 60507 import_components149.Placeholder, 60508 { 60509 icon: /* @__PURE__ */ (0, import_jsx_runtime476.jsx)(import_block_editor246.BlockIcon, { icon: table_of_contents_default }), 60510 label: (0, import_i18n230.__)("Table of Contents"), 60511 instructions: (0, import_i18n230.__)( 60512 "Start adding Heading blocks to create a table of contents. Headings with HTML anchors will be linked here." 60513 ) 60514 } 60515 ) }), 60516 inspectorControls 60517 ] }); 60518 } 60519 const ListTag = ordered ? "ol" : "ul"; 60520 return /* @__PURE__ */ (0, import_jsx_runtime476.jsxs)(import_jsx_runtime476.Fragment, { children: [ 60521 /* @__PURE__ */ (0, import_jsx_runtime476.jsx)("nav", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime476.jsx)(ListTag, { children: /* @__PURE__ */ (0, import_jsx_runtime476.jsx)( 60522 TableOfContentsList, 60523 { 60524 nestedHeadingList: headingTree, 60525 disableLinkActivation: true, 60526 onClick: showRedirectionPreventedNotice, 60527 ordered 60528 } 60529 ) }) }), 60530 toolbarControls, 60531 inspectorControls 60532 ] }); 60533 } 60534 60535 // packages/block-library/build-module/table-of-contents/save.js 60536 var import_block_editor247 = __toESM(require_block_editor()); 60537 var import_jsx_runtime477 = __toESM(require_jsx_runtime()); 60538 function save49({ 60539 attributes: { headings = [], ordered = true } 60540 }) { 60541 if (headings.length === 0) { 60542 return null; 60543 } 60544 const ListTag = ordered ? "ol" : "ul"; 60545 return /* @__PURE__ */ (0, import_jsx_runtime477.jsx)("nav", { ...import_block_editor247.useBlockProps.save(), children: /* @__PURE__ */ (0, import_jsx_runtime477.jsx)(ListTag, { children: /* @__PURE__ */ (0, import_jsx_runtime477.jsx)( 60546 TableOfContentsList, 60547 { 60548 nestedHeadingList: linearToNestedHeadingList(headings), 60549 ordered 60550 } 60551 ) }) }); 60552 } 60553 60554 // packages/block-library/build-module/table-of-contents/index.js 60555 var { name: name104 } = block_default103; 60556 var settings103 = { 60557 icon: table_of_contents_default, 60558 edit: TableOfContentsEdit, 60559 save: save49, 60560 example: { 60561 innerBlocks: [ 60562 { 60563 name: "core/heading", 60564 attributes: { 60565 level: 2, 60566 content: (0, import_i18n231.__)("Heading") 60567 } 60568 }, 60569 { 60570 name: "core/heading", 60571 attributes: { 60572 level: 3, 60573 content: (0, import_i18n231.__)("Subheading") 60574 } 60575 }, 60576 { 60577 name: "core/heading", 60578 attributes: { 60579 level: 2, 60580 content: (0, import_i18n231.__)("Heading") 60581 } 60582 }, 60583 { 60584 name: "core/heading", 60585 attributes: { 60586 level: 3, 60587 content: (0, import_i18n231.__)("Subheading") 60588 } 60589 } 60590 ], 60591 attributes: { 60592 headings: [ 60593 { 60594 content: (0, import_i18n231.__)("Heading"), 60595 level: 2 60596 }, 60597 { 60598 content: (0, import_i18n231.__)("Subheading"), 60599 level: 3 60600 }, 60601 { 60602 content: (0, import_i18n231.__)("Heading"), 60603 level: 2 60604 }, 60605 { 60606 content: (0, import_i18n231.__)("Subheading"), 60607 level: 3 60608 } 60609 ] 60610 } 60611 } 60612 }; 60613 var init103 = () => initBlock({ name: name104, metadata: block_default103, settings: settings103 }); 60614 60615 // packages/block-library/build-module/tabs/index.js 60616 var tabs_exports = {}; 60617 __export(tabs_exports, { 60618 init: () => init104, 60619 metadata: () => block_default104, 60620 name: () => name105, 60621 settings: () => settings104 60622 }); 60623 60624 // packages/block-library/build-module/tabs/edit.js 60625 var import_block_editor250 = __toESM(require_block_editor()); 60626 60627 // packages/block-library/build-module/tabs/style-engine.js 60628 var import_block_editor248 = __toESM(require_block_editor()); 60629 function getGapStyles({ attributes: attributes3 }) { 60630 const { style: style2, orientation } = attributes3 || {}; 60631 const { spacing } = style2 || {}; 60632 const { blockGap } = spacing || {}; 60633 const fallbackValue = `var( --wp--style--tabs-gap-default, var( --wp--style--block-gap, 0.5em ) )`; 60634 let listGapValue = fallbackValue; 60635 let gapValue = fallbackValue; 60636 if (!!blockGap) { 60637 listGapValue = typeof blockGap === "string" ? (0, import_block_editor248.__experimentalGetGapCSSValue)(blockGap) : (0, import_block_editor248.__experimentalGetGapCSSValue)(blockGap?.left) || fallbackValue; 60638 gapValue = typeof blockGap === "string" ? (0, import_block_editor248.__experimentalGetGapCSSValue)(blockGap) : (0, import_block_editor248.__experimentalGetGapCSSValue)(blockGap?.top) || fallbackValue; 60639 } 60640 if (orientation === "vertical") { 60641 const _listGapValue = listGapValue; 60642 const _gapValue = gapValue; 60643 listGapValue = _gapValue; 60644 gapValue = _listGapValue; 60645 } 60646 const gapMap = { 60647 "--wp--style--unstable-tabs-list-gap": listGapValue === "0" ? "0px" : listGapValue, 60648 "--wp--style--unstable-tabs-gap": gapValue 60649 }; 60650 return gapMap; 60651 } 60652 function getColorStyles({ attributes: attributes3 }) { 60653 const { 60654 customTabInactiveColor, 60655 customTabHoverColor, 60656 customTabActiveColor, 60657 customTabTextColor, 60658 customTabActiveTextColor, 60659 customTabHoverTextColor 60660 } = attributes3 || {}; 60661 function getColorValue(color) { 60662 if (!color) { 60663 return null; 60664 } 60665 if (typeof color === "object" && color.slug) { 60666 return `var(--wp--preset--color--$color.slug})`; 60667 } 60668 return color; 60669 } 60670 const colorVarMap = { 60671 "--custom-tab-inactive-color": getColorValue(customTabInactiveColor), 60672 "--custom-tab-active-color": getColorValue(customTabActiveColor), 60673 "--custom-tab-hover-color": getColorValue(customTabHoverColor), 60674 "--custom-tab-text-color": getColorValue(customTabTextColor), 60675 "--custom-tab-active-text-color": getColorValue( 60676 customTabActiveTextColor 60677 ), 60678 "--custom-tab-hover-text-color": getColorValue( 60679 customTabHoverTextColor 60680 ) 60681 }; 60682 return colorVarMap; 60683 } 60684 function StyleEngine({ attributes: attributes3, clientId }) { 60685 const gapVarMap = getGapStyles({ attributes: attributes3 }); 60686 const colorVarMap = getColorStyles({ attributes: attributes3 }); 60687 const styleVarMap = { 60688 ...gapVarMap, 60689 ...colorVarMap 60690 }; 60691 const declarations = Object.entries(styleVarMap).filter(([, value]) => !!value).map(([name117, value]) => ` $name117}: $value};`).join("\n"); 60692 (0, import_block_editor248.useStyleOverride)({ 60693 css: clientId ? `#block-$clientId} { 60694 $declarations} 60695 }` : "" 60696 }); 60697 return null; 60698 } 60699 60700 // packages/block-library/build-module/tabs/controls.js 60701 var import_i18n232 = __toESM(require_i18n()); 60702 var import_components150 = __toESM(require_components()); 60703 var import_element121 = __toESM(require_element()); 60704 var import_block_editor249 = __toESM(require_block_editor()); 60705 var import_jsx_runtime478 = __toESM(require_jsx_runtime()); 60706 function ContrastCheckerMatrix({ attributes: attributes3 }) { 60707 const { 60708 className, 60709 fontSize, 60710 tabActiveColor, 60711 customTabActiveColor, 60712 tabActiveTextColor, 60713 customTabActiveTextColor, 60714 tabInactiveColor, 60715 customTabInactiveColor, 60716 tabTextColor, 60717 customTabTextColor, 60718 tabHoverColor, 60719 customTabHoverColor, 60720 tabHoverTextColor, 60721 customTabHoverTextColor 60722 } = attributes3; 60723 const activeBackground = (0, import_element121.useMemo)(() => { 60724 if (className?.includes("is-style-links")) { 60725 return "#fff"; 60726 } 60727 if (tabActiveColor?.color) { 60728 return tabActiveColor.color; 60729 } 60730 return customTabActiveColor; 60731 }, [tabActiveColor, customTabActiveColor, className]); 60732 const activeText = (0, import_element121.useMemo)(() => { 60733 if (tabActiveTextColor?.color) { 60734 return tabActiveTextColor.color; 60735 } 60736 return customTabActiveTextColor; 60737 }, [tabActiveTextColor, customTabActiveTextColor]); 60738 const inactiveBackground = (0, import_element121.useMemo)(() => { 60739 if (className?.includes("is-style-links")) { 60740 return "#fff"; 60741 } 60742 if (tabInactiveColor?.color) { 60743 return tabInactiveColor.color; 60744 } 60745 return customTabInactiveColor; 60746 }, [tabInactiveColor, customTabInactiveColor, className]); 60747 const inactiveText = (0, import_element121.useMemo)(() => { 60748 if (tabTextColor?.color) { 60749 return tabTextColor.color; 60750 } 60751 return customTabTextColor; 60752 }, [tabTextColor, customTabTextColor]); 60753 const hoverBackground = (0, import_element121.useMemo)(() => { 60754 if (tabHoverColor?.color) { 60755 return tabHoverColor.color; 60756 } 60757 return customTabHoverColor; 60758 }, [tabHoverColor, customTabHoverColor]); 60759 const hoverText = (0, import_element121.useMemo)(() => { 60760 if (tabHoverTextColor?.color) { 60761 return tabHoverTextColor.color; 60762 } 60763 return customTabHoverTextColor; 60764 }, [tabHoverTextColor, customTabHoverTextColor]); 60765 return /* @__PURE__ */ (0, import_jsx_runtime478.jsxs)(import_jsx_runtime478.Fragment, { children: [ 60766 /* @__PURE__ */ (0, import_jsx_runtime478.jsx)( 60767 import_block_editor249.ContrastChecker, 60768 { 60769 backgroundColor: activeBackground, 60770 fontSize, 60771 textColor: activeText 60772 } 60773 ), 60774 /* @__PURE__ */ (0, import_jsx_runtime478.jsx)( 60775 import_block_editor249.ContrastChecker, 60776 { 60777 backgroundColor: inactiveBackground, 60778 fontSize, 60779 textColor: inactiveText 60780 } 60781 ), 60782 /* @__PURE__ */ (0, import_jsx_runtime478.jsx)( 60783 import_block_editor249.ContrastChecker, 60784 { 60785 backgroundColor: hoverBackground, 60786 fontSize, 60787 textColor: hoverText 60788 } 60789 ) 60790 ] }); 60791 } 60792 function Controls4({ 60793 attributes: attributes3, 60794 setAttributes, 60795 clientId, 60796 tabInactiveColor, 60797 setTabInactiveColor, 60798 tabHoverColor, 60799 setTabHoverColor, 60800 tabActiveColor, 60801 setTabActiveColor, 60802 tabTextColor, 60803 setTabTextColor, 60804 tabActiveTextColor, 60805 setTabActiveTextColor, 60806 tabHoverTextColor, 60807 setTabHoverTextColor 60808 }) { 60809 const { 60810 customTabInactiveColor, 60811 customTabActiveColor, 60812 customTabHoverColor, 60813 customTabTextColor, 60814 customTabActiveTextColor, 60815 customTabHoverTextColor, 60816 orientation, 60817 metadata = { 60818 name: "" 60819 } 60820 } = attributes3; 60821 const colorSettings = (0, import_block_editor249.__experimentalUseMultipleOriginColorsAndGradients)(); 60822 return /* @__PURE__ */ (0, import_jsx_runtime478.jsxs)(import_jsx_runtime478.Fragment, { children: [ 60823 /* @__PURE__ */ (0, import_jsx_runtime478.jsx)( 60824 AddTabToolbarControl, 60825 { 60826 tabsClientId: clientId, 60827 attributes: attributes3 60828 } 60829 ), 60830 /* @__PURE__ */ (0, import_jsx_runtime478.jsx)(import_block_editor249.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime478.jsxs)(import_components150.PanelBody, { title: (0, import_i18n232.__)("Tabs Settings"), children: [ 60831 /* @__PURE__ */ (0, import_jsx_runtime478.jsx)( 60832 import_components150.ToggleControl, 60833 { 60834 label: (0, import_i18n232.__)("Vertical Tabs"), 60835 checked: "vertical" === orientation, 60836 onChange: () => setAttributes({ 60837 orientation: "vertical" === orientation ? "horizontal" : "vertical" 60838 }) 60839 } 60840 ), 60841 /* @__PURE__ */ (0, import_jsx_runtime478.jsx)( 60842 import_components150.TextControl, 60843 { 60844 label: (0, import_i18n232.__)("Tabs Title"), 60845 help: (0, import_i18n232.__)( 60846 "The tabs title is used by screen readers to describe the purpose and content of the tabs." 60847 ), 60848 value: metadata.name, 60849 placeholder: (0, import_i18n232.__)("Tab Contents"), 60850 onChange: (value) => { 60851 setAttributes({ 60852 metadata: { ...metadata, name: value } 60853 }); 60854 }, 60855 __next40pxDefaultSize: true 60856 } 60857 ) 60858 ] }) }), 60859 /* @__PURE__ */ (0, import_jsx_runtime478.jsxs)(import_block_editor249.InspectorControls, { group: "color", children: [ 60860 /* @__PURE__ */ (0, import_jsx_runtime478.jsx)( 60861 import_block_editor249.__experimentalColorGradientSettingsDropdown, 60862 { 60863 settings: [ 60864 { 60865 label: (0, import_i18n232.__)("Tab Active Background"), 60866 colorValue: tabActiveColor?.color ?? customTabActiveColor, 60867 onColorChange: (value) => { 60868 setTabActiveColor(value); 60869 setAttributes({ 60870 customTabActiveColor: value 60871 }); 60872 } 60873 }, 60874 { 60875 label: (0, import_i18n232.__)("Tab Active Text"), 60876 colorValue: tabActiveTextColor?.color ?? customTabActiveTextColor, 60877 onColorChange: (value) => { 60878 setTabActiveTextColor(value); 60879 setAttributes({ 60880 customTabActiveTextColor: value 60881 }); 60882 } 60883 }, 60884 { 60885 label: (0, import_i18n232.__)("Tab Inactive Background"), 60886 colorValue: tabInactiveColor?.color ?? customTabInactiveColor, 60887 onColorChange: (value) => { 60888 setTabInactiveColor(value); 60889 setAttributes({ 60890 customTabInactiveColor: value 60891 }); 60892 } 60893 }, 60894 { 60895 label: (0, import_i18n232.__)("Tab Inactive Text"), 60896 colorValue: tabTextColor?.color ?? customTabTextColor, 60897 onColorChange: (value) => { 60898 setTabTextColor(value); 60899 setAttributes({ 60900 customTabTextColor: value 60901 }); 60902 } 60903 }, 60904 { 60905 label: (0, import_i18n232.__)("Tab Hover Background"), 60906 colorValue: tabHoverColor?.color ?? customTabHoverColor, 60907 onColorChange: (value) => { 60908 setTabHoverColor(value); 60909 setAttributes({ 60910 customTabHoverColor: value 60911 }); 60912 } 60913 }, 60914 { 60915 label: (0, import_i18n232.__)("Tab Hover Text"), 60916 colorValue: tabHoverTextColor?.color ?? customTabHoverTextColor, 60917 onColorChange: (value) => { 60918 setTabHoverTextColor(value); 60919 setAttributes({ 60920 customTabHoverTextColor: value 60921 }); 60922 } 60923 } 60924 ], 60925 panelId: clientId, 60926 disableCustomColors: false, 60927 __experimentalIsRenderedInSidebar: true, 60928 __next40pxDefaultSize: true, 60929 ...colorSettings 60930 } 60931 ), 60932 /* @__PURE__ */ (0, import_jsx_runtime478.jsx)(ContrastCheckerMatrix, { attributes: attributes3 }) 60933 ] }) 60934 ] }); 60935 } 60936 60937 // packages/block-library/build-module/tabs/edit.js 60938 var import_jsx_runtime479 = __toESM(require_jsx_runtime()); 60939 var TABS_TEMPLATE = [["core/tab", {}]]; 60940 var DEFAULT_BLOCK7 = { 60941 name: "core/tab", 60942 attributesToCopy: ["className", "fontFamily", "fontSize"] 60943 }; 60944 function Edit19({ 60945 clientId, 60946 attributes: attributes3, 60947 setAttributes, 60948 tabInactiveColor, 60949 setTabInactiveColor, 60950 tabHoverColor, 60951 setTabHoverColor, 60952 tabActiveColor, 60953 setTabActiveColor, 60954 tabTextColor, 60955 setTabTextColor, 60956 tabActiveTextColor, 60957 setTabActiveTextColor, 60958 tabHoverTextColor, 60959 setTabHoverTextColor 60960 }) { 60961 const { style: style2, orientation } = attributes3; 60962 const blockProps = (0, import_block_editor250.useBlockProps)({ 60963 className: clsx_default( 60964 "vertical" === orientation ? "is-vertical" : "is-horizontal" 60965 ), 60966 style: { 60967 ...style2 60968 } 60969 }); 60970 const innerBlockProps = (0, import_block_editor250.useInnerBlocksProps)(blockProps, { 60971 defaultBlock: DEFAULT_BLOCK7, 60972 directInsert: true, 60973 __experimentalCaptureToolbars: true, 60974 clientId, 60975 orientation, 60976 template: TABS_TEMPLATE, 60977 renderAppender: false 60978 // Appender is rendered by individual tab blocks. 60979 }); 60980 return /* @__PURE__ */ (0, import_jsx_runtime479.jsx)(import_jsx_runtime479.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime479.jsxs)("div", { ...innerBlockProps, children: [ 60981 innerBlockProps.children, 60982 /* @__PURE__ */ (0, import_jsx_runtime479.jsx)(StyleEngine, { attributes: attributes3, clientId }), 60983 /* @__PURE__ */ (0, import_jsx_runtime479.jsx)( 60984 Controls4, 60985 { 60986 ...{ 60987 clientId, 60988 attributes: attributes3, 60989 setAttributes, 60990 tabInactiveColor, 60991 setTabInactiveColor, 60992 tabHoverColor, 60993 setTabHoverColor, 60994 tabActiveColor, 60995 setTabActiveColor, 60996 tabTextColor, 60997 setTabTextColor, 60998 tabActiveTextColor, 60999 setTabActiveTextColor, 61000 tabHoverTextColor, 61001 setTabHoverTextColor 61002 } 61003 } 61004 ) 61005 ] }) }); 61006 } 61007 var edit_default33 = (0, import_block_editor250.withColors)( 61008 "tabInactiveColor", 61009 "tabHoverColor", 61010 "tabActiveColor", 61011 "tabTextColor", 61012 "tabActiveTextColor", 61013 "tabHoverTextColor" 61014 )(Edit19); 61015 61016 // packages/block-library/build-module/tabs/save.js 61017 var import_block_editor251 = __toESM(require_block_editor()); 61018 var import_jsx_runtime480 = __toESM(require_jsx_runtime()); 61019 function Save2({ attributes: attributes3 }) { 61020 const blockProps = import_block_editor251.useBlockProps.save(); 61021 const innerBlocksProps = import_block_editor251.useInnerBlocksProps.save({}); 61022 const title = attributes3?.metadata?.name || "Tab Contents"; 61023 return /* @__PURE__ */ (0, import_jsx_runtime480.jsxs)("div", { ...blockProps, children: [ 61024 /* @__PURE__ */ (0, import_jsx_runtime480.jsx)("h3", { className: "tabs__title", children: title }), 61025 /* @__PURE__ */ (0, import_jsx_runtime480.jsx)("ul", { className: "tabs__list" }), 61026 innerBlocksProps.children 61027 ] }); 61028 } 61029 61030 // packages/block-library/build-module/tabs/icon.js 61031 var import_components151 = __toESM(require_components()); 61032 var import_jsx_runtime481 = __toESM(require_jsx_runtime()); 61033 var icon_default9 = /* @__PURE__ */ (0, import_jsx_runtime481.jsx)( 61034 import_components151.SVG, 61035 { 61036 width: "24", 61037 height: "24", 61038 viewBox: "0 0 24 24", 61039 xmlns: "http://www.w3.org/2000/svg", 61040 children: /* @__PURE__ */ (0, import_jsx_runtime481.jsx)( 61041 import_components151.Path, 61042 { 61043 fillRule: "evenodd", 61044 clipRule: "evenodd", 61045 d: "M5.2998 4.8501C4.60945 4.8501 4.0498 5.40974 4.0498 6.1001V10.3501H11.3498V6.1001C11.3498 5.40974 10.7902 4.8501 10.0998 4.8501H5.2998ZM14.2002 10.3501V7.1001H18.5002V10.3501H20.0002V6.8501C20.0002 6.15974 19.4406 5.6001 18.7502 5.6001H13.9502C13.2598 5.6001 12.7002 6.15974 12.7002 6.8501V10.3501H14.2002ZM20 12.6001H4V14.1001H20V12.6001ZM14 17.1001H4V18.6001H14V17.1001Z" 61046 } 61047 ) 61048 } 61049 ); 61050 61051 // packages/block-library/build-module/tabs/block.json 61052 var block_default104 = { 61053 $schema: "https://schemas.wp.org/trunk/block.json", 61054 __experimental: true, 61055 apiVersion: 3, 61056 name: "core/tabs", 61057 title: "Tabs", 61058 description: "Display content in a tabbed interface to help users navigate detailed content with ease.", 61059 version: "1.0.0", 61060 category: "design", 61061 textdomain: "default", 61062 allowedBlocks: ["core/tab"], 61063 attributes: { 61064 tabsId: { 61065 type: "string", 61066 default: "" 61067 }, 61068 orientation: { 61069 type: "string", 61070 default: "horizontal", 61071 enum: ["horizontal", "vertical"] 61072 }, 61073 activeTabIndex: { 61074 type: "number", 61075 default: 0 61076 }, 61077 tabInactiveColor: { 61078 type: "string" 61079 }, 61080 customTabInactiveColor: { 61081 type: "string" 61082 }, 61083 tabHoverColor: { 61084 type: "string" 61085 }, 61086 customTabHoverColor: { 61087 type: "string" 61088 }, 61089 tabActiveColor: { 61090 type: "string" 61091 }, 61092 customTabActiveColor: { 61093 type: "string" 61094 }, 61095 tabTextColor: { 61096 type: "string" 61097 }, 61098 customTabTextColor: { 61099 type: "string" 61100 }, 61101 tabActiveTextColor: { 61102 type: "string" 61103 }, 61104 customTabActiveTextColor: { 61105 type: "string" 61106 }, 61107 tabHoverTextColor: { 61108 type: "string" 61109 }, 61110 customTabHoverTextColor: { 61111 type: "string" 61112 } 61113 }, 61114 styles: [ 61115 { 61116 name: "tab", 61117 label: "Tabs", 61118 isDefault: true 61119 }, 61120 { 61121 name: "links", 61122 label: "Links" 61123 }, 61124 { 61125 name: "button", 61126 label: "Button" 61127 } 61128 ], 61129 supports: { 61130 align: true, 61131 color: { 61132 text: false, 61133 background: false 61134 }, 61135 html: false, 61136 interactivity: true, 61137 spacing: { 61138 blockGap: ["horizontal", "vertical"], 61139 margin: true, 61140 padding: false 61141 }, 61142 typography: { 61143 fontSize: true, 61144 __experimentalFontFamily: true 61145 } 61146 }, 61147 example: { 61148 attributes: { 61149 className: "is-example" 61150 }, 61151 innerBlocks: [ 61152 { 61153 name: "core/tab", 61154 attributes: { 61155 label: "Tab 1" 61156 }, 61157 innerBlocks: [ 61158 { 61159 name: "core/paragraph", 61160 attributes: { 61161 content: "Pariatur commodo sint mollit. Veniam Lorem labore voluptate fugiat. Ad nulla est labore cillum cillum qui nostrud do incididunt eiusmod. Aliqua aliqua sunt consequat consequat in duis deserunt." 61162 } 61163 }, 61164 { 61165 name: "core/paragraph", 61166 attributes: { 61167 content: "Adipisicing ullamco nisi in eu laborum adipisicing aliquip aliqua. Fugiat labore officia consequat nisi veniam velit commodo cillum enim duis quis ad." 61168 } 61169 } 61170 ] 61171 }, 61172 { 61173 name: "core/tab", 61174 attributes: { 61175 label: "Tab 2" 61176 } 61177 }, 61178 { 61179 name: "core/tab", 61180 attributes: { 61181 label: "Tab 3" 61182 } 61183 } 61184 ] 61185 }, 61186 providesContext: { 61187 "core/tabs-id": "tabsId" 61188 }, 61189 editorScript: "file:./index.js", 61190 editorStyle: "file:./index.css", 61191 style: "file:./style-index.css", 61192 viewScriptModule: "@wordpress/block-library/tabs/view" 61193 }; 61194 61195 // packages/block-library/build-module/tabs/index.js 61196 var { name: name105 } = block_default104; 61197 var settings104 = { 61198 icon: icon_default9, 61199 edit: edit_default33, 61200 save: Save2 61201 }; 61202 var init104 = () => initBlock({ name: name105, metadata: block_default104, settings: settings104 }); 61203 61204 // packages/block-library/build-module/tag-cloud/index.js 61205 var tag_cloud_exports = {}; 61206 __export(tag_cloud_exports, { 61207 init: () => init105, 61208 metadata: () => block_default105, 61209 name: () => name106, 61210 settings: () => settings105 61211 }); 61212 61213 // packages/block-library/build-module/tag-cloud/transforms.js 61214 var import_blocks109 = __toESM(require_blocks()); 61215 var transforms35 = { 61216 from: [ 61217 { 61218 type: "block", 61219 blocks: ["core/categories"], 61220 transform: () => (0, import_blocks109.createBlock)("core/tag-cloud") 61221 } 61222 ], 61223 to: [ 61224 { 61225 type: "block", 61226 blocks: ["core/categories"], 61227 transform: () => (0, import_blocks109.createBlock)("core/categories") 61228 } 61229 ] 61230 }; 61231 var transforms_default36 = transforms35; 61232 61233 // packages/block-library/build-module/tag-cloud/block.json 61234 var block_default105 = { 61235 $schema: "https://schemas.wp.org/trunk/block.json", 61236 apiVersion: 3, 61237 name: "core/tag-cloud", 61238 title: "Tag Cloud", 61239 category: "widgets", 61240 description: "A cloud of popular keywords, each sized by how often it appears.", 61241 textdomain: "default", 61242 attributes: { 61243 numberOfTags: { 61244 type: "number", 61245 default: 45, 61246 minimum: 1, 61247 maximum: 100 61248 }, 61249 taxonomy: { 61250 type: "string", 61251 default: "post_tag" 61252 }, 61253 showTagCounts: { 61254 type: "boolean", 61255 default: false 61256 }, 61257 smallestFontSize: { 61258 type: "string", 61259 default: "8pt" 61260 }, 61261 largestFontSize: { 61262 type: "string", 61263 default: "22pt" 61264 } 61265 }, 61266 styles: [ 61267 { name: "default", label: "Default", isDefault: true }, 61268 { name: "outline", label: "Outline" } 61269 ], 61270 supports: { 61271 html: false, 61272 align: true, 61273 spacing: { 61274 margin: true, 61275 padding: true 61276 }, 61277 typography: { 61278 lineHeight: true, 61279 __experimentalFontFamily: true, 61280 __experimentalFontWeight: true, 61281 __experimentalFontStyle: true, 61282 __experimentalTextTransform: true, 61283 __experimentalLetterSpacing: true 61284 }, 61285 interactivity: { 61286 clientNavigation: true 61287 }, 61288 __experimentalBorder: { 61289 radius: true, 61290 color: true, 61291 width: true, 61292 style: true, 61293 __experimentalDefaultControls: { 61294 radius: true, 61295 color: true, 61296 width: true, 61297 style: true 61298 } 61299 } 61300 }, 61301 editorStyle: "wp-block-tag-cloud-editor" 61302 }; 61303 61304 // packages/block-library/build-module/tag-cloud/edit.js 61305 var import_components152 = __toESM(require_components()); 61306 var import_data130 = __toESM(require_data()); 61307 var import_i18n233 = __toESM(require_i18n()); 61308 var import_block_editor252 = __toESM(require_block_editor()); 61309 var import_server_side_render6 = __toESM(require_server_side_render()); 61310 var import_core_data78 = __toESM(require_core_data()); 61311 var import_jsx_runtime482 = __toESM(require_jsx_runtime()); 61312 var MIN_TAGS = 1; 61313 var MAX_TAGS = 100; 61314 var MIN_FONT_SIZE = 0.1; 61315 var MAX_FONT_SIZE = 100; 61316 function TagCloudEdit({ attributes: attributes3, setAttributes }) { 61317 const { 61318 taxonomy, 61319 showTagCounts, 61320 numberOfTags, 61321 smallestFontSize, 61322 largestFontSize 61323 } = attributes3; 61324 const [availableUnits] = (0, import_block_editor252.useSettings)("spacing.units"); 61325 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 61326 const units = (0, import_components152.__experimentalUseCustomUnits)({ 61327 availableUnits: availableUnits ? [...availableUnits, "pt"] : ["%", "px", "em", "rem", "pt"] 61328 }); 61329 const taxonomies = (0, import_data130.useSelect)( 61330 (select9) => select9(import_core_data78.store).getTaxonomies({ per_page: -1 }), 61331 [] 61332 ); 61333 const getTaxonomyOptions = () => { 61334 const selectOption = { 61335 label: (0, import_i18n233.__)("- Select -"), 61336 value: "", 61337 disabled: true 61338 }; 61339 const taxonomyOptions = (taxonomies ?? []).filter((tax) => !!tax.show_cloud).map((item) => { 61340 return { 61341 value: item.slug, 61342 label: item.name 61343 }; 61344 }); 61345 return [selectOption, ...taxonomyOptions]; 61346 }; 61347 const onFontSizeChange = (fontSizeLabel, newValue) => { 61348 const [quantity, newUnit] = (0, import_components152.__experimentalParseQuantityAndUnitFromRawValue)(newValue); 61349 if (!Number.isFinite(quantity)) { 61350 return; 61351 } 61352 const updateObj = { [fontSizeLabel]: newValue }; 61353 Object.entries({ 61354 smallestFontSize, 61355 largestFontSize 61356 }).forEach(([attribute, currentValue]) => { 61357 const [currentQuantity, currentUnit] = (0, import_components152.__experimentalParseQuantityAndUnitFromRawValue)(currentValue); 61358 if (attribute !== fontSizeLabel && currentUnit !== newUnit) { 61359 updateObj[attribute] = `$currentQuantity}$newUnit}`; 61360 } 61361 }); 61362 setAttributes(updateObj); 61363 }; 61364 const serverSideAttributes = { 61365 ...attributes3, 61366 style: { 61367 ...attributes3?.style, 61368 border: void 0 61369 } 61370 }; 61371 const inspectorControls = /* @__PURE__ */ (0, import_jsx_runtime482.jsx)(import_block_editor252.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime482.jsxs)( 61372 import_components152.__experimentalToolsPanel, 61373 { 61374 label: (0, import_i18n233.__)("Settings"), 61375 resetAll: () => { 61376 setAttributes({ 61377 taxonomy: "post_tag", 61378 showTagCounts: false, 61379 numberOfTags: 45, 61380 smallestFontSize: "8pt", 61381 largestFontSize: "22pt" 61382 }); 61383 }, 61384 dropdownMenuProps, 61385 children: [ 61386 /* @__PURE__ */ (0, import_jsx_runtime482.jsx)( 61387 import_components152.__experimentalToolsPanelItem, 61388 { 61389 hasValue: () => taxonomy !== "post_tag", 61390 label: (0, import_i18n233.__)("Taxonomy"), 61391 onDeselect: () => setAttributes({ taxonomy: "post_tag" }), 61392 isShownByDefault: true, 61393 children: /* @__PURE__ */ (0, import_jsx_runtime482.jsx)( 61394 import_components152.SelectControl, 61395 { 61396 __next40pxDefaultSize: true, 61397 label: (0, import_i18n233.__)("Taxonomy"), 61398 options: getTaxonomyOptions(), 61399 value: taxonomy, 61400 onChange: (selectedTaxonomy) => setAttributes({ taxonomy: selectedTaxonomy }) 61401 } 61402 ) 61403 } 61404 ), 61405 /* @__PURE__ */ (0, import_jsx_runtime482.jsx)( 61406 import_components152.__experimentalToolsPanelItem, 61407 { 61408 hasValue: () => smallestFontSize !== "8pt" || largestFontSize !== "22pt", 61409 label: (0, import_i18n233.__)("Font size"), 61410 onDeselect: () => setAttributes({ 61411 smallestFontSize: "8pt", 61412 largestFontSize: "22pt" 61413 }), 61414 isShownByDefault: true, 61415 children: /* @__PURE__ */ (0, import_jsx_runtime482.jsxs)(import_components152.Flex, { gap: 4, children: [ 61416 /* @__PURE__ */ (0, import_jsx_runtime482.jsx)(import_components152.FlexItem, { isBlock: true, children: /* @__PURE__ */ (0, import_jsx_runtime482.jsx)( 61417 import_components152.__experimentalUnitControl, 61418 { 61419 label: (0, import_i18n233.__)("Smallest size"), 61420 value: smallestFontSize, 61421 onChange: (value) => { 61422 onFontSizeChange( 61423 "smallestFontSize", 61424 value 61425 ); 61426 }, 61427 units, 61428 min: MIN_FONT_SIZE, 61429 max: MAX_FONT_SIZE, 61430 size: "__unstable-large" 61431 } 61432 ) }), 61433 /* @__PURE__ */ (0, import_jsx_runtime482.jsx)(import_components152.FlexItem, { isBlock: true, children: /* @__PURE__ */ (0, import_jsx_runtime482.jsx)( 61434 import_components152.__experimentalUnitControl, 61435 { 61436 label: (0, import_i18n233.__)("Largest size"), 61437 value: largestFontSize, 61438 onChange: (value) => { 61439 onFontSizeChange( 61440 "largestFontSize", 61441 value 61442 ); 61443 }, 61444 units, 61445 min: MIN_FONT_SIZE, 61446 max: MAX_FONT_SIZE, 61447 size: "__unstable-large" 61448 } 61449 ) }) 61450 ] }) 61451 } 61452 ), 61453 /* @__PURE__ */ (0, import_jsx_runtime482.jsx)( 61454 import_components152.__experimentalToolsPanelItem, 61455 { 61456 hasValue: () => numberOfTags !== 45, 61457 label: (0, import_i18n233.__)("Number of tags"), 61458 onDeselect: () => setAttributes({ numberOfTags: 45 }), 61459 isShownByDefault: true, 61460 children: /* @__PURE__ */ (0, import_jsx_runtime482.jsx)( 61461 import_components152.RangeControl, 61462 { 61463 __next40pxDefaultSize: true, 61464 label: (0, import_i18n233.__)("Number of tags"), 61465 value: numberOfTags, 61466 onChange: (value) => setAttributes({ numberOfTags: value }), 61467 min: MIN_TAGS, 61468 max: MAX_TAGS, 61469 required: true 61470 } 61471 ) 61472 } 61473 ), 61474 /* @__PURE__ */ (0, import_jsx_runtime482.jsx)( 61475 import_components152.__experimentalToolsPanelItem, 61476 { 61477 hasValue: () => showTagCounts !== false, 61478 label: (0, import_i18n233.__)("Show tag counts"), 61479 onDeselect: () => setAttributes({ showTagCounts: false }), 61480 isShownByDefault: true, 61481 children: /* @__PURE__ */ (0, import_jsx_runtime482.jsx)( 61482 import_components152.ToggleControl, 61483 { 61484 label: (0, import_i18n233.__)("Show tag counts"), 61485 checked: showTagCounts, 61486 onChange: () => setAttributes({ showTagCounts: !showTagCounts }) 61487 } 61488 ) 61489 } 61490 ) 61491 ] 61492 } 61493 ) }); 61494 return /* @__PURE__ */ (0, import_jsx_runtime482.jsxs)(import_jsx_runtime482.Fragment, { children: [ 61495 inspectorControls, 61496 /* @__PURE__ */ (0, import_jsx_runtime482.jsx)("div", { ...(0, import_block_editor252.useBlockProps)(), children: /* @__PURE__ */ (0, import_jsx_runtime482.jsx)(import_components152.Disabled, { children: /* @__PURE__ */ (0, import_jsx_runtime482.jsx)( 61497 import_server_side_render6.default, 61498 { 61499 skipBlockSupportAttributes: true, 61500 block: "core/tag-cloud", 61501 attributes: serverSideAttributes 61502 } 61503 ) }) }) 61504 ] }); 61505 } 61506 var edit_default34 = TagCloudEdit; 61507 61508 // packages/block-library/build-module/tag-cloud/index.js 61509 var { name: name106 } = block_default105; 61510 var settings105 = { 61511 icon: tag_default, 61512 example: {}, 61513 edit: edit_default34, 61514 transforms: transforms_default36 61515 }; 61516 var init105 = () => initBlock({ name: name106, metadata: block_default105, settings: settings105 }); 61517 61518 // packages/block-library/build-module/template-part/index.js 61519 var template_part_exports = {}; 61520 __export(template_part_exports, { 61521 init: () => init106, 61522 metadata: () => block_default106, 61523 name: () => name107, 61524 settings: () => settings106 61525 }); 61526 var import_core_data86 = __toESM(require_core_data()); 61527 var import_data139 = __toESM(require_data()); 61528 var import_hooks78 = __toESM(require_hooks()); 61529 var import_html_entities16 = __toESM(require_html_entities()); 61530 61531 // packages/block-library/build-module/template-part/block.json 61532 var block_default106 = { 61533 $schema: "https://schemas.wp.org/trunk/block.json", 61534 apiVersion: 3, 61535 name: "core/template-part", 61536 title: "Template Part", 61537 category: "theme", 61538 description: "Edit the different global regions of your site, like the header, footer, sidebar, or create your own.", 61539 textdomain: "default", 61540 attributes: { 61541 slug: { 61542 type: "string" 61543 }, 61544 theme: { 61545 type: "string" 61546 }, 61547 tagName: { 61548 type: "string" 61549 }, 61550 area: { 61551 type: "string" 61552 } 61553 }, 61554 supports: { 61555 align: true, 61556 html: false, 61557 reusable: false, 61558 renaming: false, 61559 interactivity: { 61560 clientNavigation: true 61561 } 61562 }, 61563 editorStyle: "wp-block-template-part-editor" 61564 }; 61565 61566 // packages/block-library/build-module/template-part/edit/index.js 61567 var import_blocks114 = __toESM(require_blocks()); 61568 var import_data137 = __toESM(require_data()); 61569 var import_block_editor257 = __toESM(require_block_editor()); 61570 var import_components158 = __toESM(require_components()); 61571 var import_i18n240 = __toESM(require_i18n()); 61572 var import_core_data84 = __toESM(require_core_data()); 61573 var import_element128 = __toESM(require_element()); 61574 var import_notices19 = __toESM(require_notices()); 61575 61576 // packages/block-library/build-module/template-part/edit/placeholder.js 61577 var import_i18n236 = __toESM(require_i18n()); 61578 var import_components154 = __toESM(require_components()); 61579 var import_element124 = __toESM(require_element()); 61580 var import_data132 = __toESM(require_data()); 61581 var import_core_data80 = __toESM(require_core_data()); 61582 61583 // packages/block-library/build-module/template-part/edit/utils/hooks.js 61584 var import_data131 = __toESM(require_data()); 61585 var import_core_data79 = __toESM(require_core_data()); 61586 var import_block_editor253 = __toESM(require_block_editor()); 61587 var import_element122 = __toESM(require_element()); 61588 var import_blocks110 = __toESM(require_blocks()); 61589 var import_i18n234 = __toESM(require_i18n()); 61590 function useAlternativeTemplateParts(area, excludedId) { 61591 const { templateParts, isResolving } = (0, import_data131.useSelect)((select9) => { 61592 const { getEntityRecords, isResolving: _isResolving } = select9(import_core_data79.store); 61593 const query = { per_page: -1 }; 61594 return { 61595 templateParts: getEntityRecords( 61596 "postType", 61597 "wp_template_part", 61598 query 61599 ), 61600 isResolving: _isResolving("getEntityRecords", [ 61601 "postType", 61602 "wp_template_part", 61603 query 61604 ]) 61605 }; 61606 }, []); 61607 const filteredTemplateParts = (0, import_element122.useMemo)(() => { 61608 if (!templateParts) { 61609 return []; 61610 } 61611 return templateParts.filter( 61612 (templatePart) => createTemplatePartId( 61613 templatePart.theme, 61614 templatePart.slug 61615 ) !== excludedId && (!area || "uncategorized" === area || templatePart.area === area) 61616 ) || []; 61617 }, [templateParts, area, excludedId]); 61618 return { 61619 templateParts: filteredTemplateParts, 61620 isResolving 61621 }; 61622 } 61623 function useAlternativeBlockPatterns(area, clientId) { 61624 return (0, import_data131.useSelect)( 61625 (select9) => { 61626 const blockNameWithArea = area ? `core/template-part/$area}` : "core/template-part"; 61627 const { getBlockRootClientId, getPatternsByBlockTypes } = select9(import_block_editor253.store); 61628 const rootClientId = getBlockRootClientId(clientId); 61629 return getPatternsByBlockTypes(blockNameWithArea, rootClientId); 61630 }, 61631 [area, clientId] 61632 ); 61633 } 61634 function useCreateTemplatePartFromBlocks(area, setAttributes) { 61635 const { saveEntityRecord } = (0, import_data131.useDispatch)(import_core_data79.store); 61636 return async (blocks = [], title = (0, import_i18n234.__)("Untitled Template Part")) => { 61637 const cleanSlug = paramCase(title).replace(/[^\w-]+/g, "") || "wp-custom-part"; 61638 const record = { 61639 title, 61640 slug: cleanSlug, 61641 content: (0, import_blocks110.serialize)(blocks), 61642 // `area` is filterable on the server and defaults to `UNCATEGORIZED` 61643 // if provided value is not allowed. 61644 area 61645 }; 61646 const templatePart = await saveEntityRecord( 61647 "postType", 61648 "wp_template_part", 61649 record 61650 ); 61651 setAttributes({ 61652 slug: templatePart.slug, 61653 theme: templatePart.theme, 61654 area: void 0 61655 }); 61656 }; 61657 } 61658 function useTemplatePartArea(area) { 61659 return (0, import_data131.useSelect)( 61660 (select9) => { 61661 const definedAreas = select9(import_core_data79.store).getCurrentTheme()?.default_template_part_areas || []; 61662 const selectedArea = definedAreas.find( 61663 (definedArea) => definedArea.area === area 61664 ); 61665 const defaultArea = definedAreas.find( 61666 (definedArea) => definedArea.area === "uncategorized" 61667 ); 61668 return { 61669 icon: selectedArea?.icon || defaultArea?.icon, 61670 label: selectedArea?.label || (0, import_i18n234.__)("Template Part"), 61671 tagName: selectedArea?.area_tag ?? "div" 61672 }; 61673 }, 61674 [area] 61675 ); 61676 } 61677 61678 // packages/block-library/build-module/template-part/edit/title-modal.js 61679 var import_element123 = __toESM(require_element()); 61680 var import_i18n235 = __toESM(require_i18n()); 61681 var import_components153 = __toESM(require_components()); 61682 var import_jsx_runtime483 = __toESM(require_jsx_runtime()); 61683 function TitleModal({ areaLabel, onClose, onSubmit }) { 61684 const [title, setTitle] = (0, import_element123.useState)(""); 61685 const submitForCreation = (event) => { 61686 event.preventDefault(); 61687 onSubmit(title); 61688 }; 61689 return /* @__PURE__ */ (0, import_jsx_runtime483.jsx)( 61690 import_components153.Modal, 61691 { 61692 title: (0, import_i18n235.sprintf)( 61693 // Translators: %s as template part area title ("Header", "Footer", etc.). 61694 (0, import_i18n235.__)("Create new %s"), 61695 areaLabel.toLowerCase() 61696 ), 61697 onRequestClose: onClose, 61698 focusOnMount: "firstContentElement", 61699 size: "small", 61700 children: /* @__PURE__ */ (0, import_jsx_runtime483.jsx)("form", { onSubmit: submitForCreation, children: /* @__PURE__ */ (0, import_jsx_runtime483.jsxs)(import_components153.__experimentalVStack, { spacing: "5", children: [ 61701 /* @__PURE__ */ (0, import_jsx_runtime483.jsx)( 61702 import_components153.TextControl, 61703 { 61704 label: (0, import_i18n235.__)("Name"), 61705 value: title, 61706 onChange: setTitle, 61707 placeholder: (0, import_i18n235.__)("Custom Template Part"), 61708 __next40pxDefaultSize: true 61709 } 61710 ), 61711 /* @__PURE__ */ (0, import_jsx_runtime483.jsxs)(import_components153.__experimentalHStack, { justify: "right", children: [ 61712 /* @__PURE__ */ (0, import_jsx_runtime483.jsx)( 61713 import_components153.Button, 61714 { 61715 __next40pxDefaultSize: true, 61716 variant: "tertiary", 61717 onClick: () => { 61718 onClose(); 61719 setTitle(""); 61720 }, 61721 children: (0, import_i18n235.__)("Cancel") 61722 } 61723 ), 61724 /* @__PURE__ */ (0, import_jsx_runtime483.jsx)( 61725 import_components153.Button, 61726 { 61727 variant: "primary", 61728 type: "submit", 61729 accessibleWhenDisabled: true, 61730 disabled: !title.length, 61731 __next40pxDefaultSize: true, 61732 children: (0, import_i18n235.__)("Create") 61733 } 61734 ) 61735 ] }) 61736 ] }) }) 61737 } 61738 ); 61739 } 61740 61741 // packages/block-library/build-module/template-part/edit/placeholder.js 61742 var import_jsx_runtime484 = __toESM(require_jsx_runtime()); 61743 function TemplatePartPlaceholder({ 61744 area, 61745 clientId, 61746 templatePartId, 61747 onOpenSelectionModal, 61748 setAttributes 61749 }) { 61750 const { templateParts, isResolving } = useAlternativeTemplateParts( 61751 area, 61752 templatePartId 61753 ); 61754 const blockPatterns = useAlternativeBlockPatterns(area, clientId); 61755 const { isBlockBasedTheme, canCreateTemplatePart } = (0, import_data132.useSelect)( 61756 (select9) => { 61757 const { getCurrentTheme, canUser } = select9(import_core_data80.store); 61758 return { 61759 isBlockBasedTheme: getCurrentTheme()?.is_block_theme, 61760 canCreateTemplatePart: canUser("create", { 61761 kind: "postType", 61762 name: "wp_template_part" 61763 }) 61764 }; 61765 }, 61766 [] 61767 ); 61768 const [showTitleModal, setShowTitleModal] = (0, import_element124.useState)(false); 61769 const areaObject = useTemplatePartArea(area); 61770 const createFromBlocks = useCreateTemplatePartFromBlocks( 61771 area, 61772 setAttributes 61773 ); 61774 return /* @__PURE__ */ (0, import_jsx_runtime484.jsxs)( 61775 import_components154.Placeholder, 61776 { 61777 icon: getTemplatePartIcon(areaObject.icon), 61778 label: areaObject.label, 61779 instructions: isBlockBasedTheme ? (0, import_i18n236.sprintf)( 61780 // Translators: %s as template part area title ("Header", "Footer", etc.). 61781 (0, import_i18n236.__)("Choose an existing %s or create a new one."), 61782 areaObject.label.toLowerCase() 61783 ) : (0, import_i18n236.sprintf)( 61784 // Translators: %s as template part area title ("Header", "Footer", etc.). 61785 (0, import_i18n236.__)("Choose an existing %s."), 61786 areaObject.label.toLowerCase() 61787 ), 61788 children: [ 61789 isResolving && /* @__PURE__ */ (0, import_jsx_runtime484.jsx)(import_components154.Spinner, {}), 61790 !isResolving && !!(templateParts.length || blockPatterns.length) && /* @__PURE__ */ (0, import_jsx_runtime484.jsx)( 61791 import_components154.Button, 61792 { 61793 __next40pxDefaultSize: true, 61794 variant: "primary", 61795 onClick: onOpenSelectionModal, 61796 children: (0, import_i18n236.__)("Choose") 61797 } 61798 ), 61799 !isResolving && isBlockBasedTheme && canCreateTemplatePart && /* @__PURE__ */ (0, import_jsx_runtime484.jsx)( 61800 import_components154.Button, 61801 { 61802 __next40pxDefaultSize: true, 61803 variant: "secondary", 61804 onClick: () => { 61805 setShowTitleModal(true); 61806 }, 61807 children: (0, import_i18n236.__)("Start blank") 61808 } 61809 ), 61810 showTitleModal && /* @__PURE__ */ (0, import_jsx_runtime484.jsx)( 61811 TitleModal, 61812 { 61813 areaLabel: areaObject.label, 61814 onClose: () => setShowTitleModal(false), 61815 onSubmit: (title) => { 61816 createFromBlocks([], title); 61817 } 61818 } 61819 ) 61820 ] 61821 } 61822 ); 61823 } 61824 61825 // packages/block-library/build-module/template-part/edit/selection-modal.js 61826 var import_element125 = __toESM(require_element()); 61827 var import_i18n237 = __toESM(require_i18n()); 61828 var import_notices17 = __toESM(require_notices()); 61829 var import_data133 = __toESM(require_data()); 61830 var import_block_editor254 = __toESM(require_block_editor()); 61831 var import_components155 = __toESM(require_components()); 61832 61833 // packages/block-library/build-module/template-part/edit/utils/map-template-part-to-block-pattern.js 61834 var import_blocks111 = __toESM(require_blocks()); 61835 function mapTemplatePartToBlockPattern(templatePart) { 61836 return { 61837 name: createTemplatePartId(templatePart.theme, templatePart.slug), 61838 title: templatePart.title.rendered, 61839 blocks: (0, import_blocks111.parse)(templatePart.content.raw), 61840 templatePart 61841 }; 61842 } 61843 61844 // packages/block-library/build-module/template-part/edit/selection-modal.js 61845 var import_jsx_runtime485 = __toESM(require_jsx_runtime()); 61846 function TemplatePartSelectionModal({ 61847 setAttributes, 61848 onClose, 61849 templatePartId = null, 61850 area, 61851 clientId 61852 }) { 61853 const [searchValue, setSearchValue] = (0, import_element125.useState)(""); 61854 const { templateParts } = useAlternativeTemplateParts( 61855 area, 61856 templatePartId 61857 ); 61858 const filteredTemplateParts = (0, import_element125.useMemo)(() => { 61859 const partsAsPatterns = templateParts.map( 61860 (templatePart) => mapTemplatePartToBlockPattern(templatePart) 61861 ); 61862 return searchPatterns(partsAsPatterns, searchValue); 61863 }, [templateParts, searchValue]); 61864 const blockPatterns = useAlternativeBlockPatterns(area, clientId); 61865 const filteredBlockPatterns = (0, import_element125.useMemo)(() => { 61866 return searchPatterns(blockPatterns, searchValue); 61867 }, [blockPatterns, searchValue]); 61868 const { createSuccessNotice } = (0, import_data133.useDispatch)(import_notices17.store); 61869 const onTemplatePartSelect = (templatePart) => { 61870 setAttributes({ 61871 slug: templatePart.slug, 61872 theme: templatePart.theme, 61873 area: void 0 61874 }); 61875 createSuccessNotice( 61876 (0, import_i18n237.sprintf)( 61877 /* translators: %s: template part title. */ 61878 (0, import_i18n237.__)('Template Part "%s" inserted.'), 61879 templatePart.title?.rendered || templatePart.slug 61880 ), 61881 { 61882 type: "snackbar" 61883 } 61884 ); 61885 onClose(); 61886 }; 61887 const hasTemplateParts = !!filteredTemplateParts.length; 61888 const hasBlockPatterns = !!filteredBlockPatterns.length; 61889 return /* @__PURE__ */ (0, import_jsx_runtime485.jsxs)("div", { className: "block-library-template-part__selection-content", children: [ 61890 /* @__PURE__ */ (0, import_jsx_runtime485.jsx)("div", { className: "block-library-template-part__selection-search", children: /* @__PURE__ */ (0, import_jsx_runtime485.jsx)( 61891 import_components155.SearchControl, 61892 { 61893 onChange: setSearchValue, 61894 value: searchValue, 61895 label: (0, import_i18n237.__)("Search"), 61896 placeholder: (0, import_i18n237.__)("Search") 61897 } 61898 ) }), 61899 hasTemplateParts && /* @__PURE__ */ (0, import_jsx_runtime485.jsxs)("div", { children: [ 61900 /* @__PURE__ */ (0, import_jsx_runtime485.jsx)("h2", { children: (0, import_i18n237.__)("Existing template parts") }), 61901 /* @__PURE__ */ (0, import_jsx_runtime485.jsx)( 61902 import_block_editor254.__experimentalBlockPatternsList, 61903 { 61904 blockPatterns: filteredTemplateParts, 61905 onClickPattern: (pattern) => { 61906 onTemplatePartSelect(pattern.templatePart); 61907 } 61908 } 61909 ) 61910 ] }), 61911 !hasTemplateParts && !hasBlockPatterns && /* @__PURE__ */ (0, import_jsx_runtime485.jsx)(import_components155.__experimentalHStack, { alignment: "center", children: /* @__PURE__ */ (0, import_jsx_runtime485.jsx)("p", { children: (0, import_i18n237.__)("No results found.") }) }) 61912 ] }); 61913 } 61914 61915 // packages/block-library/build-module/template-part/edit/advanced-controls.js 61916 var import_core_data82 = __toESM(require_core_data()); 61917 var import_components157 = __toESM(require_components()); 61918 var import_i18n239 = __toESM(require_i18n()); 61919 var import_data135 = __toESM(require_data()); 61920 var import_block_editor255 = __toESM(require_block_editor()); 61921 61922 // packages/block-library/build-module/template-part/edit/import-controls.js 61923 var import_i18n238 = __toESM(require_i18n()); 61924 var import_element126 = __toESM(require_element()); 61925 var import_data134 = __toESM(require_data()); 61926 var import_components156 = __toESM(require_components()); 61927 var import_core_data81 = __toESM(require_core_data()); 61928 var import_notices18 = __toESM(require_notices()); 61929 61930 // packages/block-library/build-module/template-part/edit/utils/transformers.js 61931 var import_blocks112 = __toESM(require_blocks()); 61932 function transformWidgetToBlock(widget) { 61933 if (widget.id_base !== "block") { 61934 let attributes3; 61935 if (widget._embedded.about[0].is_multi) { 61936 attributes3 = { 61937 idBase: widget.id_base, 61938 instance: widget.instance 61939 }; 61940 } else { 61941 attributes3 = { 61942 id: widget.id 61943 }; 61944 } 61945 return switchLegacyWidgetType( 61946 (0, import_blocks112.createBlock)("core/legacy-widget", attributes3) 61947 ); 61948 } 61949 const parsedBlocks = (0, import_blocks112.parse)(widget.instance.raw.content, { 61950 __unstableSkipAutop: true 61951 }); 61952 if (!parsedBlocks.length) { 61953 return void 0; 61954 } 61955 const block = parsedBlocks[0]; 61956 if (block.name === "core/widget-group") { 61957 return (0, import_blocks112.createBlock)( 61958 (0, import_blocks112.getGroupingBlockName)(), 61959 void 0, 61960 transformInnerBlocks(block.innerBlocks) 61961 ); 61962 } 61963 if (block.innerBlocks.length > 0) { 61964 return (0, import_blocks112.cloneBlock)( 61965 block, 61966 void 0, 61967 transformInnerBlocks(block.innerBlocks) 61968 ); 61969 } 61970 return block; 61971 } 61972 function switchLegacyWidgetType(block) { 61973 const transforms39 = (0, import_blocks112.getPossibleBlockTransformations)([block]).filter( 61974 (item) => { 61975 if (!item.transforms) { 61976 return true; 61977 } 61978 const hasWildCardFrom = item.transforms?.from?.find( 61979 (from) => from.blocks && from.blocks.includes("*") 61980 ); 61981 const hasWildCardTo = item.transforms?.to?.find( 61982 (to) => to.blocks && to.blocks.includes("*") 61983 ); 61984 return !hasWildCardFrom && !hasWildCardTo; 61985 } 61986 ); 61987 if (!transforms39.length) { 61988 return void 0; 61989 } 61990 return (0, import_blocks112.switchToBlockType)(block, transforms39[0].name); 61991 } 61992 function transformInnerBlocks(innerBlocks = []) { 61993 return innerBlocks.flatMap((block) => { 61994 if (block.name === "core/legacy-widget") { 61995 return switchLegacyWidgetType(block); 61996 } 61997 return (0, import_blocks112.createBlock)( 61998 block.name, 61999 block.attributes, 62000 transformInnerBlocks(block.innerBlocks) 62001 ); 62002 }).filter((block) => !!block); 62003 } 62004 62005 // packages/block-library/build-module/template-part/edit/import-controls.js 62006 var import_jsx_runtime486 = __toESM(require_jsx_runtime()); 62007 var SIDEBARS_QUERY = { 62008 per_page: -1, 62009 _fields: "id,name,description,status,widgets" 62010 }; 62011 function TemplatePartImportControls({ area, setAttributes }) { 62012 const [selectedSidebar, setSelectedSidebar] = (0, import_element126.useState)(""); 62013 const [isBusy, setIsBusy] = (0, import_element126.useState)(false); 62014 const registry = (0, import_data134.useRegistry)(); 62015 const { sidebars, hasResolved } = (0, import_data134.useSelect)((select9) => { 62016 const { getSidebars, hasFinishedResolution } = select9(import_core_data81.store); 62017 return { 62018 sidebars: getSidebars(SIDEBARS_QUERY), 62019 hasResolved: hasFinishedResolution("getSidebars", [ 62020 SIDEBARS_QUERY 62021 ]) 62022 }; 62023 }, []); 62024 const { createErrorNotice } = (0, import_data134.useDispatch)(import_notices18.store); 62025 const createFromBlocks = useCreateTemplatePartFromBlocks( 62026 area, 62027 setAttributes 62028 ); 62029 const options2 = (0, import_element126.useMemo)(() => { 62030 const sidebarOptions = (sidebars ?? []).filter( 62031 (widgetArea) => widgetArea.id !== "wp_inactive_widgets" && widgetArea.widgets.length > 0 62032 ).map((widgetArea) => { 62033 return { 62034 value: widgetArea.id, 62035 label: widgetArea.name 62036 }; 62037 }); 62038 if (!sidebarOptions.length) { 62039 return []; 62040 } 62041 return [ 62042 { value: "", label: (0, import_i18n238.__)("Select widget area") }, 62043 ...sidebarOptions 62044 ]; 62045 }, [sidebars]); 62046 if (!hasResolved) { 62047 return /* @__PURE__ */ (0, import_jsx_runtime486.jsx)(import_components156.__experimentalSpacer, { marginBottom: "0" }); 62048 } 62049 if (hasResolved && !options2.length) { 62050 return null; 62051 } 62052 async function createFromWidgets(event) { 62053 event.preventDefault(); 62054 if (isBusy || !selectedSidebar) { 62055 return; 62056 } 62057 setIsBusy(true); 62058 const sidebar = options2.find( 62059 ({ value }) => value === selectedSidebar 62060 ); 62061 const { getWidgets } = registry.resolveSelect(import_core_data81.store); 62062 const widgets = await getWidgets({ 62063 sidebar: sidebar.value, 62064 _embed: "about" 62065 }); 62066 const skippedWidgets = /* @__PURE__ */ new Set(); 62067 const blocks = widgets.flatMap((widget) => { 62068 const block = transformWidgetToBlock(widget); 62069 if (!block) { 62070 skippedWidgets.add(widget.id_base); 62071 return []; 62072 } 62073 return block; 62074 }); 62075 await createFromBlocks( 62076 blocks, 62077 /* translators: %s: name of the widget area */ 62078 (0, import_i18n238.sprintf)((0, import_i18n238.__)("Widget area: %s"), sidebar.label) 62079 ); 62080 if (skippedWidgets.size) { 62081 createErrorNotice( 62082 (0, import_i18n238.sprintf)( 62083 /* translators: %s: the list of widgets */ 62084 (0, import_i18n238.__)("Unable to import the following widgets: %s."), 62085 Array.from(skippedWidgets).join(", ") 62086 ), 62087 { 62088 type: "snackbar" 62089 } 62090 ); 62091 } 62092 setIsBusy(false); 62093 } 62094 return /* @__PURE__ */ (0, import_jsx_runtime486.jsx)(import_components156.__experimentalSpacer, { marginBottom: "4", children: /* @__PURE__ */ (0, import_jsx_runtime486.jsxs)(import_components156.__experimentalHStack, { as: "form", onSubmit: createFromWidgets, children: [ 62095 /* @__PURE__ */ (0, import_jsx_runtime486.jsx)(import_components156.FlexBlock, { children: /* @__PURE__ */ (0, import_jsx_runtime486.jsx)( 62096 import_components156.SelectControl, 62097 { 62098 label: (0, import_i18n238.__)("Import widget area"), 62099 value: selectedSidebar, 62100 options: options2, 62101 onChange: (value) => setSelectedSidebar(value), 62102 disabled: !options2.length, 62103 __next40pxDefaultSize: true 62104 } 62105 ) }), 62106 /* @__PURE__ */ (0, import_jsx_runtime486.jsx)( 62107 import_components156.FlexItem, 62108 { 62109 style: { 62110 marginBottom: "8px", 62111 marginTop: "auto" 62112 }, 62113 children: /* @__PURE__ */ (0, import_jsx_runtime486.jsx)( 62114 import_components156.Button, 62115 { 62116 __next40pxDefaultSize: true, 62117 variant: "primary", 62118 type: "submit", 62119 isBusy, 62120 "aria-disabled": isBusy || !selectedSidebar, 62121 children: (0, import_i18n238._x)("Import", "button label") 62122 } 62123 ) 62124 } 62125 ) 62126 ] }) }); 62127 } 62128 62129 // packages/block-library/build-module/template-part/edit/advanced-controls.js 62130 var import_jsx_runtime487 = __toESM(require_jsx_runtime()); 62131 var { HTMLElementControl: HTMLElementControl7 } = unlock(import_block_editor255.privateApis); 62132 function TemplatePartAdvancedControls({ 62133 tagName, 62134 setAttributes, 62135 isEntityAvailable, 62136 templatePartId, 62137 defaultWrapper, 62138 hasInnerBlocks, 62139 clientId 62140 }) { 62141 const [area, setArea] = (0, import_core_data82.useEntityProp)( 62142 "postType", 62143 "wp_template_part", 62144 "area", 62145 templatePartId 62146 ); 62147 const [title, setTitle] = (0, import_core_data82.useEntityProp)( 62148 "postType", 62149 "wp_template_part", 62150 "title", 62151 templatePartId 62152 ); 62153 const defaultTemplatePartAreas = (0, import_data135.useSelect)( 62154 (select9) => select9(import_core_data82.store).getCurrentTheme()?.default_template_part_areas || [], 62155 [] 62156 ); 62157 const areaOptions = defaultTemplatePartAreas.map( 62158 ({ label, area: _area }) => ({ 62159 label, 62160 value: _area 62161 }) 62162 ); 62163 return /* @__PURE__ */ (0, import_jsx_runtime487.jsxs)(import_jsx_runtime487.Fragment, { children: [ 62164 isEntityAvailable && /* @__PURE__ */ (0, import_jsx_runtime487.jsxs)(import_jsx_runtime487.Fragment, { children: [ 62165 /* @__PURE__ */ (0, import_jsx_runtime487.jsx)( 62166 import_components157.TextControl, 62167 { 62168 __next40pxDefaultSize: true, 62169 label: (0, import_i18n239.__)("Title"), 62170 value: title, 62171 onChange: (value) => { 62172 setTitle(value); 62173 }, 62174 onFocus: (event) => event.target.select() 62175 } 62176 ), 62177 /* @__PURE__ */ (0, import_jsx_runtime487.jsx)( 62178 import_components157.SelectControl, 62179 { 62180 __next40pxDefaultSize: true, 62181 label: (0, import_i18n239.__)("Area"), 62182 labelPosition: "top", 62183 options: areaOptions, 62184 value: area, 62185 onChange: setArea 62186 } 62187 ) 62188 ] }), 62189 /* @__PURE__ */ (0, import_jsx_runtime487.jsx)( 62190 HTMLElementControl7, 62191 { 62192 tagName: tagName || "", 62193 onChange: (value) => setAttributes({ tagName: value }), 62194 clientId, 62195 options: [ 62196 { 62197 label: (0, import_i18n239.sprintf)( 62198 /* translators: %s: HTML tag based on area. */ 62199 (0, import_i18n239.__)("Default based on area (%s)"), 62200 `<$defaultWrapper}>` 62201 ), 62202 value: "" 62203 }, 62204 { label: "<header>", value: "header" }, 62205 { label: "<main>", value: "main" }, 62206 { label: "<section>", value: "section" }, 62207 { label: "<article>", value: "article" }, 62208 { label: "<aside>", value: "aside" }, 62209 { label: "<footer>", value: "footer" }, 62210 { label: "<div>", value: "div" } 62211 ] 62212 } 62213 ), 62214 !hasInnerBlocks && /* @__PURE__ */ (0, import_jsx_runtime487.jsx)( 62215 TemplatePartImportControls, 62216 { 62217 area, 62218 setAttributes 62219 } 62220 ) 62221 ] }); 62222 } 62223 62224 // packages/block-library/build-module/template-part/edit/inner-blocks.js 62225 var import_core_data83 = __toESM(require_core_data()); 62226 var import_block_editor256 = __toESM(require_block_editor()); 62227 var import_data136 = __toESM(require_data()); 62228 var import_element127 = __toESM(require_element()); 62229 var import_blocks113 = __toESM(require_blocks()); 62230 var import_jsx_runtime488 = __toESM(require_jsx_runtime()); 62231 function useRenderAppender(hasInnerBlocks) { 62232 const blockEditingMode = (0, import_block_editor256.useBlockEditingMode)(); 62233 if (blockEditingMode === "contentOnly") { 62234 return false; 62235 } 62236 if (!hasInnerBlocks) { 62237 return import_block_editor256.InnerBlocks.ButtonBlockAppender; 62238 } 62239 } 62240 function useLayout(layout) { 62241 const themeSupportsLayout = (0, import_data136.useSelect)((select9) => { 62242 const { getSettings: getSettings2 } = select9(import_block_editor256.store); 62243 return getSettings2()?.supportsLayout; 62244 }, []); 62245 const [defaultLayout] = (0, import_block_editor256.useSettings)("layout"); 62246 if (themeSupportsLayout) { 62247 return layout?.inherit ? defaultLayout || {} : layout; 62248 } 62249 } 62250 function NonEditableTemplatePartPreview({ 62251 postId: id, 62252 layout, 62253 tagName: TagName2, 62254 blockProps 62255 }) { 62256 (0, import_block_editor256.useBlockEditingMode)("disabled"); 62257 const { content, editedBlocks } = (0, import_data136.useSelect)( 62258 (select9) => { 62259 if (!id) { 62260 return {}; 62261 } 62262 const { getEditedEntityRecord } = select9(import_core_data83.store); 62263 const editedRecord = getEditedEntityRecord( 62264 "postType", 62265 "wp_template_part", 62266 id, 62267 { context: "view" } 62268 ); 62269 return { 62270 editedBlocks: editedRecord.blocks, 62271 content: editedRecord.content 62272 }; 62273 }, 62274 [id] 62275 ); 62276 const blocks = (0, import_element127.useMemo)(() => { 62277 if (!id) { 62278 return void 0; 62279 } 62280 if (editedBlocks) { 62281 return editedBlocks; 62282 } 62283 if (!content || typeof content !== "string") { 62284 return []; 62285 } 62286 return (0, import_blocks113.parse)(content); 62287 }, [id, editedBlocks, content]); 62288 const innerBlocksProps = (0, import_block_editor256.useInnerBlocksProps)(blockProps, { 62289 value: blocks, 62290 onInput: () => { 62291 }, 62292 onChange: () => { 62293 }, 62294 renderAppender: false, 62295 layout: useLayout(layout) 62296 }); 62297 return /* @__PURE__ */ (0, import_jsx_runtime488.jsx)(TagName2, { ...innerBlocksProps }); 62298 } 62299 function EditableTemplatePartInnerBlocks({ 62300 postId: id, 62301 hasInnerBlocks, 62302 layout, 62303 tagName: TagName2, 62304 blockProps 62305 }) { 62306 const onNavigateToEntityRecord = (0, import_data136.useSelect)( 62307 (select9) => select9(import_block_editor256.store).getSettings().onNavigateToEntityRecord, 62308 [] 62309 ); 62310 const [blocks, onInput, onChange] = (0, import_core_data83.useEntityBlockEditor)( 62311 "postType", 62312 "wp_template_part", 62313 { id } 62314 ); 62315 const innerBlocksProps = (0, import_block_editor256.useInnerBlocksProps)(blockProps, { 62316 value: blocks, 62317 onInput, 62318 onChange, 62319 renderAppender: useRenderAppender(hasInnerBlocks), 62320 layout: useLayout(layout) 62321 }); 62322 const blockEditingMode = (0, import_block_editor256.useBlockEditingMode)(); 62323 const customProps = blockEditingMode === "contentOnly" && onNavigateToEntityRecord ? { 62324 onDoubleClick: () => onNavigateToEntityRecord({ 62325 postId: id, 62326 postType: "wp_template_part" 62327 }) 62328 } : {}; 62329 return /* @__PURE__ */ (0, import_jsx_runtime488.jsx)(TagName2, { ...innerBlocksProps, ...customProps }); 62330 } 62331 function TemplatePartInnerBlocks({ 62332 postId: id, 62333 hasInnerBlocks, 62334 layout, 62335 tagName: TagName2, 62336 blockProps 62337 }) { 62338 const { canViewTemplatePart, canEditTemplatePart } = (0, import_data136.useSelect)( 62339 (select9) => { 62340 return { 62341 canViewTemplatePart: !!select9(import_core_data83.store).canUser("read", { 62342 kind: "postType", 62343 name: "wp_template_part", 62344 id 62345 }), 62346 canEditTemplatePart: !!select9(import_core_data83.store).canUser("update", { 62347 kind: "postType", 62348 name: "wp_template_part", 62349 id 62350 }) 62351 }; 62352 }, 62353 [id] 62354 ); 62355 if (!canViewTemplatePart) { 62356 return null; 62357 } 62358 const TemplatePartInnerBlocksComponent = canEditTemplatePart ? EditableTemplatePartInnerBlocks : NonEditableTemplatePartPreview; 62359 return /* @__PURE__ */ (0, import_jsx_runtime488.jsx)( 62360 TemplatePartInnerBlocksComponent, 62361 { 62362 postId: id, 62363 hasInnerBlocks, 62364 layout, 62365 tagName: TagName2, 62366 blockProps 62367 } 62368 ); 62369 } 62370 62371 // packages/block-library/build-module/template-part/edit/index.js 62372 var import_jsx_runtime489 = __toESM(require_jsx_runtime()); 62373 function ReplaceButton({ 62374 isEntityAvailable, 62375 area, 62376 templatePartId, 62377 isTemplatePartSelectionOpen, 62378 setIsTemplatePartSelectionOpen 62379 }) { 62380 const { templateParts } = useAlternativeTemplateParts( 62381 area, 62382 templatePartId 62383 ); 62384 const hasReplacements = !!templateParts.length; 62385 const canReplace = isEntityAvailable && hasReplacements && (area === "header" || area === "footer"); 62386 if (!canReplace) { 62387 return null; 62388 } 62389 return /* @__PURE__ */ (0, import_jsx_runtime489.jsx)( 62390 import_components158.MenuItem, 62391 { 62392 onClick: () => { 62393 setIsTemplatePartSelectionOpen(true); 62394 }, 62395 "aria-expanded": isTemplatePartSelectionOpen, 62396 "aria-haspopup": "dialog", 62397 children: (0, import_i18n240.__)("Replace") 62398 } 62399 ); 62400 } 62401 function TemplatesList({ area, clientId, isEntityAvailable, onSelect }) { 62402 const blockPatterns = useAlternativeBlockPatterns(area, clientId); 62403 const canReplace = isEntityAvailable && !!blockPatterns.length && (area === "header" || area === "footer"); 62404 if (!canReplace) { 62405 return null; 62406 } 62407 return /* @__PURE__ */ (0, import_jsx_runtime489.jsx)(import_components158.PanelBody, { title: (0, import_i18n240.__)("Design"), children: /* @__PURE__ */ (0, import_jsx_runtime489.jsx)( 62408 import_block_editor257.__experimentalBlockPatternsList, 62409 { 62410 label: (0, import_i18n240.__)("Templates"), 62411 blockPatterns, 62412 onClickPattern: onSelect, 62413 showTitlesAsTooltip: true 62414 } 62415 ) }); 62416 } 62417 function TemplatePartEdit({ 62418 attributes: attributes3, 62419 setAttributes, 62420 clientId 62421 }) { 62422 const { createSuccessNotice } = (0, import_data137.useDispatch)(import_notices19.store); 62423 const { editEntityRecord } = (0, import_data137.useDispatch)(import_core_data84.store); 62424 const currentTheme = (0, import_data137.useSelect)( 62425 (select9) => select9(import_core_data84.store).getCurrentTheme()?.stylesheet, 62426 [] 62427 ); 62428 const { slug, theme = currentTheme, tagName, layout = {} } = attributes3; 62429 const templatePartId = createTemplatePartId(theme, slug); 62430 const hasAlreadyRendered = (0, import_block_editor257.useHasRecursion)(templatePartId); 62431 const [isTemplatePartSelectionOpen, setIsTemplatePartSelectionOpen] = (0, import_element128.useState)(false); 62432 const { 62433 isResolved, 62434 hasInnerBlocks, 62435 isMissing, 62436 area, 62437 onNavigateToEntityRecord, 62438 title, 62439 canUserEdit 62440 } = (0, import_data137.useSelect)( 62441 (select9) => { 62442 const { getEditedEntityRecord, hasFinishedResolution } = select9(import_core_data84.store); 62443 const { getBlockCount, getSettings: getSettings2 } = select9(import_block_editor257.store); 62444 const getEntityArgs = [ 62445 "postType", 62446 "wp_template_part", 62447 templatePartId 62448 ]; 62449 const entityRecord = templatePartId ? getEditedEntityRecord(...getEntityArgs) : null; 62450 const _area = entityRecord?.area || attributes3.area; 62451 const hasResolvedEntity = templatePartId ? hasFinishedResolution( 62452 "getEditedEntityRecord", 62453 getEntityArgs 62454 ) : false; 62455 const _canUserEdit = hasResolvedEntity ? select9(import_core_data84.store).canUser("update", { 62456 kind: "postType", 62457 name: "wp_template_part", 62458 id: templatePartId 62459 }) : false; 62460 return { 62461 hasInnerBlocks: getBlockCount(clientId) > 0, 62462 isResolved: hasResolvedEntity, 62463 isMissing: hasResolvedEntity && (!entityRecord || Object.keys(entityRecord).length === 0), 62464 area: _area, 62465 onNavigateToEntityRecord: getSettings2().onNavigateToEntityRecord, 62466 title: entityRecord?.title, 62467 canUserEdit: !!_canUserEdit 62468 }; 62469 }, 62470 [templatePartId, attributes3.area, clientId] 62471 ); 62472 const areaObject = useTemplatePartArea(area); 62473 const blockProps = (0, import_block_editor257.useBlockProps)(); 62474 const isPlaceholder = !slug; 62475 const isEntityAvailable = !isPlaceholder && !isMissing && isResolved; 62476 const TagName2 = tagName || areaObject.tagName; 62477 const onPatternSelect = async (pattern) => { 62478 await editEntityRecord( 62479 "postType", 62480 "wp_template_part", 62481 templatePartId, 62482 { 62483 blocks: pattern.blocks, 62484 content: (0, import_blocks114.serialize)(pattern.blocks) 62485 } 62486 ); 62487 createSuccessNotice( 62488 (0, import_i18n240.sprintf)( 62489 /* translators: %s: template part title. */ 62490 (0, import_i18n240.__)('Template Part "%s" updated.'), 62491 title || slug 62492 ), 62493 { 62494 type: "snackbar" 62495 } 62496 ); 62497 }; 62498 if (!hasInnerBlocks && (slug && !theme || slug && isMissing)) { 62499 return /* @__PURE__ */ (0, import_jsx_runtime489.jsx)(TagName2, { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime489.jsx)(import_block_editor257.Warning, { children: (0, import_i18n240.sprintf)( 62500 /* translators: %s: Template part slug. */ 62501 (0, import_i18n240.__)( 62502 "Template part has been deleted or is unavailable: %s" 62503 ), 62504 slug 62505 ) }) }); 62506 } 62507 if (isEntityAvailable && hasAlreadyRendered) { 62508 return /* @__PURE__ */ (0, import_jsx_runtime489.jsx)(TagName2, { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime489.jsx)(import_block_editor257.Warning, { children: (0, import_i18n240.__)("Block cannot be rendered inside itself.") }) }); 62509 } 62510 return /* @__PURE__ */ (0, import_jsx_runtime489.jsxs)(import_jsx_runtime489.Fragment, { children: [ 62511 /* @__PURE__ */ (0, import_jsx_runtime489.jsxs)(import_block_editor257.RecursionProvider, { uniqueId: templatePartId, children: [ 62512 isEntityAvailable && onNavigateToEntityRecord && canUserEdit && /* @__PURE__ */ (0, import_jsx_runtime489.jsx)(import_block_editor257.BlockControls, { group: "other", children: /* @__PURE__ */ (0, import_jsx_runtime489.jsx)( 62513 import_components158.ToolbarButton, 62514 { 62515 onClick: () => { 62516 onNavigateToEntityRecord({ 62517 postId: templatePartId, 62518 postType: "wp_template_part" 62519 }); 62520 }, 62521 children: window?.__experimentalContentOnlyPatternInsertion ? (0, import_i18n240.__)("Edit section") : (0, import_i18n240.__)("Edit") 62522 } 62523 ) }), 62524 canUserEdit && /* @__PURE__ */ (0, import_jsx_runtime489.jsx)(import_block_editor257.InspectorControls, { group: "advanced", children: /* @__PURE__ */ (0, import_jsx_runtime489.jsx)( 62525 TemplatePartAdvancedControls, 62526 { 62527 tagName, 62528 setAttributes, 62529 isEntityAvailable, 62530 templatePartId, 62531 defaultWrapper: areaObject.tagName, 62532 hasInnerBlocks, 62533 clientId 62534 } 62535 ) }), 62536 isPlaceholder && /* @__PURE__ */ (0, import_jsx_runtime489.jsx)(TagName2, { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime489.jsx)( 62537 TemplatePartPlaceholder, 62538 { 62539 area: attributes3.area, 62540 templatePartId, 62541 clientId, 62542 setAttributes, 62543 onOpenSelectionModal: () => setIsTemplatePartSelectionOpen(true) 62544 } 62545 ) }), 62546 /* @__PURE__ */ (0, import_jsx_runtime489.jsx)(import_block_editor257.BlockSettingsMenuControls, { children: ({ selectedClientIds }) => { 62547 if (!(selectedClientIds.length === 1 && clientId === selectedClientIds[0])) { 62548 return null; 62549 } 62550 return /* @__PURE__ */ (0, import_jsx_runtime489.jsx)( 62551 ReplaceButton, 62552 { 62553 ...{ 62554 isEntityAvailable, 62555 area, 62556 clientId, 62557 templatePartId, 62558 isTemplatePartSelectionOpen, 62559 setIsTemplatePartSelectionOpen 62560 } 62561 } 62562 ); 62563 } }), 62564 /* @__PURE__ */ (0, import_jsx_runtime489.jsx)(import_block_editor257.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime489.jsx)( 62565 TemplatesList, 62566 { 62567 area, 62568 clientId, 62569 isEntityAvailable, 62570 onSelect: (pattern) => onPatternSelect(pattern) 62571 } 62572 ) }), 62573 isEntityAvailable && /* @__PURE__ */ (0, import_jsx_runtime489.jsx)( 62574 TemplatePartInnerBlocks, 62575 { 62576 tagName: TagName2, 62577 blockProps, 62578 postId: templatePartId, 62579 hasInnerBlocks, 62580 layout 62581 } 62582 ), 62583 !isPlaceholder && !isResolved && /* @__PURE__ */ (0, import_jsx_runtime489.jsx)(TagName2, { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime489.jsx)(import_components158.Spinner, {}) }) 62584 ] }), 62585 isTemplatePartSelectionOpen && /* @__PURE__ */ (0, import_jsx_runtime489.jsx)( 62586 import_components158.Modal, 62587 { 62588 overlayClassName: "block-editor-template-part__selection-modal", 62589 title: (0, import_i18n240.sprintf)( 62590 // Translators: %s as template part area title ("Header", "Footer", etc.). 62591 (0, import_i18n240.__)("Choose a %s"), 62592 areaObject.label.toLowerCase() 62593 ), 62594 onRequestClose: () => setIsTemplatePartSelectionOpen(false), 62595 isFullScreen: true, 62596 children: /* @__PURE__ */ (0, import_jsx_runtime489.jsx)( 62597 TemplatePartSelectionModal, 62598 { 62599 templatePartId, 62600 clientId, 62601 area, 62602 setAttributes, 62603 onClose: () => setIsTemplatePartSelectionOpen(false) 62604 } 62605 ) 62606 } 62607 ) 62608 ] }); 62609 } 62610 62611 // packages/block-library/build-module/template-part/variations.js 62612 var import_core_data85 = __toESM(require_core_data()); 62613 var import_data138 = __toESM(require_data()); 62614 function enhanceTemplatePartVariations(settings116, name117) { 62615 if (name117 !== "core/template-part") { 62616 return settings116; 62617 } 62618 if (settings116.variations) { 62619 const isActive = (blockAttributes8, variationAttributes) => { 62620 const { area, theme, slug } = blockAttributes8; 62621 if (area) { 62622 return area === variationAttributes.area; 62623 } 62624 if (!slug) { 62625 return false; 62626 } 62627 const { getCurrentTheme, getEntityRecord } = (0, import_data138.select)(import_core_data85.store); 62628 const entity = getEntityRecord( 62629 "postType", 62630 "wp_template_part", 62631 `$theme || getCurrentTheme()?.stylesheet}//${slug}` 62632 ); 62633 if (entity?.slug) { 62634 return entity.slug === variationAttributes.slug; 62635 } 62636 return entity?.area === variationAttributes.area; 62637 }; 62638 const variations18 = settings116.variations.map((variation) => { 62639 return { 62640 ...variation, 62641 ...!variation.isActive && { isActive }, 62642 ...typeof variation.icon === "string" && { 62643 icon: getTemplatePartIcon(variation.icon) 62644 } 62645 }; 62646 }); 62647 return { 62648 ...settings116, 62649 variations: variations18 62650 }; 62651 } 62652 return settings116; 62653 } 62654 62655 // packages/block-library/build-module/template-part/index.js 62656 var { name: name107 } = block_default106; 62657 var settings106 = { 62658 icon: symbol_filled_default, 62659 __experimentalLabel: ({ slug, theme }) => { 62660 if (!slug) { 62661 return; 62662 } 62663 const { getCurrentTheme, getEditedEntityRecord } = (0, import_data139.select)(import_core_data86.store); 62664 const entity = getEditedEntityRecord( 62665 "postType", 62666 "wp_template_part", 62667 (theme || getCurrentTheme()?.stylesheet) + "//" + slug 62668 ); 62669 if (!entity) { 62670 return; 62671 } 62672 return (0, import_html_entities16.decodeEntities)(entity.title) || capitalCase(entity.slug || ""); 62673 }, 62674 edit: TemplatePartEdit 62675 }; 62676 var init106 = () => { 62677 (0, import_hooks78.addFilter)( 62678 "blocks.registerBlockType", 62679 "core/template-part", 62680 enhanceTemplatePartVariations 62681 ); 62682 const DISALLOWED_PARENTS = ["core/post-template", "core/post-content"]; 62683 (0, import_hooks78.addFilter)( 62684 "blockEditor.__unstableCanInsertBlockType", 62685 "core/block-library/removeTemplatePartsFromPostTemplates", 62686 (canInsert, blockType, rootClientId, { getBlock, getBlockParentsByBlockName }) => { 62687 if (blockType.name !== "core/template-part") { 62688 return canInsert; 62689 } 62690 for (const disallowedParentType of DISALLOWED_PARENTS) { 62691 const hasDisallowedParent = getBlock(rootClientId)?.name === disallowedParentType || getBlockParentsByBlockName( 62692 rootClientId, 62693 disallowedParentType 62694 ).length; 62695 if (hasDisallowedParent) { 62696 return false; 62697 } 62698 } 62699 return true; 62700 } 62701 ); 62702 return initBlock({ name: name107, metadata: block_default106, settings: settings106 }); 62703 }; 62704 62705 // packages/block-library/build-module/term-count/index.js 62706 var term_count_exports = {}; 62707 __export(term_count_exports, { 62708 init: () => init107, 62709 metadata: () => block_default107, 62710 name: () => name108, 62711 settings: () => settings107 62712 }); 62713 62714 // packages/block-library/build-module/term-count/block.json 62715 var block_default107 = { 62716 $schema: "https://schemas.wp.org/trunk/block.json", 62717 apiVersion: 3, 62718 name: "core/term-count", 62719 title: "Term Count", 62720 category: "theme", 62721 description: "Displays the post count of a taxonomy term.", 62722 textdomain: "default", 62723 usesContext: ["termId", "taxonomy"], 62724 attributes: { 62725 bracketType: { 62726 type: "string", 62727 enum: ["none", "round", "square", "curly", "angle"], 62728 default: "round" 62729 } 62730 }, 62731 supports: { 62732 html: false, 62733 color: { 62734 gradients: true, 62735 __experimentalDefaultControls: { 62736 background: true, 62737 text: true 62738 } 62739 }, 62740 spacing: { 62741 padding: true 62742 }, 62743 typography: { 62744 fontSize: true, 62745 lineHeight: true, 62746 __experimentalFontFamily: true, 62747 __experimentalFontWeight: true, 62748 __experimentalFontStyle: true, 62749 __experimentalTextTransform: true, 62750 __experimentalTextDecoration: true, 62751 __experimentalLetterSpacing: true, 62752 __experimentalDefaultControls: { 62753 fontSize: true 62754 } 62755 }, 62756 interactivity: { 62757 clientNavigation: true 62758 }, 62759 __experimentalBorder: { 62760 radius: true, 62761 color: true, 62762 width: true, 62763 style: true, 62764 __experimentalDefaultControls: { 62765 color: true, 62766 width: true, 62767 style: true 62768 } 62769 } 62770 }, 62771 style: "wp-block-term-count" 62772 }; 62773 62774 // packages/block-library/build-module/term-count/edit.js 62775 var import_i18n241 = __toESM(require_i18n()); 62776 var import_block_editor258 = __toESM(require_block_editor()); 62777 var import_components160 = __toESM(require_components()); 62778 62779 // packages/block-library/build-module/term-count/icons.js 62780 var import_components159 = __toESM(require_components()); 62781 var import_jsx_runtime490 = __toESM(require_jsx_runtime()); 62782 var bareNumber = /* @__PURE__ */ (0, import_jsx_runtime490.jsx)(import_components159.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime490.jsx)(import_components159.Path, { d: "M 10 6 L 9.609375 9 L 7 9 L 7 10.5 L 9.4121094 10.5 L 9.0878906 13 L 7 13 L 7 14.5 L 8.890625 14.5 L 8.5 17.5 L 10 17.5 L 10.390625 14.5 L 12.890625 14.5 L 12.5 17.5 L 14 17.5 L 14.390625 14.5 L 17 14.5 L 17 13 L 14.587891 13 L 14.912109 10.5 L 17 10.5 L 17 9 L 15.109375 9 L 15.5 6 L 14 6 L 13.609375 9 L 11.109375 9 L 11.5 6 L 10 6 z M 10.912109 10.5 L 13.412109 10.5 L 13.087891 13 L 10.587891 13 L 10.912109 10.5 z" }) }); 62783 var numberInParenthesis = /* @__PURE__ */ (0, import_jsx_runtime490.jsx)(import_components159.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime490.jsx)(import_components159.Path, { d: "M 10,6 9.609375,9 H 7 v 1.5 H 9.4121094 L 9.0878906,13 H 7 v 1.5 H 8.890625 L 8.5,17.5 H 10 l 0.390625,-3 h 2.5 L 12.5,17.5 H 14 l 0.390625,-3 H 17 V 13 h -2.412109 l 0.324218,-2.5 H 17 V 9 H 15.109375 L 15.5,6 H 14 l -0.390625,3 h -2.5 L 11.5,6 Z m 0.912109,4.5 h 2.5 L 13.087891,13 h -2.5 z M 18.5,3 c 0,0 1.5,4.004036 1.5,9 0,4.995964 -1.5,9 -1.5,9 H 20 c 0,0 1.5,-4.004036 1.5,-9 C 21.5,7.004036 20,3 20,3 Z M 5.5,21 C 5.5,21 4,16.995964 4,12 4,7.0040356 5.5,3 5.5,3 H 4 c 0,0 -1.5,4.004036 -1.5,9 0,4.995964 1.5,9 1.5,9 z" }) }); 62784 var numberInSquareBrackets = /* @__PURE__ */ (0, import_jsx_runtime490.jsx)(import_components159.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime490.jsx)(import_components159.Path, { d: "M 21.5,21 V 3 H 18 v 1.5 h 2 v 15 H 18 V 21 Z M 2.5,3 V 21 H 6 V 19.5 H 4 V 4.5 H 6 V 3 Z M 10,6 9.609375,9 H 7 v 1.5 H 9.4121094 L 9.0878906,13 H 7 v 1.5 H 8.890625 L 8.5,17.5 H 10 l 0.390625,-3 h 2.5 L 12.5,17.5 H 14 l 0.390625,-3 H 17 V 13 h -2.412109 l 0.324218,-2.5 H 17 V 9 H 15.109375 L 15.5,6 H 14 l -0.390625,3 h -2.5 L 11.5,6 Z m 0.912109,4.5 h 2.5 L 13.087891,13 h -2.5 z" }) }); 62785 var numberInCurlyBrackets = /* @__PURE__ */ (0, import_jsx_runtime490.jsx)(import_components159.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime490.jsx)(import_components159.Path, { d: "M 10,6 9.609375,9 H 7 v 1.5 H 9.4121094 L 9.0878906,13 H 7 v 1.5 H 8.890625 L 8.5,17.5 H 10 l 0.390625,-3 h 2.5 L 12.5,17.5 H 14 l 0.390625,-3 H 17 V 13 h -2.412109 l 0.324218,-2.5 H 17 V 9 H 15.109375 L 15.5,6 H 14 l -0.390625,3 h -2.5 L 11.5,6 Z m 0.912109,4.5 h 2.5 L 13.087891,13 h -2.5 z M 18.5,21 c 1.104567,0 2,-0.895433 2,-2 v -4 c 0,-1.104567 0.895433,-2 2,-2 v -2 c -1.104567,0 -2,-0.895433 -2,-2 V 5 c 0,-1.104567 -0.895433,-2 -2,-2 H 17 v 1.5 h 1.5 A 0.5,0.5 0 0 1 19,5 v 5 c 0,1.104567 0.895433,2 2,2 -1.104567,0 -2,0.895433 -2,2 v 5 c 0,0.276142 -0.223858,0.5 -0.5,0.5 H 17 V 21 Z M 5.5,3 c -1.1045668,0 -2,0.8954327 -2,2 v 4 c 0,1.104567 -0.8954332,2 -2,2 v 2 c 1.1045668,0 2,0.895433 2,2 v 4 c 0,1.104567 0.8954332,2 2,2 H 7 V 19.5 H 5.5 A 0.5,0.5 0 0 1 5,19 V 14 C 5,12.895433 4.1045668,12 3,12 4.1045668,12 5,11.104567 5,10 V 5 C 5,4.7238579 5.2238579,4.5 5.5,4.5 H 7 V 3 Z" }) }); 62786 var numberInAngleBrackets = /* @__PURE__ */ (0, import_jsx_runtime490.jsx)(import_components159.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime490.jsx)(import_components159.Path, { d: "M 18.970703,16.53125 23.5,12 18.970703,7.46875 17.910156,8.53125 21.378906,12 17.910156,15.46875 Z M 5.0292969,7.46875 0.5,12 5.0292969,16.53125 6.0898438,15.46875 2.6210938,12 6.0898438,8.53125 Z M 10,6 9.609375,9 H 7 v 1.5 H 9.4121094 L 9.0878906,13 H 7 v 1.5 H 8.890625 L 8.5,17.5 H 10 l 0.390625,-3 h 2.5 L 12.5,17.5 H 14 l 0.390625,-3 H 17 V 13 h -2.412109 l 0.324218,-2.5 H 17 V 9 H 15.109375 L 15.5,6 H 14 l -0.390625,3 h -2.5 L 11.5,6 Z m 0.912109,4.5 h 2.5 L 13.087891,13 h -2.5 z" }) }); 62787 62788 // packages/block-library/build-module/term-count/use-term-count.js 62789 var import_core_data87 = __toESM(require_core_data()); 62790 var import_data140 = __toESM(require_data()); 62791 function useTermCount(termId, taxonomy) { 62792 const [count] = (0, import_core_data87.useEntityProp)("taxonomy", taxonomy, "count", termId); 62793 const templateBasedData = useTemplateBasedTermData(); 62794 const hasContext = Boolean(termId && taxonomy); 62795 return { 62796 hasContext, 62797 termCount: hasContext ? count || "" : templateBasedData 62798 }; 62799 } 62800 function useTemplateBasedTermData() { 62801 const templateSlug = (0, import_data140.useSelect)((select9) => { 62802 const { getCurrentPostId, getCurrentPostType, getCurrentTemplateId } = select9("core/editor"); 62803 const currentPostType = getCurrentPostType(); 62804 const templateId = getCurrentTemplateId() || (currentPostType === "wp_template" ? getCurrentPostId() : null); 62805 return templateId ? select9(import_core_data87.store).getEditedEntityRecord( 62806 "postType", 62807 "wp_template", 62808 templateId 62809 )?.slug : null; 62810 }, []); 62811 const taxonomyMatches = templateSlug?.match( 62812 /^(category|tag|taxonomy-([^-]+))$|^(((category|tag)|taxonomy-([^-]+))-(.+))$/ 62813 ); 62814 let taxonomy; 62815 let termSlug; 62816 if (taxonomyMatches) { 62817 if (taxonomyMatches[1]) { 62818 taxonomy = taxonomyMatches[2] ? taxonomyMatches[2] : taxonomyMatches[1]; 62819 } else if (taxonomyMatches[3]) { 62820 taxonomy = taxonomyMatches[6] ? taxonomyMatches[6] : taxonomyMatches[4]; 62821 termSlug = taxonomyMatches[7]; 62822 } 62823 taxonomy = taxonomy === "tag" ? "post_tag" : taxonomy; 62824 } 62825 return (0, import_data140.useSelect)( 62826 (select9) => { 62827 if (!taxonomy || !termSlug) { 62828 return ""; 62829 } 62830 const { getEntityRecords } = select9(import_core_data87.store); 62831 const termRecords = getEntityRecords("taxonomy", taxonomy, { 62832 slug: termSlug, 62833 per_page: 1 62834 }); 62835 if (termRecords && termRecords[0]) { 62836 return termRecords[0].count || ""; 62837 } 62838 return ""; 62839 }, 62840 [taxonomy, termSlug] 62841 ); 62842 } 62843 62844 // packages/block-library/build-module/term-count/edit.js 62845 var import_jsx_runtime491 = __toESM(require_jsx_runtime()); 62846 var BRACKET_TYPES = { 62847 none: { label: (0, import_i18n241.__)("No brackets"), icon: bareNumber }, 62848 round: { 62849 label: (0, import_i18n241.__)("Round brackets"), 62850 icon: numberInParenthesis, 62851 before: "(", 62852 after: ")" 62853 }, 62854 square: { 62855 label: (0, import_i18n241.__)("Square brackets"), 62856 icon: numberInSquareBrackets, 62857 before: "[", 62858 after: "]" 62859 }, 62860 curly: { 62861 label: (0, import_i18n241.__)("Curly brackets"), 62862 icon: numberInCurlyBrackets, 62863 before: "{", 62864 after: "}" 62865 }, 62866 angle: { 62867 label: (0, import_i18n241.__)("Angle brackets"), 62868 icon: numberInAngleBrackets, 62869 before: "<", 62870 after: ">" 62871 } 62872 }; 62873 function TermCountEdit({ 62874 attributes: attributes3, 62875 setAttributes, 62876 context: { termId, taxonomy } 62877 }) { 62878 const { bracketType } = attributes3; 62879 const term = useTermCount(termId, taxonomy); 62880 const termCount = term?.termCount || 0; 62881 const blockProps = (0, import_block_editor258.useBlockProps)(); 62882 const bracketTypeControls = Object.entries(BRACKET_TYPES).map( 62883 ([type, { label, icon }]) => ({ 62884 role: "menuitemradio", 62885 title: label, 62886 isActive: bracketType === type, 62887 icon, 62888 onClick: () => { 62889 setAttributes({ bracketType: type }); 62890 } 62891 }) 62892 ); 62893 const formatTermCount = (count, type) => { 62894 const { before = "", after = "" } = BRACKET_TYPES[type] || {}; 62895 return `$before}$count}$after}`; 62896 }; 62897 return /* @__PURE__ */ (0, import_jsx_runtime491.jsxs)(import_jsx_runtime491.Fragment, { children: [ 62898 /* @__PURE__ */ (0, import_jsx_runtime491.jsx)(import_block_editor258.BlockControls, { group: "block", children: /* @__PURE__ */ (0, import_jsx_runtime491.jsx)( 62899 import_components160.ToolbarDropdownMenu, 62900 { 62901 icon: BRACKET_TYPES[bracketType]?.icon ?? bareNumber, 62902 label: (0, import_i18n241.__)("Change bracket type"), 62903 controls: bracketTypeControls 62904 } 62905 ) }), 62906 /* @__PURE__ */ (0, import_jsx_runtime491.jsx)("div", { ...blockProps, children: formatTermCount(termCount, bracketType) }) 62907 ] }); 62908 } 62909 62910 // packages/block-library/build-module/term-count/index.js 62911 var { name: name108 } = block_default107; 62912 var settings107 = { 62913 icon: term_count_default, 62914 example: {}, 62915 edit: TermCountEdit 62916 }; 62917 var init107 = () => initBlock({ name: name108, metadata: block_default107, settings: settings107 }); 62918 62919 // packages/block-library/build-module/term-description/index.js 62920 var term_description_exports = {}; 62921 __export(term_description_exports, { 62922 init: () => init108, 62923 metadata: () => block_default108, 62924 name: () => name109, 62925 settings: () => settings108 62926 }); 62927 62928 // packages/block-library/build-module/term-description/block.json 62929 var block_default108 = { 62930 $schema: "https://schemas.wp.org/trunk/block.json", 62931 apiVersion: 3, 62932 name: "core/term-description", 62933 title: "Term Description", 62934 category: "theme", 62935 description: "Display the description of categories, tags and custom taxonomies when viewing an archive.", 62936 textdomain: "default", 62937 usesContext: ["termId", "taxonomy"], 62938 attributes: { 62939 textAlign: { 62940 type: "string" 62941 } 62942 }, 62943 supports: { 62944 align: ["wide", "full"], 62945 html: false, 62946 color: { 62947 link: true, 62948 __experimentalDefaultControls: { 62949 background: true, 62950 text: true 62951 } 62952 }, 62953 spacing: { 62954 padding: true, 62955 margin: true 62956 }, 62957 typography: { 62958 fontSize: true, 62959 lineHeight: true, 62960 __experimentalFontFamily: true, 62961 __experimentalFontWeight: true, 62962 __experimentalFontStyle: true, 62963 __experimentalTextTransform: true, 62964 __experimentalTextDecoration: true, 62965 __experimentalLetterSpacing: true, 62966 __experimentalDefaultControls: { 62967 fontSize: true 62968 } 62969 }, 62970 interactivity: { 62971 clientNavigation: true 62972 }, 62973 __experimentalBorder: { 62974 radius: true, 62975 color: true, 62976 width: true, 62977 style: true, 62978 __experimentalDefaultControls: { 62979 radius: true, 62980 color: true, 62981 width: true, 62982 style: true 62983 } 62984 } 62985 } 62986 }; 62987 62988 // packages/block-library/build-module/term-description/edit.js 62989 var import_i18n242 = __toESM(require_i18n()); 62990 var import_block_editor259 = __toESM(require_block_editor()); 62991 62992 // packages/block-library/build-module/term-description/use-term-description.js 62993 var import_core_data88 = __toESM(require_core_data()); 62994 var import_data141 = __toESM(require_data()); 62995 function useTermDescription(termId, taxonomy) { 62996 const [description, setDescription, fullDescription] = (0, import_core_data88.useEntityProp)( 62997 "taxonomy", 62998 taxonomy, 62999 "description", 63000 termId 63001 ); 63002 const templateBasedData = useTemplateBasedTermData2(); 63003 const hasContext = Boolean(termId && taxonomy); 63004 return { 63005 hasContext, 63006 setDescription, 63007 termDescription: hasContext ? fullDescription?.rendered || description || "" : templateBasedData 63008 }; 63009 } 63010 function useTemplateBasedTermData2() { 63011 const templateSlug = (0, import_data141.useSelect)((select9) => { 63012 const { getCurrentPostId, getCurrentPostType, getCurrentTemplateId } = select9("core/editor"); 63013 const currentPostType = getCurrentPostType(); 63014 const templateId = getCurrentTemplateId() || (currentPostType === "wp_template" ? getCurrentPostId() : null); 63015 return templateId ? select9(import_core_data88.store).getEditedEntityRecord( 63016 "postType", 63017 "wp_template", 63018 templateId 63019 )?.slug : null; 63020 }, []); 63021 const taxonomyMatches = templateSlug?.match( 63022 /^(category|tag|taxonomy-([^-]+))$|^(((category|tag)|taxonomy-([^-]+))-(.+))$/ 63023 ); 63024 let taxonomy; 63025 let termSlug; 63026 if (taxonomyMatches) { 63027 if (taxonomyMatches[1]) { 63028 taxonomy = taxonomyMatches[2] ? taxonomyMatches[2] : taxonomyMatches[1]; 63029 } else if (taxonomyMatches[3]) { 63030 taxonomy = taxonomyMatches[6] ? taxonomyMatches[6] : taxonomyMatches[4]; 63031 termSlug = taxonomyMatches[7]; 63032 } 63033 taxonomy = taxonomy === "tag" ? "post_tag" : taxonomy; 63034 } 63035 return (0, import_data141.useSelect)( 63036 (select9) => { 63037 if (!taxonomy || !termSlug) { 63038 return ""; 63039 } 63040 const { getEntityRecords } = select9(import_core_data88.store); 63041 const termRecords = getEntityRecords("taxonomy", taxonomy, { 63042 slug: termSlug, 63043 per_page: 1 63044 }); 63045 if (termRecords && termRecords[0]) { 63046 return termRecords[0].description || ""; 63047 } 63048 return ""; 63049 }, 63050 [taxonomy, termSlug] 63051 ); 63052 } 63053 63054 // packages/block-library/build-module/term-description/edit.js 63055 var import_jsx_runtime492 = __toESM(require_jsx_runtime()); 63056 function TermDescriptionEdit({ 63057 attributes: attributes3, 63058 setAttributes, 63059 mergedStyle, 63060 context: { termId, taxonomy } 63061 }) { 63062 const { textAlign } = attributes3; 63063 const { termDescription } = useTermDescription(termId, taxonomy); 63064 const blockProps = (0, import_block_editor259.useBlockProps)({ 63065 className: clsx_default({ 63066 [`has-text-align-$textAlign}`]: textAlign 63067 }), 63068 style: mergedStyle 63069 }); 63070 return /* @__PURE__ */ (0, import_jsx_runtime492.jsxs)(import_jsx_runtime492.Fragment, { children: [ 63071 /* @__PURE__ */ (0, import_jsx_runtime492.jsx)(import_block_editor259.BlockControls, { group: "block", children: /* @__PURE__ */ (0, import_jsx_runtime492.jsx)( 63072 import_block_editor259.AlignmentControl, 63073 { 63074 value: textAlign, 63075 onChange: (nextAlign) => { 63076 setAttributes({ textAlign: nextAlign }); 63077 } 63078 } 63079 ) }), 63080 /* @__PURE__ */ (0, import_jsx_runtime492.jsx)("div", { ...blockProps, children: termDescription ? /* @__PURE__ */ (0, import_jsx_runtime492.jsx)( 63081 "div", 63082 { 63083 dangerouslySetInnerHTML: { __html: termDescription } 63084 } 63085 ) : /* @__PURE__ */ (0, import_jsx_runtime492.jsx)("div", { className: "wp-block-term-description__placeholder", children: /* @__PURE__ */ (0, import_jsx_runtime492.jsx)("span", { children: (0, import_i18n242.__)("Term Description") }) }) }) 63086 ] }); 63087 } 63088 63089 // packages/block-library/build-module/term-description/index.js 63090 var { name: name109 } = block_default108; 63091 var settings108 = { 63092 icon: term_description_default, 63093 edit: TermDescriptionEdit, 63094 example: {} 63095 }; 63096 var init108 = () => initBlock({ name: name109, metadata: block_default108, settings: settings108 }); 63097 63098 // packages/block-library/build-module/term-name/index.js 63099 var term_name_exports = {}; 63100 __export(term_name_exports, { 63101 init: () => init109, 63102 metadata: () => block_default109, 63103 name: () => name110, 63104 settings: () => settings109 63105 }); 63106 63107 // packages/block-library/build-module/term-name/block.json 63108 var block_default109 = { 63109 $schema: "https://schemas.wp.org/trunk/block.json", 63110 apiVersion: 3, 63111 name: "core/term-name", 63112 title: "Term Name", 63113 category: "theme", 63114 description: "Displays the name of a taxonomy term.", 63115 keywords: ["term title"], 63116 textdomain: "default", 63117 usesContext: ["termId", "taxonomy"], 63118 attributes: { 63119 textAlign: { 63120 type: "string" 63121 }, 63122 level: { 63123 type: "number", 63124 default: 0 63125 }, 63126 isLink: { 63127 type: "boolean", 63128 default: false 63129 }, 63130 levelOptions: { 63131 type: "array" 63132 } 63133 }, 63134 supports: { 63135 align: ["wide", "full"], 63136 html: false, 63137 color: { 63138 gradients: true, 63139 link: true, 63140 __experimentalDefaultControls: { 63141 background: true, 63142 text: true, 63143 link: true 63144 } 63145 }, 63146 spacing: { 63147 padding: true 63148 }, 63149 typography: { 63150 fontSize: true, 63151 lineHeight: true, 63152 __experimentalFontFamily: true, 63153 __experimentalFontWeight: true, 63154 __experimentalFontStyle: true, 63155 __experimentalTextTransform: true, 63156 __experimentalTextDecoration: true, 63157 __experimentalLetterSpacing: true, 63158 __experimentalDefaultControls: { 63159 fontSize: true 63160 } 63161 }, 63162 interactivity: { 63163 clientNavigation: true 63164 }, 63165 __experimentalBorder: { 63166 radius: true, 63167 color: true, 63168 width: true, 63169 style: true, 63170 __experimentalDefaultControls: { 63171 color: true, 63172 width: true, 63173 style: true 63174 } 63175 } 63176 }, 63177 style: "wp-block-term-name" 63178 }; 63179 63180 // packages/block-library/build-module/term-name/edit.js 63181 var import_i18n243 = __toESM(require_i18n()); 63182 var import_block_editor260 = __toESM(require_block_editor()); 63183 var import_components161 = __toESM(require_components()); 63184 var import_html_entities17 = __toESM(require_html_entities()); 63185 63186 // packages/block-library/build-module/term-name/use-term-name.js 63187 var import_core_data89 = __toESM(require_core_data()); 63188 var import_data142 = __toESM(require_data()); 63189 function useTermName(termId, taxonomy) { 63190 const contextBasedTerm = (0, import_data142.useSelect)( 63191 (select9) => { 63192 if (!termId || !taxonomy) { 63193 return null; 63194 } 63195 return select9(import_core_data89.store).getEntityRecord( 63196 "taxonomy", 63197 taxonomy, 63198 termId 63199 ); 63200 }, 63201 [termId, taxonomy] 63202 ); 63203 const templateBasedTerm = useTemplateBasedTermData3(); 63204 const hasContext = Boolean(termId && taxonomy); 63205 return { 63206 hasContext, 63207 term: hasContext ? contextBasedTerm : templateBasedTerm 63208 }; 63209 } 63210 function useTemplateBasedTermData3() { 63211 const templateSlug = (0, import_data142.useSelect)((select9) => { 63212 const { getCurrentPostId, getCurrentPostType, getCurrentTemplateId } = select9("core/editor"); 63213 const currentPostType = getCurrentPostType(); 63214 const templateId = getCurrentTemplateId() || (currentPostType === "wp_template" ? getCurrentPostId() : null); 63215 return templateId ? select9(import_core_data89.store).getEditedEntityRecord( 63216 "postType", 63217 "wp_template", 63218 templateId 63219 )?.slug : null; 63220 }, []); 63221 const taxonomyMatches = templateSlug?.match( 63222 /^(category|tag|taxonomy-([^-]+))$|^(((category|tag)|taxonomy-([^-]+))-(.+))$/ 63223 ); 63224 let taxonomy; 63225 let termSlug; 63226 if (taxonomyMatches) { 63227 if (taxonomyMatches[3]) { 63228 taxonomy = taxonomyMatches[6] ? taxonomyMatches[6] : taxonomyMatches[4]; 63229 termSlug = taxonomyMatches[7]; 63230 } 63231 taxonomy = taxonomy === "tag" ? "post_tag" : taxonomy; 63232 } 63233 return (0, import_data142.useSelect)( 63234 (select9) => { 63235 if (!taxonomy || !termSlug) { 63236 return null; 63237 } 63238 const { getEntityRecords } = select9(import_core_data89.store); 63239 const termRecords = getEntityRecords("taxonomy", taxonomy, { 63240 slug: termSlug, 63241 per_page: 1 63242 }); 63243 if (termRecords && termRecords[0]) { 63244 return termRecords[0]; 63245 } 63246 return null; 63247 }, 63248 [taxonomy, termSlug] 63249 ); 63250 } 63251 63252 // packages/block-library/build-module/term-name/edit.js 63253 var import_jsx_runtime493 = __toESM(require_jsx_runtime()); 63254 function TermNameEdit({ 63255 attributes: attributes3, 63256 setAttributes, 63257 context: { termId, taxonomy } 63258 }) { 63259 const { textAlign, level = 0, isLink, levelOptions } = attributes3; 63260 const { term } = useTermName(termId, taxonomy); 63261 const termName2 = term?.name ? (0, import_html_entities17.decodeEntities)(term.name) : (0, import_i18n243.__)("Term Name"); 63262 const blockProps = (0, import_block_editor260.useBlockProps)({ 63263 className: clsx_default({ 63264 [`has-text-align-$textAlign}`]: textAlign 63265 }) 63266 }); 63267 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 63268 const TagName2 = level === 0 ? "p" : `h$level}`; 63269 let termNameDisplay = termName2; 63270 if (isLink) { 63271 termNameDisplay = /* @__PURE__ */ (0, import_jsx_runtime493.jsx)( 63272 "a", 63273 { 63274 href: "#term-name-pseudo-link", 63275 onClick: (e2) => e2.preventDefault(), 63276 children: termName2 63277 } 63278 ); 63279 } 63280 return /* @__PURE__ */ (0, import_jsx_runtime493.jsxs)(import_jsx_runtime493.Fragment, { children: [ 63281 /* @__PURE__ */ (0, import_jsx_runtime493.jsxs)(import_block_editor260.BlockControls, { group: "block", children: [ 63282 /* @__PURE__ */ (0, import_jsx_runtime493.jsx)( 63283 import_block_editor260.HeadingLevelDropdown, 63284 { 63285 value: level, 63286 options: levelOptions, 63287 onChange: (newLevel) => { 63288 setAttributes({ level: newLevel }); 63289 } 63290 } 63291 ), 63292 /* @__PURE__ */ (0, import_jsx_runtime493.jsx)( 63293 import_block_editor260.AlignmentControl, 63294 { 63295 value: textAlign, 63296 onChange: (nextAlign) => { 63297 setAttributes({ textAlign: nextAlign }); 63298 } 63299 } 63300 ) 63301 ] }), 63302 /* @__PURE__ */ (0, import_jsx_runtime493.jsx)(import_block_editor260.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime493.jsx)( 63303 import_components161.__experimentalToolsPanel, 63304 { 63305 label: (0, import_i18n243.__)("Settings"), 63306 resetAll: () => { 63307 setAttributes({ 63308 isLink: false 63309 }); 63310 }, 63311 dropdownMenuProps, 63312 children: /* @__PURE__ */ (0, import_jsx_runtime493.jsx)( 63313 import_components161.__experimentalToolsPanelItem, 63314 { 63315 hasValue: () => !!isLink, 63316 label: (0, import_i18n243.__)("Make term name a link"), 63317 onDeselect: () => setAttributes({ isLink: false }), 63318 isShownByDefault: true, 63319 children: /* @__PURE__ */ (0, import_jsx_runtime493.jsx)( 63320 import_components161.ToggleControl, 63321 { 63322 label: (0, import_i18n243.__)("Make term name a link"), 63323 onChange: () => setAttributes({ isLink: !isLink }), 63324 checked: isLink 63325 } 63326 ) 63327 } 63328 ) 63329 } 63330 ) }), 63331 /* @__PURE__ */ (0, import_jsx_runtime493.jsx)(TagName2, { ...blockProps, children: termNameDisplay }) 63332 ] }); 63333 } 63334 63335 // packages/block-library/build-module/term-name/index.js 63336 var { name: name110 } = block_default109; 63337 var settings109 = { 63338 icon: term_name_default, 63339 example: {}, 63340 edit: TermNameEdit 63341 }; 63342 var init109 = () => initBlock({ name: name110, metadata: block_default109, settings: settings109 }); 63343 63344 // packages/block-library/build-module/terms-query/index.js 63345 var terms_query_exports = {}; 63346 __export(terms_query_exports, { 63347 init: () => init110, 63348 metadata: () => block_default110, 63349 name: () => name111, 63350 settings: () => settings110 63351 }); 63352 63353 // packages/block-library/build-module/terms-query/block.json 63354 var block_default110 = { 63355 $schema: "https://schemas.wp.org/trunk/block.json", 63356 apiVersion: 3, 63357 name: "core/terms-query", 63358 title: "Terms Query", 63359 category: "theme", 63360 description: "An advanced block that allows displaying taxonomy terms based on different query parameters and visual configurations.", 63361 keywords: ["terms", "taxonomy", "categories", "tags", "list"], 63362 textdomain: "default", 63363 attributes: { 63364 termQuery: { 63365 type: "object", 63366 default: { 63367 perPage: 10, 63368 taxonomy: "category", 63369 order: "asc", 63370 orderBy: "name", 63371 include: [], 63372 hideEmpty: true, 63373 showNested: false, 63374 inherit: false 63375 } 63376 }, 63377 tagName: { 63378 type: "string", 63379 default: "div" 63380 } 63381 }, 63382 usesContext: ["templateSlug"], 63383 providesContext: { 63384 termQuery: "termQuery" 63385 }, 63386 supports: { 63387 align: ["wide", "full"], 63388 html: false, 63389 layout: true, 63390 interactivity: true 63391 } 63392 }; 63393 63394 // packages/block-library/build-module/terms-query/edit/index.js 63395 var import_data146 = __toESM(require_data()); 63396 var import_block_editor265 = __toESM(require_block_editor()); 63397 63398 // packages/block-library/build-module/terms-query/edit/terms-query-content.js 63399 var import_element131 = __toESM(require_element()); 63400 var import_block_editor263 = __toESM(require_block_editor()); 63401 63402 // packages/block-library/build-module/terms-query/edit/inspector-controls/index.js 63403 var import_i18n248 = __toESM(require_i18n()); 63404 var import_components169 = __toESM(require_components()); 63405 var import_block_editor262 = __toESM(require_block_editor()); 63406 63407 // packages/block-library/build-module/terms-query/utils.js 63408 var import_core_data90 = __toESM(require_core_data()); 63409 var import_data143 = __toESM(require_data()); 63410 var import_element129 = __toESM(require_element()); 63411 function usePublicTaxonomies() { 63412 const taxonomies = (0, import_data143.useSelect)( 63413 (select9) => select9(import_core_data90.store).getTaxonomies({ per_page: -1 }), 63414 [] 63415 ); 63416 return (0, import_element129.useMemo)(() => { 63417 return taxonomies?.filter( 63418 ({ visibility }) => visibility?.publicly_queryable 63419 ) || []; 63420 }, [taxonomies]); 63421 } 63422 63423 // packages/block-library/build-module/terms-query/edit/inspector-controls/taxonomy-control.js 63424 var import_components162 = __toESM(require_components()); 63425 var import_jsx_runtime494 = __toESM(require_jsx_runtime()); 63426 function TaxonomyControl({ value, onChange, ...props }) { 63427 const taxonomies = usePublicTaxonomies(); 63428 const taxonomyOptions = taxonomies.map((taxonomy) => ({ 63429 label: taxonomy.name, 63430 value: taxonomy.slug 63431 })); 63432 return /* @__PURE__ */ (0, import_jsx_runtime494.jsx)( 63433 import_components162.SelectControl, 63434 { 63435 __next40pxDefaultSize: true, 63436 options: taxonomyOptions, 63437 value, 63438 onChange, 63439 ...props 63440 } 63441 ); 63442 } 63443 63444 // packages/block-library/build-module/terms-query/edit/inspector-controls/order-control.js 63445 var import_i18n244 = __toESM(require_i18n()); 63446 var import_components163 = __toESM(require_components()); 63447 var import_jsx_runtime495 = __toESM(require_jsx_runtime()); 63448 function OrderControl2({ orderBy, order, onChange, ...props }) { 63449 return /* @__PURE__ */ (0, import_jsx_runtime495.jsx)( 63450 import_components163.SelectControl, 63451 { 63452 __next40pxDefaultSize: true, 63453 options: [ 63454 { 63455 label: (0, import_i18n244.__)("Name: A \u2192 Z"), 63456 value: "name/asc" 63457 }, 63458 { 63459 label: (0, import_i18n244.__)("Name: Z \u2192 A"), 63460 value: "name/desc" 63461 }, 63462 { 63463 label: (0, import_i18n244.__)("Count, high to low"), 63464 value: "count/desc" 63465 }, 63466 { 63467 label: (0, import_i18n244.__)("Count, low to high"), 63468 value: "count/asc" 63469 } 63470 ], 63471 value: orderBy + "/" + order, 63472 onChange: (value) => { 63473 const [newOrderBy, newOrder] = value.split("/"); 63474 onChange(newOrderBy, newOrder); 63475 }, 63476 ...props 63477 } 63478 ); 63479 } 63480 63481 // packages/block-library/build-module/terms-query/edit/inspector-controls/empty-terms-control.js 63482 var import_components164 = __toESM(require_components()); 63483 var import_jsx_runtime496 = __toESM(require_jsx_runtime()); 63484 function EmptyTermsControl({ value, onChange, ...props }) { 63485 return /* @__PURE__ */ (0, import_jsx_runtime496.jsx)( 63486 import_components164.ToggleControl, 63487 { 63488 checked: !value, 63489 onChange: (showEmpty) => onChange(!showEmpty), 63490 ...props 63491 } 63492 ); 63493 } 63494 63495 // packages/block-library/build-module/terms-query/edit/inspector-controls/nested-terms-control.js 63496 var import_components165 = __toESM(require_components()); 63497 var import_jsx_runtime497 = __toESM(require_jsx_runtime()); 63498 function NestedTermsControl({ value, onChange, ...props }) { 63499 return /* @__PURE__ */ (0, import_jsx_runtime497.jsx)(import_components165.ToggleControl, { checked: value, onChange, ...props }); 63500 } 63501 63502 // packages/block-library/build-module/terms-query/edit/inspector-controls/inherit-control.js 63503 var import_components166 = __toESM(require_components()); 63504 var import_i18n245 = __toESM(require_i18n()); 63505 var import_jsx_runtime498 = __toESM(require_jsx_runtime()); 63506 function InheritControl({ value, onChange, label }) { 63507 return /* @__PURE__ */ (0, import_jsx_runtime498.jsxs)( 63508 import_components166.__experimentalToggleGroupControl, 63509 { 63510 __next40pxDefaultSize: true, 63511 label, 63512 isBlock: true, 63513 onChange: (newValue) => { 63514 onChange({ 63515 inherit: newValue === "default" 63516 }); 63517 }, 63518 help: value ? (0, import_i18n245.__)( 63519 "Display terms based on the current taxonomy archive. For hierarchical taxonomies, shows children of the current term. For non-hierarchical taxonomies, shows all terms." 63520 ) : (0, import_i18n245.__)("Display terms based on specific criteria."), 63521 value: value ? "default" : "custom", 63522 children: [ 63523 /* @__PURE__ */ (0, import_jsx_runtime498.jsx)( 63524 import_components166.__experimentalToggleGroupControlOption, 63525 { 63526 value: "default", 63527 label: (0, import_i18n245.__)("Default") 63528 } 63529 ), 63530 /* @__PURE__ */ (0, import_jsx_runtime498.jsx)(import_components166.__experimentalToggleGroupControlOption, { value: "custom", label: (0, import_i18n245.__)("Custom") }) 63531 ] 63532 } 63533 ); 63534 } 63535 63536 // packages/block-library/build-module/terms-query/edit/inspector-controls/max-terms-control.js 63537 var import_i18n246 = __toESM(require_i18n()); 63538 var import_components167 = __toESM(require_components()); 63539 var import_jsx_runtime499 = __toESM(require_jsx_runtime()); 63540 function MaxTermsControl({ value, onChange, ...props }) { 63541 return /* @__PURE__ */ (0, import_jsx_runtime499.jsx)( 63542 import_components167.RangeControl, 63543 { 63544 __next40pxDefaultSize: true, 63545 value, 63546 min: 0, 63547 max: 100, 63548 onChange, 63549 help: (0, import_i18n246.__)( 63550 "Limit the number of terms you want to show. To show all terms, use 0 (zero)." 63551 ), 63552 ...props 63553 } 63554 ); 63555 } 63556 63557 // packages/block-library/build-module/terms-query/edit/inspector-controls/advanced-controls.js 63558 var import_i18n247 = __toESM(require_i18n()); 63559 var import_block_editor261 = __toESM(require_block_editor()); 63560 var import_jsx_runtime500 = __toESM(require_jsx_runtime()); 63561 var { HTMLElementControl: HTMLElementControl8 } = unlock(import_block_editor261.privateApis); 63562 function AdvancedControls({ 63563 TagName: TagName2, 63564 setAttributes, 63565 clientId 63566 }) { 63567 return /* @__PURE__ */ (0, import_jsx_runtime500.jsx)(import_block_editor261.InspectorControls, { group: "advanced", children: /* @__PURE__ */ (0, import_jsx_runtime500.jsx)( 63568 HTMLElementControl8, 63569 { 63570 tagName: TagName2, 63571 onChange: (value) => setAttributes({ tagName: value }), 63572 clientId, 63573 options: [ 63574 { label: (0, import_i18n247.__)("Default (<div>)"), value: "div" }, 63575 { label: "<main>", value: "main" }, 63576 { label: "<section>", value: "section" }, 63577 { label: "<aside>", value: "aside" } 63578 ] 63579 } 63580 ) }); 63581 } 63582 63583 // packages/block-library/build-module/terms-query/edit/inspector-controls/include-control.js 63584 var import_components168 = __toESM(require_components()); 63585 var import_data144 = __toESM(require_data()); 63586 var import_core_data91 = __toESM(require_core_data()); 63587 var import_element130 = __toESM(require_element()); 63588 var import_compose52 = __toESM(require_compose()); 63589 var import_html_entities18 = __toESM(require_html_entities()); 63590 var import_jsx_runtime501 = __toESM(require_jsx_runtime()); 63591 var EMPTY_ARRAY6 = []; 63592 var BASE_QUERY3 = { 63593 order: "asc", 63594 _fields: "id,name", 63595 context: "view" 63596 }; 63597 function IncludeControl({ 63598 value: include, 63599 taxonomy, 63600 onChange, 63601 ...props 63602 }) { 63603 const [search, setSearch] = (0, import_element130.useState)(""); 63604 const [value, setValue] = (0, import_element130.useState)(EMPTY_ARRAY6); 63605 const [suggestions, setSuggestions] = (0, import_element130.useState)(EMPTY_ARRAY6); 63606 const debouncedSearch = (0, import_compose52.useDebounce)(setSearch, 250); 63607 const { searchResults, searchHasResolved } = (0, import_data144.useSelect)( 63608 (select9) => { 63609 if (!search) { 63610 return { searchResults: EMPTY_ARRAY6, searchHasResolved: true }; 63611 } 63612 const { getEntityRecords, hasFinishedResolution } = select9(import_core_data91.store); 63613 const selectorArgs = [ 63614 "taxonomy", 63615 taxonomy, 63616 { 63617 ...BASE_QUERY3, 63618 search, 63619 orderby: "name", 63620 exclude: include, 63621 per_page: 20 63622 } 63623 ]; 63624 return { 63625 searchResults: getEntityRecords(...selectorArgs), 63626 searchHasResolved: hasFinishedResolution( 63627 "getEntityRecords", 63628 selectorArgs 63629 ) 63630 }; 63631 }, 63632 [search, taxonomy, include] 63633 ); 63634 const currentTerms = (0, import_data144.useSelect)( 63635 (select9) => { 63636 if (!include?.length) { 63637 return EMPTY_ARRAY6; 63638 } 63639 const { getEntityRecords } = select9(import_core_data91.store); 63640 return getEntityRecords("taxonomy", taxonomy, { 63641 ...BASE_QUERY3, 63642 include, 63643 per_page: include.length 63644 }); 63645 }, 63646 [include, taxonomy] 63647 ); 63648 (0, import_element130.useEffect)(() => { 63649 if (!include?.length) { 63650 setValue(EMPTY_ARRAY6); 63651 } 63652 if (!currentTerms?.length) { 63653 return; 63654 } 63655 const sanitizedValue = include.reduce((accumulator, id) => { 63656 const entity = currentTerms.find((term) => term.id === id); 63657 if (entity) { 63658 accumulator.push({ 63659 id, 63660 value: (0, import_html_entities18.decodeEntities)(entity.name) 63661 }); 63662 } 63663 return accumulator; 63664 }, []); 63665 setValue(sanitizedValue); 63666 }, [include, currentTerms]); 63667 const entitiesInfo = (0, import_element130.useMemo)(() => { 63668 if (!searchResults?.length) { 63669 return { names: EMPTY_ARRAY6, mapByName: {} }; 63670 } 63671 const names = []; 63672 const mapByName = {}; 63673 searchResults.forEach((result) => { 63674 const decodedName = (0, import_html_entities18.decodeEntities)(result.name); 63675 names.push(decodedName); 63676 mapByName[decodedName] = result; 63677 }); 63678 return { names, mapByName }; 63679 }, [searchResults]); 63680 (0, import_element130.useEffect)(() => { 63681 if (!searchHasResolved) { 63682 return; 63683 } 63684 setSuggestions(entitiesInfo.names); 63685 }, [entitiesInfo.names, searchHasResolved]); 63686 const getIdByValue = (entitiesMappedByName, entity) => entity?.id || entitiesMappedByName?.[entity]?.id; 63687 const onTermChange = (newValue) => { 63688 const ids = Array.from( 63689 newValue.reduce((accumulator, entity) => { 63690 const id = getIdByValue(entitiesInfo.mapByName, entity); 63691 if (id) { 63692 accumulator.add(id); 63693 } 63694 return accumulator; 63695 }, /* @__PURE__ */ new Set()) 63696 ); 63697 setSuggestions(EMPTY_ARRAY6); 63698 onChange(ids); 63699 }; 63700 return /* @__PURE__ */ (0, import_jsx_runtime501.jsx)( 63701 import_components168.FormTokenField, 63702 { 63703 __next40pxDefaultSize: true, 63704 value, 63705 onInputChange: debouncedSearch, 63706 suggestions, 63707 onChange: onTermChange, 63708 __experimentalShowHowTo: false, 63709 ...props 63710 } 63711 ); 63712 } 63713 63714 // packages/block-library/build-module/terms-query/edit/inspector-controls/index.js 63715 var import_jsx_runtime502 = __toESM(require_jsx_runtime()); 63716 function TermsQueryInspectorControls({ 63717 attributes: attributes3, 63718 setQuery, 63719 setAttributes, 63720 clientId, 63721 templateSlug 63722 }) { 63723 const { termQuery, tagName: TagName2 } = attributes3; 63724 const { 63725 taxonomy, 63726 orderBy, 63727 order, 63728 hideEmpty, 63729 inherit, 63730 showNested, 63731 perPage, 63732 include 63733 } = termQuery; 63734 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 63735 const taxonomies = usePublicTaxonomies(); 63736 const isTaxonomyHierarchical = taxonomies.find( 63737 (_taxonomy) => _taxonomy.slug === taxonomy 63738 )?.hierarchical; 63739 const inheritQuery = !!inherit; 63740 const displayInheritControl = ["taxonomy", "category", "tag", "archive"].includes(templateSlug) || templateSlug?.startsWith("taxonomy-") || templateSlug?.startsWith("category-") || templateSlug?.startsWith("tag-"); 63741 const displayShowNestedControl = isTaxonomyHierarchical; 63742 const hasIncludeFilter = !!include?.length; 63743 const queryTypeControlLabel = (0, import_i18n248.__)("Query type"); 63744 const taxonomyControlLabel = (0, import_i18n248.__)("Taxonomy"); 63745 const orderByControlLabel = (0, import_i18n248.__)("Order by"); 63746 const emptyTermsControlLabel = (0, import_i18n248.__)("Show empty terms"); 63747 const nestedTermsControlLabel = (0, import_i18n248.__)("Show nested terms"); 63748 const maxTermsControlLabel = (0, import_i18n248.__)("Max terms"); 63749 const includeControlLabel = (0, import_i18n248.__)("Selected terms"); 63750 return /* @__PURE__ */ (0, import_jsx_runtime502.jsxs)(import_jsx_runtime502.Fragment, { children: [ 63751 /* @__PURE__ */ (0, import_jsx_runtime502.jsx)(import_block_editor262.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime502.jsxs)( 63752 import_components169.__experimentalToolsPanel, 63753 { 63754 label: (0, import_i18n248.__)("Settings"), 63755 resetAll: () => { 63756 setAttributes({ 63757 termQuery: { 63758 taxonomy: "category", 63759 order: "asc", 63760 orderBy: "name", 63761 include: [], 63762 hideEmpty: true, 63763 showNested: false, 63764 inherit: false, 63765 perPage: 10 63766 } 63767 }); 63768 }, 63769 dropdownMenuProps, 63770 children: [ 63771 displayInheritControl && /* @__PURE__ */ (0, import_jsx_runtime502.jsx)( 63772 import_components169.__experimentalToolsPanelItem, 63773 { 63774 hasValue: () => inherit !== false, 63775 label: queryTypeControlLabel, 63776 onDeselect: () => setQuery({ inherit: false }), 63777 isShownByDefault: true, 63778 children: /* @__PURE__ */ (0, import_jsx_runtime502.jsx)( 63779 InheritControl, 63780 { 63781 label: queryTypeControlLabel, 63782 value: inherit, 63783 onChange: setQuery 63784 } 63785 ) 63786 } 63787 ), 63788 !inheritQuery && /* @__PURE__ */ (0, import_jsx_runtime502.jsx)( 63789 import_components169.__experimentalToolsPanelItem, 63790 { 63791 hasValue: () => taxonomy !== "category", 63792 label: taxonomyControlLabel, 63793 onDeselect: () => { 63794 setQuery({ taxonomy: "category" }); 63795 }, 63796 isShownByDefault: true, 63797 children: /* @__PURE__ */ (0, import_jsx_runtime502.jsx)( 63798 TaxonomyControl, 63799 { 63800 label: taxonomyControlLabel, 63801 value: taxonomy, 63802 onChange: (value) => ( 63803 // We also need to reset the include filter when changing taxonomy. 63804 setQuery({ taxonomy: value, include: [] }) 63805 ) 63806 } 63807 ) 63808 } 63809 ), 63810 /* @__PURE__ */ (0, import_jsx_runtime502.jsx)( 63811 import_components169.__experimentalToolsPanelItem, 63812 { 63813 hasValue: () => orderBy !== "name" || order !== "asc", 63814 label: orderByControlLabel, 63815 onDeselect: () => setQuery({ orderBy: "name", order: "asc" }), 63816 isShownByDefault: true, 63817 children: /* @__PURE__ */ (0, import_jsx_runtime502.jsx)( 63818 OrderControl2, 63819 { 63820 label: orderByControlLabel, 63821 ...{ orderBy, order }, 63822 onChange: (newOrderBy, newOrder) => { 63823 setQuery({ 63824 orderBy: newOrderBy, 63825 order: newOrder 63826 }); 63827 }, 63828 disabled: hasIncludeFilter, 63829 help: hasIncludeFilter ? (0, import_i18n248.__)( 63830 "When specific terms are selected, the order is based on their selection order." 63831 ) : void 0 63832 } 63833 ) 63834 } 63835 ), 63836 !inheritQuery && /* @__PURE__ */ (0, import_jsx_runtime502.jsx)( 63837 import_components169.__experimentalToolsPanelItem, 63838 { 63839 hasValue: () => !!include?.length, 63840 label: includeControlLabel, 63841 onDeselect: () => setQuery({ 63842 include: [], 63843 orderBy: "name", 63844 order: "asc" 63845 }), 63846 isShownByDefault: true, 63847 children: /* @__PURE__ */ (0, import_jsx_runtime502.jsx)( 63848 IncludeControl, 63849 { 63850 label: includeControlLabel, 63851 taxonomy, 63852 value: include, 63853 onChange: (value) => setQuery({ include: value }) 63854 } 63855 ) 63856 } 63857 ), 63858 /* @__PURE__ */ (0, import_jsx_runtime502.jsx)( 63859 import_components169.__experimentalToolsPanelItem, 63860 { 63861 hasValue: () => hideEmpty !== true, 63862 label: emptyTermsControlLabel, 63863 onDeselect: () => setQuery({ hideEmpty: true }), 63864 isShownByDefault: true, 63865 children: /* @__PURE__ */ (0, import_jsx_runtime502.jsx)( 63866 EmptyTermsControl, 63867 { 63868 label: emptyTermsControlLabel, 63869 value: hideEmpty, 63870 onChange: (value) => setQuery({ hideEmpty: value }) 63871 } 63872 ) 63873 } 63874 ), 63875 displayShowNestedControl && /* @__PURE__ */ (0, import_jsx_runtime502.jsx)( 63876 import_components169.__experimentalToolsPanelItem, 63877 { 63878 hasValue: () => showNested !== false, 63879 label: nestedTermsControlLabel, 63880 onDeselect: () => setQuery({ showNested: false }), 63881 isShownByDefault: true, 63882 children: /* @__PURE__ */ (0, import_jsx_runtime502.jsx)( 63883 NestedTermsControl, 63884 { 63885 label: nestedTermsControlLabel, 63886 value: showNested, 63887 onChange: (value) => setQuery({ showNested: value }), 63888 disabled: hasIncludeFilter, 63889 help: hasIncludeFilter ? (0, import_i18n248.__)( 63890 "When specific terms are selected, only those are displayed." 63891 ) : void 0 63892 } 63893 ) 63894 } 63895 ), 63896 /* @__PURE__ */ (0, import_jsx_runtime502.jsx)( 63897 import_components169.__experimentalToolsPanelItem, 63898 { 63899 hasValue: () => perPage !== 10, 63900 label: maxTermsControlLabel, 63901 onDeselect: () => setQuery({ perPage: 10 }), 63902 isShownByDefault: true, 63903 children: /* @__PURE__ */ (0, import_jsx_runtime502.jsx)( 63904 MaxTermsControl, 63905 { 63906 label: maxTermsControlLabel, 63907 value: perPage, 63908 onChange: (value) => setQuery({ perPage: value }) 63909 } 63910 ) 63911 } 63912 ) 63913 ] 63914 } 63915 ) }), 63916 /* @__PURE__ */ (0, import_jsx_runtime502.jsx)( 63917 AdvancedControls, 63918 { 63919 TagName: TagName2, 63920 setAttributes, 63921 clientId 63922 } 63923 ) 63924 ] }); 63925 } 63926 63927 // packages/block-library/build-module/terms-query/edit/terms-query-content.js 63928 var import_jsx_runtime503 = __toESM(require_jsx_runtime()); 63929 var TEMPLATE17 = [["core/term-template"]]; 63930 function TermsQueryContent({ 63931 attributes: attributes3, 63932 setAttributes, 63933 clientId, 63934 context 63935 }) { 63936 const { tagName: TagName2 } = attributes3; 63937 const blockProps = (0, import_block_editor263.useBlockProps)(); 63938 const innerBlocksProps = (0, import_block_editor263.useInnerBlocksProps)(blockProps, { 63939 template: TEMPLATE17 63940 }); 63941 const setQuery = (0, import_element131.useCallback)( 63942 (newQuery) => setAttributes((prevAttributes) => ({ 63943 termQuery: { ...prevAttributes.termQuery, ...newQuery } 63944 })), 63945 [setAttributes] 63946 ); 63947 return /* @__PURE__ */ (0, import_jsx_runtime503.jsxs)(import_jsx_runtime503.Fragment, { children: [ 63948 /* @__PURE__ */ (0, import_jsx_runtime503.jsx)( 63949 TermsQueryInspectorControls, 63950 { 63951 attributes: attributes3, 63952 setQuery, 63953 setAttributes, 63954 clientId, 63955 templateSlug: context?.templateSlug 63956 } 63957 ), 63958 /* @__PURE__ */ (0, import_jsx_runtime503.jsx)(TagName2, { ...innerBlocksProps }) 63959 ] }); 63960 } 63961 63962 // packages/block-library/build-module/terms-query/edit/terms-query-placeholder.js 63963 var import_data145 = __toESM(require_data()); 63964 var import_blocks115 = __toESM(require_blocks()); 63965 var import_block_editor264 = __toESM(require_block_editor()); 63966 var import_jsx_runtime504 = __toESM(require_jsx_runtime()); 63967 function TermsQueryPlaceholder({ 63968 attributes: attributes3, 63969 clientId, 63970 name: name117 63971 }) { 63972 const { blockType, activeBlockVariation, scopeVariations } = (0, import_data145.useSelect)( 63973 (select9) => { 63974 const { 63975 getActiveBlockVariation, 63976 getBlockType: getBlockType5, 63977 getBlockVariations: getBlockVariations3 63978 } = select9(import_blocks115.store); 63979 return { 63980 blockType: getBlockType5(name117), 63981 activeBlockVariation: getActiveBlockVariation( 63982 name117, 63983 attributes3 63984 ), 63985 scopeVariations: getBlockVariations3(name117, "block") 63986 }; 63987 }, 63988 [name117, attributes3] 63989 ); 63990 const icon = activeBlockVariation?.icon?.src || activeBlockVariation?.icon || blockType?.icon?.src; 63991 const label = activeBlockVariation?.title || blockType?.title; 63992 const { replaceInnerBlocks } = (0, import_data145.useDispatch)(import_block_editor264.store); 63993 const blockProps = (0, import_block_editor264.useBlockProps)(); 63994 return /* @__PURE__ */ (0, import_jsx_runtime504.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime504.jsx)( 63995 import_block_editor264.__experimentalBlockVariationPicker, 63996 { 63997 icon, 63998 label, 63999 variations: scopeVariations, 64000 onSelect: (variation) => { 64001 if (variation.innerBlocks) { 64002 replaceInnerBlocks( 64003 clientId, 64004 (0, import_blocks115.createBlocksFromInnerBlocksTemplate)( 64005 variation.innerBlocks 64006 ), 64007 false 64008 ); 64009 } 64010 } 64011 } 64012 ) }); 64013 } 64014 64015 // packages/block-library/build-module/terms-query/edit/index.js 64016 var import_jsx_runtime505 = __toESM(require_jsx_runtime()); 64017 var TermsQueryEdit = (props) => { 64018 const hasInnerBlocks = (0, import_data146.useSelect)( 64019 (select9) => !!select9(import_block_editor265.store).getBlocks(props.clientId).length, 64020 [props.clientId] 64021 ); 64022 const Component = hasInnerBlocks ? TermsQueryContent : TermsQueryPlaceholder; 64023 return /* @__PURE__ */ (0, import_jsx_runtime505.jsx)(Component, { ...props }); 64024 }; 64025 var edit_default35 = TermsQueryEdit; 64026 64027 // packages/block-library/build-module/terms-query/save.js 64028 var import_block_editor266 = __toESM(require_block_editor()); 64029 var import_jsx_runtime506 = __toESM(require_jsx_runtime()); 64030 function save50({ attributes: { tagName: Tag = "div" } }) { 64031 const blockProps = import_block_editor266.useBlockProps.save(); 64032 const innerBlocksProps = import_block_editor266.useInnerBlocksProps.save(blockProps); 64033 return /* @__PURE__ */ (0, import_jsx_runtime506.jsx)(Tag, { ...innerBlocksProps }); 64034 } 64035 64036 // packages/block-library/build-module/terms-query/variations.js 64037 var import_i18n249 = __toESM(require_i18n()); 64038 var import_components170 = __toESM(require_components()); 64039 var import_jsx_runtime507 = __toESM(require_jsx_runtime()); 64040 var titleDate2 = /* @__PURE__ */ (0, import_jsx_runtime507.jsx)(import_components170.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 48 48", children: /* @__PURE__ */ (0, import_jsx_runtime507.jsx)(import_components170.Path, { d: "M 41,9 H 7 v 3 h 34 z m 0,9 H 7 v 3 h 34 z m 0,18 H 7 v 3 h 34 z m 0,-9 H 7 v 3 h 34 z" }) }); 64041 var titleExcerpt2 = /* @__PURE__ */ (0, import_jsx_runtime507.jsx)(import_components170.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 48 48", children: /* @__PURE__ */ (0, import_jsx_runtime507.jsx)(import_components170.Path, { d: "m 36,36 h 5 v 3 h -5 z m 0,-9 h 5 v 3 h -5 z m 0,-9 h 5 v 3 h -5 z m 0,-9 h 5 v 3 H 36 Z M 31,9 H 7 v 3 h 24 z m 0,9 H 7 v 3 h 24 z m 0,18 H 7 v 3 h 24 z m 0,-9 H 7 v 3 h 24 z" }) }); 64042 var termName = [ 64043 "core/term-name", 64044 { 64045 isLink: true 64046 } 64047 ]; 64048 var variations17 = [ 64049 { 64050 name: "name", 64051 title: (0, import_i18n249.__)("Name"), 64052 description: (0, import_i18n249.__)("Display the terms' names."), 64053 attributes: {}, 64054 icon: titleDate2, 64055 scope: ["block"], 64056 innerBlocks: [["core/term-template", {}, [termName]]] 64057 }, 64058 { 64059 name: "name-count", 64060 title: (0, import_i18n249.__)("Name & Count"), 64061 description: (0, import_i18n249.__)( 64062 "Display the terms' names and number of posts assigned to each term." 64063 ), 64064 attributes: {}, 64065 icon: titleExcerpt2, 64066 scope: ["block"], 64067 innerBlocks: [ 64068 [ 64069 "core/term-template", 64070 {}, 64071 [ 64072 [ 64073 "core/group", 64074 { layout: { type: "flex", flexWrap: "nowrap" } }, 64075 [termName, ["core/term-count"]] 64076 ] 64077 ] 64078 ] 64079 ] 64080 } 64081 ]; 64082 var variations_default17 = variations17; 64083 64084 // packages/block-library/build-module/terms-query/index.js 64085 var { name: name111 } = block_default110; 64086 var settings110 = { 64087 icon: loop_default, 64088 edit: edit_default35, 64089 save: save50, 64090 example: {}, 64091 variations: variations_default17 64092 }; 64093 var init110 = () => initBlock({ name: name111, metadata: block_default110, settings: settings110 }); 64094 64095 // packages/block-library/build-module/term-template/index.js 64096 var term_template_exports = {}; 64097 __export(term_template_exports, { 64098 init: () => init111, 64099 metadata: () => block_default111, 64100 name: () => name112, 64101 settings: () => settings111 64102 }); 64103 64104 // packages/block-library/build-module/term-template/block.json 64105 var block_default111 = { 64106 $schema: "https://schemas.wp.org/trunk/block.json", 64107 apiVersion: 3, 64108 name: "core/term-template", 64109 title: "Term Template", 64110 category: "theme", 64111 ancestor: ["core/terms-query"], 64112 description: "Contains the block elements used to render a taxonomy term, like the name, description, and more.", 64113 textdomain: "default", 64114 usesContext: ["termQuery"], 64115 supports: { 64116 reusable: false, 64117 html: false, 64118 align: ["wide", "full"], 64119 layout: true, 64120 color: { 64121 gradients: true, 64122 link: true, 64123 __experimentalDefaultControls: { 64124 background: true, 64125 text: true 64126 } 64127 }, 64128 typography: { 64129 fontSize: true, 64130 lineHeight: true, 64131 __experimentalFontFamily: true, 64132 __experimentalFontWeight: true, 64133 __experimentalFontStyle: true, 64134 __experimentalTextTransform: true, 64135 __experimentalTextDecoration: true, 64136 __experimentalLetterSpacing: true, 64137 __experimentalDefaultControls: { 64138 fontSize: true 64139 } 64140 }, 64141 spacing: { 64142 margin: true, 64143 padding: true, 64144 blockGap: { 64145 __experimentalDefault: "1.25em" 64146 }, 64147 __experimentalDefaultControls: { 64148 blockGap: true, 64149 padding: false, 64150 margin: false 64151 } 64152 }, 64153 interactivity: { 64154 clientNavigation: true 64155 }, 64156 __experimentalBorder: { 64157 radius: true, 64158 color: true, 64159 width: true, 64160 style: true 64161 } 64162 }, 64163 style: "wp-block-term-template", 64164 editorStyle: "wp-block-term-template-editor" 64165 }; 64166 64167 // packages/block-library/build-module/term-template/edit.js 64168 var import_components171 = __toESM(require_components()); 64169 var import_element132 = __toESM(require_element()); 64170 var import_data147 = __toESM(require_data()); 64171 var import_i18n250 = __toESM(require_i18n()); 64172 var import_block_editor267 = __toESM(require_block_editor()); 64173 var import_core_data92 = __toESM(require_core_data()); 64174 var import_jsx_runtime508 = __toESM(require_jsx_runtime()); 64175 var TEMPLATE18 = [["core/term-name"]]; 64176 function TermTemplateInnerBlocks({ classList }) { 64177 const innerBlocksProps = (0, import_block_editor267.useInnerBlocksProps)( 64178 { className: clsx_default("wp-block-term", classList) }, 64179 { template: TEMPLATE18, __unstableDisableLayoutClassNames: true } 64180 ); 64181 return /* @__PURE__ */ (0, import_jsx_runtime508.jsx)("li", { ...innerBlocksProps }); 64182 } 64183 function TermTemplateBlockPreview({ 64184 blocks, 64185 blockContextId, 64186 classList, 64187 isHidden, 64188 setActiveBlockContextId 64189 }) { 64190 const blockPreviewProps = (0, import_block_editor267.__experimentalUseBlockPreview)({ 64191 blocks, 64192 props: { 64193 className: clsx_default("wp-block-term", classList) 64194 } 64195 }); 64196 const handleOnClick = () => { 64197 setActiveBlockContextId(blockContextId); 64198 }; 64199 const style2 = { 64200 display: isHidden ? "none" : void 0 64201 }; 64202 return /* @__PURE__ */ (0, import_jsx_runtime508.jsx)( 64203 "li", 64204 { 64205 ...blockPreviewProps, 64206 tabIndex: 0, 64207 role: "button", 64208 onClick: handleOnClick, 64209 onKeyPress: handleOnClick, 64210 style: style2 64211 } 64212 ); 64213 } 64214 var MemoizedTermTemplateBlockPreview = (0, import_element132.memo)(TermTemplateBlockPreview); 64215 function TermTemplateEdit({ 64216 clientId, 64217 attributes: { layout }, 64218 setAttributes, 64219 context: { 64220 termQuery: { 64221 taxonomy, 64222 order, 64223 orderBy, 64224 hideEmpty, 64225 showNested = false, 64226 perPage, 64227 include 64228 } = {} 64229 }, 64230 __unstableLayoutClassNames 64231 }) { 64232 const { type: layoutType, columnCount = 3 } = layout || {}; 64233 const [activeBlockContextId, setActiveBlockContextId] = (0, import_element132.useState)(); 64234 const queryArgs = { 64235 hide_empty: hideEmpty, 64236 order, 64237 orderby: orderBy, 64238 // There is a mismatch between `WP_Term_Query` and the REST API parameter default 64239 // values to fetch all items. In `WP_Term_Query`, the default is `''|0` and in 64240 // the REST API is `-1`. 64241 per_page: perPage || -1 64242 }; 64243 if (!showNested && !include?.length) { 64244 queryArgs.parent = 0; 64245 } 64246 if (include?.length) { 64247 queryArgs.include = include; 64248 queryArgs.orderby = "include"; 64249 queryArgs.order = "asc"; 64250 } 64251 const { records: terms } = (0, import_core_data92.useEntityRecords)( 64252 "taxonomy", 64253 taxonomy, 64254 queryArgs 64255 ); 64256 const blocks = (0, import_data147.useSelect)( 64257 (select9) => select9(import_block_editor267.store).getBlocks(clientId), 64258 [clientId] 64259 ); 64260 const blockProps = (0, import_block_editor267.useBlockProps)({ 64261 className: __unstableLayoutClassNames 64262 }); 64263 const blockContexts = (0, import_element132.useMemo)( 64264 () => terms?.map((term) => ({ 64265 taxonomy, 64266 termId: term.id, 64267 classList: `term-$term.id}`, 64268 termData: term 64269 })), 64270 [terms, taxonomy] 64271 ); 64272 if (!terms) { 64273 return /* @__PURE__ */ (0, import_jsx_runtime508.jsx)("ul", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime508.jsx)("li", { className: "wp-block-term term-loading", children: /* @__PURE__ */ (0, import_jsx_runtime508.jsx)("div", { className: "term-loading-placeholder" }) }) }); 64274 } 64275 if (!terms.length) { 64276 return /* @__PURE__ */ (0, import_jsx_runtime508.jsxs)("p", { ...blockProps, children: [ 64277 " ", 64278 (0, import_i18n250.__)("No terms found.") 64279 ] }); 64280 } 64281 const setDisplayLayout = (newDisplayLayout) => setAttributes((prevAttributes) => ({ 64282 layout: { ...prevAttributes.layout, ...newDisplayLayout } 64283 })); 64284 return /* @__PURE__ */ (0, import_jsx_runtime508.jsxs)(import_jsx_runtime508.Fragment, { children: [ 64285 /* @__PURE__ */ (0, import_jsx_runtime508.jsx)(import_block_editor267.BlockControls, { children: /* @__PURE__ */ (0, import_jsx_runtime508.jsx)( 64286 import_components171.ToolbarGroup, 64287 { 64288 controls: [ 64289 { 64290 icon: list_default, 64291 title: (0, import_i18n250._x)( 64292 "List view", 64293 "Term template block display setting" 64294 ), 64295 onClick: () => setDisplayLayout({ type: "default" }), 64296 isActive: layoutType === "default" || layoutType === "constrained" 64297 }, 64298 { 64299 icon: grid_default, 64300 title: (0, import_i18n250._x)( 64301 "Grid view", 64302 "Term template block display setting" 64303 ), 64304 onClick: () => setDisplayLayout({ 64305 type: "grid", 64306 columnCount 64307 }), 64308 isActive: layoutType === "grid" 64309 } 64310 ] 64311 } 64312 ) }), 64313 /* @__PURE__ */ (0, import_jsx_runtime508.jsx)("ul", { ...blockProps, children: blockContexts?.map((blockContext) => /* @__PURE__ */ (0, import_jsx_runtime508.jsxs)( 64314 import_block_editor267.BlockContextProvider, 64315 { 64316 value: blockContext, 64317 children: [ 64318 blockContext.termId === (activeBlockContextId || blockContexts[0]?.termId) ? /* @__PURE__ */ (0, import_jsx_runtime508.jsx)( 64319 TermTemplateInnerBlocks, 64320 { 64321 classList: blockContext.classList 64322 } 64323 ) : null, 64324 /* @__PURE__ */ (0, import_jsx_runtime508.jsx)( 64325 MemoizedTermTemplateBlockPreview, 64326 { 64327 blocks, 64328 blockContextId: blockContext.termId, 64329 classList: blockContext.classList, 64330 setActiveBlockContextId, 64331 isHidden: blockContext.termId === (activeBlockContextId || blockContexts[0]?.termId) 64332 } 64333 ) 64334 ] 64335 }, 64336 blockContext.termId 64337 )) }) 64338 ] }); 64339 } 64340 64341 // packages/block-library/build-module/term-template/save.js 64342 var import_block_editor268 = __toESM(require_block_editor()); 64343 var import_jsx_runtime509 = __toESM(require_jsx_runtime()); 64344 function TermTemplateSave() { 64345 return /* @__PURE__ */ (0, import_jsx_runtime509.jsx)(import_block_editor268.InnerBlocks.Content, {}); 64346 } 64347 64348 // packages/block-library/build-module/term-template/index.js 64349 var { name: name112 } = block_default111; 64350 var settings111 = { 64351 icon: layout_default, 64352 edit: TermTemplateEdit, 64353 save: TermTemplateSave, 64354 example: {} 64355 }; 64356 var init111 = () => initBlock({ name: name112, metadata: block_default111, settings: settings111 }); 64357 64358 // packages/block-library/build-module/text-columns/index.js 64359 var text_columns_exports = {}; 64360 __export(text_columns_exports, { 64361 init: () => init112, 64362 metadata: () => block_default112, 64363 name: () => name113, 64364 settings: () => settings112 64365 }); 64366 64367 // packages/block-library/build-module/text-columns/edit.js 64368 var import_i18n251 = __toESM(require_i18n()); 64369 var import_components172 = __toESM(require_components()); 64370 var import_block_editor269 = __toESM(require_block_editor()); 64371 var import_deprecated46 = __toESM(require_deprecated()); 64372 var import_jsx_runtime510 = __toESM(require_jsx_runtime()); 64373 function TextColumnsEdit({ attributes: attributes3, setAttributes }) { 64374 const { width, content, columns } = attributes3; 64375 (0, import_deprecated46.default)("The Text Columns block", { 64376 since: "5.3", 64377 alternative: "the Columns block" 64378 }); 64379 return /* @__PURE__ */ (0, import_jsx_runtime510.jsxs)(import_jsx_runtime510.Fragment, { children: [ 64380 /* @__PURE__ */ (0, import_jsx_runtime510.jsx)(import_block_editor269.BlockControls, { children: /* @__PURE__ */ (0, import_jsx_runtime510.jsx)( 64381 import_block_editor269.BlockAlignmentToolbar, 64382 { 64383 value: width, 64384 onChange: (nextWidth) => setAttributes({ width: nextWidth }), 64385 controls: ["center", "wide", "full"] 64386 } 64387 ) }), 64388 /* @__PURE__ */ (0, import_jsx_runtime510.jsx)(import_block_editor269.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime510.jsx)(import_components172.PanelBody, { children: /* @__PURE__ */ (0, import_jsx_runtime510.jsx)( 64389 import_components172.RangeControl, 64390 { 64391 __next40pxDefaultSize: true, 64392 label: (0, import_i18n251.__)("Columns"), 64393 value: columns, 64394 onChange: (value) => setAttributes({ columns: value }), 64395 min: 2, 64396 max: 4, 64397 required: true 64398 } 64399 ) }) }), 64400 /* @__PURE__ */ (0, import_jsx_runtime510.jsx)( 64401 "div", 64402 { 64403 ...(0, import_block_editor269.useBlockProps)({ 64404 className: `align$width} columns-$columns}` 64405 }), 64406 children: Array.from({ length: columns }).map((_, index) => { 64407 return /* @__PURE__ */ (0, import_jsx_runtime510.jsx)( 64408 "div", 64409 { 64410 className: "wp-block-column", 64411 children: /* @__PURE__ */ (0, import_jsx_runtime510.jsx)( 64412 import_block_editor269.RichText, 64413 { 64414 tagName: "p", 64415 value: content?.[index]?.children, 64416 onChange: (nextContent) => { 64417 setAttributes({ 64418 content: [ 64419 ...content.slice(0, index), 64420 { children: nextContent }, 64421 ...content.slice(index + 1) 64422 ] 64423 }); 64424 }, 64425 "aria-label": (0, import_i18n251.sprintf)( 64426 // translators: %d: column index (starting with 1) 64427 (0, import_i18n251.__)("Column %d text"), 64428 index + 1 64429 ), 64430 placeholder: (0, import_i18n251.__)("New Column") 64431 } 64432 ) 64433 }, 64434 `column-$index}` 64435 ); 64436 }) 64437 } 64438 ) 64439 ] }); 64440 } 64441 64442 // packages/block-library/build-module/text-columns/block.json 64443 var block_default112 = { 64444 $schema: "https://schemas.wp.org/trunk/block.json", 64445 apiVersion: 3, 64446 name: "core/text-columns", 64447 title: "Text Columns (deprecated)", 64448 icon: "columns", 64449 category: "design", 64450 description: "This block is deprecated. Please use the Columns block instead.", 64451 textdomain: "default", 64452 attributes: { 64453 content: { 64454 type: "array", 64455 source: "query", 64456 selector: "p", 64457 query: { 64458 children: { 64459 type: "string", 64460 source: "html" 64461 } 64462 }, 64463 default: [{}, {}] 64464 }, 64465 columns: { 64466 type: "number", 64467 default: 2 64468 }, 64469 width: { 64470 type: "string" 64471 } 64472 }, 64473 supports: { 64474 inserter: false, 64475 interactivity: { 64476 clientNavigation: true 64477 } 64478 }, 64479 editorStyle: "wp-block-text-columns-editor", 64480 style: "wp-block-text-columns" 64481 }; 64482 64483 // packages/block-library/build-module/text-columns/save.js 64484 var import_block_editor270 = __toESM(require_block_editor()); 64485 var import_jsx_runtime511 = __toESM(require_jsx_runtime()); 64486 function save51({ attributes: attributes3 }) { 64487 const { width, content, columns } = attributes3; 64488 return /* @__PURE__ */ (0, import_jsx_runtime511.jsx)( 64489 "div", 64490 { 64491 ...import_block_editor270.useBlockProps.save({ 64492 className: `align$width} columns-$columns}` 64493 }), 64494 children: Array.from({ length: columns }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime511.jsx)("div", { className: "wp-block-column", children: /* @__PURE__ */ (0, import_jsx_runtime511.jsx)( 64495 import_block_editor270.RichText.Content, 64496 { 64497 tagName: "p", 64498 value: content?.[index]?.children 64499 } 64500 ) }, `column-$index}`)) 64501 } 64502 ); 64503 } 64504 64505 // packages/block-library/build-module/text-columns/transforms.js 64506 var import_blocks116 = __toESM(require_blocks()); 64507 var transforms36 = { 64508 to: [ 64509 { 64510 type: "block", 64511 blocks: ["core/columns"], 64512 transform: ({ className, columns, content, width }) => (0, import_blocks116.createBlock)( 64513 "core/columns", 64514 { 64515 align: "wide" === width || "full" === width ? width : void 0, 64516 className, 64517 columns 64518 }, 64519 content.map( 64520 ({ children }) => (0, import_blocks116.createBlock)("core/column", {}, [ 64521 (0, import_blocks116.createBlock)("core/paragraph", { 64522 content: children 64523 }) 64524 ]) 64525 ) 64526 ) 64527 } 64528 ] 64529 }; 64530 var transforms_default37 = transforms36; 64531 64532 // packages/block-library/build-module/text-columns/index.js 64533 var { name: name113 } = block_default112; 64534 var settings112 = { 64535 transforms: transforms_default37, 64536 getEditWrapperProps(attributes3) { 64537 const { width } = attributes3; 64538 if ("wide" === width || "full" === width) { 64539 return { "data-align": width }; 64540 } 64541 }, 64542 edit: TextColumnsEdit, 64543 save: save51 64544 }; 64545 var init112 = () => initBlock({ name: name113, metadata: block_default112, settings: settings112 }); 64546 64547 // packages/block-library/build-module/verse/index.js 64548 var verse_exports = {}; 64549 __export(verse_exports, { 64550 init: () => init113, 64551 metadata: () => block_default113, 64552 name: () => name114, 64553 settings: () => settings113 64554 }); 64555 var import_i18n253 = __toESM(require_i18n()); 64556 var import_blocks119 = __toESM(require_blocks()); 64557 64558 // packages/block-library/build-module/verse/deprecated.js 64559 var import_block_editor271 = __toESM(require_block_editor()); 64560 var import_jsx_runtime512 = __toESM(require_jsx_runtime()); 64561 var v133 = { 64562 attributes: { 64563 content: { 64564 type: "string", 64565 source: "html", 64566 selector: "pre", 64567 default: "" 64568 }, 64569 textAlign: { 64570 type: "string" 64571 } 64572 }, 64573 save({ attributes: attributes3 }) { 64574 const { textAlign, content } = attributes3; 64575 return /* @__PURE__ */ (0, import_jsx_runtime512.jsx)( 64576 import_block_editor271.RichText.Content, 64577 { 64578 tagName: "pre", 64579 style: { textAlign }, 64580 value: content 64581 } 64582 ); 64583 } 64584 }; 64585 var v216 = { 64586 attributes: { 64587 content: { 64588 type: "string", 64589 source: "html", 64590 selector: "pre", 64591 default: "", 64592 __unstablePreserveWhiteSpace: true, 64593 role: "content" 64594 }, 64595 textAlign: { 64596 type: "string" 64597 } 64598 }, 64599 supports: { 64600 anchor: true, 64601 color: { 64602 gradients: true, 64603 link: true 64604 }, 64605 typography: { 64606 fontSize: true, 64607 __experimentalFontFamily: true 64608 }, 64609 spacing: { 64610 padding: true 64611 } 64612 }, 64613 save({ attributes: attributes3 }) { 64614 const { textAlign, content } = attributes3; 64615 const className = clsx_default({ 64616 [`has-text-align-$textAlign}`]: textAlign 64617 }); 64618 return /* @__PURE__ */ (0, import_jsx_runtime512.jsx)("pre", { ...import_block_editor271.useBlockProps.save({ className }), children: /* @__PURE__ */ (0, import_jsx_runtime512.jsx)(import_block_editor271.RichText.Content, { value: content }) }); 64619 }, 64620 migrate: migrate_font_family_default, 64621 isEligible({ style: style2 }) { 64622 return style2?.typography?.fontFamily; 64623 } 64624 }; 64625 var deprecated_default41 = [v216, v133]; 64626 64627 // packages/block-library/build-module/verse/edit.js 64628 var import_i18n252 = __toESM(require_i18n()); 64629 var import_block_editor272 = __toESM(require_block_editor()); 64630 var import_blocks117 = __toESM(require_blocks()); 64631 var import_jsx_runtime513 = __toESM(require_jsx_runtime()); 64632 function VerseEdit({ 64633 attributes: attributes3, 64634 setAttributes, 64635 mergeBlocks, 64636 onRemove, 64637 insertBlocksAfter, 64638 style: style2 64639 }) { 64640 const { textAlign, content } = attributes3; 64641 const blockProps = (0, import_block_editor272.useBlockProps)({ 64642 className: clsx_default({ 64643 [`has-text-align-$textAlign}`]: textAlign 64644 }), 64645 style: style2 64646 }); 64647 return /* @__PURE__ */ (0, import_jsx_runtime513.jsxs)(import_jsx_runtime513.Fragment, { children: [ 64648 /* @__PURE__ */ (0, import_jsx_runtime513.jsx)(import_block_editor272.BlockControls, { children: /* @__PURE__ */ (0, import_jsx_runtime513.jsx)( 64649 import_block_editor272.AlignmentToolbar, 64650 { 64651 value: textAlign, 64652 onChange: (nextAlign) => { 64653 setAttributes({ textAlign: nextAlign }); 64654 } 64655 } 64656 ) }), 64657 /* @__PURE__ */ (0, import_jsx_runtime513.jsx)( 64658 import_block_editor272.RichText, 64659 { 64660 tagName: "pre", 64661 identifier: "content", 64662 preserveWhiteSpace: true, 64663 value: content, 64664 onChange: (nextContent) => { 64665 setAttributes({ 64666 content: nextContent 64667 }); 64668 }, 64669 "aria-label": (0, import_i18n252.__)("Verse text"), 64670 placeholder: (0, import_i18n252.__)("Write verse\u2026"), 64671 onRemove, 64672 onMerge: mergeBlocks, 64673 textAlign, 64674 ...blockProps, 64675 __unstablePastePlainText: true, 64676 __unstableOnSplitAtDoubleLineEnd: () => insertBlocksAfter((0, import_blocks117.createBlock)((0, import_blocks117.getDefaultBlockName)())) 64677 } 64678 ) 64679 ] }); 64680 } 64681 64682 // packages/block-library/build-module/verse/block.json 64683 var block_default113 = { 64684 $schema: "https://schemas.wp.org/trunk/block.json", 64685 apiVersion: 3, 64686 name: "core/verse", 64687 title: "Verse", 64688 category: "text", 64689 description: "Insert poetry. Use special spacing formats. Or quote song lyrics.", 64690 keywords: ["poetry", "poem"], 64691 textdomain: "default", 64692 attributes: { 64693 content: { 64694 type: "rich-text", 64695 source: "rich-text", 64696 selector: "pre", 64697 __unstablePreserveWhiteSpace: true, 64698 role: "content" 64699 }, 64700 textAlign: { 64701 type: "string" 64702 } 64703 }, 64704 supports: { 64705 anchor: true, 64706 background: { 64707 backgroundImage: true, 64708 backgroundSize: true, 64709 __experimentalDefaultControls: { 64710 backgroundImage: true 64711 } 64712 }, 64713 color: { 64714 gradients: true, 64715 link: true, 64716 __experimentalDefaultControls: { 64717 background: true, 64718 text: true 64719 } 64720 }, 64721 dimensions: { 64722 minHeight: true, 64723 __experimentalDefaultControls: { 64724 minHeight: false 64725 } 64726 }, 64727 typography: { 64728 fontSize: true, 64729 __experimentalFontFamily: true, 64730 lineHeight: true, 64731 __experimentalFontStyle: true, 64732 __experimentalFontWeight: true, 64733 __experimentalLetterSpacing: true, 64734 __experimentalTextTransform: true, 64735 __experimentalTextDecoration: true, 64736 __experimentalWritingMode: true, 64737 __experimentalDefaultControls: { 64738 fontSize: true 64739 } 64740 }, 64741 spacing: { 64742 margin: true, 64743 padding: true, 64744 __experimentalDefaultControls: { 64745 margin: false, 64746 padding: false 64747 } 64748 }, 64749 __experimentalBorder: { 64750 radius: true, 64751 width: true, 64752 color: true, 64753 style: true 64754 }, 64755 interactivity: { 64756 clientNavigation: true 64757 } 64758 }, 64759 style: "wp-block-verse", 64760 editorStyle: "wp-block-verse-editor" 64761 }; 64762 64763 // packages/block-library/build-module/verse/save.js 64764 var import_block_editor273 = __toESM(require_block_editor()); 64765 var import_jsx_runtime514 = __toESM(require_jsx_runtime()); 64766 function save52({ attributes: attributes3 }) { 64767 const { textAlign, content } = attributes3; 64768 const className = clsx_default({ 64769 [`has-text-align-$textAlign}`]: textAlign 64770 }); 64771 return /* @__PURE__ */ (0, import_jsx_runtime514.jsx)("pre", { ...import_block_editor273.useBlockProps.save({ className }), children: /* @__PURE__ */ (0, import_jsx_runtime514.jsx)(import_block_editor273.RichText.Content, { value: content }) }); 64772 } 64773 64774 // packages/block-library/build-module/verse/transforms.js 64775 var import_blocks118 = __toESM(require_blocks()); 64776 var transforms37 = { 64777 from: [ 64778 { 64779 type: "block", 64780 blocks: ["core/paragraph"], 64781 transform: (attributes3) => (0, import_blocks118.createBlock)("core/verse", attributes3) 64782 } 64783 ], 64784 to: [ 64785 { 64786 type: "block", 64787 blocks: ["core/paragraph"], 64788 transform: (attributes3) => (0, import_blocks118.createBlock)("core/paragraph", attributes3) 64789 } 64790 ] 64791 }; 64792 var transforms_default38 = transforms37; 64793 64794 // packages/block-library/build-module/verse/index.js 64795 var { fieldsKey: fieldsKey19, formKey: formKey19 } = unlock(import_blocks119.privateApis); 64796 var { name: name114 } = block_default113; 64797 var settings113 = { 64798 icon: verse_default, 64799 example: { 64800 attributes: { 64801 /* eslint-disable @wordpress/i18n-no-collapsible-whitespace */ 64802 // translators: Sample content for the Verse block. Can be replaced with a more locale-adequate work. 64803 content: (0, import_i18n253.__)( 64804 "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." 64805 ) 64806 /* eslint-enable @wordpress/i18n-no-collapsible-whitespace */ 64807 } 64808 }, 64809 transforms: transforms_default38, 64810 deprecated: deprecated_default41, 64811 merge(attributes3, attributesToMerge) { 64812 return { 64813 content: attributes3.content + "\n\n" + attributesToMerge.content 64814 }; 64815 }, 64816 edit: VerseEdit, 64817 save: save52 64818 }; 64819 if (window.__experimentalContentOnlyInspectorFields) { 64820 settings113[fieldsKey19] = [ 64821 { 64822 id: "content", 64823 label: (0, import_i18n253.__)("Content"), 64824 type: "richtext" 64825 } 64826 ]; 64827 settings113[formKey19] = { 64828 fields: ["content"] 64829 }; 64830 } 64831 var init113 = () => initBlock({ name: name114, metadata: block_default113, settings: settings113 }); 64832 64833 // packages/block-library/build-module/video/index.js 64834 var video_exports = {}; 64835 __export(video_exports, { 64836 init: () => init114, 64837 metadata: () => block_default114, 64838 name: () => name115, 64839 settings: () => settings114 64840 }); 64841 var import_i18n257 = __toESM(require_i18n()); 64842 var import_blocks121 = __toESM(require_blocks()); 64843 64844 // packages/block-library/build-module/video/deprecated.js 64845 var import_block_editor274 = __toESM(require_block_editor()); 64846 64847 // packages/block-library/build-module/video/block.json 64848 var block_default114 = { 64849 $schema: "https://schemas.wp.org/trunk/block.json", 64850 apiVersion: 3, 64851 name: "core/video", 64852 title: "Video", 64853 category: "media", 64854 description: "Embed a video from your media library or upload a new one.", 64855 keywords: ["movie"], 64856 textdomain: "default", 64857 attributes: { 64858 autoplay: { 64859 type: "boolean", 64860 source: "attribute", 64861 selector: "video", 64862 attribute: "autoplay" 64863 }, 64864 caption: { 64865 type: "rich-text", 64866 source: "rich-text", 64867 selector: "figcaption", 64868 role: "content" 64869 }, 64870 controls: { 64871 type: "boolean", 64872 source: "attribute", 64873 selector: "video", 64874 attribute: "controls", 64875 default: true 64876 }, 64877 id: { 64878 type: "number", 64879 role: "content" 64880 }, 64881 loop: { 64882 type: "boolean", 64883 source: "attribute", 64884 selector: "video", 64885 attribute: "loop" 64886 }, 64887 muted: { 64888 type: "boolean", 64889 source: "attribute", 64890 selector: "video", 64891 attribute: "muted" 64892 }, 64893 poster: { 64894 type: "string", 64895 source: "attribute", 64896 selector: "video", 64897 attribute: "poster" 64898 }, 64899 preload: { 64900 type: "string", 64901 source: "attribute", 64902 selector: "video", 64903 attribute: "preload", 64904 default: "metadata" 64905 }, 64906 blob: { 64907 type: "string", 64908 role: "local" 64909 }, 64910 src: { 64911 type: "string", 64912 source: "attribute", 64913 selector: "video", 64914 attribute: "src", 64915 role: "content" 64916 }, 64917 playsInline: { 64918 type: "boolean", 64919 source: "attribute", 64920 selector: "video", 64921 attribute: "playsinline" 64922 }, 64923 tracks: { 64924 role: "content", 64925 type: "array", 64926 items: { 64927 type: "object" 64928 }, 64929 default: [] 64930 } 64931 }, 64932 supports: { 64933 anchor: true, 64934 align: true, 64935 spacing: { 64936 margin: true, 64937 padding: true, 64938 __experimentalDefaultControls: { 64939 margin: false, 64940 padding: false 64941 } 64942 }, 64943 interactivity: { 64944 clientNavigation: true 64945 } 64946 }, 64947 editorStyle: "wp-block-video-editor", 64948 style: "wp-block-video" 64949 }; 64950 64951 // packages/block-library/build-module/video/tracks.js 64952 var import_jsx_runtime515 = __toESM(require_jsx_runtime()); 64953 function Tracks({ tracks = [] }) { 64954 return tracks.map((track) => { 64955 const { id, ...trackAttrs } = track; 64956 return /* @__PURE__ */ (0, import_jsx_runtime515.jsx)("track", { ...trackAttrs }, id ?? trackAttrs.src); 64957 }); 64958 } 64959 64960 // packages/block-library/build-module/video/deprecated.js 64961 var import_jsx_runtime516 = __toESM(require_jsx_runtime()); 64962 var { attributes: blockAttributes7 } = block_default114; 64963 var v134 = { 64964 attributes: blockAttributes7, 64965 save({ attributes: attributes3 }) { 64966 const { 64967 autoplay, 64968 caption, 64969 controls, 64970 loop, 64971 muted, 64972 poster, 64973 preload, 64974 src, 64975 playsInline, 64976 tracks 64977 } = attributes3; 64978 return /* @__PURE__ */ (0, import_jsx_runtime516.jsxs)("figure", { ...import_block_editor274.useBlockProps.save(), children: [ 64979 src && /* @__PURE__ */ (0, import_jsx_runtime516.jsx)( 64980 "video", 64981 { 64982 autoPlay: autoplay, 64983 controls, 64984 loop, 64985 muted, 64986 poster, 64987 preload: preload !== "metadata" ? preload : void 0, 64988 src, 64989 playsInline, 64990 children: /* @__PURE__ */ (0, import_jsx_runtime516.jsx)(Tracks, { tracks }) 64991 } 64992 ), 64993 !import_block_editor274.RichText.isEmpty(caption) && /* @__PURE__ */ (0, import_jsx_runtime516.jsx)(import_block_editor274.RichText.Content, { tagName: "figcaption", value: caption }) 64994 ] }); 64995 } 64996 }; 64997 var deprecated20 = [v134]; 64998 var deprecated_default42 = deprecated20; 64999 65000 // packages/block-library/build-module/video/edit.js 65001 var import_blob18 = __toESM(require_blob()); 65002 var import_components175 = __toESM(require_components()); 65003 var import_block_editor276 = __toESM(require_block_editor()); 65004 var import_element135 = __toESM(require_element()); 65005 var import_i18n256 = __toESM(require_i18n()); 65006 var import_data149 = __toESM(require_data()); 65007 var import_notices20 = __toESM(require_notices()); 65008 65009 // packages/block-library/build-module/video/edit-common-settings.js 65010 var import_i18n254 = __toESM(require_i18n()); 65011 var import_components173 = __toESM(require_components()); 65012 var import_element133 = __toESM(require_element()); 65013 var import_jsx_runtime517 = __toESM(require_jsx_runtime()); 65014 var options = [ 65015 { value: "auto", label: (0, import_i18n254.__)("Auto") }, 65016 { value: "metadata", label: (0, import_i18n254.__)("Metadata") }, 65017 { value: "none", label: (0, import_i18n254._x)("None", "Preload value") } 65018 ]; 65019 var VideoSettings = ({ setAttributes, attributes: attributes3 }) => { 65020 const { autoplay, controls, loop, muted, playsInline, preload } = attributes3; 65021 const autoPlayHelpText = (0, import_i18n254.__)( 65022 "Autoplay may cause usability issues for some users." 65023 ); 65024 const getAutoplayHelp = import_element133.Platform.select({ 65025 web: (0, import_element133.useCallback)((checked) => { 65026 return checked ? autoPlayHelpText : null; 65027 }, []), 65028 native: autoPlayHelpText 65029 }); 65030 const toggleFactory = (0, import_element133.useMemo)(() => { 65031 const toggleAttribute = (attribute) => { 65032 return (newValue) => { 65033 setAttributes({ 65034 [attribute]: newValue, 65035 // Set muted and playsInLine when autoplay changes 65036 // playsInline is set to true when autoplay is true to support iOS devices 65037 ...attribute === "autoplay" && { 65038 muted: newValue, 65039 playsInline: newValue 65040 } 65041 }); 65042 }; 65043 }; 65044 return { 65045 autoplay: toggleAttribute("autoplay"), 65046 loop: toggleAttribute("loop"), 65047 muted: toggleAttribute("muted"), 65048 controls: toggleAttribute("controls"), 65049 playsInline: toggleAttribute("playsInline") 65050 }; 65051 }, []); 65052 const onChangePreload = (0, import_element133.useCallback)((value) => { 65053 setAttributes({ preload: value }); 65054 }, []); 65055 return /* @__PURE__ */ (0, import_jsx_runtime517.jsxs)(import_jsx_runtime517.Fragment, { children: [ 65056 /* @__PURE__ */ (0, import_jsx_runtime517.jsx)( 65057 import_components173.__experimentalToolsPanelItem, 65058 { 65059 label: (0, import_i18n254.__)("Autoplay"), 65060 isShownByDefault: true, 65061 hasValue: () => !!autoplay, 65062 onDeselect: () => { 65063 setAttributes({ autoplay: false, muted: false }); 65064 }, 65065 children: /* @__PURE__ */ (0, import_jsx_runtime517.jsx)( 65066 import_components173.ToggleControl, 65067 { 65068 label: (0, import_i18n254.__)("Autoplay"), 65069 onChange: toggleFactory.autoplay, 65070 checked: !!autoplay, 65071 help: getAutoplayHelp 65072 } 65073 ) 65074 } 65075 ), 65076 /* @__PURE__ */ (0, import_jsx_runtime517.jsx)( 65077 import_components173.__experimentalToolsPanelItem, 65078 { 65079 label: (0, import_i18n254.__)("Loop"), 65080 isShownByDefault: true, 65081 hasValue: () => !!loop, 65082 onDeselect: () => { 65083 setAttributes({ loop: false }); 65084 }, 65085 children: /* @__PURE__ */ (0, import_jsx_runtime517.jsx)( 65086 import_components173.ToggleControl, 65087 { 65088 label: (0, import_i18n254.__)("Loop"), 65089 onChange: toggleFactory.loop, 65090 checked: !!loop 65091 } 65092 ) 65093 } 65094 ), 65095 /* @__PURE__ */ (0, import_jsx_runtime517.jsx)( 65096 import_components173.__experimentalToolsPanelItem, 65097 { 65098 label: (0, import_i18n254.__)("Muted"), 65099 isShownByDefault: true, 65100 hasValue: () => !!muted, 65101 onDeselect: () => { 65102 setAttributes({ muted: false }); 65103 }, 65104 children: /* @__PURE__ */ (0, import_jsx_runtime517.jsx)( 65105 import_components173.ToggleControl, 65106 { 65107 label: (0, import_i18n254.__)("Muted"), 65108 onChange: toggleFactory.muted, 65109 checked: !!muted, 65110 disabled: autoplay, 65111 help: autoplay ? (0, import_i18n254.__)("Muted because of Autoplay.") : null 65112 } 65113 ) 65114 } 65115 ), 65116 /* @__PURE__ */ (0, import_jsx_runtime517.jsx)( 65117 import_components173.__experimentalToolsPanelItem, 65118 { 65119 label: (0, import_i18n254.__)("Playback controls"), 65120 isShownByDefault: true, 65121 hasValue: () => !controls, 65122 onDeselect: () => { 65123 setAttributes({ controls: true }); 65124 }, 65125 children: /* @__PURE__ */ (0, import_jsx_runtime517.jsx)( 65126 import_components173.ToggleControl, 65127 { 65128 label: (0, import_i18n254.__)("Playback controls"), 65129 onChange: toggleFactory.controls, 65130 checked: !!controls 65131 } 65132 ) 65133 } 65134 ), 65135 /* @__PURE__ */ (0, import_jsx_runtime517.jsx)( 65136 import_components173.__experimentalToolsPanelItem, 65137 { 65138 label: (0, import_i18n254.__)("Play inline"), 65139 isShownByDefault: true, 65140 hasValue: () => !!playsInline, 65141 onDeselect: () => { 65142 setAttributes({ playsInline: false }); 65143 }, 65144 children: /* @__PURE__ */ (0, import_jsx_runtime517.jsx)( 65145 import_components173.ToggleControl, 65146 { 65147 label: (0, import_i18n254.__)("Play inline"), 65148 onChange: toggleFactory.playsInline, 65149 checked: !!playsInline, 65150 disabled: autoplay, 65151 help: autoplay ? (0, import_i18n254.__)("Play inline enabled because of Autoplay.") : (0, import_i18n254.__)( 65152 "When enabled, videos will play directly within the webpage on mobile browsers, instead of opening in a fullscreen player." 65153 ) 65154 } 65155 ) 65156 } 65157 ), 65158 /* @__PURE__ */ (0, import_jsx_runtime517.jsx)( 65159 import_components173.__experimentalToolsPanelItem, 65160 { 65161 label: (0, import_i18n254.__)("Preload"), 65162 isShownByDefault: true, 65163 hasValue: () => preload !== "metadata", 65164 onDeselect: () => { 65165 setAttributes({ preload: "metadata" }); 65166 }, 65167 children: /* @__PURE__ */ (0, import_jsx_runtime517.jsx)( 65168 import_components173.SelectControl, 65169 { 65170 __next40pxDefaultSize: true, 65171 label: (0, import_i18n254.__)("Preload"), 65172 value: preload, 65173 onChange: onChangePreload, 65174 options, 65175 hideCancelButton: true 65176 } 65177 ) 65178 } 65179 ) 65180 ] }); 65181 }; 65182 var edit_common_settings_default = VideoSettings; 65183 65184 // packages/block-library/build-module/video/tracks-editor.js 65185 var import_i18n255 = __toESM(require_i18n()); 65186 var import_components174 = __toESM(require_components()); 65187 var import_block_editor275 = __toESM(require_block_editor()); 65188 var import_data148 = __toESM(require_data()); 65189 var import_element134 = __toESM(require_element()); 65190 var import_url20 = __toESM(require_url()); 65191 var import_jsx_runtime518 = __toESM(require_jsx_runtime()); 65192 var { Badge: Badge2 } = unlock(import_components174.privateApis); 65193 var ALLOWED_TYPES = ["text/vtt"]; 65194 var DEFAULT_KIND = "subtitles"; 65195 var KIND_OPTIONS = [ 65196 { label: (0, import_i18n255.__)("Subtitles"), value: "subtitles" }, 65197 { label: (0, import_i18n255.__)("Captions"), value: "captions" }, 65198 { label: (0, import_i18n255.__)("Descriptions"), value: "descriptions" }, 65199 { label: (0, import_i18n255.__)("Chapters"), value: "chapters" }, 65200 { label: (0, import_i18n255.__)("Metadata"), value: "metadata" } 65201 ]; 65202 var DEFAULT_TRACK = { 65203 src: "", 65204 label: "", 65205 srcLang: "en", 65206 kind: DEFAULT_KIND, 65207 default: false 65208 }; 65209 function TrackList({ tracks, onEditPress }) { 65210 const content = tracks.map((track, index) => { 65211 return /* @__PURE__ */ (0, import_jsx_runtime518.jsxs)( 65212 import_components174.__experimentalHStack, 65213 { 65214 className: "block-library-video-tracks-editor__track-list-track", 65215 children: [ 65216 /* @__PURE__ */ (0, import_jsx_runtime518.jsx)("span", { children: track.label }), 65217 /* @__PURE__ */ (0, import_jsx_runtime518.jsxs)(import_components174.__experimentalHStack, { justify: "flex-end", children: [ 65218 track.default && /* @__PURE__ */ (0, import_jsx_runtime518.jsx)(Badge2, { children: (0, import_i18n255.__)("Default") }), 65219 /* @__PURE__ */ (0, import_jsx_runtime518.jsx)( 65220 import_components174.Button, 65221 { 65222 __next40pxDefaultSize: true, 65223 variant: "tertiary", 65224 onClick: () => onEditPress(index), 65225 "aria-label": (0, import_i18n255.sprintf)( 65226 /* translators: %s: Label of the video text track e.g: "French subtitles". */ 65227 (0, import_i18n255._x)("Edit %s", "text tracks"), 65228 track.label 65229 ), 65230 children: (0, import_i18n255.__)("Edit") 65231 } 65232 ) 65233 ] }) 65234 ] 65235 }, 65236 track.id ?? track.src 65237 ); 65238 }); 65239 return /* @__PURE__ */ (0, import_jsx_runtime518.jsx)( 65240 import_components174.MenuGroup, 65241 { 65242 label: (0, import_i18n255.__)("Text tracks"), 65243 className: "block-library-video-tracks-editor__track-list", 65244 children: content 65245 } 65246 ); 65247 } 65248 function SingleTrackEditor({ 65249 track, 65250 onChange, 65251 onClose, 65252 onRemove, 65253 allowSettingDefault 65254 }) { 65255 const [trackState, setTrackState] = (0, import_element134.useState)({ 65256 ...DEFAULT_TRACK, 65257 ...track 65258 }); 65259 const { src, label, srcLang, kind, default: isDefaultTrack } = trackState; 65260 const fileName = src.startsWith("blob:") ? "" : (0, import_url20.getFilename)(src) || ""; 65261 return /* @__PURE__ */ (0, import_jsx_runtime518.jsxs)( 65262 import_components174.__experimentalVStack, 65263 { 65264 className: "block-library-video-tracks-editor__single-track-editor", 65265 spacing: "4", 65266 children: [ 65267 /* @__PURE__ */ (0, import_jsx_runtime518.jsx)("span", { className: "block-library-video-tracks-editor__single-track-editor-edit-track-label", children: (0, import_i18n255.__)("Edit track") }), 65268 /* @__PURE__ */ (0, import_jsx_runtime518.jsxs)("span", { children: [ 65269 (0, import_i18n255.__)("File"), 65270 ": ", 65271 /* @__PURE__ */ (0, import_jsx_runtime518.jsx)("b", { children: fileName }) 65272 ] }), 65273 /* @__PURE__ */ (0, import_jsx_runtime518.jsxs)(import_components174.__experimentalGrid, { columns: 2, gap: 4, children: [ 65274 /* @__PURE__ */ (0, import_jsx_runtime518.jsx)( 65275 import_components174.TextControl, 65276 { 65277 __next40pxDefaultSize: true, 65278 onChange: (newLabel) => setTrackState((prevTrackState) => ({ 65279 ...prevTrackState, 65280 label: newLabel 65281 })), 65282 label: (0, import_i18n255.__)("Label"), 65283 value: label, 65284 help: (0, import_i18n255.__)("Title of track") 65285 } 65286 ), 65287 /* @__PURE__ */ (0, import_jsx_runtime518.jsx)( 65288 import_components174.TextControl, 65289 { 65290 __next40pxDefaultSize: true, 65291 onChange: (newSrcLang) => setTrackState((prevTrackState) => ({ 65292 ...prevTrackState, 65293 srcLang: newSrcLang 65294 })), 65295 label: (0, import_i18n255.__)("Source language"), 65296 value: srcLang, 65297 help: (0, import_i18n255.__)("Language tag (en, fr, etc.)") 65298 } 65299 ) 65300 ] }), 65301 /* @__PURE__ */ (0, import_jsx_runtime518.jsxs)(import_components174.__experimentalVStack, { spacing: "4", children: [ 65302 /* @__PURE__ */ (0, import_jsx_runtime518.jsx)( 65303 import_components174.SelectControl, 65304 { 65305 __next40pxDefaultSize: true, 65306 className: "block-library-video-tracks-editor__single-track-editor-kind-select", 65307 options: KIND_OPTIONS, 65308 value: kind, 65309 label: (0, import_i18n255.__)("Kind"), 65310 onChange: (newKind) => setTrackState((prevTrackState) => ({ 65311 ...prevTrackState, 65312 kind: newKind 65313 })) 65314 } 65315 ), 65316 /* @__PURE__ */ (0, import_jsx_runtime518.jsx)( 65317 import_components174.ToggleControl, 65318 { 65319 __next40pxDefaultSize: true, 65320 label: (0, import_i18n255.__)("Set as default track"), 65321 checked: isDefaultTrack, 65322 disabled: !allowSettingDefault, 65323 onChange: (defaultTrack) => setTrackState((prevTrackState) => ({ 65324 ...prevTrackState, 65325 default: defaultTrack 65326 })) 65327 } 65328 ), 65329 /* @__PURE__ */ (0, import_jsx_runtime518.jsxs)(import_components174.__experimentalHStack, { className: "block-library-video-tracks-editor__single-track-editor-buttons-container", children: [ 65330 /* @__PURE__ */ (0, import_jsx_runtime518.jsx)( 65331 import_components174.Button, 65332 { 65333 __next40pxDefaultSize: true, 65334 isDestructive: true, 65335 variant: "link", 65336 onClick: onRemove, 65337 children: (0, import_i18n255.__)("Remove track") 65338 } 65339 ), 65340 /* @__PURE__ */ (0, import_jsx_runtime518.jsx)( 65341 import_components174.Button, 65342 { 65343 __next40pxDefaultSize: true, 65344 variant: "primary", 65345 onClick: () => { 65346 onChange(trackState); 65347 onClose(); 65348 }, 65349 children: (0, import_i18n255.__)("Apply") 65350 } 65351 ) 65352 ] }) 65353 ] }) 65354 ] 65355 } 65356 ); 65357 } 65358 function TracksEditor({ tracks = [], onChange }) { 65359 const mediaUpload = (0, import_data148.useSelect)((select9) => { 65360 return select9(import_block_editor275.store).getSettings().mediaUpload; 65361 }, []); 65362 const [trackBeingEdited, setTrackBeingEdited] = (0, import_element134.useState)(null); 65363 const dropdownPopoverRef = (0, import_element134.useRef)(); 65364 const handleTrackSelect = (selectedTracks = [], appendTracks = false) => { 65365 const existingTracksMap = new Map( 65366 tracks.map((track) => [track.id, track]) 65367 ); 65368 const tracksToAdd = selectedTracks.map(({ id, title, url }) => { 65369 if (existingTracksMap.has(id)) { 65370 return existingTracksMap.get(id); 65371 } 65372 return { 65373 ...DEFAULT_TRACK, 65374 id, 65375 label: title || "", 65376 src: url 65377 }; 65378 }); 65379 if (tracksToAdd.length === 0) { 65380 return; 65381 } 65382 onChange([...appendTracks ? tracks : [], ...tracksToAdd]); 65383 }; 65384 function uploadFiles(event) { 65385 const files = event.target.files; 65386 mediaUpload({ 65387 allowedTypes: ALLOWED_TYPES, 65388 filesList: files, 65389 onFileChange: (selectedTracks) => { 65390 if (!Array.isArray(selectedTracks)) { 65391 return; 65392 } 65393 const uploadedTracks = selectedTracks.filter( 65394 (track) => !!track?.id 65395 ); 65396 if (!uploadedTracks.length) { 65397 return; 65398 } 65399 handleTrackSelect(uploadedTracks, true); 65400 } 65401 }); 65402 } 65403 (0, import_element134.useEffect)(() => { 65404 dropdownPopoverRef.current?.focus(); 65405 }, [trackBeingEdited]); 65406 if (!mediaUpload) { 65407 return null; 65408 } 65409 return /* @__PURE__ */ (0, import_jsx_runtime518.jsx)( 65410 import_components174.Dropdown, 65411 { 65412 contentClassName: "block-library-video-tracks-editor", 65413 focusOnMount: true, 65414 popoverProps: { 65415 ref: dropdownPopoverRef 65416 }, 65417 renderToggle: ({ isOpen, onToggle }) => { 65418 const handleOnToggle = () => { 65419 if (!isOpen) { 65420 setTrackBeingEdited(null); 65421 } 65422 onToggle(); 65423 }; 65424 return /* @__PURE__ */ (0, import_jsx_runtime518.jsx)(import_components174.ToolbarGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime518.jsx)( 65425 import_components174.ToolbarButton, 65426 { 65427 "aria-expanded": isOpen, 65428 "aria-haspopup": "true", 65429 onClick: handleOnToggle, 65430 children: (0, import_i18n255.__)("Text tracks") 65431 } 65432 ) }); 65433 }, 65434 renderContent: () => { 65435 if (trackBeingEdited !== null) { 65436 return /* @__PURE__ */ (0, import_jsx_runtime518.jsx)( 65437 SingleTrackEditor, 65438 { 65439 track: tracks[trackBeingEdited], 65440 onChange: (newTrack) => { 65441 const newTracks = [...tracks]; 65442 newTracks[trackBeingEdited] = newTrack; 65443 onChange(newTracks); 65444 }, 65445 onClose: () => setTrackBeingEdited(null), 65446 onRemove: () => { 65447 onChange( 65448 tracks.filter( 65449 (_track, index) => index !== trackBeingEdited 65450 ) 65451 ); 65452 setTrackBeingEdited(null); 65453 }, 65454 allowSettingDefault: !tracks.some((track) => track.default) || tracks[trackBeingEdited].default 65455 } 65456 ); 65457 } 65458 return /* @__PURE__ */ (0, import_jsx_runtime518.jsxs)(import_jsx_runtime518.Fragment, { children: [ 65459 tracks.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime518.jsxs)("div", { className: "block-library-video-tracks-editor__tracks-informative-message", children: [ 65460 /* @__PURE__ */ (0, import_jsx_runtime518.jsx)("h2", { className: "block-library-video-tracks-editor__tracks-informative-message-title", children: (0, import_i18n255.__)("Text tracks") }), 65461 /* @__PURE__ */ (0, import_jsx_runtime518.jsx)("p", { className: "block-library-video-tracks-editor__tracks-informative-message-description", children: (0, import_i18n255.__)( 65462 "Tracks can be subtitles, captions, chapters, or descriptions. They help make your content more accessible to a wider range of users." 65463 ) }) 65464 ] }), 65465 /* @__PURE__ */ (0, import_jsx_runtime518.jsxs)(import_components174.NavigableMenu, { children: [ 65466 /* @__PURE__ */ (0, import_jsx_runtime518.jsx)( 65467 TrackList, 65468 { 65469 tracks, 65470 onEditPress: setTrackBeingEdited 65471 } 65472 ), 65473 /* @__PURE__ */ (0, import_jsx_runtime518.jsx)( 65474 import_components174.MenuGroup, 65475 { 65476 className: "block-library-video-tracks-editor__add-tracks-container", 65477 label: (0, import_i18n255.__)("Add tracks"), 65478 children: /* @__PURE__ */ (0, import_jsx_runtime518.jsxs)(import_block_editor275.MediaUploadCheck, { children: [ 65479 /* @__PURE__ */ (0, import_jsx_runtime518.jsx)( 65480 import_block_editor275.MediaUpload, 65481 { 65482 onSelect: handleTrackSelect, 65483 allowedTypes: ALLOWED_TYPES, 65484 value: tracks.map(({ id }) => id), 65485 multiple: true, 65486 render: ({ open }) => /* @__PURE__ */ (0, import_jsx_runtime518.jsx)( 65487 import_components174.MenuItem, 65488 { 65489 icon: media_default, 65490 onClick: open, 65491 children: (0, import_i18n255.__)("Open Media Library") 65492 } 65493 ) 65494 } 65495 ), 65496 /* @__PURE__ */ (0, import_jsx_runtime518.jsx)( 65497 import_components174.FormFileUpload, 65498 { 65499 onChange: uploadFiles, 65500 accept: ".vtt,text/vtt", 65501 multiple: true, 65502 render: ({ openFileDialog }) => { 65503 return /* @__PURE__ */ (0, import_jsx_runtime518.jsx)( 65504 import_components174.MenuItem, 65505 { 65506 icon: upload_default, 65507 onClick: openFileDialog, 65508 children: (0, import_i18n255._x)("Upload", "verb") 65509 } 65510 ); 65511 } 65512 } 65513 ) 65514 ] }) 65515 } 65516 ) 65517 ] }) 65518 ] }); 65519 } 65520 } 65521 ); 65522 } 65523 65524 // packages/block-library/build-module/video/edit.js 65525 var import_jsx_runtime519 = __toESM(require_jsx_runtime()); 65526 var ALLOWED_MEDIA_TYPES8 = ["video"]; 65527 function VideoEdit({ 65528 isSelected: isSingleSelected, 65529 attributes: attributes3, 65530 className, 65531 setAttributes, 65532 insertBlocksAfter, 65533 onReplace 65534 }) { 65535 const videoPlayer = (0, import_element135.useRef)(); 65536 const { id, controls, poster, src, tracks } = attributes3; 65537 const [temporaryURL, setTemporaryURL] = (0, import_element135.useState)(attributes3.blob); 65538 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 65539 const blockEditingMode = (0, import_block_editor276.useBlockEditingMode)(); 65540 const hasNonContentControls = blockEditingMode === "default"; 65541 useUploadMediaFromBlobURL({ 65542 url: temporaryURL, 65543 allowedTypes: ALLOWED_MEDIA_TYPES8, 65544 onChange: onSelectVideo, 65545 onError: onUploadError 65546 }); 65547 (0, import_element135.useEffect)(() => { 65548 if (videoPlayer.current) { 65549 videoPlayer.current.load(); 65550 } 65551 }, [poster]); 65552 function onSelectVideo(media) { 65553 if (!media || !media.url) { 65554 setAttributes({ 65555 src: void 0, 65556 id: void 0, 65557 poster: void 0, 65558 caption: void 0, 65559 blob: void 0 65560 }); 65561 setTemporaryURL(); 65562 return; 65563 } 65564 if ((0, import_blob18.isBlobURL)(media.url)) { 65565 setTemporaryURL(media.url); 65566 return; 65567 } 65568 setAttributes({ 65569 blob: void 0, 65570 src: media.url, 65571 id: media.id, 65572 poster: media.image?.src !== media.icon ? media.image?.src : void 0, 65573 caption: media.caption 65574 }); 65575 setTemporaryURL(); 65576 } 65577 function onSelectURL(newSrc) { 65578 if (newSrc !== src) { 65579 const embedBlock = createUpgradedEmbedBlock({ 65580 attributes: { url: newSrc } 65581 }); 65582 if (void 0 !== embedBlock && onReplace) { 65583 onReplace(embedBlock); 65584 return; 65585 } 65586 setAttributes({ 65587 blob: void 0, 65588 src: newSrc, 65589 id: void 0, 65590 poster: void 0 65591 }); 65592 setTemporaryURL(); 65593 } 65594 } 65595 const { createErrorNotice } = (0, import_data149.useDispatch)(import_notices20.store); 65596 function onUploadError(message) { 65597 createErrorNotice(message, { type: "snackbar" }); 65598 } 65599 const placeholder2 = (content) => { 65600 return /* @__PURE__ */ (0, import_jsx_runtime519.jsx)( 65601 import_components175.Placeholder, 65602 { 65603 className: "block-editor-media-placeholder", 65604 withIllustration: !isSingleSelected, 65605 icon: video_default, 65606 label: (0, import_i18n256.__)("Video"), 65607 instructions: (0, import_i18n256.__)( 65608 "Drag and drop a video, upload, or choose from your library." 65609 ), 65610 children: content 65611 } 65612 ); 65613 }; 65614 const classes = clsx_default(className, { 65615 "is-transient": !!temporaryURL 65616 }); 65617 const blockProps = (0, import_block_editor276.useBlockProps)({ 65618 className: classes 65619 }); 65620 if (!src && !temporaryURL) { 65621 return /* @__PURE__ */ (0, import_jsx_runtime519.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime519.jsx)( 65622 import_block_editor276.MediaPlaceholder, 65623 { 65624 icon: /* @__PURE__ */ (0, import_jsx_runtime519.jsx)(import_block_editor276.BlockIcon, { icon: video_default }), 65625 onSelect: onSelectVideo, 65626 onSelectURL, 65627 accept: "video/*", 65628 allowedTypes: ALLOWED_MEDIA_TYPES8, 65629 value: attributes3, 65630 onError: onUploadError, 65631 placeholder: placeholder2 65632 } 65633 ) }); 65634 } 65635 return /* @__PURE__ */ (0, import_jsx_runtime519.jsxs)(import_jsx_runtime519.Fragment, { children: [ 65636 isSingleSelected && /* @__PURE__ */ (0, import_jsx_runtime519.jsxs)(import_jsx_runtime519.Fragment, { children: [ 65637 /* @__PURE__ */ (0, import_jsx_runtime519.jsx)(import_block_editor276.BlockControls, { children: /* @__PURE__ */ (0, import_jsx_runtime519.jsx)( 65638 TracksEditor, 65639 { 65640 tracks, 65641 onChange: (newTracks) => { 65642 setAttributes({ tracks: newTracks }); 65643 } 65644 } 65645 ) }), 65646 /* @__PURE__ */ (0, import_jsx_runtime519.jsx)(import_block_editor276.BlockControls, { group: "other", children: /* @__PURE__ */ (0, import_jsx_runtime519.jsx)( 65647 import_block_editor276.MediaReplaceFlow, 65648 { 65649 mediaId: id, 65650 mediaURL: src, 65651 allowedTypes: ALLOWED_MEDIA_TYPES8, 65652 accept: "video/*", 65653 onSelect: onSelectVideo, 65654 onSelectURL, 65655 onError: onUploadError, 65656 onReset: () => onSelectVideo(void 0) 65657 } 65658 ) }) 65659 ] }), 65660 /* @__PURE__ */ (0, import_jsx_runtime519.jsx)(import_block_editor276.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime519.jsxs)( 65661 import_components175.__experimentalToolsPanel, 65662 { 65663 label: (0, import_i18n256.__)("Settings"), 65664 resetAll: () => { 65665 setAttributes({ 65666 autoplay: false, 65667 controls: true, 65668 loop: false, 65669 muted: false, 65670 playsInline: false, 65671 preload: "metadata", 65672 poster: void 0 65673 }); 65674 }, 65675 dropdownMenuProps, 65676 children: [ 65677 /* @__PURE__ */ (0, import_jsx_runtime519.jsx)( 65678 edit_common_settings_default, 65679 { 65680 setAttributes, 65681 attributes: attributes3 65682 } 65683 ), 65684 /* @__PURE__ */ (0, import_jsx_runtime519.jsx)( 65685 poster_image_default, 65686 { 65687 poster, 65688 onChange: (posterImage) => setAttributes({ 65689 poster: posterImage?.url 65690 }) 65691 } 65692 ) 65693 ] 65694 } 65695 ) }), 65696 /* @__PURE__ */ (0, import_jsx_runtime519.jsxs)("figure", { ...blockProps, children: [ 65697 /* @__PURE__ */ (0, import_jsx_runtime519.jsx)(import_components175.Disabled, { isDisabled: !isSingleSelected, children: /* @__PURE__ */ (0, import_jsx_runtime519.jsx)( 65698 "video", 65699 { 65700 controls, 65701 poster, 65702 src: src || temporaryURL, 65703 ref: videoPlayer, 65704 children: /* @__PURE__ */ (0, import_jsx_runtime519.jsx)(Tracks, { tracks }) 65705 } 65706 ) }), 65707 !!temporaryURL && /* @__PURE__ */ (0, import_jsx_runtime519.jsx)(import_components175.Spinner, {}), 65708 /* @__PURE__ */ (0, import_jsx_runtime519.jsx)( 65709 Caption, 65710 { 65711 attributes: attributes3, 65712 setAttributes, 65713 isSelected: isSingleSelected, 65714 insertBlocksAfter, 65715 label: (0, import_i18n256.__)("Video caption text"), 65716 showToolbarButton: isSingleSelected && hasNonContentControls 65717 } 65718 ) 65719 ] }) 65720 ] }); 65721 } 65722 var edit_default36 = VideoEdit; 65723 65724 // packages/block-library/build-module/video/save.js 65725 var import_block_editor277 = __toESM(require_block_editor()); 65726 var import_jsx_runtime520 = __toESM(require_jsx_runtime()); 65727 function save53({ attributes: attributes3 }) { 65728 const { 65729 autoplay, 65730 caption, 65731 controls, 65732 loop, 65733 muted, 65734 poster, 65735 preload, 65736 src, 65737 playsInline, 65738 tracks 65739 } = attributes3; 65740 return /* @__PURE__ */ (0, import_jsx_runtime520.jsxs)("figure", { ...import_block_editor277.useBlockProps.save(), children: [ 65741 src && /* @__PURE__ */ (0, import_jsx_runtime520.jsx)( 65742 "video", 65743 { 65744 autoPlay: autoplay, 65745 controls, 65746 loop, 65747 muted, 65748 poster, 65749 preload: preload !== "metadata" ? preload : void 0, 65750 src, 65751 playsInline, 65752 children: /* @__PURE__ */ (0, import_jsx_runtime520.jsx)(Tracks, { tracks }) 65753 } 65754 ), 65755 !import_block_editor277.RichText.isEmpty(caption) && /* @__PURE__ */ (0, import_jsx_runtime520.jsx)( 65756 import_block_editor277.RichText.Content, 65757 { 65758 className: (0, import_block_editor277.__experimentalGetElementClassName)("caption"), 65759 tagName: "figcaption", 65760 value: caption 65761 } 65762 ) 65763 ] }); 65764 } 65765 65766 // packages/block-library/build-module/video/transforms.js 65767 var import_blob19 = __toESM(require_blob()); 65768 var import_blocks120 = __toESM(require_blocks()); 65769 var transforms38 = { 65770 from: [ 65771 { 65772 type: "files", 65773 isMatch(files) { 65774 return files.length === 1 && files[0].type.indexOf("video/") === 0; 65775 }, 65776 transform(files) { 65777 const file = files[0]; 65778 const block = (0, import_blocks120.createBlock)("core/video", { 65779 blob: (0, import_blob19.createBlobURL)(file) 65780 }); 65781 return block; 65782 } 65783 }, 65784 { 65785 type: "shortcode", 65786 tag: "video", 65787 attributes: { 65788 src: { 65789 type: "string", 65790 shortcode: ({ 65791 named: { src, mp4, m4v, webm, ogv, flv } 65792 }) => { 65793 return src || mp4 || m4v || webm || ogv || flv; 65794 } 65795 }, 65796 poster: { 65797 type: "string", 65798 shortcode: ({ named: { poster } }) => { 65799 return poster; 65800 } 65801 }, 65802 loop: { 65803 type: "string", 65804 shortcode: ({ named: { loop } }) => { 65805 return loop; 65806 } 65807 }, 65808 autoplay: { 65809 type: "string", 65810 shortcode: ({ named: { autoplay } }) => { 65811 return autoplay; 65812 } 65813 }, 65814 preload: { 65815 type: "string", 65816 shortcode: ({ named: { preload } }) => { 65817 return preload; 65818 } 65819 } 65820 } 65821 }, 65822 { 65823 type: "raw", 65824 isMatch: (node) => node.nodeName === "P" && node.children.length === 1 && node.firstChild.nodeName === "VIDEO", 65825 transform: (node) => { 65826 const videoElement = node.firstChild; 65827 const attributes3 = { 65828 autoplay: videoElement.hasAttribute("autoplay") ? true : void 0, 65829 controls: videoElement.hasAttribute("controls") ? void 0 : false, 65830 loop: videoElement.hasAttribute("loop") ? true : void 0, 65831 muted: videoElement.hasAttribute("muted") ? true : void 0, 65832 preload: videoElement.getAttribute("preload") || void 0, 65833 playsInline: videoElement.hasAttribute("playsinline") ? true : void 0, 65834 poster: videoElement.getAttribute("poster") || void 0, 65835 src: videoElement.getAttribute("src") || void 0 65836 }; 65837 if ((0, import_blob19.isBlobURL)(attributes3.src)) { 65838 attributes3.blob = attributes3.src; 65839 delete attributes3.src; 65840 } 65841 return (0, import_blocks120.createBlock)("core/video", attributes3); 65842 } 65843 } 65844 ] 65845 }; 65846 var transforms_default39 = transforms38; 65847 65848 // packages/block-library/build-module/video/index.js 65849 var { fieldsKey: fieldsKey20, formKey: formKey20 } = unlock(import_blocks121.privateApis); 65850 var { name: name115 } = block_default114; 65851 var settings114 = { 65852 icon: video_default, 65853 example: { 65854 attributes: { 65855 src: "https://upload.wikimedia.org/wikipedia/commons/c/ca/Wood_thrush_in_Central_Park_switch_sides_%2816510%29.webm", 65856 // translators: Caption accompanying a video of the wood thrush singing, which serves as an example for the Video block. 65857 caption: (0, import_i18n257.__)("Wood thrush singing in Central Park, NYC.") 65858 } 65859 }, 65860 transforms: transforms_default39, 65861 deprecated: deprecated_default42, 65862 edit: edit_default36, 65863 save: save53 65864 }; 65865 if (window.__experimentalContentOnlyInspectorFields) { 65866 settings114[fieldsKey20] = [ 65867 { 65868 id: "video", 65869 label: (0, import_i18n257.__)("Video"), 65870 type: "media", 65871 mapping: { 65872 id: "id", 65873 url: "src", 65874 caption: "caption", 65875 poster: "poster" 65876 }, 65877 args: { 65878 allowedTypes: ["video"], 65879 multiple: false 65880 } 65881 }, 65882 { 65883 id: "caption", 65884 label: (0, import_i18n257.__)("Caption"), 65885 type: "richtext" 65886 } 65887 ]; 65888 settings114[formKey20] = { 65889 fields: ["video"] 65890 }; 65891 } 65892 var init114 = () => initBlock({ name: name115, metadata: block_default114, settings: settings114 }); 65893 65894 // packages/block-library/build-module/footnotes/index.js 65895 var footnotes_exports = {}; 65896 __export(footnotes_exports, { 65897 init: () => init115, 65898 metadata: () => block_default115, 65899 name: () => name116, 65900 settings: () => settings115 65901 }); 65902 var import_rich_text6 = __toESM(require_rich_text()); 65903 65904 // packages/block-library/build-module/footnotes/edit.js 65905 var import_block_editor278 = __toESM(require_block_editor()); 65906 var import_core_data93 = __toESM(require_core_data()); 65907 var import_i18n258 = __toESM(require_i18n()); 65908 var import_components176 = __toESM(require_components()); 65909 var import_jsx_runtime521 = __toESM(require_jsx_runtime()); 65910 function FootnotesEdit({ context: { postType, postId } }) { 65911 const [meta, updateMeta] = (0, import_core_data93.useEntityProp)( 65912 "postType", 65913 postType, 65914 "meta", 65915 postId 65916 ); 65917 const footnotesSupported = "string" === typeof meta?.footnotes; 65918 const footnotes = meta?.footnotes ? JSON.parse(meta.footnotes) : []; 65919 const blockProps = (0, import_block_editor278.useBlockProps)(); 65920 if (!footnotesSupported) { 65921 return /* @__PURE__ */ (0, import_jsx_runtime521.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime521.jsx)( 65922 import_components176.Placeholder, 65923 { 65924 icon: /* @__PURE__ */ (0, import_jsx_runtime521.jsx)(import_block_editor278.BlockIcon, { icon: format_list_numbered_default }), 65925 label: (0, import_i18n258.__)("Footnotes"), 65926 instructions: (0, import_i18n258.__)( 65927 "Footnotes are not supported here. Add this block to post or page content." 65928 ) 65929 } 65930 ) }); 65931 } 65932 if (!footnotes.length) { 65933 return /* @__PURE__ */ (0, import_jsx_runtime521.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime521.jsx)( 65934 import_components176.Placeholder, 65935 { 65936 icon: /* @__PURE__ */ (0, import_jsx_runtime521.jsx)(import_block_editor278.BlockIcon, { icon: format_list_numbered_default }), 65937 label: (0, import_i18n258.__)("Footnotes"), 65938 instructions: (0, import_i18n258.__)( 65939 "Footnotes found in blocks within this document will be displayed here." 65940 ) 65941 } 65942 ) }); 65943 } 65944 return /* @__PURE__ */ (0, import_jsx_runtime521.jsx)("ol", { ...blockProps, children: footnotes.map(({ id, content }) => ( 65945 /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */ 65946 /* @__PURE__ */ (0, import_jsx_runtime521.jsxs)( 65947 "li", 65948 { 65949 onMouseDown: (event) => { 65950 if (event.target === event.currentTarget) { 65951 event.target.firstElementChild.focus(); 65952 event.preventDefault(); 65953 } 65954 }, 65955 children: [ 65956 /* @__PURE__ */ (0, import_jsx_runtime521.jsx)( 65957 import_block_editor278.RichText, 65958 { 65959 id, 65960 tagName: "span", 65961 value: content, 65962 identifier: id, 65963 onFocus: (event) => { 65964 if (!event.target.textContent.trim()) { 65965 event.target.scrollIntoView(); 65966 } 65967 }, 65968 onChange: (nextFootnote) => { 65969 updateMeta({ 65970 ...meta, 65971 footnotes: JSON.stringify( 65972 footnotes.map((footnote) => { 65973 return footnote.id === id ? { 65974 content: nextFootnote, 65975 id 65976 } : footnote; 65977 }) 65978 ) 65979 }); 65980 } 65981 } 65982 ), 65983 " ", 65984 /* @__PURE__ */ (0, import_jsx_runtime521.jsx)("a", { href: `#$id}-link`, children: "\u21A9\uFE0E" }) 65985 ] 65986 }, 65987 id 65988 ) 65989 )) }); 65990 } 65991 65992 // packages/block-library/build-module/footnotes/block.json 65993 var block_default115 = { 65994 $schema: "https://schemas.wp.org/trunk/block.json", 65995 apiVersion: 3, 65996 name: "core/footnotes", 65997 title: "Footnotes", 65998 category: "text", 65999 description: "Display footnotes added to the page.", 66000 keywords: ["references"], 66001 textdomain: "default", 66002 usesContext: ["postId", "postType"], 66003 supports: { 66004 __experimentalBorder: { 66005 radius: true, 66006 color: true, 66007 width: true, 66008 style: true, 66009 __experimentalDefaultControls: { 66010 radius: false, 66011 color: false, 66012 width: false, 66013 style: false 66014 } 66015 }, 66016 color: { 66017 background: true, 66018 link: true, 66019 text: true, 66020 __experimentalDefaultControls: { 66021 link: true, 66022 text: true 66023 } 66024 }, 66025 html: false, 66026 multiple: false, 66027 reusable: false, 66028 inserter: false, 66029 spacing: { 66030 margin: true, 66031 padding: true, 66032 __experimentalDefaultControls: { 66033 margin: false, 66034 padding: false 66035 } 66036 }, 66037 typography: { 66038 fontSize: true, 66039 lineHeight: true, 66040 __experimentalFontFamily: true, 66041 __experimentalTextDecoration: true, 66042 __experimentalFontStyle: true, 66043 __experimentalFontWeight: true, 66044 __experimentalLetterSpacing: true, 66045 __experimentalTextTransform: true, 66046 __experimentalWritingMode: true, 66047 __experimentalDefaultControls: { 66048 fontSize: true 66049 } 66050 }, 66051 interactivity: { 66052 clientNavigation: true 66053 } 66054 }, 66055 style: "wp-block-footnotes" 66056 }; 66057 66058 // node_modules/uuid/dist/esm-browser/rng.js 66059 var getRandomValues; 66060 var rnds8 = new Uint8Array(16); 66061 function rng() { 66062 if (!getRandomValues) { 66063 getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto); 66064 if (!getRandomValues) { 66065 throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported"); 66066 } 66067 } 66068 return getRandomValues(rnds8); 66069 } 66070 66071 // node_modules/uuid/dist/esm-browser/stringify.js 66072 var byteToHex = []; 66073 for (let i2 = 0; i2 < 256; ++i2) { 66074 byteToHex.push((i2 + 256).toString(16).slice(1)); 66075 } 66076 function unsafeStringify(arr, offset = 0) { 66077 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]]; 66078 } 66079 66080 // node_modules/uuid/dist/esm-browser/native.js 66081 var randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto); 66082 var native_default = { 66083 randomUUID 66084 }; 66085 66086 // node_modules/uuid/dist/esm-browser/v4.js 66087 function v411(options2, buf, offset) { 66088 if (native_default.randomUUID && !buf && !options2) { 66089 return native_default.randomUUID(); 66090 } 66091 options2 = options2 || {}; 66092 const rnds = options2.random || (options2.rng || rng)(); 66093 rnds[6] = rnds[6] & 15 | 64; 66094 rnds[8] = rnds[8] & 63 | 128; 66095 if (buf) { 66096 offset = offset || 0; 66097 for (let i2 = 0; i2 < 16; ++i2) { 66098 buf[offset + i2] = rnds[i2]; 66099 } 66100 return buf; 66101 } 66102 return unsafeStringify(rnds); 66103 } 66104 var v4_default = v411; 66105 66106 // packages/block-library/build-module/footnotes/format.js 66107 var import_i18n259 = __toESM(require_i18n()); 66108 var import_rich_text5 = __toESM(require_rich_text()); 66109 var import_block_editor279 = __toESM(require_block_editor()); 66110 var import_data150 = __toESM(require_data()); 66111 var import_core_data94 = __toESM(require_core_data()); 66112 var import_blocks122 = __toESM(require_blocks()); 66113 var import_jsx_runtime522 = __toESM(require_jsx_runtime()); 66114 var { usesContextKey } = unlock(import_block_editor279.privateApis); 66115 var formatName = "core/footnote"; 66116 var POST_CONTENT_BLOCK_NAME = "core/post-content"; 66117 var SYNCED_PATTERN_BLOCK_NAME = "core/block"; 66118 var format2 = { 66119 title: (0, import_i18n259.__)("Footnote"), 66120 tagName: "sup", 66121 className: "fn", 66122 attributes: { 66123 "data-fn": "data-fn" 66124 }, 66125 interactive: true, 66126 contentEditable: false, 66127 [usesContextKey]: ["postType", "postId"], 66128 edit: function Edit20({ 66129 value, 66130 onChange, 66131 isObjectActive, 66132 context: { postType, postId } 66133 }) { 66134 const registry = (0, import_data150.useRegistry)(); 66135 const { 66136 getSelectedBlockClientId, 66137 getBlocks, 66138 getBlockRootClientId, 66139 getBlockName, 66140 getBlockParentsByBlockName 66141 } = registry.select(import_block_editor279.store); 66142 const isFootnotesSupported = (0, import_data150.useSelect)( 66143 (select9) => { 66144 if (!select9(import_blocks122.store).getBlockType("core/footnotes")) { 66145 return false; 66146 } 66147 const allowedBlocks = select9(import_block_editor279.store).getSettings().allowedBlockTypes; 66148 if (allowedBlocks === false || Array.isArray(allowedBlocks) && !allowedBlocks.includes("core/footnotes")) { 66149 return false; 66150 } 66151 const entityRecord = select9(import_core_data94.store).getEntityRecord( 66152 "postType", 66153 postType, 66154 postId 66155 ); 66156 if ("string" !== typeof entityRecord?.meta?.footnotes) { 66157 return false; 66158 } 66159 const { 66160 getBlockParentsByBlockName: _getBlockParentsByBlockName, 66161 getSelectedBlockClientId: _getSelectedBlockClientId 66162 } = select9(import_block_editor279.store); 66163 const parentCoreBlocks = _getBlockParentsByBlockName( 66164 _getSelectedBlockClientId(), 66165 SYNCED_PATTERN_BLOCK_NAME 66166 ); 66167 return !parentCoreBlocks || parentCoreBlocks.length === 0; 66168 }, 66169 [postType, postId] 66170 ); 66171 const { selectionChange, insertBlock } = (0, import_data150.useDispatch)(import_block_editor279.store); 66172 if (!isFootnotesSupported) { 66173 return null; 66174 } 66175 function onClick() { 66176 registry.batch(() => { 66177 let id; 66178 if (isObjectActive) { 66179 const object = value.replacements[value.start]; 66180 id = object?.attributes?.["data-fn"]; 66181 } else { 66182 id = v4_default(); 66183 const newValue = (0, import_rich_text5.insertObject)( 66184 value, 66185 { 66186 type: formatName, 66187 attributes: { 66188 "data-fn": id 66189 }, 66190 innerHTML: `<a href="#$id}" id="$id}-link">*</a>` 66191 }, 66192 value.end, 66193 value.end 66194 ); 66195 newValue.start = newValue.end - 1; 66196 onChange(newValue); 66197 } 66198 const selectedClientId = getSelectedBlockClientId(); 66199 const parentPostContent = getBlockParentsByBlockName( 66200 selectedClientId, 66201 POST_CONTENT_BLOCK_NAME 66202 ); 66203 const blocks = parentPostContent.length ? getBlocks(parentPostContent[0]) : getBlocks(); 66204 let fnBlock = null; 66205 { 66206 const queue = [...blocks]; 66207 while (queue.length) { 66208 const block = queue.shift(); 66209 if (block.name === "core/footnotes") { 66210 fnBlock = block; 66211 break; 66212 } 66213 queue.push(...block.innerBlocks); 66214 } 66215 } 66216 if (!fnBlock) { 66217 let rootClientId = getBlockRootClientId(selectedClientId); 66218 while (rootClientId && getBlockName(rootClientId) !== POST_CONTENT_BLOCK_NAME) { 66219 rootClientId = getBlockRootClientId(rootClientId); 66220 } 66221 fnBlock = (0, import_blocks122.createBlock)("core/footnotes"); 66222 insertBlock(fnBlock, void 0, rootClientId); 66223 } 66224 selectionChange(fnBlock.clientId, id, 0, 0); 66225 }); 66226 } 66227 return /* @__PURE__ */ (0, import_jsx_runtime522.jsx)( 66228 import_block_editor279.RichTextToolbarButton, 66229 { 66230 icon: format_list_numbered_default, 66231 title: (0, import_i18n259.__)("Footnote"), 66232 onClick, 66233 isActive: isObjectActive 66234 } 66235 ); 66236 } 66237 }; 66238 66239 // packages/block-library/build-module/footnotes/index.js 66240 var { name: name116 } = block_default115; 66241 var settings115 = { 66242 icon: format_list_numbered_default, 66243 edit: FootnotesEdit 66244 }; 66245 var init115 = () => { 66246 (0, import_rich_text6.registerFormatType)(formatName, format2); 66247 initBlock({ name: name116, metadata: block_default115, settings: settings115 }); 66248 }; 66249 66250 // packages/block-library/build-module/utils/is-block-metadata-experimental.js 66251 var __getOwnPropNames2 = Object.getOwnPropertyNames; 66252 var __commonJS2 = (cb, mod) => function __require2() { 66253 return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; 66254 }; 66255 var require_is_block_metadata_experimental = __commonJS2({ 66256 "packages/block-library/src/utils/is-block-metadata-experimental.js"(exports, module) { 66257 module.exports = function isBlockMetadataExperimental(metadata) { 66258 return metadata && "__experimental" in metadata && metadata.__experimental !== false; 66259 }; 66260 } 66261 }); 66262 var is_block_metadata_experimental_default = require_is_block_metadata_experimental(); 66263 66264 // packages/block-library/build-module/block-keyboard-shortcuts/index.js 66265 var import_element136 = __toESM(require_element()); 66266 var import_data151 = __toESM(require_data()); 66267 var import_keyboard_shortcuts = __toESM(require_keyboard_shortcuts()); 66268 var import_i18n260 = __toESM(require_i18n()); 66269 var import_blocks123 = __toESM(require_blocks()); 66270 var import_block_editor280 = __toESM(require_block_editor()); 66271 function BlockKeyboardShortcuts() { 66272 const { registerShortcut } = (0, import_data151.useDispatch)(import_keyboard_shortcuts.store); 66273 const { replaceBlocks } = (0, import_data151.useDispatch)(import_block_editor280.store); 66274 const { getBlockName, getSelectedBlockClientId, getBlockAttributes: getBlockAttributes4 } = (0, import_data151.useSelect)(import_block_editor280.store); 66275 const handleTransformHeadingAndParagraph = (event, level) => { 66276 event.preventDefault(); 66277 const currentClientId = getSelectedBlockClientId(); 66278 if (currentClientId === null) { 66279 return; 66280 } 66281 const blockName = getBlockName(currentClientId); 66282 const isParagraph = blockName === "core/paragraph"; 66283 const isHeading = blockName === "core/heading"; 66284 if (!isParagraph && !isHeading) { 66285 return; 66286 } 66287 const destinationBlockName = level === 0 ? "core/paragraph" : "core/heading"; 66288 const attributes3 = getBlockAttributes4(currentClientId); 66289 if (isParagraph && level === 0 || isHeading && attributes3.level === level) { 66290 return; 66291 } 66292 const newAttributes = { 66293 content: attributes3.content 66294 }; 66295 const sourceTextAlign = attributes3.textAlign || attributes3.style?.typography?.textAlign; 66296 if (destinationBlockName === "core/heading") { 66297 newAttributes.level = level; 66298 if (sourceTextAlign) { 66299 newAttributes.textAlign = sourceTextAlign; 66300 } 66301 } else if (sourceTextAlign) { 66302 newAttributes.style = { 66303 typography: { 66304 textAlign: sourceTextAlign 66305 } 66306 }; 66307 } 66308 replaceBlocks( 66309 currentClientId, 66310 (0, import_blocks123.createBlock)(destinationBlockName, newAttributes) 66311 ); 66312 }; 66313 (0, import_element136.useEffect)(() => { 66314 registerShortcut({ 66315 name: "core/block-editor/transform-heading-to-paragraph", 66316 category: "block-library", 66317 description: (0, import_i18n260.__)("Transform heading to paragraph."), 66318 keyCombination: { 66319 modifier: "access", 66320 character: "0" 66321 }, 66322 aliases: [ 66323 { 66324 modifier: "access", 66325 character: "7" 66326 } 66327 ] 66328 }); 66329 [1, 2, 3, 4, 5, 6].forEach((level) => { 66330 registerShortcut({ 66331 name: `core/block-editor/transform-paragraph-to-heading-$level}`, 66332 category: "block-library", 66333 description: (0, import_i18n260.__)("Transform paragraph to heading."), 66334 keyCombination: { 66335 modifier: "access", 66336 character: `$level}` 66337 } 66338 }); 66339 }); 66340 }, [registerShortcut]); 66341 (0, import_keyboard_shortcuts.useShortcut)( 66342 "core/block-editor/transform-heading-to-paragraph", 66343 (event) => handleTransformHeadingAndParagraph(event, 0) 66344 ); 66345 (0, import_keyboard_shortcuts.useShortcut)( 66346 "core/block-editor/transform-paragraph-to-heading-1", 66347 (event) => handleTransformHeadingAndParagraph(event, 1) 66348 ); 66349 (0, import_keyboard_shortcuts.useShortcut)( 66350 "core/block-editor/transform-paragraph-to-heading-2", 66351 (event) => handleTransformHeadingAndParagraph(event, 2) 66352 ); 66353 (0, import_keyboard_shortcuts.useShortcut)( 66354 "core/block-editor/transform-paragraph-to-heading-3", 66355 (event) => handleTransformHeadingAndParagraph(event, 3) 66356 ); 66357 (0, import_keyboard_shortcuts.useShortcut)( 66358 "core/block-editor/transform-paragraph-to-heading-4", 66359 (event) => handleTransformHeadingAndParagraph(event, 4) 66360 ); 66361 (0, import_keyboard_shortcuts.useShortcut)( 66362 "core/block-editor/transform-paragraph-to-heading-5", 66363 (event) => handleTransformHeadingAndParagraph(event, 5) 66364 ); 66365 (0, import_keyboard_shortcuts.useShortcut)( 66366 "core/block-editor/transform-paragraph-to-heading-6", 66367 (event) => handleTransformHeadingAndParagraph(event, 6) 66368 ); 66369 return null; 66370 } 66371 var block_keyboard_shortcuts_default = BlockKeyboardShortcuts; 66372 66373 // packages/block-library/build-module/private-apis.js 66374 var privateApis3 = {}; 66375 lock(privateApis3, { 66376 BlockKeyboardShortcuts: block_keyboard_shortcuts_default 66377 }); 66378 66379 // packages/block-library/build-module/index.js 66380 var import_jsx_runtime523 = __toESM(require_jsx_runtime()); 66381 var getAllBlocks = () => { 66382 const blocks = [ 66383 // Common blocks are grouped at the top to prioritize their display 66384 // in various contexts — like the inserter and auto-complete components. 66385 paragraph_exports, 66386 image_exports, 66387 heading_exports, 66388 gallery_exports, 66389 list_exports, 66390 list_item_exports, 66391 quote_exports, 66392 // Register all remaining core blocks. 66393 accordion_exports, 66394 accordion_item_exports, 66395 accordion_heading_exports, 66396 accordion_panel_exports, 66397 archives_exports, 66398 audio_exports, 66399 button_exports, 66400 buttons_exports, 66401 calendar_exports, 66402 categories_exports, 66403 code_exports, 66404 column_exports, 66405 columns_exports, 66406 comment_author_avatar_exports, 66407 cover_exports, 66408 details_exports, 66409 embed_exports, 66410 file_exports, 66411 group_exports, 66412 html_exports, 66413 math_exports, 66414 latest_comments_exports, 66415 latest_posts_exports, 66416 media_text_exports, 66417 missing_exports, 66418 more_exports, 66419 nextpage_exports, 66420 page_list_exports, 66421 page_list_item_exports, 66422 pattern_exports, 66423 preformatted_exports, 66424 pullquote_exports, 66425 block_exports, 66426 rss_exports, 66427 search_exports, 66428 separator_exports, 66429 shortcode_exports, 66430 social_link_exports, 66431 social_links_exports, 66432 spacer_exports, 66433 table_exports, 66434 tag_cloud_exports, 66435 text_columns_exports, 66436 verse_exports, 66437 video_exports, 66438 footnotes_exports, 66439 // theme blocks 66440 navigation_exports, 66441 navigation_link_exports, 66442 navigation_submenu_exports, 66443 site_logo_exports, 66444 site_title_exports, 66445 site_tagline_exports, 66446 query_exports, 66447 template_part_exports, 66448 avatar_exports, 66449 post_title_exports, 66450 post_excerpt_exports, 66451 post_featured_image_exports, 66452 post_content_exports, 66453 post_author_exports, 66454 post_author_name_exports, 66455 post_comment_exports, 66456 post_comments_count_exports, 66457 post_comments_link_exports, 66458 post_date_exports, 66459 post_terms_exports, 66460 post_navigation_link_exports, 66461 post_template_exports, 66462 post_time_to_read_exports, 66463 query_pagination_exports, 66464 query_pagination_next_exports, 66465 query_pagination_numbers_exports, 66466 query_pagination_previous_exports, 66467 query_no_results_exports, 66468 query_total_exports, 66469 read_more_exports, 66470 comments_exports, 66471 comment_author_name_exports, 66472 comment_content_exports, 66473 comment_date_exports, 66474 comment_edit_link_exports, 66475 comment_reply_link_exports, 66476 comment_template_exports, 66477 comments_title_exports, 66478 comments_pagination_exports, 66479 comments_pagination_next_exports, 66480 comments_pagination_numbers_exports, 66481 comments_pagination_previous_exports, 66482 post_comments_form_exports, 66483 table_of_contents_exports, 66484 home_link_exports, 66485 loginout_exports, 66486 term_count_exports, 66487 term_description_exports, 66488 term_name_exports, 66489 terms_query_exports, 66490 term_template_exports, 66491 query_title_exports, 66492 post_author_biography_exports 66493 ]; 66494 if (window?.__experimentalEnableBlockExperiments) { 66495 blocks.push(breadcrumbs_exports); 66496 blocks.push(tab_exports); 66497 blocks.push(tabs_exports); 66498 } 66499 if (window?.__experimentalEnableFormBlocks) { 66500 blocks.push(form_exports); 66501 blocks.push(form_input_exports); 66502 blocks.push(form_submit_button_exports); 66503 blocks.push(form_submission_notification_exports); 66504 } 66505 if (window?.__experimentalNavigationOverlays) { 66506 blocks.push(navigation_overlay_close_exports); 66507 } 66508 if (window?.wp?.oldEditor && (window?.wp?.needsClassicBlock || !window?.__experimentalDisableTinymce || !!new URLSearchParams(window?.location?.search).get( 66509 "requiresTinymce" 66510 ))) { 66511 blocks.push(freeform_exports); 66512 } 66513 return blocks.filter(Boolean); 66514 }; 66515 var __experimentalGetCoreBlocks = () => getAllBlocks().filter( 66516 ({ metadata }) => !is_block_metadata_experimental_default(metadata) 66517 ); 66518 var registerCoreBlocks = (blocks = __experimentalGetCoreBlocks()) => { 66519 blocks.forEach(({ init: init116 }) => init116()); 66520 if (window.__unstableAutoRegisterBlocks) { 66521 window.__unstableAutoRegisterBlocks.forEach((blockName) => { 66522 const bootstrappedBlockType = unlock( 66523 (0, import_data152.select)(import_blocks124.store) 66524 ).getBootstrappedBlockType(blockName); 66525 (0, import_blocks124.registerBlockType)(blockName, { 66526 // Use all metadata from PHP registration, 66527 // but fall back title to block name if not provided, 66528 // ensure minimum apiVersion 3 for block wrapper support, 66529 // and override with a ServerSideRender-based edit function. 66530 ...bootstrappedBlockType, 66531 title: bootstrappedBlockType?.title || blockName, 66532 ...(bootstrappedBlockType?.apiVersion ?? 0) < 3 && { 66533 apiVersion: 3 66534 }, 66535 edit: function Edit21({ attributes: attributes3 }) { 66536 const blockProps = (0, import_block_editor281.useBlockProps)(); 66537 const { content, status, error } = (0, import_server_side_render7.useServerSideRender)({ 66538 block: blockName, 66539 attributes: attributes3 66540 }); 66541 if (status === "loading") { 66542 return /* @__PURE__ */ (0, import_jsx_runtime523.jsx)("div", { ...blockProps, children: (0, import_i18n261.__)("Loading\u2026") }); 66543 } 66544 if (status === "error") { 66545 return /* @__PURE__ */ (0, import_jsx_runtime523.jsx)("div", { ...blockProps, children: (0, import_i18n261.sprintf)( 66546 /* translators: %s: error message describing the problem */ 66547 (0, import_i18n261.__)("Error loading block: %s"), 66548 error 66549 ) }); 66550 } 66551 return /* @__PURE__ */ (0, import_jsx_runtime523.jsx)( 66552 "div", 66553 { 66554 ...blockProps, 66555 dangerouslySetInnerHTML: { 66556 __html: content || "" 66557 } 66558 } 66559 ); 66560 }, 66561 save: () => null 66562 }); 66563 }); 66564 } 66565 (0, import_blocks124.setDefaultBlockName)(name62); 66566 if (window.wp && window.wp.oldEditor && blocks.some(({ name: name510 }) => name510 === name13)) { 66567 (0, import_blocks124.setFreeformContentHandlerName)(name13); 66568 } 66569 (0, import_blocks124.setUnregisteredTypeHandlerName)(name51); 66570 (0, import_blocks124.setGroupingBlockName)(name39); 66571 }; 66572 var __experimentalRegisterExperimentalCoreBlocks = false ? ({ enableFSEBlocks } = {}) => { 66573 const enabledExperiments = [enableFSEBlocks ? "fse" : null]; 66574 getAllBlocks().filter( 66575 ({ metadata }) => is_block_metadata_experimental_default(metadata) 66576 ).filter( 66577 ({ metadata: { __experimental } }) => __experimental === true || enabledExperiments.includes(__experimental) 66578 ).forEach(({ init: init116 }) => init116()); 66579 } : void 0; 66580 return __toCommonJS(index_exports); 66581 })(); 66582 /*! Bundled license information: 66583 66584 fast-average-color/dist/index.esm.js: 66585 (*! Fast Average Color | © 2022 Denis Seleznev | MIT License | https://github.com/fast-average-color/fast-average-color *) 66586 */
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated : Tue May 5 08:20:14 2026 | Cross-referenced by PHPXref |