@insync-stageplayer/annotations 0.5.34 → 0.5.37

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,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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insync-stageplayer/annotations",
3
- "version": "0.5.34",
3
+ "version": "0.5.37",
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": "^0.5.34",
35
+ "@insync-stageplayer/measurements": "^0.5.37",
36
36
  "@insync-stageplayer/time": "^0.5.9",
37
- "@insync-stageplayer/ui-components": "^0.5.34",
37
+ "@insync-stageplayer/ui-components": "^0.5.37",
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": "aaadb1f3a85b35035694a4ea6b360f27afa6ed48"
55
+ "gitHead": "8e2b1c35a61bfd8eb4796988d429f22019e8be43"
56
56
  }