UNPKG

@atlaskit/editor-plugin-tasks-and-decisions

Version:

Tasks and decisions plugin for @atlaskit/editor-core

60 lines 2.42 kB
import React from 'react'; import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages'; import { createQuickInsertMatcher } from '@atlaskit/editor-common/quick-insert/create-quick-insert-matcher'; import { ACTION_MENU_ITEM, DECISION_MENU_ITEM, STRUCTURE_SECTION } from '@atlaskit/editor-common/quick-insert/keys'; import { STRUCTURE_SECTION_RANK } from '@atlaskit/editor-common/quick-insert/rank'; import { TasksAndDecisionsQuickInsertMenuItem } from './TasksAndDecisionsQuickInsertMenuItem'; const taskPreviewImageUrls = { light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/y5ly4nr488m2m4k4esk1bu415k1gn4gn.png', dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/t7loyl783j0qo1h45i828310rv4au3h8.png' }; const decisionPreviewImageUrls = { light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/h5duy8s83312r7263jauu10mapc53383.png', dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/70q22b8a03dep35ynbv8xigg82osw0rk.png' }; export const getTasksAndDecisionsQuickInsertComponents = ({ api, quickInsertActionDescription }) => [{ key: ACTION_MENU_ITEM.key, type: ACTION_MENU_ITEM.type, parents: [{ key: STRUCTURE_SECTION.key, type: STRUCTURE_SECTION.type, rank: STRUCTURE_SECTION_RANK[ACTION_MENU_ITEM.key] }], match: createQuickInsertMatcher(({ formatMessage }) => ({ description: quickInsertActionDescription !== null && quickInsertActionDescription !== void 0 ? quickInsertActionDescription : formatMessage(messages.actionDescription), keywords: ['checkbox', 'task', 'todo'], shortcut: '[]', title: formatMessage(messages.action) })), component: () => /*#__PURE__*/React.createElement(TasksAndDecisionsQuickInsertMenuItem, { api: api, item: "taskList", previewImageUrls: taskPreviewImageUrls }) }, { key: DECISION_MENU_ITEM.key, type: DECISION_MENU_ITEM.type, parents: [{ key: STRUCTURE_SECTION.key, type: STRUCTURE_SECTION.type, rank: STRUCTURE_SECTION_RANK[DECISION_MENU_ITEM.key] }], match: createQuickInsertMatcher(({ formatMessage }) => ({ description: formatMessage(messages.decisionDescription), keywords: [], shortcut: '<>', title: formatMessage(messages.decision) })), component: () => /*#__PURE__*/React.createElement(TasksAndDecisionsQuickInsertMenuItem, { api: api, item: "decisionList", previewImageUrls: decisionPreviewImageUrls }) }];