@neo4j-cypher/react-codemirror 2.0.0-next.2 → 2.0.0-next.21
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.
- package/CHANGELOG.md +174 -0
- package/dist/{types/CypherEditor.d.ts → CypherEditor.d.ts} +82 -3
- package/dist/CypherEditor.js +326 -0
- package/dist/CypherEditor.js.map +1 -0
- package/dist/CypherEditor.test.js +151 -0
- package/dist/CypherEditor.test.js.map +1 -0
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +2 -0
- package/dist/constants.js.map +1 -0
- package/dist/e2e_tests/autoCompletion.spec.js +318 -0
- package/dist/e2e_tests/autoCompletion.spec.js.map +1 -0
- package/dist/e2e_tests/configuration.spec.js +83 -0
- package/dist/e2e_tests/configuration.spec.js.map +1 -0
- package/dist/e2e_tests/debounce.spec.js +66 -0
- package/dist/e2e_tests/debounce.spec.js.map +1 -0
- package/dist/{types/e2e_tests/e2e-utils.d.ts → e2e_tests/e2eUtils.d.ts} +1 -0
- package/dist/e2e_tests/e2eUtils.js +71 -0
- package/dist/e2e_tests/e2eUtils.js.map +1 -0
- package/dist/e2e_tests/extraKeybindings.spec.js +43 -0
- package/dist/e2e_tests/extraKeybindings.spec.js.map +1 -0
- package/dist/e2e_tests/historyNavigation.spec.js +227 -0
- package/dist/e2e_tests/historyNavigation.spec.js.map +1 -0
- package/dist/e2e_tests/performanceTest.spec.d.ts +6 -0
- package/dist/e2e_tests/performanceTest.spec.js +97 -0
- package/dist/e2e_tests/performanceTest.spec.js.map +1 -0
- package/dist/e2e_tests/sanityChecks.spec.js +53 -0
- package/dist/e2e_tests/sanityChecks.spec.js.map +1 -0
- package/dist/e2e_tests/signatureHelp.spec.js +228 -0
- package/dist/e2e_tests/signatureHelp.spec.js.map +1 -0
- package/dist/e2e_tests/snippets.spec.js +62 -0
- package/dist/e2e_tests/snippets.spec.js.map +1 -0
- package/dist/e2e_tests/syntaxHighlighting.spec.d.ts +1 -0
- package/dist/e2e_tests/syntaxHighlighting.spec.js +90 -0
- package/dist/e2e_tests/syntaxHighlighting.spec.js.map +1 -0
- package/dist/e2e_tests/syntaxValidation.spec.d.ts +1 -0
- package/dist/e2e_tests/syntaxValidation.spec.js +116 -0
- package/dist/e2e_tests/syntaxValidation.spec.js.map +1 -0
- package/dist/historyNavigation.js +163 -0
- package/dist/historyNavigation.js.map +1 -0
- package/dist/{types/icons.d.ts → icons.d.ts} +1 -1
- package/dist/icons.js +62 -0
- package/dist/icons.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/lang-cypher/autocomplete.d.ts +6 -0
- package/dist/lang-cypher/autocomplete.js +115 -0
- package/dist/lang-cypher/autocomplete.js.map +1 -0
- package/dist/{types/lang-cypher → lang-cypher}/constants.d.ts +11 -0
- package/dist/lang-cypher/constants.js +69 -0
- package/dist/lang-cypher/constants.js.map +1 -0
- package/dist/lang-cypher/contants.test.d.ts +1 -0
- package/dist/lang-cypher/contants.test.js +103 -0
- package/dist/lang-cypher/contants.test.js.map +1 -0
- package/dist/lang-cypher/createCypherTheme.js +182 -0
- package/dist/lang-cypher/createCypherTheme.js.map +1 -0
- package/dist/lang-cypher/langCypher.d.ts +14 -0
- package/dist/lang-cypher/langCypher.js +23 -0
- package/dist/lang-cypher/langCypher.js.map +1 -0
- package/dist/lang-cypher/lintWorker.d.ts +12 -0
- package/dist/lang-cypher/lintWorker.js +14 -0
- package/dist/lang-cypher/lintWorker.js.map +1 -0
- package/dist/lang-cypher/parser-adapter.d.ts +19 -0
- package/dist/lang-cypher/parser-adapter.js +113 -0
- package/dist/lang-cypher/parser-adapter.js.map +1 -0
- package/dist/lang-cypher/signatureHelp.d.ts +4 -0
- package/dist/lang-cypher/signatureHelp.js +109 -0
- package/dist/lang-cypher/signatureHelp.js.map +1 -0
- package/dist/{types/lang-cypher/syntax-validation.d.ts → lang-cypher/syntaxValidation.d.ts} +2 -1
- package/dist/lang-cypher/syntaxValidation.js +52 -0
- package/dist/lang-cypher/syntaxValidation.js.map +1 -0
- package/dist/lang-cypher/themeIcons.js +22 -0
- package/dist/lang-cypher/themeIcons.js.map +1 -0
- package/dist/lang-cypher/utils.d.ts +2 -0
- package/dist/lang-cypher/utils.js +10 -0
- package/dist/lang-cypher/utils.js.map +1 -0
- package/dist/ndlTokensCopy.d.ts +570 -0
- package/dist/ndlTokensCopy.js +571 -0
- package/dist/ndlTokensCopy.js.map +1 -0
- package/dist/ndlTokensCopy.test.d.ts +1 -0
- package/dist/ndlTokensCopy.test.js +12 -0
- package/dist/ndlTokensCopy.test.js.map +1 -0
- package/dist/neo4jSetup.d.ts +6 -0
- package/dist/neo4jSetup.js +120 -0
- package/dist/neo4jSetup.js.map +1 -0
- package/dist/{types/themes.d.ts → themes.d.ts} +1 -1
- package/dist/themes.js +93 -0
- package/dist/themes.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +32 -34
- package/src/CypherEditor.test.tsx +200 -0
- package/src/CypherEditor.tsx +311 -41
- package/src/constants.ts +1 -0
- package/src/e2e_tests/autoCompletion.spec.tsx +546 -0
- package/src/e2e_tests/configuration.spec.tsx +111 -0
- package/src/e2e_tests/debounce.spec.tsx +106 -0
- package/src/e2e_tests/{e2e-utils.ts → e2eUtils.ts} +24 -2
- package/src/e2e_tests/{extra-keybindings.spec.tsx → extraKeybindings.spec.tsx} +1 -3
- package/src/e2e_tests/{history-navigation.spec.tsx → historyNavigation.spec.tsx} +137 -18
- package/src/e2e_tests/performanceTest.spec.tsx +163 -0
- package/src/e2e_tests/{sanity-checks.spec.tsx → sanityChecks.spec.tsx} +7 -22
- package/src/e2e_tests/signatureHelp.spec.tsx +445 -0
- package/src/e2e_tests/snippets.spec.tsx +92 -0
- package/src/e2e_tests/{syntax-highlighting.spec.tsx → syntaxHighlighting.spec.tsx} +26 -24
- package/src/e2e_tests/{syntax-validation.spec.tsx → syntaxValidation.spec.tsx} +97 -10
- package/src/{history-navigation.ts → historyNavigation.ts} +1 -1
- package/src/icons.ts +3 -0
- package/src/index.ts +2 -2
- package/src/lang-cypher/autocomplete.ts +100 -18
- package/src/lang-cypher/constants.ts +27 -0
- package/src/lang-cypher/contants.test.ts +6 -2
- package/src/lang-cypher/{create-cypher-theme.ts → createCypherTheme.ts} +44 -2
- package/src/lang-cypher/langCypher.ts +43 -0
- package/src/lang-cypher/lintWorker.ts +31 -0
- package/src/lang-cypher/parser-adapter.ts +145 -0
- package/src/lang-cypher/signatureHelp.ts +151 -0
- package/src/lang-cypher/syntaxValidation.ts +66 -0
- package/src/lang-cypher/utils.ts +9 -0
- package/src/{ndl-tokens-copy.test.ts → ndlTokensCopy.test.ts} +2 -1
- package/src/ndlTokensCopy.ts +570 -0
- package/src/{neo4j-setup.tsx → neo4jSetup.tsx} +78 -17
- package/src/themes.ts +45 -70
- package/src/viteEnv.d.ts +1 -0
- package/dist/cjs/index.cjs +0 -1440
- package/dist/cjs/index.cjs.map +0 -7
- package/dist/esm/index.mjs +0 -1463
- package/dist/esm/index.mjs.map +0 -7
- package/dist/types/e2e_tests/mock-data.d.ts +0 -3779
- package/dist/types/index.d.ts +0 -4
- package/dist/types/lang-cypher/ParserAdapter.d.ts +0 -14
- package/dist/types/lang-cypher/autocomplete.d.ts +0 -3
- package/dist/types/lang-cypher/lang-cypher.d.ts +0 -7
- package/dist/types/ndl-tokens-copy.d.ts +0 -379
- package/dist/types/neo4j-setup.d.ts +0 -2
- package/dist/types/tsconfig.tsbuildinfo +0 -1
- package/src/e2e_tests/auto-completion.spec.tsx +0 -232
- package/src/e2e_tests/mock-data.ts +0 -4310
- package/src/e2e_tests/performance-test.spec.tsx +0 -71
- package/src/lang-cypher/ParserAdapter.ts +0 -92
- package/src/lang-cypher/lang-cypher.ts +0 -32
- package/src/lang-cypher/syntax-validation.ts +0 -24
- package/src/ndl-tokens-copy.ts +0 -379
- /package/dist/{types/e2e_tests/auto-completion.spec.d.ts → CypherEditor.test.d.ts} +0 -0
- /package/dist/{types/e2e_tests/extra-keybindings.spec.d.ts → e2e_tests/autoCompletion.spec.d.ts} +0 -0
- /package/dist/{types/e2e_tests/history-navigation.spec.d.ts → e2e_tests/configuration.spec.d.ts} +0 -0
- /package/dist/{types/e2e_tests/performance-test.spec.d.ts → e2e_tests/debounce.spec.d.ts} +0 -0
- /package/dist/{types/e2e_tests/sanity-checks.spec.d.ts → e2e_tests/extraKeybindings.spec.d.ts} +0 -0
- /package/dist/{types/e2e_tests/syntax-highlighting.spec.d.ts → e2e_tests/historyNavigation.spec.d.ts} +0 -0
- /package/dist/{types/e2e_tests/syntax-validation.spec.d.ts → e2e_tests/sanityChecks.spec.d.ts} +0 -0
- /package/dist/{types/lang-cypher/contants.test.d.ts → e2e_tests/signatureHelp.spec.d.ts} +0 -0
- /package/dist/{types/ndl-tokens-copy.test.d.ts → e2e_tests/snippets.spec.d.ts} +0 -0
- /package/dist/{types/history-navigation.d.ts → historyNavigation.d.ts} +0 -0
- /package/dist/{types/lang-cypher/create-cypher-theme.d.ts → lang-cypher/createCypherTheme.d.ts} +0 -0
- /package/dist/{types/lang-cypher/theme-icons.d.ts → lang-cypher/themeIcons.d.ts} +0 -0
- /package/src/lang-cypher/{theme-icons.ts → themeIcons.ts} +0 -0
package/src/themes.ts
CHANGED
|
@@ -1,37 +1,18 @@
|
|
|
1
1
|
import { Extension } from '@codemirror/state';
|
|
2
|
-
import { light, mirage } from 'ayu';
|
|
3
2
|
import {
|
|
4
3
|
createCypherTheme,
|
|
5
4
|
ThemeOptions,
|
|
6
|
-
} from './lang-cypher/
|
|
7
|
-
import { tokens } from './
|
|
8
|
-
|
|
9
|
-
/* ndl exports most tokens as hex colors but some tokens are exported as rgb colors, in the form of "10, 20, 30"
|
|
10
|
-
This should be fixed in version 2 of ndl.
|
|
11
|
-
Meanwhile we can use this function */
|
|
12
|
-
const convertToHex = (color: string) => {
|
|
13
|
-
if (color.startsWith('#')) {
|
|
14
|
-
return color;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const rgb = color.match(/\d+/g);
|
|
18
|
-
if (!rgb) {
|
|
19
|
-
return color;
|
|
20
|
-
}
|
|
21
|
-
const [r, g, b] = rgb;
|
|
22
|
-
return `#${Number(r).toString(16)}${Number(g).toString(16)}${Number(
|
|
23
|
-
b,
|
|
24
|
-
).toString(16)}`;
|
|
25
|
-
};
|
|
5
|
+
} from './lang-cypher/createCypherTheme';
|
|
6
|
+
import { tokens } from './ndlTokensCopy';
|
|
26
7
|
|
|
27
8
|
export const lightThemeConstants: ThemeOptions = {
|
|
28
9
|
dark: false,
|
|
29
10
|
editorSettings: {
|
|
30
|
-
background:
|
|
31
|
-
foreground:
|
|
32
|
-
gutterForeground:
|
|
33
|
-
selection:
|
|
34
|
-
textMatchingSelection:
|
|
11
|
+
background: '#FEFEFE',
|
|
12
|
+
foreground: '#545454',
|
|
13
|
+
gutterForeground: '#a3a7ae',
|
|
14
|
+
selection: tokens.colors.neutral['20'],
|
|
15
|
+
textMatchingSelection: tokens.colors.lavender['15'],
|
|
35
16
|
cursor: '#000000',
|
|
36
17
|
autoCompletionPanel: {
|
|
37
18
|
selectedColor: '#cce2ff',
|
|
@@ -39,68 +20,62 @@ export const lightThemeConstants: ThemeOptions = {
|
|
|
39
20
|
backgroundColor: '#F3F4F5',
|
|
40
21
|
},
|
|
41
22
|
searchPanel: {
|
|
42
|
-
background:
|
|
43
|
-
text:
|
|
44
|
-
buttonHoverBackground: tokens.
|
|
23
|
+
background: '#FEFEFE',
|
|
24
|
+
text: '#545454',
|
|
25
|
+
buttonHoverBackground: tokens.theme.light.palette.neutral.bg.strong,
|
|
45
26
|
},
|
|
46
27
|
},
|
|
47
28
|
highlightStyles: {
|
|
48
|
-
comment: light.
|
|
49
|
-
keyword: light.
|
|
50
|
-
keywordLiteral:
|
|
51
|
-
label:
|
|
52
|
-
predicateFunction:
|
|
53
|
-
function:
|
|
54
|
-
procedure:
|
|
55
|
-
stringLiteral:
|
|
56
|
-
numberLiteral:
|
|
57
|
-
booleanLiteral:
|
|
58
|
-
operator: light.
|
|
59
|
-
property:
|
|
60
|
-
|
|
61
|
-
paramValue: light.syntax.regexp.hex(),
|
|
62
|
-
namespace: light.syntax.special.hex(),
|
|
29
|
+
comment: tokens.palette.code.light.comment,
|
|
30
|
+
keyword: tokens.palette.code.light.keyword,
|
|
31
|
+
keywordLiteral: tokens.palette.code.light.keywordLiteral,
|
|
32
|
+
label: tokens.palette.code.light.label,
|
|
33
|
+
predicateFunction: tokens.palette.code.light.predicateFunction,
|
|
34
|
+
function: tokens.palette.code.light.function,
|
|
35
|
+
procedure: tokens.palette.code.light.procedure,
|
|
36
|
+
stringLiteral: tokens.palette.code.light.stringLiteral,
|
|
37
|
+
numberLiteral: tokens.palette.code.light.numberLiteral,
|
|
38
|
+
booleanLiteral: tokens.palette.code.light.booleanLiteral,
|
|
39
|
+
operator: tokens.palette.code.light.operator,
|
|
40
|
+
property: tokens.palette.code.light.property,
|
|
41
|
+
paramValue: tokens.palette.code.light.paramValue,
|
|
63
42
|
},
|
|
64
43
|
};
|
|
65
44
|
|
|
66
45
|
export const darkThemeConstants: ThemeOptions = {
|
|
67
46
|
dark: true,
|
|
68
47
|
editorSettings: {
|
|
69
|
-
background:
|
|
70
|
-
foreground:
|
|
71
|
-
gutterForeground:
|
|
72
|
-
selection:
|
|
73
|
-
textMatchingSelection:
|
|
74
|
-
cursor: '
|
|
48
|
+
background: '#242936',
|
|
49
|
+
foreground: '#cccac2',
|
|
50
|
+
gutterForeground: '#8a919966',
|
|
51
|
+
selection: '#409fff40',
|
|
52
|
+
textMatchingSelection: '#695380',
|
|
53
|
+
cursor: tokens.colors.neutral['10'],
|
|
75
54
|
autoCompletionPanel: {
|
|
76
55
|
selectedColor: '#062f4a',
|
|
77
56
|
matchingTextColor: '#0097fb',
|
|
78
57
|
backgroundColor: '#1C212B',
|
|
79
58
|
},
|
|
80
59
|
searchPanel: {
|
|
81
|
-
background:
|
|
82
|
-
text:
|
|
83
|
-
buttonHoverBackground:
|
|
84
|
-
tokens.palette.dark.neutral.bg.strong,
|
|
85
|
-
),
|
|
60
|
+
background: tokens.theme.dark.palette.neutral.bg.default,
|
|
61
|
+
text: tokens.theme.dark.palette.neutral.text.default,
|
|
62
|
+
buttonHoverBackground: tokens.theme.dark.palette.neutral.bg.strong,
|
|
86
63
|
},
|
|
87
64
|
},
|
|
88
65
|
highlightStyles: {
|
|
89
|
-
comment:
|
|
90
|
-
keyword:
|
|
91
|
-
keywordLiteral:
|
|
92
|
-
label:
|
|
93
|
-
predicateFunction:
|
|
94
|
-
function:
|
|
95
|
-
procedure:
|
|
96
|
-
stringLiteral:
|
|
97
|
-
numberLiteral:
|
|
98
|
-
booleanLiteral:
|
|
99
|
-
operator:
|
|
100
|
-
property:
|
|
101
|
-
|
|
102
|
-
paramValue: mirage.syntax.regexp.hex(),
|
|
103
|
-
namespace: mirage.syntax.special.hex(),
|
|
66
|
+
comment: tokens.palette.code.dark.comment,
|
|
67
|
+
keyword: tokens.palette.code.dark.keyword,
|
|
68
|
+
keywordLiteral: tokens.palette.code.dark.keywordLiteral,
|
|
69
|
+
label: tokens.palette.code.dark.label,
|
|
70
|
+
predicateFunction: tokens.palette.code.dark.predicateFunction,
|
|
71
|
+
function: tokens.palette.code.dark.function,
|
|
72
|
+
procedure: tokens.palette.code.dark.procedure,
|
|
73
|
+
stringLiteral: tokens.palette.code.dark.stringLiteral,
|
|
74
|
+
numberLiteral: tokens.palette.code.dark.numberLiteral,
|
|
75
|
+
booleanLiteral: tokens.palette.code.dark.booleanLiteral,
|
|
76
|
+
operator: tokens.palette.code.dark.operator,
|
|
77
|
+
property: tokens.palette.code.dark.property,
|
|
78
|
+
paramValue: tokens.palette.code.dark.paramValue,
|
|
104
79
|
},
|
|
105
80
|
};
|
|
106
81
|
|
package/src/viteEnv.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|