@atlaskit/editor-plugin-expand
Version:
Expand plugin for @atlaskit/editor-core
33 lines • 1.27 kB
JavaScript
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 { EXPAND_MENU_ITEM, STRUCTURE_SECTION } from '@atlaskit/editor-common/quick-insert/keys';
import { STRUCTURE_SECTION_RANK } from '@atlaskit/editor-common/quick-insert/rank';
import { ExpandQuickInsertMenuItem } from './ExpandQuickInsertMenuItem';
const previewImageUrls = {
light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVKK.png',
dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVH5.png'
};
export const getExpandQuickInsertComponents = ({
api,
isLegacy
}) => [{
key: EXPAND_MENU_ITEM.key,
type: EXPAND_MENU_ITEM.type,
parents: [{
...STRUCTURE_SECTION,
rank: STRUCTURE_SECTION_RANK[EXPAND_MENU_ITEM.key]
}],
match: createQuickInsertMatcher(({
formatMessage
}) => ({
description: formatMessage(messages.expandDescription),
keywords: ['accordion', 'collapse'],
title: formatMessage(messages.expand)
})),
component: () => /*#__PURE__*/React.createElement(ExpandQuickInsertMenuItem, {
api: api,
isLegacy: isLegacy,
previewImageUrls: previewImageUrls
})
}];