UNPKG

@atlaskit/editor-plugin-table

Version:

Table plugin for the @atlaskit/editor

71 lines (65 loc) 1.68 kB
import { BACKGROUND_COLOR_ITEM, CLEAR_CELLS_ITEM } from '../shared/keys'; // --- Menu surface --- export const CELL_MENU = { type: 'menu', key: 'cell-contextual-menu' }; // --- Sections --- export const CELL_ACTION_SECTION = { type: 'menu-section', key: 'cell-action-section' }; export const CELL_DANGER_SECTION = { type: 'menu-section', key: 'cell-danger-section' }; export const CELL_MENU_RANK = { [CELL_ACTION_SECTION.key]: 100, [CELL_DANGER_SECTION.key]: 200 }; export const MERGE_CELLS_ITEM = { type: 'menu-item', key: 'merge-cells' }; export const SPLIT_CELL_ITEM = { type: 'menu-item', key: 'split-cell' }; export const VERTICAL_ALIGN_MENU = { type: 'nested-menu', key: 'vertical-align' }; export const VERTICAL_ALIGN_MENU_SECTION = { type: 'menu-section', key: 'vertical-align-section' }; export const VERTICAL_ALIGN_TOP_ITEM = { type: 'menu-item', key: 'vertical-align-top' }; export const VERTICAL_ALIGN_MIDDLE_ITEM = { type: 'menu-item', key: 'vertical-align-middle' }; export const VERTICAL_ALIGN_BOTTOM_ITEM = { type: 'menu-item', key: 'vertical-align-bottom' }; // --- Item ranks within their sections --- export const CELL_ACTION_SECTION_RANK = { [BACKGROUND_COLOR_ITEM.key]: 100, [VERTICAL_ALIGN_MENU.key]: 200, [MERGE_CELLS_ITEM.key]: 300, [SPLIT_CELL_ITEM.key]: 400 }; export const VERTICAL_ALIGN_MENU_RANK = { [VERTICAL_ALIGN_MENU_SECTION.key]: 100 }; export const VERTICAL_ALIGN_MENU_SECTION_RANK = { [VERTICAL_ALIGN_TOP_ITEM.key]: 100, [VERTICAL_ALIGN_MIDDLE_ITEM.key]: 200, [VERTICAL_ALIGN_BOTTOM_ITEM.key]: 300 }; export const CELL_DANGER_SECTION_RANK = { [CLEAR_CELLS_ITEM.key]: 100 };