semaphor 0.0.119 → 0.0.121

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,4 @@
1
+ import { ColumnSizingState } from '@tanstack/react-table';
1
2
  import { FontSpec } from 'chart.js';
2
3
  import { JSX as JSX_2 } from 'react/jsx-runtime';
3
4
 
@@ -7,6 +8,7 @@ declare type AggregateFunction = 'COUNT' | 'SUM' | 'AVG' | 'MIN' | 'MAX' | 'MEDI
7
8
 
8
9
  declare type AIContext = {
9
10
  selectedEntities: SelectedEntities;
11
+ fileAttachments?: FileAttachment[];
10
12
  };
11
13
 
12
14
  export declare type AIScopeTable = {
@@ -191,7 +193,10 @@ declare interface ColorRange_2 {
191
193
  declare interface ColumnSettings {
192
194
  type: 'none' | 'text' | 'number' | 'date' | 'badge' | 'link' | 'progress';
193
195
  textAlign: 'left' | 'center' | 'right';
194
- width: string;
196
+ width: number;
197
+ minWidth?: number;
198
+ maxWidth?: number;
199
+ textOverflow?: 'ellipsis' | 'wrap' | 'clip';
195
200
  textWrap: 'wrap' | 'nowrap';
196
201
  numberFormat: {
197
202
  style: 'decimal' | 'currency' | 'percent';
@@ -209,6 +214,8 @@ declare interface ColumnSettings {
209
214
  useCustomFormat: boolean;
210
215
  customFormat: string;
211
216
  useRelativeTime: boolean;
217
+ timezone?: string;
218
+ sourceTimezone?: string;
212
219
  };
213
220
  colorRanges: ColorRange_2[];
214
221
  }
@@ -236,6 +243,33 @@ declare type DashboardPlusProps = {
236
243
  showFooter?: boolean;
237
244
  } & DashboardProps;
238
245
 
246
+ /**
247
+ * Unified dashboard preferences for both card display and UI modes
248
+ */
249
+ export declare type DashboardPreferences = {
250
+ /**
251
+ * Visual display preferences for cards
252
+ * Controls how card content is rendered (headers, footers, etc.)
253
+ */
254
+ cardDisplay?: VisualDisplayPreferences;
255
+ /**
256
+ * UI modes for developer and debug features
257
+ * Controls what developer tools and debug panels are available
258
+ */
259
+ uiMode?: {
260
+ /**
261
+ * Enable developer mode
262
+ * Shows additional controls and debug information
263
+ */
264
+ developer?: boolean;
265
+ /**
266
+ * Enable console mode
267
+ * Shows console panel for debugging
268
+ */
269
+ console?: boolean;
270
+ };
271
+ };
272
+
239
273
  export declare type DashboardProps = {
240
274
  id?: string;
241
275
  /**
@@ -245,10 +279,7 @@ export declare type DashboardProps = {
245
279
  /**
246
280
  * Default filter values for the dashboard. The dashboard will be filtered by these values when the user loads the dashboard.
247
281
  */
248
- defaultFilterValues?: {
249
- filterId: string;
250
- values: string[] | number[];
251
- }[] | TFilterValue[];
282
+ defaultFilterValues?: TFilterValue[];
252
283
  customStyle?: TStyle;
253
284
  currentTheme?: Theme;
254
285
  version?: string;
@@ -269,6 +300,11 @@ export declare type DashboardProps = {
269
300
  * The id of the sheet to be selected when the dashboard is loaded.
270
301
  */
271
302
  selectedSheetId?: string;
303
+ /**
304
+ * Unified preferences for dashboard configuration
305
+ * Includes both card display preferences and UI mode settings
306
+ */
307
+ preferences?: DashboardPreferences;
272
308
  };
273
309
 
274
310
  declare interface DatabaseEntityReference {
@@ -419,6 +455,17 @@ declare interface Field {
419
455
  role?: 'groupby' | 'metric' | 'sortby' | 'pivotby';
420
456
  }
421
457
 
458
+ declare type FileAttachment = {
459
+ id: string;
460
+ name: string;
461
+ size: number;
462
+ type: string;
463
+ data?: string;
464
+ url?: string;
465
+ preview?: string;
466
+ uploadProgress?: number;
467
+ };
468
+
422
469
  declare interface FileEntityReference extends DatabaseEntityReference {
423
470
  id: string;
424
471
  type: 'file' | 'url' | 'upload';
@@ -492,7 +539,7 @@ declare type FilterOnClick = {
492
539
  columnIndex: number;
493
540
  };
494
541
 
495
- declare type FilterValue = string | number | boolean | Date | [number, number] | [string, string] | string[] | number[];
542
+ declare type FilterValue = string | number | boolean | Date | null | [number, number] | [string, string] | string[] | number[];
496
543
 
497
544
  export declare type GetDashboardResponse = {
498
545
  dashboard: TDashboard;
@@ -641,7 +688,7 @@ declare type OldFilterValue = string | number | null | (string | number)[] | Ran
641
688
 
642
689
  declare type Operation = '=' | '>' | '<' | '>=' | '<=' | '!=' | 'in' | 'not in' | 'like' | 'not like' | 'between' | 'not between' | 'is null' | 'is not null';
643
690
 
644
- declare type Operator = '=' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'startsWith' | 'endsWith' | 'in' | 'not in' | 'between';
691
+ declare type Operator = '=' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'startsWith' | 'endsWith' | 'in' | 'not in' | 'between' | 'isNull' | 'isNotNull';
645
692
 
646
693
  declare type OptionsMap = {
647
694
  number: NumberOptions;
@@ -775,6 +822,7 @@ declare type TablePreferences = {
775
822
  columnSettingsMap?: ColumnSettingsMap;
776
823
  selectColumnVisible?: boolean;
777
824
  columnVisibility?: Record<string, boolean>;
825
+ columnSizing?: ColumnSizingState;
778
826
  pageSize?: number;
779
827
  enableDevModePagination?: boolean;
780
828
  };
@@ -813,6 +861,11 @@ export declare type TCard = {
813
861
  lastSelectedSchema?: string;
814
862
  lastSelectedTable?: string;
815
863
  refreshInterval?: string;
864
+ /**
865
+ * Card-specific display preferences that override dashboard-level preferences.
866
+ * If not specified, the card will use the dashboard's display preferences.
867
+ */
868
+ displayPreferences?: VisualDisplayPreferences;
816
869
  };
817
870
 
818
871
  export declare type TCardContext = {
@@ -863,6 +916,7 @@ export declare type TCardPreferences = {
863
916
  kpiVisualOptions?: {
864
917
  lowerIsBetter?: boolean;
865
918
  countryLogoId?: string;
919
+ valueAlignment?: 'left' | 'center';
866
920
  formatOptions?: TFormatOptions;
867
921
  metricComparison?: {
868
922
  enabled?: boolean;
@@ -1110,4 +1164,41 @@ export declare type TStyle = {
1110
1164
  dark?: StyleProps;
1111
1165
  };
1112
1166
 
1167
+ /**
1168
+ * Display mode for visual components - controls which UI elements are shown
1169
+ */
1170
+ export declare type VisualDisplayMode = 'full' | 'content-only' | 'print' | 'embed' | 'paginated';
1171
+
1172
+ /**
1173
+ * Display preferences for controlling visual component rendering
1174
+ */
1175
+ export declare type VisualDisplayPreferences = {
1176
+ /**
1177
+ * Predefined display mode
1178
+ * - 'full': All UI elements (default)
1179
+ * - 'content-only': Just the visualization/table content
1180
+ * - 'print': Optimized for printing (shows title and description, hides interactive elements)
1181
+ * - 'embed': Minimal chrome for embedding in other contexts
1182
+ */
1183
+ mode?: VisualDisplayMode;
1184
+ /**
1185
+ * Override specific UI elements visibility
1186
+ * These overrides take precedence over the mode presets
1187
+ */
1188
+ overrides?: {
1189
+ showHeader?: boolean;
1190
+ showTitle?: boolean;
1191
+ showDescription?: boolean;
1192
+ showTabs?: boolean;
1193
+ showFooter?: boolean;
1194
+ showFilters?: boolean;
1195
+ showBreadcrumbs?: boolean;
1196
+ showRefreshIndicator?: boolean;
1197
+ showFilterInfo?: boolean;
1198
+ showPagination?: boolean;
1199
+ showTableToolbar?: boolean;
1200
+ showColumnSettings?: boolean;
1201
+ };
1202
+ };
1203
+
1113
1204
  export { }
@@ -1,3 +1,4 @@
1
+ import { ColumnSizingState } from '@tanstack/react-table';
1
2
  import { FontSpec } from 'chart.js';
2
3
 
3
4
  export declare type AggregateCalc = 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'COUNT' | 'COUNT_DISTINCT';
@@ -6,6 +7,7 @@ declare type AggregateFunction = 'COUNT' | 'SUM' | 'AVG' | 'MIN' | 'MAX' | 'MEDI
6
7
 
7
8
  declare type AIContext = {
8
9
  selectedEntities: SelectedEntities;
10
+ fileAttachments?: FileAttachment[];
9
11
  };
10
12
 
11
13
  export declare type AIScopeTable = {
@@ -190,7 +192,10 @@ declare interface ColorRange_2 {
190
192
  declare interface ColumnSettings {
191
193
  type: 'none' | 'text' | 'number' | 'date' | 'badge' | 'link' | 'progress';
192
194
  textAlign: 'left' | 'center' | 'right';
193
- width: string;
195
+ width: number;
196
+ minWidth?: number;
197
+ maxWidth?: number;
198
+ textOverflow?: 'ellipsis' | 'wrap' | 'clip';
194
199
  textWrap: 'wrap' | 'nowrap';
195
200
  numberFormat: {
196
201
  style: 'decimal' | 'currency' | 'percent';
@@ -208,6 +213,8 @@ declare interface ColumnSettings {
208
213
  useCustomFormat: boolean;
209
214
  customFormat: string;
210
215
  useRelativeTime: boolean;
216
+ timezone?: string;
217
+ sourceTimezone?: string;
211
218
  };
212
219
  colorRanges: ColorRange_2[];
213
220
  }
@@ -230,6 +237,33 @@ export declare type DashboardEventHandlers = {
230
237
  onExportData?: (payload: ExportDataPayload) => void;
231
238
  };
232
239
 
240
+ /**
241
+ * Unified dashboard preferences for both card display and UI modes
242
+ */
243
+ export declare type DashboardPreferences = {
244
+ /**
245
+ * Visual display preferences for cards
246
+ * Controls how card content is rendered (headers, footers, etc.)
247
+ */
248
+ cardDisplay?: VisualDisplayPreferences;
249
+ /**
250
+ * UI modes for developer and debug features
251
+ * Controls what developer tools and debug panels are available
252
+ */
253
+ uiMode?: {
254
+ /**
255
+ * Enable developer mode
256
+ * Shows additional controls and debug information
257
+ */
258
+ developer?: boolean;
259
+ /**
260
+ * Enable console mode
261
+ * Shows console panel for debugging
262
+ */
263
+ console?: boolean;
264
+ };
265
+ };
266
+
233
267
  export declare type DashboardProps = {
234
268
  id?: string;
235
269
  /**
@@ -239,10 +273,7 @@ export declare type DashboardProps = {
239
273
  /**
240
274
  * Default filter values for the dashboard. The dashboard will be filtered by these values when the user loads the dashboard.
241
275
  */
242
- defaultFilterValues?: {
243
- filterId: string;
244
- values: string[] | number[];
245
- }[] | TFilterValue[];
276
+ defaultFilterValues?: TFilterValue[];
246
277
  customStyle?: TStyle;
247
278
  currentTheme?: Theme;
248
279
  version?: string;
@@ -263,6 +294,11 @@ export declare type DashboardProps = {
263
294
  * The id of the sheet to be selected when the dashboard is loaded.
264
295
  */
265
296
  selectedSheetId?: string;
297
+ /**
298
+ * Unified preferences for dashboard configuration
299
+ * Includes both card display preferences and UI mode settings
300
+ */
301
+ preferences?: DashboardPreferences;
266
302
  };
267
303
 
268
304
  declare interface DatabaseEntityReference {
@@ -413,6 +449,17 @@ declare interface Field {
413
449
  role?: 'groupby' | 'metric' | 'sortby' | 'pivotby';
414
450
  }
415
451
 
452
+ declare type FileAttachment = {
453
+ id: string;
454
+ name: string;
455
+ size: number;
456
+ type: string;
457
+ data?: string;
458
+ url?: string;
459
+ preview?: string;
460
+ uploadProgress?: number;
461
+ };
462
+
416
463
  declare interface FileEntityReference extends DatabaseEntityReference {
417
464
  id: string;
418
465
  type: 'file' | 'url' | 'upload';
@@ -486,7 +533,7 @@ declare type FilterOnClick = {
486
533
  columnIndex: number;
487
534
  };
488
535
 
489
- declare type FilterValue = string | number | boolean | Date | [number, number] | [string, string] | string[] | number[];
536
+ declare type FilterValue = string | number | boolean | Date | null | [number, number] | [string, string] | string[] | number[];
490
537
 
491
538
  export declare type GetDashboardResponse = {
492
539
  dashboard: TDashboard;
@@ -635,7 +682,7 @@ declare type OldFilterValue = string | number | null | (string | number)[] | Ran
635
682
 
636
683
  declare type Operation = '=' | '>' | '<' | '>=' | '<=' | '!=' | 'in' | 'not in' | 'like' | 'not like' | 'between' | 'not between' | 'is null' | 'is not null';
637
684
 
638
- declare type Operator = '=' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'startsWith' | 'endsWith' | 'in' | 'not in' | 'between';
685
+ declare type Operator = '=' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'startsWith' | 'endsWith' | 'in' | 'not in' | 'between' | 'isNull' | 'isNotNull';
639
686
 
640
687
  declare type OptionsMap = {
641
688
  number: NumberOptions;
@@ -767,6 +814,7 @@ declare type TablePreferences = {
767
814
  columnSettingsMap?: ColumnSettingsMap;
768
815
  selectColumnVisible?: boolean;
769
816
  columnVisibility?: Record<string, boolean>;
817
+ columnSizing?: ColumnSizingState;
770
818
  pageSize?: number;
771
819
  enableDevModePagination?: boolean;
772
820
  };
@@ -805,6 +853,11 @@ export declare type TCard = {
805
853
  lastSelectedSchema?: string;
806
854
  lastSelectedTable?: string;
807
855
  refreshInterval?: string;
856
+ /**
857
+ * Card-specific display preferences that override dashboard-level preferences.
858
+ * If not specified, the card will use the dashboard's display preferences.
859
+ */
860
+ displayPreferences?: VisualDisplayPreferences;
808
861
  };
809
862
 
810
863
  export declare type TCardContext = {
@@ -855,6 +908,7 @@ export declare type TCardPreferences = {
855
908
  kpiVisualOptions?: {
856
909
  lowerIsBetter?: boolean;
857
910
  countryLogoId?: string;
911
+ valueAlignment?: 'left' | 'center';
858
912
  formatOptions?: TFormatOptions;
859
913
  metricComparison?: {
860
914
  enabled?: boolean;
@@ -1102,4 +1156,41 @@ export declare type TStyle = {
1102
1156
  dark?: StyleProps;
1103
1157
  };
1104
1158
 
1159
+ /**
1160
+ * Display mode for visual components - controls which UI elements are shown
1161
+ */
1162
+ export declare type VisualDisplayMode = 'full' | 'content-only' | 'print' | 'embed' | 'paginated';
1163
+
1164
+ /**
1165
+ * Display preferences for controlling visual component rendering
1166
+ */
1167
+ export declare type VisualDisplayPreferences = {
1168
+ /**
1169
+ * Predefined display mode
1170
+ * - 'full': All UI elements (default)
1171
+ * - 'content-only': Just the visualization/table content
1172
+ * - 'print': Optimized for printing (shows title and description, hides interactive elements)
1173
+ * - 'embed': Minimal chrome for embedding in other contexts
1174
+ */
1175
+ mode?: VisualDisplayMode;
1176
+ /**
1177
+ * Override specific UI elements visibility
1178
+ * These overrides take precedence over the mode presets
1179
+ */
1180
+ overrides?: {
1181
+ showHeader?: boolean;
1182
+ showTitle?: boolean;
1183
+ showDescription?: boolean;
1184
+ showTabs?: boolean;
1185
+ showFooter?: boolean;
1186
+ showFilters?: boolean;
1187
+ showBreadcrumbs?: boolean;
1188
+ showRefreshIndicator?: boolean;
1189
+ showFilterInfo?: boolean;
1190
+ showPagination?: boolean;
1191
+ showTableToolbar?: boolean;
1192
+ showColumnSettings?: boolean;
1193
+ };
1194
+ };
1195
+
1105
1196
  export { }
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.0.119",
8
+ "version": "0.0.121",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",
@@ -46,7 +46,7 @@
46
46
  "preview": "vite preview"
47
47
  },
48
48
  "dependencies": {
49
- "@ai-sdk/react": "^1.1.18",
49
+ "@ai-sdk/react": "^2.0.7",
50
50
  "@dnd-kit/core": "^6.3.1",
51
51
  "@dnd-kit/sortable": "^10.0.0",
52
52
  "@dnd-kit/utilities": "^3.2.2",
@@ -71,7 +71,7 @@
71
71
  "@radix-ui/react-select": "^2.1.4",
72
72
  "@radix-ui/react-separator": "^1.1.1",
73
73
  "@radix-ui/react-slider": "^1.3.5",
74
- "@radix-ui/react-slot": "^1.2.2",
74
+ "@radix-ui/react-slot": "^1.2.3",
75
75
  "@radix-ui/react-switch": "^1.1.2",
76
76
  "@radix-ui/react-tabs": "^1.1.2",
77
77
  "@radix-ui/react-toggle": "^1.1.1",
@@ -79,7 +79,7 @@
79
79
  "@tailwindcss/container-queries": "^0.1.1",
80
80
  "@tanstack/react-query": "^5.62.15",
81
81
  "@tanstack/react-table": "^8.11.7",
82
- "ai": "^4.1.46",
82
+ "ai": "^5.0.7",
83
83
  "chart.js": "^4.4.1",
84
84
  "chartjs-chart-funnel": "^4.2.4",
85
85
  "chartjs-chart-geo": "^4.3.4",
@@ -87,7 +87,8 @@
87
87
  "class-variance-authority": "^0.7.0",
88
88
  "clsx": "^2.0.0",
89
89
  "cmdk": "^1.1.1",
90
- "date-fns": "^3.3.1",
90
+ "date-fns": "^3.6.0",
91
+ "date-fns-tz": "^3.2.0",
91
92
  "immer": "^10.0.3",
92
93
  "jwt-decode": "^4.0.0",
93
94
  "lodash.merge": "^4.6.2",
@@ -95,7 +96,7 @@
95
96
  "ms": "^2.1.3",
96
97
  "next-themes": "^0.4.4",
97
98
  "prism-react-renderer": "^2.4.1",
98
- "react-day-picker": "^8.10.0",
99
+ "react-day-picker": "^9.9.0",
99
100
  "react-error-boundary": "^4.1.2",
100
101
  "react-grid-layout": "^1.5.0",
101
102
  "react-icons": "^5.0.1",