@atlaskit/editor-plugin-synced-block
Version:
SyncedBlock plugin for @atlaskit/editor-core
34 lines • 1.52 kB
JavaScript
import React from 'react';
import { blockTypeMessages } from '@atlaskit/editor-common/messages';
import { createQuickInsertMatcher } from '@atlaskit/editor-common/quick-insert/create-quick-insert-matcher';
import { STRUCTURE_SECTION, SYNCED_BLOCK_MENU_ITEM } from '@atlaskit/editor-common/quick-insert/keys';
import { STRUCTURE_SECTION_RANK } from '@atlaskit/editor-common/quick-insert/rank';
import { SyncedBlockQuickInsertMenuItem } from './SyncedBlockQuickInsertMenuItem';
export var getSyncedBlockQuickInsertComponents = function getSyncedBlockQuickInsertComponents(_ref) {
var api = _ref.api,
syncBlockStore = _ref.syncBlockStore;
return [{
key: SYNCED_BLOCK_MENU_ITEM.key,
type: SYNCED_BLOCK_MENU_ITEM.type,
parents: [{
key: STRUCTURE_SECTION.key,
type: STRUCTURE_SECTION.type,
rank: STRUCTURE_SECTION_RANK[SYNCED_BLOCK_MENU_ITEM.key]
}],
match: createQuickInsertMatcher(function (_ref2) {
var formatMessage = _ref2.formatMessage;
return {
description: formatMessage(blockTypeMessages.syncedBlockDescription),
keywords: ['synced', 'block', 'synced-block', 'sync', 'sync-block', 'auto', 'update', 'excerpt', 'connect', 'create'],
shortcut: '',
title: formatMessage(blockTypeMessages.syncedBlockQuickInsertTitle)
};
}),
component: function component() {
return /*#__PURE__*/React.createElement(SyncedBlockQuickInsertMenuItem, {
api: api,
syncBlockStore: syncBlockStore
});
}
}];
};