@linkurious/ogma-annotations 1.1.22 → 1.1.24

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.
@@ -10,6 +10,7 @@ import { Options } from '@linkurious/ogma';
10
10
  import { Overlay } from '@linkurious/ogma';
11
11
  import { Point as Point_2 } from '@linkurious/ogma';
12
12
  import { Polygon } from 'geojson';
13
+ import { Position } from 'geojson';
13
14
  import { SVGLayer } from '@linkurious/ogma';
14
15
 
15
16
  export declare type Annotation = Arrow | Text_2;
@@ -82,7 +83,14 @@ export declare interface ArrowStyles extends StrokeOptions {
82
83
  head?: Extremity;
83
84
  }
84
85
 
85
- declare type Bounds = [number, number, number, number];
86
+ /**
87
+ * Bounding box object, with the following properties:
88
+ * - [0]: min x
89
+ * - [1]: min y
90
+ * - [2]: max x
91
+ * - [3]: max y
92
+ */
93
+ export declare type Bounds = [number, number, number, number];
86
94
 
87
95
  export declare function clientToContainerPosition(evt: {
88
96
  clientX: number;
@@ -188,7 +196,6 @@ export declare class Control extends default_2<FeatureEvents> {
188
196
  updateStyle<A extends Annotation>(id: Id, style: A["properties"]["style"]): this;
189
197
  setScale(id: Id, scale: number, ox: number, oy: number): this;
190
198
  /**
191
- *
192
199
  * @returns the annotations in the controller
193
200
  */
194
201
  getAnnotations(): AnnotationCollection;
@@ -441,6 +448,10 @@ export declare type FeatureEvents = {
441
448
  [EVT_DRAG_END]: (evt: Arrow | Text_2) => void;
442
449
  };
443
450
 
451
+ /**
452
+ * Calculate the bounds of a collection of annotations
453
+ * @param annotations
454
+ */
444
455
  export declare function getAnnotationsBounds(annotations: AnnotationCollection): Bounds;
445
456
 
446
457
  export declare function getArrowEnd(a: Arrow): {
@@ -474,6 +485,8 @@ export declare function getAttachmentPointOnNode(start: Point_2, nodeCenter: Poi
474
485
  y: number;
475
486
  };
476
487
 
488
+ export declare function getCoordinates(gj: Feature | FeatureCollection | Geometry): Position[];
489
+
477
490
  export declare const getHandleId: (handle: HTMLDivElement) => number;
478
491
 
479
492
  export declare function getTextBbox(t: Text_2): BBox;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@linkurious/ogma-annotations",
3
- "version": "1.1.22",
3
+ "version": "1.1.24",
4
4
  "description": "Headless annotation plugin for Ogma",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",
@@ -15,10 +15,10 @@
15
15
  ],
16
16
  "exports": {
17
17
  ".": {
18
+ "types": "./dist/types/index.d.ts",
18
19
  "import": "./dist/index.mjs",
19
20
  "require": "./dist/index.js",
20
- "default": "./dist/index.mjs",
21
- "types": "./dist/types/index.d.ts"
21
+ "default": "./dist/index.mjs"
22
22
  },
23
23
  "./style.css": {
24
24
  "import": "./dist/ogma-annotations.css",
@@ -84,9 +84,9 @@
84
84
  "typedoc": "^0.25.13",
85
85
  "typedoc-plugin-markdown": "^3.17.1",
86
86
  "typescript": "5.3.3",
87
- "vite": "6.2.0",
87
+ "vite": "latest",
88
88
  "vite-plugin-dts": "^4.1.0",
89
- "vitest": "3.0.7"
89
+ "vitest": "latest"
90
90
  },
91
91
  "eslintConfig": {
92
92
  "extends": [