@neo4j-cypher/react-codemirror 2.0.0-alpha.0 → 2.0.0-canary-e8a1279

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 (122) hide show
  1. package/CHANGELOG.md +68 -0
  2. package/LICENSE.md +201 -0
  3. package/README.md +27 -4
  4. package/dist/CypherEditor.d.ts +153 -0
  5. package/dist/CypherEditor.js +242 -0
  6. package/dist/CypherEditor.js.map +1 -0
  7. package/dist/e2e_tests/autoCompletion.spec.d.ts +1 -0
  8. package/dist/e2e_tests/autoCompletion.spec.js +133 -0
  9. package/dist/e2e_tests/autoCompletion.spec.js.map +1 -0
  10. package/dist/e2e_tests/configuration.spec.d.ts +1 -0
  11. package/dist/e2e_tests/configuration.spec.js +73 -0
  12. package/dist/e2e_tests/configuration.spec.js.map +1 -0
  13. package/dist/e2e_tests/e2eUtils.d.ts +12 -0
  14. package/dist/e2e_tests/e2eUtils.js +60 -0
  15. package/dist/e2e_tests/e2eUtils.js.map +1 -0
  16. package/dist/e2e_tests/extraKeybindings.spec.d.ts +1 -0
  17. package/dist/e2e_tests/extraKeybindings.spec.js +44 -0
  18. package/dist/e2e_tests/extraKeybindings.spec.js.map +1 -0
  19. package/dist/e2e_tests/historyNavigation.spec.d.ts +1 -0
  20. package/dist/e2e_tests/historyNavigation.spec.js +136 -0
  21. package/dist/e2e_tests/historyNavigation.spec.js.map +1 -0
  22. package/dist/e2e_tests/performanceTest.spec.d.ts +6 -0
  23. package/dist/e2e_tests/performanceTest.spec.js +96 -0
  24. package/dist/e2e_tests/performanceTest.spec.js.map +1 -0
  25. package/dist/e2e_tests/sanityChecks.spec.d.ts +1 -0
  26. package/dist/e2e_tests/sanityChecks.spec.js +56 -0
  27. package/dist/e2e_tests/sanityChecks.spec.js.map +1 -0
  28. package/dist/e2e_tests/signatureHelp.spec.d.ts +1 -0
  29. package/dist/e2e_tests/signatureHelp.spec.js +152 -0
  30. package/dist/e2e_tests/signatureHelp.spec.js.map +1 -0
  31. package/dist/e2e_tests/snippets.spec.d.ts +1 -0
  32. package/dist/e2e_tests/snippets.spec.js +63 -0
  33. package/dist/e2e_tests/snippets.spec.js.map +1 -0
  34. package/dist/e2e_tests/syntaxHighlighting.spec.d.ts +1 -0
  35. package/dist/e2e_tests/syntaxHighlighting.spec.js +91 -0
  36. package/dist/e2e_tests/syntaxHighlighting.spec.js.map +1 -0
  37. package/dist/e2e_tests/syntaxValidation.spec.d.ts +1 -0
  38. package/dist/e2e_tests/syntaxValidation.spec.js +79 -0
  39. package/dist/e2e_tests/syntaxValidation.spec.js.map +1 -0
  40. package/dist/historyNavigation.d.ts +7 -0
  41. package/dist/historyNavigation.js +163 -0
  42. package/dist/historyNavigation.js.map +1 -0
  43. package/dist/icons.d.ts +2 -0
  44. package/dist/icons.js +62 -0
  45. package/dist/icons.js.map +1 -0
  46. package/dist/index.d.ts +4 -0
  47. package/dist/index.js +5 -0
  48. package/dist/index.js.map +1 -0
  49. package/dist/lang-cypher/autocomplete.d.ts +3 -0
  50. package/dist/lang-cypher/autocomplete.js +62 -0
  51. package/dist/lang-cypher/autocomplete.js.map +1 -0
  52. package/dist/lang-cypher/constants.d.ts +40 -0
  53. package/dist/lang-cypher/constants.js +65 -0
  54. package/dist/lang-cypher/constants.js.map +1 -0
  55. package/dist/lang-cypher/contants.test.d.ts +1 -0
  56. package/dist/lang-cypher/contants.test.js +102 -0
  57. package/dist/lang-cypher/contants.test.js.map +1 -0
  58. package/dist/lang-cypher/createCypherTheme.d.ts +26 -0
  59. package/dist/lang-cypher/createCypherTheme.js +172 -0
  60. package/dist/lang-cypher/createCypherTheme.js.map +1 -0
  61. package/dist/lang-cypher/langCypher.d.ts +9 -0
  62. package/dist/lang-cypher/langCypher.js +24 -0
  63. package/dist/lang-cypher/langCypher.js.map +1 -0
  64. package/dist/lang-cypher/lintWorker.d.ts +8 -0
  65. package/dist/lang-cypher/lintWorker.js +4 -0
  66. package/dist/lang-cypher/lintWorker.js.map +1 -0
  67. package/dist/lang-cypher/parser-adapter.d.ts +19 -0
  68. package/dist/lang-cypher/parser-adapter.js +113 -0
  69. package/dist/lang-cypher/parser-adapter.js.map +1 -0
  70. package/dist/lang-cypher/signatureHelp.d.ts +4 -0
  71. package/dist/lang-cypher/signatureHelp.js +93 -0
  72. package/dist/lang-cypher/signatureHelp.js.map +1 -0
  73. package/dist/lang-cypher/syntaxValidation.d.ts +5 -0
  74. package/dist/lang-cypher/syntaxValidation.js +71 -0
  75. package/dist/lang-cypher/syntaxValidation.js.map +1 -0
  76. package/dist/lang-cypher/themeIcons.d.ts +7 -0
  77. package/dist/lang-cypher/themeIcons.js +22 -0
  78. package/dist/lang-cypher/themeIcons.js.map +1 -0
  79. package/dist/ndlTokensCopy.d.ts +379 -0
  80. package/dist/ndlTokensCopy.js +380 -0
  81. package/dist/ndlTokensCopy.js.map +1 -0
  82. package/dist/ndlTokensCopy.test.d.ts +1 -0
  83. package/dist/ndlTokensCopy.test.js +11 -0
  84. package/dist/ndlTokensCopy.test.js.map +1 -0
  85. package/dist/neo4jSetup.d.ts +2 -0
  86. package/dist/neo4jSetup.js +120 -0
  87. package/dist/neo4jSetup.js.map +1 -0
  88. package/dist/themes.d.ts +11 -0
  89. package/dist/themes.js +114 -0
  90. package/dist/themes.js.map +1 -0
  91. package/dist/tsconfig.tsbuildinfo +1 -0
  92. package/package.json +46 -16
  93. package/src/CypherEditor.tsx +461 -0
  94. package/src/e2e_tests/autoCompletion.spec.tsx +236 -0
  95. package/src/e2e_tests/configuration.spec.tsx +97 -0
  96. package/src/e2e_tests/e2eUtils.ts +85 -0
  97. package/src/e2e_tests/extraKeybindings.spec.tsx +57 -0
  98. package/src/e2e_tests/historyNavigation.spec.tsx +196 -0
  99. package/src/e2e_tests/performanceTest.spec.tsx +158 -0
  100. package/src/e2e_tests/sanityChecks.spec.tsx +78 -0
  101. package/src/e2e_tests/signatureHelp.spec.tsx +309 -0
  102. package/src/e2e_tests/snippets.spec.tsx +94 -0
  103. package/src/e2e_tests/syntaxHighlighting.spec.tsx +198 -0
  104. package/src/e2e_tests/syntaxValidation.spec.tsx +156 -0
  105. package/src/historyNavigation.ts +191 -0
  106. package/{esm/index.mjs → src/icons.ts} +37 -1283
  107. package/src/index.ts +4 -0
  108. package/src/lang-cypher/autocomplete.ts +81 -0
  109. package/src/lang-cypher/constants.ts +84 -0
  110. package/src/lang-cypher/contants.test.ts +104 -0
  111. package/src/lang-cypher/createCypherTheme.ts +240 -0
  112. package/src/lang-cypher/langCypher.ts +41 -0
  113. package/src/lang-cypher/lintWorker.ts +14 -0
  114. package/src/lang-cypher/parser-adapter.ts +145 -0
  115. package/src/lang-cypher/signatureHelp.ts +131 -0
  116. package/src/lang-cypher/syntaxValidation.ts +99 -0
  117. package/src/lang-cypher/themeIcons.ts +27 -0
  118. package/src/ndlTokensCopy.test.ts +11 -0
  119. package/src/ndlTokensCopy.ts +379 -0
  120. package/src/neo4jSetup.tsx +179 -0
  121. package/src/themes.ts +132 -0
  122. package/dist/index.cjs +0 -1330
@@ -1,275 +1,33 @@
1
- // src/index.ts
2
- import { CypherParser, parse } from "@neo4j-cypher/language-support";
3
- import * as ReactCodemirror from "@uiw/react-codemirror";
4
-
5
- // src/CypherEditor.tsx
6
- import { EditorView as EditorView4, keymap as keymap3 } from "@codemirror/view";
7
- import CodeEditor from "@uiw/react-codemirror";
8
- import React from "react";
9
-
10
- // src/lang-cypher/lang-cypher.ts
11
- import {
12
- defineLanguageFacet,
13
- Language,
14
- LanguageSupport
15
- } from "@codemirror/language";
16
-
17
- // src/lang-cypher/autocomplete.ts
18
- import { autocomplete } from "@neo4j-cypher/language-support";
19
- import { CompletionItemKind } from "vscode-languageserver-types";
20
- var completionKindToCodemirrorIcon = (c) => {
21
- const map = {
22
- [CompletionItemKind.Text]: "Text",
23
- [CompletionItemKind.Method]: "Method",
24
- [CompletionItemKind.Function]: "Function",
25
- [CompletionItemKind.Constructor]: "Constructor",
26
- [CompletionItemKind.Field]: "Field",
27
- [CompletionItemKind.Variable]: "Variable",
28
- [CompletionItemKind.Class]: "Class",
29
- [CompletionItemKind.Interface]: "Interface",
30
- [CompletionItemKind.Module]: "Module",
31
- [CompletionItemKind.Property]: "Property",
32
- [CompletionItemKind.Unit]: "Unit",
33
- [CompletionItemKind.Value]: "Value",
34
- [CompletionItemKind.Enum]: "Enum",
35
- [CompletionItemKind.Keyword]: "Keyword",
36
- [CompletionItemKind.Snippet]: "Snippet",
37
- [CompletionItemKind.Color]: "Color",
38
- [CompletionItemKind.File]: "File",
39
- [CompletionItemKind.Reference]: "Reference",
40
- [CompletionItemKind.Folder]: "Folder",
41
- [CompletionItemKind.EnumMember]: "EnumMember",
42
- [CompletionItemKind.Constant]: "Constant",
43
- [CompletionItemKind.Struct]: "Struct",
44
- [CompletionItemKind.Event]: "Event",
45
- [CompletionItemKind.Operator]: "Operator",
46
- [CompletionItemKind.TypeParameter]: "TypeParameter"
47
- };
48
- return map[c];
49
- };
50
- var emptySchema = {};
51
- var cypherAutocomplete = (schema) => (context) => {
52
- const textUntilCursor = context.state.doc.toString().slice(0, context.pos);
53
- const triggerCharacters = [".", ":", "{", "$"];
54
- const lastCharacter = textUntilCursor.slice(-1);
55
- const lastWord = context.matchBefore(/\w*/);
56
- const inWord = lastWord.from !== lastWord.to;
57
- const shouldTriggerCompletion = inWord || context.explicit || triggerCharacters.includes(lastCharacter);
58
- if (!shouldTriggerCompletion) {
59
- return null;
60
- }
61
- const options = autocomplete(textUntilCursor, schema ?? emptySchema);
62
- return {
63
- from: context.matchBefore(/(\w|\$)*$/).from,
64
- options: options.map((o) => ({
65
- label: o.label,
66
- type: completionKindToCodemirrorIcon(o.kind)
67
- }))
68
- };
69
- };
70
-
71
- // src/lang-cypher/ParserAdapter.ts
72
- import { Parser, Tree } from "@lezer/common";
73
- import {
74
- applySyntaxColouring
75
- } from "@neo4j-cypher/language-support";
76
-
77
- // src/lang-cypher/constants.ts
78
- import { languageDataProp } from "@codemirror/language";
79
- import { NodeSet, NodeType } from "@lezer/common";
80
- import { styleTags, tags } from "@lezer/highlight";
81
- var cypherTokenTypeToNode = (facet2) => ({
82
- topNode: NodeType.define({
83
- id: 0,
84
- name: "topNode",
85
- props: [languageDataProp.add({ topNode: facet2 })]
86
- }),
87
- comment: NodeType.define({ id: 1, name: "comment" }),
88
- keyword: NodeType.define({ id: 2, name: "keyword" }),
89
- label: NodeType.define({ id: 3, name: "label" }),
90
- predicateFunction: NodeType.define({ id: 4, name: "predicateFunction" }),
91
- function: NodeType.define({ id: 5, name: "function" }),
92
- procedure: NodeType.define({ id: 6, name: "procedure" }),
93
- variable: NodeType.define({ id: 7, name: "variable" }),
94
- paramDollar: NodeType.define({ id: 8, name: "paramDollar" }),
95
- paramValue: NodeType.define({ id: 9, name: "paramValue" }),
96
- symbolicName: NodeType.define({ id: 10, name: "symbolicName" }),
97
- operator: NodeType.define({ id: 11, name: "operator" }),
98
- stringLiteral: NodeType.define({ id: 12, name: "stringLiteral" }),
99
- numberLiteral: NodeType.define({ id: 13, name: "numberLiteral" }),
100
- booleanLiteral: NodeType.define({ id: 14, name: "booleanLiteral" }),
101
- keywordLiteral: NodeType.define({ id: 15, name: "keywordLiteral" }),
102
- property: NodeType.define({ id: 16, name: "property" }),
103
- namespace: NodeType.define({ id: 17, name: "namespace" }),
104
- bracket: NodeType.define({ id: 18, name: "bracket" }),
105
- none: NodeType.define({ id: 19, name: "none" }),
106
- separator: NodeType.define({ id: 20, name: "separator" }),
107
- punctuation: NodeType.define({ id: 21, name: "punctuation" })
108
- });
109
- var tokenTypeToStyleTag = {
110
- comment: tags.comment,
111
- keyword: tags.keyword,
112
- label: tags.typeName,
113
- predicateFunction: tags.function(tags.variableName),
114
- function: tags.function(tags.variableName),
115
- procedure: tags.function(tags.variableName),
116
- variable: tags.variableName,
117
- paramDollar: tags.atom,
118
- paramValue: tags.atom,
119
- symbolicName: tags.variableName,
120
- operator: tags.operator,
121
- stringLiteral: tags.string,
122
- numberLiteral: tags.number,
123
- booleanLiteral: tags.bool,
124
- keywordLiteral: tags.operatorKeyword,
125
- property: tags.propertyName,
126
- namespace: tags.namespace,
127
- bracket: tags.bracket,
128
- punctuation: tags.punctuation,
129
- separator: tags.separator
130
- };
131
- var parserAdapterNodeSet = (nodes) => new NodeSet(Object.values(nodes)).extend(styleTags(tokenTypeToStyleTag));
132
-
133
- // src/lang-cypher/ParserAdapter.ts
134
- var DEFAULT_NODE_GROUP_SIZE = 4;
135
- var ParserAdapter = class extends Parser {
136
- cypherTokenTypeToNode;
137
- constructor(facet2) {
138
- super();
139
- this.cypherTokenTypeToNode = cypherTokenTypeToNode(facet2);
140
- }
141
- createBufferForTokens(tokens2) {
142
- return tokens2.map((token) => {
143
- const nodeTypeId = this.cypherTokenTypeToNode[token.tokenType].id;
144
- const startOffset = token.position.startOffset;
145
- const endOffset = token.position.startOffset + token.length;
146
- return [nodeTypeId, startOffset, endOffset, DEFAULT_NODE_GROUP_SIZE];
147
- });
148
- }
149
- addTopNodeToBuffer(buffer, document2) {
150
- const id = this.cypherTokenTypeToNode.topNode.id;
151
- const startOffset = 0;
152
- const endOffset = document2.length;
153
- const totalBufferLength = buffer.length * DEFAULT_NODE_GROUP_SIZE;
154
- buffer.push([
155
- id,
156
- startOffset,
157
- endOffset,
158
- totalBufferLength + DEFAULT_NODE_GROUP_SIZE
159
- ]);
160
- }
161
- buildTree(document2) {
162
- const tokens2 = applySyntaxColouring(document2);
163
- if (tokens2.length < 1) {
164
- return Tree.build({
165
- buffer: [
166
- this.cypherTokenTypeToNode.topNode.id,
167
- 0,
168
- document2.length,
169
- DEFAULT_NODE_GROUP_SIZE
170
- ],
171
- nodeSet: parserAdapterNodeSet(this.cypherTokenTypeToNode),
172
- topID: this.cypherTokenTypeToNode.topNode.id
173
- });
174
- }
175
- const buffer = this.createBufferForTokens(tokens2);
176
- this.addTopNodeToBuffer(buffer, document2);
177
- return Tree.build({
178
- buffer: buffer.flat(),
179
- nodeSet: parserAdapterNodeSet(this.cypherTokenTypeToNode),
180
- topID: this.cypherTokenTypeToNode.topNode.id
181
- });
182
- }
183
- createParse(input) {
184
- return this.startParse(input);
185
- }
186
- /* There are more arguments, but since we don't do any incremental parsing, they are not useful */
187
- startParse(input) {
188
- const document2 = typeof input === "string" ? input : input.read(0, input.length);
189
- const tree = this.buildTree(document2);
190
- return {
191
- stoppedAt: input.length,
192
- parsedPos: input.length,
193
- stopAt: () => {
194
- return void 0;
195
- },
196
- advance: () => tree
197
- };
198
- }
199
- };
200
-
201
- // src/lang-cypher/syntax-validation.ts
202
- import { linter } from "@codemirror/lint";
203
- import { validateSyntax } from "@neo4j-cypher/language-support";
204
- import { DiagnosticSeverity } from "vscode-languageserver-types";
205
- var cypherLinter = (schema) => linter((view) => {
206
- const diagnostics = [];
207
- validateSyntax(view.state.doc.toString(), schema).forEach((diagnostic) => {
208
- diagnostics.push({
209
- from: diagnostic.offsets.start,
210
- to: diagnostic.offsets.end,
211
- severity: diagnostic.severity === DiagnosticSeverity.Error ? "error" : "warning",
212
- message: diagnostic.message
213
- });
214
- });
215
- return diagnostics;
216
- });
217
-
218
- // src/lang-cypher/lang-cypher.ts
219
- var facet = defineLanguageFacet({
220
- commentTokens: { block: { open: "/*", close: "*/" }, line: "//" },
221
- closeBrackets: { brackets: ["(", "[", "{", "'", '"', "`"] }
222
- });
223
- var parserAdapter = new ParserAdapter(facet);
224
- var cypherLanguage = new Language(facet, parserAdapter, [], "cypher");
225
- function cypher({ lint, schema = {} }) {
226
- return new LanguageSupport(cypherLanguage, [
227
- cypherLanguage.data.of({
228
- autocomplete: cypherAutocomplete(schema)
229
- }),
230
- ...lint ? [cypherLinter(schema)] : []
231
- ]);
232
- }
233
-
234
- // src/neo4j-setup.tsx
235
- import {
236
- acceptCompletion,
237
- autocompletion,
238
- closeBrackets,
239
- closeBracketsKeymap,
240
- completionKeymap
241
- } from "@codemirror/autocomplete";
242
- import {
243
- defaultKeymap,
244
- history,
245
- historyKeymap,
246
- indentLess,
247
- indentMore
248
- } from "@codemirror/commands";
249
- import {
250
- bracketMatching,
251
- defaultHighlightStyle,
252
- foldKeymap,
253
- indentOnInput,
254
- syntaxHighlighting
255
- } from "@codemirror/language";
256
- import { highlightSelectionMatches, searchKeymap } from "@codemirror/search";
257
- import { EditorState } from "@codemirror/state";
258
- import {
259
- crosshairCursor,
260
- drawSelection,
261
- dropCursor,
262
- EditorView,
263
- highlightSpecialChars,
264
- keymap,
265
- lineNumbers,
266
- rectangularSelection
267
- } from "@codemirror/view";
268
- import { lintKeymap } from "@codemirror/lint";
269
-
270
- // src/icons.ts
271
- function getIconForType(iconTypeString = "Text", isDarkTheme = false) {
272
- const lightThemeIcons = {
1
+ export type CompletionItemIcons =
2
+ | 'Text'
3
+ | 'Method'
4
+ | 'Function'
5
+ | 'Constructor'
6
+ | 'Field'
7
+ | 'Variable'
8
+ | 'Class'
9
+ | 'Interface'
10
+ | 'Module'
11
+ | 'Property'
12
+ | 'Unit'
13
+ | 'Value'
14
+ | 'Enum'
15
+ | 'Keyword'
16
+ | 'Snippet'
17
+ | 'Color'
18
+ | 'File'
19
+ | 'Reference'
20
+ | 'Folder'
21
+ | 'EnumMember'
22
+ | 'Constant'
23
+ | 'Struct'
24
+ | 'Event'
25
+ | 'Operator'
26
+ | 'Console'
27
+ | 'TypeParameter';
28
+
29
+ export function getIconForType(iconTypeString = 'Text', isDarkTheme = false) {
30
+ const lightThemeIcons: Record<CompletionItemIcons, string> = {
273
31
  Keyword: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M15.0002 4H10.0002V3H15.0002V4ZM14.0002 7H12.0002V8H14.0002V7ZM10.0002 7H1.00024V8H10.0002V7ZM12.0002 13H1.00024V14H12.0002V13ZM7.00024 10H1.00024V11H7.00024V10ZM15.0002 10H10.0002V11H15.0002V10ZM8.00024 2V5H1.00024V2H8.00024ZM7.00024 3H2.00024V4H7.00024V3Z" fill="#424242"/> </svg>`,
274
32
  Text: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" clip-rule="evenodd" d="M7.22313 10.933C7.54888 11.1254 7.92188 11.2231 8.30013 11.215C8.63802 11.2218 8.97279 11.1492 9.27746 11.003C9.58213 10.8567 9.84817 10.6409 10.0541 10.373C10.5094 9.76519 10.7404 9.01867 10.7081 8.25998C10.7414 7.58622 10.5376 6.9221 10.1321 6.38298C9.93599 6.14161 9.68601 5.94957 9.40225 5.82228C9.11848 5.69498 8.80883 5.63597 8.49813 5.64997C8.07546 5.64699 7.66018 5.76085 7.29813 5.97898C7.18328 6.04807 7.07515 6.12775 6.97513 6.21698V3.47498H5.98413V11.1H6.97913V10.756C7.0554 10.8217 7.13702 10.8809 7.22313 10.933ZM7.85005 6.70006C8.03622 6.62105 8.23832 6.58677 8.44013 6.59998C8.61281 6.59452 8.78429 6.63054 8.94018 6.70501C9.09608 6.77948 9.23185 6.89023 9.33613 7.02798C9.59277 7.39053 9.71865 7.82951 9.69313 8.27297C9.71996 8.79748 9.57993 9.31701 9.29313 9.75698C9.18846 9.91527 9.04571 10.0447 8.87797 10.1335C8.71023 10.2223 8.52289 10.2675 8.33313 10.265C8.14958 10.2732 7.96654 10.24 7.79758 10.1678C7.62862 10.0956 7.47809 9.98628 7.35713 9.84797C7.10176 9.55957 6.96525 9.18506 6.97513 8.79998V8.19998C6.96324 7.78332 7.10287 7.3765 7.36813 7.05498C7.49883 6.90064 7.66388 6.77908 7.85005 6.70006ZM3.28926 5.67499C2.97035 5.67933 2.65412 5.734 2.35226 5.83699C2.06442 5.92293 1.79372 6.05828 1.55226 6.23699L1.45226 6.31399V7.51399L1.87526 7.15499C2.24603 6.80478 2.73158 6.60146 3.24126 6.58299C3.36617 6.57164 3.49194 6.59147 3.60731 6.64068C3.72267 6.6899 3.82402 6.76697 3.90226 6.86499C4.05245 7.0971 4.13264 7.36754 4.13326 7.64399L2.90026 7.82499C2.39459 7.87781 1.9155 8.07772 1.52226 8.39999C1.36721 8.55181 1.24363 8.73271 1.15859 8.93235C1.07355 9.13199 1.02873 9.34644 1.02668 9.56343C1.02464 9.78042 1.06542 9.99568 1.14668 10.1969C1.22795 10.3981 1.3481 10.5813 1.50026 10.736C1.66895 10.8904 1.86647 11.01 2.08149 11.0879C2.29651 11.1659 2.5248 11.2005 2.75326 11.19C3.14725 11.1931 3.53302 11.0774 3.86026 10.858C3.96178 10.7897 4.05744 10.7131 4.14626 10.629V11.073H5.08726V7.71499C5.12161 7.17422 4.95454 6.63988 4.61826 6.21499C4.45004 6.03285 4.24373 5.89003 4.01402 5.7967C3.78431 5.70336 3.53686 5.66181 3.28926 5.67499ZM4.14626 8.71599C4.16588 9.13435 4.02616 9.54459 3.75526 9.864C3.63714 10.0005 3.49023 10.1092 3.3251 10.1821C3.15998 10.2551 2.98073 10.2906 2.80026 10.286C2.69073 10.2945 2.5806 10.2812 2.47624 10.2469C2.37187 10.2125 2.27536 10.1579 2.19226 10.086C2.06104 9.93455 1.9888 9.74088 1.9888 9.54049C1.9888 9.34011 2.06104 9.14644 2.19226 8.99499C2.47347 8.82131 2.79258 8.71837 3.12226 8.69499L4.14226 8.54699L4.14626 8.71599ZM12.459 11.0325C12.7663 11.1638 13.0985 11.2261 13.4324 11.215C13.9273 11.227 14.4156 11.1006 14.8424 10.85L14.9654 10.775L14.9784 10.768V9.61504L14.5324 9.93504C14.2163 10.1592 13.8359 10.2747 13.4484 10.264C13.2499 10.2719 13.0522 10.2342 12.8705 10.1538C12.6889 10.0733 12.5281 9.95232 12.4004 9.80004C12.1146 9.42453 11.9728 8.95911 12.0004 8.48804C11.9739 7.98732 12.1355 7.49475 12.4534 7.10704C12.5936 6.94105 12.7698 6.80914 12.9685 6.7213C13.1672 6.63346 13.3833 6.592 13.6004 6.60004C13.9441 6.59844 14.281 6.69525 14.5714 6.87904L15.0004 7.14404V5.97004L14.8314 5.89704C14.4628 5.73432 14.0644 5.6502 13.6614 5.65004C13.3001 5.63991 12.9409 5.70762 12.608 5.84859C12.2752 5.98956 11.9766 6.20048 11.7324 6.46704C11.2263 7.02683 10.9584 7.76186 10.9854 8.51604C10.9569 9.22346 11.1958 9.91569 11.6544 10.455C11.8772 10.704 12.1518 10.9012 12.459 11.0325Z" fill="#424242"/> </svg>`,
275
33
  Method: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M13.5103 4L8.51025 1H7.51025L2.51025 4L2.02026 4.85999V10.86L2.51025 11.71L7.51025 14.71H8.51025L13.5103 11.71L14.0002 10.86V4.85999L13.5103 4ZM7.51025 13.5601L3.01025 10.86V5.69995L7.51025 8.15002V13.5601ZM3.27026 4.69995L8.01025 1.85999L12.7502 4.69995L8.01025 7.29004L3.27026 4.69995ZM13.0103 10.86L8.51025 13.5601V8.15002L13.0103 5.69995V10.86Z" fill="#652D90"/> </svg>`,
@@ -294,9 +52,11 @@ function getIconForType(iconTypeString = "Text", isDarkTheme = false) {
294
52
  Struct: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" clip-rule="evenodd" d="M2.00024 2L1.00024 3V6L2.00024 7H14.0002L15.0002 6V3L14.0002 2H2.00024ZM2.00024 3H3.00024H13.0002H14.0002V4V5V6H13.0002H3.00024H2.00024V5V4V3ZM1.00024 10L2.00024 9H5.00024L6.00024 10V13L5.00024 14H2.00024L1.00024 13V10ZM3.00024 10H2.00024V11V12V13H3.00024H4.00024H5.00024V12V11V10H4.00024H3.00024ZM10.0002 10L11.0002 9H14.0002L15.0002 10V13L14.0002 14H11.0002L10.0002 13V10ZM12.0002 10H11.0002V11V12V13H12.0002H13.0002H14.0002V12V11V10H13.0002H12.0002Z" fill="#424242"/> </svg>`,
295
53
  Event: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" clip-rule="evenodd" d="M7.41379 1.55996L8.31177 1H11.6059L12.4243 2.57465L10.2358 6H12.0176L12.7365 7.69512L5.61967 15L4.01699 13.837L6.11967 10H4.89822L4.00024 8.55996L7.41379 1.55996ZM7.78058 9L4.90078 14.3049L12.0176 7H8.31177L11.6059 2H8.31177L4.89822 9H7.78058Z" fill="#D67E00"/> </svg>`,
296
54
  Operator: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" clip-rule="evenodd" d="M2.87313 1.10023C3.20793 1.23579 3.4757 1.498 3.61826 1.82988C3.69056 1.99959 3.72699 2.18242 3.72526 2.36688C3.72642 2.54999 3.69 2.7314 3.61826 2.89988C3.51324 3.14567 3.33807 3.35503 3.11466 3.50177C2.89126 3.64851 2.62955 3.72612 2.36226 3.72488C2.17948 3.72592 1.99842 3.68951 1.83026 3.61788C1.58322 3.51406 1.37252 3.33932 1.22478 3.11575C1.07704 2.89219 0.99891 2.62984 1.00026 2.36188C0.999374 2.17921 1.03543 1.99825 1.10626 1.82988C1.24362 1.50314 1.50353 1.24323 1.83026 1.10588C2.16357 0.966692 2.53834 0.964661 2.87313 1.10023ZM2.57526 2.86488C2.70564 2.80913 2.80951 2.70526 2.86526 2.57488C2.89314 2.50838 2.90742 2.43698 2.90726 2.36488C2.90838 2.2654 2.88239 2.1675 2.8321 2.08167C2.7818 1.99584 2.70909 1.92531 2.62176 1.87767C2.53443 1.83002 2.43577 1.80705 2.33638 1.81121C2.23698 1.81537 2.1406 1.8465 2.05755 1.90128C1.97451 1.95606 1.90794 2.03241 1.865 2.12215C1.82205 2.21188 1.80434 2.31161 1.81376 2.41065C1.82319 2.50968 1.85939 2.60428 1.9185 2.6843C1.9776 2.76433 2.05738 2.82675 2.14926 2.86488C2.28574 2.92089 2.43878 2.92089 2.57526 2.86488ZM6.43019 1.1095L1.10992 6.42977L1.79581 7.11567L7.11608 1.7954L6.43019 1.1095ZM11.5002 8.99999H12.5002V11.5H15.0002V12.5H12.5002V15H11.5002V12.5H9.00024V11.5H11.5002V8.99999ZM5.76801 9.52509L6.47512 10.2322L4.70735 12L6.47512 13.7677L5.76801 14.4748L4.00024 12.7071L2.23248 14.4748L1.52537 13.7677L3.29314 12L1.52537 10.2322L2.23248 9.52509L4.00024 11.2929L5.76801 9.52509ZM7.11826 5.32988C7.01466 5.08268 6.83997 4.87183 6.61636 4.72406C6.39275 4.57629 6.13028 4.49826 5.86226 4.49988C5.6796 4.49899 5.49864 4.53505 5.33026 4.60588C5.00353 4.74323 4.74362 5.00314 4.60626 5.32988C4.53612 5.49478 4.49922 5.67191 4.49766 5.8511C4.4961 6.0303 4.52992 6.20804 4.59718 6.37414C4.66443 6.54024 4.76381 6.69143 4.88961 6.81906C5.0154 6.94669 5.16515 7.04823 5.33026 7.11788C5.49892 7.18848 5.67993 7.22484 5.86276 7.22484C6.0456 7.22484 6.22661 7.18848 6.39526 7.11788C6.64225 7.01388 6.85295 6.83913 7.00082 6.61563C7.1487 6.39213 7.22713 6.12987 7.22626 5.86188C7.22679 5.67905 7.19005 5.49803 7.11826 5.32988ZM6.36526 6.07488C6.3379 6.13937 6.29854 6.19808 6.24926 6.24788C6.19932 6.29724 6.14066 6.33691 6.07626 6.36488C6.00878 6.39297 5.93635 6.40725 5.86326 6.40688C5.79015 6.40744 5.71769 6.39315 5.65026 6.36488C5.58565 6.33729 5.52693 6.29757 5.47726 6.24788C5.42715 6.19856 5.38738 6.13975 5.36026 6.07488C5.30425 5.9384 5.30425 5.78536 5.36026 5.64888C5.41561 5.51846 5.51965 5.41477 5.65026 5.35988C5.71761 5.33126 5.79008 5.31663 5.86326 5.31688C5.93642 5.31685 6.00884 5.33147 6.07626 5.35988C6.14062 5.38749 6.19928 5.42682 6.24926 5.47588C6.2981 5.52603 6.33741 5.58465 6.36526 5.64888C6.39364 5.7163 6.40827 5.78872 6.40827 5.86188C6.40827 5.93503 6.39364 6.00745 6.36526 6.07488ZM14.0002 3H10.0002V4H14.0002V3Z" fill="#424242"/> </svg>`,
297
- TypeParameter: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" clip-rule="evenodd" d="M11.0003 6H10.0003V5.5C10.0003 5.22386 9.7764 5 9.50026 5H8.47926V10.5C8.47926 10.7761 8.70312 11 8.97926 11H9.47926V12H6.47926V11H6.97926C7.2554 11 7.47926 10.7761 7.47926 10.5V5H6.50026C6.22412 5 6.00026 5.22386 6.00026 5.5V6H5.00026V4H11.0003V6ZM13.9145 8.0481L12.4522 6.58581L13.1593 5.87871L14.9751 7.69454V8.40165L13.2074 10.1694L12.5003 9.46231L13.9145 8.0481ZM3.54835 9.4623L2.08605 8.00002L3.50026 6.58581L2.79316 5.8787L1.02539 7.64647V8.35357L2.84124 10.1694L3.54835 9.4623Z" fill="#424242"/> </svg>`
55
+ Console: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" clip-rule="evenodd" d="M1.00024 1H15.0002V15H1.00024V1ZM2.00024 14H14.0002V2H2.00024V14ZM4.00032 5.70709L4.70743 4.99999L8.24296 8.53552L7.53585 9.24263L7.53583 9.2426L4.70735 12.0711L4.00024 11.364L6.82872 8.53549L4.00032 5.70709Z" fill="#424242"/> </svg>`,
56
+ TypeParameter: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" clip-rule="evenodd" d="M11.0003 6H10.0003V5.5C10.0003 5.22386 9.7764 5 9.50026 5H8.47926V10.5C8.47926 10.7761 8.70312 11 8.97926 11H9.47926V12H6.47926V11H6.97926C7.2554 11 7.47926 10.7761 7.47926 10.5V5H6.50026C6.22412 5 6.00026 5.22386 6.00026 5.5V6H5.00026V4H11.0003V6ZM13.9145 8.0481L12.4522 6.58581L13.1593 5.87871L14.9751 7.69454V8.40165L13.2074 10.1694L12.5003 9.46231L13.9145 8.0481ZM3.54835 9.4623L2.08605 8.00002L3.50026 6.58581L2.79316 5.8787L1.02539 7.64647V8.35357L2.84124 10.1694L3.54835 9.4623Z" fill="#424242"/> </svg>`,
298
57
  };
299
- const darkThemeIcons = {
58
+
59
+ const darkThemeIcons: Record<CompletionItemIcons, string> = {
300
60
  Keyword: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M15 4H10V3H15V4ZM14 7H12V8H14V7ZM10 7H1V8H10V7ZM12 13H1V14H12V13ZM7 10H1V11H7V10ZM15 10H10V11H15V10ZM8 2V5H1V2H8ZM7 3H2V4H7V3Z" fill="#C5C5C5"/> </svg>`,
301
61
  Text: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" clip-rule="evenodd" d="M7.22289 10.933C7.54863 11.1254 7.92163 11.2231 8.29989 11.215C8.63777 11.2218 8.97254 11.1492 9.27721 11.003C9.58188 10.8567 9.84792 10.6409 10.0539 10.373C10.5091 9.76519 10.7402 9.01867 10.7079 8.25998C10.7412 7.58622 10.5374 6.9221 10.1319 6.38298C9.93575 6.14161 9.68577 5.94957 9.402 5.82228C9.11824 5.69498 8.80858 5.63597 8.49789 5.64997C8.07522 5.64699 7.65994 5.76085 7.29789 5.97898C7.18304 6.04807 7.0749 6.12775 6.97489 6.21698V3.47498H5.98389V11.1H6.97889V10.756C7.05516 10.8217 7.13677 10.8809 7.22289 10.933ZM7.84981 6.70006C8.03598 6.62105 8.23807 6.58677 8.43989 6.59998C8.61257 6.59452 8.78404 6.63054 8.93994 6.70501C9.09583 6.77948 9.23161 6.89023 9.33589 7.02798C9.59253 7.39053 9.7184 7.82951 9.69289 8.27297C9.71972 8.79748 9.57969 9.31701 9.29289 9.75698C9.18822 9.91527 9.04546 10.0447 8.87773 10.1335C8.70999 10.2223 8.52264 10.2675 8.33289 10.265C8.14934 10.2732 7.9663 10.24 7.79734 10.1678C7.62838 10.0956 7.47784 9.98628 7.35689 9.84797C7.10152 9.55957 6.96501 9.18506 6.97489 8.79998V8.19998C6.96299 7.78332 7.10263 7.3765 7.36789 7.05498C7.49858 6.90064 7.66364 6.77908 7.84981 6.70006ZM3.28902 5.67499C2.97011 5.67933 2.65388 5.734 2.35202 5.83699C2.06417 5.92293 1.79347 6.05828 1.55202 6.23699L1.45202 6.31399V7.51399L1.87502 7.15499C2.24579 6.80478 2.73133 6.60146 3.24102 6.58299C3.36593 6.57164 3.4917 6.59147 3.60706 6.64068C3.72243 6.6899 3.82377 6.76697 3.90202 6.86499C4.0522 7.0971 4.13239 7.36754 4.13302 7.64399L2.90002 7.82499C2.39435 7.87781 1.91525 8.07772 1.52202 8.39999C1.36697 8.55181 1.24339 8.73271 1.15835 8.93235C1.07331 9.13199 1.02848 9.34644 1.02644 9.56343C1.0244 9.78042 1.06517 9.99568 1.14644 10.1969C1.2277 10.3981 1.34786 10.5813 1.50002 10.736C1.6687 10.8904 1.86622 11.01 2.08125 11.0879C2.29627 11.1659 2.52456 11.2005 2.75302 11.19C3.147 11.1931 3.53278 11.0774 3.86002 10.858C3.96153 10.7897 4.0572 10.7131 4.14602 10.629V11.073H5.08702V7.71499C5.12137 7.17422 4.9543 6.63988 4.61802 6.21499C4.44979 6.03285 4.24348 5.89003 4.01378 5.7967C3.78407 5.70336 3.53661 5.66181 3.28902 5.67499ZM4.14602 8.71599C4.16564 9.13435 4.02592 9.54459 3.75502 9.864C3.63689 10.0005 3.48998 10.1092 3.32486 10.1821C3.15973 10.2551 2.98049 10.2906 2.80002 10.286C2.69049 10.2945 2.58035 10.2812 2.47599 10.2469C2.37163 10.2125 2.27511 10.1579 2.19202 10.086C2.06079 9.93455 1.98856 9.74088 1.98856 9.54049C1.98856 9.34011 2.06079 9.14644 2.19202 8.99499C2.47322 8.82131 2.79233 8.71837 3.12202 8.69499L4.14202 8.54699L4.14602 8.71599ZM12.4588 11.0325C12.766 11.1638 13.0983 11.2261 13.4322 11.215C13.927 11.227 14.4153 11.1006 14.8422 10.85L14.9652 10.775L14.9782 10.768V9.61504L14.5322 9.93504C14.216 10.1592 13.8356 10.2747 13.4482 10.264C13.2497 10.2719 13.052 10.2342 12.8703 10.1538C12.6886 10.0733 12.5278 9.95232 12.4002 9.80004C12.1144 9.42453 11.9725 8.95911 12.0002 8.48804C11.9737 7.98732 12.1352 7.49475 12.4532 7.10704C12.5934 6.94105 12.7695 6.80914 12.9682 6.7213C13.167 6.63346 13.3831 6.592 13.6002 6.60004C13.9439 6.59844 14.2808 6.69525 14.5712 6.87904L15.0002 7.14404V5.97004L14.8312 5.89704C14.4626 5.73432 14.0641 5.6502 13.6612 5.65004C13.2999 5.63991 12.9406 5.70762 12.6078 5.84859C12.2749 5.98956 11.9763 6.20048 11.7322 6.46704C11.2261 7.02683 10.9581 7.76186 10.9852 8.51604C10.9567 9.22346 11.1955 9.91569 11.6542 10.455C11.8769 10.704 12.1516 10.9012 12.4588 11.0325Z" fill="#C5C5C5"/> </svg>`,
302
62
  Method: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M13.51 4L8.51001 1H7.51001L2.51001 4L2.02002 4.85999V10.86L2.51001 11.71L7.51001 14.71H8.51001L13.51 11.71L14 10.86V4.85999L13.51 4ZM7.51001 13.5601L3.01001 10.86V5.69995L7.51001 8.15002V13.5601ZM3.27002 4.69995L8.01001 1.85999L12.75 4.69995L8.01001 7.29004L3.27002 4.69995ZM13.01 10.86L8.51001 13.5601V8.15002L13.01 5.69995V10.86Z" fill="#B180D7"/> </svg>`,
@@ -321,1016 +81,10 @@ function getIconForType(iconTypeString = "Text", isDarkTheme = false) {
321
81
  Struct: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" clip-rule="evenodd" d="M2 2L1 3V6L2 7H14L15 6V3L14 2H2ZM2 3H3H13H14V4V5V6H13H3H2V5V4V3ZM1 10L2 9H5L6 10V13L5 14H2L1 13V10ZM3 10H2V11V12V13H3H4H5V12V11V10H4H3ZM10 10L11 9H14L15 10V13L14 14H11L10 13V10ZM12 10H11V11V12V13H12H13H14V12V11V10H13H12Z" fill="#C5C5C5"/> </svg>`,
322
82
  Event: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" clip-rule="evenodd" d="M7.41354 1.55996L8.31152 1H11.6056L12.424 2.57465L10.2356 6H12.0174L12.7363 7.69512L5.61943 15L4.01675 13.837L6.11943 10H4.89798L4 8.55996L7.41354 1.55996ZM7.78033 9L4.90054 14.3049L12.0174 7H8.31152L11.6056 2H8.31152L4.89798 9H7.78033Z" fill="#EE9D28"/> </svg>`,
323
83
  Operator: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" clip-rule="evenodd" d="M2.87289 1.10023C3.20768 1.23579 3.47545 1.498 3.61802 1.82988C3.69032 1.99959 3.72675 2.18242 3.72502 2.36688C3.72617 2.54999 3.68975 2.7314 3.61802 2.89988C3.51299 3.14567 3.33782 3.35503 3.11442 3.50177C2.89102 3.64851 2.6293 3.72612 2.36202 3.72488C2.17924 3.72592 1.99818 3.68951 1.83002 3.61788C1.58298 3.51406 1.37227 3.33932 1.22453 3.11575C1.0768 2.89219 0.998666 2.62984 1.00002 2.36188C0.99913 2.17921 1.03519 1.99825 1.10602 1.82988C1.24337 1.50314 1.50328 1.24323 1.83002 1.10588C2.16332 0.966692 2.53809 0.964661 2.87289 1.10023ZM2.57502 2.86488C2.7054 2.80913 2.80927 2.70526 2.86502 2.57488C2.8929 2.50838 2.90718 2.43698 2.90702 2.36488C2.90813 2.2654 2.88215 2.1675 2.83185 2.08167C2.78156 1.99584 2.70884 1.92531 2.62151 1.87767C2.53418 1.83002 2.43553 1.80705 2.33614 1.81121C2.23674 1.81537 2.14035 1.8465 2.05731 1.90128C1.97426 1.95606 1.9077 2.03241 1.86475 2.12215C1.8218 2.21188 1.80409 2.31161 1.81352 2.41065C1.82294 2.50968 1.85915 2.60428 1.91825 2.6843C1.97736 2.76433 2.05713 2.82675 2.14902 2.86488C2.28549 2.92089 2.43854 2.92089 2.57502 2.86488ZM6.42995 1.1095L1.10967 6.42977L1.79557 7.11567L7.11584 1.7954L6.42995 1.1095ZM11.5 8.99999H12.5V11.5H15V12.5H12.5V15H11.5V12.5H9V11.5H11.5V8.99999ZM5.76777 9.52509L6.47487 10.2322L4.70711 12L6.47487 13.7677L5.76777 14.4748L4 12.7071L2.23223 14.4748L1.52513 13.7677L3.29289 12L1.52513 10.2322L2.23223 9.52509L4 11.2929L5.76777 9.52509ZM7.11802 5.32988C7.01442 5.08268 6.83973 4.87183 6.61612 4.72406C6.3925 4.57629 6.13004 4.49826 5.86202 4.49988C5.67935 4.49899 5.49839 4.53505 5.33002 4.60588C5.00328 4.74323 4.74337 5.00314 4.60602 5.32988C4.53588 5.49478 4.49897 5.67191 4.49741 5.8511C4.49586 6.0303 4.52967 6.20804 4.59693 6.37414C4.66419 6.54024 4.76356 6.69143 4.88936 6.81906C5.01516 6.94669 5.1649 7.04823 5.33002 7.11788C5.49867 7.18848 5.67968 7.22484 5.86252 7.22484C6.04535 7.22484 6.22636 7.18848 6.39502 7.11788C6.64201 7.01388 6.8527 6.83913 7.00058 6.61563C7.14845 6.39213 7.22689 6.12987 7.22602 5.86188C7.22655 5.67905 7.1898 5.49803 7.11802 5.32988ZM6.36502 6.07488C6.33766 6.13937 6.29829 6.19808 6.24902 6.24788C6.19908 6.29724 6.14042 6.33691 6.07602 6.36488C6.00854 6.39297 5.93611 6.40725 5.86302 6.40688C5.78991 6.40744 5.71744 6.39315 5.65002 6.36488C5.58541 6.33729 5.52668 6.29757 5.47702 6.24788C5.42691 6.19856 5.38713 6.13975 5.36002 6.07488C5.30401 5.9384 5.30401 5.78536 5.36002 5.64888C5.41536 5.51846 5.51941 5.41477 5.65002 5.35988C5.71737 5.33126 5.78984 5.31663 5.86302 5.31688C5.93618 5.31685 6.0086 5.33147 6.07602 5.35988C6.14037 5.38749 6.19904 5.42682 6.24902 5.47588C6.29786 5.52603 6.33717 5.58465 6.36502 5.64888C6.3934 5.7163 6.40802 5.78872 6.40802 5.86188C6.40802 5.93503 6.3934 6.00745 6.36502 6.07488ZM14 3H10V4H14V3Z" fill="#C5C5C5"/> </svg>`,
324
- TypeParameter: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" clip-rule="evenodd" d="M11 6H10V5.5C10 5.22386 9.77616 5 9.50001 5H8.47902V10.5C8.47902 10.7761 8.70288 11 8.97902 11H9.47902V12H6.47902V11H6.97902C7.25516 11 7.47902 10.7761 7.47902 10.5V5H6.50001C6.22387 5 6.00001 5.22386 6.00001 5.5V6H5.00001V4H11V6ZM13.9142 8.0481L12.4519 6.58581L13.159 5.87871L14.9749 7.69454V8.40165L13.2071 10.1694L12.5 9.46231L13.9142 8.0481ZM3.5481 9.4623L2.08581 8.00002L3.50002 6.58581L2.79291 5.8787L1.02515 7.64647V8.35357L2.841 10.1694L3.5481 9.4623Z" fill="#C5C5C5"/> </svg>`
84
+ Console: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" clip-rule="evenodd" d="M1 1H15V15H1V1ZM2 14H14V2H2V14ZM4.00008 5.70709L4.70718 4.99999L8.24272 8.53552L7.53561 9.24263L7.53558 9.2426L4.70711 12.0711L4 11.364L6.82848 8.53549L4.00008 5.70709Z" fill="#C5C5C5"/> </svg>`,
85
+ TypeParameter: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" clip-rule="evenodd" d="M11 6H10V5.5C10 5.22386 9.77616 5 9.50001 5H8.47902V10.5C8.47902 10.7761 8.70288 11 8.97902 11H9.47902V12H6.47902V11H6.97902C7.25516 11 7.47902 10.7761 7.47902 10.5V5H6.50001C6.22387 5 6.00001 5.22386 6.00001 5.5V6H5.00001V4H11V6ZM13.9142 8.0481L12.4519 6.58581L13.159 5.87871L14.9749 7.69454V8.40165L13.2071 10.1694L12.5 9.46231L13.9142 8.0481ZM3.5481 9.4623L2.08581 8.00002L3.50002 6.58581L2.79291 5.8787L1.02515 7.64647V8.35357L2.841 10.1694L3.5481 9.4623Z" fill="#C5C5C5"/> </svg>`,
325
86
  };
326
- const iconType = iconTypeString;
87
+ const iconType = iconTypeString as CompletionItemIcons;
327
88
  const icons = isDarkTheme ? darkThemeIcons : lightThemeIcons;
328
89
  return icons[iconType] ?? icons.Keyword;
329
90
  }
330
-
331
- // src/neo4j-setup.tsx
332
- var insertTab = (cmd) => {
333
- if (cmd.state.selection.main.from === cmd.state.selection.main.to) {
334
- cmd.dispatch(
335
- cmd.state.update({
336
- changes: {
337
- from: cmd.state.selection.main.to,
338
- to: cmd.state.selection.main.to,
339
- insert: " "
340
- },
341
- selection: { anchor: cmd.state.selection.main.to + 2 }
342
- })
343
- );
344
- } else {
345
- indentMore(cmd);
346
- }
347
- return true;
348
- };
349
- var basicNeo4jSetup = (prompt) => {
350
- const keymaps = [
351
- closeBracketsKeymap,
352
- defaultKeymap,
353
- searchKeymap,
354
- historyKeymap,
355
- foldKeymap,
356
- completionKeymap,
357
- lintKeymap,
358
- {
359
- key: "Tab",
360
- preventDefault: true,
361
- run: acceptCompletion
362
- },
363
- {
364
- key: "Tab",
365
- preventDefault: true,
366
- run: insertTab
367
- },
368
- {
369
- key: "Shift-Tab",
370
- preventDefault: true,
371
- run: indentLess
372
- }
373
- ].flat();
374
- const extensions = [];
375
- extensions.push(
376
- lineNumbers({
377
- formatNumber(a, state) {
378
- if (state.doc.lines === 1 && prompt !== void 0) {
379
- return prompt;
380
- }
381
- return a.toString();
382
- }
383
- })
384
- );
385
- extensions.push(highlightSpecialChars());
386
- extensions.push(history());
387
- extensions.push(drawSelection());
388
- extensions.push(dropCursor());
389
- extensions.push(EditorState.allowMultipleSelections.of(true));
390
- extensions.push(indentOnInput());
391
- extensions.push(
392
- syntaxHighlighting(defaultHighlightStyle, { fallback: true })
393
- );
394
- extensions.push(bracketMatching());
395
- extensions.push(closeBrackets());
396
- extensions.push(
397
- autocompletion({
398
- icons: false,
399
- addToOptions: [
400
- {
401
- render(completion, state) {
402
- const isDarkTheme = state.facet(EditorView.darkTheme);
403
- const icon = document.createElement("span");
404
- icon.innerHTML = getIconForType(completion.type, isDarkTheme);
405
- const svgElement = icon.children[0];
406
- svgElement.style.display = "inline";
407
- svgElement.style.marginRight = "5px";
408
- return icon;
409
- },
410
- position: 20
411
- }
412
- ]
413
- })
414
- );
415
- extensions.push(rectangularSelection());
416
- extensions.push(crosshairCursor());
417
- extensions.push(highlightSelectionMatches());
418
- extensions.push(keymap.of(keymaps));
419
- return extensions;
420
- };
421
-
422
- // src/repl-mode.ts
423
- import { StateEffect } from "@codemirror/state";
424
- import { keymap as keymap2 } from "@codemirror/view";
425
- import { StateField } from "@codemirror/state";
426
- var DRAFT_ENTRY_INDEX = -1;
427
- var historyInitialState = {
428
- history: [],
429
- index: DRAFT_ENTRY_INDEX,
430
- documentUpdate: null,
431
- draft: ""
432
- };
433
- var historyState = StateField.define({
434
- create() {
435
- return historyInitialState;
436
- },
437
- toJSON(value) {
438
- return JSON.stringify(value);
439
- },
440
- update(value, transaction) {
441
- for (const effect of transaction.effects) {
442
- if (effect.is(moveInHistory)) {
443
- if (value.history.length === 0) {
444
- return {
445
- ...value,
446
- documentUpdate: null
447
- };
448
- }
449
- const currentHistoryIndex = value.index;
450
- if (effect.value === "BACK") {
451
- const newHistoryIndex = currentHistoryIndex + 1;
452
- if (newHistoryIndex === value.history.length) {
453
- return {
454
- ...value,
455
- documentUpdate: null
456
- };
457
- }
458
- let draft = value.draft;
459
- if (currentHistoryIndex === DRAFT_ENTRY_INDEX) {
460
- draft = transaction.state.doc.toString();
461
- }
462
- return {
463
- ...value,
464
- draft,
465
- index: newHistoryIndex,
466
- documentUpdate: value.history[newHistoryIndex]
467
- };
468
- } else if (effect.value === "FORWARDS") {
469
- const newHistoryIndex = currentHistoryIndex - 1;
470
- if (currentHistoryIndex === DRAFT_ENTRY_INDEX) {
471
- return { ...value, documentUpdate: null };
472
- }
473
- if (newHistoryIndex === DRAFT_ENTRY_INDEX) {
474
- return {
475
- ...value,
476
- index: newHistoryIndex,
477
- documentUpdate: value.draft
478
- };
479
- } else {
480
- return {
481
- ...value,
482
- index: newHistoryIndex,
483
- documentUpdate: value.history[newHistoryIndex]
484
- };
485
- }
486
- }
487
- } else if (effect.is(pushToHistory)) {
488
- return {
489
- ...value,
490
- index: DRAFT_ENTRY_INDEX,
491
- history: [effect.value, ...value.history]
492
- };
493
- }
494
- }
495
- return value;
496
- }
497
- });
498
- var moveInHistory = StateEffect.define();
499
- var pushToHistory = StateEffect.define();
500
- function navigateHistory(view, direction) {
501
- view.dispatch(
502
- view.state.update({
503
- effects: moveInHistory.of(direction),
504
- selection: { anchor: view.state.doc.length }
505
- })
506
- );
507
- const updatedHistory = view.state.field(historyState, false);
508
- if (updatedHistory.documentUpdate !== null) {
509
- view.dispatch(
510
- view.state.update({
511
- changes: {
512
- from: 0,
513
- to: view.state.doc.length,
514
- insert: updatedHistory.documentUpdate
515
- }
516
- })
517
- );
518
- }
519
- }
520
- var replMode = ({
521
- onExecute,
522
- onNewHistoryEntry,
523
- initialHistory
524
- }) => {
525
- return [
526
- historyState.init(() => ({
527
- ...historyInitialState,
528
- history: initialHistory
529
- })),
530
- keymap2.of([
531
- {
532
- key: "Ctrl-Enter",
533
- mac: "Mod-Enter",
534
- preventDefault: true,
535
- run: (view) => {
536
- const doc = view.state.doc.toString();
537
- if (doc.trim() !== "") {
538
- onExecute?.(doc);
539
- onNewHistoryEntry?.(doc);
540
- view.dispatch({
541
- effects: pushToHistory.of(doc),
542
- changes: { from: 0, to: view.state.doc.length, insert: "" }
543
- });
544
- }
545
- return true;
546
- }
547
- },
548
- {
549
- key: "ArrowUp",
550
- preventDefault: true,
551
- run: (view) => {
552
- const { empty, head } = view.state.selection.main;
553
- if (!empty || head !== 0) {
554
- return false;
555
- }
556
- navigateHistory(view, "BACK");
557
- return true;
558
- }
559
- },
560
- {
561
- mac: "Cmd-ArrowUp",
562
- win: "Ctrl-ArrowUp",
563
- linux: "Ctrl-ArrowUp",
564
- preventDefault: true,
565
- run: (view) => {
566
- const { empty, head } = view.state.selection.main;
567
- if (!empty || head !== 0) {
568
- return false;
569
- }
570
- navigateHistory(view, "BACK");
571
- return true;
572
- }
573
- },
574
- {
575
- key: "ArrowDown",
576
- preventDefault: true,
577
- run: (view) => {
578
- const { empty, head } = view.state.selection.main;
579
- if (!empty || head !== view.state.doc.length) {
580
- return false;
581
- }
582
- navigateHistory(view, "FORWARDS");
583
- return true;
584
- }
585
- },
586
- {
587
- mac: "Cmd-ArrowDown",
588
- win: "Ctrl-ArrowDown",
589
- linux: "Ctrl-ArrowDown",
590
- preventDefault: true,
591
- run: (view) => {
592
- const { empty, head } = view.state.selection.main;
593
- if (!empty || head !== view.state.doc.length) {
594
- return false;
595
- }
596
- navigateHistory(view, "FORWARDS");
597
- return true;
598
- }
599
- }
600
- ])
601
- ];
602
- };
603
-
604
- // src/themes.ts
605
- import { light, mirage } from "ayu";
606
-
607
- // src/lang-cypher/create-cypher-theme.ts
608
- import {
609
- HighlightStyle,
610
- syntaxHighlighting as syntaxHighlighting2
611
- } from "@codemirror/language";
612
- import { EditorView as EditorView3 } from "@codemirror/view";
613
-
614
- // src/lang-cypher/theme-icons.ts
615
- var upArrowSvg = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
616
- <path fill-rule="evenodd" clip-rule="evenodd" d="M13.8538 6.99999L8.85384 2H8.14673L3.14673 6.99999L3.85384 7.7071L8.00027 3.56066V14H9.00027V3.56066L13.1467 7.7071L13.8538 6.99999Z" fill="#424242"/>
617
- </svg>`;
618
- var downArrowSvg = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
619
- <path fill-rule="evenodd" clip-rule="evenodd" d="M3.14667 9.00001L8.14665 14L8.85376 14L13.8538 9.00001L13.1467 8.2929L9.00021 12.4393L9.00022 2.00001L8.00022 2.00001L8.00022 12.4393L3.85378 8.2929L3.14667 9.00001Z" fill="#424242"/>
620
- </svg>`;
621
- var replaceSvg = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
622
- <path fill-rule="evenodd" clip-rule="evenodd" d="M3.22124 3.739L5.48224 6.008L7.70024 3.784L7.00025 3.084L5.98824 4.091L5.98024 2.491C5.97934 2.35567 6.03093 2.22525 6.12417 2.12716C6.21741 2.02908 6.34504 1.97095 6.48024 1.965H8.00024V1H6.48024C6.2852 1.00026 6.09213 1.03902 5.9121 1.11405C5.73207 1.18908 5.56862 1.29892 5.43112 1.43725C5.29363 1.57558 5.18479 1.73969 5.11085 1.92018C5.03691 2.10066 4.99932 2.29396 5.00024 2.489V4.1L3.92724 3.033L3.22124 3.739ZM9.89038 5.53277H9.90165C10.0838 5.84426 10.3524 6 10.7073 6C11.0998 6 11.4134 5.83236 11.6481 5.49708C11.8829 5.1618 12.0002 4.71728 12.0002 4.16353C12.0002 3.65304 11.8998 3.2507 11.6988 2.95652C11.4979 2.66234 11.2115 2.51525 10.8397 2.51525C10.434 2.51525 10.1214 2.70885 9.90165 3.09604H9.89038V1H9.00024V5.91888H9.89038V5.53277ZM9.8763 4.47177V4.13108C9.8763 3.88449 9.93452 3.6844 10.0509 3.53082C10.1693 3.37724 10.3176 3.30045 10.496 3.30045C10.6857 3.30045 10.8312 3.37833 10.9326 3.53407C11.0359 3.68765 11.0876 3.9018 11.0876 4.17651C11.0876 4.50746 11.0312 4.76379 10.9186 4.94549C10.8078 5.12503 10.6509 5.2148 10.4481 5.2148C10.281 5.2148 10.1439 5.14449 10.0369 5.00389C9.92982 4.86329 9.8763 4.68592 9.8763 4.47177ZM9.00024 12.7691C8.74457 12.923 8.37539 13 7.89272 13C7.3288 13 6.87241 12.8225 6.52354 12.4674C6.17468 12.1124 6.00024 11.6543 6.00024 11.0931C6.00024 10.4451 6.18662 9.93484 6.55938 9.5624C6.93453 9.18747 7.43513 9.00001 8.06118 9.00001C8.49367 9.00001 8.8067 9.0596 9.00024 9.17878V10.1769C8.76369 9.99319 8.49965 9.90132 8.20813 9.90132C7.88316 9.90132 7.62509 10.0006 7.43394 10.1993C7.24517 10.3954 7.15078 10.6673 7.15078 11.0149C7.15078 11.3526 7.24158 11.6183 7.42318 11.8119C7.60478 12.0031 7.85449 12.0987 8.17229 12.0987C8.45425 12.0987 8.73023 12.0068 9.00024 11.8231V12.7691ZM4.00024 7L3.00024 8V14L4.00024 15H11.0002L12.0002 14V8L11.0002 7H4.00024ZM4.00024 8H5.00024H10.0002H11.0002V9V13V14H10.0002H5.00024H4.00024V13V9V8Z" fill="#424242"/>
623
- </svg>`;
624
- var replaceAllSvg = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
625
- <path fill-rule="evenodd" clip-rule="evenodd" d="M11.6012 2.67683C11.7477 2.36708 11.9561 2.2122 12.2265 2.2122C12.4744 2.2122 12.6653 2.32987 12.7993 2.56522C12.9333 2.80056 13.0002 3.12243 13.0002 3.53082C13.0002 3.97383 12.922 4.32944 12.7655 4.59766C12.609 4.86589 12.3999 5 12.1383 5C11.9017 5 11.7226 4.87541 11.6012 4.62622H11.5937V4.93511H11.0002V1H11.5937V2.67683H11.6012ZM11.5843 3.77742C11.5843 3.94873 11.62 4.09063 11.6913 4.20311C11.7627 4.3156 11.8541 4.37184 11.9655 4.37184C12.1007 4.37184 12.2053 4.30002 12.2791 4.15639C12.3542 4.01103 12.3918 3.80597 12.3918 3.54121C12.3918 3.32144 12.3574 3.15012 12.2885 3.02726C12.2209 2.90266 12.1239 2.84036 11.9974 2.84036C11.8785 2.84036 11.7796 2.9018 11.7007 3.02466C11.6231 3.14752 11.5843 3.30759 11.5843 3.50487V3.77742ZM4.11993 7.695L2.00024 5.56781L2.66212 4.90594L3.66806 5.90625V4.39594C3.66719 4.21309 3.70243 4.03187 3.77175 3.86266C3.84107 3.69346 3.9431 3.53961 4.07201 3.40992C4.20091 3.28023 4.35414 3.17727 4.52292 3.10692C4.6917 3.03658 4.87271 3.00024 5.05556 3H7.39931V3.90469H5.05556C4.9288 3.91026 4.80915 3.96476 4.72173 4.05672C4.63432 4.14868 4.58596 4.27094 4.58681 4.39781L4.59431 5.89781L5.54306 4.95375L6.19931 5.61L4.11993 7.695ZM9.35585 4.93017H10.0002V3.22067C10.0002 2.40689 9.68559 2 9.05628 2C8.92122 2 8.77108 2.02421 8.60585 2.07263C8.44205 2.12104 8.31274 2.17691 8.21792 2.24022V2.90503C8.45499 2.70205 8.70499 2.60056 8.96792 2.60056C9.22941 2.60056 9.36016 2.75698 9.36016 3.06983L8.76102 3.17318C8.25384 3.25885 8.00024 3.57914 8.00024 4.13408C8.00024 4.39665 8.06131 4.60708 8.18343 4.76536C8.307 4.92179 8.47582 5 8.6899 5C8.98013 5 9.19924 4.83985 9.34723 4.51955H9.35585V4.93017ZM9.36016 3.57542V3.76816C9.36016 3.9432 9.31993 4.08845 9.23947 4.20391C9.15901 4.3175 9.05484 4.3743 8.92697 4.3743C8.83501 4.3743 8.76174 4.34264 8.70714 4.27933C8.65398 4.21415 8.6274 4.13128 8.6274 4.03073C8.6274 3.80912 8.73803 3.6797 8.9593 3.64246L9.36016 3.57542ZM7.00024 12.9302H6.35585V12.5196H6.34723C6.19924 12.8399 5.98013 13 5.6899 13C5.47582 13 5.307 12.9218 5.18343 12.7654C5.06131 12.6071 5.00024 12.3966 5.00024 12.1341C5.00024 11.5791 5.25384 11.2588 5.76102 11.1732L6.36016 11.0698C6.36016 10.757 6.22941 10.6006 5.96792 10.6006C5.70499 10.6006 5.45499 10.702 5.21792 10.905V10.2402C5.31274 10.1769 5.44205 10.121 5.60585 10.0726C5.77108 10.0242 5.92122 10 6.05628 10C6.68559 10 7.00024 10.4069 7.00024 11.2207V12.9302ZM6.36016 11.7682V11.5754L5.9593 11.6425C5.73803 11.6797 5.6274 11.8091 5.6274 12.0307C5.6274 12.1313 5.65398 12.2142 5.70714 12.2793C5.76174 12.3426 5.83501 12.3743 5.92697 12.3743C6.05484 12.3743 6.15901 12.3175 6.23947 12.2039C6.31993 12.0885 6.36016 11.9432 6.36016 11.7682ZM9.26189 13C9.58368 13 9.82979 12.9423 10.0002 12.8268V12.1173C9.82024 12.2551 9.63625 12.324 9.44827 12.324C9.2364 12.324 9.06994 12.2523 8.94887 12.1089C8.8278 11.9637 8.76727 11.7644 8.76727 11.5112C8.76727 11.2505 8.83019 11.0466 8.95604 10.8994C9.08348 10.7505 9.25552 10.676 9.47217 10.676C9.66651 10.676 9.84254 10.7449 10.0002 10.8827V10.1341C9.87121 10.0447 9.66253 10 9.3742 10C8.95684 10 8.6231 10.1406 8.373 10.4218C8.1245 10.7011 8.00024 11.0838 8.00024 11.5698C8.00024 11.9907 8.11653 12.3343 8.34911 12.6006C8.58169 12.8669 8.88595 13 9.26189 13ZM2.00024 9L3.00024 8H12.0002L13.0002 9V14L12.0002 15H3.00024L2.00024 14V9ZM3.00024 9V14H12.0002V9H3.00024ZM6.00024 7L7.00024 6H14.0002L15.0002 7V12L14.0002 13V12V7H7.00024H6.00024Z" fill="#424242"/>
626
- </svg>`;
627
- var caseSensitiveSvg = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
628
- <path fill-rule="evenodd" clip-rule="evenodd" d="M7.49524 9.052L8.38624 11.402H9.47724L6.23724 3H5.21724L2.00024 11.402H3.09524L3.93324 9.052H7.49524ZM5.81124 4.453L5.85524 4.588L7.17324 8.162H4.25524L5.56224 4.588L5.60624 4.453L5.64424 4.297L5.67624 4.145L5.69724 4.019H5.72024L5.74424 4.145L5.77324 4.297L5.81124 4.453ZM13.7952 10.464V11.4H14.7552V7.498C14.7552 6.779 14.5752 6.226 14.2162 5.837C13.8572 5.448 13.3272 5.254 12.6282 5.254C12.4292 5.254 12.2272 5.273 12.0222 5.31C11.8172 5.347 11.6222 5.394 11.4392 5.451C11.2562 5.508 11.0912 5.569 10.9442 5.636C10.7972 5.703 10.6832 5.765 10.6012 5.824V6.808C10.8672 6.578 11.1672 6.397 11.5052 6.268C11.8432 6.139 12.1942 6.075 12.5572 6.075C12.7452 6.075 12.9152 6.103 13.0702 6.16C13.2252 6.217 13.3572 6.306 13.4662 6.427C13.5752 6.548 13.6592 6.706 13.7182 6.899C13.7772 7.092 13.8062 7.326 13.8062 7.599L11.9952 7.851C11.6512 7.898 11.3552 7.977 11.1072 8.088C10.8592 8.199 10.6542 8.339 10.4922 8.507C10.3302 8.675 10.2102 8.868 10.1322 9.087C10.0542 9.306 10.0152 9.546 10.0152 9.808C10.0152 10.054 10.0572 10.283 10.1392 10.496C10.2212 10.709 10.3422 10.893 10.5022 11.047C10.6622 11.201 10.8622 11.323 11.1002 11.413C11.3382 11.503 11.6132 11.548 11.9262 11.548C12.3282 11.548 12.6862 11.456 13.0012 11.27C13.3162 11.084 13.5732 10.816 13.7722 10.464H13.7952ZM11.6672 8.721C11.8432 8.657 12.0682 8.607 12.3412 8.572L13.8062 8.367V8.976C13.8062 9.222 13.7652 9.451 13.6832 9.664C13.6012 9.877 13.4862 10.063 13.3402 10.221C13.1942 10.379 13.0192 10.503 12.8162 10.593C12.6132 10.683 12.3902 10.728 12.1482 10.728C11.9612 10.728 11.7952 10.703 11.6532 10.652C11.5112 10.601 11.3922 10.53 11.2962 10.441C11.2002 10.352 11.1272 10.247 11.0762 10.125C11.0252 10.003 11.0002 9.873 11.0002 9.732C11.0002 9.568 11.0182 9.421 11.0552 9.292C11.0922 9.163 11.1602 9.051 11.2572 8.958C11.3542 8.865 11.4912 8.785 11.6672 8.721Z" fill="#424242"/>
629
- </svg>`;
630
- var regexSvg = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
631
- <path fill-rule="evenodd" clip-rule="evenodd" d="M10.0124 2H10.9881V5.11346L13.5492 3.55609L14.0343 4.44095L11.4704 6L14.0343 7.55905L13.5492 8.44391L10.9881 6.88654V10H10.0124V6.88654L7.45138 8.44391L6.96631 7.55905L9.53014 6L6.96631 4.44095L7.45138 3.55609L10.0124 5.11346V2ZM2.00024 10H6.00024V14H2.00024V10Z" fill="#424242"/>
632
- </svg>`;
633
- var byWordSvg = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
634
- <path fill-rule="evenodd" clip-rule="evenodd" d="M1.00024 2H15.0002V3H1.00024V2ZM14.0002 4H13.0002V12H14.0002V4ZM11.2722 8.387C11.1942 8.088 11.0732 7.825 10.9122 7.601C10.7512 7.377 10.5472 7.2 10.3032 7.071C10.0592 6.942 9.76924 6.878 9.43724 6.878C9.23924 6.878 9.05724 6.902 8.89024 6.951C8.72524 7 8.57424 7.068 8.43724 7.156C8.30124 7.244 8.18024 7.35 8.07224 7.474L7.89324 7.732V4.578H7.00024V12H7.89324V11.425L8.01924 11.6C8.10624 11.702 8.20824 11.79 8.32324 11.869C8.44024 11.947 8.57224 12.009 8.72124 12.055C8.87024 12.101 9.03524 12.123 9.21924 12.123C9.57224 12.123 9.88524 12.052 10.1562 11.911C10.4282 11.768 10.6552 11.573 10.8382 11.325C11.0212 11.075 11.1592 10.782 11.2522 10.446C11.3452 10.108 11.3922 9.743 11.3922 9.349C11.3912 9.007 11.3522 8.686 11.2722 8.387ZM9.79324 7.78C9.94424 7.851 10.0752 7.956 10.1832 8.094C10.2922 8.234 10.3772 8.407 10.4382 8.611C10.4892 8.785 10.5202 8.982 10.5272 9.198L10.5202 9.323C10.5202 9.65 10.4872 9.943 10.4202 10.192C10.3532 10.438 10.2592 10.645 10.1422 10.806C10.0252 10.968 9.88224 11.091 9.72124 11.172C9.39924 11.334 8.96124 11.338 8.65224 11.187C8.49924 11.112 8.36624 11.012 8.25924 10.891C8.17424 10.795 8.10324 10.675 8.04124 10.524C8.04124 10.524 7.86224 10.077 7.86224 9.577C7.86224 9.077 8.04124 8.575 8.04124 8.575C8.10324 8.398 8.17724 8.257 8.26524 8.145C8.37924 8.002 8.52124 7.886 8.68924 7.8C8.85724 7.714 9.05424 7.671 9.27624 7.671C9.46624 7.671 9.64024 7.708 9.79324 7.78ZM15.0002 13H1.00024V14H15.0002V13ZM2.81324 10L2.08524 12.031H1.00024L1.02524 11.959L3.46624 4.87305H4.40724L6.89224 12.031H5.81024L5.03224 10H2.81324ZM3.93424 6.42205H3.91224L3.00724 9.17505H4.84824L3.93424 6.42205Z" fill="#424242"/>
635
- </svg>`;
636
-
637
- // src/lang-cypher/create-cypher-theme.ts
638
- var createCypherTheme = ({
639
- dark,
640
- editorSettings: settings,
641
- highlightStyles,
642
- inheritBgColor
643
- }) => {
644
- const themeOptions = {
645
- "&": {
646
- backgroundColor: inheritBgColor ? "inherit" : settings.background,
647
- color: settings.foreground,
648
- fontVariantLigatures: "none"
649
- },
650
- "&.cm-focused": {
651
- outline: "none"
652
- },
653
- ".cm-gutters": {
654
- backgroundColor: inheritBgColor ? "inherit" : settings.background,
655
- color: settings.gutterForeground,
656
- border: "none"
657
- },
658
- "&.cm-editor .cm-scroller": {
659
- fontFamily: "Fira Code, Menlo, Monaco, Lucida Console, monospace"
660
- },
661
- ".cm-content": {
662
- caretColor: settings.cursor
663
- },
664
- ".cm-cursor, .cm-dropCursor": {
665
- borderLeftColor: settings.cursor
666
- },
667
- ".cm-activeLine ::not(::selection)": {
668
- backgroundColor: settings.background
669
- },
670
- "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection ": {
671
- backgroundColor: settings.selection
672
- },
673
- "& .cm-selectionMatch": {
674
- backgroundColor: settings.textMatchingSelection
675
- },
676
- "& .cm-panels": {
677
- backgroundColor: settings.searchPanel.background,
678
- fontFamily: "Fira Code, Menlo, Monaco, Lucida Console, monospace"
679
- },
680
- "& .cm-completionLabel": {
681
- fontFamily: "Fira Code, Menlo, Monaco, Lucida Console, monospace",
682
- verticalAlign: "middle"
683
- },
684
- "& .cm-completionMatchedText": {
685
- fontWeight: "bold",
686
- color: settings.autoCompletionPanel.matchingTextColor,
687
- textDecoration: "none"
688
- },
689
- ".cm-tooltip-autocomplete": {
690
- "& > ul > li[aria-selected]": {
691
- backgroundColor: settings.autoCompletionPanel.selectedColor,
692
- color: settings.foreground
693
- },
694
- "& > ul": {
695
- backgroundColor: settings.autoCompletionPanel.backgroundColor,
696
- color: settings.foreground
697
- }
698
- },
699
- "& .cm-search.cm-panel": {
700
- "& input": {
701
- fontFamily: "Fira Code, Menlo, Monaco, Lucida Console, monospace"
702
- },
703
- backgroundColor: settings.searchPanel.background,
704
- color: settings.searchPanel.text,
705
- "& .cm-button[name=select]": { display: "none" },
706
- "& .cm-button": {
707
- backgroundImage: "none",
708
- color: settings.searchPanel.text,
709
- fontSize: 0,
710
- border: "none",
711
- verticalAlign: "middle",
712
- "&[name=next]::before": {
713
- content: `url("data:image/svg+xml;base64,${window.btoa(
714
- downArrowSvg
715
- )}")`
716
- },
717
- "&[name=prev]::before": {
718
- content: `url("data:image/svg+xml;base64,${window.btoa(
719
- upArrowSvg
720
- )}")`
721
- },
722
- "&[name=replace]::before": {
723
- content: `url("data:image/svg+xml;base64,${window.btoa(
724
- replaceSvg
725
- )}")`
726
- },
727
- "&[name=replaceAll]::before": {
728
- content: `url("data:image/svg+xml;base64,${window.btoa(
729
- replaceAllSvg
730
- )}")`
731
- },
732
- width: "20px",
733
- height: "20px",
734
- marginRight: "1px",
735
- marginLeft: "1px",
736
- borderRadius: "4px",
737
- padding: "2px",
738
- "&:hover": {
739
- backgroundColor: settings.searchPanel.buttonHoverBackground
740
- }
741
- },
742
- "& label": {
743
- fontSize: "0",
744
- height: "20px",
745
- width: "20px",
746
- verticalAlign: "middle",
747
- "& input[type='checkbox']": {
748
- cursor: "pointer",
749
- appearance: "none",
750
- marginRight: "1px",
751
- marginLeft: "1px",
752
- padding: "2px",
753
- height: "20px",
754
- width: "20px",
755
- verticalAlign: "middle",
756
- display: "inline-flex",
757
- borderRadius: "4px",
758
- "&[name=case]::before": {
759
- content: `url("data:image/svg+xml;base64,${window.btoa(
760
- caseSensitiveSvg
761
- )}")`
762
- },
763
- "&[name=re]::before": {
764
- content: `url("data:image/svg+xml;base64,${window.btoa(
765
- regexSvg
766
- )}")`
767
- },
768
- "&[name=word]::before": {
769
- content: `url("data:image/svg+xml;base64,${window.btoa(
770
- byWordSvg
771
- )}")`
772
- },
773
- "&:hover": {
774
- backgroundColor: settings.searchPanel.buttonHoverBackground
775
- },
776
- "&:checked": {
777
- backgroundColor: settings.searchPanel.buttonHoverBackground
778
- }
779
- }
780
- }
781
- }
782
- };
783
- const themeExtension = EditorView3.theme(themeOptions, { dark });
784
- const styles = Object.entries(highlightStyles).map(
785
- ([token, color]) => ({
786
- tag: tokenTypeToStyleTag[token],
787
- color
788
- })
789
- );
790
- const highlightStyle = HighlightStyle.define(styles);
791
- const extension = [themeExtension, syntaxHighlighting2(highlightStyle)];
792
- return extension;
793
- };
794
-
795
- // src/ndl-tokens-copy.ts
796
- var tokens = {
797
- borderRadius: {
798
- "1xl": "12px",
799
- "2xl": "14px",
800
- "3xl": "16px",
801
- "4xl": "18px",
802
- "5xl": "20px",
803
- full: "9999px",
804
- lg: "8px",
805
- md: "6px",
806
- none: "0px",
807
- sm: "4px",
808
- xl: "10px"
809
- },
810
- boxShadow: {
811
- l2: "0px 1px 2px 0px rgba(12, 26, 37, 0.18)",
812
- l3: "0px 4px 8px 0px rgba(12, 26, 37, 0.04)",
813
- l4: "0px 4px 8px 0px rgba(12, 26, 37, 0.08)",
814
- l5: "0px 8px 20px 0px rgba(12, 26, 37, 0.12)"
815
- },
816
- breakpoints: {
817
- "2xl": "1536px",
818
- lg: "1024px",
819
- md: "768px",
820
- sm: "640px",
821
- xl: "1280px",
822
- xs: "450px"
823
- },
824
- colors: {
825
- blueberry: {
826
- "10": "#E8EBF6",
827
- "20": "#C4CCE9",
828
- "30": "#9DABD9",
829
- "40": "#768ACA",
830
- "50": "#3557B4",
831
- "60": "#25459E",
832
- "70": "#0B297D"
833
- },
834
- danger: {
835
- "10": "#ffe6e9",
836
- "20": "#ffb8c4",
837
- "30": "#ff668a",
838
- "40": "#ed1252",
839
- "50": "#cc254b",
840
- "60": "#a1003b",
841
- "70": "#7a0031"
842
- },
843
- mint: {
844
- "10": "#F0FFFA",
845
- "20": "#D1FFF4",
846
- "30": "#A8FFEE",
847
- "40": "#55F9E2",
848
- "50": "#3DD4C5",
849
- "60": "#2AADA5",
850
- "70": "#116161"
851
- },
852
- neutral: {
853
- "10": "#FFFFFF",
854
- "20": "#F5F7FA",
855
- "30": "#EEF1F6",
856
- "40": "#E6E9EE",
857
- "50": "#C4C8CD",
858
- "60": "#B2B7BD",
859
- "70": "#717780",
860
- "80": "#535B66",
861
- "90": "#151E29"
862
- },
863
- primary: {
864
- "10": "#e6f8ff",
865
- "20": "#a3e2ff",
866
- "30": "#7ad1ff",
867
- "40": "#018bff",
868
- "50": "#006FD6",
869
- "60": "#0056b3",
870
- "70": "#004092"
871
- },
872
- success: {
873
- "10": "#E1FAEF",
874
- "20": "#98EDCB",
875
- "30": "#44D4A4",
876
- "40": "#00BA88",
877
- "50": "#327D60",
878
- "60": "#006E58",
879
- "70": "#00473B"
880
- },
881
- warning: {
882
- "10": "#FFFBDE",
883
- "20": "#FFF4B5",
884
- "30": "#FFEA8C",
885
- "40": "#FFDE63",
886
- "50": "#D9B54A",
887
- "60": "#966c2e",
888
- "70": "#664817"
889
- }
890
- },
891
- font: {
892
- size: {
893
- "body-large": "1rem",
894
- "body-medium": "0.875rem",
895
- "body-small": "0.75rem",
896
- code: "0.875rem",
897
- h1: "3rem",
898
- h2: "2.5rem",
899
- h3: "1.875rem",
900
- h4: "1.5rem",
901
- h5: "1.25rem",
902
- h6: "1rem",
903
- label: "0.875rem",
904
- "subheading-large": "1.25rem",
905
- "subheading-medium": "1rem",
906
- "subheading-small": "0.875rem"
907
- },
908
- weight: {
909
- bold: "700",
910
- light: "300",
911
- medium: "500",
912
- normal: "400",
913
- semibold: "600"
914
- }
915
- },
916
- palette: {
917
- categorical: {
918
- "1": "#55BDC5",
919
- "10": "#BF732D",
920
- "11": "#478A6E",
921
- "12": "#ADE86B",
922
- "2": "#4D49CB",
923
- "3": "#DC8B39",
924
- "4": "#C9458D",
925
- "5": "#8E8CF3",
926
- "6": "#78DE7C",
927
- "7": "#3F80E3",
928
- "8": "#673FAB",
929
- "9": "#DBBF40"
930
- },
931
- dark: {
932
- danger: {
933
- bg: {
934
- strong: "#ffb8c4",
935
- weak: "68, 61, 72"
936
- },
937
- border: {
938
- strong: "#ffb8c4",
939
- weak: "114, 91, 103"
940
- },
941
- hover: {
942
- strong: "#ff668a",
943
- weak: "rgba(255, 102, 138,0.08)"
944
- },
945
- icon: "#ffb8c4",
946
- pressed: {
947
- strong: "#ff668a",
948
- weak: "rgba(255, 102, 138,0.12)"
949
- },
950
- text: "#ffb8c4"
951
- },
952
- neutral: {
953
- bg: {
954
- default: "#151E29",
955
- strong: "45, 53, 63",
956
- strongest: "#FFFFFF",
957
- weak: "29, 38, 49"
958
- },
959
- border: {
960
- strong: "#717780",
961
- weak: "37, 47, 59"
962
- },
963
- hover: "rgba(196, 200, 205,0.1)",
964
- icon: "#C4C8CD",
965
- pressed: "rgba(196, 200, 205,0.2)",
966
- text: {
967
- default: "#F5F7FA",
968
- inverse: "#151E29",
969
- weak: "#C4C8CD",
970
- weaker: "#B2B7BD",
971
- weakest: "#717780"
972
- }
973
- },
974
- primary: {
975
- bg: {
976
- strong: "#a3e2ff",
977
- weak: "49, 69, 84"
978
- },
979
- border: {
980
- strong: "#a3e2ff",
981
- weak: "78, 108, 126"
982
- },
983
- focus: "#7ad1ff",
984
- hover: {
985
- strong: "#7ad1ff",
986
- weak: "rgba(122, 209, 255,0.08)"
987
- },
988
- icon: "#a3e2ff",
989
- pressed: {
990
- strong: "#7ad1ff",
991
- weak: "rgba(122, 209, 255,0.12)"
992
- },
993
- text: "#a3e2ff"
994
- },
995
- success: {
996
- bg: {
997
- strong: "#98EDCB",
998
- weak: "47, 71, 73"
999
- },
1000
- border: {
1001
- strong: "#98EDCB",
1002
- weak: "73, 113, 106"
1003
- },
1004
- icon: "#98EDCB",
1005
- text: "#98EDCB"
1006
- },
1007
- warning: {
1008
- bg: {
1009
- strong: "#FFEA8C",
1010
- weak: "68, 71, 60"
1011
- },
1012
- border: {
1013
- strong: "#FFEA8C",
1014
- weak: "114, 111, 80"
1015
- },
1016
- icon: "#FFEA8C",
1017
- text: "#FFEA8C"
1018
- }
1019
- },
1020
- graph: {
1021
- "1": "#FFDF81",
1022
- "10": "#FFC354",
1023
- "11": "#DA7294",
1024
- "12": "#579380",
1025
- "2": "#C990C0",
1026
- "3": "#F79767",
1027
- "4": "#56C7E4",
1028
- "5": "#F16767",
1029
- "6": "#D8C7AE",
1030
- "7": "#8DCC93",
1031
- "8": "#ECB4C9",
1032
- "9": "#4D8DDA"
1033
- },
1034
- light: {
1035
- danger: {
1036
- bg: {
1037
- strong: "#cc254b",
1038
- weak: "#ffe6e9"
1039
- },
1040
- border: {
1041
- strong: "#cc254b",
1042
- weak: "#ffb8c4"
1043
- },
1044
- hover: {
1045
- strong: "#a1003b",
1046
- weak: "rgba(237,18,82,0.08)"
1047
- },
1048
- icon: "#cc254b",
1049
- pressed: {
1050
- strong: "#7a0031",
1051
- weak: "rgba(237,18,82,0.12)"
1052
- },
1053
- text: "#cc254b"
1054
- },
1055
- neutral: {
1056
- bg: {
1057
- default: "#F5F7FA",
1058
- strong: "#E6E9EE",
1059
- strongest: "#535B66",
1060
- weak: "#FFFFFF"
1061
- },
1062
- border: {
1063
- strong: "#C4C8CD",
1064
- weak: "#EEF1F6"
1065
- },
1066
- hover: "rgba(113,119,128,0.1)",
1067
- icon: "#535B66",
1068
- pressed: "rgba(113,119,128,0.2)",
1069
- text: {
1070
- default: "#151E29",
1071
- inverse: "#FFFFFF",
1072
- weak: "#535B66",
1073
- weaker: "#717780",
1074
- weakest: "#B2B7BD"
1075
- }
1076
- },
1077
- primary: {
1078
- bg: {
1079
- strong: "#006FD6",
1080
- weak: "#e6f8ff"
1081
- },
1082
- border: {
1083
- strong: "#006FD6",
1084
- weak: "#7ad1ff"
1085
- },
1086
- focus: "#018bff",
1087
- hover: {
1088
- strong: "#0056b3",
1089
- weak: "rgba(1,139,255,0.08)"
1090
- },
1091
- icon: "#006FD6",
1092
- pressed: {
1093
- strong: "#004092",
1094
- weak: "rgba(1,139,255,0.12)"
1095
- },
1096
- text: "#006FD6"
1097
- },
1098
- success: {
1099
- bg: {
1100
- strong: "#327D60",
1101
- weak: "#E1FAEF"
1102
- },
1103
- border: {
1104
- strong: "#327D60",
1105
- weak: "#98EDCB"
1106
- },
1107
- icon: "#327D60",
1108
- text: "#327D60"
1109
- },
1110
- warning: {
1111
- bg: {
1112
- strong: "#966c2e",
1113
- weak: "#FFFBDE"
1114
- },
1115
- border: {
1116
- strong: "#966c2e",
1117
- weak: "#FFEA8C"
1118
- },
1119
- icon: "#966c2e",
1120
- text: "#966c2e"
1121
- }
1122
- }
1123
- },
1124
- space: {
1125
- "0": "0px",
1126
- "1": "1px",
1127
- "10": "64px",
1128
- "11": "96px",
1129
- "12": "128px",
1130
- "13": "320px",
1131
- "2": "2px",
1132
- "3": "4px",
1133
- "4": "8px",
1134
- "5": "12px",
1135
- "6": "16px",
1136
- "7": "24px",
1137
- "8": "32px",
1138
- "9": "48px"
1139
- },
1140
- transitions: {
1141
- default: "all 100ms cubic-bezier(0.420, 0.000, 0.580, 1.000)",
1142
- stripped: "100ms cubic-bezier(0.420, 0.000, 0.580, 1.000)",
1143
- values: {
1144
- duration: {
1145
- default: "100ms"
1146
- },
1147
- properties: {
1148
- default: "all"
1149
- },
1150
- "timing-function": {
1151
- default: "cubic-bezier(0.420, 0.000, 0.580, 1.000)"
1152
- }
1153
- }
1154
- },
1155
- zIndex: {
1156
- "0": 0,
1157
- "10": 10,
1158
- "20": 20,
1159
- "30": 30,
1160
- "40": 40,
1161
- "50": 50,
1162
- "60": 60,
1163
- alias: {
1164
- banner: 20,
1165
- blanket: 30,
1166
- modal: 60,
1167
- overlay: 10,
1168
- popover: 40,
1169
- tooltip: 50
1170
- },
1171
- auto: "auto",
1172
- deep: -999999
1173
- }
1174
- };
1175
-
1176
- // src/themes.ts
1177
- var convertToHex = (color) => {
1178
- if (color.startsWith("#")) {
1179
- return color;
1180
- }
1181
- const rgb = color.match(/\d+/g);
1182
- if (!rgb) {
1183
- return color;
1184
- }
1185
- const [r, g, b] = rgb;
1186
- return `#${Number(r).toString(16)}${Number(g).toString(16)}${Number(
1187
- b
1188
- ).toString(16)}`;
1189
- };
1190
- var lightThemeConstants = {
1191
- dark: false,
1192
- editorSettings: {
1193
- background: light.editor.bg.hex(),
1194
- foreground: light.editor.fg.hex(),
1195
- gutterForeground: light.editor.gutter.normal.hex(),
1196
- selection: light.editor.selection.active.hex(),
1197
- textMatchingSelection: light.editor.findMatch.active.hex(),
1198
- cursor: "#000000",
1199
- autoCompletionPanel: {
1200
- selectedColor: "#cce2ff",
1201
- matchingTextColor: "#0066bf",
1202
- backgroundColor: "#F3F4F5"
1203
- },
1204
- searchPanel: {
1205
- background: tokens.palette.light.neutral.bg.default,
1206
- text: tokens.palette.light.neutral.text.default,
1207
- buttonHoverBackground: tokens.palette.light.neutral.bg.strong
1208
- }
1209
- },
1210
- highlightStyles: {
1211
- comment: light.syntax.comment.hex(),
1212
- keyword: light.syntax.keyword.hex(),
1213
- keywordLiteral: light.syntax.keyword.hex(),
1214
- label: light.syntax.markup.hex(),
1215
- predicateFunction: light.syntax.func.hex(),
1216
- function: light.syntax.func.hex(),
1217
- procedure: light.syntax.func.hex(),
1218
- stringLiteral: light.syntax.string.hex(),
1219
- numberLiteral: light.syntax.constant.hex(),
1220
- booleanLiteral: light.syntax.constant.hex(),
1221
- operator: light.syntax.operator.hex(),
1222
- property: light.syntax.tag.hex(),
1223
- paramDollar: light.syntax.regexp.hex(),
1224
- paramValue: light.syntax.regexp.hex(),
1225
- namespace: light.syntax.special.hex()
1226
- }
1227
- };
1228
- var darkThemeConstants = {
1229
- dark: true,
1230
- editorSettings: {
1231
- background: mirage.editor.bg.hex(),
1232
- foreground: mirage.editor.fg.hex(),
1233
- gutterForeground: mirage.editor.gutter.normal.hex(),
1234
- selection: mirage.editor.selection.active.hex(),
1235
- textMatchingSelection: mirage.editor.findMatch.active.hex(),
1236
- cursor: "#ffffff",
1237
- autoCompletionPanel: {
1238
- selectedColor: "#062f4a",
1239
- matchingTextColor: "#0097fb",
1240
- backgroundColor: "#1C212B"
1241
- },
1242
- searchPanel: {
1243
- background: convertToHex(tokens.palette.dark.neutral.bg.default),
1244
- text: convertToHex(tokens.palette.dark.neutral.text.default),
1245
- buttonHoverBackground: convertToHex(
1246
- tokens.palette.dark.neutral.bg.strong
1247
- )
1248
- }
1249
- },
1250
- highlightStyles: {
1251
- comment: mirage.syntax.comment.hex(),
1252
- keyword: mirage.syntax.keyword.hex(),
1253
- keywordLiteral: mirage.syntax.keyword.hex(),
1254
- label: mirage.syntax.markup.hex(),
1255
- predicateFunction: mirage.syntax.func.hex(),
1256
- function: mirage.syntax.func.hex(),
1257
- procedure: mirage.syntax.func.hex(),
1258
- stringLiteral: mirage.syntax.string.hex(),
1259
- numberLiteral: mirage.syntax.constant.hex(),
1260
- booleanLiteral: mirage.syntax.constant.hex(),
1261
- operator: mirage.syntax.operator.hex(),
1262
- property: mirage.syntax.tag.hex(),
1263
- paramDollar: mirage.syntax.regexp.hex(),
1264
- paramValue: mirage.syntax.regexp.hex(),
1265
- namespace: mirage.syntax.special.hex()
1266
- }
1267
- };
1268
- var ayuLightTheme = ({ inheritBgColor }) => {
1269
- return createCypherTheme({ ...lightThemeConstants, inheritBgColor });
1270
- };
1271
- var ayuDarkTheme = ({ inheritBgColor }) => {
1272
- return createCypherTheme({ ...darkThemeConstants, inheritBgColor });
1273
- };
1274
- function getThemeExtension(theme, inheritBgColor) {
1275
- switch (theme) {
1276
- case "light":
1277
- return ayuLightTheme({ inheritBgColor });
1278
- case "dark":
1279
- return ayuDarkTheme({ inheritBgColor });
1280
- case "none":
1281
- return [];
1282
- default:
1283
- return theme;
1284
- }
1285
- }
1286
-
1287
- // src/CypherEditor.tsx
1288
- import { jsx } from "react/jsx-runtime";
1289
- var CypherEditor = React.forwardRef((props, ref) => {
1290
- const {
1291
- theme = "light",
1292
- extensions = [],
1293
- prompt,
1294
- onExecute,
1295
- initialHistory = [],
1296
- onNewHistoryEntry,
1297
- extraKeybindings = [],
1298
- lineWrap = false,
1299
- overrideThemeBackgroundColor = false,
1300
- schema = {},
1301
- lint = true,
1302
- ...rest
1303
- } = props;
1304
- const maybeReplMode = onExecute ? replMode({
1305
- onExecute,
1306
- initialHistory,
1307
- onNewHistoryEntry
1308
- }) : [];
1309
- return /* @__PURE__ */ jsx(
1310
- CodeEditor,
1311
- {
1312
- ref,
1313
- theme: getThemeExtension(theme, overrideThemeBackgroundColor),
1314
- extensions: [
1315
- cypher({ lint, schema }),
1316
- keymap3.of(extraKeybindings),
1317
- maybeReplMode,
1318
- basicNeo4jSetup(prompt),
1319
- lineWrap ? EditorView4.lineWrapping : [],
1320
- ...extensions
1321
- ],
1322
- basicSetup: false,
1323
- indentWithTab: false,
1324
- ...rest
1325
- }
1326
- );
1327
- });
1328
- export {
1329
- CypherEditor,
1330
- CypherParser,
1331
- ReactCodemirror,
1332
- cypher,
1333
- darkThemeConstants,
1334
- lightThemeConstants,
1335
- parse
1336
- };