@angular/core 18.1.0 → 18.1.2

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 (43) hide show
  1. package/esm2022/primitives/event-dispatch/contract_binary.mjs +3 -3
  2. package/esm2022/primitives/event-dispatch/index.mjs +7 -7
  3. package/esm2022/primitives/event-dispatch/src/a11y_click.mjs +1 -1
  4. package/esm2022/primitives/event-dispatch/src/action_resolver.mjs +1 -1
  5. package/esm2022/primitives/event-dispatch/src/bootstrap_app_scoped.mjs +44 -0
  6. package/esm2022/primitives/event-dispatch/src/bootstrap_global.mjs +32 -0
  7. package/esm2022/primitives/event-dispatch/src/cache.mjs +10 -21
  8. package/esm2022/primitives/event-dispatch/src/earlyeventcontract.mjs +56 -21
  9. package/esm2022/primitives/event-dispatch/src/event.mjs +3 -3
  10. package/esm2022/primitives/event-dispatch/src/event_contract_defines.mjs +1 -6
  11. package/esm2022/primitives/event-dispatch/src/event_type.mjs +19 -21
  12. package/esm2022/primitives/event-dispatch/src/eventcontract.mjs +44 -41
  13. package/esm2022/primitives/event-dispatch/src/property.mjs +1 -1
  14. package/esm2022/rxjs-interop/src/to_signal.mjs +6 -5
  15. package/esm2022/src/event_delegation_utils.mjs +9 -9
  16. package/esm2022/src/event_dispatch/event_delegation.mjs +2 -4
  17. package/esm2022/src/hydration/event_replay.mjs +19 -24
  18. package/esm2022/src/render3/after_render_hooks.mjs +8 -3
  19. package/esm2022/src/render3/component_ref.mjs +1 -1
  20. package/esm2022/src/version.mjs +1 -1
  21. package/esm2022/testing/src/logger.mjs +3 -3
  22. package/event-dispatch-contract.min.js +1 -1
  23. package/fesm2022/core.mjs +35 -36
  24. package/fesm2022/core.mjs.map +1 -1
  25. package/fesm2022/primitives/event-dispatch.mjs +558 -526
  26. package/fesm2022/primitives/event-dispatch.mjs.map +1 -1
  27. package/fesm2022/primitives/signals.mjs +1 -1
  28. package/fesm2022/rxjs-interop.mjs +6 -5
  29. package/fesm2022/rxjs-interop.mjs.map +1 -1
  30. package/fesm2022/testing.mjs +1 -1
  31. package/index.d.ts +3 -3
  32. package/package.json +1 -1
  33. package/primitives/event-dispatch/index.d.ts +46 -45
  34. package/primitives/signals/index.d.ts +1 -1
  35. package/rxjs-interop/index.d.ts +1 -1
  36. package/schematics/migrations/invalid-two-way-bindings/bundle.js +45 -33
  37. package/schematics/migrations/invalid-two-way-bindings/bundle.js.map +2 -2
  38. package/schematics/ng-generate/control-flow-migration/bundle.js +52 -33
  39. package/schematics/ng-generate/control-flow-migration/bundle.js.map +2 -2
  40. package/schematics/ng-generate/standalone-migration/bundle.js +64 -45
  41. package/schematics/ng-generate/standalone-migration/bundle.js.map +2 -2
  42. package/testing/index.d.ts +1 -1
  43. package/esm2022/primitives/event-dispatch/src/register_events.mjs +0 -31
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v18.1.0
2
+ * @license Angular v18.1.2
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v18.1.0
2
+ * @license Angular v18.1.2
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -206,8 +206,9 @@ function toSignal(source, options) {
206
206
  // Completion of the Observable is meaningless to the signal. Signals don't have a concept of
207
207
  // "complete".
208
208
  });
209
- if (ngDevMode && options?.requireSync && state().kind === 0 /* StateKind.NoValue */) {
210
- throw new ɵRuntimeError(601 /* ɵRuntimeErrorCode.REQUIRE_SYNC_WITHOUT_SYNC_EMIT */, '`toSignal()` called with `requireSync` but `Observable` did not emit synchronously.');
209
+ if (options?.requireSync && state().kind === 0 /* StateKind.NoValue */) {
210
+ throw new ɵRuntimeError(601 /* ɵRuntimeErrorCode.REQUIRE_SYNC_WITHOUT_SYNC_EMIT */, (typeof ngDevMode === 'undefined' || ngDevMode) &&
211
+ '`toSignal()` called with `requireSync` but `Observable` did not emit synchronously.');
211
212
  }
212
213
  // Unsubscribe when the current context is destroyed, if requested.
213
214
  cleanupRef?.onDestroy(sub.unsubscribe.bind(sub));
@@ -222,8 +223,8 @@ function toSignal(source, options) {
222
223
  throw current.error;
223
224
  case 0 /* StateKind.NoValue */:
224
225
  // This shouldn't really happen because the error is thrown on creation.
225
- // TODO(alxhub): use a RuntimeError when we finalize the error semantics
226
- throw new ɵRuntimeError(601 /* ɵRuntimeErrorCode.REQUIRE_SYNC_WITHOUT_SYNC_EMIT */, '`toSignal()` called with `requireSync` but `Observable` did not emit synchronously.');
226
+ throw new ɵRuntimeError(601 /* ɵRuntimeErrorCode.REQUIRE_SYNC_WITHOUT_SYNC_EMIT */, (typeof ngDevMode === 'undefined' || ngDevMode) &&
227
+ '`toSignal()` called with `requireSync` but `Observable` did not emit synchronously.');
227
228
  }
228
229
  }, { equal: options?.equal });
229
230
  }
@@ -1 +1 @@
1
- {"version":3,"file":"rxjs-interop.mjs","sources":["../../../../../../packages/core/rxjs-interop/src/take_until_destroyed.ts","../../../../../../packages/core/rxjs-interop/src/output_from_observable.ts","../../../../../../packages/core/rxjs-interop/src/output_to_observable.ts","../../../../../../packages/core/rxjs-interop/src/to_observable.ts","../../../../../../packages/core/rxjs-interop/src/to_signal.ts","../../../../../../packages/core/rxjs-interop/rxjs-interop.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {assertInInjectionContext, DestroyRef, inject} from '@angular/core';\nimport {MonoTypeOperatorFunction, Observable} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\n\n/**\n * Operator which completes the Observable when the calling context (component, directive, service,\n * etc) is destroyed.\n *\n * @param destroyRef optionally, the `DestroyRef` representing the current context. This can be\n * passed explicitly to use `takeUntilDestroyed` outside of an [injection\n * context](guide/di/dependency-injection-context). Otherwise, the current `DestroyRef` is injected.\n *\n * @developerPreview\n */\nexport function takeUntilDestroyed<T>(destroyRef?: DestroyRef): MonoTypeOperatorFunction<T> {\n if (!destroyRef) {\n assertInInjectionContext(takeUntilDestroyed);\n destroyRef = inject(DestroyRef);\n }\n\n const destroyed$ = new Observable<void>((observer) => {\n const unregisterFn = destroyRef!.onDestroy(observer.next.bind(observer));\n return unregisterFn;\n });\n\n return <T>(source: Observable<T>) => {\n return source.pipe(takeUntil(destroyed$));\n };\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n assertInInjectionContext,\n DestroyRef,\n inject,\n OutputOptions,\n OutputRef,\n OutputRefSubscription,\n ɵRuntimeError,\n ɵRuntimeErrorCode,\n} from '@angular/core';\nimport {Observable} from 'rxjs';\n\nimport {takeUntilDestroyed} from './take_until_destroyed';\n\n/**\n * Implementation of `OutputRef` that emits values from\n * an RxJS observable source.\n *\n * @internal\n */\nclass OutputFromObservableRef<T> implements OutputRef<T> {\n private destroyed = false;\n\n destroyRef = inject(DestroyRef);\n\n constructor(private source: Observable<T>) {\n this.destroyRef.onDestroy(() => {\n this.destroyed = true;\n });\n }\n\n subscribe(callbackFn: (value: T) => void): OutputRefSubscription {\n if (this.destroyed) {\n throw new ɵRuntimeError(\n ɵRuntimeErrorCode.OUTPUT_REF_DESTROYED,\n ngDevMode &&\n 'Unexpected subscription to destroyed `OutputRef`. ' +\n 'The owning directive/component is destroyed.',\n );\n }\n\n // Stop yielding more values when the directive/component is already destroyed.\n const subscription = this.source.pipe(takeUntilDestroyed(this.destroyRef)).subscribe({\n next: (value) => callbackFn(value),\n });\n\n return {\n unsubscribe: () => subscription.unsubscribe(),\n };\n }\n}\n\n/**\n * Declares an Angular output that is using an RxJS observable as a source\n * for events dispatched to parent subscribers.\n *\n * The behavior for an observable as source is defined as followed:\n * 1. New values are forwarded to the Angular output (next notifications).\n * 2. Errors notifications are not handled by Angular. You need to handle these manually.\n * For example by using `catchError`.\n * 3. Completion notifications stop the output from emitting new values.\n *\n * @usageNotes\n * Initialize an output in your directive by declaring a\n * class field and initializing it with the `outputFromObservable()` function.\n *\n * ```ts\n * @Directive({..})\n * export class MyDir {\n * nameChange$ = <some-observable>;\n * nameChange = outputFromObservable(this.nameChange$);\n * }\n * ```\n *\n * @developerPreview\n */\nexport function outputFromObservable<T>(\n observable: Observable<T>,\n opts?: OutputOptions,\n): OutputRef<T> {\n ngDevMode && assertInInjectionContext(outputFromObservable);\n return new OutputFromObservableRef<T>(observable);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {OutputRef, ɵgetOutputDestroyRef} from '@angular/core';\nimport {Observable} from 'rxjs';\n\n/**\n * Converts an Angular output declared via `output()` or `outputFromObservable()`\n * to an observable.\n *\n * You can subscribe to the output via `Observable.subscribe` then.\n *\n * @developerPreview\n */\nexport function outputToObservable<T>(ref: OutputRef<T>): Observable<T> {\n const destroyRef = ɵgetOutputDestroyRef(ref);\n\n return new Observable<T>((observer) => {\n // Complete the observable upon directive/component destroy.\n // Note: May be `undefined` if an `EventEmitter` is declared outside\n // of an injection context.\n destroyRef?.onDestroy(() => observer.complete());\n\n const subscription = ref.subscribe((v) => observer.next(v));\n return () => subscription.unsubscribe();\n });\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n assertInInjectionContext,\n DestroyRef,\n effect,\n inject,\n Injector,\n Signal,\n untracked,\n} from '@angular/core';\nimport {Observable, ReplaySubject} from 'rxjs';\n\n/**\n * Options for `toObservable`.\n *\n * @developerPreview\n */\nexport interface ToObservableOptions {\n /**\n * The `Injector` to use when creating the underlying `effect` which watches the signal.\n *\n * If this isn't specified, the current [injection context](guide/di/dependency-injection-context)\n * will be used.\n */\n injector?: Injector;\n}\n\n/**\n * Exposes the value of an Angular `Signal` as an RxJS `Observable`.\n *\n * The signal's value will be propagated into the `Observable`'s subscribers using an `effect`.\n *\n * `toObservable` must be called in an injection context unless an injector is provided via options.\n *\n * @developerPreview\n */\nexport function toObservable<T>(source: Signal<T>, options?: ToObservableOptions): Observable<T> {\n !options?.injector && assertInInjectionContext(toObservable);\n const injector = options?.injector ?? inject(Injector);\n const subject = new ReplaySubject<T>(1);\n\n const watcher = effect(\n () => {\n let value: T;\n try {\n value = source();\n } catch (err) {\n untracked(() => subject.error(err));\n return;\n }\n untracked(() => subject.next(value));\n },\n {injector, manualCleanup: true},\n );\n\n injector.get(DestroyRef).onDestroy(() => {\n watcher.destroy();\n subject.complete();\n });\n\n return subject.asObservable();\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n assertInInjectionContext,\n assertNotInReactiveContext,\n computed,\n DestroyRef,\n inject,\n Injector,\n signal,\n Signal,\n WritableSignal,\n ɵRuntimeError,\n ɵRuntimeErrorCode,\n} from '@angular/core';\nimport {ValueEqualityFn} from '@angular/core/primitives/signals';\nimport {Observable, Subscribable} from 'rxjs';\n\n/**\n * Options for `toSignal`.\n *\n * @publicApi\n */\nexport interface ToSignalOptions<T> {\n /**\n * Initial value for the signal produced by `toSignal`.\n *\n * This will be the value of the signal until the observable emits its first value.\n */\n initialValue?: unknown;\n\n /**\n * Whether to require that the observable emits synchronously when `toSignal` subscribes.\n *\n * If this is `true`, `toSignal` will assert that the observable produces a value immediately upon\n * subscription. Setting this option removes the need to either deal with `undefined` in the\n * signal type or provide an `initialValue`, at the cost of a runtime error if this requirement is\n * not met.\n */\n requireSync?: boolean;\n\n /**\n * `Injector` which will provide the `DestroyRef` used to clean up the Observable subscription.\n *\n * If this is not provided, a `DestroyRef` will be retrieved from the current [injection\n * context](guide/di/dependency-injection-context), unless manual cleanup is requested.\n */\n injector?: Injector;\n\n /**\n * Whether the subscription should be automatically cleaned up (via `DestroyRef`) when\n * `toSignal`'s creation context is destroyed.\n *\n * If manual cleanup is enabled, then `DestroyRef` is not used, and the subscription will persist\n * until the `Observable` itself completes.\n */\n manualCleanup?: boolean;\n\n /**\n * Whether `toSignal` should throw errors from the Observable error channel back to RxJS, where\n * they'll be processed as uncaught exceptions.\n *\n * In practice, this means that the signal returned by `toSignal` will keep returning the last\n * good value forever, as Observables which error produce no further values. This option emulates\n * the behavior of the `async` pipe.\n */\n rejectErrors?: boolean;\n\n /**\n * A comparison function which defines equality for values emitted by the observable.\n *\n * Equality comparisons are executed against the initial value if one is provided.\n */\n equal?: ValueEqualityFn<T>;\n}\n\n// Base case: no options -> `undefined` in the result type.\nexport function toSignal<T>(source: Observable<T> | Subscribable<T>): Signal<T | undefined>;\n// Options with `undefined` initial value and no `requiredSync` -> `undefined`.\nexport function toSignal<T>(\n source: Observable<T> | Subscribable<T>,\n options: NoInfer<ToSignalOptions<T | undefined>> & {\n initialValue?: undefined;\n requireSync?: false;\n },\n): Signal<T | undefined>;\n// Options with `null` initial value -> `null`.\nexport function toSignal<T>(\n source: Observable<T> | Subscribable<T>,\n options: NoInfer<ToSignalOptions<T | null>> & {initialValue?: null; requireSync?: false},\n): Signal<T | null>;\n// Options with `undefined` initial value and `requiredSync` -> strict result type.\nexport function toSignal<T>(\n source: Observable<T> | Subscribable<T>,\n options: NoInfer<ToSignalOptions<T>> & {initialValue?: undefined; requireSync: true},\n): Signal<T>;\n// Options with a more specific initial value type.\nexport function toSignal<T, const U extends T>(\n source: Observable<T> | Subscribable<T>,\n options: NoInfer<ToSignalOptions<T | U>> & {initialValue: U; requireSync?: false},\n): Signal<T | U>;\n\n/**\n * Get the current value of an `Observable` as a reactive `Signal`.\n *\n * `toSignal` returns a `Signal` which provides synchronous reactive access to values produced\n * by the given `Observable`, by subscribing to that `Observable`. The returned `Signal` will always\n * have the most recent value emitted by the subscription, and will throw an error if the\n * `Observable` errors.\n *\n * With `requireSync` set to `true`, `toSignal` will assert that the `Observable` produces a value\n * immediately upon subscription. No `initialValue` is needed in this case, and the returned signal\n * does not include an `undefined` type.\n *\n * By default, the subscription will be automatically cleaned up when the current [injection\n * context](guide/di/dependency-injection-context) is destroyed. For example, when `toSignal` is\n * called during the construction of a component, the subscription will be cleaned up when the\n * component is destroyed. If an injection context is not available, an explicit `Injector` can be\n * passed instead.\n *\n * If the subscription should persist until the `Observable` itself completes, the `manualCleanup`\n * option can be specified instead, which disables the automatic subscription teardown. No injection\n * context is needed in this configuration as well.\n *\n * @developerPreview\n */\nexport function toSignal<T, U = undefined>(\n source: Observable<T> | Subscribable<T>,\n options?: ToSignalOptions<T | U> & {initialValue?: U},\n): Signal<T | U> {\n ngDevMode &&\n assertNotInReactiveContext(\n toSignal,\n 'Invoking `toSignal` causes new subscriptions every time. ' +\n 'Consider moving `toSignal` outside of the reactive context and read the signal value where needed.',\n );\n\n const requiresCleanup = !options?.manualCleanup;\n requiresCleanup && !options?.injector && assertInInjectionContext(toSignal);\n const cleanupRef = requiresCleanup\n ? options?.injector?.get(DestroyRef) ?? inject(DestroyRef)\n : null;\n\n const equal = makeToSignalEqual(options?.equal);\n\n // Note: T is the Observable value type, and U is the initial value type. They don't have to be\n // the same - the returned signal gives values of type `T`.\n let state: WritableSignal<State<T | U>>;\n if (options?.requireSync) {\n // Initially the signal is in a `NoValue` state.\n state = signal({kind: StateKind.NoValue}, {equal});\n } else {\n // If an initial value was passed, use it. Otherwise, use `undefined` as the initial value.\n state = signal<State<T | U>>(\n {kind: StateKind.Value, value: options?.initialValue as U},\n {equal},\n );\n }\n\n // Note: This code cannot run inside a reactive context (see assertion above). If we'd support\n // this, we would subscribe to the observable outside of the current reactive context, avoiding\n // that side-effect signal reads/writes are attribute to the current consumer. The current\n // consumer only needs to be notified when the `state` signal changes through the observable\n // subscription. Additional context (related to async pipe):\n // https://github.com/angular/angular/pull/50522.\n const sub = source.subscribe({\n next: (value) => state.set({kind: StateKind.Value, value}),\n error: (error) => {\n if (options?.rejectErrors) {\n // Kick the error back to RxJS. It will be caught and rethrown in a macrotask, which causes\n // the error to end up as an uncaught exception.\n throw error;\n }\n state.set({kind: StateKind.Error, error});\n },\n // Completion of the Observable is meaningless to the signal. Signals don't have a concept of\n // \"complete\".\n });\n\n if (ngDevMode && options?.requireSync && state().kind === StateKind.NoValue) {\n throw new ɵRuntimeError(\n ɵRuntimeErrorCode.REQUIRE_SYNC_WITHOUT_SYNC_EMIT,\n '`toSignal()` called with `requireSync` but `Observable` did not emit synchronously.',\n );\n }\n\n // Unsubscribe when the current context is destroyed, if requested.\n cleanupRef?.onDestroy(sub.unsubscribe.bind(sub));\n\n // The actual returned signal is a `computed` of the `State` signal, which maps the various states\n // to either values or errors.\n return computed(\n () => {\n const current = state();\n switch (current.kind) {\n case StateKind.Value:\n return current.value;\n case StateKind.Error:\n throw current.error;\n case StateKind.NoValue:\n // This shouldn't really happen because the error is thrown on creation.\n // TODO(alxhub): use a RuntimeError when we finalize the error semantics\n throw new ɵRuntimeError(\n ɵRuntimeErrorCode.REQUIRE_SYNC_WITHOUT_SYNC_EMIT,\n '`toSignal()` called with `requireSync` but `Observable` did not emit synchronously.',\n );\n }\n },\n {equal: options?.equal},\n );\n}\n\nfunction makeToSignalEqual<T>(\n userEquality: ValueEqualityFn<T> = Object.is,\n): ValueEqualityFn<State<T>> {\n return (a, b) =>\n a.kind === StateKind.Value && b.kind === StateKind.Value && userEquality(a.value, b.value);\n}\n\nconst enum StateKind {\n NoValue,\n Value,\n Error,\n}\n\ninterface NoValueState {\n kind: StateKind.NoValue;\n}\n\ninterface ValueState<T> {\n kind: StateKind.Value;\n value: T;\n}\n\ninterface ErrorState {\n kind: StateKind.Error;\n error: unknown;\n}\n\ntype State<T> = NoValueState | ValueState<T> | ErrorState;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAYA;;;;;;;;;AASG;AACG,SAAU,kBAAkB,CAAI,UAAuB,EAA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AAmC,GAAA,MAAM,CAAC,EAAE,EAAA;IAE5C,OAAO,CAAC,CAAC,EAAE,CAAC,KACV,CAAC,CAAC,IAAI,KAAA,CAAA,0BAAwB,CAAC,CAAC,IAAI,KAAoB,CAAA,0BAAI,YAAY,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;AAC/F;;AC/NA;;AAEG;;;;"}
1
+ {"version":3,"file":"rxjs-interop.mjs","sources":["../../../../../../packages/core/rxjs-interop/src/take_until_destroyed.ts","../../../../../../packages/core/rxjs-interop/src/output_from_observable.ts","../../../../../../packages/core/rxjs-interop/src/output_to_observable.ts","../../../../../../packages/core/rxjs-interop/src/to_observable.ts","../../../../../../packages/core/rxjs-interop/src/to_signal.ts","../../../../../../packages/core/rxjs-interop/rxjs-interop.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {assertInInjectionContext, DestroyRef, inject} from '@angular/core';\nimport {MonoTypeOperatorFunction, Observable} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\n\n/**\n * Operator which completes the Observable when the calling context (component, directive, service,\n * etc) is destroyed.\n *\n * @param destroyRef optionally, the `DestroyRef` representing the current context. This can be\n * passed explicitly to use `takeUntilDestroyed` outside of an [injection\n * context](guide/di/dependency-injection-context). Otherwise, the current `DestroyRef` is injected.\n *\n * @developerPreview\n */\nexport function takeUntilDestroyed<T>(destroyRef?: DestroyRef): MonoTypeOperatorFunction<T> {\n if (!destroyRef) {\n assertInInjectionContext(takeUntilDestroyed);\n destroyRef = inject(DestroyRef);\n }\n\n const destroyed$ = new Observable<void>((observer) => {\n const unregisterFn = destroyRef!.onDestroy(observer.next.bind(observer));\n return unregisterFn;\n });\n\n return <T>(source: Observable<T>) => {\n return source.pipe(takeUntil(destroyed$));\n };\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n assertInInjectionContext,\n DestroyRef,\n inject,\n OutputOptions,\n OutputRef,\n OutputRefSubscription,\n ɵRuntimeError,\n ɵRuntimeErrorCode,\n} from '@angular/core';\nimport {Observable} from 'rxjs';\n\nimport {takeUntilDestroyed} from './take_until_destroyed';\n\n/**\n * Implementation of `OutputRef` that emits values from\n * an RxJS observable source.\n *\n * @internal\n */\nclass OutputFromObservableRef<T> implements OutputRef<T> {\n private destroyed = false;\n\n destroyRef = inject(DestroyRef);\n\n constructor(private source: Observable<T>) {\n this.destroyRef.onDestroy(() => {\n this.destroyed = true;\n });\n }\n\n subscribe(callbackFn: (value: T) => void): OutputRefSubscription {\n if (this.destroyed) {\n throw new ɵRuntimeError(\n ɵRuntimeErrorCode.OUTPUT_REF_DESTROYED,\n ngDevMode &&\n 'Unexpected subscription to destroyed `OutputRef`. ' +\n 'The owning directive/component is destroyed.',\n );\n }\n\n // Stop yielding more values when the directive/component is already destroyed.\n const subscription = this.source.pipe(takeUntilDestroyed(this.destroyRef)).subscribe({\n next: (value) => callbackFn(value),\n });\n\n return {\n unsubscribe: () => subscription.unsubscribe(),\n };\n }\n}\n\n/**\n * Declares an Angular output that is using an RxJS observable as a source\n * for events dispatched to parent subscribers.\n *\n * The behavior for an observable as source is defined as followed:\n * 1. New values are forwarded to the Angular output (next notifications).\n * 2. Errors notifications are not handled by Angular. You need to handle these manually.\n * For example by using `catchError`.\n * 3. Completion notifications stop the output from emitting new values.\n *\n * @usageNotes\n * Initialize an output in your directive by declaring a\n * class field and initializing it with the `outputFromObservable()` function.\n *\n * ```ts\n * @Directive({..})\n * export class MyDir {\n * nameChange$ = <some-observable>;\n * nameChange = outputFromObservable(this.nameChange$);\n * }\n * ```\n *\n * @developerPreview\n */\nexport function outputFromObservable<T>(\n observable: Observable<T>,\n opts?: OutputOptions,\n): OutputRef<T> {\n ngDevMode && assertInInjectionContext(outputFromObservable);\n return new OutputFromObservableRef<T>(observable);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {OutputRef, ɵgetOutputDestroyRef} from '@angular/core';\nimport {Observable} from 'rxjs';\n\n/**\n * Converts an Angular output declared via `output()` or `outputFromObservable()`\n * to an observable.\n *\n * You can subscribe to the output via `Observable.subscribe` then.\n *\n * @developerPreview\n */\nexport function outputToObservable<T>(ref: OutputRef<T>): Observable<T> {\n const destroyRef = ɵgetOutputDestroyRef(ref);\n\n return new Observable<T>((observer) => {\n // Complete the observable upon directive/component destroy.\n // Note: May be `undefined` if an `EventEmitter` is declared outside\n // of an injection context.\n destroyRef?.onDestroy(() => observer.complete());\n\n const subscription = ref.subscribe((v) => observer.next(v));\n return () => subscription.unsubscribe();\n });\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n assertInInjectionContext,\n DestroyRef,\n effect,\n inject,\n Injector,\n Signal,\n untracked,\n} from '@angular/core';\nimport {Observable, ReplaySubject} from 'rxjs';\n\n/**\n * Options for `toObservable`.\n *\n * @developerPreview\n */\nexport interface ToObservableOptions {\n /**\n * The `Injector` to use when creating the underlying `effect` which watches the signal.\n *\n * If this isn't specified, the current [injection context](guide/di/dependency-injection-context)\n * will be used.\n */\n injector?: Injector;\n}\n\n/**\n * Exposes the value of an Angular `Signal` as an RxJS `Observable`.\n *\n * The signal's value will be propagated into the `Observable`'s subscribers using an `effect`.\n *\n * `toObservable` must be called in an injection context unless an injector is provided via options.\n *\n * @developerPreview\n */\nexport function toObservable<T>(source: Signal<T>, options?: ToObservableOptions): Observable<T> {\n !options?.injector && assertInInjectionContext(toObservable);\n const injector = options?.injector ?? inject(Injector);\n const subject = new ReplaySubject<T>(1);\n\n const watcher = effect(\n () => {\n let value: T;\n try {\n value = source();\n } catch (err) {\n untracked(() => subject.error(err));\n return;\n }\n untracked(() => subject.next(value));\n },\n {injector, manualCleanup: true},\n );\n\n injector.get(DestroyRef).onDestroy(() => {\n watcher.destroy();\n subject.complete();\n });\n\n return subject.asObservable();\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n assertInInjectionContext,\n assertNotInReactiveContext,\n computed,\n DestroyRef,\n inject,\n Injector,\n signal,\n Signal,\n WritableSignal,\n ɵRuntimeError,\n ɵRuntimeErrorCode,\n} from '@angular/core';\nimport {ValueEqualityFn} from '@angular/core/primitives/signals';\nimport {Observable, Subscribable} from 'rxjs';\n\n/**\n * Options for `toSignal`.\n *\n * @publicApi\n */\nexport interface ToSignalOptions<T> {\n /**\n * Initial value for the signal produced by `toSignal`.\n *\n * This will be the value of the signal until the observable emits its first value.\n */\n initialValue?: unknown;\n\n /**\n * Whether to require that the observable emits synchronously when `toSignal` subscribes.\n *\n * If this is `true`, `toSignal` will assert that the observable produces a value immediately upon\n * subscription. Setting this option removes the need to either deal with `undefined` in the\n * signal type or provide an `initialValue`, at the cost of a runtime error if this requirement is\n * not met.\n */\n requireSync?: boolean;\n\n /**\n * `Injector` which will provide the `DestroyRef` used to clean up the Observable subscription.\n *\n * If this is not provided, a `DestroyRef` will be retrieved from the current [injection\n * context](guide/di/dependency-injection-context), unless manual cleanup is requested.\n */\n injector?: Injector;\n\n /**\n * Whether the subscription should be automatically cleaned up (via `DestroyRef`) when\n * `toSignal`'s creation context is destroyed.\n *\n * If manual cleanup is enabled, then `DestroyRef` is not used, and the subscription will persist\n * until the `Observable` itself completes.\n */\n manualCleanup?: boolean;\n\n /**\n * Whether `toSignal` should throw errors from the Observable error channel back to RxJS, where\n * they'll be processed as uncaught exceptions.\n *\n * In practice, this means that the signal returned by `toSignal` will keep returning the last\n * good value forever, as Observables which error produce no further values. This option emulates\n * the behavior of the `async` pipe.\n */\n rejectErrors?: boolean;\n\n /**\n * A comparison function which defines equality for values emitted by the observable.\n *\n * Equality comparisons are executed against the initial value if one is provided.\n */\n equal?: ValueEqualityFn<T>;\n}\n\n// Base case: no options -> `undefined` in the result type.\nexport function toSignal<T>(source: Observable<T> | Subscribable<T>): Signal<T | undefined>;\n// Options with `undefined` initial value and no `requiredSync` -> `undefined`.\nexport function toSignal<T>(\n source: Observable<T> | Subscribable<T>,\n options: NoInfer<ToSignalOptions<T | undefined>> & {\n initialValue?: undefined;\n requireSync?: false;\n },\n): Signal<T | undefined>;\n// Options with `null` initial value -> `null`.\nexport function toSignal<T>(\n source: Observable<T> | Subscribable<T>,\n options: NoInfer<ToSignalOptions<T | null>> & {initialValue?: null; requireSync?: false},\n): Signal<T | null>;\n// Options with `undefined` initial value and `requiredSync` -> strict result type.\nexport function toSignal<T>(\n source: Observable<T> | Subscribable<T>,\n options: NoInfer<ToSignalOptions<T>> & {initialValue?: undefined; requireSync: true},\n): Signal<T>;\n// Options with a more specific initial value type.\nexport function toSignal<T, const U extends T>(\n source: Observable<T> | Subscribable<T>,\n options: NoInfer<ToSignalOptions<T | U>> & {initialValue: U; requireSync?: false},\n): Signal<T | U>;\n\n/**\n * Get the current value of an `Observable` as a reactive `Signal`.\n *\n * `toSignal` returns a `Signal` which provides synchronous reactive access to values produced\n * by the given `Observable`, by subscribing to that `Observable`. The returned `Signal` will always\n * have the most recent value emitted by the subscription, and will throw an error if the\n * `Observable` errors.\n *\n * With `requireSync` set to `true`, `toSignal` will assert that the `Observable` produces a value\n * immediately upon subscription. No `initialValue` is needed in this case, and the returned signal\n * does not include an `undefined` type.\n *\n * By default, the subscription will be automatically cleaned up when the current [injection\n * context](guide/di/dependency-injection-context) is destroyed. For example, when `toSignal` is\n * called during the construction of a component, the subscription will be cleaned up when the\n * component is destroyed. If an injection context is not available, an explicit `Injector` can be\n * passed instead.\n *\n * If the subscription should persist until the `Observable` itself completes, the `manualCleanup`\n * option can be specified instead, which disables the automatic subscription teardown. No injection\n * context is needed in this configuration as well.\n *\n * @developerPreview\n */\nexport function toSignal<T, U = undefined>(\n source: Observable<T> | Subscribable<T>,\n options?: ToSignalOptions<T | U> & {initialValue?: U},\n): Signal<T | U> {\n ngDevMode &&\n assertNotInReactiveContext(\n toSignal,\n 'Invoking `toSignal` causes new subscriptions every time. ' +\n 'Consider moving `toSignal` outside of the reactive context and read the signal value where needed.',\n );\n\n const requiresCleanup = !options?.manualCleanup;\n requiresCleanup && !options?.injector && assertInInjectionContext(toSignal);\n const cleanupRef = requiresCleanup\n ? options?.injector?.get(DestroyRef) ?? inject(DestroyRef)\n : null;\n\n const equal = makeToSignalEqual(options?.equal);\n\n // Note: T is the Observable value type, and U is the initial value type. They don't have to be\n // the same - the returned signal gives values of type `T`.\n let state: WritableSignal<State<T | U>>;\n if (options?.requireSync) {\n // Initially the signal is in a `NoValue` state.\n state = signal({kind: StateKind.NoValue}, {equal});\n } else {\n // If an initial value was passed, use it. Otherwise, use `undefined` as the initial value.\n state = signal<State<T | U>>(\n {kind: StateKind.Value, value: options?.initialValue as U},\n {equal},\n );\n }\n\n // Note: This code cannot run inside a reactive context (see assertion above). If we'd support\n // this, we would subscribe to the observable outside of the current reactive context, avoiding\n // that side-effect signal reads/writes are attribute to the current consumer. The current\n // consumer only needs to be notified when the `state` signal changes through the observable\n // subscription. Additional context (related to async pipe):\n // https://github.com/angular/angular/pull/50522.\n const sub = source.subscribe({\n next: (value) => state.set({kind: StateKind.Value, value}),\n error: (error) => {\n if (options?.rejectErrors) {\n // Kick the error back to RxJS. It will be caught and rethrown in a macrotask, which causes\n // the error to end up as an uncaught exception.\n throw error;\n }\n state.set({kind: StateKind.Error, error});\n },\n // Completion of the Observable is meaningless to the signal. Signals don't have a concept of\n // \"complete\".\n });\n\n if (options?.requireSync && state().kind === StateKind.NoValue) {\n throw new ɵRuntimeError(\n ɵRuntimeErrorCode.REQUIRE_SYNC_WITHOUT_SYNC_EMIT,\n (typeof ngDevMode === 'undefined' || ngDevMode) &&\n '`toSignal()` called with `requireSync` but `Observable` did not emit synchronously.',\n );\n }\n\n // Unsubscribe when the current context is destroyed, if requested.\n cleanupRef?.onDestroy(sub.unsubscribe.bind(sub));\n\n // The actual returned signal is a `computed` of the `State` signal, which maps the various states\n // to either values or errors.\n return computed(\n () => {\n const current = state();\n switch (current.kind) {\n case StateKind.Value:\n return current.value;\n case StateKind.Error:\n throw current.error;\n case StateKind.NoValue:\n // This shouldn't really happen because the error is thrown on creation.\n throw new ɵRuntimeError(\n ɵRuntimeErrorCode.REQUIRE_SYNC_WITHOUT_SYNC_EMIT,\n (typeof ngDevMode === 'undefined' || ngDevMode) &&\n '`toSignal()` called with `requireSync` but `Observable` did not emit synchronously.',\n );\n }\n },\n {equal: options?.equal},\n );\n}\n\nfunction makeToSignalEqual<T>(\n userEquality: ValueEqualityFn<T> = Object.is,\n): ValueEqualityFn<State<T>> {\n return (a, b) =>\n a.kind === StateKind.Value && b.kind === StateKind.Value && userEquality(a.value, b.value);\n}\n\nconst enum StateKind {\n NoValue,\n Value,\n Error,\n}\n\ninterface NoValueState {\n kind: StateKind.NoValue;\n}\n\ninterface ValueState<T> {\n kind: StateKind.Value;\n value: T;\n}\n\ninterface ErrorState {\n kind: StateKind.Error;\n error: unknown;\n}\n\ntype State<T> = NoValueState | ValueState<T> | ErrorState;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAYA;;;;;;;;;AASG;AACG,SAAU,kBAAkB,CAAI,UAAuB,EAAA;IAC3D,IAAI,CAAC,UAAU,EAAE;QACf,wBAAwB,CAAC,kBAAkB,CAAC,CAAC;AAC7C,QAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;KACjC;IAED,MAAM,UAAU,GAAG,IAAI,UAAU,CAAO,CAAC,QAAQ,KAAI;AACnD,QAAA,MAAM,YAAY,GAAG,UAAW,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,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AC,CAAC,KAAK,CAAC,CAAC;AAC/F;;AChOA;;AAEG;;;;"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v18.1.0
2
+ * @license Angular v18.1.2
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v18.1.0
2
+ * @license Angular v18.1.2
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -4518,9 +4518,9 @@ declare const GLOBAL_PUBLISH_EXPANDO_KEY = "ng";
4518
4518
  declare class GlobalEventDelegation implements OnDestroy {
4519
4519
  private eventContractDetails;
4520
4520
  ngOnDestroy(): void;
4521
- supports(eventName: string): boolean;
4521
+ supports(eventType: string): boolean;
4522
4522
  addEventListener(element: HTMLElement, eventName: string, handler: Function): Function;
4523
- removeEventListener(element: HTMLElement, eventName: string, callback: Function): void;
4523
+ removeEventListener(element: HTMLElement, eventType: string, callback: Function): void;
4524
4524
  static ɵfac: i0.ɵɵFactoryDeclaration<GlobalEventDelegation, never>;
4525
4525
  static ɵprov: i0.ɵɵInjectableDeclaration<GlobalEventDelegation>;
4526
4526
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/core",
3
- "version": "18.1.0",
3
+ "version": "18.1.2",
4
4
  "description": "Angular - the core framework",
5
5
  "author": "angular",
6
6
  "license": "MIT",
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v18.1.0
2
+ * @license Angular v18.1.2
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -34,17 +34,13 @@ export declare const Attribute: {
34
34
  };
35
35
 
36
36
  /**
37
- * Provides a factory function for bootstrapping an event contract on a
38
- * specified object (by default, exposed on the `window`).
39
- * @param field The property on the object that the event contract will be placed on.
40
- * @param container The container that listens to events
41
- * @param appId A given identifier for an application. If there are multiple apps on the page
42
- * then this is how contracts can be initialized for each one.
43
- * @param eventTypes An array of event names that should be listened to.
44
- * @param captureEventTypes An array of event names that should be listened to with capture.
45
- * @param earlyJsactionTracker The object that should receive the event contract.
37
+ * Creates an `EarlyJsactionData`, adds events to it, and populates it on a nested object on
38
+ * the window.
46
39
  */
47
- export declare function bootstrapEarlyEventContract(field: string, container: HTMLElement, appId: string, eventTypes?: string[], captureEventTypes?: string[], earlyJsactionTracker?: EventContractTracker<EarlyJsactionDataContainer>): void;
40
+ export declare function bootstrapAppScopedEarlyEventContract(container: HTMLElement, appId: string, bubbleEventTypes: string[], captureEventTypes: string[], dataContainer?: EarlyJsactionDataContainer): void;
41
+
42
+ /** Clear the early event contract. */
43
+ export declare function clearAppScopedEarlyEventContract(appId: string, dataContainer?: EarlyJsactionDataContainer): void;
48
44
 
49
45
  /** Clones an `EventInfo` */
50
46
  declare function cloneEventInfo(eventInfo: EventInfo): EventInfo;
@@ -83,18 +79,23 @@ declare type Dispatcher = (eventInfo: eventInfoLib.EventInfo, globalDispatch?: b
83
79
  declare interface EarlyJsactionData {
84
80
  /** List used to keep track of the early JSAction event types. */
85
81
  et: string[];
86
- /** List used to keep track of capture event types. */
82
+ /** List used to keep track of the early JSAction capture event types. */
87
83
  etc: string[];
88
- /** List used to keep track of the JSAction events if using earlyeventcontract. */
89
- q: EventInfo[];
90
- /** Early Jsaction handler. */
84
+ /** Early JSAction handler for all events. */
91
85
  h: (event: Event) => void;
86
+ /** Dispatcher handler. Initializes to populating `q`. */
87
+ d: (eventInfo: EventInfo) => void;
88
+ /** List used to push `EventInfo` objects if the dispatcher is not registered. */
89
+ q: EventInfo[];
92
90
  /** Container for listening to events. */
93
91
  c: HTMLElement;
94
92
  }
95
93
 
96
94
  export declare interface EarlyJsactionDataContainer {
97
95
  _ejsa?: EarlyJsactionData;
96
+ _ejsas?: {
97
+ [appId: string]: EarlyJsactionData | undefined;
98
+ };
98
99
  }
99
100
 
100
101
  /**
@@ -112,8 +113,6 @@ export declare interface EarlyJsactionDataContainer {
112
113
  * be delay loaded in a generic way.
113
114
  */
114
115
  export declare class EventContract implements UnrenamedEventContract {
115
- private readonly useActionResolver?;
116
- static A11Y_CLICK_SUPPORT: boolean;
117
116
  static MOUSE_SPECIAL_SUPPORT: boolean;
118
117
  private containerManager;
119
118
  /**
@@ -138,7 +137,7 @@ export declare class EventContract implements UnrenamedEventContract {
138
137
  * as soon as the `Dispatcher` is registered.
139
138
  */
140
139
  private queuedEventInfos;
141
- constructor(containerManager: EventContractContainerManager, useActionResolver?: false | undefined);
140
+ constructor(containerManager: EventContractContainerManager);
142
141
  private handleEvent;
143
142
  /**
144
143
  * Handle an `EventInfo`.
@@ -163,7 +162,12 @@ export declare class EventContract implements UnrenamedEventContract {
163
162
  * in the provided event contract. Once all the events are replayed, it cleans
164
163
  * up the early contract.
165
164
  */
166
- replayEarlyEvents(earlyJsactionContainer?: EarlyJsactionDataContainer): void;
165
+ replayEarlyEvents(earlyJsactionData?: EarlyJsactionData | undefined): void;
166
+ /**
167
+ * Replays all the early `EventInfo` objects, dispatching them through the normal
168
+ * `EventContract` flow.
169
+ */
170
+ replayEarlyEventInfos(earlyEventInfos: eventInfoLib.EventInfo[]): void;
167
171
  /**
168
172
  * Returns all JSAction event types that have been registered for a given
169
173
  * browser event type.
@@ -195,16 +199,6 @@ export declare class EventContract implements UnrenamedEventContract {
195
199
  * units.
196
200
  */
197
201
  ecrd(dispatcher: Dispatcher, restriction: Restriction): void;
198
- /**
199
- * Adds a11y click support to the given `EventContract`. Meant to be called in
200
- * the same compilation unit as the `EventContract`.
201
- */
202
- addA11yClickSupport(): void;
203
- /**
204
- * Enables a11y click support to be deferred. Meant to be called in the same
205
- * compilation unit as the `EventContract`.
206
- */
207
- exportAddA11yClickSupport(): void;
208
202
  }
209
203
 
210
204
  /**
@@ -246,12 +240,6 @@ declare interface EventContractContainerManager {
246
240
  cleanUp(): void;
247
241
  }
248
242
 
249
- export declare type EventContractTracker<T> = {
250
- [key: string]: {
251
- [appId: string]: T;
252
- };
253
- };
254
-
255
243
  /**
256
244
  * A dispatcher that uses browser-based `Event` semantics, for example bubbling, `stopPropagation`,
257
245
  * `currentTarget`, etc.
@@ -396,12 +384,23 @@ declare function getA11yClickKey(eventInfo: EventInfo): boolean | undefined;
396
384
  /** Added for readability when accessing stable property names. */
397
385
  declare function getAction(eventInfo: EventInfo): ActionInfoInternal | undefined;
398
386
 
387
+ /**
388
+ * Reads the jsaction parser cache for the given DOM element. If no cache is yet present,
389
+ * creates an empty one.
390
+ */
391
+ export declare function getActionCache(element: Element): {
392
+ [key: string]: string | undefined;
393
+ };
394
+
399
395
  /** Added for readability when accessing stable property names. */
400
396
  declare function getActionElement(actionInfo: ActionInfoInternal): Element;
401
397
 
402
398
  /** Added for readability when accessing stable property names. */
403
399
  declare function getActionName(actionInfo: ActionInfoInternal): string;
404
400
 
401
+ /** Get the queued `EventInfo` objects that were dispatched before a dispatcher was registered. */
402
+ export declare function getAppScopedQueuedEventInfos(appId: string, dataContainer?: EarlyJsactionDataContainer): EventInfo[];
403
+
405
404
  /** Added for readability when accessing stable property names. */
406
405
  declare function getContainer(eventInfo: EventInfo): Element;
407
406
 
@@ -424,18 +423,22 @@ declare function getTargetElement(eventInfo: EventInfo): Element;
424
423
  declare function getTimestamp(eventInfo: EventInfo): number;
425
424
 
426
425
  /**
427
- *
428
- * Decides whether or not an event type is an event that only has a capture phase.
429
- *
426
+ * Whether or not an event type should be registered in the capture phase.
430
427
  * @param eventType
431
428
  * @returns bool
432
429
  */
433
- export declare const isCaptureEvent: (eventType: string) => boolean;
430
+ export declare const isCaptureEventType: (eventType: string) => boolean;
431
+
432
+ /**
433
+ * Whether or not an event type is registered in the early contract.
434
+ */
435
+ export declare const isEarlyEventType: (eventType: string) => boolean;
434
436
 
435
437
  /**
436
- * Detects whether a given event type is supported by JSAction.
438
+ * Registers a dispatcher function on the `EarlyJsactionData` present on the nested object on the
439
+ * window.
437
440
  */
438
- export declare const isSupportedEvent: (eventType: string) => boolean;
441
+ export declare function registerAppScopedDispatcher(restriction: Restriction, appId: string, dispatcher: (eventInfo: EventInfo) => void, dataContainer?: EarlyJsactionDataContainer): void;
439
442
 
440
443
  /**
441
444
  * Registers deferred functionality for an EventContract and a Jsaction
@@ -443,8 +446,8 @@ export declare const isSupportedEvent: (eventType: string) => boolean;
443
446
  */
444
447
  export declare function registerDispatcher(eventContract: UnrenamedEventContract, dispatcher: EventDispatcher): void;
445
448
 
446
-
447
- export declare function registerEventType(element: Element, eventType: string, action: string): void;
449
+ /** Removes all event listener handlers. */
450
+ export declare function removeAllAppScopedEventListeners(appId: string, dataContainer?: EarlyJsactionDataContainer): void;
448
451
 
449
452
 
450
453
  /**
@@ -481,8 +484,6 @@ declare function setTargetElement(eventInfo: EventInfo, targetElement: Element):
481
484
  /** Added for readability when accessing stable property names. */
482
485
  declare function setTimestamp(eventInfo: EventInfo, timestamp: number): void;
483
486
 
484
- export declare function unregisterEventType(element: Element, eventType: string): void;
485
-
486
487
  /**
487
488
  * The API of an EventContract that is safe to call from any compilation unit.
488
489
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v18.1.0
2
+ * @license Angular v18.1.2
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v18.1.0
2
+ * @license Angular v18.1.2
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -8626,6 +8626,7 @@ var CHAINABLE = /* @__PURE__ */ new Set([
8626
8626
  Identifiers.twoWayListener,
8627
8627
  Identifiers.declareLet
8628
8628
  ]);
8629
+ var MAX_CHAIN_LENGTH = 256;
8629
8630
  function chain(job) {
8630
8631
  for (const unit of job.units) {
8631
8632
  chainOperationsInList(unit.create);
@@ -8648,16 +8649,18 @@ function chainOperationsInList(opList) {
8648
8649
  chain2 = null;
8649
8650
  continue;
8650
8651
  }
8651
- if (chain2 !== null && chain2.instruction === instruction) {
8652
+ if (chain2 !== null && chain2.instruction === instruction && chain2.length < MAX_CHAIN_LENGTH) {
8652
8653
  const expression = chain2.expression.callFn(op.statement.expr.args, op.statement.expr.sourceSpan, op.statement.expr.pure);
8653
8654
  chain2.expression = expression;
8654
8655
  chain2.op.statement = expression.toStmt();
8656
+ chain2.length++;
8655
8657
  OpList.remove(op);
8656
8658
  } else {
8657
8659
  chain2 = {
8658
8660
  op,
8659
8661
  instruction,
8660
- expression: op.statement.expr
8662
+ expression: op.statement.expr,
8663
+ length: 1
8661
8664
  };
8662
8665
  }
8663
8666
  }
@@ -14420,7 +14423,7 @@ var _Tokenizer = class {
14420
14423
  const nameCursor = this._cursor.clone();
14421
14424
  let allowDigit = false;
14422
14425
  this._attemptCharCodeUntilFn((code) => {
14423
- if (isAsciiLetter(code) || code == $$ || code === $_ || allowDigit && isDigit(code)) {
14426
+ if (isAsciiLetter(code) || code === $$ || code === $_ || allowDigit && isDigit(code)) {
14424
14427
  allowDigit = true;
14425
14428
  return false;
14426
14429
  }
@@ -23078,6 +23081,7 @@ function convertQueryPredicate(predicate) {
23078
23081
  return Array.isArray(predicate) ? predicate : createMayBeForwardRefExpression(new WrappedNodeExpr(predicate), 1);
23079
23082
  }
23080
23083
  function convertDirectiveFacadeToMetadata(facade) {
23084
+ var _a2;
23081
23085
  const inputsFromMetadata = parseInputsArray(facade.inputs || []);
23082
23086
  const outputsFromMetadata = parseMappingStringArray(facade.outputs || []);
23083
23087
  const propMetadata = facade.propMetadata;
@@ -23100,6 +23104,19 @@ function convertDirectiveFacadeToMetadata(facade) {
23100
23104
  });
23101
23105
  }
23102
23106
  }
23107
+ const hostDirectives = ((_a2 = facade.hostDirectives) == null ? void 0 : _a2.length) ? facade.hostDirectives.map((hostDirective) => {
23108
+ return typeof hostDirective === "function" ? {
23109
+ directive: wrapReference(hostDirective),
23110
+ inputs: null,
23111
+ outputs: null,
23112
+ isForwardReference: false
23113
+ } : {
23114
+ directive: wrapReference(hostDirective.directive),
23115
+ isForwardReference: false,
23116
+ inputs: hostDirective.inputs ? parseMappingStringArray(hostDirective.inputs) : null,
23117
+ outputs: hostDirective.outputs ? parseMappingStringArray(hostDirective.outputs) : null
23118
+ };
23119
+ }) : null;
23103
23120
  return __spreadProps(__spreadValues({}, facade), {
23104
23121
  typeArgumentCount: 0,
23105
23122
  typeSourceSpan: facade.typeSourceSpan,
@@ -23112,31 +23129,37 @@ function convertDirectiveFacadeToMetadata(facade) {
23112
23129
  providers: facade.providers != null ? new WrappedNodeExpr(facade.providers) : null,
23113
23130
  viewQueries: facade.viewQueries.map(convertToR3QueryMetadata),
23114
23131
  fullInheritance: false,
23115
- hostDirectives: convertHostDirectivesToMetadata(facade)
23132
+ hostDirectives
23116
23133
  });
23117
23134
  }
23118
23135
  function convertDeclareDirectiveFacadeToMetadata(declaration, typeSourceSpan) {
23119
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i;
23136
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i, _j;
23137
+ const hostDirectives = ((_a2 = declaration.hostDirectives) == null ? void 0 : _a2.length) ? declaration.hostDirectives.map((dir) => ({
23138
+ directive: wrapReference(dir.directive),
23139
+ isForwardReference: false,
23140
+ inputs: dir.inputs ? getHostDirectiveBindingMapping(dir.inputs) : null,
23141
+ outputs: dir.outputs ? getHostDirectiveBindingMapping(dir.outputs) : null
23142
+ })) : null;
23120
23143
  return {
23121
23144
  name: declaration.type.name,
23122
23145
  type: wrapReference(declaration.type),
23123
23146
  typeSourceSpan,
23124
- selector: (_a2 = declaration.selector) != null ? _a2 : null,
23147
+ selector: (_b2 = declaration.selector) != null ? _b2 : null,
23125
23148
  inputs: declaration.inputs ? inputsPartialMetadataToInputMetadata(declaration.inputs) : {},
23126
- outputs: (_b2 = declaration.outputs) != null ? _b2 : {},
23149
+ outputs: (_c2 = declaration.outputs) != null ? _c2 : {},
23127
23150
  host: convertHostDeclarationToMetadata(declaration.host),
23128
- queries: ((_c2 = declaration.queries) != null ? _c2 : []).map(convertQueryDeclarationToMetadata),
23129
- viewQueries: ((_d2 = declaration.viewQueries) != null ? _d2 : []).map(convertQueryDeclarationToMetadata),
23151
+ queries: ((_d2 = declaration.queries) != null ? _d2 : []).map(convertQueryDeclarationToMetadata),
23152
+ viewQueries: ((_e2 = declaration.viewQueries) != null ? _e2 : []).map(convertQueryDeclarationToMetadata),
23130
23153
  providers: declaration.providers !== void 0 ? new WrappedNodeExpr(declaration.providers) : null,
23131
- exportAs: (_e2 = declaration.exportAs) != null ? _e2 : null,
23132
- usesInheritance: (_f2 = declaration.usesInheritance) != null ? _f2 : false,
23133
- lifecycle: { usesOnChanges: (_g2 = declaration.usesOnChanges) != null ? _g2 : false },
23154
+ exportAs: (_f2 = declaration.exportAs) != null ? _f2 : null,
23155
+ usesInheritance: (_g2 = declaration.usesInheritance) != null ? _g2 : false,
23156
+ lifecycle: { usesOnChanges: (_h2 = declaration.usesOnChanges) != null ? _h2 : false },
23134
23157
  deps: null,
23135
23158
  typeArgumentCount: 0,
23136
23159
  fullInheritance: false,
23137
- isStandalone: (_h2 = declaration.isStandalone) != null ? _h2 : false,
23138
- isSignal: (_i = declaration.isSignal) != null ? _i : false,
23139
- hostDirectives: convertHostDirectivesToMetadata(declaration)
23160
+ isStandalone: (_i = declaration.isStandalone) != null ? _i : false,
23161
+ isSignal: (_j = declaration.isSignal) != null ? _j : false,
23162
+ hostDirectives
23140
23163
  };
23141
23164
  }
23142
23165
  function convertHostDeclarationToMetadata(host = {}) {
@@ -23151,24 +23174,13 @@ function convertHostDeclarationToMetadata(host = {}) {
23151
23174
  }
23152
23175
  };
23153
23176
  }
23154
- function convertHostDirectivesToMetadata(metadata) {
23155
- var _a2;
23156
- if ((_a2 = metadata.hostDirectives) == null ? void 0 : _a2.length) {
23157
- return metadata.hostDirectives.map((hostDirective) => {
23158
- return typeof hostDirective === "function" ? {
23159
- directive: wrapReference(hostDirective),
23160
- inputs: null,
23161
- outputs: null,
23162
- isForwardReference: false
23163
- } : {
23164
- directive: wrapReference(hostDirective.directive),
23165
- isForwardReference: false,
23166
- inputs: hostDirective.inputs ? parseMappingStringArray(hostDirective.inputs) : null,
23167
- outputs: hostDirective.outputs ? parseMappingStringArray(hostDirective.outputs) : null
23168
- };
23169
- });
23177
+ function getHostDirectiveBindingMapping(array) {
23178
+ let result = null;
23179
+ for (let i = 1; i < array.length; i += 2) {
23180
+ result = result || {};
23181
+ result[array[i - 1]] = array[i];
23170
23182
  }
23171
- return null;
23183
+ return result;
23172
23184
  }
23173
23185
  function convertOpaqueValuesToExpressions(obj) {
23174
23186
  const result = {};
@@ -23439,7 +23451,7 @@ function publishFacade(global) {
23439
23451
  }
23440
23452
 
23441
23453
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/version.mjs
23442
- var VERSION2 = new Version("18.1.0");
23454
+ var VERSION2 = new Version("18.1.2");
23443
23455
 
23444
23456
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
23445
23457
  var _VisitorMode;