ds-markdown 1.0.5-beta.0 → 1.0.5-beta.1
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 +36 -0
- package/README.zh.md +36 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -93,6 +93,40 @@ function App() {
|
|
|
93
93
|
}
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
+
### Typing Cursor Examples
|
|
97
|
+
|
|
98
|
+
```tsx
|
|
99
|
+
// Show default line cursor
|
|
100
|
+
<DsMarkdown showCursor>
|
|
101
|
+
Your markdown content here...
|
|
102
|
+
</DsMarkdown>
|
|
103
|
+
|
|
104
|
+
// Use built-in cursor styles
|
|
105
|
+
<DsMarkdown showCursor cursor="block">
|
|
106
|
+
Your markdown content...
|
|
107
|
+
</DsMarkdown>
|
|
108
|
+
|
|
109
|
+
<DsMarkdown showCursor cursor="underline">
|
|
110
|
+
Your markdown content...
|
|
111
|
+
</DsMarkdown>
|
|
112
|
+
|
|
113
|
+
<DsMarkdown showCursor cursor="circle">
|
|
114
|
+
Your markdown content...
|
|
115
|
+
</DsMarkdown>
|
|
116
|
+
|
|
117
|
+
// Custom cursor element
|
|
118
|
+
<DsMarkdown showCursor cursor={<span style={{ color: 'red' }}>|</span>}>
|
|
119
|
+
Your markdown content...
|
|
120
|
+
</DsMarkdown>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**Available cursor types:**
|
|
124
|
+
- `line` - Vertical line (default)
|
|
125
|
+
- `block` - Filled block
|
|
126
|
+
- `underline` - Horizontal underline
|
|
127
|
+
- `circle` - Circular dot
|
|
128
|
+
- Custom `React.ReactNode` - Any custom React element
|
|
129
|
+
|
|
96
130
|
## Core API Documentation
|
|
97
131
|
|
|
98
132
|
For detailed documentation, please visit: [Full Documentation](https://onshinpei.github.io/ds-markdown/#get-started)
|
|
@@ -111,6 +145,8 @@ import DsMarkdown, { MarkdownCMD } from 'ds-markdown';
|
|
|
111
145
|
| `theme` | `'light'` \| `'dark'` | Theme type | `'light'` |
|
|
112
146
|
| `plugins` | `IMarkdownPlugin[]` | Plugin configuration | `[]` |
|
|
113
147
|
| `math` | `IMarkdownMath` | Mathematical formula configuration | `{ splitSymbol: 'dollar' }` |
|
|
148
|
+
| `showCursor` | `boolean` | Whether to show typing cursor during animation | `false` |
|
|
149
|
+
| `cursor` | `React.ReactNode` \| `'line'` \| `'block'` \| `'underline'` \| `'circle'` | Custom cursor element or built-in cursor type | `'line'` (when `showCursor` is `true`) |
|
|
114
150
|
| `onEnd` | `(data: EndData) => void` | Typing completion callback | - |
|
|
115
151
|
| `onStart` | `(data: StartData) => void` | Typing start callback | - |
|
|
116
152
|
| `onBeforeTypedChar` | `(data: IBeforeTypedChar) => Promise<void>` | Callback before character typing, supports async operations, blocks subsequent typing | - |
|
package/README.zh.md
CHANGED
|
@@ -93,6 +93,40 @@ function App() {
|
|
|
93
93
|
}
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
+
### 打字光标示例
|
|
97
|
+
|
|
98
|
+
```tsx
|
|
99
|
+
// 显示默认竖线光标
|
|
100
|
+
<DsMarkdown showCursor>
|
|
101
|
+
这里是你的 markdown 内容...
|
|
102
|
+
</DsMarkdown>
|
|
103
|
+
|
|
104
|
+
// 使用内置光标样式
|
|
105
|
+
<DsMarkdown showCursor cursor="block">
|
|
106
|
+
你的 markdown 内容...
|
|
107
|
+
</DsMarkdown>
|
|
108
|
+
|
|
109
|
+
<DsMarkdown showCursor cursor="underline">
|
|
110
|
+
你的 markdown 内容...
|
|
111
|
+
</DsMarkdown>
|
|
112
|
+
|
|
113
|
+
<DsMarkdown showCursor cursor="circle">
|
|
114
|
+
你的 markdown 内容...
|
|
115
|
+
</DsMarkdown>
|
|
116
|
+
|
|
117
|
+
// 自定义光标元素
|
|
118
|
+
<DsMarkdown showCursor cursor={<span style={{ color: 'red' }}>|</span>}>
|
|
119
|
+
你的 markdown 内容...
|
|
120
|
+
</DsMarkdown>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**可用的光标类型:**
|
|
124
|
+
- `line` - 竖线(默认)
|
|
125
|
+
- `block` - 实心块
|
|
126
|
+
- `underline` - 下划线
|
|
127
|
+
- `circle` - 圆点
|
|
128
|
+
- 自定义 `React.ReactNode` - 任何自定义的 React 元素
|
|
129
|
+
|
|
96
130
|
## 核心API文档
|
|
97
131
|
|
|
98
132
|
详细文档可查看:[完整文档](https://onshinpei.github.io/ds-markdown/#get-started)
|
|
@@ -111,6 +145,8 @@ import DsMarkdown, { MarkdownCMD } from 'ds-markdown';
|
|
|
111
145
|
| `theme` | `'light'` \| `'dark'` | 主题类型 | `'light'` |
|
|
112
146
|
| `plugins` | `IMarkdownPlugin[]` | 插件配置 | `[]` |
|
|
113
147
|
| `math` | `IMarkdownMath` | 数学公式配置 | `{ splitSymbol: 'dollar' }` |
|
|
148
|
+
| `showCursor` | `boolean` | 打字动画时是否显示光标 | `false` |
|
|
149
|
+
| `cursor` | `React.ReactNode` \| `'line'` \| `'block'` \| `'underline'` \| `'circle'` | 自定义光标元素或内置光标类型 | `'line'` (当 `showCursor` 为 `true` 时) |
|
|
114
150
|
| `onEnd` | `(data: EndData) => void` | 打字结束回调 | - |
|
|
115
151
|
| `onStart` | `(data: StartData) => void` | 打字开始回调 | - |
|
|
116
152
|
| `onBeforeTypedChar` | `(data: IBeforeTypedChar) => Promise<void>` | 字符打字前的回调,支持异步操作,会阻塞之后的打字 | - |
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ds-markdown",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.0.5-beta.
|
|
4
|
+
"version": "1.0.5-beta.1",
|
|
5
5
|
"main": "./dist/esm/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
7
7
|
"style": "./dist/style.css",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"classnames": "^2.5.1",
|
|
78
78
|
"katex": "^0.16.22",
|
|
79
79
|
"react-markdown": "^10.1.0",
|
|
80
|
-
"react-markdown-typer": "^1.0.4-beta.
|
|
80
|
+
"react-markdown-typer": "^1.0.4-beta.1",
|
|
81
81
|
"react-router-dom": "^7.7.1",
|
|
82
82
|
"react-syntax-highlighter": "^15.6.1",
|
|
83
83
|
"rehype-katex": "^7.0.1",
|