@@ -351,7 +351,7 @@
MeToast.info('自定义插件已安装(消息后追加计数)');
}
- // === v2.0 new features ===
+ // === 高级特性 ===
function demoResetTimer() {
const t=MeToast.info('这条消息不会自动消失(resetTimer)',{duration:3000,resetTimerOnUpdate:true,closeButton:true});
let n=0; const iv=setInterval(()=>{n++;if(n>8){clearInterval(iv);t.close();return;}t.update({message:'重置计时器 #'+n+' — 每次更新重置3秒'});},1000);
diff --git a/site/docs.html b/site/docs.html
index 55efa52..75e3154 100644
--- a/site/docs.html
+++ b/site/docs.html
@@ -69,9 +69,9 @@
API 文档
-MetonaToast v2.0.1 完整 API 参考。所有基础通知方法(show/success/error/warning/info/loading)支持两种调用形式,均可传入任何 配置项 作为可选第二参数。
+MetonaToast v0.1.1 完整 API 参考。所有基础通知方法(show/success/error/warning/info/loading)支持两种调用形式,均可传入任何 配置项 作为可选第二参数。
show(message, opts?)
@@ -309,7 +309,7 @@ q.cancel(); // 中途取消
type: 'info',
});
-action(message, actions, opts?) v2.0
+action(message, actions, opts?)
Action Toast:内嵌操作按钮。默认 duration=0 不自动关闭,closeButton=true。
| 参数 | 类型 | 默认值 | 说明 |
@@ -331,7 +331,7 @@ q.cancel(); // 中途取消
]);
-group(name) v2.0
+group(name)
创建 Toast 分组,返回 GroupAPI 对象。该对象所有方法自动传入 group: name,按组管理。
| 参数 | 类型 | 说明 |
@@ -409,7 +409,7 @@ MeToast.use('accessibility');
全部配置项
-以下配置可用于 configure()、init() 或单个 Toast 方法的 opts 参数。带 v2.0 标识的为 v2.0 新增。
+以下配置可用于 configure()、init() 或单个 Toast 方法的 opts 参数。
| 配置项 | 类型 | 默认值 | 说明 |
| position | string | 'top-right' | 位置:top-left / top-center / top-right / bottom-left / bottom-center / bottom-right |
@@ -431,9 +431,9 @@ MeToast.use('accessibility'); className | string | '' | 附加到 Toast 元素上的 CSS 类名 |
| style | object | {} | 附加到 Toast 元素上的内联样式对象 |
| locale | string | 'zh-CN' | 语言代码(zh-CN / en-US 等) |
-| resetTimerOnUpdate v2.0 | boolean | false | 调用 update() 时重置 duration 倒计时 |
-| notifyWhenHidden v2.0 | boolean | false | 页面不可见时自动通过 Notification API 发送系统通知 |
-| render v2.0 | function | — | 自定义渲染函数 (toast) => htmlString,完全接管 DOM 构建 |
+ | resetTimerOnUpdate | boolean | false | 调用 update() 时重置 duration 倒计时 |
+ | notifyWhenHidden | boolean | false | 页面不可见时自动通过 Notification API 发送系统通知 |
+ | render | function | — | 自定义渲染函数 (toast) => htmlString,完全接管 DOM 构建 |
回调函数
@@ -442,7 +442,7 @@ MeToast.use('accessibility'); onShow | (toast: ToastInstance) => void | Toast DOM 创建并播放入场动画后 |
| onClose | (toast: ToastInstance) => void | Toast DOM 被移除后(离场动画完成时) |
| onClick | (toast: ToastInstance) => void | Toast 被点击时(closeOnClick 为 true 时还会自动关闭) |
-| onUpdate v2.0 | (toast: ToastInstance) => void | Toast 内容通过 update() 更新后 |
+ | onUpdate | (toast: ToastInstance) => void | Toast 内容通过 update() 更新后 |
动画列表
diff --git a/site/index.html b/site/index.html
index cc06394..78abea9 100644
--- a/site/index.html
+++ b/site/index.html
@@ -237,7 +237,7 @@ orderGroup.dismiss(); // 一键关闭
diff --git a/src/animations.js b/src/animations.js
index b1388f3..8fb101a 100644
--- a/src/animations.js
+++ b/src/animations.js
@@ -1,5 +1,5 @@
/**
- * MetonaToast Animations - 动画管理(精简版 v2.0.1)
+ * MetonaToast Animations - 动画管理 v0.1.1
* @module animations
* @description 动画注册与管理,移除未使用的 Web Animations API dead code
*/
diff --git a/src/constants.js b/src/constants.js
index 0e0750c..3e13a20 100644
--- a/src/constants.js
+++ b/src/constants.js
@@ -1,7 +1,7 @@
/**
* MetonaToast Constants - 常量定义
* @module constants
- * @version 2.0.1
+ * @version 0.1.1
* @description 默认配置、颜色、动画、主题等常量
*/
diff --git a/src/core.js b/src/core.js
index 1f1bbe7..4155d15 100644
--- a/src/core.js
+++ b/src/core.js
@@ -1,7 +1,7 @@
/**
* MetonaToast Core - 核心Toast逻辑
* @module core
- * @version 2.0.1
+ * @version 0.1.1
* @description 重构后的核心模块,包含Toast类的优化实现
*/
@@ -621,7 +621,7 @@ const _actionHTML = (actions) => {
const meToast = {
_toasts: new Map(),
_config: { ...DEFAULTS },
- version: '2.0.1',
+ version: '0.1.1',
configure(opts) {
if (!opts || typeof opts !== 'object') return this;
diff --git a/src/i18n.js b/src/i18n.js
index 0005b9a..fcd408c 100644
--- a/src/i18n.js
+++ b/src/i18n.js
@@ -1,7 +1,7 @@
/**
* MetonaToast i18n - 国际化管理
* @module i18n
- * @version 2.0.1
+ * @version 0.1.1
* @description 多语言支持、语言切换和翻译管理
*/
diff --git a/src/icons.js b/src/icons.js
index fe472ff..70be2c1 100644
--- a/src/icons.js
+++ b/src/icons.js
@@ -1,7 +1,7 @@
/**
* MetonaToast Icons — 图标SVG定义
* @module icons
- * @version 2.0.1
+ * @version 0.1.1
* @description 80+ 内置SVG图标
*/
diff --git a/src/index.js b/src/index.js
index 66c20da..e645c88 100644
--- a/src/index.js
+++ b/src/index.js
@@ -1,7 +1,7 @@
/**
* MetonaToast - 轻量级Toast通知库
* @module metona-toast
- * @version 2.0.1
+ * @version 0.1.1
* @author thzxx
* @description 轻量、零依赖、精致美观的Toast通知库。单文件,开箱即用。
* @license MIT
@@ -15,7 +15,7 @@ import { pluginUtils, presetPlugins } from './plugins.js';
import { DEFAULTS } from './constants.js';
// 版本信息
-const VERSION = '2.0.1';
+const VERSION = '0.1.1';
/**
* 主对象增强
diff --git a/src/locales.js b/src/locales.js
index df7d4df..2cd98cf 100644
--- a/src/locales.js
+++ b/src/locales.js
@@ -1,7 +1,7 @@
/**
* MetonaToast Locales — 国际化翻译数据
* @module locales
- * @version 2.0.1
+ * @version 0.1.1
* @description 内置 zh-CN / en-US 完整翻译
*/
diff --git a/src/plugins.js b/src/plugins.js
index c7febf5..8aa1ec0 100644
--- a/src/plugins.js
+++ b/src/plugins.js
@@ -1,7 +1,7 @@
/**
* MetonaToast Plugins - 插件系统
* @module plugins
- * @version 2.0.1
+ * @version 0.1.1
* @description 插件管理器 + 3 款预设插件 (keyboard / persistence / accessibility)
*/
diff --git a/src/styles.js b/src/styles.js
index 0d9be1b..e506285 100644
--- a/src/styles.js
+++ b/src/styles.js
@@ -1,6 +1,7 @@
/**
- * MetonaToast Styles - 样式管理(精简版 v2.0.1)
+ * MetonaToast Styles - 样式管理(精简版 v0.1.1)
* @module styles
+ * @version 0.1.1
* @description 样式注入与主题管理,移除未使用的组件样式
*/
diff --git a/src/themes.js b/src/themes.js
index 7932bbe..0545950 100644
--- a/src/themes.js
+++ b/src/themes.js
@@ -1,7 +1,7 @@
/**
* MetonaToast Themes - 主题管理
* @module themes
- * @version 2.0.1
+ * @version 0.1.1
* @description 主题系统、自定义主题和主题切换
*/
diff --git a/src/utils.js b/src/utils.js
index 869b137..767484d 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -1,7 +1,7 @@
/**
* MetonaToast Utils - 精简工具函数
* @module utils
- * @version 2.0.1
+ * @version 0.1.1
* @description 仅保留核心模块实际使用的工具函数
*/
diff --git a/tests/index.test.js b/tests/index.test.js
index 5f232d8..6c2cda1 100644
--- a/tests/index.test.js
+++ b/tests/index.test.js
@@ -1,7 +1,7 @@
/**
* MetonaToast 单元测试
* @module tests
- * @version 2.0.1
+ * @version 0.1.1
*/
import MeToast, { Toast, VERSION } from '../src/index.js';
@@ -121,8 +121,8 @@ describe('MetonaToast', () => {
describe('版本信息', () => {
test('应该有正确的版本号', () => {
- expect(VERSION).toBe('2.0.1');
- expect(MeToast.version).toBe('2.0.1');
+ expect(VERSION).toBe('0.1.1');
+ expect(MeToast.version).toBe('0.1.1');
});
});
@@ -583,7 +583,7 @@ describe('MetonaToast', () => {
MeToast.success('消息');
const status = MeToast.getStatus();
- expect(status.version).toBe('2.0.1');
+ expect(status.version).toBe('0.1.1');
expect(status.toasts).toBeGreaterThanOrEqual(0);
expect(status.theme).toBeDefined();
expect(status.locale).toBeDefined();
diff --git a/types/index.d.ts b/types/index.d.ts
index 4cffbdf..a28695c 100644
--- a/types/index.d.ts
+++ b/types/index.d.ts
@@ -1,6 +1,6 @@
/**
* MetonaToast TypeScript 类型定义
- * @version 2.0.1
+ * @version 0.1.1
*/
// 基础类型