feat: v0.2.4 — 搜索面板全面重设计 + 完整安装文档
CI / test (20.x) (push) Canceled after 0s
CI / test (22.x) (push) Canceled after 0s
CI / test (24.x) (push) Canceled after 0s
CI / test (18.x) (push) Canceled after 41m3s

### Changed
- 搜索面板:暗色玻璃拟态设计,SVG 图标,流畅动画,改进间距和焦点状态
- README / site:补全 npm / CDN / ESM / CJS / 浏览器五种安装方式

### Fixed
- CI 卡死:移除 setInterval,改用纯事件驱动
- 浮动工具栏定位修正
- 浮动工具栏开关按钮修复
This commit is contained in:
2026-07-25 15:50:12 +08:00
parent b48468f599
commit ff667ae77a
17 changed files with 108 additions and 43 deletions
+44 -5
View File
@@ -2,9 +2,9 @@
> TypeScript 重构 · 零运行时依赖 · 轻量级桌面端 Markdown Editor 库
[![version](https://img.shields.io/badge/version-0.2.3-blue)](https://git.metona.cn/MetonaTeam/-/packages/npm/@metona-team%2Fmetona-editor)
[![version](https://img.shields.io/badge/version-0.2.4-blue)](https://git.metona.cn/MetonaTeam/-/packages/npm/@metona-team%2Fmetona-editor)
[![license](https://img.shields.io/badge/license-MIT-green)](./LICENSE)
[![tests](https://img.shields.io/badge/tests-725%20passed-brightgreen)](./tests)
[![tests](https://img.shields.io/badge/tests-412%20passed-brightgreen)](./tests)
[![coverage](https://img.shields.io/badge/coverage-parser%2099%25-brightgreen)](./tests)
[![types](https://img.shields.io/badge/types-TypeScript%20strict-blue)](./tsconfig.json)
@@ -46,32 +46,71 @@
## 快速开始
### npm 安装
### 方式一:npm 安装(推荐)
```bash
npm install @metona-team/metona-editor
```
```typescript
// ES Module / TypeScript
import MeEditor from '@metona-team/metona-editor';
const editor = MeEditor.create('#editor', {
value: '# Hello World',
mode: 'split',
theme: 'auto',
plugins: ['autoSave', 'searchReplace'],
});
```
### CDN 引入
```javascript
// CommonJS
const MeEditor = require('@metona-team/metona-editor');
const editor = MeEditor.create('#editor', { mode: 'split' });
```
### 方式二:CDN 引入
```html
<div id="editor"></div>
<!-- jsDelivr CDN (推荐) -->
<script src="https://cdn.jsdelivr.net/npm/@metona-team/metona-editor@0.2.4/dist/metona-editor.min.js"></script>
<!-- unpkg CDN -->
<script src="https://unpkg.com/@metona-team/metona-editor@0.2.4/dist/metona-editor.min.js"></script>
<!-- Gitea 源 -->
<script src="https://git.metona.cn/MetonaTeam/MetonaEditor/raw/branch/master/dist/metona-editor.js"></script>
<div id="editor"></div>
<script>
const editor = MeEditor.create('#editor', { mode: 'split' });
</script>
```
### 方式三:本地文件
```bash
# 下载产物文件到项目中
# dist/metona-editor.js → UMD (浏览器)
# dist/metona-editor.min.js → UMD 压缩
# dist/metona-editor.esm.js → ES Module
# dist/metona-editor.cjs.js → CommonJS
```
```html
<!-- 浏览器直接引入本地文件 -->
<script src="./dist/metona-editor.min.js"></script>
```
```javascript
// Node.js ESM
import MeEditor from './dist/metona-editor.esm.js';
// Node.js CJS
const MeEditor = require('./dist/metona-editor.cjs.js');
```
---
## 配置项