# @eyea/plugin-alignment

> 对齐方式：左对齐、居中对齐、右对齐、两端对齐

Latest version **2.7.30** (published 2022-02-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install @eyea/plugin-alignment
pnpm add @eyea/plugin-alignment
yarn add @eyea/plugin-alignment
bun add @eyea/plugin-alignment
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.7.30 |
| Published | 2022-02-18 |
| First published | 2022-02-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 4.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | me@aomao.com |
| Maintainers | eyea |

## Links

- npm: https://www.npmjs.com/package/@eyea/plugin-alignment
- Repository: https://github.com/yanmao-cc/am-editor
- Homepage: https://github.com/yanmao-cc/am-editor#readme
- Issues: https://github.com/yanmao-cc/am-editor/issues
- npm.io page: https://npm.io/package/@eyea/plugin-alignment

## Dependencies (2)

- [@aomao/engine](https://npm.io/package/@aomao/engine.md) ^2.7.30
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.13.10

## Recent versions

- 2.7.30 (latest) — 2022-02-18

## README

# @aomao/plugin-alignment

对齐方式：左对齐、居中对齐、右对齐、两端对齐

## 安装

```bash
$ yarn add @aomao/plugin-alignment
```

添加到引擎

```ts
import Engine, { EngineInterface } from '@aomao/engine';
import Alignment from '@aomao/plugin-alignment';

new Engine(...,{ plugins:[Alignment] })
```

## 可选项

```ts
//快捷键
hotkey?: {
    left?: string;//左对齐，默认 mod+shift+l
    center?: string;//居中对齐，默认 mod+shift+c
    right?: string;//右对齐，默认 mod+shift+r
    justify?: string;//两端对齐，默认 mod+shift+j
};
//使用配置
new Engine(...,{
    config:{
        "alignment":{
            //修改 左对齐 快捷键
            hotkey:{
                left:"快捷键"
            }
        }
    }
 })
```

## 命令

对齐插件可选参数，`left` | `center` | `right` | `justify`，分别表示 左对齐、居中对齐、右对齐、两端对齐

```ts
//使用 command 执行插件、并传入所需参数
engine.command.execute('alignment', 'left' | 'center' | 'right' | 'justify');
//使用 command 执行查询当前状态，返回 string | undefined，光标所在处节点对齐样式 "left" | "center" | "right" | "justify"
engine.command.queryState('alignment');
```

---
_Source: https://npm.io/package/@eyea/plugin-alignment · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
