@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.js CHANGED
@@ -8415,6 +8415,7 @@ function CodeEditor({
8415
8415
  const onChangeRef = React56.useRef(onChange);
8416
8416
  onChangeRef.current = onChange;
8417
8417
  const editableCompartment = React56.useRef(new Compartment()).current;
8418
+ const readOnlyCompartment = React56.useRef(new Compartment()).current;
8418
8419
  const attributesCompartment = React56.useRef(new Compartment()).current;
8419
8420
  const errorRef = React56.useRef(error);
8420
8421
  errorRef.current = error;
@@ -8457,7 +8458,7 @@ function CodeEditor({
8457
8458
  ...historyKeymap
8458
8459
  ]),
8459
8460
  editableCompartment.of(EditorView.editable.of(!disabled)),
8460
- EditorState.readOnly.of(readOnly),
8461
+ readOnlyCompartment.of(EditorState.readOnly.of(readOnly)),
8461
8462
  updateListener,
8462
8463
  attributesCompartment.of(EditorView.contentAttributes.of(contentAttributes()))
8463
8464
  ]
@@ -8484,6 +8485,11 @@ function CodeEditor({
8484
8485
  if (!view) return;
8485
8486
  view.dispatch({ effects: editableCompartment.reconfigure(EditorView.editable.of(!disabled)) });
8486
8487
  }, [disabled, editableCompartment]);
8488
+ React56.useEffect(() => {
8489
+ const view = viewRef.current;
8490
+ if (!view) return;
8491
+ view.dispatch({ effects: readOnlyCompartment.reconfigure(EditorState.readOnly.of(readOnly)) });
8492
+ }, [readOnly, readOnlyCompartment]);
8487
8493
  React56.useEffect(() => {
8488
8494
  const view = viewRef.current;
8489
8495
  if (!view) return;