@bigbinary/neeto-commons-frontend 2.0.36 → 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
@@ -16,6 +16,7 @@ import { Notice } from "@honeybadger-io/js/dist/server/types/core/types";
16
16
  import { ObjectAndPrimitives } from "./pure";
17
17
  import { DateTimeType, timeFormat } from "./utils";
18
18
  import { History } from "history";
19
+ import { StoreApi, UseBoundStore } from "zustand";
19
20
 
20
21
  export const HoneybadgerErrorBoundary: React.FC<{
21
22
  ErrorComponent?: React.ReactNode | React.ComponentType<any>;
@@ -24,7 +25,8 @@ export const HoneybadgerErrorBoundary: React.FC<{
24
25
  export function PrivateRoute(
25
26
  props: {
26
27
  condition?: boolean;
27
- redirectRoute: string;
28
+ redirectRoute?: string;
29
+ errorPage?: React.ReactNode;
28
30
  } & RouteProps
29
31
  ): JSX.Element;
30
32
  export const Sidebar: React.FC<{
@@ -85,6 +87,13 @@ export function useOnClickOutside<T>(
85
87
  );
86
88
  export function usePrevious<T>(value: T): T;
87
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
+ >;
88
97
 
89
98
  export const ErrorPage: React.FC<{ homeUrl?: string; status?: number }>;
90
99
  export const LoginPage: React.FC<{
@@ -143,15 +152,12 @@ export declare type ZustandStoreHook = {
143
152
  };
144
153
 
145
154
  export const CustomDomain: React.FC<{
146
- headerProps: { [key: string]: any }
155
+ headerProps: { [key: string]: any };
147
156
  }>;
148
157
 
149
158
  export const IpRestriction: React.FC<{}>;
150
159
 
151
- export const PublishBlock: React.FC<{
152
- entityId: string;
153
- publishMutation: () => UseMutationResult<any, any, any, any>;
154
- resetDraftMutation: () => UseMutationResult<any, any, any, any>;
160
+ interface PublishBlockProps {
155
161
  renderDraftButtons: (props: {
156
162
  ViewDraftButton: JSX.Element;
157
163
  ResetDraftButton: JSX.Element;
@@ -160,8 +166,11 @@ export const PublishBlock: React.FC<{
160
166
  PublishButton: JSX.Element;
161
167
  PublishPreviewButton: JSX.Element;
162
168
  }) => React.ReactNode;
163
- resetAlertProps?: AlertProps;
164
- }>;
169
+ }
170
+
171
+ export const PublishBlock: React.FC<PublishBlockProps> & {
172
+ Alert: React.FC<AlertProps>;
173
+ };
165
174
 
166
175
  export function useFieldSubmit(onSubmit: () => any): {
167
176
  current: HTMLInputElement & HTMLTextAreaElement;
@@ -179,6 +188,19 @@ export const Schedule: React.FC<{
179
188
  ref?: React.MutableRefObject;
180
189
  }>;
181
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
+
182
204
  interface Overrides {
183
205
  Chrome?: number;
184
206
  MicrosoftEdge?: number;
@@ -206,6 +228,46 @@ export async function registerBrowserNotifications(): Promise<void>;
206
228
 
207
229
  export async function destroyBrowserSubscription(): Promise<void>;
208
230
 
209
- export function handleMetaClick(history: History, params: string | object, event: React.MouseEvent<HTMLElement, MouseEvent>): void;
210
- export function handleMetaClick(history: History, params: string | object): (event: React.MouseEvent<HTMLElement, MouseEvent> ) => void;
211
- 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;