@trackunit/react-core-contexts 0.4.514 → 0.4.516

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
@@ -394,6 +394,22 @@ const OemBrandingContextProviderIrisApp = ({ children }) => {
394
394
  return jsxRuntime.jsx(reactCoreHooks.OemBrandingContextProvider, { value: oemBrandingContext, children: children });
395
395
  };
396
396
 
397
+ /**
398
+ * This is a provider for the ToastContext.
399
+ */
400
+ const ThemeCssProviderIrisApp = ({ children }) => {
401
+ React.useEffect(() => {
402
+ irisAppRuntimeCore.ThemeCssRuntime.getThemeCssProperties().then(css => {
403
+ if (css) {
404
+ Object.entries(css).forEach(([key, value]) => {
405
+ document.body.style.setProperty(key, value);
406
+ });
407
+ }
408
+ });
409
+ }, []);
410
+ return jsxRuntime.jsx(jsxRuntime.Fragment, { children: children });
411
+ };
412
+
397
413
  /**
398
414
  * This is a provider for the ToastContext.
399
415
  */
@@ -496,7 +512,7 @@ const TrackunitProviders = ({ translations, children }) => {
496
512
  i18nLibraryTranslation.registerTranslations(translations); // Register the apps translations if passed.
497
513
  }
498
514
  i18nLibraryTranslation.initializeTranslationsForApp(); // Initialize all registered translations
499
- return (jsxRuntime.jsx(EnvironmentProviderIrisApp, { children: jsxRuntime.jsx(TokenProviderIrisApp, { children: jsxRuntime.jsx(CurrentUserPreferenceProviderIrisApp, { children: jsxRuntime.jsx(CurrentUserProviderIrisApp, { children: jsxRuntime.jsx(UserSubscriptionProviderIrisApp, { children: jsxRuntime.jsx(AnalyticsProviderIrisApp, { children: jsxRuntime.jsx(OemBrandingContextProviderIrisApp, { children: jsxRuntime.jsx(AssetSortingProviderIrisApp, { children: jsxRuntime.jsx(ManagerApolloProvider, { children: jsxRuntime.jsx(NavigationProviderIrisApp, { children: jsxRuntime.jsx(ToastProviderIrisApp, { children: jsxRuntime.jsx(ModalDialogContextProviderIrisApp, { children: jsxRuntime.jsx(ConfirmationDialogProviderIrisApp, { children: jsxRuntime.jsx(FilterBarProviderIrisApp, { children: jsxRuntime.jsx(React__namespace.Suspense, { fallback: jsxRuntime.jsx(reactComponents.Spinner, { centering: "centered", dataTestId: "trackunit-providers" }), children: children }) }) }) }) }) }) }) }) }) }) }) }) }) }) }));
515
+ return (jsxRuntime.jsx(EnvironmentProviderIrisApp, { children: jsxRuntime.jsx(ThemeCssProviderIrisApp, { children: jsxRuntime.jsx(TokenProviderIrisApp, { children: jsxRuntime.jsx(CurrentUserPreferenceProviderIrisApp, { children: jsxRuntime.jsx(CurrentUserProviderIrisApp, { children: jsxRuntime.jsx(UserSubscriptionProviderIrisApp, { children: jsxRuntime.jsx(AnalyticsProviderIrisApp, { children: jsxRuntime.jsx(OemBrandingContextProviderIrisApp, { children: jsxRuntime.jsx(AssetSortingProviderIrisApp, { children: jsxRuntime.jsx(ManagerApolloProvider, { children: jsxRuntime.jsx(NavigationProviderIrisApp, { children: jsxRuntime.jsx(ToastProviderIrisApp, { children: jsxRuntime.jsx(ModalDialogContextProviderIrisApp, { children: jsxRuntime.jsx(ConfirmationDialogProviderIrisApp, { children: jsxRuntime.jsx(FilterBarProviderIrisApp, { children: jsxRuntime.jsx(React__namespace.Suspense, { fallback: jsxRuntime.jsx(reactComponents.Spinner, { centering: "centered", dataTestId: "trackunit-providers" }), children: children }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }));
500
516
  };
501
517
 
502
518
  exports.ManagerApolloProvider = ManagerApolloProvider;
package/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { jsx } from 'react/jsx-runtime';
1
+ import { jsx, Fragment } from 'react/jsx-runtime';
2
2
  import { ApolloProvider, ApolloClient, InMemoryCache, from, split } from '@apollo/client';
3
3
  import { setContext } from '@apollo/client/link/context';
4
4
  import { onError } from '@apollo/client/link/error';
@@ -10,7 +10,7 @@ import { useRef, useMemo, useEffect, useState } from 'react';
10
10
  import '@js-temporal/polyfill';
11
11
  import { registerTranslations, initializeTranslationsForApp } from '@trackunit/i18n-library-translation';
12
12
  import { Spinner } from '@trackunit/react-components';
13
- import { AnalyticsContextRuntime, setupHostConnector, AssetSortingRuntime, ConfirmationDialogRuntime, EnvironmentRuntime, FilterBarRuntime, ModalDialogRuntime, NavigationRuntime, OemBrandingContextRuntime, ToastRuntime, TokenRuntime, CurrentUserRuntime, CurrentUserPreferenceRuntime, UserSubscriptionRuntime } from '@trackunit/iris-app-runtime-core';
13
+ import { AnalyticsContextRuntime, setupHostConnector, AssetSortingRuntime, ConfirmationDialogRuntime, EnvironmentRuntime, FilterBarRuntime, ModalDialogRuntime, NavigationRuntime, OemBrandingContextRuntime, ThemeCssRuntime, ToastRuntime, TokenRuntime, CurrentUserRuntime, CurrentUserPreferenceRuntime, UserSubscriptionRuntime } from '@trackunit/iris-app-runtime-core';
14
14
 
15
15
  /******************************************************************************
16
16
  Copyright (c) Microsoft Corporation.
@@ -370,6 +370,22 @@ const OemBrandingContextProviderIrisApp = ({ children }) => {
370
370
  return jsx(OemBrandingContextProvider, { value: oemBrandingContext, children: children });
371
371
  };
372
372
 
373
+ /**
374
+ * This is a provider for the ToastContext.
375
+ */
376
+ const ThemeCssProviderIrisApp = ({ children }) => {
377
+ useEffect(() => {
378
+ ThemeCssRuntime.getThemeCssProperties().then(css => {
379
+ if (css) {
380
+ Object.entries(css).forEach(([key, value]) => {
381
+ document.body.style.setProperty(key, value);
382
+ });
383
+ }
384
+ });
385
+ }, []);
386
+ return jsx(Fragment, { children: children });
387
+ };
388
+
373
389
  /**
374
390
  * This is a provider for the ToastContext.
375
391
  */
@@ -472,7 +488,7 @@ const TrackunitProviders = ({ translations, children }) => {
472
488
  registerTranslations(translations); // Register the apps translations if passed.
473
489
  }
474
490
  initializeTranslationsForApp(); // Initialize all registered translations
475
- return (jsx(EnvironmentProviderIrisApp, { children: jsx(TokenProviderIrisApp, { children: jsx(CurrentUserPreferenceProviderIrisApp, { children: jsx(CurrentUserProviderIrisApp, { children: jsx(UserSubscriptionProviderIrisApp, { children: jsx(AnalyticsProviderIrisApp, { children: jsx(OemBrandingContextProviderIrisApp, { children: jsx(AssetSortingProviderIrisApp, { children: jsx(ManagerApolloProvider, { children: jsx(NavigationProviderIrisApp, { children: jsx(ToastProviderIrisApp, { children: jsx(ModalDialogContextProviderIrisApp, { children: jsx(ConfirmationDialogProviderIrisApp, { children: jsx(FilterBarProviderIrisApp, { children: jsx(React.Suspense, { fallback: jsx(Spinner, { centering: "centered", dataTestId: "trackunit-providers" }), children: children }) }) }) }) }) }) }) }) }) }) }) }) }) }) }));
491
+ return (jsx(EnvironmentProviderIrisApp, { children: jsx(ThemeCssProviderIrisApp, { children: jsx(TokenProviderIrisApp, { children: jsx(CurrentUserPreferenceProviderIrisApp, { children: jsx(CurrentUserProviderIrisApp, { children: jsx(UserSubscriptionProviderIrisApp, { children: jsx(AnalyticsProviderIrisApp, { children: jsx(OemBrandingContextProviderIrisApp, { children: jsx(AssetSortingProviderIrisApp, { children: jsx(ManagerApolloProvider, { children: jsx(NavigationProviderIrisApp, { children: jsx(ToastProviderIrisApp, { children: jsx(ModalDialogContextProviderIrisApp, { children: jsx(ConfirmationDialogProviderIrisApp, { children: jsx(FilterBarProviderIrisApp, { children: jsx(React.Suspense, { fallback: jsx(Spinner, { centering: "centered", dataTestId: "trackunit-providers" }), children: children }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }));
476
492
  };
477
493
 
478
494
  export { ManagerApolloProvider, ToastProviderIrisApp, TrackunitProviders };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-core-contexts",
3
- "version": "0.4.514",
3
+ "version": "0.4.516",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -0,0 +1,5 @@
1
+ import { type PropsWithChildren } from "react";
2
+ /**
3
+ * This is a provider for the ToastContext.
4
+ */
5
+ export declare const ThemeCssProviderIrisApp: ({ children }: PropsWithChildren) => JSX.Element;