UNPKG

@atlaskit/editor-plugin-date

Version:

Date plugin for @atlaskit/editor-core

37 lines • 1.49 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 { DATE_MENU_ITEM, STRUCTURE_SECTION } from '@atlaskit/editor-common/quick-insert/keys'; import { STRUCTURE_SECTION_RANK } from '@atlaskit/editor-common/quick-insert/rank'; import { DateQuickInsertMenuItem } from './DateQuickInsertMenuItem'; var previewImageUrls = { light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVNK.png', dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVJO.png' }; export var getDateQuickInsertComponents = function getDateQuickInsertComponents(_ref) { var api = _ref.api; return [{ key: DATE_MENU_ITEM.key, type: DATE_MENU_ITEM.type, parents: [{ key: STRUCTURE_SECTION.key, type: STRUCTURE_SECTION.type, rank: STRUCTURE_SECTION_RANK[DATE_MENU_ITEM.key] }], match: createQuickInsertMatcher(function (_ref2) { var formatMessage = _ref2.formatMessage; return { description: formatMessage(messages.dateDescription), keywords: ['calendar', 'day', 'time', 'today', '/'], shortcut: '//', title: formatMessage(messages.date) }; }), component: function component() { return /*#__PURE__*/React.createElement(DateQuickInsertMenuItem, { api: api, previewImageUrls: previewImageUrls }); } }]; };