| [ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Summary view] [Print] [Text view]
1 (function() { 2 "use strict"; 3 var wp; 4 (wp ||= {}).element = (() => { 5 var __create = Object.create; 6 var __defProp = Object.defineProperty; 7 var __getOwnPropDesc = Object.getOwnPropertyDescriptor; 8 var __getOwnPropNames = Object.getOwnPropertyNames; 9 var __getProtoOf = Object.getPrototypeOf; 10 var __hasOwnProp = Object.prototype.hasOwnProperty; 11 var __commonJS = (cb, mod) => function __require() { 12 return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; 13 }; 14 var __export = (target, all) => { 15 for (var name in all) 16 __defProp(target, name, { get: all[name], enumerable: true }); 17 }; 18 var __copyProps = (to, from, except, desc) => { 19 if (from && typeof from === "object" || typeof from === "function") { 20 for (let key of __getOwnPropNames(from)) 21 if (!__hasOwnProp.call(to, key) && key !== except) 22 __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); 23 } 24 return to; 25 }; 26 var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( 27 // If the importer is in node compatibility mode or this is not an ESM 28 // file that has been converted to a CommonJS file using a Babel- 29 // compatible transform (i.e. "__esModule" has not been set), then set 30 // "default" to the CommonJS "module.exports" for node compatibility. 31 isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, 32 mod 33 )); 34 var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); 35 36 // vendor-external:react 37 var require_react = __commonJS({ 38 "vendor-external:react"(exports, module) { 39 module.exports = window.React; 40 } 41 }); 42 43 // vendor-external:react-dom 44 var require_react_dom = __commonJS({ 45 "vendor-external:react-dom"(exports, module) { 46 module.exports = window.ReactDOM; 47 } 48 }); 49 50 // vendor-external:react-dom/client 51 var require_client = __commonJS({ 52 "vendor-external:react-dom/client"(exports, module) { 53 module.exports = window.ReactDOM; 54 } 55 }); 56 57 // package-external:@wordpress/escape-html 58 var require_escape_html = __commonJS({ 59 "package-external:@wordpress/escape-html"(exports, module) { 60 module.exports = window.wp.escapeHtml; 61 } 62 }); 63 64 // packages/element/build-module/index.mjs 65 var index_exports = {}; 66 __export(index_exports, { 67 Children: () => import_react.Children, 68 Component: () => import_react.Component, 69 Fragment: () => import_react.Fragment, 70 Platform: () => platform_default, 71 PureComponent: () => import_react.PureComponent, 72 RawHTML: () => RawHTML, 73 StrictMode: () => import_react.StrictMode, 74 Suspense: () => import_react.Suspense, 75 cloneElement: () => import_react.cloneElement, 76 concatChildren: () => concatChildren, 77 createContext: () => import_react.createContext, 78 createElement: () => import_react.createElement, 79 createInterpolateElement: () => create_interpolate_element_default, 80 createPortal: () => createPortal, 81 createRef: () => import_react.createRef, 82 createRoot: () => import_client.createRoot, 83 findDOMNode: () => findDOMNode, 84 flushSync: () => flushSync, 85 forwardRef: () => import_react.forwardRef, 86 hydrate: () => hydrate, 87 hydrateRoot: () => import_client.hydrateRoot, 88 isEmptyElement: () => isEmptyElement, 89 isValidElement: () => import_react.isValidElement, 90 lazy: () => import_react.lazy, 91 memo: () => import_react.memo, 92 render: () => render, 93 renderToString: () => serialize_default, 94 startTransition: () => import_react.startTransition, 95 switchChildrenNodeName: () => switchChildrenNodeName, 96 unmountComponentAtNode: () => unmountComponentAtNode, 97 useCallback: () => import_react.useCallback, 98 useContext: () => import_react.useContext, 99 useDebugValue: () => import_react.useDebugValue, 100 useDeferredValue: () => import_react.useDeferredValue, 101 useEffect: () => import_react.useEffect, 102 useId: () => import_react.useId, 103 useImperativeHandle: () => import_react.useImperativeHandle, 104 useInsertionEffect: () => import_react.useInsertionEffect, 105 useLayoutEffect: () => import_react.useLayoutEffect, 106 useMemo: () => import_react.useMemo, 107 useReducer: () => import_react.useReducer, 108 useRef: () => import_react.useRef, 109 useState: () => import_react.useState, 110 useSyncExternalStore: () => import_react.useSyncExternalStore, 111 useTransition: () => import_react.useTransition 112 }); 113 114 // packages/element/build-module/react.mjs 115 var import_react = __toESM(require_react(), 1); 116 function concatChildren(...childrenArguments) { 117 return childrenArguments.reduce( 118 (accumulator, children, i) => { 119 import_react.Children.forEach(children, (child, j) => { 120 if ((0, import_react.isValidElement)(child) && typeof child !== "string") { 121 child = (0, import_react.cloneElement)(child, { 122 key: [i, j].join() 123 }); 124 } 125 accumulator.push(child); 126 }); 127 return accumulator; 128 }, 129 [] 130 ); 131 } 132 function switchChildrenNodeName(children, nodeName) { 133 return children && import_react.Children.map(children, (elt, index) => { 134 if (typeof elt?.valueOf() === "string") { 135 return (0, import_react.createElement)(nodeName, { key: index }, elt); 136 } 137 if (!(0, import_react.isValidElement)(elt)) { 138 return elt; 139 } 140 const { children: childrenProp, ...props } = elt.props; 141 return (0, import_react.createElement)( 142 nodeName, 143 { key: index, ...props }, 144 childrenProp 145 ); 146 }); 147 } 148 149 // packages/element/build-module/create-interpolate-element.mjs 150 var indoc; 151 var offset; 152 var output; 153 var stack; 154 var tokenizer = /<(\/)?(\w+)\s*(\/)?>/g; 155 function createFrame(element, tokenStart, tokenLength, prevOffset, leadingTextStart) { 156 return { 157 element, 158 tokenStart, 159 tokenLength, 160 prevOffset, 161 leadingTextStart, 162 children: [] 163 }; 164 } 165 function createInterpolateElement(interpolatedString, conversionMap) { 166 indoc = interpolatedString; 167 offset = 0; 168 output = []; 169 stack = []; 170 tokenizer.lastIndex = 0; 171 if (!isValidConversionMap(conversionMap)) { 172 throw new TypeError( 173 "The conversionMap provided is not valid. It must be an object with values that are React Elements" 174 ); 175 } 176 do { 177 } while (proceed(conversionMap)); 178 return (0, import_react.createElement)(import_react.Fragment, null, ...output); 179 } 180 var isValidConversionMap = (conversionMap) => { 181 const isObject2 = typeof conversionMap === "object" && conversionMap !== null; 182 const values = isObject2 && Object.values(conversionMap); 183 return isObject2 && values.length > 0 && values.every((element) => (0, import_react.isValidElement)(element)); 184 }; 185 function proceed(conversionMap) { 186 const next = nextToken(); 187 const [tokenType, name, startOffset, tokenLength] = next; 188 const stackDepth = stack.length; 189 const leadingTextStart = startOffset > offset ? offset : null; 190 if (name && !conversionMap[name]) { 191 addText(); 192 return false; 193 } 194 switch (tokenType) { 195 case "no-more-tokens": 196 if (stackDepth !== 0) { 197 const { leadingTextStart: stackLeadingText, tokenStart } = stack.pop(); 198 output.push(indoc.substr(stackLeadingText, tokenStart)); 199 } 200 addText(); 201 return false; 202 case "self-closed": 203 if (0 === stackDepth) { 204 if (null !== leadingTextStart) { 205 output.push( 206 indoc.substr( 207 leadingTextStart, 208 startOffset - leadingTextStart 209 ) 210 ); 211 } 212 output.push(conversionMap[name]); 213 offset = startOffset + tokenLength; 214 return true; 215 } 216 addChild( 217 createFrame(conversionMap[name], startOffset, tokenLength) 218 ); 219 offset = startOffset + tokenLength; 220 return true; 221 case "opener": 222 stack.push( 223 createFrame( 224 conversionMap[name], 225 startOffset, 226 tokenLength, 227 startOffset + tokenLength, 228 leadingTextStart 229 ) 230 ); 231 offset = startOffset + tokenLength; 232 return true; 233 case "closer": 234 if (0 === stackDepth) { 235 if (true) { 236 console.warn( 237 `Unmatched closing tag '</$name}>' in createInterpolateElement. The rest of the string was not interpolated.` 238 ); 239 } 240 addText(); 241 return false; 242 } 243 if (1 === stackDepth) { 244 closeOuterElement(startOffset); 245 offset = startOffset + tokenLength; 246 return true; 247 } 248 const stackTop = stack.pop(); 249 const text = indoc.substr( 250 stackTop.prevOffset, 251 startOffset - stackTop.prevOffset 252 ); 253 stackTop.children.push(text); 254 stackTop.prevOffset = startOffset + tokenLength; 255 const frame = createFrame( 256 stackTop.element, 257 stackTop.tokenStart, 258 stackTop.tokenLength, 259 startOffset + tokenLength 260 ); 261 frame.children = stackTop.children; 262 addChild(frame); 263 offset = startOffset + tokenLength; 264 return true; 265 default: 266 addText(); 267 return false; 268 } 269 } 270 function nextToken() { 271 const matches = tokenizer.exec(indoc); 272 if (null === matches) { 273 return ["no-more-tokens"]; 274 } 275 const startedAt = matches.index; 276 const [match, isClosing, name, isSelfClosed] = matches; 277 const length = match.length; 278 if (isSelfClosed) { 279 return ["self-closed", name, startedAt, length]; 280 } 281 if (isClosing) { 282 return ["closer", name, startedAt, length]; 283 } 284 return ["opener", name, startedAt, length]; 285 } 286 function addText() { 287 const length = indoc.length - offset; 288 if (0 === length) { 289 return; 290 } 291 output.push(indoc.substr(offset, length)); 292 } 293 function addChild(frame) { 294 const { element, tokenStart, tokenLength, prevOffset, children } = frame; 295 const parent = stack[stack.length - 1]; 296 const text = indoc.substr( 297 parent.prevOffset, 298 tokenStart - parent.prevOffset 299 ); 300 if (text) { 301 parent.children.push(text); 302 } 303 parent.children.push((0, import_react.cloneElement)(element, null, ...children)); 304 parent.prevOffset = prevOffset ? prevOffset : tokenStart + tokenLength; 305 } 306 function closeOuterElement(endOffset) { 307 const { element, leadingTextStart, prevOffset, tokenStart, children } = stack.pop(); 308 const text = endOffset ? indoc.substr(prevOffset, endOffset - prevOffset) : indoc.substr(prevOffset); 309 if (text) { 310 children.push(text); 311 } 312 if (null !== leadingTextStart) { 313 output.push( 314 indoc.substr(leadingTextStart, tokenStart - leadingTextStart) 315 ); 316 } 317 output.push((0, import_react.cloneElement)(element, null, ...children)); 318 } 319 var create_interpolate_element_default = createInterpolateElement; 320 321 // packages/element/build-module/react-platform.mjs 322 var ReactDOM = __toESM(require_react_dom(), 1); 323 var import_client = __toESM(require_client(), 1); 324 var { 325 createPortal, 326 flushSync, 327 /* eslint-disable react/no-deprecated */ 328 findDOMNode, 329 render, 330 hydrate, 331 unmountComponentAtNode 332 /* eslint-enable react/no-deprecated */ 333 } = ReactDOM; 334 335 // packages/element/build-module/utils.mjs 336 var isEmptyElement = (element) => { 337 if (typeof element === "number") { 338 return false; 339 } 340 if (typeof element?.valueOf() === "string" || Array.isArray(element)) { 341 return !element.length; 342 } 343 return !element; 344 }; 345 346 // packages/element/build-module/platform.mjs 347 var Platform = { 348 /** Platform identifier. Will always be `'web'` in this module. */ 349 OS: "web", 350 /** 351 * Select a value based on the platform. 352 * 353 * @template T 354 * @param spec - Object with optional platform-specific values. 355 * @return The selected value. 356 */ 357 select(spec) { 358 return "web" in spec ? spec.web : spec.default; 359 }, 360 /** Whether the platform is web */ 361 isWeb: true 362 }; 363 var platform_default = Platform; 364 365 // node_modules/is-plain-object/dist/is-plain-object.mjs 366 function isObject(o) { 367 return Object.prototype.toString.call(o) === "[object Object]"; 368 } 369 function isPlainObject(o) { 370 var ctor, prot; 371 if (isObject(o) === false) return false; 372 ctor = o.constructor; 373 if (ctor === void 0) return true; 374 prot = ctor.prototype; 375 if (isObject(prot) === false) return false; 376 if (prot.hasOwnProperty("isPrototypeOf") === false) { 377 return false; 378 } 379 return true; 380 } 381 382 // node_modules/tslib/tslib.es6.mjs 383 var __assign = function() { 384 __assign = Object.assign || function __assign2(t) { 385 for (var s, i = 1, n = arguments.length; i < n; i++) { 386 s = arguments[i]; 387 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; 388 } 389 return t; 390 }; 391 return __assign.apply(this, arguments); 392 }; 393 394 // node_modules/lower-case/dist.es2015/index.js 395 function lowerCase(str) { 396 return str.toLowerCase(); 397 } 398 399 // node_modules/no-case/dist.es2015/index.js 400 var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g]; 401 var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi; 402 function noCase(input, options) { 403 if (options === void 0) { 404 options = {}; 405 } 406 var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d; 407 var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0"); 408 var start = 0; 409 var end = result.length; 410 while (result.charAt(start) === "\0") 411 start++; 412 while (result.charAt(end - 1) === "\0") 413 end--; 414 return result.slice(start, end).split("\0").map(transform).join(delimiter); 415 } 416 function replace(input, re, value) { 417 if (re instanceof RegExp) 418 return input.replace(re, value); 419 return re.reduce(function(input2, re2) { 420 return input2.replace(re2, value); 421 }, input); 422 } 423 424 // node_modules/dot-case/dist.es2015/index.js 425 function dotCase(input, options) { 426 if (options === void 0) { 427 options = {}; 428 } 429 return noCase(input, __assign({ delimiter: "." }, options)); 430 } 431 432 // node_modules/param-case/dist.es2015/index.js 433 function paramCase(input, options) { 434 if (options === void 0) { 435 options = {}; 436 } 437 return dotCase(input, __assign({ delimiter: "-" }, options)); 438 } 439 440 // packages/element/build-module/serialize.mjs 441 var import_escape_html = __toESM(require_escape_html(), 1); 442 443 // packages/element/build-module/raw-html.mjs 444 function RawHTML({ children, ...props }) { 445 let rawHtml = ""; 446 import_react.Children.toArray(children).forEach((child) => { 447 if (typeof child === "string" && child.trim() !== "") { 448 rawHtml += child; 449 } 450 }); 451 return (0, import_react.createElement)("div", { 452 dangerouslySetInnerHTML: { __html: rawHtml }, 453 ...props 454 }); 455 } 456 457 // packages/element/build-module/serialize.mjs 458 var Context = (0, import_react.createContext)(void 0); 459 Context.displayName = "ElementContext"; 460 var { Provider, Consumer } = Context; 461 var ForwardRef = (0, import_react.forwardRef)(() => { 462 return null; 463 }); 464 var Memo = (0, import_react.memo)(() => { 465 return null; 466 }); 467 var ATTRIBUTES_TYPES = /* @__PURE__ */ new Set(["string", "boolean", "number"]); 468 var SELF_CLOSING_TAGS = /* @__PURE__ */ new Set([ 469 "area", 470 "base", 471 "br", 472 "col", 473 "command", 474 "embed", 475 "hr", 476 "img", 477 "input", 478 "keygen", 479 "link", 480 "meta", 481 "param", 482 "source", 483 "track", 484 "wbr" 485 ]); 486 var BOOLEAN_ATTRIBUTES = /* @__PURE__ */ new Set([ 487 "allowfullscreen", 488 "allowpaymentrequest", 489 "allowusermedia", 490 "async", 491 "autofocus", 492 "autoplay", 493 "checked", 494 "controls", 495 "default", 496 "defer", 497 "disabled", 498 "download", 499 "formnovalidate", 500 "hidden", 501 "ismap", 502 "itemscope", 503 "loop", 504 "multiple", 505 "muted", 506 "nomodule", 507 "novalidate", 508 "open", 509 "playsinline", 510 "readonly", 511 "required", 512 "reversed", 513 "selected", 514 "typemustmatch" 515 ]); 516 var ENUMERATED_ATTRIBUTES = /* @__PURE__ */ new Set([ 517 "autocapitalize", 518 "autocomplete", 519 "charset", 520 "contenteditable", 521 "crossorigin", 522 "decoding", 523 "dir", 524 "draggable", 525 "enctype", 526 "formenctype", 527 "formmethod", 528 "http-equiv", 529 "inputmode", 530 "kind", 531 "method", 532 "preload", 533 "scope", 534 "shape", 535 "spellcheck", 536 "translate", 537 "type", 538 "wrap" 539 ]); 540 var CSS_PROPERTIES_SUPPORTS_UNITLESS = /* @__PURE__ */ new Set([ 541 "animation", 542 "animationIterationCount", 543 "baselineShift", 544 "borderImageOutset", 545 "borderImageSlice", 546 "borderImageWidth", 547 "columnCount", 548 "cx", 549 "cy", 550 "fillOpacity", 551 "flexGrow", 552 "flexShrink", 553 "floodOpacity", 554 "fontWeight", 555 "gridColumnEnd", 556 "gridColumnStart", 557 "gridRowEnd", 558 "gridRowStart", 559 "lineHeight", 560 "opacity", 561 "order", 562 "orphans", 563 "r", 564 "rx", 565 "ry", 566 "shapeImageThreshold", 567 "stopOpacity", 568 "strokeDasharray", 569 "strokeDashoffset", 570 "strokeMiterlimit", 571 "strokeOpacity", 572 "strokeWidth", 573 "tabSize", 574 "widows", 575 "x", 576 "y", 577 "zIndex", 578 "zoom" 579 ]); 580 function hasPrefix(string, prefixes) { 581 return prefixes.some((prefix) => string.indexOf(prefix) === 0); 582 } 583 function isInternalAttribute(attribute) { 584 return "key" === attribute || "children" === attribute; 585 } 586 function getNormalAttributeValue(attribute, value) { 587 switch (attribute) { 588 case "style": 589 return renderStyle(value); 590 } 591 return value; 592 } 593 var SVG_ATTRIBUTE_WITH_DASHES_LIST = [ 594 "accentHeight", 595 "alignmentBaseline", 596 "arabicForm", 597 "baselineShift", 598 "capHeight", 599 "clipPath", 600 "clipRule", 601 "colorInterpolation", 602 "colorInterpolationFilters", 603 "colorProfile", 604 "colorRendering", 605 "dominantBaseline", 606 "enableBackground", 607 "fillOpacity", 608 "fillRule", 609 "floodColor", 610 "floodOpacity", 611 "fontFamily", 612 "fontSize", 613 "fontSizeAdjust", 614 "fontStretch", 615 "fontStyle", 616 "fontVariant", 617 "fontWeight", 618 "glyphName", 619 "glyphOrientationHorizontal", 620 "glyphOrientationVertical", 621 "horizAdvX", 622 "horizOriginX", 623 "imageRendering", 624 "letterSpacing", 625 "lightingColor", 626 "markerEnd", 627 "markerMid", 628 "markerStart", 629 "overlinePosition", 630 "overlineThickness", 631 "paintOrder", 632 "panose1", 633 "pointerEvents", 634 "renderingIntent", 635 "shapeRendering", 636 "stopColor", 637 "stopOpacity", 638 "strikethroughPosition", 639 "strikethroughThickness", 640 "strokeDasharray", 641 "strokeDashoffset", 642 "strokeLinecap", 643 "strokeLinejoin", 644 "strokeMiterlimit", 645 "strokeOpacity", 646 "strokeWidth", 647 "textAnchor", 648 "textDecoration", 649 "textRendering", 650 "underlinePosition", 651 "underlineThickness", 652 "unicodeBidi", 653 "unicodeRange", 654 "unitsPerEm", 655 "vAlphabetic", 656 "vHanging", 657 "vIdeographic", 658 "vMathematical", 659 "vectorEffect", 660 "vertAdvY", 661 "vertOriginX", 662 "vertOriginY", 663 "wordSpacing", 664 "writingMode", 665 "xmlnsXlink", 666 "xHeight" 667 ].reduce( 668 (map, attribute) => { 669 map[attribute.toLowerCase()] = attribute; 670 return map; 671 }, 672 {} 673 ); 674 var CASE_SENSITIVE_SVG_ATTRIBUTES = [ 675 "allowReorder", 676 "attributeName", 677 "attributeType", 678 "autoReverse", 679 "baseFrequency", 680 "baseProfile", 681 "calcMode", 682 "clipPathUnits", 683 "contentScriptType", 684 "contentStyleType", 685 "diffuseConstant", 686 "edgeMode", 687 "externalResourcesRequired", 688 "filterRes", 689 "filterUnits", 690 "glyphRef", 691 "gradientTransform", 692 "gradientUnits", 693 "kernelMatrix", 694 "kernelUnitLength", 695 "keyPoints", 696 "keySplines", 697 "keyTimes", 698 "lengthAdjust", 699 "limitingConeAngle", 700 "markerHeight", 701 "markerUnits", 702 "markerWidth", 703 "maskContentUnits", 704 "maskUnits", 705 "numOctaves", 706 "pathLength", 707 "patternContentUnits", 708 "patternTransform", 709 "patternUnits", 710 "pointsAtX", 711 "pointsAtY", 712 "pointsAtZ", 713 "preserveAlpha", 714 "preserveAspectRatio", 715 "primitiveUnits", 716 "refX", 717 "refY", 718 "repeatCount", 719 "repeatDur", 720 "requiredExtensions", 721 "requiredFeatures", 722 "specularConstant", 723 "specularExponent", 724 "spreadMethod", 725 "startOffset", 726 "stdDeviation", 727 "stitchTiles", 728 "suppressContentEditableWarning", 729 "suppressHydrationWarning", 730 "surfaceScale", 731 "systemLanguage", 732 "tableValues", 733 "targetX", 734 "targetY", 735 "textLength", 736 "viewBox", 737 "viewTarget", 738 "xChannelSelector", 739 "yChannelSelector" 740 ].reduce( 741 (map, attribute) => { 742 map[attribute.toLowerCase()] = attribute; 743 return map; 744 }, 745 {} 746 ); 747 var SVG_ATTRIBUTES_WITH_COLONS = [ 748 "xlink:actuate", 749 "xlink:arcrole", 750 "xlink:href", 751 "xlink:role", 752 "xlink:show", 753 "xlink:title", 754 "xlink:type", 755 "xml:base", 756 "xml:lang", 757 "xml:space", 758 "xmlns:xlink" 759 ].reduce( 760 (map, attribute) => { 761 map[attribute.replace(":", "").toLowerCase()] = attribute; 762 return map; 763 }, 764 {} 765 ); 766 function getNormalAttributeName(attribute) { 767 switch (attribute) { 768 case "htmlFor": 769 return "for"; 770 case "className": 771 return "class"; 772 } 773 const attributeLowerCase = attribute.toLowerCase(); 774 if (CASE_SENSITIVE_SVG_ATTRIBUTES[attributeLowerCase]) { 775 return CASE_SENSITIVE_SVG_ATTRIBUTES[attributeLowerCase]; 776 } else if (SVG_ATTRIBUTE_WITH_DASHES_LIST[attributeLowerCase]) { 777 return paramCase( 778 SVG_ATTRIBUTE_WITH_DASHES_LIST[attributeLowerCase] 779 ); 780 } else if (SVG_ATTRIBUTES_WITH_COLONS[attributeLowerCase]) { 781 return SVG_ATTRIBUTES_WITH_COLONS[attributeLowerCase]; 782 } 783 return attributeLowerCase; 784 } 785 function getNormalStylePropertyName(property) { 786 if (property.startsWith("--")) { 787 return property; 788 } 789 if (hasPrefix(property, ["ms", "O", "Moz", "Webkit"])) { 790 return "-" + paramCase(property); 791 } 792 return paramCase(property); 793 } 794 function getNormalStylePropertyValue(property, value) { 795 if (typeof value === "number" && 0 !== value && !hasPrefix(property, ["--"]) && !CSS_PROPERTIES_SUPPORTS_UNITLESS.has(property)) { 796 return value + "px"; 797 } 798 return value; 799 } 800 function renderElement(element, context, legacyContext = {}) { 801 if (null === element || void 0 === element || false === element) { 802 return ""; 803 } 804 if (Array.isArray(element)) { 805 return renderChildren(element, context, legacyContext); 806 } 807 switch (typeof element) { 808 case "string": 809 return (0, import_escape_html.escapeHTML)(element); 810 case "number": 811 return element.toString(); 812 } 813 const { type, props } = element; 814 switch (type) { 815 case import_react.StrictMode: 816 case import_react.Fragment: 817 return renderChildren(props.children, context, legacyContext); 818 case RawHTML: 819 const { children, ...wrapperProps } = props; 820 return renderNativeComponent( 821 !Object.keys(wrapperProps).length ? null : "div", 822 { 823 ...wrapperProps, 824 dangerouslySetInnerHTML: { __html: children } 825 }, 826 context, 827 legacyContext 828 ); 829 } 830 switch (typeof type) { 831 case "string": 832 return renderNativeComponent(type, props, context, legacyContext); 833 case "function": 834 if (type.prototype && typeof type.prototype.render === "function") { 835 return renderComponent(type, props, context, legacyContext); 836 } 837 return renderElement( 838 type(props, legacyContext), 839 context, 840 legacyContext 841 ); 842 } 843 switch (type && type.$$typeof) { 844 case Provider.$$typeof: 845 return renderChildren(props.children, props.value, legacyContext); 846 case Consumer.$$typeof: 847 return renderElement( 848 props.children(context || type._currentValue), 849 context, 850 legacyContext 851 ); 852 case ForwardRef.$$typeof: 853 return renderElement( 854 type.render(props), 855 context, 856 legacyContext 857 ); 858 case Memo.$$typeof: 859 return renderElement( 860 (0, import_react.createElement)(type.type, props), 861 context, 862 legacyContext 863 ); 864 } 865 return ""; 866 } 867 function renderNativeComponent(type, props, context, legacyContext = {}) { 868 let content = ""; 869 if (type === "textarea" && props.hasOwnProperty("value")) { 870 content = renderChildren(props.value, context, legacyContext); 871 const { value, ...restProps } = props; 872 props = restProps; 873 } else if (props.dangerouslySetInnerHTML && typeof props.dangerouslySetInnerHTML.__html === "string") { 874 content = props.dangerouslySetInnerHTML.__html; 875 } else if (typeof props.children !== "undefined") { 876 content = renderChildren(props.children, context, legacyContext); 877 } 878 if (!type) { 879 return content; 880 } 881 const attributes = renderAttributes(props); 882 if (SELF_CLOSING_TAGS.has(type)) { 883 return "<" + type + attributes + "/>"; 884 } 885 return "<" + type + attributes + ">" + content + "</" + type + ">"; 886 } 887 function renderComponent(Component2, props, context, legacyContext = {}) { 888 const instance = new Component2(props, legacyContext); 889 if (typeof instance.getChildContext === "function") { 890 Object.assign(legacyContext, instance.getChildContext()); 891 } 892 const html = renderElement(instance.render(), context, legacyContext); 893 return html; 894 } 895 function renderChildren(children, context, legacyContext = {}) { 896 let result = ""; 897 const childrenArray = Array.isArray(children) ? children : [children]; 898 for (let i = 0; i < childrenArray.length; i++) { 899 const child = childrenArray[i]; 900 result += renderElement(child, context, legacyContext); 901 } 902 return result; 903 } 904 function renderAttributes(props) { 905 let result = ""; 906 for (const key in props) { 907 const attribute = getNormalAttributeName(key); 908 if (!(0, import_escape_html.isValidAttributeName)(attribute)) { 909 continue; 910 } 911 let value = getNormalAttributeValue(key, props[key]); 912 if (!ATTRIBUTES_TYPES.has(typeof value)) { 913 continue; 914 } 915 if (isInternalAttribute(key)) { 916 continue; 917 } 918 const isBooleanAttribute = BOOLEAN_ATTRIBUTES.has(attribute); 919 if (isBooleanAttribute && value === false) { 920 continue; 921 } 922 const isMeaningfulAttribute = isBooleanAttribute || hasPrefix(key, ["data-", "aria-"]) || ENUMERATED_ATTRIBUTES.has(attribute); 923 if (typeof value === "boolean" && !isMeaningfulAttribute) { 924 continue; 925 } 926 result += " " + attribute; 927 if (isBooleanAttribute) { 928 continue; 929 } 930 if (typeof value === "string") { 931 value = (0, import_escape_html.escapeAttribute)(value); 932 } 933 result += '="' + value + '"'; 934 } 935 return result; 936 } 937 function renderStyle(style) { 938 if (!isPlainObject(style)) { 939 return style; 940 } 941 let result; 942 const styleObj = style; 943 for (const property in styleObj) { 944 const value = styleObj[property]; 945 if (null === value || void 0 === value) { 946 continue; 947 } 948 if (result) { 949 result += ";"; 950 } else { 951 result = ""; 952 } 953 const normalName = getNormalStylePropertyName(property); 954 const normalValue = getNormalStylePropertyValue(property, value); 955 result += normalName + ":" + normalValue; 956 } 957 return result; 958 } 959 var serialize_default = renderElement; 960 return __toCommonJS(index_exports); 961 })(); 962 /*! Bundled license information: 963 964 is-plain-object/dist/is-plain-object.mjs: 965 (*! 966 * is-plain-object <https://github.com/jonschlinkert/is-plain-object> 967 * 968 * Copyright (c) 2014-2017, Jon Schlinkert. 969 * Released under the MIT License. 970 *) 971 */ 972 (window.wp ||= {}).element = wp.element; 973 })();
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated : Sun Sep 13 08:20:28 2026 | Cross-referenced by PHPXref |