@uiw/react-codemirror 4.3.1 → 4.4.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.
@@ -1,9 +1,9 @@
1
1
  import { useEffect, useState } from 'react';
2
- import { basicSetup as defaultBasicSetup } from '@codemirror/basic-setup';
2
+ import { basicSetup } from '@codemirror/basic-setup';
3
3
  import { EditorState, StateEffect } from '@codemirror/state';
4
- import { indentWithTab as defaultIndentWithTab } from '@codemirror/commands';
5
- import { EditorView, keymap, ViewUpdate, placeholder as extendPlaceholder } from '@codemirror/view';
6
- import { oneDarkTheme } from '@codemirror/theme-one-dark';
4
+ import { indentWithTab } from '@codemirror/commands';
5
+ import { EditorView, keymap, ViewUpdate, placeholder } from '@codemirror/view';
6
+ import { oneDark } from '@codemirror/theme-one-dark';
7
7
  import { ReactCodeMirrorProps } from './';
8
8
  import { defaultLightThemeOption } from './theme/light';
9
9
 
@@ -23,13 +23,13 @@ export function useCodeMirror(props: UseCodeMirror) {
23
23
  height = '',
24
24
  minHeight = '',
25
25
  maxHeight = '',
26
- placeholder = '',
26
+ placeholder: placeholderStr = '',
27
27
  width = '',
28
28
  minWidth = '',
29
29
  maxWidth = '',
30
30
  editable = true,
31
- indentWithTab = true,
32
- basicSetup = true,
31
+ indentWithTab: defaultIndentWithTab = true,
32
+ basicSetup: defaultBasicSetup = true,
33
33
  root,
34
34
  } = props;
35
35
  const [container, setContainer] = useState(props.container);
@@ -53,15 +53,15 @@ export function useCodeMirror(props: UseCodeMirror) {
53
53
  }
54
54
  });
55
55
  let getExtensions = [updateListener, defaultThemeOption];
56
- if (indentWithTab) {
57
- getExtensions.unshift(keymap.of([defaultIndentWithTab]));
56
+ if (defaultIndentWithTab) {
57
+ getExtensions.unshift(keymap.of([indentWithTab]));
58
58
  }
59
- if (basicSetup) {
60
- getExtensions.unshift(defaultBasicSetup);
59
+ if (defaultBasicSetup) {
60
+ getExtensions.unshift(basicSetup);
61
61
  }
62
62
 
63
- if (placeholder) {
64
- getExtensions.unshift(extendPlaceholder(placeholder));
63
+ if (placeholderStr) {
64
+ getExtensions.unshift(placeholder(placeholderStr));
65
65
  }
66
66
 
67
67
  switch (theme) {
@@ -69,7 +69,7 @@ export function useCodeMirror(props: UseCodeMirror) {
69
69
  getExtensions.push(defaultLightThemeOption);
70
70
  break;
71
71
  case 'dark':
72
- getExtensions.push(oneDarkTheme);
72
+ getExtensions.push(oneDark);
73
73
  break;
74
74
  default:
75
75
  getExtensions.push(theme);
@@ -1 +0,0 @@
1
- /// <reference types="react-scripts" />