@angular/core 18.1.0-next.4 → 18.1.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 (44) hide show
  1. package/esm2022/primitives/event-dispatch/index.mjs +3 -2
  2. package/esm2022/primitives/event-dispatch/src/action_resolver.mjs +3 -3
  3. package/esm2022/primitives/event-dispatch/src/attribute.mjs +16 -52
  4. package/esm2022/primitives/event-dispatch/src/cache.mjs +17 -6
  5. package/esm2022/primitives/event-dispatch/src/char.mjs +1 -16
  6. package/esm2022/primitives/event-dispatch/src/event.mjs +2 -3
  7. package/esm2022/primitives/event-dispatch/src/eventcontract.mjs +5 -66
  8. package/esm2022/primitives/event-dispatch/src/property.mjs +17 -22
  9. package/esm2022/primitives/signals/index.mjs +3 -3
  10. package/esm2022/primitives/signals/src/signal.mjs +4 -1
  11. package/esm2022/rxjs-interop/src/to_signal.mjs +4 -4
  12. package/esm2022/src/change_detection/scheduling/zoneless_scheduling_impl.mjs +2 -2
  13. package/esm2022/src/core_private_export.mjs +3 -1
  14. package/esm2022/src/defer/instructions.mjs +53 -35
  15. package/esm2022/src/event_delegation_utils.mjs +40 -23
  16. package/esm2022/src/event_dispatch/event_delegation.mjs +38 -0
  17. package/esm2022/src/hydration/annotate.mjs +3 -3
  18. package/esm2022/src/hydration/event_replay.mjs +5 -5
  19. package/esm2022/src/render3/component_ref.mjs +1 -1
  20. package/esm2022/src/render3/debug/framework_injector_profiler.mjs +3 -2
  21. package/esm2022/src/version.mjs +1 -1
  22. package/esm2022/testing/src/logger.mjs +3 -3
  23. package/fesm2022/core.mjs +127 -63
  24. package/fesm2022/core.mjs.map +1 -1
  25. package/fesm2022/primitives/event-dispatch.mjs +53 -242
  26. package/fesm2022/primitives/event-dispatch.mjs.map +1 -1
  27. package/fesm2022/primitives/signals.mjs +5 -2
  28. package/fesm2022/primitives/signals.mjs.map +1 -1
  29. package/fesm2022/rxjs-interop.mjs +4 -4
  30. package/fesm2022/rxjs-interop.mjs.map +1 -1
  31. package/fesm2022/testing.mjs +1 -1
  32. package/index.d.ts +31 -2
  33. package/package.json +1 -1
  34. package/primitives/event-dispatch/index.d.ts +22 -102
  35. package/primitives/signals/index.d.ts +10 -1
  36. package/rxjs-interop/index.d.ts +2 -2
  37. package/schematics/migrations/invalid-two-way-bindings/bundle.js +26 -9
  38. package/schematics/migrations/invalid-two-way-bindings/bundle.js.map +2 -2
  39. package/schematics/ng-generate/control-flow-migration/bundle.js +36 -10
  40. package/schematics/ng-generate/control-flow-migration/bundle.js.map +2 -2
  41. package/schematics/ng-generate/standalone-migration/bundle.js +155 -63
  42. package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
  43. package/testing/index.d.ts +1 -1
  44. package/esm2022/primitives/event-dispatch/src/dom.mjs +0 -48
@@ -1,18 +1,10 @@
1
1
  /**
2
- * @license Angular v18.1.0-next.4
2
+ * @license Angular v18.1.0
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
 
7
7
 
8
- declare namespace a11yClickLib {
9
- export {
10
- updateEventInfoForA11yClick,
11
- preventDefaultForA11yClick,
12
- populateClickOnlyAction
13
- }
14
- }
15
-
16
8
 
17
9
  /**
18
10
  * Records information about the action that should handle a given `Event`.
@@ -24,13 +16,21 @@ declare interface ActionInfo {
24
16
 
25
17
  declare type ActionInfoInternal = [name: string, element: Element];
26
18
 
19
+
27
20
  export declare const Attribute: {
28
- JSACTION: string;
29
- OI: string;
30
- VED: string;
31
- VET: string;
32
- JSINSTANCE: string;
33
- JSTRACK: string;
21
+ /**
22
+ * The jsaction attribute defines a mapping of a DOM event to a
23
+ * generic event (aka jsaction), to which the actual event handlers
24
+ * that implement the behavior of the application are bound. The
25
+ * value is a semicolon separated list of colon separated pairs of
26
+ * an optional DOM event name and a jsaction name. If the optional
27
+ * DOM event name is omitted, 'click' is assumed. The jsaction names
28
+ * are dot separated pairs of a namespace and a simple jsaction
29
+ * name.
30
+ *
31
+ * See grammar in README.md for expected syntax in the attribute value.
32
+ */
33
+ JSACTION: "jsaction";
34
34
  };
35
35
 
36
36
  /**
@@ -112,11 +112,10 @@ export declare interface EarlyJsactionDataContainer {
112
112
  * be delay loaded in a generic way.
113
113
  */
114
114
  export declare class EventContract implements UnrenamedEventContract {
115
- private readonly useActionResolver;
115
+ private readonly useActionResolver?;
116
116
  static A11Y_CLICK_SUPPORT: boolean;
117
117
  static MOUSE_SPECIAL_SUPPORT: boolean;
118
118
  private containerManager;
119
- private readonly actionResolver?;
120
119
  /**
121
120
  * The DOM events which this contract covers. Used to prevent double
122
121
  * registration of event types. The value of the map is the
@@ -139,10 +138,7 @@ export declare class EventContract implements UnrenamedEventContract {
139
138
  * as soon as the `Dispatcher` is registered.
140
139
  */
141
140
  private queuedEventInfos;
142
- /** Whether to add an a11y click listener. */
143
- private addA11yClickListener;
144
- ecaacs?: (updateEventInfoForA11yClick: typeof a11yClickLib.updateEventInfoForA11yClick, preventDefaultForA11yClick: typeof a11yClickLib.preventDefaultForA11yClick, populateClickOnlyAction: typeof a11yClickLib.populateClickOnlyAction) => void;
145
- constructor(containerManager: EventContractContainerManager, useActionResolver: false);
141
+ constructor(containerManager: EventContractContainerManager, useActionResolver?: false | undefined);
146
142
  private handleEvent;
147
143
  /**
148
144
  * Handle an `EventInfo`.
@@ -209,10 +205,6 @@ export declare class EventContract implements UnrenamedEventContract {
209
205
  * compilation unit as the `EventContract`.
210
206
  */
211
207
  exportAddA11yClickSupport(): void;
212
- /**
213
- * Unrenamed function that loads a11yClickSupport.
214
- */
215
- private addA11yClickSupportImpl;
216
208
  }
217
209
 
218
210
  /**
@@ -445,62 +437,6 @@ export declare const isCaptureEvent: (eventType: string) => boolean;
445
437
  */
446
438
  export declare const isSupportedEvent: (eventType: string) => boolean;
447
439
 
448
- /**
449
- * The jsaction attribute defines a mapping of a DOM event to a
450
- * generic event (aka jsaction), to which the actual event handlers
451
- * that implement the behavior of the application are bound. The
452
- * value is a semicolon separated list of colon separated pairs of
453
- * an optional DOM event name and a jsaction name. If the optional
454
- * DOM event name is omitted, 'click' is assumed. The jsaction names
455
- * are dot separated pairs of a namespace and a simple jsaction
456
- * name.
457
- *
458
- * See grammar in README.md for expected syntax in the attribute value.
459
- */
460
- export declare const JSACTION = "jsaction";
461
-
462
- /**
463
- * Support for iteration on reprocessing.
464
- *
465
- * Used by ActionFlow.
466
- */
467
- export declare const JSINSTANCE = "jsinstance";
468
-
469
- /**
470
- * All click jsactions that happen on the element that carries this
471
- * attribute or its descendants are automatically logged.
472
- * Impressions of jsactions on these elements are tracked too, if
473
- * requested by the impression() method of ActionFlow.
474
- *
475
- * Used by ActionFlow.
476
- */
477
- export declare const JSTRACK = "jstrack";
478
-
479
- /**
480
- * The oi attribute is a log impression tag for impression logging
481
- * and action tracking. For an element that carries a jsaction
482
- * attribute, the element is identified for the purpose of
483
- * impression logging and click tracking by the dot separated path
484
- * of all oi attributes in the chain of ancestors of the element.
485
- *
486
- * Used by ActionFlow.
487
- */
488
- export declare const OI = "oi";
489
-
490
- /**
491
- * Sets the `action` to `clickonly` for a click event that is not an a11y click
492
- * and if there is not already a click action.
493
- */
494
- declare function populateClickOnlyAction(actionElement: Element, eventInfo: eventInfoLib.EventInfo, actionMap: {
495
- [key: string]: string;
496
- }): void;
497
-
498
- /**
499
- * Call `preventDefault` on an a11y click if it is space key or to prevent the
500
- * browser's default action for native HTML controls.
501
- */
502
- declare function preventDefaultForA11yClick(eventInfo: eventInfoLib.EventInfo): void;
503
-
504
440
  /**
505
441
  * Registers deferred functionality for an EventContract and a Jsaction
506
442
  * Dispatcher.
@@ -508,6 +444,9 @@ declare function preventDefaultForA11yClick(eventInfo: eventInfoLib.EventInfo):
508
444
  export declare function registerDispatcher(eventContract: UnrenamedEventContract, dispatcher: EventDispatcher): void;
509
445
 
510
446
 
447
+ export declare function registerEventType(element: Element, eventType: string, action: string): void;
448
+
449
+
511
450
  /**
512
451
  * @fileoverview An enum to control who can call certain jsaction APIs.
513
452
  */
@@ -542,35 +481,16 @@ declare function setTargetElement(eventInfo: EventInfo, targetElement: Element):
542
481
  /** Added for readability when accessing stable property names. */
543
482
  declare function setTimestamp(eventInfo: EventInfo, timestamp: number): void;
544
483
 
484
+ export declare function unregisterEventType(element: Element, eventType: string): void;
485
+
545
486
  /**
546
487
  * The API of an EventContract that is safe to call from any compilation unit.
547
488
  */
548
489
  declare interface UnrenamedEventContract {
549
490
  ecrd(dispatcher: Dispatcher, restriction: Restriction): void;
550
- ecaacs?: (updateEventInfoForA11yClick: typeof a11yClickLib.updateEventInfoForA11yClick, preventDefaultForA11yClick: typeof a11yClickLib.preventDefaultForA11yClick, populateClickOnlyAction: typeof a11yClickLib.populateClickOnlyAction) => void;
551
491
  }
552
492
 
553
493
  /** Added for readability when accessing stable property names. */
554
494
  declare function unsetAction(eventInfo: EventInfo): void;
555
495
 
556
- /**
557
- * Update `EventInfo` to be `eventType = 'click'` and sets `a11yClickKey` if it
558
- * is a a11y click.
559
- */
560
- declare function updateEventInfoForA11yClick(eventInfo: eventInfoLib.EventInfo): void;
561
-
562
- /**
563
- * The ved attribute is an encoded ClickTrackingCGI proto to track
564
- * visual elements.
565
- *
566
- * Used by ActionFlow.
567
- */
568
- export declare const VED = "ved";
569
-
570
- /**
571
- * The vet attribute is the visual element type used to identify tracked
572
- * visual elements.
573
- */
574
- export declare const VET = "vet";
575
-
576
496
  export { }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v18.1.0-next.4
2
+ * @license Angular v18.1.0
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -89,6 +89,13 @@ export declare function isReactive(value: unknown): value is Reactive;
89
89
  */
90
90
  export declare function producerAccessed(node: ReactiveNode): void;
91
91
 
92
+ /**
93
+ * Increment the global epoch counter.
94
+ *
95
+ * Called by source producers (that is, not computeds) whenever their values change.
96
+ */
97
+ export declare function producerIncrementEpoch(): void;
98
+
92
99
  /**
93
100
  * Propagate a dirty notification to live consumers of this producer.
94
101
  */
@@ -208,6 +215,8 @@ export declare interface ReactiveNode {
208
215
  consumerOnSignalRead(node: unknown): void;
209
216
  }
210
217
 
218
+ export declare function runPostSignalSetFn(): void;
219
+
211
220
  export declare function setActiveConsumer(consumer: ReactiveNode | null): ReactiveNode | null;
212
221
 
213
222
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v18.1.0-next.4
2
+ * @license Angular v18.1.0
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -161,7 +161,7 @@ export declare interface ToSignalOptions<T> {
161
161
  *
162
162
  * Equality comparisons are executed against the initial value if one is provided.
163
163
  */
164
- equals?: ValueEqualityFn<T>;
164
+ equal?: ValueEqualityFn<T>;
165
165
  }
166
166
 
167
167
  export { }
@@ -5897,7 +5897,7 @@ var scopedAtRuleIdentifiers = [
5897
5897
  ];
5898
5898
  var ShadowCss = class {
5899
5899
  constructor() {
5900
- this._animationDeclarationKeyframesRe = /(^|\s+)(?:(?:(['"])((?:\\\\|\\\2|(?!\2).)+)\2)|(-?[A-Za-z][\w\-]*))(?=[,\s]|$)/g;
5900
+ this._animationDeclarationKeyframesRe = /(^|\s+|,)(?:(?:(['"])((?:\\\\|\\\2|(?!\2).)+)\2)|(-?[A-Za-z][\w\-]*))(?=[,\s]|$)/g;
5901
5901
  }
5902
5902
  shimCssText(cssText, selector, hostSelector = "") {
5903
5903
  const comments = [];
@@ -5940,7 +5940,7 @@ var ShadowCss = class {
5940
5940
  });
5941
5941
  }
5942
5942
  _scopeAnimationRule(rule, scopeSelector, unscopedKeyframesSet) {
5943
- let content = rule.content.replace(/((?:^|\s+|;)(?:-webkit-)?animation(?:\s*):(?:\s*))([^;]+)/g, (_, start, animationDeclarations) => start + animationDeclarations.replace(this._animationDeclarationKeyframesRe, (original, leadingSpaces, quote = "", quotedName, nonQuotedName) => {
5943
+ let content = rule.content.replace(/((?:^|\s+|;)(?:-webkit-)?animation\s*:\s*),*([^;]+)/g, (_, start, animationDeclarations) => start + animationDeclarations.replace(this._animationDeclarationKeyframesRe, (original, leadingSpaces, quote = "", quotedName, nonQuotedName) => {
5944
5944
  if (quotedName) {
5945
5945
  return `${leadingSpaces}${this._scopeAnimationKeyframe(`${quote}${quotedName}${quote}`, scopeSelector, unscopedKeyframesSet)}`;
5946
5946
  } else {
@@ -9629,7 +9629,8 @@ function getScopeForView(view, parent) {
9629
9629
  scope.contextVariables.set(identifier, {
9630
9630
  kind: SemanticVariableKind.Identifier,
9631
9631
  name: null,
9632
- identifier
9632
+ identifier,
9633
+ local: false
9633
9634
  });
9634
9635
  }
9635
9636
  for (const op of view.create) {
@@ -9648,7 +9649,8 @@ function getScopeForView(view, parent) {
9648
9649
  variable: {
9649
9650
  kind: SemanticVariableKind.Identifier,
9650
9651
  name: null,
9651
- identifier: op.localRefs[offset].name
9652
+ identifier: op.localRefs[offset].name,
9653
+ local: false
9652
9654
  }
9653
9655
  });
9654
9656
  }
@@ -9660,7 +9662,8 @@ function getScopeForView(view, parent) {
9660
9662
  variable: {
9661
9663
  kind: SemanticVariableKind.Identifier,
9662
9664
  name: null,
9663
- identifier: op.declaredName
9665
+ identifier: op.declaredName,
9666
+ local: false
9664
9667
  }
9665
9668
  });
9666
9669
  break;
@@ -14417,7 +14420,7 @@ var _Tokenizer = class {
14417
14420
  const nameCursor = this._cursor.clone();
14418
14421
  let allowDigit = false;
14419
14422
  this._attemptCharCodeUntilFn((code) => {
14420
- if (isAsciiLetter(code) || code === $_ || allowDigit && isDigit(code)) {
14423
+ if (isAsciiLetter(code) || code == $$ || code === $_ || allowDigit && isDigit(code)) {
14421
14424
  allowDigit = true;
14422
14425
  return false;
14423
14426
  }
@@ -18160,11 +18163,22 @@ function resolveNames(job) {
18160
18163
  }
18161
18164
  function processLexicalScope2(unit, ops, savedView) {
18162
18165
  const scope = /* @__PURE__ */ new Map();
18166
+ const localDefinitions = /* @__PURE__ */ new Map();
18163
18167
  for (const op of ops) {
18164
18168
  switch (op.kind) {
18165
18169
  case OpKind.Variable:
18166
18170
  switch (op.variable.kind) {
18167
18171
  case SemanticVariableKind.Identifier:
18172
+ if (op.variable.local) {
18173
+ if (localDefinitions.has(op.variable.identifier)) {
18174
+ continue;
18175
+ }
18176
+ localDefinitions.set(op.variable.identifier, op.xref);
18177
+ } else if (scope.has(op.variable.identifier)) {
18178
+ continue;
18179
+ }
18180
+ scope.set(op.variable.identifier, op.xref);
18181
+ break;
18168
18182
  case SemanticVariableKind.Alias:
18169
18183
  if (scope.has(op.variable.identifier)) {
18170
18184
  continue;
@@ -18191,7 +18205,9 @@ function processLexicalScope2(unit, ops, savedView) {
18191
18205
  }
18192
18206
  transformExpressionsInOp(op, (expr) => {
18193
18207
  if (expr instanceof LexicalReadExpr) {
18194
- if (scope.has(expr.name)) {
18208
+ if (localDefinitions.has(expr.name)) {
18209
+ return new ReadVariableExpr(localDefinitions.get(expr.name));
18210
+ } else if (scope.has(expr.name)) {
18195
18211
  return new ReadVariableExpr(scope.get(expr.name));
18196
18212
  } else {
18197
18213
  return new ReadPropExpr(new ContextExpr(unit.job.root.xref), expr.name);
@@ -19012,7 +19028,8 @@ function generateLocalLetReferences(job) {
19012
19028
  const variable2 = {
19013
19029
  kind: SemanticVariableKind.Identifier,
19014
19030
  name: null,
19015
- identifier: op.declaredName
19031
+ identifier: op.declaredName,
19032
+ local: true
19016
19033
  };
19017
19034
  OpList.replace(op, createVariableOp(job.allocateXrefId(), variable2, new StoreLetExpr(op.target, op.value, op.sourceSpan), VariableFlags.None));
19018
19035
  }
@@ -23422,7 +23439,7 @@ function publishFacade(global) {
23422
23439
  }
23423
23440
 
23424
23441
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/version.mjs
23425
- var VERSION2 = new Version("18.1.0-next.4");
23442
+ var VERSION2 = new Version("18.1.0");
23426
23443
 
23427
23444
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
23428
23445
  var _VisitorMode;