@ethlete/core 5.0.0-next.1 → 5.0.0-next.3

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 CHANGED
@@ -1,5 +1,21 @@
1
1
  # @ethlete/core
2
2
 
3
+ ## 5.0.0-next.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`58525cd`](https://github.com/ethlete-io/ethdk/commit/58525cd7123c8e20739b0841b2f0abf5920296f1) Thanks [@TomTomB](https://github.com/TomTomB)! - Fix error NG0600 created by using the focus visible provider
8
+
9
+ ## 5.0.0-next.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [`95e656d`](https://github.com/ethlete-io/ethdk/commit/95e656d036368a48cbd17a399f7c0c61c49ab0fa) Thanks [@TomTomB](https://github.com/TomTomB)! - Fix angular root element discovery failing if its not there during the first check
14
+
15
+ - [`95e656d`](https://github.com/ethlete-io/ethdk/commit/95e656d036368a48cbd17a399f7c0c61c49ab0fa) Thanks [@TomTomB](https://github.com/TomTomB)! - Fix animated lifecycle skipping interrupted transitions
16
+
17
+ - [`95e656d`](https://github.com/ethlete-io/ethdk/commit/95e656d036368a48cbd17a399f7c0c61c49ab0fa) Thanks [@TomTomB](https://github.com/TomTomB)! - Fix scrollbar dimensions signal not returning the actual scrollbar dimensions
18
+
3
19
  ## 5.0.0-next.1
4
20
 
5
21
  ### Patch Changes
@@ -1565,9 +1565,18 @@ const injectScrollbarDimensions = memoizeSignal(() => {
1565
1565
  scrollbarRuler.style.overflow = 'scroll';
1566
1566
  scrollbarRuler.style.position = 'absolute';
1567
1567
  scrollbarRuler.style.top = '-9999px';
1568
+ scrollbarRuler.style.scrollbarWidth = getComputedStyle(document.documentElement).scrollbarWidth;
1568
1569
  renderer.appendChild(document.body, scrollbarRuler);
1569
1570
  const scrollContainerDimensions = signalElementDimensions(scrollbarRuler);
1570
- return scrollContainerDimensions;
1571
+ return computed(() => {
1572
+ const client = scrollContainerDimensions().client;
1573
+ if (!client)
1574
+ return null;
1575
+ return {
1576
+ width: Math.max(0, 100 - client.width),
1577
+ height: Math.max(0, 100 - client.height),
1578
+ };
1579
+ });
1571
1580
  });
1572
1581
 
1573
1582
  let hasWrittenScrollbarSizes = false;
@@ -1588,7 +1597,7 @@ const writeScrollbarSizeToCssVariables = () => {
1588
1597
  const renderer = injectRenderer();
1589
1598
  const scrollbarDimensions = injectScrollbarDimensions();
1590
1599
  effect(() => {
1591
- const dimensions = scrollbarDimensions().rect?.();
1600
+ const dimensions = scrollbarDimensions();
1592
1601
  if (!dimensions)
1593
1602
  return;
1594
1603
  renderer.setCssProperties(document.documentElement, {
@@ -2290,12 +2299,16 @@ const scrollToElement = (options) => {
2290
2299
  const [, injectAngularRootElement] = createRootProvider(() => {
2291
2300
  const appRef = inject(ApplicationRef);
2292
2301
  const rootElement = signal(null, ...(ngDevMode ? [{ debugName: "rootElement" }] : []));
2293
- setTimeout(() => {
2302
+ const poll = () => {
2294
2303
  const appComponents = appRef.components;
2295
2304
  if (appComponents.length > 0) {
2296
2305
  rootElement.set(appComponents[0]?.location.nativeElement);
2297
2306
  }
2298
- });
2307
+ else {
2308
+ setTimeout(poll, 25);
2309
+ }
2310
+ };
2311
+ setTimeout(poll);
2299
2312
  return rootElement;
2300
2313
  });
2301
2314
 
@@ -2394,20 +2407,20 @@ const [provideFocusVisibleTracker, injectFocusVisibleTracker, FOCUS_VISIBLE_TRAC
2394
2407
  const onKeyDown = (e) => {
2395
2408
  if (e.key === 'Tab' || e.key === 'Shift' || e.key === 'Meta' || e.key === 'Alt' || e.key === 'Control') {
2396
2409
  hadKeyboardEvent = true;
2397
- isFocusVisible.set(true);
2410
+ queueMicrotask(() => isFocusVisible.set(true));
2398
2411
  }
2399
2412
  };
2400
2413
  const onPointerDown = () => {
2401
2414
  hadKeyboardEvent = false;
2402
- isFocusVisible.set(false);
2415
+ queueMicrotask(() => isFocusVisible.set(false));
2403
2416
  };
2404
2417
  const onFocus = () => {
2405
2418
  if (hadKeyboardEvent) {
2406
- isFocusVisible.set(true);
2419
+ queueMicrotask(() => isFocusVisible.set(true));
2407
2420
  }
2408
2421
  };
2409
2422
  const onBlur = () => {
2410
- isFocusVisible.set(false);
2423
+ queueMicrotask(() => isFocusVisible.set(false));
2411
2424
  };
2412
2425
  document.addEventListener('keydown', onKeyDown, true);
2413
2426
  document.addEventListener('mousedown', onPointerDown, true);
@@ -2838,7 +2851,7 @@ class AnimatedLifecycleDirective {
2838
2851
  const { removeClasses, addClasses, expectedState, transitionId, onComplete, cancelSignal } = config;
2839
2852
  this.removeClasses(...removeClasses);
2840
2853
  addClasses.forEach((cls) => this.addClass(cls));
2841
- timer(0)
2854
+ fromNextFrame()
2842
2855
  .pipe(switchMap(() => this.animatable.isAnimating$), take(1), switchMap((isAnimating) => {
2843
2856
  if (!isAnimating && this.state$.value === expectedState) {
2844
2857
  return of({ cancelled: false, transitionId });