UNPKG

@progress/kendo-react-editor

Version:

React Editor enables users to create rich text content through a WYSIWYG interface. KendoReact Editor package

19 lines (18 loc) 957 B
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ import { AllSelection as r } from "@progress/kendo-editor-common"; import { EditorUtils as d } from "./index.mjs"; const s = (t, o) => { const c = o.tr || t.state.tr.setSelection(new r(t.state.doc)).replaceSelectionWith(o.doc || d.createDocument(t.state.schema, o.html || "")).setMeta("commandName", "setHTML"); t.updateState(t.state.apply(c)); }, i = (t, o, c, e, m) => { typeof o == "string" ? e && o === m ? s(t, { tr: e }) : o !== c && s(t, { html: o }) : e && o.eq(e.doc) ? s(t, { tr: e }) : t.state.doc.eq(o) || s(t, { doc: o }); }; export { i as updateEditorValue };