Skip to content

Commit

Permalink
chore(all): prepare release 1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Jan 15, 2018
1 parent f8563bd commit 01ad30f
Show file tree
Hide file tree
Showing 19 changed files with 167 additions and 72 deletions.
2 changes: 1 addition & 1 deletion dist/amd/route-href.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ define(['exports', 'aurelia-templating', 'aurelia-dependency-injection', 'aureli
this.element = element;
}

RouteHref.prototype.attached = function attached() {
RouteHref.prototype.bind = function bind() {
this.isActive = true;
this.processChange();
};
Expand Down
30 changes: 21 additions & 9 deletions dist/amd/route-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ define(['exports', 'aurelia-dependency-injection', 'aurelia-templating', 'aureli
});
exports.TemplatingRouteLoader = undefined;



function _possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
Expand All @@ -32,9 +30,14 @@ define(['exports', 'aurelia-dependency-injection', 'aurelia-templating', 'aureli
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}

var _dec, _class;


var _dec, _class, _dec2, _class2;

var TemplatingRouteLoader = exports.TemplatingRouteLoader = (_dec = (0, _aureliaDependencyInjection.inject)(_aureliaTemplating.CompositionEngine), _dec(_class = function (_RouteLoader) {
var EmptyClass = (_dec = (0, _aureliaTemplating.inlineView)('<template></template>'), _dec(_class = function EmptyClass() {

}) || _class);
var TemplatingRouteLoader = exports.TemplatingRouteLoader = (_dec2 = (0, _aureliaDependencyInjection.inject)(_aureliaTemplating.CompositionEngine), _dec2(_class2 = function (_RouteLoader) {
_inherits(TemplatingRouteLoader, _RouteLoader);

function TemplatingRouteLoader(compositionEngine) {
Expand All @@ -49,7 +52,16 @@ define(['exports', 'aurelia-dependency-injection', 'aurelia-templating', 'aureli
TemplatingRouteLoader.prototype.loadRoute = function loadRoute(router, config) {
var childContainer = router.container.createChild();

var viewModel = /\.html/.test(config.moduleId) ? createDynamicClass(config.moduleId) : (0, _aureliaPath.relativeToFile)(config.moduleId, _aureliaMetadata.Origin.get(router.container.viewModel.constructor).moduleId);
var viewModel = void 0;
if (config.moduleId === null) {
viewModel = EmptyClass;
} else if (/\.html/i.test(config.moduleId)) {
viewModel = createDynamicClass(config.moduleId);
} else {
viewModel = (0, _aureliaPath.relativeToFile)(config.moduleId, _aureliaMetadata.Origin.get(router.container.viewModel.constructor).moduleId);
}

config = config || {};

var instruction = {
viewModel: viewModel,
Expand All @@ -74,15 +86,15 @@ define(['exports', 'aurelia-dependency-injection', 'aurelia-templating', 'aureli
};

return TemplatingRouteLoader;
}(_aureliaRouter.RouteLoader)) || _class);
}(_aureliaRouter.RouteLoader)) || _class2);


function createDynamicClass(moduleId) {
var _dec2, _dec3, _class2;
var _dec3, _dec4, _class3;

var name = /([^\/^\?]+)\.html/i.exec(moduleId)[1];

var DynamicClass = (_dec2 = (0, _aureliaTemplating.customElement)(name), _dec3 = (0, _aureliaTemplating.useView)(moduleId), _dec2(_class2 = _dec3(_class2 = function () {
var DynamicClass = (_dec3 = (0, _aureliaTemplating.customElement)(name), _dec4 = (0, _aureliaTemplating.useView)(moduleId), _dec3(_class3 = _dec4(_class3 = function () {
function DynamicClass() {

}
Expand All @@ -92,7 +104,7 @@ define(['exports', 'aurelia-dependency-injection', 'aurelia-templating', 'aureli
};

return DynamicClass;
}()) || _class2) || _class2);
}()) || _class3) || _class3);


return DynamicClass;
Expand Down
2 changes: 1 addition & 1 deletion dist/amd/router-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ define(['exports', 'aurelia-dependency-injection', 'aurelia-binding', 'aurelia-t
var viewModelResource = component.viewModelResource;
var metadata = viewModelResource.metadata;
var config = component.router.currentInstruction.config;
var viewPort = config.viewPorts ? config.viewPorts[viewPortInstruction.name] : {};
var viewPort = config.viewPorts ? config.viewPorts[viewPortInstruction.name] || {} : {};

childContainer.get(RouterViewLocator)._notify(this);

Expand Down
5 changes: 3 additions & 2 deletions dist/aurelia-templating-router.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import {
CompositionEngine,
ShadowDOM,
SwapStrategies,
useView
useView,
inlineView
} from 'aurelia-templating';
import {
inject,
Expand All @@ -35,7 +36,7 @@ import {
} from 'aurelia-path';
export declare class RouteHref {
constructor(router?: any, element?: any);
attached(): any;
bind(): any;
unbind(): any;
attributeChanged(value?: any, previous?: any): any;
processChange(): any;
Expand Down
22 changes: 16 additions & 6 deletions dist/aurelia-templating-router.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as LogManager from 'aurelia-logging';
import {customAttribute,bindable,ViewSlot,ViewLocator,customElement,noView,BehaviorInstruction,CompositionTransaction,CompositionEngine,ShadowDOM,SwapStrategies,useView} from 'aurelia-templating';
import {customAttribute,bindable,ViewSlot,ViewLocator,customElement,noView,BehaviorInstruction,CompositionTransaction,CompositionEngine,ShadowDOM,SwapStrategies,useView,inlineView} from 'aurelia-templating';
import {inject,Container} from 'aurelia-dependency-injection';
import {Router,RouteLoader} from 'aurelia-router';
import {DOM} from 'aurelia-pal';
Expand All @@ -20,7 +20,7 @@ export class RouteHref {
this.element = element;
}

attached() {
bind() {
this.isActive = true;
this.processChange();
}
Expand Down Expand Up @@ -101,7 +101,7 @@ export class RouterView {
let viewModelResource = component.viewModelResource;
let metadata = viewModelResource.metadata;
let config = component.router.currentInstruction.config;
let viewPort = config.viewPorts ? config.viewPorts[viewPortInstruction.name] : {};
let viewPort = config.viewPorts ? (config.viewPorts[viewPortInstruction.name] || {}) : {};

childContainer.get(RouterViewLocator)._notify(this);

Expand Down Expand Up @@ -228,6 +228,9 @@ export class RouterViewLocator {
}
}

@inlineView('<template></template>')
class EmptyClass { }

@inject(CompositionEngine)
export class TemplatingRouteLoader extends RouteLoader {
constructor(compositionEngine) {
Expand All @@ -238,9 +241,16 @@ export class TemplatingRouteLoader extends RouteLoader {
loadRoute(router, config) {
let childContainer = router.container.createChild();

let viewModel = /\.html/.test(config.moduleId)
? createDynamicClass(config.moduleId)
: relativeToFile(config.moduleId, Origin.get(router.container.viewModel.constructor).moduleId);
let viewModel;
if (config.moduleId === null) {
viewModel = EmptyClass;
} else if (/\.html/i.test(config.moduleId)) {
viewModel = createDynamicClass(config.moduleId);
} else {
viewModel = relativeToFile(config.moduleId, Origin.get(router.container.viewModel.constructor).moduleId);
}

config = config || {};

let instruction = {
viewModel: viewModel,
Expand Down
2 changes: 1 addition & 1 deletion dist/commonjs/route-href.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var RouteHref = exports.RouteHref = (_dec = (0, _aureliaTemplating.customAttribu
this.element = element;
}

RouteHref.prototype.attached = function attached() {
RouteHref.prototype.bind = function bind() {
this.isActive = true;
this.processChange();
};
Expand Down
30 changes: 21 additions & 9 deletions dist/commonjs/route-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
});
exports.TemplatingRouteLoader = undefined;

var _dec, _class;
var _dec, _class, _dec2, _class2;

var _aureliaDependencyInjection = require('aurelia-dependency-injection');

Expand All @@ -19,13 +19,16 @@ var _aureliaMetadata = require('aurelia-metadata');

var _routerView = require('./router-view');



function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

var TemplatingRouteLoader = exports.TemplatingRouteLoader = (_dec = (0, _aureliaDependencyInjection.inject)(_aureliaTemplating.CompositionEngine), _dec(_class = function (_RouteLoader) {


var EmptyClass = (_dec = (0, _aureliaTemplating.inlineView)('<template></template>'), _dec(_class = function EmptyClass() {

}) || _class);
var TemplatingRouteLoader = exports.TemplatingRouteLoader = (_dec2 = (0, _aureliaDependencyInjection.inject)(_aureliaTemplating.CompositionEngine), _dec2(_class2 = function (_RouteLoader) {
_inherits(TemplatingRouteLoader, _RouteLoader);

function TemplatingRouteLoader(compositionEngine) {
Expand All @@ -40,7 +43,16 @@ var TemplatingRouteLoader = exports.TemplatingRouteLoader = (_dec = (0, _aurelia
TemplatingRouteLoader.prototype.loadRoute = function loadRoute(router, config) {
var childContainer = router.container.createChild();

var viewModel = /\.html/.test(config.moduleId) ? createDynamicClass(config.moduleId) : (0, _aureliaPath.relativeToFile)(config.moduleId, _aureliaMetadata.Origin.get(router.container.viewModel.constructor).moduleId);
var viewModel = void 0;
if (config.moduleId === null) {
viewModel = EmptyClass;
} else if (/\.html/i.test(config.moduleId)) {
viewModel = createDynamicClass(config.moduleId);
} else {
viewModel = (0, _aureliaPath.relativeToFile)(config.moduleId, _aureliaMetadata.Origin.get(router.container.viewModel.constructor).moduleId);
}

config = config || {};

var instruction = {
viewModel: viewModel,
Expand All @@ -65,15 +77,15 @@ var TemplatingRouteLoader = exports.TemplatingRouteLoader = (_dec = (0, _aurelia
};

return TemplatingRouteLoader;
}(_aureliaRouter.RouteLoader)) || _class);
}(_aureliaRouter.RouteLoader)) || _class2);


function createDynamicClass(moduleId) {
var _dec2, _dec3, _class2;
var _dec3, _dec4, _class3;

var name = /([^\/^\?]+)\.html/i.exec(moduleId)[1];

var DynamicClass = (_dec2 = (0, _aureliaTemplating.customElement)(name), _dec3 = (0, _aureliaTemplating.useView)(moduleId), _dec2(_class2 = _dec3(_class2 = function () {
var DynamicClass = (_dec3 = (0, _aureliaTemplating.customElement)(name), _dec4 = (0, _aureliaTemplating.useView)(moduleId), _dec3(_class3 = _dec4(_class3 = function () {
function DynamicClass() {

}
Expand All @@ -83,7 +95,7 @@ function createDynamicClass(moduleId) {
};

return DynamicClass;
}()) || _class2) || _class2);
}()) || _class3) || _class3);


return DynamicClass;
Expand Down
2 changes: 1 addition & 1 deletion dist/commonjs/router-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ var RouterView = exports.RouterView = (_dec = (0, _aureliaTemplating.customEleme
var viewModelResource = component.viewModelResource;
var metadata = viewModelResource.metadata;
var config = component.router.currentInstruction.config;
var viewPort = config.viewPorts ? config.viewPorts[viewPortInstruction.name] : {};
var viewPort = config.viewPorts ? config.viewPorts[viewPortInstruction.name] || {} : {};

childContainer.get(RouterViewLocator)._notify(this);

Expand Down
2 changes: 1 addition & 1 deletion dist/es2015/route-href.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export let RouteHref = (_dec = customAttribute('route-href'), _dec2 = bindable({
this.element = element;
}

attached() {
bind() {
this.isActive = true;
this.processChange();
}
Expand Down
27 changes: 19 additions & 8 deletions dist/es2015/route-loader.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
var _dec, _class;
var _dec, _class, _dec2, _class2;

import { inject } from 'aurelia-dependency-injection';
import { CompositionEngine, useView, customElement } from 'aurelia-templating';
import { CompositionEngine, useView, inlineView, customElement } from 'aurelia-templating';
import { RouteLoader, Router } from 'aurelia-router';
import { relativeToFile } from 'aurelia-path';
import { Origin } from 'aurelia-metadata';
import { RouterViewLocator } from './router-view';

export let TemplatingRouteLoader = (_dec = inject(CompositionEngine), _dec(_class = class TemplatingRouteLoader extends RouteLoader {
let EmptyClass = (_dec = inlineView('<template></template>'), _dec(_class = class EmptyClass {}) || _class);

export let TemplatingRouteLoader = (_dec2 = inject(CompositionEngine), _dec2(_class2 = class TemplatingRouteLoader extends RouteLoader {
constructor(compositionEngine) {
super();
this.compositionEngine = compositionEngine;
Expand All @@ -16,7 +18,16 @@ export let TemplatingRouteLoader = (_dec = inject(CompositionEngine), _dec(_clas
loadRoute(router, config) {
let childContainer = router.container.createChild();

let viewModel = /\.html/.test(config.moduleId) ? createDynamicClass(config.moduleId) : relativeToFile(config.moduleId, Origin.get(router.container.viewModel.constructor).moduleId);
let viewModel;
if (config.moduleId === null) {
viewModel = EmptyClass;
} else if (/\.html/i.test(config.moduleId)) {
viewModel = createDynamicClass(config.moduleId);
} else {
viewModel = relativeToFile(config.moduleId, Origin.get(router.container.viewModel.constructor).moduleId);
}

config = config || {};

let instruction = {
viewModel: viewModel,
Expand All @@ -39,18 +50,18 @@ export let TemplatingRouteLoader = (_dec = inject(CompositionEngine), _dec(_clas

return this.compositionEngine.ensureViewModel(instruction);
}
}) || _class);
}) || _class2);

function createDynamicClass(moduleId) {
var _dec2, _dec3, _class2;
var _dec3, _dec4, _class3;

let name = /([^\/^\?]+)\.html/i.exec(moduleId)[1];

let DynamicClass = (_dec2 = customElement(name), _dec3 = useView(moduleId), _dec2(_class2 = _dec3(_class2 = class DynamicClass {
let DynamicClass = (_dec3 = customElement(name), _dec4 = useView(moduleId), _dec3(_class3 = _dec4(_class3 = class DynamicClass {
bind(bindingContext) {
this.$parent = bindingContext;
}
}) || _class2) || _class2);
}) || _class3) || _class3);


return DynamicClass;
Expand Down
2 changes: 1 addition & 1 deletion dist/es2015/router-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export let RouterView = (_dec = customElement('router-view'), _dec2 = inject(DOM
let viewModelResource = component.viewModelResource;
let metadata = viewModelResource.metadata;
let config = component.router.currentInstruction.config;
let viewPort = config.viewPorts ? config.viewPorts[viewPortInstruction.name] : {};
let viewPort = config.viewPorts ? config.viewPorts[viewPortInstruction.name] || {} : {};

childContainer.get(RouterViewLocator)._notify(this);

Expand Down
2 changes: 1 addition & 1 deletion dist/native-modules/route-href.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export var RouteHref = (_dec = customAttribute('route-href'), _dec2 = bindable({
this.element = element;
}

RouteHref.prototype.attached = function attached() {
RouteHref.prototype.bind = function bind() {
this.isActive = true;
this.processChange();
};
Expand Down
Loading

0 comments on commit 01ad30f

Please sign in to comment.