@deephaven/dashboard-core-plugins 1.27.0 → 1.27.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/WidgetLoaderPlugin.d.ts.map +1 -1
- package/dist/WidgetLoaderPlugin.js +4 -91
- package/dist/WidgetLoaderPlugin.js.map +1 -1
- package/dist/WidgetLoaderUtils.d.ts +35 -0
- package/dist/WidgetLoaderUtils.d.ts.map +1 -0
- package/dist/WidgetLoaderUtils.js +109 -0
- package/dist/WidgetLoaderUtils.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WidgetLoaderPlugin.d.ts","sourceRoot":"","sources":["../src/WidgetLoaderPlugin.tsx"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,6BAA6B,EAIlC,KAAK,UAAU,EAGhB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,
|
|
1
|
+
{"version":3,"file":"WidgetLoaderPlugin.d.ts","sourceRoot":"","sources":["../src/WidgetLoaderPlugin.tsx"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,6BAA6B,EAIlC,KAAK,UAAU,EAGhB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAIL,KAAK,YAAY,EAClB,MAAM,mBAAmB,CAAC;AAU3B,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,YAAY,GACnB,KAAK,CAAC,yBAAyB,CAAC,UAAU,GAAG,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CA2C5E;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,OAAO,CAAC,6BAA6B,CAAC,GAC5C,GAAG,CAAC,OAAO,GAAG,IAAI,CA6GpB;AAED,eAAe,kBAAkB,CAAC"}
|
|
@@ -13,15 +13,11 @@ import { useMemo, useCallback, useEffect, forwardRef } from 'react';
|
|
|
13
13
|
import { nanoid } from 'nanoid';
|
|
14
14
|
import { assertIsDashboardPluginProps, LayoutUtils, canHaveRef, usePanelOpenListener } from '@deephaven/dashboard';
|
|
15
15
|
import Log from '@deephaven/log';
|
|
16
|
-
import {
|
|
16
|
+
import { createChainedComponent, createChainedPanelComponent, usePlugins } from '@deephaven/plugin';
|
|
17
17
|
import { WidgetPanel } from "./panels/index.js";
|
|
18
|
+
import { getSupportedWidgetTypes, getUniqueWidgetPluginInfos } from "./WidgetLoaderUtils.js";
|
|
18
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
20
|
var log = Log.module('WidgetLoaderPlugin');
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Information about a widget type including its base plugin and any middleware.
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
21
|
export function WrapWidgetPlugin(plugin) {
|
|
26
22
|
var _plugin$component$dis;
|
|
27
23
|
function Wrapper(props, ref) {
|
|
@@ -69,68 +65,7 @@ export function WrapWidgetPlugin(plugin) {
|
|
|
69
65
|
*/
|
|
70
66
|
export function WidgetLoaderPlugin(props) {
|
|
71
67
|
var plugins = usePlugins();
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Build a map of widget types to their plugin chain info.
|
|
75
|
-
* For each type, we have a base plugin and a list of middleware to apply.
|
|
76
|
-
*/
|
|
77
|
-
var supportedTypes = useMemo(() => {
|
|
78
|
-
var typeMap = new Map();
|
|
79
|
-
plugins.forEach(plugin => {
|
|
80
|
-
var isMiddleware = isWidgetMiddlewarePlugin(plugin);
|
|
81
|
-
if (!isWidgetPlugin(plugin) && !isMiddleware) {
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
[plugin.supportedTypes].flat().forEach(supportedType => {
|
|
85
|
-
if (supportedType == null || supportedType === '') {
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
var existing = typeMap.get(supportedType);
|
|
89
|
-
if (isMiddleware) {
|
|
90
|
-
// Add middleware to existing chain or create pending chain
|
|
91
|
-
if (existing != null) {
|
|
92
|
-
existing.middleware.push(plugin);
|
|
93
|
-
log.debug("Adding middleware ".concat(plugin.name, " to chain for type ").concat(supportedType));
|
|
94
|
-
} else {
|
|
95
|
-
// No base plugin yet, create entry with just middleware
|
|
96
|
-
// The base plugin will be set when a non-middleware plugin is registered
|
|
97
|
-
typeMap.set(supportedType, {
|
|
98
|
-
basePlugin: null,
|
|
99
|
-
middleware: [plugin]
|
|
100
|
-
});
|
|
101
|
-
log.debug("Creating pending middleware chain for type ".concat(supportedType, " with ").concat(plugin.name));
|
|
102
|
-
}
|
|
103
|
-
} else {
|
|
104
|
-
// Non-middleware plugin: becomes the base plugin
|
|
105
|
-
if (existing != null) {
|
|
106
|
-
if (existing.basePlugin != null) {
|
|
107
|
-
// Already have a base plugin, warn about replacement
|
|
108
|
-
log.warn("Multiple WidgetPlugins handling type ".concat(supportedType, ". ") + "Replacing ".concat(existing.basePlugin.name, " with ").concat(plugin.name, " as base plugin"));
|
|
109
|
-
}
|
|
110
|
-
// Keep existing middleware, update the base plugin
|
|
111
|
-
existing.basePlugin = plugin;
|
|
112
|
-
} else {
|
|
113
|
-
typeMap.set(supportedType, {
|
|
114
|
-
basePlugin: plugin,
|
|
115
|
-
middleware: []
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
log.debug("Set base plugin ".concat(plugin.name, " for type ").concat(supportedType));
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
// Filter out entries that only have middleware (no base plugin)
|
|
124
|
-
var validEntries = new Map();
|
|
125
|
-
typeMap.forEach((info, type) => {
|
|
126
|
-
if (info.basePlugin != null) {
|
|
127
|
-
validEntries.set(type, info);
|
|
128
|
-
} else {
|
|
129
|
-
log.warn("No base plugin found for type ".concat(type, ", middleware will not be applied"));
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
return validEntries;
|
|
133
|
-
}, [plugins]);
|
|
68
|
+
var supportedTypes = useMemo(() => getSupportedWidgetTypes(plugins), [plugins]);
|
|
134
69
|
assertIsDashboardPluginProps(props);
|
|
135
70
|
var id = props.id,
|
|
136
71
|
layout = props.layout,
|
|
@@ -169,29 +104,7 @@ export function WidgetLoaderPlugin(props) {
|
|
|
169
104
|
}, [id, layout, supportedTypes]);
|
|
170
105
|
useEffect(() => {
|
|
171
106
|
// Get unique base plugins (a plugin may handle multiple types)
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
var uniquePluginInfos = new Map();
|
|
175
|
-
supportedTypes.forEach((info, _type) => {
|
|
176
|
-
// Use the base plugin name as the key to get unique plugins
|
|
177
|
-
if (!uniquePluginInfos.has(info.basePlugin.name)) {
|
|
178
|
-
// Clone to avoid mutating the useMemo result
|
|
179
|
-
uniquePluginInfos.set(info.basePlugin.name, {
|
|
180
|
-
basePlugin: info.basePlugin,
|
|
181
|
-
middleware: [...info.middleware]
|
|
182
|
-
});
|
|
183
|
-
} else {
|
|
184
|
-
// Merge middleware from multiple type registrations for the same base plugin
|
|
185
|
-
var existingInfo = uniquePluginInfos.get(info.basePlugin.name);
|
|
186
|
-
if (existingInfo != null) {
|
|
187
|
-
info.middleware.forEach(m => {
|
|
188
|
-
if (!existingInfo.middleware.includes(m)) {
|
|
189
|
-
existingInfo.middleware.push(m);
|
|
190
|
-
}
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
});
|
|
107
|
+
var uniquePluginInfos = getUniqueWidgetPluginInfos(supportedTypes);
|
|
195
108
|
log.debug('Registering widget components', [...uniquePluginInfos.entries()].map(_ref2 => {
|
|
196
109
|
var _ref3 = _slicedToArray(_ref2, 2),
|
|
197
110
|
name = _ref3[0],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WidgetLoaderPlugin.js","names":["useMemo","useCallback","useEffect","forwardRef","nanoid","assertIsDashboardPluginProps","LayoutUtils","canHaveRef","usePanelOpenListener","Log","isWidgetPlugin","isWidgetMiddlewarePlugin","createChainedComponent","createChainedPanelComponent","usePlugins","WidgetPanel","jsx","_jsx","log","module","WrapWidgetPlugin","plugin","_plugin$component$dis","Wrapper","props","ref","_metadata$type","_metadata$name","C","component","metadata","panelDescriptor","_objectSpread","type","name","hasRef","className","concat","descriptor","children","displayName","WidgetLoaderPlugin","plugins","supportedTypes","typeMap","Map","forEach","isMiddleware","flat","supportedType","existing","get","middleware","push","debug","set","basePlugin","warn","validEntries","info","id","layout","registerComponent","handlePanelOpen","_ref","_widget$name","dragEvent","_ref$panelId","panelId","fetch","widget","typeInfo","panelProps","localDashboardId","config","title","root","openComponent","uniquePluginInfos","_type","has","existingInfo","m","includes","entries","map","_ref2","_ref3","_slicedToArray","hasPanel","panelComponent","deregisterFns","values","_ref4","chainedComponent","wrappedPlugin","chainedPanelComponent","deregister","eventHub"],"sources":["../src/WidgetLoaderPlugin.tsx"],"sourcesContent":["import { useMemo, useCallback, useEffect, forwardRef } from 'react';\nimport type { ReactComponentConfig } from '@deephaven/golden-layout';\nimport { nanoid } from 'nanoid';\nimport {\n assertIsDashboardPluginProps,\n type DashboardPluginComponentProps,\n type DehydratedDashboardPanelProps,\n type PanelOpenEventDetail,\n LayoutUtils,\n type PanelProps,\n canHaveRef,\n usePanelOpenListener,\n} from '@deephaven/dashboard';\nimport Log from '@deephaven/log';\nimport {\n isWidgetPlugin,\n isWidgetMiddlewarePlugin,\n createChainedComponent,\n createChainedPanelComponent,\n usePlugins,\n type WidgetPlugin,\n type WidgetMiddlewarePlugin,\n} from '@deephaven/plugin';\nimport { WidgetPanel } from './panels';\nimport { type WidgetPanelDescriptor } from './panels/WidgetPanelTypes';\n\nconst log = Log.module('WidgetLoaderPlugin');\n\n/**\n * Information about a widget type including its base plugin and any middleware.\n */\ninterface WidgetTypeInfo {\n /** The base plugin that handles this widget type, or null if only middleware registered so far */\n basePlugin: WidgetPlugin | null;\n /** Middleware plugins to apply, in order from outermost to innermost */\n middleware: WidgetMiddlewarePlugin[];\n}\n\nexport function WrapWidgetPlugin(\n plugin: WidgetPlugin\n): React.ForwardRefExoticComponent<PanelProps & React.RefAttributes<unknown>> {\n function Wrapper(props: PanelProps, ref: React.ForwardedRef<unknown>) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const C = plugin.component as any;\n const { metadata } = props;\n\n const panelDescriptor: WidgetPanelDescriptor = {\n ...metadata,\n type: metadata?.type ?? plugin.type,\n name: metadata?.name ?? 'Widget',\n };\n\n const hasRef = canHaveRef(C);\n const className = `widget-loader-${panelDescriptor.type}`;\n\n return (\n <WidgetPanel\n descriptor={panelDescriptor}\n className={className}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...props}\n >\n {hasRef ? (\n <C\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...props}\n ref={ref}\n />\n ) : (\n <C\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...props}\n />\n )}\n </WidgetPanel>\n );\n }\n\n Wrapper.displayName = `WidgetLoaderPlugin(${\n plugin.component.displayName ?? plugin.name\n })`;\n\n return forwardRef(Wrapper);\n}\n\n/**\n * Widget to automatically open any supported WidgetPlugin types as panels\n * if the widget is emitted from the server as the result of executed code.\n *\n * Does not open panels for widgets that are not supported by any plugins.\n * Does not open panels for widgets that are a component of a larger widget or UI element.\n *\n * Supports plugin chaining via middleware plugins. When multiple plugins\n * support the same widget type, middleware plugins are chained around\n * the base plugin in registration order.\n *\n * @param props Dashboard plugin props\n * @returns React element\n */\nexport function WidgetLoaderPlugin(\n props: Partial<DashboardPluginComponentProps>\n): JSX.Element | null {\n const plugins = usePlugins();\n\n /**\n * Build a map of widget types to their plugin chain info.\n * For each type, we have a base plugin and a list of middleware to apply.\n */\n const supportedTypes = useMemo(() => {\n const typeMap = new Map<string, WidgetTypeInfo>();\n\n plugins.forEach(plugin => {\n const isMiddleware = isWidgetMiddlewarePlugin(plugin);\n if (!isWidgetPlugin(plugin) && !isMiddleware) {\n return;\n }\n\n [plugin.supportedTypes].flat().forEach(supportedType => {\n if (supportedType == null || supportedType === '') {\n return;\n }\n\n const existing = typeMap.get(supportedType);\n\n if (isMiddleware) {\n // Add middleware to existing chain or create pending chain\n if (existing != null) {\n existing.middleware.push(plugin);\n log.debug(\n `Adding middleware ${plugin.name} to chain for type ${supportedType}`\n );\n } else {\n // No base plugin yet, create entry with just middleware\n // The base plugin will be set when a non-middleware plugin is registered\n typeMap.set(supportedType, {\n basePlugin: null,\n middleware: [plugin],\n });\n log.debug(\n `Creating pending middleware chain for type ${supportedType} with ${plugin.name}`\n );\n }\n } else {\n // Non-middleware plugin: becomes the base plugin\n if (existing != null) {\n if (existing.basePlugin != null) {\n // Already have a base plugin, warn about replacement\n log.warn(\n `Multiple WidgetPlugins handling type ${supportedType}. ` +\n `Replacing ${existing.basePlugin.name} with ${plugin.name} as base plugin`\n );\n }\n // Keep existing middleware, update the base plugin\n existing.basePlugin = plugin;\n } else {\n typeMap.set(supportedType, {\n basePlugin: plugin,\n middleware: [],\n });\n }\n log.debug(`Set base plugin ${plugin.name} for type ${supportedType}`);\n }\n });\n });\n\n // Filter out entries that only have middleware (no base plugin)\n const validEntries = new Map<\n string,\n WidgetTypeInfo & { basePlugin: WidgetPlugin }\n >();\n typeMap.forEach((info, type) => {\n if (info.basePlugin != null) {\n validEntries.set(\n type,\n info as WidgetTypeInfo & { basePlugin: WidgetPlugin }\n );\n } else {\n log.warn(\n `No base plugin found for type ${type}, middleware will not be applied`\n );\n }\n });\n\n return validEntries;\n }, [plugins]);\n\n assertIsDashboardPluginProps(props);\n const { id, layout, registerComponent } = props;\n\n const handlePanelOpen = useCallback(\n ({\n dragEvent,\n panelId = nanoid(),\n fetch,\n widget,\n }: PanelOpenEventDetail) => {\n const { type } = widget;\n const typeInfo = type != null ? supportedTypes.get(type) : null;\n if (typeInfo == null) {\n return;\n }\n const name = widget.name ?? type;\n\n const panelProps: DehydratedDashboardPanelProps & {\n fetch?: () => Promise<unknown>;\n } = {\n localDashboardId: id,\n metadata: widget,\n fetch,\n };\n\n const config: ReactComponentConfig = {\n type: 'react-component',\n component: typeInfo.basePlugin.name,\n props: panelProps,\n title: name,\n id: panelId,\n };\n\n const { root } = layout;\n LayoutUtils.openComponent({ root, config, dragEvent });\n },\n [id, layout, supportedTypes]\n );\n\n useEffect(() => {\n // Get unique base plugins (a plugin may handle multiple types)\n // supportedTypes is already filtered to entries with non-null basePlugin\n type ValidWidgetTypeInfo = WidgetTypeInfo & { basePlugin: WidgetPlugin };\n const uniquePluginInfos = new Map<string, ValidWidgetTypeInfo>();\n supportedTypes.forEach((info, _type) => {\n // Use the base plugin name as the key to get unique plugins\n if (!uniquePluginInfos.has(info.basePlugin.name)) {\n // Clone to avoid mutating the useMemo result\n uniquePluginInfos.set(info.basePlugin.name, {\n basePlugin: info.basePlugin,\n middleware: [...info.middleware],\n });\n } else {\n // Merge middleware from multiple type registrations for the same base plugin\n const existingInfo = uniquePluginInfos.get(info.basePlugin.name);\n if (existingInfo != null) {\n info.middleware.forEach(m => {\n if (!existingInfo.middleware.includes(m)) {\n existingInfo.middleware.push(m);\n }\n });\n }\n }\n });\n\n log.debug(\n 'Registering widget components',\n [...uniquePluginInfos.entries()].map(([name, info]) => ({\n plugin: name,\n middleware: info.middleware.map(m => m.name),\n hasPanel: info.basePlugin.panelComponent != null,\n }))\n );\n\n const deregisterFns = [...uniquePluginInfos.values()].map(\n ({ basePlugin, middleware }) => {\n const { panelComponent } = basePlugin;\n\n if (panelComponent == null) {\n // No panel component - chain the widget components and wrap in default panel\n log.debug(\n `Chaining widget components for ${basePlugin.name} (no panel component, using default wrapper)`\n );\n const chainedComponent = createChainedComponent(\n basePlugin.component,\n middleware\n );\n const wrappedPlugin: WidgetPlugin = {\n ...basePlugin,\n component: chainedComponent,\n };\n return registerComponent(\n basePlugin.name,\n WrapWidgetPlugin(wrappedPlugin)\n );\n }\n\n // Has panel component - chain middleware around the panel.\n // Only middleware that defines panelComponent is applied here.\n // Middleware with only component is skipped in this path.\n log.debug(\n `Chaining panel components for ${basePlugin.name} (has custom panel component)`\n );\n const chainedPanelComponent = createChainedPanelComponent(\n panelComponent,\n middleware\n );\n\n return registerComponent(basePlugin.name, chainedPanelComponent);\n }\n );\n\n return () => {\n deregisterFns.forEach(deregister => deregister());\n };\n }, [registerComponent, supportedTypes]);\n\n /**\n * Listen for panel open events so we know when to open a panel\n */\n usePanelOpenListener(layout.eventHub, handlePanelOpen);\n\n return null;\n}\n\nexport default WidgetLoaderPlugin;\n"],"mappings":";;;;;;;;;;;AAAA,SAASA,OAAO,EAAEC,WAAW,EAAEC,SAAS,EAAEC,UAAU,QAAQ,OAAO;AAEnE,SAASC,MAAM,QAAQ,QAAQ;AAC/B,SACEC,4BAA4B,EAI5BC,WAAW,EAEXC,UAAU,EACVC,oBAAoB,QACf,sBAAsB;AAC7B,OAAOC,GAAG,MAAM,gBAAgB;AAChC,SACEC,cAAc,EACdC,wBAAwB,EACxBC,sBAAsB,EACtBC,2BAA2B,EAC3BC,UAAU,QAGL,mBAAmB;AAAC,SAClBC,WAAW;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAGpB,IAAMC,GAAG,GAAGT,GAAG,CAACU,MAAM,CAAC,oBAAoB,CAAC;;AAE5C;AACA;AACA;;AAQA,OAAO,SAASC,gBAAgBA,CAC9BC,MAAoB,EACwD;EAAA,IAAAC,qBAAA;EAC5E,SAASC,OAAOA,CAACC,KAAiB,EAAEC,GAAgC,EAAE;IAAA,IAAAC,cAAA,EAAAC,cAAA;IACpE;IACA,IAAMC,CAAC,GAAGP,MAAM,CAACQ,SAAgB;IACjC,IAAQC,QAAQ,GAAKN,KAAK,CAAlBM,QAAQ;IAEhB,IAAMC,eAAsC,GAAAC,aAAA,CAAAA,aAAA,KACvCF,QAAQ;MACXG,IAAI,GAAAP,cAAA,GAAEI,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAEG,IAAI,cAAAP,cAAA,cAAAA,cAAA,GAAIL,MAAM,CAACY,IA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B,SAAS,EAAEiE;QAAgB,EAC5B;QACD,OAAOhC,iBAAiB,CACtBN,UAAU,CAACtB,IAAI,EACfd,gBAAgB,CAAC2E,aAAa,CAChC,CAAC;MACH;;MAEA;MACA;MACA;MACA7E,GAAG,CAACoC,KAAK,kCAAAjB,MAAA,CAC0BmB,UAAU,CAACtB,IAAI,kCAClD,CAAC;MACD,IAAM8D,qBAAqB,GAAGnF,2BAA2B,CACvD6E,cAAc,EACdtC,UACF,CAAC;MAED,OAAOU,iBAAiB,CAACN,UAAU,CAACtB,IAAI,EAAE8D,qBAAqB,CAAC;IAClE,CACF,CAAC;IAED,OAAO,MAAM;MACXL,aAAa,CAAC7C,OAAO,CAACmD,UAAU,IAAIA,UAAU,CAAC,CAAC,CAAC;IACnD,CAAC;EACH,CAAC,EAAE,CAACnC,iBAAiB,EAAEnB,cAAc,CAAC,CAAC;;EAEvC;AACF;AACA;EACEnC,oBAAoB,CAACqD,MAAM,CAACqC,QAAQ,EAAEnC,eAAe,CAAC;EAEtD,OAAO,IAAI;AACb;AAEA,eAAetB,kBAAkB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"WidgetLoaderPlugin.js","names":["useMemo","useCallback","useEffect","forwardRef","nanoid","assertIsDashboardPluginProps","LayoutUtils","canHaveRef","usePanelOpenListener","Log","createChainedComponent","createChainedPanelComponent","usePlugins","WidgetPanel","getSupportedWidgetTypes","getUniqueWidgetPluginInfos","jsx","_jsx","log","module","WrapWidgetPlugin","plugin","_plugin$component$dis","Wrapper","props","ref","_metadata$type","_metadata$name","C","component","metadata","panelDescriptor","_objectSpread","type","name","hasRef","className","concat","descriptor","children","displayName","WidgetLoaderPlugin","plugins","supportedTypes","id","layout","registerComponent","handlePanelOpen","_ref","_widget$name","dragEvent","_ref$panelId","panelId","fetch","widget","typeInfo","get","panelProps","localDashboardId","config","basePlugin","title","root","openComponent","uniquePluginInfos","debug","entries","map","_ref2","_ref3","_slicedToArray","info","middleware","m","hasPanel","panelComponent","deregisterFns","values","_ref4","chainedComponent","wrappedPlugin","chainedPanelComponent","forEach","deregister","eventHub"],"sources":["../src/WidgetLoaderPlugin.tsx"],"sourcesContent":["import { useMemo, useCallback, useEffect, forwardRef } from 'react';\nimport type { ReactComponentConfig } from '@deephaven/golden-layout';\nimport { nanoid } from 'nanoid';\nimport {\n assertIsDashboardPluginProps,\n type DashboardPluginComponentProps,\n type DehydratedDashboardPanelProps,\n type PanelOpenEventDetail,\n LayoutUtils,\n type PanelProps,\n canHaveRef,\n usePanelOpenListener,\n} from '@deephaven/dashboard';\nimport Log from '@deephaven/log';\nimport {\n createChainedComponent,\n createChainedPanelComponent,\n usePlugins,\n type WidgetPlugin,\n} from '@deephaven/plugin';\nimport { WidgetPanel } from './panels';\nimport { type WidgetPanelDescriptor } from './panels/WidgetPanelTypes';\nimport {\n getSupportedWidgetTypes,\n getUniqueWidgetPluginInfos,\n} from './WidgetLoaderUtils';\n\nconst log = Log.module('WidgetLoaderPlugin');\n\nexport function WrapWidgetPlugin(\n plugin: WidgetPlugin\n): React.ForwardRefExoticComponent<PanelProps & React.RefAttributes<unknown>> {\n function Wrapper(props: PanelProps, ref: React.ForwardedRef<unknown>) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const C = plugin.component as any;\n const { metadata } = props;\n\n const panelDescriptor: WidgetPanelDescriptor = {\n ...metadata,\n type: metadata?.type ?? plugin.type,\n name: metadata?.name ?? 'Widget',\n };\n\n const hasRef = canHaveRef(C);\n const className = `widget-loader-${panelDescriptor.type}`;\n\n return (\n <WidgetPanel\n descriptor={panelDescriptor}\n className={className}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...props}\n >\n {hasRef ? (\n <C\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...props}\n ref={ref}\n />\n ) : (\n <C\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...props}\n />\n )}\n </WidgetPanel>\n );\n }\n\n Wrapper.displayName = `WidgetLoaderPlugin(${\n plugin.component.displayName ?? plugin.name\n })`;\n\n return forwardRef(Wrapper);\n}\n\n/**\n * Widget to automatically open any supported WidgetPlugin types as panels\n * if the widget is emitted from the server as the result of executed code.\n *\n * Does not open panels for widgets that are not supported by any plugins.\n * Does not open panels for widgets that are a component of a larger widget or UI element.\n *\n * Supports plugin chaining via middleware plugins. When multiple plugins\n * support the same widget type, middleware plugins are chained around\n * the base plugin in registration order.\n *\n * @param props Dashboard plugin props\n * @returns React element\n */\nexport function WidgetLoaderPlugin(\n props: Partial<DashboardPluginComponentProps>\n): JSX.Element | null {\n const plugins = usePlugins();\n\n const supportedTypes = useMemo(\n () => getSupportedWidgetTypes(plugins),\n [plugins]\n );\n\n assertIsDashboardPluginProps(props);\n const { id, layout, registerComponent } = props;\n\n const handlePanelOpen = useCallback(\n ({\n dragEvent,\n panelId = nanoid(),\n fetch,\n widget,\n }: PanelOpenEventDetail) => {\n const { type } = widget;\n const typeInfo = type != null ? supportedTypes.get(type) : null;\n if (typeInfo == null) {\n return;\n }\n const name = widget.name ?? type;\n\n const panelProps: DehydratedDashboardPanelProps & {\n fetch?: () => Promise<unknown>;\n } = {\n localDashboardId: id,\n metadata: widget,\n fetch,\n };\n\n const config: ReactComponentConfig = {\n type: 'react-component',\n component: typeInfo.basePlugin.name,\n props: panelProps,\n title: name,\n id: panelId,\n };\n\n const { root } = layout;\n LayoutUtils.openComponent({ root, config, dragEvent });\n },\n [id, layout, supportedTypes]\n );\n\n useEffect(() => {\n // Get unique base plugins (a plugin may handle multiple types)\n const uniquePluginInfos = getUniqueWidgetPluginInfos(supportedTypes);\n\n log.debug(\n 'Registering widget components',\n [...uniquePluginInfos.entries()].map(([name, info]) => ({\n plugin: name,\n middleware: info.middleware.map(m => m.name),\n hasPanel: info.basePlugin.panelComponent != null,\n }))\n );\n\n const deregisterFns = [...uniquePluginInfos.values()].map(\n ({ basePlugin, middleware }) => {\n const { panelComponent } = basePlugin;\n\n if (panelComponent == null) {\n // No panel component - chain the widget components and wrap in default panel\n log.debug(\n `Chaining widget components for ${basePlugin.name} (no panel component, using default wrapper)`\n );\n const chainedComponent = createChainedComponent(\n basePlugin.component,\n middleware\n );\n const wrappedPlugin: WidgetPlugin = {\n ...basePlugin,\n component: chainedComponent,\n };\n return registerComponent(\n basePlugin.name,\n WrapWidgetPlugin(wrappedPlugin)\n );\n }\n\n // Has panel component - chain middleware around the panel.\n // Only middleware that defines panelComponent is applied here.\n // Middleware with only component is skipped in this path.\n log.debug(\n `Chaining panel components for ${basePlugin.name} (has custom panel component)`\n );\n const chainedPanelComponent = createChainedPanelComponent(\n panelComponent,\n middleware\n );\n\n return registerComponent(basePlugin.name, chainedPanelComponent);\n }\n );\n\n return () => {\n deregisterFns.forEach(deregister => deregister());\n };\n }, [registerComponent, supportedTypes]);\n\n /**\n * Listen for panel open events so we know when to open a panel\n */\n usePanelOpenListener(layout.eventHub, handlePanelOpen);\n\n return null;\n}\n\nexport default WidgetLoaderPlugin;\n"],"mappings":";;;;;;;;;;;AAAA,SAASA,OAAO,EAAEC,WAAW,EAAEC,SAAS,EAAEC,UAAU,QAAQ,OAAO;AAEnE,SAASC,MAAM,QAAQ,QAAQ;AAC/B,SACEC,4BAA4B,EAI5BC,WAAW,EAEXC,UAAU,EACVC,oBAAoB,QACf,sBAAsB;AAC7B,OAAOC,GAAG,MAAM,gBAAgB;AAChC,SACEC,sBAAsB,EACtBC,2BAA2B,EAC3BC,UAAU,QAEL,mBAAmB;AAAC,SAClBC,WAAW;AAAA,SAGlBC,uBAAuB,EACvBC,0BAA0B;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAG5B,IAAMC,GAAG,GAAGT,GAAG,CAACU,MAAM,CAAC,oBAAoB,CAAC;AAE5C,OAAO,SAASC,gBAAgBA,CAC9BC,MAAoB,EACwD;EAAA,IAAAC,qBAAA;EAC5E,SAASC,OAAOA,CAACC,KAAiB,EAAEC,GAAgC,EAAE;IAAA,IAAAC,cAAA,EAAAC,cAAA;IACpE;IACA,IAAMC,CAAC,GAAGP,MAAM,CAACQ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b/B,SAAS,EAAEkD;QAAgB,EAC5B;QACD,OAAOjC,iBAAiB,CACtBc,UAAU,CAAC1B,IAAI,EACfd,gBAAgB,CAAC4D,aAAa,CAChC,CAAC;MACH;;MAEA;MACA;MACA;MACA9D,GAAG,CAAC+C,KAAK,kCAAA5B,MAAA,CAC0BuB,UAAU,CAAC1B,IAAI,kCAClD,CAAC;MACD,IAAM+C,qBAAqB,GAAGtE,2BAA2B,CACvDgE,cAAc,EACdH,UACF,CAAC;MAED,OAAO1B,iBAAiB,CAACc,UAAU,CAAC1B,IAAI,EAAE+C,qBAAqB,CAAC;IAClE,CACF,CAAC;IAED,OAAO,MAAM;MACXL,aAAa,CAACM,OAAO,CAACC,UAAU,IAAIA,UAAU,CAAC,CAAC,CAAC;IACnD,CAAC;EACH,CAAC,EAAE,CAACrC,iBAAiB,EAAEH,cAAc,CAAC,CAAC;;EAEvC;AACF;AACA;EACEnC,oBAAoB,CAACqC,MAAM,CAACuC,QAAQ,EAAErC,eAAe,CAAC;EAEtD,OAAO,IAAI;AACb;AAEA,eAAeN,kBAAkB","ignoreList":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type PluginModuleMap, type WidgetPlugin, type WidgetMiddlewarePlugin } from '@deephaven/plugin';
|
|
2
|
+
/**
|
|
3
|
+
* Information about a widget type including its base plugin and any middleware.
|
|
4
|
+
*/
|
|
5
|
+
export interface WidgetTypeInfo {
|
|
6
|
+
/** The base plugin that handles this widget type, or null if only middleware registered so far */
|
|
7
|
+
basePlugin: WidgetPlugin | null;
|
|
8
|
+
/** Middleware plugins to apply, in order from outermost to innermost */
|
|
9
|
+
middleware: WidgetMiddlewarePlugin[];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Widget type info that is guaranteed to have a base plugin.
|
|
13
|
+
*/
|
|
14
|
+
export type ValidWidgetTypeInfo = WidgetTypeInfo & {
|
|
15
|
+
basePlugin: WidgetPlugin;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Build a map of widget types to their plugin chain info.
|
|
19
|
+
* For each type, we have a base plugin and a list of middleware to apply.
|
|
20
|
+
*
|
|
21
|
+
* Types that only have middleware registered (no base plugin) are omitted.
|
|
22
|
+
*
|
|
23
|
+
* @param plugins Map of all registered plugin modules
|
|
24
|
+
* @returns Map of widget type to the base plugin and middleware for that type
|
|
25
|
+
*/
|
|
26
|
+
export declare function getSupportedWidgetTypes(plugins: PluginModuleMap): Map<string, ValidWidgetTypeInfo>;
|
|
27
|
+
/**
|
|
28
|
+
* Get the unique base plugins from a supported types map, merging the middleware
|
|
29
|
+
* from each type a given base plugin handles.
|
|
30
|
+
*
|
|
31
|
+
* @param supportedTypes Map of widget type to base plugin and middleware
|
|
32
|
+
* @returns Map of base plugin name to the base plugin and its merged middleware
|
|
33
|
+
*/
|
|
34
|
+
export declare function getUniqueWidgetPluginInfos(supportedTypes: Map<string, ValidWidgetTypeInfo>): Map<string, ValidWidgetTypeInfo>;
|
|
35
|
+
//# sourceMappingURL=WidgetLoaderUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WidgetLoaderUtils.d.ts","sourceRoot":"","sources":["../src/WidgetLoaderUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC5B,MAAM,mBAAmB,CAAC;AAI3B;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,kGAAkG;IAClG,UAAU,EAAE,YAAY,GAAG,IAAI,CAAC;IAChC,wEAAwE;IACxE,UAAU,EAAE,sBAAsB,EAAE,CAAC;CACtC;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,cAAc,GAAG;IACjD,UAAU,EAAE,YAAY,CAAC;CAC1B,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,eAAe,GACvB,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAsElC;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CACxC,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,GAC/C,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAuBlC"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import Log from '@deephaven/log';
|
|
2
|
+
import { isWidgetPlugin, isWidgetMiddlewarePlugin } from '@deephaven/plugin';
|
|
3
|
+
var log = Log.module('WidgetLoaderUtils');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Information about a widget type including its base plugin and any middleware.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Widget type info that is guaranteed to have a base plugin.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Build a map of widget types to their plugin chain info.
|
|
15
|
+
* For each type, we have a base plugin and a list of middleware to apply.
|
|
16
|
+
*
|
|
17
|
+
* Types that only have middleware registered (no base plugin) are omitted.
|
|
18
|
+
*
|
|
19
|
+
* @param plugins Map of all registered plugin modules
|
|
20
|
+
* @returns Map of widget type to the base plugin and middleware for that type
|
|
21
|
+
*/
|
|
22
|
+
export function getSupportedWidgetTypes(plugins) {
|
|
23
|
+
var typeMap = new Map();
|
|
24
|
+
plugins.forEach(plugin => {
|
|
25
|
+
var isMiddleware = isWidgetMiddlewarePlugin(plugin);
|
|
26
|
+
if (!isWidgetPlugin(plugin) && !isMiddleware) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
[plugin.supportedTypes].flat().forEach(supportedType => {
|
|
30
|
+
if (supportedType == null || supportedType === '') {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
var existing = typeMap.get(supportedType);
|
|
34
|
+
if (isMiddleware) {
|
|
35
|
+
// Add middleware to existing chain or create pending chain
|
|
36
|
+
if (existing != null) {
|
|
37
|
+
existing.middleware.push(plugin);
|
|
38
|
+
log.debug("Adding middleware ".concat(plugin.name, " to chain for type ").concat(supportedType));
|
|
39
|
+
} else {
|
|
40
|
+
// No base plugin yet, create entry with just middleware
|
|
41
|
+
// The base plugin will be set when a non-middleware plugin is registered
|
|
42
|
+
typeMap.set(supportedType, {
|
|
43
|
+
basePlugin: null,
|
|
44
|
+
middleware: [plugin]
|
|
45
|
+
});
|
|
46
|
+
log.debug("Creating pending middleware chain for type ".concat(supportedType, " with ").concat(plugin.name));
|
|
47
|
+
}
|
|
48
|
+
} else {
|
|
49
|
+
// Non-middleware plugin: becomes the base plugin
|
|
50
|
+
if (existing != null) {
|
|
51
|
+
if (existing.basePlugin != null) {
|
|
52
|
+
// Already have a base plugin, warn about replacement
|
|
53
|
+
log.warn("Multiple WidgetPlugins handling type ".concat(supportedType, ". ") + "Replacing ".concat(existing.basePlugin.name, " with ").concat(plugin.name, " as base plugin"));
|
|
54
|
+
}
|
|
55
|
+
// Keep existing middleware, update the base plugin
|
|
56
|
+
existing.basePlugin = plugin;
|
|
57
|
+
} else {
|
|
58
|
+
typeMap.set(supportedType, {
|
|
59
|
+
basePlugin: plugin,
|
|
60
|
+
middleware: []
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
log.debug("Set base plugin ".concat(plugin.name, " for type ").concat(supportedType));
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
// Filter out entries that only have middleware (no base plugin)
|
|
69
|
+
var validEntries = new Map();
|
|
70
|
+
typeMap.forEach((info, type) => {
|
|
71
|
+
if (info.basePlugin != null) {
|
|
72
|
+
validEntries.set(type, info);
|
|
73
|
+
} else {
|
|
74
|
+
log.warn("No base plugin found for type ".concat(type, ", middleware will not be applied"));
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
return validEntries;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Get the unique base plugins from a supported types map, merging the middleware
|
|
82
|
+
* from each type a given base plugin handles.
|
|
83
|
+
*
|
|
84
|
+
* @param supportedTypes Map of widget type to base plugin and middleware
|
|
85
|
+
* @returns Map of base plugin name to the base plugin and its merged middleware
|
|
86
|
+
*/
|
|
87
|
+
export function getUniqueWidgetPluginInfos(supportedTypes) {
|
|
88
|
+
var uniquePluginInfos = new Map();
|
|
89
|
+
supportedTypes.forEach(info => {
|
|
90
|
+
var existingInfo = uniquePluginInfos.get(info.basePlugin.name);
|
|
91
|
+
if (existingInfo == null) {
|
|
92
|
+
// Clone so the source map is not mutated
|
|
93
|
+
uniquePluginInfos.set(info.basePlugin.name, {
|
|
94
|
+
basePlugin: info.basePlugin,
|
|
95
|
+
middleware: [...info.middleware]
|
|
96
|
+
});
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Merge middleware from multiple type registrations for the same base plugin
|
|
101
|
+
info.middleware.forEach(m => {
|
|
102
|
+
if (!existingInfo.middleware.includes(m)) {
|
|
103
|
+
existingInfo.middleware.push(m);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
return uniquePluginInfos;
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=WidgetLoaderUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WidgetLoaderUtils.js","names":["Log","isWidgetPlugin","isWidgetMiddlewarePlugin","log","module","getSupportedWidgetTypes","plugins","typeMap","Map","forEach","plugin","isMiddleware","supportedTypes","flat","supportedType","existing","get","middleware","push","debug","concat","name","set","basePlugin","warn","validEntries","info","type","getUniqueWidgetPluginInfos","uniquePluginInfos","existingInfo","m","includes"],"sources":["../src/WidgetLoaderUtils.ts"],"sourcesContent":["import Log from '@deephaven/log';\nimport {\n isWidgetPlugin,\n isWidgetMiddlewarePlugin,\n type PluginModuleMap,\n type WidgetPlugin,\n type WidgetMiddlewarePlugin,\n} from '@deephaven/plugin';\n\nconst log = Log.module('WidgetLoaderUtils');\n\n/**\n * Information about a widget type including its base plugin and any middleware.\n */\nexport interface WidgetTypeInfo {\n /** The base plugin that handles this widget type, or null if only middleware registered so far */\n basePlugin: WidgetPlugin | null;\n /** Middleware plugins to apply, in order from outermost to innermost */\n middleware: WidgetMiddlewarePlugin[];\n}\n\n/**\n * Widget type info that is guaranteed to have a base plugin.\n */\nexport type ValidWidgetTypeInfo = WidgetTypeInfo & {\n basePlugin: WidgetPlugin;\n};\n\n/**\n * Build a map of widget types to their plugin chain info.\n * For each type, we have a base plugin and a list of middleware to apply.\n *\n * Types that only have middleware registered (no base plugin) are omitted.\n *\n * @param plugins Map of all registered plugin modules\n * @returns Map of widget type to the base plugin and middleware for that type\n */\nexport function getSupportedWidgetTypes(\n plugins: PluginModuleMap\n): Map<string, ValidWidgetTypeInfo> {\n const typeMap = new Map<string, WidgetTypeInfo>();\n\n plugins.forEach(plugin => {\n const isMiddleware = isWidgetMiddlewarePlugin(plugin);\n if (!isWidgetPlugin(plugin) && !isMiddleware) {\n return;\n }\n\n [plugin.supportedTypes].flat().forEach(supportedType => {\n if (supportedType == null || supportedType === '') {\n return;\n }\n\n const existing = typeMap.get(supportedType);\n\n if (isMiddleware) {\n // Add middleware to existing chain or create pending chain\n if (existing != null) {\n existing.middleware.push(plugin);\n log.debug(\n `Adding middleware ${plugin.name} to chain for type ${supportedType}`\n );\n } else {\n // No base plugin yet, create entry with just middleware\n // The base plugin will be set when a non-middleware plugin is registered\n typeMap.set(supportedType, {\n basePlugin: null,\n middleware: [plugin],\n });\n log.debug(\n `Creating pending middleware chain for type ${supportedType} with ${plugin.name}`\n );\n }\n } else {\n // Non-middleware plugin: becomes the base plugin\n if (existing != null) {\n if (existing.basePlugin != null) {\n // Already have a base plugin, warn about replacement\n log.warn(\n `Multiple WidgetPlugins handling type ${supportedType}. ` +\n `Replacing ${existing.basePlugin.name} with ${plugin.name} as base plugin`\n );\n }\n // Keep existing middleware, update the base plugin\n existing.basePlugin = plugin;\n } else {\n typeMap.set(supportedType, {\n basePlugin: plugin,\n middleware: [],\n });\n }\n log.debug(`Set base plugin ${plugin.name} for type ${supportedType}`);\n }\n });\n });\n\n // Filter out entries that only have middleware (no base plugin)\n const validEntries = new Map<string, ValidWidgetTypeInfo>();\n typeMap.forEach((info, type) => {\n if (info.basePlugin != null) {\n validEntries.set(type, info as ValidWidgetTypeInfo);\n } else {\n log.warn(\n `No base plugin found for type ${type}, middleware will not be applied`\n );\n }\n });\n\n return validEntries;\n}\n\n/**\n * Get the unique base plugins from a supported types map, merging the middleware\n * from each type a given base plugin handles.\n *\n * @param supportedTypes Map of widget type to base plugin and middleware\n * @returns Map of base plugin name to the base plugin and its merged middleware\n */\nexport function getUniqueWidgetPluginInfos(\n supportedTypes: Map<string, ValidWidgetTypeInfo>\n): Map<string, ValidWidgetTypeInfo> {\n const uniquePluginInfos = new Map<string, ValidWidgetTypeInfo>();\n\n supportedTypes.forEach(info => {\n const existingInfo = uniquePluginInfos.get(info.basePlugin.name);\n if (existingInfo == null) {\n // Clone so the source map is not mutated\n uniquePluginInfos.set(info.basePlugin.name, {\n basePlugin: info.basePlugin,\n middleware: [...info.middleware],\n });\n return;\n }\n\n // Merge middleware from multiple type registrations for the same base plugin\n info.middleware.forEach(m => {\n if (!existingInfo.middleware.includes(m)) {\n existingInfo.middleware.push(m);\n }\n });\n });\n\n return uniquePluginInfos;\n}\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,gBAAgB;AAChC,SACEC,cAAc,EACdC,wBAAwB,QAInB,mBAAmB;AAE1B,IAAMC,GAAG,GAAGH,GAAG,CAACI,MAAM,CAAC,mBAAmB,CAAC;;AAE3C;AACA;AACA;;AAQA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,uBAAuBA,CACrCC,OAAwB,EACU;EAClC,IAAMC,OAAO,GAAG,IAAIC,GAAG,CAAyB,CAAC;EAEjDF,OAAO,CAACG,OAAO,CAACC,MAAM,IAAI;IACxB,IAAMC,YAAY,GAAGT,wBAAwB,CAACQ,MAAM,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AC;MACjC;IACF,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,OAAOF,iBAAiB;AAC1B","ignoreList":[]}
|
package/dist/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export { default as PandasWidgetPlugin } from './PandasWidgetPlugin';
|
|
|
18
18
|
export { default as PandasPluginConfig } from './PandasPluginConfig';
|
|
19
19
|
export { default as WidgetLoaderPlugin } from './WidgetLoaderPlugin';
|
|
20
20
|
export { default as WidgetLoaderPluginConfig } from './WidgetLoaderPluginConfig';
|
|
21
|
+
export * from './WidgetLoaderUtils';
|
|
21
22
|
export { default as ControlType } from './controls/ControlType';
|
|
22
23
|
export { default as LinkerUtils } from './linker/LinkerUtils';
|
|
23
24
|
export type { Link } from './linker/LinkerUtils';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAA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kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACjF,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC9D,YAAY,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACxD,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAE3C,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -18,6 +18,7 @@ export { default as PandasWidgetPlugin } from "./PandasWidgetPlugin.js";
|
|
|
18
18
|
export { default as PandasPluginConfig } from "./PandasPluginConfig.js";
|
|
19
19
|
export { default as WidgetLoaderPlugin } from "./WidgetLoaderPlugin.js";
|
|
20
20
|
export { default as WidgetLoaderPluginConfig } from "./WidgetLoaderPluginConfig.js";
|
|
21
|
+
export * from "./WidgetLoaderUtils.js";
|
|
21
22
|
export { default as ControlType } from "./controls/ControlType.js";
|
|
22
23
|
export { default as LinkerUtils } from "./linker/LinkerUtils.js";
|
|
23
24
|
export { default as ToolType } from "./linker/ToolType.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["default","ChartPanelPlugin","ChartWidgetPlugin","ChartPluginConfig","ChartBuilderPlugin","ChartBuilderPluginConfig","ConsolePlugin","FilterPlugin","FilterPluginConfig","GridPanelPlugin","GridWidgetPlugin","GridPluginConfig","LinkerPlugin","LinkerPluginConfig","MarkdownPlugin","MarkdownPluginConfig","PandasPanelPlugin","PandasWidgetPlugin","PandasPluginConfig","WidgetLoaderPlugin","WidgetLoaderPluginConfig","ControlType","LinkerUtils","ToolType"],"sources":["../src/index.ts"],"sourcesContent":["export { default as ChartPanelPlugin } from './ChartPanelPlugin';\nexport { default as ChartWidgetPlugin } from './ChartWidgetPlugin';\nexport { default as ChartPluginConfig } from './ChartPluginConfig';\nexport { default as ChartBuilderPlugin } from './ChartBuilderPlugin';\nexport { default as ChartBuilderPluginConfig } from './ChartBuilderPluginConfig';\nexport { default as ConsolePlugin } from './ConsolePlugin';\nexport { default as FilterPlugin } from './FilterPlugin';\nexport { default as FilterPluginConfig } from './FilterPluginConfig';\nexport { default as GridPanelPlugin } from './GridPanelPlugin';\nexport { default as GridWidgetPlugin } from './GridWidgetPlugin';\nexport { default as GridPluginConfig } from './GridPluginConfig';\nexport { default as LinkerPlugin } from './LinkerPlugin';\nexport { default as LinkerPluginConfig } from './LinkerPluginConfig';\nexport { default as MarkdownPlugin } from './MarkdownPlugin';\nexport { default as MarkdownPluginConfig } from './MarkdownPluginConfig';\nexport { default as PandasPanelPlugin } from './PandasPanelPlugin';\nexport { default as PandasWidgetPlugin } from './PandasWidgetPlugin';\nexport { default as PandasPluginConfig } from './PandasPluginConfig';\nexport { default as WidgetLoaderPlugin } from './WidgetLoaderPlugin';\nexport { default as WidgetLoaderPluginConfig } from './WidgetLoaderPluginConfig';\nexport { default as ControlType } from './controls/ControlType';\nexport { default as LinkerUtils } from './linker/LinkerUtils';\nexport type { Link } from './linker/LinkerUtils';\nexport { default as ToolType } from './linker/ToolType';\nexport * from './useConfigureRuff';\nexport * from './useDashboardColumnFilters';\nexport * from './useGridLinker';\nexport * from './useLoadTablePlugin';\nexport * from './useTablePlugin';\nexport * from './TablePluginLoaderContext';\n\nexport * from './ConsoleEvents';\nexport * from './events';\nexport * from './panels';\nexport * from './redux';\nexport * from './prop-types';\nexport * from './linker';\n"],"mappings":"SAASA,OAAO,IAAIC,gBAAgB;AAAA,SAC3BD,OAAO,IAAIE,iBAAiB;AAAA,SAC5BF,OAAO,IAAIG,iBAAiB;AAAA,SAC5BH,OAAO,IAAII,kBAAkB;AAAA,SAC7BJ,OAAO,IAAIK,wBAAwB;AAAA,SACnCL,OAAO,IAAIM,aAAa;AAAA,SACxBN,OAAO,IAAIO,YAAY;AAAA,SACvBP,OAAO,IAAIQ,kBAAkB;AAAA,SAC7BR,OAAO,IAAIS,eAAe;AAAA,SAC1BT,OAAO,IAAIU,gBAAgB;AAAA,SAC3BV,OAAO,IAAIW,gBAAgB;AAAA,SAC3BX,OAAO,IAAIY,YAAY;AAAA,SACvBZ,OAAO,IAAIa,kBAAkB;AAAA,SAC7Bb,OAAO,IAAIc,cAAc;AAAA,SACzBd,OAAO,IAAIe,oBAAoB;AAAA,SAC/Bf,OAAO,IAAIgB,iBAAiB;AAAA,SAC5BhB,OAAO,IAAIiB,kBAAkB;AAAA,SAC7BjB,OAAO,IAAIkB,kBAAkB;AAAA,SAC7BlB,OAAO,IAAImB,kBAAkB;AAAA,SAC7BnB,OAAO,IAAIoB,wBAAwB;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["default","ChartPanelPlugin","ChartWidgetPlugin","ChartPluginConfig","ChartBuilderPlugin","ChartBuilderPluginConfig","ConsolePlugin","FilterPlugin","FilterPluginConfig","GridPanelPlugin","GridWidgetPlugin","GridPluginConfig","LinkerPlugin","LinkerPluginConfig","MarkdownPlugin","MarkdownPluginConfig","PandasPanelPlugin","PandasWidgetPlugin","PandasPluginConfig","WidgetLoaderPlugin","WidgetLoaderPluginConfig","ControlType","LinkerUtils","ToolType"],"sources":["../src/index.ts"],"sourcesContent":["export { default as ChartPanelPlugin } from './ChartPanelPlugin';\nexport { default as ChartWidgetPlugin } from './ChartWidgetPlugin';\nexport { default as ChartPluginConfig } from './ChartPluginConfig';\nexport { default as ChartBuilderPlugin } from './ChartBuilderPlugin';\nexport { default as ChartBuilderPluginConfig } from './ChartBuilderPluginConfig';\nexport { default as ConsolePlugin } from './ConsolePlugin';\nexport { default as FilterPlugin } from './FilterPlugin';\nexport { default as FilterPluginConfig } from './FilterPluginConfig';\nexport { default as GridPanelPlugin } from './GridPanelPlugin';\nexport { default as GridWidgetPlugin } from './GridWidgetPlugin';\nexport { default as GridPluginConfig } from './GridPluginConfig';\nexport { default as LinkerPlugin } from './LinkerPlugin';\nexport { default as LinkerPluginConfig } from './LinkerPluginConfig';\nexport { default as MarkdownPlugin } from './MarkdownPlugin';\nexport { default as MarkdownPluginConfig } from './MarkdownPluginConfig';\nexport { default as PandasPanelPlugin } from './PandasPanelPlugin';\nexport { default as PandasWidgetPlugin } from './PandasWidgetPlugin';\nexport { default as PandasPluginConfig } from './PandasPluginConfig';\nexport { default as WidgetLoaderPlugin } from './WidgetLoaderPlugin';\nexport { default as WidgetLoaderPluginConfig } from './WidgetLoaderPluginConfig';\nexport * from './WidgetLoaderUtils';\nexport { default as ControlType } from './controls/ControlType';\nexport { default as LinkerUtils } from './linker/LinkerUtils';\nexport type { Link } from './linker/LinkerUtils';\nexport { default as ToolType } from './linker/ToolType';\nexport * from './useConfigureRuff';\nexport * from './useDashboardColumnFilters';\nexport * from './useGridLinker';\nexport * from './useLoadTablePlugin';\nexport * from './useTablePlugin';\nexport * from './TablePluginLoaderContext';\n\nexport * from './ConsoleEvents';\nexport * from './events';\nexport * from './panels';\nexport * from './redux';\nexport * from './prop-types';\nexport * from './linker';\n"],"mappings":"SAASA,OAAO,IAAIC,gBAAgB;AAAA,SAC3BD,OAAO,IAAIE,iBAAiB;AAAA,SAC5BF,OAAO,IAAIG,iBAAiB;AAAA,SAC5BH,OAAO,IAAII,kBAAkB;AAAA,SAC7BJ,OAAO,IAAIK,wBAAwB;AAAA,SACnCL,OAAO,IAAIM,aAAa;AAAA,SACxBN,OAAO,IAAIO,YAAY;AAAA,SACvBP,OAAO,IAAIQ,kBAAkB;AAAA,SAC7BR,OAAO,IAAIS,eAAe;AAAA,SAC1BT,OAAO,IAAIU,gBAAgB;AAAA,SAC3BV,OAAO,IAAIW,gBAAgB;AAAA,SAC3BX,OAAO,IAAIY,YAAY;AAAA,SACvBZ,OAAO,IAAIa,kBAAkB;AAAA,SAC7Bb,OAAO,IAAIc,cAAc;AAAA,SACzBd,OAAO,IAAIe,oBAAoB;AAAA,SAC/Bf,OAAO,IAAIgB,iBAAiB;AAAA,SAC5BhB,OAAO,IAAIiB,kBAAkB;AAAA,SAC7BjB,OAAO,IAAIkB,kBAAkB;AAAA,SAC7BlB,OAAO,IAAImB,kBAAkB;AAAA,SAC7BnB,OAAO,IAAIoB,wBAAwB;AAAA;AAAA,SAEnCpB,OAAO,IAAIqB,WAAW;AAAA,SACtBrB,OAAO,IAAIsB,WAAW;AAAA,SAEtBtB,OAAO,IAAIuB,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deephaven/dashboard-core-plugins",
|
|
3
|
-
"version": "1.27.
|
|
3
|
+
"version": "1.27.1",
|
|
4
4
|
"description": "Deephaven Dashboard Core Plugins",
|
|
5
5
|
"author": "Deephaven Data Labs LLC",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"publishConfig": {
|
|
80
80
|
"access": "public"
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "b59031cd25be9b9b9fa5c7caff5612aaf99b6339"
|
|
83
83
|
}
|