@ethlete/core 4.14.0 → 4.16.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 (45) hide show
  1. package/CHANGELOG.md +20 -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 +3 -3
  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/scrollable.utils.mjs +17 -6
  40. package/esm2022/lib/utils/signal.utils.mjs +276 -85
  41. package/fesm2022/ethlete-core.mjs +412 -211
  42. package/fesm2022/ethlete-core.mjs.map +1 -1
  43. package/lib/utils/scrollable.utils.d.ts +1 -0
  44. package/lib/utils/signal.utils.d.ts +21 -7
  45. package/package.json +6 -6
@@ -38,6 +38,7 @@ export interface CurrentElementVisibility {
38
38
  element: HTMLElement;
39
39
  }
40
40
  export declare const isElementVisible: (options: IsElementVisibleOptions) => CurrentElementVisibility | null;
41
+ export declare const getElementScrollCoordinates: (options: ScrollToElementOptions) => ScrollToOptions;
41
42
  export interface ScrollToElementOptions {
42
43
  /**
43
44
  * The element to scroll to.
@@ -85,10 +85,7 @@ export declare const signalElementMutations: (el: SignalElementBindingType, opti
85
85
  export declare const signalHostElementMutations: (options?: MutationObserverInit) => Signal<MutationRecord | null>;
86
86
  export type SignalElementScrollStateOptions = {
87
87
  /** The initial scroll position to scroll to. Once a truthy value get's emitted, all further values will be ignored. */
88
- initialScrollPosition?: Signal<{
89
- x: number;
90
- y: number;
91
- } | null>;
88
+ initialScrollPosition?: Signal<ScrollToOptions | null>;
92
89
  };
93
90
  export declare const signalElementScrollState: (el: SignalElementBindingType, options?: SignalElementScrollStateOptions) => Signal<{
94
91
  canScroll: boolean;
@@ -108,10 +105,10 @@ export declare const signalHostElementScrollState: () => Signal<{
108
105
  }>;
109
106
  export type SignalElementIntersectionOptions = Omit<IntersectionObserverInit, 'root'> & {
110
107
  root?: SignalElementBindingType;
111
- enabled?: Signal<unknown>;
108
+ enabled?: Signal<boolean>;
112
109
  };
113
- export declare const signalElementIntersection: (el: SignalElementBindingType, options?: SignalElementIntersectionOptions) => WritableSignal<IntersectionObserverEntry[]>;
114
- export declare const signalHostElementIntersection: (options?: SignalElementIntersectionOptions) => WritableSignal<IntersectionObserverEntry[]>;
110
+ export declare const signalElementIntersection: (el: SignalElementBindingType, options?: SignalElementIntersectionOptions) => Signal<IntersectionObserverEntry[]>;
111
+ export declare const signalHostElementIntersection: (options?: SignalElementIntersectionOptions) => Signal<IntersectionObserverEntry[]>;
115
112
  export declare const signalElementChildren: (el: SignalElementBindingType) => Signal<HTMLElement[]>;
116
113
  export declare const previousSignalValue: <T>(signal: Signal<T>) => Signal<T | undefined>;
117
114
  export declare const syncSignal: <T>(from: Signal<T>, to: WritableSignal<T>) => void;
@@ -180,4 +177,21 @@ export declare const createIsRenderedSignal: () => {
180
177
  export declare const createCanAnimateSignal: () => {
181
178
  state: WritableSignal<boolean>;
182
179
  };
180
+ export type CursorDragScrollDirection = 'horizontal' | 'vertical' | 'both';
181
+ export type MaybeSignal<T> = T | Signal<T>;
182
+ export declare const maybeSignalValue: <T>(value: MaybeSignal<T>) => T;
183
+ export type CursorDragScrollOptions = {
184
+ /** If true, cursor drag scrolling will be enabled. */
185
+ enabled?: Signal<boolean>;
186
+ /** The allowed scroll direction. */
187
+ allowedDirection?: MaybeSignal<CursorDragScrollDirection>;
188
+ };
189
+ /** A function to apply cursor drag scroll behavior to an element. */
190
+ export declare const useCursorDragScroll: (el: SignalElementBindingType, options?: CursorDragScrollOptions) => {
191
+ isDragging: Signal<boolean>;
192
+ currentDragAmount: Signal<{
193
+ x: number;
194
+ y: number;
195
+ }>;
196
+ };
183
197
  export {};
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@ethlete/core",
3
- "version": "4.14.0",
3
+ "version": "4.16.0",
4
4
  "peerDependencies": {
5
5
  "@angular/cdk": "17.3.6",
6
- "@angular/common": "17.3.6",
7
- "@angular/core": "17.3.6",
8
- "@angular/forms": "17.3.6",
9
- "@angular/platform-browser": "17.3.6",
10
- "@angular/router": "17.3.6",
6
+ "@angular/common": "17.3.7",
7
+ "@angular/core": "17.3.7",
8
+ "@angular/forms": "17.3.7",
9
+ "@angular/platform-browser": "17.3.7",
10
+ "@angular/router": "17.3.7",
11
11
  "@ethlete/theming": "^2.3.1",
12
12
  "@ethlete/types": "^1.6.2",
13
13
  "@floating-ui/dom": "^1.5.3",