@bigbinary/neeto-commons-frontend 2.0.53 → 2.0.55

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.
package/react-utils.d.ts CHANGED
@@ -1,29 +1,15 @@
1
1
  import React from "react";
2
2
 
3
- import {
4
- AlertProps,
5
- AvatarProps,
6
- CheckboxProps,
7
- DropdownProps,
8
- InputProps,
9
- TooltipProps,
10
- TypographyProps,
11
- } from "@bigbinary/neetoui";
12
- import { LinkType, NavLinkItemType } from "@bigbinary/neetoui/layouts";
13
3
  import { RouteProps } from "react-router-dom";
14
- import { UseMutationResult } from "react-query";
15
4
  import { Notice } from "@honeybadger-io/js/dist/server/types/core/types";
16
- import { ObjectAndPrimitives } from "./pure";
17
- import { DateTimeType, timeFormat } from "./utils";
18
5
  import { History } from "history";
19
6
  import { StoreApi, UseBoundStore } from "zustand";
20
- import { Dayjs } from "dayjs";
21
- import { TFunction } from "i18next";
22
7
 
23
8
  export const HoneybadgerErrorBoundary: React.FC<{
24
9
  ErrorComponent?: React.ReactNode | React.ComponentType<any>;
25
10
  filterErrors?: (error: Notice) => boolean;
26
11
  }>;
12
+
27
13
  export function PrivateRoute(
28
14
  props: {
29
15
  condition?: boolean;
@@ -31,39 +17,6 @@ export function PrivateRoute(
31
17
  errorPage?: React.ReactNode;
32
18
  } & RouteProps
33
19
  ): JSX.Element;
34
- export const Sidebar: React.FC<{
35
- navLinks: NavLinkItemType[];
36
- appName: string;
37
- profileInfoOverrides?: {
38
- name?: string;
39
- email?: string;
40
- topLinks?: LinkType[];
41
- bottomLinks?: LinkType[];
42
- customContent?: React.ReactNode;
43
- changelogProps?: LinkType;
44
- helpProps?: LinkType;
45
- "data-cy"?: string;
46
- } & AvatarProps;
47
- organizationInfoOverrides?: {
48
- logo?: React.ReactNode;
49
- name?: React.ReactNode;
50
- subdomain?: React.ReactNode;
51
- };
52
- extraTopLinks?: LinkType[];
53
- showAppSwitcher?: boolean;
54
- }>;
55
- type EmbedCode = React.FC<{
56
- primaryApp?: string;
57
- initialSelectedWidgets?: string[];
58
- }>;
59
- export const NeetoWidget: {
60
- EmbedCode: EmbedCode;
61
- WIDGET_TYPES: {
62
- changelog: "changelog";
63
- chat: "chat";
64
- replay: "replay";
65
- };
66
- };
67
20
 
68
21
  type OptionsType = {
69
22
  root?: Element | null;
@@ -74,22 +27,30 @@ export function useIsElementVisibleInDom(
74
27
  target: Element | null,
75
28
  options?: OptionsType
76
29
  ): Boolean;
30
+
77
31
  export function useDebounce<T>(value: T, delay?: number): T;
32
+
78
33
  export function useFuncDebounce<F extends Function>(
79
34
  func: F,
80
35
  delay?: number
81
36
  ): F & { cancel: () => void };
37
+
82
38
  export function useLocalStorage<T>(
83
39
  key: string,
84
40
  initialValue?: T
85
41
  ): [T, (value: T) => void];
42
+
86
43
  export function useOnClickOutside<T>(
87
44
  ref: React.MutableRefObject<T>,
88
45
  handler: (event: MouseEvent | TouchEvent) => any
89
46
  );
47
+
90
48
  export function usePrevious<T>(value: T): T;
49
+
91
50
  export function useUpdateEffect(effect: () => void, deps: any[]): void;
51
+
92
52
  export function useDisplayErrorPage(): boolean;
53
+
93
54
  export const useErrorDisplayStore: UseBoundStore<
94
55
  StoreApi<{
95
56
  showErrorPage: boolean;
@@ -97,50 +58,11 @@ export const useErrorDisplayStore: UseBoundStore<
97
58
  }>
98
59
  >;
99
60
 
100
- export const ErrorPage: React.FC<{ homeUrl?: string; status?: number }>;
101
- export const LoginPage: React.FC<{
102
- handleSubmit: (data: {
103
- user: {
104
- email: string;
105
- password: string;
106
- };
107
- }) => any;
108
- }>;
109
-
110
- export const DateFormat: {
111
- [key in Capitalize<keyof typeof timeFormat>]: React.FC<{
112
- date: DateTimeType;
113
- typographyProps?: Partial<TypographyProps>;
114
- tooltipProps?: Partial<TooltipProps>;
115
- }>;
116
- };
117
-
118
- export const TimeFormat: typeof DateFormat;
119
-
120
- export const Columns: React.FC<{
121
- actionBlock?: React.ReactNode;
122
- checkboxProps?: CheckboxProps;
123
- columnData: {
124
- title: string;
125
- dataIndex: string;
126
- key: string;
127
- [key: string]: any;
128
- }[];
129
- dropdownProps?: DropdownProps;
130
- fixedColumns?: string[];
131
- isSearchable?: boolean;
132
- localStorageKey: string;
133
- noColumnMessage?: string;
134
- onChange: (columns: any[]) => any[];
135
- searchProps?: InputProps;
136
- }>;
137
-
138
61
  type ZustandConfigType = (
139
62
  set: (data: any) => void,
140
63
  get: () => any,
141
64
  api: any
142
65
  ) => any;
143
-
144
66
  export function withImmutableActions(
145
67
  config: ZustandConfigType
146
68
  ): ZustandConfigType;
@@ -153,87 +75,10 @@ export declare type ZustandStoreHook = {
153
75
  (): any;
154
76
  };
155
77
 
156
- export const CustomDomain: React.FC<{
157
- headerProps: { [key: string]: any };
158
- }>;
159
-
160
- export const IpRestriction: React.FC<{}>;
161
-
162
- interface PublishBlockProps {
163
- renderDraftButtons: (props: {
164
- ViewDraftButton: JSX.Element;
165
- ResetDraftButton: JSX.Element;
166
- }) => React.ReactNode;
167
- renderPublishButtons: (props: {
168
- PublishButton: JSX.Element;
169
- PublishPreviewButton: JSX.Element;
170
- }) => React.ReactNode;
171
- }
172
-
173
- export const PublishBlock: React.FC<PublishBlockProps> & {
174
- Alert: React.FC<AlertProps>;
175
- };
176
-
177
78
  export function useFieldSubmit(onSubmit: () => any): {
178
79
  current: HTMLInputElement & HTMLTextAreaElement;
179
80
  };
180
81
 
181
- interface TimePeriodType {
182
- startDate: Dayjs;
183
- endDate: Dayjs;
184
- rangeType: string;
185
- }
186
-
187
- export const DateRangeFilter: React.FC<{
188
- timePeriod: TimePeriodType;
189
- setTimePeriod: React.Dispatch<React.SetStateAction<TimePeriodType>>;
190
- timePeriodOptions: TimePeriodType[];
191
- }>;
192
-
193
- export const Schedule: React.FC<{
194
- isEditing?: boolean;
195
- setIsEditing?: React.Dispatch<React.SetStateAction<boolean>>;
196
- handleSubmit?: Function;
197
- handleValuesChanged?: Function;
198
- showHeader?: boolean;
199
- periods: {
200
- [key: string]: Array<any>;
201
- };
202
- ref?: React.MutableRefObject;
203
- }>;
204
-
205
- export const ShareViaLink: React.FC<{
206
- isRegenerating?: boolean;
207
- enableRegenerateUrl?: boolean;
208
- entity: {
209
- id: string;
210
- name: string;
211
- };
212
- entityName: string;
213
- handleRegenerate?: Function;
214
- previewUrl?: string;
215
- socialMediaPostTitle: string;
216
- url: string;
217
- }>;
218
-
219
- interface Overrides {
220
- Chrome?: number;
221
- MicrosoftEdge?: number;
222
- Firefox?: number;
223
- IE?: number;
224
- Opera?: number;
225
- Safari?: number;
226
- AndroidBrowser?: number;
227
- OperaMini?: number;
228
- ChromeMobile?: number;
229
- FirefoxMobile?: number;
230
- UCBrowser?: number;
231
- SamsungInternet?: number;
232
- }
233
- export const BrowserSupport: React.FC<{
234
- overrides?: Overrides;
235
- }>;
236
-
237
82
  export function withTitle(
238
83
  Component: () => JSX.Element,
239
84
  title?: string
@@ -263,21 +108,6 @@ export function isMetaKeyPressed(
263
108
  event: React.MouseEvent<HTMLElement, MouseEvent>
264
109
  ): boolean;
265
110
 
266
- interface Shortcut {
267
- sequence: string;
268
- description: TFunction;
269
- }
270
- interface Category {
271
- [index: string]: Shortcut | string;
272
- fullShortcutsLink?: string;
273
- }
274
- interface ProductShortcuts {
275
- [index: string | TFunction]: Category;
276
- }
277
- export const KeyboardShortcutsPane: React.FC<{
278
- productShortcuts?: ProductShortcuts;
279
- }>;
280
-
281
111
  type ConfigType = {
282
112
  mode?: "default" | "global" | "scoped";
283
113
  unbindOnUnmount?: boolean;
@@ -288,18 +118,3 @@ export function useHotKeys(
288
118
  handler: (event: React.KeyboardEvent) => void,
289
119
  config?: ConfigType
290
120
  ): React.MutableRefObject | null;
291
-
292
- export function useKeyboardShortcutsPaneState(): [
293
- boolean,
294
- React.Dispatch<React.SetStateAction<boolean>>
295
- ];
296
-
297
- export const EmailPreview: React.FC<{
298
- to?: string[];
299
- subject?: string;
300
- body?: string;
301
- from?: string;
302
- logo?: string;
303
- productName?: string;
304
- actionButtonText?: string;
305
- }>;