@toptal/picasso 19.1.1 → 19.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Autocomplete/Autocomplete.d.ts +7 -2
- package/Autocomplete/Autocomplete.js +11 -3
- package/Autocomplete/Autocomplete.js.map +1 -1
- package/DatePicker/DatePicker.d.ts +8 -1
- package/DatePicker/DatePicker.js +11 -3
- package/DatePicker/DatePicker.js.map +1 -1
- package/FileInput/FileInput.js +1 -1
- package/FileInput/FileInput.js.map +1 -1
- package/Icon/Bold16.d.ts +10 -0
- package/Icon/Bold16.js +23 -0
- package/Icon/Bold16.js.map +1 -0
- package/Icon/Italic16.d.ts +10 -0
- package/Icon/Italic16.js +23 -0
- package/Icon/Italic16.js.map +1 -0
- package/Icon/ListOrdered16.d.ts +10 -0
- package/Icon/ListOrdered16.js +23 -0
- package/Icon/ListOrdered16.js.map +1 -0
- package/Icon/ListUnordered16.d.ts +10 -0
- package/Icon/ListUnordered16.js +23 -0
- package/Icon/ListUnordered16.js.map +1 -0
- package/Icon/index.d.ts +4 -0
- package/Icon/index.js +4 -0
- package/Icon/index.js.map +1 -1
- package/Input/Input.d.ts +8 -2
- package/Input/Input.js +11 -3
- package/Input/Input.js.map +1 -1
- package/ListItem/styles.d.ts +1 -1
- package/NativeSelect/NativeSelect.js +5 -5
- package/NativeSelect/NativeSelect.js.map +1 -1
- package/NonNativeSelect/NonNativeSelect.js +4 -4
- package/NonNativeSelect/NonNativeSelect.js.map +1 -1
- package/NumberInput/NumberInput.d.ts +0 -2
- package/NumberInput/NumberInput.js +11 -3
- package/NumberInput/NumberInput.js.map +1 -1
- package/OutlinedInput/OutlinedInput.d.ts +8 -1
- package/OutlinedInput/OutlinedInput.js +18 -6
- package/OutlinedInput/OutlinedInput.js.map +1 -1
- package/PageHead/PageHead.d.ts +3 -1
- package/PageHead/PageHead.js.map +1 -1
- package/PasswordInput/PasswordInput.d.ts +2 -5
- package/PasswordInput/PasswordInput.js +12 -5
- package/PasswordInput/PasswordInput.js.map +1 -1
- package/QuillEditor/QuillEditor.d.ts +32 -0
- package/QuillEditor/QuillEditor.js +42 -0
- package/QuillEditor/QuillEditor.js.map +1 -0
- package/QuillEditor/constants.d.ts +1 -0
- package/QuillEditor/constants.js +2 -0
- package/QuillEditor/constants.js.map +1 -0
- package/QuillEditor/formats/bold.d.ts +8 -0
- package/QuillEditor/formats/bold.js +18 -0
- package/QuillEditor/formats/bold.js.map +1 -0
- package/QuillEditor/formats/header.d.ts +8 -0
- package/QuillEditor/formats/header.js +20 -0
- package/QuillEditor/formats/header.js.map +1 -0
- package/QuillEditor/formats/index.d.ts +3 -0
- package/QuillEditor/formats/index.js +4 -0
- package/QuillEditor/formats/index.js.map +1 -0
- package/QuillEditor/formats/use-typography-classes.d.ts +2 -0
- package/QuillEditor/formats/use-typography-classes.js +7 -0
- package/QuillEditor/formats/use-typography-classes.js.map +1 -0
- package/QuillEditor/hooks/index.d.ts +6 -0
- package/QuillEditor/hooks/index.js +7 -0
- package/QuillEditor/hooks/index.js.map +1 -0
- package/QuillEditor/hooks/useDefaultValue/index.d.ts +1 -0
- package/QuillEditor/hooks/useDefaultValue/index.js +2 -0
- package/QuillEditor/hooks/useDefaultValue/index.js.map +1 -0
- package/QuillEditor/hooks/useDefaultValue/useDefaultValue.d.ts +7 -0
- package/QuillEditor/hooks/useDefaultValue/useDefaultValue.js +15 -0
- package/QuillEditor/hooks/useDefaultValue/useDefaultValue.js.map +1 -0
- package/QuillEditor/hooks/useDisabledEditor/index.d.ts +1 -0
- package/QuillEditor/hooks/useDisabledEditor/index.js +2 -0
- package/QuillEditor/hooks/useDisabledEditor/index.js.map +1 -0
- package/QuillEditor/hooks/useDisabledEditor/useDisabledEditor.d.ts +6 -0
- package/QuillEditor/hooks/useDisabledEditor/useDisabledEditor.js +11 -0
- package/QuillEditor/hooks/useDisabledEditor/useDisabledEditor.js.map +1 -0
- package/QuillEditor/hooks/useFocus/index.d.ts +1 -0
- package/QuillEditor/hooks/useFocus/index.js +2 -0
- package/QuillEditor/hooks/useFocus/index.js.map +1 -0
- package/QuillEditor/hooks/useFocus/useFocus.d.ts +6 -0
- package/QuillEditor/hooks/useFocus/useFocus.js +13 -0
- package/QuillEditor/hooks/useFocus/useFocus.js.map +1 -0
- package/QuillEditor/hooks/useKeyBindings/index.d.ts +1 -0
- package/QuillEditor/hooks/useKeyBindings/index.js +2 -0
- package/QuillEditor/hooks/useKeyBindings/index.js.map +1 -0
- package/QuillEditor/hooks/useKeyBindings/useKeyBindings.d.ts +7 -0
- package/QuillEditor/hooks/useKeyBindings/useKeyBindings.js +32 -0
- package/QuillEditor/hooks/useKeyBindings/useKeyBindings.js.map +1 -0
- package/QuillEditor/hooks/useQuillInstance/index.d.ts +1 -0
- package/QuillEditor/hooks/useQuillInstance/index.js +2 -0
- package/QuillEditor/hooks/useQuillInstance/index.js.map +1 -0
- package/QuillEditor/hooks/useQuillInstance/useQuillInstance.d.ts +9 -0
- package/QuillEditor/hooks/useQuillInstance/useQuillInstance.js +68 -0
- package/QuillEditor/hooks/useQuillInstance/useQuillInstance.js.map +1 -0
- package/QuillEditor/hooks/useSubscribeToQuillEvents/index.d.ts +1 -0
- package/QuillEditor/hooks/useSubscribeToQuillEvents/index.js +2 -0
- package/QuillEditor/hooks/useSubscribeToQuillEvents/index.js.map +1 -0
- package/QuillEditor/hooks/useSubscribeToQuillEvents/useSubscribeToQuillEvents.d.ts +10 -0
- package/QuillEditor/hooks/useSubscribeToQuillEvents/useSubscribeToQuillEvents.js +64 -0
- package/QuillEditor/hooks/useSubscribeToQuillEvents/useSubscribeToQuillEvents.js.map +1 -0
- package/QuillEditor/hooks/useSubscribeToTextEditorEvents/index.d.ts +1 -0
- package/QuillEditor/hooks/useSubscribeToTextEditorEvents/index.js +2 -0
- package/QuillEditor/hooks/useSubscribeToTextEditorEvents/index.js.map +1 -0
- package/QuillEditor/hooks/useSubscribeToTextEditorEvents/useSubscribeToTextEditorEvents.d.ts +6 -0
- package/QuillEditor/hooks/useSubscribeToTextEditorEvents/useSubscribeToTextEditorEvents.js +23 -0
- package/QuillEditor/hooks/useSubscribeToTextEditorEvents/useSubscribeToTextEditorEvents.js.map +1 -0
- package/QuillEditor/index.d.ts +4 -0
- package/QuillEditor/index.js +4 -0
- package/QuillEditor/index.js.map +1 -0
- package/QuillEditor/styles.d.ts +3 -0
- package/QuillEditor/styles.js +100 -0
- package/QuillEditor/styles.js.map +1 -0
- package/QuillEditor/types.d.ts +27 -0
- package/QuillEditor/types.js +2 -0
- package/QuillEditor/types.js.map +1 -0
- package/QuillEditor/utils/getCleanupOnAllContentRemovalHandler/getCleanupOnAllContentRemovalHandler.d.ts +3 -0
- package/QuillEditor/utils/getCleanupOnAllContentRemovalHandler/getCleanupOnAllContentRemovalHandler.js +22 -0
- package/QuillEditor/utils/getCleanupOnAllContentRemovalHandler/getCleanupOnAllContentRemovalHandler.js.map +1 -0
- package/QuillEditor/utils/getCleanupOnAllContentRemovalHandler/index.d.ts +1 -0
- package/QuillEditor/utils/getCleanupOnAllContentRemovalHandler/index.js +2 -0
- package/QuillEditor/utils/getCleanupOnAllContentRemovalHandler/index.js.map +1 -0
- package/QuillEditor/utils/getEditorChangeHandler/getEditorChangeHandler.d.ts +7 -0
- package/QuillEditor/utils/getEditorChangeHandler/getEditorChangeHandler.js +41 -0
- package/QuillEditor/utils/getEditorChangeHandler/getEditorChangeHandler.js.map +1 -0
- package/QuillEditor/utils/getEditorChangeHandler/index.d.ts +1 -0
- package/QuillEditor/utils/getEditorChangeHandler/index.js +2 -0
- package/QuillEditor/utils/getEditorChangeHandler/index.js.map +1 -0
- package/QuillEditor/utils/getFormatChangeHandler/getFormatChangeHandler.d.ts +3 -0
- package/QuillEditor/utils/getFormatChangeHandler/getFormatChangeHandler.js +13 -0
- package/QuillEditor/utils/getFormatChangeHandler/getFormatChangeHandler.js.map +1 -0
- package/QuillEditor/utils/getFormatChangeHandler/index.d.ts +2 -0
- package/QuillEditor/utils/getFormatChangeHandler/index.js +3 -0
- package/QuillEditor/utils/getFormatChangeHandler/index.js.map +1 -0
- package/QuillEditor/utils/getSelectionChangeHandler/getSelectionChangeHandler.d.ts +4 -0
- package/QuillEditor/utils/getSelectionChangeHandler/getSelectionChangeHandler.js +19 -0
- package/QuillEditor/utils/getSelectionChangeHandler/getSelectionChangeHandler.js.map +1 -0
- package/QuillEditor/utils/getSelectionChangeHandler/index.d.ts +1 -0
- package/QuillEditor/utils/getSelectionChangeHandler/index.js +2 -0
- package/QuillEditor/utils/getSelectionChangeHandler/index.js.map +1 -0
- package/QuillEditor/utils/getTextChangeHandler/getTextChangeHandler.d.ts +3 -0
- package/QuillEditor/utils/getTextChangeHandler/getTextChangeHandler.js +22 -0
- package/QuillEditor/utils/getTextChangeHandler/getTextChangeHandler.js.map +1 -0
- package/QuillEditor/utils/getTextChangeHandler/index.d.ts +1 -0
- package/QuillEditor/utils/getTextChangeHandler/index.js +2 -0
- package/QuillEditor/utils/getTextChangeHandler/index.js.map +1 -0
- package/QuillEditor/utils/getTextLengthChangeHandler/getTextLengthChangeHandler.d.ts +4 -0
- package/QuillEditor/utils/getTextLengthChangeHandler/getTextLengthChangeHandler.js +9 -0
- package/QuillEditor/utils/getTextLengthChangeHandler/getTextLengthChangeHandler.js.map +1 -0
- package/QuillEditor/utils/getTextLengthChangeHandler/index.d.ts +1 -0
- package/QuillEditor/utils/getTextLengthChangeHandler/index.js +2 -0
- package/QuillEditor/utils/getTextLengthChangeHandler/index.js.map +1 -0
- package/QuillEditor/utils/remove-classes/index.d.ts +1 -0
- package/QuillEditor/utils/remove-classes/index.js +2 -0
- package/QuillEditor/utils/remove-classes/index.js.map +1 -0
- package/QuillEditor/utils/remove-classes/remove-classes.d.ts +2 -0
- package/QuillEditor/utils/remove-classes/remove-classes.js +3 -0
- package/QuillEditor/utils/remove-classes/remove-classes.js.map +1 -0
- package/QuillEditor/utils/remove-cursor-span/index.d.ts +1 -0
- package/QuillEditor/utils/remove-cursor-span/index.js +2 -0
- package/QuillEditor/utils/remove-cursor-span/index.js.map +1 -0
- package/QuillEditor/utils/remove-cursor-span/remove-cursor-span.d.ts +2 -0
- package/QuillEditor/utils/remove-cursor-span/remove-cursor-span.js +5 -0
- package/QuillEditor/utils/remove-cursor-span/remove-cursor-span.js.map +1 -0
- package/RichTextEditor/RichTextEditor.d.ts +63 -0
- package/RichTextEditor/RichTextEditor.js +77 -0
- package/RichTextEditor/RichTextEditor.js.map +1 -0
- package/RichTextEditor/hooks/index.d.ts +6 -0
- package/RichTextEditor/hooks/index.js +7 -0
- package/RichTextEditor/hooks/index.js.map +1 -0
- package/RichTextEditor/hooks/useCounter/index.d.ts +1 -0
- package/RichTextEditor/hooks/useCounter/index.js +2 -0
- package/RichTextEditor/hooks/useCounter/index.js.map +1 -0
- package/RichTextEditor/hooks/useCounter/useCounter.d.ts +14 -0
- package/RichTextEditor/hooks/useCounter/useCounter.js +68 -0
- package/RichTextEditor/hooks/useCounter/useCounter.js.map +1 -0
- package/RichTextEditor/hooks/useOnFocus/index.d.ts +1 -0
- package/RichTextEditor/hooks/useOnFocus/index.js +2 -0
- package/RichTextEditor/hooks/useOnFocus/index.js.map +1 -0
- package/RichTextEditor/hooks/useOnFocus/useOnFocus.d.ts +16 -0
- package/RichTextEditor/hooks/useOnFocus/useOnFocus.js +44 -0
- package/RichTextEditor/hooks/useOnFocus/useOnFocus.js.map +1 -0
- package/RichTextEditor/hooks/useOnSelectionChange/index.d.ts +1 -0
- package/RichTextEditor/hooks/useOnSelectionChange/index.js +2 -0
- package/RichTextEditor/hooks/useOnSelectionChange/index.js.map +1 -0
- package/RichTextEditor/hooks/useOnSelectionChange/useOnSelectionChange.d.ts +10 -0
- package/RichTextEditor/hooks/useOnSelectionChange/useOnSelectionChange.js +15 -0
- package/RichTextEditor/hooks/useOnSelectionChange/useOnSelectionChange.js.map +1 -0
- package/RichTextEditor/hooks/useOnTextFormat/index.d.ts +1 -0
- package/RichTextEditor/hooks/useOnTextFormat/index.js +2 -0
- package/RichTextEditor/hooks/useOnTextFormat/index.js.map +1 -0
- package/RichTextEditor/hooks/useOnTextFormat/useOnTextFormat.d.ts +10 -0
- package/RichTextEditor/hooks/useOnTextFormat/useOnTextFormat.js +30 -0
- package/RichTextEditor/hooks/useOnTextFormat/useOnTextFormat.js.map +1 -0
- package/RichTextEditor/hooks/useTextEditorState/index.d.ts +1 -0
- package/RichTextEditor/hooks/useTextEditorState/index.js +2 -0
- package/RichTextEditor/hooks/useTextEditorState/index.js.map +1 -0
- package/RichTextEditor/hooks/useTextEditorState/useTextEditorState.d.ts +7 -0
- package/RichTextEditor/hooks/useTextEditorState/useTextEditorState.js +8 -0
- package/RichTextEditor/hooks/useTextEditorState/useTextEditorState.js.map +1 -0
- package/RichTextEditor/hooks/useToolbarHandlers/index.d.ts +1 -0
- package/RichTextEditor/hooks/useToolbarHandlers/index.js +2 -0
- package/RichTextEditor/hooks/useToolbarHandlers/index.js.map +1 -0
- package/RichTextEditor/hooks/useToolbarHandlers/useToolbarHandlers.d.ts +16 -0
- package/RichTextEditor/hooks/useToolbarHandlers/useToolbarHandlers.js +61 -0
- package/RichTextEditor/hooks/useToolbarHandlers/useToolbarHandlers.js.map +1 -0
- package/RichTextEditor/index.d.ts +7 -0
- package/RichTextEditor/index.js +3 -0
- package/RichTextEditor/index.js.map +1 -0
- package/RichTextEditor/store/index.d.ts +9 -0
- package/RichTextEditor/store/index.js +11 -0
- package/RichTextEditor/store/index.js.map +1 -0
- package/RichTextEditor/store/toolbar/actionTypes.d.ts +9 -0
- package/RichTextEditor/store/toolbar/actionTypes.js +10 -0
- package/RichTextEditor/store/toolbar/actionTypes.js.map +1 -0
- package/RichTextEditor/store/toolbar/actions.d.ts +11 -0
- package/RichTextEditor/store/toolbar/actions.js +17 -0
- package/RichTextEditor/store/toolbar/actions.js.map +1 -0
- package/RichTextEditor/store/toolbar/index.d.ts +6 -0
- package/RichTextEditor/store/toolbar/index.js +7 -0
- package/RichTextEditor/store/toolbar/index.js.map +1 -0
- package/RichTextEditor/store/toolbar/initialState.d.ts +3 -0
- package/RichTextEditor/store/toolbar/initialState.js +11 -0
- package/RichTextEditor/store/toolbar/initialState.js.map +1 -0
- package/RichTextEditor/store/toolbar/reducer.d.ts +3 -0
- package/RichTextEditor/store/toolbar/reducer.js +22 -0
- package/RichTextEditor/store/toolbar/reducer.js.map +1 -0
- package/RichTextEditor/store/toolbar/types.d.ts +40 -0
- package/RichTextEditor/store/toolbar/types.js +2 -0
- package/RichTextEditor/store/toolbar/types.js.map +1 -0
- package/RichTextEditor/store/types.d.ts +5 -0
- package/RichTextEditor/store/types.js +2 -0
- package/RichTextEditor/store/types.js.map +1 -0
- package/RichTextEditor/styles.d.ts +3 -0
- package/RichTextEditor/styles.js +23 -0
- package/RichTextEditor/styles.js.map +1 -0
- package/RichTextEditor/types.d.ts +2 -0
- package/RichTextEditor/types.js +2 -0
- package/RichTextEditor/types.js.map +1 -0
- package/RichTextEditor/utils/convertFormat.d.ts +8 -0
- package/RichTextEditor/utils/convertFormat.js +19 -0
- package/RichTextEditor/utils/convertFormat.js.map +1 -0
- package/RichTextEditorButton/RichTextEditorButton.d.ts +18 -0
- package/RichTextEditorButton/RichTextEditorButton.js +38 -0
- package/RichTextEditorButton/RichTextEditorButton.js.map +1 -0
- package/RichTextEditorButton/index.d.ts +1 -0
- package/RichTextEditorButton/index.js +2 -0
- package/RichTextEditorButton/index.js.map +1 -0
- package/RichTextEditorButton/styles.d.ts +3 -0
- package/RichTextEditorButton/styles.js +16 -0
- package/RichTextEditorButton/styles.js.map +1 -0
- package/RichTextEditorCounter/RichTextEditorCounter.d.ts +10 -0
- package/RichTextEditorCounter/RichTextEditorCounter.js +17 -0
- package/RichTextEditorCounter/RichTextEditorCounter.js.map +1 -0
- package/RichTextEditorCounter/index.d.ts +1 -0
- package/RichTextEditorCounter/index.js +2 -0
- package/RichTextEditorCounter/index.js.map +1 -0
- package/RichTextEditorCounter/styles.d.ts +3 -0
- package/RichTextEditorCounter/styles.js +27 -0
- package/RichTextEditorCounter/styles.js.map +1 -0
- package/RichTextEditorToolbar/RichTextEditorToolbar.d.ts +22 -0
- package/RichTextEditorToolbar/RichTextEditorToolbar.js +44 -0
- package/RichTextEditorToolbar/RichTextEditorToolbar.js.map +1 -0
- package/RichTextEditorToolbar/index.d.ts +2 -0
- package/RichTextEditorToolbar/index.js +3 -0
- package/RichTextEditorToolbar/index.js.map +1 -0
- package/RichTextEditorToolbar/styles.d.ts +5 -0
- package/RichTextEditorToolbar/styles.js +27 -0
- package/RichTextEditorToolbar/styles.js.map +1 -0
- package/RichTextEditorToolbar/types.d.ts +6 -0
- package/RichTextEditorToolbar/types.js +2 -0
- package/RichTextEditorToolbar/types.js.map +1 -0
- package/Select/Select.d.ts +1 -1
- package/Select/Select.js +8 -2
- package/Select/Select.js.map +1 -1
- package/Select/types.d.ts +4 -2
- package/Tab/styles.js +2 -4
- package/Tab/styles.js.map +1 -1
- package/TagSelector/TagSelector.d.ts +10 -1
- package/TagSelector/TagSelector.js +11 -3
- package/TagSelector/TagSelector.js.map +1 -1
- package/TagSelectorInput/TagSelectorInput.js +12 -4
- package/TagSelectorInput/TagSelectorInput.js.map +1 -1
- package/TimePicker/TimePicker.d.ts +7 -1
- package/TimePicker/TimePicker.js +13 -3
- package/TimePicker/TimePicker.js.map +1 -1
- package/Typography/Typography.js +11 -13
- package/Typography/Typography.js.map +1 -1
- package/Typography/styles.d.ts +1 -1
- package/Typography/styles.js +121 -114
- package/Typography/styles.js.map +1 -1
- package/Typography/utils/get-typography-class-name/get-typography-class-name.d.ts +3 -0
- package/Typography/utils/get-typography-class-name/get-typography-class-name.js +15 -0
- package/Typography/utils/get-typography-class-name/get-typography-class-name.js.map +1 -0
- package/Typography/utils/get-typography-class-name/index.d.ts +1 -0
- package/Typography/utils/get-typography-class-name/index.js +2 -0
- package/Typography/utils/get-typography-class-name/index.js.map +1 -0
- package/index.d.ts +3 -0
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/package.json +6 -1
- package/test-utils/TestingPicasso.d.ts +5 -1
- package/test-utils/TestingPicasso.js.map +1 -1
- package/Typography/utils/index.d.ts +0 -1
- package/Typography/utils/index.js +0 -2
- package/Typography/utils/index.js.map +0 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ActionsType } from '../../store';
|
|
2
|
+
declare type Props = {
|
|
3
|
+
autoFocus: boolean;
|
|
4
|
+
editorRef: React.RefObject<HTMLDivElement>;
|
|
5
|
+
toolbarRef: React.RefObject<HTMLDivElement>;
|
|
6
|
+
wrapperRef: React.RefObject<HTMLDivElement>;
|
|
7
|
+
onFocus: () => void;
|
|
8
|
+
onBlur: () => void;
|
|
9
|
+
dispatch: React.Dispatch<ActionsType>;
|
|
10
|
+
};
|
|
11
|
+
declare const useOnFocus: ({ autoFocus, editorRef, toolbarRef, wrapperRef, onFocus, onBlur, dispatch }: Props) => {
|
|
12
|
+
isEditorFocused: boolean;
|
|
13
|
+
handleFocus: (e: React.FocusEvent<HTMLDivElement>) => void;
|
|
14
|
+
handleBlur: (e: React.FocusEvent<HTMLDivElement>) => void;
|
|
15
|
+
};
|
|
16
|
+
export default useOnFocus;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { useCallback, useState } from 'react';
|
|
2
|
+
import { actions as toolbarActions } from '../../store/toolbar';
|
|
3
|
+
const useOnFocus = ({ autoFocus, editorRef, toolbarRef, wrapperRef, onFocus, onBlur, dispatch }) => {
|
|
4
|
+
const [isEditorFocused, setIsEditorFocused] = useState(autoFocus);
|
|
5
|
+
const handleFocus = useCallback((e) => {
|
|
6
|
+
console.log('focus');
|
|
7
|
+
if (!editorRef.current || !toolbarRef.current || !wrapperRef) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
toolbarActions.setDisabled(dispatch)(false);
|
|
11
|
+
const focusElement = e.target;
|
|
12
|
+
const isFocusElementInToolbar = toolbarRef.current.contains(focusElement);
|
|
13
|
+
if (isFocusElementInToolbar) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
setIsEditorFocused(true);
|
|
17
|
+
onFocus();
|
|
18
|
+
}, [dispatch, onFocus, editorRef, toolbarRef, wrapperRef]);
|
|
19
|
+
const handleBlur = useCallback((e) => {
|
|
20
|
+
if (!toolbarRef.current || !editorRef.current) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const focusElement = e.relatedTarget;
|
|
24
|
+
const isFocusElementInToolbar = toolbarRef.current.contains(focusElement);
|
|
25
|
+
const isFocusElementInEditor = editorRef.current.contains(focusElement);
|
|
26
|
+
const isFocusElementWrapper = wrapperRef.current === focusElement;
|
|
27
|
+
if (isFocusElementInToolbar ||
|
|
28
|
+
isFocusElementInEditor ||
|
|
29
|
+
isFocusElementWrapper) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
toolbarActions.setDisabled(dispatch)(true);
|
|
33
|
+
toolbarActions.resetFormat(dispatch)();
|
|
34
|
+
setIsEditorFocused(false);
|
|
35
|
+
onBlur();
|
|
36
|
+
}, [dispatch, onBlur, toolbarRef, editorRef, wrapperRef]);
|
|
37
|
+
return {
|
|
38
|
+
isEditorFocused,
|
|
39
|
+
handleFocus,
|
|
40
|
+
handleBlur
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
export default useOnFocus;
|
|
44
|
+
//# sourceMappingURL=useOnFocus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOnFocus.js","sourceRoot":"","sources":["../../../../src/RichTextEditor/hooks/useOnFocus/useOnFocus.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAE7C,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAa/D,MAAM,UAAU,GAAG,CAAC,EAClB,SAAS,EACT,SAAS,EACT,UAAU,EACV,UAAU,EACV,OAAO,EACP,MAAM,EACN,QAAQ,EACF,EAAE,EAAE;IACV,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAA;IAEjE,MAAM,WAAW,GAAG,WAAW,CAC7B,CAAC,CAAmC,EAAE,EAAE;QACtC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QACpB,IAAI,CAAC,SAAS,CAAC,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,IAAI,CAAC,UAAU,EAAE;YAC5D,OAAM;SACP;QAED,cAAc,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAA;QAE3C,MAAM,YAAY,GAAG,CAAC,CAAC,MAAc,CAAA;QACrC,MAAM,uBAAuB,GAAG,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAA;QAEzE,IAAI,uBAAuB,EAAE;YAC3B,OAAM;SACP;QAED,kBAAkB,CAAC,IAAI,CAAC,CAAA;QAExB,OAAO,EAAE,CAAA;IACX,CAAC,EACD,CAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,CAAC,CACvD,CAAA;IAED,MAAM,UAAU,GAAG,WAAW,CAC5B,CAAC,CAAmC,EAAE,EAAE;QACtC,IAAI,CAAC,UAAU,CAAC,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE;YAC7C,OAAM;SACP;QAED,MAAM,YAAY,GAAG,CAAC,CAAC,aAAqB,CAAA;QAE5C,MAAM,uBAAuB,GAAG,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAA;QACzE,MAAM,sBAAsB,GAAG,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAA;QACvE,MAAM,qBAAqB,GAAG,UAAU,CAAC,OAAO,KAAK,YAAY,CAAA;QAEjE,IACE,uBAAuB;YACvB,sBAAsB;YACtB,qBAAqB,EACrB;YACA,OAAM;SACP;QAED,cAAc,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAA;QAE1C,cAAc,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,CAAA;QAEtC,kBAAkB,CAAC,KAAK,CAAC,CAAA;QAEzB,MAAM,EAAE,CAAA;IACV,CAAC,EACD,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,CAAC,CACtD,CAAA;IAED,OAAO;QACL,eAAe;QACf,WAAW;QACX,UAAU;KACX,CAAA;AACH,CAAC,CAAA;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './useOnSelectionChange';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/RichTextEditor/hooks/useOnSelectionChange/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Dispatch } from 'react';
|
|
2
|
+
import { FormatType as EditorFormatType } from '../../../QuillEditor';
|
|
3
|
+
import { ActionsType } from '../../store';
|
|
4
|
+
declare type Props = {
|
|
5
|
+
dispatch: Dispatch<ActionsType>;
|
|
6
|
+
};
|
|
7
|
+
declare const useOnSelectionChange: ({ dispatch }: Props) => {
|
|
8
|
+
handleSelectionChange: (editorFormat: EditorFormatType) => void;
|
|
9
|
+
};
|
|
10
|
+
export default useOnSelectionChange;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
import { actions as toolbarActions } from '../../store/toolbar';
|
|
3
|
+
import { getToolbarFormatFromEditorFormat } from '../../utils/convertFormat';
|
|
4
|
+
const useOnSelectionChange = ({ dispatch }) => {
|
|
5
|
+
const handleSelectionChange = useCallback((editorFormat) => {
|
|
6
|
+
const { bold, italic, header, list } = getToolbarFormatFromEditorFormat(editorFormat);
|
|
7
|
+
toolbarActions.setBold(dispatch)(bold);
|
|
8
|
+
toolbarActions.setItalic(dispatch)(italic);
|
|
9
|
+
toolbarActions.setHeader(dispatch)(header);
|
|
10
|
+
toolbarActions.setList(dispatch)(list);
|
|
11
|
+
}, [dispatch]);
|
|
12
|
+
return { handleSelectionChange };
|
|
13
|
+
};
|
|
14
|
+
export default useOnSelectionChange;
|
|
15
|
+
//# sourceMappingURL=useOnSelectionChange.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOnSelectionChange.js","sourceRoot":"","sources":["../../../../src/RichTextEditor/hooks/useOnSelectionChange/useOnSelectionChange.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,WAAW,EAAE,MAAM,OAAO,CAAA;AAG7C,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAE/D,OAAO,EAAE,gCAAgC,EAAE,MAAM,2BAA2B,CAAA;AAM5E,MAAM,oBAAoB,GAAG,CAAC,EAAE,QAAQ,EAAS,EAAE,EAAE;IACnD,MAAM,qBAAqB,GAAG,WAAW,CACvC,CAAC,YAA8B,EAAE,EAAE;QACjC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,gCAAgC,CACrE,YAAY,CACb,CAAA;QAED,cAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAA;QACtC,cAAc,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAA;QAC1C,cAAc,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAA;QAC1C,cAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAA;IACxC,CAAC,EACD,CAAC,QAAQ,CAAC,CACX,CAAA;IAED,OAAO,EAAE,qBAAqB,EAAE,CAAA;AAClC,CAAC,CAAA;AAED,eAAe,oBAAoB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './useOnTextFormat';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/RichTextEditor/hooks/useOnTextFormat/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Dispatch } from 'react';
|
|
2
|
+
import { ActionsType } from '../../store';
|
|
3
|
+
import { TextFormatHandlerEvent } from '../../../QuillEditor';
|
|
4
|
+
declare type Props = {
|
|
5
|
+
dispatch: Dispatch<ActionsType>;
|
|
6
|
+
};
|
|
7
|
+
declare const useOnTextFormat: ({ dispatch }: Props) => {
|
|
8
|
+
handleTextFormat: (e: TextFormatHandlerEvent) => void;
|
|
9
|
+
};
|
|
10
|
+
export default useOnTextFormat;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
import { actions as toolbarActions } from '../../store/toolbar';
|
|
3
|
+
import { convertBoldFromEditorValue, convertItalicFromEditorValue, convertListFromEditorValue, convertHeaderFromEditorValue } from '../../utils/convertFormat';
|
|
4
|
+
const useOnTextFormat = ({ dispatch }) => {
|
|
5
|
+
const handleTextFormat = useCallback((e) => {
|
|
6
|
+
switch (e.formatName) {
|
|
7
|
+
case 'bold': {
|
|
8
|
+
const boldValue = convertBoldFromEditorValue(e.value);
|
|
9
|
+
return toolbarActions.setBold(dispatch)(boldValue);
|
|
10
|
+
}
|
|
11
|
+
case 'italic': {
|
|
12
|
+
const italicValue = convertItalicFromEditorValue(e.value);
|
|
13
|
+
return toolbarActions.setItalic(dispatch)(italicValue);
|
|
14
|
+
}
|
|
15
|
+
case 'list': {
|
|
16
|
+
const listValue = convertListFromEditorValue(e.value);
|
|
17
|
+
return toolbarActions.setList(dispatch)(listValue);
|
|
18
|
+
}
|
|
19
|
+
case 'header': {
|
|
20
|
+
const headerValue = convertHeaderFromEditorValue(e.value);
|
|
21
|
+
return toolbarActions.setHeader(dispatch)(headerValue);
|
|
22
|
+
}
|
|
23
|
+
default:
|
|
24
|
+
throw Error(`TextEditor - useOnTextFormat is not implemented for ${e}`);
|
|
25
|
+
}
|
|
26
|
+
}, [dispatch]);
|
|
27
|
+
return { handleTextFormat };
|
|
28
|
+
};
|
|
29
|
+
export default useOnTextFormat;
|
|
30
|
+
//# sourceMappingURL=useOnTextFormat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOnTextFormat.js","sourceRoot":"","sources":["../../../../src/RichTextEditor/hooks/useOnTextFormat/useOnTextFormat.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,WAAW,EAAE,MAAM,OAAO,CAAA;AAG7C,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAE/D,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,EAC5B,0BAA0B,EAC1B,4BAA4B,EAC7B,MAAM,2BAA2B,CAAA;AAMlC,MAAM,eAAe,GAAG,CAAC,EAAE,QAAQ,EAAS,EAAE,EAAE;IAC9C,MAAM,gBAAgB,GAAG,WAAW,CAClC,CAAC,CAAyB,EAAE,EAAE;QAC5B,QAAQ,CAAC,CAAC,UAAU,EAAE;YACpB,KAAK,MAAM,CAAC,CAAC;gBACX,MAAM,SAAS,GAAG,0BAA0B,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;gBAErD,OAAO,cAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAA;aACnD;YACD,KAAK,QAAQ,CAAC,CAAC;gBACb,MAAM,WAAW,GAAG,4BAA4B,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;gBAEzD,OAAO,cAAc,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC,CAAA;aACvD;YACD,KAAK,MAAM,CAAC,CAAC;gBACX,MAAM,SAAS,GAAG,0BAA0B,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;gBAErD,OAAO,cAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAA;aACnD;YACD,KAAK,QAAQ,CAAC,CAAC;gBACb,MAAM,WAAW,GAAG,4BAA4B,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;gBAEzD,OAAO,cAAc,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC,CAAA;aACvD;YACD;gBACE,MAAM,KAAK,CACT,uDAAuD,CAAC,EAAE,CAC3D,CAAA;SACJ;IACH,CAAC,EACD,CAAC,QAAQ,CAAC,CACX,CAAA;IAED,OAAO,EAAE,gBAAgB,EAAE,CAAA;AAC7B,CAAC,CAAA;AAED,eAAe,eAAe,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './useTextEditorState';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/RichTextEditor/hooks/useTextEditorState/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { useReducer } from 'react';
|
|
2
|
+
import { combinedReducers, initialState } from '../../store';
|
|
3
|
+
const useTextEditorState = () => {
|
|
4
|
+
const [state, dispatch] = useReducer(combinedReducers, initialState);
|
|
5
|
+
return { state, dispatch };
|
|
6
|
+
};
|
|
7
|
+
export default useTextEditorState;
|
|
8
|
+
//# sourceMappingURL=useTextEditorState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTextEditorState.js","sourceRoot":"","sources":["../../../../src/RichTextEditor/hooks/useTextEditorState/useTextEditorState.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAElC,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE5D,MAAM,kBAAkB,GAAG,GAAG,EAAE;IAC9B,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,UAAU,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAAA;IAEpE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAA;AAC5B,CAAC,CAAA;AAED,eAAe,kBAAkB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './useToolbarHandlers';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/RichTextEditor/hooks/useToolbarHandlers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TextFormatHandler } from '../../../QuillEditor';
|
|
2
|
+
import { SelectOnChangeHandler, ButtonHandlerType } from '../../../RichTextEditorToolbar';
|
|
3
|
+
import { FormatType } from '../../store/toolbar';
|
|
4
|
+
declare type Props = {
|
|
5
|
+
editorRef: React.RefObject<HTMLDivElement | null>;
|
|
6
|
+
handleTextFormat: TextFormatHandler;
|
|
7
|
+
format: FormatType;
|
|
8
|
+
};
|
|
9
|
+
declare const useToolbarHandlers: ({ editorRef, handleTextFormat, format }: Props) => {
|
|
10
|
+
handleBold: ButtonHandlerType;
|
|
11
|
+
handleItalic: ButtonHandlerType;
|
|
12
|
+
handleOrdered: ButtonHandlerType;
|
|
13
|
+
handleUnordered: ButtonHandlerType;
|
|
14
|
+
handleHeader: SelectOnChangeHandler;
|
|
15
|
+
};
|
|
16
|
+
export default useToolbarHandlers;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
import { CUSTOM_QUILL_EDITOR_FORMAT_EVENT } from '../../../QuillEditor';
|
|
3
|
+
import { convertHeaderToEditorValue } from '../../utils/convertFormat';
|
|
4
|
+
const useToolbarHandlers = ({ editorRef, handleTextFormat, format }) => {
|
|
5
|
+
const sendFormatEvent = useCallback((detail) => {
|
|
6
|
+
var _a;
|
|
7
|
+
const formatEvent = new CustomEvent(CUSTOM_QUILL_EDITOR_FORMAT_EVENT, {
|
|
8
|
+
detail
|
|
9
|
+
});
|
|
10
|
+
(_a = editorRef.current) === null || _a === void 0 ? void 0 : _a.dispatchEvent(formatEvent);
|
|
11
|
+
}, [editorRef]);
|
|
12
|
+
const handleBold = () => {
|
|
13
|
+
const bold = !format.bold;
|
|
14
|
+
sendFormatEvent({ bold });
|
|
15
|
+
handleTextFormat({
|
|
16
|
+
formatName: 'bold',
|
|
17
|
+
value: bold
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
const handleItalic = () => {
|
|
21
|
+
const italic = !format.italic;
|
|
22
|
+
sendFormatEvent({ italic });
|
|
23
|
+
handleTextFormat({
|
|
24
|
+
formatName: 'italic',
|
|
25
|
+
value: italic
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
const handleOrdered = () => {
|
|
29
|
+
const list = format.list === 'ordered' ? undefined : 'ordered';
|
|
30
|
+
sendFormatEvent({ list });
|
|
31
|
+
handleTextFormat({
|
|
32
|
+
formatName: 'list',
|
|
33
|
+
value: list
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
const handleUnordered = () => {
|
|
37
|
+
const list = format.list === 'bullet' ? undefined : 'bullet';
|
|
38
|
+
sendFormatEvent({ list });
|
|
39
|
+
handleTextFormat({
|
|
40
|
+
formatName: 'list',
|
|
41
|
+
value: list
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
const handleHeader = event => {
|
|
45
|
+
const header = convertHeaderToEditorValue(event.target.value);
|
|
46
|
+
sendFormatEvent(header ? { header, bold: false, italic: false } : { header });
|
|
47
|
+
handleTextFormat({
|
|
48
|
+
formatName: 'header',
|
|
49
|
+
value: header
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
return {
|
|
53
|
+
handleBold,
|
|
54
|
+
handleItalic,
|
|
55
|
+
handleOrdered,
|
|
56
|
+
handleUnordered,
|
|
57
|
+
handleHeader
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
export default useToolbarHandlers;
|
|
61
|
+
//# sourceMappingURL=useToolbarHandlers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useToolbarHandlers.js","sourceRoot":"","sources":["../../../../src/RichTextEditor/hooks/useToolbarHandlers/useToolbarHandlers.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAEnC,OAAO,EAEL,gCAAgC,EAEjC,MAAM,sBAAsB,CAAA;AAM7B,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAA;AAQtE,MAAM,kBAAkB,GAAG,CAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,EAAS,EAAE,EAAE;IAC5E,MAAM,eAAe,GAAG,WAAW,CACjC,CAAC,MAAiC,EAAE,EAAE;;QACpC,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC,gCAAgC,EAAE;YACpE,MAAM;SACP,CAAC,CAAA;QAEF,MAAA,SAAS,CAAC,OAAO,0CAAE,aAAa,CAAC,WAAW,CAAC,CAAA;IAC/C,CAAC,EACD,CAAC,SAAS,CAAC,CACZ,CAAA;IAED,MAAM,UAAU,GAAsB,GAAG,EAAE;QACzC,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAA;QAEzB,eAAe,CAAC,EAAE,IAAI,EAAE,CAAC,CAAA;QACzB,gBAAgB,CAAC;YACf,UAAU,EAAE,MAAM;YAClB,KAAK,EAAE,IAAI;SACZ,CAAC,CAAA;IACJ,CAAC,CAAA;IAED,MAAM,YAAY,GAAsB,GAAG,EAAE;QAC3C,MAAM,MAAM,GAAG,CAAC,MAAM,CAAC,MAAM,CAAA;QAE7B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC,CAAA;QAC3B,gBAAgB,CAAC;YACf,UAAU,EAAE,QAAQ;YACpB,KAAK,EAAE,MAAM;SACd,CAAC,CAAA;IACJ,CAAC,CAAA;IAED,MAAM,aAAa,GAAsB,GAAG,EAAE;QAC5C,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAA;QAE9D,eAAe,CAAC,EAAE,IAAI,EAAE,CAAC,CAAA;QACzB,gBAAgB,CAAC;YACf,UAAU,EAAE,MAAM;YAClB,KAAK,EAAE,IAAI;SACZ,CAAC,CAAA;IACJ,CAAC,CAAA;IAED,MAAM,eAAe,GAAsB,GAAG,EAAE;QAC9C,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAA;QAE5D,eAAe,CAAC,EAAE,IAAI,EAAE,CAAC,CAAA;QACzB,gBAAgB,CAAC;YACf,UAAU,EAAE,MAAM;YAClB,KAAK,EAAE,IAAI;SACZ,CAAC,CAAA;IACJ,CAAC,CAAA;IAED,MAAM,YAAY,GAA0B,KAAK,CAAC,EAAE;QAClD,MAAM,MAAM,GAAG,0BAA0B,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;QAE7D,eAAe,CACb,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAC7D,CAAA;QACD,gBAAgB,CAAC;YACf,UAAU,EAAE,QAAQ;YACpB,KAAK,EAAE,MAAM;SACd,CAAC,CAAA;IACJ,CAAC,CAAA;IAED,OAAO;QACL,UAAU;QACV,YAAY;QACZ,aAAa;QACb,eAAe;QACf,YAAY;KACb,CAAA;AACH,CAAC,CAAA;AAED,eAAe,kBAAkB,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { OmitInternalProps } from '@toptal/picasso-shared';
|
|
2
|
+
import { Props } from './RichTextEditor';
|
|
3
|
+
import { FormatType, HeaderValue } from './store/toolbar';
|
|
4
|
+
export { default } from './RichTextEditor';
|
|
5
|
+
export type { FormatType, HeaderValue };
|
|
6
|
+
export * from './types';
|
|
7
|
+
export declare type RichTextEditorProps = OmitInternalProps<Props>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/RichTextEditor/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAE1C,cAAc,SAAS,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as toolbarStore from './toolbar';
|
|
2
|
+
import { StateType, ActionsType } from './types';
|
|
3
|
+
export * from './types';
|
|
4
|
+
export declare const combinedReducers: (state: StateType, action: ActionsType) => {
|
|
5
|
+
toolbar: toolbarStore.ToolbarStateType;
|
|
6
|
+
};
|
|
7
|
+
export declare const initialState: {
|
|
8
|
+
toolbar: toolbarStore.ToolbarStateType;
|
|
9
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as toolbarStore from './toolbar';
|
|
2
|
+
export * from './types';
|
|
3
|
+
export const combinedReducers = (state, action) => {
|
|
4
|
+
return {
|
|
5
|
+
toolbar: toolbarStore.reducer(state.toolbar, action)
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export const initialState = {
|
|
9
|
+
toolbar: toolbarStore.initialState
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/RichTextEditor/store/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,YAAY,MAAM,WAAW,CAAA;AAGzC,cAAc,SAAS,CAAA;AAEvB,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAgB,EAAE,MAAmB,EAAE,EAAE;IACxE,OAAO;QACL,OAAO,EAAE,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC;KACrD,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,OAAO,EAAE,YAAY,CAAC,YAAY;CACnC,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare const actionTypes: {
|
|
2
|
+
readonly bold: "TOOLBAR/SET_BOLD";
|
|
3
|
+
readonly header: "TOOLBAR/SET_HEADER";
|
|
4
|
+
readonly italic: "TOOLBAR/SET_ITALIC";
|
|
5
|
+
readonly list: "TOOLBAR/SET_LIST";
|
|
6
|
+
readonly disabled: "TOOLBAR/SET_DISABLED";
|
|
7
|
+
readonly resetFormat: "TOOLBAR/RESET_FORMAT";
|
|
8
|
+
};
|
|
9
|
+
export default actionTypes;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const actionTypes = {
|
|
2
|
+
bold: 'TOOLBAR/SET_BOLD',
|
|
3
|
+
header: 'TOOLBAR/SET_HEADER',
|
|
4
|
+
italic: 'TOOLBAR/SET_ITALIC',
|
|
5
|
+
list: 'TOOLBAR/SET_LIST',
|
|
6
|
+
disabled: 'TOOLBAR/SET_DISABLED',
|
|
7
|
+
resetFormat: 'TOOLBAR/RESET_FORMAT'
|
|
8
|
+
};
|
|
9
|
+
export default actionTypes;
|
|
10
|
+
//# sourceMappingURL=actionTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actionTypes.js","sourceRoot":"","sources":["../../../../src/RichTextEditor/store/toolbar/actionTypes.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,GAAG;IAClB,IAAI,EAAE,kBAAkB;IACxB,MAAM,EAAE,oBAAoB;IAC5B,MAAM,EAAE,oBAAoB;IAC5B,IAAI,EAAE,kBAAkB;IACxB,QAAQ,EAAE,sBAAsB;IAChC,WAAW,EAAE,sBAAsB;CAC3B,CAAA;AAEV,eAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Dispatch } from 'react';
|
|
2
|
+
import { SetBoldActionType, SetHeaderActionType, SetItalicActionType, SetListActionType, SetDisabled, ResetFormatType } from './types';
|
|
3
|
+
declare const actions: {
|
|
4
|
+
setBold: (dispatch: Dispatch<SetBoldActionType>) => (payload: SetBoldActionType['payload']) => void;
|
|
5
|
+
setItalic: (dispatch: Dispatch<SetItalicActionType>) => (payload: SetItalicActionType['payload']) => void;
|
|
6
|
+
setHeader: (dispatch: Dispatch<SetHeaderActionType>) => (payload: SetHeaderActionType['payload']) => void;
|
|
7
|
+
setList: (dispatch: Dispatch<SetListActionType>) => (payload: SetListActionType['payload']) => void;
|
|
8
|
+
setDisabled: (dispatch: Dispatch<SetDisabled>) => (payload: boolean) => void;
|
|
9
|
+
resetFormat: (dispatch: Dispatch<ResetFormatType>) => () => void;
|
|
10
|
+
};
|
|
11
|
+
export default actions;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import actionTypes from './actionTypes';
|
|
2
|
+
const setBold = (dispatch) => (payload) => dispatch({ type: actionTypes.bold, payload });
|
|
3
|
+
const setItalic = (dispatch) => (payload) => dispatch({ type: actionTypes.italic, payload });
|
|
4
|
+
const setHeader = (dispatch) => (payload) => dispatch({ type: actionTypes.header, payload });
|
|
5
|
+
const setList = (dispatch) => (payload) => dispatch({ type: actionTypes.list, payload });
|
|
6
|
+
const setDisabled = (dispatch) => (payload) => dispatch({ type: actionTypes.disabled, payload });
|
|
7
|
+
const resetFormat = (dispatch) => () => dispatch({ type: actionTypes.resetFormat });
|
|
8
|
+
const actions = {
|
|
9
|
+
setBold,
|
|
10
|
+
setItalic,
|
|
11
|
+
setHeader,
|
|
12
|
+
setList,
|
|
13
|
+
setDisabled,
|
|
14
|
+
resetFormat
|
|
15
|
+
};
|
|
16
|
+
export default actions;
|
|
17
|
+
//# sourceMappingURL=actions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../../../src/RichTextEditor/store/toolbar/actions.ts"],"names":[],"mappings":"AAEA,OAAO,WAAW,MAAM,eAAe,CAAA;AAUvC,MAAM,OAAO,GAAG,CAAC,QAAqC,EAAE,EAAE,CAAC,CACzD,OAAqC,EACrC,EAAE,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,CAAA;AAElD,MAAM,SAAS,GAAG,CAAC,QAAuC,EAAE,EAAE,CAAC,CAC7D,OAAuC,EACvC,EAAE,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAAA;AAEpD,MAAM,SAAS,GAAG,CAAC,QAAuC,EAAE,EAAE,CAAC,CAC7D,OAAuC,EACvC,EAAE,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAAA;AAEpD,MAAM,OAAO,GAAG,CAAC,QAAqC,EAAE,EAAE,CAAC,CACzD,OAAqC,EACrC,EAAE,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,CAAA;AAElD,MAAM,WAAW,GAAG,CAAC,QAA+B,EAAE,EAAE,CAAC,CAAC,OAAgB,EAAE,EAAE,CAC5E,QAAQ,CAAC,EAAE,IAAI,EAAE,WAAW,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAA;AAEnD,MAAM,WAAW,GAAG,CAAC,QAAmC,EAAE,EAAE,CAAC,GAAG,EAAE,CAChE,QAAQ,CAAC,EAAE,IAAI,EAAE,WAAW,CAAC,WAAW,EAAE,CAAC,CAAA;AAE7C,MAAM,OAAO,GAAG;IACd,OAAO;IACP,SAAS;IACT,SAAS;IACT,OAAO;IACP,WAAW;IACX,WAAW;CACZ,CAAA;AAED,eAAe,OAAO,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import actions from './actions';
|
|
2
|
+
import reducer from './reducer';
|
|
3
|
+
import initialState from './initialState';
|
|
4
|
+
import actionTypes from './actionTypes';
|
|
5
|
+
export * from './types';
|
|
6
|
+
export { actions, actionTypes, reducer, initialState };
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/RichTextEditor/store/toolbar/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,WAAW,CAAA;AAC/B,OAAO,OAAO,MAAM,WAAW,CAAA;AAC/B,OAAO,YAAY,MAAM,gBAAgB,CAAA;AACzC,OAAO,WAAW,MAAM,eAAe,CAAA;AAEvC,cAAc,SAAS,CAAA;AACvB,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initialState.js","sourceRoot":"","sources":["../../../../src/RichTextEditor/store/toolbar/initialState.ts"],"names":[],"mappings":"AAEA,MAAM,YAAY,GAAqB;IACrC,MAAM,EAAE;QACN,IAAI,EAAE,KAAK;QACX,MAAM,EAAE,EAAE;QACV,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,KAAK;KACZ;IACD,QAAQ,EAAE,IAAI;CACf,CAAA;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import actionTypes from './actionTypes';
|
|
2
|
+
import initialState from './initialState';
|
|
3
|
+
const reducer = (state = initialState, action) => {
|
|
4
|
+
switch (action.type) {
|
|
5
|
+
case actionTypes.bold:
|
|
6
|
+
return Object.assign(Object.assign({}, state), { format: Object.assign(Object.assign({}, state.format), { bold: action.payload }) });
|
|
7
|
+
case actionTypes.italic:
|
|
8
|
+
return Object.assign(Object.assign({}, state), { format: Object.assign(Object.assign({}, state.format), { italic: action.payload }) });
|
|
9
|
+
case actionTypes.header:
|
|
10
|
+
return Object.assign(Object.assign({}, state), { format: Object.assign(Object.assign({}, state.format), { header: action.payload }) });
|
|
11
|
+
case actionTypes.list:
|
|
12
|
+
return Object.assign(Object.assign({}, state), { format: Object.assign(Object.assign({}, state.format), { list: action.payload }) });
|
|
13
|
+
case actionTypes.disabled:
|
|
14
|
+
return Object.assign(Object.assign({}, state), { disabled: action.payload });
|
|
15
|
+
case actionTypes.resetFormat:
|
|
16
|
+
return Object.assign(Object.assign({}, state), { format: initialState.format });
|
|
17
|
+
default:
|
|
18
|
+
return state;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
export default reducer;
|
|
22
|
+
//# sourceMappingURL=reducer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reducer.js","sourceRoot":"","sources":["../../../../src/RichTextEditor/store/toolbar/reducer.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,eAAe,CAAA;AAEvC,OAAO,YAAY,MAAM,gBAAgB,CAAA;AAEzC,MAAM,OAAO,GAAuB,CAAC,KAAK,GAAG,YAAY,EAAE,MAAM,EAAE,EAAE;IACnE,QAAQ,MAAM,CAAC,IAAI,EAAE;QACnB,KAAK,WAAW,CAAC,IAAI;YACnB,uCACK,KAAK,KACR,MAAM,kCAAO,KAAK,CAAC,MAAM,KAAE,IAAI,EAAE,MAAM,CAAC,OAAO,OAChD;QACH,KAAK,WAAW,CAAC,MAAM;YACrB,uCACK,KAAK,KACR,MAAM,kCAAO,KAAK,CAAC,MAAM,KAAE,MAAM,EAAE,MAAM,CAAC,OAAO,OAClD;QACH,KAAK,WAAW,CAAC,MAAM;YACrB,uCACK,KAAK,KACR,MAAM,kCAAO,KAAK,CAAC,MAAM,KAAE,MAAM,EAAE,MAAM,CAAC,OAAO,OAClD;QACH,KAAK,WAAW,CAAC,IAAI;YACnB,uCACK,KAAK,KACR,MAAM,kCAAO,KAAK,CAAC,MAAM,KAAE,IAAI,EAAE,MAAM,CAAC,OAAO,OAChD;QAEH,KAAK,WAAW,CAAC,QAAQ;YACvB,uCACK,KAAK,KACR,QAAQ,EAAE,MAAM,CAAC,OAAO,IACzB;QAEH,KAAK,WAAW,CAAC,WAAW;YAC1B,uCACK,KAAK,KACR,MAAM,EAAE,YAAY,CAAC,MAAM,IAC5B;QAEH;YACE,OAAO,KAAK,CAAA;KACf;AACH,CAAC,CAAA;AAED,eAAe,OAAO,CAAA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import actionTypes from './actionTypes';
|
|
2
|
+
export declare type HeaderValue = '3' | '';
|
|
3
|
+
export declare type BoldValue = boolean;
|
|
4
|
+
export declare type ItalicValue = boolean;
|
|
5
|
+
export declare type ListValue = 'bullet' | 'ordered' | false;
|
|
6
|
+
export declare type FormatType = {
|
|
7
|
+
bold: BoldValue;
|
|
8
|
+
italic: ItalicValue;
|
|
9
|
+
list: ListValue;
|
|
10
|
+
header: HeaderValue;
|
|
11
|
+
};
|
|
12
|
+
export declare type ToolbarStateType = {
|
|
13
|
+
format: FormatType;
|
|
14
|
+
disabled: boolean;
|
|
15
|
+
};
|
|
16
|
+
export declare type SetBoldActionType = {
|
|
17
|
+
type: typeof actionTypes.bold;
|
|
18
|
+
payload: ToolbarStateType['format']['bold'];
|
|
19
|
+
};
|
|
20
|
+
export declare type SetItalicActionType = {
|
|
21
|
+
type: typeof actionTypes.italic;
|
|
22
|
+
payload: ToolbarStateType['format']['italic'];
|
|
23
|
+
};
|
|
24
|
+
export declare type SetListActionType = {
|
|
25
|
+
type: typeof actionTypes.list;
|
|
26
|
+
payload: ToolbarStateType['format']['list'];
|
|
27
|
+
};
|
|
28
|
+
export declare type SetHeaderActionType = {
|
|
29
|
+
type: typeof actionTypes.header;
|
|
30
|
+
payload: ToolbarStateType['format']['header'];
|
|
31
|
+
};
|
|
32
|
+
export declare type SetDisabled = {
|
|
33
|
+
type: typeof actionTypes.disabled;
|
|
34
|
+
payload: boolean;
|
|
35
|
+
};
|
|
36
|
+
export declare type ResetFormatType = {
|
|
37
|
+
type: typeof actionTypes.resetFormat;
|
|
38
|
+
};
|
|
39
|
+
export declare type ToolbarActionsType = SetBoldActionType | SetItalicActionType | SetListActionType | SetHeaderActionType | SetDisabled | ResetFormatType;
|
|
40
|
+
export declare type ToolbarReducerType = (state: ToolbarStateType | undefined, action: ToolbarActionsType) => ToolbarStateType;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/RichTextEditor/store/toolbar/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/RichTextEditor/store/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { outline } from '@toptal/picasso-shared';
|
|
2
|
+
import { createStyles } from '@material-ui/core/styles';
|
|
3
|
+
export default ({ palette, sizes }) => createStyles({
|
|
4
|
+
editorWrapper: {
|
|
5
|
+
position: 'relative',
|
|
6
|
+
borderRadius: sizes.borderRadius.small,
|
|
7
|
+
border: `1px solid ${palette.grey.light2}`,
|
|
8
|
+
padding: '0.5em',
|
|
9
|
+
'&:hover:not($disabled):not($error)': {
|
|
10
|
+
borderColor: palette.grey.main2
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
disabled: {
|
|
14
|
+
pointerEvents: 'none',
|
|
15
|
+
background: palette.grey.lighter,
|
|
16
|
+
border: `1px solid ${palette.grey.lighter2}`
|
|
17
|
+
},
|
|
18
|
+
error: {
|
|
19
|
+
borderColor: palette.red.main
|
|
20
|
+
},
|
|
21
|
+
focused: Object.assign({ borderColor: palette.grey.main2 }, outline(palette.primary.main))
|
|
22
|
+
});
|
|
23
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../src/RichTextEditor/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAChD,OAAO,EAAE,YAAY,EAAS,MAAM,0BAA0B,CAAA;AAE9D,eAAe,CAAC,EAAE,OAAO,EAAE,KAAK,EAAS,EAAE,EAAE,CAC3C,YAAY,CAAC;IACX,aAAa,EAAE;QACb,QAAQ,EAAE,UAAU;QACpB,YAAY,EAAE,KAAK,CAAC,YAAY,CAAC,KAAK;QACtC,MAAM,EAAE,aAAa,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE;QAC1C,OAAO,EAAE,OAAO;QAEhB,oCAAoC,EAAE;YACpC,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK;SAChC;KACF;IAED,QAAQ,EAAE;QACR,aAAa,EAAE,MAAM;QACrB,UAAU,EAAE,OAAO,CAAC,IAAI,CAAC,OAAO;QAChC,MAAM,EAAE,aAAa,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE;KAC7C;IAED,KAAK,EAAE;QACL,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,IAAI;KAC9B;IAED,OAAO,kBACL,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,IAC5B,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CACjC;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/RichTextEditor/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FormatType as EditorFormatType, BoldValue as EditorBoldValue, ItalicValue as EditorItalicValue, ListValue as EditorListValue, HeaderValue as EditorHeaderValue } from '../../QuillEditor';
|
|
2
|
+
import { FormatType as ToolbarFormatType, HeaderValue } from '../store/toolbar';
|
|
3
|
+
export declare const convertBoldFromEditorValue: (bold: EditorBoldValue) => boolean;
|
|
4
|
+
export declare const convertItalicFromEditorValue: (italic: EditorItalicValue) => boolean;
|
|
5
|
+
export declare const convertListFromEditorValue: (list: EditorListValue) => false | "bullet" | "ordered";
|
|
6
|
+
export declare const convertHeaderFromEditorValue: (header: EditorHeaderValue) => "" | "3";
|
|
7
|
+
export declare const getToolbarFormatFromEditorFormat: (format: EditorFormatType) => ToolbarFormatType;
|
|
8
|
+
export declare const convertHeaderToEditorValue: (header: HeaderValue) => EditorHeaderValue;
|