@neo4j-ndl/react 4.13.2 → 4.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/ai/response/Response.js +2 -2
- package/lib/cjs/ai/response/Response.js.map +1 -1
- package/lib/cjs/code-block/CodeBlock.js +68 -86
- package/lib/cjs/code-block/CodeBlock.js.map +1 -1
- package/lib/cjs/code-block/code-themes.js +23 -0
- package/lib/cjs/code-block/code-themes.js.map +1 -0
- package/lib/cjs/code-block/hooks/use-code-language.js +49 -0
- package/lib/cjs/code-block/hooks/use-code-language.js.map +1 -0
- package/lib/cjs/code-block/hooks/use-code-theme.js +62 -0
- package/lib/cjs/code-block/hooks/use-code-theme.js.map +1 -0
- package/lib/cjs/code-block/hooks/use-expandable.js +78 -0
- package/lib/cjs/code-block/hooks/use-expandable.js.map +1 -0
- package/lib/cjs/icons/generated/custom/GraphBuilder.js +30 -0
- package/lib/cjs/icons/generated/custom/GraphBuilder.js.map +1 -0
- package/lib/cjs/icons/generated/custom/index.js +5 -3
- package/lib/cjs/icons/generated/custom/index.js.map +1 -1
- package/lib/esm/ai/response/Response.js +2 -2
- package/lib/esm/ai/response/Response.js.map +1 -1
- package/lib/esm/code-block/CodeBlock.js +62 -80
- package/lib/esm/code-block/CodeBlock.js.map +1 -1
- package/lib/esm/code-block/code-themes.js +22 -0
- package/lib/esm/code-block/code-themes.js.map +1 -0
- package/lib/esm/code-block/hooks/use-code-language.js +45 -0
- package/lib/esm/code-block/hooks/use-code-language.js.map +1 -0
- package/lib/esm/code-block/hooks/use-code-theme.js +55 -0
- package/lib/esm/code-block/hooks/use-code-theme.js.map +1 -0
- package/lib/esm/code-block/hooks/use-expandable.js +74 -0
- package/lib/esm/code-block/hooks/use-expandable.js.map +1 -0
- package/lib/esm/icons/generated/custom/GraphBuilder.js +28 -0
- package/lib/esm/icons/generated/custom/GraphBuilder.js.map +1 -0
- package/lib/esm/icons/generated/custom/index.js +1 -0
- package/lib/esm/icons/generated/custom/index.js.map +1 -1
- package/lib/types/ai/response/Response.d.ts.map +1 -1
- package/lib/types/code-block/CodeBlock.d.ts +3 -1
- package/lib/types/code-block/CodeBlock.d.ts.map +1 -1
- package/lib/types/code-block/code-themes.d.ts +22 -0
- package/lib/types/code-block/code-themes.d.ts.map +1 -0
- package/lib/types/code-block/hooks/use-code-language.d.ts +27 -0
- package/lib/types/code-block/hooks/use-code-language.d.ts.map +1 -0
- package/lib/types/code-block/hooks/use-code-theme.d.ts +29 -0
- package/lib/types/code-block/hooks/use-code-theme.d.ts.map +1 -0
- package/lib/types/code-block/hooks/use-expandable.d.ts +34 -0
- package/lib/types/code-block/hooks/use-expandable.d.ts.map +1 -0
- package/lib/types/icons/generated/custom/GraphBuilder.d.ts +29 -0
- package/lib/types/icons/generated/custom/GraphBuilder.d.ts.map +1 -0
- package/lib/types/icons/generated/custom/index.d.ts +1 -0
- package/lib/types/icons/generated/custom/index.d.ts.map +1 -1
- package/package.json +5 -5
- package/lib/cjs/_common/CodeBlockWrapper.js +0 -105
- package/lib/cjs/_common/CodeBlockWrapper.js.map +0 -1
- package/lib/esm/_common/CodeBlockWrapper.js +0 -98
- package/lib/esm/_common/CodeBlockWrapper.js.map +0 -1
- package/lib/types/_common/CodeBlockWrapper.d.ts +0 -40
- package/lib/types/_common/CodeBlockWrapper.d.ts.map +0 -1
|
@@ -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.
|
|
27
|
-
exports.
|
|
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");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/icons/generated/custom/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;;;AAEH,uCAAuC;AACvC,wBAAwB;AACxB,qCAAmD;AAA1C,uHAAA,OAAO,OAAe;AAC/B,6CAA2D;AAAlD,+HAAA,OAAO,OAAmB;AACnC,6CAA2D;AAAlD,+HAAA,OAAO,OAAmB;AACnC,uCAAqD;AAA5C,yHAAA,OAAO,OAAgB;AAChC,2CAAyD;AAAhD,6HAAA,OAAO,OAAkB;AAClC,2CAAyD;AAAhD,6HAAA,OAAO,OAAkB;AAClC,yCAAuD;AAA9C,2HAAA,OAAO,OAAiB;AACjC,+BAA6C;AAApC,iHAAA,OAAO,OAAY;AAC5B,qCAAmD;AAA1C,uHAAA,OAAO,OAAe;AAC/B,yCAAuD;AAA9C,2HAAA,OAAO,OAAiB;AACjC,qDAAmE;AAA1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6HAAA,OAAO,OAAkB;AAClC,+BAA6C;AAApC,iHAAA,OAAO,OAAY;AAC5B,2CAAyD;AAAhD,6HAAA,OAAO,OAAkB;AAClC,uCAAqD;AAA5C,yHAAA,OAAO,OAAgB;AAChC,yCAAuD;AAA9C,2HAAA,OAAO,OAAiB;AACjC,2CAAyD;AAAhD,6HAAA,OAAO,OAAkB;AAClC,6CAA2D;AAAlD,+HAAA,OAAO,OAAmB;AACnC,mDAAiE;AAAxD,qIAAA,OAAO,OAAsB","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\nexport { default as AddNodeIcon } from './AddNode';\nexport { default as AlignBottomIcon } from './AlignBottom';\nexport { default as AlignCenterIcon } from './AlignCenter';\nexport { default as AlignTopIcon } from './AlignTop';\nexport { default as AppGalleryIcon } from './AppGallery';\nexport { default as AppearanceIcon } from './Appearance';\nexport { default as ArrowSendIcon } from './ArrowSend';\nexport { default as BoldIcon } from './Bold';\nexport { default as BooleanIcon } from './Boolean';\nexport { default as CellClickIcon } from './CellClick';\nexport { default as CellDoubleClickIcon } from './CellDoubleClick';\nexport { default as ChipIcon } from './Chip';\nexport { default as CircleIcon } from './Circle';\nexport { default as CloudCheckIcon } from './CloudCheck';\nexport { default as CloudCrossIcon } from './CloudCross';\nexport { default as CollapseLayersIcon } from './CollapseLayers';\nexport { default as ConfigureIcon } from './Configure';\nexport { default as CurlyBracketsIcon } from './CurlyBrackets';\nexport { default as DataGridCrossIcon } from './DataGridCross';\nexport { default as DataScienceIcon } from './DataScience';\nexport { default as DatabaseCrossIcon } from './DatabaseCross';\nexport { default as DatabasePlugIcon } from './DatabasePlug';\nexport { default as DatabasePlusIcon } from './DatabasePlus';\nexport { default as DatabaseRoleIcon } from './DatabaseRole';\nexport { default as DatabaseSignalIcon } from './DatabaseSignal';\nexport { default as DeploymentsIcon } from './Deployments';\nexport { default as DesktopSaveIcon } from './DesktopSave';\nexport { default as DividerSquareDashIcon } from './DividerSquareDash';\nexport { default as DocumentRefreshIcon } from './DocumentRefresh';\nexport { default as DragIcon } from './Drag';\nexport { default as ExpandLayersIcon } from './ExpandLayers';\nexport { default as ExpandIcon } from './Expand';\nexport { default as ExploreIcon } from './Explore';\nexport { default as ExternalLinkIcon } from './ExternalLink';\nexport { default as FitToScreenIcon } from './FitToScreen';\nexport { default as FloppyDiskIcon } from './FloppyDisk';\nexport { default as FolderBookmarkIcon } from './FolderBookmark';\nexport { default as FontSizeIcon } from './FontSize';\nexport { default as FunnelNavigateIcon } from './FunnelNavigate';\nexport { default as GithubIcon } from './Github';\nexport { default as GlobePinIcon } from './GlobePin';\nexport { default as GraphCrossIcon } from './GraphCross';\nexport { default as HandIcon } from './Hand';\nexport { default as HeadsetIcon } from './Headset';\nexport { default as HeartbeatIcon } from './Heartbeat';\nexport { default as HierarchyOneIcon } from './HierarchyOne';\nexport { default as HierarchyTwoIcon } from './HierarchyTwo';\nexport { default as HorizontalBarIcon } from './HorizontalBar';\nexport { default as ItalicIcon } from './Italic';\nexport { default as LassoIcon } from './Lasso';\nexport { default as LayoutBottomIcon } from './LayoutBottom';\nexport { default as LayoutLeftIcon } from './LayoutLeft';\nexport { default as LayoutRightIcon } from './LayoutRight';\nexport { default as LayoutThreeSectionsIcon } from './LayoutThreeSections';\nexport { default as ListCheckIcon } from './ListCheck';\nexport { default as ListNumberIcon } from './ListNumber';\nexport { default as LocationTargetIcon } from './LocationTarget';\nexport { default as MagnifyingGlassResetIcon } from './MagnifyingGlassReset';\nexport { default as MarkdownIcon } from './Markdown';\nexport { default as MemoryCardIcon } from './MemoryCard';\nexport { default as MenuArrowLeftIcon } from './MenuArrowLeft';\nexport { default as MenuArrowRightIcon } from './MenuArrowRight';\nexport { default as Neo4JAiNeutralIcon } from './Neo4JAiNeutral';\nexport { default as Neo4JIconBlackIcon } from './Neo4JIconBlack';\nexport { default as Neo4JIconColorIcon } from './Neo4JIconColor';\nexport { default as Neo4JIconWhiteIcon } from './Neo4JIconWhite';\nexport { default as Neo4JLogoBlackIcon } from './Neo4JLogoBlack';\nexport { default as Neo4JLogoColorIcon } from './Neo4JLogoColor';\nexport { default as Neo4JLogoWhiteIcon } from './Neo4JLogoWhite';\nexport { default as NodeAddIcon } from './NodeAdd';\nexport { default as NodeClickIcon } from './NodeClick';\nexport { default as NomLevelIcon } from './NomLevel';\nexport { default as OpenQueryTabIcon } from './OpenQueryTab';\nexport { default as PanelBottomIcon } from './PanelBottom';\nexport { default as PanelLeftCollapseIcon } from './PanelLeftCollapse';\nexport { default as PanelLeftCollapsedIcon } from './PanelLeftCollapsed';\nexport { default as PanelLeftExpandIcon } from './PanelLeftExpand';\nexport { default as PanelLeftExpandedIcon } from './PanelLeftExpanded';\nexport { default as PanelLeftIcon } from './PanelLeft';\nexport { default as PanelRightCollapsedIcon } from './PanelRightCollapsed';\nexport { default as PanelRightExpandedIcon } from './PanelRightExpanded';\nexport { default as PanelRightIcon } from './PanelRight';\nexport { default as PinIcon } from './Pin';\nexport { default as PlanViewIcon } from './PlanView';\nexport { default as PresentationIcon } from './Presentation';\nexport { default as QueryStreamIcon } from './QueryStream';\nexport { default as QueryIcon } from './Query';\nexport { default as QuoteIcon } from './Quote';\nexport { default as RelationshipAddIcon } from './RelationshipAdd';\nexport { default as RelationshipClickIcon } from './RelationshipClick';\nexport { default as ResizeCornerIcon } from './ResizeCorner';\nexport { default as RhombusIcon } from './Rhombus';\nexport { default as RotateIcon } from './Rotate';\nexport { default as SelectIcon } from './Select';\nexport { default as ShrinkIcon } from './Shrink';\nexport { default as SingleValueIcon } from './SingleValue';\nexport { default as SquareDashIcon } from './SquareDash';\nexport { default as SquareIcon } from './Square';\nexport { default as TextFormatIcon } from './TextFormat';\nexport { default as TextIcon } from './Text';\nexport { default as ThreePanelIcon } from './ThreePanel';\nexport { default as TriangleIcon } from './Triangle';\nexport { default as UnderlineIcon } from './Underline';\nexport { default as UserShieldIcon } from './UserShield';\nexport { default as VerticalBarIcon } from './VerticalBar';\nexport { default as VisualizeBloomIcon } from './VisualizeBloom';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/icons/generated/custom/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;;;AAEH,uCAAuC;AACvC,wBAAwB;AACxB,qCAAmD;AAA1C,uHAAA,OAAO,OAAe;AAC/B,6CAA2D;AAAlD,+HAAA,OAAO,OAAmB;AACnC,6CAA2D;AAAlD,+HAAA,OAAO,OAAmB;AACnC,uCAAqD;AAA5C,yHAAA,OAAO,OAAgB;AAChC,2CAAyD;AAAhD,6HAAA,OAAO,OAAkB;AAClC,2CAAyD;AAAhD,6HAAA,OAAO,OAAkB;AAClC,yCAAuD;AAA9C,2HAAA,OAAO,OAAiB;AACjC,+BAA6C;AAApC,iHAAA,OAAO,OAAY;AAC5B,qCAAmD;AAA1C,uHAAA,OAAO,OAAe;AAC/B,yCAAuD;AAA9C,2HAAA,OAAO,OAAiB;AACjC,qDAAmE;AAA1D,uIAAA,OAAO,OAAuB;AACvC,+BAA6C;AAApC,iHAAA,OAAO,OAAY;AAC5B,mCAAiD;AAAxC,qHAAA,OAAO,OAAc;AAC9B,2CAAyD;AAAhD,6HAAA,OAAO,OAAkB;AAClC,2CAAyD;AAAhD,6HAAA,OAAO,OAAkB;AAClC,mDAAiE;AAAxD,qIAAA,OAAO,OAAsB;AAC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2CAAyD;AAAhD,6HAAA,OAAO,OAAkB;AAClC,6CAA2D;AAAlD,+HAAA,OAAO,OAAmB;AACnC,mDAAiE;AAAxD,qIAAA,OAAO,OAAsB","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\nexport { default as AddNodeIcon } from './AddNode';\nexport { default as AlignBottomIcon } from './AlignBottom';\nexport { default as AlignCenterIcon } from './AlignCenter';\nexport { default as AlignTopIcon } from './AlignTop';\nexport { default as AppGalleryIcon } from './AppGallery';\nexport { default as AppearanceIcon } from './Appearance';\nexport { default as ArrowSendIcon } from './ArrowSend';\nexport { default as BoldIcon } from './Bold';\nexport { default as BooleanIcon } from './Boolean';\nexport { default as CellClickIcon } from './CellClick';\nexport { default as CellDoubleClickIcon } from './CellDoubleClick';\nexport { default as ChipIcon } from './Chip';\nexport { default as CircleIcon } from './Circle';\nexport { default as CloudCheckIcon } from './CloudCheck';\nexport { default as CloudCrossIcon } from './CloudCross';\nexport { default as CollapseLayersIcon } from './CollapseLayers';\nexport { default as ConfigureIcon } from './Configure';\nexport { default as CurlyBracketsIcon } from './CurlyBrackets';\nexport { default as DataGridCrossIcon } from './DataGridCross';\nexport { default as DataScienceIcon } from './DataScience';\nexport { default as DatabaseCrossIcon } from './DatabaseCross';\nexport { default as DatabasePlugIcon } from './DatabasePlug';\nexport { default as DatabasePlusIcon } from './DatabasePlus';\nexport { default as DatabaseRoleIcon } from './DatabaseRole';\nexport { default as DatabaseSignalIcon } from './DatabaseSignal';\nexport { default as DeploymentsIcon } from './Deployments';\nexport { default as DesktopSaveIcon } from './DesktopSave';\nexport { default as DividerSquareDashIcon } from './DividerSquareDash';\nexport { default as DocumentRefreshIcon } from './DocumentRefresh';\nexport { default as DragIcon } from './Drag';\nexport { default as ExpandLayersIcon } from './ExpandLayers';\nexport { default as ExpandIcon } from './Expand';\nexport { default as ExploreIcon } from './Explore';\nexport { default as ExternalLinkIcon } from './ExternalLink';\nexport { default as FitToScreenIcon } from './FitToScreen';\nexport { default as FloppyDiskIcon } from './FloppyDisk';\nexport { default as FolderBookmarkIcon } from './FolderBookmark';\nexport { default as FontSizeIcon } from './FontSize';\nexport { default as FunnelNavigateIcon } from './FunnelNavigate';\nexport { default as GithubIcon } from './Github';\nexport { default as GlobePinIcon } from './GlobePin';\nexport { default as GraphBuilderIcon } from './GraphBuilder';\nexport { default as GraphCrossIcon } from './GraphCross';\nexport { default as HandIcon } from './Hand';\nexport { default as HeadsetIcon } from './Headset';\nexport { default as HeartbeatIcon } from './Heartbeat';\nexport { default as HierarchyOneIcon } from './HierarchyOne';\nexport { default as HierarchyTwoIcon } from './HierarchyTwo';\nexport { default as HorizontalBarIcon } from './HorizontalBar';\nexport { default as ItalicIcon } from './Italic';\nexport { default as LassoIcon } from './Lasso';\nexport { default as LayoutBottomIcon } from './LayoutBottom';\nexport { default as LayoutLeftIcon } from './LayoutLeft';\nexport { default as LayoutRightIcon } from './LayoutRight';\nexport { default as LayoutThreeSectionsIcon } from './LayoutThreeSections';\nexport { default as ListCheckIcon } from './ListCheck';\nexport { default as ListNumberIcon } from './ListNumber';\nexport { default as LocationTargetIcon } from './LocationTarget';\nexport { default as MagnifyingGlassResetIcon } from './MagnifyingGlassReset';\nexport { default as MarkdownIcon } from './Markdown';\nexport { default as MemoryCardIcon } from './MemoryCard';\nexport { default as MenuArrowLeftIcon } from './MenuArrowLeft';\nexport { default as MenuArrowRightIcon } from './MenuArrowRight';\nexport { default as Neo4JAiNeutralIcon } from './Neo4JAiNeutral';\nexport { default as Neo4JIconBlackIcon } from './Neo4JIconBlack';\nexport { default as Neo4JIconColorIcon } from './Neo4JIconColor';\nexport { default as Neo4JIconWhiteIcon } from './Neo4JIconWhite';\nexport { default as Neo4JLogoBlackIcon } from './Neo4JLogoBlack';\nexport { default as Neo4JLogoColorIcon } from './Neo4JLogoColor';\nexport { default as Neo4JLogoWhiteIcon } from './Neo4JLogoWhite';\nexport { default as NodeAddIcon } from './NodeAdd';\nexport { default as NodeClickIcon } from './NodeClick';\nexport { default as NomLevelIcon } from './NomLevel';\nexport { default as OpenQueryTabIcon } from './OpenQueryTab';\nexport { default as PanelBottomIcon } from './PanelBottom';\nexport { default as PanelLeftCollapseIcon } from './PanelLeftCollapse';\nexport { default as PanelLeftCollapsedIcon } from './PanelLeftCollapsed';\nexport { default as PanelLeftExpandIcon } from './PanelLeftExpand';\nexport { default as PanelLeftExpandedIcon } from './PanelLeftExpanded';\nexport { default as PanelLeftIcon } from './PanelLeft';\nexport { default as PanelRightCollapsedIcon } from './PanelRightCollapsed';\nexport { default as PanelRightExpandedIcon } from './PanelRightExpanded';\nexport { default as PanelRightIcon } from './PanelRight';\nexport { default as PinIcon } from './Pin';\nexport { default as PlanViewIcon } from './PlanView';\nexport { default as PresentationIcon } from './Presentation';\nexport { default as QueryStreamIcon } from './QueryStream';\nexport { default as QueryIcon } from './Query';\nexport { default as QuoteIcon } from './Quote';\nexport { default as RelationshipAddIcon } from './RelationshipAdd';\nexport { default as RelationshipClickIcon } from './RelationshipClick';\nexport { default as ResizeCornerIcon } from './ResizeCorner';\nexport { default as RhombusIcon } from './Rhombus';\nexport { default as RotateIcon } from './Rotate';\nexport { default as SelectIcon } from './Select';\nexport { default as ShrinkIcon } from './Shrink';\nexport { default as SingleValueIcon } from './SingleValue';\nexport { default as SquareDashIcon } from './SquareDash';\nexport { default as SquareIcon } from './Square';\nexport { default as TextFormatIcon } from './TextFormat';\nexport { default as TextIcon } from './Text';\nexport { default as ThreePanelIcon } from './ThreePanel';\nexport { default as TriangleIcon } from './Triangle';\nexport { default as UnderlineIcon } from './Underline';\nexport { default as UserShieldIcon } from './UserShield';\nexport { default as VerticalBarIcon } from './VerticalBar';\nexport { default as VisualizeBloomIcon } from './VisualizeBloom';\n"]}
|
|
@@ -151,7 +151,7 @@ const Response = memo((_a) => {
|
|
|
151
151
|
},
|
|
152
152
|
code: (_a) => {
|
|
153
153
|
var _b, _c, _d, _e;
|
|
154
|
-
var { node, className,
|
|
154
|
+
var { node, className, children: codeChildren } = _a, props = __rest(_a, ["node", "className", "children"]);
|
|
155
155
|
const isInline = ((_b = node === null || node === void 0 ? void 0 : node.position) === null || _b === void 0 ? void 0 : _b.start.line) === ((_c = node === null || node === void 0 ? void 0 : node.position) === null || _c === void 0 ? void 0 : _c.end.line);
|
|
156
156
|
const nodeClassNamesRaw = (_d = node === null || node === void 0 ? void 0 : node.properties) === null || _d === void 0 ? void 0 : _d.className;
|
|
157
157
|
const nodeClassNamesArray = [];
|
|
@@ -181,7 +181,7 @@ const Response = memo((_a) => {
|
|
|
181
181
|
const hasUnclosedFence = fenceCount % 2 !== 0;
|
|
182
182
|
// Show loading state when there's an unclosed fence (code block is streaming)
|
|
183
183
|
const isCodeBlockLoading = hasUnclosedFence;
|
|
184
|
-
return (_jsx(CodePreview, { code: codeChildren, isLoading: isCodeBlockLoading, language: language, className: className, htmlAttributes: Object.assign({}, props) }, key));
|
|
184
|
+
return (_jsx(CodePreview, { code: codeChildren, isLoading: isCodeBlockLoading, language: language, className: className, htmlAttributes: Object.assign({}, props) }, props.key));
|
|
185
185
|
}
|
|
186
186
|
else {
|
|
187
187
|
return _jsx("code", { className: className, children: codeChildren });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Response.js","sourceRoot":"","sources":["../../../../src/ai/response/Response.tsx"],"names":[],"mappings":";;;;;;;;;;;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AE,CAAC,EAAuC,EAAE,EAAE;gBAA3C,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,OAAY,EAAP,KAAK,cAArC,iCAAuC,CAAF;YAAO,OAAA,CAC9C,KAAC,UAAU,kBACT,EAAE,EAAC,GAAG,EACN,OAAO,EAAC,aAAa,EACrB,SAAS,EAAE,UAAU,CAAC,SAAS,CAAC,IAC5B,KAAK,cAER,QAAQ,IACE,CACd,CAAA;SAAA;QACD,0CAA0C;QAC1C,GAAG,EAAE,CAAC,EAAuC,EAAE,EAAE;gBAA3C,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,OAAY,EAAP,KAAK,cAArC,mCAAuC,CAAF;YAAO,OAAA,CAChD,4BACE,SAAS,EAAE,UAAU,CAAC,SAAS,CAAC,EAChC,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,IACJ,KAAK,EACT,CACH,CAAA;SAAA;KACF,CAAC,EACF,EAAE,CACH,CAAC;IAEJ,OAAO,CACL,4BACE,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,UAAU,CAAC,iBAAiB,EAAE,SAAS,CAAC,IAC/C,SAAS,EACT,cAAc,cAElB,KAAC,UAAU,IACT,WAAW,EAAE,WAAW,EACxB,uBAAuB,EAAE,WAAW,EACpC,UAAU,EAAE,UAAU,YAErB,QAAQ,GACE,IACT,CACP,CAAC;AACJ,CAAC,EACD,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,QAAQ,KAAK,SAAS,CAAC,QAAQ,CACpE,CAAC;AAEF,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC;AAElC,OAAO,EAAE,QAAQ,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\nimport { Code, TextLink, Typography } from '@neo4j-ndl/react';\nimport classNames from 'classnames';\nimport { memo, useMemo, useRef } from 'react';\nimport { Streamdown } from 'streamdown';\n\nimport { type CommonProps } from '../../_common/types';\nimport { type LanguageProp, Languages } from '../../code-block/code-languages';\nimport { CodePreview } from '../code-preview';\n\ntype ResponseProps = {\n /** The response from the AI */\n children: string;\n /** Whether the response is animating */\n isAnimating?: React.ComponentProps<typeof Streamdown>['isAnimating'];\n};\n\n/**\n * The component is used to display the response from an LLM.\n * It handles markdown rendering and streaming.\n *\n * @alpha - Changes to this component may be breaking.\n */\nconst Response = memo(\n ({\n className,\n children,\n isAnimating = false,\n ref,\n style,\n htmlAttributes,\n ...restProps\n }: CommonProps<'div', ResponseProps>) => {\n // Use a ref to store the current markdown content so we can check for unclosed fences\n // without recreating the components object on every render\n const childrenRef = useRef(children);\n childrenRef.current = children;\n\n const components: React.ComponentProps<typeof Streamdown>['components'] =\n useMemo(\n () => ({\n // oxlint-disable-next-line no-unused-vars\n ol: ({ node, children, className, ...props }) => (\n <ol className={className} {...props}>\n {children}\n </ol>\n ),\n // oxlint-disable-next-line no-unused-vars\n ul: ({ node, children, className, ...props }) => (\n <ul className={classNames(className)} {...props}>\n {children}\n </ul>\n ),\n // oxlint-disable-next-line no-unused-vars\n li: ({ node, children, className, ...props }) => (\n <li className={className} {...props}>\n {children}\n </li>\n ),\n // oxlint-disable-next-line no-unused-vars\n hr: ({ node, className, ...props }) => (\n <hr className={classNames(className)} {...props} />\n ),\n // oxlint-disable-next-line no-unused-vars\n strong: ({ node, children, className, style, ...props }) => (\n <Typography\n as=\"strong\"\n variant=\"body-medium\"\n className={className}\n style={{ ...style, fontWeight: 'bold' }}\n {...props}\n >\n {children}\n </Typography>\n ),\n // oxlint-disable-next-line no-unused-vars\n em: ({ node, children, className, style, ...props }) => (\n <Typography\n as=\"em\"\n variant=\"body-medium\"\n className={className}\n style={{ ...style, fontStyle: 'italic' }}\n {...props}\n >\n {children}\n </Typography>\n ),\n // oxlint-disable-next-line no-unused-vars\n a: ({ node, children, className, href, ...props }) => (\n <TextLink\n type=\"internal-underline\"\n className={className}\n href={href}\n htmlAttributes={props}\n >\n {children}\n </TextLink>\n ),\n // oxlint-disable-next-line no-unused-vars\n h1: ({ node, children, className, ...props }) => (\n <Typography\n as=\"h1\"\n variant=\"display\"\n className={className}\n htmlAttributes={{ ...props }}\n >\n {children}\n </Typography>\n ),\n // oxlint-disable-next-line no-unused-vars\n h2: ({ node, children, className, ...props }) => (\n <Typography\n as=\"h2\"\n variant=\"title-1\"\n className={className}\n htmlAttributes={{ ...props }}\n >\n {children}\n </Typography>\n ),\n // oxlint-disable-next-line no-unused-vars\n h3: ({ node, children, className, ...props }) => (\n <Typography\n as=\"h3\"\n variant=\"title-2\"\n className={className}\n htmlAttributes={{ ...props }}\n >\n {children}\n </Typography>\n ),\n // oxlint-disable-next-line no-unused-vars\n h4: ({ node, children, className, ...props }) => (\n <Typography\n as=\"h4\"\n variant=\"title-3\"\n className={className}\n htmlAttributes={{ ...props }}\n >\n {children}\n </Typography>\n ),\n // oxlint-disable-next-line no-unused-vars\n h5: ({ node, children, className, ...props }) => (\n <Typography\n as=\"h5\"\n variant=\"title-4\"\n className={className}\n htmlAttributes={{ ...props }}\n >\n {children}\n </Typography>\n ),\n // oxlint-disable-next-line no-unused-vars\n h6: ({ node, children, className, ...props }) => (\n <Typography\n as=\"h6\"\n variant=\"label\"\n className={className}\n htmlAttributes={{ ...props }}\n >\n {children}\n </Typography>\n ),\n // oxlint-disable-next-line no-unused-vars\n table: ({ node, children, className, ...props }) => (\n <div className=\"ndl-ai-response-table-wrapper\">\n <table className={className} {...props}>\n {children}\n </table>\n </div>\n ),\n // oxlint-disable-next-line no-unused-vars\n thead: ({ node, children, className, ...props }) => (\n <thead className={className} {...props}>\n {children}\n </thead>\n ),\n // oxlint-disable-next-line no-unused-vars\n tbody: ({ node, children, className, ...props }) => (\n <tbody className={className} {...props}>\n {children}\n </tbody>\n ),\n // oxlint-disable-next-line no-unused-vars\n tr: ({ node, children, className, ...props }) => (\n <tr className={className} {...props}>\n {children}\n </tr>\n ),\n // oxlint-disable-next-line no-unused-vars\n th: ({ node, children, className, ...props }) => (\n <th className={className} {...props}>\n {children}\n </th>\n ),\n // oxlint-disable-next-line no-unused-vars\n td: ({ node, children, className, ...props }) => (\n <td className={className} {...props}>\n {children}\n </td>\n ),\n // oxlint-disable-next-line no-unused-vars\n blockquote: ({ node, children, className, ...props }) => (\n <blockquote className={classNames(className)} {...props}>\n {children}\n </blockquote>\n ),\n code: ({\n node,\n className,\n key,\n children: codeChildren,\n ...props\n }) => {\n const isInline =\n node?.position?.start.line === node?.position?.end.line;\n\n const nodeClassNamesRaw = node?.properties?.className;\n const nodeClassNamesArray: string[] = [];\n\n if (typeof nodeClassNamesRaw === 'string') {\n nodeClassNamesArray.push.apply(\n nodeClassNamesArray,\n nodeClassNamesRaw.split(' '),\n );\n } else if (Array.isArray(nodeClassNamesRaw)) {\n nodeClassNamesArray.push.apply(\n nodeClassNamesArray,\n nodeClassNamesRaw as string[],\n );\n }\n\n let language: LanguageProp | 'text' = 'text';\n const rawLanguage = nodeClassNamesArray.find((string: string) =>\n string.startsWith('language-'),\n );\n if (rawLanguage !== undefined) {\n language =\n (rawLanguage.replace('language-', '') as LanguageProp) ??\n 'text';\n }\n language = (Languages as readonly string[]).includes(language)\n ? (language as LanguageProp)\n : 'text';\n if (isInline) {\n return (\n <Code\n isRunnable={false}\n className={className}\n htmlAttributes={props}\n >\n {codeChildren}\n </Code>\n );\n }\n if (typeof codeChildren === 'string') {\n // Check if code fences are balanced in the markdown\n // If there are an odd number of fences, it means there's an unclosed code block\n const fenceMatches = childrenRef.current.match(/```/g);\n const fenceCount = fenceMatches ? fenceMatches.length : 0;\n const hasUnclosedFence = fenceCount % 2 !== 0;\n\n // Show loading state when there's an unclosed fence (code block is streaming)\n const isCodeBlockLoading = hasUnclosedFence;\n return (\n <CodePreview\n key={key}\n code={codeChildren}\n isLoading={isCodeBlockLoading}\n language={language}\n className={className}\n htmlAttributes={{\n ...props,\n }}\n />\n );\n } else {\n return <code className={className}>{codeChildren}</code>;\n }\n },\n // oxlint-disable-next-line no-unused-vars\n pre: ({ node, className, children, ...props }) => {\n return (\n <pre className={className} {...props}>\n {children}\n </pre>\n );\n },\n // oxlint-disable-next-line no-unused-vars\n p: ({ node, children, className, ...props }) => (\n <Typography\n as=\"p\"\n variant=\"body-medium\"\n className={classNames(className)}\n {...props}\n >\n {children}\n </Typography>\n ),\n // oxlint-disable-next-line no-unused-vars\n img: ({ node, className, src, alt, ...props }) => (\n <img\n className={classNames(className)}\n src={src}\n alt={alt}\n {...props}\n />\n ),\n }),\n [],\n );\n\n return (\n <div\n ref={ref}\n style={style}\n className={classNames('ndl-ai-response', className)}\n {...restProps}\n {...htmlAttributes}\n >\n <Streamdown\n isAnimating={isAnimating}\n parseIncompleteMarkdown={isAnimating}\n components={components}\n >\n {children}\n </Streamdown>\n </div>\n );\n },\n (prevProps, nextProps) => prevProps.children === nextProps.children,\n);\n\nResponse.displayName = 'Response';\n\nexport { Response };\n"]}
|
|
1
|
+
{"version":3,"file":"Response.js","sourceRoot":"","sources":["../../../../src/ai/response/Response.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC9C,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CAAC,SAAS,CAAC,IAC5B,KAAK,cAER,QAAQ,IACE,CACd,CAAA;SAAA;QACD,0CAA0C;QAC1C,GAAG,EAAE,CAAC,EAAuC,EAAE,EAAE;gBAA3C,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,OAAY,EAAP,KAAK,cAArC,mCAAuC,CAAF;YAAO,OAAA,CAChD,4BACE,SAAS,EAAE,UAAU,CAAC,SAAS,CAAC,EAChC,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,IACJ,KAAK,EACT,CACH,CAAA;SAAA;KACF,CAAC,EACF,EAAE,CACH,CAAC;IAEJ,OAAO,CACL,4BACE,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,UAAU,CAAC,iBAAiB,EAAE,SAAS,CAAC,IAC/C,SAAS,EACT,cAAc,cAElB,KAAC,UAAU,IACT,WAAW,EAAE,WAAW,EACxB,uBAAuB,EAAE,WAAW,EACpC,UAAU,EAAE,UAAU,YAErB,QAAQ,GACE,IACT,CACP,CAAC;AACJ,CAAC,EACD,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,QAAQ,KAAK,SAAS,CAAC,QAAQ,CACpE,CAAC;AAEF,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC;AAElC,OAAO,EAAE,QAAQ,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\nimport { Code, TextLink, Typography } from '@neo4j-ndl/react';\nimport classNames from 'classnames';\nimport { memo, useMemo, useRef } from 'react';\nimport { Streamdown } from 'streamdown';\n\nimport { type CommonProps } from '../../_common/types';\nimport { type LanguageProp, Languages } from '../../code-block/code-languages';\nimport { CodePreview } from '../code-preview';\n\ntype ResponseProps = {\n /** The response from the AI */\n children: string;\n /** Whether the response is animating */\n isAnimating?: React.ComponentProps<typeof Streamdown>['isAnimating'];\n};\n\n/**\n * The component is used to display the response from an LLM.\n * It handles markdown rendering and streaming.\n *\n * @alpha - Changes to this component may be breaking.\n */\nconst Response = memo(\n ({\n className,\n children,\n isAnimating = false,\n ref,\n style,\n htmlAttributes,\n ...restProps\n }: CommonProps<'div', ResponseProps>) => {\n // Use a ref to store the current markdown content so we can check for unclosed fences\n // without recreating the components object on every render\n const childrenRef = useRef(children);\n childrenRef.current = children;\n\n const components: React.ComponentProps<typeof Streamdown>['components'] =\n useMemo(\n () => ({\n // oxlint-disable-next-line no-unused-vars\n ol: ({ node, children, className, ...props }) => (\n <ol className={className} {...props}>\n {children}\n </ol>\n ),\n // oxlint-disable-next-line no-unused-vars\n ul: ({ node, children, className, ...props }) => (\n <ul className={classNames(className)} {...props}>\n {children}\n </ul>\n ),\n // oxlint-disable-next-line no-unused-vars\n li: ({ node, children, className, ...props }) => (\n <li className={className} {...props}>\n {children}\n </li>\n ),\n // oxlint-disable-next-line no-unused-vars\n hr: ({ node, className, ...props }) => (\n <hr className={classNames(className)} {...props} />\n ),\n // oxlint-disable-next-line no-unused-vars\n strong: ({ node, children, className, style, ...props }) => (\n <Typography\n as=\"strong\"\n variant=\"body-medium\"\n className={className}\n style={{ ...style, fontWeight: 'bold' }}\n {...props}\n >\n {children}\n </Typography>\n ),\n // oxlint-disable-next-line no-unused-vars\n em: ({ node, children, className, style, ...props }) => (\n <Typography\n as=\"em\"\n variant=\"body-medium\"\n className={className}\n style={{ ...style, fontStyle: 'italic' }}\n {...props}\n >\n {children}\n </Typography>\n ),\n // oxlint-disable-next-line no-unused-vars\n a: ({ node, children, className, href, ...props }) => (\n <TextLink\n type=\"internal-underline\"\n className={className}\n href={href}\n htmlAttributes={props}\n >\n {children}\n </TextLink>\n ),\n // oxlint-disable-next-line no-unused-vars\n h1: ({ node, children, className, ...props }) => (\n <Typography\n as=\"h1\"\n variant=\"display\"\n className={className}\n htmlAttributes={{ ...props }}\n >\n {children}\n </Typography>\n ),\n // oxlint-disable-next-line no-unused-vars\n h2: ({ node, children, className, ...props }) => (\n <Typography\n as=\"h2\"\n variant=\"title-1\"\n className={className}\n htmlAttributes={{ ...props }}\n >\n {children}\n </Typography>\n ),\n // oxlint-disable-next-line no-unused-vars\n h3: ({ node, children, className, ...props }) => (\n <Typography\n as=\"h3\"\n variant=\"title-2\"\n className={className}\n htmlAttributes={{ ...props }}\n >\n {children}\n </Typography>\n ),\n // oxlint-disable-next-line no-unused-vars\n h4: ({ node, children, className, ...props }) => (\n <Typography\n as=\"h4\"\n variant=\"title-3\"\n className={className}\n htmlAttributes={{ ...props }}\n >\n {children}\n </Typography>\n ),\n // oxlint-disable-next-line no-unused-vars\n h5: ({ node, children, className, ...props }) => (\n <Typography\n as=\"h5\"\n variant=\"title-4\"\n className={className}\n htmlAttributes={{ ...props }}\n >\n {children}\n </Typography>\n ),\n // oxlint-disable-next-line no-unused-vars\n h6: ({ node, children, className, ...props }) => (\n <Typography\n as=\"h6\"\n variant=\"label\"\n className={className}\n htmlAttributes={{ ...props }}\n >\n {children}\n </Typography>\n ),\n // oxlint-disable-next-line no-unused-vars\n table: ({ node, children, className, ...props }) => (\n <div className=\"ndl-ai-response-table-wrapper\">\n <table className={className} {...props}>\n {children}\n </table>\n </div>\n ),\n // oxlint-disable-next-line no-unused-vars\n thead: ({ node, children, className, ...props }) => (\n <thead className={className} {...props}>\n {children}\n </thead>\n ),\n // oxlint-disable-next-line no-unused-vars\n tbody: ({ node, children, className, ...props }) => (\n <tbody className={className} {...props}>\n {children}\n </tbody>\n ),\n // oxlint-disable-next-line no-unused-vars\n tr: ({ node, children, className, ...props }) => (\n <tr className={className} {...props}>\n {children}\n </tr>\n ),\n // oxlint-disable-next-line no-unused-vars\n th: ({ node, children, className, ...props }) => (\n <th className={className} {...props}>\n {children}\n </th>\n ),\n // oxlint-disable-next-line no-unused-vars\n td: ({ node, children, className, ...props }) => (\n <td className={className} {...props}>\n {children}\n </td>\n ),\n // oxlint-disable-next-line no-unused-vars\n blockquote: ({ node, children, className, ...props }) => (\n <blockquote className={classNames(className)} {...props}>\n {children}\n </blockquote>\n ),\n code: ({ node, className, children: codeChildren, ...props }) => {\n const isInline =\n node?.position?.start.line === node?.position?.end.line;\n\n const nodeClassNamesRaw = node?.properties?.className;\n const nodeClassNamesArray: string[] = [];\n\n if (typeof nodeClassNamesRaw === 'string') {\n nodeClassNamesArray.push.apply(\n nodeClassNamesArray,\n nodeClassNamesRaw.split(' '),\n );\n } else if (Array.isArray(nodeClassNamesRaw)) {\n nodeClassNamesArray.push.apply(\n nodeClassNamesArray,\n nodeClassNamesRaw as string[],\n );\n }\n\n let language: LanguageProp | 'text' = 'text';\n const rawLanguage = nodeClassNamesArray.find((string: string) =>\n string.startsWith('language-'),\n );\n if (rawLanguage !== undefined) {\n language =\n (rawLanguage.replace('language-', '') as LanguageProp) ??\n 'text';\n }\n language = (Languages as readonly string[]).includes(language)\n ? (language as LanguageProp)\n : 'text';\n if (isInline) {\n return (\n <Code\n isRunnable={false}\n className={className}\n htmlAttributes={props}\n >\n {codeChildren}\n </Code>\n );\n }\n if (typeof codeChildren === 'string') {\n // Check if code fences are balanced in the markdown\n // If there are an odd number of fences, it means there's an unclosed code block\n const fenceMatches = childrenRef.current.match(/```/g);\n const fenceCount = fenceMatches ? fenceMatches.length : 0;\n const hasUnclosedFence = fenceCount % 2 !== 0;\n\n // Show loading state when there's an unclosed fence (code block is streaming)\n const isCodeBlockLoading = hasUnclosedFence;\n return (\n <CodePreview\n key={props.key}\n code={codeChildren}\n isLoading={isCodeBlockLoading}\n language={language}\n className={className}\n htmlAttributes={{\n ...props,\n }}\n />\n );\n } else {\n return <code className={className}>{codeChildren}</code>;\n }\n },\n // oxlint-disable-next-line no-unused-vars\n pre: ({ node, className, children, ...props }) => {\n return (\n <pre className={className} {...props}>\n {children}\n </pre>\n );\n },\n // oxlint-disable-next-line no-unused-vars\n p: ({ node, children, className, ...props }) => (\n <Typography\n as=\"p\"\n variant=\"body-medium\"\n className={classNames(className)}\n {...props}\n >\n {children}\n </Typography>\n ),\n // oxlint-disable-next-line no-unused-vars\n img: ({ node, className, src, alt, ...props }) => (\n <img\n className={classNames(className)}\n src={src}\n alt={alt}\n {...props}\n />\n ),\n }),\n [],\n );\n\n return (\n <div\n ref={ref}\n style={style}\n className={classNames('ndl-ai-response', className)}\n {...restProps}\n {...htmlAttributes}\n >\n <Streamdown\n isAnimating={isAnimating}\n parseIncompleteMarkdown={isAnimating}\n components={components}\n >\n {children}\n </Streamdown>\n </div>\n );\n },\n (prevProps, nextProps) => prevProps.children === nextProps.children,\n);\n\nResponse.displayName = 'Response';\n\nexport { Response };\n"]}
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
13
|
/**
|
|
2
14
|
*
|
|
3
15
|
* Copyright (c) "Neo4j"
|
|
@@ -18,87 +30,57 @@
|
|
|
18
30
|
* You should have received a copy of the GNU General Public License
|
|
19
31
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
32
|
*/
|
|
21
|
-
|
|
22
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
23
|
-
var t = {};
|
|
24
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
25
|
-
t[p] = s[p];
|
|
26
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
27
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
28
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
29
|
-
t[p[i]] = s[p[i]];
|
|
30
|
-
}
|
|
31
|
-
return t;
|
|
32
|
-
};
|
|
33
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
34
|
-
import { useEffect, useState } from 'react';
|
|
33
|
+
import classNames from 'classnames';
|
|
35
34
|
import { PrismLight as SyntaxHighlighter } from 'react-syntax-highlighter';
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import
|
|
41
|
-
|
|
35
|
+
import { CleanIconButton } from '../clean-icon-button';
|
|
36
|
+
import { ChevronDownIconOutline, ChevronUpIconOutline } from '../icons';
|
|
37
|
+
import { useCodeLanguage } from './hooks/use-code-language';
|
|
38
|
+
import { useCodeTheme } from './hooks/use-code-theme';
|
|
39
|
+
import { useExpandable } from './hooks/use-expandable';
|
|
40
|
+
const defaultElement = 'div';
|
|
42
41
|
export const CodeBlock = (_a) => {
|
|
43
|
-
var
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
if (Boolean(heading) === false) {
|
|
87
|
-
const expandButtonCount = shouldShowExpandButton ? 1 : 0;
|
|
88
|
-
const actionCount = (_a = actions === null || actions === void 0 ? void 0 : actions.length) !== null && _a !== void 0 ? _a : 0;
|
|
89
|
-
return Math.max(actionCount * 36, expandButtonCount * 36) + 8;
|
|
90
|
-
}
|
|
91
|
-
})();
|
|
92
|
-
return (_jsx(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: _jsx(SyntaxHighlighter, { language: loadedLanguage || 'text', style: Object.assign(Object.assign({}, getTheme()), { 'pre[class*="language-"]': {
|
|
93
|
-
border: 0,
|
|
94
|
-
color: 'var(--theme-color-neutral-text-default)',
|
|
95
|
-
lineHeight: '1',
|
|
96
|
-
padding: `0 ${calculateRightPadding !== null && calculateRightPadding !== void 0 ? calculateRightPadding : 0}px 0.75em 0.75em`,
|
|
97
|
-
width: 'fit-content',
|
|
98
|
-
} }),
|
|
99
|
-
// Turn on 'shouldShowLineNumbers' & '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: shouldShowLineNumbers, children: code }) })));
|
|
42
|
+
var _b, _c;
|
|
43
|
+
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"])
|
|
44
|
+
// TODO: Should not be polymorphic (at least not defaulting to a button)
|
|
45
|
+
;
|
|
46
|
+
const Component = as !== null && as !== void 0 ? as : defaultElement;
|
|
47
|
+
const { containerHeight, isExpanded, toggleExpand, hasOverflowingContent, ref: syntaxHighlighterWrapperRef, } = useExpandable(maxHeight, code);
|
|
48
|
+
const codeTheme = useCodeTheme(theme);
|
|
49
|
+
const codeLanguage = useCodeLanguage(language);
|
|
50
|
+
const hasMaxHeight = maxHeight !== undefined;
|
|
51
|
+
const hasHeading = Boolean(heading);
|
|
52
|
+
const numberOfActions = (_b = actions === null || actions === void 0 ? void 0 : actions.length) !== null && _b !== void 0 ? _b : 0;
|
|
53
|
+
const shouldShowExpandButton = hasMaxHeight && hasOverflowingContent;
|
|
54
|
+
const rightPadding = hasHeading
|
|
55
|
+
? 0
|
|
56
|
+
: Math.max(numberOfActions * 36, (shouldShowExpandButton ? 1 : 0) * 36) + 8;
|
|
57
|
+
return (_jsxs(Component, Object.assign({ ref: ref, className: classNames('ndl-code-block-container', className), style: Object.assign({ height: containerHeight }, style) }, restProps, htmlAttributes, { children: [_jsxs("div", { className: "n-flex n-flex-col n-h-full", children: [hasHeading && (_jsx("div", { className: classNames('ndl-code-block-title', {
|
|
58
|
+
'ndl-disabled': isDisabled,
|
|
59
|
+
}), style: {
|
|
60
|
+
maxWidth: `calc(100% - ${((_c = actions === null || actions === void 0 ? void 0 : actions.length) !== null && _c !== void 0 ? _c : 0) * 36 + 20}px)`,
|
|
61
|
+
}, "data-testid": "ndl-code-block-title", children: heading })), _jsx("div", { className: classNames('ndl-code-content-container', {
|
|
62
|
+
'ndl-disabled': isDisabled,
|
|
63
|
+
}), style: {
|
|
64
|
+
height: hasHeading ? 'calc(100% - 24px - 12px)' : '100%',
|
|
65
|
+
}, children: _jsx("div", { ref: syntaxHighlighterWrapperRef, className: "ndl-highlight-wrapper", tabIndex: 0, role: "region", "aria-label": `Code content ${isDisabled ? '(disabled)' : ''}`, children: _jsx(SyntaxHighlighter, { language: codeLanguage, style: Object.assign(Object.assign({}, codeTheme), { 'pre[class*="language-"]': {
|
|
66
|
+
border: 0,
|
|
67
|
+
color: 'var(--theme-color-neutral-text-default)',
|
|
68
|
+
lineHeight: '1',
|
|
69
|
+
padding: `0 ${rightPadding}px 0.75em 0.75em`,
|
|
70
|
+
width: 'fit-content',
|
|
71
|
+
} }), codeTagProps: { className: 'n-code' },
|
|
72
|
+
// Turn on 'shouldShowLineNumbers' & 'wrapLongLines' at the same time, the display is wrong
|
|
73
|
+
// https://github.com/react-syntax-highlighter/react-syntax-highlighter/issues/402
|
|
74
|
+
// wrapLongLines
|
|
75
|
+
showLineNumbers: shouldShowLineNumbers, children: code }) }) })] }), _jsx("div", { className: classNames('ndl-code-block-actions', {
|
|
76
|
+
'ndl-disabled': isDisabled,
|
|
77
|
+
}), children: actions === null || actions === void 0 ? void 0 : actions.map((iconButtonProps, i) => {
|
|
78
|
+
var _a;
|
|
79
|
+
return (_jsx(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));
|
|
80
|
+
}) }), shouldShowExpandButton && (_jsx("div", { className: "ndl-code-block-expand-button", children: _jsx(CleanIconButton, { description: isExpanded ? 'Collapse' : 'Expand', tooltipProps: {
|
|
81
|
+
root: {
|
|
82
|
+
shouldCloseOnReferenceClick: true,
|
|
83
|
+
},
|
|
84
|
+
}, onClick: toggleExpand, children: isExpanded ? _jsx(ChevronUpIconOutline, {}) : _jsx(ChevronDownIconOutline, {}) }) }))] })));
|
|
103
85
|
};
|
|
104
86
|
//# sourceMappingURL=CodeBlock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeBlock.js","sourceRoot":"","sources":["../../../src/code-block/CodeBlock.tsx"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"CodeBlock.js","sourceRoot":"","sources":["../../../src/code-block/CodeBlock.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,UAAU,IAAI,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAG3E,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAGxE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAavD,MAAM,cAAc,GAAG,KAAK,CAAC;AAE7B,MAAM,CAAC,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,aAAa,CAAC,SAAS,E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AAC,QAAQ,EAC/C,YAAY,EAAE;wBACZ,IAAI,EAAE;4BACJ,2BAA2B,EAAE,IAAI;yBAClC;qBACF,EACD,OAAO,EAAE,YAAY,YAEpB,UAAU,CAAC,CAAC,CAAC,KAAC,oBAAoB,KAAG,CAAC,CAAC,CAAC,KAAC,sBAAsB,KAAG,GACnD,GACd,CACP,KACS,CACb,CAAC;AACJ,CAAC,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 */\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,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 {};
|
|
22
|
+
//# 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,45 @@
|
|
|
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 { useEffect, useState } from 'react';
|
|
22
|
+
import { PrismLight as SyntaxHighlighter } from 'react-syntax-highlighter';
|
|
23
|
+
import { loadLanguage } from '../code-languages';
|
|
24
|
+
/**
|
|
25
|
+
* Load the code highlighting language for the given language.
|
|
26
|
+
* Defaults to 'text' if no language is provided.
|
|
27
|
+
*/
|
|
28
|
+
export const useCodeLanguage = (language) => {
|
|
29
|
+
const [loadedLanguage, setLoadedLanguage] = useState('text');
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
if (language === undefined || language === 'text') {
|
|
32
|
+
setLoadedLanguage('text');
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
loadLanguage(language)
|
|
36
|
+
.then((module) => {
|
|
37
|
+
SyntaxHighlighter.registerLanguage(language, module.default);
|
|
38
|
+
setLoadedLanguage(language);
|
|
39
|
+
})
|
|
40
|
+
// TODO: add visual feedback for the user
|
|
41
|
+
.catch((err) => console.error(err));
|
|
42
|
+
}, [language]);
|
|
43
|
+
return loadedLanguage;
|
|
44
|
+
};
|
|
45
|
+
//# 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,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,UAAU,IAAI,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE3E,OAAO,EAAqB,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEpE;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,QAAgC,EAAE,EAAE;IAClE,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAClD,MAAM,CACP,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,MAAM,EAAE,CAAC;YAClD,iBAAiB,CAAC,MAAM,CAAC,CAAC;YAC1B,OAAO;QACT,CAAC;QAED,YAAY,CAAC,QAAQ,CAAC;aACnB,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;YACf,iBAAiB,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","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"]}
|