semaphor 0.0.77 → 0.0.79

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,5 +1,5 @@
1
- import { D as i } from "../chunks/dashboard-plus-5B6hJeBZ.js";
2
- import "../chunks/index-MEy4VWWZ.js";
1
+ import { D as i } from "../chunks/index-xD7LZFEm.js";
2
+ import "../chunks/index-7j85QQRg.js";
3
3
  import "react";
4
4
  import "react-dom";
5
5
  export {
@@ -209,7 +209,7 @@ declare type StringOptions = {
209
209
  */
210
210
  export declare type StyleProps = {
211
211
  /** Theme for dashboard background */
212
- canvasTheme?: 'clear' | 'muted';
212
+ canvasTheme?: 'clear' | 'muted' | string;
213
213
  /** css class for `dashboard-panel` */
214
214
  dashboardPanel?: string;
215
215
  /** css class for `dashboard-tabs-container` */
@@ -300,6 +300,16 @@ export declare type TCardPreferences = {
300
300
  textVisualOptions?: {
301
301
  isDynamicText?: boolean;
302
302
  };
303
+ mapVisualOptions?: {
304
+ topoJsonUrl?: string;
305
+ objectKey?: string;
306
+ outlineKey?: string;
307
+ customTopoJsonUrl?: string;
308
+ projection?: string;
309
+ projectionScale?: number;
310
+ projectionOffset?: [number, number];
311
+ colorScale?: string;
312
+ };
303
313
  };
304
314
 
305
315
  export declare type TChartOptions = {
@@ -325,7 +335,7 @@ export declare type TChartOptions = {
325
335
  indexAxis?: 'x' | 'y' | undefined;
326
336
  };
327
337
 
328
- declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'kpi' | 'pyramid' | 'range' | 'text' | 'custom';
338
+ declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'kpi' | 'pyramid' | 'range' | 'text' | 'map' | 'custom';
329
339
 
330
340
  export declare type TColumnSetting<T extends DisplayDataType> = {
331
341
  columnIdx: number;
@@ -4,11 +4,12 @@ import { ChartConfiguration } from 'chart.js';
4
4
  import { ChartTypeRegistry } from 'chart.js';
5
5
  import { FC } from 'react';
6
6
  import { FontSpec } from 'chart.js';
7
+ import { IBubbleMapDataPoint } from 'chartjs-chart-geo';
8
+ import { IChoroplethDataPoint } from 'chartjs-chart-geo';
7
9
  import { JSX as JSX_2 } from 'react/jsx-runtime';
8
10
  import { Layout } from 'react-grid-layout';
9
11
  import { Layouts } from 'react-grid-layout';
10
12
  import { Point } from 'chart.js';
11
- import { default as React_2 } from 'react';
12
13
  import { default as ReactGridLayout_2 } from 'react-grid-layout';
13
14
  import { StoreApi } from 'zustand';
14
15
  import { UseBoundStore } from 'zustand';
@@ -45,7 +46,6 @@ declare type Actions = {
45
46
  setCardSql: (sheetId: string, cardId: string, sql: string) => void;
46
47
  setCardPython: (cardId: string, pythonCode: string) => void;
47
48
  setCardDescription: (sheetId: string, cardId: string, description: string) => void;
48
- setFrameCardData: (sheetId: string, cardId: string, data: any[]) => void;
49
49
  addFrame: (sheetId: string, frame: TFrame, position?: 'start' | 'end') => void;
50
50
  updateFrame: (sheetId: string, frame: TFrame) => void;
51
51
  updateCard: (sheetId: string, card: TCard) => void;
@@ -113,7 +113,6 @@ declare type Actions_2 = {
113
113
  setCardSql: (sql: string) => void;
114
114
  setCardPython: (python: string) => void;
115
115
  setPythonStdOut: (pythonStdOut: string) => void;
116
- setCardData: (data: any[]) => void;
117
116
  setCardCustomCfg: (cfg: any) => void;
118
117
  setCardCfg: (cfg: any) => void;
119
118
  setShowFilters: (showFilters: boolean) => void;
@@ -208,15 +207,6 @@ export declare type CustomCard = CardWithContent | CardWithFooter;
208
207
 
209
208
  export declare function Dashboard(props: DashboardProps): JSX_2.Element;
210
209
 
211
- export declare function DashboardCard({ card, footer, className, ...props }: DashboardCardProps): JSX_2.Element | null;
212
-
213
- declare type DashboardCardProps = {
214
- card: TCard;
215
- footer?: React_2.ReactNode;
216
- showControls?: boolean;
217
- fetchCardData?: boolean;
218
- } & React_2.HTMLAttributes<HTMLDivElement>;
219
-
220
210
  declare type DashboardPlusProps = {
221
211
  showControls?: boolean;
222
212
  showFooter?: boolean;
@@ -489,7 +479,7 @@ declare type StringOptions = {
489
479
  */
490
480
  export declare type StyleProps = {
491
481
  /** Theme for dashboard background */
492
- canvasTheme?: 'clear' | 'muted';
482
+ canvasTheme?: 'clear' | 'muted' | string;
493
483
  /** css class for `dashboard-panel` */
494
484
  dashboardPanel?: string;
495
485
  /** css class for `dashboard-tabs-container` */
@@ -582,6 +572,16 @@ export declare type TCardPreferences = {
582
572
  textVisualOptions?: {
583
573
  isDynamicText?: boolean;
584
574
  };
575
+ mapVisualOptions?: {
576
+ topoJsonUrl?: string;
577
+ objectKey?: string;
578
+ outlineKey?: string;
579
+ customTopoJsonUrl?: string;
580
+ projection?: string;
581
+ projectionScale?: number;
582
+ projectionOffset?: [number, number];
583
+ colorScale?: string;
584
+ };
585
585
  };
586
586
 
587
587
  declare type TChartConfiguration = ChartConfiguration;
@@ -609,7 +609,7 @@ export declare type TChartOptions = {
609
609
  indexAxis?: 'x' | 'y' | undefined;
610
610
  };
611
611
 
612
- declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'kpi' | 'pyramid' | 'range' | 'text' | 'custom';
612
+ declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'kpi' | 'pyramid' | 'range' | 'text' | 'map' | 'custom';
613
613
 
614
614
  export declare type TColumnSetting<T extends DisplayDataType> = {
615
615
  columnIdx: number;
@@ -738,7 +738,7 @@ export declare function useCard(cardId: string): {
738
738
  isLoading: boolean;
739
739
  isFetching: boolean;
740
740
  visualKey: number;
741
- handleDatapointClick: (chart: Chart<keyof ChartTypeRegistry, (number | [number, number] | Point | BubbleDataPoint | null)[], unknown>, datasetIndex: number, clickIndex: number, value: number) => void;
741
+ handleDatapointClick: (chart: Chart<keyof ChartTypeRegistry, (number | [number, number] | Point | BubbleDataPoint | IChoroplethDataPoint | IBubbleMapDataPoint | null)[], unknown>, datasetIndex: number, clickIndex: number, value: number) => void;
742
742
  cfg: TChartConfiguration | undefined;
743
743
  };
744
744
 
@@ -754,7 +754,7 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
754
754
  currentBreakpoint: Breakpoint;
755
755
  theme?: "dark" | "light" | "system" | undefined;
756
756
  themeStyle?: {
757
- canvasTheme?: "clear" | "muted" | undefined;
757
+ canvasTheme?: string | undefined;
758
758
  dashboardPanel?: string | undefined;
759
759
  dashboardTabsContainer?: string | undefined;
760
760
  dashboardCardContainer?: string | undefined;
@@ -975,6 +975,16 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
975
975
  textVisualOptions?: {
976
976
  isDynamicText?: boolean | undefined;
977
977
  } | undefined;
978
+ mapVisualOptions?: {
979
+ topoJsonUrl?: string | undefined;
980
+ objectKey?: string | undefined;
981
+ outlineKey?: string | undefined;
982
+ customTopoJsonUrl?: string | undefined;
983
+ projection?: string | undefined;
984
+ projectionScale?: number | undefined;
985
+ projectionOffset?: [number, number] | undefined;
986
+ colorScale?: string | undefined;
987
+ } | undefined;
978
988
  } | undefined;
979
989
  customCardPreferences?: {
980
990
  showCardHeader?: boolean | undefined;
@@ -1186,6 +1196,16 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
1186
1196
  textVisualOptions?: {
1187
1197
  isDynamicText?: boolean | undefined;
1188
1198
  } | undefined;
1199
+ mapVisualOptions?: {
1200
+ topoJsonUrl?: string | undefined;
1201
+ objectKey?: string | undefined;
1202
+ outlineKey?: string | undefined;
1203
+ customTopoJsonUrl?: string | undefined;
1204
+ projection?: string | undefined;
1205
+ projectionScale?: number | undefined;
1206
+ projectionOffset?: [number, number] | undefined;
1207
+ colorScale?: string | undefined;
1208
+ } | undefined;
1189
1209
  } | undefined;
1190
1210
  customCardPreferences?: {
1191
1211
  showCardHeader?: boolean | undefined;
@@ -1356,6 +1376,16 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
1356
1376
  textVisualOptions?: {
1357
1377
  isDynamicText?: boolean | undefined;
1358
1378
  } | undefined;
1379
+ mapVisualOptions?: {
1380
+ topoJsonUrl?: string | undefined;
1381
+ objectKey?: string | undefined;
1382
+ outlineKey?: string | undefined;
1383
+ customTopoJsonUrl?: string | undefined;
1384
+ projection?: string | undefined;
1385
+ projectionScale?: number | undefined;
1386
+ projectionOffset?: [number, number] | undefined;
1387
+ colorScale?: string | undefined;
1388
+ } | undefined;
1359
1389
  } | undefined;
1360
1390
  customCardPreferences?: {
1361
1391
  showCardHeader?: boolean | undefined;
@@ -1388,7 +1418,7 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
1388
1418
  }[] | undefined;
1389
1419
  style?: {
1390
1420
  default: {
1391
- canvasTheme?: "clear" | "muted" | undefined;
1421
+ canvasTheme?: string | undefined;
1392
1422
  dashboardPanel?: string | undefined;
1393
1423
  dashboardTabsContainer?: string | undefined;
1394
1424
  dashboardCardContainer?: string | undefined;
@@ -1413,7 +1443,7 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
1413
1443
  } | undefined;
1414
1444
  };
1415
1445
  dark?: {
1416
- canvasTheme?: "clear" | "muted" | undefined;
1446
+ canvasTheme?: string | undefined;
1417
1447
  dashboardPanel?: string | undefined;
1418
1448
  dashboardTabsContainer?: string | undefined;
1419
1449
  dashboardCardContainer?: string | undefined;
@@ -1488,7 +1518,7 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
1488
1518
  }[] | undefined;
1489
1519
  globalStyle?: {
1490
1520
  default: {
1491
- canvasTheme?: "clear" | "muted" | undefined;
1521
+ canvasTheme?: string | undefined;
1492
1522
  dashboardPanel?: string | undefined;
1493
1523
  dashboardTabsContainer?: string | undefined;
1494
1524
  dashboardCardContainer?: string | undefined;
@@ -1513,7 +1543,7 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
1513
1543
  } | undefined;
1514
1544
  };
1515
1545
  dark?: {
1516
- canvasTheme?: "clear" | "muted" | undefined;
1546
+ canvasTheme?: string | undefined;
1517
1547
  dashboardPanel?: string | undefined;
1518
1548
  dashboardTabsContainer?: string | undefined;
1519
1549
  dashboardCardContainer?: string | undefined;
@@ -1686,6 +1716,16 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
1686
1716
  textVisualOptions?: {
1687
1717
  isDynamicText?: boolean | undefined;
1688
1718
  } | undefined;
1719
+ mapVisualOptions?: {
1720
+ topoJsonUrl?: string | undefined;
1721
+ objectKey?: string | undefined;
1722
+ outlineKey?: string | undefined;
1723
+ customTopoJsonUrl?: string | undefined;
1724
+ projection?: string | undefined;
1725
+ projectionScale?: number | undefined;
1726
+ projectionOffset?: [number, number] | undefined;
1727
+ colorScale?: string | undefined;
1728
+ } | undefined;
1689
1729
  } | undefined;
1690
1730
  customCardPreferences?: {
1691
1731
  showCardHeader?: boolean | undefined;
@@ -1805,7 +1845,6 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
1805
1845
  setCardSql: (sheetId: string, cardId: string, sql: string) => void;
1806
1846
  setCardPython: (cardId: string, pythonCode: string) => void;
1807
1847
  setCardDescription: (sheetId: string, cardId: string, description: string) => void;
1808
- setFrameCardData: (sheetId: string, cardId: string, data: any[]) => void;
1809
1848
  addFrame: (sheetId: string, frame: TFrame, position?: 'start' | 'end') => void;
1810
1849
  updateFrame: (sheetId: string, frame: TFrame) => void;
1811
1850
  updateCard: (sheetId: string, card: TCard) => void;
@@ -1911,7 +1950,6 @@ export declare const useEditorStore: UseBoundStore<Omit<StoreApi<EditorStore>, "
1911
1950
  setCardSql: (sql: string) => void;
1912
1951
  setCardPython: (python: string) => void;
1913
1952
  setPythonStdOut: (pythonStdOut: string) => void;
1914
- setCardData: (data: any[]) => void;
1915
1953
  setCardCustomCfg: (cfg: any) => void;
1916
1954
  setCardCfg: (cfg: any) => void;
1917
1955
  setShowFilters: (showFilters: boolean) => void;
@@ -2080,6 +2118,16 @@ export declare const useEditorStore: UseBoundStore<Omit<StoreApi<EditorStore>, "
2080
2118
  textVisualOptions?: {
2081
2119
  isDynamicText?: boolean | undefined;
2082
2120
  } | undefined;
2121
+ mapVisualOptions?: {
2122
+ topoJsonUrl?: string | undefined;
2123
+ objectKey?: string | undefined;
2124
+ outlineKey?: string | undefined;
2125
+ customTopoJsonUrl?: string | undefined;
2126
+ projection?: string | undefined;
2127
+ projectionScale?: number | undefined;
2128
+ projectionOffset?: [number, number] | undefined;
2129
+ colorScale?: string | undefined;
2130
+ } | undefined;
2083
2131
  } | undefined;
2084
2132
  customCardPreferences?: {
2085
2133
  showCardHeader?: boolean | undefined;
@@ -2249,6 +2297,16 @@ export declare const useEditorStore: UseBoundStore<Omit<StoreApi<EditorStore>, "
2249
2297
  textVisualOptions?: {
2250
2298
  isDynamicText?: boolean | undefined;
2251
2299
  } | undefined;
2300
+ mapVisualOptions?: {
2301
+ topoJsonUrl?: string | undefined;
2302
+ objectKey?: string | undefined;
2303
+ outlineKey?: string | undefined;
2304
+ customTopoJsonUrl?: string | undefined;
2305
+ projection?: string | undefined;
2306
+ projectionScale?: number | undefined;
2307
+ projectionOffset?: [number, number] | undefined;
2308
+ colorScale?: string | undefined;
2309
+ } | undefined;
2252
2310
  } | undefined;
2253
2311
  customCardPreferences?: {
2254
2312
  showCardHeader?: boolean | undefined;
@@ -212,7 +212,7 @@ declare type StringOptions = {
212
212
  */
213
213
  export declare type StyleProps = {
214
214
  /** Theme for dashboard background */
215
- canvasTheme?: 'clear' | 'muted';
215
+ canvasTheme?: 'clear' | 'muted' | string;
216
216
  /** css class for `dashboard-panel` */
217
217
  dashboardPanel?: string;
218
218
  /** css class for `dashboard-tabs-container` */
@@ -305,6 +305,16 @@ export declare type TCardPreferences = {
305
305
  textVisualOptions?: {
306
306
  isDynamicText?: boolean;
307
307
  };
308
+ mapVisualOptions?: {
309
+ topoJsonUrl?: string;
310
+ objectKey?: string;
311
+ outlineKey?: string;
312
+ customTopoJsonUrl?: string;
313
+ projection?: string;
314
+ projectionScale?: number;
315
+ projectionOffset?: [number, number];
316
+ colorScale?: string;
317
+ };
308
318
  };
309
319
 
310
320
  export declare type TChartOptions = {
@@ -330,7 +340,7 @@ export declare type TChartOptions = {
330
340
  indexAxis?: 'x' | 'y' | undefined;
331
341
  };
332
342
 
333
- declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'kpi' | 'pyramid' | 'range' | 'text' | 'custom';
343
+ declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'kpi' | 'pyramid' | 'range' | 'text' | 'map' | 'custom';
334
344
 
335
345
  export declare type TColumnSetting<T extends DisplayDataType> = {
336
346
  columnIdx: number;
@@ -206,7 +206,7 @@ declare type StringOptions = {
206
206
  */
207
207
  export declare type StyleProps = {
208
208
  /** Theme for dashboard background */
209
- canvasTheme?: 'clear' | 'muted';
209
+ canvasTheme?: 'clear' | 'muted' | string;
210
210
  /** css class for `dashboard-panel` */
211
211
  dashboardPanel?: string;
212
212
  /** css class for `dashboard-tabs-container` */
@@ -297,6 +297,16 @@ export declare type TCardPreferences = {
297
297
  textVisualOptions?: {
298
298
  isDynamicText?: boolean;
299
299
  };
300
+ mapVisualOptions?: {
301
+ topoJsonUrl?: string;
302
+ objectKey?: string;
303
+ outlineKey?: string;
304
+ customTopoJsonUrl?: string;
305
+ projection?: string;
306
+ projectionScale?: number;
307
+ projectionOffset?: [number, number];
308
+ colorScale?: string;
309
+ };
300
310
  };
301
311
 
302
312
  export declare type TChartOptions = {
@@ -322,7 +332,7 @@ export declare type TChartOptions = {
322
332
  indexAxis?: 'x' | 'y' | undefined;
323
333
  };
324
334
 
325
- declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'kpi' | 'pyramid' | 'range' | 'text' | 'custom';
335
+ declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'kpi' | 'pyramid' | 'range' | 'text' | 'map' | 'custom';
326
336
 
327
337
  export declare type TColumnSetting<T extends DisplayDataType> = {
328
338
  columnIdx: number;
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.0.77",
8
+ "version": "0.0.79",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",
@@ -69,10 +69,11 @@
69
69
  "@radix-ui/react-toggle": "^1.0.3",
70
70
  "@radix-ui/react-tooltip": "^1.0.7",
71
71
  "@tailwindcss/container-queries": "^0.1.1",
72
- "@tanstack/react-query": "^5.15.0",
72
+ "@tanstack/react-query": "^5.62.15",
73
73
  "@tanstack/react-table": "^8.11.7",
74
74
  "ai": "^3.3.0",
75
75
  "chart.js": "^4.4.1",
76
+ "chartjs-chart-geo": "^4.3.4",
76
77
  "chartjs-plugin-datalabels": "^2.2.0",
77
78
  "class-variance-authority": "^0.7.0",
78
79
  "clsx": "^2.0.0",
@@ -103,7 +104,7 @@
103
104
  },
104
105
  "devDependencies": {
105
106
  "@microsoft/api-extractor": "^7.47.0",
106
- "@tanstack/react-query-devtools": "^5.17.21",
107
+ "@tanstack/react-query-devtools": "^5.62.15",
107
108
  "@types/chart.js": "^2.9.41",
108
109
  "@types/dompurify": "^3.0.5",
109
110
  "@types/jsoneditor": "^9.9.5",