@angular-wave/angular.ts 0.0.50 → 0.0.52

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.
Files changed (59) hide show
  1. package/README.md +3 -1
  2. package/dist/angular-ts.esm.js +2 -2
  3. package/dist/angular-ts.umd.js +2 -2
  4. package/package.json +1 -1
  5. package/src/animations/animate-children-directive.js +19 -99
  6. package/src/animations/animate-children-directive.md +80 -0
  7. package/src/animations/animate-css-driver.js +250 -256
  8. package/src/animations/animate-css.js +646 -875
  9. package/src/animations/animate-css.md +263 -0
  10. package/src/animations/animate-js-driver.js +54 -56
  11. package/src/animations/animate-js.js +303 -306
  12. package/src/animations/animate-queue.js +707 -716
  13. package/src/animations/animate-swap.js +30 -119
  14. package/src/animations/animate-swap.md +88 -0
  15. package/src/animations/animation.js +3 -3
  16. package/src/animations/shared.js +2 -1
  17. package/src/core/animate/animate-runner.js +147 -145
  18. package/src/core/animate/animate.js +568 -582
  19. package/src/core/animate/anomate.md +13 -0
  20. package/src/core/compile/compile.spec.js +5 -6
  21. package/src/core/core.html +0 -1
  22. package/src/core/parser/ast-type.js +21 -20
  23. package/src/core/parser/ast.js +34 -35
  24. package/src/core/parser/interpreter.js +405 -136
  25. package/src/core/parser/lexer.js +14 -13
  26. package/src/core/parser/parse.js +31 -45
  27. package/src/core/parser/parse.spec.js +429 -444
  28. package/src/core/parser/parser.js +17 -9
  29. package/src/directive/select/select.js +301 -305
  30. package/src/loader.js +5 -1
  31. package/src/public.js +0 -1
  32. package/src/router/directives/state-directives.js +256 -574
  33. package/src/router/directives/state-directives.md +435 -0
  34. package/src/router/directives/view-directive.js +3 -3
  35. package/src/router/index.js +7 -7
  36. package/src/types.js +0 -13
  37. package/types/animations/animate-children-directive.d.ts +5 -80
  38. package/types/animations/animate-css-driver.d.ts +11 -0
  39. package/types/animations/animate-css.d.ts +8 -0
  40. package/types/animations/animate-js-driver.d.ts +8 -0
  41. package/types/animations/animate-js.d.ts +12 -0
  42. package/types/animations/animate-queue.d.ts +19 -0
  43. package/types/animations/animate-swap.d.ts +5 -89
  44. package/types/animations/shared.d.ts +1 -1
  45. package/types/core/animate/animate-runner.d.ts +32 -0
  46. package/types/core/animate/animate.d.ts +509 -0
  47. package/types/core/parser/ast-type.d.ts +24 -20
  48. package/types/core/parser/ast.d.ts +13 -14
  49. package/types/core/parser/interpreter.d.ts +24 -19
  50. package/types/core/parser/lexer.d.ts +6 -2
  51. package/types/core/parser/parse.d.ts +44 -38
  52. package/types/core/parser/parser.d.ts +2 -10
  53. package/types/directive/select/select.d.ts +79 -0
  54. package/types/loader.d.ts +397 -0
  55. package/types/router/directives/state-directives.d.ts +31 -0
  56. package/types/types.d.ts +0 -1
  57. package/src/core/document.spec.js +0 -52
  58. package/src/core/parser/shared.js +0 -234
  59. package/types/core/parser/shared.d.ts +0 -35
@@ -1,5 +1,5 @@
1
1
  import { AST } from "./ast";
2
- import { isLiteral, isConstant } from "./shared";
2
+ import { ASTType } from "./ast-type";
3
3
  import { ASTInterpreter } from "./interpreter";
4
4
 
5
5
  /**
@@ -8,11 +8,6 @@ import { ASTInterpreter } from "./interpreter";
8
8
  * @property {boolean} oneTime - True if expression should be evaluated only once
9
9
  */
10
10
 
11
- /**
12
- * @typedef {Object} ParserOptions
13
- * @property {function(string):any} literals
14
- */
15
-
16
11
  /**
17
12
  * @constructor
18
13
  */
@@ -21,11 +16,10 @@ export class Parser {
21
16
  *
22
17
  * @param {import('./lexer').Lexer} lexer
23
18
  * @param {function(any):any} $filter
24
- * @param {ParserOptions} options
25
19
  */
26
- constructor(lexer, $filter, options) {
20
+ constructor(lexer, $filter) {
27
21
  /** @type {AST} */
28
- this.ast = new AST(lexer, options);
22
+ this.ast = new AST(lexer);
29
23
 
30
24
  /** @type {ASTInterpreter} */
31
25
  this.astCompiler = new ASTInterpreter($filter);
@@ -63,3 +57,17 @@ export class Parser {
63
57
  };
64
58
  }
65
59
  }
60
+
61
+ function isLiteral(ast) {
62
+ return (
63
+ ast.body.length === 0 ||
64
+ (ast.body.length === 1 &&
65
+ (ast.body[0].expression.type === ASTType.Literal ||
66
+ ast.body[0].expression.type === ASTType.ArrayExpression ||
67
+ ast.body[0].expression.type === ASTType.ObjectExpression))
68
+ );
69
+ }
70
+
71
+ function isConstant(ast) {
72
+ return ast.constant;
73
+ }