@@ -9,6 +9,7 @@ import { JSONTransformer } from '@atlaskit/editor-json-transformer';
99import { gridPlugin } from '@atlaskit/editor-plugin-grid' ;
1010import { insertBlockPlugin } from '@atlaskit/editor-plugin-insert-block' ;
1111import { listPlugin } from '@atlaskit/editor-plugin-list' ;
12+ // eslint-disable-next-line import/no-extraneous-dependencies
1213import { mediaPlugin } from '@atlaskit/editor-plugin-media' ;
1314import { mentionsPlugin } from '@atlaskit/editor-plugin-mentions' ;
1415import { tasksAndDecisionsPlugin } from '@atlaskit/editor-plugin-tasks-and-decisions' ;
@@ -57,6 +58,8 @@ interface AtlaskitEditorProps extends Omit<Partial<EditorNextProps>, 'onChange'
5758 onFocus : ( ) => void ;
5859 onBlur : ( ) => void ;
5960 isSaveOnBlur ?: boolean ;
61+ getMediaAuth ?: ( ) => Promise < { token : string ; clientId : string ; baseUrl ?: string } > ;
62+ issueKey ?: string ;
6063}
6164
6265const AtlaskitEditor : React . FC < AtlaskitEditorProps > = ( props : AtlaskitEditorProps ) => {
@@ -131,6 +134,7 @@ const AtlaskitEditor: React.FC<AtlaskitEditorProps> = (props: AtlaskitEditorProp
131134 } ,
132135 } ) ;
133136 return { ...base , provider } ;
137+ // Only recreate if issueKey changes or if getMediaAuth changes from undefined to defined or vice versa
134138 } , [ getMediaAuth , issueKey ] ) ;
135139
136140 const { preset, editorApi } = usePreset ( ( ) => {
@@ -162,7 +166,8 @@ const AtlaskitEditor: React.FC<AtlaskitEditorProps> = (props: AtlaskitEditorProp
162166 . add ( mentionsPlugin )
163167 . add ( tasksAndDecisionsPlugin )
164168 ) ;
165- } , [ mediaOptions , mentionProvider ] ) ;
169+ // Only recreate preset when mediaOptions or appearance changes, NOT when mentionProvider changes
170+ } , [ mediaOptions , appearance ] ) ;
166171 // Helper function to get current document content
167172 const getCurrentContent = React . useCallback ( async ( ) : Promise < any | null > => {
168173 try {
0 commit comments