@trackunit/react-map 0.1.21 → 0.1.24

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.
@@ -2,14 +2,13 @@ import { type GeoJsonBbox, type GeoJsonFeature } from "@trackunit/geo-json-utils
2
2
  import type { MapInteractionState } from "@trackunit/react-map-adapter-shared";
3
3
  import type { ShapeLabelResolutionContext } from "./shapeLabelResolution";
4
4
  /**
5
- * Build the per-feature, per-frame context passed to an `edge-auto` anchor's
6
- * `resolveLabel` callback. Pure: no React, no `api` reads — caller supplies the
7
- * already-projected viewport bits, the precomputed `shapesInViewport` count for
8
- * the layer, and the current interaction state.
5
+ * Build the per-feature, per-frame context passed to viewport-aware shape
6
+ * callbacks. Pure: no React, no `api` reads — caller supplies the already-
7
+ * projected viewport bits, the precomputed `shapesInViewport` count for the
8
+ * layer, a lazy overlap count, and the current interaction state.
9
9
  *
10
10
  * Lives next to `shapeLabelResolution.ts` and is consumed by
11
- * `useShapeDecorations` once per feature that has at least one `edge-auto`
12
- * decoration, before any placement work runs.
11
+ * `useShapeDecorations` once per feature, before any placement work runs.
13
12
  */
14
13
  export declare const buildShapeLabelResolutionContext: (feature: GeoJsonFeature, args: Readonly<{
15
14
  handleId: string;
@@ -18,6 +17,6 @@ export declare const buildShapeLabelResolutionContext: (feature: GeoJsonFeature,
18
17
  zoom: number;
19
18
  tileSize: number;
20
19
  shapesInViewport: number;
21
- overlappingShapesCount: number;
20
+ getOverlappingShapesCount: () => number;
22
21
  interaction: MapInteractionState;
23
22
  }>) => ShapeLabelResolutionContext | null;
@@ -29,7 +29,6 @@ export type FillTilingInput = Readonly<{
29
29
  /** Only features whose bbox intersects this are considered. */
30
30
  viewportBounds: GeoJsonBbox;
31
31
  resolveStackOrder: ResolveShapeStackOrder;
32
- zoom: number;
33
32
  /**
34
33
  * Feature id that is currently selected. Selection forces the feature to the
35
34
  * top of its overlap group, overriding resting order. Takes highest priority.
@@ -12,22 +12,15 @@ export type ContendedShape = Readonly<{
12
12
  /** IDs of other contended shapes that fully contain this one. */
13
13
  containedIn: ReadonlyArray<string>;
14
14
  }>;
15
- /**
16
- * Context for a single resolve pass.
17
- */
18
- export type ShapeStackContext = Readonly<{
19
- /** Current map zoom level. */
20
- zoom: number;
21
- }>;
22
15
  /**
23
16
  * Decides fill ownership for a set of overlapping shapes. Returns the contended
24
17
  * feature IDs ordered **top-first** — the first ID owns shared pixels, later
25
18
  * IDs are clipped against the winners ahead of them.
26
19
  *
27
- * Pure: same inputs must yield the same ordering. Swappable per-layer via the
28
- * `overlap.resolveStackOrder` option on `useShapes`.
20
+ * Pure and zoom-invariant: same contended shapes must yield the same ordering.
21
+ * Swappable per-layer via the `overlap.resolveStackOrder` option on `useShapes`.
29
22
  */
30
- export type ResolveShapeStackOrder = (contended: ReadonlyArray<ContendedShape>, ctx: ShapeStackContext) => ReadonlyArray<string>;
23
+ export type ResolveShapeStackOrder = (contended: ReadonlyArray<ContendedShape>) => ReadonlyArray<string>;
31
24
  /**
32
25
  * Default stack-order policy (ADR-0021 "golden path"). In priority order:
33
26
  *
@@ -8,9 +8,9 @@
8
8
  * both states. The inner indicator disc (`cvaMarkerIndicator` below) carries
9
9
  * its own per-size `h-* w-*`; the outer surface sizes intrinsically around it.
10
10
  *
11
- * `transition-all` enables the morph; the duration and timing-function are
12
- * applied inline from `MARKER_TUNING.animation` so the spring config remains
13
- * the single source of truth (no stale `duration-200 ease-in-out` here).
11
+ * `transitionProperty` is set inline in `MapMarker.tsx` to list only the
12
+ * properties that need to animate, intentionally excluding `width` to prevent
13
+ * non-composited layout thrashing. See `MarkerAnimatedSurface.tsx` for details.
14
14
  */
15
15
  export declare const cvaMapMarker: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
16
16
  /**