wysimark-lite 0.11.0 → 0.13.0

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.
@@ -1,10 +1,11 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
1
2
  import * as slate from 'slate';
2
3
  import { Descendant, Editor, Element as Element$1, BaseEditor, NodeEntry, BaseRange, Location, Path, BaseText } from 'slate';
3
- import { ReactEditor, Editable } from 'slate-react';
4
4
  import { HistoryEditor } from 'slate-history';
5
+ import { ReactEditor, Editable as Editable$1 } from 'slate-react';
5
6
  import { SetReturnType, SetOptional, UnionToIntersection, Simplify } from 'type-fest';
6
7
  import react from 'react';
7
- import { RenderElementProps, RenderLeafProps, RenderPlaceholderProps, EditableProps } from 'slate-react/dist/components/editable';
8
+ import { RenderElementProps, RenderLeafProps, RenderPlaceholderProps, EditableProps as EditableProps$1 } from 'slate-react/dist/components/editable';
8
9
 
9
10
  type WysimarkEditor = {
10
11
  /**
@@ -139,8 +140,8 @@ type FullSinkEditor = SinkEditor & BaseEditor & ReactEditor & HistoryEditor;
139
140
  type VoidActionReturn = boolean | (() => void);
140
141
 
141
142
  type RenderEditableProps = {
142
- attributes: EditableProps;
143
- Editable: typeof Editable;
143
+ attributes: EditableProps$1;
144
+ Editable: typeof Editable$1;
144
145
  };
145
146
  type RenderEditable = (props: RenderEditableProps) => react.ReactElement;
146
147
  /**
@@ -176,7 +177,7 @@ type BasePluginPolicy = {
176
177
  onDrop?: EditableVoidToBooleanHandlerType<"onDrop">;
177
178
  };
178
179
  };
179
- type EditableVoidToBooleanHandlerType<K extends keyof EditableProps> = SetReturnType<NonNullable<EditableProps[K]>, boolean>;
180
+ type EditableVoidToBooleanHandlerType<K extends keyof EditableProps$1> = SetReturnType<NonNullable<EditableProps$1[K]>, boolean>;
180
181
 
181
182
  /**
182
183
  * IMPORTANT!
@@ -891,6 +892,17 @@ declare module "slate" {
891
892
  }
892
893
  }
893
894
 
895
+ type EditableProps = {
896
+ editor: Editor;
897
+ value: string;
898
+ onChange: (markdown: string) => void;
899
+ throttleInMs?: number;
900
+ placeholder?: string;
901
+ className?: string;
902
+ style?: React.CSSProperties;
903
+ };
904
+ declare function Editable({ editor, value, onChange, throttleInMs, placeholder, className, style, }: EditableProps): react_jsx_runtime.JSX.Element;
905
+
894
906
  /**
895
907
  * The options passed into the standalone version of Wysimark.
896
908
  */
@@ -913,4 +925,4 @@ type Wysimark = {
913
925
  */
914
926
  declare function createWysimark(containerElement: HTMLElement, options: StandaloneOptions): Wysimark;
915
927
 
916
- export { Wysimark, createWysimark };
928
+ export { Editable, Wysimark, createWysimark, useEditor };