semaphor 0.0.64 → 0.0.66

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.
@@ -14,6 +14,7 @@ import { StoreApi } from 'zustand';
14
14
  import { UseBoundStore } from 'zustand';
15
15
 
16
16
  declare type Actions = {
17
+ setInitStore: () => void;
17
18
  setGlobalStyle: (style: TStyle) => void;
18
19
  setLenses: (lenses: TLens[]) => void;
19
20
  setSelectedLensId: (lensId: string) => void;
@@ -67,6 +68,7 @@ declare type Actions = {
67
68
  getStyle: () => TStyle | undefined;
68
69
  setOnSaveFunction: (onSaveFunction: (dashboard: TDashboard) => void) => void;
69
70
  setOnAddCard: (onAddCard: (card: TCard, sheetId: string) => void) => void;
71
+ setOnAcceptChanges: (onAcceptChanges: (frame: TFrame, dashboard: TDashboard) => void) => void;
70
72
  setOnUpdateCard: (onUpdateCard: (card: TCard, sheetId: string) => void) => void;
71
73
  setOnRemoveCard: (onRemoveCard: (card: TCard, sheetId: string) => void) => void;
72
74
  setOnEvent: (onEvent: (event: TEvent) => void) => void;
@@ -95,6 +97,7 @@ declare type Actions_2 = {
95
97
  setQueryError: (error: string) => void;
96
98
  setRunSql: (runSql: boolean) => void;
97
99
  setCardPreferences: (preferences: TCardPreferences) => void;
100
+ setCustomCardPreferences: (customPreferences: TCustomCardPreferences) => void;
98
101
  setFilterOnClickField: (field: string) => void;
99
102
  setFilterOnClickColumnIndex: (index: number) => void;
100
103
  setIsSqlRunning: (isSqlRunning: boolean) => void;
@@ -215,6 +218,7 @@ declare type DashboardPlusProps = {
215
218
  export declare type DashboardProps = {
216
219
  id?: string;
217
220
  authToken: AuthToken | undefined;
221
+ defaultFilterValues?: TFilterValue[];
218
222
  customStyle?: TStyle;
219
223
  currentTheme?: Theme;
220
224
  version?: string;
@@ -250,6 +254,7 @@ export declare type DashboardStore = {
250
254
  onEvent?: (event: TEvent) => void;
251
255
  onSaveFunction?: (dashboard: TDashboard) => void;
252
256
  onAddFrame?: (card: TFrame, sheetId: string) => void;
257
+ onAcceptChanges?: (frame: TFrame, dashboard: TDashboard) => void;
253
258
  onUpdateCard?: (card: TCard, sheetId: string) => void;
254
259
  onRemoveCard?: (card: TCard, sheetId: string) => void;
255
260
  actions: Actions;
@@ -505,6 +510,7 @@ export declare type TCard = {
505
510
  id: string;
506
511
  title: string;
507
512
  tabTitle?: string;
513
+ displayTab?: boolean;
508
514
  description?: string;
509
515
  info?: string;
510
516
  connectionId?: string;
@@ -516,6 +522,7 @@ export declare type TCard = {
516
522
  cfg?: any;
517
523
  customCfg?: any;
518
524
  preferences?: TCardPreferences;
525
+ customCardPreferences?: TCustomCardPreferences;
519
526
  lastSelectedDatabase?: string;
520
527
  lastSelectedDatamodelId?: string;
521
528
  lastSelectedSchema?: string;
@@ -587,6 +594,23 @@ export declare type TColumnSetting<T extends DisplayDataType> = {
587
594
  options: OptionsMap[T];
588
595
  };
589
596
 
597
+ export declare type TCustomCardPreferences = {
598
+ url: string;
599
+ componentName: string;
600
+ type?: 'iframe' | 'component';
601
+ visualType?: 'single' | 'multiple';
602
+ settings?: any;
603
+ dataInputCardIds?: {
604
+ [key: number]: {
605
+ cardId: string;
606
+ };
607
+ };
608
+ inputData?: {
609
+ cardId: string;
610
+ data: Record<string, any>[];
611
+ }[];
612
+ };
613
+
590
614
  export declare type TDashboard = {
591
615
  id: string;
592
616
  title?: string;
@@ -640,7 +664,7 @@ declare type TFilter = {
640
664
  operation: Operation;
641
665
  };
642
666
 
643
- declare type TFilterValue = FilterForString | FilterForEqual | FilterForCompare | FilterForBetween | FilterForIn | FilterForDate;
667
+ export declare type TFilterValue = FilterForString | FilterForEqual | FilterForCompare | FilterForBetween | FilterForIn | FilterForDate;
644
668
 
645
669
  export declare type TFrame = {
646
670
  id: string;
@@ -786,6 +810,7 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
786
810
  id: string;
787
811
  title: string;
788
812
  tabTitle?: string | undefined;
813
+ displayTab?: boolean | undefined;
789
814
  description?: string | undefined;
790
815
  info?: string | undefined;
791
816
  connectionId?: string | undefined;
@@ -919,6 +944,24 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
919
944
  isDynamicText?: boolean | undefined;
920
945
  } | undefined;
921
946
  } | undefined;
947
+ customCardPreferences?: {
948
+ url: string;
949
+ componentName: string;
950
+ type?: "iframe" | "component" | undefined;
951
+ visualType?: "single" | "multiple" | undefined;
952
+ settings?: any;
953
+ dataInputCardIds?: {
954
+ [x: number]: {
955
+ cardId: string;
956
+ };
957
+ } | undefined;
958
+ inputData?: {
959
+ cardId: string;
960
+ data: {
961
+ [x: string]: any;
962
+ }[];
963
+ }[] | undefined;
964
+ } | undefined;
922
965
  lastSelectedDatabase?: string | undefined;
923
966
  lastSelectedDatamodelId?: string | undefined;
924
967
  lastSelectedSchema?: string | undefined;
@@ -973,6 +1016,7 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
973
1016
  id: string;
974
1017
  title: string;
975
1018
  tabTitle?: string | undefined;
1019
+ displayTab?: boolean | undefined;
976
1020
  description?: string | undefined;
977
1021
  info?: string | undefined;
978
1022
  connectionId?: string | undefined;
@@ -1106,6 +1150,24 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
1106
1150
  isDynamicText?: boolean | undefined;
1107
1151
  } | undefined;
1108
1152
  } | undefined;
1153
+ customCardPreferences?: {
1154
+ url: string;
1155
+ componentName: string;
1156
+ type?: "iframe" | "component" | undefined;
1157
+ visualType?: "single" | "multiple" | undefined;
1158
+ settings?: any;
1159
+ dataInputCardIds?: {
1160
+ [x: number]: {
1161
+ cardId: string;
1162
+ };
1163
+ } | undefined;
1164
+ inputData?: {
1165
+ cardId: string;
1166
+ data: {
1167
+ [x: string]: any;
1168
+ }[];
1169
+ }[] | undefined;
1170
+ } | undefined;
1109
1171
  lastSelectedDatabase?: string | undefined;
1110
1172
  lastSelectedDatamodelId?: string | undefined;
1111
1173
  lastSelectedSchema?: string | undefined;
@@ -1119,6 +1181,7 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
1119
1181
  id: string;
1120
1182
  title: string;
1121
1183
  tabTitle?: string | undefined;
1184
+ displayTab?: boolean | undefined;
1122
1185
  description?: string | undefined;
1123
1186
  info?: string | undefined;
1124
1187
  connectionId?: string | undefined;
@@ -1252,6 +1315,24 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
1252
1315
  isDynamicText?: boolean | undefined;
1253
1316
  } | undefined;
1254
1317
  } | undefined;
1318
+ customCardPreferences?: {
1319
+ url: string;
1320
+ componentName: string;
1321
+ type?: "iframe" | "component" | undefined;
1322
+ visualType?: "single" | "multiple" | undefined;
1323
+ settings?: any;
1324
+ dataInputCardIds?: {
1325
+ [x: number]: {
1326
+ cardId: string;
1327
+ };
1328
+ } | undefined;
1329
+ inputData?: {
1330
+ cardId: string;
1331
+ data: {
1332
+ [x: string]: any;
1333
+ }[];
1334
+ }[] | undefined;
1335
+ } | undefined;
1255
1336
  lastSelectedDatabase?: string | undefined;
1256
1337
  lastSelectedDatamodelId?: string | undefined;
1257
1338
  lastSelectedSchema?: string | undefined;
@@ -1420,6 +1501,7 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
1420
1501
  id: string;
1421
1502
  title: string;
1422
1503
  tabTitle?: string | undefined;
1504
+ displayTab?: boolean | undefined;
1423
1505
  description?: string | undefined;
1424
1506
  info?: string | undefined;
1425
1507
  connectionId?: string | undefined;
@@ -1553,6 +1635,24 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
1553
1635
  isDynamicText?: boolean | undefined;
1554
1636
  } | undefined;
1555
1637
  } | undefined;
1638
+ customCardPreferences?: {
1639
+ url: string;
1640
+ componentName: string;
1641
+ type?: "iframe" | "component" | undefined;
1642
+ visualType?: "single" | "multiple" | undefined;
1643
+ settings?: any;
1644
+ dataInputCardIds?: {
1645
+ [x: number]: {
1646
+ cardId: string;
1647
+ };
1648
+ } | undefined;
1649
+ inputData?: {
1650
+ cardId: string;
1651
+ data: {
1652
+ [x: string]: any;
1653
+ }[];
1654
+ }[] | undefined;
1655
+ } | undefined;
1556
1656
  lastSelectedDatabase?: string | undefined;
1557
1657
  lastSelectedDatamodelId?: string | undefined;
1558
1658
  lastSelectedSchema?: string | undefined;
@@ -1616,9 +1716,11 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
1616
1716
  onEvent?: ((event: TEvent) => void) | undefined;
1617
1717
  onSaveFunction?: ((dashboard: TDashboard) => void) | undefined;
1618
1718
  onAddFrame?: ((card: TFrame, sheetId: string) => void) | undefined;
1719
+ onAcceptChanges?: ((frame: TFrame, dashboard: TDashboard) => void) | undefined;
1619
1720
  onUpdateCard?: ((card: TCard, sheetId: string) => void) | undefined;
1620
1721
  onRemoveCard?: ((card: TCard, sheetId: string) => void) | undefined;
1621
1722
  actions: {
1723
+ setInitStore: () => void;
1622
1724
  setGlobalStyle: (style: TStyle) => void;
1623
1725
  setLenses: (lenses: TLens[]) => void;
1624
1726
  setSelectedLensId: (lensId: string) => void;
@@ -1672,6 +1774,7 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
1672
1774
  getStyle: () => TStyle | undefined;
1673
1775
  setOnSaveFunction: (onSaveFunction: (dashboard: TDashboard) => void) => void;
1674
1776
  setOnAddCard: (onAddCard: (card: TCard, sheetId: string) => void) => void;
1777
+ setOnAcceptChanges: (onAcceptChanges: (frame: TFrame, dashboard: TDashboard) => void) => void;
1675
1778
  setOnUpdateCard: (onUpdateCard: (card: TCard, sheetId: string) => void) => void;
1676
1779
  setOnRemoveCard: (onRemoveCard: (card: TCard, sheetId: string) => void) => void;
1677
1780
  setOnEvent: (onEvent: (event: TEvent) => void) => void;
@@ -1738,6 +1841,7 @@ export declare const useEditorStore: UseBoundStore<Omit<StoreApi<EditorStore>, "
1738
1841
  setQueryError: (error: string) => void;
1739
1842
  setRunSql: (runSql: boolean) => void;
1740
1843
  setCardPreferences: (preferences: TCardPreferences) => void;
1844
+ setCustomCardPreferences: (customPreferences: TCustomCardPreferences) => void;
1741
1845
  setFilterOnClickField: (field: string) => void;
1742
1846
  setFilterOnClickColumnIndex: (index: number) => void;
1743
1847
  setIsSqlRunning: (isSqlRunning: boolean) => void;
@@ -1784,6 +1888,7 @@ export declare const useEditorStore: UseBoundStore<Omit<StoreApi<EditorStore>, "
1784
1888
  id: string;
1785
1889
  title: string;
1786
1890
  tabTitle?: string | undefined;
1891
+ displayTab?: boolean | undefined;
1787
1892
  description?: string | undefined;
1788
1893
  info?: string | undefined;
1789
1894
  connectionId?: string | undefined;
@@ -1917,6 +2022,24 @@ export declare const useEditorStore: UseBoundStore<Omit<StoreApi<EditorStore>, "
1917
2022
  isDynamicText?: boolean | undefined;
1918
2023
  } | undefined;
1919
2024
  } | undefined;
2025
+ customCardPreferences?: {
2026
+ url: string;
2027
+ componentName: string;
2028
+ type?: "iframe" | "component" | undefined;
2029
+ visualType?: "single" | "multiple" | undefined;
2030
+ settings?: any;
2031
+ dataInputCardIds?: {
2032
+ [x: number]: {
2033
+ cardId: string;
2034
+ };
2035
+ } | undefined;
2036
+ inputData?: {
2037
+ cardId: string;
2038
+ data: {
2039
+ [x: string]: any;
2040
+ }[];
2041
+ }[] | undefined;
2042
+ } | undefined;
1920
2043
  lastSelectedDatabase?: string | undefined;
1921
2044
  lastSelectedDatamodelId?: string | undefined;
1922
2045
  lastSelectedSchema?: string | undefined;
@@ -1929,6 +2052,7 @@ export declare const useEditorStore: UseBoundStore<Omit<StoreApi<EditorStore>, "
1929
2052
  id: string;
1930
2053
  title: string;
1931
2054
  tabTitle?: string | undefined;
2055
+ displayTab?: boolean | undefined;
1932
2056
  description?: string | undefined;
1933
2057
  info?: string | undefined;
1934
2058
  connectionId?: string | undefined;
@@ -2062,6 +2186,24 @@ export declare const useEditorStore: UseBoundStore<Omit<StoreApi<EditorStore>, "
2062
2186
  isDynamicText?: boolean | undefined;
2063
2187
  } | undefined;
2064
2188
  } | undefined;
2189
+ customCardPreferences?: {
2190
+ url: string;
2191
+ componentName: string;
2192
+ type?: "iframe" | "component" | undefined;
2193
+ visualType?: "single" | "multiple" | undefined;
2194
+ settings?: any;
2195
+ dataInputCardIds?: {
2196
+ [x: number]: {
2197
+ cardId: string;
2198
+ };
2199
+ } | undefined;
2200
+ inputData?: {
2201
+ cardId: string;
2202
+ data: {
2203
+ [x: string]: any;
2204
+ }[];
2205
+ }[] | undefined;
2206
+ } | undefined;
2065
2207
  lastSelectedDatabase?: string | undefined;
2066
2208
  lastSelectedDatamodelId?: string | undefined;
2067
2209
  lastSelectedSchema?: string | undefined;
@@ -71,6 +71,7 @@ declare type DashboardPlusProps = {
71
71
  export declare type DashboardProps = {
72
72
  id?: string;
73
73
  authToken: AuthToken | undefined;
74
+ defaultFilterValues?: TFilterValue[];
74
75
  customStyle?: TStyle;
75
76
  currentTheme?: Theme;
76
77
  version?: string;
@@ -235,6 +236,7 @@ export declare type TCard = {
235
236
  id: string;
236
237
  title: string;
237
238
  tabTitle?: string;
239
+ displayTab?: boolean;
238
240
  description?: string;
239
241
  info?: string;
240
242
  connectionId?: string;
@@ -246,6 +248,7 @@ export declare type TCard = {
246
248
  cfg?: any;
247
249
  customCfg?: any;
248
250
  preferences?: TCardPreferences;
251
+ customCardPreferences?: TCustomCardPreferences;
249
252
  lastSelectedDatabase?: string;
250
253
  lastSelectedDatamodelId?: string;
251
254
  lastSelectedSchema?: string;
@@ -315,6 +318,23 @@ export declare type TColumnSetting<T extends DisplayDataType> = {
315
318
  options: OptionsMap[T];
316
319
  };
317
320
 
321
+ export declare type TCustomCardPreferences = {
322
+ url: string;
323
+ componentName: string;
324
+ type?: 'iframe' | 'component';
325
+ visualType?: 'single' | 'multiple';
326
+ settings?: any;
327
+ dataInputCardIds?: {
328
+ [key: number]: {
329
+ cardId: string;
330
+ };
331
+ };
332
+ inputData?: {
333
+ cardId: string;
334
+ data: Record<string, any>[];
335
+ }[];
336
+ };
337
+
318
338
  export declare type TDashboard = {
319
339
  id: string;
320
340
  title?: string;
@@ -65,6 +65,7 @@ export declare type CustomCard = CardWithContent | CardWithFooter;
65
65
  export declare type DashboardProps = {
66
66
  id?: string;
67
67
  authToken: AuthToken | undefined;
68
+ defaultFilterValues?: TFilterValue[];
68
69
  customStyle?: TStyle;
69
70
  currentTheme?: Theme;
70
71
  version?: string;
@@ -227,6 +228,7 @@ export declare type TCard = {
227
228
  id: string;
228
229
  title: string;
229
230
  tabTitle?: string;
231
+ displayTab?: boolean;
230
232
  description?: string;
231
233
  info?: string;
232
234
  connectionId?: string;
@@ -238,6 +240,7 @@ export declare type TCard = {
238
240
  cfg?: any;
239
241
  customCfg?: any;
240
242
  preferences?: TCardPreferences;
243
+ customCardPreferences?: TCustomCardPreferences;
241
244
  lastSelectedDatabase?: string;
242
245
  lastSelectedDatamodelId?: string;
243
246
  lastSelectedSchema?: string;
@@ -307,6 +310,23 @@ export declare type TColumnSetting<T extends DisplayDataType> = {
307
310
  options: OptionsMap[T];
308
311
  };
309
312
 
313
+ export declare type TCustomCardPreferences = {
314
+ url: string;
315
+ componentName: string;
316
+ type?: 'iframe' | 'component';
317
+ visualType?: 'single' | 'multiple';
318
+ settings?: any;
319
+ dataInputCardIds?: {
320
+ [key: number]: {
321
+ cardId: string;
322
+ };
323
+ };
324
+ inputData?: {
325
+ cardId: string;
326
+ data: Record<string, any>[];
327
+ }[];
328
+ };
329
+
310
330
  export declare type TDashboard = {
311
331
  id: string;
312
332
  title?: string;
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.0.64",
8
+ "version": "0.0.66",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",
@@ -83,7 +83,7 @@
83
83
  "immer": "^10.0.3",
84
84
  "jwt-decode": "^4.0.0",
85
85
  "lodash": "^4.17.21",
86
- "lucide-react": "^0.379.0",
86
+ "lucide-react": "^0.453.0",
87
87
  "ms": "^2.1.3",
88
88
  "next-themes": "^0.3.0",
89
89
  "react": "^18.2.0",