@deephaven/app-utils 0.107.3-alpha-parent-theme.15 → 0.107.3-alpha-parent-theme.38

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":"AAQA,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,CAe1C;AAED,eAAe,cAAc,CAAC"}
@@ -1,22 +1,17 @@
1
- import { useContext, useMemo } from 'react';
2
1
  import { ChartThemeProvider } from '@deephaven/chart';
3
2
  import { MonacoThemeProvider } from '@deephaven/console';
4
3
  import { ThemeProvider } from '@deephaven/components';
5
4
  import { IrisGridThemeProvider } from '@deephaven/iris-grid';
6
- import { getThemeDataFromPlugins, PluginsContext } from '@deephaven/plugin';
7
5
  import { getSettings } from '@deephaven/redux';
8
6
  import { useAppSelector } from '@deephaven/dashboard';
7
+ import { useCustomThemes } from "./useCustomThemes.js";
9
8
  import { jsx as _jsx } from "react/jsx-runtime";
10
9
  export function ThemeBootstrap(_ref) {
11
10
  var {
12
11
  children
13
12
  } = _ref;
14
- // The `usePlugins` hook throws if the context value is null. Since this is
15
- // the state while plugins load asynchronously, we are using `useContext`
16
- // directly to avoid the exception.
17
- var pluginModules = useContext(PluginsContext);
18
- var themes = useMemo(() => pluginModules == null ? null : getThemeDataFromPlugins(pluginModules), [pluginModules]);
19
13
  var settings = useAppSelector(getSettings);
14
+ var themes = useCustomThemes();
20
15
  return /*#__PURE__*/_jsx(ThemeProvider, {
21
16
  themes: themes,
22
17
  children: /*#__PURE__*/_jsx(ChartThemeProvider, {
@@ -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":["ChartThemeProvider","MonacoThemeProvider","ThemeProvider","IrisGridThemeProvider","getSettings","useAppSelector","useCustomThemes","jsx","_jsx","ThemeBootstrap","_ref","children","settings","themes","density","gridDensity"],"sources":["../../src/components/ThemeBootstrap.tsx"],"sourcesContent":["import { ChartThemeProvider } from '@deephaven/chart';\nimport { MonacoThemeProvider } from '@deephaven/console';\nimport { ThemeProvider } from '@deephaven/components';\nimport { IrisGridThemeProvider } from '@deephaven/iris-grid';\nimport { getSettings } from '@deephaven/redux';\nimport { useAppSelector } from '@deephaven/dashboard';\nimport { useCustomThemes } from './useCustomThemes';\n\nexport interface ThemeBootstrapProps {\n children: React.ReactNode;\n}\n\nexport function ThemeBootstrap({\n children,\n}: ThemeBootstrapProps): JSX.Element | null {\n const settings = useAppSelector(getSettings);\n const themes = useCustomThemes();\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,kBAAkB,QAAQ,kBAAkB;AACrD,SAASC,mBAAmB,QAAQ,oBAAoB;AACxD,SAASC,aAAa,QAAQ,uBAAuB;AACrD,SAASC,qBAAqB,QAAQ,sBAAsB;AAC5D,SAASC,WAAW,QAAQ,kBAAkB;AAC9C,SAASC,cAAc,QAAQ,sBAAsB;AAAC,SAC7CC,eAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAMxB,OAAO,SAASC,cAAcA,CAAAC,IAAA,EAEc;EAAA,IAFb;IAC7BC;EACmB,CAAC,GAAAD,IAAA;EACpB,IAAME,QAAQ,GAAGP,cAAc,CAACD,WAAW,CAAC;EAC5C,IAAMS,MAAM,GAAGP,eAAe,CAAC,CAAC;EAEhC,oBACEE,IAAA,CAACN,aAAa;IAACW,MAAM,EAAEA,MAAO;IAAAF,QAAA,eAC5BH,IAAA,CAACR,kBAAkB;MAAAW,QAAA,eACjBH,IAAA,CAACP,mBAAmB;QAAAU,QAAA,eAClBH,IAAA,CAACL,qBAAqB;UAACW,OAAO,EAAEF,QAAQ,CAACG,WAAY;UAAAJ,QAAA,EAClDA;QAAQ,CACY;MAAC,CACL;IAAC,CACJ;EAAC,CACR,CAAC;AAEpB;AAEA,eAAeF,cAAc"}
@@ -0,0 +1,7 @@
1
+ import { type ThemeData } from '@deephaven/components';
2
+ /**
3
+ * Use custom external or plugin themes.
4
+ */
5
+ export declare function useCustomThemes(): ThemeData[] | null;
6
+ export default useCustomThemes;
7
+ //# sourceMappingURL=useCustomThemes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCustomThemes.d.ts","sourceRoot":"","sources":["../../src/components/useCustomThemes.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGzE;;GAEG;AACH,wBAAgB,eAAe,IAAI,SAAS,EAAE,GAAG,IAAI,CAgCpD;AAED,eAAe,eAAe,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { useContext, useMemo } from 'react';
2
+ import { useExternalTheme } from '@deephaven/components';
3
+ import { getThemeDataFromPlugins, PluginsContext } from '@deephaven/plugin';
4
+
5
+ /**
6
+ * Use custom external or plugin themes.
7
+ */
8
+ export function useCustomThemes() {
9
+ var {
10
+ isEnabled: isExternalThemeEnabled,
11
+ isPending: isExternalThemePending,
12
+ themeData: externalThemeData
13
+ } = useExternalTheme();
14
+
15
+ // The `usePlugins` hook throws if the context value is null. Since this is
16
+ // the state while plugins load asynchronously, we are using `useContext`
17
+ // directly to avoid the exception.
18
+ var pluginModules = useContext(PluginsContext);
19
+ return useMemo(() => {
20
+ // Get theme from parent window via `postMessage` apis
21
+ if (isExternalThemeEnabled) {
22
+ if (isExternalThemePending) {
23
+ return null;
24
+ }
25
+ return externalThemeData ? [externalThemeData] : [];
26
+ }
27
+
28
+ // Get themes from plugins
29
+ return pluginModules == null ? null : getThemeDataFromPlugins(pluginModules);
30
+ }, [isExternalThemeEnabled, isExternalThemePending, externalThemeData, pluginModules]);
31
+ }
32
+ export default useCustomThemes;
33
+ //# sourceMappingURL=useCustomThemes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCustomThemes.js","names":["useContext","useMemo","useExternalTheme","getThemeDataFromPlugins","PluginsContext","useCustomThemes","isEnabled","isExternalThemeEnabled","isPending","isExternalThemePending","themeData","externalThemeData","pluginModules"],"sources":["../../src/components/useCustomThemes.ts"],"sourcesContent":["import { useContext, useMemo } from 'react';\nimport { useExternalTheme, type ThemeData } from '@deephaven/components';\nimport { getThemeDataFromPlugins, PluginsContext } from '@deephaven/plugin';\n\n/**\n * Use custom external or plugin themes.\n */\nexport function useCustomThemes(): ThemeData[] | null {\n const {\n isEnabled: isExternalThemeEnabled,\n isPending: isExternalThemePending,\n themeData: externalThemeData,\n } = useExternalTheme();\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 return useMemo(() => {\n // Get theme from parent window via `postMessage` apis\n if (isExternalThemeEnabled) {\n if (isExternalThemePending) {\n return null;\n }\n\n return externalThemeData ? [externalThemeData] : [];\n }\n\n // Get themes from plugins\n return pluginModules == null\n ? null\n : getThemeDataFromPlugins(pluginModules);\n }, [\n isExternalThemeEnabled,\n isExternalThemePending,\n externalThemeData,\n pluginModules,\n ]);\n}\n\nexport default useCustomThemes;\n"],"mappings":"AAAA,SAASA,UAAU,EAAEC,OAAO,QAAQ,OAAO;AAC3C,SAASC,gBAAgB,QAAwB,uBAAuB;AACxE,SAASC,uBAAuB,EAAEC,cAAc,QAAQ,mBAAmB;;AAE3E;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAAA,EAAuB;EACpD,IAAM;IACJC,SAAS,EAAEC,sBAAsB;IACjCC,SAAS,EAAEC,sBAAsB;IACjCC,SAAS,EAAEC;EACb,CAAC,GAAGT,gBAAgB,CAAC,CAAC;;EAEtB;EACA;EACA;EACA,IAAMU,aAAa,GAAGZ,UAAU,CAACI,cAAc,CAAC;EAEhD,OAAOH,OAAO,CAAC,MAAM;IACnB;IACA,IAAIM,sBAAsB,EAAE;MAC1B,IAAIE,sBAAsB,EAAE;QAC1B,OAAO,IAAI;MACb;MAEA,OAAOE,iBAAiB,GAAG,CAACA,iBAAiB,CAAC,GAAG,EAAE;IACrD;;IAEA;IACA,OAAOC,aAAa,IAAI,IAAI,GACxB,IAAI,GACJT,uBAAuB,CAACS,aAAa,CAAC;EAC5C,CAAC,EAAE,CACDL,sBAAsB,EACtBE,sBAAsB,EACtBE,iBAAiB,EACjBC,aAAa,CACd,CAAC;AACJ;AAEA,eAAeP,eAAe"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deephaven/app-utils",
3
- "version": "0.107.3-alpha-parent-theme.15+43d3de7e",
3
+ "version": "0.107.3-alpha-parent-theme.38+614bb272",
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.15+43d3de7e",
25
+ "@deephaven/test-utils": "^0.107.3-alpha-parent-theme.38+614bb272",
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.15+43d3de7e",
34
- "@deephaven/chart": "^0.107.3-alpha-parent-theme.15+43d3de7e",
35
- "@deephaven/components": "^0.107.3-alpha-parent-theme.15+43d3de7e",
36
- "@deephaven/console": "^0.107.3-alpha-parent-theme.15+43d3de7e",
37
- "@deephaven/dashboard": "^0.107.3-alpha-parent-theme.15+43d3de7e",
38
- "@deephaven/dashboard-core-plugins": "^0.107.3-alpha-parent-theme.15+43d3de7e",
39
- "@deephaven/file-explorer": "^0.107.3-alpha-parent-theme.15+43d3de7e",
40
- "@deephaven/golden-layout": "^0.107.3-alpha-parent-theme.15+43d3de7e",
41
- "@deephaven/icons": "^0.107.3-alpha-parent-theme.15+43d3de7e",
42
- "@deephaven/iris-grid": "^0.107.3-alpha-parent-theme.15+43d3de7e",
43
- "@deephaven/jsapi-bootstrap": "^0.107.3-alpha-parent-theme.15+43d3de7e",
44
- "@deephaven/jsapi-components": "^0.107.3-alpha-parent-theme.15+43d3de7e",
33
+ "@deephaven/auth-plugins": "^0.107.3-alpha-parent-theme.38+614bb272",
34
+ "@deephaven/chart": "^0.107.3-alpha-parent-theme.38+614bb272",
35
+ "@deephaven/components": "^0.107.3-alpha-parent-theme.38+614bb272",
36
+ "@deephaven/console": "^0.107.3-alpha-parent-theme.38+614bb272",
37
+ "@deephaven/dashboard": "^0.107.3-alpha-parent-theme.38+614bb272",
38
+ "@deephaven/dashboard-core-plugins": "^0.107.3-alpha-parent-theme.38+614bb272",
39
+ "@deephaven/file-explorer": "^0.107.3-alpha-parent-theme.38+614bb272",
40
+ "@deephaven/golden-layout": "^0.107.3-alpha-parent-theme.38+614bb272",
41
+ "@deephaven/icons": "^0.107.3-alpha-parent-theme.38+614bb272",
42
+ "@deephaven/iris-grid": "^0.107.3-alpha-parent-theme.38+614bb272",
43
+ "@deephaven/jsapi-bootstrap": "^0.107.3-alpha-parent-theme.38+614bb272",
44
+ "@deephaven/jsapi-components": "^0.107.3-alpha-parent-theme.38+614bb272",
45
45
  "@deephaven/jsapi-types": "^1.0.0-dev0.37.2",
46
- "@deephaven/jsapi-utils": "^0.107.3-alpha-parent-theme.15+43d3de7e",
47
- "@deephaven/log": "^0.107.3-alpha-parent-theme.15+43d3de7e",
48
- "@deephaven/plugin": "^0.107.3-alpha-parent-theme.15+43d3de7e",
49
- "@deephaven/react-hooks": "^0.107.3-alpha-parent-theme.15+43d3de7e",
50
- "@deephaven/redux": "^0.107.3-alpha-parent-theme.15+43d3de7e",
51
- "@deephaven/storage": "^0.107.3-alpha-parent-theme.15+43d3de7e",
52
- "@deephaven/utils": "^0.107.3-alpha-parent-theme.15+43d3de7e",
46
+ "@deephaven/jsapi-utils": "^0.107.3-alpha-parent-theme.38+614bb272",
47
+ "@deephaven/log": "^0.107.3-alpha-parent-theme.38+614bb272",
48
+ "@deephaven/plugin": "^0.107.3-alpha-parent-theme.38+614bb272",
49
+ "@deephaven/react-hooks": "^0.107.3-alpha-parent-theme.38+614bb272",
50
+ "@deephaven/redux": "^0.107.3-alpha-parent-theme.38+614bb272",
51
+ "@deephaven/storage": "^0.107.3-alpha-parent-theme.38+614bb272",
52
+ "@deephaven/utils": "^0.107.3-alpha-parent-theme.38+614bb272",
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": "43d3de7ed90cd7b5e827ec11173a41752773762e"
77
+ "gitHead": "614bb27236022295152c82fcf1d941fd8a95cd0c"
78
78
  }