@zwishing/emap 0.3.0 → 0.3.2

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.
@@ -1,5 +1,6 @@
1
1
  import type { Control } from './control';
2
2
  import type { Emap } from '../map/map';
3
+ import type { ModifierCombo } from '../core/handlers/select-mode';
3
4
  export type { BoxSelectStyle } from '../core/handlers/box-select';
4
5
  import type { BoxSelectStyle } from '../core/handlers/box-select';
5
6
  export interface BoxSelectControlOptions {
@@ -15,17 +16,22 @@ export interface BoxSelectControlOptions {
15
16
  * Default `4`.
16
17
  */
17
18
  dragThreshold?: number;
19
+ /**
20
+ * Modifier combo required to start dragging. Default `'none'`, so an active
21
+ * box-select tool starts with a plain left-drag.
22
+ */
23
+ dragActivator?: ModifierCombo;
18
24
  }
19
25
  /**
20
26
  * Thin shell over the `map.boxSelect` handler (DX P2c). The handler owns
21
- * the shift+drag gesture, the `.emap-box-select` rubber-band overlay,
27
+ * the drag gesture, the `.emap-box-select` rubber-band overlay,
22
28
  * hit-testing, and selection; this control just forwards options and
23
29
  * proxies enable/disable, returning a 0×0 anchor for `addControl`
24
30
  * placement. Public class, options, anchor DOM, and selection behaviour
25
31
  * are unchanged from the pre-P2c control.
26
32
  *
27
- * Modifier conventions (on top of shift): shift→`replace`,
28
- * shift+ctrl/meta→`add`, shift+alt→`toggle`. Mutually exclusive with
33
+ * Modifier conventions: plain drag→`replace`, shift→`add`,
34
+ * shift+alt→`toggle`. Mutually exclusive with
29
35
  * lasso-select — `onAdd` propagates the handler's throw if `lassoSelect`
30
36
  * is already enabled.
31
37
  */
@@ -14,4 +14,6 @@ export declare class DrawFeatureControl implements Control {
14
14
  onAdd(map: Emap): HTMLElement;
15
15
  onRemove(): void;
16
16
  private _toggle;
17
+ private _applyOptions;
18
+ private _clearPeerActiveButtons;
17
19
  }
@@ -1,6 +1,8 @@
1
1
  import { Control } from './control';
2
2
  import { Emap } from '../map/map';
3
3
  export interface EditToolbarOptions {
4
+ /** Explicit controls to render. When provided, default edit/draw buttons are not added. */
5
+ controls?: Control[];
4
6
  /** Source ID for draw tools. If not provided, draw buttons are not shown. */
5
7
  drawSource?: string;
6
8
  /** Source layer name for draw tools (optional, defaults to first matching layer). */
@@ -15,11 +17,13 @@ export interface EditToolbarOptions {
15
17
  *
16
18
  * // With draw tools
17
19
  * map.addControl(new EditToolbar({ drawSource: 'my-source' }), 'top-left');
20
+ *
21
+ * // Custom composition
22
+ * map.addControl(new EditToolbar({ controls: [new VertexEditControl()] }), 'top-left');
18
23
  */
19
24
  export declare class EditToolbar implements Control {
20
25
  private _container;
21
- private _vertexEditControl;
22
- private _drawControls;
26
+ private _controls;
23
27
  private _options;
24
28
  constructor(options?: EditToolbarOptions);
25
29
  onAdd(map: Emap): HTMLElement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zwishing/emap",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "A modern, decoupled rendering engine for mapshaper data",
5
5
  "main": "dist/emap.mjs",
6
6
  "module": "dist/emap.mjs",
@@ -98,6 +98,6 @@
98
98
  "kdbush": "^4.0.2",
99
99
  "maplibre-gl": "^5.17.0",
100
100
  "mapshaper": "^0.6.113",
101
- "mproj": "^0.0.40"
101
+ "mproj": "^0.1.2"
102
102
  }
103
103
  }