@ethlete/core 4.18.4 → 4.19.1
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.
- package/CHANGELOG.md +12 -0
- package/esm2022/lib/components/structured-data/structured-data.component.mjs +3 -3
- package/esm2022/lib/directives/animatable/animatable.directive.mjs +3 -3
- package/esm2022/lib/directives/animated-if/animated-if.directive.mjs +3 -3
- package/esm2022/lib/directives/animated-lifecycle/animated-lifecycle.directive.mjs +3 -3
- package/esm2022/lib/directives/animated-overlay/animated-overlay.directive.mjs +3 -3
- package/esm2022/lib/directives/click-outside/click-outside.directive.mjs +3 -3
- package/esm2022/lib/directives/cursor-drag-scroll/cursor-drag-scroll.directive.mjs +3 -3
- package/esm2022/lib/directives/debug/debug.directive.mjs +3 -3
- package/esm2022/lib/directives/delayable/delayable.directive.mjs +3 -3
- package/esm2022/lib/directives/is-active-element/is-active-element.directive.mjs +3 -3
- package/esm2022/lib/directives/is-element/is-element.directive.mjs +3 -3
- package/esm2022/lib/directives/let/let.directive.mjs +3 -3
- package/esm2022/lib/directives/observe-content/observe-content.directive.mjs +3 -3
- package/esm2022/lib/directives/observe-resize/observe-resize.directive.mjs +3 -3
- package/esm2022/lib/directives/observe-scroll-state/observe-scroll-state.directive.mjs +3 -3
- package/esm2022/lib/directives/observe-visibility/observe-visibility.directive.mjs +3 -3
- package/esm2022/lib/directives/repeat/repeat.directive.mjs +3 -3
- package/esm2022/lib/directives/root-boundary/root-boundary.directive.mjs +3 -3
- package/esm2022/lib/directives/scroll-observer-first-element/scroll-observer-first-element.directive.mjs +3 -3
- package/esm2022/lib/directives/scroll-observer-ignore-target/scroll-observer-ignore-target.directive.mjs +3 -3
- package/esm2022/lib/directives/scroll-observer-last-element/scroll-observer-last-element.directive.mjs +3 -3
- package/esm2022/lib/directives/seo/seo.directive.mjs +3 -3
- package/esm2022/lib/pipes/infer-mime-type/infer-mime-type.pipe.mjs +3 -3
- package/esm2022/lib/pipes/normalize-game-result-type/normalize-game-result-type.pipe.mjs +3 -3
- package/esm2022/lib/pipes/normalize-match-participants/normalize-match-participants.pipe.mjs +3 -3
- package/esm2022/lib/pipes/normalize-match-score/normalize-match-score.pipe.mjs +3 -3
- package/esm2022/lib/pipes/normalize-match-state/normalize-match-state.pipe.mjs +3 -3
- package/esm2022/lib/pipes/normalize-match-type/normalize-match-type.pipe.mjs +3 -3
- package/esm2022/lib/pipes/to-array/to-array.pipe.mjs +3 -3
- package/esm2022/lib/props/props.directive.mjs +3 -3
- package/esm2022/lib/services/click-observer.service.mjs +6 -6
- package/esm2022/lib/services/content-observer.service.mjs +6 -6
- package/esm2022/lib/services/focus-visible.service.mjs +3 -3
- package/esm2022/lib/services/intersection-observer.service.mjs +6 -6
- package/esm2022/lib/services/resize-observer.service.mjs +6 -6
- package/esm2022/lib/services/router-state.service.mjs +3 -3
- package/esm2022/lib/services/viewport.service.mjs +3 -3
- package/esm2022/lib/utils/signal.utils.mjs +82 -55
- package/fesm2022/ethlete-core.mjs +205 -178
- package/fesm2022/ethlete-core.mjs.map +1 -1
- package/lib/utils/signal.utils.d.ts +38 -21
- package/package.json +7 -7
|
@@ -74,36 +74,48 @@ export interface LogicalSize {
|
|
|
74
74
|
inlineSize: number;
|
|
75
75
|
blockSize: number;
|
|
76
76
|
}
|
|
77
|
-
export
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
77
|
+
export type ElementRect = {
|
|
78
|
+
bottom: number;
|
|
79
|
+
height: number;
|
|
80
|
+
left: number;
|
|
81
|
+
right: number;
|
|
82
|
+
top: number;
|
|
83
|
+
width: number;
|
|
84
|
+
x: number;
|
|
85
|
+
y: number;
|
|
86
|
+
};
|
|
87
|
+
export type ElementSize = {
|
|
88
|
+
width: number;
|
|
89
|
+
height: number;
|
|
90
|
+
};
|
|
91
|
+
export declare const boundingClientRectToElementRect: (rect: DOMRectReadOnly) => ElementRect;
|
|
92
|
+
export declare const createElementDimensions: (el: HTMLElement | null, rect?: DOMRect) => NullableElementDimensions;
|
|
93
|
+
export type ElementDimensions = {
|
|
94
|
+
rect: ElementRect;
|
|
95
|
+
client: ElementSize;
|
|
96
|
+
scroll: ElementSize;
|
|
97
|
+
offset: ElementSize;
|
|
98
|
+
};
|
|
99
|
+
export type NullableElementDimensions = {
|
|
100
|
+
[K in keyof ElementDimensions]: ElementDimensions[K] | null;
|
|
101
|
+
};
|
|
102
|
+
export declare const signalElementDimensions: (el: SignalElementBindingType) => Signal<NullableElementDimensions>;
|
|
103
|
+
export declare const signalHostElementDimensions: () => Signal<NullableElementDimensions>;
|
|
85
104
|
export declare const signalElementMutations: (el: SignalElementBindingType, options?: MutationObserverInit) => Signal<MutationRecord | null>;
|
|
86
105
|
export declare const signalHostElementMutations: (options?: MutationObserverInit) => Signal<MutationRecord | null>;
|
|
87
106
|
export type SignalElementScrollStateOptions = {
|
|
88
107
|
/** The initial scroll position to scroll to. Once a truthy value get's emitted, all further values will be ignored. */
|
|
89
108
|
initialScrollPosition?: Signal<ScrollToOptions | null>;
|
|
90
109
|
};
|
|
91
|
-
export
|
|
110
|
+
export type ElementScrollState = {
|
|
92
111
|
canScroll: boolean;
|
|
93
112
|
canScrollHorizontally: boolean;
|
|
94
113
|
canScrollVertically: boolean;
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
export declare const signalHostElementScrollState: () => Signal<
|
|
100
|
-
canScroll: boolean;
|
|
101
|
-
canScrollHorizontally: boolean;
|
|
102
|
-
canScrollVertically: boolean;
|
|
103
|
-
scrollWidth: number | null;
|
|
104
|
-
scrollHeight: number | null;
|
|
105
|
-
elementDimensions: ElementDimensions;
|
|
106
|
-
}>;
|
|
114
|
+
elementDimensions: NullableElementDimensions;
|
|
115
|
+
};
|
|
116
|
+
export declare const areScrollStatesEqual: (a: ElementScrollState, b: ElementScrollState) => boolean;
|
|
117
|
+
export declare const signalElementScrollState: (el: SignalElementBindingType, options?: SignalElementScrollStateOptions) => Signal<ElementScrollState>;
|
|
118
|
+
export declare const signalHostElementScrollState: () => Signal<ElementScrollState>;
|
|
107
119
|
export type SignalElementIntersectionOptions = Omit<IntersectionObserverInit, 'root'> & {
|
|
108
120
|
root?: SignalElementBindingType;
|
|
109
121
|
enabled?: Signal<boolean>;
|
|
@@ -205,6 +217,11 @@ export declare const computedTillTruthy: <T>(source: Signal<T>) => Signal<T | nu
|
|
|
205
217
|
* All subsequent changes inside the computation will be ignored.
|
|
206
218
|
*/
|
|
207
219
|
export declare const computedTillFalsy: <T>(source: Signal<T>) => Signal<T | null>;
|
|
220
|
+
/**
|
|
221
|
+
* A writeable signal that will be set to the provided value once all inputs are set.
|
|
222
|
+
* During that time, the signal will be set to `null`.
|
|
223
|
+
*/
|
|
224
|
+
export declare const deferredSignal: <T extends () => unknown>(valueFn: T) => WritableSignal<ReturnType<T> | null>;
|
|
208
225
|
/** Inject a signal containing a boolean value indicating if the viewport is xs */
|
|
209
226
|
export declare const injectIsXs: () => Signal<boolean>;
|
|
210
227
|
/** Inject a signal containing a boolean value indicating if the viewport is sm */
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ethlete/core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.19.1",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@angular/cdk": "17.3.
|
|
6
|
-
"@angular/common": "17.3.
|
|
7
|
-
"@angular/core": "17.3.
|
|
8
|
-
"@angular/forms": "17.3.
|
|
9
|
-
"@angular/platform-browser": "17.3.
|
|
10
|
-
"@angular/router": "17.3.
|
|
5
|
+
"@angular/cdk": "17.3.9",
|
|
6
|
+
"@angular/common": "17.3.9",
|
|
7
|
+
"@angular/core": "17.3.9",
|
|
8
|
+
"@angular/forms": "17.3.9",
|
|
9
|
+
"@angular/platform-browser": "17.3.9",
|
|
10
|
+
"@angular/router": "17.3.9",
|
|
11
11
|
"@ethlete/theming": "^2.3.1",
|
|
12
12
|
"@ethlete/types": "^1.6.2",
|
|
13
13
|
"@floating-ui/dom": "^1.5.3",
|