@orbat-mapper/tactical-draw 0.21.0 → 0.22.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/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { $ as PinPresentationStatusEvent, A as PointSymbolAnchor, B as PointSymbolSize, C as makeFillPatternImage, D as PointerEventInfo, E as PointerCallback, F as PointSymbolOffset, G as DEFAULT_PIN_PRESENTATION, H as clonePointSymbol, I as PointSymbolOffsetStyle, J as PinPresentation, K as PinFootprint, L as PointSymbolPlacement, M as PointSymbolColors, N as PointSymbolConnector, O as OffsetDragModifier, P as PointSymbolGraphicModifiers, Q as PinPresentationStatus, R as PointSymbolRect, S as isMinePattern, T as EditPointerDriver, U as isPointSymbol, V as PointSymbolStyle, W as resizePointSymbolSize, X as PinPresentationPatch, Y as PinPresentationCapability, Z as PinPresentationState, _ as HatchPattern, a as LayerId, at as pinZoomScale, b as fillPatternImageDimension, c as MapEvent, d as PickHandler, et as PinPresentationStore, f as PickOptions, g as HATCH_PATTERNS, h as TextStyleOptions, i as ImageOverlayResource, it as pinDistanceScale, j as PointSymbolCapability, k as PointSymbol, l as MapEventHandler, m as StyleOptions, n as HandleStyle, nt as combinePinScale, o as MapAdapter, ot as resolvePinPresentation, p as PixelCoordinate, q as PinOverridePatch, r as IconResource, rt as isValidPinNumber, s as MapCursor, t as FeatureGroup, tt as PinRender, u as PickEvent, v as MINE_PATTERN_TILE_SIZE, w as parseColor, x as fillPatternImageId, y as Rgba, z as PointSymbolRender } from "./map-adapter-Cq36Qa4q.mjs";
2
- import { AmplifierPlacement, AmplifierPlacements, ControlMeasure, ControlMeasureKind, ControlMeasureRender, ControlMeasureStyle, LabelFit, SymbolColors, TextAmplifiers } from "@orbat-mapper/control-measures";
1
+ import { $ as PinPresentationStatusEvent, A as PointSymbolAnchor, B as PointSymbolSize, C as makeFillPatternImage, D as PointerEventInfo, E as PointerCallback, F as PointSymbolOffset, G as DEFAULT_PIN_PRESENTATION, H as clonePointSymbol, I as PointSymbolOffsetStyle, J as PinPresentation, K as PinFootprint, L as PointSymbolPlacement, M as PointSymbolColors, N as PointSymbolConnector, O as OffsetDragModifier, P as PointSymbolGraphicModifiers, Q as PinPresentationStatus, R as PointSymbolRect, S as isMinePattern, T as EditPointerDriver, U as isPointSymbol, V as PointSymbolStyle, W as resizePointSymbolSize, X as PinPresentationPatch, Y as PinPresentationCapability, Z as PinPresentationState, _ as HatchPattern, a as LayerId, at as pinZoomScale, b as fillPatternImageDimension, c as MapEvent, d as PickHandler, et as PinPresentationStore, f as PickOptions, g as HATCH_PATTERNS, h as TextStyleOptions, i as ImageOverlayResource, it as pinDistanceScale, j as PointSymbolCapability, k as PointSymbol, l as MapEventHandler, m as StyleOptions, n as HandleStyle, nt as combinePinScale, o as MapAdapter, ot as resolvePinPresentation, p as PixelCoordinate, q as PinOverridePatch, r as IconResource, rt as isValidPinNumber, s as MapCursor, t as FeatureGroup, tt as PinRender, u as PickEvent, v as MINE_PATTERN_TILE_SIZE, w as parseColor, x as fillPatternImageId, y as Rgba, z as PointSymbolRender } from "./map-adapter-Btuz2FLI.mjs";
2
+ import { AmplifierPlacement, AmplifierPlacements, ControlMeasure, ControlMeasureKind, ControlMeasureRender, ControlMeasureStyle, HighlightAppearance, LabelFit, SymbolColors, TextAmplifiers } from "@orbat-mapper/control-measures";
3
3
  import { Feature, Position } from "geojson";
4
4
 
5
5
  //#region src/base-map-adapter.d.ts
@@ -219,14 +219,15 @@ declare function resolvePickPresentation(feature: Feature, layerStyle?: StyleOpt
219
219
  */
220
220
  declare function coerceHandleStyle(raw: unknown): HandleStyle | undefined;
221
221
  /**
222
- * How far a Highlight casing reaches past each side of the stroke, in CSS
223
- * pixels. The casing is a solid line `strokeWidth + 2 × outset` wide, so the
224
- * default 2 px stroke gets an 8 px orange band: wide enough to read as a
225
- * highlighter mark, narrow enough not to swallow neighbouring graphics.
222
+ * Default reach of a Highlight casing past each side of the stroke, in CSS
223
+ * pixels, when the renderer emitted no `highlightWidth`. The casing is a solid
224
+ * line `strokeWidth + 2 × outset` wide, so the default 2 px stroke gets an
225
+ * 8 px band: wide enough to read as a highlighter mark, narrow enough not to
226
+ * swallow neighbouring graphics. The renderer's `DEFAULT_HIGHLIGHT_WIDTH`.
226
227
  */
227
228
  declare const HIGHLIGHT_CASING_OUTSET_CSS_PIXELS = 3;
228
229
  /** Width of the Highlight casing beneath a stroke `strokeWidth` px wide. */
229
- declare function highlightCasingWidth(strokeWidth: number): number;
230
+ declare function highlightCasingWidth(strokeWidth: number, outset?: number): number;
230
231
  /** The solid casing an adapter paints beneath a highlighted part. */
231
232
  interface HighlightCasing {
232
233
  color: string;
@@ -234,16 +235,65 @@ interface HighlightCasing {
234
235
  width: number;
235
236
  }
236
237
  /**
237
- * Whether a rendered feature gets a Highlight casing: only a line or area part
238
- * whose `properties.style` carries the renderer's resolved `highlightColor`.
238
+ * Where a Highlight band sits, bottom to top. Every part's glow bands paint
239
+ * beneath every part's casing in the same graphic, outer glow lowest.
240
+ */
241
+ type HighlightBandSlot = "glow-outer" | "glow-inner" | "casing";
242
+ /** Bottom-to-top order of {@link HighlightBandSlot}s. */
243
+ declare const HIGHLIGHT_BAND_SLOTS: readonly HighlightBandSlot[];
244
+ /**
245
+ * The fading glow bands outside the casing (ADR-0062): each reaches `reach ×
246
+ * highlightGlow` past the casing on each side at a constant `opacity`. Plain
247
+ * translucent strokes, never a blur, so they cost no more to draw than the
248
+ * casing and print the same in every output.
249
+ */
250
+ declare const HIGHLIGHT_GLOW_BANDS: Readonly<Record<Exclude<HighlightBandSlot, "casing">, {
251
+ reach: number;
252
+ opacity: number;
253
+ }>>;
254
+ /** One stroke of a part's Highlight: its casing or a glow band. */
255
+ interface HighlightBand {
256
+ slot: HighlightBandSlot;
257
+ color: string;
258
+ /** Full band width in CSS pixels. */
259
+ width: number;
260
+ /** Stroke opacity, multiplied with any alpha already in `color`. */
261
+ opacity: number;
262
+ }
263
+ /**
264
+ * Whether a rendered feature gets a Highlight: only a line or area part whose
265
+ * `properties.style` carries the renderer's resolved `highlightColor`.
239
266
  */
240
267
  declare function hasHighlightCasing(feature: Feature): boolean;
241
268
  /**
242
- * The Highlight casing for a rendered feature, or `null` when it has none
243
- * (see {@link hasHighlightCasing}); an area is cased along its outline. The width
244
- * follows the part's own `strokeWidth`, else `fallbackStrokeWidth` — the
245
- * stroke width the adapter would draw it at — whatever the stroke color, so
246
- * a fully transparent stroke is cased too.
269
+ * The Highlight bands for a rendered feature, bottom to top: the glow bands
270
+ * when it has a glow, the casing when its outset is above `0`; empty when it
271
+ * is not highlighted. An area is cased along its outline. Widths follow the
272
+ * part's own `strokeWidth`, else `fallbackStrokeWidth` — the stroke width the
273
+ * adapter would draw it at — whatever the stroke color, so a fully transparent
274
+ * stroke is cased too.
275
+ */
276
+ declare function resolveHighlightBands(feature: Feature, fallbackStrokeWidth: number): HighlightBand[];
277
+ /**
278
+ * {@link resolveHighlightBands} for an adapter that already knows the part is
279
+ * a line or area and holds only its resolved `HandleStyle`.
280
+ */
281
+ declare function highlightBandsForStyle(style: HandleStyle, fallbackStrokeWidth: number): HighlightBand[];
282
+ /** One Highlight band of one rendered feature; see {@link highlightBandsInPaintOrder}. */
283
+ interface FeatureHighlightBand<F extends Feature = Feature> {
284
+ feature: F;
285
+ band: HighlightBand;
286
+ }
287
+ /**
288
+ * Every Highlight band of one graphic's features in paint order (ADR-0062):
289
+ * slot by slot, so every glow band paints beneath every casing, and in feature
290
+ * order within a slot. Adapters paint the result as-is, beneath all of the
291
+ * graphic's other paint.
292
+ */
293
+ declare function highlightBandsInPaintOrder<F extends Feature>(features: readonly F[], fallbackStrokeWidth: number): FeatureHighlightBand<F>[];
294
+ /**
295
+ * The solid Highlight casing for a rendered feature, or `null` when it has
296
+ * none; see {@link resolveHighlightBands} for the casing plus its glow bands.
247
297
  */
248
298
  declare function resolveHighlightCasing(feature: Feature, fallbackStrokeWidth: number): HighlightCasing | null;
249
299
  /**
@@ -1481,6 +1531,13 @@ interface TacticalDrawOptions {
1481
1531
  graphicsStyle?: ControlMeasureStyle;
1482
1532
  /** Doctrinal defaults; explicit style colors take precedence. */
1483
1533
  symbolColors?: SymbolColors;
1534
+ /**
1535
+ * How every graphic with `style.highlight` looks (ADR-0062): casing color,
1536
+ * casing width past the stroke and glow reach, all in CSS pixels. Omitted
1537
+ * fields keep their defaults (a 3 px orange casing, no glow). Change it
1538
+ * later with {@link TacticalDraw.setHighlightAppearance}.
1539
+ */
1540
+ highlightAppearance?: HighlightAppearance;
1484
1541
  /**
1485
1542
  * Pixel band for ground-anchored labels on the graphics and preview layers
1486
1543
  * (ADR-0060). A label stops growing at `textSizeMaxPixels` (default 24) and,
@@ -1675,6 +1732,11 @@ declare class TacticalDraw {
1675
1732
  private readonly ownedLayers;
1676
1733
  private readonly graphicsStyle;
1677
1734
  private readonly symbolColors;
1735
+ /**
1736
+ * Render options shared by the graphics layer and every draw, edit and
1737
+ * transform session; `setHighlightAppearance` updates it in place.
1738
+ */
1739
+ private readonly sessionRenderOptions;
1678
1740
  private readonly labelSizeBand;
1679
1741
  private labelFit;
1680
1742
  private readonly defaultInteractionStyle;
@@ -1827,6 +1889,16 @@ declare class TacticalDraw {
1827
1889
  * {@link TacticalDrawOptions.labelFit}.
1828
1890
  */
1829
1891
  setLabelFit(labelFit: LabelFit): void;
1892
+ /** The current app-wide Highlight appearance; see {@link setHighlightAppearance}. */
1893
+ getHighlightAppearance(): HighlightAppearance;
1894
+ /**
1895
+ * Change how highlighted graphics look (ADR-0062), merging `patch` into the
1896
+ * current appearance: a field set to `undefined` returns to its default.
1897
+ * Re-renders the graphics layer and any graphic being drawn, edited or
1898
+ * transformed; a no-op when nothing changes. See
1899
+ * {@link TacticalDrawOptions.highlightAppearance}.
1900
+ */
1901
+ setHighlightAppearance(patch: HighlightAppearance): void;
1830
1902
  /** Replace snapping configuration without recreating the map adapter or façade. */
1831
1903
  setSnappingOptions(options?: SnappingOptions): void;
1832
1904
  /** Clear transient host affordances when snapping or its interaction ends. */
@@ -2326,4 +2398,4 @@ declare function nearestWorldCopyLng(lng: number, refLng: number): number;
2326
2398
  /** `nearestWorldCopyLng` applied to a lon/lat position. */
2327
2399
  declare function nearestWorldCopyPosition(position: Position, refLng: number): Position;
2328
2400
  //#endregion
2329
- export { type AnchoredGraphic, BaseMapAdapter, type CombinedAbort, DEFAULT_LABEL_SIZE_PIXELS, DEFAULT_MARKER_SIZE, DEFAULT_PIN_PRESENTATION, DEFAULT_TEXT_SIZE_MAX_PIXELS, DEFAULT_TEXT_SIZE_MIN_PIXELS, type DeferredSnapProvider, type DrawImageDraft, type DrawMarkerDraft, type DrawMeasureDraft, type DrawOptions, type DrawPointSymbolDraft, type DrawSession, type EditChangeEvent, type EditManyOptions, type EditMode, type EditOptions, type EditPointerDriver, type EditSession, type FeatureGroup, type Graphic, type GraphicEditChangeEvent, type GraphicEditSession, type GraphicGeometrySnappingOptions, type GraphicRender, type GraphicSnapshot, type GuideStyle, HATCH_PATTERNS, HIGHLIGHT_CASING_OUTSET_CSS_PIXELS, type HandleStyle, type HatchPattern, type HighlightCasing, type IconResource, type ImageCapability, ImageCapabilityRequiredError, type ImageFootprint, type ImageGraphic, type ImageGraphicStyle, type ImageIntrinsicSize, type ImageOverlayResource, type ImageRender, type ImageResource, type ImageSize, type InteractionHit, type InteractionStyle, type LabelExtent, type LabelSizeBand, type LayerId, MINE_PATTERN_TILE_SIZE, type MapAdapter, type MapCursor, type MapEvent, type MapEventHandler, type Marker, type MarkerAnchor, type MarkerCapability, MarkerCapabilityRequiredError, type MarkerFootprint, type MarkerIcon, type MarkerRender, type MarkerSize, type MarkerStyle, type MergedPickFeature, type NativeEventEntry, type OffsetDragModifier, type PickCandidate, type PickCandidateHit, type PickCandidateHitKind, type PickCandidateInput, type PickEvaluationContext, type PickEvent, type PickHandler, type PickOptions, type PickPointerType, PinFootprint, PinOverridePatch, PinPresentation, PinPresentationCapability, PinPresentationPatch, PinPresentationState, PinPresentationStatus, PinPresentationStatusEvent, PinPresentationStore, PinRender, type PinnableGraphic, type PixelCoordinate, type PointSymbol, type PointSymbolAnchor, type PointSymbolCapability, PointSymbolCapabilityRequiredError, type PointSymbolColors, type PointSymbolConnector, type PointSymbolFootprint, type PointSymbolGraphicModifiers, type PointSymbolOffset, type PointSymbolOffsetControls, type PointSymbolOffsetLayout, type PointSymbolOffsetStyle, type PointSymbolPlacement, type PointSymbolProjection, type PointSymbolRect, type PointSymbolRender, type PointSymbolSize, type PointSymbolStyle, type PointSymbolView, type PointerCallback, PointerCallbackHub, type PointerEventInfo, type ResolvedPickPresentation, type Rgba, type RotatedScreenBounds, type ScreenBounds, type SessionChangeSource, type SessionHistory, type SessionHistoryState, type SettleReason, type SizeAnchor, type SnapCandidate, type SnapCandidateProvider, type SnapCandidateRequest, type SnapInteraction, type SnapResult, type SnappingOptions, type StyleOptions, TEXT_FADE_END_RATIO, TEXT_HALO_BREAKPOINT_PIXELS, TEXT_HALO_COLOR, TOUCH_HIT_TOLERANCE_PX, TacticalDraw, TacticalDrawAbortError, type TacticalDrawAbortReason, TacticalDrawDestroyedError, type TacticalDrawLayerOptions, type TacticalDrawOptions, type TextAppearance, type TextSizeProps, type TextStyleOptions, type ToPixel, type TransformBox, type TransformChangeEvent, type TransformSession, type TransientChangeEvent, type TransientPhase, alignPointSymbolIndicator, bindAbortable, cloneImageGraphic, cloneMarker, clonePointSymbol, coerceHandleStyle, combinePinScale, combineWithHostSignal, convertPointSymbolPlacement, effectivePointSymbolPixelSize, evaluatePickCandidates, fillPatternImageDimension, fillPatternImageId, getSizeAnchor, hasHighlightCasing, highlightCasingWidth, hitTestFeature, hitTestIconFeature, ignoreAbort, imageFootprint, imageOpacity, isAnchoredGraphic, isImageGraphic, isMarker, isMinePattern, isPinnableGraphic, isPointSymbol, isTacticalDrawAbortError, isValidPinNumber, makeFillPatternImage, markerFootprint, markerOpacity, mergeNativeAndCachedPickFeatures, movePointSymbolLocation, nearestWorldCopyLng, nearestWorldCopyPosition, normalizeImageGraphic, normalizeMarker, parseColor, pickHitTolerance, pickPointerType, pinDistanceScale, pinZoomScale, placePointSymbol, pointSymbolFootprint, pointSymbolResource, renderOrderToVisualOrder, resizePointSymbolSize, resolveGroundTextSizePixels, resolveHighlightCasing, resolveMarkerRender, resolvePickPresentation, resolvePinPresentation, resolvePointSymbolOffset, resolveTextAppearance, resolveTextHaloWidth, resolveTextSizePixels, scalePointSymbolLayout, tryControlMeasureIdFromFeature, validateImageGraphic, validateMarker };
2401
+ export { type AnchoredGraphic, BaseMapAdapter, type CombinedAbort, DEFAULT_LABEL_SIZE_PIXELS, DEFAULT_MARKER_SIZE, DEFAULT_PIN_PRESENTATION, DEFAULT_TEXT_SIZE_MAX_PIXELS, DEFAULT_TEXT_SIZE_MIN_PIXELS, type DeferredSnapProvider, type DrawImageDraft, type DrawMarkerDraft, type DrawMeasureDraft, type DrawOptions, type DrawPointSymbolDraft, type DrawSession, type EditChangeEvent, type EditManyOptions, type EditMode, type EditOptions, type EditPointerDriver, type EditSession, type FeatureGroup, type FeatureHighlightBand, type Graphic, type GraphicEditChangeEvent, type GraphicEditSession, type GraphicGeometrySnappingOptions, type GraphicRender, type GraphicSnapshot, type GuideStyle, HATCH_PATTERNS, HIGHLIGHT_BAND_SLOTS, HIGHLIGHT_CASING_OUTSET_CSS_PIXELS, HIGHLIGHT_GLOW_BANDS, type HandleStyle, type HatchPattern, type HighlightBand, type HighlightBandSlot, type HighlightCasing, type IconResource, type ImageCapability, ImageCapabilityRequiredError, type ImageFootprint, type ImageGraphic, type ImageGraphicStyle, type ImageIntrinsicSize, type ImageOverlayResource, type ImageRender, type ImageResource, type ImageSize, type InteractionHit, type InteractionStyle, type LabelExtent, type LabelSizeBand, type LayerId, MINE_PATTERN_TILE_SIZE, type MapAdapter, type MapCursor, type MapEvent, type MapEventHandler, type Marker, type MarkerAnchor, type MarkerCapability, MarkerCapabilityRequiredError, type MarkerFootprint, type MarkerIcon, type MarkerRender, type MarkerSize, type MarkerStyle, type MergedPickFeature, type NativeEventEntry, type OffsetDragModifier, type PickCandidate, type PickCandidateHit, type PickCandidateHitKind, type PickCandidateInput, type PickEvaluationContext, type PickEvent, type PickHandler, type PickOptions, type PickPointerType, PinFootprint, PinOverridePatch, PinPresentation, PinPresentationCapability, PinPresentationPatch, PinPresentationState, PinPresentationStatus, PinPresentationStatusEvent, PinPresentationStore, PinRender, type PinnableGraphic, type PixelCoordinate, type PointSymbol, type PointSymbolAnchor, type PointSymbolCapability, PointSymbolCapabilityRequiredError, type PointSymbolColors, type PointSymbolConnector, type PointSymbolFootprint, type PointSymbolGraphicModifiers, type PointSymbolOffset, type PointSymbolOffsetControls, type PointSymbolOffsetLayout, type PointSymbolOffsetStyle, type PointSymbolPlacement, type PointSymbolProjection, type PointSymbolRect, type PointSymbolRender, type PointSymbolSize, type PointSymbolStyle, type PointSymbolView, type PointerCallback, PointerCallbackHub, type PointerEventInfo, type ResolvedPickPresentation, type Rgba, type RotatedScreenBounds, type ScreenBounds, type SessionChangeSource, type SessionHistory, type SessionHistoryState, type SettleReason, type SizeAnchor, type SnapCandidate, type SnapCandidateProvider, type SnapCandidateRequest, type SnapInteraction, type SnapResult, type SnappingOptions, type StyleOptions, TEXT_FADE_END_RATIO, TEXT_HALO_BREAKPOINT_PIXELS, TEXT_HALO_COLOR, TOUCH_HIT_TOLERANCE_PX, TacticalDraw, TacticalDrawAbortError, type TacticalDrawAbortReason, TacticalDrawDestroyedError, type TacticalDrawLayerOptions, type TacticalDrawOptions, type TextAppearance, type TextSizeProps, type TextStyleOptions, type ToPixel, type TransformBox, type TransformChangeEvent, type TransformSession, type TransientChangeEvent, type TransientPhase, alignPointSymbolIndicator, bindAbortable, cloneImageGraphic, cloneMarker, clonePointSymbol, coerceHandleStyle, combinePinScale, combineWithHostSignal, convertPointSymbolPlacement, effectivePointSymbolPixelSize, evaluatePickCandidates, fillPatternImageDimension, fillPatternImageId, getSizeAnchor, hasHighlightCasing, highlightBandsForStyle, highlightBandsInPaintOrder, highlightCasingWidth, hitTestFeature, hitTestIconFeature, ignoreAbort, imageFootprint, imageOpacity, isAnchoredGraphic, isImageGraphic, isMarker, isMinePattern, isPinnableGraphic, isPointSymbol, isTacticalDrawAbortError, isValidPinNumber, makeFillPatternImage, markerFootprint, markerOpacity, mergeNativeAndCachedPickFeatures, movePointSymbolLocation, nearestWorldCopyLng, nearestWorldCopyPosition, normalizeImageGraphic, normalizeMarker, parseColor, pickHitTolerance, pickPointerType, pinDistanceScale, pinZoomScale, placePointSymbol, pointSymbolFootprint, pointSymbolResource, renderOrderToVisualOrder, resizePointSymbolSize, resolveGroundTextSizePixels, resolveHighlightBands, resolveHighlightCasing, resolveMarkerRender, resolvePickPresentation, resolvePinPresentation, resolvePointSymbolOffset, resolveTextAppearance, resolveTextHaloWidth, resolveTextSizePixels, scalePointSymbolLayout, tryControlMeasureIdFromFeature, validateImageGraphic, validateMarker };
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { DEFAULT_LABEL_HEIGHT_CSS_PIXELS, DEFAULT_SYMBOL_COLOR, FILL_PATTERN_DEFINITIONS, NON_SOLID_FILL_PATTERNS, applyBoxTransformOptions, canonicalTextAmplifierKey, cloneControlMeasure, controlMeasureIdFromFeature, dragControlMeasureOptionHandle, foldsBoxTransformOptions, freezeOrientationOptions, getControlMeasureMetadata, getControlMeasureOptionHandles, getDefaultOptions, normalizeTextAmplifiers, remapVertexAlignedOptions, renderControlMeasure, resetControlMeasureOptionHandle, resolveAmplifierPlacement, resolveSizePair, resolveStyleHints, resolveSymbolColor, roundToFixed, switchSizePairUnit } from "@orbat-mapper/control-measures";
1
+ import { DEFAULT_HIGHLIGHT_WIDTH, DEFAULT_LABEL_HEIGHT_CSS_PIXELS, DEFAULT_SYMBOL_COLOR, FILL_PATTERN_DEFINITIONS, NON_SOLID_FILL_PATTERNS, applyBoxTransformOptions, canonicalTextAmplifierKey, cloneControlMeasure, controlMeasureIdFromFeature, dragControlMeasureOptionHandle, foldsBoxTransformOptions, freezeOrientationOptions, getControlMeasureMetadata, getControlMeasureOptionHandles, getDefaultOptions, normalizeTextAmplifiers, remapVertexAlignedOptions, renderControlMeasure, resetControlMeasureOptionHandle, resolveAmplifierPlacement, resolveSizePair, resolveStyleHints, resolveSymbolColor, roundToFixed, switchSizePairUnit } from "@orbat-mapper/control-measures";
2
2
  function pickPointerType(originalEvent) {
3
3
  if (typeof PointerEvent !== "undefined" && originalEvent instanceof PointerEvent) {
4
4
  if (originalEvent.pointerType === "touch") return "touch";
@@ -648,16 +648,39 @@ function coerceHandleStyle(raw) {
648
648
  return raw;
649
649
  }
650
650
  /**
651
- * How far a Highlight casing reaches past each side of the stroke, in CSS
652
- * pixels. The casing is a solid line `strokeWidth + 2 × outset` wide, so the
653
- * default 2 px stroke gets an 8 px orange band: wide enough to read as a
654
- * highlighter mark, narrow enough not to swallow neighbouring graphics.
651
+ * Default reach of a Highlight casing past each side of the stroke, in CSS
652
+ * pixels, when the renderer emitted no `highlightWidth`. The casing is a solid
653
+ * line `strokeWidth + 2 × outset` wide, so the default 2 px stroke gets an
654
+ * 8 px band: wide enough to read as a highlighter mark, narrow enough not to
655
+ * swallow neighbouring graphics. The renderer's `DEFAULT_HIGHLIGHT_WIDTH`.
655
656
  */
656
- const HIGHLIGHT_CASING_OUTSET_CSS_PIXELS = 3;
657
+ const HIGHLIGHT_CASING_OUTSET_CSS_PIXELS = DEFAULT_HIGHLIGHT_WIDTH;
657
658
  /** Width of the Highlight casing beneath a stroke `strokeWidth` px wide. */
658
- function highlightCasingWidth(strokeWidth) {
659
- return strokeWidth + 6;
660
- }
659
+ function highlightCasingWidth(strokeWidth, outset = HIGHLIGHT_CASING_OUTSET_CSS_PIXELS) {
660
+ return strokeWidth + 2 * outset;
661
+ }
662
+ /** Bottom-to-top order of {@link HighlightBandSlot}s. */
663
+ const HIGHLIGHT_BAND_SLOTS = [
664
+ "glow-outer",
665
+ "glow-inner",
666
+ "casing"
667
+ ];
668
+ /**
669
+ * The fading glow bands outside the casing (ADR-0062): each reaches `reach ×
670
+ * highlightGlow` past the casing on each side at a constant `opacity`. Plain
671
+ * translucent strokes, never a blur, so they cost no more to draw than the
672
+ * casing and print the same in every output.
673
+ */
674
+ const HIGHLIGHT_GLOW_BANDS = {
675
+ "glow-outer": {
676
+ reach: 1,
677
+ opacity: .22
678
+ },
679
+ "glow-inner": {
680
+ reach: .5,
681
+ opacity: .45
682
+ }
683
+ };
661
684
  const CASED_GEOMETRIES = new Set([
662
685
  "LineString",
663
686
  "MultiLineString",
@@ -665,26 +688,82 @@ const CASED_GEOMETRIES = new Set([
665
688
  "MultiPolygon"
666
689
  ]);
667
690
  /**
668
- * Whether a rendered feature gets a Highlight casing: only a line or area part
669
- * whose `properties.style` carries the renderer's resolved `highlightColor`.
691
+ * Whether a rendered feature gets a Highlight: only a line or area part whose
692
+ * `properties.style` carries the renderer's resolved `highlightColor`.
670
693
  */
671
694
  function hasHighlightCasing(feature) {
672
695
  return typeof coerceHandleStyle(feature.properties?.style)?.highlightColor === "string" && CASED_GEOMETRIES.has(feature.geometry?.type ?? "");
673
696
  }
674
697
  /**
675
- * The Highlight casing for a rendered feature, or `null` when it has none
676
- * (see {@link hasHighlightCasing}); an area is cased along its outline. The width
677
- * follows the part's own `strokeWidth`, else `fallbackStrokeWidth` — the
678
- * stroke width the adapter would draw it at — whatever the stroke color, so
679
- * a fully transparent stroke is cased too.
698
+ * The Highlight bands for a rendered feature, bottom to top: the glow bands
699
+ * when it has a glow, the casing when its outset is above `0`; empty when it
700
+ * is not highlighted. An area is cased along its outline. Widths follow the
701
+ * part's own `strokeWidth`, else `fallbackStrokeWidth` — the stroke width the
702
+ * adapter would draw it at — whatever the stroke color, so a fully transparent
703
+ * stroke is cased too.
704
+ */
705
+ function resolveHighlightBands(feature, fallbackStrokeWidth) {
706
+ if (!hasHighlightCasing(feature)) return [];
707
+ return highlightBandsForStyle(coerceHandleStyle(feature.properties?.style), fallbackStrokeWidth);
708
+ }
709
+ /**
710
+ * {@link resolveHighlightBands} for an adapter that already knows the part is
711
+ * a line or area and holds only its resolved `HandleStyle`.
712
+ */
713
+ function highlightBandsForStyle(style, fallbackStrokeWidth) {
714
+ if (typeof style.highlightColor !== "string") return [];
715
+ const color = style.highlightColor;
716
+ const strokeWidth = typeof style.strokeWidth === "number" ? style.strokeWidth : fallbackStrokeWidth;
717
+ const outset = nonNegativeOr(style.highlightWidth, HIGHLIGHT_CASING_OUTSET_CSS_PIXELS);
718
+ const glow = nonNegativeOr(style.highlightGlow, 0);
719
+ const casingWidth = highlightCasingWidth(strokeWidth, outset);
720
+ return HIGHLIGHT_BAND_SLOTS.flatMap((slot) => {
721
+ if (slot === "casing") return outset > 0 ? [{
722
+ slot,
723
+ color,
724
+ width: casingWidth,
725
+ opacity: 1
726
+ }] : [];
727
+ if (glow === 0) return [];
728
+ const { reach, opacity } = HIGHLIGHT_GLOW_BANDS[slot];
729
+ return [{
730
+ slot,
731
+ color,
732
+ width: casingWidth + 2 * reach * glow,
733
+ opacity
734
+ }];
735
+ });
736
+ }
737
+ const SLOT_ORDER = {
738
+ "glow-outer": 0,
739
+ "glow-inner": 1,
740
+ casing: 2
741
+ };
742
+ /**
743
+ * Every Highlight band of one graphic's features in paint order (ADR-0062):
744
+ * slot by slot, so every glow band paints beneath every casing, and in feature
745
+ * order within a slot. Adapters paint the result as-is, beneath all of the
746
+ * graphic's other paint.
747
+ */
748
+ function highlightBandsInPaintOrder(features, fallbackStrokeWidth) {
749
+ return features.flatMap((feature) => resolveHighlightBands(feature, fallbackStrokeWidth).map((band) => ({
750
+ feature,
751
+ band
752
+ }))).sort((a, b) => SLOT_ORDER[a.band.slot] - SLOT_ORDER[b.band.slot]);
753
+ }
754
+ function nonNegativeOr(value, fallback) {
755
+ return typeof value === "number" && Number.isFinite(value) && value >= 0 ? value : fallback;
756
+ }
757
+ /**
758
+ * The solid Highlight casing for a rendered feature, or `null` when it has
759
+ * none; see {@link resolveHighlightBands} for the casing plus its glow bands.
680
760
  */
681
761
  function resolveHighlightCasing(feature, fallbackStrokeWidth) {
682
- if (!hasHighlightCasing(feature)) return null;
683
- const style = coerceHandleStyle(feature.properties?.style);
684
- return {
685
- color: style.highlightColor,
686
- width: highlightCasingWidth(typeof style.strokeWidth === "number" ? style.strokeWidth : fallbackStrokeWidth)
687
- };
762
+ const casing = resolveHighlightBands(feature, fallbackStrokeWidth).find((band) => band.slot === "casing");
763
+ return casing ? {
764
+ color: casing.color,
765
+ width: casing.width
766
+ } : null;
688
767
  }
689
768
  /**
690
769
  * Default lower edge of the ground-anchored label band (ADR-0060): below it a
@@ -2176,17 +2255,6 @@ function withCommittedAdapterMeasureOptions(measure) {
2176
2255
  }
2177
2256
  };
2178
2257
  }
2179
- /**
2180
- * Render a measure with the adapter's live scale supplied through core's
2181
- * renderer-owned context. The single seam for
2182
- * "turn a measure into features against the live map" — every TacticalDraw
2183
- * layer write (graphics reconcile, draw preview, edit preview, commit snapshot)
2184
- * routes through here so pixel sizing is resolved identically everywhere. The
2185
- * adapter resolution is Web Mercator construction scale; converting it to true
2186
- * ground at the Graphic midpoint lets core's compatibility boundary round-trip
2187
- * to the same construction scale. Default label capture remains a derived copy
2188
- * for previews, while the input Graphic is never augmented with live scale.
2189
- */
2190
2258
  function renderMeasureForAdapter(adapter, measure, opts) {
2191
2259
  const withLabelSize = withCommittedAdapterMeasureOptions(measure);
2192
2260
  const resolution = adapter.getResolution();
@@ -2719,7 +2787,7 @@ const PREVIEW_CURSOR$1 = "crosshair";
2719
2787
  * kinds need no host UI.
2720
2788
  */
2721
2789
  function runFixedLengthDraw(options) {
2722
- const { adapter, kind, previewLayer, guideLayer, graphicsStyle, symbolColors, generateId, signal, measureOptions, measureStyle, measureProperties, measureTextAmplifiers, guide: guideOpt, sizeAnchor, onSettled, onSession, seed, snap } = options;
2790
+ const { adapter, kind, previewLayer, guideLayer, renderOptions: renderOpts, generateId, signal, measureOptions, measureStyle, measureProperties, measureTextAmplifiers, guide: guideOpt, sizeAnchor, onSettled, onSession, seed, snap } = options;
2723
2791
  const metadata = getControlMeasureMetadata(kind);
2724
2792
  const rule = metadata.rule;
2725
2793
  const min = metadata.minCoordinates;
@@ -2728,10 +2796,6 @@ function runFixedLengthDraw(options) {
2728
2796
  if (rule) required = rule.minimumUserPoints;
2729
2797
  else if (typeof min === "number" && typeof max === "number" && min === max) required = min;
2730
2798
  else throw new Error(`runFixedLengthDraw: kind "${kind}" is not fixed-length (min=${min}, max=${max})`);
2731
- const renderOpts = {
2732
- graphicsStyle,
2733
- symbolColors
2734
- };
2735
2799
  const guideEnabled = (guideOpt ?? true) && !shouldSuppressGuide(metadata);
2736
2800
  const isAreaKind = metadata.geometry === "area";
2737
2801
  const initialPoints = [];
@@ -3000,7 +3064,7 @@ const PREVIEW_CURSOR = "crosshair";
3000
3064
  * added point again" as additional gesture-level commit triggers.
3001
3065
  */
3002
3066
  function runVariableLengthDraw(options) {
3003
- const { adapter, kind, previewLayer, guideLayer, graphicsStyle, symbolColors, generateId, signal, onSession, seed, measureOptions, measureStyle, measureProperties, measureTextAmplifiers, guide: guideOpt, sizeAnchor, onSettled, snap } = options;
3067
+ const { adapter, kind, previewLayer, guideLayer, renderOptions: renderOpts, generateId, signal, onSession, seed, measureOptions, measureStyle, measureProperties, measureTextAmplifiers, guide: guideOpt, sizeAnchor, onSettled, snap } = options;
3004
3068
  const metadata = getControlMeasureMetadata(kind);
3005
3069
  if (typeof metadata.minCoordinates !== "number") throw new Error(`runVariableLengthDraw: kind "${kind}" has no minCoordinates metadata`);
3006
3070
  const min = metadata.minCoordinates;
@@ -3018,10 +3082,6 @@ function runVariableLengthDraw(options) {
3018
3082
  function insertionIndex(len) {
3019
3083
  return canonicalFormed(len) ? len - trailingFixed : len;
3020
3084
  }
3021
- const renderOpts = {
3022
- graphicsStyle,
3023
- symbolColors
3024
- };
3025
3085
  const initialPoints = [];
3026
3086
  if (seed) {
3027
3087
  for (const pos of seed) {
@@ -3591,6 +3651,31 @@ function translatePoints(base, dx, dy) {
3591
3651
  return out;
3592
3652
  });
3593
3653
  }
3654
+ /**
3655
+ * Carry a pixel-space box by a ground (lon/lat) delta: unproject each corner,
3656
+ * shift it, re-project, and re-fit the box (same angle) around the landed
3657
+ * corners. Untilted this is the plain pixel translate (up to the small
3658
+ * Mercator-latitude term); pitched, the box also shrinks or grows with depth so
3659
+ * it keeps framing geometry moved by the same delta. Falls back to
3660
+ * `pixelDelta` when a corner can't be projected.
3661
+ */
3662
+ function translateBoxOnGround(box, [dLon, dLat], pixelDelta, projection) {
3663
+ const pixelTranslated = () => ({
3664
+ ...box,
3665
+ center: [box.center[0] + pixelDelta[0], box.center[1] + pixelDelta[1]]
3666
+ });
3667
+ const landed = [];
3668
+ for (const corner of boxCorners(box)) {
3669
+ const ground = projection.fromPixel(corner);
3670
+ const moved = projection.toPixel([ground[0] + dLon, ground[1] + dLat]);
3671
+ if (!moved || !Number.isFinite(moved[0]) || !Number.isFinite(moved[1])) return pixelTranslated();
3672
+ landed.push(moved);
3673
+ }
3674
+ const fitted = fitTransformBox(landed, box.angle);
3675
+ return Math.max(fitted.halfWidth / box.halfWidth, fitted.halfHeight / box.halfHeight) > MAX_GROUND_BOX_GROWTH ? pixelTranslated() : fitted;
3676
+ }
3677
+ /** Above this size ratio a ground-translated box is treated as unprojectable. */
3678
+ const MAX_GROUND_BOX_GROWTH = 10;
3594
3679
  function pixelDistance(a, b) {
3595
3680
  return Math.hypot(a[0] - b[0], a[1] - b[1]);
3596
3681
  }
@@ -3759,12 +3844,12 @@ function beginBoxDrag(args) {
3759
3844
  const origin = fromPixel(downPixel);
3760
3845
  const move = (pixel) => {
3761
3846
  const cur = fromPixel(pixel);
3847
+ const translation = [cur[0] - origin[0], cur[1] - origin[1]];
3848
+ const pixelDelta = [pixel[0] - downPixel[0], pixel[1] - downPixel[1]];
3762
3849
  return {
3763
- points: translatePoints(preDragPoints, cur[0] - origin[0], cur[1] - origin[1]),
3764
- box: {
3765
- ...box,
3766
- center: [box.center[0] + (pixel[0] - downPixel[0]), box.center[1] + (pixel[1] - downPixel[1])]
3767
- }
3850
+ points: translatePoints(preDragPoints, translation[0], translation[1]),
3851
+ box: translateBoxOnGround(box, translation, pixelDelta, projection),
3852
+ translation
3768
3853
  };
3769
3854
  };
3770
3855
  return {
@@ -4315,27 +4400,50 @@ function transformAmplifierPlacements(placements, from, to, projection) {
4315
4400
  if (!placements) return void 0;
4316
4401
  const scaleX = to.halfWidth / from.halfWidth;
4317
4402
  const scaleY = to.halfHeight / from.halfHeight;
4318
- const angleDelta = to.angle - from.angle;
4319
- const transformed = {};
4403
+ return mapAmplifierPlacements(placements, (position) => {
4404
+ const pixel = projection.toPixel(position);
4405
+ if (!pixel) return [...position];
4406
+ const [localX, localY] = rotate(pixel[0] - from.center[0], pixel[1] - from.center[1], -from.angle);
4407
+ const [outX, outY] = rotate(localX * scaleX, localY * scaleY, to.angle);
4408
+ return projection.fromPixel([to.center[0] + outX, to.center[1] + outY]);
4409
+ }, to.angle - from.angle);
4410
+ }
4411
+ /**
4412
+ * Rebuild `placements` with every anchor passed through `movePosition` and
4413
+ * every rotation override shifted by `-angleDelta`, keeping each entry's
4414
+ * storage shape (bare `Position` vs object form) and rotation-only entries.
4415
+ */
4416
+ function mapAmplifierPlacements(placements, movePosition, angleDelta) {
4417
+ const mapped = {};
4320
4418
  for (const [field, raw] of Object.entries(placements)) {
4321
4419
  const resolved = resolveAmplifierPlacement(raw);
4322
4420
  const rotation = resolved.rotation !== void 0 ? resolved.rotation - angleDelta : void 0;
4323
4421
  if (!resolved.position) {
4324
- if (rotation !== void 0) transformed[field] = { rotation };
4422
+ if (rotation !== void 0) mapped[field] = { rotation };
4325
4423
  continue;
4326
4424
  }
4327
- const pixel = projection.toPixel(resolved.position);
4328
- const position = pixel ? (() => {
4329
- const [localX, localY] = rotate(pixel[0] - from.center[0], pixel[1] - from.center[1], -from.angle);
4330
- const [outX, outY] = rotate(localX * scaleX, localY * scaleY, to.angle);
4331
- return projection.fromPixel([to.center[0] + outX, to.center[1] + outY]);
4332
- })() : [...resolved.position];
4333
- transformed[field] = rotation !== void 0 ? {
4425
+ const position = movePosition(resolved.position);
4426
+ mapped[field] = rotation !== void 0 ? {
4334
4427
  position,
4335
4428
  rotation
4336
4429
  } : position;
4337
4430
  }
4338
- return transformed;
4431
+ return mapped;
4432
+ }
4433
+ /**
4434
+ * Carry placement overrides through one box-drag snapshot. A body drag moves
4435
+ * the control points by a lon/lat delta (`snapshot.translation`), so the
4436
+ * anchors move by that same delta and stay glued to the geometry; going
4437
+ * through the box's pixel delta instead would drift on a pitched view, where
4438
+ * equal pixel offsets cover different ground distances at different screen
4439
+ * depths. Scale and rotate share the pixel-space affine with the points, so
4440
+ * they go through {@link transformAmplifierPlacements}.
4441
+ */
4442
+ function carryAmplifierPlacements(placements, from, snapshot, projection) {
4443
+ if (!snapshot.translation) return transformAmplifierPlacements(placements, from, snapshot.box, projection);
4444
+ if (!placements) return void 0;
4445
+ const [dLon, dLat] = snapshot.translation;
4446
+ return mapAmplifierPlacements(placements, (p) => [p[0] + dLon, p[1] + dLat], 0);
4339
4447
  }
4340
4448
  /**
4341
4449
  * Field-wise merge of one `amplifierPlacements` entry: fields present in
@@ -4652,11 +4760,7 @@ const ALLOWED_EDIT_MODES = new Set([
4652
4760
  * - close / abort / signal / preempt / destroy paths
4653
4761
  */
4654
4762
  function runEdit(opts) {
4655
- const { adapter, measure, graphicsLayer, previewLayer, guideLayer, handlesLayer, graphicsStyle, symbolColors, signal, closeOnClickAway = true, modes: initialModes, interactionStyle, onSession, handleIdPrefix, guide: guideOpt, settleToGraphics, publishWorkingGraphic, onSettled, onClickAwayGraphicsPick, snap, deferredSnap } = opts;
4656
- const renderOpts = {
4657
- graphicsStyle,
4658
- symbolColors
4659
- };
4763
+ const { adapter, measure, graphicsLayer, previewLayer, guideLayer, handlesLayer, renderOptions: renderOpts, signal, closeOnClickAway = true, modes: initialModes, interactionStyle, onSession, handleIdPrefix, guide: guideOpt, settleToGraphics, publishWorkingGraphic, onSettled, onClickAwayGraphicsPick, snap, deferredSnap } = opts;
4660
4764
  let sizeAnchor = opts.sizeAnchor ?? defaultSizeAnchor(measure);
4661
4765
  let detailHandles = opts.detailHandles ?? false;
4662
4766
  const metadata = getControlMeasureMetadata(measure.kind);
@@ -5479,7 +5583,10 @@ function runEdit(opts) {
5479
5583
  graphicId: measure.id,
5480
5584
  originalEvent: info?.native
5481
5585
  },
5482
- toDragPixel: (landed) => [pixel[0] + landed[0] - anchorPixel[0], pixel[1] + landed[1] - anchorPixel[1]]
5586
+ toDragPixel: (landed) => {
5587
+ const at = driver.fromPixel(landed);
5588
+ return driver.toPixel([origin[0] + at[0] - first[0], origin[1] + at[1] - first[1]]) ?? [pixel[0] + landed[0] - anchorPixel[0], pixel[1] + landed[1] - anchorPixel[1]];
5589
+ }
5483
5590
  };
5484
5591
  }
5485
5592
  /**
@@ -5768,7 +5875,7 @@ function runEdit(opts) {
5768
5875
  return;
5769
5876
  }
5770
5877
  workingPoints.splice(0, workingPoints.length, ...snapshot.points);
5771
- workingAmplifierPlacements = transformAmplifierPlacements(activeBoxDrag.preDragAmplifierPlacements, activeBoxDrag.preDragBox, snapshot.box, driver);
5878
+ workingAmplifierPlacements = carryAmplifierPlacements(activeBoxDrag.preDragAmplifierPlacements, activeBoxDrag.preDragBox, snapshot, driver);
5772
5879
  renderWorkingGraphic();
5773
5880
  renderHandlesLayer();
5774
5881
  recomputeDirty();
@@ -5891,7 +5998,7 @@ function runEdit(opts) {
5891
5998
  }
5892
5999
  const committedPoints = optionFold && holdsAnchorOnFold ? preDragPoints : finalSnapshot.points;
5893
6000
  transient.emit("end", committedPoints, null);
5894
- commitGesture(committedPoints, preDragOptions, transformAmplifierPlacements(preDragAmplifierPlacements, preDragBox, finalSnapshot.box, driver), preDragBox.angle);
6001
+ commitGesture(committedPoints, preDragOptions, carryAmplifierPlacements(preDragAmplifierPlacements, preDragBox, finalSnapshot, driver), preDragBox.angle);
5895
6002
  });
5896
6003
  return;
5897
6004
  }
@@ -5956,6 +6063,10 @@ function runEdit(opts) {
5956
6063
  if (stylesEqual(currentStyle, next.style)) return;
5957
6064
  currentStyle = next.style;
5958
6065
  renderWorkingGraphic();
6066
+ },
6067
+ refreshPresentation() {
6068
+ if (core.settled) return;
6069
+ renderWorkingGraphic();
5959
6070
  }
5960
6071
  };
5961
6072
  }
@@ -6479,13 +6590,9 @@ function defaultGroupSizeAnchor(graphics) {
6479
6590
  * a live session without a session boundary
6480
6591
  */
6481
6592
  function runGroupTransform(opts) {
6482
- const { adapter, capability, imageCapability, markerCapability, graphics, graphicsLayer, previewLayer, handlesLayer, graphicsStyle, symbolColors, signal, closeOnClickAway = true, interactionStyle, onSession, handleIdPrefix, publishWorkingGraphics, settleWorkingGraphics, isOnGraphicsLayer, onSettled, onClickAwayGraphicsPick } = opts;
6593
+ const { adapter, capability, imageCapability, markerCapability, graphics, graphicsLayer, previewLayer, handlesLayer, renderOptions: renderOpts, signal, closeOnClickAway = true, interactionStyle, onSession, handleIdPrefix, publishWorkingGraphics, settleWorkingGraphics, isOnGraphicsLayer, onSettled, onClickAwayGraphicsPick } = opts;
6483
6594
  assertCapabilityFor(graphics);
6484
6595
  validateHostResources(graphics);
6485
- const renderOpts = {
6486
- graphicsStyle,
6487
- symbolColors
6488
- };
6489
6596
  let sizeAnchor = opts.sizeAnchor ?? defaultGroupSizeAnchor(graphics);
6490
6597
  /** Throw synchronously if any graphic in `list` is a point symbol and no capability was supplied. */
6491
6598
  function assertCapabilityFor(list) {
@@ -7273,7 +7380,7 @@ function runGroupTransform(opts) {
7273
7380
  applyConcatenatedPoints(snapshot.points);
7274
7381
  applyPointSymbolStateByMember(pointSymbolStateForBox(snapshot.box));
7275
7382
  applyMeasureTransformForBox(snapshot.box, activeBoxDrag.preDragBox, activeBoxDrag.fsm.kind, activeBoxDrag.preDragOptionsOverrideByMember);
7276
- applyAmplifierPlacementsByMember(activeBoxDrag.preDragAmplifierPlacementsByMember.map((placements) => transformAmplifierPlacements(placements, activeBoxDrag.preDragBox, snapshot.box, driver)));
7383
+ applyAmplifierPlacementsByMember(activeBoxDrag.preDragAmplifierPlacementsByMember.map((placements) => carryAmplifierPlacements(placements, activeBoxDrag.preDragBox, snapshot, driver)));
7277
7384
  renderAllPreviews();
7278
7385
  renderHandlesLayer();
7279
7386
  recomputeDirty();
@@ -7315,7 +7422,7 @@ function runGroupTransform(opts) {
7315
7422
  if (members.some(isAnchoredMember)) shell.suppressNextClickAway();
7316
7423
  if (fsm.kind === "rotate") boxAngle += finalSnapshot.box.angle - preDragBox.angle;
7317
7424
  applyMeasureTransformForBox(finalSnapshot.box, preDragBox, fsm.kind, preDragOptionsOverrideByMember);
7318
- commitGesture(finalSnapshot.points, preDragOptionsOverrideByMember, preDragAmplifierPlacementsByMember.map((placements) => transformAmplifierPlacements(placements, preDragBox, finalSnapshot.box, driver)), preDragBox.angle, nextPointSymbolStateByMember);
7425
+ commitGesture(finalSnapshot.points, preDragOptionsOverrideByMember, preDragAmplifierPlacementsByMember.map((placements) => carryAmplifierPlacements(placements, preDragBox, finalSnapshot, driver)), preDragBox.angle, nextPointSymbolStateByMember);
7319
7426
  };
7320
7427
  const core = runEditInteraction({
7321
7428
  adapter,
@@ -8664,6 +8771,11 @@ var TacticalDraw = class {
8664
8771
  ownedLayers;
8665
8772
  graphicsStyle;
8666
8773
  symbolColors;
8774
+ /**
8775
+ * Render options shared by the graphics layer and every draw, edit and
8776
+ * transform session; `setHighlightAppearance` updates it in place.
8777
+ */
8778
+ sessionRenderOptions;
8667
8779
  labelSizeBand;
8668
8780
  labelFit;
8669
8781
  defaultInteractionStyle;
@@ -8788,6 +8900,11 @@ var TacticalDraw = class {
8788
8900
  this.labelFit = options?.labelFit ?? "shrink";
8789
8901
  this.lastViewResolution = adapter.getResolution();
8790
8902
  this.graphicsStyle = resolveStyleHints(BUILT_IN_GRAPHICS_STYLE, options?.graphicsStyle, void 0);
8903
+ this.sessionRenderOptions = {
8904
+ graphicsStyle: this.graphicsStyle,
8905
+ symbolColors: this.symbolColors,
8906
+ highlightAppearance: { ...options?.highlightAppearance }
8907
+ };
8791
8908
  this.defaultInteractionStyle = options?.interactionStyle;
8792
8909
  this.generateId = options?.generateId ?? (() => `td-${++this.idCounter}`);
8793
8910
  this.pointSymbols = options?.pointSymbols;
@@ -8896,6 +9013,31 @@ var TacticalDraw = class {
8896
9013
  this.invalidateGraphicGroupCache(false);
8897
9014
  if (this.hasRendered) this.reconcileGraphicsStack();
8898
9015
  }
9016
+ /** The current app-wide Highlight appearance; see {@link setHighlightAppearance}. */
9017
+ getHighlightAppearance() {
9018
+ return { ...this.sessionRenderOptions.highlightAppearance };
9019
+ }
9020
+ /**
9021
+ * Change how highlighted graphics look (ADR-0062), merging `patch` into the
9022
+ * current appearance: a field set to `undefined` returns to its default.
9023
+ * Re-renders the graphics layer and any graphic being drawn, edited or
9024
+ * transformed; a no-op when nothing changes. See
9025
+ * {@link TacticalDrawOptions.highlightAppearance}.
9026
+ */
9027
+ setHighlightAppearance(patch) {
9028
+ this.assertAlive();
9029
+ const next = {
9030
+ ...this.sessionRenderOptions.highlightAppearance,
9031
+ ...patch
9032
+ };
9033
+ for (const key of Object.keys(next)) if (next[key] === void 0) delete next[key];
9034
+ if (deepEqual(next, this.sessionRenderOptions.highlightAppearance)) return;
9035
+ this.sessionRenderOptions.highlightAppearance = next;
9036
+ if (this.graphicsStyle.highlight === true) this.invalidateGraphicGroupCache(false);
9037
+ else for (const graphic of this.lastRenderedMeasures) if (!isAnchoredGraphic(graphic) && graphic.style?.highlight === true) this.graphicGroupCache.delete(graphic);
9038
+ if (this.hasRendered) this.reconcileGraphicsStack();
9039
+ this.refreshActiveEditPresentation();
9040
+ }
8899
9041
  /** Replace snapping configuration without recreating the map adapter or façade. */
8900
9042
  setSnappingOptions(options) {
8901
9043
  this.assertAlive();
@@ -9007,8 +9149,7 @@ var TacticalDraw = class {
9007
9149
  };
9008
9150
  }
9009
9151
  const render = renderMeasureForAdapter(this.adapter, graphic, {
9010
- graphicsStyle: this.graphicsStyle,
9011
- symbolColors: this.symbolColors,
9152
+ ...this.sessionRenderOptions,
9012
9153
  context: { labelFit: this.labelFit }
9013
9154
  });
9014
9155
  return {
@@ -9479,8 +9620,7 @@ var TacticalDraw = class {
9479
9620
  kind,
9480
9621
  previewLayer: this.previewLayer,
9481
9622
  guideLayer: this.guideLayer,
9482
- graphicsStyle: this.graphicsStyle,
9483
- symbolColors: this.symbolColors,
9623
+ renderOptions: this.sessionRenderOptions,
9484
9624
  generateId: () => measureDraft.id ?? this.generateId(),
9485
9625
  signal: options?.signal,
9486
9626
  measureOptions: measureDraft.options,
@@ -9498,8 +9638,7 @@ var TacticalDraw = class {
9498
9638
  kind,
9499
9639
  previewLayer: this.previewLayer,
9500
9640
  guideLayer: this.guideLayer,
9501
- graphicsStyle: this.graphicsStyle,
9502
- symbolColors: this.symbolColors,
9641
+ renderOptions: this.sessionRenderOptions,
9503
9642
  generateId: () => measureDraft.id ?? this.generateId(),
9504
9643
  signal: options?.signal,
9505
9644
  onSession: this.trackSession(options?.onSession),
@@ -9662,8 +9801,7 @@ var TacticalDraw = class {
9662
9801
  previewLayer: this.previewLayer,
9663
9802
  guideLayer: this.guideLayer,
9664
9803
  handlesLayer: this.handlesLayer,
9665
- graphicsStyle: this.graphicsStyle,
9666
- symbolColors: this.symbolColors,
9804
+ renderOptions: this.sessionRenderOptions,
9667
9805
  labelSizeBand: this.labelSizeBand,
9668
9806
  signal: options?.signal,
9669
9807
  closeOnClickAway: options?.closeOnClickAway,
@@ -9723,8 +9861,7 @@ var TacticalDraw = class {
9723
9861
  graphicsLayer: this.graphicsLayer,
9724
9862
  previewLayer: this.previewLayer,
9725
9863
  handlesLayer: this.handlesLayer,
9726
- graphicsStyle: this.graphicsStyle,
9727
- symbolColors: this.symbolColors,
9864
+ renderOptions: this.sessionRenderOptions,
9728
9865
  signal: options?.signal,
9729
9866
  closeOnClickAway: options?.closeOnClickAway,
9730
9867
  interactionStyle: mergedInteractionStyle,
@@ -10532,4 +10669,4 @@ function nearestWorldCopyPosition(position, refLng) {
10532
10669
  return [nearestWorldCopyLng(position[0], refLng), ...position.slice(1)];
10533
10670
  }
10534
10671
  //#endregion
10535
- export { BaseMapAdapter, DEFAULT_LABEL_SIZE_PIXELS, DEFAULT_MARKER_SIZE, DEFAULT_PIN_PRESENTATION, DEFAULT_TEXT_SIZE_MAX_PIXELS, DEFAULT_TEXT_SIZE_MIN_PIXELS, HATCH_PATTERNS, HIGHLIGHT_CASING_OUTSET_CSS_PIXELS, ImageCapabilityRequiredError, MINE_PATTERN_TILE_SIZE, MarkerCapabilityRequiredError, PinPresentationStore, PointSymbolCapabilityRequiredError, PointerCallbackHub, TEXT_FADE_END_RATIO, TEXT_HALO_BREAKPOINT_PIXELS, TEXT_HALO_COLOR, TOUCH_HIT_TOLERANCE_PX, TacticalDraw, TacticalDrawAbortError, TacticalDrawDestroyedError, alignPointSymbolIndicator, bindAbortable, cloneImageGraphic, cloneMarker, clonePointSymbol, coerceHandleStyle, combinePinScale, combineWithHostSignal, convertPointSymbolPlacement, effectivePointSymbolPixelSize, evaluatePickCandidates, fillPatternImageDimension, fillPatternImageId, getSizeAnchor, hasHighlightCasing, highlightCasingWidth, hitTestFeature, hitTestIconFeature, ignoreAbort, imageFootprint, imageOpacity, isAnchoredGraphic, isImageGraphic, isMarker, isMinePattern, isPinnableGraphic, isPointSymbol, isTacticalDrawAbortError, isValidPinNumber, makeFillPatternImage, markerFootprint, markerOpacity, mergeNativeAndCachedPickFeatures, movePointSymbolLocation, nearestWorldCopyLng, nearestWorldCopyPosition, normalizeImageGraphic, normalizeMarker, parseColor, pickHitTolerance, pickPointerType, pinDistanceScale, pinZoomScale, placePointSymbol, pointSymbolFootprint, pointSymbolResource, renderOrderToVisualOrder, resizePointSymbolSize, resolveGroundTextSizePixels, resolveHighlightCasing, resolveMarkerRender, resolvePickPresentation, resolvePinPresentation, resolvePointSymbolOffset, resolveTextAppearance, resolveTextHaloWidth, resolveTextSizePixels, scalePointSymbolLayout, tryControlMeasureIdFromFeature, validateImageGraphic, validateMarker };
10672
+ export { BaseMapAdapter, DEFAULT_LABEL_SIZE_PIXELS, DEFAULT_MARKER_SIZE, DEFAULT_PIN_PRESENTATION, DEFAULT_TEXT_SIZE_MAX_PIXELS, DEFAULT_TEXT_SIZE_MIN_PIXELS, HATCH_PATTERNS, HIGHLIGHT_BAND_SLOTS, HIGHLIGHT_CASING_OUTSET_CSS_PIXELS, HIGHLIGHT_GLOW_BANDS, ImageCapabilityRequiredError, MINE_PATTERN_TILE_SIZE, MarkerCapabilityRequiredError, PinPresentationStore, PointSymbolCapabilityRequiredError, PointerCallbackHub, TEXT_FADE_END_RATIO, TEXT_HALO_BREAKPOINT_PIXELS, TEXT_HALO_COLOR, TOUCH_HIT_TOLERANCE_PX, TacticalDraw, TacticalDrawAbortError, TacticalDrawDestroyedError, alignPointSymbolIndicator, bindAbortable, cloneImageGraphic, cloneMarker, clonePointSymbol, coerceHandleStyle, combinePinScale, combineWithHostSignal, convertPointSymbolPlacement, effectivePointSymbolPixelSize, evaluatePickCandidates, fillPatternImageDimension, fillPatternImageId, getSizeAnchor, hasHighlightCasing, highlightBandsForStyle, highlightBandsInPaintOrder, highlightCasingWidth, hitTestFeature, hitTestIconFeature, ignoreAbort, imageFootprint, imageOpacity, isAnchoredGraphic, isImageGraphic, isMarker, isMinePattern, isPinnableGraphic, isPointSymbol, isTacticalDrawAbortError, isValidPinNumber, makeFillPatternImage, markerFootprint, markerOpacity, mergeNativeAndCachedPickFeatures, movePointSymbolLocation, nearestWorldCopyLng, nearestWorldCopyPosition, normalizeImageGraphic, normalizeMarker, parseColor, pickHitTolerance, pickPointerType, pinDistanceScale, pinZoomScale, placePointSymbol, pointSymbolFootprint, pointSymbolResource, renderOrderToVisualOrder, resizePointSymbolSize, resolveGroundTextSizePixels, resolveHighlightBands, resolveHighlightCasing, resolveMarkerRender, resolvePickPresentation, resolvePinPresentation, resolvePointSymbolOffset, resolveTextAppearance, resolveTextHaloWidth, resolveTextSizePixels, scalePointSymbolLayout, tryControlMeasureIdFromFeature, validateImageGraphic, validateMarker };
@@ -507,6 +507,19 @@ interface HandleStyle {
507
507
  * with the transient selection highlight of `setHighlightedGraphics`.
508
508
  */
509
509
  highlightColor?: string;
510
+ /**
511
+ * Casing reach past each side of the stroke in CSS pixels (the renderer's
512
+ * resolved `HighlightAppearance.width`); absent means
513
+ * `HIGHLIGHT_CASING_OUTSET_CSS_PIXELS`, and `0` paints no casing.
514
+ */
515
+ highlightWidth?: number;
516
+ /**
517
+ * Glow reach past the casing in CSS pixels (the renderer's resolved
518
+ * `HighlightAppearance.glow`); absent means no glow. Adapters paint the
519
+ * `HIGHLIGHT_GLOW_BANDS` beneath every casing of the group, as plain
520
+ * translucent strokes. Display-only like the casing.
521
+ */
522
+ highlightGlow?: number;
510
523
  }
511
524
  type LayerId = string;
512
525
  /** Canonical SVG resource shared by point features through `iconId`. */
@@ -1,4 +1,4 @@
1
- import { a as LayerId, o as MapAdapter, p as PixelCoordinate } from "./map-adapter-Cq36Qa4q.mjs";
1
+ import { a as LayerId, o as MapAdapter, p as PixelCoordinate } from "./map-adapter-Btuz2FLI.mjs";
2
2
  import { Feature } from "geojson";
3
3
 
4
4
  //#region src/testing/feature-group-conformance.d.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orbat-mapper/tactical-draw",
3
- "version": "0.21.0",
3
+ "version": "0.22.1",
4
4
  "description": "Engine-agnostic draw/edit core for tactical control measures (MIL-STD-2525 / APP-6). The MapAdapter ABI and bring-your-own-engine entry point for the tactical-draw package family.",
5
5
  "license": "MIT",
6
6
  "author": "Orbat Mapper",
@@ -39,7 +39,7 @@
39
39
  "access": "public"
40
40
  },
41
41
  "dependencies": {
42
- "@orbat-mapper/control-measures": "^0.37.0"
42
+ "@orbat-mapper/control-measures": "^0.38.0"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "vitest": ">=4.0.0"