UNPKG

@atlaskit/editor-plugin-synced-block

Version:

SyncedBlock plugin for @atlaskit/editor-core

41 lines (40 loc) 1.87 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.getSyncedBlockQuickInsertComponents = 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 _SyncedBlockQuickInsertMenuItem = require("./SyncedBlockQuickInsertMenuItem"); var getSyncedBlockQuickInsertComponents = exports.getSyncedBlockQuickInsertComponents = function getSyncedBlockQuickInsertComponents(_ref) { var api = _ref.api, syncBlockStore = _ref.syncBlockStore; return [{ key: _keys.SYNCED_BLOCK_MENU_ITEM.key, type: _keys.SYNCED_BLOCK_MENU_ITEM.type, parents: [{ key: _keys.STRUCTURE_SECTION.key, type: _keys.STRUCTURE_SECTION.type, rank: _rank.STRUCTURE_SECTION_RANK[_keys.SYNCED_BLOCK_MENU_ITEM.key] }], match: (0, _createQuickInsertMatcher.createQuickInsertMatcher)(function (_ref2) { var formatMessage = _ref2.formatMessage; return { description: formatMessage(_messages.blockTypeMessages.syncedBlockDescription), keywords: ['synced', 'block', 'synced-block', 'sync', 'sync-block', 'auto', 'update', 'excerpt', 'connect', 'create'], shortcut: '', title: formatMessage(_messages.blockTypeMessages.syncedBlockQuickInsertTitle) }; }), component: function component() { return /*#__PURE__*/_react.default.createElement(_SyncedBlockQuickInsertMenuItem.SyncedBlockQuickInsertMenuItem, { api: api, syncBlockStore: syncBlockStore }); } }]; };