BookStack/resources/js/wysiwyg/ui/defaults/forms/controls.ts
Dan Brown a27a325af7
Lexical: Started on table actions
Started building table cell form/actions
2024-08-02 15:28:54 +01:00

18 lines
550 B
TypeScript

import {EditorFormDefinition} from "../../framework/forms";
import {EditorUiContext} from "../../framework/core";
import {setEditorContentFromHtml} from "../../../actions";
export const source: EditorFormDefinition = {
submitText: 'Save',
async action(formData, context: EditorUiContext) {
setEditorContentFromHtml(context.editor, formData.get('source')?.toString() || '');
return true;
},
fields: [
{
label: 'Source',
name: 'source',
type: 'textarea',
},
],
};