@deephaven/dashboard 0.85.3-core-plugins.6 → 0.85.3
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/Dashboard.d.ts +2 -2
- package/dist/Dashboard.d.ts.map +1 -1
- package/dist/Dashboard.js.map +1 -1
- package/dist/DashboardLayout.d.ts +2 -2
- package/dist/DashboardLayout.d.ts.map +1 -1
- package/dist/DashboardLayout.js.map +1 -1
- package/dist/DashboardPlugin.d.ts +3 -2
- package/dist/DashboardPlugin.d.ts.map +1 -1
- package/dist/DashboardPlugin.js +3 -5
- package/dist/DashboardPlugin.js.map +1 -1
- package/dist/DashboardUtils.d.ts +8 -2
- package/dist/DashboardUtils.d.ts.map +1 -1
- package/dist/DashboardUtils.js +15 -2
- package/dist/DashboardUtils.js.map +1 -1
- package/dist/PanelEvent.d.ts +5 -15
- package/dist/PanelEvent.d.ts.map +1 -1
- package/dist/PanelEvent.js +1 -11
- package/dist/PanelEvent.js.map +1 -1
- package/dist/PanelManager.d.ts +3 -3
- package/dist/PanelManager.d.ts.map +1 -1
- package/dist/PanelManager.js.map +1 -1
- package/dist/PanelPlaceholder.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/layout/LayoutUtils.d.ts +14 -13
- package/dist/layout/LayoutUtils.d.ts.map +1 -1
- package/dist/layout/LayoutUtils.js +9 -8
- package/dist/layout/LayoutUtils.js.map +1 -1
- package/dist/layout/useDashboardPanel.d.ts.map +1 -1
- package/dist/layout/useDashboardPanel.js +3 -2
- package/dist/layout/useDashboardPanel.js.map +1 -1
- package/package.json +10 -9
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { useCallback } from 'react';
|
|
2
2
|
import { nanoid } from 'nanoid';
|
|
3
|
-
import
|
|
3
|
+
import PanelEvent from "../PanelEvent.js";
|
|
4
4
|
import LayoutUtils from "./LayoutUtils.js";
|
|
5
|
+
import useListener from "./useListener.js";
|
|
5
6
|
import usePanelRegistration from "./usePanelRegistration.js";
|
|
6
7
|
/**
|
|
7
8
|
* Register a panel that will be opened when one of the `supportedTypes` objects is triggered.
|
|
@@ -67,7 +68,7 @@ export function useDashboardPanel(_ref) {
|
|
|
67
68
|
/**
|
|
68
69
|
* Listen for panel open events so we know when to open a panel
|
|
69
70
|
*/
|
|
70
|
-
|
|
71
|
+
useListener(layout.eventHub, PanelEvent.OPEN, handlePanelOpen);
|
|
71
72
|
}
|
|
72
73
|
export default useDashboardPanel;
|
|
73
74
|
//# sourceMappingURL=useDashboardPanel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDashboardPanel.js","names":["useCallback","nanoid","
|
|
1
|
+
{"version":3,"file":"useDashboardPanel.js","names":["useCallback","nanoid","PanelEvent","LayoutUtils","useListener","usePanelRegistration","useDashboardPanel","_ref","dashboardProps","componentName","component","supportedTypes","hydrate","dehydrate","id","layout","registerComponent","handlePanelOpen","_ref2","dragEvent","panelId","widget","name","type","isSupportedType","Array","isArray","includes","props","localDashboardId","metadata","config","title","undefined","root","openComponent","eventHub","OPEN"],"sources":["../../src/layout/useDashboardPanel.ts"],"sourcesContent":["import { ComponentType, useCallback } from 'react';\nimport type { ReactComponentConfig } from '@deephaven/golden-layout';\nimport { nanoid } from 'nanoid';\nimport {\n DashboardPanelProps,\n DashboardPluginComponentProps,\n DehydratedDashboardPanelProps,\n PanelComponentType,\n PanelDehydrateFunction,\n PanelHydrateFunction,\n} from '../DashboardPlugin';\nimport PanelEvent, { PanelOpenEventDetail } from '../PanelEvent';\nimport LayoutUtils from './LayoutUtils';\nimport useListener from './useListener';\nimport usePanelRegistration from './usePanelRegistration';\n\n/**\n * Register a panel that will be opened when one of the `supportedTypes` objects is triggered.\n */\nexport function useDashboardPanel<\n P extends DashboardPanelProps,\n C extends ComponentType<P>,\n>({\n dashboardProps,\n componentName,\n component,\n supportedTypes,\n hydrate,\n dehydrate,\n}: {\n /** Props from the dashboard this panel is being registered in */\n dashboardProps: DashboardPluginComponentProps;\n\n /** Name of the component to register */\n componentName: string;\n\n /** Component type to register */\n component: PanelComponentType<P, C>;\n\n /** Names of the supported variable types this panel opens for */\n supportedTypes: string | string[];\n\n /** Custom hydration function to call when opening a panel */\n hydrate?: PanelHydrateFunction;\n\n /** Custom dehydration function to call when saving a panel's state to the layout */\n dehydrate?: PanelDehydrateFunction;\n}): void {\n const { id, layout, registerComponent } = dashboardProps;\n\n const handlePanelOpen = useCallback(\n ({ dragEvent, panelId = nanoid(), widget }: PanelOpenEventDetail) => {\n const { name, type } = widget;\n const isSupportedType =\n type != null &&\n ((Array.isArray(supportedTypes) && supportedTypes.includes(type)) ||\n type === supportedTypes);\n if (!isSupportedType) {\n // Only want to listen for your custom variable types\n return;\n }\n let props: DehydratedDashboardPanelProps = {\n localDashboardId: id,\n metadata: widget,\n };\n if (hydrate != null) {\n props = hydrate(props, id);\n }\n const config: ReactComponentConfig = {\n type: 'react-component',\n component: componentName,\n props,\n title: name ?? undefined,\n id: panelId,\n };\n\n const { root } = layout;\n LayoutUtils.openComponent({ root, config, dragEvent });\n },\n [componentName, hydrate, id, layout, supportedTypes]\n );\n\n /**\n * Register our custom component type so the layout know hows to open it\n */\n usePanelRegistration(registerComponent, component, hydrate, dehydrate);\n\n /**\n * Listen for panel open events so we know when to open a panel\n */\n useListener(layout.eventHub, PanelEvent.OPEN, handlePanelOpen);\n}\n\nexport default useDashboardPanel;\n"],"mappings":"AAAA,SAAwBA,WAAW,QAAQ,OAAO;AAElD,SAASC,MAAM,QAAQ,QAAQ;AAAC,OASzBC,UAAU;AAAA,OACVC,WAAW;AAAA,OACXC,WAAW;AAAA,OACXC,oBAAoB;AAE3B;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAAAC,IAAA,EA4BxB;EAAA,IAzBP;IACAC,cAAc;IACdC,aAAa;IACbC,SAAS;IACTC,cAAc;IACdC,OAAO;IACPC;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E;AACF;AACA;EACET,WAAW,CAACW,MAAM,CAACqB,QAAQ,EAAElC,UAAU,CAACmC,IAAI,EAAEpB,eAAe,CAAC;AAChE;AAEA,eAAeX,iBAAiB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deephaven/dashboard",
|
|
3
|
-
"version": "0.85.3
|
|
3
|
+
"version": "0.85.3",
|
|
4
4
|
"description": "Deephaven Dashboard",
|
|
5
5
|
"author": "Deephaven Data Labs LLC",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
"build:sass": "sass --embed-sources --load-path=../../node_modules ./src:./dist"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@deephaven/components": "^0.85.3
|
|
26
|
-
"@deephaven/golden-layout": "^0.85.3
|
|
27
|
-
"@deephaven/log": "^0.85.
|
|
28
|
-
"@deephaven/react-hooks": "^0.85.
|
|
29
|
-
"@deephaven/redux": "^0.85.3
|
|
30
|
-
"@deephaven/utils": "^0.85.
|
|
25
|
+
"@deephaven/components": "^0.85.3",
|
|
26
|
+
"@deephaven/golden-layout": "^0.85.3",
|
|
27
|
+
"@deephaven/log": "^0.85.0",
|
|
28
|
+
"@deephaven/react-hooks": "^0.85.2",
|
|
29
|
+
"@deephaven/redux": "^0.85.3",
|
|
30
|
+
"@deephaven/utils": "^0.85.2",
|
|
31
31
|
"fast-deep-equal": "^3.1.3",
|
|
32
32
|
"lodash.ismatch": "^4.1.1",
|
|
33
33
|
"lodash.throttle": "^4.1.1",
|
|
@@ -37,10 +37,11 @@
|
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"react": ">=16.8.0",
|
|
39
39
|
"react-dom": ">=16.8.0",
|
|
40
|
+
"react-is": ">=16.8.0",
|
|
40
41
|
"react-redux": "^7.2.4"
|
|
41
42
|
},
|
|
42
43
|
"devDependencies": {
|
|
43
|
-
"@deephaven/mocks": "^0.85.
|
|
44
|
+
"@deephaven/mocks": "^0.85.0",
|
|
44
45
|
"@types/lodash.ismatch": "^4.4.0"
|
|
45
46
|
},
|
|
46
47
|
"files": [
|
|
@@ -49,5 +50,5 @@
|
|
|
49
50
|
"publishConfig": {
|
|
50
51
|
"access": "public"
|
|
51
52
|
},
|
|
52
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "27c92bdcb64434d765bc2d0f694854d4e5395a2c"
|
|
53
54
|
}
|