@8btc/mditor 0.0.6 → 0.0.8

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/index.css CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Vditor v0.0.3 - A markdown editor written in TypeScript.
2
+ * Vditor v0.0.7 - A markdown editor written in TypeScript.
3
3
  *
4
4
  * MIT License
5
5
  *
@@ -25,7 +25,7 @@
25
25
  *
26
26
  */
27
27
  /*!
28
- * Vditor v0.0.3 - A markdown editor written in TypeScript.
28
+ * Vditor v0.0.7 - A markdown editor written in TypeScript.
29
29
  *
30
30
  * MIT License
31
31
  *
@@ -1840,6 +1840,10 @@
1840
1840
  pointer-events: none;
1841
1841
  display: block;
1842
1842
  }
1843
+ .vditor--linenumber .vditor-reset .vditor-line-highlight {
1844
+ background-color: #fff3cd !important;
1845
+ transition: background-color 0.2s ease-in-out;
1846
+ }
1843
1847
  /* 数学右键菜单全局样式(参考 ECharts 菜单风格) */
1844
1848
  .vditor-math-menu {
1845
1849
  position: fixed;
package/dist/index.d.ts CHANGED
@@ -16,6 +16,20 @@ declare class Vditor extends VditorMethod {
16
16
  setTheme(theme: "dark" | "classic", contentTheme?: string, codeTheme?: string, contentThemePath?: string): void;
17
17
  /** 获取 Markdown 内容 */
18
18
  getValue(): string;
19
+ /**
20
+ * 手动更新行号
21
+ * - 读取当前模式下的 Markdown 文本并为对应编辑区域同步/节流写入 data-linenumber
22
+ * - 依赖配置 `lineNumber: true`,关闭时直接跳过以提升性能
23
+ * @param immediate 为 true 时立即更新;默认为节流更新以避免频繁调用
24
+ */
25
+ updateLineNumbers(immediate?: boolean): void;
26
+ /**
27
+ * 高亮指定行号对应的块元素
28
+ * - 仅匹配拥有 `data-linenumber`/`data-lineNumber` 且值等于指定行号的元素
29
+ * - 应用高亮样式并在约 500ms 后自动恢复
30
+ * @param numbers 要高亮的行号数组
31
+ */
32
+ setLinehightNumbers(numbers: number[]): void;
19
33
  /** 获取编辑器当前编辑模式 */
20
34
  getCurrentMode(): "sv" | "wysiwyg" | "ir";
21
35
  /** 聚焦到编辑器 */