@trackunit/react-core-contexts 1.4.2 → 1.4.3

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/index.cjs.js CHANGED
@@ -509,16 +509,18 @@ const TimeRangeProviderIrisApp = ({ children }) => {
509
509
  react.useEffect(() => {
510
510
  irisAppRuntimeCore.TimeRangeRuntime.getTimeRange()
511
511
  .catch(() => null)
512
- .then(timeRange => {
512
+ .then(result => {
513
513
  setTimeRangeContext(prev => ({
514
- timeRange: timeRange,
514
+ timeRange: result?.timeRange || null,
515
+ temporalPeriod: result?.temporalPeriod || null,
515
516
  }));
516
517
  });
517
518
  }, []);
518
519
  const methods = react.useMemo(() => ({
519
- onTimeRangeChanged: (timeRange) => {
520
+ onTimeRangeChanged: (timeRange, temporalPeriod) => {
520
521
  setTimeRangeContext(prev => ({
521
522
  timeRange: timeRange || null,
523
+ temporalPeriod: temporalPeriod || null,
522
524
  }));
523
525
  },
524
526
  }), []);
package/index.esm.js CHANGED
@@ -507,16 +507,18 @@ const TimeRangeProviderIrisApp = ({ children }) => {
507
507
  useEffect(() => {
508
508
  TimeRangeRuntime.getTimeRange()
509
509
  .catch(() => null)
510
- .then(timeRange => {
510
+ .then(result => {
511
511
  setTimeRangeContext(prev => ({
512
- timeRange: timeRange,
512
+ timeRange: result?.timeRange || null,
513
+ temporalPeriod: result?.temporalPeriod || null,
513
514
  }));
514
515
  });
515
516
  }, []);
516
517
  const methods = useMemo(() => ({
517
- onTimeRangeChanged: (timeRange) => {
518
+ onTimeRangeChanged: (timeRange, temporalPeriod) => {
518
519
  setTimeRangeContext(prev => ({
519
520
  timeRange: timeRange || null,
521
+ temporalPeriod: temporalPeriod || null,
520
522
  }));
521
523
  },
522
524
  }), []);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-core-contexts",
3
- "version": "1.4.2",
3
+ "version": "1.4.3",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -12,11 +12,11 @@
12
12
  "@js-temporal/polyfill": "^0.4.4",
13
13
  "jest-fetch-mock": "^3.0.3",
14
14
  "@trackunit/iris-app-api": "1.4.1",
15
- "@trackunit/react-core-contexts-api": "1.5.1",
16
- "@trackunit/react-core-hooks": "1.4.1",
17
- "@trackunit/i18n-library-translation": "1.4.1",
18
- "@trackunit/react-components": "1.5.2",
19
- "@trackunit/iris-app-runtime-core": "1.5.1",
15
+ "@trackunit/react-core-contexts-api": "1.5.2",
16
+ "@trackunit/react-core-hooks": "1.4.2",
17
+ "@trackunit/i18n-library-translation": "1.4.2",
18
+ "@trackunit/react-components": "1.5.3",
19
+ "@trackunit/iris-app-runtime-core": "1.5.2",
20
20
  "graphql": "^16.10.0",
21
21
  "graphql-sse": "^2.5.4",
22
22
  "@trackunit/react-test-setup": "1.1.1"