@linkurious/ogma-annotations 1.1.19 → 1.1.22
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.js +21 -21
- package/dist/index.mjs +1317 -1381
- package/dist/types/index.d.ts +11 -1
- package/package.json +10 -7
- package/dist/style.css +0 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -92,6 +92,8 @@ export declare function clientToContainerPosition(evt: {
|
|
|
92
92
|
y: number;
|
|
93
93
|
};
|
|
94
94
|
|
|
95
|
+
export declare function colorToRgba(color: string, alpha: number): string;
|
|
96
|
+
|
|
95
97
|
export declare class Control extends default_2<FeatureEvents> {
|
|
96
98
|
private arrows;
|
|
97
99
|
private texts;
|
|
@@ -389,7 +391,7 @@ declare type ExportedLink = {
|
|
|
389
391
|
magnet?: Point;
|
|
390
392
|
};
|
|
391
393
|
|
|
392
|
-
export declare type Extremity = "none" | "arrow" | "arrow-plain";
|
|
394
|
+
export declare type Extremity = "none" | "arrow" | "arrow-plain" | "dot" | "halo-dot";
|
|
393
395
|
|
|
394
396
|
export declare type FeatureEvents = {
|
|
395
397
|
/**
|
|
@@ -486,6 +488,10 @@ export declare function getTextSize(t: Text_2): {
|
|
|
486
488
|
height: number;
|
|
487
489
|
};
|
|
488
490
|
|
|
491
|
+
export declare function hexShortToLong(color: string): string;
|
|
492
|
+
|
|
493
|
+
export declare function hexToRgba(color: string, alpha: number): string;
|
|
494
|
+
|
|
489
495
|
export declare type Id = string | number;
|
|
490
496
|
|
|
491
497
|
export declare const isAnnotationCollection: (a: AnnotationFeature<Geometry, AnnotationProps> | FeatureCollection) => a is AnnotationCollection;
|
|
@@ -519,6 +525,8 @@ export declare type Point = {
|
|
|
519
525
|
y: number;
|
|
520
526
|
};
|
|
521
527
|
|
|
528
|
+
export declare function rgbToRgba(color: string, alpha: number): string;
|
|
529
|
+
|
|
522
530
|
export declare function scaleGeometry(geometry: LineString | Polygon, scale: number, ox: number, oy: number): LineString | Polygon;
|
|
523
531
|
|
|
524
532
|
export declare function setArrowEnd(a: Arrow, x: number, y: number): void;
|
|
@@ -606,6 +614,8 @@ export declare interface TextStyle extends StrokeOptions {
|
|
|
606
614
|
background?: string;
|
|
607
615
|
/** padding around the text */
|
|
608
616
|
padding?: number;
|
|
617
|
+
/** Text box border radius */
|
|
618
|
+
borderRadius?: number;
|
|
609
619
|
}
|
|
610
620
|
|
|
611
621
|
export declare function updateTextBbox(t: Text_2): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@linkurious/ogma-annotations",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.22",
|
|
4
4
|
"description": "Headless annotation plugin for Ogma",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.mjs",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"types": "./dist/types/index.d.ts"
|
|
22
22
|
},
|
|
23
23
|
"./style.css": {
|
|
24
|
-
"import": "./dist/
|
|
25
|
-
"require": "./dist/
|
|
24
|
+
"import": "./dist/ogma-annotations.css",
|
|
25
|
+
"require": "./dist/ogma-annotations.css"
|
|
26
26
|
},
|
|
27
27
|
"./umd": "./dist/index.js",
|
|
28
28
|
"./esm": "./dist/index.mjs"
|
|
@@ -76,22 +76,25 @@
|
|
|
76
76
|
"geojson": "^0.5.0"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
|
-
"@linkurious/eslint-config-ogma": "
|
|
79
|
+
"@linkurious/eslint-config-ogma": "1.0.14",
|
|
80
80
|
"canvas": "2.11.2",
|
|
81
|
-
"eslint": "8.56.0",
|
|
82
81
|
"get-port": "7.0.0",
|
|
83
82
|
"jsdom": "24.0.0",
|
|
84
83
|
"playwright": "1.42.1",
|
|
85
84
|
"typedoc": "^0.25.13",
|
|
86
85
|
"typedoc-plugin-markdown": "^3.17.1",
|
|
87
86
|
"typescript": "5.3.3",
|
|
88
|
-
"vite": "
|
|
87
|
+
"vite": "6.2.0",
|
|
89
88
|
"vite-plugin-dts": "^4.1.0",
|
|
90
|
-
"vitest": "
|
|
89
|
+
"vitest": "3.0.7"
|
|
91
90
|
},
|
|
92
91
|
"eslintConfig": {
|
|
93
92
|
"extends": [
|
|
94
93
|
"@linkurious/eslint-config-ogma"
|
|
95
94
|
]
|
|
95
|
+
},
|
|
96
|
+
"prettier": {
|
|
97
|
+
"printWidth": 80,
|
|
98
|
+
"trailingComma": "none"
|
|
96
99
|
}
|
|
97
100
|
}
|
package/dist/style.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
:root{--handle-width: 2px;--point-handle-width: calc(3 * var(--handle-width));--point-handle-border: 2px;--point-handle-total: calc( var(--point-handle-width) + var(--point-handle-border) );--handle-color: #38e;--handle-background: #fff}svg text{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.handle{position:absolute;background-color:var(--handle-color)}.handle.line{cursor:move}.annotation-text-handle textarea{outline:none;margin:0;border:0;width:100%;height:100%;cursor:text;padding:0;z-index:1000;resize:none;white-space:break-spaces;background:transparent;overflow:hidden}.annotation-text-handle .noevents{pointer-events:none;z-index:20}.line-handle,.point-handle{z-index:30}.line-handle.top{cursor:ns-resize;height:var(--handle-width);left:0;width:100%;top:calc(var(--handle-width) * -1)}.line-handle.bottom{cursor:ns-resize;height:var(--handle-width);width:100%;left:0;bottom:calc(var(--handle-width) * -1)}.line-handle.left{cursor:ew-resize;height:100%;top:0;left:calc(var(--handle-width) * -1);width:var(--handle-width)}.line-handle.right{cursor:ew-resize;height:100%;right:calc(var(--handle-width) * -1);top:0;width:var(--handle-width)}.line-handle.top,.line-handle.bottom,.line-handle.left,.line-handle.right{cursor:move}.point-handle{border-radius:50%;background-color:#fff;transform-origin:center;transform:translate(-50%,-50%);border:var(--point-handle-border) solid var(--handle-color);width:var(--point-handle-width);height:var(--point-handle-width)}.point-handle.top-left{transform:translate(-55%,-55%)}.point-handle.top-right{transform:translate(-45%,-55%)}.point-handle.bottom-left{transform:translate(-55%,-45%)}.point-handle.bottom-right{transform:translate(-45%,-45%)}.point-handle.top-left,.point-handle.bottom-right{cursor:nwse-resize}.point-handle.top-right,.point-handle.bottom-left{cursor:nesw-resize}.point-handle.bottom-left,.point-handle.bottom-right{top:100%}.point-handle.top-left,.point-handle.top-right{top:0}.point-handle.bottom-left,.point-handle.top-left{left:0}.point-handle.bottom-right,.point-handle.top-right{left:100%}.arrow-handle>.handle{height:var(--point-handle-width);width:var(--point-handle-width);border-radius:50%;cursor:move;transform:translate(-50%,-50%)}.arrow-handle>.line{height:var(--handle-width);border-radius:0;cursor:move}.arrow-handle>.point{background-color:var(--handle-background);border:2px solid var(--handle-color)}.annotations-hidden-input{position:absolute;bottom:0;left:0;visibility:hidden;display:block}.active{background-color:#38e}.annotation-text{pointer-events:visible;cursor:pointer}.annotation-text:hover>rect{stroke:var(--handle-color)}.annotation-text a{fill:var(--handle-color)}.annotation-text a:hover{text-decoration:underline}
|