react-markdown-typer 1.0.0-beta.2 โ 1.0.0-beta.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/README.md +137 -141
- package/README.zh.md +129 -132
- package/es/MarkdownCMD/index.d.ts +3 -3
- package/es/MarkdownCMD/index.d.ts.map +1 -1
- package/es/MarkdownCMD/index.js +9 -6
- package/es/MarkdownCMD/index.js.map +1 -1
- package/es/MarkdownTyper/index.d.ts +5 -0
- package/es/MarkdownTyper/index.d.ts.map +1 -0
- package/es/{Markdown โ MarkdownTyper}/index.js +4 -4
- package/es/MarkdownTyper/index.js.map +1 -0
- package/es/defined.d.ts +7 -10
- package/es/defined.d.ts.map +1 -1
- package/es/hooks/useTypingTask.d.ts +2 -2
- package/es/hooks/useTypingTask.d.ts.map +1 -1
- package/es/index.d.ts +5 -5
- package/es/index.d.ts.map +1 -1
- package/es/index.js +3 -3
- package/es/index.js.map +1 -1
- package/package.json +1 -1
- package/es/Markdown/index.d.ts +0 -5
- package/es/Markdown/index.d.ts.map +0 -1
- package/es/Markdown/index.js.map +0 -1
- package/es/components/HighReactMarkdown/index.d.ts +0 -9
- package/es/components/HighReactMarkdown/index.d.ts.map +0 -1
- package/es/components/HighReactMarkdown/index.js +0 -7
- package/es/components/HighReactMarkdown/index.js.map +0 -1
package/README.md
CHANGED
|
@@ -59,7 +59,7 @@ A React component designed for modern AI applications, providing smooth real-tim
|
|
|
59
59
|
- [๐ 5-Minute Quick Start](#-5-minute-quick-start)
|
|
60
60
|
- [Basic Usage](#basic-usage)
|
|
61
61
|
- [Disable Typing Animation](#disable-typing-animation)
|
|
62
|
-
- [
|
|
62
|
+
- [Custom Markdown Processing](#custom-markdown-processing)
|
|
63
63
|
- [AI Chat Scenario](#ai-chat-scenario)
|
|
64
64
|
- [๐ฏ Advanced Callback Control](#-advanced-callback-control)
|
|
65
65
|
- [๐ Restart Animation Demo](#-restart-animation-demo)
|
|
@@ -68,16 +68,16 @@ A React component designed for modern AI applications, providing smooth real-tim
|
|
|
68
68
|
- [Default Exported Props for MarkdownTyper and MarkdownCMD](#default-exported-props-for-markdowntyper-and-markdowncmd)
|
|
69
69
|
- [IBeforeTypedChar](#ibeforetypedchar)
|
|
70
70
|
- [ITypedChar](#itypedchar)
|
|
71
|
-
- [
|
|
71
|
+
- [Custom Markdown Conversion](#custom-markdown-conversion)
|
|
72
72
|
- [IMarkdownPlugin](#imarkdownplugin)
|
|
73
73
|
- [Exposed Methods](#exposed-methods)
|
|
74
74
|
- [Default Export MarkdownTyper](#default-export-markdowntyper)
|
|
75
75
|
- [MarkdownCMD Exposed Methods](#markdowncmd-exposed-methods)
|
|
76
|
-
- [
|
|
77
|
-
- [Basic
|
|
78
|
-
- [
|
|
79
|
-
- [
|
|
80
|
-
- [
|
|
76
|
+
- [๐ง Custom Markdown Processing Guide](#-custom-markdown-processing-guide)
|
|
77
|
+
- [Basic Usage](#basic-usage-1)
|
|
78
|
+
- [Advanced Processing](#advanced-processing)
|
|
79
|
+
- [Integration with External Processors](#integration-with-external-processors)
|
|
80
|
+
- [Content Filtering](#content-filtering)
|
|
81
81
|
- [๐ Plugin System](#-plugin-system)
|
|
82
82
|
- [๐๏ธ Timer Modes Explained](#๏ธ-timer-modes-explained)
|
|
83
83
|
- [`requestAnimationFrame` Mode ๐ (Recommended)](#requestanimationframe-mode--recommended)
|
|
@@ -85,7 +85,7 @@ A React component designed for modern AI applications, providing smooth real-tim
|
|
|
85
85
|
- [๐ Performance Comparison](#-performance-comparison)
|
|
86
86
|
- [๐ก Practical Examples](#-practical-examples)
|
|
87
87
|
- [๐ AI Streaming Chat](#-ai-streaming-chat)
|
|
88
|
-
- [
|
|
88
|
+
- [๐ง Custom Markdown Processing Demo](#-custom-markdown-processing-demo)
|
|
89
89
|
- [๐ฏ Advanced Callback Control](#-advanced-callback-control-1)
|
|
90
90
|
|
|
91
91
|
---
|
|
@@ -186,19 +186,23 @@ function StaticDemo() {
|
|
|
186
186
|
}
|
|
187
187
|
```
|
|
188
188
|
|
|
189
|
-
###
|
|
189
|
+
### Custom Markdown Processing
|
|
190
190
|
|
|
191
191
|
```tsx
|
|
192
192
|
import MarkdownTyper from 'react-markdown-typer';
|
|
193
|
-
// If you need to display formulas, import the formula plugins
|
|
194
|
-
import remarkMath from 'remark-math';
|
|
195
|
-
import rehypeKatex from 'rehype-katex';
|
|
196
193
|
|
|
197
|
-
function
|
|
194
|
+
function CustomMarkdownDemo() {
|
|
195
|
+
const customConvertMarkdownString = (markdownString) => {
|
|
196
|
+
// Custom processing logic
|
|
197
|
+
return markdownString
|
|
198
|
+
.replace(/\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2" target="_blank">$1</a>') // Convert links
|
|
199
|
+
.replace(/\*\*([^*]+)\*\*/g, '<strong>$1</strong>') // Convert bold
|
|
200
|
+
.replace(/\*([^*]+)\*/g, '<em>$1</em>'); // Convert italic
|
|
201
|
+
};
|
|
202
|
+
|
|
198
203
|
return (
|
|
199
|
-
<MarkdownTyper interval={20}
|
|
200
|
-
#
|
|
201
|
-
hypotenuse For the classic "3-4-5 triangle": $c = \sqrt{3 ^ (2 + 4) ^ 2} = \sqrt{25} = 5$
|
|
204
|
+
<MarkdownTyper interval={20} customConvertMarkdownString={customConvertMarkdownString}>
|
|
205
|
+
# Custom Markdown Processing This is **bold text** and *italic text*. Check out [our website](https://example.com) for more info!
|
|
202
206
|
</MarkdownTyper>
|
|
203
207
|
);
|
|
204
208
|
}
|
|
@@ -237,10 +241,10 @@ Let's explore these new features together!`);
|
|
|
237
241
|
|
|
238
242
|
```tsx
|
|
239
243
|
import { useRef, useState } from 'react';
|
|
240
|
-
import { MarkdownCMD,
|
|
244
|
+
import { MarkdownCMD, MarkdownTyperCMDRef } from 'react-markdown-typer';
|
|
241
245
|
|
|
242
246
|
function AdvancedCallbackDemo() {
|
|
243
|
-
const markdownRef = useRef<
|
|
247
|
+
const markdownRef = useRef<MarkdownTyperCMDRef>(null);
|
|
244
248
|
const [typingStats, setTypingStats] = useState({ progress: 0, currentChar: '', totalChars: 0 });
|
|
245
249
|
|
|
246
250
|
const handleBeforeTypedChar = async (data) => {
|
|
@@ -313,10 +317,10 @@ function AdvancedCallbackDemo() {
|
|
|
313
317
|
|
|
314
318
|
```tsx
|
|
315
319
|
import { useRef, useState } from 'react';
|
|
316
|
-
import { MarkdownCMD,
|
|
320
|
+
import { MarkdownCMD, MarkdownTyperCMDRef } from 'react-markdown-typer';
|
|
317
321
|
|
|
318
322
|
function RestartDemo() {
|
|
319
|
-
const markdownRef = useRef<
|
|
323
|
+
const markdownRef = useRef<MarkdownTyperCMDRef>(null);
|
|
320
324
|
const [isPlaying, setIsPlaying] = useState(false);
|
|
321
325
|
const [hasStarted, setHasStarted] = useState(false);
|
|
322
326
|
|
|
@@ -398,10 +402,10 @@ function RestartDemo() {
|
|
|
398
402
|
|
|
399
403
|
```tsx
|
|
400
404
|
import { useRef, useState } from 'react';
|
|
401
|
-
import { MarkdownCMD,
|
|
405
|
+
import { MarkdownCMD, MarkdownTyperCMDRef } from 'react-markdown-typer';
|
|
402
406
|
|
|
403
407
|
function StartDemo() {
|
|
404
|
-
const markdownRef = useRef<
|
|
408
|
+
const markdownRef = useRef<MarkdownTyperCMDRef>(null);
|
|
405
409
|
const [isPlaying, setIsPlaying] = useState(false);
|
|
406
410
|
const [hasStarted, setHasStarted] = useState(false);
|
|
407
411
|
|
|
@@ -464,18 +468,18 @@ function StartDemo() {
|
|
|
464
468
|
import MarkdownTyper, { MarkdownCMD } from 'react-markdown-typer';
|
|
465
469
|
```
|
|
466
470
|
|
|
467
|
-
| Prop
|
|
468
|
-
|
|
|
469
|
-
| `interval`
|
|
470
|
-
| `timerType`
|
|
471
|
-
| `theme`
|
|
472
|
-
| `
|
|
473
|
-
| `onEnd`
|
|
474
|
-
| `onStart`
|
|
475
|
-
| `onBeforeTypedChar`
|
|
476
|
-
| `onTypedChar`
|
|
477
|
-
| `disableTyping`
|
|
478
|
-
| `autoStartTyping`
|
|
471
|
+
| Prop | Type | Description | Default |
|
|
472
|
+
| ----------------------------- | ------------------------------------------- | ------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
|
|
473
|
+
| `interval` | `number` | Typing interval (ms) | `30` |
|
|
474
|
+
| `timerType` | `'setTimeout'` \| `'requestAnimationFrame'` | Timer type, not dynamically changeable | Default is `setTimeout`, will switch to `requestAnimationFrame` in the future |
|
|
475
|
+
| `theme` | `'light'` \| `'dark'` | Theme type | `'light'` |
|
|
476
|
+
| `customConvertMarkdownString` | `(markdownString: string) => string` | Custom markdown string conversion function | - |
|
|
477
|
+
| `onEnd` | `(data: EndData) => void` | Typing end callback | - |
|
|
478
|
+
| `onStart` | `(data: StartData) => void` | Typing start callback | - |
|
|
479
|
+
| `onBeforeTypedChar` | `(data: IBeforeTypedChar) => Promise<void>` | Callback before typing a character, supports async, blocks next typing | - |
|
|
480
|
+
| `onTypedChar` | `(data: ITypedChar) => void` | Callback after each character | - |
|
|
481
|
+
| `disableTyping` | `boolean` | Disable typing animation | `false` |
|
|
482
|
+
| `autoStartTyping` | `boolean` | Whether to auto start typing animation, set false to trigger manually, not dynamically changeable | `true` |
|
|
479
483
|
|
|
480
484
|
> Note: If `disableTyping` changes from `true` to `false` during typing, all remaining characters will be displayed at once on the next typing trigger.
|
|
481
485
|
|
|
@@ -498,16 +502,23 @@ import MarkdownTyper, { MarkdownCMD } from 'react-markdown-typer';
|
|
|
498
502
|
| `currentStr` | `string` | Full string of current type | - |
|
|
499
503
|
| `percent` | `number` | Typing progress percent (0-100) | `0` |
|
|
500
504
|
|
|
501
|
-
####
|
|
505
|
+
#### Custom Markdown Conversion
|
|
502
506
|
|
|
503
|
-
|
|
504
|
-
| ------------- | ------------------------- | --------------------------- | ---------- |
|
|
505
|
-
| `splitSymbol` | `'dollar'` \| `'bracket'` | Math formula delimiter type | `'dollar'` |
|
|
507
|
+
The `customConvertMarkdownString` function allows you to preprocess markdown content before it's rendered. This is useful for:
|
|
506
508
|
|
|
507
|
-
|
|
509
|
+
- Custom markdown syntax extensions
|
|
510
|
+
- Content filtering or sanitization
|
|
511
|
+
- Integration with external markdown processors
|
|
512
|
+
- Custom link handling or formatting
|
|
508
513
|
|
|
509
|
-
|
|
510
|
-
|
|
514
|
+
**Example:**
|
|
515
|
+
|
|
516
|
+
```tsx
|
|
517
|
+
const customConvertMarkdownString = (markdownString) => {
|
|
518
|
+
// Add custom processing logic here
|
|
519
|
+
return markdownString.replace(/\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2" target="_blank">$1</a>').replace(/\*\*([^*]+)\*\*/g, '<strong>$1</strong>');
|
|
520
|
+
};
|
|
521
|
+
```
|
|
511
522
|
|
|
512
523
|
#### IMarkdownPlugin
|
|
513
524
|
|
|
@@ -547,90 +558,77 @@ markdownRef.current?.restart(); // Restart animation
|
|
|
547
558
|
|
|
548
559
|
---
|
|
549
560
|
|
|
550
|
-
##
|
|
551
|
-
|
|
552
|
-
<!-- [DEMO1: Pythagorean Theorem](https://stackblitz.com/edit/vitejs-vite-z94syu8j?file=src%2FApp.tsx) -->
|
|
561
|
+
## ๐ง Custom Markdown Processing Guide
|
|
553
562
|
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
### Basic Syntax
|
|
563
|
+
### Basic Usage
|
|
557
564
|
|
|
558
565
|
```tsx
|
|
559
|
-
import
|
|
560
|
-
import rehypeKatex from 'rehype-katex';
|
|
561
|
-
|
|
562
|
-
// 1. Enable math formula support
|
|
563
|
-
<MarkdownTyper reactMarkdownProps={{ remarkPlugins: [remarkMath], rehypePlugins: [rehypeKatex]}}>
|
|
564
|
-
# Math Formula Example
|
|
566
|
+
import MarkdownTyper from 'react-markdown-typer';
|
|
565
567
|
|
|
566
|
-
|
|
567
|
-
|
|
568
|
+
function CustomMarkdownDemo() {
|
|
569
|
+
const customConvertMarkdownString = (markdownString) => {
|
|
570
|
+
// Add your custom processing logic here
|
|
571
|
+
return markdownString
|
|
572
|
+
.replace(/\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2" target="_blank">$1</a>')
|
|
573
|
+
.replace(/\*\*([^*]+)\*\*/g, '<strong>$1</strong>')
|
|
574
|
+
.replace(/\*([^*]+)\*/g, '<em>$1</em>');
|
|
575
|
+
};
|
|
568
576
|
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
577
|
+
return (
|
|
578
|
+
<MarkdownTyper interval={20} customConvertMarkdownString={customConvertMarkdownString}>
|
|
579
|
+
# Custom Markdown Processing This is **bold text** and *italic text*. Check out [our website](https://example.com) for more info!
|
|
580
|
+
</MarkdownTyper>
|
|
581
|
+
);
|
|
582
|
+
}
|
|
572
583
|
```
|
|
573
584
|
|
|
574
|
-
###
|
|
585
|
+
### Advanced Processing
|
|
575
586
|
|
|
576
|
-
|
|
577
|
-
//
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
</
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
587
|
+
````tsx
|
|
588
|
+
// Complex custom processing example
|
|
589
|
+
const customConvertMarkdownString = (markdownString) => {
|
|
590
|
+
return (
|
|
591
|
+
markdownString
|
|
592
|
+
// Custom emoji processing
|
|
593
|
+
.replace(/:([a-zA-Z0-9_]+):/g, '<span class="emoji">:$1:</span>')
|
|
594
|
+
// Custom mention processing
|
|
595
|
+
.replace(/@([a-zA-Z0-9_]+)/g, '<span class="mention">@$1</span>')
|
|
596
|
+
// Custom code block processing
|
|
597
|
+
.replace(/```(\w+)\n([\s\S]*?)```/g, '<pre class="code-block"><code class="language-$1">$2</code></pre>')
|
|
598
|
+
// Custom link processing with security
|
|
599
|
+
.replace(/\[([^\]]+)\]\(([^)]+)\)/g, (match, text, url) => {
|
|
600
|
+
if (url.startsWith('http')) {
|
|
601
|
+
return `<a href="${url}" target="_blank" rel="noopener noreferrer">${text}</a>`;
|
|
602
|
+
}
|
|
603
|
+
return match;
|
|
604
|
+
})
|
|
605
|
+
);
|
|
606
|
+
};
|
|
607
|
+
````
|
|
595
608
|
|
|
596
|
-
###
|
|
609
|
+
### Integration with External Processors
|
|
597
610
|
|
|
598
611
|
```tsx
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
'$c = \\sqrt{3^2 + 4^2} = \\sqrt{25} = 5$\n\n',
|
|
609
|
-
'This theorem has wide applications in geometry!',
|
|
610
|
-
];
|
|
611
|
-
|
|
612
|
-
mathContent.forEach((chunk) => {
|
|
613
|
-
markdownRef.current?.push(chunk, 'answer');
|
|
614
|
-
});
|
|
612
|
+
import { marked } from 'marked';
|
|
613
|
+
|
|
614
|
+
const customConvertMarkdownString = (markdownString) => {
|
|
615
|
+
// Use marked.js for processing
|
|
616
|
+
return marked(markdownString, {
|
|
617
|
+
breaks: true,
|
|
618
|
+
gfm: true,
|
|
619
|
+
});
|
|
620
|
+
};
|
|
615
621
|
```
|
|
616
622
|
|
|
617
|
-
###
|
|
618
|
-
|
|
619
|
-
```css
|
|
620
|
-
/* Math formula style customization */
|
|
621
|
-
.katex {
|
|
622
|
-
font-size: 1.1em;
|
|
623
|
-
}
|
|
623
|
+
### Content Filtering
|
|
624
624
|
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
625
|
+
```tsx
|
|
626
|
+
const customConvertMarkdownString = (markdownString) => {
|
|
627
|
+
// Filter out sensitive content
|
|
628
|
+
const filteredContent = markdownString.replace(/password[:\s]*[^\s]+/gi, 'password: [FILTERED]').replace(/token[:\s]*[^\s]+/gi, 'token: [FILTERED]');
|
|
629
629
|
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
color: #e1e1e1;
|
|
633
|
-
}
|
|
630
|
+
return filteredContent;
|
|
631
|
+
};
|
|
634
632
|
```
|
|
635
633
|
|
|
636
634
|
---
|
|
@@ -696,10 +694,10 @@ High frequency: use `requestAnimationFrame`, low frequency: use `setTimeout`
|
|
|
696
694
|
|
|
697
695
|
````tsx
|
|
698
696
|
import { useRef } from 'react';
|
|
699
|
-
import { MarkdownCMD,
|
|
697
|
+
import { MarkdownCMD, MarkdownTyperCMDRef } from 'react-markdown-typer';
|
|
700
698
|
|
|
701
699
|
function StreamingChat() {
|
|
702
|
-
const markdownRef = useRef<
|
|
700
|
+
const markdownRef = useRef<MarkdownTyperCMDRef>(null);
|
|
703
701
|
|
|
704
702
|
// Simulate AI streaming response
|
|
705
703
|
const simulateAIResponse = async () => {
|
|
@@ -752,31 +750,35 @@ function StreamingChat() {
|
|
|
752
750
|
const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
753
751
|
````
|
|
754
752
|
|
|
755
|
-
###
|
|
753
|
+
### ๐ง Custom Markdown Processing Demo
|
|
756
754
|
|
|
757
755
|
```tsx
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
756
|
+
function CustomMarkdownStreamingDemo() {
|
|
757
|
+
const markdownRef = useRef<MarkdownTyperCMDRef>(null);
|
|
758
|
+
|
|
759
|
+
const customConvertMarkdownString = (markdownString) => {
|
|
760
|
+
return markdownString
|
|
761
|
+
.replace(/\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>')
|
|
762
|
+
.replace(/\*\*([^*]+)\*\*/g, '<strong>$1</strong>')
|
|
763
|
+
.replace(/\*([^*]+)\*/g, '<em>$1</em>')
|
|
764
|
+
.replace(/`([^`]+)`/g, '<code>$1</code>');
|
|
765
|
+
};
|
|
763
766
|
|
|
764
|
-
const
|
|
767
|
+
const simulateCustomResponse = async () => {
|
|
765
768
|
markdownRef.current?.clear();
|
|
766
769
|
|
|
767
|
-
const
|
|
768
|
-
'#
|
|
769
|
-
'
|
|
770
|
-
'
|
|
771
|
-
'
|
|
772
|
-
'-
|
|
773
|
-
'-
|
|
774
|
-
'
|
|
775
|
-
'
|
|
776
|
-
'This theorem has wide applications in geometry!',
|
|
770
|
+
const customChunks = [
|
|
771
|
+
'# Custom Markdown Processing\n\n',
|
|
772
|
+
'This demo shows how to use **custom markdown processing** with streaming content:\n\n',
|
|
773
|
+
'## Features\n',
|
|
774
|
+
'- *Custom link handling*\n',
|
|
775
|
+
'- **Bold and italic** text processing\n',
|
|
776
|
+
'- `Inline code` formatting\n',
|
|
777
|
+
'- [External links](https://example.com) with security attributes\n\n',
|
|
778
|
+
'The `customConvertMarkdownString` function allows you to preprocess content before rendering!',
|
|
777
779
|
];
|
|
778
780
|
|
|
779
|
-
for (const chunk of
|
|
781
|
+
for (const chunk of customChunks) {
|
|
780
782
|
await delay(150);
|
|
781
783
|
markdownRef.current?.push(chunk, 'answer');
|
|
782
784
|
}
|
|
@@ -784,15 +786,9 @@ function MathStreamingDemo() {
|
|
|
784
786
|
|
|
785
787
|
return (
|
|
786
788
|
<div>
|
|
787
|
-
<button onClick={
|
|
788
|
-
|
|
789
|
-
<MarkdownCMD
|
|
790
|
-
ref={markdownRef}
|
|
791
|
-
interval={20}
|
|
792
|
-
timerType="requestAnimationFrame"
|
|
793
|
-
reactMarkdownProps={{ remarkPlugins: [remarkMath], rehypePlugins: [rehypeKatex] }}
|
|
794
|
-
math={{ splitSymbol: 'dollar' }}
|
|
795
|
-
/>
|
|
789
|
+
<button onClick={simulateCustomResponse}>๐ง Custom Markdown Demo</button>
|
|
790
|
+
|
|
791
|
+
<MarkdownCMD ref={markdownRef} interval={20} timerType="requestAnimationFrame" customConvertMarkdownString={customConvertMarkdownString} />
|
|
796
792
|
</div>
|
|
797
793
|
);
|
|
798
794
|
}
|
|
@@ -802,10 +798,10 @@ function MathStreamingDemo() {
|
|
|
802
798
|
|
|
803
799
|
```tsx
|
|
804
800
|
import { useRef, useState } from 'react';
|
|
805
|
-
import { MarkdownCMD,
|
|
801
|
+
import { MarkdownCMD, MarkdownTyperCMDRef } from 'react-markdown-typer';
|
|
806
802
|
|
|
807
803
|
function AdvancedCallbackDemo() {
|
|
808
|
-
const markdownRef = useRef<
|
|
804
|
+
const markdownRef = useRef<MarkdownTyperCMDRef>(null);
|
|
809
805
|
const [typingStats, setTypingStats] = useState({ progress: 0, currentChar: '', totalChars: 0 });
|
|
810
806
|
|
|
811
807
|
const handleBeforeTypedChar = async (data) => {
|
package/README.zh.md
CHANGED
|
@@ -155,18 +155,23 @@ function StaticDemo() {
|
|
|
155
155
|
}
|
|
156
156
|
```
|
|
157
157
|
|
|
158
|
-
###
|
|
158
|
+
### ่ชๅฎไน Markdown ๅค็
|
|
159
159
|
|
|
160
160
|
```tsx
|
|
161
161
|
import MarkdownTyper from 'react-markdown-typer';
|
|
162
|
-
// ๅฆๆ้่ฆๅฑ็คบๅ
ฌๅผ๏ผๅ้่ฆๅผๅ
ฅๅ
ฌๅผ่ฝฌๆขๆไปถ
|
|
163
|
-
import remarkMath from 'remark-math';
|
|
164
|
-
import rehypeKatex from 'rehype-katex';
|
|
165
162
|
|
|
166
|
-
function
|
|
163
|
+
function CustomMarkdownDemo() {
|
|
164
|
+
const customConvertMarkdownString = (markdownString) => {
|
|
165
|
+
// ่ชๅฎไนๅค็้ป่พ
|
|
166
|
+
return markdownString
|
|
167
|
+
.replace(/\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2" target="_blank">$1</a>') // ่ฝฌๆข้พๆฅ
|
|
168
|
+
.replace(/\*\*([^*]+)\*\*/g, '<strong>$1</strong>') // ่ฝฌๆข็ฒไฝ
|
|
169
|
+
.replace(/\*([^*]+)\*/g, '<em>$1</em>'); // ่ฝฌๆขๆไฝ
|
|
170
|
+
};
|
|
171
|
+
|
|
167
172
|
return (
|
|
168
|
-
<MarkdownTyper interval={20}
|
|
169
|
-
#
|
|
173
|
+
<MarkdownTyper interval={20} customConvertMarkdownString={customConvertMarkdownString}>
|
|
174
|
+
# ่ชๅฎไน Markdown ๅค็ ่ฟๆฏ**็ฒไฝๆๅญ**ๅ*ๆไฝๆๅญ*ใๆฅ็[ๆไปฌ็็ฝ็ซ](https://example.com)ไบ่งฃๆดๅคไฟกๆฏ๏ผ
|
|
170
175
|
</MarkdownTyper>
|
|
171
176
|
);
|
|
172
177
|
}
|
|
@@ -205,10 +210,10 @@ React 19 ๅธฆๆฅไบ่ฎธๅคๆฟๅจไบบๅฟ็ๆฐ็นๆง๏ผ
|
|
|
205
210
|
|
|
206
211
|
```tsx
|
|
207
212
|
import { useRef, useState } from 'react';
|
|
208
|
-
import { MarkdownCMD,
|
|
213
|
+
import { MarkdownCMD, MarkdownTyperCMDRef } from 'react-markdown-typer';
|
|
209
214
|
|
|
210
215
|
function AdvancedCallbackDemo() {
|
|
211
|
-
const markdownRef = useRef<
|
|
216
|
+
const markdownRef = useRef<MarkdownTyperCMDRef>(null);
|
|
212
217
|
const [typingStats, setTypingStats] = useState({ progress: 0, currentChar: '', totalChars: 0 });
|
|
213
218
|
|
|
214
219
|
const handleBeforeTypedChar = async (data) => {
|
|
@@ -281,10 +286,10 @@ function AdvancedCallbackDemo() {
|
|
|
281
286
|
|
|
282
287
|
```tsx
|
|
283
288
|
import { useRef, useState } from 'react';
|
|
284
|
-
import { MarkdownCMD,
|
|
289
|
+
import { MarkdownCMD, MarkdownTyperCMDRef } from 'react-markdown-typer';
|
|
285
290
|
|
|
286
291
|
function RestartDemo() {
|
|
287
|
-
const markdownRef = useRef<
|
|
292
|
+
const markdownRef = useRef<MarkdownTyperCMDRef>(null);
|
|
288
293
|
const [isPlaying, setIsPlaying] = useState(false);
|
|
289
294
|
const [hasStarted, setHasStarted] = useState(false);
|
|
290
295
|
|
|
@@ -366,10 +371,10 @@ function RestartDemo() {
|
|
|
366
371
|
|
|
367
372
|
```tsx
|
|
368
373
|
import { useRef, useState } from 'react';
|
|
369
|
-
import { MarkdownCMD,
|
|
374
|
+
import { MarkdownCMD, MarkdownTyperCMDRef } from 'react-markdown-typer';
|
|
370
375
|
|
|
371
376
|
function StartDemo() {
|
|
372
|
-
const markdownRef = useRef<
|
|
377
|
+
const markdownRef = useRef<MarkdownTyperCMDRef>(null);
|
|
373
378
|
const [isPlaying, setIsPlaying] = useState(false);
|
|
374
379
|
const [hasStarted, setHasStarted] = useState(false);
|
|
375
380
|
|
|
@@ -432,18 +437,18 @@ function StartDemo() {
|
|
|
432
437
|
import MarkdownTyper, { MarkdownCMD } from 'react-markdown-typer';
|
|
433
438
|
```
|
|
434
439
|
|
|
435
|
-
| ๅฑๆง
|
|
436
|
-
|
|
|
437
|
-
| `interval`
|
|
438
|
-
| `timerType`
|
|
439
|
-
| `theme`
|
|
440
|
-
| `
|
|
441
|
-
| `onEnd`
|
|
442
|
-
| `onStart`
|
|
443
|
-
| `onBeforeTypedChar`
|
|
444
|
-
| `onTypedChar`
|
|
445
|
-
| `disableTyping`
|
|
446
|
-
| `autoStartTyping`
|
|
440
|
+
| ๅฑๆง | ็ฑปๅ | ่ฏดๆ | ้ป่ฎคๅผ |
|
|
441
|
+
| ----------------------------- | ------------------------------------------- | ------------------------------------------------------------- | ----------------------------------------------------------- |
|
|
442
|
+
| `interval` | `number` | ๆๅญ้ด้ (ๆฏซ็ง) | `30` |
|
|
443
|
+
| `timerType` | `'setTimeout'` \| `'requestAnimationFrame'` | ๅฎๆถๅจ็ฑปๅ๏ผไธๆฏๆๅจๆไฟฎๆน | ๅฝๅ้ป่ฎคๅผๆฏ`setTimeout`๏ผๅๆไผๆนไธบ`requestAnimationFrame` |
|
|
444
|
+
| `theme` | `'light'` \| `'dark'` | ไธป้ข็ฑปๅ | `'light'` |
|
|
445
|
+
| `customConvertMarkdownString` | `(markdownString: string) => string` | ่ชๅฎไน markdown ๅญ็ฌฆไธฒ่ฝฌๆขๅฝๆฐ | - |
|
|
446
|
+
| `onEnd` | `(data: EndData) => void` | ๆๅญ็ปๆๅ่ฐ | - |
|
|
447
|
+
| `onStart` | `(data: StartData) => void` | ๆๅญๅผๅงๅ่ฐ | - |
|
|
448
|
+
| `onBeforeTypedChar` | `(data: IBeforeTypedChar) => Promise<void>` | ๅญ็ฌฆๆๅญๅ็ๅ่ฐ๏ผๆฏๆๅผๆญฅๆไฝ๏ผไผ้ปๅกไนๅ็ๆๅญ | - |
|
|
449
|
+
| `onTypedChar` | `(data: ITypedChar) => void` | ๆฏๅญ็ฌฆๆๅญๅ็ๅ่ฐ | - |
|
|
450
|
+
| `disableTyping` | `boolean` | ็ฆ็จๆๅญๅจ็ปๆๆ | `false` |
|
|
451
|
+
| `autoStartTyping` | `boolean` | ๆฏๅฆ่ชๅจๅผๅงๆๅญๅจ็ป๏ผ่ฎพไธบ false ๆถ้ๆๅจ่งฆๅ๏ผไธๆฏๆๅจๆไฟฎๆน | `true` |
|
|
447
452
|
|
|
448
453
|
> ๆณจๆ๏ผ ๅฆๆๅฝๅจๆๅญไธญ `disableTyping`ไป `true` ๅไธบ `false`๏ผๅๅจไธไธไธชๆๅญ่งฆๅๆถ๏ผไผๆๅฉไธ็ๆๆๅญไธๆฌกๆงๆพ็คบ
|
|
449
454
|
|
|
@@ -466,16 +471,23 @@ import MarkdownTyper, { MarkdownCMD } from 'react-markdown-typer';
|
|
|
466
471
|
| `currentStr` | `string` | ๅฝๅ็ฑปๅๅ
ๅฎน็ๅฎๆดๅญ็ฌฆไธฒ | - |
|
|
467
472
|
| `percent` | `number` | ๆๅญ่ฟๅบฆ็พๅๆฏ (0-100) | `0` |
|
|
468
473
|
|
|
469
|
-
####
|
|
474
|
+
#### ่ชๅฎไน Markdown ่ฝฌๆข
|
|
470
475
|
|
|
471
|
-
|
|
472
|
-
| ------------- | ------------------------- | ------------------ | ---------- |
|
|
473
|
-
| `splitSymbol` | `'dollar'` \| `'bracket'` | ๆฐๅญฆๅ
ฌๅผๅ้็ฌฆ็ฑปๅ | `'dollar'` |
|
|
476
|
+
`customConvertMarkdownString` ๅฝๆฐๅ
่ฎธๆจๅจๆธฒๆๅ้ขๅค็ markdown ๅ
ๅฎนใ่ฟ้็จไบ๏ผ
|
|
474
477
|
|
|
475
|
-
|
|
478
|
+
- ่ชๅฎไน markdown ่ฏญๆณๆฉๅฑ
|
|
479
|
+
- ๅ
ๅฎน่ฟๆปคๆๆธ
็
|
|
480
|
+
- ไธๅค้จ markdown ๅค็ๅจ้ๆ
|
|
481
|
+
- ่ชๅฎไน้พๆฅๅค็ๆๆ ผๅผๅ
|
|
476
482
|
|
|
477
|
-
|
|
478
|
-
|
|
483
|
+
**็คบไพ๏ผ**
|
|
484
|
+
|
|
485
|
+
```tsx
|
|
486
|
+
const customConvertMarkdownString = (markdownString) => {
|
|
487
|
+
// ๅจ่ฟ้ๆทปๅ ่ชๅฎไนๅค็้ป่พ
|
|
488
|
+
return markdownString.replace(/\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2" target="_blank">$1</a>').replace(/\*\*([^*]+)\*\*/g, '<strong>$1</strong>');
|
|
489
|
+
};
|
|
490
|
+
```
|
|
479
491
|
|
|
480
492
|
#### IMarkdownPlugin
|
|
481
493
|
|
|
@@ -515,90 +527,77 @@ markdownRef.current?.restart(); // ้ๆฐๅผๅงๅจ็ป
|
|
|
515
527
|
|
|
516
528
|
---
|
|
517
529
|
|
|
518
|
-
##
|
|
519
|
-
|
|
520
|
-
<!-- [DEMO1๏ผๅพ่กๅฎ็](https://stackblitz.com/edit/vitejs-vite-z94syu8j?file=src%2FApp.tsx) -->
|
|
521
|
-
|
|
522
|
-
<!-- [DEMO2๏ผ้ข็ฎ่งฃ็ญ](https://stackblitz.com/edit/vitejs-vite-xk9lxagc?file=README.md) -->
|
|
530
|
+
## ๐ง ่ชๅฎไน Markdown ๅค็ๆๅ
|
|
523
531
|
|
|
524
|
-
###
|
|
532
|
+
### ๅบๆฌ็จๆณ
|
|
525
533
|
|
|
526
534
|
```tsx
|
|
527
|
-
import
|
|
528
|
-
import rehypeKatex from 'rehype-katex';
|
|
529
|
-
|
|
530
|
-
// 1. ๅฏ็จๆฐๅญฆๅ
ฌๅผๆฏๆ
|
|
531
|
-
<MarkdownTyper reactMarkdownProps={{ remarkPlugins: [remarkMath], rehypePlugins: [rehypeKatex]}}>
|
|
532
|
-
# ๆฐๅญฆๅ
ฌๅผ็คบไพ
|
|
535
|
+
import MarkdownTyper from 'react-markdown-typer';
|
|
533
536
|
|
|
534
|
-
|
|
535
|
-
|
|
537
|
+
function CustomMarkdownDemo() {
|
|
538
|
+
const customConvertMarkdownString = (markdownString) => {
|
|
539
|
+
// ๅจ่ฟ้ๆทปๅ ๆจ็่ชๅฎไนๅค็้ป่พ
|
|
540
|
+
return markdownString
|
|
541
|
+
.replace(/\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2" target="_blank">$1</a>')
|
|
542
|
+
.replace(/\*\*([^*]+)\*\*/g, '<strong>$1</strong>')
|
|
543
|
+
.replace(/\*([^*]+)\*/g, '<em>$1</em>');
|
|
544
|
+
};
|
|
536
545
|
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
546
|
+
return (
|
|
547
|
+
<MarkdownTyper interval={20} customConvertMarkdownString={customConvertMarkdownString}>
|
|
548
|
+
# ่ชๅฎไน Markdown ๅค็ ่ฟๆฏ**็ฒไฝๆๅญ**ๅ*ๆไฝๆๅญ*ใๆฅ็[ๆไปฌ็็ฝ็ซ](https://example.com)ไบ่งฃๆดๅคไฟกๆฏ๏ผ
|
|
549
|
+
</MarkdownTyper>
|
|
550
|
+
);
|
|
551
|
+
}
|
|
540
552
|
```
|
|
541
553
|
|
|
542
|
-
###
|
|
554
|
+
### ้ซ็บงๅค็
|
|
543
555
|
|
|
544
|
-
|
|
545
|
-
//
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
</
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
556
|
+
````tsx
|
|
557
|
+
// ๅคๆ็่ชๅฎไนๅค็็คบไพ
|
|
558
|
+
const customConvertMarkdownString = (markdownString) => {
|
|
559
|
+
return (
|
|
560
|
+
markdownString
|
|
561
|
+
// ่ชๅฎไน่กจๆ
็ฌฆๅทๅค็
|
|
562
|
+
.replace(/:([a-zA-Z0-9_]+):/g, '<span class="emoji">:$1:</span>')
|
|
563
|
+
// ่ชๅฎไนๆๅๅค็
|
|
564
|
+
.replace(/@([a-zA-Z0-9_]+)/g, '<span class="mention">@$1</span>')
|
|
565
|
+
// ่ชๅฎไนไปฃ็ ๅๅค็
|
|
566
|
+
.replace(/```(\w+)\n([\s\S]*?)```/g, '<pre class="code-block"><code class="language-$1">$2</code></pre>')
|
|
567
|
+
// ่ชๅฎไน้พๆฅๅค็๏ผๅธฆๅฎๅ
จๆง๏ผ
|
|
568
|
+
.replace(/\[([^\]]+)\]\(([^)]+)\)/g, (match, text, url) => {
|
|
569
|
+
if (url.startsWith('http')) {
|
|
570
|
+
return `<a href="${url}" target="_blank" rel="noopener noreferrer">${text}</a>`;
|
|
571
|
+
}
|
|
572
|
+
return match;
|
|
573
|
+
})
|
|
574
|
+
);
|
|
575
|
+
};
|
|
576
|
+
````
|
|
563
577
|
|
|
564
|
-
###
|
|
578
|
+
### ไธๅค้จๅค็ๅจ้ๆ
|
|
565
579
|
|
|
566
580
|
```tsx
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
'$c = \\sqrt{3^2 + 4^2} = \\sqrt{25} = 5$\n\n',
|
|
577
|
-
'่ฟไธชๅฎ็ๅจๅ ไฝๅญฆไธญๆ็ๅนฟๆณ็ๅบ็จ๏ผ',
|
|
578
|
-
];
|
|
579
|
-
|
|
580
|
-
mathContent.forEach((chunk) => {
|
|
581
|
-
markdownRef.current?.push(chunk, 'answer');
|
|
582
|
-
});
|
|
581
|
+
import { marked } from 'marked';
|
|
582
|
+
|
|
583
|
+
const customConvertMarkdownString = (markdownString) => {
|
|
584
|
+
// ไฝฟ็จ marked.js ่ฟ่กๅค็
|
|
585
|
+
return marked(markdownString, {
|
|
586
|
+
breaks: true,
|
|
587
|
+
gfm: true,
|
|
588
|
+
});
|
|
589
|
+
};
|
|
583
590
|
```
|
|
584
591
|
|
|
585
|
-
###
|
|
586
|
-
|
|
587
|
-
```css
|
|
588
|
-
/* ๆฐๅญฆๅ
ฌๅผๆ ทๅผๅฎๅถ */
|
|
589
|
-
.katex {
|
|
590
|
-
font-size: 1.1em;
|
|
591
|
-
}
|
|
592
|
+
### ๅ
ๅฎน่ฟๆปค
|
|
592
593
|
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
594
|
+
```tsx
|
|
595
|
+
const customConvertMarkdownString = (markdownString) => {
|
|
596
|
+
// ่ฟๆปคๆๆๅ
ๅฎน
|
|
597
|
+
const filteredContent = markdownString.replace(/password[:\s]*[^\s]+/gi, 'password: [ๅทฒ่ฟๆปค]').replace(/token[:\s]*[^\s]+/gi, 'token: [ๅทฒ่ฟๆปค]');
|
|
597
598
|
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
color: #e1e1e1;
|
|
601
|
-
}
|
|
599
|
+
return filteredContent;
|
|
600
|
+
};
|
|
602
601
|
```
|
|
603
602
|
|
|
604
603
|
---
|
|
@@ -664,10 +663,10 @@ mathContent.forEach((chunk) => {
|
|
|
664
663
|
|
|
665
664
|
````tsx
|
|
666
665
|
import { useRef } from 'react';
|
|
667
|
-
import { MarkdownCMD,
|
|
666
|
+
import { MarkdownCMD, MarkdownTyperCMDRef } from 'react-markdown-typer';
|
|
668
667
|
|
|
669
668
|
function StreamingChat() {
|
|
670
|
-
const markdownRef = useRef<
|
|
669
|
+
const markdownRef = useRef<MarkdownTyperCMDRef>(null);
|
|
671
670
|
|
|
672
671
|
// ๆจกๆ AI ๆตๅผๅๅบ
|
|
673
672
|
const simulateAIResponse = async () => {
|
|
@@ -720,31 +719,35 @@ function StreamingChat() {
|
|
|
720
719
|
const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
721
720
|
````
|
|
722
721
|
|
|
723
|
-
###
|
|
722
|
+
### ๐ง ่ชๅฎไน Markdown ๅค็ๆผ็คบ
|
|
724
723
|
|
|
725
724
|
```tsx
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
725
|
+
function CustomMarkdownStreamingDemo() {
|
|
726
|
+
const markdownRef = useRef<MarkdownTyperCMDRef>(null);
|
|
727
|
+
|
|
728
|
+
const customConvertMarkdownString = (markdownString) => {
|
|
729
|
+
return markdownString
|
|
730
|
+
.replace(/\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>')
|
|
731
|
+
.replace(/\*\*([^*]+)\*\*/g, '<strong>$1</strong>')
|
|
732
|
+
.replace(/\*([^*]+)\*/g, '<em>$1</em>')
|
|
733
|
+
.replace(/`([^`]+)`/g, '<code>$1</code>');
|
|
734
|
+
};
|
|
731
735
|
|
|
732
|
-
const
|
|
736
|
+
const simulateCustomResponse = async () => {
|
|
733
737
|
markdownRef.current?.clear();
|
|
734
738
|
|
|
735
|
-
const
|
|
736
|
-
'#
|
|
737
|
-
'
|
|
738
|
-
'
|
|
739
|
-
'
|
|
740
|
-
'-
|
|
741
|
-
'-
|
|
742
|
-
'
|
|
743
|
-
'
|
|
744
|
-
'่ฟไธชๅฎ็ๅจๅ ไฝๅญฆไธญๆ็ๅนฟๆณ็ๅบ็จ๏ผ',
|
|
739
|
+
const customChunks = [
|
|
740
|
+
'# ่ชๅฎไน Markdown ๅค็\n\n',
|
|
741
|
+
'่ฟไธชๆผ็คบๅฑ็คบไบๅฆไฝๅจๆตๅผๅ
ๅฎนไธญไฝฟ็จ**่ชๅฎไน markdown ๅค็**๏ผ\n\n',
|
|
742
|
+
'## ๅ่ฝ็นๆง\n',
|
|
743
|
+
'- *่ชๅฎไน้พๆฅๅค็*\n',
|
|
744
|
+
'- **็ฒไฝๅๆไฝ**ๆๅญๅค็\n',
|
|
745
|
+
'- `่กๅ
ไปฃ็ `ๆ ผๅผๅ\n',
|
|
746
|
+
'- [ๅค้จ้พๆฅ](https://example.com) ๅธฆๅฎๅ
จๅฑๆง\n\n',
|
|
747
|
+
'`customConvertMarkdownString` ๅฝๆฐๅ
่ฎธๆจๅจๆธฒๆๅ้ขๅค็ๅ
ๅฎน๏ผ',
|
|
745
748
|
];
|
|
746
749
|
|
|
747
|
-
for (const chunk of
|
|
750
|
+
for (const chunk of customChunks) {
|
|
748
751
|
await delay(150);
|
|
749
752
|
markdownRef.current?.push(chunk, 'answer');
|
|
750
753
|
}
|
|
@@ -752,15 +755,9 @@ function MathStreamingDemo() {
|
|
|
752
755
|
|
|
753
756
|
return (
|
|
754
757
|
<div>
|
|
755
|
-
<button onClick={
|
|
756
|
-
|
|
757
|
-
<MarkdownCMD
|
|
758
|
-
ref={markdownRef}
|
|
759
|
-
interval={20}
|
|
760
|
-
timerType="requestAnimationFrame"
|
|
761
|
-
reactMarkdownProps={{ remarkPlugins: [remarkMath], rehypePlugins: [rehypeKatex] }}
|
|
762
|
-
math={{ splitSymbol: 'dollar' }}
|
|
763
|
-
/>
|
|
758
|
+
<button onClick={simulateCustomResponse}>๐ง ่ชๅฎไน Markdown ๆผ็คบ</button>
|
|
759
|
+
|
|
760
|
+
<MarkdownCMD ref={markdownRef} interval={20} timerType="requestAnimationFrame" customConvertMarkdownString={customConvertMarkdownString} />
|
|
764
761
|
</div>
|
|
765
762
|
);
|
|
766
763
|
}
|
|
@@ -770,10 +767,10 @@ function MathStreamingDemo() {
|
|
|
770
767
|
|
|
771
768
|
```tsx
|
|
772
769
|
import { useRef, useState } from 'react';
|
|
773
|
-
import { MarkdownCMD,
|
|
770
|
+
import { MarkdownCMD, MarkdownTyperCMDRef } from 'react-markdown-typer';
|
|
774
771
|
|
|
775
772
|
function AdvancedCallbackDemo() {
|
|
776
|
-
const markdownRef = useRef<
|
|
773
|
+
const markdownRef = useRef<MarkdownTyperCMDRef>(null);
|
|
777
774
|
const [typingStats, setTypingStats] = useState({ progress: 0, currentChar: '', totalChars: 0 });
|
|
778
775
|
|
|
779
776
|
const handleBeforeTypedChar = async (data) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const
|
|
3
|
-
export default
|
|
1
|
+
import { MarkdownTyperCMDProps, MarkdownTyperCMDRef } from '../defined';
|
|
2
|
+
declare const MarkdownTyperCMD: import("react").ForwardRefExoticComponent<MarkdownTyperCMDProps & import("react").RefAttributes<MarkdownTyperCMDRef>>;
|
|
3
|
+
export default MarkdownTyperCMD;
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/MarkdownCMD/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/MarkdownCMD/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAwB,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAM9F,QAAA,MAAM,gBAAgB,uHAkLrB,CAAC;AAMF,eAAe,gBAAgB,CAAC"}
|
package/es/MarkdownCMD/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef, useImperativeHandle, useRef, useState } from 'react';
|
|
2
|
+
import { forwardRef, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import { __DEV__ } from '../constant.js';
|
|
4
4
|
import { useTypingTask } from '../hooks/useTypingTask.js';
|
|
5
|
-
import
|
|
5
|
+
import ReactMarkdown from 'react-markdown';
|
|
6
6
|
import { splitGraphemes } from '../utils/grapheme.js';
|
|
7
|
-
const
|
|
7
|
+
const MarkdownTyperCMD = forwardRef(({ interval = 30, onEnd, onStart, onTypedChar, onBeforeTypedChar, timerType = 'setTimeout', reactMarkdownProps, disableTyping = false, autoStartTyping = true, customConvertMarkdownString }, ref) => {
|
|
8
8
|
/** ๆฏๅฆ่ชๅจๅผๅฏๆๅญๅจ็ป, ๅ้ขๅ็ๅๅๅฐไธไผ็ๆ */
|
|
9
9
|
const autoStartTypingRef = useRef(autoStartTyping);
|
|
10
10
|
/** ๆฏๅฆๆ่ฟๅญ */
|
|
@@ -153,10 +153,13 @@ const MarkdownCMD = forwardRef(({ interval = 30, onEnd, onStart, onTypedChar, on
|
|
|
153
153
|
typingTask.restart();
|
|
154
154
|
},
|
|
155
155
|
}));
|
|
156
|
-
|
|
156
|
+
const markdownString = useMemo(() => {
|
|
157
|
+
return (customConvertMarkdownString === null || customConvertMarkdownString === void 0 ? void 0 : customConvertMarkdownString(wholeContentRef.current.content)) || wholeContentRef.current.content;
|
|
158
|
+
}, [wholeContentRef.current.content, customConvertMarkdownString]);
|
|
159
|
+
return _jsx(ReactMarkdown, { ...reactMarkdownProps, children: markdownString });
|
|
157
160
|
});
|
|
158
161
|
if (__DEV__) {
|
|
159
|
-
|
|
162
|
+
MarkdownTyperCMD.displayName = 'MarkdownTyperCMD';
|
|
160
163
|
}
|
|
161
|
-
export default
|
|
164
|
+
export default MarkdownTyperCMD;
|
|
162
165
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/MarkdownCMD/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/MarkdownCMD/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,OAAO,EAAE,M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C;AAEF,IAAI,OAAO,EAAE,CAAC;IACZ,gBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC;AACpD,CAAC;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MarkdownTyperProps } from '../defined';
|
|
3
|
+
declare const _default: React.NamedExoticComponent<MarkdownTyperProps & React.RefAttributes<import("../defined").MarkdownBaseRef>>;
|
|
4
|
+
export default _default;
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/MarkdownTyper/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4E,MAAM,OAAO,CAAC;AAEjG,OAAO,EAAuB,kBAAkB,EAAoB,MAAM,YAAY,CAAC;;AAuEvF,wBAAmC"}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef, memo, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
|
|
3
3
|
import { __DEV__ } from '../constant.js';
|
|
4
4
|
import MarkdownCMD from '../MarkdownCMD/index.js';
|
|
5
|
-
const
|
|
5
|
+
const MarkdownTyperInner = ({ children: _children = '', markdownRef, ...rest }) => {
|
|
6
6
|
const cmdRef = useRef(null);
|
|
7
7
|
const prefixRef = useRef('');
|
|
8
8
|
const content = useMemo(() => {
|
|
@@ -52,14 +52,14 @@ const MarkdownInner = ({ children: _children = '', markdownRef, ...rest }) => {
|
|
|
52
52
|
}));
|
|
53
53
|
return _jsx(MarkdownCMD, { ref: cmdRef, ...rest });
|
|
54
54
|
};
|
|
55
|
-
const
|
|
55
|
+
const MarkdownTyper = forwardRef((props, ref) => {
|
|
56
56
|
const { children = '' } = props;
|
|
57
57
|
if (__DEV__) {
|
|
58
58
|
if (typeof children !== 'string') {
|
|
59
59
|
throw new Error('Markdown component must have a string child');
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
return _jsx(
|
|
62
|
+
return _jsx(MarkdownTyperInner, { ...props, markdownRef: ref });
|
|
63
63
|
});
|
|
64
|
-
export default memo(
|
|
64
|
+
export default memo(MarkdownTyper);
|
|
65
65
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/MarkdownTyper/index.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjG,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,WAAW,MAAM,gBAAgB,CAAC;AAMzC,MAAM,kBAAkB,GAAsC,CAAC,EAAE,QAAQ,EAAE,SAAS,GAAG,EAAE,EAAE,WAAW,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE;IACnH,MAAM,MAAM,GAAG,MAAM,CAAsB,IAAK,CAAC,CAAC;IAClD,MAAM,SAAS,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;IAC7B,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,EAAE;QAC3B,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE,CAAC;YAClC,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,CAAC,KAAK,CAAC,6CAA6C,CAAC,CAAC;QAC/D,CAAC;QACD,OAAO,EAAE,CAAC;IACZ,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAEhB,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,SAAS,CAAC,OAAO,KAAK,OAAO,EAAE,CAAC;YAClC,IAAI,UAAU,GAAG,EAAE,CAAC;YACpB,IAAI,SAAS,CAAC,OAAO,KAAK,EAAE,EAAE,CAAC;gBAC7B,UAAU,GAAG,OAAO,CAAC;YACvB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I,OAAO,EAAE,CAAC;QACZ,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;YACjC,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;QACjE,CAAC;IACH,CAAC;IAED,OAAO,KAAC,kBAAkB,OAAK,KAAK,EAAE,WAAW,EAAE,GAAG,GAAI,CAAC;AAC7D,CAAC,CAAC,CAAC;AAEH,eAAe,IAAI,CAAC,aAAa,CAAC,CAAC"}
|
package/es/defined.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ export interface ITypedChar extends IOnTypedCharData {
|
|
|
45
45
|
export interface IBeforeTypedChar extends IOnTypedCharData {
|
|
46
46
|
percent: number;
|
|
47
47
|
}
|
|
48
|
-
export interface
|
|
48
|
+
export interface MarkdownTyperBaseProps {
|
|
49
49
|
reactMarkdownProps?: Options;
|
|
50
50
|
/** ่ฎกๆถ็ฑปๅ๏ผ ๆฏๆsetTimeoutๅrequestAnimationFrame */
|
|
51
51
|
timerType?: 'setTimeout' | 'requestAnimationFrame';
|
|
@@ -67,13 +67,14 @@ export interface MarkdownBaseProps {
|
|
|
67
67
|
onTypedChar?: (data?: ITypedChar) => void;
|
|
68
68
|
/** ๆฏๅฆ่ชๅจๅผๅฏๆๅญๅจ็ป */
|
|
69
69
|
autoStartTyping?: boolean;
|
|
70
|
-
|
|
70
|
+
/** ่ชๅฎไน่ฝฌๆขmarkdown string ๅฝๆฐ */
|
|
71
|
+
customConvertMarkdownString?: (markdownString: string) => string;
|
|
71
72
|
}
|
|
72
|
-
export interface
|
|
73
|
+
export interface MarkdownTyperProps extends MarkdownTyperBaseProps {
|
|
73
74
|
children: string | undefined;
|
|
74
75
|
}
|
|
75
76
|
/** MarkdownCMD ็ปไปถไธ้่ฆ children */
|
|
76
|
-
export interface
|
|
77
|
+
export interface MarkdownTyperCMDProps extends MarkdownTyperBaseProps {
|
|
77
78
|
children?: undefined;
|
|
78
79
|
}
|
|
79
80
|
export interface IMarkdownPlugin {
|
|
@@ -82,10 +83,6 @@ export interface IMarkdownPlugin {
|
|
|
82
83
|
type: 'buildIn' | 'custom';
|
|
83
84
|
id?: any;
|
|
84
85
|
}
|
|
85
|
-
export interface IMarkdownMath {
|
|
86
|
-
/** ๆฏๆฌๅท่ฟๆฏ$ไฝไธบๅ้็ฌฆ, ้ป่ฎคๆฏ$ */
|
|
87
|
-
splitSymbol: 'bracket' | 'dollar';
|
|
88
|
-
}
|
|
89
86
|
export interface IWholeContent {
|
|
90
87
|
content: string;
|
|
91
88
|
length: number;
|
|
@@ -98,9 +95,9 @@ export interface MarkdownBaseRef {
|
|
|
98
95
|
restart: () => void;
|
|
99
96
|
}
|
|
100
97
|
/** Markdown ็ปไปถ็ref ็ฑปๅ */
|
|
101
|
-
export type
|
|
98
|
+
export type MarkdownTyperRef = MarkdownBaseRef;
|
|
102
99
|
/** MarkdownCMD ็ปไปถ็ ref ็ฑปๅ */
|
|
103
|
-
export interface
|
|
100
|
+
export interface MarkdownTyperCMDRef extends MarkdownBaseRef {
|
|
104
101
|
push: (content: string) => void;
|
|
105
102
|
clear: () => void;
|
|
106
103
|
triggerWholeEnd: () => void;
|
package/es/defined.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defined.d.ts","sourceRoot":"","sources":["../src/defined.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,MAAM,MAAM,YAAY,GACpB,MAAM,GACN;IACE,WAAW;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,cAAc;IACd,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAChC,iCAAiC;IACjC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,aAAa,GAAG,QAAQ,GAAG,YAAY,GAAG,UAAU,CAAC;CAChG,CAAC;AAEN;;GAEG;AACH,MAA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, IntervalType } from '../defined';
|
|
2
2
|
interface UseTypingTaskOptions {
|
|
3
|
-
timerType:
|
|
3
|
+
timerType: MarkdownTyperProps['timerType'];
|
|
4
4
|
interval: IntervalType;
|
|
5
5
|
charsRef: React.RefObject<IChar[]>;
|
|
6
6
|
onEnd?: (data?: IEndData) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTypingTask.d.ts","sourceRoot":"","sources":["../../src/hooks/useTypingTask.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"useTypingTask.d.ts","sourceRoot":"","sources":["../../src/hooks/useTypingTask.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,kBAAkB,EAAE,QAAQ,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE5H,UAAU,oBAAoB;IAC5B,SAAS,EAAE,kBAAkB,CAAC,WAAW,CAAC,CAAC;IAC3C,QAAQ,EAAE,YAAY,CAAC;IACvB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC;IACnC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,QAAQ,KAAK,IAAI,CAAC;IAClC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAC1F,iBAAiB,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,gBAAgB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/D,WAAW,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IAC1C,kBAAkB,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,IAAI,CAAC;IAC1C,eAAe,EAAE,KAAK,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;IAChD,aAAa,EAAE,OAAO,CAAC;IACvB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,iBAAiB,EAAE,MAAM,IAAI,CAAC;CAC/B;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,QAAQ,EAAE,MAAM,OAAO,CAAC;IACxB,qBAAqB;IACrB,oBAAoB,EAAE,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IAC/C,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,eAAO,MAAM,aAAa,GAAI,SAAS,oBAAoB,KAAG,oBAsa7D,CAAC"}
|
package/es/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import MarkdownCMD from './MarkdownCMD';
|
|
2
|
-
import
|
|
3
|
-
import type {
|
|
4
|
-
export default
|
|
5
|
-
export type {
|
|
6
|
-
export {
|
|
2
|
+
import MarkdownTyper from './MarkdownTyper';
|
|
3
|
+
import type { MarkdownTyperCMDRef, MarkdownTyperRef, ITypedChar, MarkdownTyperProps, MarkdownTyperCMDProps } from './defined';
|
|
4
|
+
export default MarkdownTyper;
|
|
5
|
+
export type { MarkdownTyperCMDRef, MarkdownTyperRef, ITypedChar, MarkdownTyperProps, MarkdownTyperCMDProps };
|
|
6
|
+
export { MarkdownTyper, MarkdownCMD };
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
package/es/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,UAAU,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAE9H,eAAe,aAAa,CAAC;AAC7B,YAAY,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,UAAU,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,CAAC;AAC7G,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,CAAC"}
|
package/es/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import MarkdownCMD from './MarkdownCMD/index.js';
|
|
2
|
-
import
|
|
3
|
-
export default
|
|
4
|
-
export {
|
|
2
|
+
import MarkdownTyper from './MarkdownTyper/index.js';
|
|
3
|
+
export default MarkdownTyper;
|
|
4
|
+
export { MarkdownTyper, MarkdownCMD };
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
package/es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAG5C,eAAe,aAAa,CAAC;AAE7B,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,CAAC"}
|
package/package.json
CHANGED
package/es/Markdown/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Markdown/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4E,MAAM,OAAO,C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K,CAAC,6CAA6C,CAAC,CAAC;QACjE,CAAC;IACH,CAAC;IAED,OAAO,KAAC,aAAa,OAAK,KAAK,EAAE,WAAW,EAAE,GAAG,GAAI,CAAC;AACxD,CAAC,CAAC,CAAC;AAEH,eAAe,IAAI,CAAC,QAAQ,CAAC,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Options } from 'react-markdown';
|
|
3
|
-
interface HighReactMarkdownProps {
|
|
4
|
-
reactMarkdownProps?: Options;
|
|
5
|
-
children: string;
|
|
6
|
-
}
|
|
7
|
-
declare const HighReactMarkdown: React.FC<HighReactMarkdownProps>;
|
|
8
|
-
export default HighReactMarkdown;
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/HighReactMarkdown/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AACvC,OAAsB,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAExD,UAAU,sBAAsB;IAC9B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAEvD,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import ReactMarkdown from 'react-markdown';
|
|
3
|
-
const HighReactMarkdown = ({ reactMarkdownProps, children }) => {
|
|
4
|
-
return _jsx(ReactMarkdown, { ...reactMarkdownProps, children: children });
|
|
5
|
-
};
|
|
6
|
-
export default HighReactMarkdown;
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/HighReactMarkdown/index.tsx"],"names":[],"mappings":";AACA,OAAO,aAA0B,MAAM,gBAAgB,CAAC;AAOxD,MAAM,iBAAiB,GAAqC,CAAC,EAAE,kBAAkB,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC/F,OAAO,KAAC,aAAa,OAAK,kBAAkB,YAAG,QAAQ,GAAiB,CAAC;AAC3E,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|