Skip to content

Commit

Permalink
chore(all): prepare release 1.6.3
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Sep 27, 2018
1 parent 8d20410 commit cfcc40c
Show file tree
Hide file tree
Showing 11 changed files with 204 additions and 128 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-router",
"version": "1.6.2",
"version": "1.6.3",
"description": "A powerful client-side router.",
"keywords": [
"aurelia",
Expand Down
12 changes: 10 additions & 2 deletions dist/amd/aurelia-router.js
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,7 @@ define(['exports', 'aurelia-logging', 'aurelia-route-recognizer', 'aurelia-depen
this.isNavigatingRefresh = false;
this.isNavigatingForward = false;
this.isNavigatingBack = false;
this.couldDeactivate = false;
this.navigation = [];
this.currentInstruction = null;
this.viewPortDefaults = {};
Expand Down Expand Up @@ -1322,6 +1323,8 @@ define(['exports', 'aurelia-logging', 'aurelia-route-recognizer', 'aurelia-depen
}
}

navigationInstruction.router.couldDeactivate = true;

return next();
}

Expand Down Expand Up @@ -1678,9 +1681,13 @@ define(['exports', 'aurelia-logging', 'aurelia-route-recognizer', 'aurelia-depen
PipelineProvider.prototype.createPipeline = function createPipeline() {
var _this9 = this;

var useCanDeactivateStep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;

var pipeline = new Pipeline();
this.steps.forEach(function (step) {
return pipeline.addStep(_this9.container.get(step));
if (useCanDeactivateStep || step !== CanDeactivatePreviousStep) {
pipeline.addStep(_this9.container.get(step));
}
});
return pipeline;
};
Expand Down Expand Up @@ -1875,7 +1882,7 @@ define(['exports', 'aurelia-logging', 'aurelia-route-recognizer', 'aurelia-depen
throw new Error('Maximum navigation attempts exceeded. Giving up.');
}

var pipeline = _this14.pipelineProvider.createPipeline();
var pipeline = _this14.pipelineProvider.createPipeline(!_this14.couldDeactivate);

return pipeline.run(instruction).then(function (result) {
return processResult(instruction, result, instructionCount, _this14);
Expand Down Expand Up @@ -1953,6 +1960,7 @@ define(['exports', 'aurelia-logging', 'aurelia-route-recognizer', 'aurelia-depen
router.isNavigatingRefresh = false;
router.isNavigatingForward = false;
router.isNavigatingBack = false;
router.couldDeactivate = false;

var eventName = void 0;

Expand Down
223 changes: 120 additions & 103 deletions dist/aurelia-router.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,69 +6,12 @@ import {
Container
} from 'aurelia-dependency-injection';
import {
History
History,
NavigationOptions
} from 'aurelia-history';
import {
EventAggregator
} from 'aurelia-event-aggregator';

/**
* A callback to indicate when pipeline processing should advance to the next step
* or be aborted.
*/
export declare interface Next {

/**
* Indicates the successful completion of the entire pipeline.
*/
complete(result?: any): Promise<any>;

/**
* Indicates that the pipeline should cancel processing.
*/
cancel(result?: any): Promise<any>;

/**
* Indicates that pipeline processing has failed and should be stopped.
*/
reject(result?: any): Promise<any>;

/**
* Indicates the successful completion of the pipeline step.
*/
(): Promise<any>;
}

/**
* A step to be run during processing of the pipeline.
*/
/**
* A step to be run during processing of the pipeline.
*/
export declare interface PipelineStep {

/**
* Execute the pipeline step. The step should invoke next(), next.complete(),
* next.cancel(), or next.reject() to allow the pipeline to continue.
*
* @param instruction The navigation instruction.
* @param next The next step in the pipeline.
*/
run(instruction: NavigationInstruction, next: Next): Promise<any>;
}

/**
* The result of a pipeline run.
*/
/**
* The result of a pipeline run.
*/
export declare interface PipelineResult {
status: string;
instruction: NavigationInstruction;
output: any;
completed: boolean;
}
export declare interface NavigationInstructionInit {
fragment: string;
queryString: string;
Expand Down Expand Up @@ -302,6 +245,37 @@ export declare interface ActivationStrategy {
replace: 'replace';
}

/**
* A step to be run during processing of the pipeline.
*/
/**
* A step to be run during processing of the pipeline.
*/
export declare interface PipelineStep {

/**
* Execute the pipeline step. The step should invoke next(), next.complete(),
* next.cancel(), or next.reject() to allow the pipeline to continue.
*
* @param instruction The navigation instruction.
* @param next The next step in the pipeline.
*/
run(instruction: NavigationInstruction, next: Next): Promise<any>;
}

/**
* The result of a pipeline run.
*/
/**
* The result of a pipeline run.
*/
export declare interface PipelineResult {
status: string;
instruction: NavigationInstruction;
output: any;
completed: boolean;
}

/**
* When a navigation command is encountered, the current navigation
* will be cancelled and control will be passed to the navigation
Expand All @@ -316,6 +290,33 @@ export declare interface NavigationCommand {
navigate(router: Router): void;
}

/**
* A callback to indicate when pipeline processing should advance to the next step
* or be aborted.
*/
export declare interface Next {

/**
* Indicates the successful completion of the entire pipeline.
*/
complete(result?: any): Promise<any>;

/**
* Indicates that the pipeline should cancel processing.
*/
cancel(result?: any): Promise<any>;

/**
* Indicates that pipeline processing has failed and should be stopped.
*/
reject(result?: any): Promise<any>;

/**
* Indicates the successful completion of the pipeline step.
*/
(): Promise<any>;
}

/**
* A basic interface for an Observable type
*/
Expand All @@ -332,39 +333,6 @@ export declare interface IObservable {
export declare interface ISubscription {
unsubscribe(): void;
}

/**
* The status of a Pipeline.
*/
export declare const pipelineStatus: any;

/**
* The class responsible for managing and processing the navigation pipeline.
*/
/**
* The class responsible for managing and processing the navigation pipeline.
*/
export declare class Pipeline {

/**
* The pipeline steps.
*/
steps: Array<Function | PipelineStep>;

/**
* Adds a step to the pipeline.
*
* @param step The pipeline step.
*/
addStep(step: PipelineStep): Pipeline;

/**
* Runs the pipeline.
*
* @param instruction The navigation instruction to process.
*/
run(instruction: NavigationInstruction): Promise<PipelineResult>;
}
export declare class CommitChangesStep {
run(navigationInstruction: NavigationInstruction, next: Function): any;
}
Expand Down Expand Up @@ -573,18 +541,52 @@ export declare class RedirectToRoute {
navigate(appRouter: Router): void;
}

/**
* The status of a Pipeline.
*/
export declare const pipelineStatus: any;

/**
* The class responsible for managing and processing the navigation pipeline.
*/
/**
* The class responsible for managing and processing the navigation pipeline.
*/
export declare class Pipeline {

/**
* The pipeline steps.
*/
steps: Array<Function | PipelineStep>;

/**
* Adds a step to the pipeline.
*
* @param step The pipeline step.
*/
addStep(step: PipelineStep): Pipeline;

/**
* Runs the pipeline.
*
* @param instruction The navigation instruction to process.
*/
run(instruction: NavigationInstruction): Promise<PipelineResult>;
}

/**
* Class used to configure a [[Router]] instance.
*
* @constructor
*/
export declare class RouterConfiguration {
instructions: any;
options: any;
pipelineSteps: Array<Function | PipelineStep>;
instructions: Array<((router: Router) => void)>;
options: { compareQueryParams: boolean, root: string, pushState: boolean, hashChange: boolean, silent: boolean, [key: string]: any };
pipelineSteps: Array<{ name: string, step: Function | PipelineStep }>;
title: string;
unknownRouteConfig: any;
viewPortDefaults: any;
titleSeparator: string;
unknownRouteConfig: string | RouteConfig | ((instruction: NavigationInstruction) => string | RouteConfig | Promise<string | RouteConfig>);
viewPortDefaults: { [name: string]: { moduleId: string | void, [key: string]: any } };

/**
* Adds a step to be run during the [[Router]]'s navigation pipeline.
Expand Down Expand Up @@ -650,7 +652,7 @@ export declare class RouterConfiguration {
* default, of the form { viewPortName: { moduleId } }.
* @chainable
*/
useViewPortDefaults(viewPortConfig: any): any;
useViewPortDefaults(viewPortConfig: { [name: string]: { moduleId: string, [key: string]: any } }): RouterConfiguration;

/**
* Maps a single route to be registered with the router.
Expand Down Expand Up @@ -702,6 +704,16 @@ export declare class Router {
*/
baseUrl: string;

/**
* If defined, used in generation of document title for [[Router]]'s routes.
*/
title: string | undefined;

/**
* The separator used in the document title between [[Router]]'s routes.
*/
titleSeparator: string | undefined;

/**
* True if the [[Router]] has been configured.
*/
Expand Down Expand Up @@ -747,6 +759,11 @@ export declare class Router {
*/
isNavigatingRefresh: boolean;

/**
* True if the previous instruction successfully completed the CanDeactivatePreviousStep in the current navigation.
*/
couldDeactivate: boolean;

/**
* The currently active navigation tracker.
*/
Expand Down Expand Up @@ -821,19 +838,19 @@ export declare class Router {
* Navigates to a new location.
*
* @param fragment The URL fragment to use as the navigation destination.
* @param options The navigation options. See [[History.NavigationOptions]] for all available options.
* @param options The navigation options.
*/
navigate(fragment: string, options?: any): boolean;
navigate(fragment: string, options?: NavigationOptions): Promise<PipelineResult | boolean>;

/**
* Navigates to a new location corresponding to the route and params specified. Equivallent to [[Router.generate]] followed
* by [[Router.navigate]].
*
* @param route The name of the route to use when generating the navigation location.
* @param params The route parameters to be used when populating the route pattern.
* @param options The navigation options. See [[History.NavigationOptions]] for all available options.
* @param options The navigation options.
*/
navigateToRoute(route: string, params?: any, options?: any): boolean;
navigateToRoute(route: string, params?: any, options?: NavigationOptions): Promise<PipelineResult | boolean>;

/**
* Navigates back to the most recent location in history.
Expand Down Expand Up @@ -943,7 +960,7 @@ export declare class PipelineProvider {
/**
* Create the navigation pipeline.
*/
createPipeline(): Pipeline;
createPipeline(useCanDeactivateStep?: boolean): Pipeline;

/**
* Adds a step into the pipeline at a known slot location.
Expand Down
Loading

0 comments on commit cfcc40c

Please sign in to comment.