0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-29 01:22:07 +01:00

Use new ComboBox component in rich text

This commit is contained in:
Thibaud Colas 2023-01-18 10:00:31 +00:00
parent 3a7e489cdf
commit a176616cda
2 changed files with 21 additions and 6 deletions

View File

@ -208,9 +208,14 @@ $draftail-editor-font-family: $font-sans;
}
.icon {
transition: transform 0.3s ease;
width: theme('spacing.3');
height: theme('spacing.3');
}
&[aria-expanded='true'] .icon {
transform: rotate(45deg);
}
}
.Draftail-ComboBox [role='combobox'] {

View File

@ -24,6 +24,11 @@ import Tooltip from './Tooltip/Tooltip';
import TooltipEntity from './decorators/TooltipEntity';
import MaxLength from './controls/MaxLength';
import EditorFallback from './EditorFallback/EditorFallback';
import ComboBox, {
comboBoxLabel,
comboBoxNoResults,
comboBoxTriggerLabel,
} from '../ComboBox/ComboBox';
import CommentableEditor, {
splitState,
} from './CommentableEditor/CommentableEditor';
@ -191,10 +196,11 @@ const initEditor = (selector, originalOptions, currentScript) => {
<BlockToolbar
{...props}
triggerIcon={ADD_ICON}
triggerLabel={gettext('Insert a block')}
comboLabel={gettext('Search blocks')}
comboPlaceholder={gettext('Search blocks')}
noResultsText={gettext('No results')}
triggerLabel={comboBoxTriggerLabel}
comboLabel={comboBoxLabel}
comboPlaceholder={comboBoxLabel}
noResultsText={comboBoxNoResults}
ComboBoxComponent={ComboBox}
/>
<InlineToolbar
{...props}
@ -205,8 +211,12 @@ const initEditor = (selector, originalOptions, currentScript) => {
</>
),
bottomToolbar: MetaToolbar,
commandPalette: (props) => (
<CommandPalette {...props} noResultsText={gettext('No results')} />
commandToolbar: (props) => (
<CommandPalette
{...props}
noResultsText={gettext('No results')}
ComboBoxComponent={ComboBox}
/>
),
maxListNesting: 4,
stripPastedStyles: false,