rme 0.1.0-beta.8 → 0.1.1

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/dist/index.d.ts CHANGED
@@ -16,6 +16,17 @@ import { LanguageSupport, LanguageDescription } from '@codemirror/language';
16
16
  import * as styled_components from 'styled-components';
17
17
  import * as styled_components_dist_types from 'styled-components/dist/types';
18
18
 
19
+ interface ErrorBoundaryProps {
20
+ hasError?: boolean;
21
+ error?: unknown;
22
+ fallback?: react__default.ComponentType<{
23
+ error: Error;
24
+ }>;
25
+ onError?: (params: {
26
+ error: Error;
27
+ }) => void;
28
+ }
29
+
19
30
  declare const Editor: react.MemoExoticComponent<react.ForwardRefExoticComponent<EditorProps & react.RefAttributes<EditorRef>>>;
20
31
  type EditorChangeEventParams = RemirrorEventListenerProps<Extension>;
21
32
  type EditorChangeHandler = (params: EditorChangeEventParams) => void;
@@ -50,6 +61,7 @@ interface EditorProps {
50
61
  markdownToolBar?: React.ReactNode[];
51
62
  wysiwygToolBar?: React.ReactNode[];
52
63
  onContextMounted?: (context: EditorContext) => void;
64
+ errorHandler?: Pick<ErrorBoundaryProps, 'onError' | 'fallback'>;
53
65
  }
54
66
 
55
67
  type StringToDoc = (content: string) => Node;
@@ -87,6 +99,7 @@ type CreateCodemirrorOptions = {
87
99
  */
88
100
  useProsemirrorHistoryKey?: boolean;
89
101
  codemirrorEditorViewConfig?: EditorViewConfig;
102
+ onValueChange?: (value: string) => void;
90
103
  };
91
104
  declare class MfCodemirrorView {
92
105
  private readonly view;
@@ -311,12 +324,14 @@ declare const ThemeProvider: React.FC<Props>;
311
324
  interface PreviewProps {
312
325
  doc: Node | string;
313
326
  delegateOptions?: EditorProps['delegateOptions'];
327
+ onError?: (e: Error) => void;
314
328
  }
315
329
  type HTMLAstNode = {
316
330
  attrs: Record<string, any>;
317
331
  name: string;
318
332
  type: string;
319
333
  children?: HTMLAstNode[];
334
+ content?: string;
320
335
  };
321
336
  declare const Preview: React.FC<PreviewProps>;
322
337