@insync-stageplayer/annotations 0.5.34 → 0.5.35-beta.1

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.
Files changed (55) hide show
  1. package/lib/components/AnnotationContent.d.ts +37 -37
  2. package/lib/components/AnnotationContent.js +59 -59
  3. package/lib/components/AnnotationEditForm.d.ts +26 -26
  4. package/lib/components/AnnotationEditForm.js +146 -146
  5. package/lib/components/AnnotationsModuleProvider.d.ts +36 -36
  6. package/lib/components/AnnotationsModuleProvider.js +20 -20
  7. package/lib/components/AnnotationsViewer.d.ts +15 -15
  8. package/lib/components/AnnotationsViewer.js +107 -107
  9. package/lib/components/DraggablePosition.d.ts +31 -31
  10. package/lib/components/DraggablePosition.js +62 -62
  11. package/lib/components/MeasurementDisplayDataContext.d.ts +10 -10
  12. package/lib/components/MeasurementDisplayDataContext.js +2 -2
  13. package/lib/components/MeasurementDisplayDataProvider.d.ts +15 -15
  14. package/lib/components/MeasurementDisplayDataProvider.d.ts.map +1 -1
  15. package/lib/components/MeasurementDisplayDataProvider.js +45 -45
  16. package/lib/components/MeasurementDisplayDataProvider.js.map +1 -1
  17. package/lib/components/MeasurementDisplayEditor.d.ts +19 -19
  18. package/lib/components/MeasurementDisplayEditor.js +136 -136
  19. package/lib/components/MeasurementDisplayElement.d.ts +18 -18
  20. package/lib/components/MeasurementDisplayElement.d.ts.map +1 -1
  21. package/lib/components/MeasurementDisplayElement.js +65 -97
  22. package/lib/components/MeasurementDisplayElement.js.map +1 -1
  23. package/lib/components/ModalAnnotationEditor.d.ts +12 -12
  24. package/lib/components/ModalAnnotationEditor.js +37 -37
  25. package/lib/formatNumber.d.ts +29 -29
  26. package/lib/formatNumber.js +12 -12
  27. package/lib/hooks/useMeasurementDisplayData.d.ts +15 -0
  28. package/lib/hooks/useMeasurementDisplayData.d.ts.map +1 -0
  29. package/lib/hooks/useMeasurementDisplayData.js +40 -0
  30. package/lib/hooks/useMeasurementDisplayData.js.map +1 -0
  31. package/lib/index.d.ts +8 -7
  32. package/lib/index.d.ts.map +1 -1
  33. package/lib/index.js +8 -7
  34. package/lib/index.js.map +1 -1
  35. package/lib/redux/actions.d.ts +1 -1
  36. package/lib/redux/actions.js +1 -1
  37. package/lib/redux/annotationEditor.slice.d.ts +37 -37
  38. package/lib/redux/annotationEditor.slice.d.ts.map +1 -1
  39. package/lib/redux/annotationEditor.slice.js +122 -122
  40. package/lib/redux/annotations.slice.d.ts +31 -31
  41. package/lib/redux/annotations.slice.d.ts.map +1 -1
  42. package/lib/redux/annotations.slice.js +65 -65
  43. package/lib/redux/measurementDisplayEditor.slice.d.ts +25 -25
  44. package/lib/redux/measurementDisplayEditor.slice.d.ts.map +1 -1
  45. package/lib/redux/measurementDisplayEditor.slice.js +36 -36
  46. package/lib/redux/measurementDisplays.slice.d.ts +25 -25
  47. package/lib/redux/measurementDisplays.slice.d.ts.map +1 -1
  48. package/lib/redux/measurementDisplays.slice.js +22 -22
  49. package/lib/redux/reducer.d.ts +51 -51
  50. package/lib/redux/reducer.js +65 -65
  51. package/lib/useBoundingRect.d.ts +8 -8
  52. package/lib/useBoundingRect.js +27 -27
  53. package/lib/util.d.ts +5 -5
  54. package/lib/util.js +7 -7
  55. package/package.json +5 -5
@@ -1,98 +1,66 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
- import { useMeasurement, } from "@insync-stageplayer/measurements";
13
- import React, { useContext, useEffect } from "react";
14
- import { useSelector } from "react-redux";
15
- import { formatNumber } from "../formatNumber";
16
- import { MeasurementDisplayDataContext } from "./MeasurementDisplayDataContext";
17
- import { AnnotationsModuleContext } from "./AnnotationsModuleProvider";
18
- import { useTheme } from "@insync-stageplayer/ui-components";
19
- /**
20
- * A hook that registers the consuming component in the MeasurementDisplayDataContext.
21
- * @param measurementId
22
- * @returns
23
- */
24
- const useMeasurementDisplayData = (measurement) => {
25
- const { register, data: allData, loading, error, } = useContext(MeasurementDisplayDataContext);
26
- useEffect(() => {
27
- if (!measurement)
28
- return;
29
- const unregister = register(measurement);
30
- return () => {
31
- unregister();
32
- };
33
- }, [register, measurement]);
34
- const data = measurement &&
35
- allData &&
36
- allData[measurement === null || measurement === void 0 ? void 0 : measurement.id] &&
37
- allData[measurement === null || measurement === void 0 ? void 0 : measurement.id][0]
38
- ? {
39
- x: allData[measurement === null || measurement === void 0 ? void 0 : measurement.id][0][0],
40
- y: allData[measurement === null || measurement === void 0 ? void 0 : measurement.id][0][1],
41
- }
42
- : undefined;
43
- return {
44
- loading,
45
- error,
46
- data,
47
- };
48
- };
49
- /**
50
- * A component that displays the current value of a measurement.
51
- */
52
- export const MeasurementDisplayElement = React.forwardRef((props, ref) => {
53
- const { id, editable, children, xRange } = props, rest = __rest(props, ["id", "editable", "children", "xRange"]);
54
- const theme = useTheme();
55
- const context = useContext(AnnotationsModuleContext);
56
- const display = useSelector((s) => context.entitiesSelectors.measurementDisplays.selectById(s, id));
57
- const { measurement } = useMeasurement(display === null || display === void 0 ? void 0 : display.measurementId);
58
- const { data } = useMeasurementDisplayData(measurement);
59
- const padXStart = Math.max(3, (display === null || display === void 0 ? void 0 : display.padXTo) || 0);
60
- const padYStart = Math.max(3, (display === null || display === void 0 ? void 0 : display.padYTo) || 0);
61
- const decimalsX = (display === null || display === void 0 ? void 0 : display.decimalsX) !== undefined ? display.decimalsX : 0;
62
- const decimalsY = (display === null || display === void 0 ? void 0 : display.decimalsY) !== undefined ? display.decimalsY : 0;
63
- const xValue = (display === null || display === void 0 ? void 0 : display.showX) && (data === null || data === void 0 ? void 0 : data.x) !== "NaN"
64
- ? formatNumber({
65
- value: (data === null || data === void 0 ? void 0 : data.x) && data.x > 0 ? data.x / 1000 / 1000 : 0,
66
- decimals: decimalsX,
67
- padStart: padXStart,
68
- padChar: display.padXChar,
69
- })
70
- : undefined;
71
- const yValue = (display === null || display === void 0 ? void 0 : display.showY) && (data === null || data === void 0 ? void 0 : data.y) !== "NaN"
72
- ? formatNumber({
73
- value: data === null || data === void 0 ? void 0 : data.y,
74
- decimals: decimalsY,
75
- padStart: padYStart,
76
- padChar: display.padYChar,
77
- unit: (display === null || display === void 0 ? void 0 : display.showSignal) ? measurement === null || measurement === void 0 ? void 0 : measurement.unit : "",
78
- })
79
- : undefined;
80
- const formattedString = `${xValue ? `${xValue}` : ""}${xValue && yValue ? ":" : ""}${yValue ? yValue : ""}`;
81
- return (React.createElement("span", Object.assign({ className: "badge", role: "button", ref: ref }, rest, { style: {
82
- backgroundColor: "transparent",
83
- cursor: editable ? "pointer" : "text",
84
- fontFamily: "monospace",
85
- fontSize: "16px",
86
- fontWeight: 400,
87
- padding: ".2em",
88
- margin: ".1em",
89
- whiteSpace: "pre",
90
- color: "white",
91
- border: (display === null || display === void 0 ? void 0 : display.showSigColor) ? "1px solid" : "0px solid",
92
- borderColor: (display === null || display === void 0 ? void 0 : display.showSigColor) ? measurement === null || measurement === void 0 ? void 0 : measurement.color : "unset",
93
- } }),
94
- formattedString,
95
- children));
96
- });
97
- export default MeasurementDisplayElement;
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { useMeasurement, } from "@insync-stageplayer/measurements";
13
+ import React, { useContext } from "react";
14
+ import { useSelector } from "react-redux";
15
+ import { formatNumber } from "../formatNumber";
16
+ import { AnnotationsModuleContext } from "./AnnotationsModuleProvider";
17
+ import { useMeasurementDisplayData } from "../hooks/useMeasurementDisplayData";
18
+ /**
19
+ * A component that displays the current value of a measurement.
20
+ */
21
+ export const MeasurementDisplayElement = React.forwardRef((props, ref) => {
22
+ const { id, editable, children, xRange } = props, rest = __rest(props, ["id", "editable", "children", "xRange"]);
23
+ const context = useContext(AnnotationsModuleContext);
24
+ const display = useSelector((s) => context.entitiesSelectors.measurementDisplays.selectById(s, id));
25
+ const { measurement } = useMeasurement(display === null || display === void 0 ? void 0 : display.measurementId);
26
+ const { data } = useMeasurementDisplayData(measurement);
27
+ const padXStart = Math.max(3, (display === null || display === void 0 ? void 0 : display.padXTo) || 0);
28
+ const padYStart = Math.max(3, (display === null || display === void 0 ? void 0 : display.padYTo) || 0);
29
+ const decimalsX = (display === null || display === void 0 ? void 0 : display.decimalsX) !== undefined ? display.decimalsX : 0;
30
+ const decimalsY = (display === null || display === void 0 ? void 0 : display.decimalsY) !== undefined ? display.decimalsY : 0;
31
+ const xValue = (display === null || display === void 0 ? void 0 : display.showX) && (data === null || data === void 0 ? void 0 : data.x) !== "NaN"
32
+ ? formatNumber({
33
+ value: (data === null || data === void 0 ? void 0 : data.x) && data.x > 0 ? data.x / 1000 / 1000 : 0,
34
+ decimals: decimalsX,
35
+ padStart: padXStart,
36
+ padChar: display.padXChar,
37
+ })
38
+ : undefined;
39
+ const yValue = (display === null || display === void 0 ? void 0 : display.showY) && (data === null || data === void 0 ? void 0 : data.y) !== "NaN"
40
+ ? formatNumber({
41
+ value: data === null || data === void 0 ? void 0 : data.y,
42
+ decimals: decimalsY,
43
+ padStart: padYStart,
44
+ padChar: display.padYChar,
45
+ unit: (display === null || display === void 0 ? void 0 : display.showSignal) ? measurement === null || measurement === void 0 ? void 0 : measurement.unit : "",
46
+ })
47
+ : undefined;
48
+ const formattedString = `${xValue ? `${xValue}` : ""}${xValue && yValue ? ":" : ""}${yValue ? yValue : ""}`;
49
+ return (React.createElement("span", Object.assign({ className: "badge", role: "button", ref: ref }, rest, { style: {
50
+ backgroundColor: "transparent",
51
+ cursor: editable ? "pointer" : "text",
52
+ fontFamily: "monospace",
53
+ fontSize: "16px",
54
+ fontWeight: 400,
55
+ padding: ".2em",
56
+ margin: ".1em",
57
+ whiteSpace: "pre",
58
+ color: "white",
59
+ border: (display === null || display === void 0 ? void 0 : display.showSigColor) ? "1px solid" : "0px solid",
60
+ borderColor: (display === null || display === void 0 ? void 0 : display.showSigColor) ? measurement === null || measurement === void 0 ? void 0 : measurement.color : "unset",
61
+ } }),
62
+ formattedString,
63
+ children));
64
+ });
65
+ export default MeasurementDisplayElement;
98
66
  //# sourceMappingURL=MeasurementDisplayElement.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MeasurementDisplayElement.js","sourceRoot":"","sources":["../../src/components/MeasurementDisplayElement.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAEL,cAAc,GACf,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAEhF,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAe7D;;;;GAIG;AACH,MAAM,yBAAyB,GAAG,CAChC,WAA2C,EAC3C,EAAE;IACF,MAAM,EACJ,QAAQ,EACR,IAAI,EAAE,OAAO,EACb,OAAO,EACP,KAAK,GACN,GAAG,UAAU,CAAC,6BAA6B,CAAC,CAAC;IAE9C,SAAS,C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WAAW;YACzD,WAAW,EAAE,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,YAAY,EAAC,CAAC,CAAC,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,KAAK,CAAC,CAAC,CAAC,OAAO;SAClE;QAEA,eAAe;QAEf,QAAQ,CACJ,CACR,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,yBAAyB,CAAC"}
@@ -1,13 +1,13 @@
1
- import React, { CSSProperties } from "react";
2
- export declare type ModalAnnotationEditorProps = {
3
- title: string;
4
- className?: string;
5
- style?: CSSProperties;
6
- };
7
- /**
8
- * A modal wrapper around AnnotationEditor.
9
- * @param props
10
- * @returns
11
- */
12
- export declare const ModalAnnotationEditor: React.FC<ModalAnnotationEditorProps>;
1
+ import React, { CSSProperties } from "react";
2
+ export declare type ModalAnnotationEditorProps = {
3
+ title: string;
4
+ className?: string;
5
+ style?: CSSProperties;
6
+ };
7
+ /**
8
+ * A modal wrapper around AnnotationEditor.
9
+ * @param props
10
+ * @returns
11
+ */
12
+ export declare const ModalAnnotationEditor: React.FC<ModalAnnotationEditorProps>;
13
13
  //# sourceMappingURL=ModalAnnotationEditor.d.ts.map
@@ -1,41 +1,41 @@
1
- import React, { useContext } from "react";
2
- import { AnnotationEditForm } from "./AnnotationEditForm";
3
- import { Modal, ModalHeading, ModalBody, styled, } from "@insync-stageplayer/ui-components";
4
- import { editAnnotationCancel, editAnnotationDelete, editAnnotationSubmit, } from "../redux/annotations.slice";
5
- import { useDispatch, useSelector } from "react-redux";
6
- import { AnnotationsModuleContext } from "./AnnotationsModuleProvider";
1
+ import React, { useContext } from "react";
2
+ import { AnnotationEditForm } from "./AnnotationEditForm";
3
+ import { Modal, ModalHeading, ModalBody, styled, } from "@insync-stageplayer/ui-components";
4
+ import { editAnnotationCancel, editAnnotationDelete, editAnnotationSubmit, } from "../redux/annotations.slice";
5
+ import { useDispatch, useSelector } from "react-redux";
6
+ import { AnnotationsModuleContext } from "./AnnotationsModuleProvider";
7
7
  const StyledModalBody = styled(ModalBody) `
8
8
  width: 40vw;
9
9
  height: 60vh;
10
- `;
11
- /**
12
- * A modal wrapper around AnnotationEditor.
13
- * @param props
14
- * @returns
15
- */
16
- export const ModalAnnotationEditor = ({ title, className, style, }) => {
17
- const dispatch = useDispatch();
18
- const { selector } = useContext(AnnotationsModuleContext);
19
- const editingAnnotation = useSelector((s) => selector(s).annotations.editingAnnotation);
20
- const handleCancel = () => {
21
- dispatch(editAnnotationCancel());
22
- };
23
- const handleSubmit = (annotation) => {
24
- var _a;
25
- if (((_a = annotation.content) === null || _a === void 0 ? void 0 : _a.length) === 0) {
26
- alert("There is no content to show");
27
- dispatch(editAnnotationCancel());
28
- }
29
- else {
30
- dispatch(editAnnotationSubmit(annotation));
31
- }
32
- };
33
- const handleDelete = () => {
34
- dispatch(editAnnotationDelete());
35
- };
36
- return (React.createElement(Modal, { visible: editingAnnotation !== undefined, style: style, className: className },
37
- React.createElement(ModalHeading, null, title),
38
- React.createElement(StyledModalBody, null,
39
- React.createElement(AnnotationEditForm, { annotationId: editingAnnotation, onCancel: handleCancel, onSubmit: handleSubmit, onDelete: handleDelete }))));
40
- };
10
+ `;
11
+ /**
12
+ * A modal wrapper around AnnotationEditor.
13
+ * @param props
14
+ * @returns
15
+ */
16
+ export const ModalAnnotationEditor = ({ title, className, style, }) => {
17
+ const dispatch = useDispatch();
18
+ const { selector } = useContext(AnnotationsModuleContext);
19
+ const editingAnnotation = useSelector((s) => selector(s).annotations.editingAnnotation);
20
+ const handleCancel = () => {
21
+ dispatch(editAnnotationCancel());
22
+ };
23
+ const handleSubmit = (annotation) => {
24
+ var _a;
25
+ if (((_a = annotation.content) === null || _a === void 0 ? void 0 : _a.length) === 0) {
26
+ alert("There is no content to show");
27
+ dispatch(editAnnotationCancel());
28
+ }
29
+ else {
30
+ dispatch(editAnnotationSubmit(annotation));
31
+ }
32
+ };
33
+ const handleDelete = () => {
34
+ dispatch(editAnnotationDelete());
35
+ };
36
+ return (React.createElement(Modal, { visible: editingAnnotation !== undefined, style: style, className: className },
37
+ React.createElement(ModalHeading, null, title),
38
+ React.createElement(StyledModalBody, null,
39
+ React.createElement(AnnotationEditForm, { annotationId: editingAnnotation, onCancel: handleCancel, onSubmit: handleSubmit, onDelete: handleDelete }))));
40
+ };
41
41
  //# sourceMappingURL=ModalAnnotationEditor.js.map
@@ -1,30 +1,30 @@
1
- declare type FormatNumberArgs = {
2
- /**
3
- * The value to be formatted.
4
- */
5
- value?: number;
6
- /**
7
- * How many character should be added to the start of the number.
8
- */
9
- padStart?: number;
10
- /**
11
- * The char to use as padding character.
12
- */
13
- padChar?: string;
14
- /**
15
- * The amount of decimals to display.
16
- */
17
- decimals?: number;
18
- /**
19
- * The unit to display.
20
- */
21
- unit?: string;
22
- };
23
- /**
24
- * Formats a given number.
25
- * @param args
26
- * @returns
27
- */
28
- export declare const formatNumber: ({ value, decimals, padStart, padChar, unit, }: FormatNumberArgs) => string;
29
- export {};
1
+ declare type FormatNumberArgs = {
2
+ /**
3
+ * The value to be formatted.
4
+ */
5
+ value?: number;
6
+ /**
7
+ * How many character should be added to the start of the number.
8
+ */
9
+ padStart?: number;
10
+ /**
11
+ * The char to use as padding character.
12
+ */
13
+ padChar?: string;
14
+ /**
15
+ * The amount of decimals to display.
16
+ */
17
+ decimals?: number;
18
+ /**
19
+ * The unit to display.
20
+ */
21
+ unit?: string;
22
+ };
23
+ /**
24
+ * Formats a given number.
25
+ * @param args
26
+ * @returns
27
+ */
28
+ export declare const formatNumber: ({ value, decimals, padStart, padChar, unit, }: FormatNumberArgs) => string;
29
+ export {};
30
30
  //# sourceMappingURL=formatNumber.d.ts.map
@@ -1,13 +1,13 @@
1
- /**
2
- * Formats a given number.
3
- * @param args
4
- * @returns
5
- */
6
- export const formatNumber = ({ value = 0, decimals = 0, padStart = 2, padChar = ` `, unit = "", }) => {
7
- const withDecimals = value.toFixed(decimals);
8
- const finalPadTo = padStart + (decimals > 0 ? 1 : 0) + decimals;
9
- const str = withDecimals.padStart(finalPadTo, padChar);
10
- const strWithUnit = unit !== "" ? str + " " + unit : str;
11
- return strWithUnit;
12
- };
1
+ /**
2
+ * Formats a given number.
3
+ * @param args
4
+ * @returns
5
+ */
6
+ export const formatNumber = ({ value = 0, decimals = 0, padStart = 2, padChar = ` `, unit = "", }) => {
7
+ const withDecimals = value.toFixed(decimals);
8
+ const finalPadTo = padStart + (decimals > 0 ? 1 : 0) + decimals;
9
+ const str = withDecimals.padStart(finalPadTo, padChar);
10
+ const strWithUnit = unit !== "" ? str + " " + unit : str;
11
+ return strWithUnit;
12
+ };
13
13
  //# sourceMappingURL=formatNumber.js.map
@@ -0,0 +1,15 @@
1
+ import { MeasurementsTypes } from "@insync-stageplayer/measurements";
2
+ /**
3
+ * A hook that registers the consuming component in the MeasurementDisplayDataContext.
4
+ * @param measurementId
5
+ * @returns
6
+ */
7
+ export declare const useMeasurementDisplayData: (measurement?: MeasurementsTypes.Measurement) => {
8
+ loading: boolean;
9
+ error: Error | undefined;
10
+ data: {
11
+ x: number | "NaN";
12
+ y: number | "NaN";
13
+ } | undefined;
14
+ };
15
+ //# sourceMappingURL=useMeasurementDisplayData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMeasurementDisplayData.d.ts","sourceRoot":"","sources":["../../src/hooks/useMeasurementDisplayData.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAIrE;;;;GAIG;AAEH,eAAO,MAAM,yBAAyB,iBACtB,kBAAkB,WAAW;;;;;;;CAyC5C,CAAC"}
@@ -0,0 +1,40 @@
1
+ import { useContext, useEffect } from "react";
2
+ import { MeasurementDisplayDataContext } from "../components/MeasurementDisplayDataContext";
3
+ import { useTheme } from "@insync-stageplayer/ui-components";
4
+ /**
5
+ * A hook that registers the consuming component in the MeasurementDisplayDataContext.
6
+ * @param measurementId
7
+ * @returns
8
+ */
9
+ export const useMeasurementDisplayData = (measurement) => {
10
+ const { register, data: allData, loading, error, } = useContext(MeasurementDisplayDataContext);
11
+ const selectedTheme = useTheme();
12
+ useEffect(() => {
13
+ if (!measurement)
14
+ return;
15
+ const unregister = register(measurement);
16
+ return () => {
17
+ unregister();
18
+ };
19
+ }, [register, measurement]);
20
+ const data = measurement &&
21
+ allData &&
22
+ allData[measurement === null || measurement === void 0 ? void 0 : measurement.id] &&
23
+ allData[measurement === null || measurement === void 0 ? void 0 : measurement.id][0]
24
+ ? selectedTheme.name === "noldus"
25
+ ? {
26
+ x: allData[measurement === null || measurement === void 0 ? void 0 : measurement.id][0][0],
27
+ y: allData[measurement === null || measurement === void 0 ? void 0 : measurement.id][0][1],
28
+ }
29
+ : {
30
+ x: allData[measurement === null || measurement === void 0 ? void 0 : measurement.id][0][0],
31
+ y: allData[measurement === null || measurement === void 0 ? void 0 : measurement.id][1][0],
32
+ }
33
+ : undefined;
34
+ return {
35
+ loading,
36
+ error,
37
+ data,
38
+ };
39
+ };
40
+ //# sourceMappingURL=useMeasurementDisplayData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMeasurementDisplayData.js","sourceRoot":"","sources":["../../src/hooks/useMeasurementDisplayData.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9C,OAAO,EAAE,6BAA6B,EAAE,MAAM,6CAA6C,CAAC;AAC5F,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAE7D;;;;GAIG;AAEH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CACvC,WAA2C,EAC3C,EAAE;IACF,MAAM,EACJ,QAAQ,EACR,IAAI,EAAE,OAAO,EACb,OAAO,EACP,KAAK,GACN,GAAG,UAAU,CAAC,6BAA6B,CAAC,CAAC;IAE9C,MAAM,aAAa,GAAG,QAAQ,EAAE,CAAC;IAEjC,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,WAAW;YAAE,OAAO;QACzB,MAAM,UAAU,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC;QAEzC,OAAO,GAAG,EAAE;YACV,UAAU,EAAE,CAAC;QACf,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC;IAE5B,MAAM,IAAI,GACR,WAAW;QACX,OAAO;QACP,OAAO,CAAC,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,EAAE,CAAC;QACxB,OAAO,CAAC,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,EAAE,CAAC,CAAC,CAAC,CAAC;QACzB,CAAC,CAAC,aAAa,CAAC,IAAI,KAAK,QAAQ;YAC/B,CAAC,CAAC;gBACE,CAAC,EAAE,OAAO,CAAC,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACjC,CAAC,EAAE,OAAO,CAAC,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;aAClC;YACH,CAAC,CAAC;gBACE,CAAC,EAAE,OAAO,CAAC,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACjC,CAAC,EAAE,OAAO,CAAC,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;aAClC;QACL,CAAC,CAAC,SAAS,CAAC;IAEhB,OAAO;QACL,OAAO;QACP,KAAK;QACL,IAAI;KACL,CAAC;AACJ,CAAC,CAAC"}
package/lib/index.d.ts CHANGED
@@ -1,8 +1,9 @@
1
- import * as actions from "./redux/actions";
2
- export * from "./components/AnnotationsModuleProvider";
3
- export * from "./components/AnnotationsViewer";
4
- export * from "./redux/reducer";
5
- export * from "./components/ModalAnnotationEditor";
6
- export * from "./components/MeasurementDisplayDataProvider";
7
- export { actions };
1
+ import * as actions from "./redux/actions";
2
+ export * from "./components/AnnotationsModuleProvider";
3
+ export * from "./components/AnnotationsViewer";
4
+ export * from "./redux/reducer";
5
+ export * from "./components/ModalAnnotationEditor";
6
+ export * from "./components/MeasurementDisplayDataProvider";
7
+ export * from "./hooks/useMeasurementDisplayData";
8
+ export { actions };
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAC;AAE3C,cAAc,wCAAwC,CAAC;AACvD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iBAAiB,CAAC;AAChC,cAAc,oCAAoC,CAAC;AACnD,cAAc,6CAA6C,CAAC;AAE5D,OAAO,EAAE,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAC;AAE3C,cAAc,wCAAwC,CAAC;AACvD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iBAAiB,CAAC;AAChC,cAAc,oCAAoC,CAAC;AACnD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,mCAAmC,CAAC;AAElD,OAAO,EAAE,OAAO,EAAE,CAAC"}
package/lib/index.js CHANGED
@@ -1,8 +1,9 @@
1
- import * as actions from "./redux/actions";
2
- export * from "./components/AnnotationsModuleProvider";
3
- export * from "./components/AnnotationsViewer";
4
- export * from "./redux/reducer";
5
- export * from "./components/ModalAnnotationEditor";
6
- export * from "./components/MeasurementDisplayDataProvider";
7
- export { actions };
1
+ import * as actions from "./redux/actions";
2
+ export * from "./components/AnnotationsModuleProvider";
3
+ export * from "./components/AnnotationsViewer";
4
+ export * from "./redux/reducer";
5
+ export * from "./components/ModalAnnotationEditor";
6
+ export * from "./components/MeasurementDisplayDataProvider";
7
+ export * from "./hooks/useMeasurementDisplayData";
8
+ export { actions };
8
9
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAC;AAE3C,cAAc,wCAAwC,CAAC;AACvD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iBAAiB,CAAC;AAChC,cAAc,oCAAoC,CAAC;AACnD,cAAc,6CAA6C,CAAC;AAE5D,OAAO,EAAE,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAC;AAE3C,cAAc,wCAAwC,CAAC;AACvD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iBAAiB,CAAC;AAChC,cAAc,oCAAoC,CAAC;AACnD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,mCAAmC,CAAC;AAElD,OAAO,EAAE,OAAO,EAAE,CAAC"}
@@ -1,2 +1,2 @@
1
- export { editAnnotation, editAnnotationCancel, editAnnotationSubmit, editAnnotationDelete, createAnnotation, createAnnotations, updateAnnotation, deleteAnnotation, } from "./annotations.slice";
1
+ export { editAnnotation, editAnnotationCancel, editAnnotationSubmit, editAnnotationDelete, createAnnotation, createAnnotations, updateAnnotation, deleteAnnotation, } from "./annotations.slice";
2
2
  //# sourceMappingURL=actions.d.ts.map
@@ -1,2 +1,2 @@
1
- export { editAnnotation, editAnnotationCancel, editAnnotationSubmit, editAnnotationDelete, createAnnotation, createAnnotations, updateAnnotation, deleteAnnotation, } from "./annotations.slice";
1
+ export { editAnnotation, editAnnotationCancel, editAnnotationSubmit, editAnnotationDelete, createAnnotation, createAnnotations, updateAnnotation, deleteAnnotation, } from "./annotations.slice";
2
2
  //# sourceMappingURL=actions.js.map
@@ -1,38 +1,38 @@
1
- import { Node } from "slate";
2
- import { Annotation } from "./annotations.slice";
3
- declare type EditingAnnotation = Omit<Annotation, "id"> & {
4
- id: string | undefined;
5
- };
6
- export declare const initEditor: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<Annotation | undefined, string>, updateContent: import("@reduxjs/toolkit").ActionCreatorWithPayload<Node[], string>, pickMeasurement: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, pickMeasurementChoose: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, pickMeasurementSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, pickMeasurementClose: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, pickMeasurementSubmit: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, pickMeasurementFail: import("@reduxjs/toolkit").ActionCreatorWithPayload<Error, string>, editDisplay: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, finishEditingDisplay: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
7
- declare const _default: import("redux").Reducer<{
8
- /**
9
- * The current annotation being edited.
10
- */
11
- annotation: EditingAnnotation;
12
- /**
13
- * The current displays added to the editor. We're tracking this so they can be added or deleted
14
- * depending on whether the editor is submitted or cancelled.
15
- */
16
- displays: {
17
- added: string[];
18
- deleted: string[];
19
- };
20
- /**
21
- * When set to true, will show a measurement chooser.
22
- */
23
- pickingMeasurement: boolean;
24
- /**
25
- * The measurement chosen in the measurement chooser.
26
- */
27
- chosenMeasurement: string | null;
28
- /**
29
- * An error that might have ocurred while selecting a measurement.
30
- */
31
- pickingMeasurementError: Error | null;
32
- /**
33
- * The MeasurementDisplay currently being editted.
34
- */
35
- editingMeasurementDisplay: string | null;
36
- }, import("redux").AnyAction>;
37
- export default _default;
1
+ import { Node } from "slate";
2
+ import { Annotation } from "./annotations.slice";
3
+ declare type EditingAnnotation = Omit<Annotation, "id"> & {
4
+ id: string | undefined;
5
+ };
6
+ export declare const initEditor: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<Annotation | undefined, "annotationEditor/initEditor">, updateContent: import("@reduxjs/toolkit").ActionCreatorWithPayload<Node[], "annotationEditor/updateContent">, pickMeasurement: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"annotationEditor/pickMeasurement">, pickMeasurementChoose: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "annotationEditor/pickMeasurementChoose">, pickMeasurementSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "annotationEditor/pickMeasurementSuccess">, pickMeasurementClose: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"annotationEditor/pickMeasurementClose">, pickMeasurementSubmit: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"annotationEditor/pickMeasurementSubmit">, pickMeasurementFail: import("@reduxjs/toolkit").ActionCreatorWithPayload<Error, "annotationEditor/pickMeasurementFail">, editDisplay: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "annotationEditor/editDisplay">, finishEditingDisplay: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"annotationEditor/finishEditingDisplay">;
7
+ declare const _default: import("redux").Reducer<{
8
+ /**
9
+ * The current annotation being edited.
10
+ */
11
+ annotation: EditingAnnotation;
12
+ /**
13
+ * The current displays added to the editor. We're tracking this so they can be added or deleted
14
+ * depending on whether the editor is submitted or cancelled.
15
+ */
16
+ displays: {
17
+ added: string[];
18
+ deleted: string[];
19
+ };
20
+ /**
21
+ * When set to true, will show a measurement chooser.
22
+ */
23
+ pickingMeasurement: boolean;
24
+ /**
25
+ * The measurement chosen in the measurement chooser.
26
+ */
27
+ chosenMeasurement: string | null;
28
+ /**
29
+ * An error that might have ocurred while selecting a measurement.
30
+ */
31
+ pickingMeasurementError: Error | null;
32
+ /**
33
+ * The MeasurementDisplay currently being editted.
34
+ */
35
+ editingMeasurementDisplay: string | null;
36
+ }, import("redux").AnyAction>;
37
+ export default _default;
38
38
  //# sourceMappingURL=annotationEditor.slice.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"annotationEditor.slice.d.ts","sourceRoot":"","sources":["../../src/redux/annotationEditor.slice.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,aAAK,iBAAiB,GAAG,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,GAAG;IAChD,EAAE,EAAE,MAAM,GAAG,SAAS,CAAC;CACxB,CAAC;AAoIF,eAAO,MACL,UAAU,+FACV,aAAa,uEACb,eAAe,kEACf,qBAAqB,uEACrB,sBAAsB,uEACtB,oBAAoB,kEACpB,qBAAqB,kEACrB,mBAAmB,sEACnB,WAAW,uEACX,oBAAoB,gEACW,CAAC;;IAhIhC;;OAEG;;IAEH;;;OAGG;;;;;IAKH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;;AAwGL,wBAA6C"}
1
+ {"version":3,"file":"annotationEditor.slice.d.ts","sourceRoot":"","sources":["../../src/redux/annotationEditor.slice.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,aAAK,iBAAiB,GAAG,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,GAAG;IAChD,EAAE,EAAE,MAAM,GAAG,SAAS,CAAC;CACxB,CAAC;AAoIF,eAAO,MACL,UAAU,sHACV,aAAa,iGACb,eAAe,8FACf,qBAAqB,yGACrB,sBAAsB,0GACtB,oBAAoB,mGACpB,qBAAqB,oGACrB,mBAAmB,sGACnB,WAAW,+FACX,oBAAoB,iGACW,CAAC;;IAhIhC;;OAEG;;IAEH;;;OAGG;;;;;IAKH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;;AAwGL,wBAA6C"}