UNPKG

test-react-npm

Version:

Testing purpose for publishing react to npm

1 lines 3.18 kB
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom"),require("highlight.js")):"function"==typeof define&&define.amd?define(["react","react-dom","highlight.js"],t):"object"==typeof exports?exports.CodeHighlight=t(require("react"),require("react-dom"),require("highlight.js")):e.CodeHighlight=t(e.react,e["react-dom"],e["highlight.js"])}("undefined"!=typeof self?self:this,function(e,t,r){return function(e){function t(o){if(r[o])return r[o].exports;var n=r[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,o){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,r){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,r,o){return r&&e(t.prototype,r),o&&e(t,o),t}}(),u=r(1),a=o(u),l=r(2),p=(o(l),r(3)),f=o(p),h=function(e){function t(e){n(this,t);var r=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.state={},r}return s(t,e),c(t,[{key:"componentDidMount",value:function(){this.highlightCode()}},{key:"componentDidUpdate",value:function(e,t){this.highlightCode()}},{key:"highlightCode",value:function(){f.default.configure({tabReplace:this.props.tab}),f.default.highlightBlock(this.refs.code)}},{key:"render",value:function(){return a.default.createElement("div",{className:this.props.className||"code-highlight"},this.props.title&&a.default.createElement("div",{className:this.props.classes.title||"title"},this.props.title),this.props.description&&a.default.createElement("div",{className:this.props.classes.description||"description"},this.props.description),a.default.createElement("pre",{className:(this.props.language||"")+" "+(this.props.classes.pre||"")+" ",ref:"code"},a.default.createElement("code",{className:this.props.classes.code||""},this.props.children)))}}],[{key:"defaultProps",get:function(){return{language:"javascript",tab:" ",title:"",description:"",classes:{title:"",description:"",pre:"",code:""}}}}]),t}(a.default.Component);t.default=h},function(t,r){t.exports=e},function(e,r){e.exports=t},function(e,t){e.exports=r}])});