UNPKG

@atlaskit/editor-plugin-toolbar-lists-indentation

Version:

Toolbar lists and indentation plugin for @atlaskit/editor-core

70 lines 3.3 kB
/* index.tsx generated by @compiled/babel-plugin v0.39.1 */ import * as React from 'react'; import { ax, ix } from "@compiled/react/runtime"; import { INPUT_METHOD } from '@atlaskit/editor-common/analytics'; import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments'; import { ToolbarType } from '../types'; import { onItemActivated } from './onItemActivated'; import { Toolbar } from './Toolbar'; import { ToolbarDropdown } from './ToolbarDropdown'; import { getInputMethod } from './utils/input-method'; export default function ToolbarListsIndentation(props) { var disabled = props.disabled, isSmall = props.isSmall, isReducedSpacing = props.isReducedSpacing, bulletListActive = props.bulletListActive, bulletListDisabled = props.bulletListDisabled, orderedListActive = props.orderedListActive, orderedListDisabled = props.orderedListDisabled, showIndentationButtons = props.showIndentationButtons, popupsMountPoint = props.popupsMountPoint, popupsBoundariesElement = props.popupsBoundariesElement, popupsScrollableElement = props.popupsScrollableElement, indentDisabled = props.indentDisabled, outdentDisabled = props.outdentDisabled, indentationStateNode = props.indentationStateNode, featureFlags = props.featureFlags, pluginInjectionApi = props.pluginInjectionApi, toolbarType = props.toolbarType; var inputMethod = toolbarType ? getInputMethod(toolbarType) : INPUT_METHOD.TOOLBAR; if (isSmall || toolbarType === ToolbarType.FLOATING || editorExperiment('platform_editor_controls', 'variant1')) { var areAllOptionsDisabled = [bulletListDisabled, orderedListDisabled, indentDisabled, outdentDisabled].every(function (item) { return Boolean(item) === true; }); var isDisabled = disabled || areAllOptionsDisabled; return /*#__PURE__*/React.createElement(ToolbarDropdown, { editorView: props.editorView, isReducedSpacing: isReducedSpacing, popupsMountPoint: popupsMountPoint, popupsBoundariesElement: popupsBoundariesElement, popupsScrollableElement: popupsScrollableElement, bulletListActive: bulletListActive, bulletListDisabled: bulletListDisabled, showIndentationButtons: showIndentationButtons, orderedListActive: orderedListActive, orderedListDisabled: orderedListDisabled, indentDisabled: indentDisabled, outdentDisabled: outdentDisabled, disabled: isDisabled, onItemActivated: onItemActivated(pluginInjectionApi, indentationStateNode, inputMethod), featureFlags: featureFlags, pluginInjectionApi: pluginInjectionApi, toolbarType: toolbarType }); } return /*#__PURE__*/React.createElement(Toolbar, { editorView: props.editorView, isReducedSpacing: isReducedSpacing, bulletListActive: bulletListActive, bulletListDisabled: bulletListDisabled, showIndentationButtons: showIndentationButtons, orderedListActive: orderedListActive, orderedListDisabled: orderedListDisabled, indentDisabled: indentDisabled, outdentDisabled: outdentDisabled, disabled: disabled, onItemActivated: onItemActivated(pluginInjectionApi, indentationStateNode, inputMethod), featureFlags: featureFlags, pluginInjectionApi: pluginInjectionApi }); }