md-tiptap 0.1.3 → 0.1.5

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 CHANGED
@@ -3,9 +3,7 @@
3
3
  一个基于 TipTap 的强大 Markdown 编辑器组件,具有类似 Notion 的功能。
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/md-tiptap.svg)](https://www.npmjs.com/package/md-tiptap)
6
- [![license](https://img.shields.io/npm/l/md-tiptap.svg)](https://github.com/yourusername/md-tiptap/blob/master/LICENSE)
7
-
8
- 📖 [快速开始](./QUICK_START.md) | 💡 [使用示例](./EXAMPLE.md) | 📦 [发布指南](./PUBLISH.md) | 🎨 [shadcn 依赖说明](./SHADCN_DEPENDENCIES_SUMMARY.md)
6
+ [![license](https://img.shields.io/npm/l/md-tiptap.svg)](https://www.npmjs.com/package/md-tiptap)
9
7
 
10
8
  ## 特性
11
9
 
@@ -135,7 +133,13 @@ function EditorExample() {
135
133
  |------|------|------|--------|------|
136
134
  | `value` | `string` | 否 | - | 编辑器的 HTML 内容 |
137
135
  | `onChange` | `(html: string) => void` | 否 | - | 内容变化时的回调函数,参数为 HTML 字符串 |
138
- | `onImageUpload` | `(file: File) => Promise<string>` | 否 | - | 图片上传处理函数,需返回图片 URL。如果不提供,图片将以 Base64 格式插入 |
136
+ | `onImageUpload` | `(file: File) => Promise<string>` | 否 | - | 图片上传处理函数,需返回图片 URL。若不提供,图片将以 Base64 格式插入 |
137
+ | `commandMenuMaxHeight` | `number` | 否 | `240` | 斜杠命令菜单最大高度(px) |
138
+ | `commandMenuMinHeight` | `number` | 否 | `160` | 斜杠命令菜单最小高度(px) |
139
+ | `placeholder` | `string` | 否 | `"输入 '/' 查看命令..."` | 编辑器为空时的占位文本 |
140
+ | `disabled` | `boolean` | 否 | `false` | 是否禁用编辑器(只读) |
141
+ | `onChangeDebounceMs` | `number` | 否 | `300` | `onChange` 防抖延迟(毫秒) |
142
+ | `border` | `boolean` | 否 | `true` | 是否显示编辑器容器边框 |
139
143
 
140
144
  ## 功能说明
141
145
 
@@ -257,10 +261,10 @@ import 'md-tiptap/style.css'
257
261
 
258
262
  4. **弹层/对话框**:插入图片、公式等弹层通过 Portal 渲染到 `document.body`,库的样式为全局样式。若仍被覆盖,检查是否有全局 reset 或更高优先级的选择器影响弹层
259
263
 
260
- 📖 详细说明请查看 [SHADCN_GUIDE.md](./SHADCN_GUIDE.md)
261
-
262
264
  ## 开发
263
265
 
266
+ 本项目使用 pnpm、React 19、Vite 7、TypeScript 5.9、Tailwind CSS v4、TipTap 3.x。
267
+
264
268
  ```bash
265
269
  # 安装依赖
266
270
  pnpm install
@@ -268,11 +272,17 @@ pnpm install
268
272
  # 开发模式(启动示例应用)
269
273
  pnpm dev
270
274
 
271
- # 构建库(用于发布)
275
+ # 构建示例应用
276
+ pnpm build
277
+
278
+ # 构建库(用于发布到 npm)
272
279
  pnpm build:lib
273
280
 
274
281
  # 代码检查
275
282
  pnpm lint
283
+
284
+ # 预览构建结果
285
+ pnpm preview
276
286
  ```
277
287
 
278
288
  ## License