@ethlete/query-devtools 1.0.0-next.4 → 1.0.0-next.5

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,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.0-next.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [`4044a00`](https://github.com/ethlete-io/ethdk/commit/4044a0007de55d25b5a697c6e4190e21d68d022f) Thanks [@TomTomB](https://github.com/TomTomB)! - - Notifications: a toast keeps one elevation, paints above overlays, and keeps out of every reserved viewport edge.
8
+ - Query devtools: a side dock reserves the edge it covers.
9
+ - `SurfaceContextTracker` drops `topType` / `topElevation`.
10
+
11
+ - [`3122607`](https://github.com/ethlete-io/ethdk/commit/3122607d1727844a2d987032f45ad631f678c2ca) Thanks [@TomTomB](https://github.com/TomTomB)! - Overlays and floating chrome now keep out of space a surface above the page reserved with `reserveOverlayViewportSpace()` - so a dialog, menu or toast is no longer stacked under the docked query devtools panel.
12
+
3
13
  ## 1.0.0-next.4
4
14
 
5
15
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { signal, ViewEncapsulation, Component, input, output, computed, viewChild, effect, numberAttribute, linkedSignal, InjectionToken, inject, untracked, ElementRef, NgZone, DestroyRef, booleanAttribute } from '@angular/core';
3
- import { copyToClipboard, injectStyleManager, injectErrorTheme, ProvideColorDirective, clamp, injectRenderer, injectFileDownload, injectViewportSize, injectIsDocumentVisible, injectBreakpointObserver, signalElementDimensions, randomId, createObjectUrlHandle, DragHandleDirective, ResizeHandlesComponent } from '@ethlete/core';
3
+ import { copyToClipboard, injectStyleManager, injectErrorTheme, ProvideColorDirective, clamp, injectRenderer, injectFileDownload, injectViewportSize, injectIsDocumentVisible, injectBreakpointObserver, signalElementDimensions, randomId, reserveOverlayViewportSpace, createObjectUrlHandle, DragHandleDirective, ResizeHandlesComponent } from '@ethlete/core';
4
4
  import { queryDevtoolsAbout, hasQueryDevtoolsOverridesAtPath, detectPaginationShape, isDateShapedLeaf, generateQueryDevtoolsStringPreset, generateQueryDevtoolsNumberPreset, collectLeafPaths, armAllQueryDevtoolsMocks, clearQueryDevtoolsArmedMocks, clearQueryDevtoolsFaults, queryDevtoolsResponseHistory, queryDevtoolsMocks, queryDevtoolsArmedMocks, queryDevtoolsSettings, setQueryDevtoolsOverridesScope, setQueryDevtoolsArmedMocksScope, setQueryDevtoolsFaultsScope, setQueryDevtoolsSettings, QUERY_DEVTOOLS_TOKEN_TTL_LIMIT, setQueryDevtoolsTokenTtl, clearQueryDevtoolsTokenTtl, serializeQueryDevtoolsOverrideTransfer, parseQueryDevtoolsOverrideTransfer, armQueryDevtoolsOverrideTransfer, countUnresolvedQueryDevtoolsOverrides, createQueryDevtoolsOverrides, applyQueryDevtoolsOverrides, queryDevtoolsSchemaNames, queryDevtoolsSchemaRoutes, queryDevtoolsSchemaState, measureQueryDevtoolsPayload, seedQueryDevtoolsSchemaBody, loadQueryDevtoolsSchema, queryDevtoolsMockId, saveQueryDevtoolsMock, armQueryDevtoolsMock, deleteQueryDevtoolsMock, collectQueryDevtoolsSchemaComponents, seedQueryDevtoolsSchemaRoute, QUERY_DEVTOOLS_FAULT_STATUSES, setQueryDevtoolsFault, clearQueryDevtoolsTombstones, readQueryDevtoolsStore, createQueryKeyLockManager, queryDevtoolsEntries, queryDevtoolsTokenTtls, queryDevtoolsFaults, EMPTY_QUERY_DEVTOOLS_FAULT, isQueryDevtoolsFaultArmed, queryDevtoolsFaultsRestored, queryDevtoolsArmedMocksRestored, restoredQueryDevtoolsOverrides, queryDevtoolsRestoredOverridesScope, clearRestoredQueryDevtoolsOverrides, clearQueryDevtoolsStore, writeQueryDevtoolsStore, registerEthleteVersion, queryDevtoolsOverridePersistence, setQueryDevtoolsOverridePersistence, clearQueryDevtoolsOverrideStore, clearQueryDevtoolsMockStore, createQueryErrorResponse, applyQueryDevtoolsTokenTtl, canOverrideQueryDevtoolsTokenTtl, sumQueryDevtoolsStats } from '@ethlete/query';
5
5
  import { tap, Subject, switchMap, timer, interval, animationFrames, NEVER, takeUntil, finalize as finalize$1, EMPTY, startWith, merge, map, fromEvent, filter, take } from 'rxjs';
6
6
  import { takeUntilDestroyed, toSignal, toObservable } from '@angular/core/rxjs-interop';
@@ -3205,7 +3205,7 @@ const summarizeLocks = (options) => {
3205
3205
 
3206
3206
  // Generated from package.json by tools/scripts/generate-version.js - do not edit.
3207
3207
  /** The version of `@ethlete/query-devtools` this build was cut from. */
3208
- const QUERY_DEVTOOLS_VERSION = '1.0.0-next.4';
3208
+ const QUERY_DEVTOOLS_VERSION = '1.0.0-next.5';
3209
3209
 
3210
3210
  /* eslint-disable @typescript-eslint/naming-convention -- the `__export_*` keys are Insomnia's file format */
3211
3211
  const WORKSPACE_ID = 'wrk_ethlete_query_devtools';
@@ -4112,6 +4112,11 @@ const DOCK_PADDING = {
4112
4112
  left: 'paddingInlineStart',
4113
4113
  right: 'paddingInlineEnd',
4114
4114
  };
4115
+ /**
4116
+ * The panel's own z-index, mirrored from `query-devtools.component.css`. An overlay below it keeps out
4117
+ * of the space a docked panel covers; the panel's own overlays paint a level above it and may use it.
4118
+ */
4119
+ const PANEL_LAYER = 2147483010;
4115
4120
  const noop = () => undefined;
4116
4121
  /**
4117
4122
  * A devtools entry id as a person reads it. Ids are the registry's descriptor plus a per-descriptor
@@ -4578,6 +4583,28 @@ class QueryDevtoolsComponent {
4578
4583
  return { padding: DOCK_PADDING[dock], px: this.sideDocked() ? size.width : size.height };
4579
4584
  }, /* @ts-ignore */
4580
4585
  ...(ngDevMode ? [{ debugName: "pageReservation" }] : /* istanbul ignore next */ []));
4586
+ /**
4587
+ * The viewport edge a docked panel covers, reserved for overlays whatever {@link reservesSpace} says:
4588
+ * page content can be scrolled out from under the panel, a dialog or a menu cannot. A dock edge is
4589
+ * logical, so which physical edge a side dock covers flips in RTL - read from the panel, since the
4590
+ * writing direction cannot change under a dock switch.
4591
+ */
4592
+ this.overlayReservation = computed(() => {
4593
+ const dock = this.dock();
4594
+ if (dock === 'float' || this.poppedOut() || !this.open())
4595
+ return null;
4596
+ const panel = this.panelEl()?.nativeElement;
4597
+ const size = this.panelSize().offset;
4598
+ if (!panel || !size)
4599
+ return null;
4600
+ if (dock === 'top')
4601
+ return { top: size.height, layer: PANEL_LAYER };
4602
+ if (dock === 'bottom')
4603
+ return { bottom: size.height, layer: PANEL_LAYER };
4604
+ const coversLeft = (dock === 'left') !== (getComputedStyle(panel).direction === 'rtl');
4605
+ return coversLeft ? { left: size.width, layer: PANEL_LAYER } : { right: size.width, layer: PANEL_LAYER };
4606
+ }, /* @ts-ignore */
4607
+ ...(ngDevMode ? [{ debugName: "overlayReservation" }] : /* istanbul ignore next */ []));
4581
4608
  /** Which section of the query detail is showing. Shared by the Queries tab and both drawers. */
4582
4609
  this.detailTab = signal(this.persisted.detailTab ?? 'overview', /* @ts-ignore */
4583
4610
  ...(ngDevMode ? [{ debugName: "detailTab" }] : /* istanbul ignore next */ []));
@@ -5147,6 +5174,12 @@ class QueryDevtoolsComponent {
5147
5174
  this.renderer.setStyle(root, { boxSizing: 'border-box', [reservation.padding]: `${reservation.px}px` });
5148
5175
  onCleanup(() => this.renderer.removeStyles(root, 'boxSizing', reservation.padding));
5149
5176
  });
5177
+ effect((onCleanup) => {
5178
+ const reservation = this.overlayReservation();
5179
+ if (!reservation)
5180
+ return;
5181
+ onCleanup(reserveOverlayViewportSpace(reservation));
5182
+ });
5150
5183
  // A window that shrinks below the floating panel would otherwise leave it half (or wholly) off
5151
5184
  // screen, with no edge left to grab. Untracked on the way in so clamping cannot re-trigger itself.
5152
5185
  effect(() => {