@neo4j-ndl/react-graph 2.1.23 → 2.2.5

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 (132) hide show
  1. package/lib/cjs/_generated/style-rules/color-utils.js.map +1 -1
  2. package/lib/cjs/_generated/style-rules/date-utils.js +1 -1
  3. package/lib/cjs/_generated/style-rules/date-utils.js.map +1 -1
  4. package/lib/cjs/_generated/style-rules/index.js +1 -1
  5. package/lib/cjs/_generated/style-rules/index.js.map +1 -1
  6. package/lib/cjs/_generated/style-rules/literal-schemas.js +1 -1
  7. package/lib/cjs/_generated/style-rules/literal-schemas.js.map +1 -1
  8. package/lib/cjs/_generated/style-rules/numeric-utils.js.map +1 -1
  9. package/lib/cjs/_generated/style-rules/range-utils.js +1 -1
  10. package/lib/cjs/_generated/style-rules/range-utils.js.map +1 -1
  11. package/lib/cjs/graph-visualization-buttons.js +1 -1
  12. package/lib/cjs/graph-visualization-buttons.js.map +1 -1
  13. package/lib/cjs/graph-visualization-context.js +1 -1
  14. package/lib/cjs/graph-visualization-context.js.map +1 -1
  15. package/lib/cjs/graph-visualization-sidepanel.js +1 -1
  16. package/lib/cjs/graph-visualization-sidepanel.js.map +1 -1
  17. package/lib/cjs/graph-visualization.js +1 -1
  18. package/lib/cjs/graph-visualization.js.map +1 -1
  19. package/lib/cjs/index.js +1 -1
  20. package/lib/cjs/index.js.map +1 -1
  21. package/lib/cjs/sidepanel-components/button-group.js +1 -1
  22. package/lib/cjs/sidepanel-components/button-group.js.map +1 -1
  23. package/lib/cjs/sidepanel-components/clickable-urls.js +1 -1
  24. package/lib/cjs/sidepanel-components/clickable-urls.js.map +1 -1
  25. package/lib/cjs/sidepanel-components/details-panel.js +1 -1
  26. package/lib/cjs/sidepanel-components/details-panel.js.map +1 -1
  27. package/lib/cjs/sidepanel-components/graph-label-wrapper.js +1 -1
  28. package/lib/cjs/sidepanel-components/graph-label-wrapper.js.map +1 -1
  29. package/lib/cjs/sidepanel-components/overview-panel.js +1 -1
  30. package/lib/cjs/sidepanel-components/overview-panel.js.map +1 -1
  31. package/lib/cjs/sidepanel-components/properties-table.js +1 -1
  32. package/lib/cjs/sidepanel-components/properties-table.js.map +1 -1
  33. package/lib/cjs/sidepanel-components/show-all.js +1 -1
  34. package/lib/cjs/sidepanel-components/show-all.js.map +1 -1
  35. package/lib/cjs/sidepanel-components/single-selection-sidepanel-contents.js +1 -1
  36. package/lib/cjs/sidepanel-components/single-selection-sidepanel-contents.js.map +1 -1
  37. package/lib/cjs/styling/compile-graph-styles.js +134 -61
  38. package/lib/cjs/styling/compile-graph-styles.js.map +1 -1
  39. package/lib/cjs/styling/create-vis-data-structures.js +16 -9
  40. package/lib/cjs/styling/create-vis-data-structures.js.map +1 -1
  41. package/lib/cjs/styling/parse-style-rules.js +1 -1
  42. package/lib/cjs/styling/parse-style-rules.js.map +1 -1
  43. package/lib/cjs/styling/style-types.js +30 -30
  44. package/lib/cjs/styling/style-types.js.map +1 -1
  45. package/lib/cjs/styling/use-graph-data.js +1 -1
  46. package/lib/cjs/styling/use-graph-data.js.map +1 -1
  47. package/lib/cjs/use-managed-node-state.js +1 -1
  48. package/lib/cjs/use-managed-node-state.js.map +1 -1
  49. package/lib/cjs/use-semi-controlled-state.js +1 -1
  50. package/lib/cjs/use-semi-controlled-state.js.map +1 -1
  51. package/lib/cjs/utils.js +1 -1
  52. package/lib/cjs/utils.js.map +1 -1
  53. package/lib/esm/_generated/style-rules/color-utils.js.map +1 -1
  54. package/lib/esm/_generated/style-rules/date-utils.js +1 -1
  55. package/lib/esm/_generated/style-rules/date-utils.js.map +1 -1
  56. package/lib/esm/_generated/style-rules/index.js +1 -1
  57. package/lib/esm/_generated/style-rules/index.js.map +1 -1
  58. package/lib/esm/_generated/style-rules/literal-schemas.js +1 -1
  59. package/lib/esm/_generated/style-rules/literal-schemas.js.map +1 -1
  60. package/lib/esm/_generated/style-rules/numeric-utils.js.map +1 -1
  61. package/lib/esm/_generated/style-rules/range-utils.js +1 -1
  62. package/lib/esm/_generated/style-rules/range-utils.js.map +1 -1
  63. package/lib/esm/graph-visualization-buttons.js +1 -1
  64. package/lib/esm/graph-visualization-buttons.js.map +1 -1
  65. package/lib/esm/graph-visualization-context.js +1 -1
  66. package/lib/esm/graph-visualization-context.js.map +1 -1
  67. package/lib/esm/graph-visualization-sidepanel.js +1 -1
  68. package/lib/esm/graph-visualization-sidepanel.js.map +1 -1
  69. package/lib/esm/graph-visualization.js +1 -1
  70. package/lib/esm/graph-visualization.js.map +1 -1
  71. package/lib/esm/index.js +1 -1
  72. package/lib/esm/index.js.map +1 -1
  73. package/lib/esm/sidepanel-components/button-group.js +1 -1
  74. package/lib/esm/sidepanel-components/button-group.js.map +1 -1
  75. package/lib/esm/sidepanel-components/clickable-urls.js +1 -1
  76. package/lib/esm/sidepanel-components/clickable-urls.js.map +1 -1
  77. package/lib/esm/sidepanel-components/details-panel.js +1 -1
  78. package/lib/esm/sidepanel-components/details-panel.js.map +1 -1
  79. package/lib/esm/sidepanel-components/graph-label-wrapper.js +1 -1
  80. package/lib/esm/sidepanel-components/graph-label-wrapper.js.map +1 -1
  81. package/lib/esm/sidepanel-components/overview-panel.js +1 -1
  82. package/lib/esm/sidepanel-components/overview-panel.js.map +1 -1
  83. package/lib/esm/sidepanel-components/properties-table.js +1 -1
  84. package/lib/esm/sidepanel-components/properties-table.js.map +1 -1
  85. package/lib/esm/sidepanel-components/show-all.js +1 -1
  86. package/lib/esm/sidepanel-components/show-all.js.map +1 -1
  87. package/lib/esm/sidepanel-components/single-selection-sidepanel-contents.js +1 -1
  88. package/lib/esm/sidepanel-components/single-selection-sidepanel-contents.js.map +1 -1
  89. package/lib/esm/styling/compile-graph-styles.js +132 -61
  90. package/lib/esm/styling/compile-graph-styles.js.map +1 -1
  91. package/lib/esm/styling/create-vis-data-structures.js +16 -9
  92. package/lib/esm/styling/create-vis-data-structures.js.map +1 -1
  93. package/lib/esm/styling/parse-style-rules.js +1 -1
  94. package/lib/esm/styling/parse-style-rules.js.map +1 -1
  95. package/lib/esm/styling/style-types.js +30 -30
  96. package/lib/esm/styling/style-types.js.map +1 -1
  97. package/lib/esm/styling/use-graph-data.js +1 -1
  98. package/lib/esm/styling/use-graph-data.js.map +1 -1
  99. package/lib/esm/use-managed-node-state.js +1 -1
  100. package/lib/esm/use-managed-node-state.js.map +1 -1
  101. package/lib/esm/use-semi-controlled-state.js +1 -1
  102. package/lib/esm/use-semi-controlled-state.js.map +1 -1
  103. package/lib/esm/utils.js +1 -1
  104. package/lib/esm/utils.js.map +1 -1
  105. package/lib/types/_generated/style-rules/color-utils.d.ts +1 -1
  106. package/lib/types/_generated/style-rules/index.d.ts +1 -1
  107. package/lib/types/_generated/style-rules/literal-schemas.d.ts +1 -1
  108. package/lib/types/_generated/style-rules/numeric-utils.d.ts +1 -1
  109. package/lib/types/graph-visualization-buttons.d.ts +1 -1
  110. package/lib/types/graph-visualization-context.d.ts +1 -1
  111. package/lib/types/graph-visualization-sidepanel.d.ts +1 -1
  112. package/lib/types/graph-visualization.d.ts +1 -1
  113. package/lib/types/index.d.ts +1 -1
  114. package/lib/types/sidepanel-components/button-group.d.ts +1 -1
  115. package/lib/types/sidepanel-components/clickable-urls.d.ts +1 -1
  116. package/lib/types/sidepanel-components/details-panel.d.ts +1 -1
  117. package/lib/types/sidepanel-components/graph-label-wrapper.d.ts +1 -1
  118. package/lib/types/sidepanel-components/overview-panel.d.ts +1 -1
  119. package/lib/types/sidepanel-components/properties-table.d.ts +1 -1
  120. package/lib/types/sidepanel-components/show-all.d.ts +1 -1
  121. package/lib/types/sidepanel-components/single-selection-sidepanel-contents.d.ts +1 -1
  122. package/lib/types/styling/compile-graph-styles.d.ts +29 -2
  123. package/lib/types/styling/compile-graph-styles.d.ts.map +1 -1
  124. package/lib/types/styling/create-vis-data-structures.d.ts +2 -2
  125. package/lib/types/styling/create-vis-data-structures.d.ts.map +1 -1
  126. package/lib/types/styling/parse-style-rules.d.ts +1 -1
  127. package/lib/types/styling/style-types.d.ts +121 -121
  128. package/lib/types/styling/use-graph-data.d.ts +1 -1
  129. package/lib/types/use-managed-node-state.d.ts +1 -1
  130. package/lib/types/use-semi-controlled-state.d.ts +1 -1
  131. package/lib/types/utils.d.ts +1 -1
  132. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"graph-visualization.js","sourceRoot":"","sources":["../../src/graph-visualization.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGnE,OAAO,EACL,qBAAqB,GAEtB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,IAAI,EAAE,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEnE,OAAO,EACL,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EAClB,qBAAqB,EACrB,YAAY,EACZ,aAAa,EACb,eAAe,GAChB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAGL,yBAAyB,GAK1B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,EAAE,gCAAgC,EAAE,MAAM,4DAA4D,CAAC;AAE9G,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AASrE,MAAM,UAAU,GAA8B;IAC5C,aAAa,EAAE,4DAA4D;IAC3E,eAAe,EACb,8DAA8D;IAChE,cA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kBAAkB,CAAC;AAE3D;;;;;;;;;;;GAWG;AACH,kBAAkB,CAAC,mBAAmB,GAAG,mBAAmB,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 { tokens } from '@neo4j-ndl/base';\nimport { IconButtonArray, useNeedleTheme } from '@neo4j-ndl/react';\nimport type NVL from '@neo4j-nvl/base';\nimport { type Layout, type NvlOptions } from '@neo4j-nvl/base';\nimport {\n InteractiveNvlWrapper,\n type InteractiveNvlWrapperProps,\n} from '@neo4j-nvl/react';\nimport { default as cx } from 'classnames';\nimport React, { useEffect, useId, useMemo, useState } from 'react';\n\nimport {\n BoxSelectButton,\n DownloadButton,\n GestureSelectButton,\n LassoSelectButton,\n LayoutSelectButton,\n SearchButton,\n SingleSelectButton,\n ToggleSidePanelButton,\n ZoomInButton,\n ZoomOutButton,\n ZoomToFitButton,\n} from './graph-visualization-buttons';\nimport {\n type Gesture,\n type GraphSelection,\n GraphVisualizationContext,\n type InteractionMode,\n type NeoNode,\n type NeoRel,\n type Sidepanel,\n} from './graph-visualization-context';\nimport { GraphVisualizationSidepanel } from './graph-visualization-sidepanel';\nimport { SingleSelectionSidepanelContents } from './sidepanel-components/single-selection-sidepanel-contents';\nimport { type GraphStyleRule } from './styling/style-types';\nimport { useGraphData } from './styling/use-graph-data';\nimport { useManagedNodeState } from './use-managed-node-state';\nimport { useSemicontrolledState } from './use-semi-controlled-state';\n\ntype Placement =\n | 'top-right'\n | 'bottom-right'\n | 'top-left'\n | 'bottom-left'\n | 'bottom-center';\n\nconst PLACEMENTS: Record<Placement, string> = {\n 'bottom-left': 'ndl-graph-visualization-interaction-island ndl-bottom-left',\n 'bottom-center':\n 'ndl-graph-visualization-interaction-island ndl-bottom-center',\n 'bottom-right': 'ndl-graph-visualization-interaction-island ndl-bottom-right',\n 'top-left': 'ndl-graph-visualization-interaction-island ndl-top-left',\n 'top-right': 'ndl-graph-visualization-interaction-island ndl-top-right',\n};\n\nconst InteractionIsland = ({\n children,\n className,\n placement,\n}: {\n children: React.ReactNode;\n placement: Placement;\n className?: string;\n}) => {\n return <div className={cx(PLACEMENTS[placement], className)}>{children}</div>;\n};\n\nexport const DEFAULT_NVL_OPTIONS = {\n disableTelemetry: true,\n disableWebGL: true,\n maxZoom: 3,\n minZoom: 0.05,\n relationshipThreshold: 0.55,\n renderer: 'canvas',\n} satisfies NvlOptions;\n\ntype BackwardsCompatibleNvlOptions = NvlOptions & {\n /** @deprecated Use {@link NvlOptions.renderer} instead. */\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Matches the removed NVL option.\n useWebGL?: boolean;\n};\n\nconst DEFAULT_COMPONENTS = {\n bottomLeftIsland: null,\n bottomCenterIsland: null,\n bottomRightIsland: (\n <IconButtonArray orientation=\"vertical\" isFloating size=\"small\">\n <ZoomInButton /> <ZoomOutButton /> <ZoomToFitButton />\n </IconButtonArray>\n ),\n topLeftIsland: null,\n topRightIsland: (\n <div className=\"ndl-graph-visualization-default-download-group\">\n <DownloadButton /> <ToggleSidePanelButton />\n </div>\n ),\n};\n\nexport type GraphVisualizationProps<T extends React.ElementType = 'div'> = {\n nvlRef?: React.RefObject<NVL | null>;\n nvlOptions?: BackwardsCompatibleNvlOptions;\n sidepanel?: Sidepanel | null;\n bottomLeftIsland?: React.ReactNode;\n bottomCenterIsland?: React.ReactNode;\n bottomRightIsland?: React.ReactNode;\n topLeftIsland?: React.ReactNode;\n topRightIsland?: React.ReactNode;\n className?: string;\n style?: React.CSSProperties;\n /**\n * Optional style rules to apply to graph elements.\n * Consumer-set `color` on individual `NeoNode`/`NeoRel` objects takes precedence over rules.\n * Compared by reference — memoize the array to avoid recompiling on every render.\n */\n styleRules?: GraphStyleRule[];\n\n gesture?: Gesture;\n setGesture?: (gesture: Gesture) => void;\n selected?: GraphSelection;\n setSelected?: (newSelection: GraphSelection) => void;\n interactionMode?: InteractionMode;\n setInteractionMode?: (interactionMode: InteractionMode) => void;\n layout?: Layout;\n setLayout?: (layout: Layout) => void;\n\n portalTarget?: HTMLElement | null;\n\n nodes: NeoNode[];\n rels: NeoRel[];\n\n highlightedNodeIds?: string[];\n highlightedRelationshipIds?: string[];\n\n as?: T;\n ref?: React.ComponentPropsWithRef<T>['ref'];\n htmlAttributes?: React.HTMLAttributes<T>;\n} & InteractiveNvlWrapperProps;\n\n/**\n * A comprehensive graph visualization component for rendering Neo4j-style graphs with interactive features.\n *\n * @remarks\n * This component provides a complete graph visualization solution with built-in interaction modes,\n * selection handling, zoom controls, and an optional sidepanel. It wraps the NVL (Neo4j Visualization Library)\n * with additional UI controls and state management.\n *\n * The component supports various interaction modes including single selection, box selection, and lasso selection.\n * It also provides customizable UI islands for placing controls at different corners of the visualization.\n *\n * @example\n * Basic usage:\n * ```tsx\n * <GraphVisualization\n * nodes={nodes}\n * rels={relationships}\n * selected={selection}\n * setSelected={setSelection}\n * />\n * ```\n *\n * @example\n * With custom controls:\n * ```tsx\n * <GraphVisualization\n * nodes={nodes}\n * rels={relationships}\n * topRightIsland={<CustomControls />}\n * sidepanel={{\n * contents: <CustomSidepanel />,\n * isSidePanelOpen: true,\n * setIsSidePanelOpen: setSidepanelOpen\n * sidePanelWidth: 400,\n * onSidePanelResize: setSidepanelWidth,\n * }}\n * />\n * ```\n *\n * @example\n * With highlighting:\n * ```tsx\n * <GraphVisualization\n * nodes={nodes}\n * rels={relationships}\n * // undefined = no highlighting (default behavior)\n * // empty array = no search matches (dims all nodes)\n * // array with IDs = highlight only those items\n * highlightedNodeIds={searchResults.nodeIds}\n * highlightedRelationshipIds={searchResults.relationshipIds}\n * />\n * ```\n *\n * @param props - {@link GraphVisualizationProps}\n * @returns A React component that renders an interactive graph visualization\n *\n * @alpha\n */\nexport function GraphVisualization<T extends React.ElementType = 'div'>({\n nvlRef: rawNvlRef,\n nvlCallbacks,\n nvlOptions: rawNvlOptions,\n sidepanel: rawSidepanel,\n nodes: rawNodes,\n rels: rawRels,\n highlightedNodeIds,\n highlightedRelationshipIds,\n topLeftIsland = DEFAULT_COMPONENTS.topLeftIsland,\n topRightIsland = DEFAULT_COMPONENTS.topRightIsland,\n bottomLeftIsland = DEFAULT_COMPONENTS.bottomLeftIsland,\n bottomCenterIsland = DEFAULT_COMPONENTS.bottomCenterIsland,\n bottomRightIsland = DEFAULT_COMPONENTS.bottomRightIsland,\n gesture = 'single',\n setGesture,\n layout: rawLayout,\n\n layoutOptions,\n setLayout: rawSetLayout,\n portalTarget,\n selected: rawSelected,\n setSelected: rawSetSelected,\n interactionMode: rawInteractionMode,\n setInteractionMode: rawSetInteractionMode,\n mouseEventCallbacks = {},\n className,\n style,\n htmlAttributes,\n ref,\n as,\n styleRules,\n ...restProps\n}: GraphVisualizationProps<T>) {\n const { useWebGL: isWebGLEnabled, ...nvlOptions } = rawNvlOptions ?? {};\n nvlOptions.renderer =\n nvlOptions.renderer ??\n (isWebGLEnabled === true ? 'webgl' : DEFAULT_NVL_OPTIONS.renderer);\n\n const nvlRef = useMemo(\n () => rawNvlRef ?? React.createRef<NVL>(),\n [rawNvlRef],\n );\n\n const instanceId = useId();\n\n // Respect NDL theme changes\n const { theme } = useNeedleTheme();\n const { bg, border, text } = tokens.theme[theme].color.neutral;\n\n // key required for nvl react responsiveness\n const [key, setKey] = useState(0);\n useEffect(() => {\n setKey((prevKey) => prevKey + 1);\n }, [theme]);\n\n const { styledGraph, metadataLookup, compiledStyleRules } = useGraphData(\n rawNodes,\n rawRels,\n styleRules,\n );\n\n // Semi-control interaction mode and selection state\n const [interactionMode, setInteractionMode] = useSemicontrolledState({\n isControlled: rawInteractionMode !== undefined,\n onChange: rawSetInteractionMode,\n state: rawInteractionMode ?? 'select',\n });\n const [selected, setSelected] = useSemicontrolledState({\n isControlled: rawSelected !== undefined,\n onChange: rawSetSelected,\n state: rawSelected ?? { nodeIds: [], relationshipIds: [] },\n });\n const [layout, setLayout] = useSemicontrolledState({\n isControlled: rawLayout !== undefined,\n onChange: rawSetLayout,\n state: rawLayout ?? 'd3Force',\n });\n\n const { nodesWithState, relsWithState, wrappedMouseEventCallbacks } =\n useManagedNodeState({\n gesture,\n highlightedNodeIds,\n highlightedRelationshipIds,\n interactionMode,\n mouseEventCallbacks,\n nvlGraph: styledGraph,\n selected,\n setInteractionMode,\n setSelected,\n });\n\n const [isSidePanelOpen, setIsSidePanelOpen] = useSemicontrolledState({\n isControlled: rawSidepanel?.isSidePanelOpen !== undefined,\n onChange: rawSidepanel?.setIsSidePanelOpen,\n state: rawSidepanel?.isSidePanelOpen ?? true,\n });\n const [sidePanelWidth, setSidePanelWidth] = useSemicontrolledState({\n isControlled: rawSidepanel?.sidePanelWidth !== undefined,\n onChange: rawSidepanel?.onSidePanelResize,\n state: rawSidepanel?.sidePanelWidth ?? 400,\n });\n\n const sidepanel = useMemo((): Sidepanel | null => {\n if (rawSidepanel === undefined) {\n return {\n children: <GraphVisualization.SingleSelectionSidePanelContents />,\n isSidePanelOpen,\n onSidePanelResize: setSidePanelWidth,\n setIsSidePanelOpen,\n sidePanelWidth,\n };\n }\n return rawSidepanel;\n }, [\n rawSidepanel,\n isSidePanelOpen,\n setIsSidePanelOpen,\n sidePanelWidth,\n setSidePanelWidth,\n ]);\n\n const Component: React.ElementType = as ?? 'div';\n return (\n <Component\n ref={ref}\n className={cx('ndl-graph-visualization-container', className)}\n style={style}\n {...htmlAttributes}\n >\n <GraphVisualizationContext.Provider\n value={{\n compiledStyleRules,\n gesture,\n interactionMode,\n layout,\n metadataLookup,\n nvlGraph: styledGraph,\n nvlInstance: nvlRef,\n portalTarget,\n selected,\n setGesture,\n setLayout,\n sidepanel,\n }}\n >\n <div className=\"ndl-graph-visualization\">\n <InteractiveNvlWrapper\n key={key}\n nodes={nodesWithState}\n rels={relsWithState}\n nvlOptions={{\n ...DEFAULT_NVL_OPTIONS,\n instanceId,\n styling: {\n defaultRelationshipColor: border.strongest,\n disabledItemColor: bg.strong,\n disabledItemFontColor: text.weakest,\n dropShadowColor: border.weak,\n selectedInnerBorderColor: bg.default,\n },\n ...nvlOptions,\n layout,\n layoutOptions: layoutOptions ?? nvlOptions.layoutOptions,\n }}\n nvlCallbacks={{\n onLayoutComputing(isComputing) {\n if (!isComputing) {\n nvlRef.current?.fit(\n nvlRef.current.getNodes().map((neighbors) => neighbors.id),\n { noPan: true },\n );\n }\n },\n ...nvlCallbacks,\n }}\n mouseEventCallbacks={wrappedMouseEventCallbacks}\n ref={nvlRef}\n {...restProps}\n />\n {topLeftIsland !== null && (\n <InteractionIsland placement=\"top-left\">\n {topLeftIsland}\n </InteractionIsland>\n )}\n\n {topRightIsland !== null && (\n <InteractionIsland placement=\"top-right\">\n {topRightIsland}\n </InteractionIsland>\n )}\n\n {bottomLeftIsland !== null && (\n <InteractionIsland placement=\"bottom-left\">\n {bottomLeftIsland}\n </InteractionIsland>\n )}\n\n {bottomCenterIsland !== null && (\n <InteractionIsland placement=\"bottom-center\">\n {bottomCenterIsland}\n </InteractionIsland>\n )}\n\n {bottomRightIsland !== null && (\n <InteractionIsland placement=\"bottom-right\">\n {bottomRightIsland}\n </InteractionIsland>\n )}\n </div>\n {sidepanel && <GraphVisualizationSidepanel sidepanel={sidepanel} />}\n </GraphVisualizationContext.Provider>\n </Component>\n );\n}\n\n/**\n * Zoom in button for use within a GraphVisualization component.\n *\n * @remarks\n * Increases zoom level by 1.3x\n *\n * @alpha\n */\nGraphVisualization.ZoomInButton = ZoomInButton;\n\n/**\n * Zoom out button for use within a GraphVisualization component.\n *\n * @remarks\n * Decreases zoom level by 0.7x\n *\n * @alpha\n */\nGraphVisualization.ZoomOutButton = ZoomOutButton;\n\n/**\n * Zoom to fit button for use within a GraphVisualization component.\n *\n * @remarks\n * Automatically adjusts zoom and pan to show all nodes and relationships\n *\n * @alpha\n */\nGraphVisualization.ZoomToFitButton = ZoomToFitButton;\n\n/**\n * Sidepanel toggle button for use within a GraphVisualization component.\n *\n * @remarks\n * Shows or hides the sidepanel containing node and relationship details.\n * Requires a sidepanel to be configured in the GraphVisualization component.\n *\n * @throws Error when used without a configured sidepanel\n *\n * @alpha\n */\nGraphVisualization.ToggleSidePanelButton = ToggleSidePanelButton;\n\n/**\n * Download button for use within a GraphVisualization component.\n *\n * @remarks\n * Opens a dropdown menu with download options. Supports PNG and SVG formats.\n * Captures the current visualization state including zoom level.\n *\n * @alpha\n */\nGraphVisualization.DownloadButton = DownloadButton;\n\n/**\n * Box selection button for use within a GraphVisualization component.\n *\n * @remarks\n * Enables box selection mode where dragging creates a rectangular selection area.\n * Disabled unless the `setGesture` callback is passed.\n * Shows active state when enabled and supports keyboard shortcut 'B'.\n *\n * @alpha\n */\nGraphVisualization.BoxSelectButton = BoxSelectButton;\n\n/**\n * Lasso selection button for use within a GraphVisualization component.\n *\n * @remarks\n * Enables lasso selection mode where dragging creates a free-form selection area.\n * Disabled unless the `setGesture` callback is passed.\n * Shows active state when enabled and supports keyboard shortcut 'L'.\n *\n * @alpha\n */\nGraphVisualization.LassoSelectButton = LassoSelectButton;\n\n/**\n * Single node selection button for use within a GraphVisualization component.\n *\n * @remarks\n * Enables single selection mode where clicking selects individual nodes or relationships.\n * Shows active state when enabled and supports keyboard shortcut 'S'.\n *\n * @alpha\n */\nGraphVisualization.SingleSelectButton = SingleSelectButton;\n\n/**\n * Search button for use within a GraphVisualization component.\n *\n * @remarks\n * Enables search mode where clicking opens a search input for filtering nodes and relationships.\n *\n * @alpha\n */\nGraphVisualization.SearchButton = SearchButton;\n\n/**\n * Single node selection side panel for use within a GraphVisualization component.\n *\n * @remarks\n * Displays detailed information about the selected node or relationship.\n * Panel is automatically opened when a node or relationship is selected.\n * Also when user click on the show panel button in the top right corner.\n *\n * @alpha\n */\nGraphVisualization.SingleSelectionSidePanelContents =\n SingleSelectionSidepanelContents;\n\n/**\n * Layout selection button for use within a GraphVisualization component.\n *\n * @remarks\n * Opens a menu to select different graph layout algorithms.\n *\n * By default, the menu includes the **force-based** (`d3Force`) and\n * **hierarchical** layouts. Additional layouts can be enabled via configuration.\n *\n * @see {@link LayoutSelectOption} for the full set of layout options supported by NVL.\n *\n * @alpha\n */\nGraphVisualization.LayoutSelectButton = LayoutSelectButton;\n\n/**\n * Gesture selection button for use within a GraphVisualization component.\n *\n * @remarks\n * Opens a menu to select different interaction gestures.\n *\n * By default, the menu includes **single**, **box**, and **lasso** selection gestures.\n *\n * @see {@link GestureSelectOption} for the full set of gesture options supported by NVL.\n *\n * @alpha\n */\nGraphVisualization.GestureSelectButton = GestureSelectButton;\n"]}
1
+ {"version":3,"file":"graph-visualization.js","sourceRoot":"","sources":["../../src/graph-visualization.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGnE,OAAO,EACL,qBAAqB,GAEtB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,IAAI,EAAE,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEnE,OAAO,EACL,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EAClB,qBAAqB,EACrB,YAAY,EACZ,aAAa,EACb,eAAe,GAChB,MAAM,+BAA+B,CAAC;AACvC,OAAO,E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EnD;;;;;;;;;GASG;AACH,kBAAkB,CAAC,eAAe,GAAG,eAAe,CAAC;AAErD;;;;;;;;;GASG;AACH,kBAAkB,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;AAEzD;;;;;;;;GAQG;AACH,kBAAkB,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;AAE3D;;;;;;;GAOG;AACH,kBAAkB,CAAC,YAAY,GAAG,YAAY,CAAC;AAE/C;;;;;;;;;GASG;AACH,kBAAkB,CAAC,gCAAgC;IACjD,gCAAgC,CAAC;AAEnC;;;;;;;;;;;;GAYG;AACH,kBAAkB,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;AAE3D;;;;;;;;;;;GAWG;AACH,kBAAkB,CAAC,mBAAmB,GAAG,mBAAmB,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 { tokens } from '@neo4j-ndl/base';\nimport { IconButtonArray, useNeedleTheme } from '@neo4j-ndl/react';\nimport type NVL from '@neo4j-nvl/base';\nimport { type Layout, type NvlOptions } from '@neo4j-nvl/base';\nimport {\n InteractiveNvlWrapper,\n type InteractiveNvlWrapperProps,\n} from '@neo4j-nvl/react';\nimport { default as cx } from 'classnames';\nimport React, { useEffect, useId, useMemo, useState } from 'react';\n\nimport {\n BoxSelectButton,\n DownloadButton,\n GestureSelectButton,\n LassoSelectButton,\n LayoutSelectButton,\n SearchButton,\n SingleSelectButton,\n ToggleSidePanelButton,\n ZoomInButton,\n ZoomOutButton,\n ZoomToFitButton,\n} from './graph-visualization-buttons';\nimport {\n type Gesture,\n type GraphSelection,\n GraphVisualizationContext,\n type InteractionMode,\n type NeoNode,\n type NeoRel,\n type Sidepanel,\n} from './graph-visualization-context';\nimport { GraphVisualizationSidepanel } from './graph-visualization-sidepanel';\nimport { SingleSelectionSidepanelContents } from './sidepanel-components/single-selection-sidepanel-contents';\nimport { type GraphStyleRule } from './styling/style-types';\nimport { useGraphData } from './styling/use-graph-data';\nimport { useManagedNodeState } from './use-managed-node-state';\nimport { useSemicontrolledState } from './use-semi-controlled-state';\n\ntype Placement =\n | 'top-right'\n | 'bottom-right'\n | 'top-left'\n | 'bottom-left'\n | 'bottom-center';\n\nconst PLACEMENTS: Record<Placement, string> = {\n 'bottom-left': 'ndl-graph-visualization-interaction-island ndl-bottom-left',\n 'bottom-center':\n 'ndl-graph-visualization-interaction-island ndl-bottom-center',\n 'bottom-right': 'ndl-graph-visualization-interaction-island ndl-bottom-right',\n 'top-left': 'ndl-graph-visualization-interaction-island ndl-top-left',\n 'top-right': 'ndl-graph-visualization-interaction-island ndl-top-right',\n};\n\nconst InteractionIsland = ({\n children,\n className,\n placement,\n}: {\n children: React.ReactNode;\n placement: Placement;\n className?: string;\n}) => {\n return <div className={cx(PLACEMENTS[placement], className)}>{children}</div>;\n};\n\nexport const DEFAULT_NVL_OPTIONS = {\n disableTelemetry: true,\n disableWebGL: true,\n maxZoom: 3,\n minZoom: 0.05,\n relationshipThreshold: 0.55,\n renderer: 'canvas',\n} satisfies NvlOptions;\n\ntype BackwardsCompatibleNvlOptions = NvlOptions & {\n /** @deprecated Use {@link NvlOptions.renderer} instead. */\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Matches the removed NVL option.\n useWebGL?: boolean;\n};\n\nconst DEFAULT_COMPONENTS = {\n bottomLeftIsland: null,\n bottomCenterIsland: null,\n bottomRightIsland: (\n <IconButtonArray orientation=\"vertical\" isFloating size=\"small\">\n <ZoomInButton /> <ZoomOutButton /> <ZoomToFitButton />\n </IconButtonArray>\n ),\n topLeftIsland: null,\n topRightIsland: (\n <div className=\"ndl-graph-visualization-default-download-group\">\n <DownloadButton /> <ToggleSidePanelButton />\n </div>\n ),\n};\n\nexport type GraphVisualizationProps<T extends React.ElementType = 'div'> = {\n nvlRef?: React.RefObject<NVL | null>;\n nvlOptions?: BackwardsCompatibleNvlOptions;\n sidepanel?: Sidepanel | null;\n bottomLeftIsland?: React.ReactNode;\n bottomCenterIsland?: React.ReactNode;\n bottomRightIsland?: React.ReactNode;\n topLeftIsland?: React.ReactNode;\n topRightIsland?: React.ReactNode;\n className?: string;\n style?: React.CSSProperties;\n /**\n * Optional style rules to apply to graph elements.\n * Consumer-set `color` on individual `NeoNode`/`NeoRel` objects takes precedence over rules.\n * Compared by reference — memoize the array to avoid recompiling on every render.\n */\n styleRules?: GraphStyleRule[];\n\n gesture?: Gesture;\n setGesture?: (gesture: Gesture) => void;\n selected?: GraphSelection;\n setSelected?: (newSelection: GraphSelection) => void;\n interactionMode?: InteractionMode;\n setInteractionMode?: (interactionMode: InteractionMode) => void;\n layout?: Layout;\n setLayout?: (layout: Layout) => void;\n\n portalTarget?: HTMLElement | null;\n\n nodes: NeoNode[];\n rels: NeoRel[];\n\n highlightedNodeIds?: string[];\n highlightedRelationshipIds?: string[];\n\n as?: T;\n ref?: React.ComponentPropsWithRef<T>['ref'];\n htmlAttributes?: React.HTMLAttributes<T>;\n} & InteractiveNvlWrapperProps;\n\n/**\n * A comprehensive graph visualization component for rendering Neo4j-style graphs with interactive features.\n *\n * @remarks\n * This component provides a complete graph visualization solution with built-in interaction modes,\n * selection handling, zoom controls, and an optional sidepanel. It wraps the NVL (Neo4j Visualization Library)\n * with additional UI controls and state management.\n *\n * The component supports various interaction modes including single selection, box selection, and lasso selection.\n * It also provides customizable UI islands for placing controls at different corners of the visualization.\n *\n * @example\n * Basic usage:\n * ```tsx\n * <GraphVisualization\n * nodes={nodes}\n * rels={relationships}\n * selected={selection}\n * setSelected={setSelection}\n * />\n * ```\n *\n * @example\n * With custom controls:\n * ```tsx\n * <GraphVisualization\n * nodes={nodes}\n * rels={relationships}\n * topRightIsland={<CustomControls />}\n * sidepanel={{\n * contents: <CustomSidepanel />,\n * isSidePanelOpen: true,\n * setIsSidePanelOpen: setSidepanelOpen\n * sidePanelWidth: 400,\n * onSidePanelResize: setSidepanelWidth,\n * }}\n * />\n * ```\n *\n * @example\n * With highlighting:\n * ```tsx\n * <GraphVisualization\n * nodes={nodes}\n * rels={relationships}\n * // undefined = no highlighting (default behavior)\n * // empty array = no search matches (dims all nodes)\n * // array with IDs = highlight only those items\n * highlightedNodeIds={searchResults.nodeIds}\n * highlightedRelationshipIds={searchResults.relationshipIds}\n * />\n * ```\n *\n * @param props - {@link GraphVisualizationProps}\n * @returns A React component that renders an interactive graph visualization\n *\n * @alpha\n */\nexport function GraphVisualization<T extends React.ElementType = 'div'>({\n nvlRef: rawNvlRef,\n nvlCallbacks,\n nvlOptions: rawNvlOptions,\n sidepanel: rawSidepanel,\n nodes: rawNodes,\n rels: rawRels,\n highlightedNodeIds,\n highlightedRelationshipIds,\n topLeftIsland = DEFAULT_COMPONENTS.topLeftIsland,\n topRightIsland = DEFAULT_COMPONENTS.topRightIsland,\n bottomLeftIsland = DEFAULT_COMPONENTS.bottomLeftIsland,\n bottomCenterIsland = DEFAULT_COMPONENTS.bottomCenterIsland,\n bottomRightIsland = DEFAULT_COMPONENTS.bottomRightIsland,\n gesture = 'single',\n setGesture,\n layout: rawLayout,\n\n layoutOptions,\n setLayout: rawSetLayout,\n portalTarget,\n selected: rawSelected,\n setSelected: rawSetSelected,\n interactionMode: rawInteractionMode,\n setInteractionMode: rawSetInteractionMode,\n mouseEventCallbacks = {},\n className,\n style,\n htmlAttributes,\n ref,\n as,\n styleRules,\n ...restProps\n}: GraphVisualizationProps<T>) {\n const { useWebGL: isWebGLEnabled, ...nvlOptions } = rawNvlOptions ?? {};\n nvlOptions.renderer =\n nvlOptions.renderer ??\n (isWebGLEnabled === true ? 'webgl' : DEFAULT_NVL_OPTIONS.renderer);\n\n const nvlRef = useMemo(\n () => rawNvlRef ?? React.createRef<NVL>(),\n [rawNvlRef],\n );\n\n const instanceId = useId();\n\n // Respect NDL theme changes\n const { theme } = useNeedleTheme();\n const { bg, border, text } = tokens.theme[theme].color.neutral;\n\n // key required for nvl react responsiveness\n const [key, setKey] = useState(0);\n useEffect(() => {\n setKey((prevKey) => prevKey + 1);\n }, [theme]);\n\n const { styledGraph, metadataLookup, compiledStyleRules } = useGraphData(\n rawNodes,\n rawRels,\n styleRules,\n );\n\n // Semi-control interaction mode and selection state\n const [interactionMode, setInteractionMode] = useSemicontrolledState({\n isControlled: rawInteractionMode !== undefined,\n onChange: rawSetInteractionMode,\n state: rawInteractionMode ?? 'select',\n });\n const [selected, setSelected] = useSemicontrolledState({\n isControlled: rawSelected !== undefined,\n onChange: rawSetSelected,\n state: rawSelected ?? { nodeIds: [], relationshipIds: [] },\n });\n const [layout, setLayout] = useSemicontrolledState({\n isControlled: rawLayout !== undefined,\n onChange: rawSetLayout,\n state: rawLayout ?? 'd3Force',\n });\n\n const { nodesWithState, relsWithState, wrappedMouseEventCallbacks } =\n useManagedNodeState({\n gesture,\n highlightedNodeIds,\n highlightedRelationshipIds,\n interactionMode,\n mouseEventCallbacks,\n nvlGraph: styledGraph,\n selected,\n setInteractionMode,\n setSelected,\n });\n\n const [isSidePanelOpen, setIsSidePanelOpen] = useSemicontrolledState({\n isControlled: rawSidepanel?.isSidePanelOpen !== undefined,\n onChange: rawSidepanel?.setIsSidePanelOpen,\n state: rawSidepanel?.isSidePanelOpen ?? true,\n });\n const [sidePanelWidth, setSidePanelWidth] = useSemicontrolledState({\n isControlled: rawSidepanel?.sidePanelWidth !== undefined,\n onChange: rawSidepanel?.onSidePanelResize,\n state: rawSidepanel?.sidePanelWidth ?? 400,\n });\n\n const sidepanel = useMemo((): Sidepanel | null => {\n if (rawSidepanel === undefined) {\n return {\n children: <GraphVisualization.SingleSelectionSidePanelContents />,\n isSidePanelOpen,\n onSidePanelResize: setSidePanelWidth,\n setIsSidePanelOpen,\n sidePanelWidth,\n };\n }\n return rawSidepanel;\n }, [\n rawSidepanel,\n isSidePanelOpen,\n setIsSidePanelOpen,\n sidePanelWidth,\n setSidePanelWidth,\n ]);\n\n const Component: React.ElementType = as ?? 'div';\n return (\n <Component\n ref={ref}\n className={cx('ndl-graph-visualization-container', className)}\n style={style}\n {...htmlAttributes}\n >\n <GraphVisualizationContext.Provider\n value={{\n compiledStyleRules,\n gesture,\n interactionMode,\n layout,\n metadataLookup,\n nvlGraph: styledGraph,\n nvlInstance: nvlRef,\n portalTarget,\n selected,\n setGesture,\n setLayout,\n sidepanel,\n }}\n >\n <div className=\"ndl-graph-visualization\">\n <InteractiveNvlWrapper\n key={key}\n nodes={nodesWithState}\n rels={relsWithState}\n nvlOptions={{\n ...DEFAULT_NVL_OPTIONS,\n instanceId,\n styling: {\n defaultRelationshipColor: border.strongest,\n disabledItemColor: bg.strong,\n disabledItemFontColor: text.weakest,\n dropShadowColor: border.weak,\n selectedInnerBorderColor: bg.default,\n },\n ...nvlOptions,\n layout,\n layoutOptions: layoutOptions ?? nvlOptions.layoutOptions,\n }}\n nvlCallbacks={{\n onLayoutComputing(isComputing) {\n if (!isComputing) {\n nvlRef.current?.fit(\n nvlRef.current.getNodes().map((neighbors) => neighbors.id),\n { noPan: true },\n );\n }\n },\n ...nvlCallbacks,\n }}\n mouseEventCallbacks={wrappedMouseEventCallbacks}\n ref={nvlRef}\n {...restProps}\n />\n {topLeftIsland !== null && (\n <InteractionIsland placement=\"top-left\">\n {topLeftIsland}\n </InteractionIsland>\n )}\n\n {topRightIsland !== null && (\n <InteractionIsland placement=\"top-right\">\n {topRightIsland}\n </InteractionIsland>\n )}\n\n {bottomLeftIsland !== null && (\n <InteractionIsland placement=\"bottom-left\">\n {bottomLeftIsland}\n </InteractionIsland>\n )}\n\n {bottomCenterIsland !== null && (\n <InteractionIsland placement=\"bottom-center\">\n {bottomCenterIsland}\n </InteractionIsland>\n )}\n\n {bottomRightIsland !== null && (\n <InteractionIsland placement=\"bottom-right\">\n {bottomRightIsland}\n </InteractionIsland>\n )}\n </div>\n {sidepanel && <GraphVisualizationSidepanel sidepanel={sidepanel} />}\n </GraphVisualizationContext.Provider>\n </Component>\n );\n}\n\n/**\n * Zoom in button for use within a GraphVisualization component.\n *\n * @remarks\n * Increases zoom level by 1.3x\n *\n * @alpha\n */\nGraphVisualization.ZoomInButton = ZoomInButton;\n\n/**\n * Zoom out button for use within a GraphVisualization component.\n *\n * @remarks\n * Decreases zoom level by 0.7x\n *\n * @alpha\n */\nGraphVisualization.ZoomOutButton = ZoomOutButton;\n\n/**\n * Zoom to fit button for use within a GraphVisualization component.\n *\n * @remarks\n * Automatically adjusts zoom and pan to show all nodes and relationships\n *\n * @alpha\n */\nGraphVisualization.ZoomToFitButton = ZoomToFitButton;\n\n/**\n * Sidepanel toggle button for use within a GraphVisualization component.\n *\n * @remarks\n * Shows or hides the sidepanel containing node and relationship details.\n * Requires a sidepanel to be configured in the GraphVisualization component.\n *\n * @throws Error when used without a configured sidepanel\n *\n * @alpha\n */\nGraphVisualization.ToggleSidePanelButton = ToggleSidePanelButton;\n\n/**\n * Download button for use within a GraphVisualization component.\n *\n * @remarks\n * Opens a dropdown menu with download options. Supports PNG and SVG formats.\n * Captures the current visualization state including zoom level.\n *\n * @alpha\n */\nGraphVisualization.DownloadButton = DownloadButton;\n\n/**\n * Box selection button for use within a GraphVisualization component.\n *\n * @remarks\n * Enables box selection mode where dragging creates a rectangular selection area.\n * Disabled unless the `setGesture` callback is passed.\n * Shows active state when enabled and supports keyboard shortcut 'B'.\n *\n * @alpha\n */\nGraphVisualization.BoxSelectButton = BoxSelectButton;\n\n/**\n * Lasso selection button for use within a GraphVisualization component.\n *\n * @remarks\n * Enables lasso selection mode where dragging creates a free-form selection area.\n * Disabled unless the `setGesture` callback is passed.\n * Shows active state when enabled and supports keyboard shortcut 'L'.\n *\n * @alpha\n */\nGraphVisualization.LassoSelectButton = LassoSelectButton;\n\n/**\n * Single node selection button for use within a GraphVisualization component.\n *\n * @remarks\n * Enables single selection mode where clicking selects individual nodes or relationships.\n * Shows active state when enabled and supports keyboard shortcut 'S'.\n *\n * @alpha\n */\nGraphVisualization.SingleSelectButton = SingleSelectButton;\n\n/**\n * Search button for use within a GraphVisualization component.\n *\n * @remarks\n * Enables search mode where clicking opens a search input for filtering nodes and relationships.\n *\n * @alpha\n */\nGraphVisualization.SearchButton = SearchButton;\n\n/**\n * Single node selection side panel for use within a GraphVisualization component.\n *\n * @remarks\n * Displays detailed information about the selected node or relationship.\n * Panel is automatically opened when a node or relationship is selected.\n * Also when user click on the show panel button in the top right corner.\n *\n * @alpha\n */\nGraphVisualization.SingleSelectionSidePanelContents =\n SingleSelectionSidepanelContents;\n\n/**\n * Layout selection button for use within a GraphVisualization component.\n *\n * @remarks\n * Opens a menu to select different graph layout algorithms.\n *\n * By default, the menu includes the **force-based** (`d3Force`) and\n * **hierarchical** layouts. Additional layouts can be enabled via configuration.\n *\n * @see {@link LayoutSelectOption} for the full set of layout options supported by NVL.\n *\n * @alpha\n */\nGraphVisualization.LayoutSelectButton = LayoutSelectButton;\n\n/**\n * Gesture selection button for use within a GraphVisualization component.\n *\n * @remarks\n * Opens a menu to select different interaction gestures.\n *\n * By default, the menu includes **single**, **box**, and **lasso** selection gestures.\n *\n * @see {@link GestureSelectOption} for the full set of gesture options supported by NVL.\n *\n * @alpha\n */\nGraphVisualization.GestureSelectButton = GestureSelectButton;\n"]}
package/lib/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /**
1
+ /*!
2
2
  *
3
3
  * Copyright (c) "Neo4j"
4
4
  * Neo4j Sweden AB [http://neo4j.com]
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EACL,4BAA4B,GAe7B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAqBzD,OAAO,EACL,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,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\nexport { GraphVisualization } from './graph-visualization';\nexport {\n useGraphVisualizationContext,\n type ColorCount,\n type Gesture,\n type GraphItemMetaData,\n type GraphSelection,\n type GraphVisualizationContextData,\n type InteractionMode,\n type MetadataLookupTable,\n type NeoNode,\n type NeoRel,\n type NodeData,\n type NvlGraph,\n type PortableProperty,\n type RelData,\n type Sidepanel,\n} from './graph-visualization-context';\nexport { isGraphStyleRule } from './styling/style-types';\nexport type {\n GraphStyleRule,\n GraphBigintLiteral,\n GraphNumericLiteral,\n GraphRangeLiteral,\n Style as GraphStyle,\n Where as GraphWhere,\n Value as GraphValue,\n CypherValue as GraphCypherValue,\n Caption as GraphCaption,\n CaptionValue as GraphCaptionValue,\n CaptionVariation as GraphCaptionVariation,\n ColorRange as GraphColorRange,\n SizeRange as GraphSizeRange,\n WidthRange as GraphWidthRange,\n UniqueColors as GraphUniqueColors,\n DatetimeLiteral as GraphDatetimeLiteral,\n LocalDatetimeLiteral as GraphLocalDatetimeLiteral,\n TimeLiteral as GraphTimeLiteral,\n} from './styling/style-types';\nexport {\n compileGraphStyleRules,\n doesGraphStyleRuleMatch,\n} from './styling/compile-graph-styles';\nexport { parseStyleRules } from './styling/parse-style-rules';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EACL,4BAA4B,GAe7B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAqBzD,OAAO,EACL,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,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\nexport { GraphVisualization } from './graph-visualization';\nexport {\n useGraphVisualizationContext,\n type ColorCount,\n type Gesture,\n type GraphItemMetaData,\n type GraphSelection,\n type GraphVisualizationContextData,\n type InteractionMode,\n type MetadataLookupTable,\n type NeoNode,\n type NeoRel,\n type NodeData,\n type NvlGraph,\n type PortableProperty,\n type RelData,\n type Sidepanel,\n} from './graph-visualization-context';\nexport { isGraphStyleRule } from './styling/style-types';\nexport type {\n GraphStyleRule,\n GraphBigintLiteral,\n GraphNumericLiteral,\n GraphRangeLiteral,\n Style as GraphStyle,\n Where as GraphWhere,\n Value as GraphValue,\n CypherValue as GraphCypherValue,\n Caption as GraphCaption,\n CaptionValue as GraphCaptionValue,\n CaptionVariation as GraphCaptionVariation,\n ColorRange as GraphColorRange,\n SizeRange as GraphSizeRange,\n WidthRange as GraphWidthRange,\n UniqueColors as GraphUniqueColors,\n DatetimeLiteral as GraphDatetimeLiteral,\n LocalDatetimeLiteral as GraphLocalDatetimeLiteral,\n TimeLiteral as GraphTimeLiteral,\n} from './styling/style-types';\nexport {\n compileGraphStyleRules,\n doesGraphStyleRuleMatch,\n} from './styling/compile-graph-styles';\nexport { parseStyleRules } from './styling/parse-style-rules';\n"]}
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- /**
2
+ /*!
3
3
  *
4
4
  * Copyright (c) "Neo4j"
5
5
  * Neo4j Sweden AB [http://neo4j.com]
@@ -1 +1 @@
1
- {"version":3,"file":"button-group.js","sourceRoot":"","sources":["../../../src/sidepanel-components/button-group.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,EACZ,YAAY,EACZ,WAAW,EACX,OAAO,EACP,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AAEf,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAAE,QAAQ,EAAiC,EAAE,EAAE;IACzE,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IACtD,MAAM,SAAS,GAAG,MAAM,CAAmB,IAAI,CAAC,CAAC;IAEjD,MAAM,YAAY,GAAG,CAAC,KAAa,EAAE,EAAE;;QACrC,MAAM,KAAK,GAAG,MAAA,MAAA,SAAS,CAAC,OAAO,0CAAE,QAAQ,CAAC,KAAK,CAAC,0CAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;QAE9D,IAAI,KAAK,YAAY,WAAW,EAA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O,CAAC,CAAC;IACxB,CAAC,CAAC;IAEF,OAAO;IACL,2EAA2E;IAC3E,aACE,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,EAC1C,GAAG,EAAE,SAAS,EACd,KAAK,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,YAE/C,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;YAC7C,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC;gBACjC,OAAO,IAAI,CAAC;YACd,CAAC;YAED,MAAM,aAAa,GAAG,YAAY,CAAC,KAAK,EAAE;gBACxC,QAAQ,EAAE,aAAa,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;aACN,CAAC,CAAC;YAExC,OAAO,uBAAiB,aAAa,IAArB,KAAK,CAAsB,CAAC;QAC9C,CAAC,CAAC,GACC,CACN,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 */\n\nimport React, {\n cloneElement,\n useCallback,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nexport const ButtonGroup = ({ children }: { children: React.ReactNode }) => {\n const [selectedIndex, setSelectedIndex] = useState(0);\n const parentRef = useRef<HTMLUListElement>(null);\n\n const focusElement = (index: number) => {\n const child = parentRef.current?.children[index]?.children[0];\n\n if (child instanceof HTMLElement) {\n child.focus();\n }\n };\n\n const childrenCount = useMemo(\n () => React.Children.count(children),\n [children],\n );\n const safeSetSelectedIndex = useCallback(\n (index: number) => {\n if (index >= childrenCount) {\n setSelectedIndex(childrenCount - 1);\n } else {\n setSelectedIndex(Math.max(0, index));\n }\n },\n [childrenCount, setSelectedIndex],\n );\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLUListElement>) => {\n let newIndx = selectedIndex;\n if (event.key === 'ArrowRight' || event.key === 'ArrowDown') {\n newIndx = (selectedIndex + 1) % React.Children.count(children);\n safeSetSelectedIndex(newIndx);\n } else if (event.key === 'ArrowLeft' || event.key === 'ArrowUp') {\n newIndx =\n (selectedIndex - 1 + React.Children.count(children)) %\n React.Children.count(children);\n safeSetSelectedIndex(newIndx);\n }\n // set focus to new button\n focusElement(newIndx);\n };\n\n return (\n // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions\n <ul\n onKeyDown={(event) => handleKeyDown(event)}\n ref={parentRef}\n style={{ all: 'inherit', listStyleType: 'none' }}\n >\n {React.Children.map(children, (child, index) => {\n if (!React.isValidElement(child)) {\n return null;\n }\n\n const clonedElement = cloneElement(child, {\n tabIndex: selectedIndex === index ? 0 : -1,\n } as React.HTMLAttributes<HTMLElement>);\n\n return <li key={index}>{clonedElement}</li>;\n })}\n </ul>\n );\n};\n"]}
1
+ {"version":3,"file":"button-group.js","sourceRoot":"","sources":["../../../src/sidepanel-components/button-group.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,EACZ,YAAY,EACZ,WAAW,EACX,OAAO,EACP,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AAEf,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAAE,QAAQ,EAAiC,EAAE,EAAE;IACzE,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAA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W,IAAI,KAAK,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;YAChE,OAAO;gBACL,CAAC,aAAa,GAAG,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;oBACpD,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;YACjC,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAChC,CAAC;QACD,0BAA0B;QAC1B,YAAY,CAAC,OAAO,CAAC,CAAC;IACxB,CAAC,CAAC;IAEF,OAAO;IACL,2EAA2E;IAC3E,aACE,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,EAC1C,GAAG,EAAE,SAAS,EACd,KAAK,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,YAE/C,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;YAC7C,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC;gBACjC,OAAO,IAAI,CAAC;YACd,CAAC;YAED,MAAM,aAAa,GAAG,YAAY,CAAC,KAAK,EAAE;gBACxC,QAAQ,EAAE,aAAa,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;aACN,CAAC,CAAC;YAExC,OAAO,uBAAiB,aAAa,IAArB,KAAK,CAAsB,CAAC;QAC9C,CAAC,CAAC,GACC,CACN,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 */\n\nimport React, {\n cloneElement,\n useCallback,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nexport const ButtonGroup = ({ children }: { children: React.ReactNode }) => {\n const [selectedIndex, setSelectedIndex] = useState(0);\n const parentRef = useRef<HTMLUListElement>(null);\n\n const focusElement = (index: number) => {\n const child = parentRef.current?.children[index]?.children[0];\n\n if (child instanceof HTMLElement) {\n child.focus();\n }\n };\n\n const childrenCount = useMemo(\n () => React.Children.count(children),\n [children],\n );\n const safeSetSelectedIndex = useCallback(\n (index: number) => {\n if (index >= childrenCount) {\n setSelectedIndex(childrenCount - 1);\n } else {\n setSelectedIndex(Math.max(0, index));\n }\n },\n [childrenCount, setSelectedIndex],\n );\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLUListElement>) => {\n let newIndx = selectedIndex;\n if (event.key === 'ArrowRight' || event.key === 'ArrowDown') {\n newIndx = (selectedIndex + 1) % React.Children.count(children);\n safeSetSelectedIndex(newIndx);\n } else if (event.key === 'ArrowLeft' || event.key === 'ArrowUp') {\n newIndx =\n (selectedIndex - 1 + React.Children.count(children)) %\n React.Children.count(children);\n safeSetSelectedIndex(newIndx);\n }\n // set focus to new button\n focusElement(newIndx);\n };\n\n return (\n // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions\n <ul\n onKeyDown={(event) => handleKeyDown(event)}\n ref={parentRef}\n style={{ all: 'inherit', listStyleType: 'none' }}\n >\n {React.Children.map(children, (child, index) => {\n if (!React.isValidElement(child)) {\n return null;\n }\n\n const clonedElement = cloneElement(child, {\n tabIndex: selectedIndex === index ? 0 : -1,\n } as React.HTMLAttributes<HTMLElement>);\n\n return <li key={index}>{clonedElement}</li>;\n })}\n </ul>\n );\n};\n"]}
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- /**
2
+ /*!
3
3
  *
4
4
  * Copyright (c) "Neo4j"
5
5
  * Neo4j Sweden AB [http://neo4j.com]
@@ -1 +1 @@
1
- {"version":3,"file":"clickable-urls.js","sourceRoot":"","sources":["../../../src/sidepanel-components/clickable-urls.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,gEAAgE;AAChE,MAAM,SAAS;AACb,2BAA2B;AAC3B,oKAAoK,CAAC;AAMvK,MAAM,sBAAsB,GAAG,CAAC,EAAE,IAAI,EAAsB,EAAE,EAAE;;IAC9D,MAAM,WAAW,GAAG,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,EAAE,CAAC;IAC/B,MAAM,IAAI,GAAG,MAAA,WAAW,CAAC,KAAK,CAAC,SAAS,CAAC,mCAAI,EAAE,CAAC;IAEhD,OAAO,CACL,4BACG,WAAW,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE;YACpD,kEAAkE;YAClE,OAAO,CACL,MAAC,KAAK,CAAC,QAAQ,eACZ,QAAQ,EACR,IAAI,CAAC,KAAK,CAAC,IAAI;oBACd,2BAA2B;oBAC3B,qDAAqD;oBACrD,YACE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,EACjB,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,qBAAqB,EACzB,SAAS,EAAC,iBAAiB,YAE1B,IAAI,CAAC,KAAK,CAAC,GACV,CACL,KAbkB,iBAAiB,KAAK,EAAE,CAc5B,CAClB,CAAC;QACJ,CAAC,CAAC,GACD,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,CAAC,IAAI,CAAC,sBAAsB,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 React from 'react';\n\n// credits to https://www.regextester.com/96504, modified though\nconst URL_REGEX =\n // eslint-disable-next-line\n /(?:https?|s?ftp|bolt):\\/\\/(?:(?:[^\\s()<>]+|\\((?:[^\\s()<>]+|(?:\\([^\\s()<>]+\\)))?\\))+(?:\\((?:[^\\s()<>]+|(?:\\(?:[^\\s()<>]+\\)))?\\)|[^\\s`!()\\[\\]{};:'\".,<>?«»“”‘’]))?/gi;\n\ninterface ClickableUrlsProps {\n text?: string | null;\n}\n\nconst ClickableUrlsComponent = ({ text }: ClickableUrlsProps) => {\n const definedText = text ?? '';\n const urls = definedText.match(URL_REGEX) ?? [];\n\n return (\n <>\n {definedText.split(URL_REGEX).map((textPart, index) => {\n /* since we never move these components this key should be fine */\n return (\n <React.Fragment key={`clickable-url-${index}`}>\n {textPart}\n {urls[index] && (\n // Should be safe from XSS.\n // Ref: https://mathiasbynens.github.io/rel-noopener/\n <a\n href={urls[index]}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"hover:underline\"\n >\n {urls[index]}\n </a>\n )}\n </React.Fragment>\n );\n })}\n </>\n );\n};\n\nexport const ClickableUrls = React.memo(ClickableUrlsComponent);\n"]}
1
+ {"version":3,"file":"clickable-urls.js","sourceRoot":"","sources":["../../../src/sidepanel-components/clickable-urls.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,gEAAgE;AAChE,MAAM,SAAS;AACb,2BAA2B;AAC3B,oKAAoK,CAAC;AAMvK,MAAM,sBAAsB,GAAG,CAAC,EAAE,IAAI,EAAsB,EAAE,EAAE;;IAC9D,MAAM,WAAW,GAAG,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,EAAE,CAAC;IAC/B,MAAM,IAAI,GAAG,MAAA,WAAW,CAAC,KAAK,CAAC,SAAS,CAAC,mCAAI,EAAE,CAAC;IAEhD,OAAO,CACL,4BACG,WAAW,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE;YACpD,kEAAkE;YAClE,OAAO,CACL,MAAC,KAAK,CAAC,QAAQ,eACZ,QAAQ,EACR,IAAI,CAAC,KAAK,CAAC,IAAI;oBACd,2BAA2B;oBAC3B,qDAAqD;oBACrD,YACE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,EACjB,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,qBAAqB,EACzB,SAAS,EAAC,iBAAiB,YAE1B,IAAI,CAAC,KAAK,CAAC,GACV,CACL,KAbkB,iBAAiB,KAAK,EAAE,CAc5B,CAClB,CAAC;QACJ,CAAC,CAAC,GACD,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,CAAC,IAAI,CAAC,sBAAsB,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 React from 'react';\n\n// credits to https://www.regextester.com/96504, modified though\nconst URL_REGEX =\n // eslint-disable-next-line\n /(?:https?|s?ftp|bolt):\\/\\/(?:(?:[^\\s()<>]+|\\((?:[^\\s()<>]+|(?:\\([^\\s()<>]+\\)))?\\))+(?:\\((?:[^\\s()<>]+|(?:\\(?:[^\\s()<>]+\\)))?\\)|[^\\s`!()\\[\\]{};:'\".,<>?«»“”‘’]))?/gi;\n\ninterface ClickableUrlsProps {\n text?: string | null;\n}\n\nconst ClickableUrlsComponent = ({ text }: ClickableUrlsProps) => {\n const definedText = text ?? '';\n const urls = definedText.match(URL_REGEX) ?? [];\n\n return (\n <>\n {definedText.split(URL_REGEX).map((textPart, index) => {\n /* since we never move these components this key should be fine */\n return (\n <React.Fragment key={`clickable-url-${index}`}>\n {textPart}\n {urls[index] && (\n // Should be safe from XSS.\n // Ref: https://mathiasbynens.github.io/rel-noopener/\n <a\n href={urls[index]}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"hover:underline\"\n >\n {urls[index]}\n </a>\n )}\n </React.Fragment>\n );\n })}\n </>\n );\n};\n\nexport const ClickableUrls = React.memo(ClickableUrlsComponent);\n"]}
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- /**
2
+ /*!
3
3
  *
4
4
  * Copyright (c) "Neo4j"
5
5
  * Neo4j Sweden AB [http://neo4j.com]
@@ -1 +1 @@
1
- {"version":3,"file":"details-panel.js","sourceRoot":"","sources":["../../../src/sidepanel-components/details-panel.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,EAGL,4BAA4B,GAC7B,MAAM,gCAAgC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C,KAAK,EAAE,EAAE,CAAC,CAC5C,KAAC,iBAAiB,IAEhB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAC,MAAM,EACX,QAAQ,EAAE,cAAc,CAAC,aAAa,CAAC,KAAK,CAAC,EAC7C,QAAQ,EAAE,CAAC,IAJN,KAAK,CAKV,CACH,CAAC,CACH,CAAC,CAAC,CAAC,CACF,KAAC,iBAAiB,IAChB,KAAK,EAAE,YAAY,CAAC,IAAI,CAAC,IAAI,EAC7B,IAAI,EAAC,cAAc,EACnB,QAAQ,EAAE,cAAc,CAAC,eAAe,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAChE,QAAQ,EAAE,CAAC,GACX,CACH,GACG,EAEN,cAAK,SAAS,EAAC,qBAAqB,GAAG,EACvC,KAAC,eAAe,IACd,UAAU,EAAE,YAAY,CAAC,IAAI,CAAC,UAAU,EACxC,SAAS,EAAE,SAAS,GACpB,IACkC,IACrC,CACJ,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 */\n\nimport { ClipboardButton } from '@neo4j-ndl/react';\nimport { useMemo } from 'react';\n\nimport {\n type NodeData,\n type RelData,\n useGraphVisualizationContext,\n} from '../graph-visualization-context';\nimport { GraphVisualizationSidepanel } from '../graph-visualization-sidepanel';\nimport { GraphLabelWrapper } from './graph-label-wrapper';\nimport { PropertiesTable } from './properties-table';\n\ntype DetailPanelProps = {\n paneWidth?: number;\n};\n\ntype SelectedItem =\n | { dataType: 'node'; data: NodeData }\n | { dataType: 'relationship'; data: RelData };\n\nexport const DetailsPanel = ({ paneWidth = 400 }: DetailPanelProps) => {\n const { selected, nvlGraph, metadataLookup } = useGraphVisualizationContext();\n\n const nodeData = useMemo(() => {\n const [nodeId] = selected.nodeIds;\n if (nodeId !== undefined) {\n return nvlGraph.nodeData[nodeId];\n }\n\n return undefined;\n }, [selected, nvlGraph]);\n\n const relData = useMemo(() => {\n const [relId] = selected.relationshipIds;\n if (relId !== undefined) {\n return nvlGraph.relData[relId];\n }\n\n return undefined;\n }, [selected, nvlGraph]);\n\n const selectedItem = useMemo((): SelectedItem | undefined => {\n if (nodeData) {\n return { data: nodeData, dataType: 'node' };\n }\n\n if (relData) {\n return { data: relData, dataType: 'relationship' };\n }\n\n return undefined;\n }, [nodeData, relData]);\n\n if (selectedItem === undefined) {\n return null;\n }\n\n const properties = [\n {\n key: '<id>',\n type: 'String',\n value: `${selectedItem.data.id}`,\n },\n ...Object.keys(selectedItem.data.properties).map((key) => {\n return {\n key: key,\n type: selectedItem.data.properties[key].type,\n value: selectedItem.data.properties[key].stringified,\n };\n }),\n ];\n\n return (\n <>\n <GraphVisualizationSidepanel.Title>\n <h6 className=\"ndl-details-title\">\n {selectedItem.dataType === 'node'\n ? 'Node details'\n : 'Relationship details'}\n </h6>\n <ClipboardButton\n textToCopy={properties\n .map((prop) => `${prop.key}: ${prop.value}`)\n .join('\\n')}\n size=\"small\"\n />\n </GraphVisualizationSidepanel.Title>\n <GraphVisualizationSidepanel.Content>\n <div className=\"ndl-details-tags\">\n {selectedItem.dataType === 'node' ? (\n selectedItem.data.labelsSorted.map((label) => (\n <GraphLabelWrapper\n key={label}\n label={label}\n type=\"node\"\n metaData={metadataLookup.labelMetaData[label]}\n tabIndex={0}\n />\n ))\n ) : (\n <GraphLabelWrapper\n label={selectedItem.data.type}\n type=\"relationship\"\n metaData={metadataLookup.reltypeMetaData[selectedItem.data.type]}\n tabIndex={0}\n />\n )}\n </div>\n {/* Divider */}\n <div className=\"ndl-details-divider\" />\n <PropertiesTable\n properties={selectedItem.data.properties}\n paneWidth={paneWidth}\n />\n </GraphVisualizationSidepanel.Content>\n </>\n );\n};\n"]}
1
+ {"version":3,"file":"details-panel.js","sourceRoot":"","sources":["../../../src/sidepanel-components/details-panel.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,EAGL,4BAA4B,GAC7B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAUrD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAAE,SAAS,GAAG,GAAG,EAAoB,EAAE,EAAE;IACpE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,4BAA4B,EAAE,CAAC;IAE9E,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,EAAE;QAC5B,MAAM,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC;QAClC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,OAAO,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QACnC,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;IAEzB,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,EAAE;QAC3B,MAAM,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,eAAe,CAAC;QACzC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,OAAO,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AAC,CAAC,sBAAsB,GACvB,EACL,KAAC,eAAe,IACd,UAAU,EAAE,UAAU;6BACnB,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,KAAK,IAAI,CAAC,KAAK,EAAE,CAAC;6BAC3C,IAAI,CAAC,IAAI,CAAC,EACb,IAAI,EAAC,OAAO,GACZ,IACgC,EACpC,MAAC,2BAA2B,CAAC,OAAO,eAClC,cAAK,SAAS,EAAC,kBAAkB,YAC9B,YAAY,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,CAClC,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAC5C,KAAC,iBAAiB,IAEhB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAC,MAAM,EACX,QAAQ,EAAE,cAAc,CAAC,aAAa,CAAC,KAAK,CAAC,EAC7C,QAAQ,EAAE,CAAC,IAJN,KAAK,CAKV,CACH,CAAC,CACH,CAAC,CAAC,CAAC,CACF,KAAC,iBAAiB,IAChB,KAAK,EAAE,YAAY,CAAC,IAAI,CAAC,IAAI,EAC7B,IAAI,EAAC,cAAc,EACnB,QAAQ,EAAE,cAAc,CAAC,eAAe,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAChE,QAAQ,EAAE,CAAC,GACX,CACH,GACG,EAEN,cAAK,SAAS,EAAC,qBAAqB,GAAG,EACvC,KAAC,eAAe,IACd,UAAU,EAAE,YAAY,CAAC,IAAI,CAAC,UAAU,EACxC,SAAS,EAAE,SAAS,GACpB,IACkC,IACrC,CACJ,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 */\n\nimport { ClipboardButton } from '@neo4j-ndl/react';\nimport { useMemo } from 'react';\n\nimport {\n type NodeData,\n type RelData,\n useGraphVisualizationContext,\n} from '../graph-visualization-context';\nimport { GraphVisualizationSidepanel } from '../graph-visualization-sidepanel';\nimport { GraphLabelWrapper } from './graph-label-wrapper';\nimport { PropertiesTable } from './properties-table';\n\ntype DetailPanelProps = {\n paneWidth?: number;\n};\n\ntype SelectedItem =\n | { dataType: 'node'; data: NodeData }\n | { dataType: 'relationship'; data: RelData };\n\nexport const DetailsPanel = ({ paneWidth = 400 }: DetailPanelProps) => {\n const { selected, nvlGraph, metadataLookup } = useGraphVisualizationContext();\n\n const nodeData = useMemo(() => {\n const [nodeId] = selected.nodeIds;\n if (nodeId !== undefined) {\n return nvlGraph.nodeData[nodeId];\n }\n\n return undefined;\n }, [selected, nvlGraph]);\n\n const relData = useMemo(() => {\n const [relId] = selected.relationshipIds;\n if (relId !== undefined) {\n return nvlGraph.relData[relId];\n }\n\n return undefined;\n }, [selected, nvlGraph]);\n\n const selectedItem = useMemo((): SelectedItem | undefined => {\n if (nodeData) {\n return { data: nodeData, dataType: 'node' };\n }\n\n if (relData) {\n return { data: relData, dataType: 'relationship' };\n }\n\n return undefined;\n }, [nodeData, relData]);\n\n if (selectedItem === undefined) {\n return null;\n }\n\n const properties = [\n {\n key: '<id>',\n type: 'String',\n value: `${selectedItem.data.id}`,\n },\n ...Object.keys(selectedItem.data.properties).map((key) => {\n return {\n key: key,\n type: selectedItem.data.properties[key].type,\n value: selectedItem.data.properties[key].stringified,\n };\n }),\n ];\n\n return (\n <>\n <GraphVisualizationSidepanel.Title>\n <h6 className=\"ndl-details-title\">\n {selectedItem.dataType === 'node'\n ? 'Node details'\n : 'Relationship details'}\n </h6>\n <ClipboardButton\n textToCopy={properties\n .map((prop) => `${prop.key}: ${prop.value}`)\n .join('\\n')}\n size=\"small\"\n />\n </GraphVisualizationSidepanel.Title>\n <GraphVisualizationSidepanel.Content>\n <div className=\"ndl-details-tags\">\n {selectedItem.dataType === 'node' ? (\n selectedItem.data.labelsSorted.map((label) => (\n <GraphLabelWrapper\n key={label}\n label={label}\n type=\"node\"\n metaData={metadataLookup.labelMetaData[label]}\n tabIndex={0}\n />\n ))\n ) : (\n <GraphLabelWrapper\n label={selectedItem.data.type}\n type=\"relationship\"\n metaData={metadataLookup.reltypeMetaData[selectedItem.data.type]}\n tabIndex={0}\n />\n )}\n </div>\n {/* Divider */}\n <div className=\"ndl-details-divider\" />\n <PropertiesTable\n properties={selectedItem.data.properties}\n paneWidth={paneWidth}\n />\n </GraphVisualizationSidepanel.Content>\n </>\n );\n};\n"]}
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- /**
2
+ /*!
3
3
  *
4
4
  * Copyright (c) "Neo4j"
5
5
  * Neo4j Sweden AB [http://neo4j.com]
@@ -1 +1 @@
1
- {"version":3,"file":"graph-label-wrapper.js","sourceRoot":"","sources":["../../../src/sidepanel-components/graph-label-wrapper.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,UAAU,MAAM,YAAY,CAAC;AAcpC,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAChC,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,QAAQ,GAAG,CAAC,CAAC,EACb,SAAS,GAAG,KAAK,GACM,EAAE,EAAE;;IAC3B,MAAM,OAAO,GAAG,UAAU,CAAC,gCAAgC,EAAE;QAC3D,2CAA2C,EAAE,IAAI,KAAK,cAAc;KACrE,CAAC,CAAC;IAEH,OAAO,CACL,MAAC,UAAU,IACT,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,MAAA,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,iBAAiB,CAAC,CAAC,CAAC,0CAAE,KAAK,mCAAI,EAAE,EAClD,SAAS,EAAC,yBAAyB,EACnC,EAAE,EAAC,MAAM,EACT,cAAc,EAAE;YACd,QAAQ;SACT,aAEA,CAAC,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,iBAAiB,CAAC,MAAM,mCAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAChD,KAAC,eAAe,IAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAC,MAAM,GAAG,CACvD,EACA,KAAK,EACL,SAAS,IAAI,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,UAAU,KAAI,IAAI,IAAI,KAAK,QAAQ,CAAC,UAAU,GAAG,IAC9D,CACd,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 */\n\nimport { GraphLabel, StatusIndicator } from '@neo4j-ndl/react';\nimport classNames from 'classnames';\n\nimport { type GraphItemMetaData } from '../graph-visualization-context';\n\ntype GraphLabelWrapperProps = {\n label: string;\n type: 'node' | 'relationship';\n metaData: GraphItemMetaData | undefined;\n tabIndex?: number;\n // TODO v5: fix boolean naming convention\n // eslint-disable-next-line @typescript-eslint/naming-convention\n showCount?: boolean;\n};\n\nexport const GraphLabelWrapper = ({\n label,\n type,\n metaData,\n tabIndex = -1,\n showCount = false,\n}: GraphLabelWrapperProps) => {\n const classes = classNames('ndl-graph-label-rule-indicator', {\n 'ndl-graph-label-rule-indicator-shift-left': type === 'relationship',\n });\n\n return (\n <GraphLabel\n type={type}\n color={metaData?.colorDistribution[0]?.color ?? ''}\n className=\"ndl-graph-label-wrapper\"\n as=\"span\"\n htmlAttributes={{\n tabIndex,\n }}\n >\n {(metaData?.colorDistribution.length ?? 0) > 1 && (\n <StatusIndicator className={classes} variant=\"info\" />\n )}\n {label}\n {showCount && metaData?.totalCount != null && ` (${metaData.totalCount})`}\n </GraphLabel>\n );\n};\n"]}
1
+ {"version":3,"file":"graph-label-wrapper.js","sourceRoot":"","sources":["../../../src/sidepanel-components/graph-label-wrapper.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,UAAU,MAAM,YAAY,CAAC;AAcpC,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAChC,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,QAAQ,GAAG,CAAC,CAAC,EACb,SAAS,GAAG,KAAK,GACM,EAAE,EAAE;;IAC3B,MAAM,OAAO,GAAG,UAAU,CAAC,gCAAgC,EAAE;QAC3D,2CAA2C,EAAE,IAAI,KAAK,cAAc;KACrE,CAAC,CAAC;IAEH,OAAO,CACL,MAAC,UAAU,IACT,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,MAAA,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,iBAAiB,CAAC,CAAC,CAAC,0CAAE,KAAK,mCAAI,EAAE,EAClD,SAAS,EAAC,yBAAyB,EACnC,EAAE,EAAC,MAAM,EACT,cAAc,EAAE;YACd,QAAQ;SACT,aAEA,CAAC,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,iBAAiB,CAAC,MAAM,mCAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAChD,KAAC,eAAe,IAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAC,MAAM,GAAG,CACvD,EACA,KAAK,EACL,SAAS,IAAI,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,UAAU,KAAI,IAAI,IAAI,KAAK,QAAQ,CAAC,UAAU,GAAG,IAC9D,CACd,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 */\n\nimport { GraphLabel, StatusIndicator } from '@neo4j-ndl/react';\nimport classNames from 'classnames';\n\nimport { type GraphItemMetaData } from '../graph-visualization-context';\n\ntype GraphLabelWrapperProps = {\n label: string;\n type: 'node' | 'relationship';\n metaData: GraphItemMetaData | undefined;\n tabIndex?: number;\n // TODO v5: fix boolean naming convention\n // eslint-disable-next-line @typescript-eslint/naming-convention\n showCount?: boolean;\n};\n\nexport const GraphLabelWrapper = ({\n label,\n type,\n metaData,\n tabIndex = -1,\n showCount = false,\n}: GraphLabelWrapperProps) => {\n const classes = classNames('ndl-graph-label-rule-indicator', {\n 'ndl-graph-label-rule-indicator-shift-left': type === 'relationship',\n });\n\n return (\n <GraphLabel\n type={type}\n color={metaData?.colorDistribution[0]?.color ?? ''}\n className=\"ndl-graph-label-wrapper\"\n as=\"span\"\n htmlAttributes={{\n tabIndex,\n }}\n >\n {(metaData?.colorDistribution.length ?? 0) > 1 && (\n <StatusIndicator className={classes} variant=\"info\" />\n )}\n {label}\n {showCount && metaData?.totalCount != null && ` (${metaData.totalCount})`}\n </GraphLabel>\n );\n};\n"]}
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- /**
2
+ /*!
3
3
  *
4
4
  * Copyright (c) "Neo4j"
5
5
  * Neo4j Sweden AB [http://neo4j.com]
@@ -1 +1 @@
1
- {"version":3,"file":"overview-panel.js","sourceRoot":"","sources":["../../../src/sidepanel-components/overview-panel.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE/D,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAE9B,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE;IAChC,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,4BAA4B,EAAE,CAAC;IAEpE,OAAO,CACL,8BACE,KAAC,2BAA2B,CAAC,KAAK,cAChC,KAAC,UAAU,IAAC,OAAO,EAAC,SAAS,iCAA8B,GACzB,EACpC,KAAC,2BAA2B,CAAC,OAAO,cAClC,eAAK,SAAS,EAAC,wCAAwC,aACpD,cAAc,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,CACnC,eAAK,SAAS,EAAC,sBAAsB,aACnC,cAAK,SAAS,EAAC,qBAAqB,YAClC,oCACQ,KAAK,QAAQ,CAAC,KAAK,CAAC,MAAM,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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 { StatusIndicator, Typography } from '@neo4j-ndl/react';\n\nimport { useGraphVisualizationContext } from '../graph-visualization-context';\nimport { GraphVisualizationSidepanel } from '../graph-visualization-sidepanel';\nimport { GraphLabelWrapper } from './graph-label-wrapper';\nimport { ShowAll } from './show-all';\n\nconst OVERVIEW_STEP_SIZE = 25;\n\nexport const OverviewPanel = () => {\n const { nvlGraph, metadataLookup } = useGraphVisualizationContext();\n\n return (\n <>\n <GraphVisualizationSidepanel.Title>\n <Typography variant=\"title-4\">Results overview</Typography>\n </GraphVisualizationSidepanel.Title>\n <GraphVisualizationSidepanel.Content>\n <div className=\"ndl-graph-visualization-overview-panel\">\n {metadataLookup.labels.length > 0 && (\n <div className=\"ndl-overview-section\">\n <div className=\"ndl-overview-header\">\n <span>\n Nodes{` (${nvlGraph.nodes.length.toLocaleString()})`}\n </span>\n </div>\n <div className=\"ndl-overview-items\">\n <ShowAll initiallyShown={OVERVIEW_STEP_SIZE} isButtonGroup>\n {metadataLookup.labels.map((label) => (\n <GraphLabelWrapper\n key={label}\n label={label}\n type=\"node\"\n metaData={metadataLookup.labelMetaData[label]}\n showCount\n />\n ))}\n </ShowAll>\n </div>\n </div>\n )}\n\n {metadataLookup.reltypes.length > 0 && (\n <div className=\"ndl-overview-relationships-section\">\n <span className=\"ndl-overview-relationships-title\">\n Relationships{` (${nvlGraph.rels.length.toLocaleString()})`}\n </span>\n <div className=\"ndl-overview-items\">\n <ShowAll initiallyShown={OVERVIEW_STEP_SIZE} isButtonGroup>\n {metadataLookup.reltypes.map((type) => (\n <GraphLabelWrapper\n key={type}\n label={type}\n type=\"relationship\"\n metaData={metadataLookup.reltypeMetaData[type]}\n showCount\n />\n ))}\n </ShowAll>\n </div>\n </div>\n )}\n\n {metadataLookup.hasMultipleColors && (\n <div className=\"ndl-overview-hint\">\n <StatusIndicator variant=\"info\" />\n <Typography variant=\"body-small\">\n indicates color may not match\n </Typography>\n </div>\n )}\n </div>\n </GraphVisualizationSidepanel.Content>\n </>\n );\n};\n"]}
1
+ {"version":3,"file":"overview-panel.js","sourceRoot":"","sources":["../../../src/sidepanel-components/overview-panel.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE/D,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAE9B,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE;IAChC,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,4BAA4B,EAAE,CAAC;IAEpE,OAAO,CACL,8BACE,KAAC,2BAA2B,CAAC,KAAK,cAChC,KAAC,UAAU,IAAC,OAAO,EAAC,SAAS,iCAA8B,GACzB,EACpC,KAAC,2BAA2B,CAAC,OAAO,cAClC,eAAK,SAAS,EAAC,wCAAwC,aACpD,cAAc,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,CACnC,eAAK,SAAS,EAAC,sBAAsB,aACnC,cAAK,SAAS,EAAC,qBAAqB,YAClC,oCACQ,KAAK,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,cAAc,EAAE,GAAG,IAC/C,GACH,EACN,cAAK,SAAS,EAAC,oBAAoB,YACjC,KAAC,OAAO,IAAC,cAAc,EAAE,kBAAkB,EAAE,aAAa,kBACvD,cAAc,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CACpC,KAAC,iBAAiB,IAEhB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAC,MAAM,EACX,QAAQ,EAAE,cAAc,CAAC,aAAa,CAAC,KAAK,CAAC,EAC7C,SAAS,UAJJ,KAAK,CAKV,CACH,CAAC,GACM,GACN,IACF,CACP,EAEA,cAAc,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,CACrC,eAAK,SAAS,EAAC,oCAAoC,aACjD,gBAAM,SAAS,EAAC,kCAAkC,8BAClC,KAAK,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,GAAG,IACtD,EACP,cAAK,SAAS,EAAC,oBAAoB,YACjC,KAAC,OAAO,IAAC,cAAc,EAAE,kBAAkB,EAAE,aAAa,kBACvD,cAAc,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACrC,KAAC,iBAAiB,IAEhB,KAAK,EAAE,IAAI,EACX,IAAI,EAAC,cAAc,EACnB,QAAQ,EAAE,cAAc,CAAC,eAAe,CAAC,IAAI,CAAC,EAC9C,SAAS,UAJJ,IAAI,CAKT,CACH,CAAC,GACM,GACN,IACF,CACP,EAEA,cAAc,CAAC,iBAAiB,IAAI,CACnC,eAAK,SAAS,EAAC,mBAAmB,aAChC,KAAC,eAAe,IAAC,OAAO,EAAC,MAAM,GAAG,EAClC,KAAC,UAAU,IAAC,OAAO,EAAC,YAAY,8CAEnB,IACT,CACP,IACG,GAC8B,IACrC,CACJ,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 */\n\nimport { StatusIndicator, Typography } from '@neo4j-ndl/react';\n\nimport { useGraphVisualizationContext } from '../graph-visualization-context';\nimport { GraphVisualizationSidepanel } from '../graph-visualization-sidepanel';\nimport { GraphLabelWrapper } from './graph-label-wrapper';\nimport { ShowAll } from './show-all';\n\nconst OVERVIEW_STEP_SIZE = 25;\n\nexport const OverviewPanel = () => {\n const { nvlGraph, metadataLookup } = useGraphVisualizationContext();\n\n return (\n <>\n <GraphVisualizationSidepanel.Title>\n <Typography variant=\"title-4\">Results overview</Typography>\n </GraphVisualizationSidepanel.Title>\n <GraphVisualizationSidepanel.Content>\n <div className=\"ndl-graph-visualization-overview-panel\">\n {metadataLookup.labels.length > 0 && (\n <div className=\"ndl-overview-section\">\n <div className=\"ndl-overview-header\">\n <span>\n Nodes{` (${nvlGraph.nodes.length.toLocaleString()})`}\n </span>\n </div>\n <div className=\"ndl-overview-items\">\n <ShowAll initiallyShown={OVERVIEW_STEP_SIZE} isButtonGroup>\n {metadataLookup.labels.map((label) => (\n <GraphLabelWrapper\n key={label}\n label={label}\n type=\"node\"\n metaData={metadataLookup.labelMetaData[label]}\n showCount\n />\n ))}\n </ShowAll>\n </div>\n </div>\n )}\n\n {metadataLookup.reltypes.length > 0 && (\n <div className=\"ndl-overview-relationships-section\">\n <span className=\"ndl-overview-relationships-title\">\n Relationships{` (${nvlGraph.rels.length.toLocaleString()})`}\n </span>\n <div className=\"ndl-overview-items\">\n <ShowAll initiallyShown={OVERVIEW_STEP_SIZE} isButtonGroup>\n {metadataLookup.reltypes.map((type) => (\n <GraphLabelWrapper\n key={type}\n label={type}\n type=\"relationship\"\n metaData={metadataLookup.reltypeMetaData[type]}\n showCount\n />\n ))}\n </ShowAll>\n </div>\n </div>\n )}\n\n {metadataLookup.hasMultipleColors && (\n <div className=\"ndl-overview-hint\">\n <StatusIndicator variant=\"info\" />\n <Typography variant=\"body-small\">\n indicates color may not match\n </Typography>\n </div>\n )}\n </div>\n </GraphVisualizationSidepanel.Content>\n </>\n );\n};\n"]}
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- /**
2
+ /*!
3
3
  *
4
4
  * Copyright (c) "Neo4j"
5
5
  * Neo4j Sweden AB [http://neo4j.com]
@@ -1 +1 @@
1
- {"version":3,"file":"properties-table.js","sourceRoot":"","sources":["../../../src/sidepanel-components/properties-table.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGjC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,CAAC,MAAM,QAAQ,GAAG,QAAQ,CAAC;AACjC,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AACvC,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAC;AACrC,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAC;AAMnC,MAAM,eAAe,GAAG,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAwB,EAAE,EAAE;IACvE,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEpD,MAAM,SAAS,GACb,KAAK,GAAG,mBAAmB,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,iBAAiB,CAAC;IAEpE,MAAM,iBAAi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C5D,GAAG,GACO,EACb,cAAK,SAAS,EAAC,sBAAsB,YACnC,KAAC,eAAe,IACd,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE,IAAI,GACV,GACE,EACN,cAAK,SAAS,EAAC,iCAAiC,YAC9C,KAAC,eAAe,IACd,UAAU,EAAE,GAAG,GAAG,KAAK,WAAW,EAAE,EACpC,IAAI,EAAC,OAAO,EACZ,YAAY,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GACnD,GACE,KAjBE,GAAG,CAkBP,CACP,CAAC;YACJ,CAAC,CAAC,IACE,CACP,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 */\n\nimport { ClipboardButton, Typography } from '@neo4j-ndl/react';\nimport { useState } from 'react';\n\nimport { type PortableProperty } from '../graph-visualization-context';\nimport { ClickableUrls } from './clickable-urls';\n\nexport const ELLIPSIS = '\\u2026';\nexport const WIDE_VIEW_THRESHOLD = 900;\nexport const MAX_LENGTH_NARROW = 150;\nexport const MAX_LENGTH_WIDE = 300;\ntype ExpandableValueProps = {\n value: string;\n width: number;\n type: string;\n};\nconst ExpandableValue = ({ value, width, type }: ExpandableValueProps) => {\n const [isExpanded, setIsExpanded] = useState(false);\n\n const maxLength =\n width > WIDE_VIEW_THRESHOLD ? MAX_LENGTH_WIDE : MAX_LENGTH_NARROW;\n\n const handleExpandClick = () => {\n setIsExpanded(true);\n };\n\n let valueShown = isExpanded ? value : value.slice(0, maxLength);\n const isValueTrimmed = valueShown.length !== value.length;\n valueShown += isValueTrimmed ? ELLIPSIS : '';\n\n return (\n <>\n {type.startsWith('Array') && '['}\n <ClickableUrls text={valueShown} />\n {isValueTrimmed && (\n <button\n type=\"button\"\n onClick={handleExpandClick}\n className=\"ndl-properties-show-all-button\"\n >\n {' Show all'}\n </button>\n )}\n {type.startsWith('Array') && ']'}\n </>\n );\n};\n\ntype PropertiesTableProps = {\n properties: Record<string, PortableProperty>;\n paneWidth: number;\n};\n\nexport const PropertiesTable = ({\n properties,\n paneWidth,\n}: PropertiesTableProps) => {\n return (\n <div className=\"ndl-graph-visualization-properties-table\">\n <div className=\"ndl-properties-header\">\n <Typography variant=\"body-small\" className=\"ndl-properties-header-key\">\n Key\n </Typography>\n <Typography variant=\"body-small\">Value</Typography>\n </div>\n {Object.entries(properties).map(([key, { stringified, type }]) => {\n return (\n <div key={key} className=\"ndl-properties-row\">\n <Typography variant=\"body-small\" className=\"ndl-properties-key\">\n {key}\n </Typography>\n <div className=\"ndl-properties-value\">\n <ExpandableValue\n value={stringified}\n width={paneWidth}\n type={type}\n />\n </div>\n <div className=\"ndl-properties-clipboard-button\">\n <ClipboardButton\n textToCopy={`${key}: ${stringified}`}\n size=\"small\"\n tooltipProps={{ placement: 'left', type: 'simple' }}\n />\n </div>\n </div>\n );\n })}\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"properties-table.js","sourceRoot":"","sources":["../../../src/sidepanel-components/properties-table.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGjC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,CAAC,MAAM,QAAQ,GA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OAAO,CACL,eAAK,SAAS,EAAC,0CAA0C,aACvD,eAAK,SAAS,EAAC,uBAAuB,aACpC,KAAC,UAAU,IAAC,OAAO,EAAC,YAAY,EAAC,SAAS,EAAC,2BAA2B,oBAEzD,EACb,KAAC,UAAU,IAAC,OAAO,EAAC,YAAY,sBAAmB,IAC/C,EACL,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE;gBAC/D,OAAO,CACL,eAAe,SAAS,EAAC,oBAAoB,aAC3C,KAAC,UAAU,IAAC,OAAO,EAAC,YAAY,EAAC,SAAS,EAAC,oBAAoB,YAC5D,GAAG,GACO,EACb,cAAK,SAAS,EAAC,sBAAsB,YACnC,KAAC,eAAe,IACd,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE,IAAI,GACV,GACE,EACN,cAAK,SAAS,EAAC,iCAAiC,YAC9C,KAAC,eAAe,IACd,UAAU,EAAE,GAAG,GAAG,KAAK,WAAW,EAAE,EACpC,IAAI,EAAC,OAAO,EACZ,YAAY,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GACnD,GACE,KAjBE,GAAG,CAkBP,CACP,CAAC;YACJ,CAAC,CAAC,IACE,CACP,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 */\n\nimport { ClipboardButton, Typography } from '@neo4j-ndl/react';\nimport { useState } from 'react';\n\nimport { type PortableProperty } from '../graph-visualization-context';\nimport { ClickableUrls } from './clickable-urls';\n\nexport const ELLIPSIS = '\\u2026';\nexport const WIDE_VIEW_THRESHOLD = 900;\nexport const MAX_LENGTH_NARROW = 150;\nexport const MAX_LENGTH_WIDE = 300;\ntype ExpandableValueProps = {\n value: string;\n width: number;\n type: string;\n};\nconst ExpandableValue = ({ value, width, type }: ExpandableValueProps) => {\n const [isExpanded, setIsExpanded] = useState(false);\n\n const maxLength =\n width > WIDE_VIEW_THRESHOLD ? MAX_LENGTH_WIDE : MAX_LENGTH_NARROW;\n\n const handleExpandClick = () => {\n setIsExpanded(true);\n };\n\n let valueShown = isExpanded ? value : value.slice(0, maxLength);\n const isValueTrimmed = valueShown.length !== value.length;\n valueShown += isValueTrimmed ? ELLIPSIS : '';\n\n return (\n <>\n {type.startsWith('Array') && '['}\n <ClickableUrls text={valueShown} />\n {isValueTrimmed && (\n <button\n type=\"button\"\n onClick={handleExpandClick}\n className=\"ndl-properties-show-all-button\"\n >\n {' Show all'}\n </button>\n )}\n {type.startsWith('Array') && ']'}\n </>\n );\n};\n\ntype PropertiesTableProps = {\n properties: Record<string, PortableProperty>;\n paneWidth: number;\n};\n\nexport const PropertiesTable = ({\n properties,\n paneWidth,\n}: PropertiesTableProps) => {\n return (\n <div className=\"ndl-graph-visualization-properties-table\">\n <div className=\"ndl-properties-header\">\n <Typography variant=\"body-small\" className=\"ndl-properties-header-key\">\n Key\n </Typography>\n <Typography variant=\"body-small\">Value</Typography>\n </div>\n {Object.entries(properties).map(([key, { stringified, type }]) => {\n return (\n <div key={key} className=\"ndl-properties-row\">\n <Typography variant=\"body-small\" className=\"ndl-properties-key\">\n {key}\n </Typography>\n <div className=\"ndl-properties-value\">\n <ExpandableValue\n value={stringified}\n width={paneWidth}\n type={type}\n />\n </div>\n <div className=\"ndl-properties-clipboard-button\">\n <ClipboardButton\n textToCopy={`${key}: ${stringified}`}\n size=\"small\"\n tooltipProps={{ placement: 'left', type: 'simple' }}\n />\n </div>\n </div>\n );\n })}\n </div>\n );\n};\n"]}
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- /**
2
+ /*!
3
3
  *
4
4
  * Copyright (c) "Neo4j"
5
5
  * Neo4j Sweden AB [http://neo4j.com]
@@ -1 +1 @@
1
- {"version":3,"file":"show-all.js","sourceRoot":"","sources":["../../../src/sidepanel-components/show-all.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAkB,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAS7C,MAAM,gBAAgB,GAAG,CACvB,YAA2C,EACV,EAAE,CAAC,OAAO,YAAY,KAAK,UAAU,CAAC;AAEzE,MAAM,UAAU,OAAO,CAAC,EACtB,cAAc,EACd,QAAQ,EACR,aAAa,GACA;IACb,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpD,MAAM,cAAc,GAAG,GAAG,EAAE,CAAC,aAAa,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC;IAEpE,MAAM,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC;IAElC,MAAM,kBAAkB,GAAG,SAAS,GAAG,cAAc,CAAC;IACtD,MAAM,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC;IACtD,MAAM,UAAU,GAAG,SAAS,GAAG,KAAK,CAAC;IAErC,IAAI,SAAS,KAAK,CAAC,EAAE,CAAC;QACpB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,eAAe,GAAG,QAAQ;SAC7B,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC;SACf,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IAC/D,OAAO,CACL,8BACG,aAAa,KAAK,IAAI,CAAC,CAAC,CAAC,CACxB,KAAC,WAAW,cAAE,eAAe,GAAe,CAC7C,CAAC,CAAC,CAAC,CACF,cAAK,KAAK,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,YAAG,eAAe,GAAO,CACxD,EACA,kBAAkB,IAAI,CACrB,KAAC,UAAU,IAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAE,cAAc,YAC7C,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,aAAa,UAAU,QAAQ,GAChD,CACd,IACA,CACJ,CAAC;AACJ,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 { TextButton } from '@neo4j-ndl/react';\nimport { type ReactNode, useState } from 'react';\n\nimport { ButtonGroup } from './button-group';\n\ntype ShowAllProps = {\n initiallyShown: number;\n /* pass thunk to enable rendering only shown components */\n children: ((() => ReactNode) | ReactNode)[];\n isButtonGroup?: boolean;\n ariaLabel?: string;\n};\nconst isThunkComponent = (\n childOrThunk: (() => ReactNode) | ReactNode,\n): childOrThunk is () => ReactNode => typeof childOrThunk === 'function';\n\nexport function ShowAll({\n initiallyShown,\n children,\n isButtonGroup,\n}: ShowAllProps) {\n const [isExpanded, setIsExpanded] = useState(false);\n const toggleExpanded = () => setIsExpanded((expanded) => !expanded);\n\n const itemCount = children.length;\n\n const shouldHaveControls = itemCount > initiallyShown;\n const shown = isExpanded ? itemCount : initiallyShown;\n const leftToShow = itemCount - shown;\n\n if (itemCount === 0) {\n return null;\n }\n\n const currentChildren = children\n .slice(0, shown)\n .map((child) => (isThunkComponent(child) ? child() : child));\n return (\n <>\n {isButtonGroup === true ? (\n <ButtonGroup>{currentChildren}</ButtonGroup>\n ) : (\n <div style={{ all: 'inherit' }}>{currentChildren}</div>\n )}\n {shouldHaveControls && (\n <TextButton size=\"small\" onClick={toggleExpanded}>\n {isExpanded ? 'Show less' : `Show all (${leftToShow} more)`}\n </TextButton>\n )}\n </>\n );\n}\n"]}
1
+ {"version":3,"file":"show-all.js","sourceRoot":"","sources":["../../../src/sidepanel-components/show-all.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAkB,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAS7C,MAAM,gBAAgB,GAAG,CACvB,YAA2C,EACV,EAAE,CAAC,OAAO,YAAY,KAAK,UAAU,CAAC;AAEzE,MAAM,UAAU,OAAO,CAAC,EACtB,cAAc,EACd,QAAQ,EACR,aAAa,GACA;IACb,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpD,MAAM,cAAc,GAAG,GAAG,EAAE,CAAC,aAAa,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC;IAEpE,MAAM,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC;IAElC,MAAM,kBAAkB,GAAG,SAAS,GAAG,cAAc,CAAC;IACtD,MAAM,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC;IACtD,MAAM,UAAU,GAAG,SAAS,GAAG,KAAK,CAAC;IAErC,IAAI,SAAS,KAAK,CAAC,EAAE,CAAC;QACpB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,eAAe,GAAG,QAAQ;SAC7B,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC;SACf,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IAC/D,OAAO,CACL,8BACG,aAAa,KAAK,IAAI,CAAC,CAAC,CAAC,CACxB,KAAC,WAAW,cAAE,eAAe,GAAe,CAC7C,CAAC,CAAC,CAAC,CACF,cAAK,KAAK,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,YAAG,eAAe,GAAO,CACxD,EACA,kBAAkB,IAAI,CACrB,KAAC,UAAU,IAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAE,cAAc,YAC7C,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,aAAa,UAAU,QAAQ,GAChD,CACd,IACA,CACJ,CAAC;AACJ,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 { TextButton } from '@neo4j-ndl/react';\nimport { type ReactNode, useState } from 'react';\n\nimport { ButtonGroup } from './button-group';\n\ntype ShowAllProps = {\n initiallyShown: number;\n /* pass thunk to enable rendering only shown components */\n children: ((() => ReactNode) | ReactNode)[];\n isButtonGroup?: boolean;\n ariaLabel?: string;\n};\nconst isThunkComponent = (\n childOrThunk: (() => ReactNode) | ReactNode,\n): childOrThunk is () => ReactNode => typeof childOrThunk === 'function';\n\nexport function ShowAll({\n initiallyShown,\n children,\n isButtonGroup,\n}: ShowAllProps) {\n const [isExpanded, setIsExpanded] = useState(false);\n const toggleExpanded = () => setIsExpanded((expanded) => !expanded);\n\n const itemCount = children.length;\n\n const shouldHaveControls = itemCount > initiallyShown;\n const shown = isExpanded ? itemCount : initiallyShown;\n const leftToShow = itemCount - shown;\n\n if (itemCount === 0) {\n return null;\n }\n\n const currentChildren = children\n .slice(0, shown)\n .map((child) => (isThunkComponent(child) ? child() : child));\n return (\n <>\n {isButtonGroup === true ? (\n <ButtonGroup>{currentChildren}</ButtonGroup>\n ) : (\n <div style={{ all: 'inherit' }}>{currentChildren}</div>\n )}\n {shouldHaveControls && (\n <TextButton size=\"small\" onClick={toggleExpanded}>\n {isExpanded ? 'Show less' : `Show all (${leftToShow} more)`}\n </TextButton>\n )}\n </>\n );\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- /**
2
+ /*!
3
3
  *
4
4
  * Copyright (c) "Neo4j"
5
5
  * Neo4j Sweden AB [http://neo4j.com]
@@ -1 +1 @@
1
- {"version":3,"file":"single-selection-sidepanel-contents.js","sourceRoot":"","sources":["../../../src/sidepanel-components/single-selection-sidepanel-contents.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,CAAC,MAAM,gCAAgC,GAAG,GAAG,EAAE;IACnD,MAAM,EAAE,QAAQ,EAAE,GAAG,4BAA4B,EAAE,CAAC;IAEpD,MAAM,YAAY,GAAG,OAAO,CAC1B,GAAG,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,QAAQ,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,EACxE,CAAC,QAAQ,CAAC,CACX,CAAC;IAEF,OAAO,YAAY,CAAC,CAAC,CAAC,KAAC,YAAY,KAAG,CAAC,CAAC,CAAC,KAAC,aAAa,KAAG,CAAC;AAC7D,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 { useMemo } from 'react';\n\nimport { useGraphVisualizationContext } from '../graph-visualization-context';\nimport { DetailsPanel } from './details-panel';\nimport { OverviewPanel } from './overview-panel';\n\nexport const SingleSelectionSidepanelContents = () => {\n const { selected } = useGraphVisualizationContext();\n\n const hasSelection = useMemo(\n () => selected.nodeIds.length > 0 || selected.relationshipIds.length > 0,\n [selected],\n );\n\n return hasSelection ? <DetailsPanel /> : <OverviewPanel />;\n};\n"]}
1
+ {"version":3,"file":"single-selection-sidepanel-contents.js","sourceRoot":"","sources":["../../../src/sidepanel-components/single-selection-sidepanel-contents.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,CAAC,MAAM,gCAAgC,GAAG,GAAG,EAAE;IACnD,MAAM,EAAE,QAAQ,EAAE,GAAG,4BAA4B,EAAE,CAAC;IAEpD,MAAM,YAAY,GAAG,OAAO,CAC1B,GAAG,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,QAAQ,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,EACxE,CAAC,QAAQ,CAAC,CACX,CAAC;IAEF,OAAO,YAAY,CAAC,CAAC,CAAC,KAAC,YAAY,KAAG,CAAC,CAAC,CAAC,KAAC,aAAa,KAAG,CAAC;AAC7D,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 { useMemo } from 'react';\n\nimport { useGraphVisualizationContext } from '../graph-visualization-context';\nimport { DetailsPanel } from './details-panel';\nimport { OverviewPanel } from './overview-panel';\n\nexport const SingleSelectionSidepanelContents = () => {\n const { selected } = useGraphVisualizationContext();\n\n const hasSelection = useMemo(\n () => selected.nodeIds.length > 0 || selected.relationshipIds.length > 0,\n [selected],\n );\n\n return hasSelection ? <DetailsPanel /> : <OverviewPanel />;\n};\n"]}