remons-markdown-editor 1.0.0-beta.8 → 1.0.0

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/App.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare function App(): import("react").JSX.Element;
1
+ declare function App(): import('react').JSX.Element;
2
2
  export default App;
@@ -17,5 +17,5 @@ interface EditDialogProps {
17
17
  * 属性编辑弹窗组件
18
18
  * 根据组件 schema 的 renderDialog 函数渲染弹窗内容
19
19
  */
20
- export default function EditDialog({ visible, typeName, currentProps, onSave, onClose }: EditDialogProps): import("react").JSX.Element | null;
20
+ export default function EditDialog({ visible, typeName, currentProps, onSave, onClose }: EditDialogProps): import('react').JSX.Element | null;
21
21
  export {};
@@ -12,5 +12,5 @@ interface EditorProps {
12
12
  /** 未配置上传时的提示回调 */
13
13
  onMessageNoUploadConfig?: () => void;
14
14
  }
15
- export default function Editor({ value, onChange, onScrollReady, onViewReady, onEditContainer, uploadConfig, onMessageNoUploadConfig }: EditorProps): import("react").JSX.Element;
15
+ export default function Editor({ value, onChange, onScrollReady, onViewReady, onEditContainer, uploadConfig, onMessageNoUploadConfig }: EditorProps): import('react').JSX.Element;
16
16
  export {};
@@ -0,0 +1,2 @@
1
+ declare function IconComponent(type: string, className?: string): import('react').JSX.Element;
2
+ export default IconComponent;
@@ -8,6 +8,43 @@ export declare function insertAtCursor(view: EditorView, before: string, after?:
8
8
  * 在当前行行首插入文本
9
9
  */
10
10
  export declare function insertAtLineStart(view: EditorView, text: string): void;
11
+ /**
12
+ * 切换标题:
13
+ * - 当前行已是目标级别标题 → 移除行首 # 前缀(变回普通文本)
14
+ * - 当前行是其他级别标题 → 替换为目标级别
15
+ * - 当前行是普通文本 → 插入目标级别前缀
16
+ * @param view - CodeMirror 编辑器实例
17
+ * @param level - 标题级别(1-6)
18
+ */
19
+ export declare function toggleHeading(view: EditorView, level: number): void;
20
+ /**
21
+ * 切换任务列表(checkbox 待办)
22
+ * - 支持多行:对选区内每一行应用 `- [ ] `
23
+ * - 普通列表项(如 `- 内容`)直接转换为 `- [ ] 内容`
24
+ * - 切换:若所有目标行都已是任务项,则移除行首前缀
25
+ */
26
+ export declare function toggleTaskList(view: EditorView): void;
27
+ /**
28
+ * 切换行首前缀(支持多行选区)
29
+ * - 已是对应前缀的行 → 移除前缀(变回普通文本)
30
+ * - 未加前缀的行 → 在行首插入前缀
31
+ * @param view - CodeMirror 编辑器实例
32
+ * @param pattern - 匹配行首前缀的正则
33
+ * @param insertText - 未匹配时插入的前缀文本
34
+ */
35
+ export declare function toggleLinePrefix(view: EditorView, pattern: RegExp, insertText: string): void;
36
+ /**
37
+ * Tab:列表行缩进一级(4 空格)
38
+ * - 普通行返回 false,继续走默认缩进
39
+ * - 有序列表缩进后重排序号,子列表从 1 开始
40
+ */
41
+ export declare function indentMarkdownList(view: EditorView): boolean;
42
+ /**
43
+ * Shift-Tab:列表行反缩进一级
44
+ * - 普通行返回 false,继续走默认缩进
45
+ * - 有序列表反缩进后并入上一层并重排序号
46
+ */
47
+ export declare function dedentMarkdownList(view: EditorView): boolean;
11
48
  /**
12
49
  * 上传图片
13
50
  * @param file - 要上传的文件
@@ -9,5 +9,5 @@ interface ToolbarProps {
9
9
  /** 图片上传配置 */
10
10
  uploadConfig?: ImageUploadConfig;
11
11
  }
12
- export default function Toolbar({ editorView, fullscreen, onToggleFullscreen, extraItems, uploadConfig }: ToolbarProps): import("react").JSX.Element;
12
+ export default function Toolbar({ editorView, fullscreen, onToggleFullscreen, extraItems, uploadConfig }: ToolbarProps): import('react').JSX.Element;
13
13
  export {};
@@ -5,5 +5,5 @@ interface TableSize {
5
5
  interface TablePickerProps {
6
6
  onSelect: (size: TableSize) => void;
7
7
  }
8
- export default function TablePicker({ onSelect }: TablePickerProps): import("react").JSX.Element;
8
+ export default function TablePicker({ onSelect }: TablePickerProps): import('react').JSX.Element;
9
9
  export {};
@@ -3,5 +3,5 @@ interface Props {
3
3
  item: ToolbarButtonConfig;
4
4
  onClick: (item: ToolbarButtonConfig) => void;
5
5
  }
6
- export declare function ToolbarItemRenderer({ item, onClick }: Props): import("react").JSX.Element;
6
+ export declare function ToolbarItemRenderer({ item, onClick }: Props): import('react').JSX.Element;
7
7
  export {};
@@ -1,5 +1,6 @@
1
1
  /**
2
- * 滚动同步 Hook
3
- * 将源滚动容器的滚动位置同步到目标预览容器
2
+ * 双向滚动同步 Hook
3
+ * 编辑器与预览区互相同步滚动位置(基于比例)
4
+ * 使用 síncing 锁防止双向循环触发
4
5
  */
5
6
  export declare function useScrollSync(sourceRef: React.RefObject<HTMLElement | null>, targetRef: React.RefObject<HTMLDivElement | null>): void;