@insync-stageplayer/annotations 0.4.7 → 0.4.8
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/lib/components/AnnotationContent.d.ts +37 -37
- package/lib/components/AnnotationContent.js +59 -59
- package/lib/components/AnnotationEditForm.d.ts +26 -26
- package/lib/components/AnnotationEditForm.js +146 -146
- package/lib/components/AnnotationsModuleProvider.d.ts +36 -36
- package/lib/components/AnnotationsModuleProvider.js +20 -20
- package/lib/components/AnnotationsViewer.d.ts +15 -15
- package/lib/components/AnnotationsViewer.js +107 -107
- package/lib/components/DraggablePosition.d.ts +31 -31
- package/lib/components/DraggablePosition.js +62 -62
- package/lib/components/MeasurementDisplayDataContext.d.ts +10 -10
- package/lib/components/MeasurementDisplayDataContext.js +2 -2
- package/lib/components/MeasurementDisplayDataProvider.d.ts +15 -15
- package/lib/components/MeasurementDisplayDataProvider.js +45 -45
- package/lib/components/MeasurementDisplayEditor.d.ts +19 -19
- package/lib/components/MeasurementDisplayEditor.js +136 -136
- package/lib/components/MeasurementDisplayElement.d.ts +18 -18
- package/lib/components/MeasurementDisplayElement.js +97 -97
- package/lib/components/ModalAnnotationEditor.d.ts +12 -12
- package/lib/components/ModalAnnotationEditor.js +37 -37
- package/lib/formatNumber.d.ts +29 -29
- package/lib/formatNumber.js +12 -12
- package/lib/index.d.ts +7 -7
- package/lib/index.js +7 -7
- package/lib/redux/actions.d.ts +1 -1
- package/lib/redux/actions.js +1 -1
- package/lib/redux/annotationEditor.slice.d.ts +37 -37
- package/lib/redux/annotationEditor.slice.js +122 -122
- package/lib/redux/annotations.slice.d.ts +31 -31
- package/lib/redux/annotations.slice.js +65 -65
- package/lib/redux/measurementDisplayEditor.slice.d.ts +25 -25
- package/lib/redux/measurementDisplayEditor.slice.js +36 -36
- package/lib/redux/measurementDisplays.slice.d.ts +25 -25
- package/lib/redux/measurementDisplays.slice.js +22 -22
- package/lib/redux/reducer.d.ts +51 -51
- package/lib/redux/reducer.js +65 -65
- package/lib/useBoundingRect.d.ts +8 -8
- package/lib/useBoundingRect.js +27 -27
- package/lib/util.d.ts +5 -5
- package/lib/util.js +7 -7
- package/package.json +5 -5
package/lib/useBoundingRect.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { useRef, useEffect, useCallback, useState } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* React hook that uses ResizeObserver to keep track of size of element.
|
|
4
|
-
* @returns An array that with a callback to pass element, and the ClientRect for that element with it's current size.
|
|
5
|
-
*/
|
|
6
|
-
export const useBoundingRect = () => {
|
|
7
|
-
const resizeObserver = useRef();
|
|
8
|
-
const [boundingRect, setBoundingRect] = useState();
|
|
9
|
-
useEffect(() => () => {
|
|
10
|
-
if (resizeObserver.current != undefined)
|
|
11
|
-
resizeObserver.current.disconnect();
|
|
12
|
-
resizeObserver.current = undefined;
|
|
13
|
-
}, []);
|
|
14
|
-
const ref = useCallback((node) => {
|
|
15
|
-
if (!node || !node.getBoundingClientRect)
|
|
16
|
-
return;
|
|
17
|
-
if (resizeObserver.current) {
|
|
18
|
-
resizeObserver.current.disconnect();
|
|
19
|
-
resizeObserver.current = undefined;
|
|
20
|
-
}
|
|
21
|
-
resizeObserver.current = new ResizeObserver(() => {
|
|
22
|
-
setBoundingRect(node.getBoundingClientRect());
|
|
23
|
-
});
|
|
24
|
-
resizeObserver.current.observe(node);
|
|
25
|
-
}, []);
|
|
26
|
-
return [ref, boundingRect];
|
|
27
|
-
};
|
|
1
|
+
import { useRef, useEffect, useCallback, useState } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* React hook that uses ResizeObserver to keep track of size of element.
|
|
4
|
+
* @returns An array that with a callback to pass element, and the ClientRect for that element with it's current size.
|
|
5
|
+
*/
|
|
6
|
+
export const useBoundingRect = () => {
|
|
7
|
+
const resizeObserver = useRef();
|
|
8
|
+
const [boundingRect, setBoundingRect] = useState();
|
|
9
|
+
useEffect(() => () => {
|
|
10
|
+
if (resizeObserver.current != undefined)
|
|
11
|
+
resizeObserver.current.disconnect();
|
|
12
|
+
resizeObserver.current = undefined;
|
|
13
|
+
}, []);
|
|
14
|
+
const ref = useCallback((node) => {
|
|
15
|
+
if (!node || !node.getBoundingClientRect)
|
|
16
|
+
return;
|
|
17
|
+
if (resizeObserver.current) {
|
|
18
|
+
resizeObserver.current.disconnect();
|
|
19
|
+
resizeObserver.current = undefined;
|
|
20
|
+
}
|
|
21
|
+
resizeObserver.current = new ResizeObserver(() => {
|
|
22
|
+
setBoundingRect(node.getBoundingClientRect());
|
|
23
|
+
});
|
|
24
|
+
resizeObserver.current.observe(node);
|
|
25
|
+
}, []);
|
|
26
|
+
return [ref, boundingRect];
|
|
27
|
+
};
|
|
28
28
|
//# sourceMappingURL=useBoundingRect.js.map
|
package/lib/util.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creates a unique id.
|
|
3
|
-
* @returns
|
|
4
|
-
*/
|
|
5
|
-
export declare const createId: () => string;
|
|
1
|
+
/**
|
|
2
|
+
* Creates a unique id.
|
|
3
|
+
* @returns
|
|
4
|
+
*/
|
|
5
|
+
export declare const createId: () => string;
|
|
6
6
|
//# sourceMappingURL=util.d.ts.map
|
package/lib/util.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creates a unique id.
|
|
3
|
-
* @returns
|
|
4
|
-
*/
|
|
5
|
-
export const createId = () => {
|
|
6
|
-
return "_" + Math.random().toString(36).substr(2, 9);
|
|
7
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* Creates a unique id.
|
|
3
|
+
* @returns
|
|
4
|
+
*/
|
|
5
|
+
export const createId = () => {
|
|
6
|
+
return "_" + Math.random().toString(36).substr(2, 9);
|
|
7
|
+
};
|
|
8
8
|
//# sourceMappingURL=util.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@insync-stageplayer/annotations",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.8",
|
|
4
4
|
"description": "Annotations module for stageplayer",
|
|
5
5
|
"author": "David Ammeraal <david.ammeraal@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/Noterik/insync-stageplayer#readme",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"url": "https://github.com/Noterik/insync-stageplayer/issues"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@insync-stageplayer/measurements": "^
|
|
36
|
-
"@insync-stageplayer/time": "^0.4.
|
|
37
|
-
"@insync-stageplayer/ui-components": "^0.4.
|
|
35
|
+
"@insync-stageplayer/measurements": "^0.4.8",
|
|
36
|
+
"@insync-stageplayer/time": "^0.4.8",
|
|
37
|
+
"@insync-stageplayer/ui-components": "^0.4.8",
|
|
38
38
|
"@reduxjs/toolkit": "^1.5.0",
|
|
39
39
|
"@types/deep-diff": "^1.0.0",
|
|
40
40
|
"classnames": "^2.3.1",
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"rxjs": "^6.6.6"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "6260dd65545a48e0cbd5cb54674e3ca1a082fb03"
|
|
56
56
|
}
|