@deephaven/dashboard 0.46.1-beta.2 → 0.46.1-beta.7

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.js CHANGED
@@ -11,6 +11,8 @@ import LayoutUtils from "./layout/LayoutUtils.js";
11
11
  import PanelPlaceholder from "./PanelPlaceholder.js";
12
12
  import DashboardLayout from "./DashboardLayout.js";
13
13
  import "./Dashboard.css";
14
+ import { jsx as _jsx } from "react/jsx-runtime";
15
+ import { jsxs as _jsxs } from "react/jsx-runtime";
14
16
  var RESIZE_THROTTLE = 100;
15
17
  var DEFAULT_CALLBACK = () => undefined;
16
18
  var EMPTY_OBJECT = Object.freeze({});
@@ -72,22 +74,24 @@ export function Dashboard(_ref) {
72
74
  window.removeEventListener('resize', handleResize);
73
75
  };
74
76
  }, [handleResize]);
75
- return /*#__PURE__*/React.createElement("div", {
76
- className: "dashboard-container w-100 h-100"
77
- }, /*#__PURE__*/React.createElement("div", {
78
- className: "w-100 h-100",
79
- ref: layoutElement
80
- }), isInitialized && layout && /*#__PURE__*/React.createElement(DashboardLayout, {
81
- emptyDashboard: emptyDashboard,
82
- id: id,
83
- layout: layout,
84
- layoutConfig: layoutConfig,
85
- onLayoutChange: onLayoutConfigChange,
86
- onLayoutInitialized: onLayoutInitialized,
87
- hydrate: hydrate,
88
- dehydrate: dehydrate,
89
- panelWrapper: panelWrapper
90
- }, children));
77
+ return /*#__PURE__*/_jsxs("div", {
78
+ className: "dashboard-container w-100 h-100",
79
+ children: [/*#__PURE__*/_jsx("div", {
80
+ className: "w-100 h-100",
81
+ ref: layoutElement
82
+ }), isInitialized && layout && /*#__PURE__*/_jsx(DashboardLayout, {
83
+ emptyDashboard: emptyDashboard,
84
+ id: id,
85
+ layout: layout,
86
+ layoutConfig: layoutConfig,
87
+ onLayoutChange: onLayoutConfigChange,
88
+ onLayoutInitialized: onLayoutInitialized,
89
+ hydrate: hydrate,
90
+ dehydrate: dehydrate,
91
+ panelWrapper: panelWrapper,
92
+ children: children
93
+ })]
94
+ });
91
95
  }
92
96
  export default Dashboard;
93
97
  //# sourceMappingURL=Dashboard.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Dashboard.js","names":["React","useEffect","useMemo","useRef","useState","throttle","GoldenLayout","LayoutUtils","PanelPlaceholder","DashboardLayout","RESIZE_THROTTLE","DEFAULT_CALLBACK","undefined","EMPTY_OBJECT","Object","freeze","Dashboard","id","children","emptyDashboard","layoutConfig","layoutSettings","onLayoutConfigChange","onGoldenLayoutChange","onLayoutInitialized","fallbackComponent","hydrate","dehydrate","panelWrapper","layoutElement","isInitialized","setIsInitialized","layout","setLayout","initDashboard","current","config","makeDefaultLayout","settings","assign","content","newLayout","onInit","off","on","setFallbackComponent","init","destroy","handleResize","isInitialised","updateSize","initResizeEventListner","window","addEventListener","removeEventListener"],"sources":["../src/Dashboard.tsx"],"sourcesContent":["import React, {\n ComponentType,\n ForwardRefExoticComponent,\n RefAttributes,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport throttle from 'lodash.throttle';\nimport GoldenLayout from '@deephaven/golden-layout';\nimport type { ItemConfigType } from '@deephaven/golden-layout';\nimport './layout/GoldenLayout.scss';\nimport LayoutUtils from './layout/LayoutUtils';\nimport PanelPlaceholder from './PanelPlaceholder';\nimport DashboardLayout from './DashboardLayout';\nimport {\n PanelDehydrateFunction,\n PanelHydrateFunction,\n PanelProps,\n} from './DashboardPlugin';\nimport './Dashboard.scss';\n\nconst RESIZE_THROTTLE = 100;\n\nconst DEFAULT_CALLBACK = () => undefined;\n\nconst EMPTY_OBJECT = Object.freeze({});\n\nexport type DashboardProps = {\n id?: string;\n children?: React.ReactNode | React.ReactNode[];\n emptyDashboard?: React.ReactNode;\n layoutConfig?: ItemConfigType[];\n layoutSettings?: Record<string, unknown>;\n onLayoutConfigChange?: () => void;\n onGoldenLayoutChange?: (goldenLayout: GoldenLayout) => void;\n onLayoutInitialized?: () => void;\n fallbackComponent?: ForwardRefExoticComponent<\n PanelProps & RefAttributes<HTMLDivElement>\n >;\n hydrate?: PanelHydrateFunction;\n dehydrate?: PanelDehydrateFunction;\n\n /** Component to wrap each panel with */\n panelWrapper?: ComponentType;\n};\n\nexport function Dashboard({\n id = 'default',\n children,\n emptyDashboard,\n layoutConfig,\n layoutSettings = EMPTY_OBJECT,\n onLayoutConfigChange = DEFAULT_CALLBACK,\n onGoldenLayoutChange = DEFAULT_CALLBACK,\n onLayoutInitialized = DEFAULT_CALLBACK,\n fallbackComponent = PanelPlaceholder,\n hydrate,\n dehydrate,\n panelWrapper,\n}: DashboardProps): JSX.Element {\n const layoutElement = useRef<HTMLDivElement>(null);\n const [isInitialized, setIsInitialized] = useState(false);\n const [layout, setLayout] = useState<GoldenLayout>();\n\n useEffect(\n function initDashboard() {\n if (!layoutElement.current) {\n setLayout(undefined);\n return;\n }\n const config = {\n ...LayoutUtils.makeDefaultLayout(),\n };\n if (config.settings === undefined) {\n config.settings = {};\n }\n Object.assign(config.settings, layoutSettings);\n\n // Load our content later after plugins have registered\n config.content = [];\n\n const newLayout = new GoldenLayout(config, layoutElement.current);\n\n const onInit = () => {\n newLayout.off('initialised', onInit);\n setIsInitialized(true);\n };\n newLayout.on('initialised', onInit);\n\n if (fallbackComponent != null) {\n newLayout.setFallbackComponent(fallbackComponent);\n }\n\n newLayout.init();\n\n setLayout(newLayout);\n\n onGoldenLayoutChange(newLayout);\n\n return () => {\n newLayout.destroy();\n };\n },\n [\n layoutSettings,\n fallbackComponent,\n onGoldenLayoutChange,\n setIsInitialized,\n setLayout,\n ]\n );\n\n const handleResize = useMemo(\n () =>\n throttle(() => {\n if (layout != null && layout.isInitialised) {\n layout?.updateSize();\n }\n }, RESIZE_THROTTLE),\n [layout]\n );\n\n useEffect(\n function initResizeEventListner() {\n window.addEventListener('resize', handleResize);\n return () => {\n window.removeEventListener('resize', handleResize);\n };\n },\n [handleResize]\n );\n\n return (\n <div className=\"dashboard-container w-100 h-100\">\n <div className=\"w-100 h-100\" ref={layoutElement} />\n {isInitialized && layout && (\n <DashboardLayout\n emptyDashboard={emptyDashboard}\n id={id}\n layout={layout}\n layoutConfig={layoutConfig}\n onLayoutChange={onLayoutConfigChange}\n onLayoutInitialized={onLayoutInitialized}\n hydrate={hydrate}\n dehydrate={dehydrate}\n panelWrapper={panelWrapper}\n >\n {children}\n </DashboardLayout>\n )}\n </div>\n );\n}\n\nexport default Dashboard;\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,IAIVC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACH,OAAO;AACd,OAAOC,QAAQ,MAAM,iBAAiB;AACtC,OAAOC,YAAY,MAAM,0BAA0B;AAAC;AAAA,OAG7CC,WAAW;AAAA,OACXC,gBAAgB;AAAA,OAChBC,eAAe;AAAA;AAQtB,IAAMC,eAAe,GAAG,GAAG;AAE3B,IAAMC,gBAAgB,GAAG,MAAMC,SAAS;AAExC,IAAMC,YAAY,GAAGC,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,CAAC;AAqBtC,OAAO,SAASC,SAAS,OAaO;EAAA,IAbN;IACxBC,EAAE,GAAG,SAAS;IACdC,QAAQ;IACRC,cAAc;IACdC,YAAY;IACZC,cAAc,GAAGR,YAAY;IAC7BS,oBAAoB,GAAGX,gBAAgB;IACvCY,oBAAoB,GAAGZ,gBAAgB;IACvCa,mBAAmB,GAAGb,gBAAgB;IACtCc,iBAAiB,GAAGjB,gBAAgB;IACpCkB,OAAO;IACPC,SAAS;IACTC;EACc,CAAC;EACf,IAAMC,aAAa,GAAG1B,MAAM,CAAiB,IAAI,CAAC;EAClD,IAAM,CAAC2B,aAAa,EAAEC,gBAAgB,CAAC,GAAG3B,QAAQ,CAAC,KAAK,CAAC;EACzD,IAAM,CAAC4B,MAAM,EAAEC,SAAS,CAAC,GAAG7B,QAAQ,EAAgB;EAEpDH,SAAS,CACP,SAASiC,aAAa,GAAG;IACvB,IAAI,CAACL,aAAa,CAACM,OA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ED/B,SAAS,CACP,SAASkD,sBAAsB,GAAG;IAChCC,MAAM,CAACC,gBAAgB,CAAC,QAAQ,EAAEL,YAAY,CAAC;IAC/C,OAAO,MAAM;MACXI,MAAM,CAACE,mBAAmB,CAAC,QAAQ,EAAEN,YAAY,CAAC;IACpD,CAAC;EACH,CAAC,EACD,CAACA,YAAY,CAAC,CACf;EAED,oBACE;IAAK,SAAS,EAAC;EAAiC,gBAC9C;IAAK,SAAS,EAAC,aAAa;IAAC,GAAG,EAAEnB;EAAc,EAAG,EAClDC,aAAa,IAAIE,MAAM,iBACtB,oBAAC,eAAe;IACd,cAAc,EAAEb,cAAe;IAC/B,EAAE,EAAEF,EAAG;IACP,MAAM,EAAEe,MAAO;IACf,YAAY,EAAEZ,YAAa;IAC3B,cAAc,EAAEE,oBAAqB;IACrC,mBAAmB,EAAEE,mBAAoB;IACzC,OAAO,EAAEE,OAAQ;IACjB,SAAS,EAAEC,SAAU;IACrB,YAAY,EAAEC;EAAa,GAE1BV,QAAQ,CAEZ,CACG;AAEV;AAEA,eAAeF,SAAS"}
1
+ {"version":3,"file":"Dashboard.js","names":["React","useEffect","useMemo","useRef","useState","throttle","GoldenLayout","LayoutUtils","PanelPlaceholder","DashboardLayout","RESIZE_THROTTLE","DEFAULT_CALLBACK","undefined","EMPTY_OBJECT","Object","freeze","Dashboard","id","children","emptyDashboard","layoutConfig","layoutSettings","onLayoutConfigChange","onGoldenLayoutChange","onLayoutInitialized","fallbackComponent","hydrate","dehydrate","panelWrapper","layoutElement","isInitialized","setIsInitialized","layout","setLayout","initDashboard","current","config","makeDefaultLayout","settings","assign","content","newLayout","onInit","off","on","setFallbackComponent","init","destroy","handleResize","isInitialised","updateSize","initResizeEventListner","window","addEventListener","removeEventListener"],"sources":["../src/Dashboard.tsx"],"sourcesContent":["import React, {\n ComponentType,\n ForwardRefExoticComponent,\n RefAttributes,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport throttle from 'lodash.throttle';\nimport GoldenLayout from '@deephaven/golden-layout';\nimport type { ItemConfigType } from '@deephaven/golden-layout';\nimport './layout/GoldenLayout.scss';\nimport LayoutUtils from './layout/LayoutUtils';\nimport PanelPlaceholder from './PanelPlaceholder';\nimport DashboardLayout from './DashboardLayout';\nimport {\n PanelDehydrateFunction,\n PanelHydrateFunction,\n PanelProps,\n} from './DashboardPlugin';\nimport './Dashboard.scss';\n\nconst RESIZE_THROTTLE = 100;\n\nconst DEFAULT_CALLBACK = () => undefined;\n\nconst EMPTY_OBJECT = Object.freeze({});\n\nexport type DashboardProps = {\n id?: string;\n children?: React.ReactNode | React.ReactNode[];\n emptyDashboard?: React.ReactNode;\n layoutConfig?: ItemConfigType[];\n layoutSettings?: Record<string, unknown>;\n onLayoutConfigChange?: () => void;\n onGoldenLayoutChange?: (goldenLayout: GoldenLayout) => void;\n onLayoutInitialized?: () => void;\n fallbackComponent?: ForwardRefExoticComponent<\n PanelProps & RefAttributes<HTMLDivElement>\n >;\n hydrate?: PanelHydrateFunction;\n dehydrate?: PanelDehydrateFunction;\n\n /** Component to wrap each panel with */\n panelWrapper?: ComponentType;\n};\n\nexport function Dashboard({\n id = 'default',\n children,\n emptyDashboard,\n layoutConfig,\n layoutSettings = EMPTY_OBJECT,\n onLayoutConfigChange = DEFAULT_CALLBACK,\n onGoldenLayoutChange = DEFAULT_CALLBACK,\n onLayoutInitialized = DEFAULT_CALLBACK,\n fallbackComponent = PanelPlaceholder,\n hydrate,\n dehydrate,\n panelWrapper,\n}: DashboardProps): JSX.Element {\n const layoutElement = useRef<HTMLDivElement>(null);\n const [isInitialized, setIsInitialized] = useState(false);\n const [layout, setLayout] = useState<GoldenLayout>();\n\n useEffect(\n function initDashboard() {\n if (!layoutElement.current) {\n setLayout(undefined);\n return;\n }\n const config = {\n ...LayoutUtils.makeDefaultLayout(),\n };\n if (config.settings === undefined) {\n config.settings = {};\n }\n Object.assign(config.settings, layoutSettings);\n\n // Load our content later after plugins have registered\n config.content = [];\n\n const newLayout = new GoldenLayout(config, layoutElement.current);\n\n const onInit = () => {\n newLayout.off('initialised', onInit);\n setIsInitialized(true);\n };\n newLayout.on('initialised', onInit);\n\n if (fallbackComponent != null) {\n newLayout.setFallbackComponent(fallbackComponent);\n }\n\n newLayout.init();\n\n setLayout(newLayout);\n\n onGoldenLayoutChange(newLayout);\n\n return () => {\n newLayout.destroy();\n };\n },\n [\n layoutSettings,\n fallbackComponent,\n onGoldenLayoutChange,\n setIsInitialized,\n setLayout,\n ]\n );\n\n const handleResize = useMemo(\n () =>\n throttle(() => {\n if (layout != null && layout.isInitialised) {\n layout?.updateSize();\n }\n }, RESIZE_THROTTLE),\n [layout]\n );\n\n useEffect(\n function initResizeEventListner() {\n window.addEventListener('resize', handleResize);\n return () => {\n window.removeEventListener('resize', handleResize);\n };\n },\n [handleResize]\n );\n\n return (\n <div className=\"dashboard-container w-100 h-100\">\n <div className=\"w-100 h-100\" ref={layoutElement} />\n {isInitialized && layout && (\n <DashboardLayout\n emptyDashboard={emptyDashboard}\n id={id}\n layout={layout}\n layoutConfig={layoutConfig}\n onLayoutChange={onLayoutConfigChange}\n onLayoutInitialized={onLayoutInitialized}\n hydrate={hydrate}\n dehydrate={dehydrate}\n panelWrapper={panelWrapper}\n >\n {children}\n </DashboardLayout>\n )}\n </div>\n );\n}\n\nexport default Dashboard;\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,IAIVC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACH,OAAO;AACd,OAAOC,QAAQ,MAAM,iBAAiB;AACtC,OAAOC,YAAY,MAAM,0BAA0B;AAAC;AAAA,OAG7CC,WAAW;AAAA,OACXC,gBAAgB;AAAA,OAChBC,eAAe;AAAA;AAAA;AAAA;AAQtB,IAAMC,eAAe,GAAG,GAAG;AAE3B,IAAMC,gBAAgB,GAAG,MAAMC,SAAS;AAExC,IAAMC,YAAY,GAAGC,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,CAAC;AAqBtC,OAAO,SAASC,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SAAS"}
@@ -1,3 +1,8 @@
1
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
3
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
5
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
1
6
  import React, { useCallback, useEffect, useMemo, useState } from 'react';
2
7
  import PropTypes from 'prop-types';
3
8
  import Log from '@deephaven/log';
@@ -11,6 +16,9 @@ import PanelEvent from "./PanelEvent.js";
11
16
  import { GLPropTypes, useListener } from "./layout/index.js";
12
17
  import { getDashboardData, updateDashboardData } from "./redux/index.js";
13
18
  import DashboardPanelWrapper from "./DashboardPanelWrapper.js";
19
+ import { jsx as _jsx } from "react/jsx-runtime";
20
+ import { Fragment as _Fragment } from "react/jsx-runtime";
21
+ import { jsxs as _jsxs } from "react/jsx-runtime";
14
22
  var log = Log.module('DashboardLayout');
15
23
  var EMPTY_OBJECT = Object.freeze({});
16
24
  var DEFAULT_LAYOUT_CONFIG = [];
@@ -26,7 +34,9 @@ export function DashboardLayout(_ref) {
26
34
  var {
27
35
  id,
28
36
  children,
29
- emptyDashboard = /*#__PURE__*/React.createElement("div", null, "Dashboard is empty."),
37
+ emptyDashboard = /*#__PURE__*/_jsx("div", {
38
+ children: "Dashboard is empty."
39
+ }),
30
40
  layout,
31
41
  layoutConfig = DEFAULT_LAYOUT_CONFIG,
32
42
  onLayoutChange = DEFAULT_CALLBACK,
@@ -58,10 +68,13 @@ export function DashboardLayout(_ref) {
58
68
  glContainer,
59
69
  glEventHub
60
70
  } = props;
61
- return /*#__PURE__*/React.createElement(PanelErrorBoundary, {
71
+ return /*#__PURE__*/_jsx(PanelErrorBoundary, {
62
72
  glContainer: glContainer,
63
- glEventHub: glEventHub
64
- }, /*#__PURE__*/React.createElement(PanelWrapperType, props, /*#__PURE__*/React.createElement(CType, props)));
73
+ glEventHub: glEventHub,
74
+ children: /*#__PURE__*/_jsx(PanelWrapperType, _objectSpread(_objectSpread({}, props), {}, {
75
+ children: /*#__PURE__*/_jsx(CType, _objectSpread({}, props))
76
+ }))
77
+ });
65
78
  }
66
79
  var cleanup = layout.registerComponent(name, wrappedComponent);
67
80
  hydrateMap.set(name, componentHydrate);
@@ -151,12 +164,14 @@ export function DashboardLayout(_ref) {
151
164
  setIsDashboardEmpty(layout.root.contentItems.length === 0);
152
165
  }
153
166
  }, [hydrateComponent, layout, layoutConfig, lastConfig, panelManager, previousLayoutConfig]);
154
- return /*#__PURE__*/React.createElement(React.Fragment, null, isDashboardEmpty && emptyDashboard, layoutChildren, React.Children.map(children, child => child != null ? /*#__PURE__*/React.cloneElement(child, {
155
- id,
156
- layout,
157
- panelManager,
158
- registerComponent
159
- }) : null));
167
+ return /*#__PURE__*/_jsxs(_Fragment, {
168
+ children: [isDashboardEmpty && emptyDashboard, layoutChildren, React.Children.map(children, child => child != null ? /*#__PURE__*/React.cloneElement(child, {
169
+ id,
170
+ layout,
171
+ panelManager,
172
+ registerComponent
173
+ }) : null)]
174
+ });
160
175
  }
161
176
  DashboardLayout.propTypes = {
162
177
  id: PropTypes.string.isRequired,
@@ -1 +1 @@
1
- {"version":3,"file":"DashboardLayout.js","names":["React","useCallback","useEffect","useMemo","useState","PropTypes","Log","usePrevious","useDispatch","useSelector","PanelManager","PanelErrorBoundary","LayoutUtils","dehydrate","dehydrateDefault","hydrate","hydrateDefault","PanelEvent","GLPropTypes","useListener","getDashboardData","updateDashboardData","DashboardPanelWrapper","log","module","EMPTY_OBJECT","Object","freeze","DEFAULT_LAYOUT_CONFIG","DEFAULT_CALLBACK","undefined","FALLBACK_CALLBACK","props","DashboardLayout","id","children","emptyDashboard","layout","layoutConfig","onLayoutChange","onLayoutInitialized","panelWrapper","dispatch","data","state","isDashboardEmpty","setIsDashboardEmpty","isItemDragging","setIsItemDragging","lastConfig","setLastConfig","initialClosedPanels","closed","isDashboardInitialized","setIsDashboardInitialized","layoutChildren","setLayoutChildren","getReactChildren","hydrateMap","Map","dehydrateMap","registerComponent","name","componentType","componentHydrate","componentDehydrate","debug2","wrappedComponent","CType","PanelWrapperType","glContainer","glEventHub","cleanup","set","hydrateComponent","get","dehydrateComponent","config","panelManager","openedMap","handleLayoutStateChanged","glConfig","toConfig","contentConfig","content","dehydratedLayoutConfig","dehydrateLayoutConfig","hasChanged","isEqual","debug","root","contentItems","length","handleLayoutItemPickedUp","component","componentId","getIdFromContainer","eventHub","emit","DRAGGING","handleLayoutItemDropped","DROPPED","handleComponentCreated","item","element","cssComponent","replace","toLowerCase","cssClass","addClass","handleReactChildrenChange","TITLE_CHANGED","previousLayoutConfig","loadNewConfig","hydrateLayoutConfig","remove","i","addChild","Children","map","child","cloneElement","propTypes","string","isRequired","node","shape","Layout","arrayOf","func"],"sources":["../src/DashboardLayout.tsx"],"sourcesContent":["import React, {\n ComponentType,\n ReactElement,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from 'react';\nimport PropTypes from 'prop-types';\nimport GoldenLayout from '@deephaven/golden-layout';\nimport type {\n Container,\n ItemConfigType,\n ReactComponentConfig,\n} from '@deephaven/golden-layout';\nimport Log from '@deephaven/log';\nimport { usePrevious } from '@deephaven/react-hooks';\nimport { RootState } from '@deephaven/redux';\nimport { useDispatch, useSelector } from 'react-redux';\nimport PanelManager, { ClosedPanels } from './PanelManager';\nimport PanelErrorBoundary from './PanelErrorBoundary';\nimport LayoutUtils from './layout/LayoutUtils';\nimport {\n dehydrate as dehydrateDefault,\n hydrate as hydrateDefault,\n} from './DashboardUtils';\nimport PanelEvent from './PanelEvent';\nimport { GLPropTypes, useListener } from './layout';\nimport { getDashboardData, updateDashboardData } from './redux';\nimport {\n PanelComponentType,\n PanelDehydrateFunction,\n PanelHydrateFunction,\n PanelProps,\n} from './DashboardPlugin';\nimport DashboardPanelWrapper from './DashboardPanelWrapper';\n\nexport type DashboardLayoutConfig = ItemConfigType[];\n\nconst log = Log.module('DashboardLayout');\n\nconst EMPTY_OBJECT = Object.freeze({});\n\nconst DEFAULT_LAYOUT_CONFIG: DashboardLayoutConfig = [];\n\nconst DEFAULT_CALLBACK = () => undefined;\n\n// If a component isn't registered, just pass through the props so they are saved if a plugin is loaded later\nconst FALLBACK_CALLBACK = (props: unknown) => props;\n\ntype DashboardData = {\n closed?: ClosedPanels;\n};\n\ninterface DashboardLayoutProps {\n id: string;\n\n // Default hydrate/dehydration functions\n hydrate?: PanelHydrateFunction;\n dehydrate?: PanelDehydrateFunction;\n layout: GoldenLayout;\n layoutConfig?: DashboardLayoutConfig;\n onLayoutChange?: (dehydratedLayout: DashboardLayoutConfig) => void;\n onLayoutInitialized?: () => void;\n data?: DashboardData;\n children?: React.ReactNode | React.ReactNode[];\n emptyDashboard?: React.ReactNode;\n\n /** Component to wrap each panel with */\n panelWrapper?: ComponentType;\n}\n\n/**\n * DashboardLayout component. Handles hydrating, dehydrating components, listening for dragging panels.\n */\nexport function DashboardLayout({\n id,\n children,\n emptyDashboard = <div>Dashboard is empty.</div>,\n layout,\n layoutConfig = DEFAULT_LAYOUT_CONFIG,\n onLayoutChange = DEFAULT_CALLBACK,\n onLayoutInitialized = DEFAULT_CALLBACK,\n hydrate = hydrateDefault,\n dehydrate = dehydrateDefault,\n panelWrapper = DashboardPanelWrapper,\n}: DashboardLayoutProps): JSX.Element {\n const dispatch = useDispatch();\n const data =\n useSelector<RootState>(state => getDashboardData(state, id)) ??\n EMPTY_OBJECT;\n\n const [isDashboardEmpty, setIsDashboardEmpty] = useState(false);\n const [isItemDragging, setIsItemDragging] = useState(false);\n const [lastConfig, setLastConfig] = useState<DashboardLayoutConfig>();\n const [initialClosedPanels] = useState<ReactComponentConfig[] | undefined>(\n (data as DashboardData)?.closed ?? []\n );\n const [isDashboardInitialized, setIsDashboardInitialized] = useState(false);\n const [layoutChildren, setLayoutChildren] = useState(\n layout.getReactChildren()\n );\n\n const hydrateMap = useMemo(() => new Map(), []);\n const dehydrateMap = useMemo(() => new Map(), []);\n const registerComponent = useCallback(\n (\n name: string,\n componentType: PanelComponentType,\n componentHydrate = hydrate,\n componentDehydrate = dehydrate\n ) => {\n log.debug2(\n 'registerComponent',\n name,\n componentType,\n componentHydrate,\n componentDehydrate\n );\n\n function wrappedComponent(props: PanelProps) {\n const CType = componentType;\n const PanelWrapperType = panelWrapper;\n\n // Props supplied by GoldenLayout\n const { glContainer, glEventHub } = props;\n return (\n <PanelErrorBoundary glContainer={glContainer} glEventHub={glEventHub}>\n {/* eslint-disable-next-line react/jsx-props-no-spreading */}\n <PanelWrapperType {...props}>\n {/* eslint-disable-next-line react/jsx-props-no-spreading */}\n <CType {...props} />\n </PanelWrapperType>\n </PanelErrorBoundary>\n );\n }\n\n const cleanup = layout.registerComponent(name, wrappedComponent);\n hydrateMap.set(name, componentHydrate);\n dehydrateMap.set(name, componentDehydrate);\n return cleanup;\n },\n [hydrate, dehydrate, hydrateMap, dehydrateMap, layout, panelWrapper]\n );\n const hydrateComponent = useCallback(\n (name, props) => (hydrateMap.get(name) ?? FALLBACK_CALLBACK)(props, id),\n [hydrateMap, id]\n );\n const dehydrateComponent = useCallback(\n (name, config) => (dehydrateMap.get(name) ?? FALLBACK_CALLBACK)(config, id),\n [dehydrateMap, id]\n );\n const panelManager = useMemo(\n () =>\n new PanelManager(\n layout,\n hydrateComponent,\n dehydrateComponent,\n new Map(),\n initialClosedPanels,\n ({ closed, openedMap }) => {\n dispatch(updateDashboardData(id, { closed, openedMap }));\n }\n ),\n [\n dehydrateComponent,\n dispatch,\n hydrateComponent,\n id,\n initialClosedPanels,\n layout,\n ]\n );\n\n const handleLayoutStateChanged = useCallback(() => {\n // we don't want to emit stateChanges that happen during item drags or else\n // we risk the last saved state being one without that panel in the layout entirely\n if (isItemDragging) return;\n\n if (!isDashboardInitialized) {\n onLayoutInitialized();\n setIsDashboardInitialized(true);\n }\n\n const glConfig = layout.toConfig();\n const contentConfig = glConfig.content;\n const dehydratedLayoutConfig = LayoutUtils.dehydrateLayoutConfig(\n contentConfig,\n dehydrateComponent\n );\n const hasChanged =\n lastConfig == null ||\n !LayoutUtils.isEqual(lastConfig, dehydratedLayoutConfig);\n\n log.debug(\n 'handleLayoutStateChanged',\n hasChanged,\n contentConfig,\n dehydratedLayoutConfig\n );\n\n if (hasChanged) {\n setIsDashboardEmpty(layout.root.contentItems.length === 0);\n\n setLastConfig(dehydratedLayoutConfig);\n\n onLayoutChange(dehydratedLayoutConfig);\n\n setLayoutChildren(layout.getReactChildren());\n }\n }, [\n dehydrateComponent,\n isDashboardInitialized,\n isItemDragging,\n lastConfig,\n layout,\n onLayoutChange,\n onLayoutInitialized,\n ]);\n\n const handleLayoutItemPickedUp = useCallback(\n (component: Container) => {\n const componentId = LayoutUtils.getIdFromContainer(component);\n layout.eventHub.emit(PanelEvent.DRAGGING, componentId);\n setIsItemDragging(true);\n },\n [layout.eventHub]\n );\n\n const handleLayoutItemDropped = useCallback(\n (component: Container) => {\n const componentId = LayoutUtils.getIdFromContainer(component);\n layout.eventHub.emit(PanelEvent.DROPPED, componentId);\n setIsItemDragging(false);\n },\n [layout.eventHub]\n );\n\n const handleComponentCreated = useCallback(item => {\n log.debug2('handleComponentCreated', item);\n\n if (\n item == null ||\n item.config == null ||\n item.config.component == null ||\n item.element == null\n ) {\n return;\n }\n\n const cssComponent = item.config.component\n .replace(/([a-z])([A-Z])/g, '$1-$2')\n .toLowerCase();\n const cssClass = `${cssComponent}-component`;\n item.element.addClass(cssClass);\n }, []);\n\n const handleReactChildrenChange = useCallback(() => {\n setLayoutChildren(layout.getReactChildren());\n }, [layout]);\n\n useListener(layout, 'stateChanged', handleLayoutStateChanged);\n useListener(layout, 'itemPickedUp', handleLayoutItemPickedUp);\n useListener(layout, 'itemDropped', handleLayoutItemDropped);\n useListener(layout, 'componentCreated', handleComponentCreated);\n useListener(\n layout.eventHub,\n PanelEvent.TITLE_CHANGED,\n handleLayoutStateChanged\n );\n useListener(layout, 'reactChildrenChanged', handleReactChildrenChange);\n\n const previousLayoutConfig = usePrevious(layoutConfig);\n useEffect(\n function loadNewConfig() {\n if (\n previousLayoutConfig !== layoutConfig &&\n layoutConfig !== lastConfig\n ) {\n log.debug('Setting new layout content...');\n const content = LayoutUtils.hydrateLayoutConfig(\n layoutConfig,\n hydrateComponent\n );\n // Remove the old layout before add the new one\n while (layout.root.contentItems.length > 0) {\n layout.root.contentItems[0].remove();\n }\n\n // Add the new content. It is usally just one item from the root\n for (let i = 0; i < content.length; i += 1) {\n layout.root.addChild(content[i]);\n }\n\n setIsDashboardEmpty(layout.root.contentItems.length === 0);\n }\n },\n [\n hydrateComponent,\n layout,\n layoutConfig,\n lastConfig,\n panelManager,\n previousLayoutConfig,\n ]\n );\n\n return (\n <>\n {isDashboardEmpty && emptyDashboard}\n {layoutChildren}\n {React.Children.map(children, child =>\n child != null\n ? React.cloneElement(child as ReactElement, {\n id,\n layout,\n panelManager,\n registerComponent,\n })\n : null\n )}\n </>\n );\n}\n\nDashboardLayout.propTypes = {\n id: PropTypes.string.isRequired,\n children: PropTypes.node,\n data: PropTypes.shape({}),\n emptyDashboard: PropTypes.node,\n layout: GLPropTypes.Layout.isRequired,\n layoutConfig: PropTypes.arrayOf(PropTypes.shape({})),\n onLayoutChange: PropTypes.func,\n onLayoutInitialized: PropTypes.func,\n};\n\nexport default DashboardLayout;\n"],"mappings":"AAAA,OAAOA,KAAK,IAGVC,WAAW,EACXC,SAAS,EACTC,OAAO,EACPC,QAAQ,QACH,OAAO;AACd,OAAOC,SAAS,MAAM,YAAY;AAOlC,OAAOC,GAAG,MAAM,gBAAgB;AAChC,SAASC,WAAW,QAAQ,wBAAwB;AAEpD,SAASC,WAAW,EAAEC,WAAW,QAAQ,aAAa;AAAC,OAChDC,YAAY;AAAA,OACZC,kBAAkB;AAAA,OAClBC,WAAW;AAAA,SAEhBC,SAAS,IAAIC,gBAAgB,EAC7BC,OAAO,IAAIC,cAAc;AAAA,OAEpBC,UAAU;AAAA,SACRC,WAAW,EAAEC,WAAW;AAAA,SACxBC,gBAAgB,EAAEC,mBAAmB;AAAA,OAOvCC,qBAAqB;AAI5B,IAAMC,GAAG,GAAGjB,GAAG,CAACkB,MAAM,CAAC,iBAAiB,CAAC;AAEzC,IAAMC,YAAY,GAAGC,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,CAAC;AAEtC,IAAMC,qBAA4C,GAAG,EAAE;AAEvD,IAAMC,gBAAgB,GAAG,MAAMC,SAAS;;AAExC;AACA,IAAMC,iBAAiB,GAAIC,KAAc,IAAKA,KAAK;AAwBnD;AACA;AACA;AACA,OAAO,SAASC,eAAe,OAWO;EAAA;EAAA,IAXN;IAC9BC,EAAE;IACFC,QAAQ;IACRC,cAAc,gBAAG,iCAAK,qBAAmB,CAAM;IAC/CC,MAAM;IACNC,YAAY,GAAGV,qBAAqB;IACpCW,cAAc,GAAGV,gBAAgB;IACjCW,mBAAmB,GAAGX,gBAAgB;IACtCd,OAAO,GAAGC,cAAc;IACxBH,SAAS,GAAGC,gBAAgB;IAC5B2B,YAAY,GA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AC,CAAC;IAC5D;EACF,CAAC,EACD,CACElB,gBAAgB,EAChBrC,MAAM,EACNC,YAAY,EACZW,UAAU,EACV6B,YAAY,EACZkC,oBAAoB,CACrB,CACF;EAED,oBACE,0CACGnE,gBAAgB,IAAIT,cAAc,EAClCmB,cAAc,EACdvD,KAAK,CAACsH,QAAQ,CAACC,GAAG,CAACpF,QAAQ,EAAEqF,KAAK,IACjCA,KAAK,IAAI,IAAI,gBACTxH,KAAK,CAACyH,YAAY,CAACD,KAAK,EAAkB;IACxCtF,EAAE;IACFG,MAAM;IACNyC,YAAY;IACZjB;EACF,CAAC,CAAC,GACF,IAAI,CACT,CACA;AAEP;AAEA5B,eAAe,CAACyF,SAAS,GAAG;EAC1BxF,EAAE,EAAE7B,SAAS,CAACsH,MAAM,CAACC,UAAU;EAC/BzF,QAAQ,EAAE9B,SAAS,CAACwH,IAAI;EACxBlF,IAAI,EAAEtC,SAAS,CAACyH,KAAK,CAAC,CAAC,CAAC,CAAC;EACzB1F,cAAc,EAAE/B,SAAS,CAACwH,IAAI;EAC9BxF,MAAM,EAAEnB,WAAW,CAAC6G,MAAM,CAACH,UAAU;EACrCtF,YAAY,EAAEjC,SAAS,CAAC2H,OAAO,CAAC3H,SAAS,CAACyH,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;EACpDvF,cAAc,EAAElC,SAAS,CAAC4H,IAAI;EAC9BzF,mBAAmB,EAAEnC,SAAS,CAAC4H;AACjC,CAAC;AAED,eAAehG,eAAe"}
1
+ {"version":3,"file":"DashboardLayout.js","names":["React","useCallback","useEffect","useMemo","useState","PropTypes","Log","usePrevious","useDispatch","useSelector","PanelManager","PanelErrorBoundary","LayoutUtils","dehydrate","dehydrateDefault","hydrate","hydrateDefault","PanelEvent","GLPropTypes","useListener","getDashboardData","updateDashboardData","DashboardPanelWrapper","log","module","EMPTY_OBJECT","Object","freeze","DEFAULT_LAYOUT_CONFIG","DEFAULT_CALLBACK","undefined","FALLBACK_CALLBACK","props","DashboardLayout","id","children","emptyDashboard","layout","layoutConfig","onLayoutChange","onLayoutInitialized","panelWrapper","dispatch","data","state","isDashboardEmpty","setIsDashboardEmpty","isItemDragging","setIsItemDragging","lastConfig","setLastConfig","initialClosedPanels","closed","isDashboardInitialized","setIsDashboardInitialized","layoutChildren","setLayoutChildren","getReactChildren","hydrateMap","Map","dehydrateMap","registerComponent","name","componentType","componentHydrate","componentDehydrate","debug2","wrappedComponent","CType","PanelWrapperType","glContainer","glEventHub","cleanup","set","hydrateComponent","get","dehydrateComponent","config","panelManager","openedMap","handleLayoutStateChanged","glConfig","toConfig","contentConfig","content","dehydratedLayoutConfig","dehydrateLayoutConfig","hasChanged","isEqual","debug","root","contentItems","length","handleLayoutItemPickedUp","component","componentId","getIdFromContainer","eventHub","emit","DRAGGING","handleLayoutItemDropped","DROPPED","handleComponentCreated","item","element","cssComponent","replace","toLowerCase","cssClass","addClass","handleReactChildrenChange","TITLE_CHANGED","previousLayoutConfig","loadNewConfig","hydrateLayoutConfig","remove","i","addChild","Children","map","child","cloneElement","propTypes","string","isRequired","node","shape","Layout","arrayOf","func"],"sources":["../src/DashboardLayout.tsx"],"sourcesContent":["import React, {\n ComponentType,\n ReactElement,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from 'react';\nimport PropTypes from 'prop-types';\nimport GoldenLayout from '@deephaven/golden-layout';\nimport type {\n Container,\n ItemConfigType,\n ReactComponentConfig,\n} from '@deephaven/golden-layout';\nimport Log from '@deephaven/log';\nimport { usePrevious } from '@deephaven/react-hooks';\nimport { RootState } from '@deephaven/redux';\nimport { useDispatch, useSelector } from 'react-redux';\nimport PanelManager, { ClosedPanels } from './PanelManager';\nimport PanelErrorBoundary from './PanelErrorBoundary';\nimport LayoutUtils from './layout/LayoutUtils';\nimport {\n dehydrate as dehydrateDefault,\n hydrate as hydrateDefault,\n} from './DashboardUtils';\nimport PanelEvent from './PanelEvent';\nimport { GLPropTypes, useListener } from './layout';\nimport { getDashboardData, updateDashboardData } from './redux';\nimport {\n PanelComponentType,\n PanelDehydrateFunction,\n PanelHydrateFunction,\n PanelProps,\n} from './DashboardPlugin';\nimport DashboardPanelWrapper from './DashboardPanelWrapper';\n\nexport type DashboardLayoutConfig = ItemConfigType[];\n\nconst log = Log.module('DashboardLayout');\n\nconst EMPTY_OBJECT = Object.freeze({});\n\nconst DEFAULT_LAYOUT_CONFIG: DashboardLayoutConfig = [];\n\nconst DEFAULT_CALLBACK = () => undefined;\n\n// If a component isn't registered, just pass through the props so they are saved if a plugin is loaded later\nconst FALLBACK_CALLBACK = (props: unknown) => props;\n\ntype DashboardData = {\n closed?: ClosedPanels;\n};\n\ninterface DashboardLayoutProps {\n id: string;\n\n // Default hydrate/dehydration functions\n hydrate?: PanelHydrateFunction;\n dehydrate?: PanelDehydrateFunction;\n layout: GoldenLayout;\n layoutConfig?: DashboardLayoutConfig;\n onLayoutChange?: (dehydratedLayout: DashboardLayoutConfig) => void;\n onLayoutInitialized?: () => void;\n data?: DashboardData;\n children?: React.ReactNode | React.ReactNode[];\n emptyDashboard?: React.ReactNode;\n\n /** Component to wrap each panel with */\n panelWrapper?: ComponentType;\n}\n\n/**\n * DashboardLayout component. Handles hydrating, dehydrating components, listening for dragging panels.\n */\nexport function DashboardLayout({\n id,\n children,\n emptyDashboard = <div>Dashboard is empty.</div>,\n layout,\n layoutConfig = DEFAULT_LAYOUT_CONFIG,\n onLayoutChange = DEFAULT_CALLBACK,\n onLayoutInitialized = DEFAULT_CALLBACK,\n hydrate = hydrateDefault,\n dehydrate = dehydrateDefault,\n panelWrapper = DashboardPanelWrapper,\n}: DashboardLayoutProps): JSX.Element {\n const dispatch = useDispatch();\n const data =\n useSelector<RootState>(state => getDashboardData(state, id)) ??\n EMPTY_OBJECT;\n\n const [isDashboardEmpty, setIsDashboardEmpty] = useState(false);\n const [isItemDragging, setIsItemDragging] = useState(false);\n const [lastConfig, setLastConfig] = useState<DashboardLayoutConfig>();\n const [initialClosedPanels] = useState<ReactComponentConfig[] | undefined>(\n (data as DashboardData)?.closed ?? []\n );\n const [isDashboardInitialized, setIsDashboardInitialized] = useState(false);\n const [layoutChildren, setLayoutChildren] = useState(\n layout.getReactChildren()\n );\n\n const hydrateMap = useMemo(() => new Map(), []);\n const dehydrateMap = useMemo(() => new Map(), []);\n const registerComponent = useCallback(\n (\n name: string,\n componentType: PanelComponentType,\n componentHydrate = hydrate,\n componentDehydrate = dehydrate\n ) => {\n log.debug2(\n 'registerComponent',\n name,\n componentType,\n componentHydrate,\n componentDehydrate\n );\n\n function wrappedComponent(props: PanelProps) {\n const CType = componentType;\n const PanelWrapperType = panelWrapper;\n\n // Props supplied by GoldenLayout\n const { glContainer, glEventHub } = props;\n return (\n <PanelErrorBoundary glContainer={glContainer} glEventHub={glEventHub}>\n {/* eslint-disable-next-line react/jsx-props-no-spreading */}\n <PanelWrapperType {...props}>\n {/* eslint-disable-next-line react/jsx-props-no-spreading */}\n <CType {...props} />\n </PanelWrapperType>\n </PanelErrorBoundary>\n );\n }\n\n const cleanup = layout.registerComponent(name, wrappedComponent);\n hydrateMap.set(name, componentHydrate);\n dehydrateMap.set(name, componentDehydrate);\n return cleanup;\n },\n [hydrate, dehydrate, hydrateMap, dehydrateMap, layout, panelWrapper]\n );\n const hydrateComponent = useCallback(\n (name, props) => (hydrateMap.get(name) ?? FALLBACK_CALLBACK)(props, id),\n [hydrateMap, id]\n );\n const dehydrateComponent = useCallback(\n (name, config) => (dehydrateMap.get(name) ?? FALLBACK_CALLBACK)(config, id),\n [dehydrateMap, id]\n );\n const panelManager = useMemo(\n () =>\n new PanelManager(\n layout,\n hydrateComponent,\n dehydrateComponent,\n new Map(),\n initialClosedPanels,\n ({ closed, openedMap }) => {\n dispatch(updateDashboardData(id, { closed, openedMap }));\n }\n ),\n [\n dehydrateComponent,\n dispatch,\n hydrateComponent,\n id,\n initialClosedPanels,\n layout,\n ]\n );\n\n const handleLayoutStateChanged = useCallback(() => {\n // we don't want to emit stateChanges that happen during item drags or else\n // we risk the last saved state being one without that panel in the layout entirely\n if (isItemDragging) return;\n\n if (!isDashboardInitialized) {\n onLayoutInitialized();\n setIsDashboardInitialized(true);\n }\n\n const glConfig = layout.toConfig();\n const contentConfig = glConfig.content;\n const dehydratedLayoutConfig = LayoutUtils.dehydrateLayoutConfig(\n contentConfig,\n dehydrateComponent\n );\n const hasChanged =\n lastConfig == null ||\n !LayoutUtils.isEqual(lastConfig, dehydratedLayoutConfig);\n\n log.debug(\n 'handleLayoutStateChanged',\n hasChanged,\n contentConfig,\n dehydratedLayoutConfig\n );\n\n if (hasChanged) {\n setIsDashboardEmpty(layout.root.contentItems.length === 0);\n\n setLastConfig(dehydratedLayoutConfig);\n\n onLayoutChange(dehydratedLayoutConfig);\n\n setLayoutChildren(layout.getReactChildren());\n }\n }, [\n dehydrateComponent,\n isDashboardInitialized,\n isItemDragging,\n lastConfig,\n layout,\n onLayoutChange,\n onLayoutInitialized,\n ]);\n\n const handleLayoutItemPickedUp = useCallback(\n (component: Container) => {\n const componentId = LayoutUtils.getIdFromContainer(component);\n layout.eventHub.emit(PanelEvent.DRAGGING, componentId);\n setIsItemDragging(true);\n },\n [layout.eventHub]\n );\n\n const handleLayoutItemDropped = useCallback(\n (component: Container) => {\n const componentId = LayoutUtils.getIdFromContainer(component);\n layout.eventHub.emit(PanelEvent.DROPPED, componentId);\n setIsItemDragging(false);\n },\n [layout.eventHub]\n );\n\n const handleComponentCreated = useCallback(item => {\n log.debug2('handleComponentCreated', item);\n\n if (\n item == null ||\n item.config == null ||\n item.config.component == null ||\n item.element == null\n ) {\n return;\n }\n\n const cssComponent = item.config.component\n .replace(/([a-z])([A-Z])/g, '$1-$2')\n .toLowerCase();\n const cssClass = `${cssComponent}-component`;\n item.element.addClass(cssClass);\n }, []);\n\n const handleReactChildrenChange = useCallback(() => {\n setLayoutChildren(layout.getReactChildren());\n }, [layout]);\n\n useListener(layout, 'stateChanged', handleLayoutStateChanged);\n useListener(layout, 'itemPickedUp', handleLayoutItemPickedUp);\n useListener(layout, 'itemDropped', handleLayoutItemDropped);\n useListener(layout, 'componentCreated', handleComponentCreated);\n useListener(\n layout.eventHub,\n PanelEvent.TITLE_CHANGED,\n handleLayoutStateChanged\n );\n useListener(layout, 'reactChildrenChanged', handleReactChildrenChange);\n\n const previousLayoutConfig = usePrevious(layoutConfig);\n useEffect(\n function loadNewConfig() {\n if (\n previousLayoutConfig !== layoutConfig &&\n layoutConfig !== lastConfig\n ) {\n log.debug('Setting new layout content...');\n const content = LayoutUtils.hydrateLayoutConfig(\n layoutConfig,\n hydrateComponent\n );\n // Remove the old layout before add the new one\n while (layout.root.contentItems.length > 0) {\n layout.root.contentItems[0].remove();\n }\n\n // Add the new content. It is usally just one item from the root\n for (let i = 0; i < content.length; i += 1) {\n layout.root.addChild(content[i]);\n }\n\n setIsDashboardEmpty(layout.root.contentItems.length === 0);\n }\n },\n [\n hydrateComponent,\n layout,\n layoutConfig,\n lastConfig,\n panelManager,\n previousLayoutConfig,\n ]\n );\n\n return (\n <>\n {isDashboardEmpty && emptyDashboard}\n {layoutChildren}\n {React.Children.map(children, child =>\n child != null\n ? React.cloneElement(child as ReactElement, {\n id,\n layout,\n panelManager,\n registerComponent,\n })\n : null\n )}\n </>\n );\n}\n\nDashboardLayout.propTypes = {\n id: PropTypes.string.isRequired,\n children: PropTypes.node,\n data: PropTypes.shape({}),\n emptyDashboard: PropTypes.node,\n layout: GLPropTypes.Layout.isRequired,\n layoutConfig: PropTypes.arrayOf(PropTypes.shape({})),\n onLayoutChange: PropTypes.func,\n onLayoutInitialized: PropTypes.func,\n};\n\nexport default DashboardLayout;\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,IAGVC,WAAW,EACXC,SAAS,EACTC,OAAO,EACPC,QAAQ,QACH,OAAO;AACd,OAAOC,SAAS,MAAM,YAAY;AAOlC,OAAOC,GAAG,MAAM,gBAAgB;AAChC,SAASC,WAAW,QAAQ,wBAAwB;AAEpD,SAASC,WAAW,EAAEC,WAAW,QAAQ,aAAa;AAAC,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ACF,IAAI,CACT;EAAA,EACA;AAEP;AAEA5B,eAAe,CAACyF,SAAS,GAAG;EAC1BxF,EAAE,EAAE7B,SAAS,CAACsH,MAAM,CAACC,UAAU;EAC/BzF,QAAQ,EAAE9B,SAAS,CAACwH,IAAI;EACxBlF,IAAI,EAAEtC,SAAS,CAACyH,KAAK,CAAC,CAAC,CAAC,CAAC;EACzB1F,cAAc,EAAE/B,SAAS,CAACwH,IAAI;EAC9BxF,MAAM,EAAEnB,WAAW,CAAC6G,MAAM,CAACH,UAAU;EACrCtF,YAAY,EAAEjC,SAAS,CAAC2H,OAAO,CAAC3H,SAAS,CAACyH,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;EACpDvF,cAAc,EAAElC,SAAS,CAAC4H,IAAI;EAC9BzF,mBAAmB,EAAEnC,SAAS,CAAC4H;AACjC,CAAC;AAED,eAAehG,eAAe"}
@@ -1,10 +1,14 @@
1
1
  import React from 'react';
2
+ import { Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { jsx as _jsx } from "react/jsx-runtime";
2
4
  export function DashboardPanelWrapper(_ref) {
3
5
  var {
4
6
  children
5
7
  } = _ref;
6
8
  // eslint-disable-next-line react/jsx-no-useless-fragment
7
- return /*#__PURE__*/React.createElement(React.Fragment, null, children);
9
+ return /*#__PURE__*/_jsx(_Fragment, {
10
+ children: children
11
+ });
8
12
  }
9
13
  export default DashboardPanelWrapper;
10
14
  //# sourceMappingURL=DashboardPanelWrapper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DashboardPanelWrapper.js","names":["React","DashboardPanelWrapper","children"],"sources":["../src/DashboardPanelWrapper.tsx"],"sourcesContent":["import React, { PropsWithChildren } from 'react';\n\nexport function DashboardPanelWrapper({ children }: PropsWithChildren<object>) {\n // eslint-disable-next-line react/jsx-no-useless-fragment\n return <>{children}</>;\n}\n\nexport default DashboardPanelWrapper;\n"],"mappings":"AAAA,OAAOA,KAAK,MAA6B,OAAO;AAEhD,OAAO,SAASC,qBAAqB,OAA0C;EAAA,IAAzC;IAAEC;EAAoC,CAAC;EAC3E;EACA,oBAAO,0CAAGA,QAAQ,CAAI;AACxB;AAEA,eAAeD,qBAAqB"}
1
+ {"version":3,"file":"DashboardPanelWrapper.js","names":["React","DashboardPanelWrapper","children"],"sources":["../src/DashboardPanelWrapper.tsx"],"sourcesContent":["import React, { PropsWithChildren } from 'react';\n\nexport function DashboardPanelWrapper({ children }: PropsWithChildren<object>) {\n // eslint-disable-next-line react/jsx-no-useless-fragment\n return <>{children}</>;\n}\n\nexport default DashboardPanelWrapper;\n"],"mappings":"AAAA,OAAOA,KAAK,MAA6B,OAAO;AAAC;AAAA;AAEjD,OAAO,SAASC,qBAAqB,OAA0C;EAAA,IAAzC;IAAEC;EAAoC,CAAC;EAC3E;EACA,oBAAO;IAAA,UAAGA;EAAQ,EAAI;AACxB;AAEA,eAAeD,qBAAqB"}
@@ -4,6 +4,7 @@ import Log from '@deephaven/log';
4
4
  import PanelEvent from "./PanelEvent.js";
5
5
  import LayoutUtils from "./layout/LayoutUtils.js";
6
6
  import "./PanelErrorBoundary.css";
7
+ import { jsx as _jsx } from "react/jsx-runtime";
7
8
  var log = Log.module('PanelErrorBoundary');
8
9
  /**
9
10
  * Panel wrapper implementing Error Boundary and emitting Closed event.
@@ -40,13 +41,14 @@ class PanelErrorBoundary extends Component {
40
41
  error
41
42
  } = this.state;
42
43
  if (error != null) {
43
- return /*#__PURE__*/React.createElement("div", {
44
- className: "panel-error-boundary"
45
- }, /*#__PURE__*/React.createElement(LoadingOverlay, {
46
- errorMessage: "".concat(error),
47
- isLoading: false,
48
- isLoaded: false
49
- }));
44
+ return /*#__PURE__*/_jsx("div", {
45
+ className: "panel-error-boundary",
46
+ children: /*#__PURE__*/_jsx(LoadingOverlay, {
47
+ errorMessage: "".concat(error),
48
+ isLoading: false,
49
+ isLoaded: false
50
+ })
51
+ });
50
52
  }
51
53
  return children;
52
54
  }
@@ -1 +1 @@
1
- {"version":3,"file":"PanelErrorBoundary.js","names":["React","Component","LoadingOverlay","Log","PanelEvent","LayoutUtils","log","module","PanelErrorBoundary","constructor","props","state","error","componentDidCatch","setState","componentWillUnmount","glContainer","glEventHub","panelId","getIdFromContainer","debug","emit","CLOSED","render","children"],"sources":["../src/PanelErrorBoundary.tsx"],"sourcesContent":["import React, { Component, ReactNode } from 'react';\nimport { LoadingOverlay } from '@deephaven/components';\nimport type { Container, EventEmitter } from '@deephaven/golden-layout';\nimport Log from '@deephaven/log';\nimport PanelEvent from './PanelEvent';\nimport LayoutUtils from './layout/LayoutUtils';\nimport './PanelErrorBoundary.scss';\n\nconst log = Log.module('PanelErrorBoundary');\n\ninterface PanelErrorBoundaryProps {\n children: ReactNode;\n glContainer: Container;\n glEventHub: EventEmitter;\n}\n\ninterface PanelErrorBoundaryState {\n error: Error | null;\n}\n/**\n * Panel wrapper implementing Error Boundary and emitting Closed event.\n * Closed event has to be emitted from the wrapper instead of the panel itself\n * because the panel can get unmounted on errors\n * and we want to differentiate between unmount on error vs panel being intentionally closed.\n */\nclass PanelErrorBoundary extends Component<\n PanelErrorBoundaryProps,\n PanelErrorBoundaryState\n> {\n constructor(props: PanelErrorBoundaryProps) {\n super(props);\n this.state = { error: null };\n }\n\n componentDidCatch(error: Error): void {\n this.setState({ error });\n }\n\n componentWillUnmount(): void {\n const { glContainer, glEventHub } = this.props;\n const panelId = LayoutUtils.getIdFromContainer(glContainer);\n log.debug('componentWillUnmount', panelId);\n glEventHub.emit(PanelEvent.CLOSED, panelId, glContainer);\n }\n\n render(): ReactNode {\n const { children } = this.props;\n const { error } = this.state;\n if (error != null) {\n return (\n <div className=\"panel-error-boundary\">\n <LoadingOverlay\n errorMessage={`${error}`}\n isLoading={false}\n isLoaded={false}\n />\n </div>\n );\n }\n return children;\n }\n}\n\nexport default PanelErrorBoundary;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAmB,OAAO;AACnD,SAASC,cAAc,QAAQ,uBAAuB;AAEtD,OAAOC,GAAG,MAAM,gBAAgB;AAAC,OAC1BC,UAAU;AAAA,OACVC,WAAW;AAAA;AAGlB,IAAMC,GAAG,GAAGH,GAAG,CAACI,MAAM,CAAC,oBAAoB,CAAC;AAW5C;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,kBAAkB,SAASP,SAAS,CAGxC;EACAQ,WAAW,CAACC,KAA8B,EAAE;IAC1C,KAAK,CAACA,KAAK,CAAC;IACZ,IAAI,CAACC,KAAK,GAAG;MAAEC,KAAK,EAAE;IAAK,CAAC;EAC9B;EAEAC,iBAAiB,CAACD,KAAY,EAAQ;IACpC,IAAI,CAACE,QAAQ,CAAC;MAAEF;IAAM,CAAC,CAAC;EAC1B;EAEAG,oBAAoB,GAAS;IAC3B,IAAM;MAAEC,WAAW;MAAEC;IAAW,CAAC,GAAG,IAAI,CAACP,KAAK;IAC9C,IAAMQ,OAAO,GAAGb,WAAW,CAACc,kBAAkB,CAACH,WAAW,CAAC;IAC3DV,GAAG,CAACc,KAAK,CAAC,sBAAsB,EAAEF,OAAO,CAAC;IAC1CD,UAAU,CAACI,IAAI,CAACjB,UAAU,CAACkB,MAAM,EAAEJ,OAAO,EAAEF,WAAW,CAAC;EAC1D;EAEAO,MAAM,GAAc;IAClB,IAAM;MAAEC;IAAS,CAAC,GAAG,IAAI,CAACd,KAAK;IAC/B,IAAM;MAAEE;IAAM,CAAC,GAAG,IAAI,CAACD,KAAK;IAC5B,IAAIC,KAAK,IAAI,IAAI,EAAE;MACjB,oBACE;QAAK,SAAS,EAAC;MAAsB,gBACnC,oBAAC,cAAc;QACb,YAAY,YAAKA,KAAK,CAAG;QACzB,SAAS,EAAE,KAAM;QACjB,QAAQ,EAAE;MAAM,EAChB,CACE;IAEV;IACA,OAAOY,QAAQ;EACjB;AACF;AAEA,eAAehB,kBAAkB"}
1
+ {"version":3,"file":"PanelErrorBoundary.js","names":["React","Component","LoadingOverlay","Log","PanelEvent","LayoutUtils","log","module","PanelErrorBoundary","constructor","props","state","error","componentDidCatch","setState","componentWillUnmount","glContainer","glEventHub","panelId","getIdFromContainer","debug","emit","CLOSED","render","children"],"sources":["../src/PanelErrorBoundary.tsx"],"sourcesContent":["import React, { Component, ReactNode } from 'react';\nimport { LoadingOverlay } from '@deephaven/components';\nimport type { Container, EventEmitter } from '@deephaven/golden-layout';\nimport Log from '@deephaven/log';\nimport PanelEvent from './PanelEvent';\nimport LayoutUtils from './layout/LayoutUtils';\nimport './PanelErrorBoundary.scss';\n\nconst log = Log.module('PanelErrorBoundary');\n\ninterface PanelErrorBoundaryProps {\n children: ReactNode;\n glContainer: Container;\n glEventHub: EventEmitter;\n}\n\ninterface PanelErrorBoundaryState {\n error: Error | null;\n}\n/**\n * Panel wrapper implementing Error Boundary and emitting Closed event.\n * Closed event has to be emitted from the wrapper instead of the panel itself\n * because the panel can get unmounted on errors\n * and we want to differentiate between unmount on error vs panel being intentionally closed.\n */\nclass PanelErrorBoundary extends Component<\n PanelErrorBoundaryProps,\n PanelErrorBoundaryState\n> {\n constructor(props: PanelErrorBoundaryProps) {\n super(props);\n this.state = { error: null };\n }\n\n componentDidCatch(error: Error): void {\n this.setState({ error });\n }\n\n componentWillUnmount(): void {\n const { glContainer, glEventHub } = this.props;\n const panelId = LayoutUtils.getIdFromContainer(glContainer);\n log.debug('componentWillUnmount', panelId);\n glEventHub.emit(PanelEvent.CLOSED, panelId, glContainer);\n }\n\n render(): ReactNode {\n const { children } = this.props;\n const { error } = this.state;\n if (error != null) {\n return (\n <div className=\"panel-error-boundary\">\n <LoadingOverlay\n errorMessage={`${error}`}\n isLoading={false}\n isLoaded={false}\n />\n </div>\n );\n }\n return children;\n }\n}\n\nexport default PanelErrorBoundary;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAmB,OAAO;AACnD,SAASC,cAAc,QAAQ,uBAAuB;AAEtD,OAAOC,GAAG,MAAM,gBAAgB;AAAC,OAC1BC,UAAU;AAAA,OACVC,WAAW;AAAA;AAAA;AAGlB,IAAMC,GAAG,GAAGH,GAAG,CAACI,MAAM,CAAC,oBAAoB,CAAC;AAW5C;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,kBAAkB,SAASP,SAAS,CAGxC;EACAQ,WAAW,CAACC,KAA8B,EAAE;IAC1C,KAAK,CAACA,KAAK,CAAC;IACZ,IAAI,CAACC,KAAK,GAAG;MAAEC,KAAK,EAAE;IAAK,CAAC;EAC9B;EAEAC,iBAAiB,CAACD,KAAY,EAAQ;IACpC,IAAI,CAACE,QAAQ,CAAC;MAAEF;IAAM,CAAC,CAAC;EAC1B;EAEAG,oBAAoB,GAAS;IAC3B,IAAM;MAAEC,WAAW;MAAEC;IAAW,CAAC,GAAG,IAAI,CAACP,KAAK;IAC9C,IAAMQ,OAAO,GAAGb,WAAW,CAACc,kBAAkB,CAACH,WAAW,CAAC;IAC3DV,GAAG,CAACc,KAAK,CAAC,sBAAsB,EAAEF,OAAO,CAAC;IAC1CD,UAAU,CAACI,IAAI,CAACjB,UAAU,CAACkB,MAAM,EAAEJ,OAAO,EAAEF,WAAW,CAAC;EAC1D;EAEAO,MAAM,GAAc;IAClB,IAAM;MAAEC;IAAS,CAAC,GAAG,IAAI,CAACd,KAAK;IAC/B,IAAM;MAAEE;IAAM,CAAC,GAAG,IAAI,CAACD,KAAK;IAC5B,IAAIC,KAAK,IAAI,IAAI,EAAE;MACjB,oBACE;QAAK,SAAS,EAAC,sBAAsB;QAAA,uBACnC,KAAC,cAAc;UACb,YAAY,YAAKA,KAAK,CAAG;UACzB,SAAS,EAAE,KAAM;UACjB,QAAQ,EAAE;QAAM;MAChB,EACE;IAEV;IACA,OAAOY,QAAQ;EACjB;AACF;AAEA,eAAehB,kBAAkB"}
@@ -1,6 +1,8 @@
1
1
  import React from 'react';
2
2
  import "./PanelPlaceholder.css";
3
3
  import LayoutUtils from "./layout/LayoutUtils.js";
4
+ import { jsxs as _jsxs } from "react/jsx-runtime";
5
+ import { jsx as _jsx } from "react/jsx-runtime";
4
6
  /**
5
7
  * Displays a placeholder for unregistered panel types.
6
8
  */
@@ -8,10 +10,13 @@ var PanelPlaceholder = /*#__PURE__*/React.forwardRef((props, ref) => {
8
10
  var component = LayoutUtils.getComponentNameFromPanel({
9
11
  props
10
12
  });
11
- return /*#__PURE__*/React.createElement("div", {
13
+ return /*#__PURE__*/_jsx("div", {
12
14
  ref: ref,
13
- className: "panel-placeholder"
14
- }, /*#__PURE__*/React.createElement("div", null, "Component \"", component, "\" is not registered."));
15
+ className: "panel-placeholder",
16
+ children: /*#__PURE__*/_jsxs("div", {
17
+ children: ["Component \"", component, "\" is not registered."]
18
+ })
19
+ });
15
20
  });
16
21
  PanelPlaceholder.displayName = 'PanelPlaceholder';
17
22
  export default PanelPlaceholder;
@@ -1 +1 @@
1
- {"version":3,"file":"PanelPlaceholder.js","names":["React","LayoutUtils","PanelPlaceholder","forwardRef","props","ref","component","getComponentNameFromPanel","displayName"],"sources":["../src/PanelPlaceholder.tsx"],"sourcesContent":["import React, { ForwardedRef } from 'react';\nimport './PanelPlaceholder.scss';\nimport LayoutUtils from './layout/LayoutUtils';\nimport { PanelProps } from './DashboardPlugin';\n\n/**\n * Displays a placeholder for unregistered panel types.\n */\nconst PanelPlaceholder = React.forwardRef(\n (props: PanelProps, ref: ForwardedRef<HTMLDivElement>) => {\n const component = LayoutUtils.getComponentNameFromPanel({ props });\n return (\n <div ref={ref} className=\"panel-placeholder\">\n <div>Component &quot;{component}&quot; is not registered.</div>\n </div>\n );\n }\n);\n\nPanelPlaceholder.displayName = 'PanelPlaceholder';\n\nexport default PanelPlaceholder;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAwB,OAAO;AAAC;AAAA,OAErCC,WAAW;AAGlB;AACA;AACA;AACA,IAAMC,gBAAgB,gBAAGF,KAAK,CAACG,UAAU,CACvC,CAACC,KAAiB,EAAEC,GAAiC,KAAK;EACxD,IAAMC,SAAS,GAAGL,WAAW,CAACM,yBAAyB,CAAC;IAAEH;EAAM,CAAC,CAAC;EAClE,oBACE;IAAK,GAAG,EAAEC,GAAI;IAAC,SAAS,EAAC;EAAmB,gBAC1C,iCAAK,cAAgB,EAACC,SAAS,EAAC,uBAAyB,CAAM,CAC3D;AAEV,CAAC,CACF;AAEDJ,gBAAgB,CAACM,WAAW,GAAG,kBAAkB;AAEjD,eAAeN,gBAAgB"}
1
+ {"version":3,"file":"PanelPlaceholder.js","names":["React","LayoutUtils","PanelPlaceholder","forwardRef","props","ref","component","getComponentNameFromPanel","displayName"],"sources":["../src/PanelPlaceholder.tsx"],"sourcesContent":["import React, { ForwardedRef } from 'react';\nimport './PanelPlaceholder.scss';\nimport LayoutUtils from './layout/LayoutUtils';\nimport { PanelProps } from './DashboardPlugin';\n\n/**\n * Displays a placeholder for unregistered panel types.\n */\nconst PanelPlaceholder = React.forwardRef(\n (props: PanelProps, ref: ForwardedRef<HTMLDivElement>) => {\n const component = LayoutUtils.getComponentNameFromPanel({ props });\n return (\n <div ref={ref} className=\"panel-placeholder\">\n <div>Component &quot;{component}&quot; is not registered.</div>\n </div>\n );\n }\n);\n\nPanelPlaceholder.displayName = 'PanelPlaceholder';\n\nexport default PanelPlaceholder;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAwB,OAAO;AAAC;AAAA,OAErCC,WAAW;AAAA;AAAA;AAGlB;AACA;AACA;AACA,IAAMC,gBAAgB,gBAAGF,KAAK,CAACG,UAAU,CACvC,CAACC,KAAiB,EAAEC,GAAiC,KAAK;EACxD,IAAMC,SAAS,GAAGL,WAAW,CAACM,yBAAyB,CAAC;IAAEH;EAAM,CAAC,CAAC;EAClE,oBACE;IAAK,GAAG,EAAEC,GAAI;IAAC,SAAS,EAAC,mBAAmB;IAAA,uBAC1C;MAAA,WAAK,cAAgB,EAACC,SAAS,EAAC,uBAAyB;IAAA;EAAM,EAC3D;AAEV,CAAC,CACF;AAEDJ,gBAAgB,CAACM,WAAW,GAAG,kBAAkB;AAEjD,eAAeN,gBAAgB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deephaven/dashboard",
3
- "version": "0.46.1-beta.2+a1893756",
3
+ "version": "0.46.1-beta.7+d59e9bed",
4
4
  "description": "Deephaven Dashboard",
5
5
  "author": "Deephaven Data Labs LLC",
6
6
  "license": "Apache-2.0",
@@ -22,13 +22,13 @@
22
22
  "build:sass": "sass --embed-sources --load-path=../../node_modules ./src:./dist"
23
23
  },
24
24
  "dependencies": {
25
- "@deephaven/components": "^0.46.1-beta.2+a1893756",
26
- "@deephaven/golden-layout": "^0.46.1-beta.2+a1893756",
27
- "@deephaven/jsapi-bootstrap": "^0.46.1-beta.2+a1893756",
28
- "@deephaven/log": "^0.46.1-beta.2+a1893756",
29
- "@deephaven/react-hooks": "^0.46.1-beta.2+a1893756",
30
- "@deephaven/redux": "^0.46.1-beta.2+a1893756",
31
- "@deephaven/utils": "^0.46.1-beta.2+a1893756",
25
+ "@deephaven/components": "^0.46.1-beta.7+d59e9bed",
26
+ "@deephaven/golden-layout": "^0.46.1-beta.7+d59e9bed",
27
+ "@deephaven/jsapi-bootstrap": "^0.46.1-beta.7+d59e9bed",
28
+ "@deephaven/log": "^0.46.1-beta.7+d59e9bed",
29
+ "@deephaven/react-hooks": "^0.46.1-beta.7+d59e9bed",
30
+ "@deephaven/redux": "^0.46.1-beta.7+d59e9bed",
31
+ "@deephaven/utils": "^0.46.1-beta.7+d59e9bed",
32
32
  "deep-equal": "^2.0.5",
33
33
  "lodash.ismatch": "^4.1.1",
34
34
  "lodash.throttle": "^4.1.1",
@@ -41,7 +41,7 @@
41
41
  "react-redux": "^7.2.4"
42
42
  },
43
43
  "devDependencies": {
44
- "@deephaven/mocks": "^0.46.1-beta.2+a1893756",
44
+ "@deephaven/mocks": "^0.46.1-beta.7+d59e9bed",
45
45
  "@types/lodash.ismatch": "^4.4.0"
46
46
  },
47
47
  "files": [
@@ -50,5 +50,5 @@
50
50
  "publishConfig": {
51
51
  "access": "public"
52
52
  },
53
- "gitHead": "a18937562f6e9ce2d62b27f79a60adc341a435e9"
53
+ "gitHead": "d59e9bed95152170626265a00ea27d716e1b2bcb"
54
54
  }