@angular-wave/angular.ts 0.8.3 → 0.8.4
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/@types/services/sce/sce.d.ts +0 -8
- package/dist/angular-ts.esm.js +29 -24
- package/dist/angular-ts.umd.js +29 -24
- package/dist/angular-ts.umd.min.js +1 -1
- package/docs/layouts/shortcodes/version.html +1 -1
- package/docs/static/typedoc/assets/style.css +9 -2
- package/package.json +1 -1
- package/src/animations/animations.test.js +1 -1
- package/src/binding.test.js +1 -1
- package/src/core/compile/compile.spec.js +2 -2
- package/src/core/compile/compile.test.js +1 -1
- package/src/core/controller/controller.test.js +1 -1
- package/src/core/core.test.js +1 -1
- package/src/core/di/injector.test.js +1 -1
- package/src/core/di/ng-module.test.js +1 -1
- package/src/core/filter/filter.test.js +1 -1
- package/src/core/interpolate/interpolate.test.js +1 -1
- package/src/core/parse/ast/ast.test.js +1 -1
- package/src/core/parse/interpreter.js +23 -8
- package/src/core/parse/lexer/lexer.test.js +1 -1
- package/src/core/parse/parse.test.js +1 -1
- package/src/core/parse/parser/parser.test.js +1 -1
- package/src/core/sanitize/sanitize-uri.test.js +1 -1
- package/src/core/scope/scope.js +3 -9
- package/src/core/scope/scope.spec.js +2 -2
- package/src/core/scope/scope.test.js +12 -0
- package/src/directive/aria/aria.test.js +1 -1
- package/src/directive/attrs/attrs.test.js +1 -1
- package/src/directive/attrs/boolean.test.js +1 -1
- package/src/directive/attrs/element-style.test.js +1 -1
- package/src/directive/attrs/src.test.js +1 -1
- package/src/directive/bind/bind.test.js +1 -1
- package/src/directive/channel/channel.test.js +1 -1
- package/src/directive/class/class-test.html +23 -0
- package/src/directive/class/class.test.js +1 -1
- package/src/directive/cloak/cloak.test.js +1 -1
- package/src/directive/controller/controller.test.js +1 -1
- package/src/directive/events/events.test.js +1 -1
- package/src/directive/form/form.test.js +1 -1
- package/src/directive/http/http.test.js +1 -1
- package/src/directive/if/if.test.js +1 -1
- package/src/directive/include/include.test.js +1 -1
- package/src/directive/init/init.test.js +1 -1
- package/src/directive/input/input.test.js +1 -1
- package/src/directive/messages/messages.spec.js +6 -5
- package/src/directive/messages/messages.test.js +2 -2
- package/src/directive/model/model.test.js +1 -1
- package/src/directive/model-options/model-option.test.js +1 -1
- package/src/directive/non-bindable/non-bindable.test.js +1 -1
- package/src/directive/observe/observe.test.js +1 -1
- package/src/directive/on/on.test.js +1 -1
- package/src/directive/options/options.test.js +1 -1
- package/src/directive/ref/href.test.js +2 -2
- package/src/directive/repeat/repeat.spec.js +61 -61
- package/src/directive/repeat/repeat.test.js +2 -2
- package/src/directive/script/script.test.js +1 -1
- package/src/directive/select/select.test.js +1 -1
- package/src/directive/setter/setter.test.js +1 -1
- package/src/directive/show-hide/show-hide.test.js +1 -1
- package/src/directive/style/style.test.js +1 -1
- package/src/directive/switch/switch.test.js +1 -1
- package/src/directive/validators/validators.test.js +1 -1
- package/src/filters/filters.test.js +1 -1
- package/src/router/directives/state-directives.test.js +1 -1
- package/src/router/directives/view-directive.spec.js +9 -6
- package/src/router/directives/view-directive.test.js +1 -1
- package/src/router/glob/glob.test.js +1 -1
- package/src/router/router.test.js +1 -1
- package/src/router/state/state.test.js +1 -1
- package/src/router/template-factory.spec.js +1 -4
- package/src/router/template-factory.test.js +1 -1
- package/src/router/url/url.test.js +1 -1
- package/src/router/view/view.test.js +1 -1
- package/src/services/http/http.test.js +1 -1
- package/src/services/http-backend/http-backend.test.js +1 -1
- package/src/services/location/location.test.js +1 -1
- package/src/services/log/log.test.js +1 -1
- package/src/services/pubsub/pubsub.test.js +1 -1
- package/src/services/sce/sce.js +7 -6
- package/src/services/sce/sce.test.js +1 -1
- package/src/services/template-cache/template-cache.test.js +1 -1
- package/src/shared/shared.test.js +1 -1
- package/src/shared/url-utils/url-utils.test.js +1 -1
- package/src/src.test.js +1 -1
- package/src/loader.md +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
<p>Version: 0.8.
|
|
1
|
+
<p>Version: 0.8.4</p>
|
|
@@ -504,8 +504,15 @@
|
|
|
504
504
|
body {
|
|
505
505
|
background: var(--color-background);
|
|
506
506
|
font-family:
|
|
507
|
-
-apple-system,
|
|
508
|
-
|
|
507
|
+
-apple-system,
|
|
508
|
+
BlinkMacSystemFont,
|
|
509
|
+
"Segoe UI",
|
|
510
|
+
"Noto Sans",
|
|
511
|
+
Helvetica,
|
|
512
|
+
Arial,
|
|
513
|
+
sans-serif,
|
|
514
|
+
"Apple Color Emoji",
|
|
515
|
+
"Segoe UI Emoji";
|
|
509
516
|
font-size: 16px;
|
|
510
517
|
color: var(--color-text);
|
|
511
518
|
margin: 0;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@angular-wave/angular.ts",
|
|
3
3
|
"description": "A modern, optimized and type-safe version of AngularJS",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "0.8.
|
|
5
|
+
"version": "0.8.4",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/angular-ts.esm.js",
|
|
8
8
|
"module": "dist/angular-ts.esm.js",
|
package/src/binding.test.js
CHANGED
|
@@ -14397,14 +14397,14 @@ describe("$compile", () => {
|
|
|
14397
14397
|
"http://example.com/image1.jpg?x=a2x,b 1x,http://example.com/ima,ge2.jpg 2x":
|
|
14398
14398
|
"http://example.com/image1.jpg?x=a2x,b 1x,http://example.com/ima,ge2.jpg 2x",
|
|
14399
14399
|
};
|
|
14400
|
-
|
|
14400
|
+
for (const [url, ref] of Object.entries(testSet)) {
|
|
14401
14401
|
it("should sanitize all uris in srcset " + url, async () => {
|
|
14402
14402
|
element = $compile('<img srcset="{{testUrl}}"></img>')($rootScope);
|
|
14403
14403
|
$rootScope.testUrl = url;
|
|
14404
14404
|
await wait();
|
|
14405
14405
|
expect(element.getAttribute("srcset")).toEqual(ref);
|
|
14406
14406
|
});
|
|
14407
|
-
}
|
|
14407
|
+
}
|
|
14408
14408
|
});
|
|
14409
14409
|
|
|
14410
14410
|
describe("a[href] sanitization", () => {
|
package/src/core/core.test.js
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
isDefined,
|
|
3
|
+
isFunction,
|
|
4
|
+
isObject,
|
|
5
|
+
isProxy,
|
|
6
|
+
} from "../../shared/utils.js";
|
|
2
7
|
import { ASTType } from "./ast-type.js";
|
|
3
8
|
|
|
4
9
|
export const PURITY_ABSOLUTE = 1;
|
|
@@ -140,7 +145,7 @@ export class ASTInterpreter {
|
|
|
140
145
|
? (scope, locals, assign) => {
|
|
141
146
|
const values = [];
|
|
142
147
|
for (let i = 0; i < args.length; ++i) {
|
|
143
|
-
const res = args[i](scope, locals, assign);
|
|
148
|
+
const res = args[i](scope.$target, locals, assign);
|
|
144
149
|
values.push(res);
|
|
145
150
|
}
|
|
146
151
|
const value = () => {
|
|
@@ -151,7 +156,11 @@ export class ASTInterpreter {
|
|
|
151
156
|
: value;
|
|
152
157
|
}
|
|
153
158
|
: (scope, locals, assign) => {
|
|
154
|
-
const rhs = right(
|
|
159
|
+
const rhs = right(
|
|
160
|
+
scope.$target ? scope.$target : scope,
|
|
161
|
+
locals,
|
|
162
|
+
assign,
|
|
163
|
+
);
|
|
155
164
|
let value;
|
|
156
165
|
if (rhs.value != null && isFunction(rhs.value)) {
|
|
157
166
|
const values = [];
|
|
@@ -169,7 +178,11 @@ export class ASTInterpreter {
|
|
|
169
178
|
return (scope, locals, assign) => {
|
|
170
179
|
const lhs = left(scope, locals, assign);
|
|
171
180
|
const rhs = right(scope, locals, assign);
|
|
172
|
-
lhs.context[lhs.name] = rhs;
|
|
181
|
+
// lhs.context[lhs.name] = rhs;
|
|
182
|
+
const ctx = isProxy(lhs.context)
|
|
183
|
+
? lhs.context
|
|
184
|
+
: (lhs.context.$proxy ?? lhs.context);
|
|
185
|
+
ctx[lhs.name] = rhs;
|
|
173
186
|
return context ? { value: rhs } : rhs;
|
|
174
187
|
};
|
|
175
188
|
case ASTType.ArrayExpression:
|
|
@@ -222,8 +235,10 @@ export class ASTInterpreter {
|
|
|
222
235
|
case ASTType.ThisExpression:
|
|
223
236
|
return (scope) => (context ? { value: scope } : scope);
|
|
224
237
|
case ASTType.LocalsExpression:
|
|
238
|
+
// @ts-ignore
|
|
225
239
|
return (scope, locals) => (context ? { value: locals } : locals);
|
|
226
240
|
case ASTType.NGValueParameter:
|
|
241
|
+
// @ts-ignore
|
|
227
242
|
return (scope, locals, assign) =>
|
|
228
243
|
context ? { value: assign } : assign;
|
|
229
244
|
}
|
|
@@ -494,9 +509,9 @@ export class ASTInterpreter {
|
|
|
494
509
|
*/
|
|
495
510
|
"ternary?:"(test, alternate, consequent, context) {
|
|
496
511
|
return (scope, locals, assign) => {
|
|
497
|
-
const arg = test(scope, locals, assign)
|
|
498
|
-
? alternate(scope, locals, assign)
|
|
499
|
-
: consequent(scope, locals, assign);
|
|
512
|
+
const arg = test(scope.$target, locals, assign)
|
|
513
|
+
? alternate(scope.$target, locals, assign)
|
|
514
|
+
: consequent(scope.$target, locals, assign);
|
|
500
515
|
return context ? { value: arg } : arg;
|
|
501
516
|
};
|
|
502
517
|
}
|
|
@@ -527,7 +542,7 @@ export class ASTInterpreter {
|
|
|
527
542
|
}
|
|
528
543
|
let value = undefined;
|
|
529
544
|
if (base) {
|
|
530
|
-
value = base[name];
|
|
545
|
+
value = base["$target"] ? base["$target"][name] : base[name];
|
|
531
546
|
}
|
|
532
547
|
if (context) {
|
|
533
548
|
return { context: base, name, value };
|
package/src/core/scope/scope.js
CHANGED
|
@@ -791,12 +791,6 @@ export class Scope {
|
|
|
791
791
|
|
|
792
792
|
// 14
|
|
793
793
|
case ASTType.ObjectExpression: {
|
|
794
|
-
// get.decoratedNode.body[0].expression.expression.forEach(x => {
|
|
795
|
-
// x.toWatch[0].name
|
|
796
|
-
// });
|
|
797
|
-
|
|
798
|
-
// key = get.decoratedNode.body[0].expression.properties[0].key.name;
|
|
799
|
-
// listener.property.push(key);
|
|
800
794
|
get.decoratedNode.body[0].expression.properties.forEach((prop) => {
|
|
801
795
|
if (prop.key.isPure === false) {
|
|
802
796
|
keySet.push(prop.key.name);
|
|
@@ -806,7 +800,8 @@ export class Scope {
|
|
|
806
800
|
keySet.push(prop.value.name);
|
|
807
801
|
listener.property.push(key);
|
|
808
802
|
} else {
|
|
809
|
-
key =
|
|
803
|
+
key =
|
|
804
|
+
get.decoratedNode.body[0].expression.toWatch[0].property.name;
|
|
810
805
|
listener.property.push(key);
|
|
811
806
|
}
|
|
812
807
|
}
|
|
@@ -957,8 +952,7 @@ export class Scope {
|
|
|
957
952
|
|
|
958
953
|
$eval(expr, locals) {
|
|
959
954
|
const fn = $parse(expr);
|
|
960
|
-
const res = fn(this
|
|
961
|
-
|
|
955
|
+
const res = fn(this, locals);
|
|
962
956
|
if (isUndefined(res) || res === null) {
|
|
963
957
|
return res;
|
|
964
958
|
}
|
|
@@ -795,7 +795,7 @@ describe("Scope", () => {
|
|
|
795
795
|
{ expression: "false && 2", expected: false },
|
|
796
796
|
];
|
|
797
797
|
|
|
798
|
-
|
|
798
|
+
for (const { expression, expected } of cases) {
|
|
799
799
|
it("passes constants to listener cb " + expression, async () => {
|
|
800
800
|
let res;
|
|
801
801
|
scope.$watch(expression, (val) => {
|
|
@@ -805,7 +805,7 @@ describe("Scope", () => {
|
|
|
805
805
|
await wait();
|
|
806
806
|
expect(res).toEqual(expected);
|
|
807
807
|
});
|
|
808
|
-
}
|
|
808
|
+
}
|
|
809
809
|
});
|
|
810
810
|
|
|
811
811
|
describe("expressions", () => {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { test, expect } from "@playwright/test";
|
|
2
|
+
|
|
3
|
+
const TEST_URL = "src/core/scope/scope.html?random=false";
|
|
4
|
+
|
|
5
|
+
test("unit tests contain no errors", async ({ page }) => {
|
|
6
|
+
await page.goto(TEST_URL);
|
|
7
|
+
await page.content();
|
|
8
|
+
await page.waitForTimeout(1000);
|
|
9
|
+
await expect(page.locator(".jasmine-overall-result")).toHaveText(
|
|
10
|
+
/ 0 failures/,
|
|
11
|
+
);
|
|
12
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title>AngularTS</title>
|
|
6
|
+
<link rel="shortcut icon" type="image/png" href="images/favicon.ico" />
|
|
7
|
+
<script type="module" src="/src/index.js"></script>
|
|
8
|
+
</head>
|
|
9
|
+
<body ng-app ng-init="test = {deleted: false}">
|
|
10
|
+
<style>
|
|
11
|
+
.red {
|
|
12
|
+
background-color: red;
|
|
13
|
+
}
|
|
14
|
+
</style>
|
|
15
|
+
|
|
16
|
+
{{ test.deleted }}
|
|
17
|
+
<p ng-class="{red: test.deleted}">Map Syntax Example</p>
|
|
18
|
+
<label>
|
|
19
|
+
<input type="checkbox" ng-model="test.deleted" />deleted (apply "strike"
|
|
20
|
+
class)
|
|
21
|
+
</label>
|
|
22
|
+
</body>
|
|
23
|
+
</html>
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import { Angular } from "../../angular.js";
|
|
2
2
|
import { wait } from "../../shared/test-utils.js";
|
|
3
3
|
import { isString } from "../../shared/utils.js";
|
|
4
|
-
import { getController } from "../../shared/dom.js";
|
|
4
|
+
import { dealoc, getController } from "../../shared/dom.js";
|
|
5
5
|
|
|
6
6
|
describe("ngMessages", () => {
|
|
7
|
-
let $rootScope, $compile, $templateCache;
|
|
7
|
+
let $rootScope, $compile, $templateCache, el;
|
|
8
8
|
|
|
9
9
|
beforeEach(() => {
|
|
10
|
+
el = document.getElementById("app");
|
|
11
|
+
dealoc(el);
|
|
10
12
|
window.angular = new Angular();
|
|
11
|
-
window.angular.module("app", [
|
|
13
|
+
window.angular.module("app", []).directive("messageWrap", () => ({
|
|
12
14
|
transclude: true,
|
|
13
15
|
scope: {
|
|
14
16
|
col: "=col",
|
|
15
17
|
},
|
|
16
18
|
template: '<div ng-messages="col"><ng-transclude></ng-transclude></div>',
|
|
17
19
|
}));
|
|
18
|
-
|
|
19
20
|
window.angular
|
|
20
|
-
.bootstrap(
|
|
21
|
+
.bootstrap(el, ["app"])
|
|
21
22
|
.invoke((_$rootScope_, _$compile_, _$templateCache_) => {
|
|
22
23
|
$rootScope = _$rootScope_;
|
|
23
24
|
$compile = _$compile_;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { test, expect } from "@playwright/test";
|
|
2
2
|
|
|
3
|
-
const TEST_URL = "src/directive/messages/messages.html";
|
|
3
|
+
const TEST_URL = "src/directive/messages/messages.html?random=false";
|
|
4
4
|
|
|
5
5
|
test("unit tests contain no errors", async ({ page }) => {
|
|
6
6
|
await page.goto(TEST_URL);
|
|
7
7
|
await page.content();
|
|
8
8
|
await page.waitForTimeout(1000);
|
|
9
9
|
await expect(page.locator(".jasmine-overall-result")).toHaveText(
|
|
10
|
-
/0 failures/,
|
|
10
|
+
/ 0 failures/,
|
|
11
11
|
);
|
|
12
12
|
});
|
|
@@ -5,7 +5,7 @@ test("unit href tests contain no errors", async ({ page }) => {
|
|
|
5
5
|
await page.content();
|
|
6
6
|
await page.waitForTimeout(1000);
|
|
7
7
|
await expect(page.locator(".jasmine-overall-result")).toHaveText(
|
|
8
|
-
/0 failures/,
|
|
8
|
+
/ 0 failures/,
|
|
9
9
|
);
|
|
10
10
|
});
|
|
11
11
|
|
|
@@ -14,6 +14,6 @@ test("unit ref tests contain no errors", async ({ page }) => {
|
|
|
14
14
|
await page.content();
|
|
15
15
|
await page.waitForTimeout(1000);
|
|
16
16
|
await expect(page.locator(".jasmine-overall-result")).toHaveText(
|
|
17
|
-
/0 failures/,
|
|
17
|
+
/ 0 failures/,
|
|
18
18
|
);
|
|
19
19
|
});
|