@deephaven/plugin 0.108.1-beta.6 → 0.109.0

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/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ export * from './PluginsContext';
2
2
  export * from './PluginTypes';
3
3
  export * from './PluginUtils';
4
4
  export * from './TablePlugin';
5
+ export * from './useCustomThemes';
5
6
  export * from './useDashboardPlugins';
6
7
  export * from './usePlugins';
7
8
  export * from './WidgetView';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC"}
package/dist/index.js CHANGED
@@ -2,6 +2,7 @@ export * from "./PluginsContext.js";
2
2
  export * from "./PluginTypes.js";
3
3
  export * from "./PluginUtils.js";
4
4
  export * from "./TablePlugin.js";
5
+ export * from "./useCustomThemes.js";
5
6
  export * from "./useDashboardPlugins.js";
6
7
  export * from "./usePlugins.js";
7
8
  export * from "./WidgetView.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["export * from './PluginsContext';\nexport * from './PluginTypes';\nexport * from './PluginUtils';\nexport * from './TablePlugin';\nexport * from './useDashboardPlugins';\nexport * from './usePlugins';\nexport * from './WidgetView';\nexport * from './PersistentStateContext';\nexport * from './usePersistentState';\n"],"mappings":""}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["export * from './PluginsContext';\nexport * from './PluginTypes';\nexport * from './PluginUtils';\nexport * from './TablePlugin';\nexport * from './useCustomThemes';\nexport * from './useDashboardPlugins';\nexport * from './usePlugins';\nexport * from './WidgetView';\nexport * from './PersistentStateContext';\nexport * from './usePersistentState';\n"],"mappings":""}
@@ -0,0 +1,10 @@
1
+ import { type ThemeData } from '@deephaven/components';
2
+ import type { PluginModuleMap } from './PluginTypes';
3
+ /**
4
+ * Use custom external or plugin themes.
5
+ * @param pluginModules The plugin modules to get themes from when external
6
+ * themes are disabled.
7
+ */
8
+ export declare function useCustomThemes(pluginModules?: PluginModuleMap | null): ThemeData[] | null;
9
+ export default useCustomThemes;
10
+ //# sourceMappingURL=useCustomThemes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCustomThemes.d.ts","sourceRoot":"","sources":["../src/useCustomThemes.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGrD;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,aAAa,CAAC,EAAE,eAAe,GAAG,IAAI,GACrC,SAAS,EAAE,GAAG,IAAI,CA2BpB;AAED,eAAe,eAAe,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { useMemo } from 'react';
2
+ import { useExternalTheme } from '@deephaven/components';
3
+ import { getThemeDataFromPlugins } from "./PluginUtils.js";
4
+ /**
5
+ * Use custom external or plugin themes.
6
+ * @param pluginModules The plugin modules to get themes from when external
7
+ * themes are disabled.
8
+ */
9
+ export function useCustomThemes(pluginModules) {
10
+ var {
11
+ isEnabled: isExternalThemeEnabled,
12
+ isPending: isExternalThemePending,
13
+ themeData: externalThemeData
14
+ } = useExternalTheme();
15
+ return useMemo(() => {
16
+ // Get theme from parent window via `postMessage` apis
17
+ if (isExternalThemeEnabled) {
18
+ if (isExternalThemePending) {
19
+ return null;
20
+ }
21
+ return externalThemeData ? [externalThemeData] : [];
22
+ }
23
+
24
+ // Get themes from plugins
25
+ return pluginModules == null ? null : getThemeDataFromPlugins(pluginModules);
26
+ }, [isExternalThemeEnabled, isExternalThemePending, externalThemeData, pluginModules]);
27
+ }
28
+ export default useCustomThemes;
29
+ //# sourceMappingURL=useCustomThemes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCustomThemes.js","names":["useMemo","useExternalTheme","getThemeDataFromPlugins","useCustomThemes","pluginModules","isEnabled","isExternalThemeEnabled","isPending","isExternalThemePending","themeData","externalThemeData"],"sources":["../src/useCustomThemes.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { useExternalTheme, type ThemeData } from '@deephaven/components';\nimport type { PluginModuleMap } from './PluginTypes';\nimport { getThemeDataFromPlugins } from './PluginUtils';\n\n/**\n * Use custom external or plugin themes.\n * @param pluginModules The plugin modules to get themes from when external\n * themes are disabled.\n */\nexport function useCustomThemes(\n pluginModules?: PluginModuleMap | null\n): ThemeData[] | null {\n const {\n isEnabled: isExternalThemeEnabled,\n isPending: isExternalThemePending,\n themeData: externalThemeData,\n } = useExternalTheme();\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,OAAO,QAAQ,OAAO;AAC/B,SAASC,gBAAgB,QAAwB,uBAAuB;AAAC,SAEhEC,uBAAuB;AAEhC;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAC7BC,aAAsC,EAClB;EACpB,IAAM;IACJC,SAAS,EAAEC,sBAAsB;IACjCC,SAAS,EAAEC,sBAAsB;IACjCC,SAAS,EAAEC;EACb,CAAC,GAAGT,gBAAgB,CAAC,CAAC;EAEtB,OAAOD,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,OAAON,aAAa,IAAI,IAAI,GACxB,IAAI,GACJF,uBAAuB,CAACE,aAAa,CAAC;EAC5C,CAAC,EAAE,CACDE,sBAAsB,EACtBE,sBAAsB,EACtBE,iBAAiB,EACjBN,aAAa,CACd,CAAC;AACJ;AAEA,eAAeD,eAAe"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deephaven/plugin",
3
- "version": "0.108.1-beta.6+09077bfe",
3
+ "version": "0.109.0",
4
4
  "description": "Deephaven JS Plugin Core",
5
5
  "author": "Deephaven Data Labs LLC",
6
6
  "license": "Apache-2.0",
@@ -22,14 +22,14 @@
22
22
  "build:babel": "babel ./src --out-dir ./dist --extensions \".ts,.tsx,.js,.jsx\" --source-maps --root-mode upward"
23
23
  },
24
24
  "dependencies": {
25
- "@deephaven/components": "^0.108.1-beta.6+09077bfe",
26
- "@deephaven/golden-layout": "^0.108.1-beta.6+09077bfe",
27
- "@deephaven/grid": "^0.108.1-beta.6+09077bfe",
28
- "@deephaven/icons": "^0.108.1-beta.6+09077bfe",
29
- "@deephaven/iris-grid": "^0.108.1-beta.6+09077bfe",
25
+ "@deephaven/components": "^0.109.0",
26
+ "@deephaven/golden-layout": "^0.109.0",
27
+ "@deephaven/grid": "^0.109.0",
28
+ "@deephaven/icons": "^0.109.0",
29
+ "@deephaven/iris-grid": "^0.109.0",
30
30
  "@deephaven/jsapi-types": "^1.0.0-dev0.37.2",
31
- "@deephaven/log": "^0.108.1-beta.6+09077bfe",
32
- "@deephaven/react-hooks": "^0.108.1-beta.6+09077bfe",
31
+ "@deephaven/log": "^0.109.0",
32
+ "@deephaven/react-hooks": "^0.109.0",
33
33
  "@fortawesome/fontawesome-common-types": "^6.1.1",
34
34
  "@fortawesome/react-fontawesome": "^0.2.0",
35
35
  "nanoid": "^5.0.7"
@@ -43,5 +43,5 @@
43
43
  "publishConfig": {
44
44
  "access": "public"
45
45
  },
46
- "gitHead": "09077bfefd41a24172a6e77f8c9684938c757220"
46
+ "gitHead": "8dd24c00fcb5270628e21bb0bca6972db92c2408"
47
47
  }