@neo4j-ndl/react 0.7.2 → 0.8.1
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/lib/cjs/code-block/CodeBlock.js +104 -0
- package/lib/cjs/code-block/CodeBlock.js.map +1 -0
- package/lib/cjs/code-block/index.js +38 -0
- package/lib/cjs/code-block/index.js.map +1 -0
- package/lib/cjs/code-block/languages.js +302 -0
- package/lib/cjs/code-block/languages.js.map +1 -0
- package/lib/cjs/dropdown/Dropdown.js +1 -1
- package/lib/cjs/dropdown/Dropdown.js.map +1 -1
- package/lib/cjs/graph-label/GraphLabel.js +80 -42
- package/lib/cjs/graph-label/GraphLabel.js.map +1 -1
- package/lib/cjs/graph-label/color.js +87 -0
- package/lib/cjs/graph-label/color.js.map +1 -0
- package/lib/cjs/index.js +1 -0
- package/lib/cjs/index.js.map +1 -1
- package/lib/esm/code-block/CodeBlock.js +75 -0
- package/lib/esm/code-block/CodeBlock.js.map +1 -0
- package/lib/esm/code-block/index.js +22 -0
- package/lib/esm/code-block/index.js.map +1 -0
- package/lib/esm/code-block/languages.js +301 -0
- package/lib/esm/code-block/languages.js.map +1 -0
- package/lib/esm/dropdown/Dropdown.js +1 -1
- package/lib/esm/dropdown/Dropdown.js.map +1 -1
- package/lib/esm/graph-label/GraphLabel.js +57 -42
- package/lib/esm/graph-label/GraphLabel.js.map +1 -1
- package/lib/esm/graph-label/color.js +77 -0
- package/lib/esm/graph-label/color.js.map +1 -0
- package/lib/esm/index.js +1 -0
- package/lib/esm/index.js.map +1 -1
- package/lib/types/code-block/CodeBlock.d.ts +34 -0
- package/lib/types/code-block/index.d.ts +21 -0
- package/lib/types/code-block/languages.d.ts +23 -0
- package/lib/types/graph-label/GraphLabel.d.ts +11 -38
- package/lib/types/graph-label/color.d.ts +41 -0
- package/lib/types/index.d.ts +1 -0
- package/package.json +6 -3
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
const Languages = [
|
|
22
|
+
'abap',
|
|
23
|
+
'abnf',
|
|
24
|
+
'actionscript',
|
|
25
|
+
'ada',
|
|
26
|
+
'agda',
|
|
27
|
+
'al',
|
|
28
|
+
'antlr4',
|
|
29
|
+
'apacheconf',
|
|
30
|
+
'apex',
|
|
31
|
+
'apl',
|
|
32
|
+
'applescript',
|
|
33
|
+
'aql',
|
|
34
|
+
'arduino',
|
|
35
|
+
'arff',
|
|
36
|
+
'asciidoc',
|
|
37
|
+
'asm6502',
|
|
38
|
+
'asmatmel',
|
|
39
|
+
'aspnet',
|
|
40
|
+
'autohotkey',
|
|
41
|
+
'autoit',
|
|
42
|
+
'avisynth',
|
|
43
|
+
'avro-idl',
|
|
44
|
+
'bash',
|
|
45
|
+
'basic',
|
|
46
|
+
'batch',
|
|
47
|
+
'bbcode',
|
|
48
|
+
'bicep',
|
|
49
|
+
'birb',
|
|
50
|
+
'bison',
|
|
51
|
+
'bnf',
|
|
52
|
+
'brainfuck',
|
|
53
|
+
'brightscript',
|
|
54
|
+
'bro',
|
|
55
|
+
'bsl',
|
|
56
|
+
'c',
|
|
57
|
+
'cfscript',
|
|
58
|
+
'chaiscript',
|
|
59
|
+
'cil',
|
|
60
|
+
'clike',
|
|
61
|
+
'clojure',
|
|
62
|
+
'cmake',
|
|
63
|
+
'cobol',
|
|
64
|
+
'coffeescript',
|
|
65
|
+
'concurnas',
|
|
66
|
+
'coq',
|
|
67
|
+
'cpp',
|
|
68
|
+
'crystal',
|
|
69
|
+
'csharp',
|
|
70
|
+
'cshtml',
|
|
71
|
+
'csp',
|
|
72
|
+
'css-extras',
|
|
73
|
+
'css',
|
|
74
|
+
'csv',
|
|
75
|
+
'cypher',
|
|
76
|
+
'd',
|
|
77
|
+
'dart',
|
|
78
|
+
'dataweave',
|
|
79
|
+
'dax',
|
|
80
|
+
'dhall',
|
|
81
|
+
'diff',
|
|
82
|
+
'django',
|
|
83
|
+
'dns-zone-file',
|
|
84
|
+
'docker',
|
|
85
|
+
'dot',
|
|
86
|
+
'ebnf',
|
|
87
|
+
'editorconfig',
|
|
88
|
+
'eiffel',
|
|
89
|
+
'ejs',
|
|
90
|
+
'elixir',
|
|
91
|
+
'elm',
|
|
92
|
+
'erb',
|
|
93
|
+
'erlang',
|
|
94
|
+
'etlua',
|
|
95
|
+
'excel-formula',
|
|
96
|
+
'factor',
|
|
97
|
+
'false',
|
|
98
|
+
'firestore-security-rules',
|
|
99
|
+
'flow',
|
|
100
|
+
'fortran',
|
|
101
|
+
'fsharp',
|
|
102
|
+
'ftl',
|
|
103
|
+
'gap',
|
|
104
|
+
'gcode',
|
|
105
|
+
'gdscript',
|
|
106
|
+
'gedcom',
|
|
107
|
+
'gherkin',
|
|
108
|
+
'git',
|
|
109
|
+
'glsl',
|
|
110
|
+
'gml',
|
|
111
|
+
'gn',
|
|
112
|
+
'go-module',
|
|
113
|
+
'go',
|
|
114
|
+
'graphql',
|
|
115
|
+
'groovy',
|
|
116
|
+
'haml',
|
|
117
|
+
'handlebars',
|
|
118
|
+
'haskell',
|
|
119
|
+
'haxe',
|
|
120
|
+
'hcl',
|
|
121
|
+
'hlsl',
|
|
122
|
+
'hoon',
|
|
123
|
+
'hpkp',
|
|
124
|
+
'hsts',
|
|
125
|
+
'http',
|
|
126
|
+
'ichigojam',
|
|
127
|
+
'icon',
|
|
128
|
+
'icu-message-format',
|
|
129
|
+
'idris',
|
|
130
|
+
'iecst',
|
|
131
|
+
'ignore',
|
|
132
|
+
'inform7',
|
|
133
|
+
'ini',
|
|
134
|
+
'io',
|
|
135
|
+
'j',
|
|
136
|
+
'java',
|
|
137
|
+
'javadoc',
|
|
138
|
+
'javadoclike',
|
|
139
|
+
'javascript',
|
|
140
|
+
'javastacktrace',
|
|
141
|
+
'jexl',
|
|
142
|
+
'jolie',
|
|
143
|
+
'jq',
|
|
144
|
+
'js-extras',
|
|
145
|
+
'js-templates',
|
|
146
|
+
'jsdoc',
|
|
147
|
+
'json',
|
|
148
|
+
'json5',
|
|
149
|
+
'jsonp',
|
|
150
|
+
'jsstacktrace',
|
|
151
|
+
'jsx',
|
|
152
|
+
'julia',
|
|
153
|
+
'keepalived',
|
|
154
|
+
'keyman',
|
|
155
|
+
'kotlin',
|
|
156
|
+
'kumir',
|
|
157
|
+
'kusto',
|
|
158
|
+
'latex',
|
|
159
|
+
'latte',
|
|
160
|
+
'less',
|
|
161
|
+
'lilypond',
|
|
162
|
+
'liquid',
|
|
163
|
+
'lisp',
|
|
164
|
+
'livescript',
|
|
165
|
+
'llvm',
|
|
166
|
+
'log',
|
|
167
|
+
'lolcode',
|
|
168
|
+
'lua',
|
|
169
|
+
'magma',
|
|
170
|
+
'makefile',
|
|
171
|
+
'markdown',
|
|
172
|
+
'markup-templating',
|
|
173
|
+
'markup',
|
|
174
|
+
'matlab',
|
|
175
|
+
'maxscript',
|
|
176
|
+
'mel',
|
|
177
|
+
'mermaid',
|
|
178
|
+
'mizar',
|
|
179
|
+
'mongodb',
|
|
180
|
+
'monkey',
|
|
181
|
+
'moonscript',
|
|
182
|
+
'n1ql',
|
|
183
|
+
'n4js',
|
|
184
|
+
'nand2tetris-hdl',
|
|
185
|
+
'naniscript',
|
|
186
|
+
'nasm',
|
|
187
|
+
'neon',
|
|
188
|
+
'nevod',
|
|
189
|
+
'nginx',
|
|
190
|
+
'nim',
|
|
191
|
+
'nix',
|
|
192
|
+
'nsis',
|
|
193
|
+
'objectivec',
|
|
194
|
+
'ocaml',
|
|
195
|
+
'opencl',
|
|
196
|
+
'openqasm',
|
|
197
|
+
'oz',
|
|
198
|
+
'parigp',
|
|
199
|
+
'parser',
|
|
200
|
+
'pascal',
|
|
201
|
+
'pascaligo',
|
|
202
|
+
'pcaxis',
|
|
203
|
+
'peoplecode',
|
|
204
|
+
'perl',
|
|
205
|
+
'php-extras',
|
|
206
|
+
'php',
|
|
207
|
+
'phpdoc',
|
|
208
|
+
'plsql',
|
|
209
|
+
'powerquery',
|
|
210
|
+
'powershell',
|
|
211
|
+
'processing',
|
|
212
|
+
'prolog',
|
|
213
|
+
'promql',
|
|
214
|
+
'properties',
|
|
215
|
+
'protobuf',
|
|
216
|
+
'psl',
|
|
217
|
+
'pug',
|
|
218
|
+
'puppet',
|
|
219
|
+
'pure',
|
|
220
|
+
'purebasic',
|
|
221
|
+
'purescript',
|
|
222
|
+
'python',
|
|
223
|
+
'q',
|
|
224
|
+
'qml',
|
|
225
|
+
'qore',
|
|
226
|
+
'qsharp',
|
|
227
|
+
'r',
|
|
228
|
+
'racket',
|
|
229
|
+
'reason',
|
|
230
|
+
'regex',
|
|
231
|
+
'rego',
|
|
232
|
+
'renpy',
|
|
233
|
+
'rest',
|
|
234
|
+
'rip',
|
|
235
|
+
'roboconf',
|
|
236
|
+
'robotframework',
|
|
237
|
+
'ruby',
|
|
238
|
+
'rust',
|
|
239
|
+
'sas',
|
|
240
|
+
'sass',
|
|
241
|
+
'scala',
|
|
242
|
+
'scheme',
|
|
243
|
+
'scss',
|
|
244
|
+
'shell-session',
|
|
245
|
+
'smali',
|
|
246
|
+
'smalltalk',
|
|
247
|
+
'smarty',
|
|
248
|
+
'sml',
|
|
249
|
+
'solidity',
|
|
250
|
+
'solution-file',
|
|
251
|
+
'soy',
|
|
252
|
+
'sparql',
|
|
253
|
+
'splunk-spl',
|
|
254
|
+
'sqf',
|
|
255
|
+
'sql',
|
|
256
|
+
'squirrel',
|
|
257
|
+
'stan',
|
|
258
|
+
'stylus',
|
|
259
|
+
'swift',
|
|
260
|
+
'systemd',
|
|
261
|
+
't4-cs',
|
|
262
|
+
't4-templating',
|
|
263
|
+
't4-vb',
|
|
264
|
+
'tap',
|
|
265
|
+
'tcl',
|
|
266
|
+
'textile',
|
|
267
|
+
'toml',
|
|
268
|
+
'tremor',
|
|
269
|
+
'tsx',
|
|
270
|
+
'tt2',
|
|
271
|
+
'turtle',
|
|
272
|
+
'twig',
|
|
273
|
+
'typescript',
|
|
274
|
+
'typoscript',
|
|
275
|
+
'unrealscript',
|
|
276
|
+
'uorazor',
|
|
277
|
+
'uri',
|
|
278
|
+
'v',
|
|
279
|
+
'vala',
|
|
280
|
+
'vbnet',
|
|
281
|
+
'velocity',
|
|
282
|
+
'verilog',
|
|
283
|
+
'vhdl',
|
|
284
|
+
'vim',
|
|
285
|
+
'visual-basic',
|
|
286
|
+
'warpscript',
|
|
287
|
+
'wasm',
|
|
288
|
+
'web-idl',
|
|
289
|
+
'wiki',
|
|
290
|
+
'wolfram',
|
|
291
|
+
'wren',
|
|
292
|
+
'xeora',
|
|
293
|
+
'xml-doc',
|
|
294
|
+
'xojo',
|
|
295
|
+
'xquery',
|
|
296
|
+
'yaml',
|
|
297
|
+
'yang',
|
|
298
|
+
'zig',
|
|
299
|
+
];
|
|
300
|
+
export {};
|
|
301
|
+
//# sourceMappingURL=languages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"languages.js","sourceRoot":"","sources":["../../../src/code-block/languages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,MAAM,SAAS,GAAG;IAChB,MAAM;IACN,MAAM;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Q;IACR,MAAM;IACN,eAAe;IACf,OAAO;IACP,WAAW;IACX,QAAQ;IACR,KAAK;IACL,UAAU;IACV,eAAe;IACf,KAAK;IACL,QAAQ;IACR,YAAY;IACZ,KAAK;IACL,KAAK;IACL,UAAU;IACV,MAAM;IACN,QAAQ;IACR,OAAO;IACP,SAAS;IACT,OAAO;IACP,eAAe;IACf,OAAO;IACP,KAAK;IACL,KAAK;IACL,SAAS;IACT,MAAM;IACN,QAAQ;IACR,KAAK;IACL,KAAK;IACL,QAAQ;IACR,MAAM;IACN,YAAY;IACZ,YAAY;IACZ,cAAc;IACd,SAAS;IACT,KAAK;IACL,GAAG;IACH,MAAM;IACN,OAAO;IACP,UAAU;IACV,SAAS;IACT,MAAM;IACN,KAAK;IACL,cAAc;IACd,YAAY;IACZ,MAAM;IACN,SAAS;IACT,MAAM;IACN,SAAS;IACT,MAAM;IACN,OAAO;IACP,SAAS;IACT,MAAM;IACN,QAAQ;IACR,MAAM;IACN,MAAM;IACN,KAAK;CACG,CAAC"}
|
|
@@ -72,7 +72,7 @@ const customStyles = ({ errorText, size, }) => {
|
|
|
72
72
|
? `1px solid ${focusedBorderColor}`
|
|
73
73
|
: `1px solid ${defaultBorder}`,
|
|
74
74
|
} })),
|
|
75
|
-
multiValue: (provided) => (Object.assign(Object.assign({}, provided), { borderRadius: '4px', height: '28px' })),
|
|
75
|
+
multiValue: (provided) => (Object.assign(Object.assign({}, provided), { borderRadius: '4px', height: '28px', maxWidth: '95%' })),
|
|
76
76
|
indicatorsContainer: (provided) => (Object.assign(Object.assign({}, provided), {
|
|
77
77
|
/**
|
|
78
78
|
* The right icon has padding of 8px so:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.js","sourceRoot":"","sources":["../../../src/dropdown/Dropdown.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAc,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC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AAW,uBAAX,WAAW,CAAE,MAAM,KACnD,CACH,CAAC;YACF,MAAM;SACP;QACD,KAAK,WAAW;YACd,aAAa,GAAG,CACd,KAAC,SAAS,kBACR,IAAI,EAAE,UAAU,EAChB,OAAO,EAAE,UAAU,EACnB,UAAU,EAAE,kBAAkB,IAC1B,iBAAiB,IACrB,MAAM,kCAAO,cAAc,GAAK,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,MAAM,KACnD,CACH,CAAC;YACF,MAAM;QACR;YACE,aAAa,GAAG,CACd,KAAC,MAAM,kBACL,IAAI,EAAE,UAAU,EAChB,OAAO,EAAE,UAAU,EACnB,UAAU,EAAE,kBAAkB,IAC1B,iBAAiB,IACrB,MAAM,kCAAO,cAAc,GAAK,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,MAAM,KACnD,CACH,CAAC;KACL;IAED,OAAO,CACL,MAAC,SAAS,kBACR,GAAG,EAAE,GAAG,IACJ,SAAS,IACb,SAAS,EAAE,UAAU,CAAC,cAAc,EAAE,IAAI,EAAE;YAC1C,KAAK;SACN,CAAC,iBAED,KAAK,IAAI,8BAAO,OAAO,EAAE,UAAU,gBAAG,KAAK,IAAS,EACpD,aAAa,EACb,QAAQ,IAAI,CAAC,SAAS,IAAI,6BAAM,SAAS,EAAC,UAAU,gBAAE,QAAQ,IAAQ,EACtE,SAAS,IAAI,6BAAM,SAAS,EAAC,qBAAqB,gBAAE,SAAS,IAAQ,KAC5D,CACb,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -30,8 +30,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
30
30
|
* You should have received a copy of the GNU General Public License
|
|
31
31
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
32
32
|
*/
|
|
33
|
-
import React from 'react';
|
|
33
|
+
import React, { useMemo, useState } from 'react';
|
|
34
34
|
import classnames from 'classnames';
|
|
35
|
+
import tokens from '@neo4j-ndl/base/lib/tokens/js/tokens';
|
|
36
|
+
import { getDisabledColor, getDisabledTextColor, getHoverColor, getTextColorFromBackground, } from './color';
|
|
35
37
|
/**
|
|
36
38
|
*
|
|
37
39
|
*
|
|
@@ -39,7 +41,9 @@ import classnames from 'classnames';
|
|
|
39
41
|
*
|
|
40
42
|
*
|
|
41
43
|
*/
|
|
42
|
-
const HexagonEnd = ({ direction = 'left'
|
|
44
|
+
const HexagonEnd = ({ direction = 'left', color }) => {
|
|
45
|
+
return (_jsxs("div", Object.assign({ className: `ndl-hexagon-end ${direction}` }, { children: [_jsx("svg", Object.assign({ width: "8", height: "24", viewBox: "0 0 7 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: _jsx("path", { className: "ndl-hexagon-end-inner", style: { fill: color }, fillRule: "evenodd", clipRule: "evenodd", d: "M5.73024 1.03676C6.08165 0.397331 6.75338 0 7.48301 0H9V24H7.483C6.75338 24 6.08165 23.6027 5.73024 22.9632L0.315027 13.1094C-0.105009 12.4376 -0.105009 11.5624 0.315026 10.8906L5.73024 1.03676Z" }) })), _jsx("svg", Object.assign({ className: "ndl-hexagon-end-active", width: "13", height: "30", viewBox: "0 0 13 30", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M10.075 2C9.12474 2 8.24318 2.54521 7.74867 3.43873L2.21419 13.4387C1.68353 14.3976 1.68353 15.6024 2.21419 16.5613L7.74867 26.5613C8.24318 27.4548 9.12474 28 10.075 28H13V30H10.075C8.49126 30 7.022 29.0913 6.1978 27.6021L0.663324 17.6021C-0.221109 16.0041 -0.221108 13.9959 0.663325 12.3979L6.1978 2.39789C7.022 0.90869 8.49126 0 10.075 0H13V2H10.075Z" }) }))] })));
|
|
46
|
+
};
|
|
43
47
|
/**
|
|
44
48
|
*
|
|
45
49
|
*
|
|
@@ -48,7 +52,16 @@ const HexagonEnd = ({ direction = 'left' }) => (_jsxs("div", Object.assign({ cla
|
|
|
48
52
|
*
|
|
49
53
|
*/
|
|
50
54
|
const GraphLabel = React.forwardRef(function GraphLabel(_a, ref) {
|
|
51
|
-
var { type = 'node', disabled = false, selected = false, as, onClick } = _a, props = __rest(_a, ["type", "disabled", "selected", "as", "onClick"]);
|
|
55
|
+
var { type = 'node', color, disabled = false, selected = false, as, onClick } = _a, props = __rest(_a, ["type", "color", "disabled", "selected", "as", "onClick"]);
|
|
56
|
+
const [isHover, setIsHover] = useState(false);
|
|
57
|
+
const handleMouseEnter = (event) => {
|
|
58
|
+
setIsHover(true);
|
|
59
|
+
props.onMouseEnter && props.onMouseEnter(event);
|
|
60
|
+
};
|
|
61
|
+
const handleMouseLeave = (event) => {
|
|
62
|
+
setIsHover(false);
|
|
63
|
+
props.onMouseLeave && props.onMouseLeave(event);
|
|
64
|
+
};
|
|
52
65
|
const handleClick = (e) => {
|
|
53
66
|
// By default, a <button /> element with disabled set to true will not get its
|
|
54
67
|
// on click handler called. To support the same behavior on <a /> tags we
|
|
@@ -63,51 +76,53 @@ const GraphLabel = React.forwardRef(function GraphLabel(_a, ref) {
|
|
|
63
76
|
onClick(e);
|
|
64
77
|
}
|
|
65
78
|
};
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
79
|
+
let backgroundColor = useMemo(() => {
|
|
80
|
+
if (!color) {
|
|
81
|
+
switch (type) {
|
|
82
|
+
case 'node':
|
|
83
|
+
return tokens.colors.warning[40];
|
|
84
|
+
case 'relationship':
|
|
85
|
+
return tokens.palette.light.neutral.bg.strong;
|
|
86
|
+
default:
|
|
87
|
+
return tokens.palette.light.neutral.bg.strongest;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return color;
|
|
91
|
+
}, [color, type]);
|
|
92
|
+
const hoverColor = useMemo(() => getHoverColor(backgroundColor ? backgroundColor : tokens.colors.warning[40]), [backgroundColor]);
|
|
93
|
+
const textColor = useMemo(() => getTextColorFromBackground(backgroundColor ? backgroundColor : tokens.colors.warning[40]), [backgroundColor]);
|
|
94
|
+
const disabledTextColor = useMemo(() => getDisabledTextColor(backgroundColor ? backgroundColor : tokens.colors.warning[40]), [backgroundColor]);
|
|
95
|
+
if (isHover && !disabled)
|
|
96
|
+
backgroundColor = hoverColor;
|
|
97
|
+
if (disabled)
|
|
98
|
+
backgroundColor = getDisabledColor(backgroundColor);
|
|
77
99
|
let Component = 'button';
|
|
78
100
|
if (as) {
|
|
79
101
|
Component = as;
|
|
80
102
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
});
|
|
88
|
-
const RelationshipLabel = React.forwardRef(function RelationshipLabel(_a, ref) {
|
|
89
|
-
var { children, disabled, selected, as } = _a, props = __rest(_a, ["children", "disabled", "selected", "as"]);
|
|
90
|
-
let Component = 'button';
|
|
91
|
-
if (as) {
|
|
92
|
-
Component = as;
|
|
103
|
+
if (type === 'node') {
|
|
104
|
+
const classes = classnames('ndl-node-label', props.className, {
|
|
105
|
+
disabled: disabled,
|
|
106
|
+
selected: selected,
|
|
107
|
+
});
|
|
108
|
+
return (_jsx(Component, Object.assign({}, props, { className: classes, ref: ref, style: Object.assign({ backgroundColor: backgroundColor, color: disabled ? disabledTextColor : textColor }, props.style), onClick: handleClick, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave }, { children: props.children })));
|
|
93
109
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
})
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
110
|
+
else if (type === 'relationship') {
|
|
111
|
+
const classes = classnames('ndl-relationship-label', {
|
|
112
|
+
disabled: disabled,
|
|
113
|
+
selected: selected,
|
|
114
|
+
});
|
|
115
|
+
return (_jsxs(Component, Object.assign({}, props, { style: Object.assign(Object.assign({}, props.style), { color: disabled ? disabledTextColor : textColor }), className: classes, onClick: handleClick, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, ref: ref }, { children: [_jsx("svg", Object.assign({ style: { display: 'none' } }, { children: _jsx("mask", Object.assign({ id: "ndl-relationship-label-mask-outer-border", fill: "white" }, { children: _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M5.73024 1.03676C6.08165 0.397331 6.75338 0 7.48301 0H9V24H7.483C6.75338 24 6.08165 23.6027 5.73024 22.9632L0.315027 13.1094C-0.105009 12.4376 -0.105009 11.5624 0.315026 10.8906L5.73024 1.03676Z" }) })) })), _jsx(HexagonEnd, { direction: "left", color: backgroundColor }), _jsx("div", Object.assign({ className: "ndl-relationship-label-content", style: {
|
|
116
|
+
backgroundColor: backgroundColor,
|
|
117
|
+
} }, { children: props.children })), _jsx(HexagonEnd, { direction: "right", color: backgroundColor })] })));
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
const classes = classnames('ndl-property-key-label', {
|
|
121
|
+
disabled: disabled,
|
|
122
|
+
selected: selected,
|
|
123
|
+
});
|
|
124
|
+
return (_jsx(Component, Object.assign({}, props, { style: Object.assign({ backgroundColor: backgroundColor, color: disabled ? disabledTextColor : textColor }, props.style), className: classes, onClick: handleClick, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, ref: ref }, { children: props.children })));
|
|
105
125
|
}
|
|
106
|
-
const classes = classnames('ndl-property-key-label', {
|
|
107
|
-
disabled: disabled,
|
|
108
|
-
selected: selected,
|
|
109
|
-
});
|
|
110
|
-
return (_jsx(Component, Object.assign({}, props, { className: classes, ref: ref }, { children: children })));
|
|
111
126
|
});
|
|
112
127
|
export default GraphLabel;
|
|
113
128
|
//# sourceMappingURL=GraphLabel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphLabel.js","sourceRoot":"","sources":["../../../src/graph-label/GraphLabel.tsx"],"names":[],"mappings":";;;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AAC,KAAK,EAAE,eAAe,GAAI,KAC9C,CACb,CAAC;KACH;SAAM;QACL,MAAM,OAAO,GAAG,UAAU,CAAC,wBAAwB,EAAE;YACnD,QAAQ,EAAE,QAAQ;YAClB,QAAQ,EAAE,QAAQ;SACnB,CAAC,CAAC;QAEH,OAAO,CACL,KAAC,SAAS,oBACJ,KAAK,IACT,KAAK,kBACH,eAAe,EAAE,eAAe,EAChC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS,IAC5C,KAAK,CAAC,KAAK,GAEhB,SAAS,EAAE,OAAO,EAClB,OAAO,EAAE,WAAW,EACpB,YAAY,EAAE,gBAAgB,EAC9B,YAAY,EAAE,gBAAgB,EAC9B,GAAG,EAAE,GAAG,gBAEP,KAAK,CAAC,QAAQ,IACL,CACb,CAAC;KACH;AACH,CAAC,CAAC,CAAC;AAEH,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
import tinycolor from 'tinycolor2';
|
|
22
|
+
import tokens from '@neo4j-ndl/base/lib/tokens/js/tokens';
|
|
23
|
+
/**
|
|
24
|
+
* Takes a color string and returns color string
|
|
25
|
+
* that is readable on top of that background. Prioritizes pallete
|
|
26
|
+
* text colors and uses black or white as fallback.
|
|
27
|
+
*/
|
|
28
|
+
export const getTextColorFromBackground = (color) => {
|
|
29
|
+
return tinycolor
|
|
30
|
+
.mostReadable(color, [
|
|
31
|
+
tokens.palette.light.neutral.text.default,
|
|
32
|
+
tokens.palette.light.neutral.text.inverse,
|
|
33
|
+
], {
|
|
34
|
+
includeFallbackColors: true,
|
|
35
|
+
})
|
|
36
|
+
.toString();
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Takes a color string and returns a color string
|
|
40
|
+
* that is darker or ligher depending on the given color.
|
|
41
|
+
*/
|
|
42
|
+
export const getHoverColor = (color) => {
|
|
43
|
+
const hslColor = tinycolor(color).toHsl();
|
|
44
|
+
if (hslColor.l < 0.5) {
|
|
45
|
+
return tinycolor(color).lighten(10).toString();
|
|
46
|
+
}
|
|
47
|
+
return tinycolor(color).darken(10).toString();
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Returns the most readlabale color on the given background color
|
|
51
|
+
* as a string from a list of palette text colors
|
|
52
|
+
*/
|
|
53
|
+
export const getDisabledTextColor = (backgroundColor) => {
|
|
54
|
+
//TODO: update to token when dark theme is available
|
|
55
|
+
//inverse of text.weaker color should probably be replaced by token
|
|
56
|
+
const inverseTextColor = '#8e887f';
|
|
57
|
+
return tinycolor
|
|
58
|
+
.mostReadable(backgroundColor, [
|
|
59
|
+
inverseTextColor,
|
|
60
|
+
tokens.palette.light.neutral.text.weakest,
|
|
61
|
+
tokens.palette.light.neutral.text.weak,
|
|
62
|
+
tokens.palette.light.neutral.text.weaker,
|
|
63
|
+
])
|
|
64
|
+
.toString();
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Takes a color string and returns a color string
|
|
68
|
+
* that is darker or ligher depending on the given color.
|
|
69
|
+
*/
|
|
70
|
+
export const getDisabledColor = (color) => {
|
|
71
|
+
const hslColor = tinycolor(color).toHsl();
|
|
72
|
+
if (hslColor.l < 0.5) {
|
|
73
|
+
return tinycolor(color).lighten(15).toString();
|
|
74
|
+
}
|
|
75
|
+
return tinycolor(color).darken(15).toString();
|
|
76
|
+
};
|
|
77
|
+
//# sourceMappingURL=color.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color.js","sourceRoot":"","sources":["../../../src/graph-label/color.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,MAAM,MAAM,sCAAsC,CAAC;AAE1D;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,KAAa,EAAU,EAAE;IAClE,OAAO,SAAS;SACb,YAAY,CACX,KAAK,EACL;QACE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO;QACzC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO;KAC1C,EACD;QACE,qBAAqB,EAAE,IAAI;KAC5B,CACF;SACA,QAAQ,EAAE,CAAC;AAChB,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAa,EAAU,EAAE;IACrD,MAAM,QAAQ,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC;IAC1C,IAAI,QAAQ,CAAC,CAAC,GAAG,GAAG,EAAE;QACpB,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;KAChD;IACD,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;AAChD,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,eAAuB,EAAU,EAAE;IACtE,oDAAoD;IACpD,mEAAmE;IACnE,MAAM,gBAAgB,GAAG,SAAS,CAAC;IACnC,OAAO,SAAS;SACb,YAAY,CAAC,eAAe,EAAE;QAC7B,gBAAgB;QAChB,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO;QACzC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI;QACtC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM;KACzC,CAAC;SACD,QAAQ,EAAE,CAAC;AAChB,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAa,EAAU,EAAE;IACxD,MAAM,QAAQ,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC;IAC1C,IAAI,QAAQ,CAAC,CAAC,GAAG,GAAG,EAAE;QACpB,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;KAChD;IACD,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;AAChD,CAAC,CAAC"}
|
package/lib/esm/index.js
CHANGED
package/lib/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,gB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5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
import React from 'react';
|
|
22
|
+
import { IconButtonProps } from '../button';
|
|
23
|
+
import { ElementBase } from '../helpers';
|
|
24
|
+
import { LanguageProp } from './languages';
|
|
25
|
+
export interface RunnableCodeBlockProps extends ElementBase<HTMLDivElement> {
|
|
26
|
+
code: string;
|
|
27
|
+
language: LanguageProp | 'text';
|
|
28
|
+
showLineNumbers?: boolean;
|
|
29
|
+
theme?: 'vs' | 'base16-ateliersulphurpool.light' | 'coy' | 'duotone-light' | 'ghcolors' | 'prism' | 'solarizedlight';
|
|
30
|
+
title?: string;
|
|
31
|
+
actions?: IconButtonProps[];
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export declare const CodeBlock: React.ForwardRefExoticComponent<RunnableCodeBlockProps & React.RefAttributes<unknown>>;
|