mirror of
https://github.com/Redocly/redoc.git
synced 2025-02-17 02:10:39 +03:00
parent
5dae267a54
commit
c8a5f36f17
|
@ -14,8 +14,6 @@ export interface RequestSamplesProps {
|
||||||
export class RequestSamples extends React.Component<RequestSamplesProps> {
|
export class RequestSamples extends React.Component<RequestSamplesProps> {
|
||||||
operation: OperationModel;
|
operation: OperationModel;
|
||||||
|
|
||||||
visited = new Set();
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { operation } = this.props;
|
const { operation } = this.props;
|
||||||
const requestBodyContent = operation.requestBody && operation.requestBody.content;
|
const requestBodyContent = operation.requestBody && operation.requestBody.content;
|
||||||
|
|
|
@ -24,8 +24,6 @@ export interface ResponseSamplesProps {
|
||||||
export class ResponseSamples extends React.Component<ResponseSamplesProps> {
|
export class ResponseSamples extends React.Component<ResponseSamplesProps> {
|
||||||
operation: OperationModel;
|
operation: OperationModel;
|
||||||
|
|
||||||
visited = new Set();
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { operation } = this.props;
|
const { operation } = this.props;
|
||||||
const responses = operation.responses.filter(response => {
|
const responses = operation.responses.filter(response => {
|
||||||
|
|
|
@ -10,7 +10,7 @@ import { AnimatedChevronButton } from './ChevronSvg';
|
||||||
|
|
||||||
let Stickyfill;
|
let Stickyfill;
|
||||||
if (IS_BROWSER) {
|
if (IS_BROWSER) {
|
||||||
Stickyfill = require('stickyfill').default;
|
Stickyfill = require('stickyfill');
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface StickySidebarProps {
|
export interface StickySidebarProps {
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
import 'core-js/es6/promise';
|
import 'core-js/es6/promise';
|
||||||
import 'core-js/fn/object/assign';
|
|
||||||
import 'core-js/fn/string/starts-with';
|
|
||||||
import 'core-js/fn/string/ends-with';
|
|
||||||
import 'core-js/fn/array/find';
|
import 'core-js/fn/array/find';
|
||||||
|
import 'core-js/fn/object/assign';
|
||||||
|
import 'core-js/fn/string/ends-with';
|
||||||
|
import 'core-js/fn/string/starts-with';
|
||||||
|
|
||||||
import 'core-js/es6/map';
|
import 'core-js/es6/map';
|
||||||
import 'core-js/es6/set';
|
|
||||||
import 'core-js/es6/symbol';
|
import 'core-js/es6/symbol';
|
||||||
|
|
|
@ -51,7 +51,8 @@ export class ScrollService {
|
||||||
if (el === null) {
|
if (el === null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
return Math.trunc(el.getBoundingClientRect().top) <= this.options.scrollYOffset();
|
const top = el.getBoundingClientRect().top;
|
||||||
|
return (top > 0 ? Math.floor(top) : Math.ceil(top)) <= this.options.scrollYOffset();
|
||||||
}
|
}
|
||||||
|
|
||||||
subscribe(cb): () => void {
|
subscribe(cb): () => void {
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
import * as lunr from 'lunr';
|
import * as lunr from 'lunr';
|
||||||
|
|
||||||
|
try {
|
||||||
|
require('core-js/es6/promise'); // bundle into worker
|
||||||
|
} catch (_) {
|
||||||
|
// nope
|
||||||
|
}
|
||||||
|
|
||||||
/* just for better typings */
|
/* just for better typings */
|
||||||
export default class Worker {
|
export default class Worker {
|
||||||
add: typeof add = add;
|
add: typeof add = add;
|
||||||
|
@ -72,8 +78,7 @@ export async function search<Meta = string>(
|
||||||
}
|
}
|
||||||
|
|
||||||
let searchResults = (await index).query(t => {
|
let searchResults = (await index).query(t => {
|
||||||
q
|
q.trim()
|
||||||
.trim()
|
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.split(/\s+/)
|
.split(/\s+/)
|
||||||
.forEach(term => {
|
.forEach(term => {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user