@deephaven/dashboard 0.23.1-beta.8 → 0.24.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.
@@ -1 +1 @@
1
- {"version":3,"file":"DashboardLayout.d.ts","sourceRoot":"","sources":["../src/DashboardLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AACf,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,YAAY,MAAM,0BAA0B,CAAC;AACpD,OAAO,KAAK,EAGV,cAAc,EAEf,MAAM,0BAA0B,CAAC;AAKlC,OAAqB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAU5D,OAAO,EAEL,sBAAsB,EACtB,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,MAAM,qBAAqB,GAAG,cAAc,EAAE,CAAC;AAarD,KAAK,aAAa,GAAG;IACnB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB,CAAC;AAEF,UAAU,oBAAoB;IAC5B,EAAE,EAAE,MAAM,CAAC;IAGX,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,SAAS,CAAC,EAAE,sBAAsB,CAAC;IACnC,MAAM,EAAE,YAAY,CAAC;IACrB,YAAY,CAAC,EAAE,qBAAqB,CAAC;IACrC,cAAc,CAAC,EAAE,CAAC,gBAAgB,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACnE,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;IACjC,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;IAC/C,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAClC;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,EAC9B,EAAE,EACF,QAAQ,EACR,cAA+C,EAC/C,MAAM,EACN,YAAoC,EACpC,cAAiC,EACjC,mBA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C,EACpC,cAAiC,EACjC,mBAAsC,EACtC,OAAwB,EACxB,SAA4B,GAC7B,EAAE,oBAAoB,GAAG,GAAG,CAAC,OAAO,CA4OpC;yBAtPe,eAAe;;;;;;;;;;;;;;;;;;;;;;;;AAmQ/B,eAAe,eAAe,CAAC"}
@@ -112,12 +112,16 @@ export function DashboardLayout(_ref) {
112
112
  onLayoutChange(dehydratedLayoutConfig);
113
113
  }
114
114
  }, [dehydrateComponent, isDashboardInitialized, isItemDragging, lastConfig, layout, onLayoutChange, onLayoutInitialized]);
115
- var handleLayoutItemPickedUp = useCallback(() => {
115
+ var handleLayoutItemPickedUp = useCallback(component => {
116
+ var componentId = LayoutUtils.getIdFromContainer(component);
117
+ layout.eventHub.emit(PanelEvent.DRAGGING, componentId);
116
118
  setIsItemDragging(true);
117
- }, []);
118
- var handleLayoutItemDropped = useCallback(() => {
119
+ }, [layout.eventHub]);
120
+ var handleLayoutItemDropped = useCallback(component => {
121
+ var componentId = LayoutUtils.getIdFromContainer(component);
122
+ layout.eventHub.emit(PanelEvent.DROPPED, componentId);
119
123
  setIsItemDragging(false);
120
- }, []);
124
+ }, [layout.eventHub]);
121
125
  var handleComponentCreated = useCallback(item => {
122
126
  log.debug2('handleComponentCreated', item);
123
127
  if (item == null || item.config == null || item.config.component == null || item.element == null) {
@@ -1 +1 @@
1
- {"version":3,"file":"DashboardLayout.js","names":["React","useCallback","useEffect","useMemo","useState","PropTypes","Log","usePrevious","Provider","useDispatch","useSelector","useStore","PanelManager","PanelErrorBoundary","LayoutUtils","dehydrate","dehydrateDefault","hydrate","hydrateDefault","PanelEvent","GLPropTypes","useListener","getDashboardData","updateDashboardData","log","module","EMPTY_OBJECT","Object","freeze","DEFAULT_LAYOUT_CONFIG","DEFAULT_CALLBACK","undefined","FALLBACK_CALLBACK","props","DashboardLayout","id","children","emptyDashboard","layout","layoutConfig","onLayoutChange","onLayoutInitialized","dispatch","data","state","isDashboardEmpty","setIsDashboardEmpty","isItemDragging","setIsItemDragging","lastConfig","setLastConfig","initialClosedPanels","closed","isDashboardInitialized","setIsDashboardInitialized","hydrateMap","Map","dehydrateMap","store","registerComponent","name","componentType","componentHydrate","componentDehydrate","debug2","renderComponent","ref","CType","glContainer","glEventHub","wrappedComponent","forwardRef","cleanup","set","hydrateComponent","get","dehydrateComponent","config","panelManager","openedMap","handleLayoutStateChanged","glConfig","toConfig","contentConfig","content","dehydratedLayoutConfig","dehydrateLayoutConfig","hasChanged","isEqual","debug","root","contentItems","length","handleLayoutItemPickedUp","handleLayoutItemDropped","handleComponentCreated","item","component","element","cssComponent","replace","toLowerCase","cssClass","addClass","eventHub","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 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 EventEmitter,\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 { Provider, useDispatch, useSelector, useStore } 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} from './DashboardPlugin';\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\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}: 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\n const hydrateMap = useMemo(() => new Map(), []);\n const dehydrateMap = useMemo(() => new Map(), []);\n const store = useStore();\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 renderComponent(\n props: { glContainer: Container; glEventHub: EventEmitter },\n ref: unknown\n ) {\n // Cast it to an `any` type so we can pass the ref in correctly.\n // ComponentType doesn't seem to work right, ReactNode is also incorrect\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const CType = componentType as any;\n\n // Props supplied by GoldenLayout\n // eslint-disable-next-line react/prop-types\n const { glContainer, glEventHub } = props;\n return (\n <Provider store={store}>\n <PanelErrorBoundary\n glContainer={glContainer}\n glEventHub={glEventHub}\n >\n {/* eslint-disable-next-line react/jsx-props-no-spreading */}\n <CType {...props} ref={ref} />\n </PanelErrorBoundary>\n </Provider>\n );\n }\n\n const wrappedComponent = React.forwardRef(renderComponent);\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, store]\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 }, [\n dehydrateComponent,\n isDashboardInitialized,\n isItemDragging,\n lastConfig,\n layout,\n onLayoutChange,\n onLayoutInitialized,\n ]);\n\n const handleLayoutItemPickedUp = useCallback(() => {\n setIsItemDragging(true);\n }, []);\n\n const handleLayoutItemDropped = useCallback(() => {\n setIsItemDragging(false);\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 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\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 {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,IAEVC,WAAW,EACXC,SAAS,EACTC,OAAO,EACPC,QAAQ,QACH,OAAO;AACd,OAAOC,SAAS,MAAM,YAAY;AAQlC,OAAOC,GAAG,MAAM,gBAAgB;AAChC,SAASC,WAAW,QAAQ,wBAAwB;AAEpD,SAASC,QAAQ,EAAEC,WAAW,EAAEC,WAAW,EAAEC,QAAQ,QAAQ,aAAa;AAAC,OACpEC,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;AAS9C,IAAMC,GAAG,GAAGlB,GAAG,CAACmB,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;AAqBnD;A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C,GACF,IAAI,CACT,CACA;AAEP;AAEAzB,eAAe,CAACkF,SAAS,GAAG;EAC1BjF,EAAE,EAAE9B,SAAS,CAACgH,MAAM,CAACC,UAAU;EAC/BlF,QAAQ,EAAE/B,SAAS,CAACkH,IAAI;EACxB5E,IAAI,EAAEtC,SAAS,CAACmH,KAAK,CAAC,CAAC,CAAC,CAAC;EACzBnF,cAAc,EAAEhC,SAAS,CAACkH,IAAI;EAC9BjF,MAAM,EAAElB,WAAW,CAACqG,MAAM,CAACH,UAAU;EACrC/E,YAAY,EAAElC,SAAS,CAACqH,OAAO,CAACrH,SAAS,CAACmH,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;EACpDhF,cAAc,EAAEnC,SAAS,CAACsH,IAAI;EAC9BlF,mBAAmB,EAAEpC,SAAS,CAACsH;AACjC,CAAC;AAED,eAAezF,eAAe"}
1
+ {"version":3,"file":"DashboardLayout.js","names":["React","useCallback","useEffect","useMemo","useState","PropTypes","Log","usePrevious","Provider","useDispatch","useSelector","useStore","PanelManager","PanelErrorBoundary","LayoutUtils","dehydrate","dehydrateDefault","hydrate","hydrateDefault","PanelEvent","GLPropTypes","useListener","getDashboardData","updateDashboardData","log","module","EMPTY_OBJECT","Object","freeze","DEFAULT_LAYOUT_CONFIG","DEFAULT_CALLBACK","undefined","FALLBACK_CALLBACK","props","DashboardLayout","id","children","emptyDashboard","layout","layoutConfig","onLayoutChange","onLayoutInitialized","dispatch","data","state","isDashboardEmpty","setIsDashboardEmpty","isItemDragging","setIsItemDragging","lastConfig","setLastConfig","initialClosedPanels","closed","isDashboardInitialized","setIsDashboardInitialized","hydrateMap","Map","dehydrateMap","store","registerComponent","name","componentType","componentHydrate","componentDehydrate","debug2","renderComponent","ref","CType","glContainer","glEventHub","wrappedComponent","forwardRef","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","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 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 EventEmitter,\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 { Provider, useDispatch, useSelector, useStore } 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} from './DashboardPlugin';\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\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}: 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\n const hydrateMap = useMemo(() => new Map(), []);\n const dehydrateMap = useMemo(() => new Map(), []);\n const store = useStore();\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 renderComponent(\n props: { glContainer: Container; glEventHub: EventEmitter },\n ref: unknown\n ) {\n // Cast it to an `any` type so we can pass the ref in correctly.\n // ComponentType doesn't seem to work right, ReactNode is also incorrect\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const CType = componentType as any;\n\n // Props supplied by GoldenLayout\n // eslint-disable-next-line react/prop-types\n const { glContainer, glEventHub } = props;\n return (\n <Provider store={store}>\n <PanelErrorBoundary\n glContainer={glContainer}\n glEventHub={glEventHub}\n >\n {/* eslint-disable-next-line react/jsx-props-no-spreading */}\n <CType {...props} ref={ref} />\n </PanelErrorBoundary>\n </Provider>\n );\n }\n\n const wrappedComponent = React.forwardRef(renderComponent);\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, store]\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 }, [\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 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\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 {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,IAEVC,WAAW,EACXC,SAAS,EACTC,OAAO,EACPC,QAAQ,QACH,OAAO;AACd,OAAOC,SAAS,MAAM,YAAY;AAQlC,OAAOC,GAAG,MAAM,gBAAgB;AAChC,SAASC,WAAW,QAAQ,wBAAwB;AAEpD,SAASC,QAAQ,EAAEC,WAAW,EAAEC,WAAW,EAAEC,QAAQ,QAAQ,aAAa;AAAC,OACpEC,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;AAS9C,IAAMC,GAAG,GAAGlB,GAAG,CAACmB,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;AAqBnD;AACA;AACA;AACA,OAAO,SAASC,eAAe,OAUO;EAAA;EAAA,IAVN;IAC9BC,EAAE;IACFC,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M,EACNC,YAAY,EACZU,UAAU,EACV6B,YAAY,EACZiC,oBAAoB,CACrB,CACF;EAED,oBACE,0CACGlE,gBAAgB,IAAIR,cAAc,EAClCrC,KAAK,CAACqH,QAAQ,CAACC,GAAG,CAAClF,QAAQ,EAAEmF,KAAK,IACjCA,KAAK,IAAI,IAAI,gBACTvH,KAAK,CAACwH,YAAY,CAACD,KAAK,EAAkB;IACxCpF,EAAE;IACFG,MAAM;IACNwC,YAAY;IACZnB;EACF,CAAC,CAAC,GACF,IAAI,CACT,CACA;AAEP;AAEAzB,eAAe,CAACuF,SAAS,GAAG;EAC1BtF,EAAE,EAAE9B,SAAS,CAACqH,MAAM,CAACC,UAAU;EAC/BvF,QAAQ,EAAE/B,SAAS,CAACuH,IAAI;EACxBjF,IAAI,EAAEtC,SAAS,CAACwH,KAAK,CAAC,CAAC,CAAC,CAAC;EACzBxF,cAAc,EAAEhC,SAAS,CAACuH,IAAI;EAC9BtF,MAAM,EAAElB,WAAW,CAAC0G,MAAM,CAACH,UAAU;EACrCpF,YAAY,EAAElC,SAAS,CAAC0H,OAAO,CAAC1H,SAAS,CAACwH,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;EACpDrF,cAAc,EAAEnC,SAAS,CAAC2H,IAAI;EAC9BvF,mBAAmB,EAAEpC,SAAS,CAAC2H;AACjC,CAAC;AAED,eAAe9F,eAAe"}
@@ -12,6 +12,8 @@ declare const _default: Readonly<{
12
12
  CLOSED: "PanelEvent.CLOSED";
13
13
  OPEN: "PanelEvent.OPEN";
14
14
  CLOSE: "PanelEvent.CLOSE";
15
+ DRAGGING: "PanelEvent.DRAGGING";
16
+ DROPPED: "PanelEvent.DROPPED";
15
17
  }>;
16
18
  export default _default;
17
19
  //# sourceMappingURL=PanelEvent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PanelEvent.d.ts","sourceRoot":"","sources":["../src/PanelEvent.ts"],"names":[],"mappings":"AAAA;;GAEG;;;;;;;;;;;;;AACH,wBAgCG"}
1
+ {"version":3,"file":"PanelEvent.d.ts","sourceRoot":"","sources":["../src/PanelEvent.ts"],"names":[],"mappings":"AAAA;;GAEG;;;;;;;;;;;;;;;AACH,wBAsCG"}
@@ -23,6 +23,10 @@ export default Object.freeze({
23
23
  // Multiple plugins could open panels for the same event if desired.
24
24
  OPEN: 'PanelEvent.OPEN',
25
25
  // Event to close a panel that's currently open
26
- CLOSE: 'PanelEvent.CLOSE'
26
+ CLOSE: 'PanelEvent.CLOSE',
27
+ // Panel is being dragged
28
+ DRAGGING: 'PanelEvent.DRAGGING',
29
+ // Panel is dropped
30
+ DROPPED: 'PanelEvent.DROPPED'
27
31
  });
28
32
  //# sourceMappingURL=PanelEvent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PanelEvent.js","names":["Object","freeze","FOCUS","MOUNT","UNMOUNT","TITLE_CHANGED","REOPEN","DELETE","CLONED","CLOSED","OPEN","CLOSE"],"sources":["../src/PanelEvent.ts"],"sourcesContent":["/**\n * Events emitted by panels and to control panels\n */\nexport default Object.freeze({\n // Panel has received focus\n FOCUS: 'PanelEvent.FOCUS',\n\n // Panel has been mounted\n MOUNT: 'PanelEvent.MOUNT',\n\n // Panel has been unmounted\n UNMOUNT: 'PanelEvent.UNMOUNT',\n\n // The title of the panel has changed\n TITLE_CHANGED: 'PanelEvent.TITLE_CHANGED',\n\n // Panel was re-opened from a dehydrated state\n REOPEN: 'PanelEvent.REOPEN',\n\n // Panel was deleted\n DELETE: 'PanelEvent.DELETE',\n\n // Panel was cloned/copied\n CLONED: 'PanelEvent.CLONED',\n\n // Panel was closed\n CLOSED: 'PanelEvent.CLOSED',\n\n // Event to open a new panel\n // Plugins will need to register to open based on this event.\n // Multiple plugins could open panels for the same event if desired.\n OPEN: 'PanelEvent.OPEN',\n\n // Event to close a panel that's currently open\n CLOSE: 'PanelEvent.CLOSE',\n});\n"],"mappings":"AAAA;AACA;AACA;AACA,eAAeA,MAAM,CAACC,MAAM,CAAC;EAC3B;EACAC,KAAK,EAAE,kBAAkB;EAEzB;EACAC,KAAK,EAAE,kBAAkB;EAEzB;EACAC,OAAO,EAAE,oBAAoB;EAE7B;EACAC,aAAa,EAAE,0BAA0B;EAEzC;EACAC,MAAM,EAAE,mBAAmB;EAE3B;EACAC,MAAM,EAAE,mBAAmB;EAE3B;EACAC,MAAM,EAAE,mBAAmB;EAE3B;EACAC,MAAM,EAAE,mBAAmB;EAE3B;EACA;EACA;EACAC,IAAI,EAAE,iBAAiB;EAEvB;EACAC,KAAK,EAAE;AACT,CAAC,CAAC"}
1
+ {"version":3,"file":"PanelEvent.js","names":["Object","freeze","FOCUS","MOUNT","UNMOUNT","TITLE_CHANGED","REOPEN","DELETE","CLONED","CLOSED","OPEN","CLOSE","DRAGGING","DROPPED"],"sources":["../src/PanelEvent.ts"],"sourcesContent":["/**\n * Events emitted by panels and to control panels\n */\nexport default Object.freeze({\n // Panel has received focus\n FOCUS: 'PanelEvent.FOCUS',\n\n // Panel has been mounted\n MOUNT: 'PanelEvent.MOUNT',\n\n // Panel has been unmounted\n UNMOUNT: 'PanelEvent.UNMOUNT',\n\n // The title of the panel has changed\n TITLE_CHANGED: 'PanelEvent.TITLE_CHANGED',\n\n // Panel was re-opened from a dehydrated state\n REOPEN: 'PanelEvent.REOPEN',\n\n // Panel was deleted\n DELETE: 'PanelEvent.DELETE',\n\n // Panel was cloned/copied\n CLONED: 'PanelEvent.CLONED',\n\n // Panel was closed\n CLOSED: 'PanelEvent.CLOSED',\n\n // Event to open a new panel\n // Plugins will need to register to open based on this event.\n // Multiple plugins could open panels for the same event if desired.\n OPEN: 'PanelEvent.OPEN',\n\n // Event to close a panel that's currently open\n CLOSE: 'PanelEvent.CLOSE',\n\n // Panel is being dragged\n DRAGGING: 'PanelEvent.DRAGGING',\n\n // Panel is dropped\n DROPPED: 'PanelEvent.DROPPED',\n});\n"],"mappings":"AAAA;AACA;AACA;AACA,eAAeA,MAAM,CAACC,MAAM,CAAC;EAC3B;EACAC,KAAK,EAAE,kBAAkB;EAEzB;EACAC,KAAK,EAAE,kBAAkB;EAEzB;EACAC,OAAO,EAAE,oBAAoB;EAE7B;EACAC,aAAa,EAAE,0BAA0B;EAEzC;EACAC,MAAM,EAAE,mBAAmB;EAE3B;EACAC,MAAM,EAAE,mBAAmB;EAE3B;EACAC,MAAM,EAAE,mBAAmB;EAE3B;EACAC,MAAM,EAAE,mBAAmB;EAE3B;EACA;EACA;EACAC,IAAI,EAAE,iBAAiB;EAEvB;EACAC,KAAK,EAAE,kBAAkB;EAEzB;EACAC,QAAQ,EAAE,qBAAqB;EAE/B;EACAC,OAAO,EAAE;AACX,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deephaven/dashboard",
3
- "version": "0.23.1-beta.8+40bedaa",
3
+ "version": "0.24.0",
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.23.1-beta.8+40bedaa",
26
- "@deephaven/golden-layout": "^0.23.1-beta.8+40bedaa",
27
- "@deephaven/log": "^0.23.1-beta.8+40bedaa",
28
- "@deephaven/react-hooks": "^0.23.1-beta.8+40bedaa",
29
- "@deephaven/redux": "^0.23.1-beta.8+40bedaa",
30
- "@deephaven/utils": "^0.23.1-beta.8+40bedaa",
25
+ "@deephaven/components": "^0.24.0",
26
+ "@deephaven/golden-layout": "^0.24.0",
27
+ "@deephaven/log": "^0.24.0",
28
+ "@deephaven/react-hooks": "^0.24.0",
29
+ "@deephaven/redux": "^0.24.0",
30
+ "@deephaven/utils": "^0.24.0",
31
31
  "deep-equal": "^2.0.5",
32
32
  "lodash.ismatch": "^4.1.1",
33
33
  "lodash.throttle": "^4.1.1",
@@ -40,8 +40,8 @@
40
40
  "react-redux": "^7.2.4"
41
41
  },
42
42
  "devDependencies": {
43
- "@deephaven/mocks": "^0.23.1-beta.8+40bedaa",
44
- "@deephaven/tsconfig": "^0.23.1-beta.8+40bedaa",
43
+ "@deephaven/mocks": "^0.24.0",
44
+ "@deephaven/tsconfig": "^0.24.0",
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": "40bedaa3d81ab47a2b626466395194595c531bbc"
53
+ "gitHead": "dcde3072e63dd6580b8018643b8a78366ecace08"
54
54
  }