@deephaven/app-utils 0.49.2-theme-plugins.34 → 0.49.2-theme-plugins.45

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeBootstrap.d.ts","sourceRoot":"","sources":["../../src/components/ThemeBootstrap.tsx"],"names":[],"mappings":";AASA,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,EAAE,mBAAmB,GAAG,GAAG,CAAC,OAAO,CA8B7E;AAED,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"ThemeBootstrap.d.ts","sourceRoot":"","sources":["../../src/components/ThemeBootstrap.tsx"],"names":[],"mappings":";AAKA,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,EAAE,mBAAmB,GAAG,GAAG,CAAC,OAAO,CAa7E;AAED,eAAe,cAAc,CAAC"}
@@ -1,38 +1,20 @@
1
- import { getDefaultBaseThemes, ThemeContext, useInitializeThemeContextValue } from '@deephaven/components';
2
- import { useContext, useEffect } from 'react';
1
+ import { ThemeProvider } from '@deephaven/components';
2
+ import { useContext, useMemo } from 'react';
3
3
  import { getThemeDataFromPlugins } from "../plugins/index.js";
4
4
  import { PluginsContext } from "./PluginsBootstrap.js";
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
- import { jsxs as _jsxs } from "react/jsx-runtime";
7
6
  export function ThemeBootstrap(_ref) {
8
- var _themeContextValue$ac;
9
7
  var {
10
8
  children
11
9
  } = _ref;
12
- var themeContextValue = useInitializeThemeContextValue();
13
-
14
10
  // The `usePlugins` hook throws if the context value is null. Since this is
15
11
  // the state while plugins load asynchronously, we are using `useContext`
16
12
  // directly to avoid the exception.
17
13
  var pluginModules = useContext(PluginsContext);
18
- var {
19
- registerThemes
20
- } = themeContextValue;
21
- useEffect(() => {
22
- if (pluginModules == null) {
23
- return;
24
- }
25
- registerThemes({
26
- base: getDefaultBaseThemes(),
27
- custom: getThemeDataFromPlugins(pluginModules)
28
- });
29
- }, [pluginModules, registerThemes]);
30
- return /*#__PURE__*/_jsxs(ThemeContext.Provider, {
31
- value: themeContextValue,
32
- children: [(_themeContextValue$ac = themeContextValue.activeThemes) === null || _themeContextValue$ac === void 0 ? void 0 : _themeContextValue$ac.map(theme => /*#__PURE__*/_jsx("style", {
33
- "data-theme-key": theme.themeKey,
34
- children: theme.styleContent
35
- }, theme.themeKey)), children]
14
+ var themes = useMemo(() => pluginModules == null ? null : getThemeDataFromPlugins(pluginModules), [pluginModules]);
15
+ return /*#__PURE__*/_jsx(ThemeProvider, {
16
+ themes: themes,
17
+ children: children
36
18
  });
37
19
  }
38
20
  export default ThemeBootstrap;
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeBootstrap.js","names":["getDefaultBaseThemes","ThemeContext","useInitializeThemeContextValue","useContext","useEffect","getThemeDataFromPlugins","PluginsContext","ThemeBootstrap","children","themeContextValue","pluginModules","registerThemes","base","custom","activeThemes","map","theme","themeKey","styleContent"],"sources":["../../src/components/ThemeBootstrap.tsx"],"sourcesContent":["import {\n getDefaultBaseThemes,\n ThemeContext,\n useInitializeThemeContextValue,\n} from '@deephaven/components';\nimport { useContext, useEffect } from 'react';\nimport { getThemeDataFromPlugins } from '../plugins';\nimport { PluginsContext } from './PluginsBootstrap';\n\nexport interface ThemeBootstrapProps {\n children: React.ReactNode;\n}\n\nexport function ThemeBootstrap({ children }: ThemeBootstrapProps): JSX.Element {\n const themeContextValue = useInitializeThemeContextValue();\n\n // The `usePlugins` hook throws if the context value is null. Since this is\n // the state while plugins load asynchronously, we are using `useContext`\n // directly to avoid the exception.\n const pluginModules = useContext(PluginsContext);\n const { registerThemes } = themeContextValue;\n\n useEffect(() => {\n if (pluginModules == null) {\n return;\n }\n\n registerThemes({\n base: getDefaultBaseThemes(),\n custom: getThemeDataFromPlugins(pluginModules),\n });\n }, [pluginModules, registerThemes]);\n\n return (\n <ThemeContext.Provider value={themeContextValue}>\n {themeContextValue.activeThemes?.map(theme => (\n <style data-theme-key={theme.themeKey} key={theme.themeKey}>\n {theme.styleContent}\n </style>\n ))}\n {children}\n </ThemeContext.Provider>\n );\n}\n\nexport default ThemeBootstrap;\n"],"mappings":"AAAA,SACEA,oBAAoB,EACpBC,YAAY,EACZC,8BAA8B,QACzB,uBAAuB;AAC9B,SAASC,UAAU,EAAEC,SAAS,QAAQ,OAAO;AAAC,SACrCC,uBAAuB;AAAA,SACvBC,cAAc;AAAA;AAAA;AAMvB,OAAO,SAASC,cAAc,OAAiD;EAAA;EAAA,IAAhD;IAAEC;EAA8B,CAAC;EAC9D,IAAMC,iBAAiB,GAAGP,8BAA8B,EAAE;;EAE1D;EACA;EACA;EACA,IAAMQ,aAAa,GAAGP,UAAU,CAACG,cAAc,CAAC;EAChD,IAAM;IAAEK;EAAe,CAAC,GAAGF,iBAAiB;EAE5CL,SAAS,CAAC,MAAM;IACd,IAAIM,aAAa,IAAI,IAAI,EAAE;MACzB;IACF;IAEAC,cAAc,CAAC;MACbC,IAAI,EAAEZ,oBAAoB,EAAE;MAC5Ba,MAAM,EAAER,uBAAuB,CAACK,aAAa;IAC/C,CAAC,CAAC;EACJ,CAAC,EAAE,CAACA,aAAa,EAAEC,cAAc,CAAC,CAAC;EAEnC,oBACE,MAAC,YAAY,CAAC,QAAQ;IAAC,KAAK,EAAEF,iBAAkB;IAAA,oCAC7CA,iBAAiB,CAACK,YAAY,0DAA9B,sBAAgCC,GAAG,CAACC,KAAK,iBACxC;MAAO,kBAAgBA,KAAK,CAACC,QAAS;MAAA,UACnCD,KAAK,CAACE;IAAY,GADuBF,KAAK,CAACC,QAAQ,CAG3D,CAAC,EACDT,QAAQ;EAAA,EACa;AAE5B;AAEA,eAAeD,cAAc"}
1
+ {"version":3,"file":"ThemeBootstrap.js","names":["ThemeProvider","useContext","useMemo","getThemeDataFromPlugins","PluginsContext","ThemeBootstrap","children","pluginModules","themes"],"sources":["../../src/components/ThemeBootstrap.tsx"],"sourcesContent":["import { ThemeProvider } from '@deephaven/components';\nimport { useContext, useMemo } from 'react';\nimport { getThemeDataFromPlugins } from '../plugins';\nimport { PluginsContext } from './PluginsBootstrap';\n\nexport interface ThemeBootstrapProps {\n children: React.ReactNode;\n}\n\nexport function ThemeBootstrap({ children }: ThemeBootstrapProps): JSX.Element {\n // The `usePlugins` hook throws if the context value is null. Since this is\n // the state while plugins load asynchronously, we are using `useContext`\n // directly to avoid the exception.\n const pluginModules = useContext(PluginsContext);\n\n const themes = useMemo(\n () =>\n pluginModules == null ? null : getThemeDataFromPlugins(pluginModules),\n [pluginModules]\n );\n\n return <ThemeProvider themes={themes}>{children}</ThemeProvider>;\n}\n\nexport default ThemeBootstrap;\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,uBAAuB;AACrD,SAASC,UAAU,EAAEC,OAAO,QAAQ,OAAO;AAAC,SACnCC,uBAAuB;AAAA,SACvBC,cAAc;AAAA;AAMvB,OAAO,SAASC,cAAc,OAAiD;EAAA,IAAhD;IAAEC;EAA8B,CAAC;EAC9D;EACA;EACA;EACA,IAAMC,aAAa,GAAGN,UAAU,CAACG,cAAc,CAAC;EAEhD,IAAMI,MAAM,GAAGN,OAAO,CACpB,MACEK,aAAa,IAAI,IAAI,GAAG,IAAI,GAAGJ,uBAAuB,CAACI,aAAa,CAAC,EACvE,CAACA,aAAa,CAAC,CAChB;EAED,oBAAO,KAAC,aAAa;IAAC,MAAM,EAAEC,MAAO;IAAA,UAAEF;EAAQ,EAAiB;AAClE;AAEA,eAAeD,cAAc"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deephaven/app-utils",
3
- "version": "0.49.2-theme-plugins.34+a1a4bfd9",
3
+ "version": "0.49.2-theme-plugins.45+2d9d2fa7",
4
4
  "description": "Deephaven App Utils",
5
5
  "author": "Deephaven Data Labs LLC",
6
6
  "license": "Apache-2.0",
@@ -28,17 +28,17 @@
28
28
  "redux": "^4.x"
29
29
  },
30
30
  "dependencies": {
31
- "@deephaven/auth-plugins": "^0.49.2-theme-plugins.34+a1a4bfd9",
32
- "@deephaven/components": "^0.49.2-theme-plugins.34+a1a4bfd9",
33
- "@deephaven/jsapi-bootstrap": "^0.49.2-theme-plugins.34+a1a4bfd9",
34
- "@deephaven/jsapi-components": "^0.49.2-theme-plugins.34+a1a4bfd9",
35
- "@deephaven/jsapi-types": "^0.49.2-theme-plugins.34+a1a4bfd9",
36
- "@deephaven/jsapi-utils": "^0.49.2-theme-plugins.34+a1a4bfd9",
37
- "@deephaven/log": "^0.49.2-theme-plugins.34+a1a4bfd9",
38
- "@deephaven/plugin": "^0.49.2-theme-plugins.34+a1a4bfd9",
39
- "@deephaven/react-hooks": "^0.49.2-theme-plugins.34+a1a4bfd9",
40
- "@deephaven/redux": "^0.49.2-theme-plugins.34+a1a4bfd9",
41
- "@deephaven/utils": "^0.49.2-theme-plugins.34+a1a4bfd9",
31
+ "@deephaven/auth-plugins": "^0.49.2-theme-plugins.45+2d9d2fa7",
32
+ "@deephaven/components": "^0.49.2-theme-plugins.45+2d9d2fa7",
33
+ "@deephaven/jsapi-bootstrap": "^0.49.2-theme-plugins.45+2d9d2fa7",
34
+ "@deephaven/jsapi-components": "^0.49.2-theme-plugins.45+2d9d2fa7",
35
+ "@deephaven/jsapi-types": "^0.49.2-theme-plugins.45+2d9d2fa7",
36
+ "@deephaven/jsapi-utils": "^0.49.2-theme-plugins.45+2d9d2fa7",
37
+ "@deephaven/log": "^0.49.2-theme-plugins.45+2d9d2fa7",
38
+ "@deephaven/plugin": "^0.49.2-theme-plugins.45+2d9d2fa7",
39
+ "@deephaven/react-hooks": "^0.49.2-theme-plugins.45+2d9d2fa7",
40
+ "@deephaven/redux": "^0.49.2-theme-plugins.45+2d9d2fa7",
41
+ "@deephaven/utils": "^0.49.2-theme-plugins.45+2d9d2fa7",
42
42
  "@paciolan/remote-component": "2.13.0",
43
43
  "@paciolan/remote-module-loader": "^3.0.2",
44
44
  "fira": "mozilla/fira#4.202"
@@ -58,5 +58,5 @@
58
58
  "publishConfig": {
59
59
  "access": "public"
60
60
  },
61
- "gitHead": "a1a4bfd93b2144647a2147ef963332d51d1722e3"
61
+ "gitHead": "2d9d2fa7116f00b55aec65ed41db7042e2a87e17"
62
62
  }