dn-react-router-toolkit 0.2.3 → 0.2.5
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/auth/client/provider.d.mts +2 -4
- package/dist/auth/client/provider.d.ts +2 -4
- package/dist/auth/client/provider.js +3 -4
- package/dist/auth/client/provider.mjs +3 -4
- package/dist/auth/jwt_manager.js +1 -1
- package/dist/auth/jwt_manager.mjs +1 -1
- package/dist/file/cdn.d.mts +3 -2
- package/dist/file/cdn.d.ts +3 -2
- package/dist/file/client/drop_file_input.js +36 -10
- package/dist/file/client/drop_file_input.mjs +36 -10
- package/dist/file/client/file_uploader.js +36 -10
- package/dist/file/client/file_uploader.mjs +36 -10
- package/dist/file/client/metadata.d.mts +5 -1
- package/dist/file/client/metadata.d.ts +5 -1
- package/dist/file/client/metadata.js +36 -10
- package/dist/file/client/metadata.mjs +36 -10
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +7 -0
- package/dist/index.mjs +6 -0
- package/dist/sleep.d.mts +3 -0
- package/dist/sleep.d.ts +3 -0
- package/dist/sleep.js +32 -0
- package/dist/sleep.mjs +7 -0
- package/dist/text_editor/attach_media.d.mts +16 -0
- package/dist/text_editor/attach_media.d.ts +16 -0
- package/dist/text_editor/attach_media.js +237 -0
- package/dist/text_editor/attach_media.mjs +210 -0
- package/dist/text_editor/plugins/drag_and_drop.d.mts +13 -0
- package/dist/text_editor/plugins/drag_and_drop.d.ts +13 -0
- package/dist/text_editor/plugins/drag_and_drop.js +59 -0
- package/dist/text_editor/plugins/drag_and_drop.mjs +34 -0
- package/dist/text_editor/plugins/keymap.d.mts +5 -0
- package/dist/text_editor/plugins/keymap.d.ts +5 -0
- package/dist/text_editor/plugins/keymap.js +40 -0
- package/dist/text_editor/plugins/keymap.mjs +15 -0
- package/dist/text_editor/plugins/placehoder.d.mts +5 -0
- package/dist/text_editor/plugins/placehoder.d.ts +5 -0
- package/dist/text_editor/plugins/placehoder.js +112 -0
- package/dist/text_editor/plugins/placehoder.mjs +87 -0
- package/dist/text_editor/plugins/trailing_paragraph.d.mts +5 -0
- package/dist/text_editor/plugins/trailing_paragraph.d.ts +5 -0
- package/dist/text_editor/plugins/trailing_paragraph.js +46 -0
- package/dist/text_editor/plugins/trailing_paragraph.mjs +21 -0
- package/dist/text_editor/plugins/upload_placeholder.d.mts +7 -0
- package/dist/text_editor/plugins/upload_placeholder.d.ts +7 -0
- package/dist/text_editor/plugins/upload_placeholder.js +94 -0
- package/dist/text_editor/plugins/upload_placeholder.mjs +68 -0
- package/dist/text_editor/schema.d.mts +9 -0
- package/dist/text_editor/schema.d.ts +9 -0
- package/dist/text_editor/schema.js +354 -0
- package/dist/text_editor/schema.mjs +319 -0
- package/dist/text_editor/text_editor.d.mts +44 -0
- package/dist/text_editor/text_editor.d.ts +44 -0
- package/dist/text_editor/text_editor.js +830 -0
- package/dist/text_editor/text_editor.mjs +802 -0
- package/package.json +14 -2
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as orderedmap from 'orderedmap';
|
|
2
|
+
import * as prosemirror_model from 'prosemirror-model';
|
|
3
|
+
import { Node, Attrs, Fragment, Mark } from 'prosemirror-model';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { EditorStateConfig } from 'prosemirror-state';
|
|
6
|
+
import { EditorView, DirectEditorProps } from 'prosemirror-view';
|
|
7
|
+
import { FileUploader } from '../file/client/file_uploader.js';
|
|
8
|
+
|
|
9
|
+
type TextEditorProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> & {
|
|
10
|
+
name?: string;
|
|
11
|
+
state?: Partial<EditorStateConfig>;
|
|
12
|
+
editor?: Partial<DirectEditorProps>;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
defaultValue?: string;
|
|
15
|
+
onHTMLChanged?: (html: string) => void;
|
|
16
|
+
};
|
|
17
|
+
declare function createTextEditor<TFile extends {
|
|
18
|
+
key: string;
|
|
19
|
+
}>({ fileUploader, cdnOrigin, }?: {
|
|
20
|
+
fileUploader?: FileUploader<TFile>;
|
|
21
|
+
cdnOrigin?: string;
|
|
22
|
+
}): {
|
|
23
|
+
schema: prosemirror_model.Schema<keyof orderedmap.default<prosemirror_model.NodeSpec>, keyof orderedmap.default<prosemirror_model.MarkSpec>>;
|
|
24
|
+
useTextEditor: () => {
|
|
25
|
+
readonly schema: prosemirror_model.Schema<keyof orderedmap.default<prosemirror_model.NodeSpec>, keyof orderedmap.default<prosemirror_model.MarkSpec>>;
|
|
26
|
+
readonly view: React.RefObject<EditorView | null>;
|
|
27
|
+
readonly commands: {
|
|
28
|
+
readonly attachMedia: (files: File[]) => Promise<Node[] | undefined>;
|
|
29
|
+
readonly toggleMark: <T extends string | number>(type: T, attrs?: Attrs, options?: {
|
|
30
|
+
removeWhenPresent?: boolean;
|
|
31
|
+
enterInlineAtoms?: boolean;
|
|
32
|
+
includeWhitespace?: boolean;
|
|
33
|
+
}) => void;
|
|
34
|
+
readonly setBlockType: <T extends string | number>(type: T, attrs?: Attrs) => void;
|
|
35
|
+
readonly insertNode: (type: string, attrs?: Attrs, content?: Fragment | Node | Node[], marks?: Mark[]) => void;
|
|
36
|
+
readonly setHTML: (html: string) => void;
|
|
37
|
+
};
|
|
38
|
+
readonly Component: ({ name, placeholder, className, defaultValue, onClick, onHTMLChanged, editor, state, ...props }: TextEditorProps) => React.JSX.Element;
|
|
39
|
+
readonly serialize: () => string;
|
|
40
|
+
readonly getTextContent: () => string;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export { type TextEditorProps, createTextEditor as default };
|