documint 0.0.2 → 0.0.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.ts CHANGED
@@ -148,6 +148,8 @@ export type EditorTheme = {
148
148
  leafText: string;
149
149
  linkText: string;
150
150
  listMarkerText: string;
151
+ mentionBackground?: string;
152
+ mentionText?: string;
151
153
  paddingX: number;
152
154
  paddingY: number;
153
155
  paragraphText: string;
@@ -158,11 +160,29 @@ export type EditorTheme = {
158
160
  tableBorder: string;
159
161
  tableHeaderBackground: string;
160
162
  };
161
- export type Presence = {
162
- color?: string;
163
+ /**
164
+ * A user known to the host. The full set is the mention roster; the subset
165
+ * that also appears in `presence` shows a live cursor in the document.
166
+ */
167
+ export type DocumentUser = {
168
+ id: string;
169
+ username: string;
170
+ fullName?: string;
171
+ avatarUrl?: string;
172
+ };
173
+ /**
174
+ * One user's live cursor in the document. `userId` foreign-keys into the
175
+ * `users` roster; entries without a matching user are silently dropped.
176
+ *
177
+ * `cursor` is a content-addressable anchor (prefix/suffix). The editor
178
+ * resolves it against the current document; if the anchor matches zero or
179
+ * more than one place, the cursor is treated as unresolved and rendered as
180
+ * an "unknown location" indicator rather than guessed.
181
+ */
182
+ export type DocumentPresence = {
183
+ userId: string;
163
184
  cursor?: Anchor;
164
- imageUrl?: string;
165
- name: string;
185
+ color?: string;
166
186
  };
167
187
  export type EditorKeybinding = {
168
188
  altKey?: boolean;
@@ -177,7 +197,8 @@ export type DocumintProps = {
177
197
  className?: string;
178
198
  theme?: DocumintTheme;
179
199
  keybindings?: EditorKeybinding[];
180
- presence?: Presence[];
200
+ presence?: DocumentPresence[];
201
+ users?: DocumentUser[];
181
202
  onContentChange?: (content: string, document: Document$1) => void;
182
203
  onStateChange?: (state: DocumintState) => void;
183
204
  };
@@ -197,7 +218,7 @@ export type DocumintState = {
197
218
  selectionFrom: number;
198
219
  selectionTo: number;
199
220
  };
200
- export declare function Documint({ className, content, keybindings, onContentChange, onStateChange, presence, theme, }: DocumintProps): import("react/jsx-runtime").JSX.Element;
221
+ export declare function Documint({ className, content, keybindings, onContentChange, onStateChange, presence, theme, users, }: DocumintProps): import("react/jsx-runtime").JSX.Element;
201
222
  export declare const lightTheme: EditorTheme;
202
223
  export declare const darkTheme: EditorTheme;
203
224
  export declare const mintTheme: EditorTheme;