diff --git a/web/client/components/mapviews/settings/CompactRichTextEditor.jsx b/web/client/components/mapviews/settings/CompactRichTextEditor.jsx index 3901828cfc..5f3acd59bd 100644 --- a/web/client/components/mapviews/settings/CompactRichTextEditor.jsx +++ b/web/client/components/mapviews/settings/CompactRichTextEditor.jsx @@ -56,9 +56,8 @@ function CompactRichTextEditor({ options: toolbarOptions || ['fontFamily', 'blockType', 'inline', 'textAlign', 'list', 'link', 'colorPicker', 'remove', 'image', 'embedded'], image: { urlEnabled: true, - // disable the upload at the moment - // it will increase the size of the map too much - uploadEnabled: false, + // upload controlled via props, disabled by default + uploadEnabled: props.uploadEnabled || false, alignmentEnabled: false, uploadCallback: (file) => new Promise((resolve, reject) => { const reader = new FileReader(); @@ -86,7 +85,8 @@ function CompactRichTextEditor({ } }, fontFamily: { - options: DEFAULT_FONT_FAMILIES + // Setup fonts via props or use default from GeoStories + options: props.fonts || DEFAULT_FONT_FAMILIES }, link: { inDropdown: false, diff --git a/web/client/components/widgets/builder/wizard/text/TextOptions.jsx b/web/client/components/widgets/builder/wizard/text/TextOptions.jsx index 3300abe79a..fca9d10700 100644 --- a/web/client/components/widgets/builder/wizard/text/TextOptions.jsx +++ b/web/client/components/widgets/builder/wizard/text/TextOptions.jsx @@ -6,34 +6,64 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; -import { Col, Form, FormControl, FormGroup } from 'react-bootstrap'; -import ReactQuill from '../../../../../libs/quill/react-quill-suspense'; +import React, { useState } from "react"; +import { Col, Form, FormControl, FormGroup } from "react-bootstrap"; +import localizedProps from "../../../../misc/enhancers/localizedProps"; +import { + htmlToDraftJSEditorState, + draftJSEditorStateToHtml +} from "../../../../../utils/EditorUtils"; -import localizedProps from '../../../../misc/enhancers/localizedProps'; +import withDebounceOnCallback from "../../../../misc/enhancers/withDebounceOnCallback"; +import CompactRichTextEditor from "../../../../mapviews/settings/CompactRichTextEditor"; const TitleInput = localizedProps("placeholder")(FormControl); +const DescriptorEditor = withDebounceOnCallback( + "onEditorStateChange", + "editorState" +)(CompactRichTextEditor); -const Editor = localizedProps("placeholder")(ReactQuill); - -export default ({ data = {}, onChange = () => { }}) => ( -