Compare commits

..
Author SHA1 Message Date
kyle 7e9881d885 Update operations.jsx 2018-07-11 12:02:42 -05:00
8 changed files with 86 additions and 82 deletions
-3
View File
@@ -7,9 +7,6 @@
"plugins": [
"transform-runtime",
"babel-plugin-transform-es2015-constants",
["transform-react-remove-prop-types", {
"additionalLibraries": ["react-immutable-proptypes"]
}],
[
"module-alias",
[
+3 -8
View File
@@ -71,13 +71,10 @@ module.exports = function(rules, options) {
plugins.push(
new UglifyJsPlugin({
uglifyOptions: {
mangle: specialOptions.mangle ? {
reserved: ["GeneratorFunction"]
} : false,
compress: specialOptions.mangle,
mangle: specialOptions.mangle,
beautify: !specialOptions.mangle,
keep_fnames: true
},
sourceMap: true,
}),
new webpack.LoaderOptionsPlugin({
@@ -145,9 +142,7 @@ module.exports = function(rules, options) {
"node_modules"
],
extensions: [".web.js", ".js", ".jsx", ".json", ".less"],
alias: {
"js-yaml": "@kyleshockey/js-yaml"
}
alias: {}
},
devtool: specialOptions.sourcemaps ? "nosource-source-map" : false,
+65 -58
View File
@@ -1,6 +1,6 @@
{
"name": "swagger-ui",
"version": "3.17.3",
"version": "3.17.2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -9,14 +9,6 @@
"resolved": "https://registry.npmjs.org/@braintree/sanitize-url/-/sanitize-url-2.1.0.tgz",
"integrity": "sha1-VJqdH5I8m8eVOlhdPpqpQpvo/ig="
},
"@kyleshockey/js-yaml": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@kyleshockey/js-yaml/-/js-yaml-1.0.1.tgz",
"integrity": "sha512-coFyIk1LvTscq1cUU4nCCfYwv+cmG4fCP+wgDKgYZjhM4f++YwZy+g0k+1tUqa4GuUpBTEOGH2KUqKFFWdT73g==",
"requires": {
"argparse": "^1.0.7"
}
},
"@kyleshockey/object-assign-deep": {
"version": "0.4.2",
"resolved": "https://registry.npmjs.org/@kyleshockey/object-assign-deep/-/object-assign-deep-0.4.2.tgz",
@@ -1531,12 +1523,6 @@
"babel-runtime": "^6.22.0"
}
},
"babel-plugin-transform-react-remove-prop-types": {
"version": "0.4.13",
"resolved": "https://registry.npmjs.org/babel-plugin-transform-react-remove-prop-types/-/babel-plugin-transform-react-remove-prop-types-0.4.13.tgz",
"integrity": "sha1-Mxz8BQmagII4MR14MZwnRg1IEYk=",
"dev": true
},
"babel-plugin-transform-regenerator": {
"version": "6.26.0",
"resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz",
@@ -2933,6 +2919,28 @@
"integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=",
"dev": true
},
"commonmark": {
"version": "0.28.1",
"resolved": "https://registry.npmjs.org/commonmark/-/commonmark-0.28.1.tgz",
"integrity": "sha1-Buq41SM4uDn6Gi11rwCF7tGxvq4=",
"requires": {
"entities": "~ 1.1.1",
"mdurl": "~ 1.0.1",
"minimist": "~ 1.2.0",
"string.prototype.repeat": "^0.2.0"
}
},
"commonmark-react-renderer": {
"version": "4.3.4",
"resolved": "https://registry.npmjs.org/commonmark-react-renderer/-/commonmark-react-renderer-4.3.4.tgz",
"integrity": "sha512-+/Rzo3sI37NR8LaVdkUiqBH3+CEW75hc86shwY4E9eEERg78VCy4rSkaP/p7OG5bTvosUMkvhn5d1ZJ5iyt/ag==",
"requires": {
"lodash.assign": "^4.2.0",
"lodash.isplainobject": "^4.0.6",
"pascalcase": "^0.1.1",
"xss-filters": "^1.2.6"
}
},
"compressible": {
"version": "2.0.13",
"resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.13.tgz",
@@ -4212,8 +4220,7 @@
"entities": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz",
"integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=",
"dev": true
"integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA="
},
"enzyme": {
"version": "2.9.1",
@@ -4536,36 +4543,6 @@
}
}
},
"eslint-plugin-import": {
"version": "2.13.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.13.0.tgz",
"integrity": "sha512-t6hGKQDMIt9N8R7vLepsYXgDfeuhp6ZJSgtrLEDxonpSubyxUZHjhm6LsAaZX8q6GYVxkbT3kTsV9G5mBCFR6A==",
"dev": true,
"requires": {
"contains-path": "^0.1.0",
"debug": "^2.6.8",
"doctrine": "1.5.0",
"eslint-import-resolver-node": "^0.3.1",
"eslint-module-utils": "^2.2.0",
"has": "^1.0.1",
"lodash": "^4.17.4",
"minimatch": "^3.0.3",
"read-pkg-up": "^2.0.0",
"resolve": "^1.6.0"
},
"dependencies": {
"doctrine": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz",
"integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=",
"dev": true,
"requires": {
"esutils": "^2.0.2",
"isarray": "^1.0.0"
}
}
}
},
"eslint-plugin-mocha": {
"version": "4.12.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-4.12.1.tgz",
@@ -6787,8 +6764,7 @@
"in-publish": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/in-publish/-/in-publish-2.0.0.tgz",
"integrity": "sha1-4g/146KvwmkDILbcVSaCqcf631E=",
"dev": true
"integrity": "sha1-4g/146KvwmkDILbcVSaCqcf631E="
},
"indent-string": {
"version": "2.1.0",
@@ -8209,8 +8185,7 @@
"lodash.assign": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz",
"integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=",
"dev": true
"integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc="
},
"lodash.assignin": {
"version": "4.2.0",
@@ -8324,8 +8299,7 @@
"lodash.isplainobject": {
"version": "4.0.6",
"resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz",
"integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=",
"dev": true
"integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs="
},
"lodash.keys": {
"version": "3.1.2",
@@ -8589,6 +8563,11 @@
"inherits": "^2.0.1"
}
},
"mdurl": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz",
"integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4="
},
"media-typer": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
@@ -15988,6 +15967,29 @@
"is-dom": "^1.0.9"
}
},
"react-markdown": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/react-markdown/-/react-markdown-2.5.0.tgz",
"integrity": "sha1-scYZBP7liViGgDvZ332yPD3DqJ4=",
"requires": {
"commonmark": "^0.24.0",
"commonmark-react-renderer": "^4.2.4",
"in-publish": "^2.0.0",
"prop-types": "^15.5.1"
},
"dependencies": {
"commonmark": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/commonmark/-/commonmark-0.24.0.tgz",
"integrity": "sha1-uA3gGCxUY1VkOqFdsSv7KCNoJ48=",
"requires": {
"entities": "~ 1.1.1",
"mdurl": "~ 1.0.1",
"string.prototype.repeat": "^0.2.0"
}
}
}
},
"react-motion": {
"version": "0.5.2",
"resolved": "https://registry.npmjs.org/react-motion/-/react-motion-0.5.2.tgz",
@@ -16492,11 +16494,6 @@
"resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
"integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8="
},
"reselect": {
"version": "2.5.4",
"resolved": "https://registry.npmjs.org/reselect/-/reselect-2.5.4.tgz",
"integrity": "sha1-t9I/3wC4P6etAnlUb427vXZccEc="
},
"resolve": {
"version": "1.7.1",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.7.1.tgz",
@@ -17914,6 +17911,11 @@
"function-bind": "^1.0.2"
}
},
"string.prototype.repeat": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/string.prototype.repeat/-/string.prototype.repeat-0.2.0.tgz",
"integrity": "sha1-q6Nt4I3O5qWjN9SbLqHaGyj8Ds8="
},
"string_decoder": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
@@ -19670,6 +19672,11 @@
"integrity": "sha1-UqY+VsoLhKfzpfPWGHLxJq16WUM=",
"dev": true
},
"xss-filters": {
"version": "1.2.7",
"resolved": "https://registry.npmjs.org/xss-filters/-/xss-filters-1.2.7.tgz",
"integrity": "sha1-Wfod4gHzby80cNysX1jMwoMLCpo="
},
"xtend": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz",
+4 -3
View File
@@ -43,9 +43,9 @@
},
"dependencies": {
"@braintree/sanitize-url": "^2.0.2",
"@kyleshockey/js-yaml": "^1.0.1",
"base64-js": "^1.2.0",
"classnames": "^2.2.5",
"commonmark": "^0.28.1",
"core-js": "^2.5.1",
"css.escape": "1.5.1",
"deep-extend": "0.5.1",
@@ -53,6 +53,7 @@
"ieee754": "^1.1.8",
"immutable": "^3.x.x",
"js-file-download": "^0.4.1",
"js-yaml": "^3.5.5",
"lodash": "^4.17.10",
"memoizee": "^0.4.12",
"prop-types": "^15.5.10",
@@ -64,6 +65,7 @@
"react-immutable-proptypes": "2.1.0",
"react-immutable-pure-component": "^1.1.1",
"react-inspector": "^2.3.0",
"react-markdown": "^2.5.0",
"react-motion": "^0.5.2",
"react-redux": "^4.x.x",
"react-split-pane": "^0.1.77",
@@ -86,7 +88,6 @@
"babel-loader": "^7.1.0",
"babel-plugin-module-alias": "^1.6.0",
"babel-plugin-transform-es2015-constants": "^6.1.4",
"babel-plugin-transform-react-remove-prop-types": "^0.4.13",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-es2015": "^6.22.0",
"babel-preset-es2015-ie": "^6.6.2",
@@ -157,7 +158,7 @@
"bundlesize": [
{
"path": "./dist/swagger-ui-bundle.js",
"maxSize": "1 MB",
"maxSize": "1.5 MB",
"compression": "none"
}
]
+1
View File
@@ -63,6 +63,7 @@ export default class Operations extends React.Component {
return (
<OperationTag
key={"operation-" + tag}
myProp={"whatever"}
tagObj={tagObj}
tag={tag}
layoutSelectors={layoutSelectors}
+1 -1
View File
@@ -1,4 +1,4 @@
import YAML from "@kyleshockey/js-yaml"
import YAML from "js-yaml"
export const parseYamlConfig = (yaml, system) => {
try {
@@ -1,22 +1,25 @@
import React from "react"
import PropTypes from "prop-types"
import ReactMarkdown from "react-markdown"
import cx from "classnames"
import Remarkable from "remarkable"
import { Parser, HtmlRenderer } from "commonmark"
import { OAS3ComponentWrapFactory } from "../helpers"
import { sanitizer } from "core/components/providers/markdown"
const parser = new Remarkable("commonmark")
export const Markdown = ({ source, className = "" }) => {
if ( source ) {
const html = parser.render(source)
const parser = new Parser()
const writer = new HtmlRenderer()
const html = writer.render(parser.parse(source || ""))
const sanitized = sanitizer(html)
if ( !source || !html || !sanitized ) {
return null
}
return (
<div
dangerouslySetInnerHTML={{
__html: sanitized
}}
<ReactMarkdown
source={sanitized}
className={cx(className, "renderedMarkdown")}
/>
)
+1 -1
View File
@@ -1,4 +1,4 @@
import YAML from "@kyleshockey/js-yaml"
import YAML from "js-yaml"
import { Map } from "immutable"
import parseUrl from "url-parse"
import serializeError from "serialize-error"