documint 0.0.5 → 0.0.7
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/README.md +2 -2
- package/dist/index.d.ts +9 -4
- package/dist/index.js +37 -45
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,12 +8,12 @@ A canvas-based, batteries-included markdown editor for React.
|
|
|
8
8
|
|
|
9
9
|
- **Markdown in, markdown out** — Documents are parsed from markdown and serialized back to markdown. Full support for CommonMark, GFM tables, task lists, strikethrough, and fenced code blocks with language hints.
|
|
10
10
|
|
|
11
|
+
- **Rich semantic editing** — Context-sensitive behavior that adapts to what you're editing. Enter splits a paragraph but adds a new row in a table. Backspace at the start of a list item dedents it. Tab indents a list but inserts a column in a table. The editor understands the structure of your document, so every gesture does the right thing.
|
|
12
|
+
|
|
11
13
|
- **Subtle, delightful animations** — A typing trail highlights newly inserted text. Deleted text fades out before disappearing. List markers pop into place. Punctuation pulses with a soft ring on keystroke. Small details that make editing feel fun.
|
|
12
14
|
|
|
13
15
|
- **Mobile-native editing** — Responsive layout with full support for iOS and Android gestures: auto-capitalization, auto-correct, auto-scroll on keyboard appearance, shake-to-undo, and selection handles all work as expected.
|
|
14
16
|
|
|
15
|
-
- **Rich semantic editing** — Context-sensitive behavior that adapts to what you're editing. Enter splits a paragraph but adds a new row in a table. Backspace at the start of a list item dedents it. Tab indents a list but inserts a column in a table. The editor understands the structure of your document, so every gesture does the right thing.
|
|
16
|
-
|
|
17
17
|
- **Context-aware toolbars ("leaves")** — Floating toolbars that appear based on what you're interacting with: text formatting options on selection, link editing on links, column/row controls on tables, and block insertion (headings, lists, quotes, tables) on empty lines.
|
|
18
18
|
|
|
19
19
|
- **Configurable themes and keybindings** — Ships with built-in light and dark themes, follows the system theme by default, and lets you customize every theme value or start from presets like mint, midnight, and sunrise. Keybindings are configurable too — remap formatting shortcuts, navigation, and list operations to match your users' expectations.
|
package/dist/index.d.ts
CHANGED
|
@@ -106,7 +106,11 @@ export type Anchor = {
|
|
|
106
106
|
prefix?: string;
|
|
107
107
|
suffix?: string;
|
|
108
108
|
};
|
|
109
|
-
type
|
|
109
|
+
export type DocumintStorage = {
|
|
110
|
+
readFile(path: string): Promise<Blob | null>;
|
|
111
|
+
writeFile(file: File): Promise<string>;
|
|
112
|
+
};
|
|
113
|
+
type EditorCommand = "dedent" | "deleteBackward" | "indent" | "insertLineBreak" | "moveListItemDown" | "moveListItemUp" | "moveToDocumentEnd" | "moveToDocumentStart" | "moveToLineEnd" | "moveToLineStart" | "redo" | "selectAll" | "toggleBold" | "toggleCode" | "toggleItalic" | "toggleStrikethrough" | "toggleUnderline" | "undo";
|
|
110
114
|
export type EditorTheme = {
|
|
111
115
|
activeBlockBackground: string;
|
|
112
116
|
activeBlockFlash: string;
|
|
@@ -199,12 +203,13 @@ export type DocumintProps = {
|
|
|
199
203
|
theme?: DocumintTheme;
|
|
200
204
|
keybindings?: EditorKeybinding[];
|
|
201
205
|
presence?: DocumentPresence[];
|
|
206
|
+
storage?: DocumintStorage;
|
|
202
207
|
users?: DocumentUser[];
|
|
203
208
|
onContentChanged?: (content: string, document: Document$1) => void;
|
|
204
209
|
onStateChanged?: (state: DocumintState) => void;
|
|
205
|
-
onCommentChanged?: (
|
|
210
|
+
onCommentChanged?: (change: CommentChange) => void;
|
|
206
211
|
};
|
|
207
|
-
export type
|
|
212
|
+
export type CommentChange = {
|
|
208
213
|
kind: "added";
|
|
209
214
|
comment: Comment$1;
|
|
210
215
|
mentionedUserIds: string[];
|
|
@@ -239,7 +244,7 @@ export type DocumintState = {
|
|
|
239
244
|
selectionFrom: number;
|
|
240
245
|
selectionTo: number;
|
|
241
246
|
};
|
|
242
|
-
export declare function Documint({ className, content, keybindings, onCommentChanged, onContentChanged, onStateChanged, presence, theme, users, }: DocumintProps): import("react/jsx-runtime").JSX.Element;
|
|
247
|
+
export declare function Documint({ className, content, keybindings, onCommentChanged, onContentChanged, onStateChanged, presence, storage, theme, users, }: DocumintProps): import("react/jsx-runtime").JSX.Element;
|
|
243
248
|
export declare const lightTheme: EditorTheme;
|
|
244
249
|
export declare const darkTheme: EditorTheme;
|
|
245
250
|
export declare const mintTheme: EditorTheme;
|