@entur-partner/rich-text-editor 6.2.2 → 6.2.4-alpha.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/LICENSE.md +1 -0
- package/dist/ExpandableMultiLanguageRichTextEditor.d.ts +3 -3
- package/dist/RichTextEditor/constants.d.ts +8 -8
- package/dist/index.d.ts +5 -5
- package/dist/rich-text-editor.cjs.development.js +228 -226
- package/dist/rich-text-editor.cjs.development.js.map +1 -1
- package/dist/rich-text-editor.cjs.production.min.js +1 -1
- package/dist/rich-text-editor.cjs.production.min.js.map +1 -1
- package/dist/rich-text-editor.esm.js +227 -225
- package/dist/rich-text-editor.esm.js.map +1 -1
- package/package.json +60 -60
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rich-text-editor.cjs.production.min.js","sources":["../src/withI18n.js","../src/RichTextEditor/BlockTypeDropdown/index.js","../src/RichTextEditor/Controls/BlockTypeSelectControls.js","../src/events.js","../src/RichTextEditor/StyleButton/index.js","../src/RichTextEditor/Controls/BlockTypeButtonControls.js","../src/RichTextEditor/Controls/BlockTypeLinkControls.js","../src/RichTextEditor/Controls/InlineStyleControls.js","../src/RichTextEditor/Controls/TagControls.js","../src/RichTextEditor/Link/index.js","../src/RichTextEditor/constants.js","../src/RichTextEditor/index.js","../src/RichTextEditor/markdownConvertion.js","../src/ExpandableMultiLanguageRichTextEditor.tsx","../src/RichTextEditor/htmlConvertion.js"],"sourcesContent":["import React from 'react';\nimport { useTranslation } from 'react-i18next';\n\nfunction useI18N() {\n const {\n t,\n i18n: { language },\n } = useTranslation();\n\n if (\n language !== 'nb' &&\n language !== 'en' &&\n language !== 'nb-NO' &&\n language !== 'en-GB'\n ) {\n throw Error('Language must be either nb or en.');\n }\n\n return t;\n}\n\nexport function withI18n(Component) {\n return function WrappedComponent(props) {\n const t = useI18N();\n return <Component {...props} i18n={t} />;\n };\n}\n","import './styles.scss';\n\nimport React, { Component } from 'react';\nimport { Dropdown } from '@entur/dropdown';\n\nimport { withI18n } from '../../withI18n';\n\nclass BlockTypeDropdown extends Component {\n handleOnClick = (selectedOption) => {\n const { onChange } = this.props;\n onChange(selectedOption);\n };\n\n toItem(option) {\n return {\n value: option.style,\n label: this.renderFormattedLabel(option.label),\n };\n }\n\n renderFormattedLabel(label) {\n const formattedLabelText = this.props.i18n(label);\n switch (label) {\n case 'styles.p':\n return <div className=\"default-p\">{formattedLabelText}</div>;\n case 'styles.h1':\n return <div className=\"default-h1\">{formattedLabelText}</div>;\n case 'styles.h2':\n return <div className=\"default-h2\">{formattedLabelText}</div>;\n case 'styles.h3':\n return <div className=\"default-h3\">{formattedLabelText}</div>;\n case 'styles.h4':\n return <div className=\"default-h4\">{formattedLabelText}</div>;\n case 'styles.h5':\n return <div className=\"default-h5\">{formattedLabelText}</div>;\n case 'styles.h6':\n return <div className=\"default-h6\">{formattedLabelText}</div>;\n default:\n return <p>{formattedLabelText}</p>;\n }\n }\n\n render() {\n const { options, selected, i18n } = this.props;\n\n return (\n <Dropdown\n className=\"block-type-dropdown\"\n items={options.map((option) => this.toItem(option))}\n selectedItem={this.toItem(selected)}\n label={i18n('styles.style')}\n onChange={(selectedItem) => this.handleOnClick(selectedItem.value)}\n />\n );\n }\n}\n\nexport default withI18n(BlockTypeDropdown);\n","import './styles.scss';\n\nimport React from 'react';\n\nimport BlockTypeDropdown from '../BlockTypeDropdown';\n\nconst BlockTypeControls = ({ editorState, blockTypes, onToggle }) => {\n const selection = editorState.getSelection();\n const blockTypeStyle = editorState\n .getCurrentContent()\n .getBlockForKey(selection.getStartKey())\n .getType();\n\n const selectedOption =\n blockTypes.find((option) => option.style === blockTypeStyle) ||\n blockTypes[0];\n\n return (\n <BlockTypeDropdown\n options={blockTypes}\n selected={selectedOption}\n onChange={onToggle}\n />\n );\n};\n\nexport default BlockTypeControls;\n","export const Key = Object.freeze({\n ENTER: 13,\n});\n\nexport function getKey(event) {\n return event.keyCode || event.which;\n}\n","import './styles.scss';\n\nimport React, { Component } from 'react';\nimport cx from 'classnames';\n\nimport { withI18n } from '../../withI18n';\nimport { Key, getKey } from '../../events';\n\nclass StyleButton extends Component {\n onToggle = (e) => {\n const { style, onToggle } = this.props;\n e.preventDefault();\n onToggle(style);\n };\n\n onToggleNoEvent = () => {\n const { style, onToggle } = this.props;\n onToggle(style);\n };\n\n render() {\n const { i18n, active, label, title, hotKey } = this.props;\n\n const classNames = cx('editor-stylebutton', { active });\n\n return (\n <div\n className={classNames}\n onMouseDown={this.onToggle}\n title={i18n(title) + hotKey}\n tabIndex={0}\n onKeyPress={(event) => {\n if (getKey(event) === Key.ENTER) {\n this.onToggleNoEvent();\n }\n }}\n >\n {label}\n </div>\n );\n }\n}\n\nexport default withI18n(StyleButton);\n","import './styles.scss';\n\nimport React from 'react';\n\nimport StyleButton from '../StyleButton';\n\nconst BlockTypeButtonControls = (props) => {\n const { editorState, blockTypes, onToggle } = props;\n const selection = editorState.getSelection();\n const blockTypeStyle = editorState\n .getCurrentContent()\n .getBlockForKey(selection.getStartKey())\n .getType();\n\n return (\n <div className=\"controls-group block-editor-controls\">\n {blockTypes.map((type, i) => (\n <StyleButton\n key={i}\n active={type.style === blockTypeStyle}\n label={type.label}\n onToggle={onToggle}\n style={type.style}\n title={type.tooltip}\n />\n ))}\n </div>\n );\n};\n\nexport default BlockTypeButtonControls;\n","import './styles.scss';\n\nimport React, { Component } from 'react';\nimport { EditorState } from 'draft-js';\nimport PropTypes from 'prop-types';\nimport { TextField } from '@entur/form';\nimport { UnlinkIcon, LinkIcon, CheckIcon, CloseIcon } from '@entur/icons';\nimport { Unbutton } from '@entur-partner/common';\nimport { SecondarySquareButton } from '@entur/button';\n\nimport { withI18n } from '../../withI18n';\nimport { Key, getKey } from '../../events';\n\nclass BlockTypeLinkControls extends Component {\n state = {\n urlValue: '',\n showUrlInput: false,\n hasLink: false,\n };\n\n onUrlChange = (e) => {\n this.setState({ urlValue: e.target.value });\n };\n\n addLink = (e) => {\n e.preventDefault();\n const { editorState } = this.props;\n const selection = editorState.getSelection();\n if (!selection.isCollapsed()) {\n const currentContent = editorState.getCurrentContent();\n const startKey = selection.getStartKey();\n const startOffset = selection.getStartOffset();\n const blockWithLinkAtBeginning = currentContent.getBlockForKey(startKey);\n const linkKey = blockWithLinkAtBeginning.getEntityAt(startOffset);\n\n let url = '';\n if (linkKey) {\n const linkInstance = currentContent.getEntity(linkKey);\n url = linkInstance.getData().url;\n }\n\n this.setState({\n showUrlInput: true,\n urlValue: url,\n hasLink: !!url,\n });\n }\n };\n\n confirmLink = (e) => {\n e.preventDefault();\n const { urlValue } = this.state;\n const { editorState, onToggle } = this.props;\n const contentState = editorState.getCurrentContent();\n const contentStateWithEntity = contentState.createEntity(\n 'LINK',\n 'MUTABLE',\n { url: urlValue }\n );\n const entityKey = contentStateWithEntity.getLastCreatedEntityKey();\n const newEditorState = EditorState.set(editorState, {\n currentContent: contentStateWithEntity,\n });\n onToggle(newEditorState, entityKey);\n this.setState({\n showUrlInput: false,\n urlValue: '',\n });\n };\n\n cancelLink = (e) => {\n e.preventDefault();\n this.setState({\n showUrlInput: false,\n urlValue: '',\n });\n };\n\n onLinkInputKeyDown = (e) => {\n if (getKey(e) === Key.ENTER) {\n this.confirmLink(e);\n }\n };\n\n removeLink = (e) => {\n e.preventDefault();\n const { editorState, onToggle } = this.props;\n const { hasLink } = this.state;\n const selection = editorState.getSelection();\n if (!selection.isCollapsed() && hasLink) {\n onToggle(editorState, null);\n this.setState({\n showUrlInput: false,\n });\n }\n };\n\n render() {\n const { i18n } = this.props;\n const { showUrlInput, hasLink } = this.state;\n return (\n <div className=\"controls-group block-editor-controls link-controls\">\n <div\n className=\"editor-stylebutton\"\n title={i18n('styles.link')}\n onClick={this.addLink}\n tabIndex={0}\n >\n <LinkIcon />\n </div>\n\n {showUrlInput && (\n <div className=\"url-input-container\">\n <span className=\"exit-button\" onMouseDown={this.cancelLink}>\n <CloseIcon />\n </span>\n <div className=\"link-label\">{i18n('common.from')}</div>\n <div className=\"url-input-form\">\n <TextField\n style={{ width: 250, margin: 5 }}\n onChange={this.onUrlChange}\n value={this.state.urlValue}\n onKeyDown={this.onLinkInputKeyDown}\n placeholder=\"https://example.com\"\n />\n <SecondarySquareButton onMouseDown={this.confirmLink}>\n <CheckIcon width={15} height={15} />\n </SecondarySquareButton>\n </div>\n {hasLink && (\n <div className=\"remove-link\">\n <Unbutton\n onClick={this.removeLink}\n title={i18n('styles.unlink')}\n >\n <UnlinkIcon />\n {i18n('styles.unlink')}\n </Unbutton>\n </div>\n )}\n </div>\n )}\n </div>\n );\n }\n}\nBlockTypeLinkControls.propTypes = {\n editorState: PropTypes.object,\n onToggle: PropTypes.func,\n};\n\nexport default withI18n(BlockTypeLinkControls);\n","import './styles.scss';\n\nimport React from 'react';\n\nimport StyleButton from '../StyleButton';\n\nconst InlineStyleControls = (props) => {\n const { editorState, inlineStyles } = props;\n\n const currentStyle = editorState.getCurrentInlineStyle();\n\n return (\n <div className=\"controls-group inline-editor-controls\">\n {inlineStyles.map((type, i) => (\n <StyleButton\n key={i}\n active={currentStyle.has(type.style)}\n label={type.label}\n onToggle={props.onToggle}\n style={type.style}\n title={type.tooltip}\n hotKey={type.hotKey}\n />\n ))}\n </div>\n );\n};\n\nexport default InlineStyleControls;\n","import './styles.scss';\n\nimport React, { Component, createRef } from 'react';\nimport PropTypes from 'prop-types';\nimport { Popover } from '@entur/tooltip';\nimport { OverflowMenuItem, OverflowMenu } from '@entur/menu';\nimport { DownArrowIcon } from '@entur/icons';\n\nimport { withI18n } from '../../withI18n';\n\nclass TagControls extends Component {\n tagControlRef = createRef();\n state = { isOpen: false };\n\n componentDidMount() {\n document.addEventListener('mousedown', this.handleClickOutside);\n }\n\n componentWillUnmount() {\n document.removeEventListener('mousedown', this.handleClickOutside);\n }\n\n handleClickOutside = (e) => {\n if (\n this.tagControlRef &&\n this.tagControlRef.current &&\n !this.tagControlRef.current.contains(e.target)\n ) {\n this.setState({ isOpen: false });\n }\n };\n\n handleTagClick = (tag, delimiter) => {\n const { editorState, onInsertTag } = this.props;\n const delimiterStart = delimiter[0];\n const delimiterEnd = delimiter[1];\n const fullTag = `${delimiterStart}${tag}${delimiterEnd}`;\n onInsertTag(editorState, fullTag);\n };\n\n render() {\n const { i18n, tags } = this.props;\n const { isOpen } = this.state;\n const menuItems = tags.map((tag, i) => {\n const delimiter = tag.delimiter || '{}';\n return (\n <OverflowMenuItem\n key={i}\n className=\"tag-control\"\n id={'tag-control-' + tag.tag}\n onClick={() => this.handleTagClick(tag.tag, delimiter)}\n >\n {tag.icon}\n <span className=\"tag-control-text\">{tag.label}</span>\n </OverflowMenuItem>\n );\n });\n\n return (\n <div className=\"tag-control-dropdown\" ref={this.tagControlRef}>\n <div\n className=\"tag-control-header\"\n onClick={() => this.setState(({ isOpen }) => ({ isOpen: !isOpen }))}\n >\n {i18n('common.insert')}\n <DownArrowIcon className=\"tag-control-chevron\" inline />\n </div>\n <Popover open={isOpen} className=\"tag-control-content\">\n <OverflowMenu className=\"action-menu\">{menuItems}</OverflowMenu>\n </Popover>\n </div>\n );\n }\n}\n\nTagControls.propTypes = {\n editorState: PropTypes.object,\n tags: PropTypes.arrayOf(PropTypes.object).isRequired,\n onInsertTag: PropTypes.func.isRequired,\n};\n\nexport default withI18n(TagControls);\n","import React from 'react';\n\nexport const HtmlLink = ({ url, children }) => {\n return <a href={url}>{children}</a>;\n};\n\nconst Link = (props) => {\n const { url } = props.contentState.getEntity(props.entityKey).getData();\n return <HtmlLink url={url}>{props.children}</HtmlLink>;\n};\n\nexport function findLinkEntities(contentBlock, callback, contentState) {\n contentBlock.findEntityRanges((character) => {\n const entityKey = character.getEntity();\n return (\n entityKey !== null &&\n contentState.getEntity(entityKey).getType() === 'LINK'\n );\n }, callback);\n}\n\nexport default Link;\n","import React from 'react';\nimport {\n BoldIcon,\n ItalicIcon,\n UnderlineIcon,\n BulletListIcon,\n NumberListIcon,\n} from '@entur/icons';\nimport { CompositeDecorator } from 'draft-js';\n\nimport Link, { findLinkEntities } from './Link';\n\nexport const EditorConfigTypes = Object.freeze({\n FONT_LIST: {\n UNSTYLED: 'unstyled',\n HEADER_ONE: 'header-one',\n HEADER_TWO: 'header-two',\n HEADER_THREE: 'header-three',\n HEADER_FOUR: 'header-four',\n HEADER_FIVE: 'header-five',\n HEADER_SIX: 'header-six',\n },\n BLOCK_TYPES: {\n UNORDERED_LIST: 'unordered-list',\n ORDERED_LIST: 'ordered-list',\n },\n INLINE_STYLES: {\n BOLD: 'bold',\n ITALIC: 'italic',\n UNDERLINE: 'underline',\n },\n});\n\nexport const FontList = Object.freeze({\n unstyled: { label: 'styles.p', style: 'unstyled' },\n 'header-one': { label: 'styles.h1', style: 'header-one' },\n 'header-two': { label: 'styles.h2', style: 'header-two' },\n 'header-three': { label: 'styles.h3', style: 'header-three' },\n 'header-four': { label: 'styles.h4', style: 'header-four' },\n 'header-five': { label: 'styles.h5', style: 'header-five' },\n 'header-six': { label: 'styles.h6', style: 'header-six' },\n});\n\nexport const BlockTypeList = Object.freeze({\n 'unordered-list': {\n label: <BulletListIcon />,\n style: 'unordered-list-item',\n tooltip: 'styles.unordered_list_item',\n },\n 'ordered-list': {\n label: <NumberListIcon />,\n style: 'ordered-list-item',\n tooltip: 'styles.ordered_list_item',\n },\n});\n\nexport const InlineStylesList = Object.freeze({\n bold: {\n label: <BoldIcon />,\n style: 'BOLD',\n tooltip: 'styles.bold',\n hotKey: '(Ctrl+B)',\n },\n italic: {\n label: <ItalicIcon />,\n style: 'ITALIC',\n tooltip: 'styles.italic',\n hotKey: '(Ctrl+I)',\n },\n underline: {\n label: <UnderlineIcon />,\n style: 'UNDERLINE',\n tooltip: 'styles.underline',\n hotKey: '(Ctrl+U)',\n },\n});\n\nexport const MinifiedConfigTypes = Object.freeze({\n fontList: [\n { type: 'unstyled', label: 'styles.p', style: 'unstyled' },\n { type: 'header-two', label: 'styles.h1', style: 'header-two' },\n ],\n blockTypes: Object.values(EditorConfigTypes.BLOCK_TYPES),\n inlineStyles: [\n EditorConfigTypes.INLINE_STYLES.BOLD,\n EditorConfigTypes.INLINE_STYLES.ITALIC,\n ],\n});\nexport const decorator = new CompositeDecorator([\n {\n strategy: findLinkEntities,\n component: Link,\n },\n]);\n","import './styles.scss';\n\nimport React, { Component, createRef } from 'react';\nimport {\n Editor,\n EditorState,\n Modifier,\n RichUtils,\n getDefaultKeyBinding,\n} from 'draft-js';\nimport PropTypes from 'prop-types';\nimport cx from 'classnames';\nimport { Label } from '@entur/typography';\n\nimport BlockTypeSelectControls from './Controls/BlockTypeSelectControls';\nimport BlockTypeButtonControls from './Controls/BlockTypeButtonControls';\nimport BlockTypeLinkControls from './Controls/BlockTypeLinkControls';\nimport InlineStyleControls from './Controls/InlineStyleControls';\nimport TagControls from './Controls/TagControls';\nimport {\n BlockTypeList,\n EditorConfigTypes,\n FontList,\n InlineStylesList,\n decorator,\n} from './constants';\n\nclass RichTextEditor extends Component {\n static decorator = decorator;\n\n wrapperRef = createRef();\n editor = createRef();\n\n focusEditor() {\n this.editor.current && this.editor.current.focus();\n }\n\n handleKeyCommand = (command, editorState) => {\n const newState = RichUtils.handleKeyCommand(editorState, command);\n if (newState) {\n this.props.onChange(newState);\n return true;\n }\n return false;\n };\n\n keyBindingFn = (evt) => {\n switch (evt.keyCode) {\n case 9:\n return this.onTab(evt);\n default:\n return getDefaultKeyBinding(evt);\n }\n };\n\n onTab = (evt) => {\n evt.stopPropagation();\n const { maxTabDepth, editorState, onChange } = this.props;\n onChange(RichUtils.onTab(evt, editorState, maxTabDepth));\n };\n\n toggleButtonBlockType = (blockType) => {\n const { editorState, onChange } = this.props;\n onChange(RichUtils.toggleBlockType(editorState, blockType));\n };\n\n toggleSelectBlockType = (blockType) => {\n const { editorState, onChange } = this.props;\n onChange(RichUtils.toggleBlockType(editorState, blockType));\n };\n\n toggleInlineStyle = (inlineStyle) => {\n const { editorState, onChange } = this.props;\n onChange(RichUtils.toggleInlineStyle(editorState, inlineStyle));\n };\n\n toggleLink = (newEditorState, entityKey) => {\n this.props.onChange(\n RichUtils.toggleLink(\n newEditorState,\n newEditorState.getSelection(),\n entityKey\n )\n );\n };\n\n insertText = (editorState, text) => {\n const newContent = Modifier.insertText(\n editorState.getCurrentContent(),\n editorState.getSelection(),\n text\n );\n this.props.onChange(\n EditorState.push(editorState, newContent, 'insert-characters'),\n () => this.focusEditor()\n );\n };\n\n getFontListConfigForPanelType = (panelType) => {\n const controlConfig = this.getControlConfigBySet(\n this.props.controlConfigSet\n );\n return controlConfig[panelType];\n };\n\n getControlConfigBySet = (config) => {\n const fontList = ((config && config.fontList) || Object.keys(FontList))\n .filter((f) => (typeof f === 'object' ? FontList[f.type] : FontList[f]))\n .map((f) => (f.label && f.style ? f : FontList[f]));\n const blockTypes = (\n (config && config.blockTypes) ||\n Object.keys(BlockTypeList)\n )\n .filter((f) =>\n typeof f === 'object' ? BlockTypeList[f.type] : BlockTypeList[f]\n )\n .map((f) => (f.label && f.style ? f : BlockTypeList[f]));\n const inlineStyles = (\n (config && config.inlineStyles) ||\n Object.keys(InlineStylesList)\n )\n .filter((f) =>\n typeof f === 'object' ? InlineStylesList[f.type] : InlineStylesList[f]\n )\n .map((f) => (f.label && f.style ? f : InlineStylesList[f]));\n\n return {\n fontList,\n blockTypes,\n inlineStyles,\n };\n };\n\n render() {\n const {\n className,\n showFontMenu,\n showInlineStyleMenu,\n showTextFormatMenu,\n showLinkMenu,\n label,\n tags,\n editorState,\n onChange,\n handleBeforeInput,\n } = this.props;\n\n const classNames = cx('editor-root', className);\n\n return (\n <div ref={this.wrapperRef}>\n {label && <Label>{label}</Label>}\n\n <div className={classNames}>\n <div className=\"controls-wrapper\">\n {showFontMenu && (\n <BlockTypeSelectControls\n editorState={editorState}\n onToggle={this.toggleSelectBlockType}\n blockTypes={this.getFontListConfigForPanelType('fontList')}\n />\n )}\n {showInlineStyleMenu && (\n <InlineStyleControls\n editorState={editorState}\n onToggle={this.toggleInlineStyle}\n inlineStyles={this.getFontListConfigForPanelType(\n 'inlineStyles'\n )}\n />\n )}\n {showTextFormatMenu && (\n <BlockTypeButtonControls\n editorState={editorState}\n onToggle={this.toggleButtonBlockType}\n blockTypes={this.getFontListConfigForPanelType('blockTypes')}\n />\n )}\n {showLinkMenu && (\n <BlockTypeLinkControls\n editorState={editorState}\n onToggle={this.toggleLink}\n />\n )}\n {tags && tags.length > 0 && (\n <TagControls\n editorState={editorState}\n tags={tags}\n onInsertTag={this.insertText}\n />\n )}\n </div>\n\n <div className=\"editor-wrapper\">\n <Editor\n ref={this.editor}\n editorState={editorState}\n handleKeyCommand={this.handleKeyCommand}\n onChange={onChange}\n handleBeforeInput={handleBeforeInput}\n keyBindingFn={this.keyBindingFn}\n spellCheck\n />\n </div>\n </div>\n </div>\n );\n }\n}\n\nconst styleShape = (configList) =>\n PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.oneOf([...Object.values(configList)])),\n PropTypes.arrayOf(\n PropTypes.shape({\n type: PropTypes.oneOf([...Object.values(configList)]),\n label: PropTypes.string,\n style: PropTypes.string,\n tooltip: PropTypes.string,\n hotKey: PropTypes.string,\n })\n ),\n ]);\n\nRichTextEditor.propTypes = {\n editorState: PropTypes.object.isRequired,\n onChange: PropTypes.func.isRequired,\n maxTabDepth: PropTypes.number,\n showFontMenu: PropTypes.bool,\n showInlineStyleMenu: PropTypes.bool,\n showTextFormatMenu: PropTypes.bool,\n showLinkMenu: PropTypes.bool,\n label: PropTypes.string,\n tags: PropTypes.arrayOf(PropTypes.object),\n controlConfigSet: PropTypes.shape({\n fontList: styleShape(EditorConfigTypes.FONT_LIST),\n blockTypes: styleShape(EditorConfigTypes.BLOCK_TYPES),\n inlineStyles: styleShape(EditorConfigTypes.INLINE_STYLES),\n }),\n};\nRichTextEditor.defaultProps = {\n maxTabDepth: 4,\n showFontMenu: true,\n showInlineStyleMenu: true,\n showTextFormatMenu: true,\n showLinkMenu: true,\n label: '',\n};\n\nexport default RichTextEditor;\n","import { markdownToDraft, draftToMarkdown } from 'markdown-draft-js';\nimport { convertToRaw, convertFromRaw, EditorState } from 'draft-js';\nimport showdown from 'showdown';\n\nimport { decorator } from './constants';\n\nexport const editorStateToMarkdown = (editorState) => {\n const rawState = convertToRaw(editorState.getCurrentContent());\n return draftToMarkdown(rawState, { preserveNewlines: true });\n};\n\nexport const markdownToEditorState = (markdown) => {\n if (!markdown) {\n return EditorState.createEmpty(decorator);\n }\n const rawState = markdownToDraft(markdown, { preserveNewlines: true });\n const contentState = convertFromRaw(rawState);\n return EditorState.createWithContent(contentState, decorator);\n};\n\nconst converter = new showdown.Converter({\n underline: true,\n});\n\nexport const markdownToHtml = (markdown) => {\n return converter.makeHtml(markdown);\n};\n","import React, { useState } from 'react';\nimport { EditorState } from 'draft-js';\nimport { ExpandablePanel } from '@entur/expand';\nimport {\n LanguageKey,\n LanguageOption,\n MultiLanguageValues,\n Stack,\n} from '@entur-partner/common';\nimport { FeedbackText, VariantType } from '@entur/form';\n\nimport {\n editorStateToMarkdown,\n markdownToEditorState,\n} from './RichTextEditor/markdownConvertion';\nimport RichTextEditor from './RichTextEditor';\nimport { MinifiedConfigTypes } from './RichTextEditor/constants';\n\ntype MultiLanguageInputProps = {\n values: MultiLanguageValues;\n onChange: (values: MultiLanguageValues) => void;\n variant?: (lang: LanguageKey) => VariantType;\n feedback?: (lang: LanguageKey) => string;\n tags?: {\n tag: string;\n delimiter: string;\n label: string;\n }[];\n};\n\ntype RichTextEditorForLanguageProps = MultiLanguageInputProps & {\n language: LanguageOption;\n};\n\nconst RichTextEditorForLanguage = ({\n language: { value: langKey, label, required },\n values,\n onChange,\n variant,\n feedback,\n tags,\n}: RichTextEditorForLanguageProps) => {\n const [editorState, setEditorState] = useState<EditorState>(\n markdownToEditorState(values[langKey])\n );\n\n const handleOnChange = (changedState: EditorState) => {\n const newValues = { ...values };\n const content = editorStateToMarkdown(changedState);\n if (values[langKey] && content === '\\n') {\n delete newValues[langKey];\n } else {\n newValues[langKey] = content;\n }\n\n setEditorState(changedState);\n onChange(newValues);\n };\n\n const feedbackText = feedback && feedback(langKey);\n\n return (\n <>\n <RichTextEditor\n label={required ? label + '*' : label}\n editorState={editorState}\n onChange={(changedState: EditorState) => handleOnChange(changedState)}\n controlConfigSet={MinifiedConfigTypes}\n tags={tags}\n />\n {variant && feedbackText?.length! > 0 && (\n <FeedbackText variant={variant(langKey)}>{feedbackText}</FeedbackText>\n )}\n </>\n );\n};\n\ntype ExpandableMultiLanguageRichTextEditorProps = MultiLanguageInputProps & {\n name: string;\n title: string;\n languages: LanguageOption[];\n};\n\nexport const ExpandableMultiLanguageRichTextEditor = ({\n name,\n title,\n languages,\n ...rest\n}: ExpandableMultiLanguageRichTextEditorProps) => (\n <ExpandablePanel\n title={title}\n defaultOpen\n contentStyle={{\n padding: '4px 4px 4px 4px',\n marginTop: '16px',\n marginBottom: '16px',\n }}\n >\n <Stack space=\"medium\">\n {languages.map((lang) => (\n <div\n key={name + lang.value}\n data-testid={`multi-lang-rich-text-${name}-${lang.value}`}\n >\n <RichTextEditorForLanguage language={lang} {...rest} />\n </div>\n ))}\n </Stack>\n </ExpandablePanel>\n);\n","import React from 'react';\nimport { EditorState } from 'draft-js';\nimport { convertFromHTML, convertToHTML } from 'draft-convert';\n\nimport { HtmlLink } from './Link';\nimport { decorator } from './constants';\n\n/* eslint-disable react/display-name */\n\nexport const entityToHtml = {\n entityToHTML: (entity, originalText) => {\n if (entity.type === 'LINK') {\n return <HtmlLink url={entity.data.url}>{originalText}</HtmlLink>;\n }\n return originalText;\n },\n};\n\nexport const htmlToEntity = {\n htmlToEntity: (nodeName, node, createEntity) => {\n if (nodeName === 'a') {\n return createEntity('LINK', 'MUTABLE', { url: node.href });\n }\n },\n};\n\n/* eslint-disable react/display-name */\n\nexport const htmlToEditorState = (html) => {\n if (!html) {\n return EditorState.createEmpty(decorator);\n }\n const rawState = convertFromHTML(htmlToEntity)(html);\n return EditorState.createWithContent(rawState, decorator);\n};\n\nexport const editorStateToHtml = (editorState) => {\n return convertToHTML(entityToHtml)(editorState.getCurrentContent());\n};\n"],"names":["withI18n","Component","props","t","_useTranslation","useTranslation","language","i18n","Error","useI18N","React","createElement","_extends","BlockTypeDropdown$1","_Component","BlockTypeDropdown","_this","_len","arguments","length","args","Array","_key","call","apply","this","concat","handleOnClick","selectedOption","onChange","_inheritsLoose","_proto","prototype","toItem","option","value","style","label","renderFormattedLabel","formattedLabelText","className","render","_this2","_this$props","selected","Dropdown","items","options","map","selectedItem","BlockTypeControls","_ref","editorState","blockTypes","onToggle","selection","getSelection","blockTypeStyle","getCurrentContent","getBlockForKey","getStartKey","getType","find","Key","Object","freeze","ENTER","getKey","event","keyCode","which","StyleButton$1","StyleButton","e","preventDefault","onToggleNoEvent","_this$props2","_this$props3","title","hotKey","classNames","cx","active","onMouseDown","tabIndex","onKeyPress","BlockTypeButtonControls","type","i","key","tooltip","BlockTypeLinkControls","state","urlValue","showUrlInput","hasLink","onUrlChange","setState","target","addLink","isCollapsed","currentContent","startKey","startOffset","getStartOffset","linkKey","getEntityAt","url","getEntity","getData","confirmLink","contentStateWithEntity","createEntity","entityKey","getLastCreatedEntityKey","EditorState","set","cancelLink","onLinkInputKeyDown","removeLink","_this$state","onClick","LinkIcon","CloseIcon","TextField","width","margin","onKeyDown","placeholder","SecondarySquareButton","CheckIcon","height","Unbutton","UnlinkIcon","propTypes","PropTypes","object","func","BlockTypeLinkControls$1","InlineStyleControls","inlineStyles","currentStyle","getCurrentInlineStyle","has","TagControls","tagControlRef","createRef","isOpen","handleClickOutside","current","contains","handleTagClick","tag","delimiter","onInsertTag","delimiterStart","componentDidMount","document","addEventListener","componentWillUnmount","removeEventListener","menuItems","tags","OverflowMenuItem","id","icon","ref","DownArrowIcon","inline","Popover","open","OverflowMenu","arrayOf","isRequired","TagControls$1","HtmlLink","href","children","EditorConfigTypes","FONT_LIST","UNSTYLED","HEADER_ONE","HEADER_TWO","HEADER_THREE","HEADER_FOUR","HEADER_FIVE","HEADER_SIX","BLOCK_TYPES","UNORDERED_LIST","ORDERED_LIST","INLINE_STYLES","BOLD","ITALIC","UNDERLINE","FontList","unstyled","BlockTypeList","BulletListIcon","NumberListIcon","InlineStylesList","bold","BoldIcon","italic","ItalicIcon","underline","UnderlineIcon","MinifiedConfigTypes","fontList","values","decorator","CompositeDecorator","strategy","contentBlock","callback","contentState","findEntityRanges","character","component","_props$contentState$g","RichTextEditor","wrapperRef","editor","handleKeyCommand","command","newState","RichUtils","keyBindingFn","evt","onTab","getDefaultKeyBinding","stopPropagation","maxTabDepth","toggleButtonBlockType","blockType","toggleBlockType","toggleSelectBlockType","toggleInlineStyle","inlineStyle","_this$props4","toggleLink","newEditorState","insertText","text","newContent","Modifier","push","focusEditor","getFontListConfigForPanelType","panelType","getControlConfigBySet","controlConfigSet","config","keys","filter","f","focus","_this$props5","showFontMenu","showInlineStyleMenu","showTextFormatMenu","showLinkMenu","handleBeforeInput","Label","BlockTypeSelectControls","Editor","spellCheck","styleShape","configList","oneOfType","oneOf","shape","string","number","bool","defaultProps","editorStateToMarkdown","rawState","convertToRaw","draftToMarkdown","preserveNewlines","markdownToEditorState","markdown","createEmpty","markdownToDraft","convertFromRaw","createWithContent","converter","showdown","Converter","RichTextEditorForLanguage","_ref$language","langKey","required","variant","feedback","_useState","useState","setEditorState","feedbackText","Fragment","changedState","newValues","content","handleOnChange","FeedbackText","entityToHtml","entityToHTML","entity","originalText","data","htmlToEntity","nodeName","node","_ref2","name","languages","rest","_objectWithoutPropertiesLoose","_excluded","ExpandablePanel","defaultOpen","contentStyle","padding","marginTop","marginBottom","Stack","space","lang","convertToHTML","html","convertFromHTML","makeHtml"],"mappings":"siCAqBO,SAASA,EAASC,GACvB,OAAO,SAA0BC,GAC/B,IAAMC,EApBV,WACE,IAAAC,EAGIC,EAAAA,iBAFFF,EAACC,EAADD,EACQG,EAAQF,EAAhBG,KAAQD,SAGV,GACe,OAAbA,GACa,OAAbA,GACa,UAAbA,GACa,UAAbA,EAEA,MAAME,MAAM,qCAGd,OAAOL,CACT,CAIc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AA,QAAAC,cAAA,MAAA,CACE8E,IAAKiO,EAAOa,EAAKpS,MACJ,cAAwBuR,wBAAAA,EAAQa,IAAAA,EAAKpS,OAElDzB,UAAAC,cAACsR,EAAyBrR,EAAA,CAACN,SAAUiU,GAAUX,IAElD,KAEa,mFCxEa,SAACxQ,GAChC,OAAOoR,EAAaA,cAACvB,EAAduB,CAA4BpR,EAAYM,oBACjD,4DAViC,SAAC+Q,GAChC,IAAKA,EACH,OAAOtN,EAAWA,YAACuK,YAAYzE,GAEjC,IAAMmE,EAAWsD,EAAeA,gBAACpB,EAAhBoB,CAA8BD,GAC/C,OAAOtN,cAAY0K,kBAAkBT,EAAUnE,EACjD,yDFV8B,SAACwE,GAC7B,OAAOK,EAAU6C,SAASlD,EAC5B"}
|
|
1
|
+
{"version":3,"file":"rich-text-editor.cjs.production.min.js","sources":["../src/events.js","../src/withI18n.js","../src/RichTextEditor/StyleButton/index.js","../src/RichTextEditor/Controls/BlockTypeButtonControls.js","../src/RichTextEditor/Controls/BlockTypeLinkControls.js","../src/RichTextEditor/BlockTypeDropdown/index.js","../src/RichTextEditor/Controls/BlockTypeSelectControls.js","../src/RichTextEditor/Controls/InlineStyleControls.js","../src/RichTextEditor/Controls/TagControls.js","../src/RichTextEditor/Link/index.js","../src/RichTextEditor/constants.js","../src/RichTextEditor/index.js","../src/RichTextEditor/markdownConvertion.js","../src/ExpandableMultiLanguageRichTextEditor.tsx","../src/RichTextEditor/htmlConvertion.js"],"sourcesContent":["export const Key = Object.freeze({\n\tENTER: 13,\n});\n\nexport function getKey(event) {\n\treturn event.keyCode || event.which;\n}\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nfunction useI18N() {\n\tconst {\n\t\tt,\n\t\ti18n: { language },\n\t} = useTranslation();\n\n\tif (\n\t\tlanguage !== \"nb\" &&\n\t\tlanguage !== \"en\" &&\n\t\tlanguage !== \"nb-NO\" &&\n\t\tlanguage !== \"en-GB\"\n\t) {\n\t\tthrow Error(\"Language must be either nb or en.\");\n\t}\n\n\treturn t;\n}\n\nexport function withI18n(Component) {\n\treturn function WrappedComponent(props) {\n\t\tconst t = useI18N();\n\t\treturn <Component {...props} i18n={t} />;\n\t};\n}\n","import \"./styles.scss\";\n\nimport cx from \"classnames\";\nimport React, { Component } from \"react\";\nimport { getKey, Key } from \"../../events\";\nimport { withI18n } from \"../../withI18n\";\n\nclass StyleButton extends Component {\n\tonToggle = (e) => {\n\t\tconst { style, onToggle } = this.props;\n\t\te.preventDefault();\n\t\tonToggle(style);\n\t};\n\n\tonToggleNoEvent = () => {\n\t\tconst { style, onToggle } = this.props;\n\t\tonToggle(style);\n\t};\n\n\trender() {\n\t\tconst { i18n, active, label, title, hotKey } = this.props;\n\n\t\tconst classNames = cx(\"editor-stylebutton\", { active });\n\n\t\treturn (\n\t\t\t// biome-ignore lint/a11y/noStaticElementInteractions: Ignore for now.\n\t\t\t<div\n\t\t\t\tclassName={classNames}\n\t\t\t\tonMouseDown={this.onToggle}\n\t\t\t\ttitle={i18n(title) + hotKey}\n\t\t\t\t// biome-ignore lint/a11y/noNoninteractiveTabindex: Ignore for now.\n\t\t\t\ttabIndex={0}\n\t\t\t\tonKeyPress={(event) => {\n\t\t\t\t\tif (getKey(event) === Key.ENTER) {\n\t\t\t\t\t\tthis.onToggleNoEvent();\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{label}\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nexport default withI18n(StyleButton);\n","import \"./styles.scss\";\n\nimport React from \"react\";\n\nimport StyleButton from \"../StyleButton\";\n\nconst BlockTypeButtonControls = (props) => {\n\tconst { editorState, blockTypes, onToggle } = props;\n\tconst selection = editorState.getSelection();\n\tconst blockTypeStyle = editorState\n\t\t.getCurrentContent()\n\t\t.getBlockForKey(selection.getStartKey())\n\t\t.getType();\n\n\treturn (\n\t\t<div className=\"controls-group block-editor-controls\">\n\t\t\t{blockTypes.map((type) => (\n\t\t\t\t<StyleButton\n\t\t\t\t\tkey={type.style + type.label}\n\t\t\t\t\tactive={type.style === blockTypeStyle}\n\t\t\t\t\tlabel={type.label}\n\t\t\t\t\tonToggle={onToggle}\n\t\t\t\t\tstyle={type.style}\n\t\t\t\t\ttitle={type.tooltip}\n\t\t\t\t/>\n\t\t\t))}\n\t\t</div>\n\t);\n};\n\nexport default BlockTypeButtonControls;\n","/** biome-ignore-all lint/a11y/noStaticElementInteractions: Ignore for now. */\n/** biome-ignore-all lint/a11y/noNoninteractiveTabindex: Ignore for now. */\n/** biome-ignore-all lint/a11y/useKeyWithClickEvents: Ignore for now. */\nimport \"./styles.scss\";\n\nimport { SecondarySquareButton } from \"@entur/button\";\nimport { TextField } from \"@entur/form\";\nimport { CheckIcon, CloseIcon, LinkIcon, UnlinkIcon } from \"@entur/icons\";\nimport { Unbutton } from \"@entur-partner/common\";\nimport { EditorState } from \"draft-js\";\nimport PropTypes from \"prop-types\";\nimport React, { Component } from \"react\";\nimport { getKey, Key } from \"../../events\";\nimport { withI18n } from \"../../withI18n\";\n\nclass BlockTypeLinkControls extends Component {\n\tstate = {\n\t\turlValue: \"\",\n\t\tshowUrlInput: false,\n\t\thasLink: false,\n\t};\n\n\tonUrlChange = (e) => {\n\t\tthis.setState({ urlValue: e.target.value });\n\t};\n\n\taddLink = (e) => {\n\t\te.preventDefault();\n\t\tconst { editorState } = this.props;\n\t\tconst selection = editorState.getSelection();\n\t\tif (!selection.isCollapsed()) {\n\t\t\tconst currentContent = editorState.getCurrentContent();\n\t\t\tconst startKey = selection.getStartKey();\n\t\t\tconst startOffset = selection.getStartOffset();\n\t\t\tconst blockWithLinkAtBeginning = currentContent.getBlockForKey(startKey);\n\t\t\tconst linkKey = blockWithLinkAtBeginning.getEntityAt(startOffset);\n\n\t\t\tlet url = \"\";\n\t\t\tif (linkKey) {\n\t\t\t\tconst linkInstance = currentContent.getEntity(linkKey);\n\t\t\t\turl = linkInstance.getData().url;\n\t\t\t}\n\n\t\t\tthis.setState({\n\t\t\t\tshowUrlInput: true,\n\t\t\t\turlValue: url,\n\t\t\t\thasLink: !!url,\n\t\t\t});\n\t\t}\n\t};\n\n\tconfirmLink = (e) => {\n\t\te.preventDefault();\n\t\tconst { urlValue } = this.state;\n\t\tconst { editorState, onToggle } = this.props;\n\t\tconst contentState = editorState.getCurrentContent();\n\t\tconst contentStateWithEntity = contentState.createEntity(\n\t\t\t\"LINK\",\n\t\t\t\"MUTABLE\",\n\t\t\t{ url: urlValue },\n\t\t);\n\t\tconst entityKey = contentStateWithEntity.getLastCreatedEntityKey();\n\t\tconst newEditorState = EditorState.set(editorState, {\n\t\t\tcurrentContent: contentStateWithEntity,\n\t\t});\n\t\tonToggle(newEditorState, entityKey);\n\t\tthis.setState({\n\t\t\tshowUrlInput: false,\n\t\t\turlValue: \"\",\n\t\t});\n\t};\n\n\tcancelLink = (e) => {\n\t\te.preventDefault();\n\t\tthis.setState({\n\t\t\tshowUrlInput: false,\n\t\t\turlValue: \"\",\n\t\t});\n\t};\n\n\tonLinkInputKeyDown = (e) => {\n\t\tif (getKey(e) === Key.ENTER) {\n\t\t\tthis.confirmLink(e);\n\t\t}\n\t};\n\n\tremoveLink = (e) => {\n\t\te.preventDefault();\n\t\tconst { editorState, onToggle } = this.props;\n\t\tconst { hasLink } = this.state;\n\t\tconst selection = editorState.getSelection();\n\t\tif (!selection.isCollapsed() && hasLink) {\n\t\t\tonToggle(editorState, null);\n\t\t\tthis.setState({\n\t\t\t\tshowUrlInput: false,\n\t\t\t});\n\t\t}\n\t};\n\n\trender() {\n\t\tconst { i18n } = this.props;\n\t\tconst { showUrlInput, hasLink } = this.state;\n\t\treturn (\n\t\t\t<div className=\"controls-group block-editor-controls link-controls\">\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"editor-stylebutton\"\n\t\t\t\t\ttitle={i18n(\"styles.link\")}\n\t\t\t\t\tonClick={this.addLink}\n\t\t\t\t\ttabIndex={0}\n\t\t\t\t>\n\t\t\t\t\t<LinkIcon />\n\t\t\t\t</div>\n\n\t\t\t\t{showUrlInput && (\n\t\t\t\t\t<div className=\"url-input-container\">\n\t\t\t\t\t\t<span className=\"exit-button\" onMouseDown={this.cancelLink}>\n\t\t\t\t\t\t\t<CloseIcon />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<div className=\"link-label\">{i18n(\"common.from\")}</div>\n\t\t\t\t\t\t<div className=\"url-input-form\">\n\t\t\t\t\t\t\t<TextField\n\t\t\t\t\t\t\t\tstyle={{ width: 250, margin: 5 }}\n\t\t\t\t\t\t\t\tonChange={this.onUrlChange}\n\t\t\t\t\t\t\t\tvalue={this.state.urlValue}\n\t\t\t\t\t\t\t\tonKeyDown={this.onLinkInputKeyDown}\n\t\t\t\t\t\t\t\tplaceholder=\"https://example.com\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<SecondarySquareButton onMouseDown={this.confirmLink}>\n\t\t\t\t\t\t\t\t<CheckIcon width={15} height={15} />\n\t\t\t\t\t\t\t</SecondarySquareButton>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{hasLink && (\n\t\t\t\t\t\t\t<div className=\"remove-link\">\n\t\t\t\t\t\t\t\t<Unbutton\n\t\t\t\t\t\t\t\t\tonClick={this.removeLink}\n\t\t\t\t\t\t\t\t\ttitle={i18n(\"styles.unlink\")}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<UnlinkIcon />\n\t\t\t\t\t\t\t\t\t{i18n(\"styles.unlink\")}\n\t\t\t\t\t\t\t\t</Unbutton>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t}\n}\nBlockTypeLinkControls.propTypes = {\n\teditorState: PropTypes.object,\n\tonToggle: PropTypes.func,\n};\n\nexport default withI18n(BlockTypeLinkControls);\n","import \"./styles.scss\";\n\nimport { Dropdown } from \"@entur/dropdown\";\nimport React, { Component } from \"react\";\n\nimport { withI18n } from \"../../withI18n\";\n\nclass BlockTypeDropdown extends Component {\n\thandleOnClick = (selectedOption) => {\n\t\tconst { onChange } = this.props;\n\t\tonChange(selectedOption);\n\t};\n\n\ttoItem(option) {\n\t\treturn {\n\t\t\tvalue: option.style,\n\t\t\tlabel: this.renderFormattedLabel(option.label),\n\t\t};\n\t}\n\n\trenderFormattedLabel(label) {\n\t\tconst formattedLabelText = this.props.i18n(label);\n\t\tswitch (label) {\n\t\t\tcase \"styles.p\":\n\t\t\t\treturn <div className=\"default-p\">{formattedLabelText}</div>;\n\t\t\tcase \"styles.h1\":\n\t\t\t\treturn <div className=\"default-h1\">{formattedLabelText}</div>;\n\t\t\tcase \"styles.h2\":\n\t\t\t\treturn <div className=\"default-h2\">{formattedLabelText}</div>;\n\t\t\tcase \"styles.h3\":\n\t\t\t\treturn <div className=\"default-h3\">{formattedLabelText}</div>;\n\t\t\tcase \"styles.h4\":\n\t\t\t\treturn <div className=\"default-h4\">{formattedLabelText}</div>;\n\t\t\tcase \"styles.h5\":\n\t\t\t\treturn <div className=\"default-h5\">{formattedLabelText}</div>;\n\t\t\tcase \"styles.h6\":\n\t\t\t\treturn <div className=\"default-h6\">{formattedLabelText}</div>;\n\t\t\tdefault:\n\t\t\t\treturn <p>{formattedLabelText}</p>;\n\t\t}\n\t}\n\n\trender() {\n\t\tconst { options, selected, i18n } = this.props;\n\n\t\treturn (\n\t\t\t<Dropdown\n\t\t\t\tclassName=\"block-type-dropdown\"\n\t\t\t\titems={options.map((option) => this.toItem(option))}\n\t\t\t\tselectedItem={this.toItem(selected)}\n\t\t\t\tlabel={i18n(\"styles.style\")}\n\t\t\t\tonChange={(selectedItem) => this.handleOnClick(selectedItem.value)}\n\t\t\t/>\n\t\t);\n\t}\n}\n\nexport default withI18n(BlockTypeDropdown);\n","import \"./styles.scss\";\n\nimport React from \"react\";\n\nimport BlockTypeDropdown from \"../BlockTypeDropdown\";\n\nconst BlockTypeControls = ({ editorState, blockTypes, onToggle }) => {\n\tconst selection = editorState.getSelection();\n\tconst blockTypeStyle = editorState\n\t\t.getCurrentContent()\n\t\t.getBlockForKey(selection.getStartKey())\n\t\t.getType();\n\n\tconst selectedOption =\n\t\tblockTypes.find((option) => option.style === blockTypeStyle) ||\n\t\tblockTypes[0];\n\n\treturn (\n\t\t<BlockTypeDropdown\n\t\t\toptions={blockTypes}\n\t\t\tselected={selectedOption}\n\t\t\tonChange={onToggle}\n\t\t/>\n\t);\n};\n\nexport default BlockTypeControls;\n","import \"./styles.scss\";\n\nimport React from \"react\";\n\nimport StyleButton from \"../StyleButton\";\n\nconst InlineStyleControls = (props) => {\n\tconst { editorState, inlineStyles } = props;\n\n\tconst currentStyle = editorState.getCurrentInlineStyle();\n\n\treturn (\n\t\t<div className=\"controls-group inline-editor-controls\">\n\t\t\t{inlineStyles.map((type) => (\n\t\t\t\t<StyleButton\n\t\t\t\t\tkey={type.style + type.label}\n\t\t\t\t\tactive={currentStyle.has(type.style)}\n\t\t\t\t\tlabel={type.label}\n\t\t\t\t\tonToggle={props.onToggle}\n\t\t\t\t\tstyle={type.style}\n\t\t\t\t\ttitle={type.tooltip}\n\t\t\t\t\thotKey={type.hotKey}\n\t\t\t\t/>\n\t\t\t))}\n\t\t</div>\n\t);\n};\n\nexport default InlineStyleControls;\n","import \"./styles.scss\";\n\nimport { DownArrowIcon } from \"@entur/icons\";\nimport { OverflowMenu, OverflowMenuItem } from \"@entur/menu\";\nimport { Popover } from \"@entur/tooltip\";\nimport PropTypes from \"prop-types\";\nimport React, { Component, createRef } from \"react\";\n\nimport { withI18n } from \"../../withI18n\";\n\nclass TagControls extends Component {\n\ttagControlRef = createRef();\n\tstate = { isOpen: false };\n\n\tcomponentDidMount() {\n\t\tdocument.addEventListener(\"mousedown\", this.handleClickOutside);\n\t}\n\n\tcomponentWillUnmount() {\n\t\tdocument.removeEventListener(\"mousedown\", this.handleClickOutside);\n\t}\n\n\thandleClickOutside = (e) => {\n\t\tif (\n\t\t\tthis.tagControlRef.current &&\n\t\t\t!this.tagControlRef.current.contains(e.target)\n\t\t) {\n\t\t\tthis.setState({ isOpen: false });\n\t\t}\n\t};\n\n\thandleTagClick = (tag, delimiter) => {\n\t\tconst { editorState, onInsertTag } = this.props;\n\t\tconst delimiterStart = delimiter[0];\n\t\tconst delimiterEnd = delimiter[1];\n\t\tconst fullTag = `${delimiterStart}${tag}${delimiterEnd}`;\n\t\tonInsertTag(editorState, fullTag);\n\t};\n\n\trender() {\n\t\tconst { i18n, tags } = this.props;\n\t\tconst { isOpen } = this.state;\n\t\tconst menuItems = tags.map((tag) => {\n\t\t\tconst delimiter = tag.delimiter || \"{}\";\n\t\t\treturn (\n\t\t\t\t<OverflowMenuItem\n\t\t\t\t\tkey={tag.tag}\n\t\t\t\t\tclassName=\"tag-control\"\n\t\t\t\t\tid={`tag-control-${tag.tag}`}\n\t\t\t\t\tonClick={() => this.handleTagClick(tag.tag, delimiter)}\n\t\t\t\t>\n\t\t\t\t\t{tag.icon}\n\t\t\t\t\t<span className=\"tag-control-text\">{tag.label}</span>\n\t\t\t\t</OverflowMenuItem>\n\t\t\t);\n\t\t});\n\n\t\treturn (\n\t\t\t<div className=\"tag-control-dropdown\" ref={this.tagControlRef}>\n\t\t\t\t{/** biome-ignore lint/a11y/noStaticElementInteractions: Ignore for now. */}\n\t\t\t\t{/** biome-ignore lint/a11y/useKeyWithClickEvents: Ignore for now. */}\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"tag-control-header\"\n\t\t\t\t\tonClick={() => this.setState(({ isOpen }) => ({ isOpen: !isOpen }))}\n\t\t\t\t>\n\t\t\t\t\t{i18n(\"common.insert\")}\n\t\t\t\t\t<DownArrowIcon className=\"tag-control-chevron\" inline />\n\t\t\t\t</div>\n\t\t\t\t<Popover open={isOpen} className=\"tag-control-content\">\n\t\t\t\t\t<OverflowMenu className=\"action-menu\">{menuItems}</OverflowMenu>\n\t\t\t\t</Popover>\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nTagControls.propTypes = {\n\teditorState: PropTypes.object,\n\ttags: PropTypes.arrayOf(PropTypes.object).isRequired,\n\tonInsertTag: PropTypes.func.isRequired,\n};\n\nexport default withI18n(TagControls);\n","import React from \"react\";\n\nexport const HtmlLink = ({ url, children }) => {\n\treturn <a href={url}>{children}</a>;\n};\n\nconst Link = (props) => {\n\tconst { url } = props.contentState.getEntity(props.entityKey).getData();\n\treturn <HtmlLink url={url}>{props.children}</HtmlLink>;\n};\n\nexport function findLinkEntities(contentBlock, callback, contentState) {\n\tcontentBlock.findEntityRanges((character) => {\n\t\tconst entityKey = character.getEntity();\n\t\treturn (\n\t\t\tentityKey !== null &&\n\t\t\tcontentState.getEntity(entityKey).getType() === \"LINK\"\n\t\t);\n\t}, callback);\n}\n\nexport default Link;\n","import {\n\tBoldIcon,\n\tBulletListIcon,\n\tItalicIcon,\n\tNumberListIcon,\n\tUnderlineIcon,\n} from \"@entur/icons\";\nimport { CompositeDecorator } from \"draft-js\";\nimport React from \"react\";\n\nimport Link, { findLinkEntities } from \"./Link\";\n\nexport const EditorConfigTypes = Object.freeze({\n\tFONT_LIST: {\n\t\tUNSTYLED: \"unstyled\",\n\t\tHEADER_ONE: \"header-one\",\n\t\tHEADER_TWO: \"header-two\",\n\t\tHEADER_THREE: \"header-three\",\n\t\tHEADER_FOUR: \"header-four\",\n\t\tHEADER_FIVE: \"header-five\",\n\t\tHEADER_SIX: \"header-six\",\n\t},\n\tBLOCK_TYPES: {\n\t\tUNORDERED_LIST: \"unordered-list\",\n\t\tORDERED_LIST: \"ordered-list\",\n\t},\n\tINLINE_STYLES: {\n\t\tBOLD: \"bold\",\n\t\tITALIC: \"italic\",\n\t\tUNDERLINE: \"underline\",\n\t},\n});\n\nexport const FontList = Object.freeze({\n\tunstyled: { label: \"styles.p\", style: \"unstyled\" },\n\t\"header-one\": { label: \"styles.h1\", style: \"header-one\" },\n\t\"header-two\": { label: \"styles.h2\", style: \"header-two\" },\n\t\"header-three\": { label: \"styles.h3\", style: \"header-three\" },\n\t\"header-four\": { label: \"styles.h4\", style: \"header-four\" },\n\t\"header-five\": { label: \"styles.h5\", style: \"header-five\" },\n\t\"header-six\": { label: \"styles.h6\", style: \"header-six\" },\n});\n\nexport const BlockTypeList = Object.freeze({\n\t\"unordered-list\": {\n\t\tlabel: <BulletListIcon />,\n\t\tstyle: \"unordered-list-item\",\n\t\ttooltip: \"styles.unordered_list_item\",\n\t},\n\t\"ordered-list\": {\n\t\tlabel: <NumberListIcon />,\n\t\tstyle: \"ordered-list-item\",\n\t\ttooltip: \"styles.ordered_list_item\",\n\t},\n});\n\nexport const InlineStylesList = Object.freeze({\n\tbold: {\n\t\tlabel: <BoldIcon />,\n\t\tstyle: \"BOLD\",\n\t\ttooltip: \"styles.bold\",\n\t\thotKey: \"(Ctrl+B)\",\n\t},\n\titalic: {\n\t\tlabel: <ItalicIcon />,\n\t\tstyle: \"ITALIC\",\n\t\ttooltip: \"styles.italic\",\n\t\thotKey: \"(Ctrl+I)\",\n\t},\n\tunderline: {\n\t\tlabel: <UnderlineIcon />,\n\t\tstyle: \"UNDERLINE\",\n\t\ttooltip: \"styles.underline\",\n\t\thotKey: \"(Ctrl+U)\",\n\t},\n});\n\nexport const MinifiedConfigTypes = Object.freeze({\n\tfontList: [\n\t\t{ type: \"unstyled\", label: \"styles.p\", style: \"unstyled\" },\n\t\t{ type: \"header-two\", label: \"styles.h1\", style: \"header-two\" },\n\t],\n\tblockTypes: Object.values(EditorConfigTypes.BLOCK_TYPES),\n\tinlineStyles: [\n\t\tEditorConfigTypes.INLINE_STYLES.BOLD,\n\t\tEditorConfigTypes.INLINE_STYLES.ITALIC,\n\t],\n});\nexport const decorator = new CompositeDecorator([\n\t{\n\t\tstrategy: findLinkEntities,\n\t\tcomponent: Link,\n\t},\n]);\n","import \"./styles.scss\";\n\nimport { Label } from \"@entur/typography\";\nimport cx from \"classnames\";\nimport {\n\tEditor,\n\tEditorState,\n\tgetDefaultKeyBinding,\n\tModifier,\n\tRichUtils,\n} from \"draft-js\";\nimport PropTypes from \"prop-types\";\nimport React, { Component, createRef } from \"react\";\nimport BlockTypeButtonControls from \"./Controls/BlockTypeButtonControls\";\nimport BlockTypeLinkControls from \"./Controls/BlockTypeLinkControls\";\nimport BlockTypeSelectControls from \"./Controls/BlockTypeSelectControls\";\nimport InlineStyleControls from \"./Controls/InlineStyleControls\";\nimport TagControls from \"./Controls/TagControls\";\nimport {\n\tBlockTypeList,\n\tdecorator,\n\tEditorConfigTypes,\n\tFontList,\n\tInlineStylesList,\n} from \"./constants\";\n\nclass RichTextEditor extends Component {\n\tstatic decorator = decorator;\n\n\twrapperRef = createRef();\n\teditor = createRef();\n\n\tfocusEditor() {\n\t\tthis.editor.current?.focus();\n\t}\n\n\thandleKeyCommand = (command, editorState) => {\n\t\tconst newState = RichUtils.handleKeyCommand(editorState, command);\n\t\tif (newState) {\n\t\t\tthis.props.onChange(newState);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t};\n\n\tkeyBindingFn = (evt) => {\n\t\tswitch (evt.keyCode) {\n\t\t\tcase 9:\n\t\t\t\treturn this.onTab(evt);\n\t\t\tdefault:\n\t\t\t\treturn getDefaultKeyBinding(evt);\n\t\t}\n\t};\n\n\tonTab = (evt) => {\n\t\tevt.stopPropagation();\n\t\tconst { maxTabDepth, editorState, onChange } = this.props;\n\t\tonChange(RichUtils.onTab(evt, editorState, maxTabDepth));\n\t};\n\n\ttoggleButtonBlockType = (blockType) => {\n\t\tconst { editorState, onChange } = this.props;\n\t\tonChange(RichUtils.toggleBlockType(editorState, blockType));\n\t};\n\n\ttoggleSelectBlockType = (blockType) => {\n\t\tconst { editorState, onChange } = this.props;\n\t\tonChange(RichUtils.toggleBlockType(editorState, blockType));\n\t};\n\n\ttoggleInlineStyle = (inlineStyle) => {\n\t\tconst { editorState, onChange } = this.props;\n\t\tonChange(RichUtils.toggleInlineStyle(editorState, inlineStyle));\n\t};\n\n\ttoggleLink = (newEditorState, entityKey) => {\n\t\tthis.props.onChange(\n\t\t\tRichUtils.toggleLink(\n\t\t\t\tnewEditorState,\n\t\t\t\tnewEditorState.getSelection(),\n\t\t\t\tentityKey,\n\t\t\t),\n\t\t);\n\t};\n\n\tinsertText = (editorState, text) => {\n\t\tconst newContent = Modifier.insertText(\n\t\t\teditorState.getCurrentContent(),\n\t\t\teditorState.getSelection(),\n\t\t\ttext,\n\t\t);\n\t\tthis.props.onChange(\n\t\t\tEditorState.push(editorState, newContent, \"insert-characters\"),\n\t\t\t() => this.focusEditor(),\n\t\t);\n\t};\n\n\tgetFontListConfigForPanelType = (panelType) => {\n\t\tconst controlConfig = this.getControlConfigBySet(\n\t\t\tthis.props.controlConfigSet,\n\t\t);\n\t\treturn controlConfig[panelType];\n\t};\n\n\tgetControlConfigBySet = (config) => {\n\t\tconst fontList = (config?.fontList || Object.keys(FontList))\n\t\t\t.filter((f) => (typeof f === \"object\" ? FontList[f.type] : FontList[f]))\n\t\t\t.map((f) => (f.label && f.style ? f : FontList[f]));\n\t\tconst blockTypes = (config?.blockTypes || Object.keys(BlockTypeList))\n\t\t\t.filter((f) =>\n\t\t\t\ttypeof f === \"object\" ? BlockTypeList[f.type] : BlockTypeList[f],\n\t\t\t)\n\t\t\t.map((f) => (f.label && f.style ? f : BlockTypeList[f]));\n\t\tconst inlineStyles = (config?.inlineStyles || Object.keys(InlineStylesList))\n\t\t\t.filter((f) =>\n\t\t\t\ttypeof f === \"object\" ? InlineStylesList[f.type] : InlineStylesList[f],\n\t\t\t)\n\t\t\t.map((f) => (f.label && f.style ? f : InlineStylesList[f]));\n\n\t\treturn {\n\t\t\tfontList,\n\t\t\tblockTypes,\n\t\t\tinlineStyles,\n\t\t};\n\t};\n\n\trender() {\n\t\tconst {\n\t\t\tclassName,\n\t\t\tshowFontMenu,\n\t\t\tshowInlineStyleMenu,\n\t\t\tshowTextFormatMenu,\n\t\t\tshowLinkMenu,\n\t\t\tlabel,\n\t\t\ttags,\n\t\t\teditorState,\n\t\t\tonChange,\n\t\t\thandleBeforeInput,\n\t\t} = this.props;\n\n\t\tconst classNames = cx(\"editor-root\", className);\n\n\t\treturn (\n\t\t\t<div ref={this.wrapperRef}>\n\t\t\t\t{label && <Label>{label}</Label>}\n\n\t\t\t\t<div className={classNames}>\n\t\t\t\t\t<div className=\"controls-wrapper\">\n\t\t\t\t\t\t{showFontMenu && (\n\t\t\t\t\t\t\t<BlockTypeSelectControls\n\t\t\t\t\t\t\t\teditorState={editorState}\n\t\t\t\t\t\t\t\tonToggle={this.toggleSelectBlockType}\n\t\t\t\t\t\t\t\tblockTypes={this.getFontListConfigForPanelType(\"fontList\")}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{showInlineStyleMenu && (\n\t\t\t\t\t\t\t<InlineStyleControls\n\t\t\t\t\t\t\t\teditorState={editorState}\n\t\t\t\t\t\t\t\tonToggle={this.toggleInlineStyle}\n\t\t\t\t\t\t\t\tinlineStyles={this.getFontListConfigForPanelType(\n\t\t\t\t\t\t\t\t\t\"inlineStyles\",\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{showTextFormatMenu && (\n\t\t\t\t\t\t\t<BlockTypeButtonControls\n\t\t\t\t\t\t\t\teditorState={editorState}\n\t\t\t\t\t\t\t\tonToggle={this.toggleButtonBlockType}\n\t\t\t\t\t\t\t\tblockTypes={this.getFontListConfigForPanelType(\"blockTypes\")}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{showLinkMenu && (\n\t\t\t\t\t\t\t<BlockTypeLinkControls\n\t\t\t\t\t\t\t\teditorState={editorState}\n\t\t\t\t\t\t\t\tonToggle={this.toggleLink}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{tags && tags.length > 0 && (\n\t\t\t\t\t\t\t<TagControls\n\t\t\t\t\t\t\t\teditorState={editorState}\n\t\t\t\t\t\t\t\ttags={tags}\n\t\t\t\t\t\t\t\tonInsertTag={this.insertText}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div className=\"editor-wrapper\">\n\t\t\t\t\t\t<Editor\n\t\t\t\t\t\t\tref={this.editor}\n\t\t\t\t\t\t\teditorState={editorState}\n\t\t\t\t\t\t\thandleKeyCommand={this.handleKeyCommand}\n\t\t\t\t\t\t\tonChange={onChange}\n\t\t\t\t\t\t\thandleBeforeInput={handleBeforeInput}\n\t\t\t\t\t\t\tkeyBindingFn={this.keyBindingFn}\n\t\t\t\t\t\t\tspellCheck\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nconst styleShape = (configList) =>\n\tPropTypes.oneOfType([\n\t\tPropTypes.arrayOf(PropTypes.oneOf([...Object.values(configList)])),\n\t\tPropTypes.arrayOf(\n\t\t\tPropTypes.shape({\n\t\t\t\ttype: PropTypes.oneOf([...Object.values(configList)]),\n\t\t\t\tlabel: PropTypes.string,\n\t\t\t\tstyle: PropTypes.string,\n\t\t\t\ttooltip: PropTypes.string,\n\t\t\t\thotKey: PropTypes.string,\n\t\t\t}),\n\t\t),\n\t]);\n\nRichTextEditor.propTypes = {\n\teditorState: PropTypes.object.isRequired,\n\tonChange: PropTypes.func.isRequired,\n\tmaxTabDepth: PropTypes.number,\n\tshowFontMenu: PropTypes.bool,\n\tshowInlineStyleMenu: PropTypes.bool,\n\tshowTextFormatMenu: PropTypes.bool,\n\tshowLinkMenu: PropTypes.bool,\n\tlabel: PropTypes.string,\n\ttags: PropTypes.arrayOf(PropTypes.object),\n\tcontrolConfigSet: PropTypes.shape({\n\t\tfontList: styleShape(EditorConfigTypes.FONT_LIST),\n\t\tblockTypes: styleShape(EditorConfigTypes.BLOCK_TYPES),\n\t\tinlineStyles: styleShape(EditorConfigTypes.INLINE_STYLES),\n\t}),\n};\nRichTextEditor.defaultProps = {\n\tmaxTabDepth: 4,\n\tshowFontMenu: true,\n\tshowInlineStyleMenu: true,\n\tshowTextFormatMenu: true,\n\tshowLinkMenu: true,\n\tlabel: \"\",\n};\n\nexport default RichTextEditor;\n","import { convertFromRaw, convertToRaw, EditorState } from \"draft-js\";\nimport { draftToMarkdown, markdownToDraft } from \"markdown-draft-js\";\nimport showdown from \"showdown\";\n\nimport { decorator } from \"./constants\";\n\nexport const editorStateToMarkdown = (editorState) => {\n\tconst rawState = convertToRaw(editorState.getCurrentContent());\n\treturn draftToMarkdown(rawState, { preserveNewlines: true });\n};\n\nexport const markdownToEditorState = (markdown) => {\n\tif (!markdown) {\n\t\treturn EditorState.createEmpty(decorator);\n\t}\n\tconst rawState = markdownToDraft(markdown, { preserveNewlines: true });\n\tconst contentState = convertFromRaw(rawState);\n\treturn EditorState.createWithContent(contentState, decorator);\n};\n\nconst converter = new showdown.Converter({\n\tunderline: true,\n});\n\nexport const markdownToHtml = (markdown) => {\n\treturn converter.makeHtml(markdown);\n};\n","import { ExpandablePanel } from \"@entur/expand\";\nimport { FeedbackText, type VariantType } from \"@entur/form\";\nimport {\n\ttype LanguageKey,\n\ttype LanguageOption,\n\ttype MultiLanguageValues,\n\tStack,\n} from \"@entur-partner/common\";\nimport type { EditorState } from \"draft-js\";\nimport React, { useState } from \"react\";\nimport RichTextEditor from \"./RichTextEditor\";\nimport { MinifiedConfigTypes } from \"./RichTextEditor/constants\";\nimport {\n\teditorStateToMarkdown,\n\tmarkdownToEditorState,\n} from \"./RichTextEditor/markdownConvertion\";\n\ntype MultiLanguageInputProps = {\n\tvalues: MultiLanguageValues;\n\tonChange: (values: MultiLanguageValues) => void;\n\tvariant?: (lang: LanguageKey) => VariantType;\n\tfeedback?: (lang: LanguageKey) => string;\n\ttags?: {\n\t\ttag: string;\n\t\tdelimiter: string;\n\t\tlabel: string;\n\t}[];\n};\n\ntype RichTextEditorForLanguageProps = MultiLanguageInputProps & {\n\tlanguage: LanguageOption;\n};\n\nconst RichTextEditorForLanguage = ({\n\tlanguage: { value: langKey, label, required },\n\tvalues,\n\tonChange,\n\tvariant,\n\tfeedback,\n\ttags,\n}: RichTextEditorForLanguageProps) => {\n\tconst [editorState, setEditorState] = useState<EditorState>(\n\t\tmarkdownToEditorState(values[langKey]),\n\t);\n\n\tconst handleOnChange = (changedState: EditorState) => {\n\t\tconst newValues = { ...values };\n\t\tconst content = editorStateToMarkdown(changedState);\n\t\tif (values[langKey] && content === \"\\n\") {\n\t\t\tdelete newValues[langKey];\n\t\t} else {\n\t\t\tnewValues[langKey] = content;\n\t\t}\n\n\t\tsetEditorState(changedState);\n\t\tonChange(newValues);\n\t};\n\n\tconst feedbackText = feedback?.(langKey);\n\n\treturn (\n\t\t<>\n\t\t\t<RichTextEditor\n\t\t\t\tlabel={required ? `${label}*` : label}\n\t\t\t\teditorState={editorState}\n\t\t\t\tonChange={(changedState: EditorState) => handleOnChange(changedState)}\n\t\t\t\tcontrolConfigSet={MinifiedConfigTypes}\n\t\t\t\ttags={tags}\n\t\t\t/>\n\t\t\t{variant && feedbackText && feedbackText.length > 0 && (\n\t\t\t\t<FeedbackText variant={variant(langKey)}>{feedbackText}</FeedbackText>\n\t\t\t)}\n\t\t</>\n\t);\n};\n\ntype ExpandableMultiLanguageRichTextEditorProps = MultiLanguageInputProps & {\n\tname: string;\n\ttitle: string;\n\tlanguages: LanguageOption[];\n};\n\nexport const ExpandableMultiLanguageRichTextEditor = ({\n\tname,\n\ttitle,\n\tlanguages,\n\t...rest\n}: ExpandableMultiLanguageRichTextEditorProps) => (\n\t<ExpandablePanel\n\t\ttitle={title}\n\t\tdefaultOpen\n\t\tcontentStyle={{\n\t\t\tpadding: \"4px 4px 4px 4px\",\n\t\t\tmarginTop: \"16px\",\n\t\t\tmarginBottom: \"16px\",\n\t\t}}\n\t>\n\t\t<Stack space=\"medium\">\n\t\t\t{languages.map((lang) => (\n\t\t\t\t<div\n\t\t\t\t\tkey={name + lang.value}\n\t\t\t\t\tdata-testid={`multi-lang-rich-text-${name}-${lang.value}`}\n\t\t\t\t>\n\t\t\t\t\t<RichTextEditorForLanguage language={lang} {...rest} />\n\t\t\t\t</div>\n\t\t\t))}\n\t\t</Stack>\n\t</ExpandablePanel>\n);\n","import { convertFromHTML, convertToHTML } from \"draft-convert\";\nimport { EditorState } from \"draft-js\";\nimport React from \"react\";\nimport { decorator } from \"./constants\";\nimport { HtmlLink } from \"./Link\";\n\nexport const entityToHtml = {\n\tentityToHTML: (entity, originalText) => {\n\t\tif (entity.type === \"LINK\") {\n\t\t\treturn <HtmlLink url={entity.data.url}>{originalText}</HtmlLink>;\n\t\t}\n\t\treturn originalText;\n\t},\n};\n\nexport const htmlToEntity = {\n\thtmlToEntity: (nodeName, node, createEntity) => {\n\t\tif (nodeName === \"a\") {\n\t\t\treturn createEntity(\"LINK\", \"MUTABLE\", { url: node.href });\n\t\t}\n\t},\n};\n\nexport const htmlToEditorState = (html) => {\n\tif (!html) {\n\t\treturn EditorState.createEmpty(decorator);\n\t}\n\tconst rawState = convertFromHTML(htmlToEntity)(html);\n\treturn EditorState.createWithContent(rawState, decorator);\n};\n\nexport const editorStateToHtml = (editorState) => {\n\treturn convertToHTML(entityToHtml)(editorState.getCurrentContent());\n};\n"],"names":["Key","Object","freeze","ENTER","getKey","event","keyCode","which","withI18n","Component","props","t","_useTranslation","useTranslation","language","i18n","Error","useI18N","React","createElement","_extends","StyleButton$1","_Component","StyleButton","_this","_len","arguments","length","args","Array","_key","call","apply","this","concat","onToggle","e","_this$props","style","preventDefault","onToggleNoEvent","_this$props2","_inheritsLoose","prototype","render","_this2","_this$props3","label","title","hotKey","classNames","cx","active","className","onMouseDown","tabIndex","onKeyPress","BlockTypeButtonControls","editorState","blockTypes","selection","getSelection","blockTypeStyle","getCurrentContent","getBlockForKey","getStartKey","getType","map","type","key","tooltip","BlockTypeLinkControls","state","urlValue","showUrlInput","hasLink","onUrlChange","setState","target","value","addLink","isCollapsed","currentContent","startKey","startOffset","getStartOffset","linkKey","getEntityAt","url","getEntity","getData","confirmLink","contentStateWithEntity","createEntity","entityKey","getLastCreatedEntityKey","EditorState","set","cancelLink","onLinkInputKeyDown","removeLink","_this$state","onClick","LinkIcon","CloseIcon","TextField","width","margin","onChange","onKeyDown","placeholder","SecondarySquareButton","CheckIcon","height","Unbutton","UnlinkIcon","propTypes","PropTypes","object","func","BlockTypeLinkControls$1","BlockTypeDropdown$1","BlockTypeDropdown","handleOnClick","selectedOption","_proto","toItem","option","renderFormattedLabel","formattedLabelText","selected","Dropdown","items","options","selectedItem","BlockTypeControls","_ref","find","InlineStyleControls","inlineStyles","currentStyle","getCurrentInlineStyle","has","TagControls","tagControlRef","createRef","isOpen","handleClickOutside","current","contains","handleTagClick","tag","delimiter","onInsertTag","delimiterStart","componentDidMount","document","addEventListener","componentWillUnmount","removeEventListener","menuItems","tags","OverflowMenuItem","id","icon","ref","DownArrowIcon","inline","Popover","open","OverflowMenu","arrayOf","isRequired","TagControls$1","HtmlLink","href","children","EditorConfigTypes","FONT_LIST","UNSTYLED","HEADER_ONE","HEADER_TWO","HEADER_THREE","HEADER_FOUR","HEADER_FIVE","HEADER_SIX","BLOCK_TYPES","UNORDERED_LIST","ORDERED_LIST","INLINE_STYLES","BOLD","ITALIC","UNDERLINE","FontList","unstyled","BlockTypeList","BulletListIcon","NumberListIcon","InlineStylesList","bold","BoldIcon","italic","ItalicIcon","underline","UnderlineIcon","MinifiedConfigTypes","fontList","values","decorator","CompositeDecorator","strategy","contentBlock","callback","contentState","findEntityRanges","character","component","_props$contentState$g","RichTextEditor","wrapperRef","editor","handleKeyCommand","command","newState","RichUtils","keyBindingFn","evt","onTab","getDefaultKeyBinding","stopPropagation","maxTabDepth","toggleButtonBlockType","blockType","toggleBlockType","toggleSelectBlockType","toggleInlineStyle","inlineStyle","_this$props4","toggleLink","newEditorState","insertText","text","newContent","Modifier","push","focusEditor","getFontListConfigForPanelType","panelType","getControlConfigBySet","controlConfigSet","config","keys","filter","f","_this$editor$current","focus","_this$props5","showFontMenu","showInlineStyleMenu","showTextFormatMenu","showLinkMenu","handleBeforeInput","Label","BlockTypeSelectControls","Editor","spellCheck","styleShape","configList","oneOfType","oneOf","shape","string","number","bool","defaultProps","editorStateToMarkdown","rawState","convertToRaw","draftToMarkdown","preserveNewlines","markdownToEditorState","markdown","createEmpty","markdownToDraft","convertFromRaw","createWithContent","converter","showdown","Converter","RichTextEditorForLanguage","_ref$language","langKey","required","variant","feedback","_useState","useState","setEditorState","feedbackText","Fragment","changedState","newValues","content","handleOnChange","FeedbackText","entityToHtml","entityToHTML","entity","originalText","data","htmlToEntity","nodeName","node","_ref2","name","languages","rest","_objectWithoutPropertiesLoose","_excluded","ExpandablePanel","defaultOpen","contentStyle","padding","marginTop","marginBottom","Stack","space","lang","convertToHTML","html","convertFromHTML","makeHtml"],"mappings":"siCAAO,IAAMA,EAAMC,OAAOC,OAAO,CAChCC,MAAO,KAGD,SAASC,EAAOC,GACtB,OAAOA,EAAMC,SAAWD,EAAME,KAC/B,CCeO,SAASC,EAASC,GACxB,OAAO,SAA0BC,GAChC,IAAMC,EApBR,WACC,IAAAC,EAGIC,EAAAA,iBAFHF,EAACC,EAADD,EACQG,EAAQF,EAAhBG,KAAQD,SAGT,GACc,OAAbA,GACa,OAAbA,GACa,UAAbA,GACa,UAAbA,EAEA,MAAME,MAAM,qCAGb,OAAOL,CACR,CAIYM,GACV,OAAOC,EAAAA,QAAAC,cAACV,EAASW,KAAKV,EAAK,CAAEK,KAAMJ,KAErC,CCrB0C,IAuC1CU,EAAeb,WArCEc,GAAA,SAAAC,IAAA,IAAA,IAAAC,EAAAC,EAAAC,UAAAC,OAAAC,EAAAC,IAAAA,MAAAJ,GAAAK,EAAA,EAAAA,EAAAL,EAAAK,IAAAF,EAAAE,GAAAJ,UAAAI,GAUf,OAVeN,EAAAF,EAAAS,KAAAC,MAAAV,EAAA,CAAAW,MAAAC,OAAAN,KAAAK,MAChBE,SAAW,SAACC,GACX,IAAAC,EAA4Bb,EAAKd,MAAzB4B,EAAKD,EA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