@angular-wave/angular.ts 0.0.23 → 0.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/angular-ts.esm.js +1 -1
- package/dist/angular-ts.umd.js +1 -1
- package/package.json +1 -1
- package/src/core/compile.js +2 -3
- package/src/core/parser/parse.js +2 -3
- package/src/router/directives/{stateDirectives.js → state-directives.js} +1 -2
- package/src/router/directives/{viewDirective.js → view-directive.js} +1 -1
- package/src/router/globals.js +1 -1
- package/src/router/hooks/{ignoredTransition.js → ignored-transition.js} +1 -1
- package/src/router/hooks/{redirectTo.js → redirect-to.js} +1 -1
- package/src/router/hooks/resolve.js +1 -1
- package/src/router/index.js +6 -8
- package/src/router/params/{paramTypes.js → param-types.js} +3 -4
- package/src/router/params/param.js +1 -1
- package/src/router/path/{pathUtils.js → path-utils.js} +2 -2
- package/src/router/resolve/resolvable.js +2 -2
- package/src/router/resolve/{resolveContext.js → resolve-context.js} +1 -1
- package/src/router/router.js +8 -8
- package/src/router/services.js +3 -3
- package/src/router/state/{stateBuilder.js → state-builder.js} +2 -3
- package/src/router/state/{stateQueueManager.js → state-queue-manager.js} +2 -1
- package/src/router/state/{stateRegistry.js → state-registry.js} +3 -3
- package/src/router/state/{stateService.js → state-service.js} +7 -7
- package/src/router/state/views.js +1 -1
- package/src/router/{templateFactory.js → template-factory.js} +84 -48
- package/src/router/transition/{hookBuilder.js → hook-builder.js} +3 -3
- package/src/router/transition/{transitionEventType.js → transition-event-type.js} +1 -1
- package/src/router/transition/{transitionHook.js → transition-hook.js} +2 -2
- package/src/router/transition/{transitionService.js → transition-service.js} +10 -10
- package/src/router/transition/transition.js +7 -8
- package/src/router/url/{urlConfig.js → url-config.js} +1 -1
- package/src/router/url/{urlMatcherFactory.js → url-matcher-factory.js} +1 -1
- package/src/router/url/{urlMatcher.js → url-matcher.js} +0 -2
- package/src/router/url/{urlRouter.js → url-router.js} +1 -1
- package/src/router/url/{urlRule.js → url-rule.js} +4 -4
- package/src/router/url/{urlRules.js → url-rules.js} +3 -3
- package/src/router/url/{urlService.js → url-service.js} +6 -6
- package/src/shared/strings.js +2 -2
- package/test/router/view.spec.js +5 -5
- package/test/test-utils.js +9 -0
- package/types/router/legacy/resolveService.d.ts +1 -1
- package/types/router/statebuilders/onEnterExitRetain.d.ts +1 -1
- package/types/router/statebuilders/views.d.ts +1 -2
- /package/src/router/hooks/{coreResolvables.js → core-resolvables.js} +0 -0
- /package/src/router/hooks/{invalidTransition.js → invalid-transition.js} +0 -0
- /package/src/router/hooks/{lazyLoad.js → lazy-load.js} +0 -0
- /package/src/router/hooks/{onEnterExitRetain.js → on-enter-exit-retain.js} +0 -0
- /package/src/router/hooks/{updateGlobals.js → update-globals.js} +0 -0
- /package/src/router/{locationServices.js → location-services.js} +0 -0
- /package/src/router/params/{paramType.js → param-type.js} +0 -0
- /package/src/router/params/{stateParams.js → state-params.js} +0 -0
- /package/src/router/path/{pathNode.js → path-node.js} +0 -0
- /package/src/router/state/{stateMatcher.js → state-matcher.js} +0 -0
- /package/src/router/state/{stateObject.js → state-object.js} +0 -0
- /package/src/router/state/{targetState.js → target-state.js} +0 -0
- /package/src/router/{stateFilters.js → state-filters.js} +0 -0
- /package/src/router/{stateProvider.js → state-provider.js} +0 -0
- /package/src/router/transition/{hookRegistry.js → hook-registry.js} +0 -0
- /package/src/router/transition/{rejectFactory.js → reject-factory.js} +0 -0
- /package/src/router/{viewScroll.js → view-scroll.js} +0 -0
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { TransitionHookScope, TransitionHookPhase } from "./interface";
|
|
2
2
|
import { Transition } from "./transition";
|
|
3
|
-
import { makeEvent } from "./
|
|
3
|
+
import { makeEvent } from "./hook-registry";
|
|
4
4
|
import {
|
|
5
5
|
registerAddCoreResolvables,
|
|
6
6
|
treeChangesCleanup,
|
|
7
|
-
} from "../hooks/
|
|
8
|
-
import { registerRedirectToHook } from "../hooks/
|
|
7
|
+
} from "../hooks/core-resolvables";
|
|
8
|
+
import { registerRedirectToHook } from "../hooks/redirect-to";
|
|
9
9
|
import {
|
|
10
10
|
registerOnExitHook,
|
|
11
11
|
registerOnRetainHook,
|
|
12
12
|
registerOnEnterHook,
|
|
13
|
-
} from "../hooks/
|
|
13
|
+
} from "../hooks/on-enter-exit-retain";
|
|
14
14
|
import {
|
|
15
15
|
registerEagerResolvePath,
|
|
16
16
|
registerLazyResolveState,
|
|
@@ -20,16 +20,16 @@ import {
|
|
|
20
20
|
registerLoadEnteringViews,
|
|
21
21
|
registerActivateViews,
|
|
22
22
|
} from "../hooks/views";
|
|
23
|
-
import { registerUpdateGlobalState } from "../hooks/
|
|
23
|
+
import { registerUpdateGlobalState } from "../hooks/update-globals";
|
|
24
24
|
import { registerUpdateUrl } from "../hooks/url";
|
|
25
|
-
import { registerLazyLoadHook } from "../hooks/
|
|
26
|
-
import { TransitionEventType } from "./
|
|
27
|
-
import { TransitionHook } from "./
|
|
25
|
+
import { registerLazyLoadHook } from "../hooks/lazy-load";
|
|
26
|
+
import { TransitionEventType } from "./transition-event-type";
|
|
27
|
+
import { TransitionHook } from "./transition-hook";
|
|
28
28
|
import { isDefined } from "../../shared/utils";
|
|
29
29
|
import { removeFrom, createProxyFunctions } from "../../shared/common";
|
|
30
30
|
import { val } from "../../shared/hof";
|
|
31
|
-
import { registerIgnoredTransitionHook } from "../hooks/
|
|
32
|
-
import { registerInvalidTransitionHook } from "../hooks/
|
|
31
|
+
import { registerIgnoredTransitionHook } from "../hooks/ignored-transition";
|
|
32
|
+
import { registerInvalidTransitionHook } from "../hooks/invalid-transition";
|
|
33
33
|
/**
|
|
34
34
|
* The default [[Transition]] options.
|
|
35
35
|
*
|
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
omit,
|
|
10
10
|
arrayTuples,
|
|
11
11
|
unnestR,
|
|
12
|
-
identity,
|
|
13
12
|
anyTrueR,
|
|
14
13
|
flattenR,
|
|
15
14
|
uniqR,
|
|
@@ -17,14 +16,14 @@ import {
|
|
|
17
16
|
import { isUndefined, isObject } from "../../shared/utils";
|
|
18
17
|
import { prop, propEq, val, not, is } from "../../shared/hof";
|
|
19
18
|
import { TransitionHookPhase } from "./interface"; // has or is using
|
|
20
|
-
import { TransitionHook } from "./
|
|
21
|
-
import { matchState, makeEvent } from "./
|
|
22
|
-
import { HookBuilder } from "./
|
|
23
|
-
import { PathUtils } from "../path/
|
|
19
|
+
import { TransitionHook } from "./transition-hook";
|
|
20
|
+
import { matchState, makeEvent } from "./hook-registry";
|
|
21
|
+
import { HookBuilder } from "./hook-builder";
|
|
22
|
+
import { PathUtils } from "../path/path-utils";
|
|
24
23
|
import { Param } from "../params/param";
|
|
25
24
|
import { Resolvable } from "../resolve/resolvable";
|
|
26
|
-
import { ResolveContext } from "../resolve/
|
|
27
|
-
import { Rejection } from "./
|
|
25
|
+
import { ResolveContext } from "../resolve/resolve-context";
|
|
26
|
+
import { Rejection } from "./reject-factory";
|
|
28
27
|
|
|
29
28
|
const stateSelf = prop("self");
|
|
30
29
|
/**
|
|
@@ -466,7 +465,7 @@ export class Transition {
|
|
|
466
465
|
views(pathname = "entering", state) {
|
|
467
466
|
let path = this._treeChanges[pathname];
|
|
468
467
|
path = !state ? path : path.filter(propEq("state", state));
|
|
469
|
-
return path.map(prop("views")).
|
|
468
|
+
return path.map(prop("views")).reduce(unnestR, []);
|
|
470
469
|
}
|
|
471
470
|
treeChanges(pathname) {
|
|
472
471
|
return pathname ? this._treeChanges[pathname] : this._treeChanges;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
map,
|
|
3
3
|
inherit,
|
|
4
|
-
identity,
|
|
5
4
|
unnest,
|
|
6
5
|
tail,
|
|
7
6
|
find,
|
|
@@ -530,7 +529,6 @@ export class UrlMatcher {
|
|
|
530
529
|
if (!param.raw) encoded = map(encoded, encodeURIComponent);
|
|
531
530
|
return encoded.map((val) => `${param.id}=${val}`);
|
|
532
531
|
})
|
|
533
|
-
.filter(identity)
|
|
534
532
|
.reduce(unnestR, [])
|
|
535
533
|
.join("&");
|
|
536
534
|
// Concat the pathstring with the queryString (if exists) and the hashString (if exists)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { stripLastPathElement } from "../../shared/strings";
|
|
2
|
-
import { UrlRuleFactory } from "./
|
|
2
|
+
import { UrlRuleFactory } from "./url-rule";
|
|
3
3
|
function appendBasePath(url, isHtml5, absolute, baseHref) {
|
|
4
4
|
if (baseHref === "/") return url;
|
|
5
5
|
if (isHtml5) return stripLastPathElement(baseHref) + url;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { UrlMatcher } from "./
|
|
1
|
+
import { UrlMatcher } from "./url-matcher";
|
|
2
2
|
import { isString, isFunction, isDefined } from "../../shared/utils";
|
|
3
|
-
import { identity } from "../../shared/common";
|
|
4
3
|
import { is, or, pattern } from "../../shared/hof";
|
|
5
|
-
import { StateObject } from "../state/
|
|
4
|
+
import { StateObject } from "../state/state-object";
|
|
6
5
|
/**
|
|
7
6
|
* Creates a [[UrlRule]]
|
|
8
7
|
*
|
|
@@ -17,6 +16,7 @@ export class UrlRuleFactory {
|
|
|
17
16
|
constructor(router) {
|
|
18
17
|
this.router = router;
|
|
19
18
|
}
|
|
19
|
+
|
|
20
20
|
compile(str) {
|
|
21
21
|
return this.router.urlMatcherFactory.compile(str);
|
|
22
22
|
}
|
|
@@ -208,6 +208,6 @@ export class BaseUrlRule {
|
|
|
208
208
|
this.type = "RAW";
|
|
209
209
|
this.$id = -1;
|
|
210
210
|
this.matchPriority = () => 0 - this.$id;
|
|
211
|
-
this.handler = handler ||
|
|
211
|
+
this.handler = handler || ((x) => x);
|
|
212
212
|
}
|
|
213
213
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { TargetState } from "../state/
|
|
2
|
-
import { UrlMatcher } from "./
|
|
1
|
+
import { TargetState } from "../state/target-state";
|
|
2
|
+
import { UrlMatcher } from "./url-matcher";
|
|
3
3
|
import { is, val } from "../../shared/hof";
|
|
4
4
|
import { isDefined, isFunction, isString } from "../../shared/utils";
|
|
5
5
|
import { removeFrom } from "../../shared/common";
|
|
6
|
-
import { UrlRuleFactory } from "./
|
|
6
|
+
import { UrlRuleFactory } from "./url-rule";
|
|
7
7
|
const prioritySort = (a, b) => (b.priority || 0) - (a.priority || 0);
|
|
8
8
|
const typeSort = (a, b) => {
|
|
9
9
|
const weights = { STATE: 4, URLMATCHER: 4, REGEXP: 3, RAW: 2, OTHER: 1 };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { isString } from "../../shared/utils";
|
|
2
2
|
import { is, pattern } from "../../shared/hof";
|
|
3
|
-
import { UrlRules } from "./
|
|
4
|
-
import { UrlConfig } from "./
|
|
5
|
-
import { TargetState } from "../state/
|
|
3
|
+
import { UrlRules } from "./url-rules";
|
|
4
|
+
import { UrlConfig } from "./url-config";
|
|
5
|
+
import { TargetState } from "../state/target-state";
|
|
6
6
|
/**
|
|
7
7
|
* API for URL management
|
|
8
8
|
*/
|
|
@@ -74,11 +74,11 @@ export class UrlService {
|
|
|
74
74
|
* locationServices.url("/some/path?query=value#anchor", true);
|
|
75
75
|
* ```
|
|
76
76
|
*
|
|
77
|
-
* @param newurl The new value for the URL.
|
|
77
|
+
* @param {string} newurl The new value for the URL.
|
|
78
78
|
* This url should reflect only the new internal [[path]], [[search]], and [[hash]] values.
|
|
79
79
|
* It should not include the protocol, site, port, or base path of an absolute HREF.
|
|
80
|
-
* @param replace When true, replaces the current history entry (instead of appending it) with this new url
|
|
81
|
-
* @param state The history's state object, i.e., pushState (if the LocationServices implementation supports it)
|
|
80
|
+
* @param {boolean} replace When true, replaces the current history entry (instead of appending it) with this new url
|
|
81
|
+
* @param {any} state The history's state object, i.e., pushState (if the LocationServices implementation supports it)
|
|
82
82
|
*
|
|
83
83
|
* @return the url (after potentially being processed)
|
|
84
84
|
*/
|
package/src/shared/strings.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { isInjectable, isNull, isPromise } from "./predicates";
|
|
9
9
|
import { isUndefined, isFunction, isString, isObject } from "./utils";
|
|
10
|
-
import { Rejection } from "../router/transition/
|
|
10
|
+
import { Rejection } from "../router/transition/reject-factory";
|
|
11
11
|
import { identity, pushR, tail } from "./common";
|
|
12
12
|
import { pattern, val } from "./hof";
|
|
13
13
|
/**
|
|
@@ -112,7 +112,7 @@ export const trimHashVal = (str) => (str ? str.replace(/^#/, "") : "");
|
|
|
112
112
|
*/
|
|
113
113
|
export function splitOnDelim(delim) {
|
|
114
114
|
const re = new RegExp("(" + delim + ")", "g");
|
|
115
|
-
return (str) => str.split(re).filter(
|
|
115
|
+
return (str) => str.split(re).filter(Boolean);
|
|
116
116
|
}
|
|
117
117
|
/**
|
|
118
118
|
* Reduce fn that joins neighboring strings
|
package/test/router/view.spec.js
CHANGED
|
@@ -2,16 +2,16 @@ import { dealoc } from "../../src/jqLite";
|
|
|
2
2
|
import { Angular } from "../../src/loader";
|
|
3
3
|
import { publishExternalAPI } from "../../src/public";
|
|
4
4
|
import { curry } from "../../src/shared/hof";
|
|
5
|
-
import { StateMatcher } from "../../src/router/state/
|
|
6
|
-
import { StateBuilder } from "../../src/router/state/
|
|
7
|
-
import { StateObject } from "../../src/router/state/
|
|
5
|
+
import { StateMatcher } from "../../src/router/state/state-matcher";
|
|
6
|
+
import { StateBuilder } from "../../src/router/state/state-builder";
|
|
7
|
+
import { StateObject } from "../../src/router/state/state-object";
|
|
8
8
|
import { ViewService } from "../../src/router/view/view";
|
|
9
9
|
import {
|
|
10
10
|
ng1ViewsBuilder,
|
|
11
11
|
getNg1ViewConfigFactory,
|
|
12
12
|
} from "../../src/router/state/views";
|
|
13
|
-
import { PathNode } from "../../src/router/path/
|
|
14
|
-
import { PathUtils } from "../../src/router/path/
|
|
13
|
+
import { PathNode } from "../../src/router/path/path-node";
|
|
14
|
+
import { PathUtils } from "../../src/router/path/path-utils";
|
|
15
15
|
import { tail } from "../../src/shared/common";
|
|
16
16
|
import { wait } from "../test-utils";
|
|
17
17
|
|
package/test/test-utils.js
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
import { jqLite } from "../src/jqLite";
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @param {HTMLElement} element
|
|
5
|
+
* @param {string} event
|
|
6
|
+
*/
|
|
3
7
|
export function browserTrigger(element, event) {
|
|
4
8
|
jqLite(element)[0].dispatchEvent(
|
|
5
9
|
new Event(event, { bubbles: true, cancelable: true }),
|
|
6
10
|
);
|
|
7
11
|
}
|
|
8
12
|
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @param {number} t milliseconds to wait
|
|
16
|
+
* @returns
|
|
17
|
+
*/
|
|
9
18
|
export function wait(t) {
|
|
10
19
|
return new Promise((resolve, _) => setTimeout(resolve, t));
|
|
11
20
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @publicapi @module ng1 */ /** */
|
|
2
|
-
import { StateObject, TransitionStateHookFn } from "
|
|
2
|
+
import { StateObject, TransitionStateHookFn } from "../core";
|
|
3
3
|
/**
|
|
4
4
|
* This is a [[StateBuilder.builder]] function for angular1 `onEnter`, `onExit`,
|
|
5
5
|
* `onRetain` callback hooks on a [[Ng1StateDeclaration]].
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/** @publicapi @module ng1 */ /** */
|
|
2
1
|
import {
|
|
3
2
|
StateObject,
|
|
4
3
|
ViewConfig,
|
|
@@ -6,7 +5,7 @@ import {
|
|
|
6
5
|
PathNode,
|
|
7
6
|
ResolveContext,
|
|
8
7
|
IInjectable,
|
|
9
|
-
} from "
|
|
8
|
+
} from "../core";
|
|
10
9
|
import { Ng1ViewDeclaration } from "../interface";
|
|
11
10
|
import { TemplateFactory } from "../templateFactory";
|
|
12
11
|
/** @internalapi */
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|