@ethlete/core 4.10.0 → 4.12.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 (46) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/esm2022/lib/components/structured-data/structured-data.component.mjs +3 -3
  3. package/esm2022/lib/directives/animatable/animatable.directive.mjs +3 -3
  4. package/esm2022/lib/directives/animated-if/animated-if.directive.mjs +3 -3
  5. package/esm2022/lib/directives/animated-lifecycle/animated-lifecycle.directive.mjs +6 -5
  6. package/esm2022/lib/directives/animated-overlay/animated-overlay.directive.mjs +3 -3
  7. package/esm2022/lib/directives/click-outside/click-outside.directive.mjs +3 -3
  8. package/esm2022/lib/directives/cursor-drag-scroll/cursor-drag-scroll.directive.mjs +3 -3
  9. package/esm2022/lib/directives/debug/debug.directive.mjs +3 -3
  10. package/esm2022/lib/directives/delayable/delayable.directive.mjs +3 -3
  11. package/esm2022/lib/directives/is-active-element/is-active-element.directive.mjs +3 -3
  12. package/esm2022/lib/directives/is-element/is-element.directive.mjs +3 -3
  13. package/esm2022/lib/directives/let/let.directive.mjs +3 -3
  14. package/esm2022/lib/directives/observe-content/observe-content.directive.mjs +3 -3
  15. package/esm2022/lib/directives/observe-resize/observe-resize.directive.mjs +3 -3
  16. package/esm2022/lib/directives/observe-scroll-state/observe-scroll-state.directive.mjs +3 -3
  17. package/esm2022/lib/directives/observe-visibility/observe-visibility.directive.mjs +3 -3
  18. package/esm2022/lib/directives/repeat/repeat.directive.mjs +3 -3
  19. package/esm2022/lib/directives/root-boundary/root-boundary.directive.mjs +3 -3
  20. package/esm2022/lib/directives/scroll-observer-first-element/scroll-observer-first-element.directive.mjs +3 -3
  21. package/esm2022/lib/directives/scroll-observer-ignore-target/scroll-observer-ignore-target.directive.mjs +3 -3
  22. package/esm2022/lib/directives/scroll-observer-last-element/scroll-observer-last-element.directive.mjs +3 -3
  23. package/esm2022/lib/directives/seo/seo.directive.mjs +3 -3
  24. package/esm2022/lib/pipes/infer-mime-type/infer-mime-type.pipe.mjs +3 -3
  25. package/esm2022/lib/pipes/normalize-game-result-type/normalize-game-result-type.pipe.mjs +3 -3
  26. package/esm2022/lib/pipes/normalize-match-participants/normalize-match-participants.pipe.mjs +3 -3
  27. package/esm2022/lib/pipes/normalize-match-score/normalize-match-score.pipe.mjs +3 -3
  28. package/esm2022/lib/pipes/normalize-match-state/normalize-match-state.pipe.mjs +3 -3
  29. package/esm2022/lib/pipes/normalize-match-type/normalize-match-type.pipe.mjs +3 -3
  30. package/esm2022/lib/pipes/to-array/to-array.pipe.mjs +3 -3
  31. package/esm2022/lib/props/props.directive.mjs +3 -3
  32. package/esm2022/lib/services/click-observer.service.mjs +6 -6
  33. package/esm2022/lib/services/content-observer.service.mjs +6 -6
  34. package/esm2022/lib/services/focus-visible.service.mjs +3 -3
  35. package/esm2022/lib/services/intersection-observer.service.mjs +6 -6
  36. package/esm2022/lib/services/resize-observer.service.mjs +6 -6
  37. package/esm2022/lib/services/router-state.service.mjs +3 -3
  38. package/esm2022/lib/services/viewport.service.mjs +3 -3
  39. package/esm2022/lib/utils/intersection-observer.utils.mjs +50 -12
  40. package/esm2022/lib/utils/signal.utils.mjs +70 -1
  41. package/fesm2022/ethlete-core.mjs +1601 -1494
  42. package/fesm2022/ethlete-core.mjs.map +1 -1
  43. package/lib/directives/animated-lifecycle/animated-lifecycle.directive.d.ts +3 -3
  44. package/lib/utils/intersection-observer.utils.d.ts +36 -10
  45. package/lib/utils/signal.utils.d.ts +31 -1
  46. package/package.json +7 -7
@@ -2,7 +2,7 @@ import { AfterViewInit, InjectionToken } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
3
  import * as i1 from "../animatable/animatable.directive";
4
4
  export declare const ANIMATED_LIFECYCLE_TOKEN: InjectionToken<AnimatedLifecycleDirective>;
5
- type AnimatedLifecycleState = 'entering' | 'entered' | 'leaving' | 'left' | 'init';
5
+ export type AnimatedLifecycleState = 'entering' | 'entered' | 'leaving' | 'left' | 'init';
6
6
  export declare class AnimatedLifecycleDirective implements AfterViewInit {
7
7
  private readonly _destroy$;
8
8
  private readonly _elementRef;
@@ -19,6 +19,7 @@ export declare class AnimatedLifecycleDirective implements AfterViewInit {
19
19
  push: (tokenString: string, signal: import("@angular/core").Signal<unknown>) => void;
20
20
  pushMany: (map: Record<string, import("@angular/core").Signal<unknown>>) => void;
21
21
  };
22
+ stateChange: import("@angular/core").OutputRef<AnimatedLifecycleState>;
22
23
  skipNextEnter: import("@angular/core").ModelSignal<boolean>;
23
24
  ngAfterViewInit(): void;
24
25
  enter(config?: {
@@ -29,6 +30,5 @@ export declare class AnimatedLifecycleDirective implements AfterViewInit {
29
30
  }): void;
30
31
  _forceState(state: AnimatedLifecycleState): void;
31
32
  static ɵfac: i0.ɵɵFactoryDeclaration<AnimatedLifecycleDirective, never>;
32
- static ɵdir: i0.ɵɵDirectiveDeclaration<AnimatedLifecycleDirective, "[etAnimatedLifecycle]", ["etAnimatedLifecycle"], { "skipNextEnter": { "alias": "skipNextEnter"; "required": false; "isSignal": true; }; }, { "skipNextEnter": "skipNextEnterChange"; }, never, never, true, [{ directive: typeof i1.AnimatableDirective; inputs: {}; outputs: {}; }]>;
33
+ static ɵdir: i0.ɵɵDirectiveDeclaration<AnimatedLifecycleDirective, "[etAnimatedLifecycle]", ["etAnimatedLifecycle"], { "skipNextEnter": { "alias": "skipNextEnter"; "required": false; "isSignal": true; }; }, { "stateChange": "stateChange"; "skipNextEnter": "skipNextEnterChange"; }, never, never, true, [{ directive: typeof i1.AnimatableDirective; inputs: {}; outputs: {}; }]>;
33
34
  }
34
- export {};
@@ -1,14 +1,40 @@
1
- export declare const getFirstAndLastPartialIntersection: (intersections: IntersectionObserverEntry[]) => {
2
- first: {
3
- intersection: IntersectionObserverEntry;
4
- index: number;
1
+ export declare const getIntersectionInfo: (intersections: IntersectionObserverEntry[]) => {
2
+ partial: {
3
+ hasAny: boolean;
4
+ hasMultiple: boolean;
5
+ first: {
6
+ intersection: IntersectionObserverEntry;
7
+ index: number;
8
+ };
9
+ last: {
10
+ intersection: IntersectionObserverEntry;
11
+ index: number;
12
+ };
13
+ biggest: {
14
+ intersection: IntersectionObserverEntry;
15
+ index: number;
16
+ };
5
17
  };
6
- last: {
7
- intersection: IntersectionObserverEntry;
8
- index: number;
18
+ full: {
19
+ hasAny: boolean;
20
+ hasMultiple: boolean;
21
+ first: {
22
+ index: number;
23
+ intersection: IntersectionObserverEntry | undefined;
24
+ };
25
+ last: {
26
+ index: number;
27
+ intersection: IntersectionObserverEntry | undefined;
28
+ };
9
29
  };
10
- biggest: {
11
- intersection: IntersectionObserverEntry;
12
- index: number;
30
+ none: {
31
+ first: {
32
+ index: number;
33
+ intersection: IntersectionObserverEntry | undefined;
34
+ };
35
+ last: {
36
+ index: number;
37
+ intersection: IntersectionObserverEntry | undefined;
38
+ };
13
39
  };
14
40
  } | null;
@@ -1,4 +1,4 @@
1
- import { ElementRef, QueryList, Signal, WritableSignal } from '@angular/core';
1
+ import { ElementRef, Injector, QueryList, Signal, WritableSignal } from '@angular/core';
2
2
  import { FormArray, FormControl, FormGroup } from '@angular/forms';
3
3
  import { Observable } from 'rxjs';
4
4
  type SignalElementBindingComplexType = HTMLElement | ElementRef<HTMLElement> | QueryList<ElementRef<HTMLElement> | HTMLElement> | Array<ElementRef<HTMLElement> | HTMLElement> | null | undefined;
@@ -136,4 +136,34 @@ export interface DebouncedControlValueSignalOptions {
136
136
  * @deprecated Use `controlValueSignal` instead with `debounceTime` set to `300` and `debounceFirst` set to `true`.
137
137
  */
138
138
  export declare const debouncedControlValueSignal: <T extends FormControl<any>>(control: T, options?: DebouncedControlValueSignalOptions) => Signal<ReturnType<T["getRawValue"]>>;
139
+ export type InjectUtilConfig = {
140
+ /** The injector to use for the injection. Must be provided if the function is not called from within a injection context. */
141
+ injector?: Injector;
142
+ };
143
+ export type InjectUtilTransformConfig<In, Out> = {
144
+ /**
145
+ * A transform function similar to the `transform` function in Angular input bindings.
146
+ * Can be used to transform the value before it is returned.
147
+ * E.g. transforming `"true"` to `true` for a boolean attribute.
148
+ */
149
+ transform?: (value: In) => Out;
150
+ };
151
+ export declare const injectOrRunInContext: <T>(fn: () => T, config?: InjectUtilConfig) => T;
152
+ export declare const transformOrReturn: <In, Out>(src: Signal<In>, config?: InjectUtilTransformConfig<In, Out>) => Signal<Out>;
153
+ /** Inject a signal containing the current route fragment (the part after the # inside the url if present) */
154
+ export declare const injectFragment: <T = string | null>(config?: InjectUtilConfig & InjectUtilTransformConfig<string | null, T>) => Signal<T>;
155
+ /** Inject all currently available query parameters as a signal */
156
+ export declare const injectQueryParams: (config?: InjectUtilConfig) => Signal<import("@angular/router").Params>;
157
+ /** Inject all currently available route data as a signal */
158
+ export declare const injectRouteData: (config?: InjectUtilConfig) => Signal<import("@angular/router").Data>;
159
+ /** Inject the current route title as a signal */
160
+ export declare const injectRouteTitle: <T = string | null>(config?: InjectUtilConfig & InjectUtilTransformConfig<string | null, T>) => Signal<T>;
161
+ /** Inject all currently available path parameters as a signal */
162
+ export declare const injectPathParams: (config?: InjectUtilConfig) => Signal<import("@angular/router").Params>;
163
+ /** Inject a specific query parameter as a signal */
164
+ export declare const injectQueryParam: <T extends string>(key: string, config?: InjectUtilConfig & InjectUtilTransformConfig<string | null, T>) => Signal<T>;
165
+ /** Inject a specific route data item as a signal */
166
+ export declare const injectRouteDataItem: <T = unknown>(key: string, config?: InjectUtilConfig & InjectUtilTransformConfig<unknown, T>) => Signal<T>;
167
+ /** Inject a specific path parameter as a signal */
168
+ export declare const injectPathParam: <T = string | null>(key: string, config?: InjectUtilConfig & InjectUtilTransformConfig<string | null, T>) => Signal<T>;
139
169
  export {};
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@ethlete/core",
3
- "version": "4.10.0",
3
+ "version": "4.12.0",
4
4
  "peerDependencies": {
5
- "@angular/cdk": "17.3.3",
6
- "@angular/common": "17.3.3",
7
- "@angular/core": "17.3.3",
8
- "@angular/forms": "17.3.3",
9
- "@angular/platform-browser": "17.3.3",
10
- "@angular/router": "17.3.3",
5
+ "@angular/cdk": "17.3.6",
6
+ "@angular/common": "17.3.5",
7
+ "@angular/core": "17.3.5",
8
+ "@angular/forms": "17.3.5",
9
+ "@angular/platform-browser": "17.3.5",
10
+ "@angular/router": "17.3.5",
11
11
  "@ethlete/theming": "^2.3.1",
12
12
  "@ethlete/types": "^1.6.2",
13
13
  "@floating-ui/dom": "^1.5.3",