wysimark-lite 0.27.1 → 0.27.3
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.mts +13 -1
- package/dist/index.js +169 -138
- package/dist/index.mjs +927 -717
- package/dist/index.mjs.map +1 -1
- package/dist/metafile-esm.json +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -10,6 +10,7 @@ import { EditableProps as EditableProps$1, RenderElementProps, RenderLeafProps,
|
|
|
10
10
|
type OnImageChangeHandler = (file: File) => Promise<string>;
|
|
11
11
|
type OnFileSelectHandler = () => Promise<string | null>;
|
|
12
12
|
type RenderInternalLinkPreview = (target: string) => ReactNode;
|
|
13
|
+
type RenderInternalEmbed = (spec: string) => ReactNode;
|
|
13
14
|
type ImageDialogState = {
|
|
14
15
|
url: string;
|
|
15
16
|
alt: string;
|
|
@@ -62,6 +63,10 @@ type WysimarkEditor = {
|
|
|
62
63
|
* Render preview content for an internal link target.
|
|
63
64
|
*/
|
|
64
65
|
renderInternalLinkPreview?: RenderInternalLinkPreview;
|
|
66
|
+
/**
|
|
67
|
+
* Render inline content for an internal embed (`![[spec]]`).
|
|
68
|
+
*/
|
|
69
|
+
renderInternalEmbed?: RenderInternalEmbed;
|
|
65
70
|
};
|
|
66
71
|
/**
|
|
67
72
|
* Public methods for the wysimark editor.
|
|
@@ -104,8 +109,9 @@ type UseEditorOptions = {
|
|
|
104
109
|
*/
|
|
105
110
|
enableInternalLinks?: boolean;
|
|
106
111
|
renderInternalLinkPreview?: RenderInternalLinkPreview;
|
|
112
|
+
renderInternalEmbed?: RenderInternalEmbed;
|
|
107
113
|
};
|
|
108
|
-
declare function useEditor({ authToken, height, minHeight, maxHeight, disableRawMode, disableTaskList, disableCodeBlock, disableHighlight, enableInternalLinks, renderInternalLinkPreview, }?: UseEditorOptions): Editor & ReactEditor & WysimarkEditor;
|
|
114
|
+
declare function useEditor({ authToken, height, minHeight, maxHeight, disableRawMode, disableTaskList, disableCodeBlock, disableHighlight, enableInternalLinks, renderInternalLinkPreview, renderInternalEmbed, }?: UseEditorOptions): Editor & ReactEditor & WysimarkEditor;
|
|
109
115
|
|
|
110
116
|
/**
|
|
111
117
|
* SinkEditor just adds a `sink` object where we drop all of our sink
|
|
@@ -965,6 +971,12 @@ declare function createAnchorMethods(editor: Editor): {
|
|
|
965
971
|
}, args_1: {
|
|
966
972
|
at?: BetterAt;
|
|
967
973
|
}) => boolean;
|
|
974
|
+
convertToEmbed: (spec: string, args_1: {
|
|
975
|
+
at?: BetterAt;
|
|
976
|
+
}) => boolean;
|
|
977
|
+
convertToLink: (spec: string, args_1: {
|
|
978
|
+
at?: BetterAt;
|
|
979
|
+
}) => false | readonly [AnchorElement, number[]];
|
|
968
980
|
};
|
|
969
981
|
|
|
970
982
|
type AnchorMethods = ReturnType<typeof createAnchorMethods>;
|