@angular-wave/angular.ts 0.8.3 → 0.9.0

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 (85) hide show
  1. package/@types/services/sce/sce.d.ts +0 -8
  2. package/dist/angular-ts.esm.js +33 -23
  3. package/dist/angular-ts.umd.js +33 -23
  4. package/dist/angular-ts.umd.min.js +1 -1
  5. package/docs/layouts/shortcodes/version.html +1 -1
  6. package/package.json +1 -1
  7. package/src/animations/animations.test.js +1 -1
  8. package/src/binding.test.js +1 -1
  9. package/src/core/compile/compile.spec.js +2 -2
  10. package/src/core/compile/compile.test.js +1 -1
  11. package/src/core/controller/controller.test.js +1 -1
  12. package/src/core/core.test.js +1 -1
  13. package/src/core/di/injector.test.js +1 -1
  14. package/src/core/di/ng-module.test.js +1 -1
  15. package/src/core/filter/filter.test.js +1 -1
  16. package/src/core/interpolate/interpolate.test.js +1 -1
  17. package/src/core/parse/ast/ast.test.js +1 -1
  18. package/src/core/parse/interpreter.js +27 -7
  19. package/src/core/parse/lexer/lexer.test.js +1 -1
  20. package/src/core/parse/parse.spec.js +6 -8
  21. package/src/core/parse/parse.test.js +1 -1
  22. package/src/core/parse/parser/parser.test.js +1 -1
  23. package/src/core/sanitize/sanitize-uri.test.js +1 -1
  24. package/src/core/scope/scope.js +3 -9
  25. package/src/core/scope/scope.spec.js +6 -6
  26. package/src/core/scope/scope.test.js +12 -0
  27. package/src/directive/aria/aria.test.js +1 -1
  28. package/src/directive/attrs/attrs.test.js +1 -1
  29. package/src/directive/attrs/boolean.test.js +1 -1
  30. package/src/directive/attrs/element-style.test.js +1 -1
  31. package/src/directive/attrs/src.test.js +1 -1
  32. package/src/directive/bind/bind.test.js +1 -1
  33. package/src/directive/channel/channel.test.js +1 -1
  34. package/src/directive/class/class-test.html +23 -0
  35. package/src/directive/class/class.test.js +1 -1
  36. package/src/directive/cloak/cloak.test.js +1 -1
  37. package/src/directive/controller/controller.test.js +1 -1
  38. package/src/directive/events/events.test.js +1 -1
  39. package/src/directive/form/form.test.js +1 -1
  40. package/src/directive/http/http.test.js +1 -1
  41. package/src/directive/if/if.test.js +1 -1
  42. package/src/directive/include/include.test.js +1 -1
  43. package/src/directive/init/init.test.js +1 -1
  44. package/src/directive/input/input.test.js +1 -1
  45. package/src/directive/messages/messages.spec.js +6 -5
  46. package/src/directive/messages/messages.test.js +2 -2
  47. package/src/directive/model/model.test.js +1 -1
  48. package/src/directive/model-options/model-option.test.js +1 -1
  49. package/src/directive/non-bindable/non-bindable.test.js +1 -1
  50. package/src/directive/observe/observe.test.js +1 -1
  51. package/src/directive/on/on.test.js +1 -1
  52. package/src/directive/options/options.test.js +1 -1
  53. package/src/directive/ref/href.test.js +2 -2
  54. package/src/directive/repeat/repeat.spec.js +61 -61
  55. package/src/directive/repeat/repeat.test.js +2 -2
  56. package/src/directive/script/script.test.js +1 -1
  57. package/src/directive/select/select.test.js +1 -1
  58. package/src/directive/setter/setter.test.js +1 -1
  59. package/src/directive/show-hide/show-hide.test.js +1 -1
  60. package/src/directive/style/style.test.js +1 -1
  61. package/src/directive/switch/switch.test.js +1 -1
  62. package/src/directive/validators/validators.test.js +1 -1
  63. package/src/filters/filters.test.js +1 -1
  64. package/src/router/directives/state-directives.test.js +1 -1
  65. package/src/router/directives/view-directive.spec.js +9 -5
  66. package/src/router/directives/view-directive.test.js +1 -1
  67. package/src/router/glob/glob.test.js +1 -1
  68. package/src/router/router.test.js +1 -1
  69. package/src/router/state/state.test.js +1 -1
  70. package/src/router/template-factory.spec.js +1 -4
  71. package/src/router/template-factory.test.js +1 -1
  72. package/src/router/url/url.test.js +1 -1
  73. package/src/router/view/view.test.js +1 -1
  74. package/src/services/http/http.test.js +1 -1
  75. package/src/services/http-backend/http-backend.test.js +1 -1
  76. package/src/services/location/location.test.js +1 -1
  77. package/src/services/log/log.test.js +1 -1
  78. package/src/services/pubsub/pubsub.test.js +1 -1
  79. package/src/services/sce/sce.js +7 -6
  80. package/src/services/sce/sce.test.js +1 -1
  81. package/src/services/template-cache/template-cache.test.js +1 -1
  82. package/src/shared/shared.test.js +1 -1
  83. package/src/shared/url-utils/url-utils.test.js +1 -1
  84. package/src/src.test.js +1 -1
  85. package/src/loader.md +0 -0
@@ -177,14 +177,6 @@ export namespace SCE_CONTEXTS {
177
177
  * of issues, like for instance attacker-controlled `ng-includes`.
178
178
  */
179
179
  export class SceDelegateProvider {
180
- SCE_CONTEXTS: {
181
- HTML: string;
182
- CSS: string;
183
- MEDIA_URL: string;
184
- URL: string;
185
- RESOURCE_URL: string;
186
- JS: string;
187
- };
188
180
  /**
189
181
  *
190
182
  * @param {Array=} trustedResourceUrlList When provided, replaces the trustedResourceUrlList with
@@ -1,4 +1,4 @@
1
- /* Version: 0.8.3 - August 22, 2025 14:53:17 */
1
+ /* Version: 0.9.0 - September 12, 2025 22:41:28 */
2
2
  const VALID_CLASS = "ng-valid";
3
3
  const INVALID_CLASS = "ng-invalid";
4
4
  const PRISTINE_CLASS = "ng-pristine";
@@ -3396,8 +3396,6 @@ function adjustMatcher(matcher) {
3396
3396
  */
3397
3397
  class SceDelegateProvider {
3398
3398
  constructor() {
3399
- this.SCE_CONTEXTS = SCE_CONTEXTS;
3400
-
3401
3399
  // Resource URLs can also be trusted by policy.
3402
3400
  let trustedResourceUrlList = ["self"];
3403
3401
  let bannedResourceUrlList = [];
@@ -3696,11 +3694,14 @@ class SceDelegateProvider {
3696
3694
  if (isResourceUrlAllowedByPolicy(maybeTrusted)) {
3697
3695
  return maybeTrusted;
3698
3696
  }
3699
- throw $sceMinErr(
3700
- "insecurl",
3701
- "Blocked loading resource from url not allowed by $sceDelegate policy. URL: {0}",
3702
- maybeTrusted.toString(),
3697
+ $exceptionHandler(
3698
+ $sceMinErr(
3699
+ "insecurl",
3700
+ "Blocked loading resource from url not allowed by $sceDelegate policy. URL: {0}",
3701
+ maybeTrusted.toString(),
3702
+ ),
3703
3703
  );
3704
+ return;
3704
3705
  } else if (type === SCE_CONTEXTS.HTML) {
3705
3706
  // htmlSanitizer throws its own error when no sanitizer is available.
3706
3707
  return htmlSanitizer();
@@ -15452,7 +15453,11 @@ class ASTInterpreter {
15452
15453
  ? (scope, locals, assign) => {
15453
15454
  const values = [];
15454
15455
  for (let i = 0; i < args.length; ++i) {
15455
- const res = args[i](scope, locals, assign);
15456
+ const res = args[i](
15457
+ scope && scope.$target ? scope.$target : scope,
15458
+ locals,
15459
+ assign,
15460
+ );
15456
15461
  values.push(res);
15457
15462
  }
15458
15463
  const value = () => {
@@ -15463,7 +15468,11 @@ class ASTInterpreter {
15463
15468
  : value;
15464
15469
  }
15465
15470
  : (scope, locals, assign) => {
15466
- const rhs = right(scope, locals, assign);
15471
+ const rhs = right(
15472
+ scope.$target ? scope.$target : scope,
15473
+ locals,
15474
+ assign,
15475
+ );
15467
15476
  let value;
15468
15477
  if (rhs.value != null && isFunction(rhs.value)) {
15469
15478
  const values = [];
@@ -15481,7 +15490,11 @@ class ASTInterpreter {
15481
15490
  return (scope, locals, assign) => {
15482
15491
  const lhs = left(scope, locals, assign);
15483
15492
  const rhs = right(scope, locals, assign);
15484
- lhs.context[lhs.name] = rhs;
15493
+ // lhs.context[lhs.name] = rhs;
15494
+ const ctx = isProxy(lhs.context)
15495
+ ? lhs.context
15496
+ : (lhs.context.$proxy ?? lhs.context);
15497
+ ctx[lhs.name] = rhs;
15485
15498
  return context ? { value: rhs } : rhs;
15486
15499
  };
15487
15500
  case ASTType.ArrayExpression:
@@ -15532,10 +15545,12 @@ class ASTInterpreter {
15532
15545
  return context ? { value } : value;
15533
15546
  };
15534
15547
  case ASTType.ThisExpression:
15535
- return (scope) => (context ? { value: scope } : scope);
15548
+ return (scope) => (context ? { value: scope } : scope.$proxy);
15536
15549
  case ASTType.LocalsExpression:
15550
+ // @ts-ignore
15537
15551
  return (scope, locals) => (context ? { value: locals } : locals);
15538
15552
  case ASTType.NGValueParameter:
15553
+ // @ts-ignore
15539
15554
  return (scope, locals, assign) =>
15540
15555
  context ? { value: assign } : assign;
15541
15556
  }
@@ -15833,13 +15848,14 @@ class ASTInterpreter {
15833
15848
  */
15834
15849
  identifier(name, context, create) {
15835
15850
  return (scope, locals) => {
15836
- const base = locals && name in locals ? locals : scope;
15851
+ const base =
15852
+ locals && name in locals ? locals : ((scope && scope.$proxy) ?? scope);
15837
15853
  if (create && create !== 1 && base && base[name] == null) {
15838
15854
  base[name] = {};
15839
15855
  }
15840
15856
  let value = undefined;
15841
15857
  if (base) {
15842
- value = base[name];
15858
+ value = base["$target"] ? base["$target"][name] : base[name];
15843
15859
  }
15844
15860
  if (context) {
15845
15861
  return { context: base, name, value };
@@ -20840,12 +20856,6 @@ class Scope {
20840
20856
 
20841
20857
  // 14
20842
20858
  case ASTType.ObjectExpression: {
20843
- // get.decoratedNode.body[0].expression.expression.forEach(x => {
20844
- // x.toWatch[0].name
20845
- // });
20846
-
20847
- // key = get.decoratedNode.body[0].expression.properties[0].key.name;
20848
- // listener.property.push(key);
20849
20859
  get.decoratedNode.body[0].expression.properties.forEach((prop) => {
20850
20860
  if (prop.key.isPure === false) {
20851
20861
  keySet.push(prop.key.name);
@@ -20855,7 +20865,8 @@ class Scope {
20855
20865
  keySet.push(prop.value.name);
20856
20866
  listener.property.push(key);
20857
20867
  } else {
20858
- key = get.decoratedNode.body[0].expression.properties[0].key.name;
20868
+ const target = get.decoratedNode.body[0].expression.toWatch[0];
20869
+ key = target.property ? target.property.name : target.name;
20859
20870
  listener.property.push(key);
20860
20871
  }
20861
20872
  }
@@ -21006,8 +21017,7 @@ class Scope {
21006
21017
 
21007
21018
  $eval(expr, locals) {
21008
21019
  const fn = $parse(expr);
21009
- const res = fn(this.$target, locals);
21010
-
21020
+ const res = fn(this, locals);
21011
21021
  if (isUndefined(res) || res === null) {
21012
21022
  return res;
21013
21023
  }
@@ -35815,7 +35825,7 @@ class Angular {
35815
35825
  /**
35816
35826
  * @type {string} `version` from `package.json`
35817
35827
  */
35818
- this.version = "0.8.3"; //inserted via rollup plugin
35828
+ this.version = "0.9.0"; //inserted via rollup plugin
35819
35829
 
35820
35830
  /** @type {!Array<string|any>} */
35821
35831
  this.bootsrappedModules = [];
@@ -1,4 +1,4 @@
1
- /* Version: 0.8.3 - August 22, 2025 14:53:15 */
1
+ /* Version: 0.9.0 - September 12, 2025 22:41:26 */
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
4
4
  typeof define === 'function' && define.amd ? define(['exports'], factory) :
@@ -3402,8 +3402,6 @@
3402
3402
  */
3403
3403
  class SceDelegateProvider {
3404
3404
  constructor() {
3405
- this.SCE_CONTEXTS = SCE_CONTEXTS;
3406
-
3407
3405
  // Resource URLs can also be trusted by policy.
3408
3406
  let trustedResourceUrlList = ["self"];
3409
3407
  let bannedResourceUrlList = [];
@@ -3702,11 +3700,14 @@
3702
3700
  if (isResourceUrlAllowedByPolicy(maybeTrusted)) {
3703
3701
  return maybeTrusted;
3704
3702
  }
3705
- throw $sceMinErr(
3706
- "insecurl",
3707
- "Blocked loading resource from url not allowed by $sceDelegate policy. URL: {0}",
3708
- maybeTrusted.toString(),
3703
+ $exceptionHandler(
3704
+ $sceMinErr(
3705
+ "insecurl",
3706
+ "Blocked loading resource from url not allowed by $sceDelegate policy. URL: {0}",
3707
+ maybeTrusted.toString(),
3708
+ ),
3709
3709
  );
3710
+ return;
3710
3711
  } else if (type === SCE_CONTEXTS.HTML) {
3711
3712
  // htmlSanitizer throws its own error when no sanitizer is available.
3712
3713
  return htmlSanitizer();
@@ -15458,7 +15459,11 @@
15458
15459
  ? (scope, locals, assign) => {
15459
15460
  const values = [];
15460
15461
  for (let i = 0; i < args.length; ++i) {
15461
- const res = args[i](scope, locals, assign);
15462
+ const res = args[i](
15463
+ scope && scope.$target ? scope.$target : scope,
15464
+ locals,
15465
+ assign,
15466
+ );
15462
15467
  values.push(res);
15463
15468
  }
15464
15469
  const value = () => {
@@ -15469,7 +15474,11 @@
15469
15474
  : value;
15470
15475
  }
15471
15476
  : (scope, locals, assign) => {
15472
- const rhs = right(scope, locals, assign);
15477
+ const rhs = right(
15478
+ scope.$target ? scope.$target : scope,
15479
+ locals,
15480
+ assign,
15481
+ );
15473
15482
  let value;
15474
15483
  if (rhs.value != null && isFunction(rhs.value)) {
15475
15484
  const values = [];
@@ -15487,7 +15496,11 @@
15487
15496
  return (scope, locals, assign) => {
15488
15497
  const lhs = left(scope, locals, assign);
15489
15498
  const rhs = right(scope, locals, assign);
15490
- lhs.context[lhs.name] = rhs;
15499
+ // lhs.context[lhs.name] = rhs;
15500
+ const ctx = isProxy(lhs.context)
15501
+ ? lhs.context
15502
+ : (lhs.context.$proxy ?? lhs.context);
15503
+ ctx[lhs.name] = rhs;
15491
15504
  return context ? { value: rhs } : rhs;
15492
15505
  };
15493
15506
  case ASTType.ArrayExpression:
@@ -15538,10 +15551,12 @@
15538
15551
  return context ? { value } : value;
15539
15552
  };
15540
15553
  case ASTType.ThisExpression:
15541
- return (scope) => (context ? { value: scope } : scope);
15554
+ return (scope) => (context ? { value: scope } : scope.$proxy);
15542
15555
  case ASTType.LocalsExpression:
15556
+ // @ts-ignore
15543
15557
  return (scope, locals) => (context ? { value: locals } : locals);
15544
15558
  case ASTType.NGValueParameter:
15559
+ // @ts-ignore
15545
15560
  return (scope, locals, assign) =>
15546
15561
  context ? { value: assign } : assign;
15547
15562
  }
@@ -15839,13 +15854,14 @@
15839
15854
  */
15840
15855
  identifier(name, context, create) {
15841
15856
  return (scope, locals) => {
15842
- const base = locals && name in locals ? locals : scope;
15857
+ const base =
15858
+ locals && name in locals ? locals : ((scope && scope.$proxy) ?? scope);
15843
15859
  if (create && create !== 1 && base && base[name] == null) {
15844
15860
  base[name] = {};
15845
15861
  }
15846
15862
  let value = undefined;
15847
15863
  if (base) {
15848
- value = base[name];
15864
+ value = base["$target"] ? base["$target"][name] : base[name];
15849
15865
  }
15850
15866
  if (context) {
15851
15867
  return { context: base, name, value };
@@ -20846,12 +20862,6 @@
20846
20862
 
20847
20863
  // 14
20848
20864
  case ASTType.ObjectExpression: {
20849
- // get.decoratedNode.body[0].expression.expression.forEach(x => {
20850
- // x.toWatch[0].name
20851
- // });
20852
-
20853
- // key = get.decoratedNode.body[0].expression.properties[0].key.name;
20854
- // listener.property.push(key);
20855
20865
  get.decoratedNode.body[0].expression.properties.forEach((prop) => {
20856
20866
  if (prop.key.isPure === false) {
20857
20867
  keySet.push(prop.key.name);
@@ -20861,7 +20871,8 @@
20861
20871
  keySet.push(prop.value.name);
20862
20872
  listener.property.push(key);
20863
20873
  } else {
20864
- key = get.decoratedNode.body[0].expression.properties[0].key.name;
20874
+ const target = get.decoratedNode.body[0].expression.toWatch[0];
20875
+ key = target.property ? target.property.name : target.name;
20865
20876
  listener.property.push(key);
20866
20877
  }
20867
20878
  }
@@ -21012,8 +21023,7 @@
21012
21023
 
21013
21024
  $eval(expr, locals) {
21014
21025
  const fn = $parse(expr);
21015
- const res = fn(this.$target, locals);
21016
-
21026
+ const res = fn(this, locals);
21017
21027
  if (isUndefined(res) || res === null) {
21018
21028
  return res;
21019
21029
  }
@@ -35821,7 +35831,7 @@
35821
35831
  /**
35822
35832
  * @type {string} `version` from `package.json`
35823
35833
  */
35824
- this.version = "0.8.3"; //inserted via rollup plugin
35834
+ this.version = "0.9.0"; //inserted via rollup plugin
35825
35835
 
35826
35836
  /** @type {!Array<string|any>} */
35827
35837
  this.bootsrappedModules = [];