@neo4j-ndl/react 0.7.2 → 0.8.0

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.
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.CodeBlock = void 0;
30
+ const jsx_runtime_1 = require("react/jsx-runtime");
31
+ /**
32
+ *
33
+ * Copyright (c) "Neo4j"
34
+ * Neo4j Sweden AB [http://neo4j.com]
35
+ *
36
+ * This file is part of Neo4j.
37
+ *
38
+ * Neo4j is free software: you can redistribute it and/or modify
39
+ * it under the terms of the GNU General Public License as published by
40
+ * the Free Software Foundation, either version 3 of the License, or
41
+ * (at your option) any later version.
42
+ *
43
+ * This program is distributed in the hope that it will be useful,
44
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
45
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
46
+ * GNU General Public License for more details.
47
+ *
48
+ * You should have received a copy of the GNU General Public License
49
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
50
+ */
51
+ const tokens_1 = __importDefault(require("@neo4j-ndl/base/lib/tokens/js/tokens"));
52
+ const react_1 = __importStar(require("react"));
53
+ const classnames_1 = __importDefault(require("classnames"));
54
+ const button_1 = require("../button");
55
+ const react_syntax_highlighter_1 = require("react-syntax-highlighter");
56
+ const prism_1 = require("react-syntax-highlighter/dist/cjs/styles/prism");
57
+ exports.CodeBlock = react_1.default.forwardRef(function CodeBlock({ as, code, language, showLineNumbers, theme, title, actions, disabled, }, ref) {
58
+ const Component = as || 'div';
59
+ const [isFocused, setIsFocused] = (0, react_1.useState)(false);
60
+ const getTheme = () => {
61
+ switch (theme) {
62
+ case 'vs':
63
+ return prism_1.vs;
64
+ case 'base16-ateliersulphurpool.light':
65
+ return prism_1.base16AteliersulphurpoolLight;
66
+ case 'coy':
67
+ return prism_1.coy;
68
+ case 'duotone-light':
69
+ return prism_1.duotoneLight;
70
+ case 'ghcolors':
71
+ return prism_1.ghcolors;
72
+ case 'prism':
73
+ return prism_1.prism;
74
+ case 'solarizedlight':
75
+ return prism_1.solarizedlight;
76
+ default:
77
+ return prism_1.vs;
78
+ }
79
+ };
80
+ const hasHeader = title || actions;
81
+ return ((0, jsx_runtime_1.jsxs)(Component, Object.assign({ ref: ref, className: "ndl-code-block-container" }, { children: [hasHeader && ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: (0, classnames_1.default)('ndl-code-block-title', {
82
+ disabled,
83
+ }) }, { children: [title && (0, jsx_runtime_1.jsx)("h6", { children: title }), (0, jsx_runtime_1.jsx)("div", { children: actions === null || actions === void 0 ? void 0 : actions.map((iconButtonProps, i) => ((0, jsx_runtime_1.jsx)(button_1.IconButton, Object.assign({ clean: true, disabled: disabled }, iconButtonProps), i))) })] }))), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: (0, classnames_1.default)('highlight-wrapper', {
84
+ 'has-header': hasHeader,
85
+ focused: isFocused,
86
+ }), role: "textbox", "aria-label": `${title} code-snippet`, tabIndex: 0, onFocus: () => {
87
+ setIsFocused(true);
88
+ }, onBlur: () => setIsFocused(false) }, { children: (0, jsx_runtime_1.jsx)(react_syntax_highlighter_1.Prism, Object.assign({ language: language, style: Object.assign(Object.assign({}, getTheme()), { 'pre[class*="language-"]': {
89
+ color: tokens_1.default.palette.light.neutral.text.weak,
90
+ backgroundColor: tokens_1.default.colors.neutral[20],
91
+ background: tokens_1.default.colors.neutral[20],
92
+ lineHeight: '1',
93
+ border: 0,
94
+ padding: '0 1em 1em 1em',
95
+ overflowX: 'auto',
96
+ overflowY: 'auto',
97
+ opacity: disabled ? 0.5 : 1,
98
+ } }),
99
+ // Turn on 'showLineNumbers' & 'wrapLongLines' at the same time, the display is wrong
100
+ // https://github.com/react-syntax-highlighter/react-syntax-highlighter/issues/402
101
+ // wrapLongLines
102
+ codeTagProps: { className: 'n-code' }, showLineNumbers: showLineNumbers }, { children: code })) }))] })));
103
+ });
104
+ //# sourceMappingURL=CodeBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CodeBlock.js","sourceRoot":"","sources":["../../../src/code-block/CodeBlock.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,kFAA6D;AAC7D,+CAAwC;AACxC,4DAAoC;AACpC,sCAAwD;AACxD,uEAAsE;AACtE,0EAQwD;AAsB3C,QAAA,SAAS,GAAG,eAAK,CAAC,UAAU,CAAC,SAAS,SAAS,CAC1D,EACE,EAAE,EACF,IAAI,EACJ,QAAQ,EACR,eAAe,EACf,KAAK,EACL,KAAK,EACL,OAAO,EACP,QAAQ,GACe,EACzB,GAAG;IAEH,MAAM,SAAS,GAAG,EAAE,IAAI,KAAK,CAAC;IAE9B,MAAM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,CAAC,CAAC;gBACrB,CAAC,EACD,MAAM,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,gBAEjC,uBAAC,gCAAiB,kBAChB,QAAQ,EAAE,QAAQ,EAClB,KAAK,kCACA,QAAQ,EAAE,KACb,yBAAyB,EAAE;4BACzB,KAAK,EAAE,gBAAS,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI;4BAChD,eAAe,EAAE,gBAAS,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;4BAC7C,UAAU,EAAE,gBAAS,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;4BACxC,UAAU,EAAE,GAAG;4BACf,MAAM,EAAE,CAAC;4BACT,OAAO,EAAE,eAAe;4BACxB,SAAS,EAAE,MAAM;4BACjB,SAAS,EAAE,MAAM;4BACjB,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;yBAC5B;oBAEH,qFAAqF;oBACrF,kFAAkF;oBAClF,gBAAgB;oBAChB,YAAY,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,EACrC,eAAe,EAAE,eAAe,gBAE/B,IAAI,IACa,IAChB,KACI,CACb,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ /**
3
+ *
4
+ * Copyright (c) "Neo4j"
5
+ * Neo4j Sweden AB [http://neo4j.com]
6
+ *
7
+ * This file is part of Neo4j.
8
+ *
9
+ * Neo4j is free software: you can redistribute it and/or modify
10
+ * it under the terms of the GNU General Public License as published by
11
+ * the Free Software Foundation, either version 3 of the License, or
12
+ * (at your option) any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ * GNU General Public License for more details.
18
+ *
19
+ * You should have received a copy of the GNU General Public License
20
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
21
+ */
22
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
23
+ if (k2 === undefined) k2 = k;
24
+ var desc = Object.getOwnPropertyDescriptor(m, k);
25
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
26
+ desc = { enumerable: true, get: function() { return m[k]; } };
27
+ }
28
+ Object.defineProperty(o, k2, desc);
29
+ }) : (function(o, m, k, k2) {
30
+ if (k2 === undefined) k2 = k;
31
+ o[k2] = m[k];
32
+ }));
33
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
34
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
35
+ };
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ __exportStar(require("./CodeBlock"), exports);
38
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/code-block/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;;;;;;;;;;;AAEH,8CAA4B"}
@@ -0,0 +1,302 @@
1
+ "use strict";
2
+ /**
3
+ *
4
+ * Copyright (c) "Neo4j"
5
+ * Neo4j Sweden AB [http://neo4j.com]
6
+ *
7
+ * This file is part of Neo4j.
8
+ *
9
+ * Neo4j is free software: you can redistribute it and/or modify
10
+ * it under the terms of the GNU General Public License as published by
11
+ * the Free Software Foundation, either version 3 of the License, or
12
+ * (at your option) any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ * GNU General Public License for more details.
18
+ *
19
+ * You should have received a copy of the GNU General Public License
20
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
21
+ */
22
+ Object.defineProperty(exports, "__esModule", { value: true });
23
+ const Languages = [
24
+ 'abap',
25
+ 'abnf',
26
+ 'actionscript',
27
+ 'ada',
28
+ 'agda',
29
+ 'al',
30
+ 'antlr4',
31
+ 'apacheconf',
32
+ 'apex',
33
+ 'apl',
34
+ 'applescript',
35
+ 'aql',
36
+ 'arduino',
37
+ 'arff',
38
+ 'asciidoc',
39
+ 'asm6502',
40
+ 'asmatmel',
41
+ 'aspnet',
42
+ 'autohotkey',
43
+ 'autoit',
44
+ 'avisynth',
45
+ 'avro-idl',
46
+ 'bash',
47
+ 'basic',
48
+ 'batch',
49
+ 'bbcode',
50
+ 'bicep',
51
+ 'birb',
52
+ 'bison',
53
+ 'bnf',
54
+ 'brainfuck',
55
+ 'brightscript',
56
+ 'bro',
57
+ 'bsl',
58
+ 'c',
59
+ 'cfscript',
60
+ 'chaiscript',
61
+ 'cil',
62
+ 'clike',
63
+ 'clojure',
64
+ 'cmake',
65
+ 'cobol',
66
+ 'coffeescript',
67
+ 'concurnas',
68
+ 'coq',
69
+ 'cpp',
70
+ 'crystal',
71
+ 'csharp',
72
+ 'cshtml',
73
+ 'csp',
74
+ 'css-extras',
75
+ 'css',
76
+ 'csv',
77
+ 'cypher',
78
+ 'd',
79
+ 'dart',
80
+ 'dataweave',
81
+ 'dax',
82
+ 'dhall',
83
+ 'diff',
84
+ 'django',
85
+ 'dns-zone-file',
86
+ 'docker',
87
+ 'dot',
88
+ 'ebnf',
89
+ 'editorconfig',
90
+ 'eiffel',
91
+ 'ejs',
92
+ 'elixir',
93
+ 'elm',
94
+ 'erb',
95
+ 'erlang',
96
+ 'etlua',
97
+ 'excel-formula',
98
+ 'factor',
99
+ 'false',
100
+ 'firestore-security-rules',
101
+ 'flow',
102
+ 'fortran',
103
+ 'fsharp',
104
+ 'ftl',
105
+ 'gap',
106
+ 'gcode',
107
+ 'gdscript',
108
+ 'gedcom',
109
+ 'gherkin',
110
+ 'git',
111
+ 'glsl',
112
+ 'gml',
113
+ 'gn',
114
+ 'go-module',
115
+ 'go',
116
+ 'graphql',
117
+ 'groovy',
118
+ 'haml',
119
+ 'handlebars',
120
+ 'haskell',
121
+ 'haxe',
122
+ 'hcl',
123
+ 'hlsl',
124
+ 'hoon',
125
+ 'hpkp',
126
+ 'hsts',
127
+ 'http',
128
+ 'ichigojam',
129
+ 'icon',
130
+ 'icu-message-format',
131
+ 'idris',
132
+ 'iecst',
133
+ 'ignore',
134
+ 'inform7',
135
+ 'ini',
136
+ 'io',
137
+ 'j',
138
+ 'java',
139
+ 'javadoc',
140
+ 'javadoclike',
141
+ 'javascript',
142
+ 'javastacktrace',
143
+ 'jexl',
144
+ 'jolie',
145
+ 'jq',
146
+ 'js-extras',
147
+ 'js-templates',
148
+ 'jsdoc',
149
+ 'json',
150
+ 'json5',
151
+ 'jsonp',
152
+ 'jsstacktrace',
153
+ 'jsx',
154
+ 'julia',
155
+ 'keepalived',
156
+ 'keyman',
157
+ 'kotlin',
158
+ 'kumir',
159
+ 'kusto',
160
+ 'latex',
161
+ 'latte',
162
+ 'less',
163
+ 'lilypond',
164
+ 'liquid',
165
+ 'lisp',
166
+ 'livescript',
167
+ 'llvm',
168
+ 'log',
169
+ 'lolcode',
170
+ 'lua',
171
+ 'magma',
172
+ 'makefile',
173
+ 'markdown',
174
+ 'markup-templating',
175
+ 'markup',
176
+ 'matlab',
177
+ 'maxscript',
178
+ 'mel',
179
+ 'mermaid',
180
+ 'mizar',
181
+ 'mongodb',
182
+ 'monkey',
183
+ 'moonscript',
184
+ 'n1ql',
185
+ 'n4js',
186
+ 'nand2tetris-hdl',
187
+ 'naniscript',
188
+ 'nasm',
189
+ 'neon',
190
+ 'nevod',
191
+ 'nginx',
192
+ 'nim',
193
+ 'nix',
194
+ 'nsis',
195
+ 'objectivec',
196
+ 'ocaml',
197
+ 'opencl',
198
+ 'openqasm',
199
+ 'oz',
200
+ 'parigp',
201
+ 'parser',
202
+ 'pascal',
203
+ 'pascaligo',
204
+ 'pcaxis',
205
+ 'peoplecode',
206
+ 'perl',
207
+ 'php-extras',
208
+ 'php',
209
+ 'phpdoc',
210
+ 'plsql',
211
+ 'powerquery',
212
+ 'powershell',
213
+ 'processing',
214
+ 'prolog',
215
+ 'promql',
216
+ 'properties',
217
+ 'protobuf',
218
+ 'psl',
219
+ 'pug',
220
+ 'puppet',
221
+ 'pure',
222
+ 'purebasic',
223
+ 'purescript',
224
+ 'python',
225
+ 'q',
226
+ 'qml',
227
+ 'qore',
228
+ 'qsharp',
229
+ 'r',
230
+ 'racket',
231
+ 'reason',
232
+ 'regex',
233
+ 'rego',
234
+ 'renpy',
235
+ 'rest',
236
+ 'rip',
237
+ 'roboconf',
238
+ 'robotframework',
239
+ 'ruby',
240
+ 'rust',
241
+ 'sas',
242
+ 'sass',
243
+ 'scala',
244
+ 'scheme',
245
+ 'scss',
246
+ 'shell-session',
247
+ 'smali',
248
+ 'smalltalk',
249
+ 'smarty',
250
+ 'sml',
251
+ 'solidity',
252
+ 'solution-file',
253
+ 'soy',
254
+ 'sparql',
255
+ 'splunk-spl',
256
+ 'sqf',
257
+ 'sql',
258
+ 'squirrel',
259
+ 'stan',
260
+ 'stylus',
261
+ 'swift',
262
+ 'systemd',
263
+ 't4-cs',
264
+ 't4-templating',
265
+ 't4-vb',
266
+ 'tap',
267
+ 'tcl',
268
+ 'textile',
269
+ 'toml',
270
+ 'tremor',
271
+ 'tsx',
272
+ 'tt2',
273
+ 'turtle',
274
+ 'twig',
275
+ 'typescript',
276
+ 'typoscript',
277
+ 'unrealscript',
278
+ 'uorazor',
279
+ 'uri',
280
+ 'v',
281
+ 'vala',
282
+ 'vbnet',
283
+ 'velocity',
284
+ 'verilog',
285
+ 'vhdl',
286
+ 'vim',
287
+ 'visual-basic',
288
+ 'warpscript',
289
+ 'wasm',
290
+ 'web-idl',
291
+ 'wiki',
292
+ 'wolfram',
293
+ 'wren',
294
+ 'xeora',
295
+ 'xml-doc',
296
+ 'xojo',
297
+ 'xquery',
298
+ 'yaml',
299
+ 'yang',
300
+ 'zig',
301
+ ];
302
+ //# 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;IACN,cAAc;IACd,KAAK;IACL,MAAM;IACN,IAAI;IACJ,QAAQ;IACR,YAAY;IACZ,MAAM;IACN,KAAK;IACL,aAAa;IACb,KAAK;IACL,SAAS;IACT,MAAM;IACN,UAAU;IACV,SAAS;IACT,UAAU;IACV,QAAQ;IACR,YAAY;IACZ,QAAQ;IACR,UAAU;IACV,UAAU;IACV,MAAM;IACN,OAAO;IACP,OAAO;IACP,QAAQ;IACR,OAAO;IACP,MAAM;IACN,OAAO;IACP,KAAK;IACL,WAAW;IACX,cAAc;IACd,KAAK;IACL,KAAK;IACL,GAAG;IACH,UAAU;IACV,YAAY;IACZ,KAAK;IACL,OAAO;IACP,SAAS;IACT,OAAO;IACP,OAAO;IACP,cAAc;IACd,WAAW;IACX,KAAK;IACL,KAAK;IACL,SAAS;IACT,QAAQ;IACR,QAAQ;IACR,KAAK;IACL,YAAY;IACZ,KAAK;IACL,KAAK;IACL,QAAQ;IACR,GAAG;IACH,MAAM;IACN,WAAW;IACX,KAAK;IACL,OAAO;IACP,MAAM;IACN,QAAQ;IACR,eAAe;IACf,QAAQ;IACR,KAAK;IACL,MAAM;IACN,cAAc;IACd,QAAQ;IACR,KAAK;IACL,QAAQ;IACR,KAAK;IACL,KAAK;IACL,QAAQ;IACR,OAAO;IACP,eAAe;IACf,QAAQ;IACR,OAAO;IACP,0BAA0B;IAC1B,MAAM;IACN,SAAS;IACT,QAAQ;IACR,KAAK;IACL,KAAK;IACL,OAAO;IACP,UAAU;IACV,QAAQ;IACR,SAAS;IACT,KAAK;IACL,MAAM;IACN,KAAK;IACL,IAAI;IACJ,WAAW;IACX,IAAI;IACJ,SAAS;IACT,QAAQ;IACR,MAAM;I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M;IACN,QAAQ;IACR,GAAG;IACH,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,MAAM;IACN,OAAO;IACP,MAAM;IACN,KAAK;IACL,UAAU;IACV,gBAAgB;IAChB,MAAM;IACN,MAAM;IACN,KAAK;IACL,MAAM;IACN,OAAO;IACP,QAAQ;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"}
package/lib/cjs/index.js CHANGED
@@ -57,4 +57,5 @@ __exportStar(require("./dropdown"), exports);
57
57
  __exportStar(require("./tag"), exports);
58
58
  __exportStar(require("./wizard"), exports);
59
59
  __exportStar(require("./graph-label"), exports);
60
+ __exportStar(require("./code-block"), exports);
60
61
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;;;;;;;;;;;AAEH,2CAAyB;AACzB,0CAAwB;AACxB,0CAAwB;AACxB,4CAA0B;AAC1B,6CAA2B;AAC3B,2CAAyB;AACzB,0CAAwB;AACxB,iDAA+B;AAC/B,2CAAyB;AACzB,0CAAwB;AACxB,oDAAkC;AAClC,yCAAuB;AACvB,kDAAgC;AAChC,4CAA0B;AAC1B,0CAAwB;AACxB,iDAA+B;AAC/B,0CAAwB;AACxB,kDAAgC;AAChC,+CAA6B;AAC7B,6CAA2B;AAC3B,wCAAsB;AACtB,2CAAyB;AACzB,gDAA8B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;;;;;;;;;;;AAEH,2CAAyB;AACzB,0CAAwB;AACxB,0CAAwB;AACxB,4CAA0B;AAC1B,6CAA2B;AAC3B,2CAAyB;AACzB,0CAAwB;AACxB,iDAA+B;AAC/B,2CAAyB;AACzB,0CAAwB;AACxB,oDAAkC;AAClC,yCAAuB;AACvB,kDAAgC;AAChC,4CAA0B;AAC1B,0CAAwB;AACxB,iDAA+B;AAC/B,0CAAwB;AACxB,kDAAgC;AAChC,+CAA6B;AAC7B,6CAA2B;AAC3B,wCAAsB;AACtB,2CAAyB;AACzB,gDAA8B;AAC9B,+CAA6B"}
@@ -0,0 +1,75 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ *
4
+ * Copyright (c) "Neo4j"
5
+ * Neo4j Sweden AB [http://neo4j.com]
6
+ *
7
+ * This file is part of Neo4j.
8
+ *
9
+ * Neo4j is free software: you can redistribute it and/or modify
10
+ * it under the terms of the GNU General Public License as published by
11
+ * the Free Software Foundation, either version 3 of the License, or
12
+ * (at your option) any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ * GNU General Public License for more details.
18
+ *
19
+ * You should have received a copy of the GNU General Public License
20
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
21
+ */
22
+ import ndlTokens from '@neo4j-ndl/base/lib/tokens/js/tokens';
23
+ import React, { useState } from 'react';
24
+ import classNames from 'classnames';
25
+ import { IconButton } from '../button';
26
+ import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
27
+ import { base16AteliersulphurpoolLight, coy, duotoneLight, ghcolors, prism, solarizedlight, vs, } from 'react-syntax-highlighter/dist/cjs/styles/prism';
28
+ export const CodeBlock = React.forwardRef(function CodeBlock({ as, code, language, showLineNumbers, theme, title, actions, disabled, }, ref) {
29
+ const Component = as || 'div';
30
+ const [isFocused, setIsFocused] = useState(false);
31
+ const getTheme = () => {
32
+ switch (theme) {
33
+ case 'vs':
34
+ return vs;
35
+ case 'base16-ateliersulphurpool.light':
36
+ return base16AteliersulphurpoolLight;
37
+ case 'coy':
38
+ return coy;
39
+ case 'duotone-light':
40
+ return duotoneLight;
41
+ case 'ghcolors':
42
+ return ghcolors;
43
+ case 'prism':
44
+ return prism;
45
+ case 'solarizedlight':
46
+ return solarizedlight;
47
+ default:
48
+ return vs;
49
+ }
50
+ };
51
+ const hasHeader = title || actions;
52
+ return (_jsxs(Component, Object.assign({ ref: ref, className: "ndl-code-block-container" }, { children: [hasHeader && (_jsxs("div", Object.assign({ className: classNames('ndl-code-block-title', {
53
+ disabled,
54
+ }) }, { children: [title && _jsx("h6", { children: title }), _jsx("div", { children: actions === null || actions === void 0 ? void 0 : actions.map((iconButtonProps, i) => (_jsx(IconButton, Object.assign({ clean: true, disabled: disabled }, iconButtonProps), i))) })] }))), _jsx("div", Object.assign({ className: classNames('highlight-wrapper', {
55
+ 'has-header': hasHeader,
56
+ focused: isFocused,
57
+ }), role: "textbox", "aria-label": `${title} code-snippet`, tabIndex: 0, onFocus: () => {
58
+ setIsFocused(true);
59
+ }, onBlur: () => setIsFocused(false) }, { children: _jsx(SyntaxHighlighter, Object.assign({ language: language, style: Object.assign(Object.assign({}, getTheme()), { 'pre[class*="language-"]': {
60
+ color: ndlTokens.palette.light.neutral.text.weak,
61
+ backgroundColor: ndlTokens.colors.neutral[20],
62
+ background: ndlTokens.colors.neutral[20],
63
+ lineHeight: '1',
64
+ border: 0,
65
+ padding: '0 1em 1em 1em',
66
+ overflowX: 'auto',
67
+ overflowY: 'auto',
68
+ opacity: disabled ? 0.5 : 1,
69
+ } }),
70
+ // Turn on 'showLineNumbers' & 'wrapLongLines' at the same time, the display is wrong
71
+ // https://github.com/react-syntax-highlighter/react-syntax-highlighter/issues/402
72
+ // wrapLongLines
73
+ codeTagProps: { className: 'n-code' }, showLineNumbers: showLineNumbers }, { children: code })) }))] })));
74
+ });
75
+ //# sourceMappingURL=CodeBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CodeBlock.js","sourceRoot":"","sources":["../../../src/code-block/CodeBlock.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,SAAS,MAAM,sCAAsC,CAAC;AAC7D,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,UAAU,EAAmB,MAAM,WAAW,CAAC;AACxD,OAAO,EAAE,KAAK,IAAI,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EACL,6BAA6B,EAC7B,GAAG,EACH,YAAY,EACZ,QAAQ,EACR,KAAK,EACL,cAAc,EACd,EAAE,GACH,MAAM,gDAAgD,CAAC;AAsBxD,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CAAC,SAAS,SAAS,CAC1D,EACE,EAAE,EACF,IAAI,EACJ,QAAQ,EACR,eAAe,EACf,KAAK,EACL,KAAK,EACL,OAAO,EACP,QAAQ,GACe,EACzB,GAAG;IAEH,MAAM,SAAS,GAAG,EAAE,IAAI,KAAK,CAAC;IAE9B,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CA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KAAC,iBAAiB,kBAChB,QAAQ,EAAE,QAAQ,EAClB,KAAK,kCACA,QAAQ,EAAE,KACb,yBAAyB,EAAE;4BACzB,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI;4BAChD,eAAe,EAAE,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;4BAC7C,UAAU,EAAE,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;4BACxC,UAAU,EAAE,GAAG;4BACf,MAAM,EAAE,CAAC;4BACT,OAAO,EAAE,eAAe;4BACxB,SAAS,EAAE,MAAM;4BACjB,SAAS,EAAE,MAAM;4BACjB,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;yBAC5B;oBAEH,qFAAqF;oBACrF,kFAAkF;oBAClF,gBAAgB;oBAChB,YAAY,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,EACrC,eAAe,EAAE,eAAe,gBAE/B,IAAI,IACa,IAChB,KACI,CACb,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,22 @@
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
+ export * from './CodeBlock';
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/code-block/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,aAAa,CAAC"}
@@ -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;IACN,cAAc;IACd,KAAK;IACL,MAAM;IACN,IAAI;IACJ,QAAQ;IACR,YAAY;IACZ,MAAM;IACN,KAAK;IACL,aAAa;IACb,KAAK;IACL,SAAS;IACT,MAAM;IACN,UAAU;IACV,SAAS;IACT,UAAU;IACV,QAAQ;IACR,YAAY;IACZ,QAAQ;IACR,UAAU;IACV,UAAU;IACV,MAAM;IACN,OAAO;IACP,OAAO;IACP,QAAQ;IACR,OAAO;IACP,MAAM;IACN,OAAO;IACP,KAAK;IACL,WAAW;IACX,cAAc;IACd,KAAK;IACL,KAAK;IACL,GAAG;IACH,UAAU;IACV,YAAY;IACZ,KAAK;IACL,OAAO;IACP,SAAS;IACT,OAAO;IACP,O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V,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"}
package/lib/esm/index.js CHANGED
@@ -41,4 +41,5 @@ export * from './dropdown';
41
41
  export * from './tag';
42
42
  export * from './wizard';
43
43
  export * from './graph-label';
44
+ export * from './code-block';
44
45
  //# sourceMappingURL=index.js.map
@@ -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,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC"}
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,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC"}
@@ -0,0 +1,34 @@
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 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>>;
@@ -0,0 +1,21 @@
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
+ export * from './CodeBlock';
@@ -0,0 +1,23 @@
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
+ declare const Languages: readonly ["abap", "abnf", "actionscript", "ada", "agda", "al", "antlr4", "apacheconf", "apex", "apl", "applescript", "aql", "arduino", "arff", "asciidoc", "asm6502", "asmatmel", "aspnet", "autohotkey", "autoit", "avisynth", "avro-idl", "bash", "basic", "batch", "bbcode", "bicep", "birb", "bison", "bnf", "brainfuck", "brightscript", "bro", "bsl", "c", "cfscript", "chaiscript", "cil", "clike", "clojure", "cmake", "cobol", "coffeescript", "concurnas", "coq", "cpp", "crystal", "csharp", "cshtml", "csp", "css-extras", "css", "csv", "cypher", "d", "dart", "dataweave", "dax", "dhall", "diff", "django", "dns-zone-file", "docker", "dot", "ebnf", "editorconfig", "eiffel", "ejs", "elixir", "elm", "erb", "erlang", "etlua", "excel-formula", "factor", "false", "firestore-security-rules", "flow", "fortran", "fsharp", "ftl", "gap", "gcode", "gdscript", "gedcom", "gherkin", "git", "glsl", "gml", "gn", "go-module", "go", "graphql", "groovy", "haml", "handlebars", "haskell", "haxe", "hcl", "hlsl", "hoon", "hpkp", "hsts", "http", "ichigojam", "icon", "icu-message-format", "idris", "iecst", "ignore", "inform7", "ini", "io", "j", "java", "javadoc", "javadoclike", "javascript", "javastacktrace", "jexl", "jolie", "jq", "js-extras", "js-templates", "jsdoc", "json", "json5", "jsonp", "jsstacktrace", "jsx", "julia", "keepalived", "keyman", "kotlin", "kumir", "kusto", "latex", "latte", "less", "lilypond", "liquid", "lisp", "livescript", "llvm", "log", "lolcode", "lua", "magma", "makefile", "markdown", "markup-templating", "markup", "matlab", "maxscript", "mel", "mermaid", "mizar", "mongodb", "monkey", "moonscript", "n1ql", "n4js", "nand2tetris-hdl", "naniscript", "nasm", "neon", "nevod", "nginx", "nim", "nix", "nsis", "objectivec", "ocaml", "opencl", "openqasm", "oz", "parigp", "parser", "pascal", "pascaligo", "pcaxis", "peoplecode", "perl", "php-extras", "php", "phpdoc", "plsql", "powerquery", "powershell", "processing", "prolog", "promql", "properties", "protobuf", "psl", "pug", "puppet", "pure", "purebasic", "purescript", "python", "q", "qml", "qore", "qsharp", "r", "racket", "reason", "regex", "rego", "renpy", "rest", "rip", "roboconf", "robotframework", "ruby", "rust", "sas", "sass", "scala", "scheme", "scss", "shell-session", "smali", "smalltalk", "smarty", "sml", "solidity", "solution-file", "soy", "sparql", "splunk-spl", "sqf", "sql", "squirrel", "stan", "stylus", "swift", "systemd", "t4-cs", "t4-templating", "t4-vb", "tap", "tcl", "textile", "toml", "tremor", "tsx", "tt2", "turtle", "twig", "typescript", "typoscript", "unrealscript", "uorazor", "uri", "v", "vala", "vbnet", "velocity", "verilog", "vhdl", "vim", "visual-basic", "warpscript", "wasm", "web-idl", "wiki", "wolfram", "wren", "xeora", "xml-doc", "xojo", "xquery", "yaml", "yang", "zig"];
22
+ export declare type LanguageProp = typeof Languages[number];
23
+ export {};
@@ -41,3 +41,4 @@ export * from './dropdown';
41
41
  export * from './tag';
42
42
  export * from './wizard';
43
43
  export * from './graph-label';
44
+ export * from './code-block';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neo4j-ndl/react",
3
- "version": "0.7.2",
3
+ "version": "0.8.0",
4
4
  "description": "React implementation of Neo4j Design System",
5
5
  "keywords": [
6
6
  "button",
@@ -68,11 +68,12 @@
68
68
  },
69
69
  "dependencies": {
70
70
  "@heroicons/react": "^1.0.5",
71
- "@neo4j-ndl/base": "^0.7.1",
71
+ "@neo4j-ndl/base": "^0.8.0",
72
72
  "classnames": "^2.3.1",
73
73
  "detect-browser": "^5.3.0",
74
74
  "react-dropzone": "^14.0.0",
75
75
  "react-select": "^5.3.2",
76
+ "react-syntax-highlighter": "^15.5.0",
76
77
  "react-table": "^7.7.0",
77
78
  "react-use": "^17.4.0"
78
79
  }