@cyberyozh/text-editor 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/editor.js CHANGED
@@ -6066,6 +6066,12 @@ function TiptapContent({
6066
6066
  const katexHandler = createHandleKatexAdd(editor, handleCloseDialog);
6067
6067
  katexHandler(latex, katexDialogContext?.pos);
6068
6068
  };
6069
+ (0, import_react36.useEffect)(() => {
6070
+ if (!editor || editor.isDestroyed) return;
6071
+ editor.commands.setContent(safeContent, {
6072
+ emitUpdate: false
6073
+ });
6074
+ }, [content, editor]);
6069
6075
  if (!editor) return null;
6070
6076
  const shouldBubbleMenuShow = ({ state }) => {
6071
6077
  if (state.selection instanceof import_state5.NodeSelection) {
@@ -6097,10 +6103,16 @@ function TiptapContent({
6097
6103
  )
6098
6104
  }
6099
6105
  ),
6100
- /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: `tiptap-content-wrapper ${!!error ? "has-error" : ""} ${isDisabled ? "is-disabled" : ""}`, children: [
6101
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_react37.EditorContent, { editor }),
6102
- isEditable && !isDisabled && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(CharacterCount, { editor })
6103
- ] }),
6106
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(
6107
+ "div",
6108
+ {
6109
+ className: `tiptap-content-wrapper ${!!error ? "has-error" : ""} ${isDisabled ? "is-disabled" : ""}`,
6110
+ children: [
6111
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_react37.EditorContent, { editor }),
6112
+ isEditable && !isDisabled && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(CharacterCount, { editor })
6113
+ ]
6114
+ }
6115
+ ),
6104
6116
  !!error && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("p", { className: "tiptap-error-message", children: error }),
6105
6117
  activeDialog === "image" && isEditable && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
6106
6118
  ImageDialog,