semaphor 0.0.28 → 0.0.30

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.
@@ -10,12 +10,14 @@ import { FC } from 'react';
10
10
  import { FontSpec } from 'chart.js';
11
11
  import { JSX as JSX_2 } from 'react/jsx-runtime';
12
12
  import { Layout } from 'react-grid-layout';
13
+ import { Layouts } from 'react-grid-layout';
13
14
  import { Point } from 'chart.js';
14
- import { default as React_2 } from 'react';
15
+ import { default as ReactGridLayout_2 } from 'react-grid-layout';
15
16
  import { StoreApi } from 'zustand';
16
17
  import { UseBoundStore } from 'zustand';
17
18
 
18
19
  declare type Actions = {
20
+ setCurrentBreakpoint: (breakpoint: Breakpoint) => void;
19
21
  addFilteringCard: (card: TCard) => void;
20
22
  removeFilteringCard: (card: TCard) => void;
21
23
  setCustomCards: (customCards: CustomCard[]) => void;
@@ -26,10 +28,12 @@ declare type Actions = {
26
28
  setDashboardTheme: (theme: 'light' | 'dark' | 'system') => void;
27
29
  setSheets: (sheets: TSheet[]) => void;
28
30
  setSelectedSheetId: (sheetId: string | null) => void;
29
- setSheetLayout: (sheetId: string, layout: ReactGridLayout.Layout[]) => void;
31
+ setSheetLayout: (sheetId: string, layout: ReactGridLayout_2.Layout[]) => void;
32
+ setSheetLayouts: (sheetId: string, layouts: ReactGridLayout_2.Layouts) => void;
30
33
  setSelectedCardId: (sheetId: string, cardId: string | null) => void;
31
34
  setSelectedFrameId: (frameId: string) => void;
32
35
  setCardTitle: (sheetId: string, cardId: string, title: string) => void;
36
+ setCardInfo: (cardId: string, info: string) => void;
33
37
  setCardSql: (sheetId: string, cardId: string, sql: string) => void;
34
38
  setCardDescription: (sheetId: string, cardId: string, description: string) => void;
35
39
  setFrameCardData: (sheetId: string, cardId: string, data: any[]) => void;
@@ -62,7 +66,8 @@ declare type Actions = {
62
66
  getSelectedSheet: () => TSheet | undefined;
63
67
  getCard: (cardId: string) => TCard | undefined;
64
68
  getSelectedFrame: () => TFrame | undefined;
65
- getSelectedSheetLayout: () => ReactGridLayout.Layout[] | undefined;
69
+ getSelectedSheetLayout: () => ReactGridLayout_2.Layout[] | undefined;
70
+ getSelectedSheetLayouts: () => ReactGridLayout_2.Layouts | undefined;
66
71
  handleDataPointClickAction: (card: TCard, dataPoint: any) => void;
67
72
  };
68
73
 
@@ -129,6 +134,8 @@ export declare type Bookmark = {
129
134
 
130
135
  export declare const BOOLEAN_DATA_TYPES: string[];
131
136
 
137
+ export declare type Breakpoint = 'lg' | 'md' | 'sm' | 'xs' | 'xxs';
138
+
132
139
  declare type CardWithContent = BaseCustomCard & {
133
140
  content: React.FC<{
134
141
  card: TCard;
@@ -161,15 +168,6 @@ export declare type CustomCard = CardWithContent | CardWithFooter;
161
168
 
162
169
  export declare function Dashboard(props: DashboardProps): JSX_2.Element;
163
170
 
164
- export declare function DashboardCard({ card, footer, className, ...props }: DashboardCardProps): JSX_2.Element | null;
165
-
166
- declare type DashboardCardProps = {
167
- card: TCard;
168
- footer?: React_2.ReactNode;
169
- showControls?: boolean;
170
- fetchCardData?: boolean;
171
- } & React_2.HTMLAttributes<HTMLDivElement>;
172
-
173
171
  export declare function DashboardPlus({ showControls, showFooter, ...rest }: DashboardPlusProps): JSX_2.Element;
174
172
 
175
173
  declare type DashboardPlusProps = {
@@ -197,6 +195,7 @@ export declare function DashboardProvider({ children }: {
197
195
 
198
196
  export declare type DashboardStore = {
199
197
  authToken?: AuthToken;
198
+ currentBreakpoint: Breakpoint;
200
199
  theme?: 'light' | 'dark' | 'system';
201
200
  themeStyle?: StyleProps;
202
201
  filteringCards?: TCard[];
@@ -299,6 +298,7 @@ export declare function getDashbaordStateWithoutData(dashboardState: TDashboard)
299
298
  title?: string | undefined;
300
299
  description?: string | undefined;
301
300
  layout?: Layout[] | undefined;
301
+ layouts?: Layouts | undefined;
302
302
  cards?: TCard[] | undefined;
303
303
  }[] | undefined;
304
304
  id: string;
@@ -389,6 +389,7 @@ export declare type TCard = {
389
389
  id: string;
390
390
  title: string;
391
391
  description?: string;
392
+ info?: string;
392
393
  connectionId?: string;
393
394
  type: TChartType;
394
395
  sql?: string;
@@ -472,6 +473,7 @@ export declare type TSheet = {
472
473
  title?: string;
473
474
  description?: string;
474
475
  layout?: ReactGridLayout.Layout[];
476
+ layouts?: ReactGridLayout.Layouts;
475
477
  cards?: TCard[];
476
478
  frames?: TFrame[];
477
479
  };
@@ -528,6 +530,7 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
528
530
  accessToken: string;
529
531
  refreshToken: string;
530
532
  } | undefined;
533
+ currentBreakpoint: Breakpoint;
531
534
  theme?: "light" | "dark" | "system" | undefined;
532
535
  themeStyle?: {
533
536
  dashboardPanel?: string | undefined;
@@ -554,6 +557,7 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
554
557
  id: string;
555
558
  title: string;
556
559
  description?: string | undefined;
560
+ info?: string | undefined;
557
561
  connectionId?: string | undefined;
558
562
  type: TChartType;
559
563
  sql?: string | undefined;
@@ -602,10 +606,30 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
602
606
  resizeHandles?: ("s" | "w" | "e" | "n" | "sw" | "nw" | "se" | "ne")[] | undefined;
603
607
  isBounded?: boolean | undefined;
604
608
  }[] | undefined;
609
+ layouts?: {
610
+ [x: string]: {
611
+ i: string;
612
+ x: number;
613
+ y: number;
614
+ w: number;
615
+ h: number;
616
+ minW?: number | undefined;
617
+ maxW?: number | undefined;
618
+ minH?: number | undefined;
619
+ maxH?: number | undefined;
620
+ moved?: boolean | undefined;
621
+ static?: boolean | undefined;
622
+ isDraggable?: boolean | undefined;
623
+ isResizable?: boolean | undefined;
624
+ resizeHandles?: ("s" | "w" | "e" | "n" | "sw" | "nw" | "se" | "ne")[] | undefined;
625
+ isBounded?: boolean | undefined;
626
+ }[];
627
+ } | undefined;
605
628
  cards?: {
606
629
  id: string;
607
630
  title: string;
608
631
  description?: string | undefined;
632
+ info?: string | undefined;
609
633
  connectionId?: string | undefined;
610
634
  type: TChartType;
611
635
  sql?: string | undefined;
@@ -634,6 +658,7 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
634
658
  id: string;
635
659
  title: string;
636
660
  description?: string | undefined;
661
+ info?: string | undefined;
637
662
  connectionId?: string | undefined;
638
663
  type: TChartType;
639
664
  sql?: string | undefined;
@@ -740,6 +765,7 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
740
765
  id: string;
741
766
  title: string;
742
767
  description?: string | undefined;
768
+ info?: string | undefined;
743
769
  connectionId?: string | undefined;
744
770
  type: TChartType;
745
771
  sql?: string | undefined;
@@ -822,6 +848,7 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
822
848
  onUpdateCard?: ((card: TCard, sheetId: string) => void) | undefined;
823
849
  onRemoveCard?: ((card: TCard, sheetId: string) => void) | undefined;
824
850
  actions: {
851
+ setCurrentBreakpoint: (breakpoint: Breakpoint) => void;
825
852
  addFilteringCard: (card: TCard) => void;
826
853
  removeFilteringCard: (card: TCard) => void;
827
854
  setCustomCards: (customCards: CustomCard[]) => void;
@@ -832,10 +859,12 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
832
859
  setDashboardTheme: (theme: 'light' | 'dark' | 'system') => void;
833
860
  setSheets: (sheets: TSheet[]) => void;
834
861
  setSelectedSheetId: (sheetId: string | null) => void;
835
- setSheetLayout: (sheetId: string, layout: ReactGridLayout.Layout[]) => void;
862
+ setSheetLayout: (sheetId: string, layout: ReactGridLayout_2.Layout[]) => void;
863
+ setSheetLayouts: (sheetId: string, layouts: ReactGridLayout_2.Layouts) => void;
836
864
  setSelectedCardId: (sheetId: string, cardId: string | null) => void;
837
865
  setSelectedFrameId: (frameId: string) => void;
838
866
  setCardTitle: (sheetId: string, cardId: string, title: string) => void;
867
+ setCardInfo: (cardId: string, info: string) => void;
839
868
  setCardSql: (sheetId: string, cardId: string, sql: string) => void;
840
869
  setCardDescription: (sheetId: string, cardId: string, description: string) => void;
841
870
  setFrameCardData: (sheetId: string, cardId: string, data: any[]) => void;
@@ -868,7 +897,8 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
868
897
  getSelectedSheet: () => TSheet | undefined;
869
898
  getCard: (cardId: string) => TCard | undefined;
870
899
  getSelectedFrame: () => TFrame | undefined;
871
- getSelectedSheetLayout: () => ReactGridLayout.Layout[] | undefined;
900
+ getSelectedSheetLayout: () => ReactGridLayout_2.Layout[] | undefined;
901
+ getSelectedSheetLayouts: () => ReactGridLayout_2.Layouts | undefined;
872
902
  handleDataPointClickAction: (card: TCard, dataPoint: any) => void;
873
903
  };
874
904
  }) => void), shouldReplace?: boolean | undefined): void;
@@ -951,6 +981,7 @@ export declare const useEditorStore: UseBoundStore<Omit<StoreApi<EditorStore>, "
951
981
  id: string;
952
982
  title: string;
953
983
  description?: string | undefined;
984
+ info?: string | undefined;
954
985
  connectionId?: string | undefined;
955
986
  type: TChartType;
956
987
  sql?: string | undefined;
@@ -979,6 +1010,7 @@ export declare const useEditorStore: UseBoundStore<Omit<StoreApi<EditorStore>, "
979
1010
  id: string;
980
1011
  title: string;
981
1012
  description?: string | undefined;
1013
+ info?: string | undefined;
982
1014
  connectionId?: string | undefined;
983
1015
  type: TChartType;
984
1016
  sql?: string | undefined;