@cyberyozh/text-editor 0.1.3 → 0.1.5

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.mjs CHANGED
@@ -5958,6 +5958,7 @@ function TiptapContent({
5958
5958
  handleChange,
5959
5959
  imageHandlers,
5960
5960
  isEditable = true,
5961
+ isDisabled = false,
5961
5962
  lang,
5962
5963
  error
5963
5964
  }) {
@@ -5976,11 +5977,11 @@ function TiptapContent({
5976
5977
  }
5977
5978
  const editor = useEditor(
5978
5979
  {
5979
- editable: isEditable,
5980
+ editable: isEditable && !isDisabled,
5980
5981
  extensions: getEditorExtensions({
5981
5982
  translations: translations2,
5982
5983
  suggestion: createSuggestions(translations2, !!imageHandlers),
5983
- isEditable,
5984
+ isEditable: isEditable && !isDisabled,
5984
5985
  getImageById: imageHandlers?.getImage,
5985
5986
  onKatexClick: (latex, pos) => {
5986
5987
  setKatexDialogContext({ latex, pos });
@@ -6043,9 +6044,9 @@ function TiptapContent({
6043
6044
  return true;
6044
6045
  };
6045
6046
  return /* @__PURE__ */ jsxs35(Fragment3, { children: [
6046
- /* @__PURE__ */ jsx92(DragHandle, { editor }),
6047
- isEditable && /* @__PURE__ */ jsx92(TableMenu, { editor }),
6048
- /* @__PURE__ */ jsx92(
6047
+ !isDisabled && /* @__PURE__ */ jsx92(DragHandle, { editor }),
6048
+ isEditable && !isDisabled && /* @__PURE__ */ jsx92(TableMenu, { editor }),
6049
+ !isDisabled && /* @__PURE__ */ jsx92(
6049
6050
  BubbleMenu,
6050
6051
  {
6051
6052
  shouldShow: shouldBubbleMenuShow,
@@ -6060,9 +6061,9 @@ function TiptapContent({
6060
6061
  )
6061
6062
  }
6062
6063
  ),
6063
- /* @__PURE__ */ jsxs35("div", { className: `tiptap-content-wrapper ${!!error ? "has-error" : ""}`, children: [
6064
+ /* @__PURE__ */ jsxs35("div", { className: `tiptap-content-wrapper ${!!error ? "has-error" : ""} ${isDisabled ? "is-disabled" : ""}`, children: [
6064
6065
  /* @__PURE__ */ jsx92(EditorContent, { editor }),
6065
- isEditable && /* @__PURE__ */ jsx92(CharacterCount, { editor })
6066
+ isEditable && !isDisabled && /* @__PURE__ */ jsx92(CharacterCount, { editor })
6066
6067
  ] }),
6067
6068
  !!error && /* @__PURE__ */ jsx92("p", { className: "tiptap-error-message", children: error }),
6068
6069
  activeDialog === "image" && isEditable && /* @__PURE__ */ jsx92(