UNPKG

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

Version:

Tasks and decisions plugin for @atlaskit/editor-core

74 lines (73 loc) • 3.37 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.getTasksAndDecisionsQuickInsertComponents = void 0; var _react = _interopRequireDefault(require("react")); var _messages = require("@atlaskit/editor-common/messages"); var _createQuickInsertMatcher = require("@atlaskit/editor-common/quick-insert/create-quick-insert-matcher"); var _keys = require("@atlaskit/editor-common/quick-insert/keys"); var _rank = require("@atlaskit/editor-common/quick-insert/rank"); var _TasksAndDecisionsQuickInsertMenuItem = require("./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' }; var getTasksAndDecisionsQuickInsertComponents = exports.getTasksAndDecisionsQuickInsertComponents = function getTasksAndDecisionsQuickInsertComponents(_ref) { var api = _ref.api, quickInsertActionDescription = _ref.quickInsertActionDescription; return [{ key: _keys.ACTION_MENU_ITEM.key, type: _keys.ACTION_MENU_ITEM.type, parents: [{ key: _keys.STRUCTURE_SECTION.key, type: _keys.STRUCTURE_SECTION.type, rank: _rank.STRUCTURE_SECTION_RANK[_keys.ACTION_MENU_ITEM.key] }], match: (0, _createQuickInsertMatcher.createQuickInsertMatcher)(function (_ref2) { var formatMessage = _ref2.formatMessage; return { description: quickInsertActionDescription !== null && quickInsertActionDescription !== void 0 ? quickInsertActionDescription : formatMessage(_messages.toolbarInsertBlockMessages.actionDescription), keywords: ['checkbox', 'task', 'todo'], shortcut: '[]', title: formatMessage(_messages.toolbarInsertBlockMessages.action) }; }), component: function component() { return /*#__PURE__*/_react.default.createElement(_TasksAndDecisionsQuickInsertMenuItem.TasksAndDecisionsQuickInsertMenuItem, { api: api, item: "taskList", previewImageUrls: taskPreviewImageUrls }); } }, { key: _keys.DECISION_MENU_ITEM.key, type: _keys.DECISION_MENU_ITEM.type, parents: [{ key: _keys.STRUCTURE_SECTION.key, type: _keys.STRUCTURE_SECTION.type, rank: _rank.STRUCTURE_SECTION_RANK[_keys.DECISION_MENU_ITEM.key] }], match: (0, _createQuickInsertMatcher.createQuickInsertMatcher)(function (_ref3) { var formatMessage = _ref3.formatMessage; return { description: formatMessage(_messages.toolbarInsertBlockMessages.decisionDescription), keywords: [], shortcut: '<>', title: formatMessage(_messages.toolbarInsertBlockMessages.decision) }; }), component: function component() { return /*#__PURE__*/_react.default.createElement(_TasksAndDecisionsQuickInsertMenuItem.TasksAndDecisionsQuickInsertMenuItem, { api: api, item: "decisionList", previewImageUrls: decisionPreviewImageUrls }); } }]; };