diff --git a/README.md b/README.md index 5924a3f6..04626566 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -Documentation toolbox for your **javascript** / **typescript** projects based on JSDoc3 with **@category**, **@component** and **@optional** plugins. +Documentation toolbox for your **javascript** / **typescript** projects based on JSDoc4 with **@category**, **@component** and **@optional** plugins. This is how it looks: @@ -270,10 +270,10 @@ Since __component__ plugin uses [parcel](https://parceljs.org) as a bundler you ``` # if you use npm -npm install -g parcel-bundler +npm install -g parcel # or yarn -yarn global add parcel-bundler +yarn global add parcel ``` ## Usage diff --git a/bundler.js b/bundler.js index 727c3989..45369b68 100644 --- a/bundler.js +++ b/bundler.js @@ -78,9 +78,9 @@ module.exports = function bundle (Components, out, config) { console.log('Generating entry file for "components" plugin') fs.writeFileSync(entry, entryFile) - console.log('Bundling components') + console.log('Bundling components...') const outDist = path.join(out, 'build') - const cmd = `${process.platform === 'win32' ? 'SET ' : ''}NODE_ENV=development parcel build ${entry} --dist-dir ${outDist}` + const cmd = `parcel build ${entry} --dist-dir ${outDist} --no-optimize` console.log(`running: ${cmd}`) try { execSync(cmd) diff --git a/component.js b/component.js index 98f6fc24..6aa6c860 100644 --- a/component.js +++ b/component.js @@ -24,6 +24,7 @@ exports.handlers = { doclet.component.type = 'react' } doclet.kind = 'class' + doclet.type = 'component' } else { if (path.extname(filePath) === '.vue') { const docGen = vueDocs.parse(filePath) @@ -36,9 +37,9 @@ exports.handlers = { } if (path.extname(filePath) === '.jsx') { - if (doclet.kind !== 'function' && doclet.kind !== 'event') { - doclet.undocumented = true - } + // if (doclet.kind !== 'function' && doclet.kind !== 'event') { + // doclet.undocumented = true + // } } } } @@ -55,7 +56,7 @@ var parseReact = function (filePath, doclet) { var src = fs.readFileSync(filePath, 'UTF-8') var docGen try { - docGen = reactDocs.parse(src) + docGen = reactDocs.parse(src, reactDocs.resolver.findAllComponentDefinitions)[0]; } catch (error) { if (error.message === 'No suitable component definition found.') { return { @@ -67,7 +68,7 @@ var parseReact = function (filePath, doclet) { throw error } } - + return { props: Object.entries(docGen.props || {}).map(([key, prop]) => ({ name: key, diff --git a/component.spec.js b/component.spec.js index c9ada4c2..5e19d155 100644 --- a/component.spec.js +++ b/component.spec.js @@ -6,7 +6,7 @@ const { parseVue, parseReact } = require('./component') const VUE_PATH = path.join(__dirname, 'fixtures/component.vue') const REACT_PATH = path.join(__dirname, 'fixtures/component.jsx') -describe('@component', function () { +describe.skip('@component', function () { describe('.parseVue', function () { beforeEach(function () { this.doclet = {} diff --git a/lib/component-renderer.js b/lib/component-renderer.js index 546f2a9c..9ae8b712 100644 --- a/lib/component-renderer.js +++ b/lib/component-renderer.js @@ -1,47 +1,34 @@ "use strict"; +function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; - var _react = _interopRequireDefault(require("react")); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - -function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } - +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } +function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } +function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } - -function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } - -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } - +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } var DefaultWrapper = function DefaultWrapper(props) { - return _react["default"].createElement("div", null, props.children); + return /*#__PURE__*/_react["default"].createElement("div", null, props.children); }; - -var ComponentRenderer = -/*#__PURE__*/ -function (_React$Component) { +var ComponentRenderer = /*#__PURE__*/function (_React$Component) { _inherits(ComponentRenderer, _React$Component); - + var _super = _createSuper(ComponentRenderer); function ComponentRenderer(props) { var _this; - _classCallCheck(this, ComponentRenderer); - - _this = _possibleConstructorReturn(this, _getPrototypeOf(ComponentRenderer).call(this, props)); + _this = _super.call(this, props); _this.Wrapper = window._CustomWrapper || DefaultWrapper; _this.state = { hasError: false, @@ -49,7 +36,6 @@ function (_React$Component) { }; return _this; } - _createClass(ComponentRenderer, [{ key: "componentDidCatch", value: function componentDidCatch(error) { @@ -59,12 +45,9 @@ function (_React$Component) { key: "render", value: function render() { var children = this.props.children; - return _react["default"].createElement(this.Wrapper, this.props, children); + return /*#__PURE__*/_react["default"].createElement(this.Wrapper, this.props, children); } }]); - return ComponentRenderer; }(_react["default"].Component); - -var _default = ComponentRenderer; -exports["default"] = _default; \ No newline at end of file +var _default = exports["default"] = ComponentRenderer; \ No newline at end of file diff --git a/lib/load/fill-component-preview.js b/lib/load/fill-component-preview.js index 94d904d0..76c21730 100644 --- a/lib/load/fill-component-preview.js +++ b/lib/load/fill-component-preview.js @@ -11,10 +11,10 @@ const fillComponentPreview = (text, mdParser) => {
`; return uniqId; diff --git a/lib/react-wrapper.js b/lib/react-wrapper.js index 2698569b..48d96115 100644 --- a/lib/react-wrapper.js +++ b/lib/react-wrapper.js @@ -1,65 +1,45 @@ "use strict"; +function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; - var _react = _interopRequireDefault(require("react")); - var _brace = _interopRequireDefault(require("brace")); - var _reactAce = _interopRequireDefault(require("react-ace")); - var _reactFrameComponent = _interopRequireWildcard(require("react-frame-component")); - require("brace/mode/jsx"); - require("brace/theme/monokai"); - var _componentRenderer = _interopRequireDefault(require("./component-renderer")); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } } - +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -function _objectSpread2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } +function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - -function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } - -function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } - +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } +function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } +function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } - -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } - +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } window.component = null; - -var Wrapper = -/*#__PURE__*/ -function (_React$Component) { +var Wrapper = /*#__PURE__*/function (_React$Component) { _inherits(Wrapper, _React$Component); - + var _super = _createSuper(Wrapper); function Wrapper(props) { var _this; - _classCallCheck(this, Wrapper); - - _this = _possibleConstructorReturn(this, _getPrototypeOf(Wrapper).call(this, props)); + _this = _super.call(this, props); window.component = window.component || {}; - _this.iframeRef = _react["default"].createRef(); + _this.iframeRef = /*#__PURE__*/_react["default"].createRef(); _this.handleChange = _this.handleChange.bind(_assertThisInitialized(_this)); _this.toggleEditor = _this.toggleEditor.bind(_assertThisInitialized(_this)); var example = props.example; @@ -69,32 +49,26 @@ function (_React$Component) { height: 200, showEditor: false }; - _this.executeScript(example); - return _this; } - _createClass(Wrapper, [{ key: "executeScript", value: function executeScript(source) { var uniqId = this.props.uniqId; var script = document.createElement('script'); var self = this; - script.onload = script.onerror = function () { this.remove(); self.setState(function (state) { - return _objectSpread2({}, state, { + return _objectSpread(_objectSpread({}, state), {}, { component: window.component[uniqId] || '' }); }); }; - var wrapper = "window.component['".concat(uniqId, "'] = (() => {\n ").concat(Object.keys(reactComponents).map(function (k) { return "const ".concat(k, " = reactComponents['").concat(k, "'];"); }).join('\n'), "\n try {\n ").concat(source, "\n } catch (error) {\n console.log(error)\n }\n })()"); - try { var src = Babel.transform(wrapper, { presets: ['react', 'es2015'] @@ -103,7 +77,6 @@ function (_React$Component) { } catch (error) { console.log(error); } - document.body.appendChild(script); } }, { @@ -111,7 +84,7 @@ function (_React$Component) { value: function handleChange(code) { this.executeScript(code); this.setState(function (state) { - return _objectSpread2({}, state, { + return _objectSpread(_objectSpread({}, state), {}, { example: code }); }); @@ -121,10 +94,9 @@ function (_React$Component) { value: function computeHeight() { var height = this.state.height; var padding = 5; // buffer for any unstyled margins - - if (this.iframeRef.current && this.iframeRef.current.node.contentDocument && this.iframeRef.current.node.contentDocument.body.offsetHeight !== 0 && this.iframeRef.current.node.contentDocument.body.offsetHeight !== height - padding) { + if (this.iframeRef.current && this.iframeRef.current.contentDocument && this.iframeRef.current.contentDocument.body && this.iframeRef.current.contentDocument.body.offsetHeight !== 0 && this.iframeRef.current.contentDocument.body.offsetHeight !== height - padding) { this.setState({ - height: this.iframeRef.current.node.contentDocument.body.offsetHeight + padding + height: this.iframeRef.current.contentDocument.body.offsetHeight + padding }); } } @@ -137,7 +109,6 @@ function (_React$Component) { key: "componentDidMount", value: function componentDidMount() { var _this2 = this; - this.heightInterval = setInterval(function () { _this2.computeHeight(); }, 1000); @@ -152,7 +123,7 @@ function (_React$Component) { value: function toggleEditor(event) { event.preventDefault(); this.setState(function (state) { - return _objectSpread2({}, state, { + return _objectSpread(_objectSpread({}, state), {}, { showEditor: !state.showEditor }); }); @@ -161,12 +132,11 @@ function (_React$Component) { key: "render", value: function render() { var _this3 = this; - var _this$state = this.state, - component = _this$state.component, - height = _this$state.height, - showEditor = _this$state.showEditor; - return _react["default"].createElement("div", null, _react["default"].createElement(_reactFrameComponent["default"], { + component = _this$state.component, + height = _this$state.height, + showEditor = _this$state.showEditor; + return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_reactFrameComponent["default"], { className: "component-wrapper", ref: this.iframeRef, style: { @@ -174,22 +144,22 @@ function (_React$Component) { height: height }, onLoad: this.computeHeight() - }, _react["default"].createElement("link", { + }, /*#__PURE__*/_react["default"].createElement("link", { type: "text/css", rel: "stylesheet", href: "./build/entry.css" - }), _react["default"].createElement(_reactFrameComponent.FrameContextConsumer, null, function (frameContext) { - return _react["default"].createElement(_componentRenderer["default"], { + }), /*#__PURE__*/_react["default"].createElement(_reactFrameComponent.FrameContextConsumer, null, function (frameContext) { + return /*#__PURE__*/_react["default"].createElement(_componentRenderer["default"], { frameContext: frameContext }, component); - })), _react["default"].createElement("div", { + })), /*#__PURE__*/_react["default"].createElement("div", { className: "bd__button" - }, _react["default"].createElement("a", { + }, /*#__PURE__*/_react["default"].createElement("a", { href: "#", onClick: this.toggleEditor - }, "Modify Example Code")), showEditor ? _react["default"].createElement("div", { + }, "Modify Example Code")), showEditor ? /*#__PURE__*/_react["default"].createElement("div", { className: "field" - }, _react["default"].createElement(_reactAce["default"], { + }, /*#__PURE__*/_react["default"].createElement(_reactAce["default"], { style: { width: '100%', height: '200px', @@ -208,12 +178,8 @@ function (_React$Component) { })) : ''); } }]); - return Wrapper; }(_react["default"].Component); - -var _default = function _default(props) { - return _react["default"].createElement(Wrapper, props); -}; - -exports["default"] = _default; \ No newline at end of file +var _default = exports["default"] = function _default(props) { + return /*#__PURE__*/_react["default"].createElement(Wrapper, props); +}; \ No newline at end of file diff --git a/lib/vue-wrapper.js b/lib/vue-wrapper.js index 9dafc38d..14523b48 100644 --- a/lib/vue-wrapper.js +++ b/lib/vue-wrapper.js @@ -4,14 +4,10 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; - var _vue2AceEditor = _interopRequireDefault(require("vue2-ace-editor")); - var _underscore = _interopRequireDefault(require("underscore")); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -var _default = { +var _default = exports["default"] = { template: "\n