<commit_before>import {commands} from "prosemirror-old/dist/edit/commands"
import {tableInsertTemplate, tableEditTemplate} from "./templates"
import {createTable, addColumnAfter, addColumnBefore, removeColumn, addRowBefore, addRowAfter, removeRow} from "prosemirror-old/dist/schema-table"

export class TableDropdown {
    constructor(mod) {
        this.editor = mod.editor
        this.init()
    }

    // Check if caret is inside a table
    inTable() {
        const currentPm = this.editor.currentPm
        const fromEl = currentPm.doc.resolve(currentPm.selection.from).node(2)
        const toEl = currentPm.doc.resolve(currentPm.selection.to).node(2)
        if (fromEl===toEl && fromEl.type.name === 'table') {<commit_msg>fix: show table change menu when inside table<commit_after>import {commands} from "prosemirror-old/dist/edit/commands"
import {tableInsertTemplate, tableEditTemplate} from "./templates"
import {createTable, addColumnAfter, addColumnBefore, removeColumn, addRowBefore, addRowAfter, removeRow} from "prosemirror-old/dist/schema-table"

export class TableDropdown {
    constructor(mod) {
        this.editor = mod.editor
        this.init()
    }

    // Check if caret is inside a table
    inTable() {
        const currentPm = this.editor.currentPm
        const fromEl = currentPm.doc.resolve(currentPm.selection.from).node(3)
        const toEl = currentPm.doc.resolve(currentPm.selection.to).node(3)
        if (fromEl===toEl && fromEl.type.name === 'table') {
{'fraction_non_alphanumeric': 0.11564171122994653, 'fraction_numerical': 0.00267379679144385, 'mean_word_length': 3.767515923566879, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1460945', 'n_tokens_mistral': 455, 'n_tokens_neox': 450, 'n_words': 101}