@orbat-mapper/tactical-draw 0.28.1 → 0.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.mjs +10 -6
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -5399,12 +5399,16 @@ function runEdit(opts) {
5399
5399
  }]);
5400
5400
  }
5401
5401
  /** Live view scale for option handles behind pixel-authored sizes. */
5402
- /** The live view state for option handles; `modifier` adds the press's modifier-drag key. */
5403
- function optionHandleContext(modifier = false) {
5402
+ function optionHandleContext() {
5404
5403
  const resolution = adapter.getResolution();
5404
+ return hasUsableResolution(resolution) ? { constructionMetersPerCssPixel: resolution } : {};
5405
+ }
5406
+ /** A drag or reset's context: the view scale, the press's modifier-drag key, the selected parts. */
5407
+ function optionHandleGesture(modifier) {
5405
5408
  return {
5406
- ...hasUsableResolution(resolution) ? { constructionMetersPerCssPixel: resolution } : {},
5407
- ...modifier ? { modifier: true } : {}
5409
+ ...optionHandleContext(),
5410
+ ...modifier ? { modifier: true } : {},
5411
+ ...parts.selected !== void 0 ? { parts: parts.parts } : {}
5408
5412
  };
5409
5413
  }
5410
5414
  function buildCurrentHandleSet() {
@@ -6006,7 +6010,7 @@ function runEdit(opts) {
6006
6010
  if (frame.part !== void 0) parts.select(frame.part);
6007
6011
  }
6008
6012
  function optionsForOptionHandle(position, drag) {
6009
- const patch = dragControlMeasureOptionHandle(measure.kind, workingPoints, drag.preDragOptions, drag.handleId, position, optionHandleContext(drag.modifier));
6013
+ const patch = dragControlMeasureOptionHandle(measure.kind, workingPoints, drag.preDragOptions, drag.handleId, position, optionHandleGesture(drag.modifier));
6010
6014
  return patch ? {
6011
6015
  ...drag.preDragOptions ?? {},
6012
6016
  ...patch
@@ -6196,7 +6200,7 @@ function runEdit(opts) {
6196
6200
  }
6197
6201
  const optionModifier = hit.kind === "option" && modifierHeld(info, keys().modifierDrag);
6198
6202
  if (hit.kind === "option" && hit.optionId && deleteOrReset) {
6199
- const patch = resetControlMeasureOptionHandle(measure.kind, workingPoints, workingOptions, hit.optionId, optionHandleContext(optionModifier));
6203
+ const patch = resetControlMeasureOptionHandle(measure.kind, workingPoints, workingOptions, hit.optionId, optionHandleGesture(optionModifier));
6200
6204
  if (patch) {
6201
6205
  setOptions(patch, "gesture", "Reset option handle");
6202
6206
  shell.suppressNextClickAway();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orbat-mapper/tactical-draw",
3
- "version": "0.28.1",
3
+ "version": "0.29.0",
4
4
  "description": "Engine-agnostic draw/edit core for tactical control measures (MIL-STD-2525 / APP-6). The MapAdapter ABI and bring-your-own-engine entry point for the tactical-draw package family.",
5
5
  "license": "MIT",
6
6
  "author": "Orbat Mapper",
@@ -39,7 +39,7 @@
39
39
  "access": "public"
40
40
  },
41
41
  "dependencies": {
42
- "@orbat-mapper/control-measures": "^0.43.0"
42
+ "@orbat-mapper/control-measures": "^0.44.0"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "vitest": ">=4.0.0"