@linkurious/ogma-annotations 1.0.5

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.
@@ -0,0 +1,104 @@
1
+ import Ogma from '@linkurious/ogma';
2
+ import EventEmitter from 'eventemitter3';
3
+ import { Annotation, AnnotationCollection, Arrow, ControllerOptions, FeatureEvents, Id, Text } from './types';
4
+ export declare class Control extends EventEmitter<FeatureEvents> {
5
+ private arrows;
6
+ private texts;
7
+ private links;
8
+ private layer;
9
+ private annotations;
10
+ private ogma;
11
+ private options;
12
+ private selected;
13
+ private updateTimeout;
14
+ private hoveredNode;
15
+ private dragged;
16
+ private textToMagnet;
17
+ private activeLinks;
18
+ constructor(ogma: Ogma, options?: Partial<ControllerOptions>);
19
+ private _render;
20
+ private _onFeatureDrag;
21
+ private _onFeatureDragEnd;
22
+ private _onFeatureDragStart;
23
+ private _onNodesDragStart;
24
+ private _onNodesDrag;
25
+ private _moveNodes;
26
+ private _snapToText;
27
+ private _findAndSnapToNode;
28
+ private _snapToNode;
29
+ private _onAdded;
30
+ private _onRemoved;
31
+ private _onUnselect;
32
+ private _onSelect;
33
+ /**
34
+ * @returns the currently selected annotation
35
+ */
36
+ getSelected(): Annotation | null;
37
+ private findMagnetPoint;
38
+ /**
39
+ * Set the options for the controller
40
+ * @param options new Options
41
+ * @returns the updated options
42
+ */
43
+ setOptions(options?: Partial<ControllerOptions>): ControllerOptions;
44
+ /**
45
+ * Selects the annotation with the given id
46
+ * @param id the id of the annotation to select
47
+ */
48
+ select(id: Id): this;
49
+ /**
50
+ * Unselects the currently selected annotation
51
+ */
52
+ unselect(): this;
53
+ /**
54
+ * Add an annotation to the controller
55
+ * @param annotation The annotation to add
56
+ */
57
+ add(annotation: Arrow | Text | AnnotationCollection): this;
58
+ private loadLink;
59
+ /**
60
+ * Start adding an arrow (add it, and give control to the user)
61
+ * @param x coord of the first point
62
+ * @param y coord of the first point
63
+ * @param arrow The arrow to add
64
+ */
65
+ startArrow(x: number, y: number, arrow?: Arrow): void;
66
+ /**
67
+ * Start adding a text (add it, and give control to the user)
68
+ * @param x coord of the top left point
69
+ * @param y coord of the top left point
70
+ * @param text The text to add
71
+ */
72
+ startText(x: number, y: number, text?: Text): void;
73
+ /**
74
+ * Cancel drawing on the current frame
75
+ */
76
+ cancelDrawing(): void;
77
+ /**
78
+ * Triggers the update event on the annotation
79
+ * @param annotation The annotation updated
80
+ */
81
+ onUpdate: (annotation: Annotation) => void;
82
+ private _onUpdate;
83
+ /**
84
+ * Update the style of the annotation with the given id
85
+ * @param id The id of the annotation to update
86
+ * @param style The new style
87
+ */
88
+ updateStyle<A extends Annotation>(id: Id, style: A['properties']['style']): this;
89
+ /**
90
+ *
91
+ * @returns the annotations in the controller
92
+ */
93
+ getAnnotations(): AnnotationCollection;
94
+ /**
95
+ * Retrieve the annotation with the given id
96
+ * @param id the id of the annotation to get
97
+ * @returns The annotation with the given id
98
+ */
99
+ getAnnotation(id: Id): Arrow | Text | undefined;
100
+ /**
101
+ * Destroy the controller and its elements
102
+ */
103
+ destroy(): void;
104
+ }
@@ -0,0 +1,10 @@
1
+ import { Arrow, ArrowStyles } from '../../types';
2
+ export declare const defaultStyle: ArrowStyles;
3
+ export declare const defaultOptions: Arrow;
4
+ export declare const createArrow: (x0?: number, y0?: number, x1?: number, y1?: number, styles?: {
5
+ tail?: import("../../types").Extremity | undefined;
6
+ head?: import("../../types").Extremity | undefined;
7
+ strokeType?: "none" | "plain" | "dashed" | undefined;
8
+ strokeColor?: string | undefined;
9
+ strokeWidth?: number | undefined;
10
+ }) => Arrow;
@@ -0,0 +1,38 @@
1
+ import Ogma, { Point } from '@linkurious/ogma';
2
+ import { createArrow, defaultOptions, defaultStyle } from './defaults';
3
+ import { Arrow, ControllerOptions } from '../../types';
4
+ import Editor from '../base';
5
+ /**
6
+ * @class Arrows
7
+ * Draw and edit arrows
8
+ */
9
+ export declare class Arrows extends Editor<Arrow> {
10
+ private draggedHandle;
11
+ private start;
12
+ private end;
13
+ private arrow;
14
+ private startX;
15
+ private startY;
16
+ private minArrowHeight;
17
+ private maxArrowHeight;
18
+ private handles;
19
+ constructor(ogma: Ogma, options?: Pick<Partial<ControllerOptions>, 'arrowHandleSize' | 'maxArrowHeight' | 'minArrowHeight'>);
20
+ private onHandleMouseDown;
21
+ /**
22
+ * Start drawing a new arrow, it will also be added as a new annotation
23
+ * @param x
24
+ * @param y
25
+ * @param arrow
26
+ */
27
+ startDrawing(x: number, y: number, arrow?: Arrow): void;
28
+ cancelDrawing(): void;
29
+ private startDragging;
30
+ private onMouseUp;
31
+ private onMouseMove;
32
+ detect(point: Point, margin?: number): Arrow | undefined;
33
+ refreshEditor(): void;
34
+ getDefaultOptions(): Arrow;
35
+ draw(svg: SVGSVGElement): void;
36
+ destroy(): void;
37
+ }
38
+ export { defaultOptions as defaultArrowOptions, defaultStyle as defaultArrowStyle, createArrow };
@@ -0,0 +1,13 @@
1
+ import { Arrow, ArrowStyles } from '../../types';
2
+ /**
3
+ * @function getArrowHeight
4
+ * @param arrow The arrow to measure
5
+ * @returns The height of the bounding box of the arrow
6
+ */
7
+ export declare function getArrowHeight(arrow: Arrow, min?: number, max?: number): number;
8
+ /**
9
+ * @function draw
10
+ * @param arrow The arrow to draw
11
+ * @param g the group in which to draw
12
+ */
13
+ export default function draw(arrow: Arrow, g: SVGGElement, defaultStyle: ArrowStyles, minArrowHeight: number, maxArrowHeight: number): void;
@@ -0,0 +1,5 @@
1
+ import { AnnotationOptions, Text, TextStyle } from '../../types';
2
+ export declare const defaultStyle: TextStyle;
3
+ export declare const defaultOptions: Text;
4
+ export declare const defaultControllerOptions: AnnotationOptions;
5
+ export declare const createText: (x?: number, y?: number, width?: number, height?: number, content?: string, styles?: Partial<TextStyle>) => Text;
@@ -0,0 +1,40 @@
1
+ import Ogma, { Point } from '@linkurious/ogma';
2
+ import { createText, defaultControllerOptions, defaultOptions, defaultStyle } from './defaults';
3
+ import { ControllerOptions, Id, Text } from '../../types';
4
+ import Editor from '../base';
5
+ /**
6
+ * @class Texts
7
+ * Draw, update, edit texts
8
+ */
9
+ export declare class Texts extends Editor<Text> {
10
+ private textArea;
11
+ private handleSize;
12
+ private rect;
13
+ private annotation;
14
+ private startX;
15
+ private startY;
16
+ private handles;
17
+ private draggedHandle;
18
+ private isFocused;
19
+ private placeholder;
20
+ constructor(ogma: Ogma, options?: Pick<Partial<ControllerOptions>, 'textHandleSize' | 'textPlaceholder'>);
21
+ private _onFocus;
22
+ private _onBlur;
23
+ protected _canRemove(): boolean;
24
+ startDrawing: (x: number, y: number, text?: Text) => void;
25
+ cancelDrawing: () => void;
26
+ private startDragging;
27
+ private onHandleMouseDown;
28
+ private onMouseMove;
29
+ private _onMouseMove;
30
+ private onMouseUp;
31
+ private onViewChanged;
32
+ private _onInput;
33
+ detect({ x, y }: Point, margin?: number): Text | undefined;
34
+ draw(svg: SVGSVGElement): void;
35
+ getDefaultOptions(): Text;
36
+ refreshEditor(): void;
37
+ select(id: Id): void;
38
+ destroy(): void;
39
+ }
40
+ export { defaultOptions as defaultTextOptions, defaultStyle as defaultTextStyle, defaultControllerOptions, createText };
@@ -0,0 +1,7 @@
1
+ import { Text } from '../../types';
2
+ /**
3
+ * @function draw
4
+ * @param annotation the annotation to draw
5
+ * @param g the group in which the text should be drawn
6
+ */
7
+ export default function draw(annotation: Text, g: SVGGElement): void;
@@ -0,0 +1,81 @@
1
+ import Ogma, { Options, Overlay, Point, SVGLayer } from '@linkurious/ogma';
2
+ import eventEmmitter from 'eventemitter3';
3
+ import { Annotation, Events, Id } from '../types';
4
+ /**
5
+ * @class Annotations
6
+ * Abstract class to display Texts and Arrows, provide add/remove/update and mouse events
7
+ * Modifying annotation is handled by the child classes, it is too specific
8
+ */
9
+ export default abstract class Editor<T extends Annotation> extends eventEmmitter<Events<T>> {
10
+ protected ogma: Ogma;
11
+ protected elements: T[];
12
+ protected layer: SVGLayer;
13
+ protected editor: Overlay;
14
+ protected selectedId: Id;
15
+ protected hoveredId: Id;
16
+ protected ogmaOptions: Options;
17
+ protected shouldDetect: boolean;
18
+ protected isDragging: boolean;
19
+ constructor(ogma: Ogma, editorHtml: string);
20
+ private _onKeyUp;
21
+ protected _canRemove(): boolean;
22
+ private _onClickMouseMove;
23
+ /**
24
+ * @method add
25
+ * @param options Params for the annotation (merged with default)
26
+ * @returns the added annotation
27
+ */
28
+ add(options: T): T;
29
+ updateStyle(annotation: T, style: Partial<T['properties']['style']>): void;
30
+ updateGeometry(annotation: T, geometry: Partial<T['geometry']>): void;
31
+ /**
32
+ * @method update
33
+ * Updates an annotation (position, color etc)
34
+ * @param id Id of the annotation to update
35
+ * @param new params of the annotation
36
+ */
37
+ update(id: Id, element: Partial<T>): void;
38
+ updateAnnotation(target: T, element: Partial<T>): void;
39
+ getById(id: Id): T;
40
+ /**
41
+ * @method select
42
+ * @param id id of the element to select
43
+ * Select element, show editor, disable Ogma dragging and fire event
44
+ */
45
+ select(id: Id): void;
46
+ hover(id: Id): void;
47
+ getSelectedFeature(): T | null;
48
+ unselect(): this;
49
+ unhover(): this;
50
+ /**
51
+ * @method remove
52
+ * @param id Id of the annotation to remove
53
+ * Removes annotation with the given id
54
+ */
55
+ remove(id: Id): void;
56
+ /**
57
+ * @method disableDragging
58
+ * Prevents Ogma from dragging elements or moving the view while dragging an annotation
59
+ */
60
+ disableDragging(): void;
61
+ /**
62
+ * @method restoreDragging
63
+ * restore ogma options as they were before we start dragging an annotation
64
+ */
65
+ restoreDragging(): void;
66
+ enableDetection(): void;
67
+ /**
68
+ * @method disableDetection
69
+ * Disables the hover behaviour, used by controller to avoid hovering
70
+ * arrows while dragging texts and vice versa
71
+ */
72
+ disableDetection(): void;
73
+ refreshLayer(): void;
74
+ getElements(): T[];
75
+ abstract refreshEditor(): void;
76
+ abstract draw(svg: SVGSVGElement): void;
77
+ abstract cancelDrawing(): void;
78
+ abstract getDefaultOptions(): T;
79
+ abstract detect(point: Point, margin: number): T | undefined;
80
+ destroy(): void;
81
+ }
@@ -0,0 +1,13 @@
1
+ export declare const NONE = -1;
2
+ export declare const EVT_DRAG = "dragging";
3
+ export declare const EVT_DRAG_START = "dragstart";
4
+ export declare const EVT_DRAG_END = "dragend";
5
+ export declare const EVT_SELECT = "select";
6
+ export declare const EVT_UNSELECT = "unselect";
7
+ export declare const EVT_HOVER = "hover";
8
+ export declare const EVT_UNHOVER = "unhover";
9
+ export declare const EVT_REMOVE = "remove";
10
+ export declare const EVT_ADD = "add";
11
+ export declare const EVT_CANCEL_DRAWING = "cancelDrawing";
12
+ export declare const EVT_UPDATE = "update";
13
+ export declare const EVT_LINK = "link";
@@ -0,0 +1,6 @@
1
+ import './style.css';
2
+ export * from './Editor/Arrows';
3
+ export * from './Editor/Texts';
4
+ export * from './Control';
5
+ export * from './utils';
6
+ export * from './types';
@@ -0,0 +1,20 @@
1
+ import { Point } from '@linkurious/ogma';
2
+ import { Arrow, Id, TargetType, Link, Side } from './types';
3
+ /**
4
+ * Class that implements linking between annotation arrows and different items.
5
+ * An arrow can be connected to a text or to a node. It supports double indexing
6
+ * so that you could get the arrow by the id of the text or the id of the node
7
+ * or by the id of the arrow id itself.
8
+ * A node or text can be connected to multiple arrows.
9
+ * An arrow can be connected to only one node or text, but on both ends.
10
+ */
11
+ export declare class Links {
12
+ private links;
13
+ private linksByTargetId;
14
+ private linksByArrowId;
15
+ add(arrow: Arrow, side: Side, targetId: Id, targetType: TargetType, connectionPoint: Point): this;
16
+ arrowIsLinked(arrowId: Id, side: Side): boolean;
17
+ remove(arrow: Arrow, side: Side): this;
18
+ getArrowLink(arrowId: Id, side: Side): Link | null;
19
+ getTargetLinks(targetId: Id): Link[];
20
+ }
@@ -0,0 +1,172 @@
1
+ import { Point } from '@linkurious/ogma';
2
+ import type { Feature, FeatureCollection, Geometry, GeometryObject, LineString, Polygon } from 'geojson';
3
+ import { EVT_ADD, EVT_CANCEL_DRAWING, EVT_DRAG, EVT_DRAG_END, EVT_DRAG_START, EVT_HOVER, EVT_REMOVE, EVT_SELECT, EVT_UNHOVER, EVT_UNSELECT, EVT_UPDATE, EVT_LINK } from './constants';
4
+ export declare const isArrow: (a: AnnotationFeature<Geometry, AnnotationProps>) => a is Arrow;
5
+ export declare const isText: (a: AnnotationFeature<Geometry, AnnotationProps>) => a is Text;
6
+ export declare const isAnnotationCollection: (a: AnnotationFeature<Geometry, AnnotationProps> | FeatureCollection) => a is AnnotationCollection;
7
+ type AnnotationType = 'arrow' | 'text';
8
+ export interface AnnotationProps {
9
+ type: AnnotationType;
10
+ style?: unknown;
11
+ }
12
+ export type Id = string | number;
13
+ export interface AnnotationFeature<G extends GeometryObject = GeometryObject, P = AnnotationProps> extends Feature<G, P> {
14
+ id: string | number;
15
+ }
16
+ export interface ArrowStyles extends StrokeOptions {
17
+ tail?: Extremity;
18
+ head?: Extremity;
19
+ }
20
+ type ExportedLink = {
21
+ id: Id;
22
+ side: 'start' | 'end';
23
+ type: 'node' | 'text';
24
+ magnet?: Point;
25
+ };
26
+ export interface ArrowProperties extends AnnotationProps {
27
+ type: 'arrow';
28
+ style?: ArrowStyles;
29
+ link?: Partial<Record<Side, ExportedLink>>;
30
+ }
31
+ export type Arrow = AnnotationFeature<LineString, ArrowProperties>;
32
+ export interface AnnotationCollection extends FeatureCollection {
33
+ features: (Arrow | Text)[];
34
+ }
35
+ export type StrokeOptions = {
36
+ strokeType?: 'plain' | 'dashed' | 'none';
37
+ strokeColor?: string;
38
+ strokeWidth?: number;
39
+ };
40
+ export interface TextStyle extends StrokeOptions {
41
+ /** Helvetica, sans-serif... */
42
+ font?: string;
43
+ /** 12px, 1em... */
44
+ fontSize?: string;
45
+ /** text color: #f00, yellow...*/
46
+ color?: string;
47
+ /** background color: empty for transparent #f00, yellow...*/
48
+ background?: string;
49
+ /** padding around the text */
50
+ padding?: number;
51
+ }
52
+ export interface TextProperties extends AnnotationProps {
53
+ type: 'text';
54
+ /**text to display*/
55
+ content: string;
56
+ style?: TextStyle;
57
+ }
58
+ export type Text = AnnotationFeature<Polygon, TextProperties>;
59
+ export type Stroke = {
60
+ type: 'plain' | 'dashed' | 'none';
61
+ color: string;
62
+ width: number;
63
+ };
64
+ export type StrokeStyle = Stroke;
65
+ export type Extremity = 'none' | 'arrow' | 'arrow-plain';
66
+ export type AnnotationOptions = {
67
+ handleSize: number;
68
+ placeholder: string;
69
+ };
70
+ export type Events<T> = {
71
+ [EVT_HOVER]: (evt: T) => void;
72
+ [EVT_UNHOVER]: (evt: T) => void;
73
+ [EVT_SELECT]: (evt: T) => void;
74
+ [EVT_UNSELECT]: (evt: T) => void;
75
+ [EVT_DRAG_START]: (evt: T) => void;
76
+ [EVT_DRAG]: (evt: T, key: 'line' | 'start' | 'end' | 'text') => void;
77
+ [EVT_DRAG_END]: (evt: T) => void;
78
+ [EVT_REMOVE]: (evt: T) => void;
79
+ [EVT_ADD]: (evt: T) => void;
80
+ [EVT_UPDATE]: (evt: T) => void;
81
+ };
82
+ export type FeatureEvents = {
83
+ /**
84
+ * Event trigerred when selecting an annotation
85
+ * @param evt The annotation selected
86
+ */
87
+ [EVT_SELECT]: (evt: Annotation) => void;
88
+ /**
89
+ * Event trigerred when unselecting an annotation
90
+ * @param evt The annotation unselected
91
+ */
92
+ [EVT_UNSELECT]: (evt: Annotation) => void;
93
+ /**
94
+ * Event trigerred when removing an annotation
95
+ * @param evt The annotation removed
96
+ */
97
+ [EVT_REMOVE]: (evt: Annotation) => void;
98
+ /**
99
+ * Event trigerred when adding an annotation
100
+ * @param evt The annotation added
101
+ */
102
+ [EVT_ADD]: (evt: Annotation) => void;
103
+ [EVT_CANCEL_DRAWING]: () => void;
104
+ /**
105
+ * Event trigerred when updating an annotation
106
+ * @returns The annotation updated
107
+ */
108
+ [EVT_UPDATE]: (evt: Annotation) => void;
109
+ /**
110
+ * Event trigerred when linking an arrow to a text or node
111
+ */
112
+ [EVT_LINK]: (evt: {
113
+ arrow: Arrow;
114
+ link: Link;
115
+ }) => void;
116
+ };
117
+ export type TargetType = 'text' | 'node';
118
+ export type Side = 'start' | 'end';
119
+ export type Link = {
120
+ /** arrow atteched to the text or node */
121
+ arrow: Id;
122
+ /** id of the text the arrow is attached to */
123
+ id: Id;
124
+ /** On which end the arrow is tighten to the text */
125
+ side: Side;
126
+ /** id of the text or node the arrow is attached to */
127
+ target: Id;
128
+ /** Text or node */
129
+ targetType: TargetType;
130
+ /**
131
+ * On which point relative to topleft corner the arrow is tighten, in case of
132
+ * node, it can be deduced from the arrow itself
133
+ */
134
+ connectionPoint: Point;
135
+ };
136
+ export type ControllerOptions = {
137
+ magnetColor: string;
138
+ /**
139
+ * The radius in which arrows are attracted
140
+ */
141
+ magnetRadius: number;
142
+ /**
143
+ * The margin in which the Texts are detected when looking for magnet points
144
+ */
145
+ detectMargin: number;
146
+ /**
147
+ * Display size of the magnet point
148
+ */
149
+ magnetHandleRadius: number;
150
+ /**
151
+ * Placeholder for the text input
152
+ */
153
+ textPlaceholder: string;
154
+ /**
155
+ * Size of the text handle
156
+ */
157
+ textHandleSize: number;
158
+ /**
159
+ * Size of the arrow handle
160
+ */
161
+ arrowHandleSize: number;
162
+ /**
163
+ * Minimum height of the arrow in units
164
+ */
165
+ minArrowHeight: number;
166
+ /**
167
+ * Maximum height of the arrow in units
168
+ */
169
+ maxArrowHeight: number;
170
+ };
171
+ export type Annotation = Arrow | Text;
172
+ export {};
@@ -0,0 +1,48 @@
1
+ import { Point } from '@linkurious/ogma';
2
+ import type { BBox } from 'geojson';
3
+ import { AnnotationCollection, Arrow, Text } from './types';
4
+ export declare function createSVGElement<T extends SVGElement>(tag: string): T;
5
+ export declare function getTextBbox(t: Text): BBox;
6
+ export declare function getTextSize(t: Text): {
7
+ width: number;
8
+ height: number;
9
+ };
10
+ export declare function getTextPosition(t: Text): {
11
+ x: number;
12
+ y: number;
13
+ };
14
+ export declare function updateTextBbox(t: Text): void;
15
+ export declare function setTextBbox(t: Text, x: number, y: number, width: number, height: number): void;
16
+ export declare function getArrowStart(a: Arrow): {
17
+ x: number;
18
+ y: number;
19
+ };
20
+ export declare function getArrowSide(a: Arrow, side: 'start' | 'end'): {
21
+ x: number;
22
+ y: number;
23
+ };
24
+ export declare function getArrowEnd(a: Arrow): {
25
+ x: number;
26
+ y: number;
27
+ };
28
+ export declare function setArrowStart(a: Arrow, x: number, y: number): void;
29
+ export declare function setArrowEnd(a: Arrow, x: number, y: number): void;
30
+ export declare function getArrowEndPoints(a: Arrow): {
31
+ start: {
32
+ x: number;
33
+ y: number;
34
+ };
35
+ end: {
36
+ x: number;
37
+ y: number;
38
+ };
39
+ };
40
+ export declare function setArrowEndPoint(a: Arrow, side: 'start' | 'end', x: number, y: number): void;
41
+ export declare const getHandleId: (handle: HTMLDivElement) => number;
42
+ type Bounds = [number, number, number, number];
43
+ export declare function getAnnotationsBounds(annotations: AnnotationCollection): Bounds;
44
+ export declare function getAttachmentPointOnNode(start: Point, nodeCenter: Point, nodeRadius: number): {
45
+ x: number;
46
+ y: number;
47
+ };
48
+ export {};
package/package.json ADDED
@@ -0,0 +1,78 @@
1
+ {
2
+ "name": "@linkurious/ogma-annotations",
3
+ "version": "1.0.5",
4
+ "description": "Headless annotation plugin for Ogma",
5
+ "main": "dist/index.mjs",
6
+ "module": "dist/index.mjs",
7
+ "browser": "dist/index.umd.js",
8
+ "types": "dist/types/index.d.ts",
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "exports": {
13
+ ".": {
14
+ "import": "./dist/index.mjs",
15
+ "require": "./dist/index.umd.js",
16
+ "default": "./dist/index.mjs",
17
+ "types": "./dist/types/index.d.ts"
18
+ },
19
+ "./style.css": {
20
+ "import": "./dist/style.css",
21
+ "require": "./dist/style.css"
22
+ },
23
+ "./umd": "./dist/index.umd.js",
24
+ "./esm": "./dist/index.mjs"
25
+ },
26
+ "scripts": {
27
+ "start": "npm run dev",
28
+ "dev": "vite -c web/vite.config.ts",
29
+ "build:ui": "vite build -c vite.config-ui.ts",
30
+ "prebuild": "rm -rf dist",
31
+ "build": "tsc && vite build && npm run types",
32
+ "lint:ci": "eslint --ext .ts,.tsx src",
33
+ "lint": "eslint --ext .ts,.tsx --fix src",
34
+ "types": "tsc --d -emitDeclarationOnly --outDir dist/types",
35
+ "preview": "vite preview",
36
+ "docs:build": "typedoc --plugin typedoc-plugin-markdown --out ../../docs/annotations src/index.ts",
37
+ "test:unit": "vitest run -c test/unit/vitest.config.mts",
38
+ "test:watch": "vitest watch -c test/unit/vitest.config.mts",
39
+ "test:e2e": "vitest run -c test/e2e/vitest.config.mts",
40
+ "test:e2e:watch": "vitest watch -c test/e2e/vitest.config.mts"
41
+ },
42
+ "publishConfig": {
43
+ "access": "public"
44
+ },
45
+ "private": false,
46
+ "repository": {
47
+ "type": "git",
48
+ "url": "git+https://github.com/Linkurious/ogma-prototype.git"
49
+ },
50
+ "keywords": [
51
+ "annotations",
52
+ "headless",
53
+ "arrow",
54
+ "ogma",
55
+ "text"
56
+ ],
57
+ "author": "Linkurious SAS",
58
+ "license": "Apache-2.0",
59
+ "peerDependencies": {
60
+ "@linkurious/ogma": ">=4.5.6"
61
+ },
62
+ "devDependencies": {
63
+ "canvas": "^2.11.2",
64
+ "get-port": "^7.0.0",
65
+ "jsdom": "^22.1.0",
66
+ "playwright": "1.40.0",
67
+ "typescript": "5.3.2",
68
+ "vite": "^5.0.2",
69
+ "vitest": "^0.34.6"
70
+ },
71
+ "dependencies": {
72
+ "@borgar/textbox": "^1.6.0",
73
+ "@types/geojson": "^7946.0.13",
74
+ "@types/vector2js": "^2.0.2",
75
+ "eventemitter3": "^5.0.1",
76
+ "vector2js": "^2.0.1"
77
+ }
78
+ }