@bigbinary/neeto-commons-frontend 2.0.35 → 2.0.37

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,6 +1,7 @@
1
1
  import React from "react";
2
2
 
3
3
  import {
4
+ AlertProps,
4
5
  AvatarProps,
5
6
  CheckboxProps,
6
7
  DropdownProps,
@@ -10,10 +11,12 @@ import {
10
11
  } from "@bigbinary/neetoui";
11
12
  import { LinkType, NavLinkItemType } from "@bigbinary/neetoui/layouts";
12
13
  import { RouteProps } from "react-router-dom";
14
+ import { UseMutationResult } from "react-query";
13
15
  import { Notice } from "@honeybadger-io/js/dist/server/types/core/types";
14
16
  import { ObjectAndPrimitives } from "./pure";
15
17
  import { DateTimeType, timeFormat } from "./utils";
16
18
  import { History } from "history";
19
+ import { StoreApi, UseBoundStore } from "zustand";
17
20
 
18
21
  export const HoneybadgerErrorBoundary: React.FC<{
19
22
  ErrorComponent?: React.ReactNode | React.ComponentType<any>;
@@ -22,7 +25,8 @@ export const HoneybadgerErrorBoundary: React.FC<{
22
25
  export function PrivateRoute(
23
26
  props: {
24
27
  condition?: boolean;
25
- redirectRoute: string;
28
+ redirectRoute?: string;
29
+ errorPage?: React.ReactNode;
26
30
  } & RouteProps
27
31
  ): JSX.Element;
28
32
  export const Sidebar: React.FC<{
@@ -83,6 +87,13 @@ export function useOnClickOutside<T>(
83
87
  );
84
88
  export function usePrevious<T>(value: T): T;
85
89
  export function useUpdateEffect(effect: () => void, deps: any[]): void;
90
+ export function useDisplayErrorPage(): boolean;
91
+ export const useErrorDisplayStore: UseBoundStore<
92
+ StoreApi<{
93
+ showErrorPage: boolean;
94
+ statusCode: number;
95
+ }>
96
+ >;
86
97
 
87
98
  export const ErrorPage: React.FC<{ homeUrl?: string; status?: number }>;
88
99
  export const LoginPage: React.FC<{
@@ -141,11 +152,26 @@ export declare type ZustandStoreHook = {
141
152
  };
142
153
 
143
154
  export const CustomDomain: React.FC<{
144
- headerProps: { [key: string]: any }
155
+ headerProps: { [key: string]: any };
145
156
  }>;
146
157
 
147
158
  export const IpRestriction: React.FC<{}>;
148
159
 
160
+ interface PublishBlockProps {
161
+ renderDraftButtons: (props: {
162
+ ViewDraftButton: JSX.Element;
163
+ ResetDraftButton: JSX.Element;
164
+ }) => React.ReactNode;
165
+ renderPublishButtons: (props: {
166
+ PublishButton: JSX.Element;
167
+ PublishPreviewButton: JSX.Element;
168
+ }) => React.ReactNode;
169
+ }
170
+
171
+ export const PublishBlock: React.FC<PublishBlockProps> & {
172
+ Alert: React.FC<AlertProps>;
173
+ };
174
+
149
175
  export function useFieldSubmit(onSubmit: () => any): {
150
176
  current: HTMLInputElement & HTMLTextAreaElement;
151
177
  };
@@ -162,6 +188,19 @@ export const Schedule: React.FC<{
162
188
  ref?: React.MutableRefObject;
163
189
  }>;
164
190
 
191
+ export const ShareViaLink: React.FC<{
192
+ isRegenerating?: boolean;
193
+ enableRegenerateUrl?: boolean;
194
+ entity: {
195
+ id: string;
196
+ name: string;
197
+ };
198
+ entityName: string;
199
+ handleRegenerate?: Function;
200
+ socialMediaPostTitle: string;
201
+ url: string;
202
+ }>;
203
+
165
204
  interface Overrides {
166
205
  Chrome?: number;
167
206
  MicrosoftEdge?: number;
@@ -189,6 +228,46 @@ export async function registerBrowserNotifications(): Promise<void>;
189
228
 
190
229
  export async function destroyBrowserSubscription(): Promise<void>;
191
230
 
192
- export function handleMetaClick(history: History, params: string | object, event: React.MouseEvent<HTMLElement, MouseEvent>): void;
193
- export function handleMetaClick(history: History, params: string | object): (event: React.MouseEvent<HTMLElement, MouseEvent> ) => void;
194
- export function handleMetaClick(history: History): (params: string | object, event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
231
+ export function handleMetaClick(
232
+ history: History,
233
+ params: string | object,
234
+ event: React.MouseEvent<HTMLElement, MouseEvent>
235
+ ): void;
236
+ export function handleMetaClick(
237
+ history: History,
238
+ params: string | object
239
+ ): (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
240
+ export function handleMetaClick(
241
+ history: History
242
+ ): (
243
+ params: string | object,
244
+ event: React.MouseEvent<HTMLElement, MouseEvent>
245
+ ) => void;
246
+
247
+ export function isMetaKeyPressed(
248
+ event: React.MouseEvent<HTMLElement, MouseEvent>
249
+ ): boolean;
250
+
251
+ interface Shortcut {
252
+ sequence: string;
253
+ description: string;
254
+ }
255
+ interface Category {
256
+ [index: string]: Shortcut;
257
+ }
258
+ interface ProductShortcuts {
259
+ [index: any]: Category;
260
+ }
261
+ export const KeyboardShortcutsPane: React.FC<{
262
+ productShortcuts?: ProductShortcuts;
263
+ }>;
264
+
265
+ type ConfigType = {
266
+ mode?: "default" | "global" | "scoped";
267
+ unbindOnUnmount?: boolean;
268
+ };
269
+ export function useHotKeys(
270
+ hotkey: string,
271
+ handler: () => void,
272
+ config?: ConfigType
273
+ ): React.MutableRefObject | null;