@deephaven/dashboard 0.70.0 → 0.70.1-beta.1
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/DashboardPlugin.d.ts +6 -0
- package/dist/DashboardPlugin.d.ts.map +1 -1
- package/dist/DashboardPlugin.js.map +1 -1
- package/dist/DashboardUtils.d.ts +2 -2
- package/dist/DashboardUtils.d.ts.map +1 -1
- package/dist/DashboardUtils.js.map +1 -1
- package/dist/PanelPlaceholder.d.ts +1 -0
- package/dist/PanelPlaceholder.d.ts.map +1 -1
- package/package.json +9 -9
|
@@ -31,6 +31,7 @@ export declare function isWrappedComponent<P extends PanelProps, C extends Compo
|
|
|
31
31
|
export type PanelMetadata = Partial<WidgetDescriptor>;
|
|
32
32
|
export type PanelProps = GLPanelProps & {
|
|
33
33
|
metadata?: PanelMetadata;
|
|
34
|
+
panelState?: unknown;
|
|
34
35
|
};
|
|
35
36
|
export type DehydratedPanelProps = Omit<PanelProps, keyof GLPanelProps>;
|
|
36
37
|
export type LocalDashboardProps = {
|
|
@@ -45,6 +46,11 @@ export type PanelComponent<T extends PanelProps = PanelProps> = Component<T> | {
|
|
|
45
46
|
export type PanelConfig = ReactComponentConfig & {
|
|
46
47
|
componentState?: Record<string, unknown> | null;
|
|
47
48
|
};
|
|
49
|
+
export type DehydratedPanelConfig = PanelConfig & {
|
|
50
|
+
componentState: null;
|
|
51
|
+
props: DehydratedPanelProps;
|
|
52
|
+
type: 'react-component';
|
|
53
|
+
};
|
|
48
54
|
export type DashboardConfig = {
|
|
49
55
|
id: string;
|
|
50
56
|
layout: GoldenLayout;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardPlugin.d.ts","sourceRoot":"","sources":["../src/DashboardPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,aAAa,EACb,yBAAyB,EACzB,eAAe,EACf,aAAa,EACd,MAAM,OAAO,CAAC;AACf,OAA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AA6B,CAAC,GAC5C,OAAO,CAAC,KAAK,IAAI,6BAA6B,CAMhD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardPlugin.js","names":["GoldenLayout","PanelManager","isWrappedComponent","type","WrappedComponent","undefined","isDashboardPluginProps","props","id","layout","panelManager","registerComponent","assertIsDashboardPluginProps","Error","concat"],"sources":["../src/DashboardPlugin.ts"],"sourcesContent":["import type {\n Component,\n ComponentType,\n ForwardRefExoticComponent,\n PropsWithoutRef,\n RefAttributes,\n} from 'react';\nimport { ConnectedComponent } from 'react-redux';\nimport GoldenLayout from '@deephaven/golden-layout';\nimport type {\n GLPanelProps,\n ReactComponentConfig,\n} from '@deephaven/golden-layout';\nimport PanelManager from './PanelManager';\nimport { WidgetDescriptor } from './PanelEvent';\n\n/**\n * Panel components can provide static props that provide meta data about the\n * panel.\n */\nexport interface PanelStaticMetaData {\n /**\n * Should be set to the same name as the component type.\n * @deprecated Use `displayName` instead.\n */\n COMPONENT?: string;\n\n /** Title of the panel. */\n TITLE?: string;\n}\n\n/**\n * Alias for the return type of React.forwardRef()\n */\ntype ForwardRefComponentType<P, R> = ForwardRefExoticComponent<\n PropsWithoutRef<P> & RefAttributes<R>\n>;\n\n/**\n * @deprecated Use `PanelComponentType` instead and add generic types to forwardRef call.\n */\nexport type PanelFunctionComponentType<P, R> = ForwardRefComponentType<P, R> &\n PanelStaticMetaData;\n\nexport type WrappedComponentType<\n P extends PanelProps,\n C extends ComponentType<P>,\n> = ConnectedComponent<C, P>;\n\nexport type PanelComponentType<\n P extends PanelProps = PanelProps,\n C extends ComponentType<P> = ComponentType<P>,\n> = (ComponentType<P> | WrappedComponentType<P, C>) & PanelStaticMetaData;\n\nexport function isWrappedComponent<\n P extends PanelProps,\n C extends ComponentType<P>,\n>(type: PanelComponentType<P, C>): type is WrappedComponentType<P, C> {\n return (type as WrappedComponentType<P, C>)?.WrappedComponent !== undefined;\n}\n\nexport type PanelMetadata = Partial<WidgetDescriptor>;\n\nexport type PanelProps = GLPanelProps & {\n metadata?: PanelMetadata;\n};\n\nexport type DehydratedPanelProps = Omit<PanelProps, keyof GLPanelProps>;\n\nexport type LocalDashboardProps = { localDashboardId: string };\n\nexport type DashboardPanelProps = PanelProps & LocalDashboardProps;\n\nexport type DehydratedDashboardPanelProps = DehydratedPanelProps &\n LocalDashboardProps;\n\nexport type PanelComponent<T extends PanelProps = PanelProps> =\n | Component<T>\n | { props: T; state: unknown };\n\nexport type PanelConfig = ReactComponentConfig & {\n componentState?: Record<string, unknown> | null;\n};\n\nexport type DashboardConfig = {\n id: string;\n layout: GoldenLayout;\n panelManager: PanelManager;\n};\n\nexport interface DashboardPanelDefinition {\n name: string;\n definition: ComponentType;\n}\n\nexport type DeregisterComponentFunction = () => void;\n\nexport type PanelHydrateFunction<\n T extends DehydratedDashboardPanelProps = DehydratedDashboardPanelProps,\n R extends T = T,\n> = (props: T, dashboardId: string) => R;\n\nexport type PanelDehydrateFunction = (\n config: PanelConfig,\n dashboardId: string\n) => PanelConfig | null;\n\nexport type DashboardPluginComponentProps = {\n id: string;\n layout: GoldenLayout;\n panelManager: PanelManager;\n registerComponent: <\n P extends DashboardPanelProps,\n C extends ComponentType<P>,\n >(\n name: string,\n ComponentType: PanelComponentType<P, C>,\n hydrate?: PanelHydrateFunction,\n dehydrate?: PanelDehydrateFunction\n ) => DeregisterComponentFunction;\n};\n\n/**\n * Takes a partial DashboardPluginComponentProps and verifies all the dashboard component fields are filled in.\n * @param props The props to check\n * @returns True if the props are valid DashboardPluginComponentProps, false otherwise\n */\nexport function isDashboardPluginProps(\n props: Partial<DashboardPluginComponentProps>\n): props is DashboardPluginComponentProps {\n return (\n typeof props.id === 'string' &&\n props.layout instanceof GoldenLayout &&\n props.panelManager instanceof PanelManager &&\n typeof props.registerComponent === 'function'\n );\n}\n\nexport function assertIsDashboardPluginProps(\n props: Partial<DashboardPluginComponentProps>\n): asserts props is DashboardPluginComponentProps {\n if (!isDashboardPluginProps(props)) {\n throw new Error(\n `Expected dashboard plugin props, but instead received ${props}`\n );\n }\n}\n"],"mappings":"AAQA,OAAOA,YAAY,MAAM,0BAA0B;AAAC,OAK7CC,YAAY;AAGnB;AACA;AACA;AACA;AAYA;AACA;AACA;AAKA;AACA;AACA;AAcA,OAAO,SAASC,kBAAkBA,CAGhCC,IAA8B,EAAsC;EACpE,OAAO,CAACA,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAiCC,gBAAgB,MAAKC,SAAS;AAC7E;
|
|
1
|
+
{"version":3,"file":"DashboardPlugin.js","names":["GoldenLayout","PanelManager","isWrappedComponent","type","WrappedComponent","undefined","isDashboardPluginProps","props","id","layout","panelManager","registerComponent","assertIsDashboardPluginProps","Error","concat"],"sources":["../src/DashboardPlugin.ts"],"sourcesContent":["import type {\n Component,\n ComponentType,\n ForwardRefExoticComponent,\n PropsWithoutRef,\n RefAttributes,\n} from 'react';\nimport { ConnectedComponent } from 'react-redux';\nimport GoldenLayout from '@deephaven/golden-layout';\nimport type {\n GLPanelProps,\n ReactComponentConfig,\n} from '@deephaven/golden-layout';\nimport PanelManager from './PanelManager';\nimport { WidgetDescriptor } from './PanelEvent';\n\n/**\n * Panel components can provide static props that provide meta data about the\n * panel.\n */\nexport interface PanelStaticMetaData {\n /**\n * Should be set to the same name as the component type.\n * @deprecated Use `displayName` instead.\n */\n COMPONENT?: string;\n\n /** Title of the panel. */\n TITLE?: string;\n}\n\n/**\n * Alias for the return type of React.forwardRef()\n */\ntype ForwardRefComponentType<P, R> = ForwardRefExoticComponent<\n PropsWithoutRef<P> & RefAttributes<R>\n>;\n\n/**\n * @deprecated Use `PanelComponentType` instead and add generic types to forwardRef call.\n */\nexport type PanelFunctionComponentType<P, R> = ForwardRefComponentType<P, R> &\n PanelStaticMetaData;\n\nexport type WrappedComponentType<\n P extends PanelProps,\n C extends ComponentType<P>,\n> = ConnectedComponent<C, P>;\n\nexport type PanelComponentType<\n P extends PanelProps = PanelProps,\n C extends ComponentType<P> = ComponentType<P>,\n> = (ComponentType<P> | WrappedComponentType<P, C>) & PanelStaticMetaData;\n\nexport function isWrappedComponent<\n P extends PanelProps,\n C extends ComponentType<P>,\n>(type: PanelComponentType<P, C>): type is WrappedComponentType<P, C> {\n return (type as WrappedComponentType<P, C>)?.WrappedComponent !== undefined;\n}\n\nexport type PanelMetadata = Partial<WidgetDescriptor>;\n\nexport type PanelProps = GLPanelProps & {\n metadata?: PanelMetadata;\n panelState?: unknown;\n};\n\nexport type DehydratedPanelProps = Omit<PanelProps, keyof GLPanelProps>;\n\nexport type LocalDashboardProps = { localDashboardId: string };\n\nexport type DashboardPanelProps = PanelProps & LocalDashboardProps;\n\nexport type DehydratedDashboardPanelProps = DehydratedPanelProps &\n LocalDashboardProps;\n\nexport type PanelComponent<T extends PanelProps = PanelProps> =\n | Component<T>\n | { props: T; state: unknown };\n\nexport type PanelConfig = ReactComponentConfig & {\n componentState?: Record<string, unknown> | null;\n};\n\nexport type DehydratedPanelConfig = PanelConfig & {\n componentState: null;\n props: DehydratedPanelProps;\n type: 'react-component';\n};\n\nexport type DashboardConfig = {\n id: string;\n layout: GoldenLayout;\n panelManager: PanelManager;\n};\n\nexport interface DashboardPanelDefinition {\n name: string;\n definition: ComponentType;\n}\n\nexport type DeregisterComponentFunction = () => void;\n\nexport type PanelHydrateFunction<\n T extends DehydratedDashboardPanelProps = DehydratedDashboardPanelProps,\n R extends T = T,\n> = (props: T, dashboardId: string) => R;\n\nexport type PanelDehydrateFunction = (\n config: PanelConfig,\n dashboardId: string\n) => PanelConfig | null;\n\nexport type DashboardPluginComponentProps = {\n id: string;\n layout: GoldenLayout;\n panelManager: PanelManager;\n registerComponent: <\n P extends DashboardPanelProps,\n C extends ComponentType<P>,\n >(\n name: string,\n ComponentType: PanelComponentType<P, C>,\n hydrate?: PanelHydrateFunction,\n dehydrate?: PanelDehydrateFunction\n ) => DeregisterComponentFunction;\n};\n\n/**\n * Takes a partial DashboardPluginComponentProps and verifies all the dashboard component fields are filled in.\n * @param props The props to check\n * @returns True if the props are valid DashboardPluginComponentProps, false otherwise\n */\nexport function isDashboardPluginProps(\n props: Partial<DashboardPluginComponentProps>\n): props is DashboardPluginComponentProps {\n return (\n typeof props.id === 'string' &&\n props.layout instanceof GoldenLayout &&\n props.panelManager instanceof PanelManager &&\n typeof props.registerComponent === 'function'\n );\n}\n\nexport function assertIsDashboardPluginProps(\n props: Partial<DashboardPluginComponentProps>\n): asserts props is DashboardPluginComponentProps {\n if (!isDashboardPluginProps(props)) {\n throw new Error(\n `Expected dashboard plugin props, but instead received ${props}`\n );\n }\n}\n"],"mappings":"AAQA,OAAOA,YAAY,MAAM,0BAA0B;AAAC,OAK7CC,YAAY;AAGnB;AACA;AACA;AACA;AAYA;AACA;AACA;AAKA;AACA;AACA;AAcA,OAAO,SAASC,kBAAkBA,CAGhCC,IAA8B,EAAsC;EACpE,OAAO,CAACA,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAiCC,gBAAgB,MAAKC,SAAS;AAC7E;AAsEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,sBAAsBA,CACpCC,KAA6C,EACL;EACxC,OACE,OAAOA,KAAK,CAACC,EAAE,KAAK,QAAQ,IAC5BD,KAAK,CAACE,MAAM,YAAYT,YAAY,IACpCO,KAAK,CAACG,YAAY,YAAYT,YAAY,IAC1C,OAAOM,KAAK,CAACI,iBAAiB,KAAK,UAAU;AAEjD;AAEA,OAAO,SAASC,4BAA4BA,CAC1CL,KAA6C,EACG;EAChD,IAAI,CAACD,sBAAsB,CAACC,KAAK,CAAC,EAAE;IAClC,MAAM,IAAIM,KAAK,0DAAAC,MAAA,CAC4CP,KAAK,CAChE,CAAC;EACH;AACF"}
|
package/dist/DashboardUtils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DehydratedDashboardPanelProps, PanelComponentType, PanelConfig } from './DashboardPlugin';
|
|
1
|
+
import { DehydratedDashboardPanelProps, DehydratedPanelConfig, PanelComponentType, PanelConfig } from './DashboardPlugin';
|
|
2
2
|
/**
|
|
3
3
|
* Dehydrate an existing panel to allow it to be serialized/saved.
|
|
4
4
|
* Just takes what's in the panels `metadata` in the props and `panelState` in
|
|
@@ -6,7 +6,7 @@ import { DehydratedDashboardPanelProps, PanelComponentType, PanelConfig } from '
|
|
|
6
6
|
* @param config The panel config to dehydrate
|
|
7
7
|
* @returns The dehydrated PanelConfig
|
|
8
8
|
*/
|
|
9
|
-
export declare function dehydrate(config: PanelConfig):
|
|
9
|
+
export declare function dehydrate(config: PanelConfig): DehydratedPanelConfig;
|
|
10
10
|
/**
|
|
11
11
|
* Default hydration function. Just applies the dashboard ID. When used with dehydrate above,
|
|
12
12
|
* the panels state will be stored in `panelState` prop.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardUtils.d.ts","sourceRoot":"","sources":["../src/DashboardUtils.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,6BAA6B,
|
|
1
|
+
{"version":3,"file":"DashboardUtils.d.ts","sourceRoot":"","sources":["../src/DashboardUtils.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,EAErB,kBAAkB,EAClB,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAE3B;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,WAAW,GAAG,qBAAqB,CAqBpE;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,6BAA6B,EAC7D,KAAK,EAAE,CAAC,EACR,gBAAgB,SAAK,GACpB,CAAC,CAKH;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,SAAS,EAAE,kBAAkB,GAAG,OAAO,CAejE;;;;;AAED,wBAGE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardUtils.js","names":["ForwardRef","isWrappedComponent","dehydrate","config","props","componentState","metadata","panelState","newProps","_objectSpread","type","hydrate","localDashboardId","arguments","length","undefined","canHaveRef","component","isClassComponent","WrappedComponent","prototype","isReactComponent","isForwardRef","$$typeof"],"sources":["../src/DashboardUtils.tsx"],"sourcesContent":["import { ForwardRef } from 'react-is';\nimport {\n DehydratedDashboardPanelProps,\n isWrappedComponent,\n PanelComponentType,\n PanelConfig,\n} from './DashboardPlugin';\n\n/**\n * Dehydrate an existing panel to allow it to be serialized/saved.\n * Just takes what's in the panels `metadata` in the props and `panelState` in\n * the component state, assumes it's serializable, and saves it.\n * @param config The panel config to dehydrate\n * @returns The dehydrated PanelConfig\n */\nexport function dehydrate(config: PanelConfig):
|
|
1
|
+
{"version":3,"file":"DashboardUtils.js","names":["ForwardRef","isWrappedComponent","dehydrate","config","props","componentState","metadata","panelState","newProps","_objectSpread","type","hydrate","localDashboardId","arguments","length","undefined","canHaveRef","component","isClassComponent","WrappedComponent","prototype","isReactComponent","isForwardRef","$$typeof"],"sources":["../src/DashboardUtils.tsx"],"sourcesContent":["import { ForwardRef } from 'react-is';\nimport {\n DehydratedDashboardPanelProps,\n DehydratedPanelConfig,\n isWrappedComponent,\n PanelComponentType,\n PanelConfig,\n} from './DashboardPlugin';\n\n/**\n * Dehydrate an existing panel to allow it to be serialized/saved.\n * Just takes what's in the panels `metadata` in the props and `panelState` in\n * the component state, assumes it's serializable, and saves it.\n * @param config The panel config to dehydrate\n * @returns The dehydrated PanelConfig\n */\nexport function dehydrate(config: PanelConfig): DehydratedPanelConfig {\n const { props, componentState } = config;\n const { metadata } = props;\n let { panelState = null } = props;\n if (componentState) {\n ({ panelState } = componentState);\n }\n const newProps: Record<string, unknown> = {};\n if (metadata != null) {\n newProps.metadata = metadata;\n }\n if (panelState != null) {\n newProps.panelState = panelState;\n }\n\n return {\n ...config,\n componentState: null,\n props: newProps,\n type: 'react-component',\n };\n}\n\n/**\n * Default hydration function. Just applies the dashboard ID. When used with dehydrate above,\n * the panels state will be stored in `panelState` prop.\n * @param props Panel props to hydrate\n * @param localDashboardId The local dashboard ID to hydrate the panel with\n * @returns The hydrated panel props\n */\nexport function hydrate<T extends DehydratedDashboardPanelProps>(\n props: T,\n localDashboardId = ''\n): T {\n return {\n ...props,\n localDashboardId,\n };\n}\n\n/**\n * Checks if a panel component can take a ref. Helps silence react dev errors\n * if a ref is passed to a functional component without forwardRef.\n * @param component The panel component to check if it can take a ref\n * @returns Wheter the component can take a ref or not\n */\nexport function canHaveRef(component: PanelComponentType): boolean {\n // Might be a redux connect wrapped component\n const isClassComponent =\n (isWrappedComponent(component) &&\n component.WrappedComponent.prototype != null &&\n component.WrappedComponent.prototype.isReactComponent != null) ||\n (component.prototype != null &&\n component.prototype.isReactComponent != null);\n\n const isForwardRef =\n !isWrappedComponent(component) &&\n '$$typeof' in component &&\n component.$$typeof === ForwardRef;\n\n return isClassComponent || isForwardRef;\n}\n\nexport default {\n dehydrate,\n hydrate,\n};\n"],"mappings":";;;;;AAAA,SAASA,UAAU,QAAQ,UAAU;AAAC,SAIpCC,kBAAkB;AAKpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,SAASA,CAACC,MAAmB,EAAyB;EACpE,IAAM;IAAEC,KAAK;IAAEC;EAAe,CAAC,GAAGF,MAAM;EACxC,IAAM;IAAEG;EAAS,CAAC,GAAGF,KAAK;EAC1B,IAAI;IAAEG,UAAU,GAAG;EAAK,CAAC,GAAGH,KAAK;EACjC,IAAIC,cAAc,EAAE;IAClB,CAAC;MAAEE;IAAW,CAAC,GAAGF,cAAc;EAClC;EACA,IAAMG,QAAiC,GAAG,CAAC,CAAC;EAC5C,IAAIF,QAAQ,IAAI,IAAI,EAAE;IACpBE,QAAQ,CAACF,QAAQ,GAAGA,QAAQ;EAC9B;EACA,IAAIC,UAAU,IAAI,IAAI,EAAE;IACtBC,QAAQ,CAACD,UAAU,GAAGA,UAAU;EAClC;EAEA,OAAAE,aAAA,CAAAA,aAAA,KACKN,MAAM;IACTE,cAAc,EAAE,IAAI;IACpBD,KAAK,EAAEI,QAAQ;IACfE,IAAI,EAAE;EAAiB;AAE3B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,OAAOA,CACrBP,KAAQ,EAEL;EAAA,IADHQ,gBAAgB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;EAErB,OAAAJ,aAAA,CAAAA,aAAA,KACKL,KAAK;IACRQ;EAAgB;AAEpB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASI,UAAUA,CAACC,SAA6B,EAAW;EACjE;EACA,IAAMC,gBAAgB,GACnBjB,kBAAkB,CAACgB,SAAS,CAAC,IAC5BA,SAAS,CAACE,gBAAgB,CAACC,SAAS,IAAI,IAAI,IAC5CH,SAAS,CAACE,gBAAgB,CAACC,SAAS,CAACC,gBAAgB,IAAI,IAAI,IAC9DJ,SAAS,CAACG,SAAS,IAAI,IAAI,IAC1BH,SAAS,CAACG,SAAS,CAACC,gBAAgB,IAAI,IAAK;EAEjD,IAAMC,YAAY,GAChB,CAACrB,kBAAkB,CAACgB,SAAS,CAAC,IAC9B,UAAU,IAAIA,SAAS,IACvBA,SAAS,CAACM,QAAQ,KAAKvB,UAAU;EAEnC,OAAOkB,gBAAgB,IAAII,YAAY;AACzC;AAEA,eAAe;EACbpB,SAAS;EACTS;AACF,CAAC"}
|
|
@@ -5,6 +5,7 @@ import './PanelPlaceholder.scss';
|
|
|
5
5
|
*/
|
|
6
6
|
declare const PanelPlaceholder: React.ForwardRefExoticComponent<import("@deephaven/golden-layout").GLPanelProps & {
|
|
7
7
|
metadata?: Partial<import("./PanelEvent").WidgetDescriptor> | undefined;
|
|
8
|
+
panelState?: unknown;
|
|
8
9
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
9
10
|
export default PanelPlaceholder;
|
|
10
11
|
//# sourceMappingURL=PanelPlaceholder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PanelPlaceholder.d.ts","sourceRoot":"","sources":["../src/PanelPlaceholder.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuB,MAAM,OAAO,CAAC;AAC5C,OAAO,yBAAyB,CAAC;AAIjC;;GAEG;AACH,QAAA,MAAM,gBAAgB
|
|
1
|
+
{"version":3,"file":"PanelPlaceholder.d.ts","sourceRoot":"","sources":["../src/PanelPlaceholder.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuB,MAAM,OAAO,CAAC;AAC5C,OAAO,yBAAyB,CAAC;AAIjC;;GAEG;AACH,QAAA,MAAM,gBAAgB;;;wCASrB,CAAC;AAIF,eAAe,gBAAgB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deephaven/dashboard",
|
|
3
|
-
"version": "0.70.
|
|
3
|
+
"version": "0.70.1-beta.1+b49b5069",
|
|
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.70.
|
|
26
|
-
"@deephaven/golden-layout": "^0.70.
|
|
27
|
-
"@deephaven/log": "^0.70.
|
|
28
|
-
"@deephaven/react-hooks": "^0.70.
|
|
29
|
-
"@deephaven/redux": "^0.70.
|
|
30
|
-
"@deephaven/utils": "^0.70.
|
|
25
|
+
"@deephaven/components": "^0.70.1-beta.1+b49b5069",
|
|
26
|
+
"@deephaven/golden-layout": "^0.70.1-beta.1+b49b5069",
|
|
27
|
+
"@deephaven/log": "^0.70.1-beta.1+b49b5069",
|
|
28
|
+
"@deephaven/react-hooks": "^0.70.1-beta.1+b49b5069",
|
|
29
|
+
"@deephaven/redux": "^0.70.1-beta.1+b49b5069",
|
|
30
|
+
"@deephaven/utils": "^0.70.1-beta.1+b49b5069",
|
|
31
31
|
"deep-equal": "^2.0.5",
|
|
32
32
|
"lodash.ismatch": "^4.1.1",
|
|
33
33
|
"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.70.
|
|
44
|
+
"@deephaven/mocks": "^0.70.1-beta.1+b49b5069",
|
|
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": "
|
|
53
|
+
"gitHead": "b49b5069d637ac136578ce839d9fc0416f468adf"
|
|
54
54
|
}
|