demo fixes & styles

This commit is contained in:
Yurov Dmitry 2019-01-15 18:56:47 +03:00
parent c056c818aa
commit b807ff24b0
11 changed files with 23 additions and 143 deletions

File diff suppressed because one or more lines are too long

View File

@ -122,13 +122,13 @@ module.exports = require("mobx-react");
/* 3 */ /* 3 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
module.exports = require("polished"); module.exports = require("mobx");
/***/ }), /***/ }),
/* 4 */ /* 4 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
module.exports = require("mobx"); module.exports = require("polished");
/***/ }), /***/ }),
/* 5 */ /* 5 */
@ -3837,7 +3837,7 @@ var external_prop_types_ = __webpack_require__(9);
var external_react_ = __webpack_require__(0); var external_react_ = __webpack_require__(0);
// EXTERNAL MODULE: external "polished" // EXTERNAL MODULE: external "polished"
var external_polished_ = __webpack_require__(3); var external_polished_ = __webpack_require__(4);
// CONCATENATED MODULE: ./src/theme.ts // CONCATENATED MODULE: ./src/theme.ts
@ -3974,7 +3974,7 @@ var defaultTheme = {
} }
}, },
schema: { schema: {
linesColor: function (theme) { return Object(external_polished_["lighten"])(theme.colors.tonalOffset, Object(external_polished_["desaturate"])(theme.colors.tonalOffset, theme.colors.primary.main)); }, linesColor: '#ddd',
defaultDetailsWidth: '75%', defaultDetailsWidth: '75%',
typeNameColor: function (theme) { return theme.colors.text.secondary; }, typeNameColor: function (theme) { return theme.colors.text.secondary; },
typeTitleColor: function (theme) { return theme.schema.typeNameColor; }, typeTitleColor: function (theme) { return theme.schema.typeNameColor; },
@ -4327,7 +4327,7 @@ var RedocNormalizedOptions_RedocNormalizedOptions = /** @class */ (function () {
this.pathInMiddlePanel = true; this.pathInMiddlePanel = true;
this.untrustedSpec = argValueToBoolean(raw.untrustedSpec); this.untrustedSpec = argValueToBoolean(raw.untrustedSpec);
this.hideDownloadButton = argValueToBoolean(raw.hideDownloadButton); this.hideDownloadButton = argValueToBoolean(raw.hideDownloadButton);
this.disableSearch = argValueToBoolean(raw.disableSearch); this.disableSearch = true; //argValueToBoolean(raw.disableSearch);
this.onlyRequiredInSamples = argValueToBoolean(raw.onlyRequiredInSamples); this.onlyRequiredInSamples = argValueToBoolean(raw.onlyRequiredInSamples);
this.showExtensions = RedocNormalizedOptions.normalizeShowExtensions(raw.showExtensions); this.showExtensions = RedocNormalizedOptions.normalizeShowExtensions(raw.showExtensions);
this.unstable_ignoreMimeParameters = argValueToBoolean(raw.unstable_ignoreMimeParameters); this.unstable_ignoreMimeParameters = argValueToBoolean(raw.unstable_ignoreMimeParameters);
@ -4484,7 +4484,7 @@ var ErrorBoundary_ErrorBoundary = /** @class */ (function (_super) {
external_react_["createElement"]("br", null), external_react_["createElement"]("br", null),
external_react_["createElement"]("small", null, external_react_["createElement"]("small", null,
" Commit: ", " Commit: ",
"1dfed34")); "c056c81"));
} }
return external_react_["Children"].only(this.props.children); return external_react_["Children"].only(this.props.children);
}; };
@ -4541,7 +4541,7 @@ var OptionsProvider = OptionsContext.Provider;
var OptionsConsumer = OptionsContext.Consumer; var OptionsConsumer = OptionsContext.Consumer;
// EXTERNAL MODULE: external "mobx" // EXTERNAL MODULE: external "mobx"
var external_mobx_ = __webpack_require__(4); var external_mobx_ = __webpack_require__(3);
// EXTERNAL MODULE: external "json-schema-ref-parser" // EXTERNAL MODULE: external "json-schema-ref-parser"
var external_json_schema_ref_parser_ = __webpack_require__(31); var external_json_schema_ref_parser_ = __webpack_require__(31);
@ -8877,7 +8877,7 @@ var Content = styled_components.div.withConfig({
})(["background:#fff;color:#000;display:inline;font-size:0.85em;white-space:nowrap;"]); })(["background:#fff;color:#000;display:inline;font-size:0.85em;white-space:nowrap;"]);
var Arrow = styled_components.div.withConfig({ var Arrow = styled_components.div.withConfig({
componentId: "t0v3fg-3" componentId: "t0v3fg-3"
})(["position:absolute;width:0;height:0;bottom:-5px;left:50%;margin-left:-5px;border-left:solid transparent 5px;border-right:solid transparent 5px;border-top:solid #fff 5px;"]); })(["position:absolute;width:0;height:0;bottom:-5px;left:50%;margin-left:-5px;border-left:solid transparent 5px;border-right:solid transparent 5px;border-top:solid #bbb 5px;"]);
var Gap = styled_components.div.withConfig({ var Gap = styled_components.div.withConfig({
componentId: "t0v3fg-4" componentId: "t0v3fg-4"
})(["position:absolute;width:100%;height:20px;bottom:-20px;"]); })(["position:absolute;width:100%;height:20px;bottom:-20px;"]);
@ -9472,7 +9472,7 @@ var ResponsesList_ResponsesList = /** @class */ (function (_super) {
var OperationRow = styled_components(Row).withConfig({ var OperationRow = styled_components(Row).withConfig({
componentId: "bf7xj3-0" componentId: "bf7xj3-0"
})(["backface-visibility:hidden;"]); })(["backface-visibility:hidden;margin-bottom:12px;padding-bottom:40px;"]);
var Description = styled_components.div.withConfig({ var Description = styled_components.div.withConfig({
componentId: "bf7xj3-1" componentId: "bf7xj3-1"
})(["margin-bottom:", "px;"], function (_a) { })(["margin-bottom:", "px;"], function (_a) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -16,10 +16,7 @@ const renderRoot = (props: RedocProps) =>
document.getElementById('example'), document.getElementById('example'),
); );
const big = window.location.search.indexOf('big') > -1; const specUrl = 'tt.json';
const swagger = window.location.search.indexOf('swagger') > -1; // compatibility mode ?
const specUrl = swagger ? 'swagger.yaml' : big ? 'big-openapi.json' : 'openapi.yaml';
let store; let store;
const options: RedocRawOptions = { nativeScrollbars: false }; const options: RedocRawOptions = { nativeScrollbars: false };

View File

@ -143,7 +143,7 @@ export default (env: { playground?: boolean; bench?: boolean } = {}, { mode }) =
ignore(/js-yaml\/dumper\.js$/), ignore(/js-yaml\/dumper\.js$/),
ignore(/json-schema-ref-parser\/lib\/dereference\.js/), ignore(/json-schema-ref-parser\/lib\/dereference\.js/),
ignore(/^\.\/SearchWorker\.worker$/), ignore(/^\.\/SearchWorker\.worker$/),
new CopyWebpackPlugin(['demo/openapi.yaml']), new CopyWebpackPlugin(['demo/tt.json']),
], ],
}); });

View File

@ -39,7 +39,7 @@ const Arrow = styled.div`
margin-left: -5px; margin-left: -5px;
border-left: solid transparent 5px; border-left: solid transparent 5px;
border-right: solid transparent 5px; border-right: solid transparent 5px;
border-top: solid #fff 5px; border-top: solid #bbb 5px;
`; `;
const Gap = styled.div` const Gap = styled.div`

View File

@ -22,6 +22,8 @@ import { Extensions } from '../Fields/Extensions';
const OperationRow = styled(Row)` const OperationRow = styled(Row)`
backface-visibility: hidden; backface-visibility: hidden;
margin-bottom: 12px;
padding-bottom: 40px;
`; `;
const Description = styled.div` const Description = styled.div`

View File

@ -144,7 +144,7 @@ export class RedocNormalizedOptions {
this.pathInMiddlePanel = true; this.pathInMiddlePanel = true;
this.untrustedSpec = argValueToBoolean(raw.untrustedSpec); this.untrustedSpec = argValueToBoolean(raw.untrustedSpec);
this.hideDownloadButton = argValueToBoolean(raw.hideDownloadButton); this.hideDownloadButton = argValueToBoolean(raw.hideDownloadButton);
this.disableSearch = argValueToBoolean(raw.disableSearch); this.disableSearch = true; //argValueToBoolean(raw.disableSearch);
this.onlyRequiredInSamples = argValueToBoolean(raw.onlyRequiredInSamples); this.onlyRequiredInSamples = argValueToBoolean(raw.onlyRequiredInSamples);
this.showExtensions = RedocNormalizedOptions.normalizeShowExtensions(raw.showExtensions); this.showExtensions = RedocNormalizedOptions.normalizeShowExtensions(raw.showExtensions);

View File

@ -1,4 +1,4 @@
import { darken, desaturate, lighten, readableColor, transparentize } from 'polished'; import { darken, lighten, readableColor, transparentize } from 'polished';
const defaultTheme: ThemeInterface = { const defaultTheme: ThemeInterface = {
spacing: { spacing: {
@ -76,11 +76,7 @@ const defaultTheme: ThemeInterface = {
}, },
}, },
schema: { schema: {
linesColor: theme => linesColor: '#ddd',
lighten(
theme.colors.tonalOffset,
desaturate(theme.colors.tonalOffset, theme.colors.primary.main),
),
defaultDetailsWidth: '75%', defaultDetailsWidth: '75%',
typeNameColor: theme => theme.colors.text.secondary, typeNameColor: theme => theme.colors.text.secondary,
typeTitleColor: theme => theme.schema.typeNameColor, typeTitleColor: theme => theme.schema.typeNameColor,