release: v0.1.11 — quality & stability improvements
fix(core): clear _outlineTimer in destroy() to prevent post-destroy callbacks fix(core): remove '<' from BRACKET_PAIRS to avoid HTML tag conflicts fix(core): setValue now updates outline panel and resets gutter scroll fix(core): getValue returns '' on destroyed instances (safe API access) opt(core): _renderGutter skips rebuild when line count unchanged chore: bump version 0.1.10 → 0.1.11 across all files
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* MetonaEditor Animations - 动画管理
|
||||
* @module animations
|
||||
* @version 0.1.10
|
||||
* @version 0.1.11
|
||||
* @description 动画注册与管理(当前为 CSS 动画元数据管理,供未来扩展如 Toast/通知组件的进出场动画使用;
|
||||
* 内置 7 种预设动画曲线配置;编辑器核心当前未直接调用此模块)
|
||||
*/
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* MetonaEditor Constants - 常量定义
|
||||
* @module constants
|
||||
* @version 0.1.10
|
||||
* @version 0.1.11
|
||||
* @description 默认配置、主题、动画、工具栏等常量
|
||||
*/
|
||||
|
||||
|
||||
+9
-3
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* MetonaEditor Core - 编辑器核心
|
||||
* @module core
|
||||
* @version 0.1.10
|
||||
* @version 0.1.11
|
||||
* @description MarkdownEditor 类实现:DOM 构建、事件、渲染、历史栈、选区操作、模式切换
|
||||
* v0.1.6: 插件依赖拓扑排序、实例 i18n、快捷键/工具栏定制、右键菜单、Toast
|
||||
* v0.1.7: 行号装订线、自动格式化、括号自动闭合、拖放、大纲面板
|
||||
@@ -27,7 +27,7 @@ const TOAST_ICONS = {
|
||||
|
||||
/** 括号/引号自动闭合映射 */
|
||||
const BRACKET_PAIRS = {
|
||||
'(': ')', '[': ']', '{': '}', '<': '>',
|
||||
'(': ')', '[': ']', '{': '}',
|
||||
'"': '"', "'": "'", '`': '`',
|
||||
'*': '*', '_': '_',
|
||||
};
|
||||
@@ -1164,14 +1164,19 @@ class MarkdownEditor {
|
||||
|
||||
// ============ 公共 API ============
|
||||
|
||||
getValue() { return this._value; }
|
||||
getValue() { return this._destroyed ? '' : this._value; }
|
||||
|
||||
setValue(md, opts = {}) {
|
||||
if (this._destroyed) return this;
|
||||
this._value = md || '';
|
||||
this.textarea.value = this._value;
|
||||
if (!opts.silent) this._pushHistory();
|
||||
this._render();
|
||||
this._renderGutter();
|
||||
this._updateWordCount();
|
||||
this._updateOutline();
|
||||
// 同步行号滚动
|
||||
if (this.gutter) this.gutter.scrollTop = 0;
|
||||
if (!opts.silent) {
|
||||
this._emit('change', this._value);
|
||||
if (typeof this.config.onChange === 'function') {
|
||||
@@ -1507,6 +1512,7 @@ class MarkdownEditor {
|
||||
|
||||
if (this._renderRaf) cancelAnimationFrame(this._renderRaf);
|
||||
if (this._historyTimer) clearTimeout(this._historyTimer);
|
||||
if (this._outlineTimer) clearTimeout(this._outlineTimer);
|
||||
|
||||
this._cleanups.forEach((fn) => { try { fn(); } catch (_) {} });
|
||||
this._cleanups = [];
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* MetonaEditor i18n — 国际化管理(增强版)
|
||||
* @module i18n
|
||||
* @version 0.1.10
|
||||
* @version 0.1.11
|
||||
* @description 多语言支持、实例级语言隔离、复数规则、动态加载、命名空间
|
||||
*
|
||||
* v0.1.6 增强:
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* MetonaEditor Icons — 工具栏图标SVG定义
|
||||
* @module icons
|
||||
* @version 0.1.10
|
||||
* @version 0.1.11
|
||||
* @description 工具栏格式化按钮 SVG 图标
|
||||
*/
|
||||
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* MetonaEditor - 轻量级 Markdown Editor 库
|
||||
* @module metona-editor
|
||||
* @version 0.1.10
|
||||
* @version 0.1.11
|
||||
* @author thzxx
|
||||
* @description 现代化、零依赖、易扩展、易维护、易使用的 Markdown 编辑器库。单文件,开箱即用。
|
||||
* @license MIT
|
||||
@@ -29,7 +29,7 @@ import { animationUtils } from './animations.js';
|
||||
import { DEFAULTS, ICONS, THEMES, EDIT_MODES, DEFAULT_TOOLBAR, TOOLBAR_ACTIONS } from './constants.js';
|
||||
|
||||
// 版本信息
|
||||
const VERSION = '0.1.10';
|
||||
const VERSION = '0.1.11';
|
||||
|
||||
/**
|
||||
* 全局默认插件队列
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* MetonaEditor Locales — 国际化翻译数据
|
||||
* @module locales
|
||||
* @version 0.1.10
|
||||
* @version 0.1.11
|
||||
* @description 内置 zh-CN / en-US 完整翻译
|
||||
*/
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* MetonaEditor Parser - 轻量 Markdown 解析器(增强版)
|
||||
* @module parser
|
||||
* @version 0.1.10
|
||||
* @version 0.1.11
|
||||
* @description 自研零依赖 Markdown 解析器,覆盖 CommonMark 子集 + GFM 扩展
|
||||
*
|
||||
* v0.1.4 增强:
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* MetonaEditor Plugins — 插件系统 v2
|
||||
* @module plugins
|
||||
* @version 0.1.10
|
||||
* @version 0.1.11
|
||||
* @description 插件管理器 + 预设插件 + 依赖/生命周期/异步/卸载
|
||||
*
|
||||
* v0.1.6 增强:
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* MetonaEditor Styles - 编辑器样式
|
||||
* @module styles
|
||||
* @version 0.1.10
|
||||
* @version 0.1.11
|
||||
* @description 编辑器 UI 样式注入与管理
|
||||
*/
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* MetonaEditor Themes — 主题系统(增强版)
|
||||
* @module themes
|
||||
* @version 0.1.10
|
||||
* @version 0.1.11
|
||||
* @description 全局+实例级主题管理、CSS 变量隔离、外部主题跟随、主题继承
|
||||
*
|
||||
* v0.1.5 增强:
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* MetonaEditor Utils - 工具函数
|
||||
* @module utils
|
||||
* @version 0.1.10
|
||||
* @version 0.1.11
|
||||
* @description 通用工具函数集合
|
||||
*/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user