feat: v0.2.4 — 搜索面板全面重设计 + 完整安装文档
### Changed - 搜索面板:暗色玻璃拟态设计,SVG 图标,流畅动画,改进间距和焦点状态 - README / site:补全 npm / CDN / ESM / CJS / 浏览器五种安装方式 ### Fixed - CI 卡死:移除 setInterval,改用纯事件驱动 - 浮动工具栏定位修正 - 浮动工具栏开关按钮修复
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
|
||||
> TypeScript 重构 · 零运行时依赖 · 轻量级桌面端 Markdown Editor 库
|
||||
|
||||
[](https://git.metona.cn/MetonaTeam/-/packages/npm/@metona-team%2Fmetona-editor)
|
||||
[](https://git.metona.cn/MetonaTeam/-/packages/npm/@metona-team%2Fmetona-editor)
|
||||
[](./LICENSE)
|
||||
[](./tests)
|
||||
[](./tests)
|
||||
[](./tests)
|
||||
[](./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');
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 配置项
|
||||
|
||||
Reference in New Issue
Block a user