documint 0.0.1 → 0.0.2
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 +20 -29
- package/dist/index.js +32 -33
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -105,17 +105,7 @@ export type Anchor = {
|
|
|
105
105
|
prefix?: string;
|
|
106
106
|
suffix?: string;
|
|
107
107
|
};
|
|
108
|
-
|
|
109
|
-
color?: string;
|
|
110
|
-
cursor?: Anchor;
|
|
111
|
-
imageUrl?: string;
|
|
112
|
-
name: string;
|
|
113
|
-
};
|
|
114
|
-
/**
|
|
115
|
-
* Canvas render themes for the editor surface. These tokens are intentionally
|
|
116
|
-
* semantic so paint code can stay focused on structure rather than color
|
|
117
|
-
* decisions.
|
|
118
|
-
*/
|
|
108
|
+
type EditorCommand = "dedent" | "deleteBackward" | "indent" | "insertLineBreak" | "moveListItemDown" | "moveListItemUp" | "moveToDocumentEnd" | "moveToDocumentStart" | "moveToLineEnd" | "moveToLineStart" | "redo" | "selectAll" | "toggleBold" | "toggleInlineCode" | "toggleItalic" | "toggleStrikethrough" | "toggleUnderline" | "undo";
|
|
119
109
|
export type EditorTheme = {
|
|
120
110
|
activeBlockBackground: string;
|
|
121
111
|
activeBlockFlash: string;
|
|
@@ -168,7 +158,12 @@ export type EditorTheme = {
|
|
|
168
158
|
tableBorder: string;
|
|
169
159
|
tableHeaderBackground: string;
|
|
170
160
|
};
|
|
171
|
-
type
|
|
161
|
+
export type Presence = {
|
|
162
|
+
color?: string;
|
|
163
|
+
cursor?: Anchor;
|
|
164
|
+
imageUrl?: string;
|
|
165
|
+
name: string;
|
|
166
|
+
};
|
|
172
167
|
export type EditorKeybinding = {
|
|
173
168
|
altKey?: boolean;
|
|
174
169
|
command: EditorCommand;
|
|
@@ -177,6 +172,19 @@ export type EditorKeybinding = {
|
|
|
177
172
|
shiftKey?: boolean | "any";
|
|
178
173
|
};
|
|
179
174
|
export declare const defaultKeybindings: EditorKeybinding[];
|
|
175
|
+
export type DocumintProps = {
|
|
176
|
+
content: string;
|
|
177
|
+
className?: string;
|
|
178
|
+
theme?: DocumintTheme;
|
|
179
|
+
keybindings?: EditorKeybinding[];
|
|
180
|
+
presence?: Presence[];
|
|
181
|
+
onContentChange?: (content: string, document: Document$1) => void;
|
|
182
|
+
onStateChange?: (state: DocumintState) => void;
|
|
183
|
+
};
|
|
184
|
+
export type DocumintTheme = EditorTheme | {
|
|
185
|
+
dark: EditorTheme;
|
|
186
|
+
light: EditorTheme;
|
|
187
|
+
};
|
|
180
188
|
export type DocumintState = {
|
|
181
189
|
activeBlockType: string | null;
|
|
182
190
|
activeCommentThreadIndex: number | null;
|
|
@@ -184,27 +192,10 @@ export type DocumintState = {
|
|
|
184
192
|
canonicalContent: string;
|
|
185
193
|
characterCount: number;
|
|
186
194
|
commentThreadCount: number;
|
|
187
|
-
docChangeCount: number;
|
|
188
|
-
lastTransactionMs: number;
|
|
189
195
|
layoutWidth: number;
|
|
190
|
-
lineCount: number;
|
|
191
196
|
resolvedCommentCount: number;
|
|
192
197
|
selectionFrom: number;
|
|
193
198
|
selectionTo: number;
|
|
194
|
-
transactionCount: number;
|
|
195
|
-
};
|
|
196
|
-
export type DocumintTheme = EditorTheme | {
|
|
197
|
-
dark: EditorTheme;
|
|
198
|
-
light: EditorTheme;
|
|
199
|
-
};
|
|
200
|
-
export type DocumintProps = {
|
|
201
|
-
className?: string;
|
|
202
|
-
content: string;
|
|
203
|
-
keybindings?: EditorKeybinding[];
|
|
204
|
-
onContentChange?: (content: string, document: Document$1) => void;
|
|
205
|
-
onStateChange?: (state: DocumintState) => void;
|
|
206
|
-
presence?: Presence[];
|
|
207
|
-
theme?: DocumintTheme;
|
|
208
199
|
};
|
|
209
200
|
export declare function Documint({ className, content, keybindings, onContentChange, onStateChange, presence, theme, }: DocumintProps): import("react/jsx-runtime").JSX.Element;
|
|
210
201
|
export declare const lightTheme: EditorTheme;
|