UNPKG

@atlaskit/editor-plugin-table

Version:

Table plugin for the @atlaskit/editor

81 lines (75 loc) 1.85 kB
import { BACKGROUND_COLOR_ITEM, CLEAR_CELLS_ITEM } from '../shared/keys'; // --- Menu surface --- export const ROW_MENU = { type: 'menu', key: 'row-handle-menu' }; // --- Sections --- export const ROW_TOGGLE_SECTION = { type: 'menu-section', key: 'row-toggle-section' }; export const ROW_BACKGROUND_SECTION = { type: 'menu-section', key: 'row-background-section' }; export const ROW_ADD_SECTION = { type: 'menu-section', key: 'row-add-section' }; export const ROW_DANGER_SECTION = { type: 'menu-section', key: 'row-danger-section' }; export const ROW_MENU_SECTION_RANK = { [ROW_TOGGLE_SECTION.key]: 100, [ROW_BACKGROUND_SECTION.key]: 200, [ROW_ADD_SECTION.key]: 300, [ROW_DANGER_SECTION.key]: 400 }; export const HEADER_ROW_TOGGLE_ITEM = { type: 'menu-item', key: 'header-row-toggle' }; export const NUMBERED_ROWS_TOGGLE_ITEM = { type: 'menu-item', key: 'numbered-rows-toggle' }; export const ADD_ROW_ABOVE_ITEM = { type: 'menu-item', key: 'add-row-above' }; export const ADD_ROW_BELOW_ITEM = { type: 'menu-item', key: 'add-row-below' }; export const MOVE_ROW_UP_ITEM = { type: 'menu-item', key: 'move-row-up' }; export const MOVE_ROW_DOWN_ITEM = { type: 'menu-item', key: 'move-row-down' }; export const DELETE_ROW_ITEM = { type: 'menu-item', key: 'delete-row' }; // --- Item ranks within their sections --- export const ROW_TOGGLE_SECTION_RANK = { [HEADER_ROW_TOGGLE_ITEM.key]: 100, [NUMBERED_ROWS_TOGGLE_ITEM.key]: 200 }; export const ROW_BACKGROUND_SECTION_RANK = { [BACKGROUND_COLOR_ITEM.key]: 100 }; export const ROW_ADD_SECTION_RANK = { [ADD_ROW_ABOVE_ITEM.key]: 100, [ADD_ROW_BELOW_ITEM.key]: 200, [MOVE_ROW_UP_ITEM.key]: 300, [MOVE_ROW_DOWN_ITEM.key]: 400 }; export const ROW_DANGER_SECTION_RANK = { [CLEAR_CELLS_ITEM.key]: 100, [DELETE_ROW_ITEM.key]: 200 };