@neo4j-cypher/react-codemirror 2.0.0-next.4 → 2.0.0-next.41

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 (186) hide show
  1. package/CHANGELOG.md +370 -0
  2. package/README.md +3 -2
  3. package/dist/src/CypherEditor.d.ts +245 -0
  4. package/dist/src/CypherEditor.js +513 -0
  5. package/dist/src/CypherEditor.js.map +1 -0
  6. package/dist/src/CypherEditor.test.js +162 -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/diffView.d.ts +13 -0
  12. package/dist/src/diffView.js +11 -0
  13. package/dist/src/diffView.js.map +1 -0
  14. package/dist/src/e2e_tests/autoCompletion.spec.js +334 -0
  15. package/dist/src/e2e_tests/autoCompletion.spec.js.map +1 -0
  16. package/dist/src/e2e_tests/configuration.spec.js +83 -0
  17. package/dist/src/e2e_tests/configuration.spec.js.map +1 -0
  18. package/dist/src/e2e_tests/debounce.spec.js +66 -0
  19. package/dist/src/e2e_tests/debounce.spec.js.map +1 -0
  20. package/dist/{types/e2e_tests/e2e-utils.d.ts → src/e2e_tests/e2eUtils.d.ts} +2 -0
  21. package/dist/src/e2e_tests/e2eUtils.js +79 -0
  22. package/dist/src/e2e_tests/e2eUtils.js.map +1 -0
  23. package/dist/src/e2e_tests/extraKeybindings.spec.js +43 -0
  24. package/dist/src/e2e_tests/extraKeybindings.spec.js.map +1 -0
  25. package/dist/src/e2e_tests/historyNavigation.spec.js +227 -0
  26. package/dist/src/e2e_tests/historyNavigation.spec.js.map +1 -0
  27. package/dist/src/e2e_tests/performanceTest.spec.d.ts +6 -0
  28. package/dist/src/e2e_tests/performanceTest.spec.js +97 -0
  29. package/dist/src/e2e_tests/performanceTest.spec.js.map +1 -0
  30. package/dist/src/e2e_tests/sanityChecks.spec.js +64 -0
  31. package/dist/src/e2e_tests/sanityChecks.spec.js.map +1 -0
  32. package/dist/src/e2e_tests/signatureHelp.spec.js +226 -0
  33. package/dist/src/e2e_tests/signatureHelp.spec.js.map +1 -0
  34. package/dist/src/e2e_tests/snippets.spec.js +14 -0
  35. package/dist/src/e2e_tests/snippets.spec.js.map +1 -0
  36. package/dist/src/e2e_tests/syntaxHighlighting.spec.d.ts +1 -0
  37. package/dist/src/e2e_tests/syntaxHighlighting.spec.js +90 -0
  38. package/dist/src/e2e_tests/syntaxHighlighting.spec.js.map +1 -0
  39. package/dist/src/e2e_tests/syntaxValidation.spec.d.ts +1 -0
  40. package/dist/src/e2e_tests/syntaxValidation.spec.js +129 -0
  41. package/dist/src/e2e_tests/syntaxValidation.spec.js.map +1 -0
  42. package/dist/src/editorActions.d.ts +17 -0
  43. package/dist/src/editorActions.js +259 -0
  44. package/dist/src/editorActions.js.map +1 -0
  45. package/dist/{types/history-navigation.d.ts → src/historyNavigation.d.ts} +1 -1
  46. package/dist/src/historyNavigation.js +163 -0
  47. package/dist/src/historyNavigation.js.map +1 -0
  48. package/dist/src/hostCallbacks.d.ts +9 -0
  49. package/dist/src/hostCallbacks.js +2 -0
  50. package/dist/src/hostCallbacks.js.map +1 -0
  51. package/dist/{types → src}/icons.d.ts +1 -1
  52. package/dist/src/icons.js +62 -0
  53. package/dist/src/icons.js.map +1 -0
  54. package/dist/src/index.d.ts +6 -0
  55. package/dist/src/index.js +5 -0
  56. package/dist/src/index.js.map +1 -0
  57. package/dist/src/inlinePanel.d.ts +27 -0
  58. package/dist/src/inlinePanel.js +86 -0
  59. package/dist/src/inlinePanel.js.map +1 -0
  60. package/dist/src/lang-cypher/autocomplete.d.ts +6 -0
  61. package/dist/src/lang-cypher/autocomplete.js +116 -0
  62. package/dist/src/lang-cypher/autocomplete.js.map +1 -0
  63. package/dist/{types → src}/lang-cypher/constants.d.ts +15 -2
  64. package/dist/src/lang-cypher/constants.js +74 -0
  65. package/dist/src/lang-cypher/constants.js.map +1 -0
  66. package/dist/src/lang-cypher/contants.test.d.ts +1 -0
  67. package/dist/src/lang-cypher/contants.test.js +103 -0
  68. package/dist/src/lang-cypher/contants.test.js.map +1 -0
  69. package/dist/{types/lang-cypher/create-cypher-theme.d.ts → src/lang-cypher/createCypherTheme.d.ts} +14 -3
  70. package/dist/src/lang-cypher/createCypherTheme.js +202 -0
  71. package/dist/src/lang-cypher/createCypherTheme.js.map +1 -0
  72. package/dist/src/lang-cypher/langCypher.d.ts +15 -0
  73. package/dist/src/lang-cypher/langCypher.js +23 -0
  74. package/dist/src/lang-cypher/langCypher.js.map +1 -0
  75. package/dist/src/lang-cypher/lintWorker.mjs +2039 -0
  76. package/dist/src/lang-cypher/parser-adapter.d.ts +21 -0
  77. package/dist/src/lang-cypher/parser-adapter.js +115 -0
  78. package/dist/src/lang-cypher/parser-adapter.js.map +1 -0
  79. package/dist/src/lang-cypher/prism-global.d.ts +1 -0
  80. package/dist/src/lang-cypher/prism-global.js +7 -0
  81. package/dist/src/lang-cypher/prism-global.js.map +1 -0
  82. package/dist/src/lang-cypher/signatureHelp.d.ts +4 -0
  83. package/dist/src/lang-cypher/signatureHelp.js +108 -0
  84. package/dist/src/lang-cypher/signatureHelp.js.map +1 -0
  85. package/dist/src/lang-cypher/syntaxValidation.d.ts +4 -0
  86. package/dist/src/lang-cypher/syntaxValidation.js +65 -0
  87. package/dist/src/lang-cypher/syntaxValidation.js.map +1 -0
  88. package/dist/src/lang-cypher/themeIcons.js +22 -0
  89. package/dist/src/lang-cypher/themeIcons.js.map +1 -0
  90. package/dist/src/lang-cypher/utils.d.ts +2 -0
  91. package/dist/src/lang-cypher/utils.js +10 -0
  92. package/dist/src/lang-cypher/utils.js.map +1 -0
  93. package/dist/src/ndlTokensCopy.d.ts +570 -0
  94. package/dist/src/ndlTokensCopy.js +571 -0
  95. package/dist/src/ndlTokensCopy.js.map +1 -0
  96. package/dist/src/ndlTokensCopy.test.d.ts +1 -0
  97. package/dist/src/ndlTokensCopy.test.js +12 -0
  98. package/dist/src/ndlTokensCopy.test.js.map +1 -0
  99. package/dist/src/neo4jSetup.d.ts +6 -0
  100. package/dist/src/neo4jSetup.js +120 -0
  101. package/dist/src/neo4jSetup.js.map +1 -0
  102. package/dist/src/richClipboardCopier.d.ts +4 -0
  103. package/dist/src/richClipboardCopier.js +78 -0
  104. package/dist/src/richClipboardCopier.js.map +1 -0
  105. package/dist/src/richClipboardCopier.test.d.ts +1 -0
  106. package/dist/src/richClipboardCopier.test.js +53 -0
  107. package/dist/src/richClipboardCopier.test.js.map +1 -0
  108. package/dist/src/themes.d.ts +5 -0
  109. package/dist/src/themes.js +107 -0
  110. package/dist/src/themes.js.map +1 -0
  111. package/dist/tsconfig.tsbuildinfo +1 -0
  112. package/package.json +64 -62
  113. package/src/CypherEditor.test.tsx +211 -0
  114. package/src/CypherEditor.tsx +586 -59
  115. package/src/constants.ts +1 -0
  116. package/src/diffView.ts +24 -0
  117. package/src/e2e_tests/autoCompletion.spec.tsx +576 -0
  118. package/src/e2e_tests/configuration.spec.tsx +111 -0
  119. package/src/e2e_tests/debounce.spec.tsx +102 -0
  120. package/src/e2e_tests/{e2e-utils.ts → e2eUtils.ts} +41 -3
  121. package/src/e2e_tests/{extra-keybindings.spec.tsx → extraKeybindings.spec.tsx} +1 -3
  122. package/src/e2e_tests/{history-navigation.spec.tsx → historyNavigation.spec.tsx} +138 -19
  123. package/src/e2e_tests/performanceTest.spec.tsx +163 -0
  124. package/src/e2e_tests/{sanity-checks.spec.tsx → sanityChecks.spec.tsx} +28 -20
  125. package/src/e2e_tests/signatureHelp.spec.tsx +442 -0
  126. package/src/e2e_tests/snippets.spec.tsx +19 -0
  127. package/src/e2e_tests/{syntax-highlighting.spec.tsx → syntaxHighlighting.spec.tsx} +26 -24
  128. package/src/e2e_tests/syntaxValidation.spec.tsx +252 -0
  129. package/src/editorActions.ts +334 -0
  130. package/src/{history-navigation.ts → historyNavigation.ts} +6 -4
  131. package/src/hostCallbacks.ts +9 -0
  132. package/src/icons.ts +3 -0
  133. package/src/index.ts +4 -2
  134. package/src/inlinePanel.ts +140 -0
  135. package/src/lang-cypher/autocomplete.ts +96 -19
  136. package/src/lang-cypher/constants.ts +35 -2
  137. package/src/lang-cypher/contants.test.ts +7 -3
  138. package/src/lang-cypher/{create-cypher-theme.ts → createCypherTheme.ts} +97 -33
  139. package/src/lang-cypher/langCypher.ts +44 -0
  140. package/src/lang-cypher/lintWorker.mjs +2039 -0
  141. package/src/lang-cypher/parser-adapter.ts +146 -0
  142. package/src/lang-cypher/prism-global.ts +7 -0
  143. package/src/lang-cypher/signatureHelp.ts +154 -0
  144. package/src/lang-cypher/syntaxValidation.ts +81 -0
  145. package/src/lang-cypher/utils.ts +9 -0
  146. package/src/{ndl-tokens-copy.test.ts → ndlTokensCopy.test.ts} +2 -1
  147. package/src/ndlTokensCopy.ts +570 -0
  148. package/src/{neo4j-setup.tsx → neo4jSetup.tsx} +79 -18
  149. package/src/richClipboardCopier.test.ts +67 -0
  150. package/src/richClipboardCopier.ts +99 -0
  151. package/src/themes.ts +63 -71
  152. package/src/viteEnv.d.ts +1 -0
  153. package/dist/cjs/index.cjs +0 -1441
  154. package/dist/cjs/index.cjs.map +0 -7
  155. package/dist/esm/index.mjs +0 -1464
  156. package/dist/esm/index.mjs.map +0 -7
  157. package/dist/types/CypherEditor.d.ts +0 -113
  158. package/dist/types/e2e_tests/mock-data.d.ts +0 -3779
  159. package/dist/types/index.d.ts +0 -4
  160. package/dist/types/lang-cypher/ParserAdapter.d.ts +0 -14
  161. package/dist/types/lang-cypher/autocomplete.d.ts +0 -3
  162. package/dist/types/lang-cypher/lang-cypher.d.ts +0 -7
  163. package/dist/types/lang-cypher/syntax-validation.d.ts +0 -3
  164. package/dist/types/ndl-tokens-copy.d.ts +0 -379
  165. package/dist/types/neo4j-setup.d.ts +0 -2
  166. package/dist/types/themes.d.ts +0 -11
  167. package/dist/types/tsconfig.tsbuildinfo +0 -1
  168. package/src/e2e_tests/auto-completion.spec.tsx +0 -232
  169. package/src/e2e_tests/mock-data.ts +0 -4310
  170. package/src/e2e_tests/performance-test.spec.tsx +0 -71
  171. package/src/e2e_tests/syntax-validation.spec.tsx +0 -156
  172. package/src/lang-cypher/ParserAdapter.ts +0 -92
  173. package/src/lang-cypher/lang-cypher.ts +0 -32
  174. package/src/lang-cypher/syntax-validation.ts +0 -24
  175. package/src/ndl-tokens-copy.ts +0 -379
  176. /package/dist/{types/e2e_tests/auto-completion.spec.d.ts → src/CypherEditor.test.d.ts} +0 -0
  177. /package/dist/{types/e2e_tests/extra-keybindings.spec.d.ts → src/e2e_tests/autoCompletion.spec.d.ts} +0 -0
  178. /package/dist/{types/e2e_tests/history-navigation.spec.d.ts → src/e2e_tests/configuration.spec.d.ts} +0 -0
  179. /package/dist/{types/e2e_tests/performance-test.spec.d.ts → src/e2e_tests/debounce.spec.d.ts} +0 -0
  180. /package/dist/{types/e2e_tests/sanity-checks.spec.d.ts → src/e2e_tests/extraKeybindings.spec.d.ts} +0 -0
  181. /package/dist/{types/e2e_tests/syntax-highlighting.spec.d.ts → src/e2e_tests/historyNavigation.spec.d.ts} +0 -0
  182. /package/dist/{types/e2e_tests/syntax-validation.spec.d.ts → src/e2e_tests/sanityChecks.spec.d.ts} +0 -0
  183. /package/dist/{types/lang-cypher/contants.test.d.ts → src/e2e_tests/signatureHelp.spec.d.ts} +0 -0
  184. /package/dist/{types/ndl-tokens-copy.test.d.ts → src/e2e_tests/snippets.spec.d.ts} +0 -0
  185. /package/dist/{types/lang-cypher/theme-icons.d.ts → src/lang-cypher/themeIcons.d.ts} +0 -0
  186. /package/src/lang-cypher/{theme-icons.ts → themeIcons.ts} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,375 @@
1
1
  # @neo4j-cypher/react-codemirror
2
2
 
3
+ ## 2.0.0-next.41
4
+
5
+ ### Minor Changes
6
+
7
+ - 2844ec4: Modify exports for api stability in language-support. Adds "forgotten exports" and most importantly (possibly breaking for dependants) removes export of generated antlr classes (or functions referencing these) - namely "parse", "createParsingResult" and full exports of generated Lexer/Parser files. Exported language support methods for linting, formatting etc no longer take optional "ParsingResult". Antlr grammar is now exported as .g4 files instead - see readme for instructions on how to generate parser/lexer.
8
+
9
+ ### Patch Changes
10
+
11
+ - c2d5648: Center `editorActions` on the editor's first line instead of aligning them with its top
12
+ - b2432d3: Keep the editor action in the editor's top-right corner when an inline panel or the deleted lines of a diff render above the first line
13
+ - 5f11dd8: Fix vite bundling bug on prism after vite v8 update
14
+ - f0f28db: Update vite to v8 and bump playwright
15
+ - Updated dependencies [d3dbe10]
16
+ - Updated dependencies [1897def]
17
+ - Updated dependencies [321e370]
18
+ - Updated dependencies [2844ec4]
19
+ - Updated dependencies [b38430c]
20
+ - @neo4j-cypher/language-support@2.0.0-next.38
21
+ - @neo4j-cypher/lint-worker@1.10.1-next.15
22
+
23
+ ## 2.0.0-next.40
24
+
25
+ ### Minor Changes
26
+
27
+ - 0ddd727: wrap placeholder around editor actions
28
+ - 9266800: normalize CRLF line endings
29
+
30
+ ### Patch Changes
31
+
32
+ - ce3820b: Update grammar and semantic analysis to 2026.08
33
+ - Updated dependencies [ce3820b]
34
+ - Updated dependencies [6c863cd]
35
+ - @neo4j-cypher/language-support@2.0.0-next.37
36
+ - @neo4j-cypher/lint-worker@1.10.1-next.14
37
+
38
+ ## 2.0.0-next.39
39
+
40
+ ### Patch Changes
41
+
42
+ - Updated dependencies [50f061e]
43
+ - @neo4j-cypher/language-support@2.0.0-next.36
44
+ - @neo4j-cypher/lint-worker@1.10.1-next.13
45
+
46
+ ## 2.0.0-next.38
47
+
48
+ ### Patch Changes
49
+
50
+ - 6866132: Update grammar and semantic analysis to 2026.07
51
+ - 9c65003: Declares `react-dom` as a peer dependency, since `CypherEditor` now imports `createPortal` from it to render the editor action buttons overlay
52
+ - Updated dependencies [6866132]
53
+ - @neo4j-cypher/language-support@2.0.0-next.35
54
+ - @neo4j-cypher/lint-worker@1.10.1-next.12
55
+
56
+ ## 2.0.0-next.37
57
+
58
+ ### Patch Changes
59
+
60
+ - b616748: Add diff view to the Cypher editor using @codemirror/merge
61
+ - Updated dependencies [2f8b52d]
62
+ - @neo4j-cypher/language-support@2.0.0-next.34
63
+ - @neo4j-cypher/lint-worker@1.10.1-next.11
64
+
65
+ ## 2.0.0-next.36
66
+
67
+ ### Patch Changes
68
+
69
+ - 2d5fa77: Add `inlinePanel` prop to `CypherEditor` for rendering a host-controlled panel as a block widget inside the editor.
70
+ - 02df611: Hide parameter errors when disconnected
71
+ - Updated dependencies [02df611]
72
+ - Updated dependencies [e69ee30]
73
+ - @neo4j-cypher/language-support@2.0.0-next.33
74
+ - @neo4j-cypher/lint-worker@1.10.1-next.10
75
+
76
+ ## 2.0.0-next.35
77
+
78
+ ### Patch Changes
79
+
80
+ - cd4ab49: Update grammar and semantic analysis to 2026.05
81
+ - Updated dependencies [cd4ab49]
82
+ - Updated dependencies [0b2d441]
83
+ - @neo4j-cypher/language-support@2.0.0-next.32
84
+ - @neo4j-cypher/lint-worker@1.10.1-next.9
85
+
86
+ ## 2.0.0-next.34
87
+
88
+ ### Patch Changes
89
+
90
+ - 3b2faf5: Rewrite global parserWrapper to instantiated languageService and add symbol fetching to react-codemirror
91
+ - Updated dependencies [08f94af]
92
+ - Updated dependencies [0763d97]
93
+ - Updated dependencies [3b2faf5]
94
+ - Updated dependencies [ca1bba6]
95
+ - @neo4j-cypher/language-support@2.0.0-next.31
96
+ - @neo4j-cypher/lint-worker@1.10.1-next.8
97
+
98
+ ## 2.0.0-next.33
99
+
100
+ ### Patch Changes
101
+
102
+ - Updated dependencies [0e457d6]
103
+ - Updated dependencies [b0170f9]
104
+ - Updated dependencies [25fad16]
105
+ - @neo4j-cypher/language-support@2.0.0-next.30
106
+ - @neo4j-cypher/lint-worker@1.10.1-next.7
107
+
108
+ ## 2.0.0-next.32
109
+
110
+ ### Patch Changes
111
+
112
+ - Updated dependencies [bfdc70e]
113
+ - @neo4j-cypher/language-support@2.0.0-next.29
114
+ - @neo4j-cypher/lint-worker@1.10.1-next.6
115
+
116
+ ## 2.0.0-next.31
117
+
118
+ ### Patch Changes
119
+
120
+ - Updated dependencies [5df1435]
121
+ - @neo4j-cypher/language-support@2.0.0-next.28
122
+ - @neo4j-cypher/lint-worker@1.10.1-next.5
123
+
124
+ ## 2.0.0-next.30
125
+
126
+ ### Patch Changes
127
+
128
+ - Updated dependencies [6a2a408]
129
+ - Updated dependencies [20b31b6]
130
+ - Updated dependencies [68d92a8]
131
+ - @neo4j-cypher/lint-worker@1.10.1-next.4
132
+ - @neo4j-cypher/language-support@2.0.0-next.27
133
+
134
+ ## 2.0.0-next.29
135
+
136
+ ### Patch Changes
137
+
138
+ - Updated dependencies [8e8d7f1]
139
+ - Updated dependencies [808aa73]
140
+ - @neo4j-cypher/language-support@2.0.0-next.26
141
+ - @neo4j-cypher/lint-worker@1.10.1-next.3
142
+
143
+ ## 2.0.0-next.28
144
+
145
+ ### Patch Changes
146
+
147
+ - Updated dependencies [b1e686e]
148
+ - @neo4j-cypher/language-support@2.0.0-next.25
149
+ - @neo4j-cypher/lint-worker@1.10.1-next.2
150
+
151
+ ## 2.0.0-next.27
152
+
153
+ ### Patch Changes
154
+
155
+ - 86f5c55: adding rich clipboard copier to codemirror
156
+ - 5fdc6dd: Fixes faulty worker termination on big queries
157
+ - Updated dependencies [246d60c]
158
+ - Updated dependencies [8eacddd]
159
+ - Updated dependencies [3a29711]
160
+ - Updated dependencies [b9c0e9d]
161
+ - Updated dependencies [d77e8a1]
162
+ - Updated dependencies [5fdc6dd]
163
+ - Updated dependencies [7183c63]
164
+ - @neo4j-cypher/lint-worker@1.10.1-next.1
165
+ - @neo4j-cypher/language-support@2.0.0-next.24
166
+
167
+ ## 2.0.0-next.26
168
+
169
+ ### Patch Changes
170
+
171
+ - Updated dependencies [c065d85]
172
+ - @neo4j-cypher/language-support@2.0.0-next.23
173
+ - @neo4j-cypher/lint-worker@1.10.1-next.0
174
+
175
+ ## 2.0.0-next.25
176
+
177
+ ### Patch Changes
178
+
179
+ - d99368c: Ensures CRLF newlines are handled when setting editor value
180
+ - Updated dependencies [ed65ef3]
181
+ - Updated dependencies [7538cfd]
182
+ - Updated dependencies [c1fa91f]
183
+ - Updated dependencies [039d1c5]
184
+ - Updated dependencies [1ef063e]
185
+ - Updated dependencies [a38255f]
186
+ - Updated dependencies [c4f27c9]
187
+ - @neo4j-cypher/language-support@2.0.0-next.22
188
+ - @neo4j-cypher/lint-worker@0.1.0-next.0
189
+
190
+ ## 2.0.0-next.24
191
+
192
+ ### Patch Changes
193
+
194
+ - 8b03317: resetting z index for cm panels
195
+ - Updated dependencies [4b0ee37]
196
+ - @neo4j-cypher/language-support@2.0.0-next.21
197
+ - @neo4j-cypher/lint-worker@2025.4.1-next.0
198
+
199
+ ## 2.0.0-next.23
200
+
201
+ ### Patch Changes
202
+
203
+ - Updated dependencies [013e4ff]
204
+ - @neo4j-cypher/language-support@2.0.0-next.20
205
+
206
+ ## 2.0.0-next.22
207
+
208
+ ### Patch Changes
209
+
210
+ - 5bfdac2: restructure packages as part of move to pnpm
211
+ - Updated dependencies [88e4930]
212
+ - Updated dependencies [5bfdac2]
213
+ - @neo4j-cypher/language-support@2.0.0-next.19
214
+
215
+ ## 2.0.0-next.21
216
+
217
+ ### Patch Changes
218
+
219
+ - Updated dependencies [1b971aa]
220
+ - Updated dependencies [07ac90f]
221
+ - @neo4j-cypher/language-support@2.0.0-next.18
222
+
223
+ ## 2.0.0-next.20
224
+
225
+ ### Patch Changes
226
+
227
+ - Updated dependencies [bffbb19]
228
+ - Updated dependencies [826d922]
229
+ - Updated dependencies [1caab0c]
230
+ - @neo4j-cypher/language-support@2.0.0-next.17
231
+
232
+ ## 2.0.0-next.19
233
+
234
+ ### Patch Changes
235
+
236
+ - a3e3e50: updating themes to use needle colors
237
+ - Updated dependencies [68f55d4]
238
+ - Updated dependencies [6d00433]
239
+ - Updated dependencies [c01b32a]
240
+ - @neo4j-cypher/language-support@2.0.0-next.16
241
+
242
+ ## 2.0.0-next.18
243
+
244
+ ### Patch Changes
245
+
246
+ - Updated dependencies [50cc73e]
247
+ - Updated dependencies [5ef538d]
248
+ - Updated dependencies [b988d3b]
249
+ - @neo4j-cypher/language-support@2.0.0-next.15
250
+
251
+ ## 2.0.0-next.17
252
+
253
+ ### Patch Changes
254
+
255
+ - 245fb6a: Automatically opens autocompletions after "YIELD "
256
+ - Updated dependencies [8ec797d]
257
+ - Updated dependencies [7aa9c3a]
258
+ - Updated dependencies [2be5469]
259
+ - Updated dependencies [245fb6a]
260
+ - Updated dependencies [c587b81]
261
+ - Updated dependencies [3f8b64f]
262
+ - Updated dependencies [043d766]
263
+ - Updated dependencies [704d1c5]
264
+ - @neo4j-cypher/language-support@2.0.0-next.14
265
+
266
+ ## 2.0.0-next.16
267
+
268
+ ### Patch Changes
269
+
270
+ - Updated dependencies [84a12fc]
271
+ - Updated dependencies [d329252]
272
+ - Updated dependencies [b0e419e]
273
+ - @neo4j-cypher/language-support@2.0.0-next.13
274
+
275
+ ## 2.0.0-next.15
276
+
277
+ ### Patch Changes
278
+
279
+ - adc5b64: using custom light color theme for the cypher editor
280
+ - Updated dependencies [88fbe63]
281
+ - Updated dependencies [22081b0]
282
+ - Updated dependencies [62ac442]
283
+ - @neo4j-cypher/language-support@2.0.0-next.12
284
+
285
+ ## 2.0.0-next.14
286
+
287
+ ### Patch Changes
288
+
289
+ - d85c1e0: Fixes bug with auto-completions
290
+ - Updated dependencies [bccf518]
291
+ - @neo4j-cypher/language-support@2.0.0-next.11
292
+
293
+ ## 2.0.0-next.13
294
+
295
+ ### Patch Changes
296
+
297
+ - Updated dependencies [8760c02]
298
+ - @neo4j-cypher/language-support@2.0.0-next.10
299
+
300
+ ## 2.0.0-next.12
301
+
302
+ ### Patch Changes
303
+
304
+ - dcbe67d: Expose moveFocusOnTab property on the CypherEditor component to conditionally disable tab keymappings
305
+ - e9621c8: Re-export language support from react codemirror
306
+ - Updated dependencies [2e72ac8]
307
+ - @neo4j-cypher/language-support@2.0.0-next.9
308
+
309
+ ## 2.0.0-next.11
310
+
311
+ ### Patch Changes
312
+
313
+ - Updated dependencies [05663bd]
314
+ - @neo4j-cypher/language-support@2.0.0-next.8
315
+
316
+ ## 2.0.0-next.10
317
+
318
+ ### Patch Changes
319
+
320
+ - bb7e9d3: Simplify detection and handling of value prop updates
321
+
322
+ ## 2.0.0-next.9
323
+
324
+ ### Patch Changes
325
+
326
+ - fbd5f7e: allow signature help panel to render below editor when there's not enough space above it
327
+ - 09dfae2: Add an ariaLabel prop to CypherEditor
328
+ - 7154e94: Fix bug causing debouncing to override value
329
+ - 62c152f: execute single line query on enter by default
330
+ - cbfc75e: Fix a bug causing debounced value updates to get cancelled erroneously
331
+ - 04ae35e: Set initial latestDispatchedValue and flush debounced changes onExecute
332
+ Add tests for debounce behaviour
333
+ - Updated dependencies [3661e9d]
334
+ - Updated dependencies [b76af58]
335
+ - Updated dependencies [21699b7]
336
+ - Updated dependencies [6afc0e3]
337
+ - Updated dependencies [39b924d]
338
+ - @neo4j-cypher/language-support@2.0.0-next.7
339
+
340
+ ## 2.0.0-next.8
341
+
342
+ ### Patch Changes
343
+
344
+ - 6cc9022: Adds more props to the CypherEditor component
345
+ - Updated dependencies [e92d8c7]
346
+ - @neo4j-cypher/language-support@2.0.0-next.6
347
+
348
+ ## 2.0.0-next.7
349
+
350
+ ### Patch Changes
351
+
352
+ - Updated dependencies [1f790d0]
353
+ - @neo4j-cypher/language-support@2.0.0-next.5
354
+
355
+ ## 2.0.0-next.6
356
+
357
+ ### Patch Changes
358
+
359
+ - Updated dependencies
360
+ - @neo4j-cypher/language-support@2.0.0-next.4
361
+
362
+ ## 2.0.0-next.5
363
+
364
+ ### Patch Changes
365
+
366
+ - 8cc77c6: Add support for console commands
367
+ - 1e210cb: Moves semantic analysis to a separate worker file
368
+ - Updated dependencies [8cc77c6]
369
+ - Updated dependencies [1e210cb]
370
+ - Updated dependencies [f6d20b2]
371
+ - @neo4j-cypher/language-support@2.0.0-next.3
372
+
3
373
  ## 2.0.0-next.4
4
374
 
5
375
  ### 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
 
@@ -0,0 +1,245 @@
1
+ import type { Extension } from '@codemirror/state';
2
+ import { EditorState } from '@codemirror/state';
3
+ import type { KeyBinding, ViewUpdate } from '@codemirror/view';
4
+ import { EditorView } from '@codemirror/view';
5
+ import { type InlinePanelCallbacks } from './inlinePanel';
6
+ import { type DiffProps } from './diffView';
7
+ import { CypherLanguageService, type DbSchema } from '@neo4j-cypher/language-support';
8
+ import { Component, type ReactNode } from 'react';
9
+ type DomEventHandlers = Parameters<typeof EditorView.domEventHandlers>[0];
10
+ export interface CypherEditorProps {
11
+ /**
12
+ * The prompt to show on single line editors
13
+ */
14
+ prompt?: string;
15
+ /**
16
+ * Custom keybindings to add to the editor.
17
+ * See https://codemirror.net/6/docs/ref/#keymap.of
18
+ */
19
+ extraKeybindings?: KeyBinding[];
20
+ /**
21
+ * Callback on query execution, triggered via ctrl/cmd + Enter.
22
+ * If provided, will enable "repl-mode", which turns on navigating editor history
23
+ *
24
+ * @param cmd - the editor value when ctrl/cmd + enter was pressed
25
+ * @returns void
26
+ */
27
+ onExecute?: (cmd: string) => void;
28
+ /**
29
+ * If true, pressing enter will add a new line to the editor and cmd/ctrl + enter will execute the query.
30
+ * Otherwise pressing enter on a single line will execute the query.
31
+ *
32
+ * @default false
33
+ */
34
+ newLineOnEnter?: boolean;
35
+ /**
36
+ * The editor history navigable via up/down arrow keys. Order newest to oldest.
37
+ * Add to this list with the `onExecute` callback for REPL style history.
38
+ */
39
+ history?: string[];
40
+ /**
41
+ * When set to `true` the editor will use the background color of the parent element.
42
+ *
43
+ * @default false
44
+ */
45
+ overrideThemeBackgroundColor?: boolean;
46
+ /**
47
+ * Whether the editor should take focus on mount.
48
+ * Will move the cursor to the end of the query when provided with an initial value.
49
+ *
50
+ * @default false
51
+ */
52
+ autofocus?: boolean;
53
+ /**
54
+ * Where to place the cursor in the query. Cannot be enabled at the same time than autofocus
55
+ */
56
+ offset?: number;
57
+ /**
58
+ * Whether the editor should wrap lines.
59
+ *
60
+ * @default false
61
+ */
62
+ lineWrap?: boolean;
63
+ /**
64
+ * Whether the editor should perform syntax validation.
65
+ *
66
+ * @default true
67
+ */
68
+ lint?: boolean;
69
+ /**
70
+ * Whether the signature help tooltip should be shown below the text.
71
+ * If false, it will be shown above.
72
+ *
73
+ * @default true
74
+ */
75
+ showSignatureTooltipBelow?: boolean;
76
+ /**
77
+ * Internal feature flags for the editor. Don't use in production
78
+ *
79
+ */
80
+ featureFlags?: {
81
+ consoleCommands?: boolean;
82
+ };
83
+ /**
84
+ * The schema to use for autocompletion and linting.
85
+ *
86
+ * @type {DbSchema}
87
+ */
88
+ schema?: DbSchema;
89
+ /**
90
+ * The current value of the editor.
91
+ */
92
+ value?: string;
93
+ /**
94
+ * Extra css classnames to add to the editor container.
95
+ */
96
+ className?: string;
97
+ /**
98
+ * Set the built in theme or provide a custom theme.
99
+ *
100
+ * `light` / `dark` / `Extension`
101
+ * @default light
102
+ */
103
+ theme?: 'light' | 'dark' | Extension;
104
+ /**
105
+ * Callback when the editor value changes.
106
+ * @param {string} value - the current editor value
107
+ * @param {ViewUpdate} viewUpdate - the view update from codemirror
108
+ */
109
+ onChange?(value: string, viewUpdate: ViewUpdate): void;
110
+ /**
111
+ * Map of event handlers to add to the editor.
112
+ *
113
+ * Note that the props are compared by reference, meaning object defined inline
114
+ * will cause the editor to re-render (much like the style prop does in this example:
115
+ * <div style={{}} />
116
+ *
117
+ * Memoize the object if you want/need to avoid this.
118
+ *
119
+ * @example
120
+ * // listen to blur events
121
+ * <CypherEditor domEventHandlers={{blur: () => console.log("blur event fired")}} />
122
+ */
123
+ domEventHandlers?: DomEventHandlers;
124
+ /**
125
+ * Placeholder text to display when the editor is empty.
126
+ */
127
+ placeholder?: string;
128
+ /**
129
+ * Whether the editor should show line numbers.
130
+ *
131
+ * @default true
132
+ */
133
+ lineNumbers?: boolean;
134
+ /**
135
+ * Whether the editor is read-only.
136
+ *
137
+ * @default false
138
+ */
139
+ readonly?: boolean;
140
+ /**
141
+ * String value to assign to the aria-label attribute of the editor.
142
+ */
143
+ ariaLabel?: string;
144
+ /**
145
+ * Whether keybindings for inserting indents with the Tab key should be disabled.
146
+ *
147
+ * true will not create keybindings for inserting indents.
148
+ * false will create keybindings for inserting indents.
149
+ *
150
+ * @default false
151
+ */
152
+ moveFocusOnTab?: boolean;
153
+ /**
154
+ * Render a panel as a block widget inside the editor.
155
+ * The widget DOM is only rebuilt when `pos` or `placement` change
156
+ */
157
+ inlinePanel?: InlinePanelProps | null;
158
+ /**
159
+ * Render a unified diff of the current document against `diff.original`.
160
+ * Deleted lines are shown as uneditable widgets.
161
+ */
162
+ diff?: DiffProps | null;
163
+ /**
164
+ * React content rendered as a cluster of action buttons (e.g. a context menu
165
+ * + Run) pinned to the top-right corner of the editor. Omit (or `null`) to
166
+ * hide it.
167
+ */
168
+ editorActions?: ReactNode;
169
+ }
170
+ export type InlinePanelProps = {
171
+ /**
172
+ * Position the panel anchors to.
173
+ */
174
+ pos: number;
175
+ /**
176
+ * Whether to render above or below the line
177
+ *
178
+ * @default 'above'
179
+ */
180
+ placement?: 'above' | 'below';
181
+ } & InlinePanelCallbacks;
182
+ type CypherEditorState = {
183
+ editorActionsContainer: HTMLElement | null;
184
+ };
185
+ declare class CodemirrorSymbolFetcher {
186
+ constructor(languageService: CypherLanguageService);
187
+ private languageService;
188
+ private processing;
189
+ private nextJob;
190
+ private symbolTablePool;
191
+ queueSymbolJob(query: string, schema: DbSchema): void;
192
+ terminate(): void;
193
+ private processJobQueue;
194
+ }
195
+ export declare class CypherEditor extends Component<CypherEditorProps, CypherEditorState> {
196
+ /**
197
+ * The symbol fetcher object used to fetch the current symbol table on document changes
198
+ */
199
+ symbolFetcher: CodemirrorSymbolFetcher;
200
+ /**
201
+ * The codemirror editor container.
202
+ */
203
+ editorContainer: React.RefObject<HTMLDivElement>;
204
+ /**
205
+ * The codemirror editor state.
206
+ */
207
+ editorState: React.MutableRefObject<EditorState>;
208
+ /**
209
+ * The codemirror editor view.
210
+ */
211
+ editorView: React.MutableRefObject<EditorView>;
212
+ private schemaRef;
213
+ private inlinePanelController;
214
+ private editorActionsController;
215
+ state: CypherEditorState;
216
+ private editorActionsCallbacks;
217
+ /**
218
+ * Format Cypher query
219
+ */
220
+ format(): void;
221
+ /**
222
+ * Focus the editor
223
+ */
224
+ focus(): void;
225
+ /**
226
+ * Move the cursor to the supplied position.
227
+ * For example, to move the cursor to the end of the editor, use `value.length`
228
+ */
229
+ updateCursorPosition(position: number): void;
230
+ /**
231
+ * Externally set the editor value and focus the editor.
232
+ */
233
+ setValueAndFocus(value?: string): void;
234
+ static defaultProps: CypherEditorProps;
235
+ private debouncedOnChange;
236
+ componentDidMount(): void;
237
+ private setEditorActions;
238
+ private openInlinePanel;
239
+ private updateInlinePanel;
240
+ private closeInlinePanel;
241
+ componentDidUpdate(prevProps: CypherEditorProps): void;
242
+ componentWillUnmount(): void;
243
+ render(): React.ReactNode;
244
+ }
245
+ export {};