release: v0.1.6 — plugin v2, i18n instance isolation, shortcuts, toolbar, toast
feat(plugins): plugin system v2
- depends: declarative plugin dependencies with topological sort (Kahn algorithm)
- async plugins: install() returning Promise auto-await
- editor.unuse(name): uninstall individual plugins
- pluginUtils.validateConfig(schema, config): configuration validation
- plugin priority field controls install order within same dependency level
feat(i18n): instance-level locale isolation, pluralization, dynamic loading
- createInstanceI18n(): per-editor independent locale contexts
- editor.setLocale()/getLocale()/t() instance methods
- Plural rules: t('items', { count: 5 }) auto-selects one/other/few/many
- i18nUtils.loadRemote(url, locale): fetch translation packs from remote
- editor.on('localeChange') event
feat(core): toolbar & shortcut customization, context menu, toast
- editor.registerShortcut(combo, handler): custom keyboard shortcuts
- editor.configureToolbar(tools): dynamic toolbar rebuild
- editor.removeToolbarButton(action): remove single button
- editor.registerContextMenu(items): right-click context menu
- editor.toast(msg, {type, duration, animation}): toast notifications
style: toast notifications, context menu, dropdown CSS
- .me-toast with success/error/warning/info types, fade/slide animations
- .me-context-menu with items, separators, shortcut hints
test: 22 new tests covering plugin deps, unuse, shortcuts, toast, i18n plural (521 total)
chore: bump version 0.1.5 → 0.1.6 across all files, site, types
This commit is contained in:
+63
-1
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* MetonaEditor Styles - 编辑器样式
|
||||
* @module styles
|
||||
* @version 0.1.5
|
||||
* @version 0.1.6
|
||||
* @description 编辑器 UI 样式注入与管理
|
||||
*/
|
||||
|
||||
@@ -392,6 +392,68 @@ const generateCSS = () => {
|
||||
margin-right: 0.4em;
|
||||
}
|
||||
|
||||
/* ============ Toast 通知(v0.1.6) ============ */
|
||||
.me-toast {
|
||||
position: absolute;
|
||||
bottom: 16px;
|
||||
right: 16px;
|
||||
z-index: 30;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 10px 16px;
|
||||
border-radius: 8px;
|
||||
font-size: 13px;
|
||||
pointer-events: auto;
|
||||
cursor: pointer;
|
||||
opacity: 0;
|
||||
transform: translateY(12px);
|
||||
transition: opacity 0.3s ease, transform 0.3s ease;
|
||||
box-shadow: 0 6px 20px rgba(0,0,0,0.15);
|
||||
max-width: 360px;
|
||||
}
|
||||
.me-toast.me-toast-enter { opacity: 1; transform: translateY(0); }
|
||||
.me-toast.me-toast-leave { opacity: 0; transform: translateY(12px); }
|
||||
.me-toast-success { background: #10b981; color: #fff; }
|
||||
.me-toast-error { background: #ef4444; color: #fff; }
|
||||
.me-toast-warning { background: #f59e0b; color: #fff; }
|
||||
.me-toast-info { background: var(--md-accent, #3b82f6); color: #fff; }
|
||||
.me-toast-icon { font-weight: 700; font-size: 16px; flex-shrink: 0; }
|
||||
.me-toast-msg { line-height: 1.4; }
|
||||
|
||||
/* ============ 右键菜单(v0.1.6) ============ */
|
||||
.me-context-menu {
|
||||
position: fixed;
|
||||
z-index: 40;
|
||||
min-width: 180px;
|
||||
padding: 4px 0;
|
||||
background: var(--md-bg);
|
||||
border: 1px solid var(--md-border);
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 8px 28px rgba(0,0,0,0.18);
|
||||
font-size: 13px;
|
||||
}
|
||||
.me-context-menu-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 6px 14px;
|
||||
cursor: pointer;
|
||||
color: var(--md-text);
|
||||
transition: background 0.1s;
|
||||
}
|
||||
.me-context-menu-item:hover { background: var(--md-code-bg); color: var(--md-accent); }
|
||||
.me-context-menu-sep {
|
||||
height: 1px;
|
||||
background: var(--md-border);
|
||||
margin: 4px 0;
|
||||
}
|
||||
.me-context-menu-shortcut {
|
||||
color: var(--md-muted);
|
||||
font-size: 11px;
|
||||
margin-left: 24px;
|
||||
}
|
||||
|
||||
/* ============ 打印样式 ============ */
|
||||
@media print {
|
||||
.me-wrapper { border: 0 !important; box-shadow: none !important; }
|
||||
|
||||
Reference in New Issue
Block a user