@neo4j-cypher/react-codemirror 2.0.0-next.3 → 2.0.0-next.31

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 (163) hide show
  1. package/CHANGELOG.md +265 -0
  2. package/README.md +3 -2
  3. package/dist/{types → src}/CypherEditor.d.ts +81 -3
  4. package/dist/src/CypherEditor.js +336 -0
  5. package/dist/src/CypherEditor.js.map +1 -0
  6. package/dist/src/CypherEditor.test.js +154 -0
  7. package/dist/src/CypherEditor.test.js.map +1 -0
  8. package/dist/src/constants.d.ts +1 -0
  9. package/dist/src/constants.js +2 -0
  10. package/dist/src/constants.js.map +1 -0
  11. package/dist/src/e2e_tests/autoCompletion.spec.js +332 -0
  12. package/dist/src/e2e_tests/autoCompletion.spec.js.map +1 -0
  13. package/dist/src/e2e_tests/configuration.spec.js +83 -0
  14. package/dist/src/e2e_tests/configuration.spec.js.map +1 -0
  15. package/dist/src/e2e_tests/debounce.spec.js +66 -0
  16. package/dist/src/e2e_tests/debounce.spec.js.map +1 -0
  17. package/dist/{types/e2e_tests/e2e-utils.d.ts → src/e2e_tests/e2eUtils.d.ts} +2 -0
  18. package/dist/src/e2e_tests/e2eUtils.js +79 -0
  19. package/dist/src/e2e_tests/e2eUtils.js.map +1 -0
  20. package/dist/src/e2e_tests/extraKeybindings.spec.js +43 -0
  21. package/dist/src/e2e_tests/extraKeybindings.spec.js.map +1 -0
  22. package/dist/src/e2e_tests/historyNavigation.spec.js +227 -0
  23. package/dist/src/e2e_tests/historyNavigation.spec.js.map +1 -0
  24. package/dist/src/e2e_tests/performanceTest.spec.d.ts +6 -0
  25. package/dist/src/e2e_tests/performanceTest.spec.js +97 -0
  26. package/dist/src/e2e_tests/performanceTest.spec.js.map +1 -0
  27. package/dist/src/e2e_tests/sanityChecks.spec.js +53 -0
  28. package/dist/src/e2e_tests/sanityChecks.spec.js.map +1 -0
  29. package/dist/src/e2e_tests/signatureHelp.spec.js +228 -0
  30. package/dist/src/e2e_tests/signatureHelp.spec.js.map +1 -0
  31. package/dist/src/e2e_tests/snippets.spec.js +62 -0
  32. package/dist/src/e2e_tests/snippets.spec.js.map +1 -0
  33. package/dist/src/e2e_tests/syntaxHighlighting.spec.d.ts +1 -0
  34. package/dist/src/e2e_tests/syntaxHighlighting.spec.js +90 -0
  35. package/dist/src/e2e_tests/syntaxHighlighting.spec.js.map +1 -0
  36. package/dist/src/e2e_tests/syntaxValidation.spec.d.ts +1 -0
  37. package/dist/src/e2e_tests/syntaxValidation.spec.js +126 -0
  38. package/dist/src/e2e_tests/syntaxValidation.spec.js.map +1 -0
  39. package/dist/src/historyNavigation.js +163 -0
  40. package/dist/src/historyNavigation.js.map +1 -0
  41. package/dist/{types → src}/icons.d.ts +1 -1
  42. package/dist/src/icons.js +62 -0
  43. package/dist/src/icons.js.map +1 -0
  44. package/dist/src/index.d.ts +4 -0
  45. package/dist/src/index.js +5 -0
  46. package/dist/src/index.js.map +1 -0
  47. package/dist/src/lang-cypher/autocomplete.d.ts +6 -0
  48. package/dist/src/lang-cypher/autocomplete.js +113 -0
  49. package/dist/src/lang-cypher/autocomplete.js.map +1 -0
  50. package/dist/{types → src}/lang-cypher/constants.d.ts +11 -0
  51. package/dist/src/lang-cypher/constants.js +69 -0
  52. package/dist/src/lang-cypher/constants.js.map +1 -0
  53. package/dist/src/lang-cypher/contants.test.d.ts +1 -0
  54. package/dist/src/lang-cypher/contants.test.js +103 -0
  55. package/dist/src/lang-cypher/contants.test.js.map +1 -0
  56. package/dist/src/lang-cypher/createCypherTheme.js +183 -0
  57. package/dist/src/lang-cypher/createCypherTheme.js.map +1 -0
  58. package/dist/src/lang-cypher/langCypher.d.ts +13 -0
  59. package/dist/src/lang-cypher/langCypher.js +23 -0
  60. package/dist/src/lang-cypher/langCypher.js.map +1 -0
  61. package/dist/src/lang-cypher/lintWorker.mjs +2022 -0
  62. package/dist/src/lang-cypher/parser-adapter.d.ts +19 -0
  63. package/dist/src/lang-cypher/parser-adapter.js +113 -0
  64. package/dist/src/lang-cypher/parser-adapter.js.map +1 -0
  65. package/dist/src/lang-cypher/signatureHelp.d.ts +4 -0
  66. package/dist/src/lang-cypher/signatureHelp.js +109 -0
  67. package/dist/src/lang-cypher/signatureHelp.js.map +1 -0
  68. package/dist/{types/lang-cypher/syntax-validation.d.ts → src/lang-cypher/syntaxValidation.d.ts} +2 -1
  69. package/dist/src/lang-cypher/syntaxValidation.js +57 -0
  70. package/dist/src/lang-cypher/syntaxValidation.js.map +1 -0
  71. package/dist/src/lang-cypher/themeIcons.js +22 -0
  72. package/dist/src/lang-cypher/themeIcons.js.map +1 -0
  73. package/dist/src/lang-cypher/utils.d.ts +2 -0
  74. package/dist/src/lang-cypher/utils.js +10 -0
  75. package/dist/src/lang-cypher/utils.js.map +1 -0
  76. package/dist/src/ndlTokensCopy.d.ts +570 -0
  77. package/dist/src/ndlTokensCopy.js +571 -0
  78. package/dist/src/ndlTokensCopy.js.map +1 -0
  79. package/dist/src/ndlTokensCopy.test.d.ts +1 -0
  80. package/dist/src/ndlTokensCopy.test.js +12 -0
  81. package/dist/src/ndlTokensCopy.test.js.map +1 -0
  82. package/dist/src/neo4jSetup.d.ts +6 -0
  83. package/dist/src/neo4jSetup.js +120 -0
  84. package/dist/src/neo4jSetup.js.map +1 -0
  85. package/dist/src/richClipboardCopier.d.ts +4 -0
  86. package/dist/src/richClipboardCopier.js +78 -0
  87. package/dist/src/richClipboardCopier.js.map +1 -0
  88. package/dist/src/richClipboardCopier.test.d.ts +1 -0
  89. package/dist/src/richClipboardCopier.test.js +53 -0
  90. package/dist/src/richClipboardCopier.test.js.map +1 -0
  91. package/dist/{types → src}/themes.d.ts +1 -1
  92. package/dist/src/themes.js +93 -0
  93. package/dist/src/themes.js.map +1 -0
  94. package/dist/tsconfig.tsbuildinfo +1 -0
  95. package/package.json +43 -41
  96. package/src/CypherEditor.test.tsx +204 -0
  97. package/src/CypherEditor.tsx +316 -42
  98. package/src/constants.ts +1 -0
  99. package/src/e2e_tests/autoCompletion.spec.tsx +571 -0
  100. package/src/e2e_tests/configuration.spec.tsx +111 -0
  101. package/src/e2e_tests/debounce.spec.tsx +106 -0
  102. package/src/e2e_tests/{e2e-utils.ts → e2eUtils.ts} +41 -3
  103. package/src/e2e_tests/{extra-keybindings.spec.tsx → extraKeybindings.spec.tsx} +1 -3
  104. package/src/e2e_tests/{history-navigation.spec.tsx → historyNavigation.spec.tsx} +137 -18
  105. package/src/e2e_tests/performanceTest.spec.tsx +163 -0
  106. package/src/e2e_tests/{sanity-checks.spec.tsx → sanityChecks.spec.tsx} +7 -22
  107. package/src/e2e_tests/signatureHelp.spec.tsx +444 -0
  108. package/src/e2e_tests/snippets.spec.tsx +92 -0
  109. package/src/e2e_tests/{syntax-highlighting.spec.tsx → syntaxHighlighting.spec.tsx} +26 -24
  110. package/src/e2e_tests/syntaxValidation.spec.tsx +259 -0
  111. package/src/{history-navigation.ts → historyNavigation.ts} +1 -1
  112. package/src/icons.ts +3 -0
  113. package/src/index.ts +2 -2
  114. package/src/lang-cypher/autocomplete.ts +99 -18
  115. package/src/lang-cypher/constants.ts +27 -0
  116. package/src/lang-cypher/contants.test.ts +6 -2
  117. package/src/lang-cypher/{create-cypher-theme.ts → createCypherTheme.ts} +45 -2
  118. package/src/lang-cypher/langCypher.ts +42 -0
  119. package/src/lang-cypher/lintWorker.mjs +2022 -0
  120. package/src/lang-cypher/parser-adapter.ts +145 -0
  121. package/src/lang-cypher/signatureHelp.ts +151 -0
  122. package/src/lang-cypher/syntaxValidation.ts +72 -0
  123. package/src/lang-cypher/utils.ts +9 -0
  124. package/src/{ndl-tokens-copy.test.ts → ndlTokensCopy.test.ts} +2 -1
  125. package/src/ndlTokensCopy.ts +570 -0
  126. package/src/{neo4j-setup.tsx → neo4jSetup.tsx} +78 -17
  127. package/src/richClipboardCopier.test.ts +65 -0
  128. package/src/richClipboardCopier.ts +99 -0
  129. package/src/themes.ts +45 -70
  130. package/src/viteEnv.d.ts +1 -0
  131. package/dist/cjs/index.cjs +0 -1440
  132. package/dist/cjs/index.cjs.map +0 -7
  133. package/dist/esm/index.mjs +0 -1463
  134. package/dist/esm/index.mjs.map +0 -7
  135. package/dist/types/e2e_tests/mock-data.d.ts +0 -3779
  136. package/dist/types/index.d.ts +0 -4
  137. package/dist/types/lang-cypher/ParserAdapter.d.ts +0 -14
  138. package/dist/types/lang-cypher/autocomplete.d.ts +0 -3
  139. package/dist/types/lang-cypher/lang-cypher.d.ts +0 -7
  140. package/dist/types/ndl-tokens-copy.d.ts +0 -379
  141. package/dist/types/neo4j-setup.d.ts +0 -2
  142. package/dist/types/tsconfig.tsbuildinfo +0 -1
  143. package/src/e2e_tests/auto-completion.spec.tsx +0 -232
  144. package/src/e2e_tests/mock-data.ts +0 -4310
  145. package/src/e2e_tests/performance-test.spec.tsx +0 -71
  146. package/src/e2e_tests/syntax-validation.spec.tsx +0 -156
  147. package/src/lang-cypher/ParserAdapter.ts +0 -92
  148. package/src/lang-cypher/lang-cypher.ts +0 -32
  149. package/src/lang-cypher/syntax-validation.ts +0 -24
  150. package/src/ndl-tokens-copy.ts +0 -379
  151. /package/dist/{types/e2e_tests/auto-completion.spec.d.ts → src/CypherEditor.test.d.ts} +0 -0
  152. /package/dist/{types/e2e_tests/extra-keybindings.spec.d.ts → src/e2e_tests/autoCompletion.spec.d.ts} +0 -0
  153. /package/dist/{types/e2e_tests/history-navigation.spec.d.ts → src/e2e_tests/configuration.spec.d.ts} +0 -0
  154. /package/dist/{types/e2e_tests/performance-test.spec.d.ts → src/e2e_tests/debounce.spec.d.ts} +0 -0
  155. /package/dist/{types/e2e_tests/sanity-checks.spec.d.ts → src/e2e_tests/extraKeybindings.spec.d.ts} +0 -0
  156. /package/dist/{types/e2e_tests/syntax-highlighting.spec.d.ts → src/e2e_tests/historyNavigation.spec.d.ts} +0 -0
  157. /package/dist/{types/e2e_tests/syntax-validation.spec.d.ts → src/e2e_tests/sanityChecks.spec.d.ts} +0 -0
  158. /package/dist/{types/lang-cypher/contants.test.d.ts → src/e2e_tests/signatureHelp.spec.d.ts} +0 -0
  159. /package/dist/{types/ndl-tokens-copy.test.d.ts → src/e2e_tests/snippets.spec.d.ts} +0 -0
  160. /package/dist/{types/history-navigation.d.ts → src/historyNavigation.d.ts} +0 -0
  161. /package/dist/{types/lang-cypher/create-cypher-theme.d.ts → src/lang-cypher/createCypherTheme.d.ts} +0 -0
  162. /package/dist/{types/lang-cypher/theme-icons.d.ts → src/lang-cypher/themeIcons.d.ts} +0 -0
  163. /package/src/lang-cypher/{theme-icons.ts → themeIcons.ts} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,270 @@
1
1
  # @neo4j-cypher/react-codemirror
2
2
 
3
+ ## 2.0.0-next.31
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [5df1435]
8
+ - @neo4j-cypher/language-support@2.0.0-next.28
9
+ - @neo4j-cypher/lint-worker@1.10.1-next.5
10
+
11
+ ## 2.0.0-next.30
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies [6a2a408]
16
+ - Updated dependencies [20b31b6]
17
+ - Updated dependencies [68d92a8]
18
+ - @neo4j-cypher/lint-worker@1.10.1-next.4
19
+ - @neo4j-cypher/language-support@2.0.0-next.27
20
+
21
+ ## 2.0.0-next.29
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies [8e8d7f1]
26
+ - Updated dependencies [808aa73]
27
+ - @neo4j-cypher/language-support@2.0.0-next.26
28
+ - @neo4j-cypher/lint-worker@1.10.1-next.3
29
+
30
+ ## 2.0.0-next.28
31
+
32
+ ### Patch Changes
33
+
34
+ - Updated dependencies [b1e686e]
35
+ - @neo4j-cypher/language-support@2.0.0-next.25
36
+ - @neo4j-cypher/lint-worker@1.10.1-next.2
37
+
38
+ ## 2.0.0-next.27
39
+
40
+ ### Patch Changes
41
+
42
+ - 86f5c55: adding rich clipboard copier to codemirror
43
+ - 5fdc6dd: Fixes faulty worker termination on big queries
44
+ - Updated dependencies [246d60c]
45
+ - Updated dependencies [8eacddd]
46
+ - Updated dependencies [3a29711]
47
+ - Updated dependencies [b9c0e9d]
48
+ - Updated dependencies [d77e8a1]
49
+ - Updated dependencies [5fdc6dd]
50
+ - Updated dependencies [7183c63]
51
+ - @neo4j-cypher/lint-worker@1.10.1-next.1
52
+ - @neo4j-cypher/language-support@2.0.0-next.24
53
+
54
+ ## 2.0.0-next.26
55
+
56
+ ### Patch Changes
57
+
58
+ - Updated dependencies [c065d85]
59
+ - @neo4j-cypher/language-support@2.0.0-next.23
60
+ - @neo4j-cypher/lint-worker@1.10.1-next.0
61
+
62
+ ## 2.0.0-next.25
63
+
64
+ ### Patch Changes
65
+
66
+ - d99368c: Ensures CRLF newlines are handled when setting editor value
67
+ - Updated dependencies [ed65ef3]
68
+ - Updated dependencies [7538cfd]
69
+ - Updated dependencies [c1fa91f]
70
+ - Updated dependencies [039d1c5]
71
+ - Updated dependencies [1ef063e]
72
+ - Updated dependencies [a38255f]
73
+ - Updated dependencies [c4f27c9]
74
+ - @neo4j-cypher/language-support@2.0.0-next.22
75
+ - @neo4j-cypher/lint-worker@0.1.0-next.0
76
+
77
+ ## 2.0.0-next.24
78
+
79
+ ### Patch Changes
80
+
81
+ - 8b03317: resetting z index for cm panels
82
+ - Updated dependencies [4b0ee37]
83
+ - @neo4j-cypher/language-support@2.0.0-next.21
84
+ - @neo4j-cypher/lint-worker@2025.4.1-next.0
85
+
86
+ ## 2.0.0-next.23
87
+
88
+ ### Patch Changes
89
+
90
+ - Updated dependencies [013e4ff]
91
+ - @neo4j-cypher/language-support@2.0.0-next.20
92
+
93
+ ## 2.0.0-next.22
94
+
95
+ ### Patch Changes
96
+
97
+ - 5bfdac2: restructure packages as part of move to pnpm
98
+ - Updated dependencies [88e4930]
99
+ - Updated dependencies [5bfdac2]
100
+ - @neo4j-cypher/language-support@2.0.0-next.19
101
+
102
+ ## 2.0.0-next.21
103
+
104
+ ### Patch Changes
105
+
106
+ - Updated dependencies [1b971aa]
107
+ - Updated dependencies [07ac90f]
108
+ - @neo4j-cypher/language-support@2.0.0-next.18
109
+
110
+ ## 2.0.0-next.20
111
+
112
+ ### Patch Changes
113
+
114
+ - Updated dependencies [bffbb19]
115
+ - Updated dependencies [826d922]
116
+ - Updated dependencies [1caab0c]
117
+ - @neo4j-cypher/language-support@2.0.0-next.17
118
+
119
+ ## 2.0.0-next.19
120
+
121
+ ### Patch Changes
122
+
123
+ - a3e3e50: updating themes to use needle colors
124
+ - Updated dependencies [68f55d4]
125
+ - Updated dependencies [6d00433]
126
+ - Updated dependencies [c01b32a]
127
+ - @neo4j-cypher/language-support@2.0.0-next.16
128
+
129
+ ## 2.0.0-next.18
130
+
131
+ ### Patch Changes
132
+
133
+ - Updated dependencies [50cc73e]
134
+ - Updated dependencies [5ef538d]
135
+ - Updated dependencies [b988d3b]
136
+ - @neo4j-cypher/language-support@2.0.0-next.15
137
+
138
+ ## 2.0.0-next.17
139
+
140
+ ### Patch Changes
141
+
142
+ - 245fb6a: Automatically opens autocompletions after "YIELD "
143
+ - Updated dependencies [8ec797d]
144
+ - Updated dependencies [7aa9c3a]
145
+ - Updated dependencies [2be5469]
146
+ - Updated dependencies [245fb6a]
147
+ - Updated dependencies [c587b81]
148
+ - Updated dependencies [3f8b64f]
149
+ - Updated dependencies [043d766]
150
+ - Updated dependencies [704d1c5]
151
+ - @neo4j-cypher/language-support@2.0.0-next.14
152
+
153
+ ## 2.0.0-next.16
154
+
155
+ ### Patch Changes
156
+
157
+ - Updated dependencies [84a12fc]
158
+ - Updated dependencies [d329252]
159
+ - Updated dependencies [b0e419e]
160
+ - @neo4j-cypher/language-support@2.0.0-next.13
161
+
162
+ ## 2.0.0-next.15
163
+
164
+ ### Patch Changes
165
+
166
+ - adc5b64: using custom light color theme for the cypher editor
167
+ - Updated dependencies [88fbe63]
168
+ - Updated dependencies [22081b0]
169
+ - Updated dependencies [62ac442]
170
+ - @neo4j-cypher/language-support@2.0.0-next.12
171
+
172
+ ## 2.0.0-next.14
173
+
174
+ ### Patch Changes
175
+
176
+ - d85c1e0: Fixes bug with auto-completions
177
+ - Updated dependencies [bccf518]
178
+ - @neo4j-cypher/language-support@2.0.0-next.11
179
+
180
+ ## 2.0.0-next.13
181
+
182
+ ### Patch Changes
183
+
184
+ - Updated dependencies [8760c02]
185
+ - @neo4j-cypher/language-support@2.0.0-next.10
186
+
187
+ ## 2.0.0-next.12
188
+
189
+ ### Patch Changes
190
+
191
+ - dcbe67d: Expose moveFocusOnTab property on the CypherEditor component to conditionally disable tab keymappings
192
+ - e9621c8: Re-export language support from react codemirror
193
+ - Updated dependencies [2e72ac8]
194
+ - @neo4j-cypher/language-support@2.0.0-next.9
195
+
196
+ ## 2.0.0-next.11
197
+
198
+ ### Patch Changes
199
+
200
+ - Updated dependencies [05663bd]
201
+ - @neo4j-cypher/language-support@2.0.0-next.8
202
+
203
+ ## 2.0.0-next.10
204
+
205
+ ### Patch Changes
206
+
207
+ - bb7e9d3: Simplify detection and handling of value prop updates
208
+
209
+ ## 2.0.0-next.9
210
+
211
+ ### Patch Changes
212
+
213
+ - fbd5f7e: allow signature help panel to render below editor when there's not enough space above it
214
+ - 09dfae2: Add an ariaLabel prop to CypherEditor
215
+ - 7154e94: Fix bug causing debouncing to override value
216
+ - 62c152f: execute single line query on enter by default
217
+ - cbfc75e: Fix a bug causing debounced value updates to get cancelled erroneously
218
+ - 04ae35e: Set initial latestDispatchedValue and flush debounced changes onExecute
219
+ Add tests for debounce behaviour
220
+ - Updated dependencies [3661e9d]
221
+ - Updated dependencies [b76af58]
222
+ - Updated dependencies [21699b7]
223
+ - Updated dependencies [6afc0e3]
224
+ - Updated dependencies [39b924d]
225
+ - @neo4j-cypher/language-support@2.0.0-next.7
226
+
227
+ ## 2.0.0-next.8
228
+
229
+ ### Patch Changes
230
+
231
+ - 6cc9022: Adds more props to the CypherEditor component
232
+ - Updated dependencies [e92d8c7]
233
+ - @neo4j-cypher/language-support@2.0.0-next.6
234
+
235
+ ## 2.0.0-next.7
236
+
237
+ ### Patch Changes
238
+
239
+ - Updated dependencies [1f790d0]
240
+ - @neo4j-cypher/language-support@2.0.0-next.5
241
+
242
+ ## 2.0.0-next.6
243
+
244
+ ### Patch Changes
245
+
246
+ - Updated dependencies
247
+ - @neo4j-cypher/language-support@2.0.0-next.4
248
+
249
+ ## 2.0.0-next.5
250
+
251
+ ### Patch Changes
252
+
253
+ - 8cc77c6: Add support for console commands
254
+ - 1e210cb: Moves semantic analysis to a separate worker file
255
+ - Updated dependencies [8cc77c6]
256
+ - Updated dependencies [1e210cb]
257
+ - Updated dependencies [f6d20b2]
258
+ - @neo4j-cypher/language-support@2.0.0-next.3
259
+
260
+ ## 2.0.0-next.4
261
+
262
+ ### Patch Changes
263
+
264
+ - 8de605b: Improved history prop change detection
265
+ - Updated dependencies [17909e3]
266
+ - @neo4j-cypher/language-support@2.0.0-next.2
267
+
3
268
  ## 2.0.0-next.3
4
269
 
5
270
  ### Patch Changes
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # React Codemirror
2
2
 
3
- This package can be built with `npm run build` and then published to npm with `npm publish`.
3
+ This package can be built with `pnpm build` and then published to npm with `pnpm publish`.
4
4
 
5
5
  ## Usage
6
6
 
@@ -27,7 +27,8 @@ For a full example, see the [react-codemirror-playground](https://github.com/neo
27
27
  Currently we only support using the codemirror editor via the react wrapper, but we plan to release the codemirror extensions separately as well.
28
28
 
29
29
  ## Learning codemirror
30
- It can take a little time to get into the CodeMirror6 ways of thinking, Trevor Harmon has a [great blog post](https://thetrevorharmon.com/blog/learning-codemirror/) explaining the cm6 "primitives". He also has a demo on how to integrate ANTLR4 with codemirror over [here](https://github.com/thetrevorharmon/zephyr-demo).
30
+
31
+ It can take a little time to get into the CodeMirror6 ways of thinking, Trevor Harmon has a [great blog post](https://thetrevorharmon.com/blog/learning-codemirror/) explaining the cm6 "primitives". He also has a demo on how to integrate ANTLR4 with codemirror over [here](https://github.com/thetrevorharmon/zephyr-demo).
31
32
 
32
33
  ### Completion Icons
33
34
 
@@ -1,7 +1,8 @@
1
1
  import { EditorState, Extension } from '@codemirror/state';
2
2
  import { EditorView, KeyBinding, ViewUpdate } from '@codemirror/view';
3
- import type { DbSchema } from '@neo4j-cypher/language-support';
3
+ import { type DbSchema } from '@neo4j-cypher/language-support';
4
4
  import { Component } from 'react';
5
+ type DomEventHandlers = Parameters<typeof EditorView.domEventHandlers>[0];
5
6
  export interface CypherEditorProps {
6
7
  /**
7
8
  * The prompt to show on single line editors
@@ -21,7 +22,14 @@ export interface CypherEditorProps {
21
22
  */
22
23
  onExecute?: (cmd: string) => void;
23
24
  /**
24
- * The editor history navigateable via up/down arrow keys. Order newest to oldest.
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.
25
33
  * Add to this list with the `onExecute` callback for REPL style history.
26
34
  */
27
35
  history?: string[];
@@ -38,6 +46,10 @@ export interface CypherEditorProps {
38
46
  * @default false
39
47
  */
40
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;
41
53
  /**
42
54
  * Whether the editor should wrap lines.
43
55
  *
@@ -50,6 +62,20 @@ export interface CypherEditorProps {
50
62
  * @default true
51
63
  */
52
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
+ };
53
79
  /**
54
80
  * The schema to use for autocompletion and linting.
55
81
  *
@@ -77,8 +103,54 @@ export interface CypherEditorProps {
77
103
  * @param {ViewUpdate} viewUpdate - the view update from codemirror
78
104
  */
79
105
  onChange?(value: string, viewUpdate: ViewUpdate): void;
106
+ /**
107
+ * Map of event handlers to add to the editor.
108
+ *
109
+ * Note that the props are compared by reference, meaning object defined inline
110
+ * will cause the editor to re-render (much like the style prop does in this example:
111
+ * <div style={{}} />
112
+ *
113
+ * Memoize the object if you want/need to avoid this.
114
+ *
115
+ * @example
116
+ * // listen to blur events
117
+ * <CypherEditor domEventHandlers={{blur: () => console.log("blur event fired")}} />
118
+ */
119
+ domEventHandlers?: DomEventHandlers;
120
+ /**
121
+ * Placeholder text to display when the editor is empty.
122
+ */
123
+ placeholder?: string;
124
+ /**
125
+ * Whether the editor should show line numbers.
126
+ *
127
+ * @default true
128
+ */
129
+ lineNumbers?: boolean;
130
+ /**
131
+ * Whether the editor is read-only.
132
+ *
133
+ * @default false
134
+ */
135
+ readonly?: boolean;
136
+ /**
137
+ * String value to assign to the aria-label attribute of the editor.
138
+ */
139
+ ariaLabel?: string;
140
+ /**
141
+ * Whether keybindings for inserting indents with the Tab key should be disabled.
142
+ *
143
+ * true will not create keybindings for inserting indents.
144
+ * false will create keybindings for inserting indents.
145
+ *
146
+ * @default false
147
+ */
148
+ moveFocusOnTab?: boolean;
80
149
  }
81
- export declare class CypherEditor extends Component<CypherEditorProps> {
150
+ type CypherEditorState = {
151
+ cypherSupportEnabled: boolean;
152
+ };
153
+ export declare class CypherEditor extends Component<CypherEditorProps, CypherEditorState> {
82
154
  /**
83
155
  * The codemirror editor container.
84
156
  */
@@ -92,6 +164,10 @@ export declare class CypherEditor extends Component<CypherEditorProps> {
92
164
  */
93
165
  editorView: React.MutableRefObject<EditorView>;
94
166
  private schemaRef;
167
+ /**
168
+ * Format Cypher query
169
+ */
170
+ format(): void;
95
171
  /**
96
172
  * Focus the editor
97
173
  */
@@ -106,8 +182,10 @@ export declare class CypherEditor extends Component<CypherEditorProps> {
106
182
  */
107
183
  setValueAndFocus(value?: string): void;
108
184
  static defaultProps: CypherEditorProps;
185
+ private debouncedOnChange;
109
186
  componentDidMount(): void;
110
187
  componentDidUpdate(prevProps: CypherEditorProps): void;
111
188
  componentWillUnmount(): void;
112
189
  render(): React.ReactNode;
113
190
  }
191
+ export {};