@linkurious/ogma-annotations 1.0.8 → 1.0.11
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.mjs +829 -812
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +18 -18
- package/dist/index.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/Control.d.ts +6 -0
- package/dist/types/Editor/base.d.ts +1 -0
- package/package.json +30 -18
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--handle-width: 2px;--point-handle-width: calc(3 * var(--handle-width))}svg text{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.handle{position:absolute;background-color:#38e}.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;
|
|
1
|
+
:root{--handle-width: 2px;--point-handle-width: calc(3 * var(--handle-width))}svg text{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.handle{position:absolute;background-color:#38e}.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{width:var(--point-handle-width);height:var(--point-handle-width)}.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:calc(100% - (var(--point-handle-width) - var(--handle-width)) * .5)}.point-handle.top-left,.point-handle.top-right{top:calc((var(--point-handle-width) + var(--handle-width)) * -.5)}.point-handle.bottom-left,.point-handle.top-left{left:calc((var(--point-handle-width) + var(--handle-width)) * -.5)}.point-handle.bottom-right,.point-handle.top-right{left:calc(100% - (var(--point-handle-width) + var(--handle-width)) * .25)}.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}.annotations-hidden-input{position:absolute;bottom:0;left:0;visibility:hidden;display:block}.active{background-color:#38e}
|
package/dist/types/Control.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export declare class Control extends EventEmitter<FeatureEvents> {
|
|
|
22
22
|
private _onFeatureDragStart;
|
|
23
23
|
private _onNodesDragStart;
|
|
24
24
|
private _onNodesDrag;
|
|
25
|
+
private _onLayoutEnd;
|
|
25
26
|
private _moveNodes;
|
|
26
27
|
private _snapToText;
|
|
27
28
|
private _findAndSnapToNode;
|
|
@@ -55,6 +56,11 @@ export declare class Control extends EventEmitter<FeatureEvents> {
|
|
|
55
56
|
* @param annotation The annotation to add
|
|
56
57
|
*/
|
|
57
58
|
add(annotation: Arrow | Text | AnnotationCollection): this;
|
|
59
|
+
/**
|
|
60
|
+
* Remove an annotation or an array of annotations from the controller
|
|
61
|
+
* @param annotation The annotation(s) to remove
|
|
62
|
+
*/
|
|
63
|
+
remove(annotation: Arrow | Text | AnnotationCollection): this;
|
|
58
64
|
private loadLink;
|
|
59
65
|
/**
|
|
60
66
|
* Start adding an arrow (add it, and give control to the user)
|
|
@@ -16,6 +16,7 @@ export default abstract class Editor<T extends Annotation> extends eventEmmitter
|
|
|
16
16
|
protected ogmaOptions: Options;
|
|
17
17
|
protected shouldDetect: boolean;
|
|
18
18
|
protected isDragging: boolean;
|
|
19
|
+
protected maxHandleScale: number;
|
|
19
20
|
constructor(ogma: Ogma, editorHtml: string);
|
|
20
21
|
private _onKeyUp;
|
|
21
22
|
protected _canRemove(): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@linkurious/ogma-annotations",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
4
4
|
"description": "Headless annotation plugin for Ogma",
|
|
5
5
|
"main": "dist/index.mjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -24,13 +24,17 @@
|
|
|
24
24
|
"./esm": "./dist/index.mjs"
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
|
+
"postinstall": "playwright install",
|
|
27
28
|
"start": "npm run dev",
|
|
28
29
|
"dev": "vite -c web/vite.config.ts",
|
|
29
30
|
"build:ui": "vite build -c vite.config-ui.ts",
|
|
30
31
|
"prebuild": "rm -rf dist",
|
|
32
|
+
"bump:patch": "bump2version patch && npm version --no-git-tag-version patch",
|
|
33
|
+
"bump:minor": "bump2version minor && npm version --no-git-tag-version minor",
|
|
34
|
+
"bump:major": "bump2version major && npm version --no-git-tag-version major",
|
|
31
35
|
"build": "tsc && vite build && npm run types",
|
|
32
|
-
"lint:ci": "eslint --ext
|
|
33
|
-
"lint": "eslint --ext
|
|
36
|
+
"lint:ci": "eslint -f checkstyle -o reports/checkstyle.xml --ext ts --ext js src",
|
|
37
|
+
"lint": "eslint --ext ts --ext js src",
|
|
34
38
|
"types": "tsc --d -emitDeclarationOnly --outDir dist/types",
|
|
35
39
|
"preview": "vite preview",
|
|
36
40
|
"docs:build": "typedoc --plugin typedoc-plugin-markdown --out ../../docs/annotations src/index.ts",
|
|
@@ -57,22 +61,30 @@
|
|
|
57
61
|
"author": "Linkurious SAS",
|
|
58
62
|
"license": "Apache-2.0",
|
|
59
63
|
"peerDependencies": {
|
|
60
|
-
"@linkurious/ogma": "
|
|
64
|
+
"@linkurious/ogma": "4.5.6"
|
|
65
|
+
},
|
|
66
|
+
"dependencies": {
|
|
67
|
+
"@borgar/textbox": "1.6.0",
|
|
68
|
+
"eventemitter3": "5.0.1",
|
|
69
|
+
"vector2js": "2.0.1"
|
|
61
70
|
},
|
|
62
71
|
"devDependencies": {
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
72
|
+
"@linkurious/eslint-config-ogma": "^1.0.9",
|
|
73
|
+
"@types/geojson": "7946.0.13",
|
|
74
|
+
"@types/vector2js": "2.0.2",
|
|
75
|
+
"canvas": "2.11.2",
|
|
76
|
+
"eslint": "8.56.0",
|
|
77
|
+
"get-port": "7.0.0",
|
|
78
|
+
"jsdom": "24.0.0",
|
|
79
|
+
"playwright": "1.41.1",
|
|
80
|
+
"typescript": "5.3.3",
|
|
81
|
+
"vite": "5.0.12",
|
|
82
|
+
"vitest": "1.2.2"
|
|
70
83
|
},
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
"vector2js": "^2.0.1"
|
|
84
|
+
"eslintConfig": {
|
|
85
|
+
"parser": "@typescript-eslint/parser",
|
|
86
|
+
"extends": [
|
|
87
|
+
"@linkurious/eslint-config-ogma"
|
|
88
|
+
]
|
|
77
89
|
}
|
|
78
|
-
}
|
|
90
|
+
}
|