{"ast":null,"code":"import React from \"react\";\nimport { slugger } from \"../../helpers/slugger\";\nexport var PropTypeWithLinks = function PropTypeWithLinks(_ref) {\n  var type = _ref.type,\n      allPropComponents = _ref.allPropComponents;\n  // If this type contains the names of any other components on this page as full words, turn them into links.\n  var referencedComponentNames = allPropComponents.filter(function (component) {\n    return type.match(new RegExp(\"\\\\b\" + component.name + \"\\\\b\"));\n  }).map(function (component) {\n    return component.name;\n  });\n\n  if (referencedComponentNames.length > 0) {\n    return React.createElement(React.Fragment, null, type.split(new RegExp(\"\\\\b(\" + referencedComponentNames.join(\"|\") + \")\\\\b\")).map(function (segment, i) {\n      return referencedComponentNames.includes(segment) ? React.createElement(\"a\", {\n        key: segment + i,\n        onClick: function onClick(event) {\n          event.preventDefault();\n          document.getElementById(slugger(segment)).scrollIntoView();\n        }\n      }, segment) : segment;\n    }));\n  }\n\n  return type;\n};","map":{"version":3,"names":["React","slugger","PropTypeWithLinks","type","allPropComponents","referencedComponentNames","filter","component","match","RegExp","name","map","length","split","join","segment","i","includes","event","preventDefault","document","getElementById","scrollIntoView"],"sources":["/Users/ausulliv/repos/temp/patternfly-react/node_modules/@patternfly/documentation-framework/components/propsTable/propTypeWithLinks.js"],"sourcesContent":["import React from \"react\";\nimport { slugger } from \"../../helpers/slugger\";\n\nexport const PropTypeWithLinks = ({ type, allPropComponents }) => {\n  // If this type contains the names of any other components on this page as full words, turn them into links.\n  const referencedComponentNames = allPropComponents\n    .filter((component) => type.match(new RegExp(`\\\\b${component.name}\\\\b`)))\n    .map((component) => component.name);\n  if (referencedComponentNames.length > 0) {\n    return (\n      <React.Fragment>\n        {type\n          .split(new RegExp(`\\\\b(${referencedComponentNames.join(\"|\")})\\\\b`))\n          .map((segment, i) =>\n            referencedComponentNames.includes(segment) ? (\n              <a\n                key={segment + i}\n                onClick={(event) => {\n                  event.preventDefault();\n                  document.getElementById(slugger(segment)).scrollIntoView();\n                }}\n              >\n                {segment}\n              </a>\n            ) : (\n              segment\n            )\n          )}\n      </React.Fragment>\n    );\n  }\n  return type;\n};\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,OAAT,QAAwB,uBAAxB;AAEA,OAAO,IAAMC,iBAAiB,GAAG,SAApBA,iBAAoB,OAAiC;EAAA,IAA9BC,IAA8B,QAA9BA,IAA8B;EAAA,IAAxBC,iBAAwB,QAAxBA,iBAAwB;EAChE;EACA,IAAMC,wBAAwB,GAAGD,iBAAiB,CAC/CE,MAD8B,CACvB,UAACC,SAAD;IAAA,OAAeJ,IAAI,CAACK,KAAL,CAAW,IAAIC,MAAJ,SAAiBF,SAAS,CAACG,IAA3B,SAAX,CAAf;EAAA,CADuB,EAE9BC,GAF8B,CAE1B,UAACJ,SAAD;IAAA,OAAeA,SAAS,CAACG,IAAzB;EAAA,CAF0B,CAAjC;;EAGA,IAAIL,wBAAwB,CAACO,MAAzB,GAAkC,CAAtC,EAAyC;IACvC,OACE,oBAAC,KAAD,CAAO,QAAP,QACGT,IAAI,CACFU,KADF,CACQ,IAAIJ,MAAJ,UAAkBJ,wBAAwB,CAACS,IAAzB,CAA8B,GAA9B,CAAlB,UADR,EAEEH,GAFF,CAEM,UAACI,OAAD,EAAUC,CAAV;MAAA,OACHX,wBAAwB,CAACY,QAAzB,CAAkCF,OAAlC,IACE;QACE,GAAG,EAAEA,OAAO,GAAGC,CADjB;QAEE,OAAO,EAAE,iBAACE,KAAD,EAAW;UAClBA,KAAK,CAACC,cAAN;UACAC,QAAQ,CAACC,cAAT,CAAwBpB,OAAO,CAACc,OAAD,CAA/B,EAA0CO,cAA1C;QACD;MALH,GAOGP,OAPH,CADF,GAWEA,OAZC;IAAA,CAFN,CADH,CADF;EAqBD;;EACD,OAAOZ,IAAP;AACD,CA7BM"},"metadata":{},"sourceType":"module"}