import {$createLinkNode} from "@lexical/link";
import {$createTextNode, $getSelection} from "lexical";
import {$createImageNode} from "../../nodes/image";
+import {setEditorContentFromHtml} from "../../actions";
export const link: EditorFormDefinition = {
type: 'text',
},
],
+};
+
+export const source: EditorFormDefinition = {
+ submitText: 'Save',
+ action(formData, context: EditorUiContext) {
+ setEditorContentFromHtml(context.editor, formData.get('source')?.toString() || '');
+ return true;
+ },
+ fields: [
+ {
+ label: 'Source',
+ name: 'source',
+ type: 'textarea',
+ },
+ ],
};
\ No newline at end of file