md-tiptap 0.1.5 → 0.1.6

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
@@ -134,6 +134,8 @@ function EditorExample() {
134
134
  | `value` | `string` | 否 | - | 编辑器的 HTML 内容 |
135
135
  | `onChange` | `(html: string) => void` | 否 | - | 内容变化时的回调函数,参数为 HTML 字符串 |
136
136
  | `onImageUpload` | `(file: File) => Promise<string>` | 否 | - | 图片上传处理函数,需返回图片 URL。若不提供,图片将以 Base64 格式插入 |
137
+ | `editorMode` | `'notion-like' \| 'headless'` | 否 | `'notion-like'` | 编辑器模式:Notion 风格(斜杠命令、块状编辑等)或无头模式 |
138
+ | `headlessToolbarMode` | `'always' \| 'on-focus'` | 否 | `'always'` | **仅在 `editorMode='headless'` 时生效**。`always`:工具栏始终显示;`on-focus`:编辑器聚焦或点击工具栏时显示,失焦到编辑器区域外时隐藏 |
137
139
  | `commandMenuMaxHeight` | `number` | 否 | `240` | 斜杠命令菜单最大高度(px) |
138
140
  | `commandMenuMinHeight` | `number` | 否 | `160` | 斜杠命令菜单最小高度(px) |
139
141
  | `placeholder` | `string` | 否 | `"输入 '/' 查看命令..."` | 编辑器为空时的占位文本 |
@@ -141,6 +143,19 @@ function EditorExample() {
141
143
  | `onChangeDebounceMs` | `number` | 否 | `300` | `onChange` 防抖延迟(毫秒) |
142
144
  | `border` | `boolean` | 否 | `true` | 是否显示编辑器容器边框 |
143
145
 
146
+ ### Headless 模式下的工具栏显示
147
+
148
+ 在 `editorMode="headless"` 时,可以通过 `headlessToolbarMode` 控制顶部工具栏的显示策略:
149
+
150
+ - `headlessToolbarMode="always"`:工具栏始终显示。
151
+ - `headlessToolbarMode="on-focus"`:当编辑器获得焦点或用户点击工具栏区域时显示;当焦点离开整个编辑器容器(包括工具栏)后隐藏。点击工具栏按钮本身不会导致工具栏立即消失。
152
+
153
+ 示例:
154
+
155
+ ```tsx
156
+ <TiptapEditor editorMode="headless" headlessToolbarMode="on-focus" />
157
+ ```
158
+
144
159
  ## 功能说明
145
160
 
146
161
  ### 斜杠命令