File tree Expand file tree Collapse file tree
src/common/components/textEditor Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525 frame-src 'self' *.hel.fi *.hel.ninja *.youtube.com www.youtube-nocookie.com *.vimeo.com;
2626 img-src 'self' data: *.hel.fi *.hel.ninja *.ytimg.com *.youtube.com *.vimeo.com *.vimeocdn.com *.blob.core.windows.net *.hkih.hion.dev;
2727 font-src 'self' *.hel.fi *.hel.ninja;
28- connect-src 'self' localhost:* 127.0.0.1:* *.hel.fi *.hel.ninja *.hkih.hion.dev *.digiaiiris.com;
28+ connect-src 'self' localhost:* 127.0.0.1:* *.hel.fi *.hel.ninja *.hkih.hion.dev *.digiaiiris.com *.sentry.io ;
2929 manifest-src 'self';
3030 base-uri 'self';
3131 form-action 'self';
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ import 'react-draft-wysiwyg/dist/react-draft-wysiwyg.css';
1414import classNames from 'classnames' ;
1515import { ContentState , convertToRaw , EditorState } from 'draft-js' ;
1616import draftToHtml from 'draftjs-to-html' ;
17- import htmlToDraft from 'html-to-draftjs' ;
17+ import htmlToDraftImport from 'html-to-draftjs' ;
1818import React from 'react' ;
1919import { Editor , EditorState as EditorStateWysiwyg } from 'react-draft-wysiwyg' ;
2020import { useTranslation } from 'react-i18next' ;
@@ -24,6 +24,13 @@ import styles from './textEditor.module.scss';
2424import useIsMounted from '../../../hooks/useIsMounted' ;
2525import InputWrapper , { InputWrapperProps } from '../inputWrapper/InputWrapper' ;
2626
27+ // Vite 8 CJS/ESM interop: html-to-draftjs uses module.exports, unwrap .default if needed
28+ const htmlToDraft : typeof htmlToDraftImport =
29+ typeof htmlToDraftImport === 'function'
30+ ? htmlToDraftImport
31+ : ( htmlToDraftImport as unknown as { default : typeof htmlToDraftImport } )
32+ . default ;
33+
2734const convertHtmlToEditorState = ( html : string ) => {
2835 const blocksFromHtml = htmlToDraft ( html ) ;
2936 const { contentBlocks, entityMap } = blocksFromHtml ;
You can’t perform that action at this time.
0 commit comments