UNPKG

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

Version:

Tasks and decisions plugin for @atlaskit/editor-core

67 lines 2.83 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'; var taskPreviewImageUrls = { light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/y5ly4nr488m2m4k4esk1bu415k1gn4gn.png', dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/t7loyl783j0qo1h45i828310rv4au3h8.png' }; var decisionPreviewImageUrls = { light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/h5duy8s83312r7263jauu10mapc53383.png', dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/70q22b8a03dep35ynbv8xigg82osw0rk.png' }; export var getTasksAndDecisionsQuickInsertComponents = function getTasksAndDecisionsQuickInsertComponents(_ref) { var api = _ref.api, quickInsertActionDescription = _ref.quickInsertActionDescription; return [{ 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(function (_ref2) { var formatMessage = _ref2.formatMessage; return { description: quickInsertActionDescription !== null && quickInsertActionDescription !== void 0 ? quickInsertActionDescription : formatMessage(messages.actionDescription), keywords: ['checkbox', 'task', 'todo'], shortcut: '[]', title: formatMessage(messages.action) }; }), component: function component() { return /*#__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(function (_ref3) { var formatMessage = _ref3.formatMessage; return { description: formatMessage(messages.decisionDescription), keywords: [], shortcut: '<>', title: formatMessage(messages.decision) }; }), component: function component() { return /*#__PURE__*/React.createElement(TasksAndDecisionsQuickInsertMenuItem, { api: api, item: "decisionList", previewImageUrls: decisionPreviewImageUrls }); } }]; };