@8btc/mditor 0.0.8 → 0.0.10

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.7 - A markdown editor written in TypeScript.
2
+ * Vditor v0.0.8 - 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.7 - A markdown editor written in TypeScript.
28
+ * Vditor v0.0.8 - A markdown editor written in TypeScript.
29
29
  *
30
30
  * MIT License
31
31
  *
@@ -1842,7 +1842,7 @@
1842
1842
  }
1843
1843
  .vditor--linenumber .vditor-reset .vditor-line-highlight {
1844
1844
  background-color: #fff3cd !important;
1845
- transition: background-color 0.2s ease-in-out;
1845
+ transition: background-color 0.3s ease-in-out;
1846
1846
  }
1847
1847
  /* 数学右键菜单全局样式(参考 ECharts 菜单风格) */
1848
1848
  .vditor-math-menu {
@@ -1916,6 +1916,56 @@
1916
1916
  user-select: text;
1917
1917
  -webkit-user-select: text;
1918
1918
  }
1919
+ .vditor-selection-popover {
1920
+ position: absolute;
1921
+ z-index: 4;
1922
+ display: none;
1923
+ padding: 0;
1924
+ border-radius: 12px;
1925
+ background-color: var(--panel-background-color);
1926
+ box-shadow: var(--panel-shadow);
1927
+ border: 1px solid var(--border-color);
1928
+ -webkit-user-select: none;
1929
+ -moz-user-select: none;
1930
+ user-select: none;
1931
+ white-space: nowrap;
1932
+ transform-origin: top left;
1933
+ transition: opacity 150ms cubic-bezier(0.2, 0, 0.13, 1.5), transform 150ms cubic-bezier(0.2, 0, 0.13, 1.5);
1934
+ display: flex;
1935
+ align-items: center;
1936
+ }
1937
+ .vditor-selection-popover__btn {
1938
+ display: flex;
1939
+ align-items: center;
1940
+ justify-content: center;
1941
+ height: 32px;
1942
+ width: 109px;
1943
+ flex: 0 0 109px;
1944
+ box-sizing: border-box;
1945
+ white-space: nowrap;
1946
+ margin: 0 0px;
1947
+ border: none;
1948
+ background: transparent;
1949
+ color: var(--textarea-text-color);
1950
+ cursor: pointer;
1951
+ border-radius: 8px;
1952
+ outline: none;
1953
+ font-size: 14px;
1954
+ font-weight: 500;
1955
+ transition: all 0.15s ease-in-out;
1956
+ }
1957
+ .vditor-selection-popover__btn:hover,
1958
+ .vditor-selection-popover__btn:focus {
1959
+ color: var(--toolbar-icon-hover-color);
1960
+ background-color: transparent;
1961
+ }
1962
+ .vditor-selection-popover__btn[disabled] {
1963
+ opacity: 0.9;
1964
+ cursor: not-allowed;
1965
+ }
1966
+ .vditor-selection-popover__btn + .vditor-selection-popover__btn {
1967
+ border-left: 1px solid var(--border-color);
1968
+ }
1919
1969
  details > summary {
1920
1970
  list-style: none;
1921
1971
  }
package/dist/index.d.ts CHANGED
@@ -22,6 +22,7 @@ declare class Vditor extends VditorMethod {
22
22
  * - 依赖配置 `lineNumber: true`,关闭时直接跳过以提升性能
23
23
  * @param immediate 为 true 时立即更新;默认为节流更新以避免频繁调用
24
24
  */
25
+ /** 手动更新行号 */
25
26
  updateLineNumbers(immediate?: boolean): void;
26
27
  /**
27
28
  * 高亮指定行号对应的块元素
@@ -29,6 +30,7 @@ declare class Vditor extends VditorMethod {
29
30
  * - 应用高亮样式并在约 500ms 后自动恢复
30
31
  * @param numbers 要高亮的行号数组
31
32
  */
33
+ /** 高亮指定行号,时长受 `options.lineNumber.highlightTimer` 控制 */
32
34
  setLinehightNumbers(numbers: number[]): void;
33
35
  /** 获取编辑器当前编辑模式 */
34
36
  getCurrentMode(): "sv" | "wysiwyg" | "ir";