@firecms/editor 3.0.0-canary.187 → 3.0.0-canary.189
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.d.ts +2 -1
- package/dist/index.es.js +7 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +7 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +29 -29
package/dist/index.umd.js
CHANGED
@@ -1793,7 +1793,8 @@
|
|
1793
1793
|
textSize = "base",
|
1794
1794
|
highlight,
|
1795
1795
|
handleImageUpload,
|
1796
|
-
aiController
|
1796
|
+
aiController,
|
1797
|
+
disabled
|
1797
1798
|
}) => {
|
1798
1799
|
const ref = React.useRef(null);
|
1799
1800
|
const editorRef = React.useRef(null);
|
@@ -1809,6 +1810,9 @@
|
|
1809
1810
|
editorRef.current?.commands.setContent(content ?? "");
|
1810
1811
|
}
|
1811
1812
|
}, [version]);
|
1813
|
+
React.useEffect(() => {
|
1814
|
+
editorRef?.current?.setEditable(!disabled);
|
1815
|
+
}, [disabled]);
|
1812
1816
|
React.useEffect(() => {
|
1813
1817
|
if (version === void 0) return;
|
1814
1818
|
if (editorRef.current && version > 0) {
|
@@ -1882,6 +1886,7 @@
|
|
1882
1886
|
})
|
1883
1887
|
], []);
|
1884
1888
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: "relative min-h-[300px] w-full", children: /* @__PURE__ */ jsxRuntime.jsx(react.EditorProvider, { content: content ?? "", extensions, editorProps: {
|
1889
|
+
editable: () => !disabled,
|
1885
1890
|
attributes: {
|
1886
1891
|
class: ui.cls(proseClass, "prose-headings:font-title font-default focus:outline-none max-w-full p-12")
|
1887
1892
|
}
|
@@ -1889,6 +1894,7 @@
|
|
1889
1894
|
editor: editor_0
|
1890
1895
|
}) => {
|
1891
1896
|
editorRef.current = editor_0;
|
1897
|
+
editor_0.setEditable(!disabled);
|
1892
1898
|
}, onUpdate: ({
|
1893
1899
|
editor: editor_1
|
1894
1900
|
}) => {
|