@openim/im-composer 1.0.2 → 1.0.4

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 CHANGED
@@ -285,6 +285,25 @@ interface IMComposerProps {
285
285
  };
286
286
  /** Image upload handler with optional progress callback */
287
287
  uploadImage?: UploadImageFn;
288
+ /** Rich mode toolbar configuration */
289
+ richToolbarConfig?: {
290
+ undoRedo?: boolean;
291
+ heading?: boolean;
292
+ list?: boolean;
293
+ blockquote?: boolean;
294
+ codeBlock?: boolean;
295
+ bold?: boolean;
296
+ italic?: boolean;
297
+ strike?: boolean;
298
+ code?: boolean;
299
+ underline?: boolean;
300
+ highlight?: boolean;
301
+ link?: boolean;
302
+ superscript?: boolean;
303
+ subscript?: boolean;
304
+ textAlign?: boolean;
305
+ image?: boolean;
306
+ };
288
307
  /** Keymap configuration */
289
308
  keymap?: {
290
309
  send?: SendKeymap;
@@ -358,6 +377,40 @@ interface MentionSuggestionState {
358
377
  */
359
378
  declare const IMComposer: React__default.ForwardRefExoticComponent<IMComposerProps & React__default.RefAttributes<IMComposerRef>>;
360
379
 
380
+ interface RichToolbarConfig {
381
+ /** Show undo/redo buttons */
382
+ undoRedo?: boolean;
383
+ /** Show heading dropdown */
384
+ heading?: boolean;
385
+ /** Show list dropdown */
386
+ list?: boolean;
387
+ /** Show blockquote button */
388
+ blockquote?: boolean;
389
+ /** Show code block button */
390
+ codeBlock?: boolean;
391
+ /** Show bold button */
392
+ bold?: boolean;
393
+ /** Show italic button */
394
+ italic?: boolean;
395
+ /** Show strikethrough button */
396
+ strike?: boolean;
397
+ /** Show inline code button */
398
+ code?: boolean;
399
+ /** Show underline button */
400
+ underline?: boolean;
401
+ /** Show highlight button */
402
+ highlight?: boolean;
403
+ /** Show link button */
404
+ link?: boolean;
405
+ /** Show superscript button */
406
+ superscript?: boolean;
407
+ /** Show subscript button */
408
+ subscript?: boolean;
409
+ /** Show text align buttons */
410
+ textAlign?: boolean;
411
+ /** Show image upload button */
412
+ image?: boolean;
413
+ }
361
414
  interface RichEditorProps {
362
415
  placeholder?: string;
363
416
  disabled?: boolean;
@@ -366,6 +419,8 @@ interface RichEditorProps {
366
419
  onSend?: () => void;
367
420
  onChange?: () => void;
368
421
  sendKeymap?: 'enter' | 'ctrlEnter' | 'cmdEnter';
422
+ /** Toolbar configuration */
423
+ toolbarConfig?: RichToolbarConfig;
369
424
  }
370
425
  interface RichEditorRef {
371
426
  editor: Editor | null;
@@ -614,4 +669,4 @@ declare function sanitizeLinkUrl(url: string): string | null;
614
669
  */
615
670
  declare function sanitizeImageUrl(url: string): string | null;
616
671
 
617
- export { type Attachment, type AttachmentLimitReason, AttachmentPreview, type AttachmentPreviewProps, type ComposerDraft, type EditorMode, IMComposer, type IMComposerLocale, type IMComposerProps, type IMComposerRef, LocaleProvider, type MarkdownMessagePayload, type Member, type MentionInfo, MentionList, type MentionListProps, type MessagePayload, type PlainMessagePayload, QuoteBar, type QuoteBarProps, type QuoteInfo, RichEditor, type RichEditorProps, type RichEditorRef, type SendKeymap, type UploadImageFn, type UploadImageResult, type UploadProgressEvent, type UseAttachmentsOptions, type UseAttachmentsReturn, type UsePlainEditorOptions, type UsePlainEditorReturn, createAttachment, createMentionInfo, defaultLocale, editorToMarkdown, extractPlainTextWithMentions, formatFileSize, isAllowedImageProtocol, isAllowedLinkProtocol, markdownToEditorContent, revokeAllAttachmentUrls, revokeAttachmentUrl, sanitizeImageUrl, sanitizeLinkUrl, useAttachments, useLocale, usePlainEditor, validateFile, validateMentionIndices };
672
+ export { type Attachment, type AttachmentLimitReason, AttachmentPreview, type AttachmentPreviewProps, type ComposerDraft, type EditorMode, IMComposer, type IMComposerLocale, type IMComposerProps, type IMComposerRef, LocaleProvider, type MarkdownMessagePayload, type Member, type MentionInfo, MentionList, type MentionListProps, type MessagePayload, type PlainMessagePayload, QuoteBar, type QuoteBarProps, type QuoteInfo, RichEditor, type RichEditorProps, type RichEditorRef, type RichToolbarConfig, type SendKeymap, type UploadImageFn, type UploadImageResult, type UploadProgressEvent, type UseAttachmentsOptions, type UseAttachmentsReturn, type UsePlainEditorOptions, type UsePlainEditorReturn, createAttachment, createMentionInfo, defaultLocale, editorToMarkdown, extractPlainTextWithMentions, formatFileSize, isAllowedImageProtocol, isAllowedLinkProtocol, markdownToEditorContent, revokeAllAttachmentUrls, revokeAttachmentUrl, sanitizeImageUrl, sanitizeLinkUrl, useAttachments, useLocale, usePlainEditor, validateFile, validateMentionIndices };
package/dist/index.d.ts CHANGED
@@ -285,6 +285,25 @@ interface IMComposerProps {
285
285
  };
286
286
  /** Image upload handler with optional progress callback */
287
287
  uploadImage?: UploadImageFn;
288
+ /** Rich mode toolbar configuration */
289
+ richToolbarConfig?: {
290
+ undoRedo?: boolean;
291
+ heading?: boolean;
292
+ list?: boolean;
293
+ blockquote?: boolean;
294
+ codeBlock?: boolean;
295
+ bold?: boolean;
296
+ italic?: boolean;
297
+ strike?: boolean;
298
+ code?: boolean;
299
+ underline?: boolean;
300
+ highlight?: boolean;
301
+ link?: boolean;
302
+ superscript?: boolean;
303
+ subscript?: boolean;
304
+ textAlign?: boolean;
305
+ image?: boolean;
306
+ };
288
307
  /** Keymap configuration */
289
308
  keymap?: {
290
309
  send?: SendKeymap;
@@ -358,6 +377,40 @@ interface MentionSuggestionState {
358
377
  */
359
378
  declare const IMComposer: React__default.ForwardRefExoticComponent<IMComposerProps & React__default.RefAttributes<IMComposerRef>>;
360
379
 
380
+ interface RichToolbarConfig {
381
+ /** Show undo/redo buttons */
382
+ undoRedo?: boolean;
383
+ /** Show heading dropdown */
384
+ heading?: boolean;
385
+ /** Show list dropdown */
386
+ list?: boolean;
387
+ /** Show blockquote button */
388
+ blockquote?: boolean;
389
+ /** Show code block button */
390
+ codeBlock?: boolean;
391
+ /** Show bold button */
392
+ bold?: boolean;
393
+ /** Show italic button */
394
+ italic?: boolean;
395
+ /** Show strikethrough button */
396
+ strike?: boolean;
397
+ /** Show inline code button */
398
+ code?: boolean;
399
+ /** Show underline button */
400
+ underline?: boolean;
401
+ /** Show highlight button */
402
+ highlight?: boolean;
403
+ /** Show link button */
404
+ link?: boolean;
405
+ /** Show superscript button */
406
+ superscript?: boolean;
407
+ /** Show subscript button */
408
+ subscript?: boolean;
409
+ /** Show text align buttons */
410
+ textAlign?: boolean;
411
+ /** Show image upload button */
412
+ image?: boolean;
413
+ }
361
414
  interface RichEditorProps {
362
415
  placeholder?: string;
363
416
  disabled?: boolean;
@@ -366,6 +419,8 @@ interface RichEditorProps {
366
419
  onSend?: () => void;
367
420
  onChange?: () => void;
368
421
  sendKeymap?: 'enter' | 'ctrlEnter' | 'cmdEnter';
422
+ /** Toolbar configuration */
423
+ toolbarConfig?: RichToolbarConfig;
369
424
  }
370
425
  interface RichEditorRef {
371
426
  editor: Editor | null;
@@ -614,4 +669,4 @@ declare function sanitizeLinkUrl(url: string): string | null;
614
669
  */
615
670
  declare function sanitizeImageUrl(url: string): string | null;
616
671
 
617
- export { type Attachment, type AttachmentLimitReason, AttachmentPreview, type AttachmentPreviewProps, type ComposerDraft, type EditorMode, IMComposer, type IMComposerLocale, type IMComposerProps, type IMComposerRef, LocaleProvider, type MarkdownMessagePayload, type Member, type MentionInfo, MentionList, type MentionListProps, type MessagePayload, type PlainMessagePayload, QuoteBar, type QuoteBarProps, type QuoteInfo, RichEditor, type RichEditorProps, type RichEditorRef, type SendKeymap, type UploadImageFn, type UploadImageResult, type UploadProgressEvent, type UseAttachmentsOptions, type UseAttachmentsReturn, type UsePlainEditorOptions, type UsePlainEditorReturn, createAttachment, createMentionInfo, defaultLocale, editorToMarkdown, extractPlainTextWithMentions, formatFileSize, isAllowedImageProtocol, isAllowedLinkProtocol, markdownToEditorContent, revokeAllAttachmentUrls, revokeAttachmentUrl, sanitizeImageUrl, sanitizeLinkUrl, useAttachments, useLocale, usePlainEditor, validateFile, validateMentionIndices };
672
+ export { type Attachment, type AttachmentLimitReason, AttachmentPreview, type AttachmentPreviewProps, type ComposerDraft, type EditorMode, IMComposer, type IMComposerLocale, type IMComposerProps, type IMComposerRef, LocaleProvider, type MarkdownMessagePayload, type Member, type MentionInfo, MentionList, type MentionListProps, type MessagePayload, type PlainMessagePayload, QuoteBar, type QuoteBarProps, type QuoteInfo, RichEditor, type RichEditorProps, type RichEditorRef, type RichToolbarConfig, type SendKeymap, type UploadImageFn, type UploadImageResult, type UploadProgressEvent, type UseAttachmentsOptions, type UseAttachmentsReturn, type UsePlainEditorOptions, type UsePlainEditorReturn, createAttachment, createMentionInfo, defaultLocale, editorToMarkdown, extractPlainTextWithMentions, formatFileSize, isAllowedImageProtocol, isAllowedLinkProtocol, markdownToEditorContent, revokeAllAttachmentUrls, revokeAttachmentUrl, sanitizeImageUrl, sanitizeLinkUrl, useAttachments, useLocale, usePlainEditor, validateFile, validateMentionIndices };