mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-24 09:33:44 +03:00
Merge commit '00703e0ed0879d5b7fe3707c3f5a883551bacfef' into releases
This commit is contained in:
commit
6e69bff71c
14
CHANGELOG.md
14
CHANGELOG.md
|
@ -1,3 +1,17 @@
|
||||||
|
# 1.6.0 (2016-11-30)
|
||||||
|
### Bug fixes
|
||||||
|
* Update webpack to the latest beta ([#143](https://github.com/Rebilly/ReDoc/issues/143))
|
||||||
|
* Fix read-only fields appear in request samples ([#142](https://github.com/Rebilly/ReDoc/issues/142))
|
||||||
|
* A few more minor UI improvemnts
|
||||||
|
|
||||||
|
### Features/Improvements
|
||||||
|
* Major performance optimization with new option `lazy-rendering`
|
||||||
|
|
||||||
|
To enable use `<redoc>` tag parameter: `<redoc spec-url="..." lazy-rendering></redoc>`.
|
||||||
|
In this mode ReDoc shows initial screen ASAP and then renders the rest operations asynchronously while showing progress bar on the top. Check out [the demo](//rebilly.github.io/ReDoc) for the example.
|
||||||
|
* Enable cors-proxy for demo
|
||||||
|
* README: Add button link to yeoman-generator
|
||||||
|
|
||||||
# 1.5.2 (2016-11-28)
|
# 1.5.2 (2016-11-28)
|
||||||
### Bug fixes
|
### Bug fixes
|
||||||
* Fix crashing on array without items ([#104](https://github.com/Rebilly/ReDoc/issues/104))
|
* Fix crashing on array without items ([#104](https://github.com/Rebilly/ReDoc/issues/104))
|
||||||
|
|
15
README.md
15
README.md
|
@ -18,19 +18,24 @@
|
||||||
## Features
|
## Features
|
||||||
- Extremely easy deployment
|
- Extremely easy deployment
|
||||||
- It’s free and open-source project under MIT license
|
- It’s free and open-source project under MIT license
|
||||||
- The widest OpenAPI features support (yes, it supports even discriminator)
|
- The widest OpenAPI features support (yes, it supports even `discriminator`)
|
||||||
- Neat documentation for nested objects
|
- Neat **interactive** documentation for nested objects
|
||||||
|
|
||||||
|
<img src="http://i.imgur.com/260gaV4.png" width="500">
|
||||||
|
|
||||||
- Code samples support (via vendor extension)
|
- Code samples support (via vendor extension)
|
||||||
- Responsive three-panel design with menu/scrolling synchronization
|
- Responsive three-panel design with menu/scrolling synchronization
|
||||||
- Integrate API introduction into side menu - ReDoc takes advantage of markdown headings from OpenAPI description field. It pulls them into side menu and also supports deep linking.
|
- Integrate API introduction into side menu - ReDoc takes advantage of markdown headings from OpenAPI description field. It pulls them into side menu and also supports deep linking.
|
||||||
|
|
||||||
## Roadmap
|
## Roadmap
|
||||||
- [ ] docs pre-rendering (performance and SEO)
|
- [x] performance optimizations
|
||||||
- [ ] ability to simple customization
|
- [ ] better navigation (menu improvements + search)
|
||||||
|
- [ ] ability to simple branding/styling
|
||||||
- [ ] built-in API Console
|
- [ ] built-in API Console
|
||||||
|
- [ ] docs pre-rendering (performance and SEO)
|
||||||
|
|
||||||
## Releases
|
## Releases
|
||||||
We host latest and all the previous ReDoc releases on GitHub Pages-based **CDN**:
|
We host the latest and all the previous ReDoc releases on GitHub Pages-based **CDN**:
|
||||||
- particular release, e.g. `v1.2.0`: https://rebilly.github.io/ReDoc/releases/v1.2.0/redoc.min.js
|
- particular release, e.g. `v1.2.0`: https://rebilly.github.io/ReDoc/releases/v1.2.0/redoc.min.js
|
||||||
- `v1.x.x` release: https://rebilly.github.io/ReDoc/releases/v1.x.x/redoc.min.js
|
- `v1.x.x` release: https://rebilly.github.io/ReDoc/releases/v1.x.x/redoc.min.js
|
||||||
- `latest` release: https://rebilly.github.io/ReDoc/releases/latest/redoc.min.js **[not for production]**
|
- `latest` release: https://rebilly.github.io/ReDoc/releases/latest/redoc.min.js **[not for production]**
|
||||||
|
|
|
@ -10,7 +10,6 @@ import {
|
||||||
TestBed
|
TestBed
|
||||||
} from '@angular/core/testing';
|
} from '@angular/core/testing';
|
||||||
|
|
||||||
import { ApiInfo } from './api-info';
|
|
||||||
import { SpecManager } from '../../utils/spec-manager';
|
import { SpecManager } from '../../utils/spec-manager';
|
||||||
|
|
||||||
describe('Redoc components', () => {
|
describe('Redoc components', () => {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
import { Component, ChangeDetectionStrategy, OnInit } from '@angular/core';
|
import { Component, ChangeDetectionStrategy, OnInit } from '@angular/core';
|
||||||
import { SpecManager, BaseComponent } from '../base';
|
import { SpecManager, BaseComponent } from '../base';
|
||||||
import { OptionsService, MenuService } from '../../services/index';
|
import { OptionsService } from '../../services/index';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'api-info',
|
selector: 'api-info',
|
||||||
|
|
|
@ -9,7 +9,6 @@ import {
|
||||||
TestBed
|
TestBed
|
||||||
} from '@angular/core/testing';
|
} from '@angular/core/testing';
|
||||||
|
|
||||||
import { ApiLogo } from './api-logo';
|
|
||||||
import { SpecManager } from '../../utils/spec-manager';
|
import { SpecManager } from '../../utils/spec-manager';
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,9 +20,6 @@ describe('Redoc components', () => {
|
||||||
let component;
|
let component;
|
||||||
let fixture;
|
let fixture;
|
||||||
|
|
||||||
beforeEach(inject([TestBed], (tcb) => {
|
|
||||||
|
|
||||||
}));
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(TestAppComponent);
|
fixture = TestBed.createComponent(TestAppComponent);
|
||||||
let debugEl = getChildDebugElement(fixture.debugElement, 'json-schema-lazy');
|
let debugEl = getChildDebugElement(fixture.debugElement, 'json-schema-lazy');
|
||||||
|
|
|
@ -67,7 +67,7 @@ export class JsonSchemaLazy implements OnDestroy, AfterViewInit {
|
||||||
this._loadAfterSelf();
|
this._loadAfterSelf();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//insertAfter($element.cloneNode(true), this.elementRef.nativeElement);
|
insertAfter($element.cloneNode(true), this.elementRef.nativeElement);
|
||||||
this.loaded = true;
|
this.loaded = true;
|
||||||
} else {
|
} else {
|
||||||
cache[this.pointer] = this._loadAfterSelf();
|
cache[this.pointer] = this._loadAfterSelf();
|
||||||
|
|
|
@ -8,8 +8,6 @@ import {
|
||||||
|
|
||||||
import { getChildDebugElement } from '../../../tests/helpers';
|
import { getChildDebugElement } from '../../../tests/helpers';
|
||||||
|
|
||||||
|
|
||||||
import { JsonSchema } from './json-schema';
|
|
||||||
import { SpecManager } from '../../utils/spec-manager';;
|
import { SpecManager } from '../../utils/spec-manager';;
|
||||||
|
|
||||||
describe('Redoc components', () => {
|
describe('Redoc components', () => {
|
||||||
|
|
|
@ -120,7 +120,7 @@ export class JsonSchema extends BaseComponent implements OnInit {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
trackByName(index: number, item: any): number {
|
trackByName(_: number, item: any): number {
|
||||||
return item.name + (item._pointer || '');
|
return item.name + (item._pointer || '');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
import { Input, HostBinding, Component, OnInit, ChangeDetectionStrategy, ElementRef, ChangeDetectorRef } from '@angular/core';
|
import { Input, HostBinding, Component, OnChanges } from '@angular/core';
|
||||||
import JsonPointer from '../../utils/JsonPointer';
|
|
||||||
import { BaseComponent, SpecManager } from '../base';
|
|
||||||
import { SchemaHelper } from '../../services/schema-helper.service';
|
|
||||||
import { OptionsService, AppStateService } from '../../services/';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'loading-bar',
|
selector: 'loading-bar',
|
||||||
|
@ -32,10 +28,9 @@ import { OptionsService, AppStateService } from '../../services/';
|
||||||
background-color: #5f7fc3;
|
background-color: #5f7fc3;
|
||||||
transition: right 0.2s linear;
|
transition: right 0.2s linear;
|
||||||
}
|
}
|
||||||
`],
|
`]
|
||||||
//changeDetection: ChangeDetectionStrategy.OnPush
|
|
||||||
})
|
})
|
||||||
export class LoadingBar {
|
export class LoadingBar implements OnChanges {
|
||||||
@Input() progress:number = 0;
|
@Input() progress:number = 0;
|
||||||
@HostBinding('style.display') display = 'block';
|
@HostBinding('style.display') display = 'block';
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
import { Input, Component, OnInit, ChangeDetectionStrategy, ElementRef, ChangeDetectorRef } from '@angular/core';
|
import { Input, Component, OnInit, ChangeDetectionStrategy, ElementRef } from '@angular/core';
|
||||||
import JsonPointer from '../../utils/JsonPointer';
|
import JsonPointer from '../../utils/JsonPointer';
|
||||||
import { BaseComponent, SpecManager } from '../base';
|
import { BaseComponent, SpecManager } from '../base';
|
||||||
import { SchemaHelper } from '../../services/schema-helper.service';
|
import { SchemaHelper } from '../../services/schema-helper.service';
|
||||||
import { OptionsService, AppStateService } from '../../services/';
|
import { OptionsService } from '../../services/';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'method',
|
selector: 'method',
|
||||||
|
@ -20,8 +20,7 @@ export class Method extends BaseComponent implements OnInit {
|
||||||
|
|
||||||
method:any;
|
method:any;
|
||||||
|
|
||||||
constructor(specMgr:SpecManager, private optionsService: OptionsService, private chDetector: ChangeDetectorRef,
|
constructor(specMgr:SpecManager, private optionsService: OptionsService, private el: ElementRef) {
|
||||||
private appState: AppStateService, private el: ElementRef) {
|
|
||||||
super(specMgr);
|
super(specMgr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,11 +30,7 @@ export class MethodsList extends BaseComponent implements OnInit {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
trackByPointer(idx, el) {
|
trackByTagName(_, el) {
|
||||||
return el.pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
trackByTagName(idx, el) {
|
|
||||||
return el.name;
|
return el.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import { ElementRef,
|
import { ElementRef,
|
||||||
ComponentRef,
|
|
||||||
ChangeDetectorRef,
|
ChangeDetectorRef,
|
||||||
Input,
|
Input,
|
||||||
Component,
|
Component,
|
||||||
OnInit,
|
OnInit,
|
||||||
ChangeDetectionStrategy,
|
|
||||||
HostBinding
|
HostBinding
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
|
@ -18,7 +16,6 @@ import * as detectScollParent from 'scrollparent';
|
||||||
import { SpecManager } from '../../utils/spec-manager';
|
import { SpecManager } from '../../utils/spec-manager';
|
||||||
import { OptionsService, Hash, AppStateService, SchemaHelper } from '../../services/index';
|
import { OptionsService, Hash, AppStateService, SchemaHelper } from '../../services/index';
|
||||||
import { LazyTasksService } from '../../shared/components/LazyFor/lazy-for';
|
import { LazyTasksService } from '../../shared/components/LazyFor/lazy-for';
|
||||||
import { CustomErrorHandler } from '../../utils/';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'redoc',
|
selector: 'redoc',
|
||||||
|
@ -112,16 +109,12 @@ export class Redoc extends BaseComponent implements OnInit {
|
||||||
this.appState.error.subscribe(_err => {
|
this.appState.error.subscribe(_err => {
|
||||||
if (!_err) return;
|
if (!_err) return;
|
||||||
|
|
||||||
if (this.specLoading) {
|
this.appState.stopLoading();
|
||||||
this.specLoaded = true;
|
|
||||||
this.hideLoadingAnimation();
|
if (this.loadingProgress === 100) return;
|
||||||
}
|
|
||||||
this.error = _err;
|
this.error = _err;
|
||||||
this.changeDetector.markForCheck();
|
this.changeDetector.markForCheck();
|
||||||
setTimeout(() => {
|
|
||||||
this.changeDetector.detectChanges()
|
|
||||||
});
|
});
|
||||||
})
|
|
||||||
|
|
||||||
if (this.specUrl) {
|
if (this.specUrl) {
|
||||||
this.options.specUrl = this.specUrl;
|
this.options.specUrl = this.specUrl;
|
||||||
|
|
|
@ -63,7 +63,7 @@ export class ResponsesList extends BaseComponent implements OnInit {
|
||||||
this.responses = responses;
|
this.responses = responses;
|
||||||
}
|
}
|
||||||
|
|
||||||
trackByCode(idx, el) {
|
trackByCode(_, el) {
|
||||||
return el.code;
|
return el.code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
import { Component, ChangeDetectionStrategy, OnInit, HostListener } from '@angular/core';
|
import { Component, ChangeDetectionStrategy, OnInit } from '@angular/core';
|
||||||
import { SpecManager, BaseComponent } from '../base';
|
import { SpecManager, BaseComponent } from '../base';
|
||||||
|
|
||||||
import { ComponentParser } from '../../services/component-parser.service';
|
import { ComponentParser } from '../../services/component-parser.service';
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
<label class="menu-cat-header" (click)="activateAndScroll(idx, -1)" [hidden]="cat.headless"
|
<label class="menu-cat-header" (click)="activateAndScroll(idx, -1)" [hidden]="cat.headless"
|
||||||
[ngClass]="{active: cat.active, disabled: !cat.ready }"> {{cat.name}}</label>
|
[ngClass]="{active: cat.active, disabled: !cat.ready }"> {{cat.name}}</label>
|
||||||
<ul class="menu-subitems" [@itemAnimation]="cat.active ? 'expanded' : 'collapsed'">
|
<ul *ngIf="cat.methods.length" class="menu-subitems" [@itemAnimation]="cat.active ? 'expanded' : 'collapsed'">
|
||||||
<li *ngFor="let method of cat.methods; trackBy:summary; let methIdx = index"
|
<li *ngFor="let method of cat.methods; trackBy:summary; let methIdx = index"
|
||||||
[ngClass]="{active: method.active, disabled: !method.ready}"
|
[ngClass]="{active: method.active, disabled: !method.ready}"
|
||||||
(click)="activateAndScroll(idx, methIdx)">
|
(click)="activateAndScroll(idx, methIdx)">
|
||||||
|
|
|
@ -5,7 +5,7 @@ import { Component, ElementRef, ChangeDetectorRef, OnInit } from '@angular/core'
|
||||||
//import { global } from '@angular/core/src/facade/lang';
|
//import { global } from '@angular/core/src/facade/lang';
|
||||||
import { trigger, state, animate, transition, style } from '@angular/core';
|
import { trigger, state, animate, transition, style } from '@angular/core';
|
||||||
import { BaseComponent, SpecManager } from '../base';
|
import { BaseComponent, SpecManager } from '../base';
|
||||||
import { ScrollService, Hash, MenuService, OptionsService } from '../../services/index';
|
import { ScrollService, MenuService, OptionsService } from '../../services/index';
|
||||||
import { BrowserDomAdapter as DOM } from '../../utils/browser-adapter';
|
import { BrowserDomAdapter as DOM } from '../../utils/browser-adapter';
|
||||||
import { MenuCategory } from '../../services/schema-helper.service';
|
import { MenuCategory } from '../../services/schema-helper.service';
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ export class SideMenu extends BaseComponent implements OnInit {
|
||||||
private firstChange = true;
|
private firstChange = true;
|
||||||
|
|
||||||
constructor(specMgr:SpecManager, elementRef:ElementRef,
|
constructor(specMgr:SpecManager, elementRef:ElementRef,
|
||||||
private scrollService:ScrollService, private menuService:MenuService, private hash:Hash,
|
private scrollService:ScrollService, private menuService:MenuService,
|
||||||
optionsService:OptionsService, private detectorRef:ChangeDetectorRef) {
|
optionsService:OptionsService, private detectorRef:ChangeDetectorRef) {
|
||||||
super(specMgr);
|
super(specMgr);
|
||||||
this.$element = elementRef.nativeElement;
|
this.$element = elementRef.nativeElement;
|
||||||
|
|
|
@ -3,7 +3,6 @@ import './components/Redoc/redoc-initial-styles.css';
|
||||||
|
|
||||||
import { enableProdMode } from '@angular/core';
|
import { enableProdMode } from '@angular/core';
|
||||||
import { Redoc } from './components/index';
|
import { Redoc } from './components/index';
|
||||||
import { SpecManager } from './utils/spec-manager';
|
|
||||||
import { BrowserDomAdapter as DOM } from './utils/browser-adapter';
|
import { BrowserDomAdapter as DOM } from './utils/browser-adapter';
|
||||||
import { disableDebugTools } from '@angular/platform-browser';
|
import { disableDebugTools } from '@angular/platform-browser';
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { CommonModule } from '@angular/common';
|
||||||
|
|
||||||
import { Redoc, SecurityDefinitions, Method, REDOC_DIRECTIVES } from './components/index';
|
import { Redoc, SecurityDefinitions, Method, REDOC_DIRECTIVES } from './components/index';
|
||||||
import { REDOC_COMMON_DIRECTIVES, DynamicNg2Wrapper } from './shared/components/index';
|
import { REDOC_COMMON_DIRECTIVES, DynamicNg2Wrapper } from './shared/components/index';
|
||||||
import { REDOC_PIPES, KeysPipe } from './utils/pipes';
|
import { REDOC_PIPES } from './utils/pipes';
|
||||||
import { CustomErrorHandler } from './utils/'
|
import { CustomErrorHandler } from './utils/'
|
||||||
import { LazyTasksService } from './shared/components/LazyFor/lazy-for';
|
import { LazyTasksService } from './shared/components/LazyFor/lazy-for';
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import { Injectable, NgZone } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Subject } from 'rxjs/Subject';
|
import { Subject } from 'rxjs/Subject';
|
||||||
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
|
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
|
||||||
import { Injector } from '@angular/core';
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class AppStateService {
|
export class AppStateService {
|
||||||
samplesLanguage = new Subject<string>();
|
samplesLanguage = new Subject<string>();
|
||||||
error = new BehaviorSubject<any>(null);
|
error = new BehaviorSubject<any>(null);
|
||||||
loading = new Subject<boolean>();
|
loading = new Subject<boolean>();
|
||||||
|
initialized = new BehaviorSubject<any>(false);
|
||||||
|
|
||||||
startLoading() {
|
startLoading() {
|
||||||
this.loading.next(true);
|
this.loading.next(true);
|
||||||
|
@ -18,7 +18,4 @@ export class AppStateService {
|
||||||
stopLoading() {
|
stopLoading() {
|
||||||
this.loading.next(false);
|
this.loading.next(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(private injector: Injector, private zone: NgZone) {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,7 +64,7 @@ export class ComponentParser {
|
||||||
}
|
}
|
||||||
|
|
||||||
createComponentByHtml(htmlTag: string, injector:Injector):ComponentRef<any>| null {
|
createComponentByHtml(htmlTag: string, injector:Injector):ComponentRef<any>| null {
|
||||||
let {componentType, options} = this._parseHtml(htmlTag);
|
let { componentType } = this._parseHtml(htmlTag);
|
||||||
if (!componentType) return null;
|
if (!componentType) return null;
|
||||||
|
|
||||||
let factory = this.resolver.resolveComponentFactory(componentType);
|
let factory = this.resolver.resolveComponentFactory(componentType);
|
||||||
|
|
|
@ -29,13 +29,13 @@ export class ContentProjector {
|
||||||
let parentCompRef = parentView.createComponent(componentFactory, null, contextInjector, [projectedNodes]);
|
let parentCompRef = parentView.createComponent(componentFactory, null, contextInjector, [projectedNodes]);
|
||||||
|
|
||||||
// using private property to get AppElement instance
|
// using private property to get AppElement instance
|
||||||
let appElement = (<any>parentView)._element;
|
let viewContainer = (<any>parentView)._element;
|
||||||
appElement.nestedViews = appElement.nestedViews || [];
|
viewContainer.nestedViews = viewContainer.nestedViews || [];
|
||||||
for (let i=0; i < componentRefs.length; i++) {
|
for (let i=0; i < componentRefs.length; i++) {
|
||||||
let compRef = componentRefs[i];
|
let compRef = componentRefs[i];
|
||||||
appElement.nestedViews.push((<any>compRef.hostView).internalView);
|
// attach view to viewContainer change detector
|
||||||
// attach appElement to parentView change detector
|
viewContainer.nestedViews.push((<any>compRef.hostView).internalView);
|
||||||
(<any>compRef.hostView).internalView.addToContentChildren(appElement);
|
(<any>compRef.hostView).internalView.viewContainer = viewContainer;
|
||||||
}
|
}
|
||||||
return parentCompRef;
|
return parentCompRef;
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,7 @@ export class OptionsService {
|
||||||
//camelCasify
|
//camelCasify
|
||||||
.map(k => ({
|
.map(k => ({
|
||||||
attrName: k,
|
attrName: k,
|
||||||
name: k.replace(/-(.)/g, (m, $1) => $1.toUpperCase())
|
name: k.replace(/-(.)/g, (_, $1) => $1.toUpperCase())
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
.filter(option => OPTION_NAMES.has(option.name))
|
.filter(option => OPTION_NAMES.has(option.name))
|
||||||
|
|
|
@ -64,7 +64,7 @@ const injectors = {
|
||||||
},
|
},
|
||||||
discriminator: {
|
discriminator: {
|
||||||
check: (propertySchema) => propertySchema.discriminator || propertySchema['x-extendedDiscriminator'],
|
check: (propertySchema) => propertySchema.discriminator || propertySchema['x-extendedDiscriminator'],
|
||||||
inject: (injectTo, propertySchema = injectTo, pointer) => {
|
inject: (injectTo, propertySchema = injectTo) => {
|
||||||
injectTo.discriminator = propertySchema.discriminator;
|
injectTo.discriminator = propertySchema.discriminator;
|
||||||
injectTo['x-extendedDiscriminator'] = propertySchema['x-extendedDiscriminator'];
|
injectTo['x-extendedDiscriminator'] = propertySchema['x-extendedDiscriminator'];
|
||||||
}
|
}
|
||||||
|
@ -182,7 +182,7 @@ const injectors = {
|
||||||
},
|
},
|
||||||
file: {
|
file: {
|
||||||
check: propertySchema => (propertySchema.type === 'file'),
|
check: propertySchema => (propertySchema.type === 'file'),
|
||||||
inject: (injectTo, propertySchema = injectTo, propPointer, hostPointer) => {
|
inject: (injectTo, propertySchema = injectTo, _, hostPointer) => {
|
||||||
injectTo.isFile = true;
|
injectTo.isFile = true;
|
||||||
let parentPtr;
|
let parentPtr;
|
||||||
if (propertySchema.in === 'formData') {
|
if (propertySchema.in === 'formData') {
|
||||||
|
@ -230,7 +230,7 @@ export class SchemaHelper {
|
||||||
schema.required.forEach(prop => requiredMap[prop] = true);
|
schema.required.forEach(prop => requiredMap[prop] = true);
|
||||||
}
|
}
|
||||||
|
|
||||||
let props = schema.properties && Object.keys(schema.properties).map((propName, idx) => {
|
let props = schema.properties && Object.keys(schema.properties).map(propName => {
|
||||||
let propertySchema = Object.assign({}, schema.properties[propName]);
|
let propertySchema = Object.assign({}, schema.properties[propName]);
|
||||||
let propPointer = propertySchema._pointer ||
|
let propPointer = propertySchema._pointer ||
|
||||||
JsonPointer.join(pointer, ['properties', propName]);
|
JsonPointer.join(pointer, ['properties', propName]);
|
||||||
|
|
|
@ -20,7 +20,7 @@ interface Schema {
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class SchemaNormalizer {
|
export class SchemaNormalizer {
|
||||||
_dereferencer:SchemaDereferencer;
|
_dereferencer:SchemaDereferencer;
|
||||||
constructor(private _schema:any) {
|
constructor(_schema:any) {
|
||||||
this._dereferencer = new SchemaDereferencer(_schema, this);
|
this._dereferencer = new SchemaDereferencer(_schema, this);
|
||||||
}
|
}
|
||||||
normalize(schema, ptr, opts:any ={}) {
|
normalize(schema, ptr, opts:any ={}) {
|
||||||
|
|
|
@ -19,7 +19,7 @@ export class ScrollService {
|
||||||
private _cancel:any;
|
private _cancel:any;
|
||||||
private _savedPosition:number;
|
private _savedPosition:number;
|
||||||
private _stickElement: HTMLElement;
|
private _stickElement: HTMLElement;
|
||||||
constructor(private optionsService:OptionsService) {
|
constructor(optionsService:OptionsService) {
|
||||||
this.scrollYOffset = () => optionsService.options.scrollYOffset();
|
this.scrollYOffset = () => optionsService.options.scrollYOffset();
|
||||||
this.$scrollParent = optionsService.options.$scrollParent || window;
|
this.$scrollParent = optionsService.options.$scrollParent || window;
|
||||||
this.scroll = new EventEmitter();
|
this.scroll = new EventEmitter();
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Component,
|
Component,
|
||||||
EventEmitter,
|
|
||||||
Output,
|
|
||||||
Input,
|
Input,
|
||||||
OnInit,
|
OnInit,
|
||||||
ViewContainerRef,
|
ViewContainerRef,
|
||||||
|
|
|
@ -6,8 +6,7 @@ import {
|
||||||
TemplateRef,
|
TemplateRef,
|
||||||
ChangeDetectorRef,
|
ChangeDetectorRef,
|
||||||
ViewContainerRef,
|
ViewContainerRef,
|
||||||
Injectable,
|
Injectable
|
||||||
NgZone
|
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
|
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
|
||||||
|
@ -36,7 +35,7 @@ export class LazyTasksService {
|
||||||
|
|
||||||
public loadProgress = new BehaviorSubject<number>(0);
|
public loadProgress = new BehaviorSubject<number>(0);
|
||||||
public allSync = false;
|
public allSync = false;
|
||||||
constructor(public optionsService: OptionsService, private zone: NgZone) {
|
constructor(public optionsService: OptionsService) {
|
||||||
}
|
}
|
||||||
|
|
||||||
get empty() {
|
get empty() {
|
||||||
|
@ -117,8 +116,8 @@ export class LazyTasksService {
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class LazyTasksServiceSync extends LazyTasksService {
|
export class LazyTasksServiceSync extends LazyTasksService {
|
||||||
constructor(optionsService: OptionsService, zone: NgZone) {
|
constructor(optionsService: OptionsService) {
|
||||||
super(optionsService, zone);
|
super(optionsService);
|
||||||
this.allSync = true;
|
this.allSync = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -132,7 +131,6 @@ export class LazyFor {
|
||||||
|
|
||||||
prevIdx = null;
|
prevIdx = null;
|
||||||
|
|
||||||
private _viewRef;
|
|
||||||
constructor(
|
constructor(
|
||||||
public _template: TemplateRef<LazyForRow>,
|
public _template: TemplateRef<LazyForRow>,
|
||||||
public cdr: ChangeDetectorRef,
|
public cdr: ChangeDetectorRef,
|
||||||
|
@ -152,7 +150,7 @@ export class LazyFor {
|
||||||
if (sync) {
|
if (sync) {
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
return new Promise<void>((resolve, reject) => {
|
return new Promise<void>(resolve => {
|
||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
this.scroll.saveScroll();
|
this.scroll.saveScroll();
|
||||||
|
|
||||||
|
|
|
@ -18,12 +18,12 @@ describe('Common components', () => {
|
||||||
let component;
|
let component;
|
||||||
let fixture;
|
let fixture;
|
||||||
|
|
||||||
beforeEach(inject([TestBed], (tcb) => {
|
beforeEach(() => {
|
||||||
|
|
||||||
fixture = TestBed.createComponent(TestApp);
|
fixture = TestBed.createComponent(TestApp);
|
||||||
let debugEl = getChildDebugElementByType(fixture.debugElement, StickySidebar);
|
let debugEl = getChildDebugElementByType(fixture.debugElement, StickySidebar);
|
||||||
component = debugEl.injector.get(StickySidebar);
|
component = debugEl.injector.get(StickySidebar);
|
||||||
}));
|
});
|
||||||
|
|
||||||
|
|
||||||
it('should init component', () => {
|
it('should init component', () => {
|
||||||
|
|
|
@ -22,14 +22,14 @@ describe('Common components', () => {
|
||||||
let fixture;
|
let fixture;
|
||||||
let hostComponent;
|
let hostComponent;
|
||||||
|
|
||||||
beforeEach(inject([TestBed], (tcb) => {
|
beforeEach(() => {
|
||||||
|
|
||||||
fixture = TestBed.createComponent(TestApp);
|
fixture = TestBed.createComponent(TestApp);
|
||||||
hostComponent = fixture.debugElement.componentInstance;
|
hostComponent = fixture.debugElement.componentInstance;
|
||||||
debugEl = getChildDebugElement(fixture.debugElement, 'tabs');
|
debugEl = getChildDebugElement(fixture.debugElement, 'tabs');
|
||||||
childDebugEls = getChildDebugElementAll(debugEl, 'tab');
|
childDebugEls = getChildDebugElementAll(debugEl, 'tab');
|
||||||
component = debugEl.componentInstance;
|
component = debugEl.componentInstance;
|
||||||
}));
|
});
|
||||||
|
|
||||||
it('should init component', () => {
|
it('should init component', () => {
|
||||||
expect(component).not.toBeNull();
|
expect(component).not.toBeNull();
|
||||||
|
|
|
@ -20,12 +20,12 @@ describe('Common components', () => {
|
||||||
let nativeElement;
|
let nativeElement;
|
||||||
let fixture;
|
let fixture;
|
||||||
|
|
||||||
beforeEach(inject([TestBed], (tcb) => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(TestApp);
|
fixture = TestBed.createComponent(TestApp);
|
||||||
let debugEl = getChildDebugElement(fixture.debugElement, 'zippy');
|
let debugEl = getChildDebugElement(fixture.debugElement, 'zippy');
|
||||||
component = debugEl.componentInstance;
|
component = debugEl.componentInstance;
|
||||||
nativeElement = debugEl.nativeElement;
|
nativeElement = debugEl.nativeElement;
|
||||||
}));
|
});
|
||||||
|
|
||||||
it('should init component', () => {
|
it('should init component', () => {
|
||||||
expect(component).not.toBeNull();
|
expect(component).not.toBeNull();
|
||||||
|
|
|
@ -19,11 +19,6 @@ const md = new Remarkable({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
interface HeadersHandler {
|
|
||||||
open: Function;
|
|
||||||
close: Function;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class MdRenderer {
|
export class MdRenderer {
|
||||||
public firstLevelHeadings: string[] = [];
|
public firstLevelHeadings: string[] = [];
|
||||||
|
|
34
package.json
34
package.json
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "redoc",
|
"name": "redoc",
|
||||||
"description": "Swagger-generated API Reference Documentation",
|
"description": "Swagger-generated API Reference Documentation",
|
||||||
"version": "1.6.0",
|
"version": "1.6.1",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git://github.com/Rebilly/ReDoc"
|
"url": "git://github.com/Rebilly/ReDoc"
|
||||||
|
@ -45,13 +45,13 @@
|
||||||
"author": "Roman Hotsiy",
|
"author": "Roman Hotsiy",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular/common": "~2.1.2",
|
"@angular/common": "^2.2.4",
|
||||||
"@angular/compiler": "~2.1.2",
|
"@angular/compiler": "^2.2.4",
|
||||||
"@angular/compiler-cli": "~2.1.2",
|
"@angular/compiler-cli": "^2.2.4",
|
||||||
"@angular/core": "~2.1.2",
|
"@angular/core": "^2.2.4",
|
||||||
"@angular/platform-browser": "~2.1.2",
|
"@angular/platform-browser": "^2.2.4",
|
||||||
"@angular/platform-browser-dynamic": "~2.1.2",
|
"@angular/platform-browser-dynamic": "^2.2.4",
|
||||||
"@angular/platform-server": "~2.1.2",
|
"@angular/platform-server": "^2.2.4",
|
||||||
"@types/core-js": "^0.9.31",
|
"@types/core-js": "^0.9.31",
|
||||||
"@types/jasmine": "^2.2.32",
|
"@types/jasmine": "^2.2.32",
|
||||||
"@types/requirejs": "^2.1.26",
|
"@types/requirejs": "^2.1.26",
|
||||||
|
@ -60,10 +60,10 @@
|
||||||
"awesome-typescript-loader": "2.2.4",
|
"awesome-typescript-loader": "2.2.4",
|
||||||
"branch-release": "^1.0.3",
|
"branch-release": "^1.0.3",
|
||||||
"chalk": "^1.1.3",
|
"chalk": "^1.1.3",
|
||||||
"codelyzer": "^1.0.0-beta.3",
|
"codelyzer": "^2.0.0-beta.1",
|
||||||
"core-js": "^2.4.1",
|
"core-js": "^2.4.1",
|
||||||
"coveralls": "^2.11.9",
|
"coveralls": "^2.11.9",
|
||||||
"css-loader": "^0.25.0",
|
"css-loader": "^0.26.0",
|
||||||
"deploy-to-gh-pages": "^1.1.2",
|
"deploy-to-gh-pages": "^1.1.2",
|
||||||
"http-server": "^0.9.0",
|
"http-server": "^0.9.0",
|
||||||
"istanbul-instrumenter-loader": "^0.2.0",
|
"istanbul-instrumenter-loader": "^0.2.0",
|
||||||
|
@ -94,7 +94,7 @@
|
||||||
"string-replace-webpack-plugin": "0.0.4",
|
"string-replace-webpack-plugin": "0.0.4",
|
||||||
"style-loader": "^0.13.1",
|
"style-loader": "^0.13.1",
|
||||||
"ts-helpers": "^1.1.1",
|
"ts-helpers": "^1.1.1",
|
||||||
"tslint": "^3.15.1",
|
"tslint": "^4.0.2",
|
||||||
"typescript": "^2.0.3",
|
"typescript": "^2.0.3",
|
||||||
"webpack": "^2.1.0-beta.27",
|
"webpack": "^2.1.0-beta.27",
|
||||||
"webpack-dev-server": "^2.1.0-beta.12",
|
"webpack-dev-server": "^2.1.0-beta.12",
|
||||||
|
@ -113,12 +113,12 @@
|
||||||
"stream-http": "^2.3.1"
|
"stream-http": "^2.3.1"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@angular/common": "~2.1.2",
|
"@angular/common": "^2.2.4",
|
||||||
"@angular/compiler": "~2.1.2",
|
"@angular/compiler": "^2.2.4",
|
||||||
"@angular/core": "~2.1.2",
|
"@angular/core": "^2.2.4",
|
||||||
"@angular/platform-browser": "~2.1.2",
|
"@angular/platform-browser": "^2.2.4",
|
||||||
"@angular/platform-browser-dynamic": "~2.1.2",
|
"@angular/platform-browser-dynamic": "^2.2.4",
|
||||||
"@angular/platform-server": "~2.1.2",
|
"@angular/platform-server": "^2.2.4",
|
||||||
"core-js": "^2.4.1",
|
"core-js": "^2.4.1",
|
||||||
"rxjs": "5.0.0-beta.12",
|
"rxjs": "5.0.0-beta.12",
|
||||||
"zone.js": "^0.6.25"
|
"zone.js": "^0.6.25"
|
||||||
|
|
16
tslint.json
16
tslint.json
|
@ -13,14 +13,12 @@
|
||||||
],
|
],
|
||||||
"no-arg": true,
|
"no-arg": true,
|
||||||
"no-construct": true,
|
"no-construct": true,
|
||||||
"no-duplicate-key": true,
|
|
||||||
"no-duplicate-variable": true,
|
"no-duplicate-variable": true,
|
||||||
"no-empty": true,
|
"no-empty": true,
|
||||||
"no-eval": true,
|
"no-eval": true,
|
||||||
"no-trailing-whitespace": true,
|
"no-trailing-whitespace": true,
|
||||||
"no-unused-expression": true,
|
"no-unused-expression": true,
|
||||||
"no-unused-variable": true,
|
|
||||||
"no-unreachable": true,
|
|
||||||
"no-use-before-declare": true,
|
"no-use-before-declare": true,
|
||||||
"one-line": [true,
|
"one-line": [true,
|
||||||
"check-open-brace",
|
"check-open-brace",
|
||||||
|
@ -36,10 +34,8 @@
|
||||||
],
|
],
|
||||||
"variable-name": false,
|
"variable-name": false,
|
||||||
|
|
||||||
"directive-selector-type": [true, "attribute"],
|
"directive-selector": [true, "attribute", "", "camelCase"],
|
||||||
"component-selector-type": [true, "element"],
|
"component-selector": [true, "element", "", "kebab-case"],
|
||||||
"component-selector-name": [true, "kebab-case"],
|
|
||||||
"directive-selector-name": [true, "camelCase"],
|
|
||||||
"use-input-property-decorator": true,
|
"use-input-property-decorator": true,
|
||||||
"use-output-property-decorator": true,
|
"use-output-property-decorator": true,
|
||||||
"use-host-property-decorator": true,
|
"use-host-property-decorator": true,
|
||||||
|
@ -53,6 +49,10 @@
|
||||||
"no-access-missing-member": true,
|
"no-access-missing-member": true,
|
||||||
"invoke-injectable": true,
|
"invoke-injectable": true,
|
||||||
"no-forward-ref": true,
|
"no-forward-ref": true,
|
||||||
"no-attribute-parameter-decorator": true
|
"no-attribute-parameter-decorator": true,
|
||||||
|
"templates-use-public": true,
|
||||||
|
"no-access-missing-member": true,
|
||||||
|
"invoke-injectable": true,
|
||||||
|
"no-unused-css": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user