@orbat-mapper/control-measures 0.2.0-alpha.3 → 0.2.0-alpha.31

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 (87) hide show
  1. package/README.md +55 -3
  2. package/dist/index-c_3HSN3X.d.mts +2939 -0
  3. package/dist/index.d.mts +2 -2
  4. package/dist/index.mjs +38 -8
  5. package/dist/preview/index.d.mts +110 -3
  6. package/dist/preview/index.mjs +235 -21
  7. package/dist/renderControlMeasure-EdeAQZIo.mjs +12589 -0
  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 -0
  33. package/media/classic-arrow.svg +1 -1
  34. package/media/clear.svg +1 -1
  35. package/media/cover.svg +1 -0
  36. package/media/delay.svg +1 -1
  37. package/media/direction-of-attack-aviation.svg +1 -0
  38. package/media/direction-of-main-attack.svg +1 -0
  39. package/media/direction-of-supporting-attack.svg +1 -0
  40. package/media/disrupt.svg +1 -1
  41. package/media/drop-zone.svg +1 -0
  42. package/media/encirclement.svg +1 -0
  43. package/media/engineer-work-line.svg +1 -0
  44. package/media/extraction-zone.svg +1 -0
  45. package/media/final-protective-fire-left.svg +1 -1
  46. package/media/final-protective-fire-right.svg +1 -1
  47. package/media/fix.svg +1 -1
  48. package/media/flot.svg +1 -1
  49. package/media/fortified-area.svg +1 -1
  50. package/media/fortified-line.svg +1 -1
  51. package/media/frontal-attack.svg +1 -0
  52. package/media/generic-c2-area.svg +1 -0
  53. package/media/generic-c2-line.svg +1 -0
  54. package/media/guard.svg +1 -0
  55. package/media/guerrilla-base.svg +1 -0
  56. package/media/handover-line.svg +1 -0
  57. package/media/isolate.svg +1 -1
  58. package/media/joint-tactical-action-area.svg +1 -0
  59. package/media/landing-zone.svg +1 -0
  60. package/media/light-line.svg +1 -0
  61. package/media/limited-access-area.svg +1 -0
  62. package/media/line.svg +1 -0
  63. package/media/main-attack.svg +1 -1
  64. package/media/named-area-of-interest.svg +1 -0
  65. package/media/no-fire-area-irregular.svg +1 -0
  66. package/media/objective-area.svg +1 -0
  67. package/media/obstacle-bypass-difficult.svg +1 -1
  68. package/media/obstacle-bypass-easy.svg +1 -1
  69. package/media/obstacle-bypass-impossible.svg +1 -1
  70. package/media/phase-line.svg +1 -0
  71. package/media/pickup-zone.svg +1 -0
  72. package/media/polygon.svg +1 -0
  73. package/media/principal-direction-of-fire.svg +1 -1
  74. package/media/rectangle.svg +1 -0
  75. package/media/screen.svg +1 -0
  76. package/media/search-area.svg +1 -1
  77. package/media/strong-point.svg +1 -0
  78. package/media/submarine-action-area.svg +1 -0
  79. package/media/submarine-generated-action-area.svg +1 -0
  80. package/media/support-by-fire.svg +1 -1
  81. package/media/supporting-attack.svg +1 -1
  82. package/media/target-area-of-interest.svg +1 -0
  83. package/media/turn.svg +1 -1
  84. package/media/turning-movement.svg +1 -0
  85. package/package.json +1 -1
  86. package/dist/index-BJYbQlzo.d.mts +0 -1713
  87. package/dist/renderControlMeasure-DkXDSrLz.mjs +0 -6877
package/dist/index.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { $ as listControlMeasureMetadata, $t as DEFAULT_ENCIRCLEMENT_OPTIONS, A as SimpleStyleProps, At as BreachOptions, B as controlMeasureIdFromFeature, Bt as AttackHelicopterOptions, C as BaselineFrameNormal, Ct as DelayOptions, D as EPSILON, Dt as DEFAULT_CANALIZE_OPTIONS, E as createBaselineFrame, Et as CanalizeOptions, F as renderControlMeasure, Ft as FLOTOptions, G as CONTROL_MEASURE_IDS, Gt as SupportingAttackOptions, H as cloneControlMeasure, Ht as AirborneAttackOptions, I as ControlMeasureRender, It as AttackByFireOptions, J as ControlMeasureKind, Jt as calculateMetrics, K as CONTROL_MEASURE_METADATA, Kt as DEFAULT_MAIN_ATTACK_OPTIONS, L as ControlMeasureSnapshot, Lt as DEFAULT_ATTACK_BY_FIRE_OPTIONS, M as toSimpleStyle, Mt as BlockMissionTaskOptions, N as resolveStyleHints, Nt as DEFAULT_BLOCK_MISSION_TASK_OPTIONS, O as getMetersPerPixel, Ot as BypassOptions, P as RenderOptions, Pt as DEFAULT_FLOT_OPTIONS, Q as getDefaultOptions, Qt as unproject, R as FeaturePartProps, Rt as DEFAULT_SUPPORT_BY_FIRE_OPTIONS, S as BaselineFrame, St as DEFAULT_DELAY_OPTIONS, T as BaselineFrameOrigin, Tt as DEFAULT_CLEAR_OPTIONS, U as isKind, Ut as DEFAULT_AIRBORNE_ATTACK_OPTIONS, V as ControlMeasure, Vt as DEFAULT_ATTACK_HELICOPTER_OPTIONS, W as ControlMeasureStyle, Wt as DEFAULT_SUPPORTING_ATTACK_OPTIONS, X as getControlMeasureMetadata, Xt as Point2D, Y as OptionsByKind, Yt as computeInitialWidthPoint, Z as getControlMeasureMetadataByValue, Zt as project, _ as computeDefaultMidpointPerpendicularPoint, _t as FortifiedLineOptions, a as axis1DrawRule, an as DEFAULT_STRONG_POINT_OPTIONS, at as ObstacleBypassEasyOptions, b as pointOnMidpointPerpendicularAxis, bt as AntitankDitchOptions, c as line23DrawRule, cn as ControlMeasureGeometryType, ct as DEFAULT_FIX_OPTIONS, d as ambushDrawRule, dn as AnchorTransformEvent, dt as DisruptOptions, en as EncirclementOptions, et as DEFAULT_OBSTACLE_BYPASS_IMPOSSIBLE_OPTIONS, f as attackByFireDrawRule, fn as ControlMeasureDrawRule, ft as BlockOptions, g as MidpointPerpendicularDrawRuleOptions, gt as DEFAULT_FORTIFIED_LINE_OPTIONS, h as blockDrawRule, ht as FortifiedAreaOptions, i as DEFAULT_AMBUSH_OPTIONS, in as PrincipalDirectionOfFireOptions, it as DEFAULT_OBSTACLE_BYPASS_EASY_OPTIONS, j as SimpleStyleRender, jt as DEFAULT_BREACH_OPTIONS, k as roundToFixed, kt as DEFAULT_BYPASS_OPTIONS, l as turnDrawRule, ln as ControlMeasureMetadata, lt as FixOptions, m as disruptDrawRule, mt as DEFAULT_FORTIFIED_AREA_OPTIONS, n as TacticalArrowOptions, nn as FinalProtectiveFireOptions, nt as DEFAULT_OBSTACLE_BYPASS_DIFFICULT_OPTIONS, o as supportByFireDrawRule, on as StrongPointOptions, ot as DEFAULT_TURN_OPTIONS, p as point12DrawRule, pt as DEFAULT_BLOCK_OPTIONS, q as ControlMeasureId, qt as MainAttackOptions, r as AmbushOptions, rn as DEFAULT_PRINCIPAL_DIRECTION_OF_FIRE_OPTIONS, rt as ObstacleBypassDifficultOptions, s as line24DrawRule, sn as ControlMeasureGeometry, st as TurnOptions, t as DEFAULT_TACTICAL_ARROW_OPTIONS, tn as DEFAULT_FINAL_PROTECTIVE_FIRE_OPTIONS, tt as ObstacleBypassImpossibleOptions, u as line1DrawRule, un as ParamDescriptor, ut as DEFAULT_DISRUPT_OPTIONS, v as createMidpointPerpendicularDrawRule, vt as AntitankWallOptions, w as BaselineFrameOptions, wt as ClearOptions, x as snapToMidpointPerpendicular, xt as DEFAULT_ANTITANK_DITCH_OPTIONS, y as getMidpointPerpendicularSignedDistance, yt as DEFAULT_ANTITANK_WALL_OPTIONS, z as StyleHints, zt as SupportByFireOptions } from "./index-BJYbQlzo.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 BlockMissionTaskOptions, type BlockOptions, type BreachOptions, type BypassOptions, CONTROL_MEASURE_IDS, CONTROL_MEASURE_METADATA, type CanalizeOptions, 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_BLOCK_MISSION_TASK_OPTIONS, DEFAULT_BLOCK_OPTIONS, DEFAULT_BREACH_OPTIONS, DEFAULT_BYPASS_OPTIONS, DEFAULT_CANALIZE_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_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 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, type TacticalArrowOptions, type TurnOptions, ambushDrawRule, attackByFireDrawRule, axis1DrawRule, blockDrawRule, calculateMetrics, cloneControlMeasure, computeDefaultMidpointPerpendicularPoint, computeInitialWidthPoint, controlMeasureIdFromFeature, createBaselineFrame, createMidpointPerpendicularDrawRule, disruptDrawRule, getControlMeasureMetadata, getControlMeasureMetadataByValue, getDefaultOptions, getMetersPerPixel, getMidpointPerpendicularSignedDistance, isKind, line1DrawRule, line23DrawRule, line24DrawRule, listControlMeasureMetadata, point12DrawRule, pointOnMidpointPerpendicularAxis, project, renderControlMeasure, resolveStyleHints, roundToFixed, snapToMidpointPerpendicular, supportByFireDrawRule, toSimpleStyle, turnDrawRule, unproject };
1
+ import { $ as DEFAULT_OBSTACLE_BYPASS_DIFFICULT_OPTIONS, $n as DEFAULT_DIRECTION_OF_ATTACK_AVIATION_OPTIONS, $t as DEFAULT_SUPPORT_BY_FIRE_OPTIONS, A as roundToFixed, An as PickupZoneOptions, Ar as CanonicalTextAmplifiers, At as DEFAULT_COVER_OPTIONS, B as cloneControlMeasure, Bn as EncirclementOptions, Br as AnchorTransformEvent, Bt as DEFAULT_BREACH_OPTIONS, C as BaselineFrame, Cn as DEFAULT_MAIN_ATTACK_OPTIONS, Cr as ControlMeasureGeometryType, Ct as DEFAULT_SCREEN_OPTIONS, D as createBaselineFrame, Dn as AreaOfOperationsOptions, Dr as TextAmplifierDescriptor, Dt as DEFAULT_DELAY_OPTIONS, E as BaselineFrameOrigin, En as computeInitialWidthPoint, Er as ParamDescriptor, Et as GuardOptions, F as applyBoxTransformOptions, Fn as AssemblyAreaOptions, Fr as TextAmplifierKey, Ft as CanalizeOptions, G as ControlMeasureKind, Gn as StyleHints, Gt as DEFAULT_HANDOVER_LINE_OPTIONS, H as CONTROL_MEASURE_IDS, Hn as FinalProtectiveFireOptions, Ht as DEFAULT_BLOCK_MISSION_TASK_OPTIONS, I as freezeOrientationOptions, In as DEFAULT_ASSEMBLY_AREA_OPTIONS, Ir as TextAmplifiers, It as DEFAULT_CANALIZE_OPTIONS, J as getControlMeasureMetadataByValue, Jn as PrincipalDirectionOfFireOptions, Jt as PhaseLineOptions, K as OptionsByKind, Kn as controlMeasureIdFromFeature, Kt as HandoverLineOptions, L as RenderOptions, Ln as AreaDefenseOptions, Lr as canonicalTextAmplifierKey, Lt as BypassOptions, M as SimpleStyleRender, Mn as LandingZoneOptions, Mr as LabelPlacementOverride, Mt as TacticalArrowOptions, N as toSimpleStyle, Nn as DEFAULT_JOINT_TACTICAL_ACTION_AREA_OPTIONS, Nr as TEXT_AMPLIFIER_FIELDS, Nt as ClearOptions, O as EPSILON, On as DEFAULT_AREA_OF_OPERATIONS_OPTIONS, Or as AmplifierPlacement, Ot as DelayOptions, P as resolveStyleHints, Pn as JointTacticalActionAreaOptions, Pr as TextAmplifierField, Pt as DEFAULT_CLEAR_OPTIONS, Q as ObstacleBypassImpossibleOptions, Qn as DirectionOfMainAttackOptions, Qt as DEFAULT_ATTACK_BY_FIRE_OPTIONS, R as renderControlMeasure, Rn as DEFAULT_AREA_DEFENSE_OPTIONS, Rr as normalizeTextAmplifiers, Rt as DEFAULT_BYPASS_OPTIONS, S as snapToMidpointPerpendicular, Sn as SupportingAttackOptions, Sr as ControlMeasureGeometry, St as DEFAULT_ANTITANK_DITCH_OPTIONS, T as BaselineFrameOptions, Tn as calculateMetrics, Tr as ControlMeasurePaintCapability, Tt as DEFAULT_GUARD_OPTIONS, U as CONTROL_MEASURE_METADATA, Un as ControlMeasureRender, Ut as BattleHandoverLineOptions, V as isKind, Vn as DEFAULT_FINAL_PROTECTIVE_FIRE_OPTIONS, Vr as ControlMeasureDrawRule, Vt as BlockMissionTaskOptions, W as ControlMeasureId, Wn as FeaturePartProps, Wt as DEFAULT_BATTLE_HANDOVER_LINE_OPTIONS, X as listControlMeasureMetadata, Xn as DirectionOfSupportingAttackOptions, Xt as FLOTOptions, Y as getDefaultOptions, Yn as DEFAULT_DIRECTION_OF_SUPPORTING_ATTACK_OPTIONS, Yt as DEFAULT_FLOT_OPTIONS, Z as DEFAULT_OBSTACLE_BYPASS_IMPOSSIBLE_OPTIONS, Zn as DEFAULT_DIRECTION_OF_MAIN_ATTACK_OPTIONS, Zt as AttackByFireOptions, _ as MidpointPerpendicularDrawRuleOptions, _n as DEFAULT_BLOCK_ARROW_OPTIONS, _r as unproject, _t as DEFAULT_FORTIFIED_LINE_OPTIONS, a as supportByFireDrawRule, an as DEFAULT_GENERIC_TEXT_OPTIONS, ar as ControlMeasureStyle, at as DEFAULT_FIX_OPTIONS, b as getMidpointPerpendicularSignedDistance, bn as DEFAULT_CLASSIC_ARROW_OPTIONS, br as BoxTransformDelta, bt as DEFAULT_ANTITANK_WALL_OPTIONS, c as line23DrawRule, cn as GenericCircleOptions, cr as GenericC2LineOptions, ct as DisruptOptions, d as ambushDrawRule, dn as DEFAULT_GENERIC_POLYGON_OPTIONS, dr as DEFAULT_LIGHT_LINE_OPTIONS, dt as DEFAULT_TURNING_MOVEMENT_OPTIONS, en as SupportByFireOptions, er as DirectionOfAttackAviationOptions, et as ObstacleBypassDifficultOptions, f as attackByFireDrawRule, fn as GenericPolygonOptions, fr as LightLineOptions, ft as TurningMovementOptions, g as blockDrawRule, gn as BlockArrowOptions, gr as project, gt as FortifiedAreaOptions, h as disruptDrawRule, hn as BlockArrowHeadStyle, hr as haversineDistance, ht as DEFAULT_FORTIFIED_AREA_OPTIONS, i as axis1DrawRule, in as DEFAULT_AIRBORNE_ATTACK_OPTIONS, ir as DEFAULT_BATTLE_POSITION_OPTIONS, it as TurnOptions, j as SimpleStyleProps, jn as DEFAULT_LANDING_ZONE_OPTIONS, jr as GeneratedLabelKey, jt as DEFAULT_TACTICAL_ARROW_OPTIONS, k as getMetersPerPixel, kn as DEFAULT_PICKUP_ZONE_OPTIONS, kr as AmplifierPlacements, kt as CoverOptions, l as turnDrawRule, ln as DEFAULT_GENERIC_RECTANGLE_OPTIONS, lr as DEFAULT_ENGINEER_WORK_LINE_OPTIONS, lt as BlockOptions, m as centerRadiusDrawRule, mn as GenericLineOptions, mr as Point2D, mt as FrontalAttackOptions, n as DEFAULT_AMBUSH_OPTIONS, nn as DEFAULT_ATTACK_HELICOPTER_OPTIONS, nr as StrongPointOptions, nt as ObstacleBypassEasyOptions, o as line26DrawRule, on as GenericTextOptions, or as FillPattern, ot as FixOptions, p as point12DrawRule, pn as DEFAULT_GENERIC_LINE_OPTIONS, pr as LabelSizeOptions, pt as DEFAULT_FRONTAL_ATTACK_OPTIONS, q as getControlMeasureMetadata, qn as DEFAULT_PRINCIPAL_DIRECTION_OF_FIRE_OPTIONS, qt as DEFAULT_PHASE_LINE_OPTIONS, r as rectangleDrawRule, rn as AirborneAttackOptions, rr as BattlePositionOptions, rt as DEFAULT_TURN_OPTIONS, s as line24DrawRule, sn as DEFAULT_GENERIC_CIRCLE_OPTIONS, sr as DEFAULT_GENERIC_C2_LINE_OPTIONS, st as DEFAULT_DISRUPT_OPTIONS, t as AmbushOptions, tn as AttackHelicopterOptions, tr as DEFAULT_STRONG_POINT_OPTIONS, tt as DEFAULT_OBSTACLE_BYPASS_EASY_OPTIONS, u as line1DrawRule, un as GenericRectangleOptions, ur as EngineerWorkLineOptions, ut as DEFAULT_BLOCK_OPTIONS, v as computeDefaultMidpointPerpendicularPoint, vn as ClassicArrowHeadStyle, vr as BoundaryOptions, vt as FortifiedLineOptions, w as BaselineFrameNormal, wn as MainAttackOptions, wr as ControlMeasureMetadata, wt as ScreenOptions, x as pointOnMidpointPerpendicularAxis, xn as DEFAULT_SUPPORTING_ATTACK_OPTIONS, xr as ControlMeasureFillCapability, xt as AntitankDitchOptions, y as createMidpointPerpendicularDrawRule, yn as ClassicArrowOptions, yr as DEFAULT_BOUNDARY_OPTIONS, yt as AntitankWallOptions, z as ControlMeasure, zn as DEFAULT_ENCIRCLEMENT_OPTIONS, zr as resolveAmplifierPlacement, zt as BreachOptions } from "./index-c_3HSN3X.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 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 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_BYPASS_OPTIONS, DEFAULT_CANALIZE_OPTIONS, DEFAULT_CLASSIC_ARROW_OPTIONS, DEFAULT_CLEAR_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_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_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_SCREEN_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 FrontalAttackOptions, type GeneratedLabelKey, type GenericC2LineOptions, type GenericCircleOptions, type GenericLineOptions, type GenericPolygonOptions, type GenericRectangleOptions, type GenericTextOptions, type GuardOptions, type HandoverLineOptions, 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 RenderOptions, type ScreenOptions, 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,33 @@
1
- import { $ as getMidpointPerpendicularSignedDistance, A as DEFAULT_BYPASS_OPTIONS, B as axis1DrawRule, C as DEFAULT_FIX_OPTIONS, D as DEFAULT_DELAY_OPTIONS, E as DEFAULT_DISRUPT_OPTIONS, F as DEFAULT_ATTACK_BY_FIRE_OPTIONS, G as line1DrawRule, H as line24DrawRule, I as DEFAULT_ANTITANK_WALL_OPTIONS, J as point12DrawRule, K as ambushDrawRule, L as DEFAULT_ANTITANK_DITCH_OPTIONS, M as DEFAULT_BLOCK_MISSION_TASK_OPTIONS, N as DEFAULT_BLOCK_OPTIONS, O as DEFAULT_CLEAR_OPTIONS, P as DEFAULT_ATTACK_HELICOPTER_OPTIONS, Q as createMidpointPerpendicularDrawRule, R as DEFAULT_AMBUSH_OPTIONS, S as DEFAULT_FLOT_OPTIONS, T as DEFAULT_ENCIRCLEMENT_OPTIONS, U as line23DrawRule, V as supportByFireDrawRule, W as turnDrawRule, X as blockDrawRule, Y as disruptDrawRule, Z as computeDefaultMidpointPerpendicularPoint, _ as DEFAULT_OBSTACLE_BYPASS_EASY_OPTIONS, at as project, b as DEFAULT_FORTIFIED_AREA_OPTIONS, c as getDefaultOptions, ct as getMetersPerPixel, d as DEFAULT_SUPPORTING_ATTACK_OPTIONS, et as pointOnMidpointPerpendicularAxis, f as DEFAULT_SUPPORT_BY_FIRE_OPTIONS, g as DEFAULT_OBSTACLE_BYPASS_IMPOSSIBLE_OPTIONS, h as DEFAULT_PRINCIPAL_DIRECTION_OF_FIRE_OPTIONS, i as CONTROL_MEASURE_METADATA, it as computeInitialWidthPoint, j as DEFAULT_BREACH_OPTIONS, k as DEFAULT_CANALIZE_OPTIONS, l as listControlMeasureMetadata, lt as roundToFixed, m as DEFAULT_TACTICAL_ARROW_OPTIONS, n as resolveStyleHints, nt as createBaselineFrame, o as getControlMeasureMetadata, ot as unproject, p as DEFAULT_STRONG_POINT_OPTIONS, q as attackByFireDrawRule, r as CONTROL_MEASURE_IDS, rt as calculateMetrics, s as getControlMeasureMetadataByValue, st as EPSILON, t as renderControlMeasure, tt as snapToMidpointPerpendicular, u as DEFAULT_TURN_OPTIONS, v as DEFAULT_OBSTACLE_BYPASS_DIFFICULT_OPTIONS, w as DEFAULT_FINAL_PROTECTIVE_FIRE_OPTIONS, x as DEFAULT_FORTIFIED_LINE_OPTIONS, y as DEFAULT_MAIN_ATTACK_OPTIONS, z as DEFAULT_AIRBORNE_ATTACK_OPTIONS } from "./renderControlMeasure-DkXDSrLz.mjs";
1
+ import { $ as DEFAULT_BOUNDARY_OPTIONS, A as DEFAULT_FLOT_OPTIONS, At as centerRadiusDrawRule, B as DEFAULT_GENERIC_TEXT_OPTIONS, Bt as computeInitialWidthPoint, C as DEFAULT_SCREEN_OPTIONS, Ct as line24DrawRule, D as DEFAULT_BATTLE_HANDOVER_LINE_OPTIONS, Dt as ambushDrawRule, E as DEFAULT_FORTIFIED_LINE_OPTIONS, Et as line1DrawRule, F as DEFAULT_GUARD_OPTIONS, Ft as getMidpointPerpendicularSignedDistance, G as DEFAULT_CLASSIC_ARROW_OPTIONS, Gt as getMetersPerPixel, H as DEFAULT_GENERIC_POLYGON_OPTIONS, Ht as project, I as DEFAULT_DELAY_OPTIONS, It as pointOnMidpointPerpendicularAxis, J as DEFAULT_BREACH_OPTIONS, K as DEFAULT_CANALIZE_OPTIONS, Kt as roundToFixed, L as DEFAULT_COVER_OPTIONS, Lt as snapToMidpointPerpendicular, M as DEFAULT_FINAL_PROTECTIVE_FIRE_OPTIONS, Mt as blockDrawRule, N as DEFAULT_ENCIRCLEMENT_OPTIONS, Nt as computeDefaultMidpointPerpendicularPoint, O as DEFAULT_HANDOVER_LINE_OPTIONS, Ot as attackByFireDrawRule, P as DEFAULT_DISRUPT_OPTIONS, Pt as createMidpointPerpendicularDrawRule, Q as DEFAULT_LIGHT_LINE_OPTIONS, R as DEFAULT_TACTICAL_ARROW_OPTIONS, Rt as createBaselineFrame, S as DEFAULT_JOINT_TACTICAL_ACTION_AREA_OPTIONS, St as line26DrawRule, T as DEFAULT_FORTIFIED_AREA_OPTIONS, Tt as turnDrawRule, U as DEFAULT_GENERIC_LINE_OPTIONS, Ut as unproject, V as DEFAULT_GENERIC_RECTANGLE_OPTIONS, Vt as haversineDistance, W as DEFAULT_GENERIC_CIRCLE_OPTIONS, Wt as EPSILON, X as DEFAULT_GENERIC_C2_LINE_OPTIONS, Y as DEFAULT_BLOCK_MISSION_TASK_OPTIONS, Z as DEFAULT_ENGINEER_WORK_LINE_OPTIONS, _ as DEFAULT_OBSTACLE_BYPASS_IMPOSSIBLE_OPTIONS, _t as DEFAULT_AMBUSH_OPTIONS, a as DEFINITIONS, at as DEFAULT_ANTITANK_WALL_OPTIONS, b as DEFAULT_MAIN_ATTACK_OPTIONS, bt as axis1DrawRule, c as getDefaultOptions, ct as DEFAULT_AREA_OF_OPERATIONS_OPTIONS, d as DEFAULT_TURN_OPTIONS, dt as DEFAULT_DIRECTION_OF_MAIN_ATTACK_OPTIONS, et as DEFAULT_BLOCK_ARROW_OPTIONS, f as DEFAULT_SUPPORTING_ATTACK_OPTIONS, ft as DEFAULT_DIRECTION_OF_ATTACK_AVIATION_OPTIONS, g as DEFAULT_PICKUP_ZONE_OPTIONS, gt as resolveAmplifierPlacement, h as DEFAULT_PRINCIPAL_DIRECTION_OF_FIRE_OPTIONS, ht as normalizeTextAmplifiers, i as CONTROL_MEASURE_METADATA, it as DEFAULT_ATTACK_BY_FIRE_OPTIONS, j as DEFAULT_FIX_OPTIONS, jt as disruptDrawRule, k as DEFAULT_PHASE_LINE_OPTIONS, kt as point12DrawRule, l as listControlMeasureMetadata, lt as DEFAULT_AREA_DEFENSE_OPTIONS, m as DEFAULT_STRONG_POINT_OPTIONS, mt as canonicalTextAmplifierKey, n as resolveStyleHints, nt as DEFAULT_BATTLE_POSITION_OPTIONS, o as getControlMeasureMetadata, ot as DEFAULT_ANTITANK_DITCH_OPTIONS, p as DEFAULT_SUPPORT_BY_FIRE_OPTIONS, pt as TEXT_AMPLIFIER_FIELDS, q as DEFAULT_BYPASS_OPTIONS, r as CONTROL_MEASURE_IDS, rt as DEFAULT_ATTACK_HELICOPTER_OPTIONS, s as getControlMeasureMetadataByValue, st as DEFAULT_ASSEMBLY_AREA_OPTIONS, t as renderControlMeasure, tt as DEFAULT_BLOCK_OPTIONS, u as DEFAULT_TURNING_MOVEMENT_OPTIONS, ut as DEFAULT_DIRECTION_OF_SUPPORTING_ATTACK_OPTIONS, v as DEFAULT_OBSTACLE_BYPASS_EASY_OPTIONS, vt as DEFAULT_AIRBORNE_ATTACK_OPTIONS, w as DEFAULT_FRONTAL_ATTACK_OPTIONS, wt as line23DrawRule, x as DEFAULT_LANDING_ZONE_OPTIONS, xt as supportByFireDrawRule, y as DEFAULT_OBSTACLE_BYPASS_DIFFICULT_OPTIONS, yt as rectangleDrawRule, z as DEFAULT_CLEAR_OPTIONS, zt as calculateMetrics } from "./renderControlMeasure-EdeAQZIo.mjs";
2
+ //#region src/freeze-orientation.ts
3
+ /**
4
+ * Dispatches to a measure kind's `freezeOrientation` hook (see
5
+ * {@link import("./define").ControlMeasureDefinition.freezeOrientation}),
6
+ * pinning orientation-derived option defaults to their current concrete
7
+ * values ahead of a rigid rotation of `controlPoints`. Returns `undefined`
8
+ * when the kind declares no hook, or when the hook itself finds nothing to
9
+ * freeze. Edit hosts call this when a rotate gesture starts (ADR-0023).
10
+ */
11
+ function freezeOrientationOptions(kind, controlPoints, options) {
12
+ const definition = DEFINITIONS[kind];
13
+ if (!definition.freezeOrientation) return void 0;
14
+ return definition.freezeOrientation(controlPoints, options ?? {});
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
+ }
30
+ //#endregion
2
31
  //#region src/instance.ts
3
32
  function isKind(cm, kind) {
4
33
  return cm.kind === kind;
@@ -6,10 +35,10 @@ function isKind(cm, kind) {
6
35
  /**
7
36
  * Deep-clone a `ControlMeasure` so held references survive mutations to the
8
37
  * original (and vice versa). Used by the session façade to build the
9
- * `measure` half of `ControlMeasureSnapshot`. Nested values inside
10
- * `options`, `style`, and `properties` are cloned too — `properties` is
11
- * `Record<string, unknown>` and may carry arbitrary host metadata, so a
12
- * shallow copy would leak shared references.
38
+ * `graphic` half of TacticalDraw's `GraphicSnapshot`. Nested values inside
39
+ * `options`, `style`, `properties`, and `textAmplifiers` are cloned too —
40
+ * `properties` is `Record<string, unknown>` and may carry arbitrary host
41
+ * metadata, so a shallow copy would leak shared references.
13
42
  *
14
43
  * Backed by `structuredClone`: only structured-cloneable values are
15
44
  * supported (no functions, DOM nodes, class instances). Absent optional
@@ -42,8 +71,9 @@ function controlMeasureIdFromFeature(feature) {
42
71
  * three-layer merge and stays a pure post-processing step.
43
72
  *
44
73
  * Lossy mapping, by design:
45
- * - `strokeDash` has no simplestyle equivalent and is dropped — dashed
46
- * 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.
47
77
  * - colors must be hex or `rgb()/rgba()`; alpha becomes `*-opacity`. Other
48
78
  * color forms (named, `hsl()`) are omitted rather than guessed.
49
79
  */
@@ -99,4 +129,4 @@ function toHexChannel(value) {
99
129
  return Math.max(0, Math.min(255, Math.round(value))).toString(16).padStart(2, "0");
100
130
  }
101
131
  //#endregion
102
- 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_BLOCK_MISSION_TASK_OPTIONS, DEFAULT_BLOCK_OPTIONS, DEFAULT_BREACH_OPTIONS, DEFAULT_BYPASS_OPTIONS, DEFAULT_CANALIZE_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_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, ambushDrawRule, attackByFireDrawRule, axis1DrawRule, blockDrawRule, calculateMetrics, cloneControlMeasure, computeDefaultMidpointPerpendicularPoint, computeInitialWidthPoint, controlMeasureIdFromFeature, createBaselineFrame, createMidpointPerpendicularDrawRule, disruptDrawRule, getControlMeasureMetadata, getControlMeasureMetadataByValue, getDefaultOptions, getMetersPerPixel, getMidpointPerpendicularSignedDistance, isKind, line1DrawRule, line23DrawRule, line24DrawRule, listControlMeasureMetadata, point12DrawRule, pointOnMidpointPerpendicularAxis, project, 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_BYPASS_OPTIONS, DEFAULT_CANALIZE_OPTIONS, DEFAULT_CLASSIC_ARROW_OPTIONS, DEFAULT_CLEAR_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_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_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_SCREEN_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, 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,14 +1,41 @@
1
- import { q as ControlMeasureId } from "../index-BJYbQlzo.mjs";
1
+ import { Ir as TextAmplifiers, W as ControlMeasureId, or as FillPattern } from "../index-c_3HSN3X.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 {
@@ -20,10 +47,37 @@ interface PreviewShape {
20
47
  cy?: number;
21
48
  /** Whether a `polygon` is a doctrinal solid (arrowhead) vs an area outline. */
22
49
  filled?: boolean;
50
+ /** Pattern requested by a filled polygon. */
51
+ fillPattern?: PreviewFillPattern;
23
52
  /** Glyph text for `text` (e.g. breach's "B"). */
24
53
  text?: string;
25
54
  /** Generator-frame rotation (radians) for `text`. */
26
55
  rotation?: number;
56
+ /**
57
+ * Text height in the same SVG units as `d`/`cx`/`cy`, derived from the
58
+ * source label's ground-anchored `textSizeMeters` (ADR-0028) scaled through
59
+ * the fit into the viewBox, then clamped so a long string can't exceed ~40%
60
+ * of the viewBox width. Present only when the label carried real
61
+ * ground-anchored sizing; a fixed glyph with no sizing (e.g. breach's "B",
62
+ * or Boundary's echelon-only sample) or a screen-anchored label (bare
63
+ * `textSizePixels`, unresolvable to a ground size without a live map
64
+ * resolution) leaves this `undefined` — a consumer should fall back to its
65
+ * own fixed font size, matching behavior from before this field existed.
66
+ */
67
+ heightPx?: number;
68
+ /** Horizontal alignment relative to (`cx`, `cy`), mirroring the label
69
+ * feature's `textAnchor` — `"start"`/`"end"` anchor the text at the point
70
+ * instead of centering it. Undefined = centered. */
71
+ textAnchor?: "start" | "end";
72
+ /** Whether the text needs an opaque readability backdrop. */
73
+ textBackground?: boolean;
74
+ /** Whether the text needs a white halo behind its glyphs. */
75
+ textHalo?: boolean;
76
+ /** Multi-line justification within the text block, mirroring the label
77
+ * feature's `textJustify`. The block itself still centers on (`cx`, `cy`). */
78
+ textJustify?: "left" | "center" | "right";
79
+ /** Typography preset, mirroring the label feature's `textStyle`. */
80
+ textStyle?: "regular" | "italic" | "light" | "caps";
27
81
  }
28
82
  /** Target viewBox the geometry is fit into. */
29
83
  interface ProjectDimensions {
@@ -41,5 +95,58 @@ declare function projectRenderToShapes(fc: FeatureCollection<Geometry, unknown>,
41
95
  shapes: PreviewShape[];
42
96
  ok: boolean;
43
97
  };
98
+ /**
99
+ * On-screen width (SVG units) of a `textBackground` label's readability box at
100
+ * `fontSize`: the glyph run (via {@link CHAR_WIDTH_RATIO}) or the font size,
101
+ * whichever is wider, plus a small horizontal pad. Shared by every preview
102
+ * consumer that paints the backdrop rect so the box width stays consistent.
103
+ */
104
+ declare function previewLabelBackgroundWidth(text: string | undefined, fontSize: number): number;
105
+ /**
106
+ * Grows a viewBox to include every `text` shape's estimated on-screen box —
107
+ * {@link projectRenderToShapes} fits geometry coordinates only, so an
108
+ * anchor-aware label (e.g. a phase line's end-anchored "PL ECHO") can extend
109
+ * well past the plain `0 0 width height` viewBox. Consumers should build
110
+ * their SVG `viewBox` from this instead.
111
+ *
112
+ * For each text shape (skipping shapes without `cx`/`cy`), estimates a box
113
+ * from its glyph count (`CHAR_WIDTH_RATIO` × `fontSize`) and `fontSize`
114
+ * itself, placed per `textAnchor` horizontally and centered on `cy`
115
+ * vertically (SVG text uses `dominant-baseline="central"`), rotates its
116
+ * corners around `(cx, cy)` by the same angle the SVG transform applies
117
+ * (`renderedAngle = PI - rotation`, negated for SVG's y-down axis — see
118
+ * {@link svgTextTransform}; labels commonly carry `rotation = PI`,
119
+ * which renders flat, so an undefined rotation must not be treated as
120
+ * rotated), and unions the result with the base `[0, 0, width, height]` box.
121
+ *
122
+ * `fontSize` is supplied by the caller since each gallery picks its own
123
+ * fallback/cap for `heightPx`.
124
+ */
125
+ declare function viewBoxWithLabels(shapes: PreviewShape[], dims: {
126
+ width: number;
127
+ height: number;
128
+ }, fontSize: (s: PreviewShape) => number): {
129
+ minX: number;
130
+ minY: number;
131
+ width: number;
132
+ height: number;
133
+ };
134
+ /**
135
+ * The SVG `viewBox` string for a preview, grown to include every label's
136
+ * on-screen box (see {@link viewBoxWithLabels}). The convenience every Vue
137
+ * consumer wants — they only ever format the box into this exact string.
138
+ */
139
+ declare function viewBoxString(shapes: PreviewShape[], dims: {
140
+ width: number;
141
+ height: number;
142
+ }, fontSize: (s: PreviewShape) => number): string;
143
+ /**
144
+ * The SVG `transform` attribute that rotates a `text` shape into place, or
145
+ * `undefined` for an unrotated/incomplete shape. Text rotations use the same
146
+ * generator convention as the map adapters (`renderedAngle = PI - rotation`);
147
+ * SVG's y-axis points down, so the angle is negated. Shared by every SVG
148
+ * preview consumer (sidebar gallery, docs catalog, README generator).
149
+ */
150
+ declare function svgTextTransform(s: PreviewShape): string | undefined;
44
151
  //#endregion
45
- export { PreviewShape, ProjectDimensions, projectRenderToShapes, renderRepresentative };
152
+ 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 { a as DEFINITIONS, t as renderControlMeasure } from "../renderControlMeasure-DkXDSrLz.mjs";
1
+ import { a as DEFINITIONS, t as renderControlMeasure } from "../renderControlMeasure-EdeAQZIo.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,156 @@ 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`, negated for SVG's y-down axis — 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
+ * SVG's y-axis points down, so the angle is negated. Shared by every SVG
285
+ * preview consumer (sidebar gallery, docs catalog, README generator).
286
+ */
287
+ function svgTextTransform(s) {
288
+ if (s.rotation === void 0 || s.cx === void 0 || s.cy === void 0) return void 0;
289
+ return `rotate(${(-((Math.PI - s.rotation) * 180) / Math.PI).toFixed(3)} ${s.cx.toFixed(3)} ${s.cy.toFixed(3)})`;
290
+ }
291
+ /**
292
+ * Resolves a label's SVG-unit text height from its `textSizeMeters` property
293
+ * (ADR-0028's ground anchor), scaled by the same `scale` the geometry was fit
294
+ * with, then clamped by both the height cap and the width the string would
295
+ * occupy at that height (so a long string can't overflow `maxWidthPx`).
296
+ * Returns `undefined` when the label carries no ground-anchored sizing — a
297
+ * screen-anchored label (bare `textSizePixels`, meaningless without a live map
298
+ * resolution to convert it) or one with no size at all — and the caller
299
+ * leaves `heightPx` unset.
300
+ */
301
+ function resolveTextHeightPx(labelProps, text, limits) {
302
+ const sizeMeters = labelProps.textSizeMeters;
303
+ if (typeof sizeMeters !== "number") return void 0;
304
+ const raw = sizeMeters * limits.scale / METERS_PER_DEGREE;
305
+ const widthLimit = text.length > 0 ? limits.maxWidthPx / (text.length * CHAR_WIDTH_RATIO) : Infinity;
306
+ return Math.min(raw, limits.maxHeightPx, widthLimit);
307
+ }
112
308
  function ringArea(ring) {
113
309
  let a = 0;
114
310
  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 +340,38 @@ function pathFromRing(ring, tx, close) {
144
340
  if (close) parts.push("Z");
145
341
  return parts.join(" ");
146
342
  }
147
- function collectShapes(g, tx, out, bboxArea, props) {
343
+ function collectShapes(g, tx, out, bboxArea, textLimits, props) {
148
344
  const labelProps = props && typeof props === "object" ? props : {};
149
345
  const labelText = typeof labelProps.text === "string" ? labelProps.text : void 0;
150
346
  const labelRotation = typeof labelProps.rotation === "number" ? labelProps.rotation : void 0;
347
+ const labelAnchor = labelProps.textAnchor === "start" || labelProps.textAnchor === "end" ? labelProps.textAnchor : void 0;
348
+ const textBackground = labelProps.textBackground === true ? true : void 0;
349
+ const textHalo = labelProps.textHalo === true ? true : void 0;
350
+ const textJustify = labelProps.textJustify === "left" || labelProps.textJustify === "center" || labelProps.textJustify === "right" ? labelProps.textJustify : void 0;
351
+ const textStyle = labelProps.textStyle === "regular" || labelProps.textStyle === "italic" || labelProps.textStyle === "light" || labelProps.textStyle === "caps" ? labelProps.textStyle : void 0;
352
+ const styleProps = labelProps.style && typeof labelProps.style === "object" ? labelProps.style : {};
353
+ const fillPattern = PREVIEW_FILL_PATTERNS.some((p) => p.id === styleProps.fillPattern) ? styleProps.fillPattern : void 0;
354
+ const explicitlyFilled = typeof styleProps.fillColor === "string";
151
355
  const polygonFilled = (ring) => bboxArea > 0 && ringArea(ring) / bboxArea < .25;
152
356
  switch (g.type) {
153
357
  case "Point": {
154
358
  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({
359
+ if (labelText !== void 0) {
360
+ const heightPx = resolveTextHeightPx(labelProps, labelText, textLimits);
361
+ out.push({
362
+ type: "text",
363
+ cx: x,
364
+ cy: y,
365
+ text: labelText,
366
+ rotation: labelRotation,
367
+ heightPx,
368
+ textAnchor: labelAnchor,
369
+ textBackground,
370
+ textHalo,
371
+ textJustify,
372
+ textStyle
373
+ });
374
+ } else out.push({
163
375
  type: "circle",
164
376
  cx: x,
165
377
  cy: y
@@ -192,20 +404,22 @@ function collectShapes(g, tx, out, bboxArea, props) {
192
404
  g.coordinates.forEach((ring) => out.push({
193
405
  type: "polygon",
194
406
  d: pathFromRing(ring, tx, true),
195
- filled: polygonFilled(ring)
407
+ filled: explicitlyFilled || polygonFilled(ring),
408
+ fillPattern
196
409
  }));
197
410
  break;
198
411
  case "MultiPolygon":
199
412
  g.coordinates.forEach((poly) => poly.forEach((ring) => out.push({
200
413
  type: "polygon",
201
414
  d: pathFromRing(ring, tx, true),
202
- filled: polygonFilled(ring)
415
+ filled: polygonFilled(ring),
416
+ fillPattern
203
417
  })));
204
418
  break;
205
419
  case "GeometryCollection":
206
- g.geometries.forEach((sub) => collectShapes(sub, tx, out, bboxArea, props));
420
+ g.geometries.forEach((sub) => collectShapes(sub, tx, out, bboxArea, textLimits, props));
207
421
  break;
208
422
  }
209
423
  }
210
424
  //#endregion
211
- export { projectRenderToShapes, renderRepresentative };
425
+ export { PREVIEW_FILL_PATTERNS, PREVIEW_PATTERN_DOT_RADIUS, PREVIEW_PATTERN_TILE, previewLabelBackgroundWidth, projectRenderToShapes, renderRepresentative, svgTextTransform, viewBoxString, viewBoxWithLabels };