UNPKG

@atlaskit/editor-plugin-table

Version:

Table plugin for the @atlaskit/editor

54 lines 2.08 kB
/** * @jsxRuntime classic * @jsx jsx */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766 import { jsx } from '@emotion/react'; import { ButtonGroup } from '@atlaskit/button'; import { FloatingToolbarButton as Button, FloatingToolbarSeparator } from '@atlaskit/editor-common/ui'; // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss import { Box, xcss } from '@atlaskit/primitives'; var containerStyles = xcss({ marginLeft: 'space.100' }); export var FloatingAlignmentButtons = function FloatingAlignmentButtons(_ref) { var alignmentButtons = _ref.alignmentButtons, dispatchCommand = _ref.dispatchCommand, areAnyNewToolbarFlagsEnabled = _ref.areAnyNewToolbarFlagsEnabled; return jsx(Box, { xcss: containerStyles }, jsx(ButtonGroup, null, alignmentButtons.map(function (item, idx) { switch (item.type) { case 'separator': return jsx(FloatingToolbarSeparator // Ignored via go/ees005 // eslint-disable-next-line react/no-array-index-key , { key: idx, areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled }); case 'button': // Ignored via go/ees005 // eslint-disable-next-line @typescript-eslint/no-explicit-any var ButtonIcon = item.icon; return jsx(Button // Ignored via go/ees005 // eslint-disable-next-line react/no-array-index-key , { key: idx, icon: item.icon ? jsx(ButtonIcon, { label: item.title }) : undefined, title: item.title, selected: item.selected, disabled: item.disabled // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed) , onClick: function onClick() { dispatchCommand(item.onClick); }, areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled }); } }))); };