Skip to content

Commit

Permalink
chore(all): prepare release 1.0.0-beta.2.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Jun 19, 2016
1 parent 30bb67b commit d6534e0
Show file tree
Hide file tree
Showing 11 changed files with 257 additions and 276 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aurelia-templating-router",
"version": "1.0.0-beta.2.0.2",
"version": "1.0.0-beta.2.0.3",
"description": "An implementation of the RouteLoader interface for use with the router module. Also contains a custom element that allows the templating engine to display the current route.",
"keywords": [
"aurelia",
Expand Down
73 changes: 35 additions & 38 deletions dist/amd/router-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,66 +145,63 @@ define(['exports', 'aurelia-dependency-injection', 'aurelia-templating', 'aureli
viewSlot: this.viewSlot
};

return Promise.resolve(this.composeLayout(layoutInstruction)).then(function (layoutView) {
var viewStrategy = _this.viewLocator.getViewStrategy(component.view || viewModel);
var viewStrategy = this.viewLocator.getViewStrategy(component.view || viewModel);
if (viewStrategy) {
viewStrategy.makeRelativeTo(_aureliaMetadata.Origin.get(component.router.container.viewModel.constructor).moduleId);
}

if (viewStrategy) {
viewStrategy.makeRelativeTo(_aureliaMetadata.Origin.get(component.router.container.viewModel.constructor).moduleId);
return metadata.load(childContainer, viewModelResource.value, null, viewStrategy, true).then(function (viewFactory) {
if (!_this.compositionTransactionNotifier) {
_this.compositionTransactionOwnershipToken = _this.compositionTransaction.tryCapture();
}

return metadata.load(childContainer, viewModelResource.value, null, viewStrategy, true).then(function (viewFactory) {
if (!_this.compositionTransactionNotifier) {
_this.compositionTransactionOwnershipToken = _this.compositionTransaction.tryCapture();
}

viewPortInstruction.layout = layoutView ? layoutView.view || layoutView : undefined;
if (layoutInstruction.viewModel || layoutInstruction.view) {
viewPortInstruction.layoutInstruction = layoutInstruction;
}

viewPortInstruction.controller = metadata.create(childContainer, _aureliaTemplating.BehaviorInstruction.dynamic(_this.element, viewModel, viewFactory));
viewPortInstruction.controller = metadata.create(childContainer, _aureliaTemplating.BehaviorInstruction.dynamic(_this.element, viewModel, viewFactory));

if (waitToSwap) {
return;
}
if (waitToSwap) {
return;
}

_this.swap(viewPortInstruction);
});
_this.swap(viewPortInstruction);
});
};

RouterView.prototype.composeLayout = function composeLayout(instruction) {
if (instruction.viewModel || instruction.view) {
return this.compositionEngine.compose(instruction);
}

return undefined;
};

RouterView.prototype.swap = function swap(viewPortInstruction) {
var _this2 = this;

var work = function work() {
var previousView = _this2.view;
var swapStrategy = void 0;
var layout = viewPortInstruction.layout;
var viewSlot = layout ? new _aureliaTemplating.ViewSlot(layout.firstChild, false) : _this2.viewSlot;

if (layout) {
viewSlot.attached();
}
var viewSlot = _this2.viewSlot;
var layoutInstruction = viewPortInstruction.layoutInstruction;

swapStrategy = _this2.swapOrder in swapStrategies ? swapStrategies[_this2.swapOrder] : swapStrategies.after;

swapStrategy(viewSlot, previousView, function () {
if (layout) {
_aureliaTemplating.ShadowDOM.distributeView(viewPortInstruction.controller.view, layout.slots, viewSlot);
_this2._notify();
} else {
return Promise.resolve(viewSlot.add(viewPortInstruction.controller.view)).then(function () {
_this2._notify();
var waitForView = void 0;

if (layoutInstruction) {
if (!layoutInstruction.viewModel) {
layoutInstruction.viewModel = {};
}

waitForView = _this2.compositionEngine.createController(layoutInstruction).then(function (layout) {
_aureliaTemplating.ShadowDOM.distributeView(viewPortInstruction.controller.view, layout.slots || layout.view.slots);
return layout.view || layout;
});
} else {
waitForView = Promise.resolve(viewPortInstruction.controller.view);
}

_this2.view = viewPortInstruction.controller.view;
return Promise.resolve();
return waitForView.then(function (newView) {
_this2.view = newView;
return viewSlot.add(newView);
}).then(function () {
_this2._notify();
});
});
};

Expand Down
1 change: 0 additions & 1 deletion dist/aurelia-templating-router.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ export declare class RouterView {
created(owningView?: any): any;
bind(bindingContext?: any, overrideContext?: any): any;
process(viewPortInstruction?: any, waitToSwap?: any): any;
composeLayout(instruction?: any): any;
swap(viewPortInstruction?: any): any;
_notify(): any;
}
Expand Down
88 changes: 44 additions & 44 deletions dist/aurelia-templating-router.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,72 +136,72 @@ export class RouterView {
viewSlot: this.viewSlot
};

return Promise.resolve(this.composeLayout(layoutInstruction))
.then(layoutView => {
let viewStrategy = this.viewLocator.getViewStrategy(component.view || viewModel);
let viewStrategy = this.viewLocator.getViewStrategy(component.view || viewModel);
if (viewStrategy) {
viewStrategy.makeRelativeTo(Origin.get(component.router.container.viewModel.constructor).moduleId);
}

if (viewStrategy) {
viewStrategy.makeRelativeTo(Origin.get(component.router.container.viewModel.constructor).moduleId);
return metadata.load(childContainer, viewModelResource.value, null, viewStrategy, true)
.then(viewFactory => {
if (!this.compositionTransactionNotifier) {
this.compositionTransactionOwnershipToken = this.compositionTransaction.tryCapture();
}

return metadata.load(childContainer, viewModelResource.value, null, viewStrategy, true)
.then(viewFactory => {
if (!this.compositionTransactionNotifier) {
this.compositionTransactionOwnershipToken = this.compositionTransaction.tryCapture();
}

viewPortInstruction.layout = layoutView ? layoutView.view || layoutView : undefined;
if (layoutInstruction.viewModel || layoutInstruction.view) {
viewPortInstruction.layoutInstruction = layoutInstruction;
}

viewPortInstruction.controller = metadata.create(childContainer,
BehaviorInstruction.dynamic(
this.element,
viewModel,
viewFactory
)
);
viewPortInstruction.controller = metadata.create(childContainer,
BehaviorInstruction.dynamic(
this.element,
viewModel,
viewFactory
)
);

if (waitToSwap) {
return;
}
if (waitToSwap) {
return;
}

this.swap(viewPortInstruction);
});
this.swap(viewPortInstruction);
});
}

composeLayout(instruction) {
if (instruction.viewModel || instruction.view) {
return this.compositionEngine.compose(instruction);
}

return undefined;
}

swap(viewPortInstruction) {
let work = () => {
let previousView = this.view;
let swapStrategy;
let layout = viewPortInstruction.layout;
let viewSlot = layout ? new ViewSlot(layout.firstChild, false) : this.viewSlot;

if (layout) {
viewSlot.attached();
}
let viewSlot = this.viewSlot;
let layoutInstruction = viewPortInstruction.layoutInstruction;

swapStrategy = this.swapOrder in swapStrategies
? swapStrategies[this.swapOrder]
: swapStrategies.after;

swapStrategy(viewSlot, previousView, () => {
if (layout) {
ShadowDOM.distributeView(viewPortInstruction.controller.view, layout.slots, viewSlot);
this._notify();
let waitForView;

if (layoutInstruction) {
if (!layoutInstruction.viewModel) {
// createController chokes if there's no viewmodel, so create a dummy one
// could possibly check if there was no VM and don't use compose, just create a viewfactory -> view?
layoutInstruction.viewModel = {};
}

waitForView = this.compositionEngine.createController(layoutInstruction).then(layout => {
ShadowDOM.distributeView(viewPortInstruction.controller.view, layout.slots || layout.view.slots);
return layout.view || layout;
});
} else {
return Promise.resolve(viewSlot.add(viewPortInstruction.controller.view)).then(() => { this._notify(); });
waitForView = Promise.resolve(viewPortInstruction.controller.view);
}

this.view = viewPortInstruction.controller.view;
return Promise.resolve();
return waitForView.then(newView => {
this.view = newView;
return viewSlot.add(newView);
}).then(() => {
this._notify();
});
});
};

Expand Down
73 changes: 35 additions & 38 deletions dist/commonjs/router-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,66 +154,63 @@ var RouterView = exports.RouterView = (_dec = (0, _aureliaTemplating.customEleme
viewSlot: this.viewSlot
};

return Promise.resolve(this.composeLayout(layoutInstruction)).then(function (layoutView) {
var viewStrategy = _this.viewLocator.getViewStrategy(component.view || viewModel);
var viewStrategy = this.viewLocator.getViewStrategy(component.view || viewModel);
if (viewStrategy) {
viewStrategy.makeRelativeTo(_aureliaMetadata.Origin.get(component.router.container.viewModel.constructor).moduleId);
}

if (viewStrategy) {
viewStrategy.makeRelativeTo(_aureliaMetadata.Origin.get(component.router.container.viewModel.constructor).moduleId);
return metadata.load(childContainer, viewModelResource.value, null, viewStrategy, true).then(function (viewFactory) {
if (!_this.compositionTransactionNotifier) {
_this.compositionTransactionOwnershipToken = _this.compositionTransaction.tryCapture();
}

return metadata.load(childContainer, viewModelResource.value, null, viewStrategy, true).then(function (viewFactory) {
if (!_this.compositionTransactionNotifier) {
_this.compositionTransactionOwnershipToken = _this.compositionTransaction.tryCapture();
}

viewPortInstruction.layout = layoutView ? layoutView.view || layoutView : undefined;
if (layoutInstruction.viewModel || layoutInstruction.view) {
viewPortInstruction.layoutInstruction = layoutInstruction;
}

viewPortInstruction.controller = metadata.create(childContainer, _aureliaTemplating.BehaviorInstruction.dynamic(_this.element, viewModel, viewFactory));
viewPortInstruction.controller = metadata.create(childContainer, _aureliaTemplating.BehaviorInstruction.dynamic(_this.element, viewModel, viewFactory));

if (waitToSwap) {
return;
}
if (waitToSwap) {
return;
}

_this.swap(viewPortInstruction);
});
_this.swap(viewPortInstruction);
});
};

RouterView.prototype.composeLayout = function composeLayout(instruction) {
if (instruction.viewModel || instruction.view) {
return this.compositionEngine.compose(instruction);
}

return undefined;
};

RouterView.prototype.swap = function swap(viewPortInstruction) {
var _this2 = this;

var work = function work() {
var previousView = _this2.view;
var swapStrategy = void 0;
var layout = viewPortInstruction.layout;
var viewSlot = layout ? new _aureliaTemplating.ViewSlot(layout.firstChild, false) : _this2.viewSlot;

if (layout) {
viewSlot.attached();
}
var viewSlot = _this2.viewSlot;
var layoutInstruction = viewPortInstruction.layoutInstruction;

swapStrategy = _this2.swapOrder in swapStrategies ? swapStrategies[_this2.swapOrder] : swapStrategies.after;

swapStrategy(viewSlot, previousView, function () {
if (layout) {
_aureliaTemplating.ShadowDOM.distributeView(viewPortInstruction.controller.view, layout.slots, viewSlot);
_this2._notify();
} else {
return Promise.resolve(viewSlot.add(viewPortInstruction.controller.view)).then(function () {
_this2._notify();
var waitForView = void 0;

if (layoutInstruction) {
if (!layoutInstruction.viewModel) {
layoutInstruction.viewModel = {};
}

waitForView = _this2.compositionEngine.createController(layoutInstruction).then(function (layout) {
_aureliaTemplating.ShadowDOM.distributeView(viewPortInstruction.controller.view, layout.slots || layout.view.slots);
return layout.view || layout;
});
} else {
waitForView = Promise.resolve(viewPortInstruction.controller.view);
}

_this2.view = viewPortInstruction.controller.view;
return Promise.resolve();
return waitForView.then(function (newView) {
_this2.view = newView;
return viewSlot.add(newView);
}).then(function () {
_this2._notify();
});
});
};

Expand Down
Loading

0 comments on commit d6534e0

Please sign in to comment.