<commit_before>/**
 * @description 增加缩进/减少缩进
 * @author tonghan
 */

import $ from '../../utils/dom-core'
import Editor from '../../editor/index'
import DropListMenu from '../menu-constructors/DropListMenu'
import { MenuActive } from '../menu-constructors/Menu'
import getParagraph from './get-paragraph'
import getParagraphs from './get-paragraphs'
import operateElement from './operate-element'

class Indent extends DropListMenu implements MenuActive {
    constructor(editor: Editor) {
        const $elem = $(
            `<div class="w-e-menu">
                <i class="w-e-icon-indent-increase"></i>
            </div>`
        )
        const dropListConf = {
            width: 100,
            title: '设置缩进',
            type: 'list',
            list: [
                {
                    $elem: $(
                        `<p><i class="w-e-icon-indent-increase" style="padding-right:7px;position: relative;top:1px; color: #999"></i>增加缩进<p>`
                    ),
                    value: 'increase',
                },

                {
                    $elem: $(
                        `<p><i class="w-e-icon-indent-decrease" style="padding-right:7px;position: relative;top:1px; color: #999"></i>减少缩进<p>`
                    ),
                    value: 'decrease',
                },
            ],
            clickHandler: (value: string) => {
                // 注意 this 是指向当前的 Indent 对象
                this.command(value)
            },
        }

        super($elem, editor, dropListConf)
    }

    /**
     * 执行命令
     * @param value value
     */
    public command(value: string): void {
        const editor = this.editor
        const $selectionElem = editor.selection.getSelectionContainerElem()
<commit_msg>fix: 修改字体颜色<commit_after>/**
 * @description 增加缩进/减少缩进
 * @author tonghan
 */

import $ from '../../utils/dom-core'
import Editor from '../../editor/index'
import DropListMenu from '../menu-constructors/DropListMenu'
import { MenuActive } from '../menu-constructors/Menu'
import getParagraph from './get-paragraph'
import getParagraphs from './get-paragraphs'
import operateElement from './operate-element'

class Indent extends DropListMenu implements MenuActive {
    constructor(editor: Editor) {
        const $elem = $(
            `<div class="w-e-menu">
                <i class="w-e-icon-indent-increase"></i>
            </div>`
        )
        const dropListConf = {
            width: 100,
            title: '设置缩进',
            type: 'list',
            list: [
                {
                    $elem: $(
                        `<p><i class="w-e-icon-indent-increase" style="padding-right:7px;position: relative;top:1px; color: #333"></i>增加缩进<p>`
                    ),
                    value: 'increase',
                },

                {
                    $elem: $(
                        `<p><i class="w-e-icon-indent-decrease" style="padding-right:7px;position: relative;top:1px; color: #333"></i>减少缩进<p>`
                    ),
                    value: 'decrease',
                },
            ],
            clickHandler: (value: string) => {
                // 注意 this 是指向当前的 Indent 对象
                this.command(value)
            },
        }

        super($elem, editor, dropListConf)
    }

    /**
     * 执行命令
     * @param value value
     */
    public command(value: string): void {
        const editor = this.editor
        const $selectionElem = editor.selection.getSelectionContainerElem()

{'fraction_non_alphanumeric': 0.13880938752146538, 'fraction_numerical': 0.007441327990841442, 'mean_word_length': 1.551094890510949, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2980069', 'n_tokens_mistral': 1061, 'n_tokens_neox': 1024, 'n_words': 201}