chore: 版本回退至 0.5.0 并重建产物(含 CJS 兼容修复)
CI / test (18.x) (push) Successful in 10m8s
CI / test (20.x) (push) Successful in 10m10s
CI / test (22.x) (push) Successful in 10m4s
CI / test (24.x) (push) Successful in 10m2s

This commit is contained in:
tianhao
2026-08-08 15:40:04 +08:00
parent 2516a3a36b
commit 5f8b9d2f75
32 changed files with 104 additions and 103 deletions
+1
View File
@@ -23,6 +23,7 @@ All notable changes to MetonaToast will be documented in this file.
### Added ### Added
- **Gitea Actions 发布自动化**`publish.yml` — 推送 `v*` tag 时自动 测试+构建+发布到 Gitea npm registry(需配置 `PACKAGES_TOKEN` secret - **Gitea Actions 发布自动化**`publish.yml` — 推送 `v*` tag 时自动 测试+构建+发布到 Gitea npm registry(需配置 `PACKAGES_TOKEN` secret
- **CI 强化**lint 改为必过(移除 continue-on-error);测试命令带覆盖率门禁 - **CI 强化**lint 改为必过(移除 continue-on-error);测试命令带覆盖率门禁
- **CJS 产物兼容性修复**:包声明 `type: module``.js` 产物被 Node 按 ESM 解析导致 `require()` 失效,CJS 产物改 `.cjs` 扩展名并将 default 提升为 `module.exports``require()` 直接返回 MeToast,兼容 `.default`/`.MeToast`/`.Met`/`.Toast`/`.VERSION` 全部用法)
## [0.4.0] - 2026-08-08 ## [0.4.0] - 2026-08-08
+13 -13
View File
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
/** /**
* MetonaToast Utils — 工具函数 * MetonaToast Utils — 工具函数
* @module utils * @module utils
* @version 0.5.1 * @version 0.5.0
*/ */
/** /**
* 生成唯一ID * 生成唯一ID
@@ -42,7 +42,7 @@ const prefersDark = () => {
/** /**
* MetonaToast Icons — 图标SVG定义 * MetonaToast Icons — 图标SVG定义
* @module icons * @module icons
* @version 0.5.1 * @version 0.5.0
* @description 107 个内置 SVG 图标 * @description 107 个内置 SVG 图标
*/ */
const ICONS = { const ICONS = {
@@ -539,7 +539,7 @@ const ICONS = {
/** /**
* MetonaToast Locales — 国际化翻译数据 * MetonaToast Locales — 国际化翻译数据
* @module locales * @module locales
* @version 0.5.1 * @version 0.5.0
* @description 内置 zh-CN / en-US 完整翻译 * @description 内置 zh-CN / en-US 完整翻译
*/ */
const LOCALES = { const LOCALES = {
@@ -1026,12 +1026,12 @@ const LOCALES = {
/** /**
* MetonaToast Constants — 常量定义 * MetonaToast Constants — 常量定义
* @module constants * @module constants
* @version 0.5.1 * @version 0.5.0
*/ */
/** /**
* 版本号 — 唯一来源,发布时只需修改此处 * 版本号 — 唯一来源,发布时只需修改此处
*/ */
const VERSION = '0.5.1'; const VERSION = '0.5.0';
/** /**
* 默认配置 * 默认配置
*/ */
@@ -1298,7 +1298,7 @@ const ANIMATION_TYPES = ['slide', 'fade', 'scale', 'bounce', 'flip', 'rotate', '
/** /**
* MetonaToast Styles — 样式管理 * MetonaToast Styles — 样式管理
* @module styles * @module styles
* @version 0.5.1 * @version 0.5.0
*/ */
// 样式缓存 // 样式缓存
let styleElement = null; let styleElement = null;
@@ -1787,7 +1787,7 @@ const injectStyles = () => {
/** /**
* MetonaToast Themes — 主题管理 * MetonaToast Themes — 主题管理
* @module themes * @module themes
* @version 0.5.1 * @version 0.5.0
*/ */
// 当前主题状态 // 当前主题状态
let currentTheme = 'auto'; let currentTheme = 'auto';
@@ -2131,7 +2131,7 @@ const themeUtils = {
/** /**
* MetonaToast i18n — 国际化管理 * MetonaToast i18n — 国际化管理
* @module i18n * @module i18n
* @version 0.5.1 * @version 0.5.0
*/ */
// 当前语言状态 // 当前语言状态
let currentLocale = 'zh-CN'; let currentLocale = 'zh-CN';
@@ -2806,7 +2806,7 @@ const animationUtils = {
/** /**
* MetonaToast Toast — Toast 类 * MetonaToast Toast — Toast 类
* @module toast * @module toast
* @version 0.5.1 * @version 0.5.0
*/ */
/** /**
* Toast 类 — 核心通知组件 * Toast 类 — 核心通知组件
@@ -3445,7 +3445,7 @@ const _containerCache = new Map();
/** /**
* MetonaToast Templates — HTML 模板辅助函数 * MetonaToast Templates — HTML 模板辅助函数
* @module templates * @module templates
* @version 0.5.1 * @version 0.5.0
* @description confirm / prompt / progress / action 的 DOM 模板 * @description confirm / prompt / progress / action 的 DOM 模板
*/ */
/** /**
@@ -3517,7 +3517,7 @@ const actionHTML = (actions) => {
/** /**
* MetonaToast Plugins — 插件系统 * MetonaToast Plugins — 插件系统
* @module plugins * @module plugins
* @version 0.5.1 * @version 0.5.0
*/ */
/** /**
* 插件管理器 * 插件管理器
@@ -3777,7 +3777,7 @@ const defaultPluginManager = new PluginManager();
/** /**
* MetonaToast API — meToast 核心 API 对象 * MetonaToast API — meToast 核心 API 对象
* @module api * @module api
* @version 0.5.1 * @version 0.5.0
*/ */
/** /**
* 参数标准化工具 * 参数标准化工具
@@ -4463,7 +4463,7 @@ Toast.setCallbacks({
/** /**
* MetonaToast — 轻量级Toast通知库 * MetonaToast — 轻量级Toast通知库
* @module metona-toast * @module metona-toast
* @version 0.5.1 * @version 0.5.0
* @author thzxx * @author thzxx
* @license MIT * @license MIT
*/ */
+4 -4
View File
@@ -1,7 +1,7 @@
/** /**
* MetonaToast — 核心类型定义 * MetonaToast — 核心类型定义
* @module types * @module types
* @version 0.5.1 * @version 0.5.0
*/ */
/** Toast 通知类型(107种内置图标类型) */ /** Toast 通知类型(107种内置图标类型) */
type ToastType = 'default' | 'success' | 'error' | 'warning' | 'info' | 'loading' | 'check' | 'x' | 'alert' | 'question' | 'star' | 'heart' | 'bell' | 'mail' | 'settings' | 'user' | 'home' | 'search' | 'plus' | 'minus' | 'edit' | 'trash' | 'download' | 'upload' | 'share' | 'link' | 'external' | 'clock' | 'calendar' | 'map' | 'compass' | 'globe' | 'wifi' | 'cloud' | 'sun' | 'moon' | 'zap' | 'activity' | 'cpu' | 'database' | 'server' | 'terminal' | 'code' | 'git' | 'package' | 'layers' | 'grid' | 'list' | 'filter' | 'sort' | 'refresh' | 'sync' | 'power' | 'battery' | 'bluetooth' | 'volume' | 'mic' | 'camera' | 'image' | 'video' | 'music' | 'file' | 'folder' | 'clipboard' | 'save' | 'print' | 'eye' | 'eyeOff' | 'lock' | 'unlock' | 'shield' | 'key' | 'flag' | 'bookmark' | 'tag' | 'gift' | 'award' | 'target' | 'crosshair' | 'move' | 'maximize' | 'minimize' | 'copy' | 'cut' | 'paste' | 'rotateCw' | 'rotateCcw' | 'zoomIn' | 'zoomOut' | 'crop' | 'sliders' | 'toggleLeft' | 'toggleRight' | 'checkCircle' | 'xCircle' | 'alertCircle' | 'infoCircle' | 'helpCircle' | 'alertTriangle' | 'checkSquare' | 'square' | 'circle' | 'triangle' | 'hexagon' | 'octagon' | 'pentagon' | 'diamond'; type ToastType = 'default' | 'success' | 'error' | 'warning' | 'info' | 'loading' | 'check' | 'x' | 'alert' | 'question' | 'star' | 'heart' | 'bell' | 'mail' | 'settings' | 'user' | 'home' | 'search' | 'plus' | 'minus' | 'edit' | 'trash' | 'download' | 'upload' | 'share' | 'link' | 'external' | 'clock' | 'calendar' | 'map' | 'compass' | 'globe' | 'wifi' | 'cloud' | 'sun' | 'moon' | 'zap' | 'activity' | 'cpu' | 'database' | 'server' | 'terminal' | 'code' | 'git' | 'package' | 'layers' | 'grid' | 'list' | 'filter' | 'sort' | 'refresh' | 'sync' | 'power' | 'battery' | 'bluetooth' | 'volume' | 'mic' | 'camera' | 'image' | 'video' | 'music' | 'file' | 'folder' | 'clipboard' | 'save' | 'print' | 'eye' | 'eyeOff' | 'lock' | 'unlock' | 'shield' | 'key' | 'flag' | 'bookmark' | 'tag' | 'gift' | 'award' | 'target' | 'crosshair' | 'move' | 'maximize' | 'minimize' | 'copy' | 'cut' | 'paste' | 'rotateCw' | 'rotateCcw' | 'zoomIn' | 'zoomOut' | 'crop' | 'sliders' | 'toggleLeft' | 'toggleRight' | 'checkCircle' | 'xCircle' | 'alertCircle' | 'infoCircle' | 'helpCircle' | 'alertTriangle' | 'checkSquare' | 'square' | 'circle' | 'triangle' | 'hexagon' | 'octagon' | 'pentagon' | 'diamond';
@@ -418,7 +418,7 @@ declare global {
/** /**
* MetonaToast Toast — Toast 类 * MetonaToast Toast — Toast 类
* @module toast * @module toast
* @version 0.5.1 * @version 0.5.0
*/ */
/** /**
@@ -492,13 +492,13 @@ declare class Toast implements ToastInstance {
/** /**
* MetonaToast Constants — 常量定义 * MetonaToast Constants — 常量定义
* @module constants * @module constants
* @version 0.5.1 * @version 0.5.0
*/ */
/** /**
* 版本号 — 唯一来源,发布时只需修改此处 * 版本号 — 唯一来源,发布时只需修改此处
*/ */
declare const VERSION = "0.5.1"; declare const VERSION = "0.5.0";
/** /**
* 增强的 MeToast 对象 — 在 meToast 基础上注入子模块 * 增强的 MeToast 对象 — 在 meToast 基础上注入子模块
+13 -13
View File
@@ -1,7 +1,7 @@
/** /**
* MetonaToast Utils — 工具函数 * MetonaToast Utils — 工具函数
* @module utils * @module utils
* @version 0.5.1 * @version 0.5.0
*/ */
/** /**
* 生成唯一ID * 生成唯一ID
@@ -38,7 +38,7 @@ const prefersDark = () => {
/** /**
* MetonaToast Icons — 图标SVG定义 * MetonaToast Icons — 图标SVG定义
* @module icons * @module icons
* @version 0.5.1 * @version 0.5.0
* @description 107 个内置 SVG 图标 * @description 107 个内置 SVG 图标
*/ */
const ICONS = { const ICONS = {
@@ -535,7 +535,7 @@ const ICONS = {
/** /**
* MetonaToast Locales — 国际化翻译数据 * MetonaToast Locales — 国际化翻译数据
* @module locales * @module locales
* @version 0.5.1 * @version 0.5.0
* @description 内置 zh-CN / en-US 完整翻译 * @description 内置 zh-CN / en-US 完整翻译
*/ */
const LOCALES = { const LOCALES = {
@@ -1022,12 +1022,12 @@ const LOCALES = {
/** /**
* MetonaToast Constants — 常量定义 * MetonaToast Constants — 常量定义
* @module constants * @module constants
* @version 0.5.1 * @version 0.5.0
*/ */
/** /**
* 版本号 — 唯一来源,发布时只需修改此处 * 版本号 — 唯一来源,发布时只需修改此处
*/ */
const VERSION = '0.5.1'; const VERSION = '0.5.0';
/** /**
* 默认配置 * 默认配置
*/ */
@@ -1294,7 +1294,7 @@ const ANIMATION_TYPES = ['slide', 'fade', 'scale', 'bounce', 'flip', 'rotate', '
/** /**
* MetonaToast Styles — 样式管理 * MetonaToast Styles — 样式管理
* @module styles * @module styles
* @version 0.5.1 * @version 0.5.0
*/ */
// 样式缓存 // 样式缓存
let styleElement = null; let styleElement = null;
@@ -1783,7 +1783,7 @@ const injectStyles = () => {
/** /**
* MetonaToast Themes — 主题管理 * MetonaToast Themes — 主题管理
* @module themes * @module themes
* @version 0.5.1 * @version 0.5.0
*/ */
// 当前主题状态 // 当前主题状态
let currentTheme = 'auto'; let currentTheme = 'auto';
@@ -2127,7 +2127,7 @@ const themeUtils = {
/** /**
* MetonaToast i18n — 国际化管理 * MetonaToast i18n — 国际化管理
* @module i18n * @module i18n
* @version 0.5.1 * @version 0.5.0
*/ */
// 当前语言状态 // 当前语言状态
let currentLocale = 'zh-CN'; let currentLocale = 'zh-CN';
@@ -2802,7 +2802,7 @@ const animationUtils = {
/** /**
* MetonaToast Toast — Toast 类 * MetonaToast Toast — Toast 类
* @module toast * @module toast
* @version 0.5.1 * @version 0.5.0
*/ */
/** /**
* Toast 类 — 核心通知组件 * Toast 类 — 核心通知组件
@@ -3441,7 +3441,7 @@ const _containerCache = new Map();
/** /**
* MetonaToast Templates — HTML 模板辅助函数 * MetonaToast Templates — HTML 模板辅助函数
* @module templates * @module templates
* @version 0.5.1 * @version 0.5.0
* @description confirm / prompt / progress / action 的 DOM 模板 * @description confirm / prompt / progress / action 的 DOM 模板
*/ */
/** /**
@@ -3513,7 +3513,7 @@ const actionHTML = (actions) => {
/** /**
* MetonaToast Plugins — 插件系统 * MetonaToast Plugins — 插件系统
* @module plugins * @module plugins
* @version 0.5.1 * @version 0.5.0
*/ */
/** /**
* 插件管理器 * 插件管理器
@@ -3773,7 +3773,7 @@ const defaultPluginManager = new PluginManager();
/** /**
* MetonaToast API — meToast 核心 API 对象 * MetonaToast API — meToast 核心 API 对象
* @module api * @module api
* @version 0.5.1 * @version 0.5.0
*/ */
/** /**
* 参数标准化工具 * 参数标准化工具
@@ -4459,7 +4459,7 @@ Toast.setCallbacks({
/** /**
* MetonaToast — 轻量级Toast通知库 * MetonaToast — 轻量级Toast通知库
* @module metona-toast * @module metona-toast
* @version 0.5.1 * @version 0.5.0
* @author thzxx * @author thzxx
* @license MIT * @license MIT
*/ */
+13 -13
View File
@@ -7,7 +7,7 @@
/** /**
* MetonaToast Utils — 工具函数 * MetonaToast Utils — 工具函数
* @module utils * @module utils
* @version 0.5.1 * @version 0.5.0
*/ */
/** /**
* 生成唯一ID * 生成唯一ID
@@ -44,7 +44,7 @@
/** /**
* MetonaToast Icons — 图标SVG定义 * MetonaToast Icons — 图标SVG定义
* @module icons * @module icons
* @version 0.5.1 * @version 0.5.0
* @description 107 个内置 SVG 图标 * @description 107 个内置 SVG 图标
*/ */
const ICONS = { const ICONS = {
@@ -541,7 +541,7 @@
/** /**
* MetonaToast Locales — 国际化翻译数据 * MetonaToast Locales — 国际化翻译数据
* @module locales * @module locales
* @version 0.5.1 * @version 0.5.0
* @description 内置 zh-CN / en-US 完整翻译 * @description 内置 zh-CN / en-US 完整翻译
*/ */
const LOCALES = { const LOCALES = {
@@ -1028,12 +1028,12 @@
/** /**
* MetonaToast Constants — 常量定义 * MetonaToast Constants — 常量定义
* @module constants * @module constants
* @version 0.5.1 * @version 0.5.0
*/ */
/** /**
* 版本号 — 唯一来源,发布时只需修改此处 * 版本号 — 唯一来源,发布时只需修改此处
*/ */
const VERSION = '0.5.1'; const VERSION = '0.5.0';
/** /**
* 默认配置 * 默认配置
*/ */
@@ -1300,7 +1300,7 @@
/** /**
* MetonaToast Styles — 样式管理 * MetonaToast Styles — 样式管理
* @module styles * @module styles
* @version 0.5.1 * @version 0.5.0
*/ */
// 样式缓存 // 样式缓存
let styleElement = null; let styleElement = null;
@@ -1789,7 +1789,7 @@
/** /**
* MetonaToast Themes — 主题管理 * MetonaToast Themes — 主题管理
* @module themes * @module themes
* @version 0.5.1 * @version 0.5.0
*/ */
// 当前主题状态 // 当前主题状态
let currentTheme = 'auto'; let currentTheme = 'auto';
@@ -2133,7 +2133,7 @@
/** /**
* MetonaToast i18n — 国际化管理 * MetonaToast i18n — 国际化管理
* @module i18n * @module i18n
* @version 0.5.1 * @version 0.5.0
*/ */
// 当前语言状态 // 当前语言状态
let currentLocale = 'zh-CN'; let currentLocale = 'zh-CN';
@@ -2808,7 +2808,7 @@
/** /**
* MetonaToast Toast — Toast 类 * MetonaToast Toast — Toast 类
* @module toast * @module toast
* @version 0.5.1 * @version 0.5.0
*/ */
/** /**
* Toast 类 — 核心通知组件 * Toast 类 — 核心通知组件
@@ -3447,7 +3447,7 @@
/** /**
* MetonaToast Templates — HTML 模板辅助函数 * MetonaToast Templates — HTML 模板辅助函数
* @module templates * @module templates
* @version 0.5.1 * @version 0.5.0
* @description confirm / prompt / progress / action 的 DOM 模板 * @description confirm / prompt / progress / action 的 DOM 模板
*/ */
/** /**
@@ -3519,7 +3519,7 @@
/** /**
* MetonaToast Plugins — 插件系统 * MetonaToast Plugins — 插件系统
* @module plugins * @module plugins
* @version 0.5.1 * @version 0.5.0
*/ */
/** /**
* 插件管理器 * 插件管理器
@@ -3779,7 +3779,7 @@
/** /**
* MetonaToast API — meToast 核心 API 对象 * MetonaToast API — meToast 核心 API 对象
* @module api * @module api
* @version 0.5.1 * @version 0.5.0
*/ */
/** /**
* 参数标准化工具 * 参数标准化工具
@@ -4465,7 +4465,7 @@
/** /**
* MetonaToast — 轻量级Toast通知库 * MetonaToast — 轻量级Toast通知库
* @module metona-toast * @module metona-toast
* @version 0.5.1 * @version 0.5.0
* @author thzxx * @author thzxx
* @license MIT * @license MIT
*/ */
+1 -1
View File
File diff suppressed because one or more lines are too long
+14 -14
View File
@@ -5,7 +5,7 @@ var react = require('react');
/** /**
* MetonaToast Utils 工具函数 * MetonaToast Utils 工具函数
* @module utils * @module utils
* @version 0.5.1 * @version 0.5.0
*/ */
/** /**
* 生成唯一ID * 生成唯一ID
@@ -42,7 +42,7 @@ const prefersDark = () => {
/** /**
* MetonaToast Icons 图标SVG定义 * MetonaToast Icons 图标SVG定义
* @module icons * @module icons
* @version 0.5.1 * @version 0.5.0
* @description 107 个内置 SVG 图标 * @description 107 个内置 SVG 图标
*/ */
const ICONS = { const ICONS = {
@@ -539,7 +539,7 @@ const ICONS = {
/** /**
* MetonaToast Locales 国际化翻译数据 * MetonaToast Locales 国际化翻译数据
* @module locales * @module locales
* @version 0.5.1 * @version 0.5.0
* @description 内置 zh-CN / en-US 完整翻译 * @description 内置 zh-CN / en-US 完整翻译
*/ */
const LOCALES = { const LOCALES = {
@@ -1026,12 +1026,12 @@ const LOCALES = {
/** /**
* MetonaToast Constants 常量定义 * MetonaToast Constants 常量定义
* @module constants * @module constants
* @version 0.5.1 * @version 0.5.0
*/ */
/** /**
* 版本号 唯一来源发布时只需修改此处 * 版本号 唯一来源发布时只需修改此处
*/ */
const VERSION = '0.5.1'; const VERSION = '0.5.0';
/** /**
* 默认配置 * 默认配置
*/ */
@@ -1298,7 +1298,7 @@ const ANIMATION_TYPES = ['slide', 'fade', 'scale', 'bounce', 'flip', 'rotate', '
/** /**
* MetonaToast Styles 样式管理 * MetonaToast Styles 样式管理
* @module styles * @module styles
* @version 0.5.1 * @version 0.5.0
*/ */
// 样式缓存 // 样式缓存
let styleElement = null; let styleElement = null;
@@ -1787,7 +1787,7 @@ const injectStyles = () => {
/** /**
* MetonaToast Themes 主题管理 * MetonaToast Themes 主题管理
* @module themes * @module themes
* @version 0.5.1 * @version 0.5.0
*/ */
// 当前主题状态 // 当前主题状态
let currentTheme = 'auto'; let currentTheme = 'auto';
@@ -2131,7 +2131,7 @@ const themeUtils = {
/** /**
* MetonaToast i18n 国际化管理 * MetonaToast i18n 国际化管理
* @module i18n * @module i18n
* @version 0.5.1 * @version 0.5.0
*/ */
// 当前语言状态 // 当前语言状态
let currentLocale = 'zh-CN'; let currentLocale = 'zh-CN';
@@ -2806,7 +2806,7 @@ const animationUtils = {
/** /**
* MetonaToast Toast Toast * MetonaToast Toast Toast
* @module toast * @module toast
* @version 0.5.1 * @version 0.5.0
*/ */
/** /**
* Toast 核心通知组件 * Toast 核心通知组件
@@ -3445,7 +3445,7 @@ const _containerCache = new Map();
/** /**
* MetonaToast Templates HTML 模板辅助函数 * MetonaToast Templates HTML 模板辅助函数
* @module templates * @module templates
* @version 0.5.1 * @version 0.5.0
* @description confirm / prompt / progress / action DOM 模板 * @description confirm / prompt / progress / action DOM 模板
*/ */
/** /**
@@ -3517,7 +3517,7 @@ const actionHTML = (actions) => {
/** /**
* MetonaToast Plugins 插件系统 * MetonaToast Plugins 插件系统
* @module plugins * @module plugins
* @version 0.5.1 * @version 0.5.0
*/ */
/** /**
* 插件管理器 * 插件管理器
@@ -3777,7 +3777,7 @@ const defaultPluginManager = new PluginManager();
/** /**
* MetonaToast API meToast 核心 API 对象 * MetonaToast API meToast 核心 API 对象
* @module api * @module api
* @version 0.5.1 * @version 0.5.0
*/ */
/** /**
* 参数标准化工具 * 参数标准化工具
@@ -4463,7 +4463,7 @@ Toast$1.setCallbacks({
/** /**
* MetonaToast 轻量级Toast通知库 * MetonaToast 轻量级Toast通知库
* @module metona-toast * @module metona-toast
* @version 0.5.1 * @version 0.5.0
* @author thzxx * @author thzxx
* @license MIT * @license MIT
*/ */
@@ -4529,7 +4529,7 @@ if (typeof window !== 'undefined') {
/** /**
* MetonaToast React React 适配器 * MetonaToast React React 适配器
* @module react * @module react
* @version 0.5.1 * @version 0.5.0
* @description useToast hook + 声明式 <Toast /> 组件主包保持零依赖React optional peerDependency * @description useToast hook + 声明式 <Toast /> 组件主包保持零依赖React optional peerDependency
*/ */
const SHOW_METHODS = ['success', 'error', 'warning', 'info', 'show']; const SHOW_METHODS = ['success', 'error', 'warning', 'info', 'show'];
+2 -2
View File
@@ -1,7 +1,7 @@
/** /**
* MetonaToast * MetonaToast
* @module types * @module types
* @version 0.5.1 * @version 0.5.0
*/ */
/** Toast 通知类型(107种内置图标类型) */ /** Toast 通知类型(107种内置图标类型) */
type ToastType = 'default' | 'success' | 'error' | 'warning' | 'info' | 'loading' | 'check' | 'x' | 'alert' | 'question' | 'star' | 'heart' | 'bell' | 'mail' | 'settings' | 'user' | 'home' | 'search' | 'plus' | 'minus' | 'edit' | 'trash' | 'download' | 'upload' | 'share' | 'link' | 'external' | 'clock' | 'calendar' | 'map' | 'compass' | 'globe' | 'wifi' | 'cloud' | 'sun' | 'moon' | 'zap' | 'activity' | 'cpu' | 'database' | 'server' | 'terminal' | 'code' | 'git' | 'package' | 'layers' | 'grid' | 'list' | 'filter' | 'sort' | 'refresh' | 'sync' | 'power' | 'battery' | 'bluetooth' | 'volume' | 'mic' | 'camera' | 'image' | 'video' | 'music' | 'file' | 'folder' | 'clipboard' | 'save' | 'print' | 'eye' | 'eyeOff' | 'lock' | 'unlock' | 'shield' | 'key' | 'flag' | 'bookmark' | 'tag' | 'gift' | 'award' | 'target' | 'crosshair' | 'move' | 'maximize' | 'minimize' | 'copy' | 'cut' | 'paste' | 'rotateCw' | 'rotateCcw' | 'zoomIn' | 'zoomOut' | 'crop' | 'sliders' | 'toggleLeft' | 'toggleRight' | 'checkCircle' | 'xCircle' | 'alertCircle' | 'infoCircle' | 'helpCircle' | 'alertTriangle' | 'checkSquare' | 'square' | 'circle' | 'triangle' | 'hexagon' | 'octagon' | 'pentagon' | 'diamond'; type ToastType = 'default' | 'success' | 'error' | 'warning' | 'info' | 'loading' | 'check' | 'x' | 'alert' | 'question' | 'star' | 'heart' | 'bell' | 'mail' | 'settings' | 'user' | 'home' | 'search' | 'plus' | 'minus' | 'edit' | 'trash' | 'download' | 'upload' | 'share' | 'link' | 'external' | 'clock' | 'calendar' | 'map' | 'compass' | 'globe' | 'wifi' | 'cloud' | 'sun' | 'moon' | 'zap' | 'activity' | 'cpu' | 'database' | 'server' | 'terminal' | 'code' | 'git' | 'package' | 'layers' | 'grid' | 'list' | 'filter' | 'sort' | 'refresh' | 'sync' | 'power' | 'battery' | 'bluetooth' | 'volume' | 'mic' | 'camera' | 'image' | 'video' | 'music' | 'file' | 'folder' | 'clipboard' | 'save' | 'print' | 'eye' | 'eyeOff' | 'lock' | 'unlock' | 'shield' | 'key' | 'flag' | 'bookmark' | 'tag' | 'gift' | 'award' | 'target' | 'crosshair' | 'move' | 'maximize' | 'minimize' | 'copy' | 'cut' | 'paste' | 'rotateCw' | 'rotateCcw' | 'zoomIn' | 'zoomOut' | 'crop' | 'sliders' | 'toggleLeft' | 'toggleRight' | 'checkCircle' | 'xCircle' | 'alertCircle' | 'infoCircle' | 'helpCircle' | 'alertTriangle' | 'checkSquare' | 'square' | 'circle' | 'triangle' | 'hexagon' | 'octagon' | 'pentagon' | 'diamond';
@@ -478,7 +478,7 @@ declare const enhancedMeToast: {
/** /**
* MetonaToast React React * MetonaToast React React
* @module react * @module react
* @version 0.5.1 * @version 0.5.0
* @description useToast hook + <Toast /> React optional peerDependency * @description useToast hook + <Toast /> React optional peerDependency
*/ */
+14 -14
View File
@@ -3,7 +3,7 @@ import { useRef, useEffect, useMemo } from 'react';
/** /**
* MetonaToast Utils 工具函数 * MetonaToast Utils 工具函数
* @module utils * @module utils
* @version 0.5.1 * @version 0.5.0
*/ */
/** /**
* 生成唯一ID * 生成唯一ID
@@ -40,7 +40,7 @@ const prefersDark = () => {
/** /**
* MetonaToast Icons 图标SVG定义 * MetonaToast Icons 图标SVG定义
* @module icons * @module icons
* @version 0.5.1 * @version 0.5.0
* @description 107 个内置 SVG 图标 * @description 107 个内置 SVG 图标
*/ */
const ICONS = { const ICONS = {
@@ -537,7 +537,7 @@ const ICONS = {
/** /**
* MetonaToast Locales 国际化翻译数据 * MetonaToast Locales 国际化翻译数据
* @module locales * @module locales
* @version 0.5.1 * @version 0.5.0
* @description 内置 zh-CN / en-US 完整翻译 * @description 内置 zh-CN / en-US 完整翻译
*/ */
const LOCALES = { const LOCALES = {
@@ -1024,12 +1024,12 @@ const LOCALES = {
/** /**
* MetonaToast Constants 常量定义 * MetonaToast Constants 常量定义
* @module constants * @module constants
* @version 0.5.1 * @version 0.5.0
*/ */
/** /**
* 版本号 唯一来源发布时只需修改此处 * 版本号 唯一来源发布时只需修改此处
*/ */
const VERSION = '0.5.1'; const VERSION = '0.5.0';
/** /**
* 默认配置 * 默认配置
*/ */
@@ -1296,7 +1296,7 @@ const ANIMATION_TYPES = ['slide', 'fade', 'scale', 'bounce', 'flip', 'rotate', '
/** /**
* MetonaToast Styles 样式管理 * MetonaToast Styles 样式管理
* @module styles * @module styles
* @version 0.5.1 * @version 0.5.0
*/ */
// 样式缓存 // 样式缓存
let styleElement = null; let styleElement = null;
@@ -1785,7 +1785,7 @@ const injectStyles = () => {
/** /**
* MetonaToast Themes 主题管理 * MetonaToast Themes 主题管理
* @module themes * @module themes
* @version 0.5.1 * @version 0.5.0
*/ */
// 当前主题状态 // 当前主题状态
let currentTheme = 'auto'; let currentTheme = 'auto';
@@ -2129,7 +2129,7 @@ const themeUtils = {
/** /**
* MetonaToast i18n 国际化管理 * MetonaToast i18n 国际化管理
* @module i18n * @module i18n
* @version 0.5.1 * @version 0.5.0
*/ */
// 当前语言状态 // 当前语言状态
let currentLocale = 'zh-CN'; let currentLocale = 'zh-CN';
@@ -2804,7 +2804,7 @@ const animationUtils = {
/** /**
* MetonaToast Toast Toast * MetonaToast Toast Toast
* @module toast * @module toast
* @version 0.5.1 * @version 0.5.0
*/ */
/** /**
* Toast 核心通知组件 * Toast 核心通知组件
@@ -3443,7 +3443,7 @@ const _containerCache = new Map();
/** /**
* MetonaToast Templates HTML 模板辅助函数 * MetonaToast Templates HTML 模板辅助函数
* @module templates * @module templates
* @version 0.5.1 * @version 0.5.0
* @description confirm / prompt / progress / action DOM 模板 * @description confirm / prompt / progress / action DOM 模板
*/ */
/** /**
@@ -3515,7 +3515,7 @@ const actionHTML = (actions) => {
/** /**
* MetonaToast Plugins 插件系统 * MetonaToast Plugins 插件系统
* @module plugins * @module plugins
* @version 0.5.1 * @version 0.5.0
*/ */
/** /**
* 插件管理器 * 插件管理器
@@ -3775,7 +3775,7 @@ const defaultPluginManager = new PluginManager();
/** /**
* MetonaToast API meToast 核心 API 对象 * MetonaToast API meToast 核心 API 对象
* @module api * @module api
* @version 0.5.1 * @version 0.5.0
*/ */
/** /**
* 参数标准化工具 * 参数标准化工具
@@ -4461,7 +4461,7 @@ Toast$1.setCallbacks({
/** /**
* MetonaToast 轻量级Toast通知库 * MetonaToast 轻量级Toast通知库
* @module metona-toast * @module metona-toast
* @version 0.5.1 * @version 0.5.0
* @author thzxx * @author thzxx
* @license MIT * @license MIT
*/ */
@@ -4527,7 +4527,7 @@ if (typeof window !== 'undefined') {
/** /**
* MetonaToast React React 适配器 * MetonaToast React React 适配器
* @module react * @module react
* @version 0.5.1 * @version 0.5.0
* @description useToast hook + 声明式 <Toast /> 组件主包保持零依赖React optional peerDependency * @description useToast hook + 声明式 <Toast /> 组件主包保持零依赖React optional peerDependency
*/ */
const SHOW_METHODS = ['success', 'error', 'warning', 'info', 'show']; const SHOW_METHODS = ['success', 'error', 'warning', 'info', 'show'];
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@metona-team/metona-toast", "name": "@metona-team/metona-toast",
"version": "0.5.1", "version": "0.5.0",
"description": "轻量、零依赖、精致美观的Toast通知库。TypeScript源码,开箱即用。", "description": "轻量、零依赖、精致美观的Toast通知库。TypeScript源码,开箱即用。",
"type": "module", "type": "module",
"main": "dist/metona-toast.cjs", "main": "dist/metona-toast.cjs",
+1 -1
View File
@@ -336,7 +336,7 @@
</main> </main>
<footer> <footer>
MetonaToast v0.5.1 · MIT · MetonaToast v0.5.0 · MIT ·
<a href="index.html">首页</a> · <a href="index.html">首页</a> ·
<a href="docs.html">文档</a> · <a href="docs.html">文档</a> ·
<a href="https://git.metona.cn/MetonaTeam/MetonaToast">Gitea</a> <a href="https://git.metona.cn/MetonaTeam/MetonaToast">Gitea</a>
+1 -1
View File
@@ -146,7 +146,7 @@
<main class="main"> <main class="main">
<h1>API 文档</h1> <h1>API 文档</h1>
<p class="h1-desc">MetonaToast v0.5.1 完整 API 参考。所有基础通知方法支持字符串与对象两种调用形式,均可传入任何<a href="#config">配置项</a>作为可选参数。</p> <p class="h1-desc">MetonaToast v0.5.0 完整 API 参考。所有基础通知方法支持字符串与对象两种调用形式,均可传入任何<a href="#config">配置项</a>作为可选参数。</p>
<!-- ===== 基础通知 ===== --> <!-- ===== 基础通知 ===== -->
<h2 id="show">show(message, opts?)</h2> <h2 id="show">show(message, opts?)</h2>
+2 -2
View File
@@ -251,7 +251,7 @@
<div class="orb orb-1"></div> <div class="orb orb-1"></div>
<div class="orb orb-2"></div> <div class="orb orb-2"></div>
<div class="orb orb-3"></div> <div class="orb orb-3"></div>
<div class="hero-badge"><span class="dot"></span> v0.5.1 · 385 测试 · 覆盖率 96%</div> <div class="hero-badge"><span class="dot"></span> v0.5.0 · 385 测试 · 覆盖率 96%</div>
<h1><span class="grad-text">MetonaToast</span></h1> <h1><span class="grad-text">MetonaToast</span></h1>
<p class="hero-sub">轻量 · 零依赖 · 精致美观的 Toast 通知库。TypeScript 严格模式,gzip 不到 10KB,一切开箱即用。</p> <p class="hero-sub">轻量 · 零依赖 · 精致美观的 Toast 通知库。TypeScript 严格模式,gzip 不到 10KB,一切开箱即用。</p>
<div class="hero-badges"> <div class="hero-badges">
@@ -441,7 +441,7 @@ MeToast.<span class="fn">action</span>(<span class="s">'文件已删除'</span>,
</section> </section>
<footer> <footer>
MetonaToast v0.5.1 · MIT License · MetonaToast v0.5.0 · MIT License ·
<a href="https://git.metona.cn/MetonaTeam/MetonaToast" target="_blank">Gitea</a> · <a href="https://git.metona.cn/MetonaTeam/MetonaToast" target="_blank">Gitea</a> ·
<a href="docs.html">文档</a> · <a href="docs.html">文档</a> ·
<a href="demo.html">演示</a> <a href="demo.html">演示</a>
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* MetonaToast API meToast API * MetonaToast API meToast API
* @module api * @module api
* @version 0.5.1 * @version 0.5.0
*/ */
import { Toast, _containerCache } from './toast.js'; import { Toast, _containerCache } from './toast.js';
+2 -2
View File
@@ -1,7 +1,7 @@
/** /**
* MetonaToast Constants * MetonaToast Constants
* @module constants * @module constants
* @version 0.5.1 * @version 0.5.0
*/ */
import { ICONS } from './icons.js'; import { ICONS } from './icons.js';
@@ -12,7 +12,7 @@ export { ICONS, LOCALES };
/** /**
* *
*/ */
export const VERSION = '0.5.1'; export const VERSION = '0.5.0';
/** /**
* *
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* MetonaToast i18n * MetonaToast i18n
* @module i18n * @module i18n
* @version 0.5.1 * @version 0.5.0
*/ */
import { LOCALES } from './constants.js'; import { LOCALES } from './constants.js';
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* MetonaToast Icons SVG定义 * MetonaToast Icons SVG定义
* @module icons * @module icons
* @version 0.5.1 * @version 0.5.0
* @description 107 SVG * @description 107 SVG
*/ */
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* MetonaToast Toast通知库 * MetonaToast Toast通知库
* @module metona-toast * @module metona-toast
* @version 0.5.1 * @version 0.5.0
* @author thzxx * @author thzxx
* @license MIT * @license MIT
*/ */
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* MetonaToast Locales * MetonaToast Locales
* @module locales * @module locales
* @version 0.5.1 * @version 0.5.0
* @description zh-CN / en-US * @description zh-CN / en-US
*/ */
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* MetonaToast Plugins * MetonaToast Plugins
* @module plugins * @module plugins
* @version 0.5.1 * @version 0.5.0
*/ */
import { t } from './i18n.js'; import { t } from './i18n.js';
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* MetonaToast React React * MetonaToast React React
* @module react * @module react
* @version 0.5.1 * @version 0.5.0
* @description useToast hook + <Toast /> React optional peerDependency * @description useToast hook + <Toast /> React optional peerDependency
*/ */
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* MetonaToast Styles * MetonaToast Styles
* @module styles * @module styles
* @version 0.5.1 * @version 0.5.0
*/ */
import type { ThemeConfig } from './types.js'; import type { ThemeConfig } from './types.js';
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* MetonaToast Templates HTML * MetonaToast Templates HTML
* @module templates * @module templates
* @version 0.5.1 * @version 0.5.0
* @description confirm / prompt / progress / action DOM * @description confirm / prompt / progress / action DOM
*/ */
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* MetonaToast Themes * MetonaToast Themes
* @module themes * @module themes
* @version 0.5.1 * @version 0.5.0
*/ */
import { THEMES } from './constants.js'; import { THEMES } from './constants.js';
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* MetonaToast Toast Toast * MetonaToast Toast Toast
* @module toast * @module toast
* @version 0.5.1 * @version 0.5.0
*/ */
import { generateId, escapeHTML } from './utils.js'; import { generateId, escapeHTML } from './utils.js';
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* MetonaToast * MetonaToast
* @module types * @module types
* @version 0.5.1 * @version 0.5.0
*/ */
// ========== 基础类型 ========== // ========== 基础类型 ==========
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* MetonaToast Utils * MetonaToast Utils
* @module utils * @module utils
* @version 0.5.1 * @version 0.5.0
*/ */
/** /**
+2 -2
View File
@@ -1,7 +1,7 @@
/** /**
* MetonaToast 95%+ * MetonaToast 95%+
* @module tests * @module tests
* @version 0.5.1 * @version 0.5.0
*/ */
import MeToast, { Toast, VERSION } from '../src/index'; import MeToast, { Toast, VERSION } from '../src/index';
@@ -809,7 +809,7 @@ describe('api.ts 覆盖率', () => {
test('getStatus 返回完整状态', () => { test('getStatus 返回完整状态', () => {
const status = MeToast.getStatus(); const status = MeToast.getStatus();
expect(status.version).toBe('0.5.1'); expect(status.version).toBe('0.5.0');
expect(status.toasts).toBeGreaterThanOrEqual(0); expect(status.toasts).toBeGreaterThanOrEqual(0);
expect(status.theme).toBeDefined(); expect(status.theme).toBeDefined();
expect(status.locale).toBeDefined(); expect(status.locale).toBeDefined();
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* MetonaToast DOM jsdom DOM * MetonaToast DOM jsdom DOM
* @module tests * @module tests
* @version 0.5.1 * @version 0.5.0
*/ */
import MeToast, { Toast } from '../src/index'; import MeToast, { Toast } from '../src/index';
+4 -4
View File
@@ -1,7 +1,7 @@
/** /**
* MetonaToast * MetonaToast
* @module tests * @module tests
* @version 0.5.1 * @version 0.5.0
*/ */
import MeToast, { Toast, VERSION } from '../src/index'; import MeToast, { Toast, VERSION } from '../src/index';
@@ -105,8 +105,8 @@ const mockWindow = {
describe('版本信息', () => { describe('版本信息', () => {
test('应该有正确的版本号', () => { test('应该有正确的版本号', () => {
expect(VERSION).toBe('0.5.1'); expect(VERSION).toBe('0.5.0');
expect(MeToast.version).toBe('0.5.1'); expect(MeToast.version).toBe('0.5.0');
}); });
}); });
@@ -526,7 +526,7 @@ const mockWindow = {
test('应该能够获取状态信息', () => { test('应该能够获取状态信息', () => {
MeToast.success('消息'); MeToast.success('消息');
const status = MeToast.getStatus(); const status = MeToast.getStatus();
expect(status.version).toBe('0.5.1'); expect(status.version).toBe('0.5.0');
expect(status.toasts).toBeGreaterThanOrEqual(0); expect(status.toasts).toBeGreaterThanOrEqual(0);
expect(status.theme).toBeDefined(); expect(status.theme).toBeDefined();
expect(status.locale).toBeDefined(); expect(status.locale).toBeDefined();
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* MetonaToast React * MetonaToast React
* @module tests * @module tests
* @version 0.5.1 * @version 0.5.0
*/ */
import React from 'react'; import React from 'react';
+1 -1
View File
@@ -4,7 +4,7 @@
* require import * require import
* jsdom getter document/window defineProperty * jsdom getter document/window defineProperty
* @module tests * @module tests
* @version 0.5.1 * @version 0.5.0
*/ */
/** 临时移除全局对象,返回恢复函数 */ /** 临时移除全局对象,返回恢复函数 */