@flytedan/flytebot-design-system 0.78.0 → 0.78.1
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/index.cjs +7 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -9599,6 +9599,7 @@ function CodeEditor({
|
|
|
9599
9599
|
const onChangeRef = React56.useRef(onChange);
|
|
9600
9600
|
onChangeRef.current = onChange;
|
|
9601
9601
|
const editableCompartment = React56.useRef(new import_state.Compartment()).current;
|
|
9602
|
+
const readOnlyCompartment = React56.useRef(new import_state.Compartment()).current;
|
|
9602
9603
|
const attributesCompartment = React56.useRef(new import_state.Compartment()).current;
|
|
9603
9604
|
const errorRef = React56.useRef(error);
|
|
9604
9605
|
errorRef.current = error;
|
|
@@ -9641,7 +9642,7 @@ function CodeEditor({
|
|
|
9641
9642
|
...import_commands.historyKeymap
|
|
9642
9643
|
]),
|
|
9643
9644
|
editableCompartment.of(import_view.EditorView.editable.of(!disabled)),
|
|
9644
|
-
import_state.EditorState.readOnly.of(readOnly),
|
|
9645
|
+
readOnlyCompartment.of(import_state.EditorState.readOnly.of(readOnly)),
|
|
9645
9646
|
updateListener,
|
|
9646
9647
|
attributesCompartment.of(import_view.EditorView.contentAttributes.of(contentAttributes()))
|
|
9647
9648
|
]
|
|
@@ -9668,6 +9669,11 @@ function CodeEditor({
|
|
|
9668
9669
|
if (!view) return;
|
|
9669
9670
|
view.dispatch({ effects: editableCompartment.reconfigure(import_view.EditorView.editable.of(!disabled)) });
|
|
9670
9671
|
}, [disabled, editableCompartment]);
|
|
9672
|
+
React56.useEffect(() => {
|
|
9673
|
+
const view = viewRef.current;
|
|
9674
|
+
if (!view) return;
|
|
9675
|
+
view.dispatch({ effects: readOnlyCompartment.reconfigure(import_state.EditorState.readOnly.of(readOnly)) });
|
|
9676
|
+
}, [readOnly, readOnlyCompartment]);
|
|
9671
9677
|
React56.useEffect(() => {
|
|
9672
9678
|
const view = viewRef.current;
|
|
9673
9679
|
if (!view) return;
|