@orbat-mapper/control-measures 0.2.0-alpha.9 → 0.2.0

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.
Files changed (88) hide show
  1. package/README.md +49 -0
  2. package/dist/{index-26Xb77jE.d.mts → index-DtgRm_dz.d.mts} +1313 -255
  3. package/dist/index.d.mts +2 -2
  4. package/dist/index.mjs +20 -5
  5. package/dist/preview/index.d.mts +114 -3
  6. package/dist/preview/index.mjs +242 -23
  7. package/dist/{renderControlMeasure-CFdgTURO.mjs → renderControlMeasure-CAfC2nEw.mjs} +9570 -3988
  8. package/media/airborne-attack.svg +1 -1
  9. package/media/airfield-zone.svg +1 -0
  10. package/media/ambush.svg +1 -1
  11. package/media/antitank-ditch-completed.svg +1 -1
  12. package/media/antitank-ditch-under-construction.svg +1 -1
  13. package/media/antitank-wall.svg +1 -1
  14. package/media/area-defense.svg +1 -0
  15. package/media/area-of-operations.svg +1 -0
  16. package/media/area.svg +1 -0
  17. package/media/assault-position.svg +1 -0
  18. package/media/assembly-area.svg +1 -0
  19. package/media/attack-by-fire.svg +1 -1
  20. package/media/attack-helicopter.svg +1 -1
  21. package/media/attack-position.svg +1 -0
  22. package/media/base-camp.svg +1 -0
  23. package/media/battle-handover-line.svg +1 -0
  24. package/media/battle-position.svg +1 -1
  25. package/media/block-arrow.svg +1 -1
  26. package/media/block-mission-task.svg +1 -1
  27. package/media/block.svg +1 -1
  28. package/media/boundary.svg +1 -1
  29. package/media/breach.svg +1 -1
  30. package/media/bypass.svg +1 -1
  31. package/media/canalize.svg +1 -1
  32. package/media/circle.svg +1 -1
  33. package/media/classic-arrow.svg +1 -1
  34. package/media/clear.svg +1 -1
  35. package/media/counterattack.svg +1 -0
  36. package/media/cover.svg +1 -0
  37. package/media/delay.svg +1 -1
  38. package/media/direction-of-attack-aviation.svg +1 -0
  39. package/media/direction-of-main-attack.svg +1 -0
  40. package/media/direction-of-supporting-attack.svg +1 -0
  41. package/media/disrupt.svg +1 -1
  42. package/media/drop-zone.svg +1 -0
  43. package/media/encirclement.svg +1 -1
  44. package/media/engineer-work-line.svg +1 -0
  45. package/media/extraction-zone.svg +1 -0
  46. package/media/final-protective-fire-left.svg +1 -1
  47. package/media/final-protective-fire-right.svg +1 -1
  48. package/media/fix.svg +1 -1
  49. package/media/flot.svg +1 -1
  50. package/media/fortified-area.svg +1 -1
  51. package/media/fortified-line.svg +1 -1
  52. package/media/forward-edge-of-battle-area.svg +1 -0
  53. package/media/frontal-attack.svg +1 -0
  54. package/media/generic-c2-area.svg +1 -0
  55. package/media/generic-c2-line.svg +1 -0
  56. package/media/guard.svg +1 -0
  57. package/media/guerrilla-base.svg +1 -0
  58. package/media/handover-line.svg +1 -0
  59. package/media/isolate.svg +1 -1
  60. package/media/joint-tactical-action-area.svg +1 -0
  61. package/media/landing-zone.svg +1 -0
  62. package/media/light-line.svg +1 -0
  63. package/media/limited-access-area.svg +1 -0
  64. package/media/line.svg +1 -1
  65. package/media/main-attack.svg +1 -1
  66. package/media/named-area-of-interest.svg +1 -0
  67. package/media/no-fire-area-irregular.svg +1 -0
  68. package/media/objective-area.svg +1 -0
  69. package/media/obstacle-bypass-difficult.svg +1 -1
  70. package/media/obstacle-bypass-easy.svg +1 -1
  71. package/media/obstacle-bypass-impossible.svg +1 -1
  72. package/media/phase-line.svg +1 -0
  73. package/media/pickup-zone.svg +1 -0
  74. package/media/polygon.svg +1 -1
  75. package/media/principal-direction-of-fire.svg +1 -1
  76. package/media/rectangle.svg +1 -1
  77. package/media/screen.svg +1 -0
  78. package/media/search-area.svg +1 -1
  79. package/media/secondary-direction-of-fire.svg +1 -0
  80. package/media/strong-point.svg +1 -1
  81. package/media/submarine-action-area.svg +1 -0
  82. package/media/submarine-generated-action-area.svg +1 -0
  83. package/media/support-by-fire.svg +1 -1
  84. package/media/supporting-attack.svg +1 -1
  85. package/media/target-area-of-interest.svg +1 -0
  86. package/media/turn.svg +1 -1
  87. package/media/turning-movement.svg +1 -0
  88. package/package.json +1 -1
package/dist/index.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { $ as getControlMeasureMetadata, $t as DEFAULT_GENERIC_LINE_OPTIONS, A as getMetersPerPixel, An as ControlMeasureMetadata, At as DEFAULT_CANALIZE_OPTIONS, B as ControlMeasureSnapshot, Bn as AnchorTransformEvent, Bt as DEFAULT_ATTACK_BY_FIRE_OPTIONS, C as snapToMidpointPerpendicular, Cn as StrongPointOptions, Ct as AntitankDitchOptions, D as BaselineFrameOrigin, Dn as DEFAULT_BOUNDARY_OPTIONS, Dt as ClearOptions, E as BaselineFrameOptions, En as BoundaryOptions, Et as DelayOptions, F as resolveStyleHints, Fn as TextAmplifierField, Ft as BlockMissionTaskOptions, G as cloneControlMeasure, Gt as AirborneAttackOptions, H as StyleHints, Ht as SupportByFireOptions, I as freezeOrientationOptions, In as TextAmplifierKey, It as DEFAULT_BLOCK_MISSION_TASK_OPTIONS, J as CONTROL_MEASURE_IDS, Jt as GenericCircleOptions, K as isKind, Kt as DEFAULT_AIRBORNE_ATTACK_OPTIONS, L as RenderOptions, Ln as TextAmplifiers, Lt as DEFAULT_FLOT_OPTIONS, M as SimpleStyleProps, Mn as TextAmplifierDescriptor, Mt as DEFAULT_BYPASS_OPTIONS, N as SimpleStyleRender, Nn as CanonicalTextAmplifiers, Nt as BreachOptions, O as createBaselineFrame, On as ControlMeasureGeometry, Ot as DEFAULT_CLEAR_OPTIONS, P as toSimpleStyle, Pn as TEXT_AMPLIFIER_FIELDS, Pt as DEFAULT_BREACH_OPTIONS, Q as OptionsByKind, Qt as GenericPolygonOptions, R as renderControlMeasure, Rn as canonicalTextAmplifierKey, Rt as FLOTOptions, S as pointOnMidpointPerpendicularAxis, Sn as DEFAULT_STRONG_POINT_OPTIONS, St as DEFAULT_ANTITANK_WALL_OPTIONS, T as BaselineFrameNormal, Tn as DEFAULT_BATTLE_POSITION_OPTIONS, Tt as DEFAULT_DELAY_OPTIONS, U as controlMeasureIdFromFeature, Ut as AttackHelicopterOptions, V as FeaturePartProps, Vn as ControlMeasureDrawRule, Vt as DEFAULT_SUPPORT_BY_FIRE_OPTIONS, W as ControlMeasure, Wt as DEFAULT_ATTACK_HELICOPTER_OPTIONS, X as ControlMeasureId, Xt as GenericRectangleOptions, Y as CONTROL_MEASURE_METADATA, Yt as DEFAULT_GENERIC_RECTANGLE_OPTIONS, Z as ControlMeasureKind, Zt as DEFAULT_GENERIC_POLYGON_OPTIONS, _ as blockDrawRule, _n as EncirclementOptions, _t as DEFAULT_FORTIFIED_AREA_OPTIONS, a as rectangleDrawRule, an as ClassicArrowOptions, at as DEFAULT_OBSTACLE_BYPASS_DIFFICULT_OPTIONS, b as createMidpointPerpendicularDrawRule, bn as DEFAULT_PRINCIPAL_DIRECTION_OF_FIRE_OPTIONS, bt as FortifiedLineOptions, c as line24DrawRule, cn as SupportingAttackOptions, ct as ObstacleBypassEasyOptions, d as line1DrawRule, dn as calculateMetrics, dt as DEFAULT_FIX_OPTIONS, en as GenericLineOptions, et as getControlMeasureMetadataByValue, f as ambushDrawRule, fn as computeInitialWidthPoint, ft as FixOptions, g as disruptDrawRule, gn as DEFAULT_ENCIRCLEMENT_OPTIONS, gt as DEFAULT_BLOCK_OPTIONS, h as centerRadiusDrawRule, hn as unproject, ht as BlockOptions, i as DEFAULT_AMBUSH_OPTIONS, in as ClassicArrowHeadStyle, it as ObstacleBypassImpossibleOptions, j as roundToFixed, jn as ParamDescriptor, jt as BypassOptions, k as EPSILON, kn as ControlMeasureGeometryType, kt as CanalizeOptions, l as line23DrawRule, ln as DEFAULT_MAIN_ATTACK_OPTIONS, lt as DEFAULT_TURN_OPTIONS, m as point12DrawRule, mn as project, mt as DisruptOptions, n as TacticalArrowOptions, nn as BlockArrowOptions, nt as listControlMeasureMetadata, o as axis1DrawRule, on as DEFAULT_CLASSIC_ARROW_OPTIONS, ot as ObstacleBypassDifficultOptions, p as attackByFireDrawRule, pn as Point2D, pt as DEFAULT_DISRUPT_OPTIONS, q as ControlMeasureStyle, qt as DEFAULT_GENERIC_CIRCLE_OPTIONS, r as AmbushOptions, rn as DEFAULT_BLOCK_ARROW_OPTIONS, rt as DEFAULT_OBSTACLE_BYPASS_IMPOSSIBLE_OPTIONS, s as supportByFireDrawRule, sn as DEFAULT_SUPPORTING_ATTACK_OPTIONS, st as DEFAULT_OBSTACLE_BYPASS_EASY_OPTIONS, t as DEFAULT_TACTICAL_ARROW_OPTIONS, tn as BlockArrowHeadStyle, tt as getDefaultOptions, u as turnDrawRule, un as MainAttackOptions, ut as TurnOptions, v as MidpointPerpendicularDrawRuleOptions, vn as DEFAULT_FINAL_PROTECTIVE_FIRE_OPTIONS, vt as FortifiedAreaOptions, w as BaselineFrame, wn as BattlePositionOptions, wt as DEFAULT_ANTITANK_DITCH_OPTIONS, x as getMidpointPerpendicularSignedDistance, xn as PrincipalDirectionOfFireOptions, xt as AntitankWallOptions, y as computeDefaultMidpointPerpendicularPoint, yn as FinalProtectiveFireOptions, yt as DEFAULT_FORTIFIED_LINE_OPTIONS, z as ControlMeasureRender, zn as normalizeTextAmplifiers, zt as AttackByFireOptions } from "./index-26Xb77jE.mjs";
2
- export { type AirborneAttackOptions, type AmbushOptions, type AnchorTransformEvent, type AntitankDitchOptions, type AntitankWallOptions, type AttackByFireOptions, type AttackHelicopterOptions, type BaselineFrame, type BaselineFrameNormal, type BaselineFrameOptions, type BaselineFrameOrigin, type BattlePositionOptions, type BlockArrowHeadStyle, type BlockArrowOptions, type BlockMissionTaskOptions, type BlockOptions, type BoundaryOptions, type BreachOptions, type BypassOptions, CONTROL_MEASURE_IDS, CONTROL_MEASURE_METADATA, type CanalizeOptions, type CanonicalTextAmplifiers, type ClassicArrowHeadStyle, type ClassicArrowOptions, type ClearOptions, type ControlMeasure, type ControlMeasureDrawRule, type ControlMeasureGeometry, type ControlMeasureGeometryType, type ControlMeasureId, type ControlMeasureKind, type ControlMeasureMetadata, type ControlMeasureRender, type ControlMeasureSnapshot, type ControlMeasureStyle, DEFAULT_AIRBORNE_ATTACK_OPTIONS, DEFAULT_AMBUSH_OPTIONS, DEFAULT_ANTITANK_DITCH_OPTIONS, DEFAULT_ANTITANK_WALL_OPTIONS, DEFAULT_ATTACK_BY_FIRE_OPTIONS, DEFAULT_ATTACK_HELICOPTER_OPTIONS, DEFAULT_BATTLE_POSITION_OPTIONS, DEFAULT_BLOCK_ARROW_OPTIONS, DEFAULT_BLOCK_MISSION_TASK_OPTIONS, DEFAULT_BLOCK_OPTIONS, DEFAULT_BOUNDARY_OPTIONS, DEFAULT_BREACH_OPTIONS, DEFAULT_BYPASS_OPTIONS, DEFAULT_CANALIZE_OPTIONS, DEFAULT_CLASSIC_ARROW_OPTIONS, DEFAULT_CLEAR_OPTIONS, DEFAULT_DELAY_OPTIONS, DEFAULT_DISRUPT_OPTIONS, DEFAULT_ENCIRCLEMENT_OPTIONS, DEFAULT_FINAL_PROTECTIVE_FIRE_OPTIONS, DEFAULT_FIX_OPTIONS, DEFAULT_FLOT_OPTIONS, DEFAULT_FORTIFIED_AREA_OPTIONS, DEFAULT_FORTIFIED_LINE_OPTIONS, DEFAULT_GENERIC_CIRCLE_OPTIONS, DEFAULT_GENERIC_LINE_OPTIONS, DEFAULT_GENERIC_POLYGON_OPTIONS, DEFAULT_GENERIC_RECTANGLE_OPTIONS, DEFAULT_MAIN_ATTACK_OPTIONS, DEFAULT_OBSTACLE_BYPASS_DIFFICULT_OPTIONS, DEFAULT_OBSTACLE_BYPASS_EASY_OPTIONS, DEFAULT_OBSTACLE_BYPASS_IMPOSSIBLE_OPTIONS, DEFAULT_PRINCIPAL_DIRECTION_OF_FIRE_OPTIONS, DEFAULT_STRONG_POINT_OPTIONS, DEFAULT_SUPPORTING_ATTACK_OPTIONS, DEFAULT_SUPPORT_BY_FIRE_OPTIONS, DEFAULT_TACTICAL_ARROW_OPTIONS, DEFAULT_TURN_OPTIONS, type DelayOptions, type DisruptOptions, EPSILON, type EncirclementOptions, type FLOTOptions, type FeaturePartProps, type FinalProtectiveFireOptions, type FixOptions, type FortifiedAreaOptions, type FortifiedLineOptions, type GenericCircleOptions, type GenericLineOptions, type GenericPolygonOptions, type GenericRectangleOptions, type MainAttackOptions, type MidpointPerpendicularDrawRuleOptions, type ObstacleBypassDifficultOptions, type ObstacleBypassEasyOptions, type ObstacleBypassImpossibleOptions, type OptionsByKind, type ParamDescriptor, type Point2D, type PrincipalDirectionOfFireOptions, type RenderOptions, type SimpleStyleProps, type SimpleStyleRender, type StrongPointOptions, type StyleHints, type SupportByFireOptions, type SupportingAttackOptions, TEXT_AMPLIFIER_FIELDS, type TacticalArrowOptions, type TextAmplifierDescriptor, type TextAmplifierField, type TextAmplifierKey, type TextAmplifiers, type TurnOptions, ambushDrawRule, attackByFireDrawRule, axis1DrawRule, blockDrawRule, calculateMetrics, canonicalTextAmplifierKey, centerRadiusDrawRule, cloneControlMeasure, computeDefaultMidpointPerpendicularPoint, computeInitialWidthPoint, controlMeasureIdFromFeature, createBaselineFrame, createMidpointPerpendicularDrawRule, disruptDrawRule, freezeOrientationOptions, getControlMeasureMetadata, getControlMeasureMetadataByValue, getDefaultOptions, getMetersPerPixel, getMidpointPerpendicularSignedDistance, isKind, line1DrawRule, line23DrawRule, line24DrawRule, listControlMeasureMetadata, normalizeTextAmplifiers, point12DrawRule, pointOnMidpointPerpendicularAxis, project, rectangleDrawRule, renderControlMeasure, resolveStyleHints, roundToFixed, snapToMidpointPerpendicular, supportByFireDrawRule, toSimpleStyle, turnDrawRule, unproject };
1
+ import { $ as DEFAULT_OBSTACLE_BYPASS_DIFFICULT_OPTIONS, $n as ControlMeasureRender, $r as AnchorTransformEvent, $t as BridgeheadLineOptions, A as roundToFixed, An as DEFAULT_CLASSIC_ARROW_OPTIONS, Ar as unproject, At as DEFAULT_COVER_OPTIONS, B as cloneControlMeasure, Bn as PickupZoneOptions, Br as TextAmplifierDescriptor, Bt as DEFAULT_BYPASS_OPTIONS, C as BaselineFrame, Cn as DEFAULT_GENERIC_LINE_OPTIONS, Cr as EngineerWorkLineOptions, Ct as DEFAULT_SCREEN_OPTIONS, D as createBaselineFrame, Dn as DEFAULT_BLOCK_ARROW_OPTIONS, Dr as Point2D, Dt as DEFAULT_DELAY_OPTIONS, E as BaselineFrameOrigin, En as BlockArrowOptions, Er as LabelSizeOptions, Et as GuardOptions, F as applyBoxTransformOptions, Fn as calculateMetrics, Fr as ControlMeasureGeometry, Ft as ClearOptions, G as ControlMeasureKind, Gn as AssemblyAreaOptions, Gr as LabelPlacementOverride, Gt as BattleHandoverLineOptions, H as CONTROL_MEASURE_IDS, Hn as LandingZoneOptions, Hr as AmplifierPlacements, Ht as DEFAULT_BREACH_OPTIONS, I as freezeOrientationOptions, In as computeInitialWidthPoint, Ir as ControlMeasureGeometryType, It as DEFAULT_CLEAR_OPTIONS, J as getControlMeasureMetadataByValue, Jn as DEFAULT_AREA_DEFENSE_OPTIONS, Jr as TextAmplifierKey, Jt as HandoverLineOptions, K as OptionsByKind, Kn as DEFAULT_ASSEMBLY_AREA_OPTIONS, Kr as TEXT_AMPLIFIER_FIELDS, Kt as DEFAULT_BATTLE_HANDOVER_LINE_OPTIONS, L as RenderOptions, Ln as AreaOfOperationsOptions, Lr as ControlMeasureMetadata, Lt as CanalizeOptions, M as SimpleStyleRender, Mn as SupportingAttackOptions, Mr as DEFAULT_BOUNDARY_OPTIONS, Mt as TacticalArrowOptions, N as toSimpleStyle, Nn as DEFAULT_MAIN_ATTACK_OPTIONS, Nr as BoxTransformDelta, Nt as CounterattackOptions, O as EPSILON, On as ClassicArrowHeadStyle, Or as haversineDistance, Ot as DelayOptions, P as resolveStyleHints, Pn as MainAttackOptions, Pr as ControlMeasureFillCapability, Pt as DEFAULT_COUNTERATTACK_OPTIONS, Q as ObstacleBypassImpossibleOptions, Qn as FinalProtectiveFireOptions, Qr as resolveAmplifierPlacement, Qt as HoldingLineOptions, R as renderControlMeasure, Rn as DEFAULT_AREA_OF_OPERATIONS_OPTIONS, Rr as ControlMeasurePaintCapability, Rt as DEFAULT_CANALIZE_OPTIONS, S as snapToMidpointPerpendicular, Sn as GenericPolygonOptions, Sr as DEFAULT_ENGINEER_WORK_LINE_OPTIONS, St as DEFAULT_ANTITANK_DITCH_OPTIONS, T as BaselineFrameOptions, Tn as BlockArrowHeadStyle, Tr as LightLineOptions, Tt as DEFAULT_GUARD_OPTIONS, U as CONTROL_MEASURE_METADATA, Un as DEFAULT_JOINT_TACTICAL_ACTION_AREA_OPTIONS, Ur as CanonicalTextAmplifiers, Ut as BlockMissionTaskOptions, V as isKind, Vn as DEFAULT_LANDING_ZONE_OPTIONS, Vr as AmplifierPlacement, Vt as BreachOptions, W as ControlMeasureId, Wn as JointTacticalActionAreaOptions, Wr as GeneratedLabelKey, Wt as DEFAULT_BLOCK_MISSION_TASK_OPTIONS, X as listControlMeasureMetadata, Xn as EncirclementOptions, Xr as canonicalTextAmplifierKey, Xt as ReleaseLineOptions, Y as getDefaultOptions, Yn as DEFAULT_ENCIRCLEMENT_OPTIONS, Yr as TextAmplifiers, Yt as DEFAULT_RELEASE_LINE_OPTIONS, Z as DEFAULT_OBSTACLE_BYPASS_IMPOSSIBLE_OPTIONS, Zn as DEFAULT_FINAL_PROTECTIVE_FIRE_OPTIONS, Zr as normalizeTextAmplifiers, Zt as DEFAULT_HOLDING_LINE_OPTIONS, _ as MidpointPerpendicularDrawRuleOptions, _n as DEFAULT_GENERIC_CIRCLE_OPTIONS, _r as DEFAULT_BATTLE_POSITION_OPTIONS, _t as DEFAULT_FORTIFIED_LINE_OPTIONS, a as supportByFireDrawRule, an as DEFAULT_FLOT_OPTIONS, ar as SecondaryDirectionOfFireOptions, at as DEFAULT_FIX_OPTIONS, b as getMidpointPerpendicularSignedDistance, bn as GenericRectangleOptions, br as DEFAULT_GENERIC_C2_LINE_OPTIONS, bt as DEFAULT_ANTITANK_WALL_OPTIONS, c as line23DrawRule, cn as DEFAULT_ATTACK_BY_FIRE_OPTIONS, cr as DEFAULT_DIRECTION_OF_SUPPORTING_ATTACK_OPTIONS, ct as DisruptOptions, d as ambushDrawRule, dn as AttackHelicopterOptions, dr as DirectionOfMainAttackOptions, dt as DEFAULT_TURNING_MOVEMENT_OPTIONS, ei as ControlMeasureDrawRule, en as DEFAULT_BRIDGEHEAD_LINE_OPTIONS, er as FeaturePartProps, et as ObstacleBypassDifficultOptions, f as attackByFireDrawRule, fn as DEFAULT_ATTACK_HELICOPTER_OPTIONS, fr as DEFAULT_DIRECTION_OF_ATTACK_AVIATION_OPTIONS, ft as TurningMovementOptions, g as blockDrawRule, gn as GenericTextOptions, gr as BattlePositionOptions, gt as FortifiedAreaOptions, h as disruptDrawRule, hn as DEFAULT_GENERIC_TEXT_OPTIONS, hr as StrongPointOptions, ht as DEFAULT_FORTIFIED_AREA_OPTIONS, i as axis1DrawRule, in as PhaseLineOptions, ir as SECONDARY_DIRECTION_OF_FIRE_DASH, it as TurnOptions, j as SimpleStyleProps, jn as DEFAULT_SUPPORTING_ATTACK_OPTIONS, jr as BoundaryOptions, jt as DEFAULT_TACTICAL_ARROW_OPTIONS, k as getMetersPerPixel, kn as ClassicArrowOptions, kr as project, kt as CoverOptions, l as turnDrawRule, ln as DEFAULT_SUPPORT_BY_FIRE_OPTIONS, lr as DirectionOfSupportingAttackOptions, lt as BlockOptions, m as centerRadiusDrawRule, mn as DEFAULT_AIRBORNE_ATTACK_OPTIONS, mr as DEFAULT_STRONG_POINT_OPTIONS, mt as FrontalAttackOptions, n as DEFAULT_AMBUSH_OPTIONS, nn as ForwardEdgeOfBattleAreaOptions, nr as controlMeasureIdFromFeature, nt as ObstacleBypassEasyOptions, o as line26DrawRule, on as FLOTOptions, or as DEFAULT_PRINCIPAL_DIRECTION_OF_FIRE_OPTIONS, ot as FixOptions, p as point12DrawRule, pn as AirborneAttackOptions, pr as DirectionOfAttackAviationOptions, pt as DEFAULT_FRONTAL_ATTACK_OPTIONS, q as getControlMeasureMetadata, qn as AreaDefenseOptions, qr as TextAmplifierField, qt as DEFAULT_HANDOVER_LINE_OPTIONS, r as rectangleDrawRule, rn as DEFAULT_PHASE_LINE_OPTIONS, rr as DEFAULT_SECONDARY_DIRECTION_OF_FIRE_OPTIONS, rt as DEFAULT_TURN_OPTIONS, s as line24DrawRule, sn as AttackByFireOptions, sr as PrincipalDirectionOfFireOptions, st as DEFAULT_DISRUPT_OPTIONS, t as AmbushOptions, tn as DEFAULT_FORWARD_EDGE_OF_BATTLE_AREA_OPTIONS, tr as StyleHints, tt as DEFAULT_OBSTACLE_BYPASS_EASY_OPTIONS, u as line1DrawRule, un as SupportByFireOptions, ur as DEFAULT_DIRECTION_OF_MAIN_ATTACK_OPTIONS, ut as DEFAULT_BLOCK_OPTIONS, v as computeDefaultMidpointPerpendicularPoint, vn as GenericCircleOptions, vr as ControlMeasureStyle, vt as FortifiedLineOptions, w as BaselineFrameNormal, wn as GenericLineOptions, wr as DEFAULT_LIGHT_LINE_OPTIONS, wt as ScreenOptions, x as pointOnMidpointPerpendicularAxis, xn as DEFAULT_GENERIC_POLYGON_OPTIONS, xr as GenericC2LineOptions, xt as AntitankDitchOptions, y as createMidpointPerpendicularDrawRule, yn as DEFAULT_GENERIC_RECTANGLE_OPTIONS, yr as FillPattern, yt as AntitankWallOptions, z as ControlMeasure, zn as DEFAULT_PICKUP_ZONE_OPTIONS, zr as ParamDescriptor, zt as BypassOptions } from "./index-DtgRm_dz.mjs";
2
+ export { type AirborneAttackOptions, type AmbushOptions, type AmplifierPlacement, type AmplifierPlacements, type AnchorTransformEvent, type AntitankDitchOptions, type AntitankWallOptions, type AreaDefenseOptions, type AreaOfOperationsOptions, type AssemblyAreaOptions, type AttackByFireOptions, type AttackHelicopterOptions, type BaselineFrame, type BaselineFrameNormal, type BaselineFrameOptions, type BaselineFrameOrigin, type BattleHandoverLineOptions, type BattlePositionOptions, type BlockArrowHeadStyle, type BlockArrowOptions, type BlockMissionTaskOptions, type BlockOptions, type BoundaryOptions, type BoxTransformDelta, type BreachOptions, type BridgeheadLineOptions, type BypassOptions, CONTROL_MEASURE_IDS, CONTROL_MEASURE_METADATA, type CanalizeOptions, type CanonicalTextAmplifiers, type ClassicArrowHeadStyle, type ClassicArrowOptions, type ClearOptions, type ControlMeasure, type ControlMeasureDrawRule, type ControlMeasureFillCapability, type ControlMeasureGeometry, type ControlMeasureGeometryType, type ControlMeasureId, type ControlMeasureKind, type ControlMeasureMetadata, type ControlMeasurePaintCapability, type ControlMeasureRender, type ControlMeasureStyle, type CounterattackOptions, type CoverOptions, DEFAULT_AIRBORNE_ATTACK_OPTIONS, DEFAULT_AMBUSH_OPTIONS, DEFAULT_ANTITANK_DITCH_OPTIONS, DEFAULT_ANTITANK_WALL_OPTIONS, DEFAULT_AREA_DEFENSE_OPTIONS, DEFAULT_AREA_OF_OPERATIONS_OPTIONS, DEFAULT_ASSEMBLY_AREA_OPTIONS, DEFAULT_ATTACK_BY_FIRE_OPTIONS, DEFAULT_ATTACK_HELICOPTER_OPTIONS, DEFAULT_BATTLE_HANDOVER_LINE_OPTIONS, DEFAULT_BATTLE_POSITION_OPTIONS, DEFAULT_BLOCK_ARROW_OPTIONS, DEFAULT_BLOCK_MISSION_TASK_OPTIONS, DEFAULT_BLOCK_OPTIONS, DEFAULT_BOUNDARY_OPTIONS, DEFAULT_BREACH_OPTIONS, DEFAULT_BRIDGEHEAD_LINE_OPTIONS, DEFAULT_BYPASS_OPTIONS, DEFAULT_CANALIZE_OPTIONS, DEFAULT_CLASSIC_ARROW_OPTIONS, DEFAULT_CLEAR_OPTIONS, DEFAULT_COUNTERATTACK_OPTIONS, DEFAULT_COVER_OPTIONS, DEFAULT_DELAY_OPTIONS, DEFAULT_DIRECTION_OF_ATTACK_AVIATION_OPTIONS, DEFAULT_DIRECTION_OF_MAIN_ATTACK_OPTIONS, DEFAULT_DIRECTION_OF_SUPPORTING_ATTACK_OPTIONS, DEFAULT_DISRUPT_OPTIONS, DEFAULT_ENCIRCLEMENT_OPTIONS, DEFAULT_ENGINEER_WORK_LINE_OPTIONS, DEFAULT_FINAL_PROTECTIVE_FIRE_OPTIONS, DEFAULT_FIX_OPTIONS, DEFAULT_FLOT_OPTIONS, DEFAULT_FORTIFIED_AREA_OPTIONS, DEFAULT_FORTIFIED_LINE_OPTIONS, DEFAULT_FORWARD_EDGE_OF_BATTLE_AREA_OPTIONS, DEFAULT_FRONTAL_ATTACK_OPTIONS, DEFAULT_GENERIC_C2_LINE_OPTIONS, DEFAULT_GENERIC_CIRCLE_OPTIONS, DEFAULT_GENERIC_LINE_OPTIONS, DEFAULT_GENERIC_POLYGON_OPTIONS, DEFAULT_GENERIC_RECTANGLE_OPTIONS, DEFAULT_GENERIC_TEXT_OPTIONS, DEFAULT_GUARD_OPTIONS, DEFAULT_HANDOVER_LINE_OPTIONS, DEFAULT_HOLDING_LINE_OPTIONS, DEFAULT_JOINT_TACTICAL_ACTION_AREA_OPTIONS, DEFAULT_LANDING_ZONE_OPTIONS, DEFAULT_LIGHT_LINE_OPTIONS, DEFAULT_MAIN_ATTACK_OPTIONS, DEFAULT_OBSTACLE_BYPASS_DIFFICULT_OPTIONS, DEFAULT_OBSTACLE_BYPASS_EASY_OPTIONS, DEFAULT_OBSTACLE_BYPASS_IMPOSSIBLE_OPTIONS, DEFAULT_PHASE_LINE_OPTIONS, DEFAULT_PICKUP_ZONE_OPTIONS, DEFAULT_PRINCIPAL_DIRECTION_OF_FIRE_OPTIONS, DEFAULT_RELEASE_LINE_OPTIONS, DEFAULT_SCREEN_OPTIONS, DEFAULT_SECONDARY_DIRECTION_OF_FIRE_OPTIONS, DEFAULT_STRONG_POINT_OPTIONS, DEFAULT_SUPPORTING_ATTACK_OPTIONS, DEFAULT_SUPPORT_BY_FIRE_OPTIONS, DEFAULT_TACTICAL_ARROW_OPTIONS, DEFAULT_TURNING_MOVEMENT_OPTIONS, DEFAULT_TURN_OPTIONS, type DelayOptions, type DirectionOfAttackAviationOptions, type DirectionOfMainAttackOptions, type DirectionOfSupportingAttackOptions, type DisruptOptions, EPSILON, type EncirclementOptions, type EngineerWorkLineOptions, type FLOTOptions, type FeaturePartProps, type FillPattern, type FinalProtectiveFireOptions, type FixOptions, type FortifiedAreaOptions, type FortifiedLineOptions, type ForwardEdgeOfBattleAreaOptions, type FrontalAttackOptions, type GeneratedLabelKey, type GenericC2LineOptions, type GenericCircleOptions, type GenericLineOptions, type GenericPolygonOptions, type GenericRectangleOptions, type GenericTextOptions, type GuardOptions, type HandoverLineOptions, type HoldingLineOptions, type JointTacticalActionAreaOptions, type LabelPlacementOverride, type LabelSizeOptions, type LandingZoneOptions, type LightLineOptions, type MainAttackOptions, type MidpointPerpendicularDrawRuleOptions, type ObstacleBypassDifficultOptions, type ObstacleBypassEasyOptions, type ObstacleBypassImpossibleOptions, type OptionsByKind, type ParamDescriptor, type PhaseLineOptions, type PickupZoneOptions, type Point2D, type PrincipalDirectionOfFireOptions, type ReleaseLineOptions, type RenderOptions, SECONDARY_DIRECTION_OF_FIRE_DASH, type ScreenOptions, type SecondaryDirectionOfFireOptions, type SimpleStyleProps, type SimpleStyleRender, type StrongPointOptions, type StyleHints, type SupportByFireOptions, type SupportingAttackOptions, TEXT_AMPLIFIER_FIELDS, type TacticalArrowOptions, type TextAmplifierDescriptor, type TextAmplifierField, type TextAmplifierKey, type TextAmplifiers, type TurnOptions, type TurningMovementOptions, ambushDrawRule, applyBoxTransformOptions, attackByFireDrawRule, axis1DrawRule, blockDrawRule, calculateMetrics, canonicalTextAmplifierKey, centerRadiusDrawRule, cloneControlMeasure, computeDefaultMidpointPerpendicularPoint, computeInitialWidthPoint, controlMeasureIdFromFeature, createBaselineFrame, createMidpointPerpendicularDrawRule, disruptDrawRule, freezeOrientationOptions, getControlMeasureMetadata, getControlMeasureMetadataByValue, getDefaultOptions, getMetersPerPixel, getMidpointPerpendicularSignedDistance, haversineDistance, isKind, line1DrawRule, line23DrawRule, line24DrawRule, line26DrawRule, listControlMeasureMetadata, normalizeTextAmplifiers, point12DrawRule, pointOnMidpointPerpendicularAxis, project, rectangleDrawRule, renderControlMeasure, resolveAmplifierPlacement, resolveStyleHints, roundToFixed, snapToMidpointPerpendicular, supportByFireDrawRule, toSimpleStyle, turnDrawRule, unproject };
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as supportByFireDrawRule, A as DEFAULT_DELAY_OPTIONS, B as DEFAULT_BLOCK_MISSION_TASK_OPTIONS, C as DEFAULT_FORTIFIED_AREA_OPTIONS, D as DEFAULT_FINAL_PROTECTIVE_FIRE_OPTIONS, E as DEFAULT_FIX_OPTIONS, F as DEFAULT_GENERIC_CIRCLE_OPTIONS, G as DEFAULT_ATTACK_HELICOPTER_OPTIONS, H as DEFAULT_BLOCK_ARROW_OPTIONS, I as DEFAULT_CLASSIC_ARROW_OPTIONS, J as DEFAULT_ANTITANK_DITCH_OPTIONS, K as DEFAULT_ATTACK_BY_FIRE_OPTIONS, L as DEFAULT_CANALIZE_OPTIONS, M as DEFAULT_GENERIC_RECTANGLE_OPTIONS, N as DEFAULT_GENERIC_POLYGON_OPTIONS, O as DEFAULT_ENCIRCLEMENT_OPTIONS, P as DEFAULT_GENERIC_LINE_OPTIONS, Q as axis1DrawRule, R as DEFAULT_BYPASS_OPTIONS, S as DEFAULT_MAIN_ATTACK_OPTIONS, St as roundToFixed, T as DEFAULT_FLOT_OPTIONS, U as DEFAULT_BLOCK_OPTIONS, V as DEFAULT_BOUNDARY_OPTIONS, W as DEFAULT_BATTLE_POSITION_OPTIONS, X as DEFAULT_AIRBORNE_ATTACK_OPTIONS, Y as DEFAULT_AMBUSH_OPTIONS, Z as rectangleDrawRule, _ as DEFAULT_TACTICAL_ARROW_OPTIONS, _t as computeInitialWidthPoint, a as resolveStyleHints, at as attackByFireDrawRule, b as DEFAULT_OBSTACLE_BYPASS_EASY_OPTIONS, bt as EPSILON, c as DEFINITIONS, ct as disruptDrawRule, d as getDefaultOptions, dt as createMidpointPerpendicularDrawRule, et as line24DrawRule, f as listControlMeasureMetadata, ft as getMidpointPerpendicularSignedDistance, g as DEFAULT_STRONG_POINT_OPTIONS, gt as calculateMetrics, h as DEFAULT_SUPPORT_BY_FIRE_OPTIONS, ht as createBaselineFrame, i as normalizeTextAmplifiers, it as ambushDrawRule, j as DEFAULT_CLEAR_OPTIONS, k as DEFAULT_DISRUPT_OPTIONS, l as getControlMeasureMetadata, lt as blockDrawRule, m as DEFAULT_SUPPORTING_ATTACK_OPTIONS, mt as snapToMidpointPerpendicular, n as TEXT_AMPLIFIER_FIELDS, nt as turnDrawRule, o as CONTROL_MEASURE_IDS, ot as point12DrawRule, p as DEFAULT_TURN_OPTIONS, pt as pointOnMidpointPerpendicularAxis, q as DEFAULT_ANTITANK_WALL_OPTIONS, r as canonicalTextAmplifierKey, rt as line1DrawRule, s as CONTROL_MEASURE_METADATA, st as centerRadiusDrawRule, t as renderControlMeasure, tt as line23DrawRule, u as getControlMeasureMetadataByValue, ut as computeDefaultMidpointPerpendicularPoint, v as DEFAULT_PRINCIPAL_DIRECTION_OF_FIRE_OPTIONS, vt as project, w as DEFAULT_FORTIFIED_LINE_OPTIONS, x as DEFAULT_OBSTACLE_BYPASS_DIFFICULT_OPTIONS, xt as getMetersPerPixel, y as DEFAULT_OBSTACLE_BYPASS_IMPOSSIBLE_OPTIONS, yt as unproject, z as DEFAULT_BREACH_OPTIONS } from "./renderControlMeasure-CFdgTURO.mjs";
1
+ import { $ as DEFAULT_CANALIZE_OPTIONS, $t as roundToFixed, A as DEFAULT_FORWARD_EDGE_OF_BATTLE_AREA_OPTIONS, At as line24DrawRule, B as DEFAULT_GUARD_OPTIONS, Bt as computeDefaultMidpointPerpendicularPoint, C as DEFAULT_JOINT_TACTICAL_ACTION_AREA_OPTIONS, Ct as resolveAmplifierPlacement, D as DEFAULT_FORTIFIED_LINE_OPTIONS, Dt as axis1DrawRule, E as DEFAULT_FORTIFIED_AREA_OPTIONS, Et as rectangleDrawRule, F as DEFAULT_FLOT_OPTIONS, Ft as attackByFireDrawRule, G as DEFAULT_SUPPORTING_ATTACK_OPTIONS, Gt as createBaselineFrame, H as DEFAULT_COVER_OPTIONS, Ht as getMidpointPerpendicularSignedDistance, I as DEFAULT_FIX_OPTIONS, It as point12DrawRule, J as DEFAULT_GENERIC_RECTANGLE_OPTIONS, Jt as haversineDistance, K as DEFAULT_CLEAR_OPTIONS, Kt as calculateMetrics, L as DEFAULT_FINAL_PROTECTIVE_FIRE_OPTIONS, Lt as centerRadiusDrawRule, M as DEFAULT_HOLDING_LINE_OPTIONS, Mt as turnDrawRule, N as DEFAULT_BRIDGEHEAD_LINE_OPTIONS, Nt as line1DrawRule, O as DEFAULT_BATTLE_HANDOVER_LINE_OPTIONS, Ot as supportByFireDrawRule, P as DEFAULT_PHASE_LINE_OPTIONS, Pt as ambushDrawRule, Q as DEFAULT_CLASSIC_ARROW_OPTIONS, Qt as getMetersPerPixel, R as DEFAULT_ENCIRCLEMENT_OPTIONS, Rt as disruptDrawRule, S as DEFAULT_LANDING_ZONE_OPTIONS, St as normalizeTextAmplifiers, T as DEFAULT_FRONTAL_ATTACK_OPTIONS, Tt as DEFAULT_AIRBORNE_ATTACK_OPTIONS, U as DEFAULT_TACTICAL_ARROW_OPTIONS, Ut as pointOnMidpointPerpendicularAxis, V as DEFAULT_DELAY_OPTIONS, Vt as createMidpointPerpendicularDrawRule, W as DEFAULT_COUNTERATTACK_OPTIONS, Wt as snapToMidpointPerpendicular, X as DEFAULT_GENERIC_LINE_OPTIONS, Xt as unproject, Y as DEFAULT_GENERIC_POLYGON_OPTIONS, Yt as project, Z as DEFAULT_GENERIC_CIRCLE_OPTIONS, Zt as EPSILON, _ as DEFAULT_PICKUP_ZONE_OPTIONS, _t as DEFAULT_DIRECTION_OF_SUPPORTING_ATTACK_OPTIONS, a as DEFINITIONS, at as DEFAULT_LIGHT_LINE_OPTIONS, b as DEFAULT_OBSTACLE_BYPASS_DIFFICULT_OPTIONS, bt as TEXT_AMPLIFIER_FIELDS, c as getDefaultOptions, ct as DEFAULT_BLOCK_OPTIONS, d as DEFAULT_TURN_OPTIONS, dt as DEFAULT_ATTACK_BY_FIRE_OPTIONS, et as DEFAULT_BYPASS_OPTIONS, f as DEFAULT_SUPPORT_BY_FIRE_OPTIONS, ft as DEFAULT_ANTITANK_WALL_OPTIONS, g as DEFAULT_PRINCIPAL_DIRECTION_OF_FIRE_OPTIONS, gt as DEFAULT_AREA_DEFENSE_OPTIONS, h as SECONDARY_DIRECTION_OF_FIRE_DASH, ht as DEFAULT_AREA_OF_OPERATIONS_OPTIONS, i as CONTROL_MEASURE_METADATA, it as DEFAULT_ENGINEER_WORK_LINE_OPTIONS, j as DEFAULT_RELEASE_LINE_OPTIONS, jt as line23DrawRule, k as DEFAULT_HANDOVER_LINE_OPTIONS, kt as line26DrawRule, l as listControlMeasureMetadata, lt as DEFAULT_BATTLE_POSITION_OPTIONS, m as DEFAULT_SECONDARY_DIRECTION_OF_FIRE_OPTIONS, mt as DEFAULT_ASSEMBLY_AREA_OPTIONS, n as resolveStyleHints, nt as DEFAULT_BLOCK_MISSION_TASK_OPTIONS, o as getControlMeasureMetadata, ot as DEFAULT_BOUNDARY_OPTIONS, p as DEFAULT_STRONG_POINT_OPTIONS, pt as DEFAULT_ANTITANK_DITCH_OPTIONS, q as DEFAULT_GENERIC_TEXT_OPTIONS, qt as computeInitialWidthPoint, r as CONTROL_MEASURE_IDS, rt as DEFAULT_GENERIC_C2_LINE_OPTIONS, s as getControlMeasureMetadataByValue, st as DEFAULT_BLOCK_ARROW_OPTIONS, t as renderControlMeasure, tt as DEFAULT_BREACH_OPTIONS, u as DEFAULT_TURNING_MOVEMENT_OPTIONS, ut as DEFAULT_ATTACK_HELICOPTER_OPTIONS, v as DEFAULT_OBSTACLE_BYPASS_IMPOSSIBLE_OPTIONS, vt as DEFAULT_DIRECTION_OF_MAIN_ATTACK_OPTIONS, w as DEFAULT_SCREEN_OPTIONS, wt as DEFAULT_AMBUSH_OPTIONS, x as DEFAULT_MAIN_ATTACK_OPTIONS, xt as canonicalTextAmplifierKey, y as DEFAULT_OBSTACLE_BYPASS_EASY_OPTIONS, yt as DEFAULT_DIRECTION_OF_ATTACK_AVIATION_OPTIONS, z as DEFAULT_DISRUPT_OPTIONS, zt as blockDrawRule } from "./renderControlMeasure-CAfC2nEw.mjs";
2
2
  //#region src/freeze-orientation.ts
3
3
  /**
4
4
  * Dispatches to a measure kind's `freezeOrientation` hook (see
@@ -13,6 +13,20 @@ function freezeOrientationOptions(kind, controlPoints, options) {
13
13
  if (!definition.freezeOrientation) return void 0;
14
14
  return definition.freezeOrientation(controlPoints, options ?? {});
15
15
  }
16
+ /**
17
+ * Dispatches to a measure kind's `transformOptions` hook (see
18
+ * {@link import("./define").ControlMeasureDefinition.transformOptions}), folding
19
+ * a box transform gesture's `delta` (screen-space scale/rotation) into option
20
+ * values for a graphic that persists orientation/size as options rather than in
21
+ * geometry. Returns an options patch to merge, or `undefined` when the kind
22
+ * declares no hook (or the hook finds nothing to fold). Edit hosts call this at
23
+ * a rotate/scale gesture's commit (ADR-0017).
24
+ */
25
+ function applyBoxTransformOptions(kind, options, delta) {
26
+ const definition = DEFINITIONS[kind];
27
+ if (!definition.transformOptions) return void 0;
28
+ return definition.transformOptions(options ?? {}, delta);
29
+ }
16
30
  //#endregion
17
31
  //#region src/instance.ts
18
32
  function isKind(cm, kind) {
@@ -21,7 +35,7 @@ function isKind(cm, kind) {
21
35
  /**
22
36
  * Deep-clone a `ControlMeasure` so held references survive mutations to the
23
37
  * original (and vice versa). Used by the session façade to build the
24
- * `measure` half of `ControlMeasureSnapshot`. Nested values inside
38
+ * `graphic` half of TacticalDraw's `GraphicSnapshot`. Nested values inside
25
39
  * `options`, `style`, `properties`, and `textAmplifiers` are cloned too —
26
40
  * `properties` is `Record<string, unknown>` and may carry arbitrary host
27
41
  * metadata, so a shallow copy would leak shared references.
@@ -57,8 +71,9 @@ function controlMeasureIdFromFeature(feature) {
57
71
  * three-layer merge and stays a pure post-processing step.
58
72
  *
59
73
  * Lossy mapping, by design:
60
- * - `strokeDash` has no simplestyle equivalent and is dropped — dashed
61
- * doctrinal sub-lines render solid in simplestyle consumers.
74
+ * - `strokeDash` and `fillPattern` have no simplestyle equivalent and are
75
+ * dropped — dashed sub-lines and patterned fills render solid in
76
+ * simplestyle consumers.
62
77
  * - colors must be hex or `rgb()/rgba()`; alpha becomes `*-opacity`. Other
63
78
  * color forms (named, `hsl()`) are omitted rather than guessed.
64
79
  */
@@ -114,4 +129,4 @@ function toHexChannel(value) {
114
129
  return Math.max(0, Math.min(255, Math.round(value))).toString(16).padStart(2, "0");
115
130
  }
116
131
  //#endregion
117
- export { CONTROL_MEASURE_IDS, CONTROL_MEASURE_METADATA, DEFAULT_AIRBORNE_ATTACK_OPTIONS, DEFAULT_AMBUSH_OPTIONS, DEFAULT_ANTITANK_DITCH_OPTIONS, DEFAULT_ANTITANK_WALL_OPTIONS, DEFAULT_ATTACK_BY_FIRE_OPTIONS, DEFAULT_ATTACK_HELICOPTER_OPTIONS, DEFAULT_BATTLE_POSITION_OPTIONS, DEFAULT_BLOCK_ARROW_OPTIONS, DEFAULT_BLOCK_MISSION_TASK_OPTIONS, DEFAULT_BLOCK_OPTIONS, DEFAULT_BOUNDARY_OPTIONS, DEFAULT_BREACH_OPTIONS, DEFAULT_BYPASS_OPTIONS, DEFAULT_CANALIZE_OPTIONS, DEFAULT_CLASSIC_ARROW_OPTIONS, DEFAULT_CLEAR_OPTIONS, DEFAULT_DELAY_OPTIONS, DEFAULT_DISRUPT_OPTIONS, DEFAULT_ENCIRCLEMENT_OPTIONS, DEFAULT_FINAL_PROTECTIVE_FIRE_OPTIONS, DEFAULT_FIX_OPTIONS, DEFAULT_FLOT_OPTIONS, DEFAULT_FORTIFIED_AREA_OPTIONS, DEFAULT_FORTIFIED_LINE_OPTIONS, DEFAULT_GENERIC_CIRCLE_OPTIONS, DEFAULT_GENERIC_LINE_OPTIONS, DEFAULT_GENERIC_POLYGON_OPTIONS, DEFAULT_GENERIC_RECTANGLE_OPTIONS, DEFAULT_MAIN_ATTACK_OPTIONS, DEFAULT_OBSTACLE_BYPASS_DIFFICULT_OPTIONS, DEFAULT_OBSTACLE_BYPASS_EASY_OPTIONS, DEFAULT_OBSTACLE_BYPASS_IMPOSSIBLE_OPTIONS, DEFAULT_PRINCIPAL_DIRECTION_OF_FIRE_OPTIONS, DEFAULT_STRONG_POINT_OPTIONS, DEFAULT_SUPPORTING_ATTACK_OPTIONS, DEFAULT_SUPPORT_BY_FIRE_OPTIONS, DEFAULT_TACTICAL_ARROW_OPTIONS, DEFAULT_TURN_OPTIONS, EPSILON, TEXT_AMPLIFIER_FIELDS, ambushDrawRule, attackByFireDrawRule, axis1DrawRule, blockDrawRule, calculateMetrics, canonicalTextAmplifierKey, centerRadiusDrawRule, cloneControlMeasure, computeDefaultMidpointPerpendicularPoint, computeInitialWidthPoint, controlMeasureIdFromFeature, createBaselineFrame, createMidpointPerpendicularDrawRule, disruptDrawRule, freezeOrientationOptions, getControlMeasureMetadata, getControlMeasureMetadataByValue, getDefaultOptions, getMetersPerPixel, getMidpointPerpendicularSignedDistance, isKind, line1DrawRule, line23DrawRule, line24DrawRule, listControlMeasureMetadata, normalizeTextAmplifiers, point12DrawRule, pointOnMidpointPerpendicularAxis, project, rectangleDrawRule, renderControlMeasure, resolveStyleHints, roundToFixed, snapToMidpointPerpendicular, supportByFireDrawRule, toSimpleStyle, turnDrawRule, unproject };
132
+ export { CONTROL_MEASURE_IDS, CONTROL_MEASURE_METADATA, DEFAULT_AIRBORNE_ATTACK_OPTIONS, DEFAULT_AMBUSH_OPTIONS, DEFAULT_ANTITANK_DITCH_OPTIONS, DEFAULT_ANTITANK_WALL_OPTIONS, DEFAULT_AREA_DEFENSE_OPTIONS, DEFAULT_AREA_OF_OPERATIONS_OPTIONS, DEFAULT_ASSEMBLY_AREA_OPTIONS, DEFAULT_ATTACK_BY_FIRE_OPTIONS, DEFAULT_ATTACK_HELICOPTER_OPTIONS, DEFAULT_BATTLE_HANDOVER_LINE_OPTIONS, DEFAULT_BATTLE_POSITION_OPTIONS, DEFAULT_BLOCK_ARROW_OPTIONS, DEFAULT_BLOCK_MISSION_TASK_OPTIONS, DEFAULT_BLOCK_OPTIONS, DEFAULT_BOUNDARY_OPTIONS, DEFAULT_BREACH_OPTIONS, DEFAULT_BRIDGEHEAD_LINE_OPTIONS, DEFAULT_BYPASS_OPTIONS, DEFAULT_CANALIZE_OPTIONS, DEFAULT_CLASSIC_ARROW_OPTIONS, DEFAULT_CLEAR_OPTIONS, DEFAULT_COUNTERATTACK_OPTIONS, DEFAULT_COVER_OPTIONS, DEFAULT_DELAY_OPTIONS, DEFAULT_DIRECTION_OF_ATTACK_AVIATION_OPTIONS, DEFAULT_DIRECTION_OF_MAIN_ATTACK_OPTIONS, DEFAULT_DIRECTION_OF_SUPPORTING_ATTACK_OPTIONS, DEFAULT_DISRUPT_OPTIONS, DEFAULT_ENCIRCLEMENT_OPTIONS, DEFAULT_ENGINEER_WORK_LINE_OPTIONS, DEFAULT_FINAL_PROTECTIVE_FIRE_OPTIONS, DEFAULT_FIX_OPTIONS, DEFAULT_FLOT_OPTIONS, DEFAULT_FORTIFIED_AREA_OPTIONS, DEFAULT_FORTIFIED_LINE_OPTIONS, DEFAULT_FORWARD_EDGE_OF_BATTLE_AREA_OPTIONS, DEFAULT_FRONTAL_ATTACK_OPTIONS, DEFAULT_GENERIC_C2_LINE_OPTIONS, DEFAULT_GENERIC_CIRCLE_OPTIONS, DEFAULT_GENERIC_LINE_OPTIONS, DEFAULT_GENERIC_POLYGON_OPTIONS, DEFAULT_GENERIC_RECTANGLE_OPTIONS, DEFAULT_GENERIC_TEXT_OPTIONS, DEFAULT_GUARD_OPTIONS, DEFAULT_HANDOVER_LINE_OPTIONS, DEFAULT_HOLDING_LINE_OPTIONS, DEFAULT_JOINT_TACTICAL_ACTION_AREA_OPTIONS, DEFAULT_LANDING_ZONE_OPTIONS, DEFAULT_LIGHT_LINE_OPTIONS, DEFAULT_MAIN_ATTACK_OPTIONS, DEFAULT_OBSTACLE_BYPASS_DIFFICULT_OPTIONS, DEFAULT_OBSTACLE_BYPASS_EASY_OPTIONS, DEFAULT_OBSTACLE_BYPASS_IMPOSSIBLE_OPTIONS, DEFAULT_PHASE_LINE_OPTIONS, DEFAULT_PICKUP_ZONE_OPTIONS, DEFAULT_PRINCIPAL_DIRECTION_OF_FIRE_OPTIONS, DEFAULT_RELEASE_LINE_OPTIONS, DEFAULT_SCREEN_OPTIONS, DEFAULT_SECONDARY_DIRECTION_OF_FIRE_OPTIONS, DEFAULT_STRONG_POINT_OPTIONS, DEFAULT_SUPPORTING_ATTACK_OPTIONS, DEFAULT_SUPPORT_BY_FIRE_OPTIONS, DEFAULT_TACTICAL_ARROW_OPTIONS, DEFAULT_TURNING_MOVEMENT_OPTIONS, DEFAULT_TURN_OPTIONS, EPSILON, SECONDARY_DIRECTION_OF_FIRE_DASH, TEXT_AMPLIFIER_FIELDS, ambushDrawRule, applyBoxTransformOptions, attackByFireDrawRule, axis1DrawRule, blockDrawRule, calculateMetrics, canonicalTextAmplifierKey, centerRadiusDrawRule, cloneControlMeasure, computeDefaultMidpointPerpendicularPoint, computeInitialWidthPoint, controlMeasureIdFromFeature, createBaselineFrame, createMidpointPerpendicularDrawRule, disruptDrawRule, freezeOrientationOptions, getControlMeasureMetadata, getControlMeasureMetadataByValue, getDefaultOptions, getMetersPerPixel, getMidpointPerpendicularSignedDistance, haversineDistance, isKind, line1DrawRule, line23DrawRule, line24DrawRule, line26DrawRule, listControlMeasureMetadata, normalizeTextAmplifiers, point12DrawRule, pointOnMidpointPerpendicularAxis, project, rectangleDrawRule, renderControlMeasure, resolveAmplifierPlacement, resolveStyleHints, roundToFixed, snapToMidpointPerpendicular, supportByFireDrawRule, toSimpleStyle, turnDrawRule, unproject };
@@ -1,29 +1,85 @@
1
- import { X as ControlMeasureId } from "../index-26Xb77jE.mjs";
1
+ import { W as ControlMeasureId, Yr as TextAmplifiers, yr as FillPattern } from "../index-DtgRm_dz.mjs";
2
2
  import { FeatureCollection, Geometry } from "geojson";
3
3
 
4
4
  //#region src/preview/index.d.ts
5
+ /** The hatch fill patterns a preview can render — the `FillPattern` vocabulary
6
+ * minus `"solid"` (a plain fill, not a pattern). */
7
+ type PreviewFillPattern = Exclude<FillPattern, "solid">;
8
+ /** Side length (SVG units) of the repeating hatch tile in {@link PREVIEW_FILL_PATTERNS}. */
9
+ declare const PREVIEW_PATTERN_TILE = 8;
10
+ /**
11
+ * SVG `<pattern>` tile geometry every preview consumer (docs catalog, sidebar
12
+ * thumbnail, README/`media` generator) renders so a `fillPattern` shape looks
13
+ * identical everywhere; the `d` paths mirror the leaflet adapter's fill-pattern
14
+ * tiles over a {@link PREVIEW_PATTERN_TILE}-unit tile. Kept here as the single
15
+ * source so a new pattern is defined once, not copied per renderer.
16
+ */
17
+ declare const PREVIEW_FILL_PATTERNS: readonly {
18
+ readonly id: PreviewFillPattern;
19
+ readonly paths: readonly string[]; /** Filled dot centers (tile units); the `"dots"` family has no stroked path. */
20
+ readonly dots?: readonly (readonly [number, number])[];
21
+ }[];
22
+ /** Radius (SVG units) of a {@link PREVIEW_FILL_PATTERNS} dot. */
23
+ declare const PREVIEW_PATTERN_DOT_RADIUS = 1.25;
5
24
  /**
6
25
  * Renders a measure's representative preview to GeoJSON. Pure — no map engine,
7
26
  * so it runs identically at build time (docs catalog, README generator) and in
8
27
  * the browser (preview app). Returns an empty collection if the generator
9
28
  * throws, so a single broken measure never breaks a whole gallery.
29
+ *
30
+ * `overrides.textAmplifiers` and `overrides.options` are each merged over the
31
+ * sample's own amplifiers/options (override wins per key, sample-only keys
32
+ * survive) — used by the params panel's placement preview to substitute
33
+ * placeholder values (`<T>`, `<N>`, …) for whatever the sample carries.
10
34
  */
11
- declare function renderRepresentative(id: ControlMeasureId): FeatureCollection<Geometry, unknown>;
35
+ declare function renderRepresentative(id: ControlMeasureId, overrides?: {
36
+ textAmplifiers?: TextAmplifiers;
37
+ options?: Record<string, unknown>;
38
+ }): FeatureCollection<Geometry, unknown>;
12
39
  /** A styling-free preview primitive. Consumers supply stroke, radius, font,
13
40
  * and colors when they draw it. */
14
41
  interface PreviewShape {
15
42
  type: "polyline" | "polygon" | "circle" | "text";
16
43
  /** SVG path data for `polyline`/`polygon`. */
17
44
  d?: string;
45
+ /** Intrinsic dash pattern carried by a stroked feature. Empty means solid. */
46
+ strokeDash?: number[];
18
47
  /** Center for `circle`/`text`. */
19
48
  cx?: number;
20
49
  cy?: number;
21
50
  /** Whether a `polygon` is a doctrinal solid (arrowhead) vs an area outline. */
22
51
  filled?: boolean;
52
+ /** Pattern requested by a filled polygon. */
53
+ fillPattern?: PreviewFillPattern;
23
54
  /** Glyph text for `text` (e.g. breach's "B"). */
24
55
  text?: string;
25
56
  /** Generator-frame rotation (radians) for `text`. */
26
57
  rotation?: number;
58
+ /**
59
+ * Text height in the same SVG units as `d`/`cx`/`cy`, derived from the
60
+ * source label's ground-anchored `textSizeMeters` (ADR-0028) scaled through
61
+ * the fit into the viewBox, then clamped so a long string can't exceed ~40%
62
+ * of the viewBox width. Present only when the label carried real
63
+ * ground-anchored sizing; a fixed glyph with no sizing (e.g. breach's "B",
64
+ * or Boundary's echelon-only sample) or a screen-anchored label (bare
65
+ * `textSizePixels`, unresolvable to a ground size without a live map
66
+ * resolution) leaves this `undefined` — a consumer should fall back to its
67
+ * own fixed font size, matching behavior from before this field existed.
68
+ */
69
+ heightPx?: number;
70
+ /** Horizontal alignment relative to (`cx`, `cy`), mirroring the label
71
+ * feature's `textAnchor` — `"start"`/`"end"` anchor the text at the point
72
+ * instead of centering it. Undefined = centered. */
73
+ textAnchor?: "start" | "end";
74
+ /** Whether the text needs an opaque readability backdrop. */
75
+ textBackground?: boolean;
76
+ /** Whether the text needs a white halo behind its glyphs. */
77
+ textHalo?: boolean;
78
+ /** Multi-line justification within the text block, mirroring the label
79
+ * feature's `textJustify`. The block itself still centers on (`cx`, `cy`). */
80
+ textJustify?: "left" | "center" | "right";
81
+ /** Typography preset, mirroring the label feature's `textStyle`. */
82
+ textStyle?: "regular" | "italic" | "light" | "caps";
27
83
  }
28
84
  /** Target viewBox the geometry is fit into. */
29
85
  interface ProjectDimensions {
@@ -41,5 +97,60 @@ declare function projectRenderToShapes(fc: FeatureCollection<Geometry, unknown>,
41
97
  shapes: PreviewShape[];
42
98
  ok: boolean;
43
99
  };
100
+ /**
101
+ * On-screen width (SVG units) of a `textBackground` label's readability box at
102
+ * `fontSize`: the glyph run (via {@link CHAR_WIDTH_RATIO}) or the font size,
103
+ * whichever is wider, plus a small horizontal pad. Shared by every preview
104
+ * consumer that paints the backdrop rect so the box width stays consistent.
105
+ */
106
+ declare function previewLabelBackgroundWidth(text: string | undefined, fontSize: number): number;
107
+ /**
108
+ * Grows a viewBox to include every `text` shape's estimated on-screen box —
109
+ * {@link projectRenderToShapes} fits geometry coordinates only, so an
110
+ * anchor-aware label (e.g. a phase line's end-anchored "PL ECHO") can extend
111
+ * well past the plain `0 0 width height` viewBox. Consumers should build
112
+ * their SVG `viewBox` from this instead.
113
+ *
114
+ * For each text shape (skipping shapes without `cx`/`cy`), estimates a box
115
+ * from its glyph count (`CHAR_WIDTH_RATIO` × `fontSize`) and `fontSize`
116
+ * itself, placed per `textAnchor` horizontally and centered on `cy`
117
+ * vertically (SVG text uses `dominant-baseline="central"`), rotates its
118
+ * corners around `(cx, cy)` by the same angle the SVG transform applies
119
+ * (`renderedAngle = PI - rotation` — see
120
+ * {@link svgTextTransform}; labels commonly carry `rotation = PI`,
121
+ * which renders flat, so an undefined rotation must not be treated as
122
+ * rotated), and unions the result with the base `[0, 0, width, height]` box.
123
+ *
124
+ * `fontSize` is supplied by the caller since each gallery picks its own
125
+ * fallback/cap for `heightPx`.
126
+ */
127
+ declare function viewBoxWithLabels(shapes: PreviewShape[], dims: {
128
+ width: number;
129
+ height: number;
130
+ }, fontSize: (s: PreviewShape) => number): {
131
+ minX: number;
132
+ minY: number;
133
+ width: number;
134
+ height: number;
135
+ };
136
+ /**
137
+ * The SVG `viewBox` string for a preview, grown to include every label's
138
+ * on-screen box (see {@link viewBoxWithLabels}). The convenience every Vue
139
+ * consumer wants — they only ever format the box into this exact string.
140
+ */
141
+ declare function viewBoxString(shapes: PreviewShape[], dims: {
142
+ width: number;
143
+ height: number;
144
+ }, fontSize: (s: PreviewShape) => number): string;
145
+ /**
146
+ * The SVG `transform` attribute that rotates a `text` shape into place, or
147
+ * `undefined` for an unrotated/incomplete shape. Text rotations use the same
148
+ * generator convention as the map adapters (`renderedAngle = PI - rotation`).
149
+ * The stored convention already accounts for projected Y-up coordinates being
150
+ * displayed in SVG's Y-down space, so no additional sign flip is needed.
151
+ * Shared by every SVG preview consumer (sidebar gallery, docs catalog, README
152
+ * generator).
153
+ */
154
+ declare function svgTextTransform(s: PreviewShape): string | undefined;
44
155
  //#endregion
45
- export { PreviewShape, ProjectDimensions, projectRenderToShapes, renderRepresentative };
156
+ export { PREVIEW_FILL_PATTERNS, PREVIEW_PATTERN_DOT_RADIUS, PREVIEW_PATTERN_TILE, PreviewFillPattern, PreviewShape, ProjectDimensions, previewLabelBackgroundWidth, projectRenderToShapes, renderRepresentative, svgTextTransform, viewBoxString, viewBoxWithLabels };
@@ -1,5 +1,43 @@
1
- import { c as DEFINITIONS, t as renderControlMeasure } from "../renderControlMeasure-CFdgTURO.mjs";
1
+ import { a as DEFINITIONS, t as renderControlMeasure } from "../renderControlMeasure-CAfC2nEw.mjs";
2
2
  //#region src/preview/index.ts
3
+ /** Side length (SVG units) of the repeating hatch tile in {@link PREVIEW_FILL_PATTERNS}. */
4
+ const PREVIEW_PATTERN_TILE = 8;
5
+ /**
6
+ * SVG `<pattern>` tile geometry every preview consumer (docs catalog, sidebar
7
+ * thumbnail, README/`media` generator) renders so a `fillPattern` shape looks
8
+ * identical everywhere; the `d` paths mirror the leaflet adapter's fill-pattern
9
+ * tiles over a {@link PREVIEW_PATTERN_TILE}-unit tile. Kept here as the single
10
+ * source so a new pattern is defined once, not copied per renderer.
11
+ */
12
+ const PREVIEW_FILL_PATTERNS = [
13
+ {
14
+ id: "hatch",
15
+ paths: ["M-1,-1 L9,9 M7,-1 L9,1 M-1,7 L1,9"]
16
+ },
17
+ {
18
+ id: "reverse-hatch",
19
+ paths: ["M9,-1 L-1,9 M1,-1 L-1,1 M9,7 L7,9"]
20
+ },
21
+ {
22
+ id: "cross-hatch",
23
+ paths: ["M-1,-1 L9,9 M7,-1 L9,1 M-1,7 L1,9", "M9,-1 L-1,9 M1,-1 L-1,1 M9,7 L7,9"]
24
+ },
25
+ {
26
+ id: "horizontal",
27
+ paths: ["M-1,4 L9,4"]
28
+ },
29
+ {
30
+ id: "vertical",
31
+ paths: ["M4,-1 L4,9"]
32
+ },
33
+ {
34
+ id: "dots",
35
+ paths: [],
36
+ dots: [[4, 4]]
37
+ }
38
+ ];
39
+ /** Radius (SVG units) of a {@link PREVIEW_FILL_PATTERNS} dot. */
40
+ const PREVIEW_PATTERN_DOT_RADIUS = 1.25;
3
41
  /**
4
42
  * Unitless `previewSample` points (~`[-1, 1]`) are scaled by this degree offset
5
43
  * before reaching a generator. Most generators operate in projected meters, so
@@ -47,25 +85,39 @@ function representativeSample(id) {
47
85
  const sample = definition.previewSample;
48
86
  const controlPoints = (sample ? sample.controlPoints : fallbackControlPoints(definition.metadata)).map(([x, y]) => [x * D, y * D]);
49
87
  const options = sample?.options;
50
- return options ? {
88
+ const textAmplifiers = sample?.textAmplifiers;
89
+ return {
51
90
  controlPoints,
52
- options
53
- } : { controlPoints };
91
+ ...options ? { options } : {},
92
+ ...textAmplifiers ? { textAmplifiers } : {}
93
+ };
54
94
  }
55
95
  /**
56
96
  * Renders a measure's representative preview to GeoJSON. Pure — no map engine,
57
97
  * so it runs identically at build time (docs catalog, README generator) and in
58
98
  * the browser (preview app). Returns an empty collection if the generator
59
99
  * throws, so a single broken measure never breaks a whole gallery.
100
+ *
101
+ * `overrides.textAmplifiers` and `overrides.options` are each merged over the
102
+ * sample's own amplifiers/options (override wins per key, sample-only keys
103
+ * survive) — used by the params panel's placement preview to substitute
104
+ * placeholder values (`<T>`, `<N>`, …) for whatever the sample carries.
60
105
  */
61
- function renderRepresentative(id) {
106
+ function renderRepresentative(id, overrides) {
62
107
  try {
63
- const { controlPoints, options } = representativeSample(id);
108
+ const { controlPoints, options, textAmplifiers } = representativeSample(id);
64
109
  return renderControlMeasure({
65
110
  id: "preview",
66
111
  kind: id,
67
112
  controlPoints,
68
- ...options ? { options } : {}
113
+ options: {
114
+ ...options,
115
+ ...overrides?.options
116
+ },
117
+ textAmplifiers: {
118
+ ...textAmplifiers,
119
+ ...overrides?.textAmplifiers
120
+ }
69
121
  });
70
122
  } catch {
71
123
  return {
@@ -103,12 +155,158 @@ function projectRenderToShapes(fc, dims) {
103
155
  const tx = (p) => [offsetX + (p[0] - minX) * scale, offsetY + (maxY - p[1]) * scale];
104
156
  const shapes = [];
105
157
  const bboxArea = spanX * spanY;
106
- for (const f of fc.features) collectShapes(f.geometry, tx, shapes, bboxArea, f.properties);
158
+ const textLimits = {
159
+ scale,
160
+ maxWidthPx: dims.width * MAX_TEXT_WIDTH_RATIO,
161
+ maxHeightPx: dims.height * MAX_TEXT_HEIGHT_RATIO
162
+ };
163
+ for (const f of fc.features) collectShapes(f.geometry, tx, shapes, bboxArea, textLimits, f.properties);
107
164
  return {
108
165
  shapes,
109
166
  ok: shapes.length > 0
110
167
  };
111
168
  }
169
+ /**
170
+ * Meters per degree of latitude, converting a label's ground-meter height
171
+ * (`textSizeMeters`, ADR-0028) into the lon/lat degree frame the render was
172
+ * fit in. Preview samples sit near the origin (see `D`), where this holds for
173
+ * both axes. Without it the raw height overshoots by ~5 orders of magnitude,
174
+ * pinning every label to the width/height caps — larger than its geometric
175
+ * footprint, swallowing the clearance the generator baked in between line and
176
+ * label.
177
+ */
178
+ const METERS_PER_DEGREE = 111320;
179
+ /** Rough average glyph width, as a ratio of height, for a bold sans-serif
180
+ * label — used only to estimate whether a string will overflow the viewBox,
181
+ * not to lay out real text. */
182
+ const CHAR_WIDTH_RATIO = .62;
183
+ /**
184
+ * On-screen width (SVG units) of a `textBackground` label's readability box at
185
+ * `fontSize`: the glyph run (via {@link CHAR_WIDTH_RATIO}) or the font size,
186
+ * whichever is wider, plus a small horizontal pad. Shared by every preview
187
+ * consumer that paints the backdrop rect so the box width stays consistent.
188
+ */
189
+ function previewLabelBackgroundWidth(text, fontSize) {
190
+ return Math.max(fontSize, (text?.length ?? 0) * fontSize * CHAR_WIDTH_RATIO) + 6;
191
+ }
192
+ /**
193
+ * Glyph-width ratio for {@link viewBoxWithLabels}' extent boxes. Deliberately
194
+ * wider than {@link CHAR_WIDTH_RATIO}: the average slightly undershoots bold
195
+ * uppercase strings ("PL ECHO"), and an extent estimate that undershoots crops
196
+ * the label edge while one that overshoots only costs a little slack.
197
+ */
198
+ const EXTENT_CHAR_WIDTH_RATIO = .75;
199
+ /** A text shape may not claim more than this fraction of the viewBox width;
200
+ * longer strings shrink their `heightPx` to fit. */
201
+ const MAX_TEXT_WIDTH_RATIO = .4;
202
+ /**
203
+ * A text shape may not claim more than this fraction of the viewBox height —
204
+ * guards short strings (e.g. "LL", "BHL") whose ground-anchored size would
205
+ * otherwise fit the width cap easily but still tower over the sample line. The
206
+ * preview samples sit near the origin (see `D`), so the fit `scale` is large
207
+ * and a real-sized label's `raw` height overshoots this cap almost every time;
208
+ * the cap, not the ground size, is what sets the on-screen height. Kept well
209
+ * below the fixed glyph fallback so labels read as annotations on the line
210
+ * rather than dominating a 96×48 thumbnail.
211
+ */
212
+ const MAX_TEXT_HEIGHT_RATIO = .16;
213
+ /**
214
+ * Grows a viewBox to include every `text` shape's estimated on-screen box —
215
+ * {@link projectRenderToShapes} fits geometry coordinates only, so an
216
+ * anchor-aware label (e.g. a phase line's end-anchored "PL ECHO") can extend
217
+ * well past the plain `0 0 width height` viewBox. Consumers should build
218
+ * their SVG `viewBox` from this instead.
219
+ *
220
+ * For each text shape (skipping shapes without `cx`/`cy`), estimates a box
221
+ * from its glyph count (`CHAR_WIDTH_RATIO` × `fontSize`) and `fontSize`
222
+ * itself, placed per `textAnchor` horizontally and centered on `cy`
223
+ * vertically (SVG text uses `dominant-baseline="central"`), rotates its
224
+ * corners around `(cx, cy)` by the same angle the SVG transform applies
225
+ * (`renderedAngle = PI - rotation` — see
226
+ * {@link svgTextTransform}; labels commonly carry `rotation = PI`,
227
+ * which renders flat, so an undefined rotation must not be treated as
228
+ * rotated), and unions the result with the base `[0, 0, width, height]` box.
229
+ *
230
+ * `fontSize` is supplied by the caller since each gallery picks its own
231
+ * fallback/cap for `heightPx`.
232
+ */
233
+ function viewBoxWithLabels(shapes, dims, fontSize) {
234
+ let minX = 0;
235
+ let minY = 0;
236
+ let maxX = dims.width;
237
+ let maxY = dims.height;
238
+ for (const s of shapes) {
239
+ if (s.type !== "text" || s.cx === void 0 || s.cy === void 0) continue;
240
+ const font = fontSize(s);
241
+ const w = (s.text?.length ?? 0) * EXTENT_CHAR_WIDTH_RATIO * font;
242
+ const h = font;
243
+ const left = s.textAnchor === "start" ? s.cx : s.textAnchor === "end" ? s.cx - w : s.cx - w / 2;
244
+ const right = left + w;
245
+ const top = s.cy - h / 2;
246
+ const bottom = s.cy + h / 2;
247
+ const theta = s.rotation === void 0 ? 0 : Math.PI - s.rotation;
248
+ const cos = Math.cos(theta);
249
+ const sin = Math.sin(theta);
250
+ for (const [x, y] of [
251
+ [left, top],
252
+ [right, top],
253
+ [right, bottom],
254
+ [left, bottom]
255
+ ]) {
256
+ const rx = s.cx + (x - s.cx) * cos - (y - s.cy) * sin;
257
+ const ry = s.cy + (x - s.cx) * sin + (y - s.cy) * cos;
258
+ if (rx < minX) minX = rx;
259
+ if (rx > maxX) maxX = rx;
260
+ if (ry < minY) minY = ry;
261
+ if (ry > maxY) maxY = ry;
262
+ }
263
+ }
264
+ return {
265
+ minX,
266
+ minY,
267
+ width: maxX - minX,
268
+ height: maxY - minY
269
+ };
270
+ }
271
+ /**
272
+ * The SVG `viewBox` string for a preview, grown to include every label's
273
+ * on-screen box (see {@link viewBoxWithLabels}). The convenience every Vue
274
+ * consumer wants — they only ever format the box into this exact string.
275
+ */
276
+ function viewBoxString(shapes, dims, fontSize) {
277
+ const box = viewBoxWithLabels(shapes, dims, fontSize);
278
+ return `${box.minX} ${box.minY} ${box.width} ${box.height}`;
279
+ }
280
+ /**
281
+ * The SVG `transform` attribute that rotates a `text` shape into place, or
282
+ * `undefined` for an unrotated/incomplete shape. Text rotations use the same
283
+ * generator convention as the map adapters (`renderedAngle = PI - rotation`).
284
+ * The stored convention already accounts for projected Y-up coordinates being
285
+ * displayed in SVG's Y-down space, so no additional sign flip is needed.
286
+ * Shared by every SVG preview consumer (sidebar gallery, docs catalog, README
287
+ * generator).
288
+ */
289
+ function svgTextTransform(s) {
290
+ if (s.rotation === void 0 || s.cx === void 0 || s.cy === void 0) return void 0;
291
+ return `rotate(${((Math.PI - s.rotation) * 180 / Math.PI).toFixed(3)} ${s.cx.toFixed(3)} ${s.cy.toFixed(3)})`;
292
+ }
293
+ /**
294
+ * Resolves a label's SVG-unit text height from its `textSizeMeters` property
295
+ * (ADR-0028's ground anchor), scaled by the same `scale` the geometry was fit
296
+ * with, then clamped by both the height cap and the width the string would
297
+ * occupy at that height (so a long string can't overflow `maxWidthPx`).
298
+ * Returns `undefined` when the label carries no ground-anchored sizing — a
299
+ * screen-anchored label (bare `textSizePixels`, meaningless without a live map
300
+ * resolution to convert it) or one with no size at all — and the caller
301
+ * leaves `heightPx` unset.
302
+ */
303
+ function resolveTextHeightPx(labelProps, text, limits) {
304
+ const sizeMeters = labelProps.textSizeMeters;
305
+ if (typeof sizeMeters !== "number") return void 0;
306
+ const raw = sizeMeters * limits.scale / METERS_PER_DEGREE;
307
+ const widthLimit = text.length > 0 ? limits.maxWidthPx / (text.length * CHAR_WIDTH_RATIO) : Infinity;
308
+ return Math.min(raw, limits.maxHeightPx, widthLimit);
309
+ }
112
310
  function ringArea(ring) {
113
311
  let a = 0;
114
312
  for (let i = 0, j = ring.length - 1; i < ring.length; j = i++) a += (ring[j][0] - ring[i][0]) * (ring[j][1] + ring[i][1]);
@@ -144,22 +342,39 @@ function pathFromRing(ring, tx, close) {
144
342
  if (close) parts.push("Z");
145
343
  return parts.join(" ");
146
344
  }
147
- function collectShapes(g, tx, out, bboxArea, props) {
345
+ function collectShapes(g, tx, out, bboxArea, textLimits, props) {
148
346
  const labelProps = props && typeof props === "object" ? props : {};
149
347
  const labelText = typeof labelProps.text === "string" ? labelProps.text : void 0;
150
348
  const labelRotation = typeof labelProps.rotation === "number" ? labelProps.rotation : void 0;
349
+ const labelAnchor = labelProps.textAnchor === "start" || labelProps.textAnchor === "end" ? labelProps.textAnchor : void 0;
350
+ const textBackground = labelProps.textBackground === true ? true : void 0;
351
+ const textHalo = labelProps.textHalo === true ? true : void 0;
352
+ const textJustify = labelProps.textJustify === "left" || labelProps.textJustify === "center" || labelProps.textJustify === "right" ? labelProps.textJustify : void 0;
353
+ const textStyle = labelProps.textStyle === "regular" || labelProps.textStyle === "italic" || labelProps.textStyle === "light" || labelProps.textStyle === "caps" ? labelProps.textStyle : void 0;
354
+ const styleProps = labelProps.style && typeof labelProps.style === "object" ? labelProps.style : {};
355
+ const fillPattern = PREVIEW_FILL_PATTERNS.some((p) => p.id === styleProps.fillPattern) ? styleProps.fillPattern : void 0;
356
+ const strokeDash = Array.isArray(styleProps.strokeDash) ? styleProps.strokeDash.filter((value) => typeof value === "number") : void 0;
357
+ const explicitlyFilled = typeof styleProps.fillColor === "string";
151
358
  const polygonFilled = (ring) => bboxArea > 0 && ringArea(ring) / bboxArea < .25;
152
359
  switch (g.type) {
153
360
  case "Point": {
154
361
  const [x, y] = tx(g.coordinates);
155
- if (labelText !== void 0) out.push({
156
- type: "text",
157
- cx: x,
158
- cy: y,
159
- text: labelText,
160
- rotation: labelRotation
161
- });
162
- else out.push({
362
+ if (labelText !== void 0) {
363
+ const heightPx = resolveTextHeightPx(labelProps, labelText, textLimits);
364
+ out.push({
365
+ type: "text",
366
+ cx: x,
367
+ cy: y,
368
+ text: labelText,
369
+ rotation: labelRotation,
370
+ heightPx,
371
+ textAnchor: labelAnchor,
372
+ textBackground,
373
+ textHalo,
374
+ textJustify,
375
+ textStyle
376
+ });
377
+ } else out.push({
163
378
  type: "circle",
164
379
  cx: x,
165
380
  cy: y
@@ -179,33 +394,37 @@ function collectShapes(g, tx, out, bboxArea, props) {
179
394
  case "LineString":
180
395
  out.push({
181
396
  type: "polyline",
182
- d: pathFromRing(g.coordinates, tx, false)
397
+ d: pathFromRing(g.coordinates, tx, false),
398
+ strokeDash
183
399
  });
184
400
  break;
185
401
  case "MultiLineString":
186
402
  g.coordinates.forEach((line) => out.push({
187
403
  type: "polyline",
188
- d: pathFromRing(line, tx, false)
404
+ d: pathFromRing(line, tx, false),
405
+ strokeDash
189
406
  }));
190
407
  break;
191
408
  case "Polygon":
192
409
  g.coordinates.forEach((ring) => out.push({
193
410
  type: "polygon",
194
411
  d: pathFromRing(ring, tx, true),
195
- filled: polygonFilled(ring)
412
+ filled: explicitlyFilled || polygonFilled(ring),
413
+ fillPattern
196
414
  }));
197
415
  break;
198
416
  case "MultiPolygon":
199
417
  g.coordinates.forEach((poly) => poly.forEach((ring) => out.push({
200
418
  type: "polygon",
201
419
  d: pathFromRing(ring, tx, true),
202
- filled: polygonFilled(ring)
420
+ filled: polygonFilled(ring),
421
+ fillPattern
203
422
  })));
204
423
  break;
205
424
  case "GeometryCollection":
206
- g.geometries.forEach((sub) => collectShapes(sub, tx, out, bboxArea, props));
425
+ g.geometries.forEach((sub) => collectShapes(sub, tx, out, bboxArea, textLimits, props));
207
426
  break;
208
427
  }
209
428
  }
210
429
  //#endregion
211
- export { projectRenderToShapes, renderRepresentative };
430
+ export { PREVIEW_FILL_PATTERNS, PREVIEW_PATTERN_DOT_RADIUS, PREVIEW_PATTERN_TILE, previewLabelBackgroundWidth, projectRenderToShapes, renderRepresentative, svgTextTransform, viewBoxString, viewBoxWithLabels };