@neo4j-cypher/react-codemirror 0.0.0-canary-20250423075344

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.
Files changed (138) hide show
  1. package/CHANGELOG.md +279 -0
  2. package/LICENSE.md +201 -0
  3. package/README.md +35 -0
  4. package/dist/CypherEditor.d.ts +192 -0
  5. package/dist/CypherEditor.js +326 -0
  6. package/dist/CypherEditor.js.map +1 -0
  7. package/dist/CypherEditor.test.d.ts +1 -0
  8. package/dist/CypherEditor.test.js +151 -0
  9. package/dist/CypherEditor.test.js.map +1 -0
  10. package/dist/constants.d.ts +1 -0
  11. package/dist/constants.js +2 -0
  12. package/dist/constants.js.map +1 -0
  13. package/dist/e2e_tests/autoCompletion.spec.d.ts +1 -0
  14. package/dist/e2e_tests/autoCompletion.spec.js +318 -0
  15. package/dist/e2e_tests/autoCompletion.spec.js.map +1 -0
  16. package/dist/e2e_tests/configuration.spec.d.ts +1 -0
  17. package/dist/e2e_tests/configuration.spec.js +83 -0
  18. package/dist/e2e_tests/configuration.spec.js.map +1 -0
  19. package/dist/e2e_tests/debounce.spec.d.ts +1 -0
  20. package/dist/e2e_tests/debounce.spec.js +66 -0
  21. package/dist/e2e_tests/debounce.spec.js.map +1 -0
  22. package/dist/e2e_tests/e2eUtils.d.ts +13 -0
  23. package/dist/e2e_tests/e2eUtils.js +71 -0
  24. package/dist/e2e_tests/e2eUtils.js.map +1 -0
  25. package/dist/e2e_tests/extraKeybindings.spec.d.ts +1 -0
  26. package/dist/e2e_tests/extraKeybindings.spec.js +43 -0
  27. package/dist/e2e_tests/extraKeybindings.spec.js.map +1 -0
  28. package/dist/e2e_tests/historyNavigation.spec.d.ts +1 -0
  29. package/dist/e2e_tests/historyNavigation.spec.js +227 -0
  30. package/dist/e2e_tests/historyNavigation.spec.js.map +1 -0
  31. package/dist/e2e_tests/performanceTest.spec.d.ts +6 -0
  32. package/dist/e2e_tests/performanceTest.spec.js +97 -0
  33. package/dist/e2e_tests/performanceTest.spec.js.map +1 -0
  34. package/dist/e2e_tests/sanityChecks.spec.d.ts +1 -0
  35. package/dist/e2e_tests/sanityChecks.spec.js +53 -0
  36. package/dist/e2e_tests/sanityChecks.spec.js.map +1 -0
  37. package/dist/e2e_tests/signatureHelp.spec.d.ts +1 -0
  38. package/dist/e2e_tests/signatureHelp.spec.js +228 -0
  39. package/dist/e2e_tests/signatureHelp.spec.js.map +1 -0
  40. package/dist/e2e_tests/snippets.spec.d.ts +1 -0
  41. package/dist/e2e_tests/snippets.spec.js +62 -0
  42. package/dist/e2e_tests/snippets.spec.js.map +1 -0
  43. package/dist/e2e_tests/syntaxHighlighting.spec.d.ts +1 -0
  44. package/dist/e2e_tests/syntaxHighlighting.spec.js +90 -0
  45. package/dist/e2e_tests/syntaxHighlighting.spec.js.map +1 -0
  46. package/dist/e2e_tests/syntaxValidation.spec.d.ts +1 -0
  47. package/dist/e2e_tests/syntaxValidation.spec.js +116 -0
  48. package/dist/e2e_tests/syntaxValidation.spec.js.map +1 -0
  49. package/dist/historyNavigation.d.ts +7 -0
  50. package/dist/historyNavigation.js +163 -0
  51. package/dist/historyNavigation.js.map +1 -0
  52. package/dist/icons.d.ts +2 -0
  53. package/dist/icons.js +62 -0
  54. package/dist/icons.js.map +1 -0
  55. package/dist/index.d.ts +4 -0
  56. package/dist/index.js +5 -0
  57. package/dist/index.js.map +1 -0
  58. package/dist/lang-cypher/autocomplete.d.ts +6 -0
  59. package/dist/lang-cypher/autocomplete.js +115 -0
  60. package/dist/lang-cypher/autocomplete.js.map +1 -0
  61. package/dist/lang-cypher/constants.d.ts +42 -0
  62. package/dist/lang-cypher/constants.js +69 -0
  63. package/dist/lang-cypher/constants.js.map +1 -0
  64. package/dist/lang-cypher/contants.test.d.ts +1 -0
  65. package/dist/lang-cypher/contants.test.js +103 -0
  66. package/dist/lang-cypher/contants.test.js.map +1 -0
  67. package/dist/lang-cypher/createCypherTheme.d.ts +26 -0
  68. package/dist/lang-cypher/createCypherTheme.js +182 -0
  69. package/dist/lang-cypher/createCypherTheme.js.map +1 -0
  70. package/dist/lang-cypher/langCypher.d.ts +14 -0
  71. package/dist/lang-cypher/langCypher.js +23 -0
  72. package/dist/lang-cypher/langCypher.js.map +1 -0
  73. package/dist/lang-cypher/lintWorker.d.ts +12 -0
  74. package/dist/lang-cypher/lintWorker.js +14 -0
  75. package/dist/lang-cypher/lintWorker.js.map +1 -0
  76. package/dist/lang-cypher/parser-adapter.d.ts +19 -0
  77. package/dist/lang-cypher/parser-adapter.js +113 -0
  78. package/dist/lang-cypher/parser-adapter.js.map +1 -0
  79. package/dist/lang-cypher/signatureHelp.d.ts +4 -0
  80. package/dist/lang-cypher/signatureHelp.js +109 -0
  81. package/dist/lang-cypher/signatureHelp.js.map +1 -0
  82. package/dist/lang-cypher/syntaxValidation.d.ts +4 -0
  83. package/dist/lang-cypher/syntaxValidation.js +52 -0
  84. package/dist/lang-cypher/syntaxValidation.js.map +1 -0
  85. package/dist/lang-cypher/themeIcons.d.ts +7 -0
  86. package/dist/lang-cypher/themeIcons.js +22 -0
  87. package/dist/lang-cypher/themeIcons.js.map +1 -0
  88. package/dist/lang-cypher/utils.d.ts +2 -0
  89. package/dist/lang-cypher/utils.js +10 -0
  90. package/dist/lang-cypher/utils.js.map +1 -0
  91. package/dist/ndlTokensCopy.d.ts +570 -0
  92. package/dist/ndlTokensCopy.js +571 -0
  93. package/dist/ndlTokensCopy.js.map +1 -0
  94. package/dist/ndlTokensCopy.test.d.ts +1 -0
  95. package/dist/ndlTokensCopy.test.js +12 -0
  96. package/dist/ndlTokensCopy.test.js.map +1 -0
  97. package/dist/neo4jSetup.d.ts +6 -0
  98. package/dist/neo4jSetup.js +120 -0
  99. package/dist/neo4jSetup.js.map +1 -0
  100. package/dist/themes.d.ts +11 -0
  101. package/dist/themes.js +93 -0
  102. package/dist/themes.js.map +1 -0
  103. package/dist/tsconfig.tsbuildinfo +1 -0
  104. package/package.json +82 -0
  105. package/src/CypherEditor.test.tsx +200 -0
  106. package/src/CypherEditor.tsx +607 -0
  107. package/src/constants.ts +1 -0
  108. package/src/e2e_tests/autoCompletion.spec.tsx +546 -0
  109. package/src/e2e_tests/configuration.spec.tsx +111 -0
  110. package/src/e2e_tests/debounce.spec.tsx +106 -0
  111. package/src/e2e_tests/e2eUtils.ts +97 -0
  112. package/src/e2e_tests/extraKeybindings.spec.tsx +55 -0
  113. package/src/e2e_tests/historyNavigation.spec.tsx +315 -0
  114. package/src/e2e_tests/performanceTest.spec.tsx +163 -0
  115. package/src/e2e_tests/sanityChecks.spec.tsx +72 -0
  116. package/src/e2e_tests/signatureHelp.spec.tsx +445 -0
  117. package/src/e2e_tests/snippets.spec.tsx +92 -0
  118. package/src/e2e_tests/syntaxHighlighting.spec.tsx +200 -0
  119. package/src/e2e_tests/syntaxValidation.spec.tsx +243 -0
  120. package/src/historyNavigation.ts +191 -0
  121. package/src/icons.ts +90 -0
  122. package/src/index.ts +4 -0
  123. package/src/lang-cypher/autocomplete.ts +147 -0
  124. package/src/lang-cypher/constants.ts +88 -0
  125. package/src/lang-cypher/contants.test.ts +108 -0
  126. package/src/lang-cypher/createCypherTheme.ts +249 -0
  127. package/src/lang-cypher/langCypher.ts +43 -0
  128. package/src/lang-cypher/lintWorker.ts +31 -0
  129. package/src/lang-cypher/parser-adapter.ts +145 -0
  130. package/src/lang-cypher/signatureHelp.ts +151 -0
  131. package/src/lang-cypher/syntaxValidation.ts +66 -0
  132. package/src/lang-cypher/themeIcons.ts +27 -0
  133. package/src/lang-cypher/utils.ts +9 -0
  134. package/src/ndlTokensCopy.test.ts +12 -0
  135. package/src/ndlTokensCopy.ts +570 -0
  136. package/src/neo4jSetup.tsx +190 -0
  137. package/src/themes.ts +105 -0
  138. package/src/viteEnv.d.ts +1 -0
@@ -0,0 +1,192 @@
1
+ import { EditorState, Extension } from '@codemirror/state';
2
+ import { EditorView, KeyBinding, ViewUpdate } from '@codemirror/view';
3
+ import { type DbSchema } from '@neo4j-cypher/language-support';
4
+ import { Component } from 'react';
5
+ type DomEventHandlers = Parameters<typeof EditorView.domEventHandlers>[0];
6
+ export interface CypherEditorProps {
7
+ /**
8
+ * The prompt to show on single line editors
9
+ */
10
+ prompt?: string;
11
+ /**
12
+ * Custom keybindings to add to the editor.
13
+ * See https://codemirror.net/6/docs/ref/#keymap.of
14
+ */
15
+ extraKeybindings?: KeyBinding[];
16
+ /**
17
+ * Callback on query execution, triggered via ctrl/cmd + Enter.
18
+ * If provided, will enable "repl-mode", which turns on navigating editor history
19
+ *
20
+ * @param cmd - the editor value when ctrl/cmd + enter was pressed
21
+ * @returns void
22
+ */
23
+ onExecute?: (cmd: string) => void;
24
+ /**
25
+ * If true, pressing enter will add a new line to the editor and cmd/ctrl + enter will execute the query.
26
+ * Otherwise pressing enter on a single line will execute the query.
27
+ *
28
+ * @default false
29
+ */
30
+ newLineOnEnter?: boolean;
31
+ /**
32
+ * The editor history navigable via up/down arrow keys. Order newest to oldest.
33
+ * Add to this list with the `onExecute` callback for REPL style history.
34
+ */
35
+ history?: string[];
36
+ /**
37
+ * When set to `true` the editor will use the background color of the parent element.
38
+ *
39
+ * @default false
40
+ */
41
+ overrideThemeBackgroundColor?: boolean;
42
+ /**
43
+ * Whether the editor should take focus on mount.
44
+ * Will move the cursor to the end of the query when provided with an initial value.
45
+ *
46
+ * @default false
47
+ */
48
+ autofocus?: boolean;
49
+ /**
50
+ * Where to place the cursor in the query. Cannot be enabled at the same time than autofocus
51
+ */
52
+ offset?: number;
53
+ /**
54
+ * Whether the editor should wrap lines.
55
+ *
56
+ * @default false
57
+ */
58
+ lineWrap?: boolean;
59
+ /**
60
+ * Whether the editor should perform syntax validation.
61
+ *
62
+ * @default true
63
+ */
64
+ lint?: boolean;
65
+ /**
66
+ * Whether the signature help tooltip should be shown below the text.
67
+ * If false, it will be shown above.
68
+ *
69
+ * @default true
70
+ */
71
+ showSignatureTooltipBelow?: boolean;
72
+ /**
73
+ * Internal feature flags for the editor. Don't use in production
74
+ *
75
+ */
76
+ featureFlags?: {
77
+ consoleCommands?: boolean;
78
+ cypher25?: boolean;
79
+ };
80
+ /**
81
+ * The schema to use for autocompletion and linting.
82
+ *
83
+ * @type {DbSchema}
84
+ */
85
+ schema?: DbSchema;
86
+ /**
87
+ * The current value of the editor.
88
+ */
89
+ value?: string;
90
+ /**
91
+ * Extra css classnames to add to the editor container.
92
+ */
93
+ className?: string;
94
+ /**
95
+ * Set the built in theme or provide a custom theme.
96
+ *
97
+ * `light` / `dark` / `Extension`
98
+ * @default light
99
+ */
100
+ theme?: 'light' | 'dark' | Extension;
101
+ /**
102
+ * Callback when the editor value changes.
103
+ * @param {string} value - the current editor value
104
+ * @param {ViewUpdate} viewUpdate - the view update from codemirror
105
+ */
106
+ onChange?(value: string, viewUpdate: ViewUpdate): void;
107
+ /**
108
+ * Map of event handlers to add to the editor.
109
+ *
110
+ * Note that the props are compared by reference, meaning object defined inline
111
+ * will cause the editor to re-render (much like the style prop does in this example:
112
+ * <div style={{}} />
113
+ *
114
+ * Memoize the object if you want/need to avoid this.
115
+ *
116
+ * @example
117
+ * // listen to blur events
118
+ * <CypherEditor domEventHandlers={{blur: () => console.log("blur event fired")}} />
119
+ */
120
+ domEventHandlers?: DomEventHandlers;
121
+ /**
122
+ * Placeholder text to display when the editor is empty.
123
+ */
124
+ placeholder?: string;
125
+ /**
126
+ * Whether the editor should show line numbers.
127
+ *
128
+ * @default true
129
+ */
130
+ lineNumbers?: boolean;
131
+ /**
132
+ * Whether the editor is read-only.
133
+ *
134
+ * @default false
135
+ */
136
+ readonly?: boolean;
137
+ /**
138
+ * String value to assign to the aria-label attribute of the editor.
139
+ */
140
+ ariaLabel?: string;
141
+ /**
142
+ * Whether keybindings for inserting indents with the Tab key should be disabled.
143
+ *
144
+ * true will not create keybindings for inserting indents.
145
+ * false will create keybindings for inserting indents.
146
+ *
147
+ * @default false
148
+ */
149
+ moveFocusOnTab?: boolean;
150
+ }
151
+ type CypherEditorState = {
152
+ cypherSupportEnabled: boolean;
153
+ };
154
+ export declare class CypherEditor extends Component<CypherEditorProps, CypherEditorState> {
155
+ /**
156
+ * The codemirror editor container.
157
+ */
158
+ editorContainer: React.RefObject<HTMLDivElement>;
159
+ /**
160
+ * The codemirror editor state.
161
+ */
162
+ editorState: React.MutableRefObject<EditorState>;
163
+ /**
164
+ * The codemirror editor view.
165
+ */
166
+ editorView: React.MutableRefObject<EditorView>;
167
+ private schemaRef;
168
+ /**
169
+ * Format Cypher query
170
+ */
171
+ format(): void;
172
+ /**
173
+ * Focus the editor
174
+ */
175
+ focus(): void;
176
+ /**
177
+ * Move the cursor to the supplied position.
178
+ * For example, to move the cursor to the end of the editor, use `value.length`
179
+ */
180
+ updateCursorPosition(position: number): void;
181
+ /**
182
+ * Externally set the editor value and focus the editor.
183
+ */
184
+ setValueAndFocus(value?: string): void;
185
+ static defaultProps: CypherEditorProps;
186
+ private debouncedOnChange;
187
+ componentDidMount(): void;
188
+ componentDidUpdate(prevProps: CypherEditorProps): void;
189
+ componentWillUnmount(): void;
190
+ render(): React.ReactNode;
191
+ }
192
+ export {};
@@ -0,0 +1,326 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { insertNewline } from '@codemirror/commands';
3
+ import { Annotation, Compartment, EditorState, } from '@codemirror/state';
4
+ import { EditorView, keymap, lineNumbers, placeholder, } from '@codemirror/view';
5
+ import { formatQuery, _internalFeatureFlags, } from '@neo4j-cypher/language-support';
6
+ import debounce from 'lodash.debounce';
7
+ import { Component, createRef } from 'react';
8
+ import { DEBOUNCE_TIME } from './constants';
9
+ import { replaceHistory, replMode as historyNavigation, } from './historyNavigation';
10
+ import { cypher } from './lang-cypher/langCypher';
11
+ import { cleanupWorkers } from './lang-cypher/syntaxValidation';
12
+ import { basicNeo4jSetup } from './neo4jSetup';
13
+ import { getThemeExtension } from './themes';
14
+ const format = (view) => {
15
+ try {
16
+ const doc = view.state.doc.toString();
17
+ const { formattedString, newCursorPos } = formatQuery(doc, view.state.selection.main.anchor);
18
+ view.dispatch({
19
+ changes: {
20
+ from: 0,
21
+ to: doc.length,
22
+ insert: formattedString,
23
+ },
24
+ selection: { anchor: newCursorPos },
25
+ });
26
+ }
27
+ catch (error) {
28
+ // Formatting failed, likely because of a syntax error
29
+ }
30
+ };
31
+ const executeKeybinding = (onExecute, newLineOnEnter, flush) => {
32
+ const keybindings = {
33
+ 'Shift-Enter': {
34
+ key: 'Shift-Enter',
35
+ run: insertNewline,
36
+ },
37
+ 'Ctrl-Enter': {
38
+ key: 'Ctrl-Enter',
39
+ run: () => true,
40
+ },
41
+ Enter: {
42
+ key: 'Enter',
43
+ run: insertNewline,
44
+ },
45
+ };
46
+ if (onExecute) {
47
+ keybindings['Ctrl-Enter'] = {
48
+ key: 'Ctrl-Enter',
49
+ mac: 'Mod-Enter',
50
+ preventDefault: true,
51
+ run: (view) => {
52
+ const doc = view.state.doc.toString();
53
+ if (doc.trim() !== '') {
54
+ flush?.();
55
+ onExecute(doc);
56
+ }
57
+ return true;
58
+ },
59
+ };
60
+ if (!newLineOnEnter) {
61
+ keybindings['Enter'] = {
62
+ key: 'Enter',
63
+ preventDefault: true,
64
+ run: (view) => {
65
+ const doc = view.state.doc.toString();
66
+ if (doc.includes('\n')) {
67
+ // Returning false means the event will mark the event
68
+ // as not handled and the default behavior will be executed
69
+ return false;
70
+ }
71
+ if (doc.trim() !== '') {
72
+ flush?.();
73
+ onExecute(doc);
74
+ }
75
+ return true;
76
+ },
77
+ };
78
+ }
79
+ }
80
+ return Object.values(keybindings);
81
+ };
82
+ const themeCompartment = new Compartment();
83
+ const keyBindingCompartment = new Compartment();
84
+ const lineNumbersCompartment = new Compartment();
85
+ const readOnlyCompartment = new Compartment();
86
+ const placeholderCompartment = new Compartment();
87
+ const domEventHandlerCompartment = new Compartment();
88
+ const formatLineNumber = (prompt) => (a, state) => {
89
+ if (state.doc.lines === 1 && prompt !== undefined) {
90
+ return prompt;
91
+ }
92
+ return a.toString();
93
+ };
94
+ const ExternalEdit = Annotation.define();
95
+ export class CypherEditor extends Component {
96
+ /**
97
+ * The codemirror editor container.
98
+ */
99
+ editorContainer = createRef();
100
+ /**
101
+ * The codemirror editor state.
102
+ */
103
+ editorState = createRef();
104
+ /**
105
+ * The codemirror editor view.
106
+ */
107
+ editorView = createRef();
108
+ schemaRef = createRef();
109
+ /**
110
+ * Format Cypher query
111
+ */
112
+ format() {
113
+ format(this.editorView.current);
114
+ }
115
+ /**
116
+ * Focus the editor
117
+ */
118
+ focus() {
119
+ this.editorView.current?.focus();
120
+ }
121
+ /**
122
+ * Move the cursor to the supplied position.
123
+ * For example, to move the cursor to the end of the editor, use `value.length`
124
+ */
125
+ updateCursorPosition(position) {
126
+ this.editorView.current?.dispatch({
127
+ selection: { anchor: position, head: position },
128
+ });
129
+ }
130
+ /**
131
+ * Externally set the editor value and focus the editor.
132
+ */
133
+ setValueAndFocus(value = '') {
134
+ const currentCmValue = this.editorView.current.state?.doc.toString() ?? '';
135
+ this.editorView.current.dispatch({
136
+ changes: {
137
+ from: 0,
138
+ to: currentCmValue.length,
139
+ insert: value,
140
+ },
141
+ selection: { anchor: value.length, head: value.length },
142
+ });
143
+ this.editorView.current?.focus();
144
+ }
145
+ static defaultProps = {
146
+ lint: true,
147
+ schema: {},
148
+ overrideThemeBackgroundColor: false,
149
+ lineWrap: false,
150
+ showSignatureTooltipBelow: true,
151
+ extraKeybindings: [],
152
+ history: [],
153
+ theme: 'light',
154
+ lineNumbers: true,
155
+ newLineOnEnter: false,
156
+ moveFocusOnTab: false,
157
+ };
158
+ debouncedOnChange = this.props.onChange
159
+ ? debounce(((value, viewUpdate) => {
160
+ this.props.onChange(value, viewUpdate);
161
+ }), DEBOUNCE_TIME)
162
+ : undefined;
163
+ componentDidMount() {
164
+ const { theme, extraKeybindings, lineWrap, overrideThemeBackgroundColor, schema, lint, showSignatureTooltipBelow, featureFlags, onExecute, newLineOnEnter, } = this.props;
165
+ _internalFeatureFlags.cypher25 = featureFlags?.cypher25 ?? false;
166
+ this.schemaRef.current = {
167
+ schema,
168
+ lint,
169
+ showSignatureTooltipBelow,
170
+ featureFlags: {
171
+ consoleCommands: true,
172
+ ...featureFlags,
173
+ },
174
+ useLightVersion: false,
175
+ setUseLightVersion: (newVal) => {
176
+ if (this.schemaRef.current !== undefined) {
177
+ this.schemaRef.current.useLightVersion = newVal;
178
+ }
179
+ },
180
+ };
181
+ const themeExtension = getThemeExtension(theme, overrideThemeBackgroundColor);
182
+ const changeListener = this.debouncedOnChange
183
+ ? [
184
+ EditorView.updateListener.of((upt) => {
185
+ const wasUserEdit = !upt.transactions.some((tr) => tr.annotation(ExternalEdit));
186
+ if (upt.docChanged && wasUserEdit) {
187
+ const doc = upt.state.doc;
188
+ const value = doc.toString();
189
+ this.debouncedOnChange(value, upt);
190
+ }
191
+ }),
192
+ ]
193
+ : [];
194
+ this.editorState.current = EditorState.create({
195
+ extensions: [
196
+ keyBindingCompartment.of(keymap.of([
197
+ ...executeKeybinding(onExecute, newLineOnEnter, () => this.debouncedOnChange?.flush()),
198
+ ...extraKeybindings,
199
+ ])),
200
+ historyNavigation(this.props),
201
+ basicNeo4jSetup(this.props),
202
+ themeCompartment.of(themeExtension),
203
+ changeListener,
204
+ cypher(this.schemaRef.current),
205
+ lineWrap ? EditorView.lineWrapping : [],
206
+ lineNumbersCompartment.of(this.props.lineNumbers
207
+ ? lineNumbers({ formatNumber: formatLineNumber(this.props.prompt) })
208
+ : []),
209
+ readOnlyCompartment.of(EditorState.readOnly.of(this.props.readonly)),
210
+ placeholderCompartment.of(this.props.placeholder ? placeholder(this.props.placeholder) : []),
211
+ domEventHandlerCompartment.of(this.props.domEventHandlers
212
+ ? EditorView.domEventHandlers(this.props.domEventHandlers)
213
+ : []),
214
+ this.props.ariaLabel
215
+ ? EditorView.contentAttributes.of({
216
+ 'aria-label': this.props.ariaLabel,
217
+ })
218
+ : [],
219
+ ],
220
+ doc: this.props.value,
221
+ });
222
+ this.editorView.current = new EditorView({
223
+ state: this.editorState.current,
224
+ parent: this.editorContainer.current,
225
+ });
226
+ if (this.props.autofocus) {
227
+ this.focus();
228
+ if (this.props.value) {
229
+ this.updateCursorPosition(this.props.value.length);
230
+ }
231
+ }
232
+ else if (this.props.offset) {
233
+ this.updateCursorPosition(this.props.offset);
234
+ }
235
+ }
236
+ componentDidUpdate(prevProps) {
237
+ if (!this.editorView.current) {
238
+ return;
239
+ }
240
+ // Handle externally set value
241
+ const currentCmValue = this.editorView.current.state?.doc.toString() ?? '';
242
+ if (this.props.value !== undefined && // If the component becomes uncontolled, we just leave the value as is
243
+ this.props.value !== prevProps.value && // The value prop has changed, we need to update the editor
244
+ this.props.value !== currentCmValue // No need to dispatch an update if the value is the same
245
+ ) {
246
+ this.editorView.current.dispatch({
247
+ changes: {
248
+ from: 0,
249
+ to: currentCmValue.length,
250
+ insert: this.props.value ?? '',
251
+ },
252
+ annotations: [ExternalEdit.of(true)],
253
+ });
254
+ }
255
+ // Handle theme change
256
+ const didChangeTheme = prevProps.theme !== this.props.theme ||
257
+ prevProps.overrideThemeBackgroundColor !==
258
+ this.props.overrideThemeBackgroundColor;
259
+ if (didChangeTheme) {
260
+ this.editorView.current.dispatch({
261
+ effects: themeCompartment.reconfigure(getThemeExtension(this.props.theme, this.props.overrideThemeBackgroundColor)),
262
+ });
263
+ }
264
+ if (prevProps.lineNumbers !== this.props.lineNumbers ||
265
+ prevProps.prompt !== this.props.prompt) {
266
+ this.editorView.current.dispatch({
267
+ effects: lineNumbersCompartment.reconfigure(this.props.lineNumbers
268
+ ? lineNumbers({ formatNumber: formatLineNumber(this.props.prompt) })
269
+ : []),
270
+ });
271
+ }
272
+ if (prevProps.readonly !== this.props.readonly) {
273
+ this.editorView.current.dispatch({
274
+ effects: readOnlyCompartment.reconfigure(EditorState.readOnly.of(this.props.readonly)),
275
+ });
276
+ }
277
+ if (prevProps.placeholder !== this.props.placeholder) {
278
+ this.editorView.current.dispatch({
279
+ effects: placeholderCompartment.reconfigure(this.props.placeholder ? placeholder(this.props.placeholder) : []),
280
+ });
281
+ }
282
+ if (prevProps.extraKeybindings !== this.props.extraKeybindings ||
283
+ prevProps.onExecute !== this.props.onExecute) {
284
+ this.editorView.current.dispatch({
285
+ effects: keyBindingCompartment.reconfigure(keymap.of([
286
+ ...executeKeybinding(this.props.onExecute, this.props.newLineOnEnter, () => this.debouncedOnChange?.flush()),
287
+ ...this.props.extraKeybindings,
288
+ ])),
289
+ });
290
+ }
291
+ if (prevProps.domEventHandlers !== this.props.domEventHandlers) {
292
+ this.editorView.current.dispatch({
293
+ effects: domEventHandlerCompartment.reconfigure(this.props.domEventHandlers
294
+ ? EditorView.domEventHandlers(this.props.domEventHandlers)
295
+ : []),
296
+ });
297
+ }
298
+ // This component rerenders on every keystroke and comparing the
299
+ // full lists of editor strings on every render could be expensive.
300
+ const didChangeHistoryEstimate = prevProps.history?.length !== this.props.history?.length ||
301
+ prevProps.history?.[0] !== this.props.history?.[0];
302
+ if (didChangeHistoryEstimate) {
303
+ this.editorView.current.dispatch({
304
+ effects: replaceHistory.of(this.props.history ?? []),
305
+ });
306
+ }
307
+ /*
308
+ The cypher configuration is a mutable object that is passed to the cypher language extension.
309
+ Much like how the schema based completions work in the official sql language extension.
310
+ https://github.com/codemirror/lang-sql/blob/4b7b2564dff7cdb1a15f8ccd08142f2cc8a0006f/src/sql.ts#L178C17-L178C18
311
+ */
312
+ this.schemaRef.current.schema = this.props.schema;
313
+ this.schemaRef.current.lint = this.props.lint;
314
+ this.schemaRef.current.featureFlags = this.props.featureFlags;
315
+ }
316
+ componentWillUnmount() {
317
+ this.editorView.current?.destroy();
318
+ cleanupWorkers();
319
+ }
320
+ render() {
321
+ const { className, theme } = this.props;
322
+ const themeClass = typeof theme === 'string' ? `cm-theme-${theme}` : 'cm-theme';
323
+ return (_jsx("div", { ref: this.editorContainer, className: `${themeClass}${className ? ` ${className}` : ''}` }));
324
+ }
325
+ }
326
+ //# sourceMappingURL=CypherEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"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