@aomao/plugin-heading
标题样式插件
Last updated 2 years ago by aomao .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @aomao/plugin-heading 
SYNC missed versions from official npm registry.

@aomao/plugin-heading

标题样式插件

安装

$ yarn add @aomao/plugin-heading

添加到引擎

import Engine, { EngineInterface } from '@aomao/engine';
import Heading from '@aomao/plugin-heading';

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

可选项

锚点

开启后在标题左边出现可复制锚点按钮

showAnchor?: boolean;

当点击复制锚点的时候触发,传入当前标题的 id 值,返回的内容将写入到用户的粘贴板上,默认将返回当前 url+id

anchorCopy?:(id:string) => string

快捷键

//快捷键
hotkey?: {
    h1?: string;//标题1,默认 mod+opt+1
    h2?: string;//标题2,默认 mod+opt+2
    h3?: string;//标题3,默认 mod+opt+3
    h4?: string;//标题4,默认 mod+opt+4
    h5?: string;//标题5,默认 mod+opt+5
    h6?: string;//标题6,默认 mod+opt+6
};
//使用配置
new Engine(...,{
    config:{
        "heading":{
            //修改快捷键
            hotkey:{
                h1:"快捷键"
            }
        }
    }
 })

禁用 mark 插件样式效果

可以在标题下禁用 mark 插件效果,默认禁用 ['fontsize', 'bold'] ,在分割、粘贴等情况下过滤掉这些插件样式

disableMark?: Array<string> //mark插件名称集合

要启用的类型(h1 h2 h3 h4 h5 h6)

可以定义 h1 - h6 所需要的节点类型,如果不定义则支持全部

enableTypes?: Array<string>

另外可能还需要配置 toolbar 中 items 属性的 heading 插件

{
    type: 'dropdown',
    name: 'heading',
    items: [
        {
            key: "p",
            className: 'heading-item-p',
            content: "正文"
        },
        {
            key: "h1",
            className: 'heading-item-h1',
            content: "标题1"
        }
    ]
    }

命令

传入 p 或当前标题样式与当前传入值一致 时将取消标题

//使用 command 执行插件、并传入所需参数
engine.command.execute(
	'heading',
	'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p',
);
//使用 command 执行查询当前状态,返回 string | undefined,返回 "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p"
engine.command.queryState('heading');

Current Tags

  • 2.10.0                                ...           latest (2 years ago)

221 Versions

  • 2.10.0                                ...           2 years ago
  • 2.9.29                                ...           2 years ago
  • 2.9.28                                ...           2 years ago
  • 2.9.27                                ...           2 years ago
  • 2.9.26                                ...           2 years ago
  • 2.9.25                                ...           2 years ago
  • 2.9.24                                ...           2 years ago
  • 2.9.23                                ...           2 years ago
  • 2.9.22                                ...           2 years ago
  • 2.9.21                                ...           2 years ago
  • 2.9.20                                ...           2 years ago
  • 2.9.19                                ...           2 years ago
  • 2.9.18                                ...           2 years ago
  • 2.9.17                                ...           2 years ago
  • 2.9.16                                ...           2 years ago
  • 2.9.15                                ...           2 years ago
  • 2.9.14                                ...           2 years ago
  • 2.9.13                                ...           2 years ago
  • 2.9.12                                ...           2 years ago
  • 2.9.11                                ...           2 years ago
  • 2.9.10                                ...           2 years ago
  • 2.9.9                                ...           2 years ago
  • 2.9.8                                ...           2 years ago
  • 2.9.7                                ...           2 years ago
  • 2.9.6                                ...           2 years ago
  • 2.9.5                                ...           2 years ago
  • 2.9.4                                ...           2 years ago
  • 2.9.3                                ...           2 years ago
  • 2.9.2                                ...           2 years ago
  • 2.9.1                                ...           2 years ago
  • 2.9.0                                ...           3 years ago
  • 2.8.27                                ...           3 years ago
  • 2.8.26                                ...           3 years ago
  • 2.8.25                                ...           3 years ago
  • 2.8.24                                ...           3 years ago
  • 2.8.23                                ...           3 years ago
  • 2.8.22                                ...           3 years ago
  • 2.8.21                                ...           3 years ago
  • 2.8.20                                ...           3 years ago
  • 2.8.19                                ...           3 years ago
  • 2.8.18                                ...           3 years ago
  • 2.8.17                                ...           3 years ago
  • 2.8.16                                ...           3 years ago
  • 2.8.15                                ...           3 years ago
  • 2.8.14                                ...           3 years ago
  • 2.8.13                                ...           3 years ago
  • 2.8.12                                ...           3 years ago
  • 2.8.11                                ...           3 years ago
  • 2.8.10                                ...           3 years ago
  • 2.8.9                                ...           3 years ago
  • 2.8.8                                ...           3 years ago
  • 2.8.7                                ...           3 years ago
  • 2.8.6                                ...           3 years ago
  • 2.8.5                                ...           3 years ago
  • 2.8.4                                ...           3 years ago
  • 2.8.3                                ...           3 years ago
  • 2.8.2                                ...           3 years ago
  • 2.8.1                                ...           3 years ago
  • 2.8.0                                ...           3 years ago
  • 2.7.37                                ...           3 years ago
  • 2.7.36                                ...           3 years ago
  • 2.7.35                                ...           3 years ago
  • 2.7.34                                ...           3 years ago
  • 2.7.33                                ...           3 years ago
  • 2.7.32                                ...           3 years ago
  • 2.7.31                                ...           3 years ago
  • 2.7.30                                ...           3 years ago
  • 2.7.29                                ...           3 years ago
  • 2.7.28                                ...           3 years ago
  • 2.7.27                                ...           3 years ago
  • 2.7.26                                ...           3 years ago
  • 2.7.25                                ...           3 years ago
  • 2.7.24                                ...           3 years ago
  • 2.7.23                                ...           3 years ago
  • 2.7.22                                ...           3 years ago
  • 2.7.21                                ...           3 years ago
  • 2.7.20                                ...           3 years ago
  • 2.7.19                                ...           3 years ago
  • 2.7.18                                ...           3 years ago
  • 2.7.17                                ...           3 years ago
  • 2.7.16                                ...           3 years ago
  • 2.7.15                                ...           3 years ago
  • 2.7.14                                ...           3 years ago
  • 2.7.13                                ...           3 years ago
  • 2.7.12                                ...           3 years ago
  • 2.7.11                                ...           3 years ago
  • 2.7.10                                ...           3 years ago
  • 2.7.9                                ...           3 years ago
  • 2.7.8                                ...           3 years ago
  • 2.7.7                                ...           3 years ago
  • 2.7.6                                ...           3 years ago
  • 2.7.5                                ...           3 years ago
  • 2.7.4                                ...           3 years ago
  • 2.7.3                                ...           3 years ago
  • 2.7.2                                ...           3 years ago
  • 2.7.1                                ...           3 years ago
  • 2.7.0                                ...           3 years ago
  • 2.6.23                                ...           3 years ago
  • 2.6.22                                ...           3 years ago
  • 2.6.21                                ...           3 years ago
  • 2.6.20                                ...           3 years ago
  • 2.6.19                                ...           3 years ago
  • 2.6.18                                ...           3 years ago
  • 2.6.17                                ...           3 years ago
  • 2.6.16                                ...           3 years ago
  • 2.6.15                                ...           3 years ago
  • 2.6.14                                ...           3 years ago
  • 2.6.13                                ...           3 years ago
  • 2.6.12                                ...           3 years ago
  • 2.6.11                                ...           3 years ago
  • 2.6.10                                ...           3 years ago
  • 2.6.9                                ...           3 years ago
  • 2.6.8                                ...           3 years ago
  • 2.6.7                                ...           3 years ago
  • 2.6.6                                ...           3 years ago
  • 2.6.5                                ...           3 years ago
  • 2.6.4                                ...           3 years ago
  • 2.6.3                                ...           3 years ago
  • 2.6.2                                ...           3 years ago
  • 2.6.1                                ...           3 years ago
  • 2.6.0                                ...           3 years ago
  • 2.5.3                                ...           3 years ago
  • 2.5.2                                ...           3 years ago
  • 2.5.1                                ...           3 years ago
  • 2.5.0                                ...           3 years ago
  • 2.4.20                                ...           3 years ago
  • 2.4.19                                ...           3 years ago
  • 2.4.18                                ...           3 years ago
  • 2.4.17                                ...           3 years ago
  • 2.4.16                                ...           3 years ago
  • 2.4.15                                ...           3 years ago
  • 2.4.14                                ...           3 years ago
  • 2.4.13                                ...           3 years ago
  • 2.4.12                                ...           3 years ago
  • 2.4.11                                ...           3 years ago
  • 2.4.10                                ...           3 years ago
  • 2.4.9                                ...           3 years ago
  • 2.4.8                                ...           3 years ago
  • 2.4.7                                ...           3 years ago
  • 2.4.6                                ...           3 years ago
  • 2.4.5                                ...           3 years ago
  • 2.4.4                                ...           3 years ago
  • 2.4.3                                ...           3 years ago
  • 2.4.2                                ...           3 years ago
  • 2.4.1                                ...           3 years ago
  • 2.4.0                                ...           3 years ago
  • 2.3.35                                ...           3 years ago
  • 2.3.34                                ...           3 years ago
  • 2.3.33                                ...           3 years ago
  • 2.3.32                                ...           3 years ago
  • 2.3.31                                ...           3 years ago
  • 2.3.30                                ...           3 years ago
  • 2.3.29                                ...           3 years ago
  • 2.3.28                                ...           3 years ago
  • 2.3.26                                ...           3 years ago
  • 2.3.25                                ...           3 years ago
  • 2.3.24                                ...           3 years ago
  • 2.3.23                                ...           3 years ago
  • 2.3.22                                ...           3 years ago
  • 2.3.21                                ...           3 years ago
  • 2.3.20                                ...           3 years ago
  • 2.3.19                                ...           3 years ago
  • 2.3.18                                ...           3 years ago
  • 2.3.17                                ...           3 years ago
  • 2.3.16                                ...           3 years ago
  • 2.3.15                                ...           3 years ago
  • 2.3.14                                ...           3 years ago
  • 2.3.13                                ...           3 years ago
  • 2.3.12                                ...           3 years ago
  • 2.3.11                                ...           3 years ago
  • 2.3.10                                ...           3 years ago
  • 2.3.9                                ...           3 years ago
  • 2.3.8                                ...           3 years ago
  • 2.3.7                                ...           3 years ago
  • 2.3.6                                ...           3 years ago
  • 2.3.5                                ...           3 years ago
  • 2.3.4                                ...           3 years ago
  • 2.3.3                                ...           3 years ago
  • 2.3.2                                ...           3 years ago
  • 2.3.1                                ...           3 years ago
  • 2.3.0                                ...           3 years ago
  • 2.2.20                                ...           3 years ago
  • 2.2.19                                ...           3 years ago
  • 2.2.18                                ...           3 years ago
  • 2.2.17                                ...           3 years ago
  • 2.2.16                                ...           3 years ago
  • 2.2.15                                ...           3 years ago
  • 2.2.14                                ...           3 years ago
  • 2.2.13                                ...           3 years ago
  • 2.2.12                                ...           3 years ago
  • 2.2.11                                ...           3 years ago
  • 2.2.10                                ...           3 years ago
  • 2.2.9                                ...           3 years ago
  • 2.2.8                                ...           3 years ago
  • 2.2.7                                ...           3 years ago
  • 2.2.6                                ...           3 years ago
  • 2.2.5                                ...           3 years ago
  • 2.2.4                                ...           3 years ago
  • 2.2.3                                ...           3 years ago
  • 2.2.2                                ...           3 years ago
  • 2.2.1                                ...           3 years ago
  • 2.2.0                                ...           3 years ago
  • 2.1.4                                ...           3 years ago
  • 2.1.3                                ...           3 years ago
  • 2.1.2                                ...           3 years ago
  • 2.1.1                                ...           3 years ago
  • 2.1.0                                ...           3 years ago
  • 2.0.1                                ...           4 years ago
  • 2.0.0                                ...           4 years ago
  • 1.3.0                                ...           4 years ago
  • 1.2.2                                ...           4 years ago
  • 1.2.1                                ...           4 years ago
  • 1.2.0                                ...           4 years ago
  • 1.1.7                                ...           4 years ago
  • 1.1.6                                ...           4 years ago
  • 1.1.5                                ...           4 years ago
  • 1.1.3                                ...           4 years ago
  • 1.1.2                                ...           4 years ago
  • 1.1.1                                ...           4 years ago
  • 1.1.0                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Total 200
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (1)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE