@tenorlab/react-dashboard 1.0.3 → 1.0.4

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.
@@ -60,7 +60,7 @@ export type TWidgetFactoryBase<TFrameworkComponent = any> = () => Promise<{
60
60
  * TFrameworkElementType: see TWidgetMetaInfoBase
61
61
  * TFrameworkComponentType: i.e. React.ComponentType<any> (see TWidgetFactoryBase)
62
62
  */
63
- export interface IDynamicWidgetCatalogEntryBase<TFrameworkElementType, TFrameworkComponentType> {
63
+ export interface IDynamicWidgetCatalogEntryBase<TFrameworkElementType = any, TFrameworkComponentType = any> {
64
64
  key: TDashboardWidgetKey;
65
65
  title: string;
66
66
  isContainer?: boolean;
@@ -74,3 +74,7 @@ export type TGetDefaultWidgetMetaFromKeyOptions = {
74
74
  description?: string;
75
75
  };
76
76
  export type TGetDefaultWidgetMetaFromKey = (widgetKey: TDashboardWidgetKey, options?: TGetDefaultWidgetMetaFromKeyOptions) => TWidgetMetaInfoBase<any>;
77
+ export type TManifestEntry = {
78
+ url: string;
79
+ meta: TWidgetMetaInfoBase;
80
+ };
@@ -1,4 +1,4 @@
1
- import type { TDashboardWidgetKey, TWidgetMetaInfoBase, TDashboardWidgetCatalogBase, TGetDefaultWidgetMetaFromKey } from './core.base';
1
+ import type { TDashboardWidgetKey, TWidgetMetaInfoBase, TDashboardWidgetCatalogBase, TGetDefaultWidgetMetaFromKey, TWidgetFactoryBase, IDynamicWidgetCatalogEntryBase } from './core.base';
2
2
  import type { IDashboardConfig } from './core.interfaces';
3
3
  export declare const blankDashboardConfig: IDashboardConfig;
4
4
  export declare const DashboardMinZoomScale: 0.7;
@@ -6,6 +6,13 @@ export declare const DashboardMaxZoomScale: 1;
6
6
  export declare const DashboardZoomStep: 0.05;
7
7
  export declare const ensureZoomScaleIsWithinRange: (value: number) => number;
8
8
  export declare const getNewZoomScaleWithinRange: (currentZoomScale: number, direction: -1 | 1) => number;
9
+ export declare const removeEmptyContainers: (dashboardConfig: IDashboardConfig) => IDashboardConfig;
10
+ /**
11
+ * @name ensureContainersSequence
12
+ * @description
13
+ * Ensures that the container widgets are numbered sequentially in the dashboardConfig, but the original order is preserved.
14
+ */
15
+ export declare const ensureContainersSequence: (dashboardConfig: IDashboardConfig) => IDashboardConfig;
9
16
  export declare const getDefaultWidgetMetaFromKey: TGetDefaultWidgetMetaFromKey;
10
17
  /**
11
18
  * @name getDefaultWidgetMetaFromMap
@@ -20,10 +27,25 @@ export declare const getDefaultWidgetMetaFromMap: <TFrameworkElementType = any>(
20
27
  * @description Helper to get widget meta info from the catalog by key.
21
28
  */
22
29
  export declare const getWidgetMetaFromCatalog: <TFrameworkElementType = any, TFrameworkComponentType = any>(widgetKey: TDashboardWidgetKey, widgetsCatalog: TDashboardWidgetCatalogBase<TFrameworkElementType, TFrameworkComponentType>) => TWidgetMetaInfoBase<TFrameworkElementType>;
23
- export declare const removeEmptyContainers: (dashboardConfig: IDashboardConfig) => IDashboardConfig;
24
30
  /**
25
- * @name ensureContainersSequence
26
- * @description
27
- * Ensures that the container widgets are numbered sequentially in the dashboardConfig, but the original order is preserved.
31
+ * @name createStaticEntry
32
+ * Helper function to create static entries
33
+ * This helps keep the catalog registration clean
28
34
  */
29
- export declare const ensureContainersSequence: (dashboardConfig: IDashboardConfig) => IDashboardConfig;
35
+ export declare const createStaticEntry: <TFrameworkComponentType = any>(key: string, component: TFrameworkComponentType) => [string, IDynamicWidgetCatalogEntryBase];
36
+ /**
37
+ * @name createDynamicEntry
38
+ * Helper function to create dynamic entries
39
+ * This helps keep the catalog registration clean
40
+ */
41
+ export declare const createDynamicEntry: (key: string, loader: TWidgetFactoryBase, meta: TWidgetMetaInfoBase) => [string, IDynamicWidgetCatalogEntryBase];
42
+ export declare const parseKeyAndTitleFromFilePath: (path: string) => {
43
+ key: TDashboardWidgetKey;
44
+ title: string;
45
+ folder: string;
46
+ } | null;
47
+ export declare const remoteWidgetDiscovery: (manifestUrl: string) => Promise<{
48
+ entries: [string, IDynamicWidgetCatalogEntryBase][];
49
+ message: string;
50
+ details: string;
51
+ }>;