ngx-forge
Advanced tools
Comparing version 0.0.11-development to 0.0.12-development
export { AsciidocComponent } from './src/app/asciidoc/asciidoc.component'; | ||
export { AsciidocIndex } from './src/app/asciidoc/asciidoc.index'; | ||
export { AsciidocService } from './src/app/asciidoc/asciidoc.service'; | ||
@@ -6,3 +7,3 @@ export { InputComponent } from './src/app/input/input.component'; | ||
export * from './src/app/model/gui.model'; | ||
export { ProjectSelect } from './src/app/project-select/project-select'; | ||
export { ProjectSelect, ProjectSelectConfig } from './src/app/project-select/project-select'; | ||
export { Config } from './src/app/service/config.component'; | ||
@@ -9,0 +10,0 @@ export { ForgeService } from './src/app/service/forge.service'; |
export { AsciidocComponent } from './src/app/asciidoc/asciidoc.component'; | ||
export { AsciidocIndex } from './src/app/asciidoc/asciidoc.index'; | ||
export { AsciidocService } from './src/app/asciidoc/asciidoc.service'; | ||
@@ -6,3 +7,3 @@ export { InputComponent } from './src/app/input/input.component'; | ||
export * from './src/app/model/gui.model'; | ||
export { ProjectSelect } from './src/app/project-select/project-select'; | ||
export { ProjectSelect, ProjectSelectConfig } from './src/app/project-select/project-select'; | ||
export { Config } from './src/app/service/config.component'; | ||
@@ -9,0 +10,0 @@ export { ForgeService } from './src/app/service/forge.service'; |
@@ -7,3 +7,3 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
}; | ||
import { APP_INITIALIZER, NgModule } from '@angular/core'; | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
@@ -13,2 +13,3 @@ import { FormsModule } from '@angular/forms'; | ||
import { InputComponent } from './src/app/input/input.component'; | ||
import { MultiselectDropdownModule } from 'angular-2-dropdown-multiselect/src/multiselect-dropdown'; | ||
import { ProjectSelect } from './src/app/project-select/project-select'; | ||
@@ -18,2 +19,3 @@ import { Config } from './src/app/service/config.component'; | ||
import { History } from './src/app/service/history.component'; | ||
import { AsciidocIndex } from './src/app/asciidoc/asciidoc.index'; | ||
import { AsciidocService } from './src/app/asciidoc/asciidoc.service'; | ||
@@ -32,3 +34,3 @@ var classes = [ | ||
NgModule({ | ||
imports: [CommonModule, FormsModule], | ||
imports: [CommonModule, FormsModule, MultiselectDropdownModule], | ||
exports: classes, | ||
@@ -38,5 +40,6 @@ declarations: classes, | ||
ForgeService, | ||
AsciidocIndex, | ||
AsciidocService, | ||
History, | ||
{ provide: APP_INITIALIZER, useFactory: function (config) { return function () { return config.load(); }; }, deps: [Config], multi: true } | ||
Config | ||
] | ||
@@ -43,0 +46,0 @@ }) |
{ | ||
"name": "ngx-forge", | ||
"version": "0.0.11-development", | ||
"version": "0.0.12-development", | ||
"description": "Forge services for Angular v2 and up", | ||
"main": "bundles/ngx-forge.umd.js", | ||
"module": "index.js", | ||
"main": "bundles/ngx-forge.js", | ||
"module": "bundles/ngx-forge.js", | ||
"typings": "index.d.ts", | ||
@@ -143,3 +143,3 @@ "scripts": { | ||
"tslint": "5.0.0", | ||
"tslint-loader": "3.4.3", | ||
"tslint-loader": "3.5.3", | ||
"typedoc": "0.5.9", | ||
@@ -146,0 +146,0 @@ "typescript": "2.3", |
import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; | ||
import { History } from '../service/history.component'; | ||
import { AsciidocIndex } from './asciidoc.index'; | ||
export declare class AsciidocService { | ||
private domSanitizer; | ||
private history; | ||
private adocIndex; | ||
defaultOptions: { | ||
@@ -10,5 +12,5 @@ safe: string; | ||
}; | ||
constructor(domSanitizer: DomSanitizer, history: History); | ||
constructor(domSanitizer: DomSanitizer, history: History, adocIndex: AsciidocIndex); | ||
generateHtml(docId: string): string; | ||
generateSafeHtml(docId: string): SafeHtml; | ||
} |
@@ -13,8 +13,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
import { History } from '../service/history.component'; | ||
var adocIndex = []; // require('../../../../assets/adoc.index'); | ||
import { AsciidocIndex } from './asciidoc.index'; | ||
var asciidoctor = require('asciidoctor.js')(); | ||
var AsciidocService = (function () { | ||
function AsciidocService(domSanitizer, history) { | ||
function AsciidocService(domSanitizer, history, adocIndex) { | ||
this.domSanitizer = domSanitizer; | ||
this.history = history; | ||
this.adocIndex = adocIndex; | ||
this.defaultOptions = { | ||
@@ -26,3 +27,3 @@ safe: 'unsafe', | ||
AsciidocService.prototype.generateHtml = function (docId) { | ||
if (!adocIndex.hasOwnProperty(docId)) { | ||
if (!this.adocIndex.hasKey(docId)) { | ||
console.warn("docId: '" + docId + "' not valid"); | ||
@@ -36,3 +37,4 @@ return ''; | ||
}); | ||
return asciidoctor.convert(context + adocIndex['document-attributes'] + adocIndex[docId], this.defaultOptions); | ||
return asciidoctor.convert(context + this.adocIndex.get('document-attributes') | ||
+ this.adocIndex.get(docId), this.defaultOptions); | ||
}; | ||
@@ -46,5 +48,5 @@ AsciidocService.prototype.generateSafeHtml = function (docId) { | ||
Injectable(), | ||
__metadata("design:paramtypes", [DomSanitizer, History]) | ||
__metadata("design:paramtypes", [DomSanitizer, History, AsciidocIndex]) | ||
], AsciidocService); | ||
export { AsciidocService }; | ||
//# sourceMappingURL=asciidoc.service.js.map |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":3,"metadata":{"AsciidocService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/platform-browser","name":"DomSanitizer"},{"__symbolic":"reference","module":"../service/history.component","name":"History"}]}],"generateHtml":[{"__symbolic":"method"}],"generateSafeHtml":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"AsciidocService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/platform-browser","name":"DomSanitizer"},{"__symbolic":"reference","module":"../service/history.component","name":"History"}]}],"generateHtml":[{"__symbolic":"method"}],"generateSafeHtml":[{"__symbolic":"method"}]}}}}] | ||
[{"__symbolic":"module","version":3,"metadata":{"AsciidocService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/platform-browser","name":"DomSanitizer"},{"__symbolic":"reference","module":"../service/history.component","name":"History"},{"__symbolic":"reference","module":"./asciidoc.index","name":"AsciidocIndex"}]}],"generateHtml":[{"__symbolic":"method"}],"generateSafeHtml":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"AsciidocService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/platform-browser","name":"DomSanitizer"},{"__symbolic":"reference","module":"../service/history.component","name":"History"},{"__symbolic":"reference","module":"./asciidoc.index","name":"AsciidocIndex"}]}],"generateHtml":[{"__symbolic":"method"}],"generateSafeHtml":[{"__symbolic":"method"}]}}}}] |
@@ -5,9 +5,16 @@ import { DefaultValueAccessor } from '@angular/forms'; | ||
input: Field; | ||
config: ProjectSelectConfig; | ||
model: string; | ||
writeValue(value: any): void; | ||
className(option: Option): string; | ||
techPreview(option: Option): boolean; | ||
isSelected(option: Option): boolean; | ||
setSelected(option: Option): void; | ||
} | ||
export declare class ProjectSelectConfig { | ||
classes: string[]; | ||
techPreview: string[]; | ||
renderType: string; | ||
} | ||
export declare class ProjectSelectModule { | ||
} |
@@ -40,6 +40,14 @@ var __extends = (this && this.__extends) || (function () { | ||
ProjectSelect.prototype.className = function (option) { | ||
var index = option.id.indexOf(' '); | ||
index = index === -1 ? option.id.indexOf('.') : index; | ||
return option.id.substr(0, index).replace(/\./, '-'); | ||
for (var _i = 0, _a = this.config.classes; _i < _a.length; _i++) { | ||
var key = _a[_i]; | ||
if (option.id.toLowerCase().indexOf(key.toLowerCase()) !== -1) { | ||
return key; | ||
} | ||
} | ||
return ''; | ||
}; | ||
ProjectSelect.prototype.techPreview = function (option) { | ||
var className = this.className(option); | ||
return this.config.techPreview.indexOf(className) !== -1; | ||
}; | ||
ProjectSelect.prototype.isSelected = function (option) { | ||
@@ -58,2 +66,6 @@ return this.model === option.id; | ||
], ProjectSelect.prototype, "input", void 0); | ||
__decorate([ | ||
Input(), | ||
__metadata("design:type", ProjectSelectConfig) | ||
], ProjectSelect.prototype, "config", void 0); | ||
ProjectSelect = __decorate([ | ||
@@ -63,7 +75,16 @@ Component({ | ||
providers: [PROJECTSELECT_VALUE_ACCESSOR], | ||
templateUrl: 'project-select.component.html', | ||
styleUrls: ['project-select.component.scss'] | ||
templateUrl: 'project-select.html', | ||
styleUrls: ['project-select.scss'] | ||
}) | ||
], ProjectSelect); | ||
export { ProjectSelect }; | ||
var ProjectSelectConfig = (function () { | ||
function ProjectSelectConfig() { | ||
this.classes = []; | ||
this.techPreview = []; | ||
this.renderType = 'title'; | ||
} | ||
return ProjectSelectConfig; | ||
}()); | ||
export { ProjectSelectConfig }; | ||
var ProjectSelectModule = (function () { | ||
@@ -77,4 +98,4 @@ function ProjectSelectModule() { | ||
imports: [CommonModule, FormsModule], | ||
exports: [ProjectSelect], | ||
declarations: [ProjectSelect] | ||
exports: [ProjectSelect, ProjectSelectConfig], | ||
declarations: [ProjectSelect, ProjectSelectConfig] | ||
}) | ||
@@ -81,0 +102,0 @@ ], ProjectSelectModule); |
@@ -6,5 +6,5 @@ import { Http } from '@angular/http'; | ||
constructor(http: Http); | ||
load(settingsLocation?: string): Promise<any>; | ||
load(settingsLocation?: string): Promise<Config>; | ||
set(settings: any): void; | ||
get(key: string): string; | ||
} |
@@ -19,5 +19,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
if (settingsLocation === void 0) { settingsLocation = 'settings.json'; } | ||
return this.http.get(settingsLocation).toPromise().then(function (settings) { | ||
_this.settings = settings.json(); | ||
this.http.get(settingsLocation).toPromise().then(function (settings) { | ||
_this.settings = Object.assign(_this.settings, settings.json()); | ||
}).catch(function () { return console.log('settings.json not found ignoring'); }); | ||
return Promise.resolve(this); | ||
}; | ||
@@ -24,0 +25,0 @@ Config.prototype.set = function (settings) { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
3304656
71007
0
45