@orbat-mapper/control-measures 0.2.0-alpha.23 → 0.2.0-alpha.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{index-CuLg1vvg.d.mts → index-B9zJp8RE.d.mts} +106 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +16 -2
- package/dist/preview/index.d.mts +8 -1
- package/dist/preview/index.mjs +8 -2
- package/dist/{renderControlMeasure-CsrLHwjB.mjs → renderControlMeasure-BVCfd97P.mjs} +256 -8
- package/package.json +1 -1
|
@@ -205,7 +205,7 @@ declare function normalizeTextAmplifiers(input: TextAmplifiers | undefined): Can
|
|
|
205
205
|
//#region src/metadata.d.ts
|
|
206
206
|
type ControlMeasureGeometryType = Geometry["type"];
|
|
207
207
|
type ControlMeasureGeometry = "point" | "line" | "area";
|
|
208
|
-
declare const DRAW_RULE_IDS: readonly ["Area1", "Area7", "Area8", "Area11", "Area12", "Area15", "Area21", "Axis1", "Line1", "Line3", "Line9", "Line10", "Line23", "Line24", "Line26", "Line29", "Point12", "Rectangle"];
|
|
208
|
+
declare const DRAW_RULE_IDS: readonly ["Area1", "Area7", "Area8", "Area11", "Area12", "Area15", "Area21", "Axis1", "Line1", "Line3", "Line9", "Line10", "Line23", "Line24", "Line26", "Line29", "Point1", "Point12", "Rectangle"];
|
|
209
209
|
type DrawRuleId = (typeof DRAW_RULE_IDS)[number];
|
|
210
210
|
interface BaseParamDescriptor {
|
|
211
211
|
key: string;
|
|
@@ -245,6 +245,12 @@ interface TextParamDescriptor extends BaseParamDescriptor {
|
|
|
245
245
|
* amplifier field.
|
|
246
246
|
*/
|
|
247
247
|
field?: TextAmplifierField;
|
|
248
|
+
/**
|
|
249
|
+
* Whether the value may contain explicit line breaks that a metadata-driven
|
|
250
|
+
* editor should let the user enter directly (a multi-row textarea rather
|
|
251
|
+
* than a single-line input), e.g. the generic Text measure's `text` option.
|
|
252
|
+
*/
|
|
253
|
+
multiline?: boolean;
|
|
248
254
|
}
|
|
249
255
|
type ParamDescriptor = NumberParamDescriptor | BooleanParamDescriptor | ColorParamDescriptor | TextParamDescriptor | EnumParamDescriptor;
|
|
250
256
|
/** Editor-facing description of one text amplifier field a measure accepts. */
|
|
@@ -359,6 +365,30 @@ interface ControlMeasureDefinition<Id extends string, G extends ControlMeasureGe
|
|
|
359
365
|
* against the new orientation. See ADR-0023.
|
|
360
366
|
*/
|
|
361
367
|
freezeOrientation?: (controlPoints: Position[], options: NonNullable<Parameters<G>[1]>) => Partial<NonNullable<Parameters<G>[1]>> | undefined;
|
|
368
|
+
/**
|
|
369
|
+
* Folds a box transform gesture's screen-space delta into option values for a
|
|
370
|
+
* graphic that persists orientation and/or size as options rather than in its
|
|
371
|
+
* geometry — single-point graphics (e.g. Text) have no geometry to encode
|
|
372
|
+
* them. Returns an options patch to merge onto the working options, or
|
|
373
|
+
* `undefined` when the kind carries no such option (or the delta is inert).
|
|
374
|
+
* Edit hosts call this at a rotate/scale gesture's commit, alongside the rigid
|
|
375
|
+
* transform of the control points, so the persisted rotation/size follow the
|
|
376
|
+
* box. The measure owns the unit/sign conversion (e.g. Text stores degrees
|
|
377
|
+
* clockwise-on-screen while the delta is radians). See ADR-0017/0023.
|
|
378
|
+
*/
|
|
379
|
+
transformOptions?: (options: NonNullable<Parameters<G>[1]>, delta: BoxTransformDelta) => Partial<NonNullable<Parameters<G>[1]>> | undefined;
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* A box transform gesture's screen-space delta, folded into orientation- and
|
|
383
|
+
* size-carrying options by {@link ControlMeasureDefinition.transformOptions}.
|
|
384
|
+
* The transform box (ADR-0017) is the source: `scale` is the uniform corner
|
|
385
|
+
* -scale factor (`1` = no scaling), `rotationRadians` the rotate-grip delta
|
|
386
|
+
* (positive = clockwise on screen, matching the box angle convention; `0` = no
|
|
387
|
+
* rotation). A body translate reports neither (`{ scale: 1, rotationRadians: 0 }`).
|
|
388
|
+
*/
|
|
389
|
+
interface BoxTransformDelta {
|
|
390
|
+
scale: number;
|
|
391
|
+
rotationRadians: number;
|
|
362
392
|
}
|
|
363
393
|
/**
|
|
364
394
|
* A measure's representative preview input. Shared between the typed
|
|
@@ -952,6 +982,10 @@ interface FeaturePartProps {
|
|
|
952
982
|
textAnchor?: "start" | "end";
|
|
953
983
|
/** Render an opaque light backdrop behind text placed over patterned geometry. */
|
|
954
984
|
textBackground?: boolean;
|
|
985
|
+
/** Render a contrast-aware halo behind the glyphs so text stays legible on busy backgrounds. */
|
|
986
|
+
textHalo?: boolean;
|
|
987
|
+
/** Halo color contrasting with the resolved text color; present only when `textHalo` is set. */
|
|
988
|
+
textHaloColor?: string;
|
|
955
989
|
/** Canonical field key for a text-amplifier label that may be repositioned. */
|
|
956
990
|
amplifierField?: TextAmplifierKey;
|
|
957
991
|
/** Stable key used to persist a user-adjusted anchor for any rendered label. */
|
|
@@ -968,6 +1002,20 @@ interface FeaturePartProps {
|
|
|
968
1002
|
* their configured clamp band.
|
|
969
1003
|
*/
|
|
970
1004
|
textSizeMeters?: number;
|
|
1005
|
+
/**
|
|
1006
|
+
* Multi-line justification within the text block (Text's `textAlign`
|
|
1007
|
+
* option); the block itself stays centered on the anchor regardless of this
|
|
1008
|
+
* value — unrelated to the block-shifting `textAnchor`.
|
|
1009
|
+
*/
|
|
1010
|
+
textJustify?: "left" | "center" | "right";
|
|
1011
|
+
/** Closed typography preset for a text label (Text's `textStyle` option). */
|
|
1012
|
+
textStyle?: "regular" | "italic" | "light" | "caps";
|
|
1013
|
+
/**
|
|
1014
|
+
* Hide threshold in CSS pixels: when the derived on-screen text size exceeds
|
|
1015
|
+
* this, adapters render nothing for the label instead of clamping (ADR-0037)
|
|
1016
|
+
* and skip the default 8-24px ground clamp band.
|
|
1017
|
+
*/
|
|
1018
|
+
textMaxSizePixels?: number;
|
|
971
1019
|
}
|
|
972
1020
|
/**
|
|
973
1021
|
* Output of `renderControlMeasure`. A GeoJSON `FeatureCollection` whose
|
|
@@ -1573,6 +1621,51 @@ declare function createGenericCircle(coordinates: Position[], options?: GenericC
|
|
|
1573
1621
|
fill: boolean;
|
|
1574
1622
|
}>;
|
|
1575
1623
|
//#endregion
|
|
1624
|
+
//#region src/generators/cm99-generic-graphics/text.d.ts
|
|
1625
|
+
/** Configuration options for the generic Text control measure. */
|
|
1626
|
+
interface GenericTextOptions {
|
|
1627
|
+
/** Plain text; explicit `\n` breaks lines — never auto-wraps. @default "Text" */
|
|
1628
|
+
text?: string;
|
|
1629
|
+
/**
|
|
1630
|
+
* Placement of the text block relative to the anchor point, and the
|
|
1631
|
+
* justification of its lines. `left` puts the anchor at the block's left edge
|
|
1632
|
+
* (text extends rightward, lines left-justified); `right` puts the anchor at
|
|
1633
|
+
* the right edge (text extends leftward, lines right-justified); `center`
|
|
1634
|
+
* centers the block on the anchor (lines centered). Maps onto the existing
|
|
1635
|
+
* block-shifting `textAnchor` prop (`left` → `start`, `right` → `end`, `center`
|
|
1636
|
+
* → none) plus the `textJustify` prop; rotation always pivots at the anchor.
|
|
1637
|
+
* @default "center"
|
|
1638
|
+
*/
|
|
1639
|
+
textAlign?: "left" | "center" | "right";
|
|
1640
|
+
/** Closed typography preset. `caps` uppercases `regular`; `light` is weight 300. @default "regular" */
|
|
1641
|
+
textStyle?: "regular" | "italic" | "light" | "caps";
|
|
1642
|
+
/** Clockwise rotation in degrees on screen. @default 0 */
|
|
1643
|
+
rotation?: number;
|
|
1644
|
+
/**
|
|
1645
|
+
* Text height (cap height) in projected meters — ground-anchored
|
|
1646
|
+
* (ADR-0020). Ignored whenever `sizePixels` is present.
|
|
1647
|
+
*/
|
|
1648
|
+
sizeMeters?: number;
|
|
1649
|
+
/**
|
|
1650
|
+
* Text height in CSS pixels — screen-anchored (ADR-0020). A fresh draw is
|
|
1651
|
+
* authored in pixels and bakes to `sizeMeters` on commit.
|
|
1652
|
+
* @default 24
|
|
1653
|
+
*/
|
|
1654
|
+
sizePixels?: number;
|
|
1655
|
+
/**
|
|
1656
|
+
* Hide threshold in CSS pixels: once the ground-derived on-screen size
|
|
1657
|
+
* exceeds this, adapters hide the text entirely instead of clamping it
|
|
1658
|
+
* (ADR-0037); there is no minimum, so the text just keeps shrinking on
|
|
1659
|
+
* zoom-out.
|
|
1660
|
+
* @default 200
|
|
1661
|
+
*/
|
|
1662
|
+
maxSizePixels?: number;
|
|
1663
|
+
/** Contrasting halo behind the glyphs so the text stays legible on busy backgrounds. @default false */
|
|
1664
|
+
halo?: boolean;
|
|
1665
|
+
}
|
|
1666
|
+
declare const DEFAULT_GENERIC_TEXT_OPTIONS: GenericTextOptions;
|
|
1667
|
+
declare function createGenericText(coordinates: Position[], options?: GenericTextOptions): FeatureCollection<Point, Record<string, unknown>>;
|
|
1668
|
+
//#endregion
|
|
1576
1669
|
//#region src/generators/cm15-maneuver-areas/airborneAttack.d.ts
|
|
1577
1670
|
type AirborneAttackOptions = AttackOptions;
|
|
1578
1671
|
declare const DEFAULT_AIRBORNE_ATTACK_OPTIONS: Required<AirborneAttackOptions>;
|
|
@@ -2392,6 +2485,7 @@ declare const DEFINITIONS: {
|
|
|
2392
2485
|
polygon: ControlMeasureDefinition<"polygon", typeof createGenericPolygon>;
|
|
2393
2486
|
rectangle: ControlMeasureDefinition<"rectangle", typeof createGenericRectangle>;
|
|
2394
2487
|
circle: ControlMeasureDefinition<"circle", typeof createGenericCircle>;
|
|
2488
|
+
text: ControlMeasureDefinition<"text", typeof createGenericText>;
|
|
2395
2489
|
"airborne-attack": ControlMeasureDefinition<"airborne-attack", typeof createAirborneAttack>;
|
|
2396
2490
|
"attack-helicopter": ControlMeasureDefinition<"attack-helicopter", typeof createAttackHelicopter>;
|
|
2397
2491
|
"support-by-fire": ControlMeasureDefinition<"support-by-fire", typeof createSupportByFire>;
|
|
@@ -2508,6 +2602,16 @@ declare function renderControlMeasure<K extends ControlMeasureKind>(cm: ControlM
|
|
|
2508
2602
|
* freeze. Edit hosts call this when a rotate gesture starts (ADR-0023).
|
|
2509
2603
|
*/
|
|
2510
2604
|
declare function freezeOrientationOptions<K extends ControlMeasureKind>(kind: K, controlPoints: Position[], options: OptionsByKind[K] | undefined): Partial<OptionsByKind[K]> | undefined;
|
|
2605
|
+
/**
|
|
2606
|
+
* Dispatches to a measure kind's `transformOptions` hook (see
|
|
2607
|
+
* {@link import("./define").ControlMeasureDefinition.transformOptions}), folding
|
|
2608
|
+
* a box transform gesture's `delta` (screen-space scale/rotation) into option
|
|
2609
|
+
* values for a graphic that persists orientation/size as options rather than in
|
|
2610
|
+
* geometry. Returns an options patch to merge, or `undefined` when the kind
|
|
2611
|
+
* declares no hook (or the hook finds nothing to fold). Edit hosts call this at
|
|
2612
|
+
* a rotate/scale gesture's commit (ADR-0017).
|
|
2613
|
+
*/
|
|
2614
|
+
declare function applyBoxTransformOptions<K extends ControlMeasureKind>(kind: K, options: OptionsByKind[K] | undefined, delta: BoxTransformDelta): Partial<OptionsByKind[K]> | undefined;
|
|
2511
2615
|
//#endregion
|
|
2512
2616
|
//#region src/styleResolver.d.ts
|
|
2513
2617
|
/**
|
|
@@ -2764,4 +2868,4 @@ interface AmbushOptions {
|
|
|
2764
2868
|
}
|
|
2765
2869
|
declare const DEFAULT_AMBUSH_OPTIONS: Required<AmbushOptions>;
|
|
2766
2870
|
//#endregion
|
|
2767
|
-
export {
|
|
2871
|
+
export { DEFAULT_OBSTACLE_BYPASS_DIFFICULT_OPTIONS as $, DEFAULT_DIRECTION_OF_ATTACK_AVIATION_OPTIONS as $n, DEFAULT_SUPPORT_BY_FIRE_OPTIONS as $t, roundToFixed as A, PickupZoneOptions as An, LabelPlacementOverride as Ar, DEFAULT_COVER_OPTIONS as At, cloneControlMeasure as B, EncirclementOptions as Bn, DEFAULT_BREACH_OPTIONS as Bt, BaselineFrame as C, DEFAULT_MAIN_ATTACK_OPTIONS as Cn, ControlMeasureMetadata as Cr, DEFAULT_SCREEN_OPTIONS as Ct, createBaselineFrame as D, AreaOfOperationsOptions as Dn, AmplifierPlacements as Dr, DEFAULT_DELAY_OPTIONS as Dt, BaselineFrameOrigin as E, computeInitialWidthPoint as En, AmplifierPlacement as Er, GuardOptions as Et, applyBoxTransformOptions as F, AssemblyAreaOptions as Fn, canonicalTextAmplifierKey as Fr, CanalizeOptions as Ft, ControlMeasureKind as G, StyleHints as Gn, DEFAULT_HANDOVER_LINE_OPTIONS as Gt, CONTROL_MEASURE_IDS as H, FinalProtectiveFireOptions as Hn, DEFAULT_BLOCK_MISSION_TASK_OPTIONS as Ht, freezeOrientationOptions as I, DEFAULT_ASSEMBLY_AREA_OPTIONS as In, normalizeTextAmplifiers as Ir, DEFAULT_CANALIZE_OPTIONS as It, getControlMeasureMetadataByValue as J, PrincipalDirectionOfFireOptions as Jn, PhaseLineOptions as Jt, OptionsByKind as K, controlMeasureIdFromFeature as Kn, HandoverLineOptions as Kt, RenderOptions as L, AreaDefenseOptions as Ln, resolveAmplifierPlacement as Lr, BypassOptions as Lt, SimpleStyleRender as M, LandingZoneOptions as Mn, TextAmplifierField as Mr, TacticalArrowOptions as Mt, toSimpleStyle as N, DEFAULT_JOINT_TACTICAL_ACTION_AREA_OPTIONS as Nn, TextAmplifierKey as Nr, ClearOptions as Nt, EPSILON as O, DEFAULT_AREA_OF_OPERATIONS_OPTIONS as On, CanonicalTextAmplifiers as Or, DelayOptions as Ot, resolveStyleHints as P, JointTacticalActionAreaOptions as Pn, TextAmplifiers as Pr, DEFAULT_CLEAR_OPTIONS as Pt, ObstacleBypassImpossibleOptions as Q, DirectionOfMainAttackOptions as Qn, DEFAULT_ATTACK_BY_FIRE_OPTIONS as Qt, renderControlMeasure as R, DEFAULT_AREA_DEFENSE_OPTIONS as Rn, AnchorTransformEvent as Rr, DEFAULT_BYPASS_OPTIONS as Rt, snapToMidpointPerpendicular as S, SupportingAttackOptions as Sn, ControlMeasureGeometryType as Sr, DEFAULT_ANTITANK_DITCH_OPTIONS as St, BaselineFrameOptions as T, calculateMetrics as Tn, TextAmplifierDescriptor as Tr, DEFAULT_GUARD_OPTIONS as Tt, CONTROL_MEASURE_METADATA as U, ControlMeasureRender as Un, BattleHandoverLineOptions as Ut, isKind as V, DEFAULT_FINAL_PROTECTIVE_FIRE_OPTIONS as Vn, BlockMissionTaskOptions as Vt, ControlMeasureId as W, FeaturePartProps as Wn, DEFAULT_BATTLE_HANDOVER_LINE_OPTIONS as Wt, listControlMeasureMetadata as X, DirectionOfSupportingAttackOptions as Xn, FLOTOptions as Xt, getDefaultOptions as Y, DEFAULT_DIRECTION_OF_SUPPORTING_ATTACK_OPTIONS as Yn, DEFAULT_FLOT_OPTIONS as Yt, DEFAULT_OBSTACLE_BYPASS_IMPOSSIBLE_OPTIONS as Z, DEFAULT_DIRECTION_OF_MAIN_ATTACK_OPTIONS as Zn, AttackByFireOptions as Zt, MidpointPerpendicularDrawRuleOptions as _, DEFAULT_BLOCK_ARROW_OPTIONS as _n, unproject as _r, DEFAULT_FORTIFIED_LINE_OPTIONS as _t, supportByFireDrawRule as a, DEFAULT_GENERIC_TEXT_OPTIONS as an, ControlMeasureStyle as ar, DEFAULT_FIX_OPTIONS as at, getMidpointPerpendicularSignedDistance as b, DEFAULT_CLASSIC_ARROW_OPTIONS as bn, BoxTransformDelta as br, DEFAULT_ANTITANK_WALL_OPTIONS as bt, line23DrawRule as c, GenericCircleOptions as cn, GenericC2LineOptions as cr, DisruptOptions as ct, ambushDrawRule as d, DEFAULT_GENERIC_POLYGON_OPTIONS as dn, DEFAULT_LIGHT_LINE_OPTIONS as dr, DEFAULT_TURNING_MOVEMENT_OPTIONS as dt, SupportByFireOptions as en, DirectionOfAttackAviationOptions as er, ObstacleBypassDifficultOptions as et, attackByFireDrawRule as f, GenericPolygonOptions as fn, LightLineOptions as fr, TurningMovementOptions as ft, blockDrawRule as g, BlockArrowOptions as gn, project as gr, FortifiedAreaOptions as gt, disruptDrawRule as h, BlockArrowHeadStyle as hn, haversineDistance as hr, DEFAULT_FORTIFIED_AREA_OPTIONS as ht, axis1DrawRule as i, DEFAULT_AIRBORNE_ATTACK_OPTIONS as in, DEFAULT_BATTLE_POSITION_OPTIONS as ir, TurnOptions as it, SimpleStyleProps as j, DEFAULT_LANDING_ZONE_OPTIONS as jn, TEXT_AMPLIFIER_FIELDS as jr, DEFAULT_TACTICAL_ARROW_OPTIONS as jt, getMetersPerPixel as k, DEFAULT_PICKUP_ZONE_OPTIONS as kn, GeneratedLabelKey as kr, CoverOptions as kt, turnDrawRule as l, DEFAULT_GENERIC_RECTANGLE_OPTIONS as ln, DEFAULT_ENGINEER_WORK_LINE_OPTIONS as lr, BlockOptions as lt, centerRadiusDrawRule as m, GenericLineOptions as mn, Point2D as mr, FrontalAttackOptions as mt, DEFAULT_AMBUSH_OPTIONS as n, DEFAULT_ATTACK_HELICOPTER_OPTIONS as nn, StrongPointOptions as nr, ObstacleBypassEasyOptions as nt, line26DrawRule as o, GenericTextOptions as on, FillPattern as or, FixOptions as ot, point12DrawRule as p, DEFAULT_GENERIC_LINE_OPTIONS as pn, LabelSizeOptions as pr, DEFAULT_FRONTAL_ATTACK_OPTIONS as pt, getControlMeasureMetadata as q, DEFAULT_PRINCIPAL_DIRECTION_OF_FIRE_OPTIONS as qn, DEFAULT_PHASE_LINE_OPTIONS as qt, rectangleDrawRule as r, AirborneAttackOptions as rn, BattlePositionOptions as rr, DEFAULT_TURN_OPTIONS as rt, line24DrawRule as s, DEFAULT_GENERIC_CIRCLE_OPTIONS as sn, DEFAULT_GENERIC_C2_LINE_OPTIONS as sr, DEFAULT_DISRUPT_OPTIONS as st, AmbushOptions as t, AttackHelicopterOptions as tn, DEFAULT_STRONG_POINT_OPTIONS as tr, DEFAULT_OBSTACLE_BYPASS_EASY_OPTIONS as tt, line1DrawRule as u, GenericRectangleOptions as un, EngineerWorkLineOptions as ur, DEFAULT_BLOCK_OPTIONS as ut, computeDefaultMidpointPerpendicularPoint as v, ClassicArrowHeadStyle as vn, BoundaryOptions as vr, FortifiedLineOptions as vt, BaselineFrameNormal as w, MainAttackOptions as wn, ParamDescriptor as wr, ScreenOptions as wt, pointOnMidpointPerpendicularAxis as x, DEFAULT_SUPPORTING_ATTACK_OPTIONS as xn, ControlMeasureGeometry as xr, AntitankDitchOptions as xt, createMidpointPerpendicularDrawRule as y, ClassicArrowOptions as yn, DEFAULT_BOUNDARY_OPTIONS as yr, AntitankWallOptions as yt, ControlMeasure as z, DEFAULT_ENCIRCLEMENT_OPTIONS as zn, ControlMeasureDrawRule as zr, BreachOptions as zt };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
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 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 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_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 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, 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
|
+
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 LabelPlacementOverride, At as DEFAULT_COVER_OPTIONS, B as cloneControlMeasure, Bn as EncirclementOptions, Bt as DEFAULT_BREACH_OPTIONS, C as BaselineFrame, Cn as DEFAULT_MAIN_ATTACK_OPTIONS, Cr as ControlMeasureMetadata, Ct as DEFAULT_SCREEN_OPTIONS, D as createBaselineFrame, Dn as AreaOfOperationsOptions, Dr as AmplifierPlacements, Dt as DEFAULT_DELAY_OPTIONS, E as BaselineFrameOrigin, En as computeInitialWidthPoint, Er as AmplifierPlacement, Et as GuardOptions, F as applyBoxTransformOptions, Fn as AssemblyAreaOptions, Fr as canonicalTextAmplifierKey, 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 normalizeTextAmplifiers, 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 resolveAmplifierPlacement, Lt as BypassOptions, M as SimpleStyleRender, Mn as LandingZoneOptions, Mr as TextAmplifierField, Mt as TacticalArrowOptions, N as toSimpleStyle, Nn as DEFAULT_JOINT_TACTICAL_ACTION_AREA_OPTIONS, Nr as TextAmplifierKey, Nt as ClearOptions, O as EPSILON, On as DEFAULT_AREA_OF_OPERATIONS_OPTIONS, Or as CanonicalTextAmplifiers, Ot as DelayOptions, P as resolveStyleHints, Pn as JointTacticalActionAreaOptions, Pr as TextAmplifiers, 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 AnchorTransformEvent, Rt as DEFAULT_BYPASS_OPTIONS, S as snapToMidpointPerpendicular, Sn as SupportingAttackOptions, Sr as ControlMeasureGeometryType, St as DEFAULT_ANTITANK_DITCH_OPTIONS, T as BaselineFrameOptions, Tn as calculateMetrics, Tr as TextAmplifierDescriptor, 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, 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 TEXT_AMPLIFIER_FIELDS, jt as DEFAULT_TACTICAL_ARROW_OPTIONS, k as getMetersPerPixel, kn as DEFAULT_PICKUP_ZONE_OPTIONS, kr as GeneratedLabelKey, 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 ParamDescriptor, wt as ScreenOptions, x as pointOnMidpointPerpendicularAxis, xn as DEFAULT_SUPPORTING_ATTACK_OPTIONS, xr as ControlMeasureGeometry, 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 ControlMeasureDrawRule, zt as BreachOptions } from "./index-B9zJp8RE.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 ControlMeasureGeometry, type ControlMeasureGeometryType, type ControlMeasureId, type ControlMeasureKind, type ControlMeasureMetadata, 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,4 @@
|
|
|
1
|
-
import { $ as
|
|
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 canonicalTextAmplifierKey, et as DEFAULT_BLOCK_ARROW_OPTIONS, f as DEFAULT_SUPPORTING_ATTACK_OPTIONS, ft as normalizeTextAmplifiers, g as DEFAULT_PICKUP_ZONE_OPTIONS, gt as DEFAULT_DIRECTION_OF_ATTACK_AVIATION_OPTIONS, h as DEFAULT_PRINCIPAL_DIRECTION_OF_FIRE_OPTIONS, ht as DEFAULT_DIRECTION_OF_MAIN_ATTACK_OPTIONS, 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 DEFAULT_DIRECTION_OF_SUPPORTING_ATTACK_OPTIONS, 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 resolveAmplifierPlacement, 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 TEXT_AMPLIFIER_FIELDS, 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-BVCfd97P.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) {
|
|
@@ -115,4 +129,4 @@ function toHexChannel(value) {
|
|
|
115
129
|
return Math.max(0, Math.min(255, Math.round(value))).toString(16).padStart(2, "0");
|
|
116
130
|
}
|
|
117
131
|
//#endregion
|
|
118
|
-
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_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, 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 };
|
|
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 };
|
package/dist/preview/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Pr as TextAmplifiers, W as ControlMeasureId, or as FillPattern } from "../index-B9zJp8RE.mjs";
|
|
2
2
|
import { FeatureCollection, Geometry } from "geojson";
|
|
3
3
|
|
|
4
4
|
//#region src/preview/index.d.ts
|
|
@@ -68,6 +68,13 @@ interface PreviewShape {
|
|
|
68
68
|
textAnchor?: "start" | "end";
|
|
69
69
|
/** Whether the text needs an opaque readability backdrop. */
|
|
70
70
|
textBackground?: boolean;
|
|
71
|
+
/** Whether the text needs a white halo behind its glyphs. */
|
|
72
|
+
textHalo?: boolean;
|
|
73
|
+
/** Multi-line justification within the text block, mirroring the label
|
|
74
|
+
* feature's `textJustify`. The block itself still centers on (`cx`, `cy`). */
|
|
75
|
+
textJustify?: "left" | "center" | "right";
|
|
76
|
+
/** Typography preset, mirroring the label feature's `textStyle`. */
|
|
77
|
+
textStyle?: "regular" | "italic" | "light" | "caps";
|
|
71
78
|
}
|
|
72
79
|
/** Target viewBox the geometry is fit into. */
|
|
73
80
|
interface ProjectDimensions {
|
package/dist/preview/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as DEFINITIONS, t as renderControlMeasure } from "../renderControlMeasure-
|
|
1
|
+
import { a as DEFINITIONS, t as renderControlMeasure } from "../renderControlMeasure-BVCfd97P.mjs";
|
|
2
2
|
//#region src/preview/index.ts
|
|
3
3
|
/** Side length (SVG units) of the repeating hatch tile in {@link PREVIEW_FILL_PATTERNS}. */
|
|
4
4
|
const PREVIEW_PATTERN_TILE = 8;
|
|
@@ -331,6 +331,9 @@ function collectShapes(g, tx, out, bboxArea, textLimits, props) {
|
|
|
331
331
|
const labelRotation = typeof labelProps.rotation === "number" ? labelProps.rotation : void 0;
|
|
332
332
|
const labelAnchor = labelProps.textAnchor === "start" || labelProps.textAnchor === "end" ? labelProps.textAnchor : void 0;
|
|
333
333
|
const textBackground = labelProps.textBackground === true ? true : void 0;
|
|
334
|
+
const textHalo = labelProps.textHalo === true ? true : void 0;
|
|
335
|
+
const textJustify = labelProps.textJustify === "left" || labelProps.textJustify === "center" || labelProps.textJustify === "right" ? labelProps.textJustify : void 0;
|
|
336
|
+
const textStyle = labelProps.textStyle === "regular" || labelProps.textStyle === "italic" || labelProps.textStyle === "light" || labelProps.textStyle === "caps" ? labelProps.textStyle : void 0;
|
|
334
337
|
const styleProps = labelProps.style && typeof labelProps.style === "object" ? labelProps.style : {};
|
|
335
338
|
const fillPattern = PREVIEW_FILL_PATTERNS.some((p) => p.id === styleProps.fillPattern) ? styleProps.fillPattern : void 0;
|
|
336
339
|
const explicitlyFilled = typeof styleProps.fillColor === "string";
|
|
@@ -348,7 +351,10 @@ function collectShapes(g, tx, out, bboxArea, textLimits, props) {
|
|
|
348
351
|
rotation: labelRotation,
|
|
349
352
|
heightPx,
|
|
350
353
|
textAnchor: labelAnchor,
|
|
351
|
-
textBackground
|
|
354
|
+
textBackground,
|
|
355
|
+
textHalo,
|
|
356
|
+
textJustify,
|
|
357
|
+
textStyle
|
|
352
358
|
});
|
|
353
359
|
} else out.push({
|
|
354
360
|
type: "circle",
|
|
@@ -557,7 +557,7 @@ function samePosition(a, b) {
|
|
|
557
557
|
}
|
|
558
558
|
//#endregion
|
|
559
559
|
//#region src/draw-rules/area1.ts
|
|
560
|
-
function derive$
|
|
560
|
+
function derive$10(points) {
|
|
561
561
|
return clonePositions(points);
|
|
562
562
|
}
|
|
563
563
|
/**
|
|
@@ -577,9 +577,9 @@ const area1DrawRule = {
|
|
|
577
577
|
id: "area1",
|
|
578
578
|
minimumUserPoints: 3,
|
|
579
579
|
closedRing: true,
|
|
580
|
-
derive: derive$
|
|
580
|
+
derive: derive$10,
|
|
581
581
|
transform(event) {
|
|
582
|
-
return derive$
|
|
582
|
+
return derive$10(event.next);
|
|
583
583
|
}
|
|
584
584
|
};
|
|
585
585
|
//#endregion
|
|
@@ -605,14 +605,14 @@ const disruptDrawRule = createMidpointPerpendicularDrawRule({
|
|
|
605
605
|
* that fixes both the radius and the bearing of the symbol's opening. Both
|
|
606
606
|
* points are user-clicked, so the canonical array is just the (clamped) input.
|
|
607
607
|
*/
|
|
608
|
-
function derive$
|
|
608
|
+
function derive$9(points) {
|
|
609
609
|
return clonePositions(points.slice(0, 2));
|
|
610
610
|
}
|
|
611
611
|
const centerRadiusDrawRule = {
|
|
612
612
|
id: "area15:center-radius",
|
|
613
613
|
minimumUserPoints: 2,
|
|
614
614
|
canonicalPointCount: 2,
|
|
615
|
-
derive: derive$
|
|
615
|
+
derive: derive$9,
|
|
616
616
|
transform(event) {
|
|
617
617
|
const { previous, next, activePointIndex } = event;
|
|
618
618
|
if (activePointIndex === 0 && previous.length >= 2 && next.length >= 2) {
|
|
@@ -621,7 +621,7 @@ const centerRadiusDrawRule = {
|
|
|
621
621
|
const origin = previous[1];
|
|
622
622
|
return [clonePosition(next[0]), [origin[0] + dx, origin[1] + dy]];
|
|
623
623
|
}
|
|
624
|
-
return derive$
|
|
624
|
+
return derive$9(next);
|
|
625
625
|
}
|
|
626
626
|
};
|
|
627
627
|
/** Backward-compatible doctrinal name for Area15's shared center-radius rule. */
|
|
@@ -639,6 +639,24 @@ const isolateDrawRule = centerRadiusDrawRule;
|
|
|
639
639
|
*/
|
|
640
640
|
const point12DrawRule = createMidpointPerpendicularDrawRule({ id: "point12:obstacle-bypass" });
|
|
641
641
|
//#endregion
|
|
642
|
+
//#region src/draw-rules/point1.ts
|
|
643
|
+
/**
|
|
644
|
+
* Point1 — a single anchor point (e.g. Text's center). One user click commits
|
|
645
|
+
* the measure; dragging the point simply translates it.
|
|
646
|
+
*/
|
|
647
|
+
function derive$8(points) {
|
|
648
|
+
return clonePositions(points.slice(0, 1));
|
|
649
|
+
}
|
|
650
|
+
const pointDrawRule = {
|
|
651
|
+
id: "point1:anchor",
|
|
652
|
+
minimumUserPoints: 1,
|
|
653
|
+
canonicalPointCount: 1,
|
|
654
|
+
derive: derive$8,
|
|
655
|
+
transform(event) {
|
|
656
|
+
return derive$8(event.next);
|
|
657
|
+
}
|
|
658
|
+
};
|
|
659
|
+
//#endregion
|
|
642
660
|
//#region src/draw-rules/area7.ts
|
|
643
661
|
/**
|
|
644
662
|
* Area7 anchor draw rule for Attack By Fire.
|
|
@@ -7177,6 +7195,186 @@ const GENERIC_RECTANGLE = defineControlMeasure({
|
|
|
7177
7195
|
] }
|
|
7178
7196
|
});
|
|
7179
7197
|
//#endregion
|
|
7198
|
+
//#region src/generators/cm99-generic-graphics/text.ts
|
|
7199
|
+
/** Wrap a degree value into the canonical clockwise `[0, 360)` range. */
|
|
7200
|
+
function normalizeDegrees(degrees) {
|
|
7201
|
+
return (degrees % 360 + 360) % 360;
|
|
7202
|
+
}
|
|
7203
|
+
const DEFAULT_GENERIC_TEXT_OPTIONS = {
|
|
7204
|
+
text: "Text",
|
|
7205
|
+
textAlign: "center",
|
|
7206
|
+
textStyle: "regular",
|
|
7207
|
+
rotation: 0,
|
|
7208
|
+
sizePixels: 24,
|
|
7209
|
+
maxSizePixels: 200,
|
|
7210
|
+
halo: false
|
|
7211
|
+
};
|
|
7212
|
+
const GENERIC_TEXT_METADATA = {
|
|
7213
|
+
id: "text",
|
|
7214
|
+
name: "Text",
|
|
7215
|
+
description: "A non-doctrinal free-standing text label anchored at a single point.",
|
|
7216
|
+
entity: "Generic Graphics",
|
|
7217
|
+
entityType: "Annotation",
|
|
7218
|
+
entitySubtype: "Text",
|
|
7219
|
+
value: "990201",
|
|
7220
|
+
minCoordinates: 1,
|
|
7221
|
+
maxCoordinates: 1,
|
|
7222
|
+
geometry: "point",
|
|
7223
|
+
geometryTypes: ["Point"],
|
|
7224
|
+
drawRule: "Point1",
|
|
7225
|
+
params: [
|
|
7226
|
+
{
|
|
7227
|
+
key: "text",
|
|
7228
|
+
label: "Text",
|
|
7229
|
+
description: "The text to render. Explicit line breaks are honored; it never auto-wraps.",
|
|
7230
|
+
type: "text",
|
|
7231
|
+
placeholder: "Text",
|
|
7232
|
+
multiline: true
|
|
7233
|
+
},
|
|
7234
|
+
{
|
|
7235
|
+
key: "textAlign",
|
|
7236
|
+
label: "Alignment",
|
|
7237
|
+
description: "Placement of the text block relative to the anchor: left/right put the anchor at that edge, center centers it; lines justify the same way.",
|
|
7238
|
+
type: "enum",
|
|
7239
|
+
options: [
|
|
7240
|
+
{
|
|
7241
|
+
label: "Left",
|
|
7242
|
+
value: "left"
|
|
7243
|
+
},
|
|
7244
|
+
{
|
|
7245
|
+
label: "Center",
|
|
7246
|
+
value: "center"
|
|
7247
|
+
},
|
|
7248
|
+
{
|
|
7249
|
+
label: "Right",
|
|
7250
|
+
value: "right"
|
|
7251
|
+
}
|
|
7252
|
+
]
|
|
7253
|
+
},
|
|
7254
|
+
{
|
|
7255
|
+
key: "textStyle",
|
|
7256
|
+
label: "Style",
|
|
7257
|
+
description: "Typography preset.",
|
|
7258
|
+
type: "enum",
|
|
7259
|
+
options: [
|
|
7260
|
+
{
|
|
7261
|
+
label: "Regular",
|
|
7262
|
+
value: "regular"
|
|
7263
|
+
},
|
|
7264
|
+
{
|
|
7265
|
+
label: "Italic",
|
|
7266
|
+
value: "italic"
|
|
7267
|
+
},
|
|
7268
|
+
{
|
|
7269
|
+
label: "Light",
|
|
7270
|
+
value: "light"
|
|
7271
|
+
},
|
|
7272
|
+
{
|
|
7273
|
+
label: "Caps",
|
|
7274
|
+
value: "caps"
|
|
7275
|
+
}
|
|
7276
|
+
]
|
|
7277
|
+
},
|
|
7278
|
+
{
|
|
7279
|
+
key: "halo",
|
|
7280
|
+
label: "Halo",
|
|
7281
|
+
description: "Render a contrasting halo behind the text for legibility on busy backgrounds.",
|
|
7282
|
+
type: "boolean"
|
|
7283
|
+
},
|
|
7284
|
+
{
|
|
7285
|
+
key: "rotation",
|
|
7286
|
+
label: "Rotation",
|
|
7287
|
+
description: "Clockwise rotation in degrees.",
|
|
7288
|
+
type: "number",
|
|
7289
|
+
min: 0,
|
|
7290
|
+
max: 360,
|
|
7291
|
+
step: 1,
|
|
7292
|
+
unit: "°"
|
|
7293
|
+
},
|
|
7294
|
+
{
|
|
7295
|
+
key: "sizePixels",
|
|
7296
|
+
label: "Size",
|
|
7297
|
+
description: "Text height in screen pixels.",
|
|
7298
|
+
type: "number",
|
|
7299
|
+
min: 8,
|
|
7300
|
+
max: 200,
|
|
7301
|
+
step: 1,
|
|
7302
|
+
unit: "px"
|
|
7303
|
+
},
|
|
7304
|
+
{
|
|
7305
|
+
key: "maxSizePixels",
|
|
7306
|
+
label: "Max size",
|
|
7307
|
+
description: "Hide the text once its on-screen size exceeds this.",
|
|
7308
|
+
type: "number",
|
|
7309
|
+
min: 8,
|
|
7310
|
+
max: 400,
|
|
7311
|
+
step: 1,
|
|
7312
|
+
unit: "px"
|
|
7313
|
+
}
|
|
7314
|
+
]
|
|
7315
|
+
};
|
|
7316
|
+
function createGenericText(coordinates, options = {}) {
|
|
7317
|
+
const merged = {
|
|
7318
|
+
...DEFAULT_GENERIC_TEXT_OPTIONS,
|
|
7319
|
+
...options
|
|
7320
|
+
};
|
|
7321
|
+
const text = merged.text ?? "";
|
|
7322
|
+
if (text.trim().length === 0) return {
|
|
7323
|
+
type: "FeatureCollection",
|
|
7324
|
+
features: []
|
|
7325
|
+
};
|
|
7326
|
+
const anchor = coordinates[0];
|
|
7327
|
+
const rotation = normalizeRadians(Math.PI - (merged.rotation ?? 0) * Math.PI / 180);
|
|
7328
|
+
const sizeProps = options.sizePixels !== void 0 ? { textSizePixels: options.sizePixels } : options.sizeMeters !== void 0 ? { textSizeMeters: options.sizeMeters } : merged.sizePixels !== void 0 ? { textSizePixels: merged.sizePixels } : {};
|
|
7329
|
+
const textAlign = merged.textAlign ?? "center";
|
|
7330
|
+
const textAnchor = textAlign === "left" ? "start" : textAlign === "right" ? "end" : void 0;
|
|
7331
|
+
return {
|
|
7332
|
+
type: "FeatureCollection",
|
|
7333
|
+
features: [{
|
|
7334
|
+
type: "Feature",
|
|
7335
|
+
properties: {
|
|
7336
|
+
part: "text",
|
|
7337
|
+
labelPlacement: false,
|
|
7338
|
+
text,
|
|
7339
|
+
rotation,
|
|
7340
|
+
textJustify: textAlign,
|
|
7341
|
+
...textAnchor !== void 0 ? { textAnchor } : {},
|
|
7342
|
+
textStyle: merged.textStyle ?? "regular",
|
|
7343
|
+
...merged.maxSizePixels !== void 0 ? { textMaxSizePixels: merged.maxSizePixels } : {},
|
|
7344
|
+
...merged.halo === true ? { textHalo: true } : {},
|
|
7345
|
+
...sizeProps
|
|
7346
|
+
},
|
|
7347
|
+
geometry: {
|
|
7348
|
+
type: "Point",
|
|
7349
|
+
coordinates: anchor
|
|
7350
|
+
}
|
|
7351
|
+
}]
|
|
7352
|
+
};
|
|
7353
|
+
}
|
|
7354
|
+
const GENERIC_TEXT = defineControlMeasure({
|
|
7355
|
+
metadata: GENERIC_TEXT_METADATA,
|
|
7356
|
+
generator: createGenericText,
|
|
7357
|
+
defaultOptions: DEFAULT_GENERIC_TEXT_OPTIONS,
|
|
7358
|
+
rule: pointDrawRule,
|
|
7359
|
+
transformOptions(options, { scale, rotationRadians }) {
|
|
7360
|
+
const patch = {};
|
|
7361
|
+
if (rotationRadians !== 0) patch.rotation = normalizeDegrees((options.rotation ?? DEFAULT_GENERIC_TEXT_OPTIONS.rotation ?? 0) + rotationRadians * 180 / Math.PI);
|
|
7362
|
+
if (scale !== 1 && Number.isFinite(scale) && scale > 0) {
|
|
7363
|
+
if (options.sizePixels !== void 0) patch.sizePixels = options.sizePixels * scale;
|
|
7364
|
+
else if (options.sizeMeters !== void 0) patch.sizeMeters = options.sizeMeters * scale;
|
|
7365
|
+
}
|
|
7366
|
+
return Object.keys(patch).length > 0 ? patch : void 0;
|
|
7367
|
+
},
|
|
7368
|
+
previewSample: {
|
|
7369
|
+
controlPoints: [[0, 0]],
|
|
7370
|
+
options: {
|
|
7371
|
+
text: "Text",
|
|
7372
|
+
sizePixels: void 0,
|
|
7373
|
+
sizeMeters: 500
|
|
7374
|
+
}
|
|
7375
|
+
}
|
|
7376
|
+
});
|
|
7377
|
+
//#endregion
|
|
7180
7378
|
//#region src/generators/cm34-mission-tasks/clear.ts
|
|
7181
7379
|
/**
|
|
7182
7380
|
* Default options for the CLEAR symbol.
|
|
@@ -11389,6 +11587,7 @@ const DEFINITIONS = {
|
|
|
11389
11587
|
polygon: GENERIC_POLYGON,
|
|
11390
11588
|
rectangle: GENERIC_RECTANGLE,
|
|
11391
11589
|
circle: GENERIC_CIRCLE,
|
|
11590
|
+
text: GENERIC_TEXT,
|
|
11392
11591
|
"airborne-attack": AIRBORNE_ATTACK,
|
|
11393
11592
|
"attack-helicopter": ATTACK_HELICOPTER,
|
|
11394
11593
|
"support-by-fire": SUPPORT_BY_FIRE,
|
|
@@ -11473,6 +11672,45 @@ function getDefaultOptions(kind) {
|
|
|
11473
11672
|
return structuredClone(DEFINITIONS[kind].defaultOptions);
|
|
11474
11673
|
}
|
|
11475
11674
|
//#endregion
|
|
11675
|
+
//#region src/internal/halo-color.ts
|
|
11676
|
+
/**
|
|
11677
|
+
* Contrast-aware halo color for `textHalo` (felt.com-style): the halo must
|
|
11678
|
+
* read against the resolved text color, not just against the basemap, so a
|
|
11679
|
+
* dark label gets a white halo and a light label gets a near-black one.
|
|
11680
|
+
*
|
|
11681
|
+
* Parses `#rgb`, `#rrggbb` (case-insensitive), and `rgb()`/`rgba()` strings;
|
|
11682
|
+
* relative luminance (0.2126R + 0.7152G + 0.0722B over 0-1 channels) below
|
|
11683
|
+
* 0.5 is "dark" → white halo, else "light" → `#1a1a1a` (near-black reads
|
|
11684
|
+
* better than pure black over imagery). Unparseable input defaults to white,
|
|
11685
|
+
* matching the common case of dark text on a busy background.
|
|
11686
|
+
*/
|
|
11687
|
+
function contrastingHaloColor(color) {
|
|
11688
|
+
const rgb = parseColor(color);
|
|
11689
|
+
if (!rgb) return "#ffffff";
|
|
11690
|
+
return .2126 * (rgb.r / 255) + .7152 * (rgb.g / 255) + .0722 * (rgb.b / 255) < .5 ? "#ffffff" : "#1a1a1a";
|
|
11691
|
+
}
|
|
11692
|
+
function parseColor(color) {
|
|
11693
|
+
const trimmed = color.trim();
|
|
11694
|
+
const hexShort = /^#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(trimmed);
|
|
11695
|
+
if (hexShort) return {
|
|
11696
|
+
r: parseInt(hexShort[1] + hexShort[1], 16),
|
|
11697
|
+
g: parseInt(hexShort[2] + hexShort[2], 16),
|
|
11698
|
+
b: parseInt(hexShort[3] + hexShort[3], 16)
|
|
11699
|
+
};
|
|
11700
|
+
const hexLong = /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(trimmed);
|
|
11701
|
+
if (hexLong) return {
|
|
11702
|
+
r: parseInt(hexLong[1], 16),
|
|
11703
|
+
g: parseInt(hexLong[2], 16),
|
|
11704
|
+
b: parseInt(hexLong[3], 16)
|
|
11705
|
+
};
|
|
11706
|
+
const rgbFn = /^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*(?:,\s*[\d.]+\s*)?\)$/i.exec(trimmed);
|
|
11707
|
+
if (rgbFn) return {
|
|
11708
|
+
r: Number(rgbFn[1]),
|
|
11709
|
+
g: Number(rgbFn[2]),
|
|
11710
|
+
b: Number(rgbFn[3])
|
|
11711
|
+
};
|
|
11712
|
+
}
|
|
11713
|
+
//#endregion
|
|
11476
11714
|
//#region src/styleResolver.ts
|
|
11477
11715
|
/**
|
|
11478
11716
|
* Three-layer style precedence for `renderControlMeasure`.
|
|
@@ -11618,6 +11856,11 @@ function normalizeFeature(id, feature, index, generatedLabelOrdinal, measureStyl
|
|
|
11618
11856
|
const textSizeMeters = typeof sourceProps.textSizeMeters === "number" ? sourceProps.textSizeMeters : void 0;
|
|
11619
11857
|
const textAnchor = sourceProps.textAnchor === "start" || sourceProps.textAnchor === "end" ? sourceProps.textAnchor : void 0;
|
|
11620
11858
|
const textBackground = sourceProps.textBackground === true ? true : void 0;
|
|
11859
|
+
const textHalo = sourceProps.textHalo === true ? true : void 0;
|
|
11860
|
+
const textHaloColor = textHalo ? contrastingHaloColor(style.strokeColor ?? "#000") : void 0;
|
|
11861
|
+
const textJustify = sourceProps.textJustify === "left" || sourceProps.textJustify === "center" || sourceProps.textJustify === "right" ? sourceProps.textJustify : void 0;
|
|
11862
|
+
const textStyle = sourceProps.textStyle === "regular" || sourceProps.textStyle === "italic" || sourceProps.textStyle === "light" || sourceProps.textStyle === "caps" ? sourceProps.textStyle : void 0;
|
|
11863
|
+
const textMaxSizePixels = typeof sourceProps.textMaxSizePixels === "number" ? sourceProps.textMaxSizePixels : void 0;
|
|
11621
11864
|
const amplifierField = typeof sourceProps.amplifierField === "string" ? canonicalTextAmplifierKey(sourceProps.amplifierField) : void 0;
|
|
11622
11865
|
const labelPlacementKey = resolveLabelPlacementKey(sourceProps, amplifierField, text, feature.geometry.type, part, generatedLabelOrdinal);
|
|
11623
11866
|
const resolvedPlacement = labelPlacementKey ? resolveAmplifierPlacement(amplifierPlacements?.[labelPlacementKey]) : void 0;
|
|
@@ -11637,10 +11880,15 @@ function normalizeFeature(id, feature, index, generatedLabelOrdinal, measureStyl
|
|
|
11637
11880
|
...resolvedRotation !== void 0 ? { rotation: resolvedRotation } : {},
|
|
11638
11881
|
...textAnchor !== void 0 ? { textAnchor } : {},
|
|
11639
11882
|
...textBackground !== void 0 ? { textBackground } : {},
|
|
11883
|
+
...textHalo !== void 0 ? { textHalo } : {},
|
|
11884
|
+
...textHaloColor !== void 0 ? { textHaloColor } : {},
|
|
11640
11885
|
...amplifierField !== void 0 ? { amplifierField } : {},
|
|
11641
11886
|
...labelPlacementKey !== void 0 ? { labelPlacementKey } : {},
|
|
11642
11887
|
...textSizePixels !== void 0 ? { textSizePixels } : {},
|
|
11643
|
-
...textSizeMeters !== void 0 ? { textSizeMeters } : {}
|
|
11888
|
+
...textSizeMeters !== void 0 ? { textSizeMeters } : {},
|
|
11889
|
+
...textJustify !== void 0 ? { textJustify } : {},
|
|
11890
|
+
...textStyle !== void 0 ? { textStyle } : {},
|
|
11891
|
+
...textMaxSizePixels !== void 0 ? { textMaxSizePixels } : {}
|
|
11644
11892
|
},
|
|
11645
11893
|
geometry
|
|
11646
11894
|
};
|
|
@@ -11691,4 +11939,4 @@ function assertNever(value) {
|
|
|
11691
11939
|
throw new Error(`Unhandled control measure kind: ${String(value)}`);
|
|
11692
11940
|
}
|
|
11693
11941
|
//#endregion
|
|
11694
|
-
export {
|
|
11942
|
+
export { DEFAULT_BOUNDARY_OPTIONS as $, DEFAULT_FLOT_OPTIONS as A, centerRadiusDrawRule as At, DEFAULT_GENERIC_TEXT_OPTIONS as B, computeInitialWidthPoint as Bt, DEFAULT_SCREEN_OPTIONS as C, line24DrawRule as Ct, DEFAULT_BATTLE_HANDOVER_LINE_OPTIONS as D, ambushDrawRule as Dt, DEFAULT_FORTIFIED_LINE_OPTIONS as E, line1DrawRule as Et, DEFAULT_GUARD_OPTIONS as F, getMidpointPerpendicularSignedDistance as Ft, DEFAULT_CLASSIC_ARROW_OPTIONS as G, getMetersPerPixel as Gt, DEFAULT_GENERIC_POLYGON_OPTIONS as H, project as Ht, DEFAULT_DELAY_OPTIONS as I, pointOnMidpointPerpendicularAxis as It, DEFAULT_BREACH_OPTIONS as J, DEFAULT_CANALIZE_OPTIONS as K, roundToFixed as Kt, DEFAULT_COVER_OPTIONS as L, snapToMidpointPerpendicular as Lt, DEFAULT_FINAL_PROTECTIVE_FIRE_OPTIONS as M, blockDrawRule as Mt, DEFAULT_ENCIRCLEMENT_OPTIONS as N, computeDefaultMidpointPerpendicularPoint as Nt, DEFAULT_HANDOVER_LINE_OPTIONS as O, attackByFireDrawRule as Ot, DEFAULT_DISRUPT_OPTIONS as P, createMidpointPerpendicularDrawRule as Pt, DEFAULT_LIGHT_LINE_OPTIONS as Q, DEFAULT_TACTICAL_ARROW_OPTIONS as R, createBaselineFrame as Rt, DEFAULT_JOINT_TACTICAL_ACTION_AREA_OPTIONS as S, line26DrawRule as St, DEFAULT_FORTIFIED_AREA_OPTIONS as T, turnDrawRule as Tt, DEFAULT_GENERIC_LINE_OPTIONS as U, unproject as Ut, DEFAULT_GENERIC_RECTANGLE_OPTIONS as V, haversineDistance as Vt, DEFAULT_GENERIC_CIRCLE_OPTIONS as W, EPSILON as Wt, DEFAULT_GENERIC_C2_LINE_OPTIONS as X, DEFAULT_BLOCK_MISSION_TASK_OPTIONS as Y, DEFAULT_ENGINEER_WORK_LINE_OPTIONS as Z, DEFAULT_OBSTACLE_BYPASS_IMPOSSIBLE_OPTIONS as _, DEFAULT_AMBUSH_OPTIONS as _t, DEFINITIONS as a, DEFAULT_ANTITANK_WALL_OPTIONS as at, DEFAULT_MAIN_ATTACK_OPTIONS as b, axis1DrawRule as bt, getDefaultOptions as c, DEFAULT_AREA_OF_OPERATIONS_OPTIONS as ct, DEFAULT_TURN_OPTIONS as d, canonicalTextAmplifierKey as dt, DEFAULT_BLOCK_ARROW_OPTIONS as et, DEFAULT_SUPPORTING_ATTACK_OPTIONS as f, normalizeTextAmplifiers as ft, DEFAULT_PICKUP_ZONE_OPTIONS as g, DEFAULT_DIRECTION_OF_ATTACK_AVIATION_OPTIONS as gt, DEFAULT_PRINCIPAL_DIRECTION_OF_FIRE_OPTIONS as h, DEFAULT_DIRECTION_OF_MAIN_ATTACK_OPTIONS as ht, CONTROL_MEASURE_METADATA as i, DEFAULT_ATTACK_BY_FIRE_OPTIONS as it, DEFAULT_FIX_OPTIONS as j, disruptDrawRule as jt, DEFAULT_PHASE_LINE_OPTIONS as k, point12DrawRule as kt, listControlMeasureMetadata as l, DEFAULT_AREA_DEFENSE_OPTIONS as lt, DEFAULT_STRONG_POINT_OPTIONS as m, DEFAULT_DIRECTION_OF_SUPPORTING_ATTACK_OPTIONS as mt, resolveStyleHints as n, DEFAULT_BATTLE_POSITION_OPTIONS as nt, getControlMeasureMetadata as o, DEFAULT_ANTITANK_DITCH_OPTIONS as ot, DEFAULT_SUPPORT_BY_FIRE_OPTIONS as p, resolveAmplifierPlacement as pt, DEFAULT_BYPASS_OPTIONS as q, CONTROL_MEASURE_IDS as r, DEFAULT_ATTACK_HELICOPTER_OPTIONS as rt, getControlMeasureMetadataByValue as s, DEFAULT_ASSEMBLY_AREA_OPTIONS as st, renderControlMeasure as t, DEFAULT_BLOCK_OPTIONS as tt, DEFAULT_TURNING_MOVEMENT_OPTIONS as u, TEXT_AMPLIFIER_FIELDS as ut, DEFAULT_OBSTACLE_BYPASS_EASY_OPTIONS as v, DEFAULT_AIRBORNE_ATTACK_OPTIONS as vt, DEFAULT_FRONTAL_ATTACK_OPTIONS as w, line23DrawRule as wt, DEFAULT_LANDING_ZONE_OPTIONS as x, supportByFireDrawRule as xt, DEFAULT_OBSTACLE_BYPASS_DIFFICULT_OPTIONS as y, rectangleDrawRule as yt, DEFAULT_CLEAR_OPTIONS as z, calculateMetrics as zt };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orbat-mapper/control-measures",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.25",
|
|
4
4
|
"description": "Library for drawing tactical graphics and control measures according to MIL-STD-2525 and APP-6 standards.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Orbat Mapper",
|