@deephaven/app-utils 0.107.3-alpha-parent-theme.13 → 0.107.3-alpha-parent-theme.16

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,EAC7B,QAAQ,GACT,EAAE,mBAAmB,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAyB1C;AAED,eAAe,cAAc,CAAC"}
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,EAC7B,QAAQ,GACT,EAAE,mBAAmB,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CA8C1C;AAED,eAAe,cAAc,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { useContext, useMemo } from 'react';
2
2
  import { ChartThemeProvider } from '@deephaven/chart';
3
3
  import { MonacoThemeProvider } from '@deephaven/console';
4
- import { ThemeProvider } from '@deephaven/components';
4
+ import { ThemeProvider, useParentWindowTheme } from '@deephaven/components';
5
5
  import { IrisGridThemeProvider } from '@deephaven/iris-grid';
6
6
  import { getThemeDataFromPlugins, PluginsContext } from '@deephaven/plugin';
7
7
  import { getSettings } from '@deephaven/redux';
@@ -11,11 +11,28 @@ export function ThemeBootstrap(_ref) {
11
11
  var {
12
12
  children
13
13
  } = _ref;
14
+ var {
15
+ isEnabled: isParentThemeEnabled,
16
+ isPending: isParentThemePending,
17
+ themeData: parentThemeData
18
+ } = useParentWindowTheme();
19
+
14
20
  // The `usePlugins` hook throws if the context value is null. Since this is
15
21
  // the state while plugins load asynchronously, we are using `useContext`
16
22
  // directly to avoid the exception.
17
23
  var pluginModules = useContext(PluginsContext);
18
- var themes = useMemo(() => pluginModules == null ? null : getThemeDataFromPlugins(pluginModules), [pluginModules]);
24
+ var themes = useMemo(() => {
25
+ // Get theme from parent window via `postMessage` apis
26
+ if (isParentThemeEnabled) {
27
+ if (isParentThemePending) {
28
+ return null;
29
+ }
30
+ return parentThemeData ? [parentThemeData] : [];
31
+ }
32
+
33
+ // Get themes from plugins
34
+ return pluginModules == null ? null : getThemeDataFromPlugins(pluginModules);
35
+ }, [isParentThemeEnabled, isParentThemePending, parentThemeData, pluginModules]);
19
36
  var settings = useAppSelector(getSettings);
20
37
  return /*#__PURE__*/_jsx(ThemeProvider, {
21
38
  themes: themes,
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeBootstrap.js","names":["useContext","useMemo","ChartThemeProvider","MonacoThemeProvider","ThemeProvider","IrisGridThemeProvider","getThemeDataFromPlugins","PluginsContext","getSettings","useAppSelector","jsx","_jsx","ThemeBootstrap","_ref","children","pluginModules","themes","settings","density","gridDensity"],"sources":["../../src/components/ThemeBootstrap.tsx"],"sourcesContent":["import { useContext, useMemo } from 'react';\nimport { ChartThemeProvider } from '@deephaven/chart';\nimport { MonacoThemeProvider } from '@deephaven/console';\nimport { ThemeProvider } from '@deephaven/components';\nimport { IrisGridThemeProvider } from '@deephaven/iris-grid';\nimport { getThemeDataFromPlugins, PluginsContext } from '@deephaven/plugin';\nimport { getSettings } from '@deephaven/redux';\nimport { useAppSelector } from '@deephaven/dashboard';\n\nexport interface ThemeBootstrapProps {\n children: React.ReactNode;\n}\n\nexport function ThemeBootstrap({\n children,\n}: ThemeBootstrapProps): JSX.Element | null {\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 const settings = useAppSelector(getSettings);\n\n return (\n <ThemeProvider themes={themes}>\n <ChartThemeProvider>\n <MonacoThemeProvider>\n <IrisGridThemeProvider density={settings.gridDensity}>\n {children}\n </IrisGridThemeProvider>\n </MonacoThemeProvider>\n </ChartThemeProvider>\n </ThemeProvider>\n );\n}\n\nexport default ThemeBootstrap;\n"],"mappings":"AAAA,SAASA,UAAU,EAAEC,OAAO,QAAQ,OAAO;AAC3C,SAASC,kBAAkB,QAAQ,kBAAkB;AACrD,SAASC,mBAAmB,QAAQ,oBAAoB;AACxD,SAASC,aAAa,QAAQ,uBAAuB;AACrD,SAASC,qBAAqB,QAAQ,sBAAsB;AAC5D,SAASC,uBAAuB,EAAEC,cAAc,QAAQ,mBAAmB;AAC3E,SAASC,WAAW,QAAQ,kBAAkB;AAC9C,SAASC,cAAc,QAAQ,sBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAMtD,OAAO,SAASC,cAAcA,CAAAC,IAAA,EAEc;EAAA,IAFb;IAC7BC;EACmB,CAAC,GAAAD,IAAA;EACpB;EACA;EACA;EACA,IAAME,aAAa,GAAGf,UAAU,CAACO,cAAc,CAAC;EAEhD,IAAMS,MAAM,GAAGf,OAAO,CACpB,MACEc,aAAa,IAAI,IAAI,GAAG,IAAI,GAAGT,uBAAuB,CAACS,aAAa,CAAC,EACvE,CAACA,aAAa,CAChB,CAAC;EAED,IAAME,QAAQ,GAAGR,cAAc,CAACD,WAAW,CAAC;EAE5C,oBACEG,IAAA,CAACP,aAAa;IAACY,MAAM,EAAEA,MAAO;IAAAF,QAAA,eAC5BH,IAAA,CAACT,kBAAkB;MAAAY,QAAA,eACjBH,IAAA,CAACR,mBAAmB;QAAAW,QAAA,eAClBH,IAAA,CAACN,qBAAqB;UAACa,OAAO,EAAED,QAAQ,CAACE,WAAY;UAAAL,QAAA,EAClDA;QAAQ,CACY;MAAC,CACL;IAAC,CACJ;EAAC,CACR,CAAC;AAEpB;AAEA,eAAeF,cAAc"}
1
+ {"version":3,"file":"ThemeBootstrap.js","names":["useContext","useMemo","ChartThemeProvider","MonacoThemeProvider","ThemeProvider","useParentWindowTheme","IrisGridThemeProvider","getThemeDataFromPlugins","PluginsContext","getSettings","useAppSelector","jsx","_jsx","ThemeBootstrap","_ref","children","isEnabled","isParentThemeEnabled","isPending","isParentThemePending","themeData","parentThemeData","pluginModules","themes","settings","density","gridDensity"],"sources":["../../src/components/ThemeBootstrap.tsx"],"sourcesContent":["import { useContext, useMemo } from 'react';\nimport { ChartThemeProvider } from '@deephaven/chart';\nimport { MonacoThemeProvider } from '@deephaven/console';\nimport { ThemeProvider, useParentWindowTheme } from '@deephaven/components';\nimport { IrisGridThemeProvider } from '@deephaven/iris-grid';\nimport { getThemeDataFromPlugins, PluginsContext } from '@deephaven/plugin';\nimport { getSettings } from '@deephaven/redux';\nimport { useAppSelector } from '@deephaven/dashboard';\n\nexport interface ThemeBootstrapProps {\n children: React.ReactNode;\n}\n\nexport function ThemeBootstrap({\n children,\n}: ThemeBootstrapProps): JSX.Element | null {\n const {\n isEnabled: isParentThemeEnabled,\n isPending: isParentThemePending,\n themeData: parentThemeData,\n } = useParentWindowTheme();\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\n const themes = useMemo(() => {\n // Get theme from parent window via `postMessage` apis\n if (isParentThemeEnabled) {\n if (isParentThemePending) {\n return null;\n }\n\n return parentThemeData ? [parentThemeData] : [];\n }\n\n // Get themes from plugins\n return pluginModules == null\n ? null\n : getThemeDataFromPlugins(pluginModules);\n }, [\n isParentThemeEnabled,\n isParentThemePending,\n parentThemeData,\n pluginModules,\n ]);\n\n const settings = useAppSelector(getSettings);\n\n return (\n <ThemeProvider themes={themes}>\n <ChartThemeProvider>\n <MonacoThemeProvider>\n <IrisGridThemeProvider density={settings.gridDensity}>\n {children}\n </IrisG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C5BH,IAAA,CAACV,kBAAkB;MAAAa,QAAA,eACjBH,IAAA,CAACT,mBAAmB;QAAAY,QAAA,eAClBH,IAAA,CAACN,qBAAqB;UAACmB,OAAO,EAAED,QAAQ,CAACE,WAAY;UAAAX,QAAA,EAClDA;QAAQ,CACY;MAAC,CACL;IAAC,CACJ;EAAC,CACR,CAAC;AAEpB;AAEA,eAAeF,cAAc"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deephaven/app-utils",
3
- "version": "0.107.3-alpha-parent-theme.13+d777c298",
3
+ "version": "0.107.3-alpha-parent-theme.16+297fec16",
4
4
  "description": "Deephaven App Utils",
5
5
  "author": "Deephaven Data Labs LLC",
6
6
  "license": "Apache-2.0",
@@ -22,7 +22,7 @@
22
22
  "build:babel": "babel ./src --out-dir ./dist --extensions \".ts,.tsx,.js,.jsx\" --source-maps --root-mode upward"
23
23
  },
24
24
  "devDependencies": {
25
- "@deephaven/test-utils": "^0.107.3-alpha-parent-theme.13+d777c298",
25
+ "@deephaven/test-utils": "^0.107.3-alpha-parent-theme.16+297fec16",
26
26
  "react": "^17.x",
27
27
  "react-dom": "^17.x",
28
28
  "react-redux": "^7.x",
@@ -30,26 +30,26 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@adobe/react-spectrum": "3.38.0",
33
- "@deephaven/auth-plugins": "^0.107.3-alpha-parent-theme.13+d777c298",
34
- "@deephaven/chart": "^0.107.3-alpha-parent-theme.13+d777c298",
35
- "@deephaven/components": "^0.107.3-alpha-parent-theme.13+d777c298",
36
- "@deephaven/console": "^0.107.3-alpha-parent-theme.13+d777c298",
37
- "@deephaven/dashboard": "^0.107.3-alpha-parent-theme.13+d777c298",
38
- "@deephaven/dashboard-core-plugins": "^0.107.3-alpha-parent-theme.13+d777c298",
39
- "@deephaven/file-explorer": "^0.107.3-alpha-parent-theme.13+d777c298",
40
- "@deephaven/golden-layout": "^0.107.3-alpha-parent-theme.13+d777c298",
41
- "@deephaven/icons": "^0.107.3-alpha-parent-theme.13+d777c298",
42
- "@deephaven/iris-grid": "^0.107.3-alpha-parent-theme.13+d777c298",
43
- "@deephaven/jsapi-bootstrap": "^0.107.3-alpha-parent-theme.13+d777c298",
44
- "@deephaven/jsapi-components": "^0.107.3-alpha-parent-theme.13+d777c298",
33
+ "@deephaven/auth-plugins": "^0.107.3-alpha-parent-theme.16+297fec16",
34
+ "@deephaven/chart": "^0.107.3-alpha-parent-theme.16+297fec16",
35
+ "@deephaven/components": "^0.107.3-alpha-parent-theme.16+297fec16",
36
+ "@deephaven/console": "^0.107.3-alpha-parent-theme.16+297fec16",
37
+ "@deephaven/dashboard": "^0.107.3-alpha-parent-theme.16+297fec16",
38
+ "@deephaven/dashboard-core-plugins": "^0.107.3-alpha-parent-theme.16+297fec16",
39
+ "@deephaven/file-explorer": "^0.107.3-alpha-parent-theme.16+297fec16",
40
+ "@deephaven/golden-layout": "^0.107.3-alpha-parent-theme.16+297fec16",
41
+ "@deephaven/icons": "^0.107.3-alpha-parent-theme.16+297fec16",
42
+ "@deephaven/iris-grid": "^0.107.3-alpha-parent-theme.16+297fec16",
43
+ "@deephaven/jsapi-bootstrap": "^0.107.3-alpha-parent-theme.16+297fec16",
44
+ "@deephaven/jsapi-components": "^0.107.3-alpha-parent-theme.16+297fec16",
45
45
  "@deephaven/jsapi-types": "^1.0.0-dev0.37.2",
46
- "@deephaven/jsapi-utils": "^0.107.3-alpha-parent-theme.13+d777c298",
47
- "@deephaven/log": "^0.107.3-alpha-parent-theme.13+d777c298",
48
- "@deephaven/plugin": "^0.107.3-alpha-parent-theme.13+d777c298",
49
- "@deephaven/react-hooks": "^0.107.3-alpha-parent-theme.13+d777c298",
50
- "@deephaven/redux": "^0.107.3-alpha-parent-theme.13+d777c298",
51
- "@deephaven/storage": "^0.107.3-alpha-parent-theme.13+d777c298",
52
- "@deephaven/utils": "^0.107.3-alpha-parent-theme.13+d777c298",
46
+ "@deephaven/jsapi-utils": "^0.107.3-alpha-parent-theme.16+297fec16",
47
+ "@deephaven/log": "^0.107.3-alpha-parent-theme.16+297fec16",
48
+ "@deephaven/plugin": "^0.107.3-alpha-parent-theme.16+297fec16",
49
+ "@deephaven/react-hooks": "^0.107.3-alpha-parent-theme.16+297fec16",
50
+ "@deephaven/redux": "^0.107.3-alpha-parent-theme.16+297fec16",
51
+ "@deephaven/storage": "^0.107.3-alpha-parent-theme.16+297fec16",
52
+ "@deephaven/utils": "^0.107.3-alpha-parent-theme.16+297fec16",
53
53
  "@fontsource/fira-mono": "5.0.13",
54
54
  "@fontsource/fira-sans": "5.0.20",
55
55
  "@paciolan/remote-component": "2.13.0",
@@ -74,5 +74,5 @@
74
74
  "publishConfig": {
75
75
  "access": "public"
76
76
  },
77
- "gitHead": "d777c298b7c74d6646f0aace33bd35646e2142cc"
77
+ "gitHead": "297fec16fcabbf0f620319c716491b6e09f0d921"
78
78
  }