@neo4j-ndl/react 4.13.1 → 4.14.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.
Files changed (49) hide show
  1. package/lib/cjs/code-block/CodeBlock.js +68 -86
  2. package/lib/cjs/code-block/CodeBlock.js.map +1 -1
  3. package/lib/cjs/code-block/code-themes.js +23 -0
  4. package/lib/cjs/code-block/code-themes.js.map +1 -0
  5. package/lib/cjs/code-block/hooks/use-code-language.js +49 -0
  6. package/lib/cjs/code-block/hooks/use-code-language.js.map +1 -0
  7. package/lib/cjs/code-block/hooks/use-code-theme.js +62 -0
  8. package/lib/cjs/code-block/hooks/use-code-theme.js.map +1 -0
  9. package/lib/cjs/code-block/hooks/use-expandable.js +78 -0
  10. package/lib/cjs/code-block/hooks/use-expandable.js.map +1 -0
  11. package/lib/cjs/icons/generated/custom/GraphBuilder.js +30 -0
  12. package/lib/cjs/icons/generated/custom/GraphBuilder.js.map +1 -0
  13. package/lib/cjs/icons/generated/custom/index.js +5 -3
  14. package/lib/cjs/icons/generated/custom/index.js.map +1 -1
  15. package/lib/esm/code-block/CodeBlock.js +62 -80
  16. package/lib/esm/code-block/CodeBlock.js.map +1 -1
  17. package/lib/esm/code-block/code-themes.js +22 -0
  18. package/lib/esm/code-block/code-themes.js.map +1 -0
  19. package/lib/esm/code-block/hooks/use-code-language.js +45 -0
  20. package/lib/esm/code-block/hooks/use-code-language.js.map +1 -0
  21. package/lib/esm/code-block/hooks/use-code-theme.js +55 -0
  22. package/lib/esm/code-block/hooks/use-code-theme.js.map +1 -0
  23. package/lib/esm/code-block/hooks/use-expandable.js +74 -0
  24. package/lib/esm/code-block/hooks/use-expandable.js.map +1 -0
  25. package/lib/esm/icons/generated/custom/GraphBuilder.js +28 -0
  26. package/lib/esm/icons/generated/custom/GraphBuilder.js.map +1 -0
  27. package/lib/esm/icons/generated/custom/index.js +1 -0
  28. package/lib/esm/icons/generated/custom/index.js.map +1 -1
  29. package/lib/types/code-block/CodeBlock.d.ts +3 -1
  30. package/lib/types/code-block/CodeBlock.d.ts.map +1 -1
  31. package/lib/types/code-block/code-themes.d.ts +22 -0
  32. package/lib/types/code-block/code-themes.d.ts.map +1 -0
  33. package/lib/types/code-block/hooks/use-code-language.d.ts +27 -0
  34. package/lib/types/code-block/hooks/use-code-language.d.ts.map +1 -0
  35. package/lib/types/code-block/hooks/use-code-theme.d.ts +29 -0
  36. package/lib/types/code-block/hooks/use-code-theme.d.ts.map +1 -0
  37. package/lib/types/code-block/hooks/use-expandable.d.ts +34 -0
  38. package/lib/types/code-block/hooks/use-expandable.d.ts.map +1 -0
  39. package/lib/types/icons/generated/custom/GraphBuilder.d.ts +29 -0
  40. package/lib/types/icons/generated/custom/GraphBuilder.d.ts.map +1 -0
  41. package/lib/types/icons/generated/custom/index.d.ts +1 -0
  42. package/lib/types/icons/generated/custom/index.d.ts.map +1 -1
  43. package/package.json +5 -5
  44. package/lib/cjs/_common/CodeBlockWrapper.js +0 -105
  45. package/lib/cjs/_common/CodeBlockWrapper.js.map +0 -1
  46. package/lib/esm/_common/CodeBlockWrapper.js +0 -98
  47. package/lib/esm/_common/CodeBlockWrapper.js.map +0 -1
  48. package/lib/types/_common/CodeBlockWrapper.d.ts +0 -40
  49. package/lib/types/_common/CodeBlockWrapper.d.ts.map +0 -1
@@ -1,3 +1,21 @@
1
+ "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.CodeBlock = void 0;
18
+ const jsx_runtime_1 = require("react/jsx-runtime");
1
19
  /**
2
20
  *
3
21
  * Copyright (c) "Neo4j"
@@ -18,94 +36,58 @@
18
36
  * You should have received a copy of the GNU General Public License
19
37
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
38
  */
21
-
22
- "use strict";
23
- var __rest = (this && this.__rest) || function (s, e) {
24
- var t = {};
25
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
26
- t[p] = s[p];
27
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
28
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
29
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
30
- t[p[i]] = s[p[i]];
31
- }
32
- return t;
33
- };
34
- var __importDefault = (this && this.__importDefault) || function (mod) {
35
- return (mod && mod.__esModule) ? mod : { "default": mod };
36
- };
37
- Object.defineProperty(exports, "__esModule", { value: true });
38
- exports.CodeBlock = void 0;
39
- const jsx_runtime_1 = require("react/jsx-runtime");
40
- const react_1 = require("react");
39
+ const classnames_1 = __importDefault(require("classnames"));
41
40
  const react_syntax_highlighter_1 = require("react-syntax-highlighter");
42
- const prism_1 = require("react-syntax-highlighter/dist/cjs/styles/prism");
43
- const CodeBlockWrapper_1 = require("../_common/CodeBlockWrapper");
44
- const theme_1 = require("../theme");
45
- const code_languages_1 = require("./code-languages");
46
- const ndl_code_dark_1 = __importDefault(require("./themes/ndl-code-dark"));
47
- const ndl_code_light_1 = __importDefault(require("./themes/ndl-code-light"));
41
+ const clean_icon_button_1 = require("../clean-icon-button");
42
+ const icons_1 = require("../icons");
43
+ const use_code_language_1 = require("./hooks/use-code-language");
44
+ const use_code_theme_1 = require("./hooks/use-code-theme");
45
+ const use_expandable_1 = require("./hooks/use-expandable");
46
+ const defaultElement = 'div';
48
47
  const CodeBlock = (_a) => {
49
- var { as, maxHeight, code, language, shouldShowLineNumbers, theme, heading, actions, isDisabled, className, style, htmlAttributes, ref } = _a, restProps = __rest(_a, ["as", "maxHeight", "code", "language", "shouldShowLineNumbers", "theme", "heading", "actions", "isDisabled", "className", "style", "htmlAttributes", "ref"]);
50
- const [shouldShowExpandButton, setShouldShowExpandButton] = (0, react_1.useState)(maxHeight !== undefined);
51
- const { theme: ndlTheme } = (0, theme_1.useNeedleTheme)();
52
- const [loadedLanguage, setLoadedLanguage] = (0, react_1.useState)(null);
53
- (0, react_1.useEffect)(() => {
54
- if (language === undefined || language === 'text') {
55
- setLoadedLanguage('text');
56
- return;
57
- }
58
- (0, code_languages_1.loadLanguage)(language)
59
- .then((module) => {
60
- react_syntax_highlighter_1.PrismLight.registerLanguage(language, module.default);
61
- setLoadedLanguage(language);
62
- })
63
- // TODO: add visual feedback for the user
64
- .catch((err) => console.error(err));
65
- }, [language]);
66
- const getTheme = () => {
67
- switch (theme) {
68
- case 'ndl-code-dark':
69
- return ndl_code_dark_1.default;
70
- case 'ndl-code-light':
71
- return ndl_code_light_1.default;
72
- case 'vs':
73
- return prism_1.vs;
74
- case 'base16-ateliersulphurpool.light':
75
- return prism_1.base16AteliersulphurpoolLight;
76
- case 'coy':
77
- return prism_1.coy;
78
- case 'duotone-light':
79
- return prism_1.duotoneLight;
80
- case 'ghcolors':
81
- return prism_1.ghcolors;
82
- case 'prism':
83
- return prism_1.prism;
84
- case 'solarizedlight':
85
- return prism_1.solarizedlight;
86
- default:
87
- return ndlTheme === 'light' ? ndl_code_light_1.default : ndl_code_dark_1.default;
88
- }
89
- };
90
- const calculateRightPadding = (() => {
91
- var _a;
92
- if (Boolean(heading) === false) {
93
- const expandButtonCount = shouldShowExpandButton ? 1 : 0;
94
- const actionCount = (_a = actions === null || actions === void 0 ? void 0 : actions.length) !== null && _a !== void 0 ? _a : 0;
95
- return Math.max(actionCount * 36, expandButtonCount * 36) + 8;
96
- }
97
- })();
98
- return ((0, jsx_runtime_1.jsx)(CodeBlockWrapper_1.CodeBlockWrapper, Object.assign({ as: as, className: className, style: style, ref: ref, maxHeight: maxHeight, code: code, heading: heading, isDisabled: isDisabled, actions: actions, shouldShowExpandButton: shouldShowExpandButton, setShouldShowExpandButton: setShouldShowExpandButton }, restProps, htmlAttributes, { children: (0, jsx_runtime_1.jsx)(react_syntax_highlighter_1.PrismLight, { language: loadedLanguage || 'text', style: Object.assign(Object.assign({}, getTheme()), { 'pre[class*="language-"]': {
99
- border: 0,
100
- color: 'var(--theme-color-neutral-text-default)',
101
- lineHeight: '1',
102
- padding: `0 ${calculateRightPadding !== null && calculateRightPadding !== void 0 ? calculateRightPadding : 0}px 0.75em 0.75em`,
103
- width: 'fit-content',
104
- } }),
105
- // Turn on 'shouldShowLineNumbers' & 'wrapLongLines' at the same time, the display is wrong
106
- // https://github.com/react-syntax-highlighter/react-syntax-highlighter/issues/402
107
- // wrapLongLines
108
- codeTagProps: { className: 'n-code' }, showLineNumbers: shouldShowLineNumbers, children: code }) })));
48
+ var _b, _c;
49
+ var { as, maxHeight, code, language, shouldShowLineNumbers, theme, heading, actions, isDisabled, className, style, htmlAttributes, ref } = _a, restProps = __rest(_a, ["as", "maxHeight", "code", "language", "shouldShowLineNumbers", "theme", "heading", "actions", "isDisabled", "className", "style", "htmlAttributes", "ref"])
50
+ // TODO: Should not be polymorphic (at least not defaulting to a button)
51
+ ;
52
+ const Component = as !== null && as !== void 0 ? as : defaultElement;
53
+ const { containerHeight, isExpanded, toggleExpand, hasOverflowingContent, ref: syntaxHighlighterWrapperRef, } = (0, use_expandable_1.useExpandable)(maxHeight, code);
54
+ const codeTheme = (0, use_code_theme_1.useCodeTheme)(theme);
55
+ const codeLanguage = (0, use_code_language_1.useCodeLanguage)(language);
56
+ const hasMaxHeight = maxHeight !== undefined;
57
+ const hasHeading = Boolean(heading);
58
+ const numberOfActions = (_b = actions === null || actions === void 0 ? void 0 : actions.length) !== null && _b !== void 0 ? _b : 0;
59
+ const shouldShowExpandButton = hasMaxHeight && hasOverflowingContent;
60
+ const rightPadding = hasHeading
61
+ ? 0
62
+ : Math.max(numberOfActions * 36, (shouldShowExpandButton ? 1 : 0) * 36) + 8;
63
+ return ((0, jsx_runtime_1.jsxs)(Component, Object.assign({ ref: ref, className: (0, classnames_1.default)('ndl-code-block-container', className), style: Object.assign({ height: containerHeight }, style) }, restProps, htmlAttributes, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-flex-col n-h-full", children: [hasHeading && ((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)('ndl-code-block-title', {
64
+ 'ndl-disabled': isDisabled,
65
+ }), style: {
66
+ maxWidth: `calc(100% - ${((_c = actions === null || actions === void 0 ? void 0 : actions.length) !== null && _c !== void 0 ? _c : 0) * 36 + 20}px)`,
67
+ }, "data-testid": "ndl-code-block-title", children: heading })), (0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)('ndl-code-content-container', {
68
+ 'ndl-disabled': isDisabled,
69
+ }), style: {
70
+ height: hasHeading ? 'calc(100% - 24px - 12px)' : '100%',
71
+ }, children: (0, jsx_runtime_1.jsx)("div", { ref: syntaxHighlighterWrapperRef, className: "ndl-highlight-wrapper", tabIndex: 0, role: "region", "aria-label": `Code content ${isDisabled ? '(disabled)' : ''}`, children: (0, jsx_runtime_1.jsx)(react_syntax_highlighter_1.PrismLight, { language: codeLanguage, style: Object.assign(Object.assign({}, codeTheme), { 'pre[class*="language-"]': {
72
+ border: 0,
73
+ color: 'var(--theme-color-neutral-text-default)',
74
+ lineHeight: '1',
75
+ padding: `0 ${rightPadding}px 0.75em 0.75em`,
76
+ width: 'fit-content',
77
+ } }), codeTagProps: { className: 'n-code' },
78
+ // Turn on 'shouldShowLineNumbers' & 'wrapLongLines' at the same time, the display is wrong
79
+ // https://github.com/react-syntax-highlighter/react-syntax-highlighter/issues/402
80
+ // wrapLongLines
81
+ showLineNumbers: shouldShowLineNumbers, children: code }) }) })] }), (0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)('ndl-code-block-actions', {
82
+ 'ndl-disabled': isDisabled,
83
+ }), children: actions === null || actions === void 0 ? void 0 : actions.map((iconButtonProps, i) => {
84
+ var _a;
85
+ return ((0, jsx_runtime_1.jsx)(clean_icon_button_1.CleanIconButton, Object.assign({ isDisabled: isDisabled }, iconButtonProps, { description: `${(_a = iconButtonProps.description) !== null && _a !== void 0 ? _a : 'CodeBlock Action'}`, htmlAttributes: Object.assign({ 'data-testid': `ndl-action-button-${i}` }, iconButtonProps.htmlAttributes) }), i));
86
+ }) }), shouldShowExpandButton && ((0, jsx_runtime_1.jsx)("div", { className: "ndl-code-block-expand-button", children: (0, jsx_runtime_1.jsx)(clean_icon_button_1.CleanIconButton, { description: isExpanded ? 'Collapse' : 'Expand', tooltipProps: {
87
+ root: {
88
+ shouldCloseOnReferenceClick: true,
89
+ },
90
+ }, onClick: toggleExpand, children: isExpanded ? (0, jsx_runtime_1.jsx)(icons_1.ChevronUpIconOutline, {}) : (0, jsx_runtime_1.jsx)(icons_1.ChevronDownIconOutline, {}) }) }))] })));
109
91
  };
110
92
  exports.CodeBlock = CodeBlock;
111
93
  //# sourceMappingURL=CodeBlock.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CodeBlock.js","sourceRoot":"","sources":["../../../src/code-block/CodeBlock.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAqBA,iCAA4C;AAC5C,uEAA2E;AAC3E,0EAQwD;AAExD,kEAA+D;AAG/D,oCAA0C;AAC1C,qDAAmE;AACnE,2EAAiD;AACjD,6EAAmD;AAsB5C,MAAM,SAAS,GAAG,CAAyC,EAetB,EAAE,EAAE;QAfkB,EAChE,EAAE,EACF,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,qBAAqB,EACrB,KAAK,EACL,OAAO,EACP,OAAO,EACP,UAAU,EACV,SAAS,EACT,KAAK,EACL,cAAc,EACd,GAAG,OAEuC,EADvC,SAAS,cAdoD,4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Aa;iBACrB;YAEH,2FAA2F;YAC3F,kFAAkF;YAClF,gBAAgB;YAChB,YAAY,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,EACrC,eAAe,EAAE,qBAAqB,YAErC,IAAI,GACa,IACH,CACpB,CAAC;AACJ,CAAC,CAAC;AA9GW,QAAA,SAAS,aA8GpB","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport type React from 'react';\nimport { useEffect, useState } from 'react';\nimport { PrismLight as SyntaxHighlighter } from 'react-syntax-highlighter';\nimport {\n base16AteliersulphurpoolLight,\n coy,\n duotoneLight,\n ghcolors,\n prism,\n solarizedlight,\n vs,\n} from 'react-syntax-highlighter/dist/cjs/styles/prism';\n\nimport { CodeBlockWrapper } from '../_common/CodeBlockWrapper';\nimport { type PolymorphicCommonProps } from '../_common/types';\nimport { type IconButton } from '../icon-button';\nimport { useNeedleTheme } from '../theme';\nimport { type LanguageProp, loadLanguage } from './code-languages';\nimport ndlCodeDark from './themes/ndl-code-dark';\nimport ndlCodeLight from './themes/ndl-code-light';\n\ninterface CodeBlockProps {\n code: string;\n isDisabled?: boolean;\n maxHeight?: number;\n language: LanguageProp | 'text';\n shouldShowLineNumbers?: boolean;\n theme?:\n | 'vs'\n | 'base16-ateliersulphurpool.light'\n | 'coy'\n | 'duotone-light'\n | 'ghcolors'\n | 'prism'\n | 'solarizedlight'\n | 'ndl-code-dark'\n | 'ndl-code-light';\n heading?: React.ReactNode;\n actions?: React.ComponentProps<typeof IconButton<'button'>>[];\n}\n\nexport const CodeBlock = <T extends React.ElementType = 'button'>({\n as,\n maxHeight,\n code,\n language,\n shouldShowLineNumbers,\n theme,\n heading,\n actions,\n isDisabled,\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, CodeBlockProps>) => {\n const [shouldShowExpandButton, setShouldShowExpandButton] = useState(\n maxHeight !== undefined,\n );\n\n const { theme: ndlTheme } = useNeedleTheme();\n const [loadedLanguage, setLoadedLanguage] = useState<\n LanguageProp | 'text' | null\n >(null);\n\n useEffect(() => {\n if (language === undefined || language === 'text') {\n setLoadedLanguage('text');\n return;\n }\n\n loadLanguage(language)\n .then((module) => {\n SyntaxHighlighter.registerLanguage(language, module.default);\n setLoadedLanguage(language);\n })\n // TODO: add visual feedback for the user\n .catch((err) => console.error(err));\n }, [language]);\n\n const getTheme = () => {\n switch (theme) {\n case 'ndl-code-dark':\n return ndlCodeDark;\n case 'ndl-code-light':\n return ndlCodeLight;\n case 'vs':\n return vs;\n case 'base16-ateliersulphurpool.light':\n return base16AteliersulphurpoolLight;\n case 'coy':\n return coy;\n case 'duotone-light':\n return duotoneLight;\n case 'ghcolors':\n return ghcolors;\n case 'prism':\n return prism;\n case 'solarizedlight':\n return solarizedlight;\n default:\n return ndlTheme === 'light' ? ndlCodeLight : ndlCodeDark;\n }\n };\n const calculateRightPadding = (() => {\n if (Boolean(heading) === false) {\n const expandButtonCount = shouldShowExpandButton ? 1 : 0;\n const actionCount = actions?.length ?? 0;\n return Math.max(actionCount * 36, expandButtonCount * 36) + 8;\n }\n })();\n\n return (\n <CodeBlockWrapper\n as={as}\n className={className}\n style={style}\n ref={ref}\n maxHeight={maxHeight}\n code={code}\n heading={heading}\n isDisabled={isDisabled}\n actions={actions}\n shouldShowExpandButton={shouldShowExpandButton}\n setShouldShowExpandButton={setShouldShowExpandButton}\n {...restProps}\n {...htmlAttributes}\n >\n <SyntaxHighlighter\n language={loadedLanguage || 'text'}\n style={{\n ...getTheme(),\n 'pre[class*=\"language-\"]': {\n border: 0,\n color: 'var(--theme-color-neutral-text-default)',\n lineHeight: '1',\n padding: `0 ${calculateRightPadding ?? 0}px 0.75em 0.75em`,\n width: 'fit-content',\n },\n }}\n // Turn on 'shouldShowLineNumbers' & 'wrapLongLines' at the same time, the display is wrong\n // https://github.com/react-syntax-highlighter/react-syntax-highlighter/issues/402\n // wrapLongLines\n codeTagProps={{ className: 'n-code' }}\n showLineNumbers={shouldShowLineNumbers}\n >\n {code}\n </SyntaxHighlighter>\n </CodeBlockWrapper>\n );\n};\n"]}
1
+ {"version":3,"file":"CodeBlock.js","sourceRoot":"","sources":["../../../src/code-block/CodeBlock.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4DAAoC;AAEpC,uEAA2E;AAG3E,4DAAuD;AAEvD,oCAAwE;AAGxE,iEAA4D;AAC5D,2DAAsD;AACtD,2DAAuD;AAavD,MAAM,cAAc,GAAG,KAAK,CAAC;AAEtB,MAAM,SAAS,GAAG,CAAyC,EAgBtB,EAAE,EAAE;;QAhBkB,EAChE,EAAE,EACF,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,qBAAqB,EACrB,KAAK,EACL,OAAO,EACP,OAAO,EACP,UAAU,EACV,SAAS,EACT,KAAK,EACL,cAAc,EACd,GAAG,OAGuC,EAFvC,SAAS,cAdoD,4JAgBjE,CAFa;IACZ,wEAAwE;;IAExE,MAAM,SAAS,GAAsB,EAAE,aAAF,EAAE,cAAF,EAAE,GAAI,cAAc,CAAC;IAE1D,MAAM,EACJ,eAAe,EACf,UAAU,EACV,YAAY,EACZ,qBAAqB,EACrB,GAAG,EAAE,2BAA2B,GACjC,GAAG,IAAA,8BAAa,EAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IACnC,MAAM,SAAS,GAAG,IAAA,6BAAY,EAAC,KAAK,CAAC,CAAC;IACtC,MAAM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,IAAI,EAAE;4BACJ,2BAA2B,EAAE,IAAI;yBAClC;qBACF,EACD,OAAO,EAAE,YAAY,YAEpB,UAAU,CAAC,CAAC,CAAC,uBAAC,4BAAoB,KAAG,CAAC,CAAC,CAAC,uBAAC,8BAAsB,KAAG,GACnD,GACd,CACP,KACS,CACb,CAAC;AACJ,CAAC,CAAC;AArIW,QAAA,SAAS,aAqIpB","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport classNames from 'classnames';\nimport type React from 'react';\nimport { PrismLight as SyntaxHighlighter } from 'react-syntax-highlighter';\n\nimport { type PolymorphicCommonProps } from '../_common/types';\nimport { CleanIconButton } from '../clean-icon-button';\nimport { type IconButton } from '../icon-button';\nimport { ChevronDownIconOutline, ChevronUpIconOutline } from '../icons';\nimport { type LanguageProp } from './code-languages';\nimport { type CodeTheme } from './code-themes';\nimport { useCodeLanguage } from './hooks/use-code-language';\nimport { useCodeTheme } from './hooks/use-code-theme';\nimport { useExpandable } from './hooks/use-expandable';\n\ninterface CodeBlockProps {\n code: string;\n isDisabled?: boolean;\n maxHeight?: number;\n language: LanguageProp | 'text';\n shouldShowLineNumbers?: boolean;\n theme?: CodeTheme;\n heading?: React.ReactNode;\n actions?: React.ComponentProps<typeof IconButton<'button'>>[];\n}\n\nconst defaultElement = 'div';\n\nexport const CodeBlock = <T extends React.ElementType = 'button'>({\n as,\n maxHeight,\n code,\n language,\n shouldShowLineNumbers,\n theme,\n heading,\n actions,\n isDisabled,\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n // TODO: Should not be polymorphic (at least not defaulting to a button)\n}: PolymorphicCommonProps<T, CodeBlockProps>) => {\n const Component: React.ElementType = as ?? defaultElement;\n\n const {\n containerHeight,\n isExpanded,\n toggleExpand,\n hasOverflowingContent,\n ref: syntaxHighlighterWrapperRef,\n } = useExpandable(maxHeight, code);\n const codeTheme = useCodeTheme(theme);\n const codeLanguage = useCodeLanguage(language);\n\n const hasMaxHeight = maxHeight !== undefined;\n const hasHeading = Boolean(heading);\n const numberOfActions = actions?.length ?? 0;\n\n const shouldShowExpandButton = hasMaxHeight && hasOverflowingContent;\n const rightPadding = hasHeading\n ? 0\n : Math.max(numberOfActions * 36, (shouldShowExpandButton ? 1 : 0) * 36) + 8;\n\n return (\n <Component\n ref={ref}\n className={classNames('ndl-code-block-container', className)}\n style={{ height: containerHeight, ...style }}\n {...restProps}\n {...htmlAttributes}\n >\n <div className=\"n-flex n-flex-col n-h-full\">\n {hasHeading && (\n <div\n className={classNames('ndl-code-block-title', {\n 'ndl-disabled': isDisabled,\n })}\n style={{\n maxWidth: `calc(100% - ${(actions?.length ?? 0) * 36 + 20}px)`,\n }}\n data-testid=\"ndl-code-block-title\"\n >\n {heading}\n </div>\n )}\n <div\n className={classNames('ndl-code-content-container', {\n 'ndl-disabled': isDisabled,\n })}\n style={{\n height: hasHeading ? 'calc(100% - 24px - 12px)' : '100%',\n }}\n >\n <div\n ref={syntaxHighlighterWrapperRef}\n className=\"ndl-highlight-wrapper\"\n tabIndex={0}\n role=\"region\"\n aria-label={`Code content ${isDisabled ? '(disabled)' : ''}`}\n >\n <SyntaxHighlighter\n language={codeLanguage}\n style={{\n ...codeTheme,\n 'pre[class*=\"language-\"]': {\n border: 0,\n color: 'var(--theme-color-neutral-text-default)',\n lineHeight: '1',\n padding: `0 ${rightPadding}px 0.75em 0.75em`,\n width: 'fit-content',\n },\n }}\n codeTagProps={{ className: 'n-code' }}\n // Turn on 'shouldShowLineNumbers' & 'wrapLongLines' at the same time, the display is wrong\n // https://github.com/react-syntax-highlighter/react-syntax-highlighter/issues/402\n // wrapLongLines\n showLineNumbers={shouldShowLineNumbers}\n >\n {code}\n </SyntaxHighlighter>\n </div>\n </div>\n </div>\n <div\n className={classNames('ndl-code-block-actions', {\n 'ndl-disabled': isDisabled,\n })}\n >\n {actions?.map((iconButtonProps, i) => (\n <CleanIconButton\n key={i}\n isDisabled={isDisabled}\n {...iconButtonProps}\n description={`${iconButtonProps.description ?? 'CodeBlock Action'}`}\n htmlAttributes={{\n 'data-testid': `ndl-action-button-${i}`,\n ...iconButtonProps.htmlAttributes,\n }}\n />\n ))}\n </div>\n {shouldShowExpandButton && (\n <div className=\"ndl-code-block-expand-button\">\n <CleanIconButton\n description={isExpanded ? 'Collapse' : 'Expand'}\n tooltipProps={{\n root: {\n shouldCloseOnReferenceClick: true,\n },\n }}\n onClick={toggleExpand}\n >\n {isExpanded ? <ChevronUpIconOutline /> : <ChevronDownIconOutline />}\n </CleanIconButton>\n </div>\n )}\n </Component>\n );\n};\n"]}
@@ -0,0 +1,23 @@
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
+ //# sourceMappingURL=code-themes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-themes.js","sourceRoot":"","sources":["../../../src/code-block/code-themes.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nexport type CodeTheme =\n | 'vs'\n | 'base16-ateliersulphurpool.light'\n | 'coy'\n | 'duotone-light'\n | 'ghcolors'\n | 'prism'\n | 'solarizedlight'\n | 'ndl-code-dark'\n | 'ndl-code-light';\n"]}
@@ -0,0 +1,49 @@
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
+ exports.useCodeLanguage = void 0;
24
+ const react_1 = require("react");
25
+ const react_syntax_highlighter_1 = require("react-syntax-highlighter");
26
+ const code_languages_1 = require("../code-languages");
27
+ /**
28
+ * Load the code highlighting language for the given language.
29
+ * Defaults to 'text' if no language is provided.
30
+ */
31
+ const useCodeLanguage = (language) => {
32
+ const [loadedLanguage, setLoadedLanguage] = (0, react_1.useState)('text');
33
+ (0, react_1.useEffect)(() => {
34
+ if (language === undefined || language === 'text') {
35
+ setLoadedLanguage('text');
36
+ return;
37
+ }
38
+ (0, code_languages_1.loadLanguage)(language)
39
+ .then((module) => {
40
+ react_syntax_highlighter_1.PrismLight.registerLanguage(language, module.default);
41
+ setLoadedLanguage(language);
42
+ })
43
+ // TODO: add visual feedback for the user
44
+ .catch((err) => console.error(err));
45
+ }, [language]);
46
+ return loadedLanguage;
47
+ };
48
+ exports.useCodeLanguage = useCodeLanguage;
49
+ //# sourceMappingURL=use-code-language.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-code-language.js","sourceRoot":"","sources":["../../../../src/code-block/hooks/use-code-language.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH,iCAA4C;AAC5C,uEAA2E;AAE3E,sDAAoE;AAEpE;;;GAGG;AACI,MAAM,eAAe,GAAG,CAAC,QAAgC,EAAE,EAAE;IAClE,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,IAAA,gBAAQ,EAClD,MAAM,CACP,CAAC;IAEF,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,MAAM,EAAE,CAAC;YAClD,iBAAiB,CAAC,MAAM,CAAC,CAAC;YAC1B,OAAO;QACT,CAAC;QAED,IAAA,6BAAY,EAAC,QAAQ,CAAC;aACnB,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;YACf,qCAAiB,CAAC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;YAC7D,iBAAiB,CAAC,QAAQ,CAAC,CAAC;QAC9B,CAAC,CAAC;YACF,yCAAyC;aACxC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;IACxC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,OAAO,cAAc,CAAC;AACxB,CAAC,CAAC;AArBW,QAAA,eAAe,mBAqB1B","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { useEffect, useState } from 'react';\nimport { PrismLight as SyntaxHighlighter } from 'react-syntax-highlighter';\n\nimport { type LanguageProp, loadLanguage } from '../code-languages';\n\n/**\n * Load the code highlighting language for the given language.\n * Defaults to 'text' if no language is provided.\n */\nexport const useCodeLanguage = (language?: LanguageProp | 'text') => {\n const [loadedLanguage, setLoadedLanguage] = useState<LanguageProp | 'text'>(\n 'text',\n );\n\n useEffect(() => {\n if (language === undefined || language === 'text') {\n setLoadedLanguage('text');\n return;\n }\n\n loadLanguage(language)\n .then((module) => {\n SyntaxHighlighter.registerLanguage(language, module.default);\n setLoadedLanguage(language);\n })\n // TODO: add visual feedback for the user\n .catch((err) => console.error(err));\n }, [language]);\n\n return loadedLanguage;\n};\n"]}
@@ -0,0 +1,62 @@
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 __importDefault = (this && this.__importDefault) || function (mod) {
23
+ return (mod && mod.__esModule) ? mod : { "default": mod };
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.useCodeTheme = void 0;
27
+ const prism_1 = require("react-syntax-highlighter/dist/cjs/styles/prism");
28
+ const theme_1 = require("../../theme");
29
+ const ndl_code_dark_1 = __importDefault(require("../themes/ndl-code-dark"));
30
+ const ndl_code_light_1 = __importDefault(require("../themes/ndl-code-light"));
31
+ /**
32
+ * The color themes that we support for the Prism code highlighting library.
33
+ */
34
+ const PRISM_CODE_THEMES = {
35
+ 'base16-ateliersulphurpool.light': prism_1.base16AteliersulphurpoolLight,
36
+ coy: prism_1.coy,
37
+ 'duotone-light': prism_1.duotoneLight,
38
+ ghcolors: prism_1.ghcolors,
39
+ 'ndl-code-dark': ndl_code_dark_1.default,
40
+ 'ndl-code-light': ndl_code_light_1.default,
41
+ prism: prism_1.prism,
42
+ solarizedlight: prism_1.solarizedlight,
43
+ vs: prism_1.vs,
44
+ };
45
+ /**
46
+ * Map the Needle theme to the corresponding Prism color theme.
47
+ */
48
+ const NEEDLE_CODE_THEMES = {
49
+ dark: ndl_code_dark_1.default,
50
+ light: ndl_code_light_1.default,
51
+ };
52
+ /**
53
+ * Get the Prism code color theme.
54
+ * Defaults to the appropriate Prism theme based on the Needle theme if no chosen theme is provided.
55
+ */
56
+ const useCodeTheme = (chosenTheme) => {
57
+ var _a;
58
+ const { theme: needleTheme } = (0, theme_1.useNeedleTheme)();
59
+ return ((_a = (chosenTheme && PRISM_CODE_THEMES[chosenTheme])) !== null && _a !== void 0 ? _a : NEEDLE_CODE_THEMES[needleTheme]);
60
+ };
61
+ exports.useCodeTheme = useCodeTheme;
62
+ //# sourceMappingURL=use-code-theme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-code-theme.js","sourceRoot":"","sources":["../../../../src/code-block/hooks/use-code-theme.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;AAGH,0EAQwD;AAExD,uCAA6C;AAE7C,4EAAkD;AAClD,8EAAoD;AAIpD;;GAEG;AACH,MAAM,iBAAiB,GAAG;IACxB,iCAAiC,EAAE,qCAA6B;IAChE,GAAG,EAAH,WAAG;IACH,eAAe,EAAE,oBAAY;IAC7B,QAAQ,EAAR,gBAAQ;IACR,eAAe,EAAE,uBAAW;IAC5B,gBAAgB,EAAE,wBAAY;IAC9B,KAAK,EAAL,aAAK;IACL,cAAc,EAAd,sBAAc;IACd,EAAE,EAAF,UAAE;CACqC,CAAC;AAE1C;;GAEG;AACH,MAAM,kBAAkB,GAAG;IACzB,IAAI,EAAE,uBAAW;IACjB,KAAK,EAAE,wBAAY;CACX,CAAC;AAEX;;;GAGG;AACI,MAAM,YAAY,GAAG,CAAC,WAAkC,EAAE,EAAE;;IACjE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,IAAA,sBAAc,GAAE,CAAC;IAChD,OAAO,CACL,MAAA,CAAC,WAAW,IAAI,iBAAiB,CAAC,WAAW,CAAC,CAAC,mCAC/C,kBAAkB,CAAC,WAAW,CAAC,CAChC,CAAC;AACJ,CAAC,CAAC;AANW,QAAA,YAAY,gBAMvB","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { type SyntaxHighlighterProps } from 'react-syntax-highlighter';\nimport {\n base16AteliersulphurpoolLight,\n coy,\n duotoneLight,\n ghcolors,\n prism,\n solarizedlight,\n vs,\n} from 'react-syntax-highlighter/dist/cjs/styles/prism';\n\nimport { useNeedleTheme } from '../../theme';\nimport { type CodeTheme } from '../code-themes';\nimport ndlCodeDark from '../themes/ndl-code-dark';\nimport ndlCodeLight from '../themes/ndl-code-light';\n\ntype PrismTheme = SyntaxHighlighterProps['style'];\n\n/**\n * The color themes that we support for the Prism code highlighting library.\n */\nconst PRISM_CODE_THEMES = {\n 'base16-ateliersulphurpool.light': base16AteliersulphurpoolLight,\n coy,\n 'duotone-light': duotoneLight,\n ghcolors,\n 'ndl-code-dark': ndlCodeDark,\n 'ndl-code-light': ndlCodeLight,\n prism,\n solarizedlight,\n vs,\n} satisfies Record<CodeTheme, PrismTheme>;\n\n/**\n * Map the Needle theme to the corresponding Prism color theme.\n */\nconst NEEDLE_CODE_THEMES = {\n dark: ndlCodeDark,\n light: ndlCodeLight,\n} as const;\n\n/**\n * Get the Prism code color theme.\n * Defaults to the appropriate Prism theme based on the Needle theme if no chosen theme is provided.\n */\nexport const useCodeTheme = (chosenTheme: CodeTheme | undefined) => {\n const { theme: needleTheme } = useNeedleTheme();\n return (\n (chosenTheme && PRISM_CODE_THEMES[chosenTheme]) ??\n NEEDLE_CODE_THEMES[needleTheme]\n );\n};\n"]}
@@ -0,0 +1,78 @@
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
+ exports.useExpandable = void 0;
24
+ const react_1 = require("react");
25
+ /**
26
+ * A hook to manage the expandable state of a content container.
27
+ * @param maxHeight - The maximum height of the content container.
28
+ * @param dependency - A dependency to watch for changes.
29
+ * @returns An object containing the container height, whether the content is overflowing, and the expandable state.
30
+ */
31
+ const useExpandable = (maxHeight, dependency) => {
32
+ const ref = (0, react_1.useRef)(null);
33
+ const [containerHeight, setContainerHeight] = (0, react_1.useState)(`${maxHeight}px`);
34
+ const [isExpanded, setIsExpanded] = (0, react_1.useState)(maxHeight === undefined);
35
+ const [hasOverflowingContent, setHasOverflowingContent] = (0, react_1.useState)(false);
36
+ (0, react_1.useEffect)(() => {
37
+ var _a, _b, _c, _d;
38
+ if (((_b = (_a = ref.current) === null || _a === void 0 ? void 0 : _a.scrollHeight) !== null && _b !== void 0 ? _b : 0) <= ((_d = (_c = ref.current) === null || _c === void 0 ? void 0 : _c.clientHeight) !== null && _d !== void 0 ? _d : 0)) {
39
+ setIsExpanded(true);
40
+ }
41
+ else {
42
+ setIsExpanded(false);
43
+ }
44
+ }, []);
45
+ (0, react_1.useLayoutEffect)(() => {
46
+ var _a, _b, _c, _d;
47
+ if (maxHeight === undefined) {
48
+ return;
49
+ }
50
+ if (((_b = (_a = ref.current) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : 0) >= ((_d = (_c = ref.current) === null || _c === void 0 ? void 0 : _c.scrollHeight) !== null && _d !== void 0 ? _d : 0)) {
51
+ setContainerHeight(`fit-content`);
52
+ setHasOverflowingContent(false);
53
+ }
54
+ else {
55
+ setContainerHeight(`${maxHeight}px`);
56
+ setHasOverflowingContent(true);
57
+ }
58
+ }, [maxHeight, dependency]);
59
+ const toggleExpand = () => {
60
+ if (isExpanded) {
61
+ setContainerHeight(`${maxHeight}px`);
62
+ setIsExpanded(false);
63
+ }
64
+ else {
65
+ setContainerHeight(`fit-content`);
66
+ setIsExpanded(true);
67
+ }
68
+ };
69
+ return {
70
+ containerHeight,
71
+ hasOverflowingContent,
72
+ isExpanded,
73
+ ref,
74
+ toggleExpand,
75
+ };
76
+ };
77
+ exports.useExpandable = useExpandable;
78
+ //# sourceMappingURL=use-expandable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-expandable.js","sourceRoot":"","sources":["../../../../src/code-block/hooks/use-expandable.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH,iCAAqE;AAErE;;;;;GAKG;AACI,MAAM,aAAa,GAAG,CAC3B,SAA6B,EAC7B,UAAmB,EACnB,EAAE;IACF,MAAM,GAAG,GAAG,IAAA,cAAM,EAAiB,IAAI,CAAC,CAAC;IAEzC,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,IAAA,gBAAQ,EAAC,GAAG,SAAS,IAAI,CAAC,CAAC;IACzE,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAAA,gBAAQ,EAAC,SAAS,KAAK,SAAS,CAAC,CAAC;IACtE,MAAM,CAAC,qBAAqB,EAAE,wBAAwB,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAE1E,IAAA,iBAAS,EAAC,GAAG,EAAE;;QACb,IAAI,CAAC,MAAA,MAAA,GAAG,CAAC,OAAO,0CAAE,YAAY,mCAAI,CAAC,CAAC,IAAI,CAAC,MAAA,MAAA,GAAG,CAAC,OAAO,0CAAE,YAAY,mCAAI,CAAC,CAAC,EAAE,CAAC;YACzE,aAAa,CAAC,IAAI,CAAC,CAAC;QACtB,CAAC;aAAM,CAAC;YACN,aAAa,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,IAAA,uBAAe,EAAC,GAAG,EAAE;;QACnB,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC5B,OAAO;QACT,CAAC;QAED,IAAI,CAAC,MAAA,MAAA,GAAG,CAAC,OAAO,0CAAE,YAAY,mCAAI,CAAC,CAAC,IAAI,CAAC,MAAA,MAAA,GAAG,CAAC,OAAO,0CAAE,YAAY,mCAAI,CAAC,CAAC,EAAE,CAAC;YACzE,kBAAkB,CAAC,aAAa,CAAC,CAAC;YAClC,wBAAwB,CAAC,KAAK,CAAC,CAAC;QAClC,CAAC;aAAM,CAAC;YACN,kBAAkB,CAAC,GAAG,SAAS,IAAI,CAAC,CAAC;YACrC,wBAAwB,CAAC,IAAI,CAAC,CAAC;QACjC,CAAC;IACH,CAAC,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;IAE5B,MAAM,YAAY,GAAG,GAAG,EAAE;QACxB,IAAI,UAAU,EAAE,CAAC;YACf,kBAAkB,CAAC,GAAG,SAAS,IAAI,CAAC,CAAC;YACrC,aAAa,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC;aAAM,CAAC;YACN,kBAAkB,CAAC,aAAa,CAAC,CAAC;YAClC,aAAa,CAAC,IAAI,CAAC,CAAC;QACtB,CAAC;IACH,CAAC,CAAC;IAEF,OAAO;QACL,eAAe;QACf,qBAAqB;QACrB,UAAU;QACV,GAAG;QACH,YAAY;KACb,CAAC;AACJ,CAAC,CAAC;AAjDW,QAAA,aAAa,iBAiDxB","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { useEffect, useLayoutEffect, useRef, useState } from 'react';\n\n/**\n * A hook to manage the expandable state of a content container.\n * @param maxHeight - The maximum height of the content container.\n * @param dependency - A dependency to watch for changes.\n * @returns An object containing the container height, whether the content is overflowing, and the expandable state.\n */\nexport const useExpandable = (\n maxHeight: number | undefined,\n dependency: unknown,\n) => {\n const ref = useRef<HTMLDivElement>(null);\n\n const [containerHeight, setContainerHeight] = useState(`${maxHeight}px`);\n const [isExpanded, setIsExpanded] = useState(maxHeight === undefined);\n const [hasOverflowingContent, setHasOverflowingContent] = useState(false);\n\n useEffect(() => {\n if ((ref.current?.scrollHeight ?? 0) <= (ref.current?.clientHeight ?? 0)) {\n setIsExpanded(true);\n } else {\n setIsExpanded(false);\n }\n }, []);\n\n useLayoutEffect(() => {\n if (maxHeight === undefined) {\n return;\n }\n\n if ((ref.current?.clientHeight ?? 0) >= (ref.current?.scrollHeight ?? 0)) {\n setContainerHeight(`fit-content`);\n setHasOverflowingContent(false);\n } else {\n setContainerHeight(`${maxHeight}px`);\n setHasOverflowingContent(true);\n }\n }, [maxHeight, dependency]);\n\n const toggleExpand = () => {\n if (isExpanded) {\n setContainerHeight(`${maxHeight}px`);\n setIsExpanded(false);\n } else {\n setContainerHeight(`fit-content`);\n setIsExpanded(true);\n }\n };\n\n return {\n containerHeight,\n hasOverflowingContent,\n isExpanded,\n ref,\n toggleExpand,\n };\n};\n"]}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
+ /**
5
+ *
6
+ * Copyright (c) "Neo4j"
7
+ * Neo4j Sweden AB [http://neo4j.com]
8
+ *
9
+ * This file is part of Neo4j.
10
+ *
11
+ * Neo4j is free software: you can redistribute it and/or modify
12
+ * it under the terms of the GNU General Public License as published by
13
+ * the Free Software Foundation, either version 3 of the License, or
14
+ * (at your option) any later version.
15
+ *
16
+ * This program is distributed in the hope that it will be useful,
17
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
+ * GNU General Public License for more details.
20
+ *
21
+ * You should have received a copy of the GNU General Public License
22
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
23
+ */
24
+ // THIS FILE IS GENERATED BY BUILD TOOL
25
+ // DO NOT EDIT IT MANUAL
26
+ const wrapIcon_1 = require("../../wrapIcon");
27
+ const SvgGraphBuilderBase = (props) => ((0, jsx_runtime_1.jsx)("svg", Object.assign({ viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props, { children: (0, jsx_runtime_1.jsx)("path", { d: "M6.40933 6.93311C7.099 7.08977 7.82266 6.96603 8.4211 6.58913C9.01955 6.21223 9.44376 5.61303 9.60041 4.92335C9.75706 4.23367 9.63333 3.51002 9.25642 2.91157C8.87952 2.31313 8.28032 1.88892 7.59065 1.73226C6.90098 1.57561 6.17732 1.69935 5.57888 2.07625C4.98043 2.45315 4.55622 3.05235 4.39957 3.74203C4.24292 4.4317 4.36665 5.15536 4.74356 5.75381C5.12046 6.35225 5.71966 6.77646 6.40933 6.93311ZM6.40933 6.93311L5.02352 13.0902M17.3333 12.9993C17.0025 13.2496 16.6148 13.4217 16.199 13.497M15.6667 8.33268C16.0744 8.33268 16.4725 8.42606 16.8324 8.60097M18.1387 9.99935C18.2661 10.3141 18.3333 10.6533 18.3333 10.9993M13.9036 12.9993C13.6643 12.76 13.4751 12.4798 13.3429 12.1751M13.1946 9.99935C13.3275 9.67093 13.5257 9.3691 13.7811 9.11373M5.02352 13.0902C4.34037 12.9072 3.6125 13.003 3.00001 13.3566C2.38752 13.7102 1.94059 14.2927 1.75754 14.9758C1.5745 15.659 1.67032 16.3869 2.02394 16.9993C2.37756 17.6118 2.96001 18.0588 3.64315 18.2418C4.3263 18.4249 5.05417 18.329 5.66666 17.9754C6.27915 17.6218 6.72608 17.0393 6.90913 16.3562C7.09217 15.6731 6.99635 14.9452 6.64273 14.3327M5.02352 13.0902C5.70666 13.2733 6.28911 13.7202 6.64273 14.3327M6.64273 14.3327L8.66665 13.666M9.66665 4.99936L10.5 5.83268M11.8333 7.24935L12.5 7.91602M10.3333 13.0902L11.6666 12.666", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }) })));
28
+ const SvgGraphBuilder = (0, wrapIcon_1.wrapIcon)(SvgGraphBuilderBase);
29
+ exports.default = SvgGraphBuilder;
30
+ //# sourceMappingURL=GraphBuilder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GraphBuilder.js","sourceRoot":"","sources":["../../../../../src/icons/generated/custom/GraphBuilder.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,uCAAuC;AACvC,wBAAwB;AACxB,6CAA0C;AAE1C,MAAM,mBAAmB,GAAG,CAAC,KAA8B,EAAE,EAAE,CAAC,CAC9D,8CACE,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,IAC9B,KAAK,cAET,iCACE,CAAC,EAAC,4vCAA4vC,EAC9vC,MAAM,EAAC,cAAc,EACrB,WAAW,EAAE,GAAG,EAChB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,GACtB,IACE,CACP,CAAC;AACF,MAAM,eAAe,GAAG,IAAA,mBAAQ,EAAC,mBAAmB,CAAC,CAAC;AACtD,kBAAe,eAAe,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n// THIS FILE IS GENERATED BY BUILD TOOL\n// DO NOT EDIT IT MANUAL\nimport { wrapIcon } from '../../wrapIcon';\nimport { SVGProps } from 'react';\nconst SvgGraphBuilderBase = (props: SVGProps<SVGSVGElement>) => (\n <svg\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <path\n d=\"M6.40933 6.93311C7.099 7.08977 7.82266 6.96603 8.4211 6.58913C9.01955 6.21223 9.44376 5.61303 9.60041 4.92335C9.75706 4.23367 9.63333 3.51002 9.25642 2.91157C8.87952 2.31313 8.28032 1.88892 7.59065 1.73226C6.90098 1.57561 6.17732 1.69935 5.57888 2.07625C4.98043 2.45315 4.55622 3.05235 4.39957 3.74203C4.24292 4.4317 4.36665 5.15536 4.74356 5.75381C5.12046 6.35225 5.71966 6.77646 6.40933 6.93311ZM6.40933 6.93311L5.02352 13.0902M17.3333 12.9993C17.0025 13.2496 16.6148 13.4217 16.199 13.497M15.6667 8.33268C16.0744 8.33268 16.4725 8.42606 16.8324 8.60097M18.1387 9.99935C18.2661 10.3141 18.3333 10.6533 18.3333 10.9993M13.9036 12.9993C13.6643 12.76 13.4751 12.4798 13.3429 12.1751M13.1946 9.99935C13.3275 9.67093 13.5257 9.3691 13.7811 9.11373M5.02352 13.0902C4.34037 12.9072 3.6125 13.003 3.00001 13.3566C2.38752 13.7102 1.94059 14.2927 1.75754 14.9758C1.5745 15.659 1.67032 16.3869 2.02394 16.9993C2.37756 17.6118 2.96001 18.0588 3.64315 18.2418C4.3263 18.4249 5.05417 18.329 5.66666 17.9754C6.27915 17.6218 6.72608 17.0393 6.90913 16.3562C7.09217 15.6731 6.99635 14.9452 6.64273 14.3327M5.02352 13.0902C5.70666 13.2733 6.28911 13.7202 6.64273 14.3327M6.64273 14.3327L8.66665 13.666M9.66665 4.99936L10.5 5.83268M11.8333 7.24935L12.5 7.91602M10.3333 13.0902L11.6666 12.666\"\n stroke=\"currentColor\"\n strokeWidth={1.5}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\nconst SvgGraphBuilder = wrapIcon(SvgGraphBuilderBase);\nexport default SvgGraphBuilder;\n"]}
@@ -23,9 +23,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
23
23
  return (mod && mod.__esModule) ? mod : { "default": mod };
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.LassoIcon = exports.ItalicIcon = exports.HorizontalBarIcon = exports.HierarchyTwoIcon = exports.HierarchyOneIcon = exports.HeartbeatIcon = exports.HeadsetIcon = exports.HandIcon = exports.GraphCrossIcon = exports.GlobePinIcon = exports.GithubIcon = exports.FunnelNavigateIcon = exports.FontSizeIcon = exports.FolderBookmarkIcon = exports.FloppyDiskIcon = exports.FitToScreenIcon = exports.ExternalLinkIcon = exports.ExploreIcon = exports.ExpandIcon = exports.ExpandLayersIcon = exports.DragIcon = exports.DocumentRefreshIcon = exports.DividerSquareDashIcon = exports.DesktopSaveIcon = exports.DeploymentsIcon = exports.DatabaseSignalIcon = exports.DatabaseRoleIcon = exports.DatabasePlusIcon = exports.DatabasePlugIcon = exports.DatabaseCrossIcon = exports.DataScienceIcon = exports.DataGridCrossIcon = exports.CurlyBracketsIcon = exports.ConfigureIcon = exports.CollapseLayersIcon = exports.CloudCrossIcon = exports.CloudCheckIcon = exports.CircleIcon = exports.ChipIcon = exports.CellDoubleClickIcon = exports.CellClickIcon = exports.BooleanIcon = exports.BoldIcon = exports.ArrowSendIcon = exports.AppearanceIcon = exports.AppGalleryIcon = exports.AlignTopIcon = exports.AlignCenterIcon = exports.AlignBottomIcon = exports.AddNodeIcon = void 0;
27
- exports.TextIcon = exports.TextFormatIcon = exports.SquareIcon = exports.SquareDashIcon = exports.SingleValueIcon = exports.ShrinkIcon = exports.SelectIcon = exports.RotateIcon = exports.RhombusIcon = exports.ResizeCornerIcon = exports.RelationshipClickIcon = exports.RelationshipAddIcon = exports.QuoteIcon = exports.QueryIcon = exports.QueryStreamIcon = exports.PresentationIcon = exports.PlanViewIcon = exports.PinIcon = exports.PanelRightIcon = exports.PanelRightExpandedIcon = exports.PanelRightCollapsedIcon = exports.PanelLeftIcon = exports.PanelLeftExpandedIcon = exports.PanelLeftExpandIcon = exports.PanelLeftCollapsedIcon = exports.PanelLeftCollapseIcon = exports.PanelBottomIcon = exports.OpenQueryTabIcon = exports.NomLevelIcon = exports.NodeClickIcon = exports.NodeAddIcon = exports.Neo4JLogoWhiteIcon = exports.Neo4JLogoColorIcon = exports.Neo4JLogoBlackIcon = exports.Neo4JIconWhiteIcon = exports.Neo4JIconColorIcon = exports.Neo4JIconBlackIcon = exports.Neo4JAiNeutralIcon = exports.MenuArrowRightIcon = exports.MenuArrowLeftIcon = exports.MemoryCardIcon = exports.MarkdownIcon = exports.MagnifyingGlassResetIcon = exports.LocationTargetIcon = exports.ListNumberIcon = exports.ListCheckIcon = exports.LayoutThreeSectionsIcon = exports.LayoutRightIcon = exports.LayoutLeftIcon = exports.LayoutBottomIcon = void 0;
28
- exports.VisualizeBloomIcon = exports.VerticalBarIcon = exports.UserShieldIcon = exports.UnderlineIcon = exports.TriangleIcon = exports.ThreePanelIcon = void 0;
26
+ exports.ItalicIcon = exports.HorizontalBarIcon = exports.HierarchyTwoIcon = exports.HierarchyOneIcon = exports.HeartbeatIcon = exports.HeadsetIcon = exports.HandIcon = exports.GraphCrossIcon = exports.GraphBuilderIcon = exports.GlobePinIcon = exports.GithubIcon = exports.FunnelNavigateIcon = exports.FontSizeIcon = exports.FolderBookmarkIcon = exports.FloppyDiskIcon = exports.FitToScreenIcon = exports.ExternalLinkIcon = exports.ExploreIcon = exports.ExpandIcon = exports.ExpandLayersIcon = exports.DragIcon = exports.DocumentRefreshIcon = exports.DividerSquareDashIcon = exports.DesktopSaveIcon = exports.DeploymentsIcon = exports.DatabaseSignalIcon = exports.DatabaseRoleIcon = exports.DatabasePlusIcon = exports.DatabasePlugIcon = exports.DatabaseCrossIcon = exports.DataScienceIcon = exports.DataGridCrossIcon = exports.CurlyBracketsIcon = exports.ConfigureIcon = exports.CollapseLayersIcon = exports.CloudCrossIcon = exports.CloudCheckIcon = exports.CircleIcon = exports.ChipIcon = exports.CellDoubleClickIcon = exports.CellClickIcon = exports.BooleanIcon = exports.BoldIcon = exports.ArrowSendIcon = exports.AppearanceIcon = exports.AppGalleryIcon = exports.AlignTopIcon = exports.AlignCenterIcon = exports.AlignBottomIcon = exports.AddNodeIcon = void 0;
27
+ exports.TextFormatIcon = exports.SquareIcon = exports.SquareDashIcon = exports.SingleValueIcon = exports.ShrinkIcon = exports.SelectIcon = exports.RotateIcon = exports.RhombusIcon = exports.ResizeCornerIcon = exports.RelationshipClickIcon = exports.RelationshipAddIcon = exports.QuoteIcon = exports.QueryIcon = exports.QueryStreamIcon = exports.PresentationIcon = exports.PlanViewIcon = exports.PinIcon = exports.PanelRightIcon = exports.PanelRightExpandedIcon = exports.PanelRightCollapsedIcon = exports.PanelLeftIcon = exports.PanelLeftExpandedIcon = exports.PanelLeftExpandIcon = exports.PanelLeftCollapsedIcon = exports.PanelLeftCollapseIcon = exports.PanelBottomIcon = exports.OpenQueryTabIcon = exports.NomLevelIcon = exports.NodeClickIcon = exports.NodeAddIcon = exports.Neo4JLogoWhiteIcon = exports.Neo4JLogoColorIcon = exports.Neo4JLogoBlackIcon = exports.Neo4JIconWhiteIcon = exports.Neo4JIconColorIcon = exports.Neo4JIconBlackIcon = exports.Neo4JAiNeutralIcon = exports.MenuArrowRightIcon = exports.MenuArrowLeftIcon = exports.MemoryCardIcon = exports.MarkdownIcon = exports.MagnifyingGlassResetIcon = exports.LocationTargetIcon = exports.ListNumberIcon = exports.ListCheckIcon = exports.LayoutThreeSectionsIcon = exports.LayoutRightIcon = exports.LayoutLeftIcon = exports.LayoutBottomIcon = exports.LassoIcon = void 0;
28
+ exports.VisualizeBloomIcon = exports.VerticalBarIcon = exports.UserShieldIcon = exports.UnderlineIcon = exports.TriangleIcon = exports.ThreePanelIcon = exports.TextIcon = void 0;
29
29
  // THIS FILE IS GENERATED BY BUILD TOOL
30
30
  // DO NOT EDIT IT MANUAL
31
31
  var AddNode_1 = require("./AddNode");
@@ -110,6 +110,8 @@ var Github_1 = require("./Github");
110
110
  Object.defineProperty(exports, "GithubIcon", { enumerable: true, get: function () { return __importDefault(Github_1).default; } });
111
111
  var GlobePin_1 = require("./GlobePin");
112
112
  Object.defineProperty(exports, "GlobePinIcon", { enumerable: true, get: function () { return __importDefault(GlobePin_1).default; } });
113
+ var GraphBuilder_1 = require("./GraphBuilder");
114
+ Object.defineProperty(exports, "GraphBuilderIcon", { enumerable: true, get: function () { return __importDefault(GraphBuilder_1).default; } });
113
115
  var GraphCross_1 = require("./GraphCross");
114
116
  Object.defineProperty(exports, "GraphCrossIcon", { enumerable: true, get: function () { return __importDefault(GraphCross_1).default; } });
115
117
  var Hand_1 = require("./Hand");