@neo4j-ndl/react-graph 2.2.4 → 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 +91 -55
  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 +1 -1
  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 +89 -55
  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 +1 -1
  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 +28 -1
  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 +1 -1
  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":"numeric-utils.js","sourceRoot":"","sources":["../../../../src/_generated/style-rules/numeric-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAgCH,MAAM,WAAW,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAC9B,MAAM,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAC7B,MAAM,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAC7B,MAAM,kBAAkB,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;AAEzD,SAAS,gBAAgB,CAAC,QAAgB;IACxC,OAAO,MAAM,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AAC5C,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,qBAAqB,CAAC,KAAqB;IACzD,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAClE,CAAC;AAED,qEAAqE;AACrE,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,QAAQ,IAAI,KAAK;QACjB,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ;QAChC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAChC,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAClC,IAAkB,EAClB,KAAmB;IAEnB,IACE,CAAC,OAAO,IAAI,KAAK,QAAQ,IAAI,MAAM,CAAC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MAAM,GAAG,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;IACjC,MAAM,OAAO,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IAClC,IAAI,KAAK,KAAK,IAAI,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACvD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,UAAU,GACd,OAAO,CAAC,SAAS,GAAG,KAAK,CAAC,WAAW;QACrC,KAAK,CAAC,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC;IACxC,MAAM,UAAU,GACd,GAAG,CAAC,SAAS,GAAG,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,SAAS,GAAG,GAAG,CAAC,WAAW,CAAC;IAExE,OAAO,aAAa,CAClB,UAAU,GAAG,GAAG,CAAC,WAAW,EAC5B,OAAO,CAAC,WAAW,GAAG,UAAU,CACjC,CAAC;AACJ,CAAC","sourcesContent":["/*\n * AUTO-GENERATED FILE — DO NOT EDIT.\n * Source of truth: packages/style-rules/src/\n * Regenerate with `pnpm generate:shared` (runs automatically at build/dev/install).\n */\n\n/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport type { BigintLiteral, NumericLiteral } from './literal-schemas';\n\nexport type NumericValue = number | bigint;\n\ntype Rational = {\n denominator: bigint;\n numerator: bigint;\n};\n\nconst BIGINT_ZERO = BigInt(0);\nconst BIGINT_ONE = BigInt(1);\nconst BIGINT_TWO = BigInt(2);\nconst BIGINT_RATIO_SCALE = BigInt('1000000000000000000');\n\nfunction bigintPowerOfTen(exponent: number): bigint {\n return BigInt(`1${'0'.repeat(exponent)}`);\n}\n\n/** Resolves a native or JSON-safe numeric literal without reducing bigints. */\nexport function resolveNumericLiteral(value: NumericLiteral): NumericValue {\n return typeof value === 'object' ? BigInt(value.bigint) : value;\n}\n\n/** Returns whether a value is the JSON-safe bigint literal shape. */\nexport function isBigintLiteral(value: unknown): value is BigintLiteral {\n return (\n typeof value === 'object' &&\n value !== null &&\n 'bigint' in value &&\n typeof value.bigint === 'string' &&\n /^[+-]?\\d+$/.test(value.bigint)\n );\n}\n\n/**\n * Compares numeric values without coercing bigint operands to number.\n * Returns null for NaN, otherwise -1, 0, or 1.\n */\nexport function compareNumericValues(\n left: NumericValue,\n right: NumericValue,\n): -1 | 0 | 1 | null {\n if (\n (typeof left === 'number' && Number.isNaN(left)) ||\n (typeof right === 'number' && Number.isNaN(right))\n ) {\n return null;\n }\n if (left < right) {\n return -1;\n }\n if (left > right) {\n return 1;\n }\n return 0;\n}\n\n/** Numeric equality that treats equivalent number and bigint values as equal. */\nexport function numericValuesEqual(\n left: NumericValue,\n right: NumericValue,\n): boolean {\n return compareNumericValues(left, right) === 0;\n}\n\n/**\n * Clamps a numeric value between two endpoints. Inverted endpoints are\n * supported, and the original number/bigint representation is retained.\n */\nexport function clampNumericValue(\n value: NumericValue,\n firstBound: NumericValue,\n secondBound: NumericValue,\n): NumericValue | null {\n const boundsOrder = compareNumericValues(firstBound, secondBound);\n if (boundsOrder === null) {\n return null;\n }\n const min = boundsOrder <= 0 ? firstBound : secondBound;\n const max = boundsOrder <= 0 ? secondBound : firstBound;\n const minOrder = compareNumericValues(value, min);\n const maxOrder = compareNumericValues(value, max);\n if (minOrder === null || maxOrder === null) {\n return null;\n }\n if (minOrder < 0) {\n return min;\n }\n if (maxOrder > 0) {\n return max;\n }\n return value;\n}\n\nfunction numberToRational(value: number): Rational | null {\n if (!Number.isFinite(value)) {\n return null;\n }\n\n const match = /^([+-]?)(\\d+)(?:\\.(\\d+))?(?:e([+-]?\\d+))?$/i.exec(\n value.toString(),\n );\n if (!match) {\n return null;\n }\n\n const [, sign, integer, fraction = '', exponentText = '0'] = match;\n const exponent = Number(exponentText) - fraction.length;\n const digits = BigInt(`${sign}${integer}${fraction}`);\n if (exponent >= 0) {\n return {\n denominator: BIGINT_ONE,\n numerator: digits * bigintPowerOfTen(exponent),\n };\n }\n return {\n denominator: bigintPowerOfTen(-exponent),\n numerator: digits,\n };\n}\n\nfunction toRational(value: NumericValue): Rational | null {\n return typeof value === 'bigint'\n ? { denominator: BIGINT_ONE, numerator: value }\n : numberToRational(value);\n}\n\nfunction divideBigints(numerator: bigint, denominator: bigint): number | null {\n if (denominator === BIGINT_ZERO) {\n return null;\n }\n\n const isNegative = numerator < BIGINT_ZERO !== denominator < BIGINT_ZERO;\n const absoluteNumerator = numerator < BIGINT_ZERO ? -numerator : numerator;\n const absoluteDenominator =\n denominator < BIGINT_ZERO ? -denominator : denominator;\n const integer = absoluteNumerator / absoluteDenominator;\n const remainder = absoluteNumerator % absoluteDenominator;\n const fraction =\n (remainder * BIGINT_RATIO_SCALE + absoluteDenominator / BIGINT_TWO) /\n absoluteDenominator;\n const result =\n Number(integer) + Number(fraction) / Number(BIGINT_RATIO_SCALE);\n\n return isNegative ? -result : result;\n}\n\n/**\n * Computes `(value - startValue) / (endValue - startValue)` while retaining\n * bigint precision. Only the final dimensionless interpolation weight is\n * converted to number.\n */\nexport function getNumericWeight(\n startValue: NumericValue,\n endValue: NumericValue,\n value: NumericValue,\n): number | null {\n if (\n typeof startValue === 'number' &&\n typeof endValue === 'number' &&\n typeof value === 'number'\n ) {\n const weight = (value - startValue) / (endValue - startValue);\n return Number.isNaN(weight) ? null : weight;\n }\n\n const start = toRational(startValue);\n const end = toRational(endValue);\n const current = toRational(value);\n if (start === null || end === null || current === null) {\n return null;\n }\n\n const valueDelta =\n current.numerator * start.denominator -\n start.numerator * current.denominator;\n const rangeDelta =\n end.numerator * start.denominator - start.numerator * end.denominator;\n\n return divideBigints(\n valueDelta * end.denominator,\n current.denominator * rangeDelta,\n );\n}\n"]}
1
+ {"version":3,"file":"numeric-utils.js","sourceRoot":"","sources":["../../../../src/_generated/style-rules/numeric-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAgCH,MAAM,WAAW,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAC9B,MAAM,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAC7B,MAAM,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAC7B,MAAM,kBAAkB,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;AAEzD,SAAS,gBAAgB,CAAC,QAAgB;IACxC,OAAO,MAAM,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AAC5C,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,qBAAqB,CAAC,KAAqB;IACzD,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAClE,CAAC;AAED,qEAAqE;AACrE,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,QAAQ,IAAI,KAAK;QACjB,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ;QAChC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAChC,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAClC,IAAkB,EAClB,KAAmB;IAEnB,IACE,CAAC,OAAO,IAAI,KAAK,QAAQ,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAChD,CAAC,OAAO,KAAK,KAAK,QAAQ,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AAG,UAAU,CAAC,KAAK,CAAC,CAAC;IAClC,IAAI,KAAK,KAAK,IAAI,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACvD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,UAAU,GACd,OAAO,CAAC,SAAS,GAAG,KAAK,CAAC,WAAW;QACrC,KAAK,CAAC,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC;IACxC,MAAM,UAAU,GACd,GAAG,CAAC,SAAS,GAAG,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,SAAS,GAAG,GAAG,CAAC,WAAW,CAAC;IAExE,OAAO,aAAa,CAClB,UAAU,GAAG,GAAG,CAAC,WAAW,EAC5B,OAAO,CAAC,WAAW,GAAG,UAAU,CACjC,CAAC;AACJ,CAAC","sourcesContent":["/*\n * AUTO-GENERATED FILE — DO NOT EDIT.\n * Source of truth: packages/style-rules/src/\n * Regenerate with `pnpm generate:shared` (runs automatically at build/dev/install).\n */\n\n/*!\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport type { BigintLiteral, NumericLiteral } from './literal-schemas';\n\nexport type NumericValue = number | bigint;\n\ntype Rational = {\n denominator: bigint;\n numerator: bigint;\n};\n\nconst BIGINT_ZERO = BigInt(0);\nconst BIGINT_ONE = BigInt(1);\nconst BIGINT_TWO = BigInt(2);\nconst BIGINT_RATIO_SCALE = BigInt('1000000000000000000');\n\nfunction bigintPowerOfTen(exponent: number): bigint {\n return BigInt(`1${'0'.repeat(exponent)}`);\n}\n\n/** Resolves a native or JSON-safe numeric literal without reducing bigints. */\nexport function resolveNumericLiteral(value: NumericLiteral): NumericValue {\n return typeof value === 'object' ? BigInt(value.bigint) : value;\n}\n\n/** Returns whether a value is the JSON-safe bigint literal shape. */\nexport function isBigintLiteral(value: unknown): value is BigintLiteral {\n return (\n typeof value === 'object' &&\n value !== null &&\n 'bigint' in value &&\n typeof value.bigint === 'string' &&\n /^[+-]?\\d+$/.test(value.bigint)\n );\n}\n\n/**\n * Compares numeric values without coercing bigint operands to number.\n * Returns null for NaN, otherwise -1, 0, or 1.\n */\nexport function compareNumericValues(\n left: NumericValue,\n right: NumericValue,\n): -1 | 0 | 1 | null {\n if (\n (typeof left === 'number' && Number.isNaN(left)) ||\n (typeof right === 'number' && Number.isNaN(right))\n ) {\n return null;\n }\n if (left < right) {\n return -1;\n }\n if (left > right) {\n return 1;\n }\n return 0;\n}\n\n/** Numeric equality that treats equivalent number and bigint values as equal. */\nexport function numericValuesEqual(\n left: NumericValue,\n right: NumericValue,\n): boolean {\n return compareNumericValues(left, right) === 0;\n}\n\n/**\n * Clamps a numeric value between two endpoints. Inverted endpoints are\n * supported, and the original number/bigint representation is retained.\n */\nexport function clampNumericValue(\n value: NumericValue,\n firstBound: NumericValue,\n secondBound: NumericValue,\n): NumericValue | null {\n const boundsOrder = compareNumericValues(firstBound, secondBound);\n if (boundsOrder === null) {\n return null;\n }\n const min = boundsOrder <= 0 ? firstBound : secondBound;\n const max = boundsOrder <= 0 ? secondBound : firstBound;\n const minOrder = compareNumericValues(value, min);\n const maxOrder = compareNumericValues(value, max);\n if (minOrder === null || maxOrder === null) {\n return null;\n }\n if (minOrder < 0) {\n return min;\n }\n if (maxOrder > 0) {\n return max;\n }\n return value;\n}\n\nfunction numberToRational(value: number): Rational | null {\n if (!Number.isFinite(value)) {\n return null;\n }\n\n const match = /^([+-]?)(\\d+)(?:\\.(\\d+))?(?:e([+-]?\\d+))?$/i.exec(\n value.toString(),\n );\n if (!match) {\n return null;\n }\n\n const [, sign, integer, fraction = '', exponentText = '0'] = match;\n const exponent = Number(exponentText) - fraction.length;\n const digits = BigInt(`${sign}${integer}${fraction}`);\n if (exponent >= 0) {\n return {\n denominator: BIGINT_ONE,\n numerator: digits * bigintPowerOfTen(exponent),\n };\n }\n return {\n denominator: bigintPowerOfTen(-exponent),\n numerator: digits,\n };\n}\n\nfunction toRational(value: NumericValue): Rational | null {\n return typeof value === 'bigint'\n ? { denominator: BIGINT_ONE, numerator: value }\n : numberToRational(value);\n}\n\nfunction divideBigints(numerator: bigint, denominator: bigint): number | null {\n if (denominator === BIGINT_ZERO) {\n return null;\n }\n\n const isNegative = numerator < BIGINT_ZERO !== denominator < BIGINT_ZERO;\n const absoluteNumerator = numerator < BIGINT_ZERO ? -numerator : numerator;\n const absoluteDenominator =\n denominator < BIGINT_ZERO ? -denominator : denominator;\n const integer = absoluteNumerator / absoluteDenominator;\n const remainder = absoluteNumerator % absoluteDenominator;\n const fraction =\n (remainder * BIGINT_RATIO_SCALE + absoluteDenominator / BIGINT_TWO) /\n absoluteDenominator;\n const result =\n Number(integer) + Number(fraction) / Number(BIGINT_RATIO_SCALE);\n\n return isNegative ? -result : result;\n}\n\n/**\n * Computes `(value - startValue) / (endValue - startValue)` while retaining\n * bigint precision. Only the final dimensionless interpolation weight is\n * converted to number.\n */\nexport function getNumericWeight(\n startValue: NumericValue,\n endValue: NumericValue,\n value: NumericValue,\n): number | null {\n if (\n typeof startValue === 'number' &&\n typeof endValue === 'number' &&\n typeof value === 'number'\n ) {\n const weight = (value - startValue) / (endValue - startValue);\n return Number.isNaN(weight) ? null : weight;\n }\n\n const start = toRational(startValue);\n const end = toRational(endValue);\n const current = toRational(value);\n if (start === null || end === null || current === null) {\n return null;\n }\n\n const valueDelta =\n current.numerator * start.denominator -\n start.numerator * current.denominator;\n const rangeDelta =\n end.numerator * start.denominator - start.numerator * end.denominator;\n\n return divideBigints(\n valueDelta * end.denominator,\n current.denominator * rangeDelta,\n );\n}\n"]}
@@ -3,7 +3,7 @@
3
3
  * Source of truth: packages/style-rules/src/
4
4
  * Regenerate with `pnpm generate:shared` (runs automatically at build/dev/install).
5
5
  */
6
- /**
6
+ /*!
7
7
  *
8
8
  * Copyright (c) "Neo4j"
9
9
  * Neo4j Sweden AB [http://neo4j.com]
@@ -1 +1 @@
1
- {"version":3,"file":"range-utils.js","sourceRoot":"","sources":["../../../../src/_generated/style-rules/range-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,eAAe,GAChB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAqB,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAE3E,qFAAqF;AACrF,MAAM,UAAU,mBAAmB,CAAC,KAAmB;IACrD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAChD,IAAI,UAAU,IAAI,KAAK,EAAE,CAAC;YACxB,OAAO,eAAe,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACzC,CAAC;QACD,IAAI,eAAe,IAAI,KAAK,EAAE,CAAC;YAC7B,OAAO,oBAAoB,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;QACnD,CAAC;QACD,IAAI,MAAM,IAAI,KAAK,EAAE,CAAC;YACpB,OAAO,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;IACD,OAAO,qBAAqB,CAAC,KAAK,CAAC,CAAC;AACtC,CAAC","sourcesContent":["/*\n * AUTO-GENERATED FILE — DO NOT EDIT.\n * Source of truth: packages/style-rules/src/\n * Regenerate with `pnpm generate:shared` (runs automatically at build/dev/install).\n */\n\n/**\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 {\n parseDateString,\n parseLocalDateString,\n parseTimeString,\n} from './date-utils';\nimport type { RangeLiteral } from './literal-schemas';\nimport { type NumericValue, resolveNumericLiteral } from './numeric-utils';\n\n/** Resolves a range literal to the numeric representation used for interpolation. */\nexport function resolveRangeLiteral(value: RangeLiteral): NumericValue | null {\n if (typeof value === 'object' && value !== null) {\n if ('datetime' in value) {\n return parseDateString(value.datetime);\n }\n if ('localdatetime' in value) {\n return parseLocalDateString(value.localdatetime);\n }\n if ('time' in value) {\n return parseTimeString(value.time);\n }\n }\n return resolveNumericLiteral(value);\n}\n"]}
1
+ {"version":3,"file":"range-utils.js","sourceRoot":"","sources":["../../../../src/_generated/style-rules/range-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,eAAe,GAChB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAqB,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAE3E,qFAAqF;AACrF,MAAM,UAAU,mBAAmB,CAAC,KAAmB;IACrD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAChD,IAAI,UAAU,IAAI,KAAK,EAAE,CAAC;YACxB,OAAO,eAAe,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACzC,CAAC;QACD,IAAI,eAAe,IAAI,KAAK,EAAE,CAAC;YAC7B,OAAO,oBAAoB,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;QACnD,CAAC;QACD,IAAI,MAAM,IAAI,KAAK,EAAE,CAAC;YACpB,OAAO,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;IACD,OAAO,qBAAqB,CAAC,KAAK,CAAC,CAAC;AACtC,CAAC","sourcesContent":["/*\n * AUTO-GENERATED FILE — DO NOT EDIT.\n * Source of truth: packages/style-rules/src/\n * Regenerate with `pnpm generate:shared` (runs automatically at build/dev/install).\n */\n\n/*!\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 {\n parseDateString,\n parseLocalDateString,\n parseTimeString,\n} from './date-utils';\nimport type { RangeLiteral } from './literal-schemas';\nimport { type NumericValue, resolveNumericLiteral } from './numeric-utils';\n\n/** Resolves a range literal to the numeric representation used for interpolation. */\nexport function resolveRangeLiteral(value: RangeLiteral): NumericValue | null {\n if (typeof value === 'object' && value !== null) {\n if ('datetime' in value) {\n return parseDateString(value.datetime);\n }\n if ('localdatetime' in value) {\n return parseLocalDateString(value.localdatetime);\n }\n if ('time' in value) {\n return parseTimeString(value.time);\n }\n }\n return resolveNumericLiteral(value);\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":"graph-visualization-buttons.js","sourceRoot":"","sources":["../../src/graph-visualization-buttons.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EACL,eAAe,EACf,UAAU,EACV,GAAG,EACH,IAAI,EACJ,gBAAgB,EAChB,SAAS,GAEV,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,SAAS,EACT,0BAA0B,EAC1B,+BAA+B,EAC/B,8BAA8B,EAC9B,UAAU,EACV,cAAc,EACd,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,OAAO,IAAI,EAAE,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,EAEL,WAAW,EACX,SAAS,EACT,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,4BAA4B,GAC7B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AA2ClD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAoC,EAAE,EAAE;IAClE,MAAM,EACJ,QAAQ,EACR,SAAS,EACT,UAAU,EACV,WAAW,EACX,OAAO,EACP,WAAW,EACX,gBAAgB,EAChB,SAAS,EACT,KAAK,EACL,cAAc,EACd,QAAQ,EACR,mBAAmB,GACpB,GAAG,KAAK,CAAC;IACV,OAAO,CACL,KAAC,eAAe,IACd,WAAW,EAAE,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,SAAS,EACrC,YAAY,EAAE;YACZ,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE;YAC5C,IAAI,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,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K,EAAE,KAAK,EACZ,cAAc,EAAE,cAAc,EAC9B,IAAI,EAAC,OAAO,EACZ,YAAY,EAAE;oBACZ,IAAI,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,gBAAgB,aAAhB,gBAAgB,cAAhB,gBAAgB,GAAI,QAAQ,EAAE;iBACrE,YAEA,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,KAAC,UAAU,KAAG,GACtC,EACnB,KAAC,IAAI,IACH,MAAM,EAAE,UAAU,EAClB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,EACnC,SAAS,EAAE,aAAa,EACxB,YAAY,EAAE,YAAY,YAEzB,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE;;oBAAC,OAAA,CACnD,KAAC,IAAI,CAAC,SAAS,IAEb,KAAK,EAAE,MAAA,IAAI,CAAC,KAAK,mCAAI,2BAA2B,CAAC,GAAc,CAAC,EAChE,aAAa,EAAE,IAAI,CAAC,IAAI,EACxB,eAAe,EACb,KAAC,GAAG,IACF,IAAI,EAAE,MAAA,IAAI,CAAC,WAAW,0CAAE,IAAI,EAC5B,YAAY,EAAE,uBAAuB,CAAC,IAAI,CAAC,WAAW,CAAC,GACvD,EAEJ,SAAS,EAAE,GAAG,KAAK,OAAO,EAC1B,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAG,GAAc,CAAC,IAVtC,GAAG,CAWR,CACH,CAAA;iBAAA,CAAC,GACG,IACN,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 {\n CleanIconButton,\n IconButton,\n Kbd,\n Menu,\n SelectIconButton,\n TextInput,\n type Tooltip,\n} from '@neo4j-ndl/react';\nimport {\n ArrowDownTrayIconOutline,\n DocumentTextIconOutline,\n ExploreIcon,\n FitToScreenIcon,\n HierarchyTwoIcon,\n LassoIcon,\n MagnifyingGlassIconOutline,\n MagnifyingGlassMinusIconOutline,\n MagnifyingGlassPlusIconOutline,\n SelectIcon,\n SquareDashIcon,\n XMarkIconOutline,\n} from '@neo4j-ndl/react/icons';\nimport { type Layout } from '@neo4j-nvl/base';\nimport { default as cx } from 'classnames';\nimport type React from 'react';\nimport {\n type PropsWithChildren,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\n\nimport {\n type Gesture,\n useGraphVisualizationContext,\n} from './graph-visualization-context';\nimport { useSemicontrolledState } from './use-semi-controlled-state';\nimport { searchNodes, searchRels } from './utils';\n\ntype GraphVisualizationButtonProps = {\n tooltipPlacement?: React.ComponentProps<typeof Tooltip>['placement'];\n className?: string;\n /**\n * Additional css styling. Will be applied to the root element.\n */\n style?: React.CSSProperties;\n\n /**\n * Html attributes to apply to the root element. This will override any default html attributes, use with caution.\n */\n htmlAttributes?: React.ComponentPropsWithRef<\n typeof CleanIconButton\n >['htmlAttributes'];\n\n /**\n * A ref to apply to the root element.\n */\n ref?: React.ComponentPropsWithRef<'button'>['ref'];\n shortcutKey?: {\n keys: string[];\n isMetaKey: boolean;\n isShiftKey: boolean;\n };\n};\n\ntype BaseProperties = GraphVisualizationButtonProps & {\n description: string;\n testid?: string;\n ariaLabel?: string;\n isActive?: boolean;\n isDisabled?: boolean;\n onClick?: () => void;\n onMouseDown?: () => void;\n descriptionKbdProps?: React.ComponentPropsWithRef<\n typeof CleanIconButton\n >['descriptionKbdProps'];\n};\n\nexport type GraphVisualizationGroupButton = PropsWithChildren<BaseProperties>;\n\nexport const GroupButton = (props: GraphVisualizationGroupButton) => {\n const {\n isActive,\n ariaLabel,\n isDisabled,\n description,\n onClick,\n onMouseDown,\n tooltipPlacement,\n className,\n style,\n htmlAttributes,\n children,\n descriptionKbdProps,\n } = props;\n return (\n <CleanIconButton\n description={description ?? ariaLabel}\n tooltipProps={{\n content: { style: { whiteSpace: 'nowrap' } },\n root: { isPortaled: false, placement: tooltipPlacement },\n }}\n size=\"small\"\n className={className}\n style={style}\n isActive={isActive}\n isDisabled={isDisabled}\n descriptionKbdProps={descriptionKbdProps}\n onClick={onClick}\n htmlAttributes={{\n onMouseDown,\n ...htmlAttributes,\n }}\n >\n {children}\n </CleanIconButton>\n );\n};\n\nconst targetIsTextInput = (target: EventTarget | null): boolean => {\n if (!(target instanceof HTMLElement)) {\n return false;\n }\n return (\n target.isContentEditable || ['INPUT', 'TEXTAREA'].includes(target.tagName)\n );\n};\n\nconst isEditingText = (event: KeyboardEvent): boolean => {\n return targetIsTextInput(event.target);\n};\n\nconst GESTURE_KEYS_DEFAULT: Record<Gesture, string> = {\n box: 'B',\n lasso: 'L',\n single: 'S',\n};\n\nconst GESTURE_KEYS_DEFAULT_ICONS: Record<Gesture, React.ReactNode> = {\n box: <SquareDashIcon />,\n lasso: <LassoIcon />,\n single: <SelectIcon />,\n};\n\nconst GESTURE_KEYS_DEFAULT_TITLES: Record<Gesture, string> = {\n box: 'Box',\n lasso: 'Lasso',\n single: 'Single',\n};\n\ntype ShortcutKey = NonNullable<GraphVisualizationButtonProps['shortcutKey']>;\n\nconst getShortcutModifierKeys = (\n shortcutKey: Pick<ShortcutKey, 'isMetaKey' | 'isShiftKey'> | undefined,\n): NonNullable<React.ComponentProps<typeof Kbd>['modifierKeys']> => [\n ...(shortcutKey?.isMetaKey ? (['meta'] as const) : []),\n ...(shortcutKey?.isShiftKey ? (['shift'] as const) : []),\n];\n\nconst isShortcutMatch = (\n evt: KeyboardEvent,\n shortcutKey: GraphVisualizationButtonProps['shortcutKey'],\n): boolean => {\n if (shortcutKey === undefined || shortcutKey.keys.length !== 1) {\n return false;\n }\n\n return (\n evt.key.toUpperCase() === shortcutKey.keys[0].toUpperCase() &&\n evt.metaKey === shortcutKey.isMetaKey &&\n evt.shiftKey === shortcutKey.isShiftKey &&\n !evt.altKey &&\n !evt.ctrlKey\n );\n};\n\nconst useRegisterKeyboardGestureSwitcher = (\n gestureShortcuts: ReadonlyArray<{\n gesture: Gesture;\n shortcutKey: GraphVisualizationButtonProps['shortcutKey'];\n }>,\n) => {\n const { setGesture } = useGraphVisualizationContext();\n const handleKeyDown = useCallback(\n (evt: KeyboardEvent) => {\n if (!isEditingText(evt) && setGesture !== undefined) {\n for (const { gesture, shortcutKey } of gestureShortcuts) {\n if (isShortcutMatch(evt, shortcutKey)) {\n setGesture(gesture);\n }\n }\n }\n },\n [gestureShortcuts, setGesture],\n );\n\n useEffect(() => {\n document.addEventListener('keydown', handleKeyDown);\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n };\n }, [handleKeyDown]);\n};\n\nexport const SingleSelectButton = ({\n className,\n style,\n htmlAttributes,\n tooltipPlacement,\n shortcutKey = {\n keys: [GESTURE_KEYS_DEFAULT.single],\n isMetaKey: false,\n isShiftKey: false,\n },\n}: GraphVisualizationButtonProps) => {\n const { gesture, setGesture, interactionMode } =\n useGraphVisualizationContext();\n useRegisterKeyboardGestureSwitcher([{ gesture: 'single', shortcutKey }]);\n\n return (\n <GroupButton\n isActive={gesture === 'single'}\n isDisabled={interactionMode !== 'select'}\n ariaLabel=\"Individual Select Button\"\n description=\"Individual Select\"\n descriptionKbdProps={{\n keys: shortcutKey.keys,\n modifierKeys: getShortcutModifierKeys(shortcutKey),\n }}\n onClick={() => {\n setGesture?.('single');\n }}\n tooltipPlacement={tooltipPlacement ?? 'right'}\n htmlAttributes={{\n 'data-testid': 'gesture-individual-select',\n ...htmlAttributes,\n }}\n className={className}\n style={style}\n >\n <SelectIcon aria-label=\"Individual Select\" />\n </GroupButton>\n );\n};\n\nexport const BoxSelectButton = ({\n className,\n style,\n htmlAttributes,\n tooltipPlacement,\n shortcutKey = {\n keys: [GESTURE_KEYS_DEFAULT.box],\n isMetaKey: false,\n isShiftKey: false,\n },\n}: GraphVisualizationButtonProps) => {\n const { gesture, setGesture, interactionMode } =\n useGraphVisualizationContext();\n useRegisterKeyboardGestureSwitcher([{ gesture: 'box', shortcutKey }]);\n\n return (\n <GroupButton\n isDisabled={interactionMode !== 'select' || setGesture === undefined}\n isActive={gesture === 'box'}\n ariaLabel=\"Box Select Button\"\n description=\"Box Select\"\n descriptionKbdProps={{\n keys: shortcutKey.keys,\n modifierKeys: getShortcutModifierKeys(shortcutKey),\n }}\n onClick={() => {\n setGesture?.('box');\n }}\n tooltipPlacement={tooltipPlacement ?? 'right'}\n htmlAttributes={{\n 'data-testid': 'gesture-box-select',\n ...htmlAttributes,\n }}\n className={className}\n style={style}\n >\n <SquareDashIcon aria-label=\"Box select\" />\n </GroupButton>\n );\n};\n\nexport const LassoSelectButton = ({\n className,\n style,\n htmlAttributes,\n tooltipPlacement,\n shortcutKey = {\n keys: [GESTURE_KEYS_DEFAULT.lasso],\n isMetaKey: false,\n isShiftKey: false,\n },\n}: GraphVisualizationButtonProps) => {\n const { gesture, setGesture, interactionMode } =\n useGraphVisualizationContext();\n useRegisterKeyboardGestureSwitcher([{ gesture: 'lasso', shortcutKey }]);\n\n return (\n <GroupButton\n isDisabled={interactionMode !== 'select' || setGesture === undefined}\n isActive={gesture === 'lasso'}\n ariaLabel=\"Lasso Select Button\"\n description=\"Lasso Select\"\n descriptionKbdProps={{\n keys: shortcutKey.keys,\n modifierKeys: getShortcutModifierKeys(shortcutKey),\n }}\n onClick={() => {\n setGesture?.('lasso');\n }}\n tooltipPlacement={tooltipPlacement ?? 'right'}\n htmlAttributes={{\n 'data-testid': 'gesture-lasso-select',\n ...htmlAttributes,\n }}\n className={className}\n style={style}\n >\n <LassoIcon aria-label=\"Lasso select\" />\n </GroupButton>\n );\n};\n\nexport const ZoomInButton = ({\n className,\n style,\n htmlAttributes,\n tooltipPlacement,\n}: GraphVisualizationButtonProps) => {\n const { nvlInstance } = useGraphVisualizationContext();\n\n const handleZoomIn = useCallback(() => {\n nvlInstance.current?.setZoom(nvlInstance.current?.getScale() * 1.3);\n }, [nvlInstance]);\n\n return (\n <GroupButton\n onClick={handleZoomIn}\n description=\"Zoom in\"\n className={className}\n style={style}\n htmlAttributes={htmlAttributes}\n tooltipPlacement={tooltipPlacement ?? 'left'}\n >\n <MagnifyingGlassPlusIconOutline />\n </GroupButton>\n );\n};\n\nexport const ZoomOutButton = ({\n className,\n style,\n htmlAttributes,\n tooltipPlacement,\n}: GraphVisualizationButtonProps) => {\n const { nvlInstance } = useGraphVisualizationContext();\n\n const handleZoomOut = useCallback(() => {\n nvlInstance.current?.setZoom(nvlInstance.current?.getScale() * 0.7);\n }, [nvlInstance]);\n\n return (\n <GroupButton\n onClick={handleZoomOut}\n description=\"Zoom out\"\n className={className}\n style={style}\n htmlAttributes={htmlAttributes}\n tooltipPlacement={tooltipPlacement ?? 'left'}\n >\n <MagnifyingGlassMinusIconOutline />\n </GroupButton>\n );\n};\n\nexport const ZoomToFitButton = ({\n className,\n style,\n htmlAttributes,\n tooltipPlacement,\n}: GraphVisualizationButtonProps) => {\n const { nvlInstance } = useGraphVisualizationContext();\n\n const getNodesToFit = useCallback(() => {\n const instance = nvlInstance.current;\n if (!instance) {\n return [];\n }\n\n const selectedNodes = instance.getSelectedNodes();\n const selectedRels = instance.getSelectedRelationships();\n const nodeIds = new Set<string>();\n\n if (selectedNodes.length || selectedRels.length) {\n selectedNodes.forEach((node) => nodeIds.add(node.id));\n selectedRels.forEach((relationship) =>\n nodeIds.add(relationship.from).add(relationship.to),\n );\n return [...nodeIds];\n }\n\n const allNodes = instance.getNodes();\n const allRels = instance.getRelationships();\n\n allNodes.forEach((node) => node.disabled !== true && nodeIds.add(node.id));\n allRels.forEach(\n (relationship) =>\n relationship.disabled !== true &&\n nodeIds.add(relationship.from).add(relationship.to),\n );\n\n if (nodeIds.size > 0) {\n return [...nodeIds];\n }\n\n return allNodes.map((node) => node.id);\n }, [nvlInstance]);\n\n const handleZoomToFit = useCallback(() => {\n nvlInstance.current?.fit(getNodesToFit());\n }, [getNodesToFit, nvlInstance]);\n\n return (\n <GroupButton\n onClick={handleZoomToFit}\n description=\"Zoom to fit\"\n className={className}\n style={style}\n htmlAttributes={htmlAttributes}\n tooltipPlacement={tooltipPlacement ?? 'left'}\n >\n <FitToScreenIcon />\n </GroupButton>\n );\n};\n\nexport const ToggleSidePanelButton = ({\n className,\n htmlAttributes,\n style,\n tooltipPlacement,\n}: GraphVisualizationButtonProps) => {\n const { sidepanel } = useGraphVisualizationContext();\n if (!sidepanel) {\n throw new Error(\n 'Using the ToggleSidePanelButton requires having a sidepanel',\n );\n }\n const { isSidePanelOpen, setIsSidePanelOpen } = sidepanel;\n return (\n <IconButton\n size=\"small\"\n onClick={() => setIsSidePanelOpen?.(!isSidePanelOpen)}\n isFloating\n description=\"Details\"\n isActive={isSidePanelOpen}\n tooltipProps={{\n content: { style: { whiteSpace: 'nowrap' } },\n root: {\n isPortaled: false,\n placement: tooltipPlacement ?? 'bottom',\n shouldCloseOnReferenceClick: true,\n },\n }}\n className={cx('ndl-graph-visualization-toggle-sidepanel', className)}\n style={style}\n htmlAttributes={{\n 'aria-label': 'Toggle graph details panel',\n ...htmlAttributes,\n }}\n >\n <DocumentTextIconOutline className=\"ndl-graph-visualization-toggle-icon\" />\n </IconButton>\n );\n};\n\ntype SearchButtonProps = GraphVisualizationButtonProps & {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n open?: boolean;\n setOpen?: React.Dispatch<React.SetStateAction<boolean>>;\n searchTerm?: string;\n setSearchTerm?: React.Dispatch<React.SetStateAction<string>>;\n onSearch?: (\n nodeIds: string[] | undefined,\n relationshipIds: string[] | undefined,\n ) => void;\n};\n\nexport const SearchButton = ({\n className,\n style,\n htmlAttributes,\n tooltipPlacement,\n open: rawOpen,\n setOpen: rawSetOpen,\n searchTerm: rawSearchTerm,\n setSearchTerm: rawSetSearchTerm,\n onSearch = () => {\n // no-op\n },\n}: SearchButtonProps) => {\n const inputRef = useRef<HTMLInputElement>(null);\n const [isOpen, setIsOpen] = useSemicontrolledState({\n isControlled: rawOpen !== undefined,\n onChange: rawSetOpen,\n state: rawOpen ?? false,\n });\n const [searchTerm, setSearchTerm] = useSemicontrolledState({\n isControlled: rawSearchTerm !== undefined,\n onChange: rawSetSearchTerm,\n state: rawSearchTerm ?? '',\n });\n const { nvlGraph } = useGraphVisualizationContext();\n\n const handleSearchChange = (newValue: string) => {\n setSearchTerm(newValue);\n if (newValue === '') {\n onSearch(undefined, undefined);\n return;\n }\n\n onSearch(searchNodes(nvlGraph, newValue), searchRels(nvlGraph, newValue));\n };\n\n return (\n <>\n {isOpen ? (\n <TextInput\n ref={inputRef}\n size=\"small\"\n leadingElement={<MagnifyingGlassIconOutline />}\n trailingElement={\n <CleanIconButton\n onClick={() => {\n handleSearchChange('');\n inputRef.current?.focus();\n }}\n description=\"Clear search\"\n >\n <XMarkIconOutline />\n </CleanIconButton>\n }\n placeholder=\"Search...\"\n value={searchTerm}\n onChange={(event) => handleSearchChange(event.target.value)}\n htmlAttributes={{\n autoFocus: true,\n onBlur: () => {\n if (searchTerm === '') {\n setIsOpen(false);\n }\n },\n }}\n />\n ) : (\n <IconButton\n size=\"small\"\n isFloating\n onClick={() => setIsOpen((open) => !open)}\n description=\"Search\"\n className={className}\n style={style}\n htmlAttributes={htmlAttributes}\n tooltipProps={{\n root: {\n isPortaled: false,\n placement: tooltipPlacement ?? 'bottom',\n },\n }}\n >\n <MagnifyingGlassIconOutline />\n </IconButton>\n )}\n </>\n );\n};\n\nexport const DownloadButton = ({\n className,\n style,\n htmlAttributes,\n tooltipPlacement,\n}: GraphVisualizationButtonProps) => {\n const { nvlInstance, portalTarget } = useGraphVisualizationContext();\n\n const [isDownloadMenuOpen, setOpen] = useState(false);\n const closeFileMenu = () => setOpen(false);\n const downloadButtonRef = useRef<HTMLButtonElement>(null);\n return (\n <>\n <IconButton\n ref={downloadButtonRef}\n size=\"small\"\n isFloating\n onClick={() => setOpen((open) => !open)}\n description=\"Download\"\n tooltipProps={{\n root: { isPortaled: false, placement: tooltipPlacement ?? 'bottom' },\n }}\n className={className}\n style={style}\n htmlAttributes={htmlAttributes}\n >\n <ArrowDownTrayIconOutline />\n </IconButton>\n\n <Menu\n isOpen={isDownloadMenuOpen}\n onClose={closeFileMenu}\n anchorRef={downloadButtonRef}\n portalTarget={portalTarget}\n >\n <Menu.Item\n title=\"Download as PNG\"\n onClick={() => {\n nvlInstance.current?.saveToFile({});\n closeFileMenu();\n }}\n />\n <Menu.Item\n title=\"Download as SVG\"\n onClick={() => {\n nvlInstance.current?.saveToSvg({});\n closeFileMenu();\n }}\n />\n </Menu>\n </>\n );\n};\n\nexport type LayoutSelectOption = Record<\n Layout,\n {\n icon: React.ReactNode;\n title: string;\n }\n>;\n\nconst DEFAULT_LAYOUT_OPTIONS: Partial<LayoutSelectOption> = {\n d3Force: {\n icon: <ExploreIcon />,\n title: 'Force-based layout',\n },\n hierarchical: {\n icon: <HierarchyTwoIcon />,\n title: 'Hierarchical layout',\n },\n};\n\nexport const LayoutSelectButton = ({\n className,\n style,\n htmlAttributes,\n tooltipPlacement,\n menuPlacement,\n layoutOptions = DEFAULT_LAYOUT_OPTIONS,\n}: GraphVisualizationButtonProps & {\n menuPlacement?: React.ComponentProps<typeof Menu>['placement'];\n layoutOptions?: Partial<LayoutSelectOption>;\n}) => {\n const anchorRef = useRef<HTMLButtonElement | null>(null);\n const [isMenuOpen, setIsMenuOpen] = useState(false);\n const { layout, setLayout, portalTarget } = useGraphVisualizationContext();\n\n return (\n <>\n <SelectIconButton\n description=\"Select layout\"\n isOpen={isMenuOpen}\n onClick={() => setIsMenuOpen((old) => !old)}\n ref={anchorRef}\n className={className}\n style={style}\n htmlAttributes={htmlAttributes}\n size=\"small\"\n tooltipProps={{\n root: { isPortaled: false, placement: tooltipPlacement ?? 'bottom' },\n }}\n >\n {layoutOptions[layout]?.icon ?? <SelectIcon />}\n </SelectIconButton>\n <Menu\n isOpen={isMenuOpen}\n anchorRef={anchorRef}\n onClose={() => setIsMenuOpen(false)}\n placement={menuPlacement}\n portalTarget={portalTarget}\n >\n {Object.entries(layoutOptions).map(([key, item]) => (\n <Menu.RadioItem\n key={key}\n title={item.title}\n leadingVisual={item.icon}\n isChecked={key === layout}\n onClick={() => setLayout?.(key as Layout)}\n />\n ))}\n </Menu>\n </>\n );\n};\n\nexport type GestureSelectOption = Record<\n Gesture,\n {\n icon?: React.ReactNode;\n title?: string;\n shortcutKey?: GraphVisualizationButtonProps['shortcutKey'];\n }\n>;\n\n// oxlint-disable-next-line sort-keys\nconst DEFAULT_GESTURE_OPTIONS: Partial<GestureSelectOption> = {\n single: {\n icon: <SelectIcon />,\n shortcutKey: {\n keys: [GESTURE_KEYS_DEFAULT.single],\n isMetaKey: false,\n isShiftKey: false,\n },\n title: 'Individual',\n },\n box: {\n icon: <SquareDashIcon />,\n shortcutKey: {\n keys: [GESTURE_KEYS_DEFAULT.box],\n isMetaKey: false,\n isShiftKey: false,\n },\n title: 'Box',\n },\n lasso: {\n icon: <LassoIcon />,\n shortcutKey: {\n keys: [GESTURE_KEYS_DEFAULT.lasso],\n isMetaKey: false,\n isShiftKey: false,\n },\n title: 'Lasso',\n },\n};\n\nexport const GestureSelectButton = ({\n className,\n style,\n htmlAttributes,\n tooltipPlacement,\n menuPlacement,\n gestureOptions = DEFAULT_GESTURE_OPTIONS,\n}: GraphVisualizationButtonProps & {\n menuPlacement?: React.ComponentProps<typeof Menu>['placement'];\n gestureOptions?: Partial<GestureSelectOption>;\n}) => {\n const anchorRef = useRef<HTMLButtonElement | null>(null);\n const [isMenuOpen, setIsMenuOpen] = useState(false);\n const { gesture, setGesture, portalTarget } = useGraphVisualizationContext();\n useRegisterKeyboardGestureSwitcher(\n Object.entries(gestureOptions).map(([gesture, item]) => ({\n gesture: gesture as Gesture,\n shortcutKey: item.shortcutKey,\n })),\n );\n\n const gestureIcon =\n gestureOptions[gesture]?.icon ?? GESTURE_KEYS_DEFAULT_ICONS[gesture];\n return (\n <>\n <SelectIconButton\n description=\"Select gesture\"\n isOpen={isMenuOpen}\n onClick={() => setIsMenuOpen((old) => !old)}\n ref={anchorRef}\n className={className}\n style={style}\n htmlAttributes={htmlAttributes}\n size=\"small\"\n tooltipProps={{\n root: { isPortaled: false, placement: tooltipPlacement ?? 'bottom' },\n }}\n >\n {gestureOptions[gesture] ? gestureIcon : <SelectIcon />}\n </SelectIconButton>\n <Menu\n isOpen={isMenuOpen}\n anchorRef={anchorRef}\n onClose={() => setIsMenuOpen(false)}\n placement={menuPlacement}\n portalTarget={portalTarget}\n >\n {Object.entries(gestureOptions).map(([key, item]) => (\n <Menu.RadioItem\n key={key}\n title={item.title ?? GESTURE_KEYS_DEFAULT_TITLES[key as Gesture]}\n leadingVisual={item.icon}\n trailingContent={\n <Kbd\n keys={item.shortcutKey?.keys}\n modifierKeys={getShortcutModifierKeys(item.shortcutKey)}\n />\n }\n isChecked={key === gesture}\n onClick={() => setGesture?.(key as Gesture)}\n />\n ))}\n </Menu>\n </>\n );\n};\n"]}
1
+ {"version":3,"file":"graph-visualization-buttons.js","sourceRoot":"","sources":["../../src/graph-visualization-buttons.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EACL,eAAe,EACf,UAAU,EACV,GAAG,EACH,IAAI,EACJ,gBAAgB,EAChB,SAAS,GAEV,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,WAAW,EACX,eAAe,EACf,gBAA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AAI,IACH,MAAM,EAAE,UAAU,EAClB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,EACnC,SAAS,EAAE,aAAa,EACxB,YAAY,EAAE,YAAY,YAEzB,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE;;oBAAC,OAAA,CACnD,KAAC,IAAI,CAAC,SAAS,IAEb,KAAK,EAAE,MAAA,IAAI,CAAC,KAAK,mCAAI,2BAA2B,CAAC,GAAc,CAAC,EAChE,aAAa,EAAE,IAAI,CAAC,IAAI,EACxB,eAAe,EACb,KAAC,GAAG,IACF,IAAI,EAAE,MAAA,IAAI,CAAC,WAAW,0CAAE,IAAI,EAC5B,YAAY,EAAE,uBAAuB,CAAC,IAAI,CAAC,WAAW,CAAC,GACvD,EAEJ,SAAS,EAAE,GAAG,KAAK,OAAO,EAC1B,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAG,GAAc,CAAC,IAVtC,GAAG,CAWR,CACH,CAAA;iBAAA,CAAC,GACG,IACN,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 {\n CleanIconButton,\n IconButton,\n Kbd,\n Menu,\n SelectIconButton,\n TextInput,\n type Tooltip,\n} from '@neo4j-ndl/react';\nimport {\n ArrowDownTrayIconOutline,\n DocumentTextIconOutline,\n ExploreIcon,\n FitToScreenIcon,\n HierarchyTwoIcon,\n LassoIcon,\n MagnifyingGlassIconOutline,\n MagnifyingGlassMinusIconOutline,\n MagnifyingGlassPlusIconOutline,\n SelectIcon,\n SquareDashIcon,\n XMarkIconOutline,\n} from '@neo4j-ndl/react/icons';\nimport { type Layout } from '@neo4j-nvl/base';\nimport { default as cx } from 'classnames';\nimport type React from 'react';\nimport {\n type PropsWithChildren,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\n\nimport {\n type Gesture,\n useGraphVisualizationContext,\n} from './graph-visualization-context';\nimport { useSemicontrolledState } from './use-semi-controlled-state';\nimport { searchNodes, searchRels } from './utils';\n\ntype GraphVisualizationButtonProps = {\n tooltipPlacement?: React.ComponentProps<typeof Tooltip>['placement'];\n className?: string;\n /**\n * Additional css styling. Will be applied to the root element.\n */\n style?: React.CSSProperties;\n\n /**\n * Html attributes to apply to the root element. This will override any default html attributes, use with caution.\n */\n htmlAttributes?: React.ComponentPropsWithRef<\n typeof CleanIconButton\n >['htmlAttributes'];\n\n /**\n * A ref to apply to the root element.\n */\n ref?: React.ComponentPropsWithRef<'button'>['ref'];\n shortcutKey?: {\n keys: string[];\n isMetaKey: boolean;\n isShiftKey: boolean;\n };\n};\n\ntype BaseProperties = GraphVisualizationButtonProps & {\n description: string;\n testid?: string;\n ariaLabel?: string;\n isActive?: boolean;\n isDisabled?: boolean;\n onClick?: () => void;\n onMouseDown?: () => void;\n descriptionKbdProps?: React.ComponentPropsWithRef<\n typeof CleanIconButton\n >['descriptionKbdProps'];\n};\n\nexport type GraphVisualizationGroupButton = PropsWithChildren<BaseProperties>;\n\nexport const GroupButton = (props: GraphVisualizationGroupButton) => {\n const {\n isActive,\n ariaLabel,\n isDisabled,\n description,\n onClick,\n onMouseDown,\n tooltipPlacement,\n className,\n style,\n htmlAttributes,\n children,\n descriptionKbdProps,\n } = props;\n return (\n <CleanIconButton\n description={description ?? ariaLabel}\n tooltipProps={{\n content: { style: { whiteSpace: 'nowrap' } },\n root: { isPortaled: false, placement: tooltipPlacement },\n }}\n size=\"small\"\n className={className}\n style={style}\n isActive={isActive}\n isDisabled={isDisabled}\n descriptionKbdProps={descriptionKbdProps}\n onClick={onClick}\n htmlAttributes={{\n onMouseDown,\n ...htmlAttributes,\n }}\n >\n {children}\n </CleanIconButton>\n );\n};\n\nconst targetIsTextInput = (target: EventTarget | null): boolean => {\n if (!(target instanceof HTMLElement)) {\n return false;\n }\n return (\n target.isContentEditable || ['INPUT', 'TEXTAREA'].includes(target.tagName)\n );\n};\n\nconst isEditingText = (event: KeyboardEvent): boolean => {\n return targetIsTextInput(event.target);\n};\n\nconst GESTURE_KEYS_DEFAULT: Record<Gesture, string> = {\n box: 'B',\n lasso: 'L',\n single: 'S',\n};\n\nconst GESTURE_KEYS_DEFAULT_ICONS: Record<Gesture, React.ReactNode> = {\n box: <SquareDashIcon />,\n lasso: <LassoIcon />,\n single: <SelectIcon />,\n};\n\nconst GESTURE_KEYS_DEFAULT_TITLES: Record<Gesture, string> = {\n box: 'Box',\n lasso: 'Lasso',\n single: 'Single',\n};\n\ntype ShortcutKey = NonNullable<GraphVisualizationButtonProps['shortcutKey']>;\n\nconst getShortcutModifierKeys = (\n shortcutKey: Pick<ShortcutKey, 'isMetaKey' | 'isShiftKey'> | undefined,\n): NonNullable<React.ComponentProps<typeof Kbd>['modifierKeys']> => [\n ...(shortcutKey?.isMetaKey ? (['meta'] as const) : []),\n ...(shortcutKey?.isShiftKey ? (['shift'] as const) : []),\n];\n\nconst isShortcutMatch = (\n evt: KeyboardEvent,\n shortcutKey: GraphVisualizationButtonProps['shortcutKey'],\n): boolean => {\n if (shortcutKey === undefined || shortcutKey.keys.length !== 1) {\n return false;\n }\n\n return (\n evt.key.toUpperCase() === shortcutKey.keys[0].toUpperCase() &&\n evt.metaKey === shortcutKey.isMetaKey &&\n evt.shiftKey === shortcutKey.isShiftKey &&\n !evt.altKey &&\n !evt.ctrlKey\n );\n};\n\nconst useRegisterKeyboardGestureSwitcher = (\n gestureShortcuts: ReadonlyArray<{\n gesture: Gesture;\n shortcutKey: GraphVisualizationButtonProps['shortcutKey'];\n }>,\n) => {\n const { setGesture } = useGraphVisualizationContext();\n const handleKeyDown = useCallback(\n (evt: KeyboardEvent) => {\n if (!isEditingText(evt) && setGesture !== undefined) {\n for (const { gesture, shortcutKey } of gestureShortcuts) {\n if (isShortcutMatch(evt, shortcutKey)) {\n setGesture(gesture);\n }\n }\n }\n },\n [gestureShortcuts, setGesture],\n );\n\n useEffect(() => {\n document.addEventListener('keydown', handleKeyDown);\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n };\n }, [handleKeyDown]);\n};\n\nexport const SingleSelectButton = ({\n className,\n style,\n htmlAttributes,\n tooltipPlacement,\n shortcutKey = {\n keys: [GESTURE_KEYS_DEFAULT.single],\n isMetaKey: false,\n isShiftKey: false,\n },\n}: GraphVisualizationButtonProps) => {\n const { gesture, setGesture, interactionMode } =\n useGraphVisualizationContext();\n useRegisterKeyboardGestureSwitcher([{ gesture: 'single', shortcutKey }]);\n\n return (\n <GroupButton\n isActive={gesture === 'single'}\n isDisabled={interactionMode !== 'select'}\n ariaLabel=\"Individual Select Button\"\n description=\"Individual Select\"\n descriptionKbdProps={{\n keys: shortcutKey.keys,\n modifierKeys: getShortcutModifierKeys(shortcutKey),\n }}\n onClick={() => {\n setGesture?.('single');\n }}\n tooltipPlacement={tooltipPlacement ?? 'right'}\n htmlAttributes={{\n 'data-testid': 'gesture-individual-select',\n ...htmlAttributes,\n }}\n className={className}\n style={style}\n >\n <SelectIcon aria-label=\"Individual Select\" />\n </GroupButton>\n );\n};\n\nexport const BoxSelectButton = ({\n className,\n style,\n htmlAttributes,\n tooltipPlacement,\n shortcutKey = {\n keys: [GESTURE_KEYS_DEFAULT.box],\n isMetaKey: false,\n isShiftKey: false,\n },\n}: GraphVisualizationButtonProps) => {\n const { gesture, setGesture, interactionMode } =\n useGraphVisualizationContext();\n useRegisterKeyboardGestureSwitcher([{ gesture: 'box', shortcutKey }]);\n\n return (\n <GroupButton\n isDisabled={interactionMode !== 'select' || setGesture === undefined}\n isActive={gesture === 'box'}\n ariaLabel=\"Box Select Button\"\n description=\"Box Select\"\n descriptionKbdProps={{\n keys: shortcutKey.keys,\n modifierKeys: getShortcutModifierKeys(shortcutKey),\n }}\n onClick={() => {\n setGesture?.('box');\n }}\n tooltipPlacement={tooltipPlacement ?? 'right'}\n htmlAttributes={{\n 'data-testid': 'gesture-box-select',\n ...htmlAttributes,\n }}\n className={className}\n style={style}\n >\n <SquareDashIcon aria-label=\"Box select\" />\n </GroupButton>\n );\n};\n\nexport const LassoSelectButton = ({\n className,\n style,\n htmlAttributes,\n tooltipPlacement,\n shortcutKey = {\n keys: [GESTURE_KEYS_DEFAULT.lasso],\n isMetaKey: false,\n isShiftKey: false,\n },\n}: GraphVisualizationButtonProps) => {\n const { gesture, setGesture, interactionMode } =\n useGraphVisualizationContext();\n useRegisterKeyboardGestureSwitcher([{ gesture: 'lasso', shortcutKey }]);\n\n return (\n <GroupButton\n isDisabled={interactionMode !== 'select' || setGesture === undefined}\n isActive={gesture === 'lasso'}\n ariaLabel=\"Lasso Select Button\"\n description=\"Lasso Select\"\n descriptionKbdProps={{\n keys: shortcutKey.keys,\n modifierKeys: getShortcutModifierKeys(shortcutKey),\n }}\n onClick={() => {\n setGesture?.('lasso');\n }}\n tooltipPlacement={tooltipPlacement ?? 'right'}\n htmlAttributes={{\n 'data-testid': 'gesture-lasso-select',\n ...htmlAttributes,\n }}\n className={className}\n style={style}\n >\n <LassoIcon aria-label=\"Lasso select\" />\n </GroupButton>\n );\n};\n\nexport const ZoomInButton = ({\n className,\n style,\n htmlAttributes,\n tooltipPlacement,\n}: GraphVisualizationButtonProps) => {\n const { nvlInstance } = useGraphVisualizationContext();\n\n const handleZoomIn = useCallback(() => {\n nvlInstance.current?.setZoom(nvlInstance.current?.getScale() * 1.3);\n }, [nvlInstance]);\n\n return (\n <GroupButton\n onClick={handleZoomIn}\n description=\"Zoom in\"\n className={className}\n style={style}\n htmlAttributes={htmlAttributes}\n tooltipPlacement={tooltipPlacement ?? 'left'}\n >\n <MagnifyingGlassPlusIconOutline />\n </GroupButton>\n );\n};\n\nexport const ZoomOutButton = ({\n className,\n style,\n htmlAttributes,\n tooltipPlacement,\n}: GraphVisualizationButtonProps) => {\n const { nvlInstance } = useGraphVisualizationContext();\n\n const handleZoomOut = useCallback(() => {\n nvlInstance.current?.setZoom(nvlInstance.current?.getScale() * 0.7);\n }, [nvlInstance]);\n\n return (\n <GroupButton\n onClick={handleZoomOut}\n description=\"Zoom out\"\n className={className}\n style={style}\n htmlAttributes={htmlAttributes}\n tooltipPlacement={tooltipPlacement ?? 'left'}\n >\n <MagnifyingGlassMinusIconOutline />\n </GroupButton>\n );\n};\n\nexport const ZoomToFitButton = ({\n className,\n style,\n htmlAttributes,\n tooltipPlacement,\n}: GraphVisualizationButtonProps) => {\n const { nvlInstance } = useGraphVisualizationContext();\n\n const getNodesToFit = useCallback(() => {\n const instance = nvlInstance.current;\n if (!instance) {\n return [];\n }\n\n const selectedNodes = instance.getSelectedNodes();\n const selectedRels = instance.getSelectedRelationships();\n const nodeIds = new Set<string>();\n\n if (selectedNodes.length || selectedRels.length) {\n selectedNodes.forEach((node) => nodeIds.add(node.id));\n selectedRels.forEach((relationship) =>\n nodeIds.add(relationship.from).add(relationship.to),\n );\n return [...nodeIds];\n }\n\n const allNodes = instance.getNodes();\n const allRels = instance.getRelationships();\n\n allNodes.forEach((node) => node.disabled !== true && nodeIds.add(node.id));\n allRels.forEach(\n (relationship) =>\n relationship.disabled !== true &&\n nodeIds.add(relationship.from).add(relationship.to),\n );\n\n if (nodeIds.size > 0) {\n return [...nodeIds];\n }\n\n return allNodes.map((node) => node.id);\n }, [nvlInstance]);\n\n const handleZoomToFit = useCallback(() => {\n nvlInstance.current?.fit(getNodesToFit());\n }, [getNodesToFit, nvlInstance]);\n\n return (\n <GroupButton\n onClick={handleZoomToFit}\n description=\"Zoom to fit\"\n className={className}\n style={style}\n htmlAttributes={htmlAttributes}\n tooltipPlacement={tooltipPlacement ?? 'left'}\n >\n <FitToScreenIcon />\n </GroupButton>\n );\n};\n\nexport const ToggleSidePanelButton = ({\n className,\n htmlAttributes,\n style,\n tooltipPlacement,\n}: GraphVisualizationButtonProps) => {\n const { sidepanel } = useGraphVisualizationContext();\n if (!sidepanel) {\n throw new Error(\n 'Using the ToggleSidePanelButton requires having a sidepanel',\n );\n }\n const { isSidePanelOpen, setIsSidePanelOpen } = sidepanel;\n return (\n <IconButton\n size=\"small\"\n onClick={() => setIsSidePanelOpen?.(!isSidePanelOpen)}\n isFloating\n description=\"Details\"\n isActive={isSidePanelOpen}\n tooltipProps={{\n content: { style: { whiteSpace: 'nowrap' } },\n root: {\n isPortaled: false,\n placement: tooltipPlacement ?? 'bottom',\n shouldCloseOnReferenceClick: true,\n },\n }}\n className={cx('ndl-graph-visualization-toggle-sidepanel', className)}\n style={style}\n htmlAttributes={{\n 'aria-label': 'Toggle graph details panel',\n ...htmlAttributes,\n }}\n >\n <DocumentTextIconOutline className=\"ndl-graph-visualization-toggle-icon\" />\n </IconButton>\n );\n};\n\ntype SearchButtonProps = GraphVisualizationButtonProps & {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n open?: boolean;\n setOpen?: React.Dispatch<React.SetStateAction<boolean>>;\n searchTerm?: string;\n setSearchTerm?: React.Dispatch<React.SetStateAction<string>>;\n onSearch?: (\n nodeIds: string[] | undefined,\n relationshipIds: string[] | undefined,\n ) => void;\n};\n\nexport const SearchButton = ({\n className,\n style,\n htmlAttributes,\n tooltipPlacement,\n open: rawOpen,\n setOpen: rawSetOpen,\n searchTerm: rawSearchTerm,\n setSearchTerm: rawSetSearchTerm,\n onSearch = () => {\n // no-op\n },\n}: SearchButtonProps) => {\n const inputRef = useRef<HTMLInputElement>(null);\n const [isOpen, setIsOpen] = useSemicontrolledState({\n isControlled: rawOpen !== undefined,\n onChange: rawSetOpen,\n state: rawOpen ?? false,\n });\n const [searchTerm, setSearchTerm] = useSemicontrolledState({\n isControlled: rawSearchTerm !== undefined,\n onChange: rawSetSearchTerm,\n state: rawSearchTerm ?? '',\n });\n const { nvlGraph } = useGraphVisualizationContext();\n\n const handleSearchChange = (newValue: string) => {\n setSearchTerm(newValue);\n if (newValue === '') {\n onSearch(undefined, undefined);\n return;\n }\n\n onSearch(searchNodes(nvlGraph, newValue), searchRels(nvlGraph, newValue));\n };\n\n return (\n <>\n {isOpen ? (\n <TextInput\n ref={inputRef}\n size=\"small\"\n leadingElement={<MagnifyingGlassIconOutline />}\n trailingElement={\n <CleanIconButton\n onClick={() => {\n handleSearchChange('');\n inputRef.current?.focus();\n }}\n description=\"Clear search\"\n >\n <XMarkIconOutline />\n </CleanIconButton>\n }\n placeholder=\"Search...\"\n value={searchTerm}\n onChange={(event) => handleSearchChange(event.target.value)}\n htmlAttributes={{\n autoFocus: true,\n onBlur: () => {\n if (searchTerm === '') {\n setIsOpen(false);\n }\n },\n }}\n />\n ) : (\n <IconButton\n size=\"small\"\n isFloating\n onClick={() => setIsOpen((open) => !open)}\n description=\"Search\"\n className={className}\n style={style}\n htmlAttributes={htmlAttributes}\n tooltipProps={{\n root: {\n isPortaled: false,\n placement: tooltipPlacement ?? 'bottom',\n },\n }}\n >\n <MagnifyingGlassIconOutline />\n </IconButton>\n )}\n </>\n );\n};\n\nexport const DownloadButton = ({\n className,\n style,\n htmlAttributes,\n tooltipPlacement,\n}: GraphVisualizationButtonProps) => {\n const { nvlInstance, portalTarget } = useGraphVisualizationContext();\n\n const [isDownloadMenuOpen, setOpen] = useState(false);\n const closeFileMenu = () => setOpen(false);\n const downloadButtonRef = useRef<HTMLButtonElement>(null);\n return (\n <>\n <IconButton\n ref={downloadButtonRef}\n size=\"small\"\n isFloating\n onClick={() => setOpen((open) => !open)}\n description=\"Download\"\n tooltipProps={{\n root: { isPortaled: false, placement: tooltipPlacement ?? 'bottom' },\n }}\n className={className}\n style={style}\n htmlAttributes={htmlAttributes}\n >\n <ArrowDownTrayIconOutline />\n </IconButton>\n\n <Menu\n isOpen={isDownloadMenuOpen}\n onClose={closeFileMenu}\n anchorRef={downloadButtonRef}\n portalTarget={portalTarget}\n >\n <Menu.Item\n title=\"Download as PNG\"\n onClick={() => {\n nvlInstance.current?.saveToFile({});\n closeFileMenu();\n }}\n />\n <Menu.Item\n title=\"Download as SVG\"\n onClick={() => {\n nvlInstance.current?.saveToSvg({});\n closeFileMenu();\n }}\n />\n </Menu>\n </>\n );\n};\n\nexport type LayoutSelectOption = Record<\n Layout,\n {\n icon: React.ReactNode;\n title: string;\n }\n>;\n\nconst DEFAULT_LAYOUT_OPTIONS: Partial<LayoutSelectOption> = {\n d3Force: {\n icon: <ExploreIcon />,\n title: 'Force-based layout',\n },\n hierarchical: {\n icon: <HierarchyTwoIcon />,\n title: 'Hierarchical layout',\n },\n};\n\nexport const LayoutSelectButton = ({\n className,\n style,\n htmlAttributes,\n tooltipPlacement,\n menuPlacement,\n layoutOptions = DEFAULT_LAYOUT_OPTIONS,\n}: GraphVisualizationButtonProps & {\n menuPlacement?: React.ComponentProps<typeof Menu>['placement'];\n layoutOptions?: Partial<LayoutSelectOption>;\n}) => {\n const anchorRef = useRef<HTMLButtonElement | null>(null);\n const [isMenuOpen, setIsMenuOpen] = useState(false);\n const { layout, setLayout, portalTarget } = useGraphVisualizationContext();\n\n return (\n <>\n <SelectIconButton\n description=\"Select layout\"\n isOpen={isMenuOpen}\n onClick={() => setIsMenuOpen((old) => !old)}\n ref={anchorRef}\n className={className}\n style={style}\n htmlAttributes={htmlAttributes}\n size=\"small\"\n tooltipProps={{\n root: { isPortaled: false, placement: tooltipPlacement ?? 'bottom' },\n }}\n >\n {layoutOptions[layout]?.icon ?? <SelectIcon />}\n </SelectIconButton>\n <Menu\n isOpen={isMenuOpen}\n anchorRef={anchorRef}\n onClose={() => setIsMenuOpen(false)}\n placement={menuPlacement}\n portalTarget={portalTarget}\n >\n {Object.entries(layoutOptions).map(([key, item]) => (\n <Menu.RadioItem\n key={key}\n title={item.title}\n leadingVisual={item.icon}\n isChecked={key === layout}\n onClick={() => setLayout?.(key as Layout)}\n />\n ))}\n </Menu>\n </>\n );\n};\n\nexport type GestureSelectOption = Record<\n Gesture,\n {\n icon?: React.ReactNode;\n title?: string;\n shortcutKey?: GraphVisualizationButtonProps['shortcutKey'];\n }\n>;\n\n// oxlint-disable-next-line sort-keys\nconst DEFAULT_GESTURE_OPTIONS: Partial<GestureSelectOption> = {\n single: {\n icon: <SelectIcon />,\n shortcutKey: {\n keys: [GESTURE_KEYS_DEFAULT.single],\n isMetaKey: false,\n isShiftKey: false,\n },\n title: 'Individual',\n },\n box: {\n icon: <SquareDashIcon />,\n shortcutKey: {\n keys: [GESTURE_KEYS_DEFAULT.box],\n isMetaKey: false,\n isShiftKey: false,\n },\n title: 'Box',\n },\n lasso: {\n icon: <LassoIcon />,\n shortcutKey: {\n keys: [GESTURE_KEYS_DEFAULT.lasso],\n isMetaKey: false,\n isShiftKey: false,\n },\n title: 'Lasso',\n },\n};\n\nexport const GestureSelectButton = ({\n className,\n style,\n htmlAttributes,\n tooltipPlacement,\n menuPlacement,\n gestureOptions = DEFAULT_GESTURE_OPTIONS,\n}: GraphVisualizationButtonProps & {\n menuPlacement?: React.ComponentProps<typeof Menu>['placement'];\n gestureOptions?: Partial<GestureSelectOption>;\n}) => {\n const anchorRef = useRef<HTMLButtonElement | null>(null);\n const [isMenuOpen, setIsMenuOpen] = useState(false);\n const { gesture, setGesture, portalTarget } = useGraphVisualizationContext();\n useRegisterKeyboardGestureSwitcher(\n Object.entries(gestureOptions).map(([gesture, item]) => ({\n gesture: gesture as Gesture,\n shortcutKey: item.shortcutKey,\n })),\n );\n\n const gestureIcon =\n gestureOptions[gesture]?.icon ?? GESTURE_KEYS_DEFAULT_ICONS[gesture];\n return (\n <>\n <SelectIconButton\n description=\"Select gesture\"\n isOpen={isMenuOpen}\n onClick={() => setIsMenuOpen((old) => !old)}\n ref={anchorRef}\n className={className}\n style={style}\n htmlAttributes={htmlAttributes}\n size=\"small\"\n tooltipProps={{\n root: { isPortaled: false, placement: tooltipPlacement ?? 'bottom' },\n }}\n >\n {gestureOptions[gesture] ? gestureIcon : <SelectIcon />}\n </SelectIconButton>\n <Menu\n isOpen={isMenuOpen}\n anchorRef={anchorRef}\n onClose={() => setIsMenuOpen(false)}\n placement={menuPlacement}\n portalTarget={portalTarget}\n >\n {Object.entries(gestureOptions).map(([key, item]) => (\n <Menu.RadioItem\n key={key}\n title={item.title ?? GESTURE_KEYS_DEFAULT_TITLES[key as Gesture]}\n leadingVisual={item.icon}\n trailingContent={\n <Kbd\n keys={item.shortcutKey?.keys}\n modifierKeys={getShortcutModifierKeys(item.shortcutKey)}\n />\n }\n isChecked={key === gesture}\n onClick={() => setGesture?.(key as Gesture)}\n />\n ))}\n </Menu>\n </>\n );\n};\n"]}
@@ -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":"graph-visualization-context.js","sourceRoot":"","sources":["../../src/graph-visualization-context.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAqFlD,MAAM,CAAC,MAAM,yBAAyB,GAAG,aAAa,CAEpD,SAAS,CAAC,CAAC;AAEb;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAG,EAAE;IAC/C,MAAM,OAAO,GAAG,UAAU,CAAC,yBAAyB,CAAC,CAAC;IACtD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,8EAA8E,CAC/E,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,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 type NVL from '@neo4j-nvl/base';\nimport { type Layout, type Node, type Relationship } from '@neo4j-nvl/base';\nimport { createContext, useContext } from 'react';\n\nimport { type CompiledGraphStyleRules } from './styling/compile-graph-styles';\n\nexport type GraphSelection = { nodeIds: string[]; relationshipIds: string[] };\nexport type Sidepanel = {\n children: React.ReactNode;\n isSidePanelOpen: boolean;\n setIsSidePanelOpen?: (isSidePanelOpen: boolean) => void;\n sidePanelWidth?: number;\n onSidePanelResize: (width: number) => void;\n minWidth?: number | string;\n maxWidth?: number | string;\n};\n\nexport type NvlGraph = {\n nodes: Node[];\n nodeData: Record<string, NodeData>;\n rels: Relationship[];\n relData: Record<string, RelData>;\n};\n\nexport type ColorCount = { color: string; count: number };\n\nexport type GraphItemMetaData = {\n totalCount: number;\n /** Distribution of colors across all elements with this label/type, sorted descending by count. */\n colorDistribution: ColorCount[];\n};\n\nexport type MetadataLookupTable = {\n labels: string[];\n labelMetaData: Record<string, GraphItemMetaData>;\n reltypes: string[];\n reltypeMetaData: Record<string, GraphItemMetaData>;\n hasMultipleColors: boolean;\n};\n\n// We use this type to avoid coupling the graph visualization component to the neo4j driver types\n// The tradeoff is that it's limited to displaying values and not manipulating them\n// and that it's harder to pass to the graph visualization component from the raw driver result\nexport type PortableProperty = { stringified: string; type: string };\n\nexport type NodeData = {\n labelsSorted: string[];\n properties: Record<string, PortableProperty>;\n id: string;\n};\nexport type RelData = {\n type: string;\n properties: Record<string, PortableProperty>;\n id: string;\n};\n\nexport type NeoNode = Node & {\n properties: Record<string, PortableProperty>;\n labels: string[];\n};\n\nexport type NeoRel = Relationship & {\n properties: Record<string, PortableProperty>;\n type: string;\n};\n\n/**\n * Data that is shared across the graph visualization component.\n *\n * @see {@link useGraphVisualizationContext}\n * @alpha\n */\nexport type GraphVisualizationContextData = {\n nvlInstance: React.MutableRefObject<NVL | null>;\n sidepanel: Sidepanel | null;\n gesture: Gesture;\n setGesture?: (gesture: Gesture) => void;\n interactionMode: InteractionMode;\n nvlGraph: NvlGraph;\n selected: GraphSelection;\n metadataLookup: MetadataLookupTable;\n compiledStyleRules: CompiledGraphStyleRules;\n layout: Layout;\n setLayout?: (layout: Layout) => void;\n portalTarget?: HTMLElement | null;\n};\n\nexport const GraphVisualizationContext = createContext<\n GraphVisualizationContextData | undefined\n>(undefined);\n\n/**\n * Hook to access the graph visualization context.\n *\n * This hook is used to implement custom UI components like buttons, panels, and controls\n * that need access to data and functionality from the graph visualization component.\n * @see {@link GraphVisualizationContextData}\n *\n * @returns The graph visualization context containing NVL instance, sidepanel, gestures, and graph data\n * @throws Error if used outside of a GraphVisualizationContext provider\n *\n * @example\n * ```tsx\n * const NodeLoggerButton = () => {\n * const { selected } = useGraphVisualizationContext();\n *\n * const handleClick = () => {\n * console.log('Selected nodes:', selected.nodeIds);\n * };\n *\n * return (\n * <button onClick={handleClick}>\n * Log Selected Nodes ({selected.nodeIds.length})\n * </button>\n * );\n * };\n * ```\n * @alpha\n */\nexport const useGraphVisualizationContext = () => {\n const context = useContext(GraphVisualizationContext);\n if (!context) {\n throw new Error(\n 'useGraphVisualizationContext must be used within a GraphVisualizationContext',\n );\n }\n return context;\n};\n\nexport type Gesture = 'single' | 'box' | 'lasso';\n\nexport type InteractionMode =\n | 'select'\n | 'draw'\n | 'edit-text'\n | 'pan'\n | 'drag'\n | 'none';\n"]}
1
+ {"version":3,"file":"graph-visualization-context.js","sourceRoot":"","sources":["../../src/graph-visualization-context.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAqFlD,MAAM,CAAC,MAAM,yBAAyB,GAAG,aAAa,CAEpD,SAAS,CAAC,CAAC;AAEb;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAG,EAAE;IAC/C,MAAM,OAAO,GAAG,UAAU,CAAC,yBAAyB,CAAC,CAAC;IACtD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,8EAA8E,CAC/E,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,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 type NVL from '@neo4j-nvl/base';\nimport { type Layout, type Node, type Relationship } from '@neo4j-nvl/base';\nimport { createContext, useContext } from 'react';\n\nimport { type CompiledGraphStyleRules } from './styling/compile-graph-styles';\n\nexport type GraphSelection = { nodeIds: string[]; relationshipIds: string[] };\nexport type Sidepanel = {\n children: React.ReactNode;\n isSidePanelOpen: boolean;\n setIsSidePanelOpen?: (isSidePanelOpen: boolean) => void;\n sidePanelWidth?: number;\n onSidePanelResize: (width: number) => void;\n minWidth?: number | string;\n maxWidth?: number | string;\n};\n\nexport type NvlGraph = {\n nodes: Node[];\n nodeData: Record<string, NodeData>;\n rels: Relationship[];\n relData: Record<string, RelData>;\n};\n\nexport type ColorCount = { color: string; count: number };\n\nexport type GraphItemMetaData = {\n totalCount: number;\n /** Distribution of colors across all elements with this label/type, sorted descending by count. */\n colorDistribution: ColorCount[];\n};\n\nexport type MetadataLookupTable = {\n labels: string[];\n labelMetaData: Record<string, GraphItemMetaData>;\n reltypes: string[];\n reltypeMetaData: Record<string, GraphItemMetaData>;\n hasMultipleColors: boolean;\n};\n\n// We use this type to avoid coupling the graph visualization component to the neo4j driver types\n// The tradeoff is that it's limited to displaying values and not manipulating them\n// and that it's harder to pass to the graph visualization component from the raw driver result\nexport type PortableProperty = { stringified: string; type: string };\n\nexport type NodeData = {\n labelsSorted: string[];\n properties: Record<string, PortableProperty>;\n id: string;\n};\nexport type RelData = {\n type: string;\n properties: Record<string, PortableProperty>;\n id: string;\n};\n\nexport type NeoNode = Node & {\n properties: Record<string, PortableProperty>;\n labels: string[];\n};\n\nexport type NeoRel = Relationship & {\n properties: Record<string, PortableProperty>;\n type: string;\n};\n\n/**\n * Data that is shared across the graph visualization component.\n *\n * @see {@link useGraphVisualizationContext}\n * @alpha\n */\nexport type GraphVisualizationContextData = {\n nvlInstance: React.MutableRefObject<NVL | null>;\n sidepanel: Sidepanel | null;\n gesture: Gesture;\n setGesture?: (gesture: Gesture) => void;\n interactionMode: InteractionMode;\n nvlGraph: NvlGraph;\n selected: GraphSelection;\n metadataLookup: MetadataLookupTable;\n compiledStyleRules: CompiledGraphStyleRules;\n layout: Layout;\n setLayout?: (layout: Layout) => void;\n portalTarget?: HTMLElement | null;\n};\n\nexport const GraphVisualizationContext = createContext<\n GraphVisualizationContextData | undefined\n>(undefined);\n\n/**\n * Hook to access the graph visualization context.\n *\n * This hook is used to implement custom UI components like buttons, panels, and controls\n * that need access to data and functionality from the graph visualization component.\n * @see {@link GraphVisualizationContextData}\n *\n * @returns The graph visualization context containing NVL instance, sidepanel, gestures, and graph data\n * @throws Error if used outside of a GraphVisualizationContext provider\n *\n * @example\n * ```tsx\n * const NodeLoggerButton = () => {\n * const { selected } = useGraphVisualizationContext();\n *\n * const handleClick = () => {\n * console.log('Selected nodes:', selected.nodeIds);\n * };\n *\n * return (\n * <button onClick={handleClick}>\n * Log Selected Nodes ({selected.nodeIds.length})\n * </button>\n * );\n * };\n * ```\n * @alpha\n */\nexport const useGraphVisualizationContext = () => {\n const context = useContext(GraphVisualizationContext);\n if (!context) {\n throw new Error(\n 'useGraphVisualizationContext must be used within a GraphVisualizationContext',\n );\n }\n return context;\n};\n\nexport type Gesture = 'single' | 'box' | 'lasso';\n\nexport type InteractionMode =\n | 'select'\n | 'draw'\n | 'edit-text'\n | 'pan'\n | 'drag'\n | 'none';\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":"graph-visualization-sidepanel.js","sourceRoot":"","sources":["../../src/graph-visualization-sidepanel.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAI1C,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,EAC1C,SAAS,GAGV,EAAE,EAAE;IACH,MAAM,EACJ,QAAQ,EACR,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,QAAQ,GAAG,8BAA8B,EACzC,QAAQ,GAAG,GAAG,GACf,GAAG,SAAS,CAAC;IAEd,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,KAAC,MAAM,IACL,SAAS,EAAC,gCAAgC,EAC1C,UAAU,EAAE,eAAe,EAC3B,gBAAgB,EAAE,CAAC,QAAQ,EAAE,EAAE;YAC7B,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAG,QAAQ,CAAC,CAAC;QACjC,CAAC,EACD,QAAQ,EAAC,OAAO,EAChB,IAAI,EAAC,MAAM,EACX,YAAY,QACZ,WAAW,EAAE,KAAK,EAClB,eAAe,EAAE;YACf,MAAM,EAAE,QAAQ;YAChB,WAAW,EAAE;gBACX,MAAM,EAAE,MAAM;gBACd,KAAK,EAAE,cAAc,aAAd,cAAc,cAAd,cAAc,GAAI,GAAG;aAC7B;YACD,QAAQ;YACR,QAAQ;YACR,YAAY,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE;gBAC9B,iBAAiB,CAAC,GAAG,CAAC,qBAAqB,EAAE,CAAC,KAAK,CAAC,CAAC;YACvD,CAAC;SACF,YAED,cAAK,SAAS,EAAC,2CAA2C,YACvD,QAAQ,GACL,GACC,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,KAAK,GAAG,CAAC,EAAE,QAAQ,EAAiC,EAAE,EAAE;IAC5D,OAAO,CACL,KAAC,MAAM,CAAC,MAAM,IAAC,SAAS,EAAC,yCAAyC,YAC/D,QAAQ,GACK,CACjB,CAAC;AACJ,CAAC,CAAC;AACF,2BAA2B,CAAC,KAAK,GAAG,KAAK,CAAC;AAE1C,MAAM,OAAO,GAAG,CAAC,EAAE,QAAQ,EAAiC,EAAE,EAAE;IAC9D,OAAO,CACL,KAAC,MAAM,CAAC,IAAI,IAAC,SAAS,EAAC,2CAA2C,YAC/D,QAAQ,GACG,CACf,CAAC;AACJ,CAAC,CAAC;AACF,2BAA2B,CAAC,OAAO,GAAG,OAAO,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 { Drawer } from '@neo4j-ndl/react';\n\nimport { type Sidepanel } from './graph-visualization-context';\n\nexport const GraphVisualizationSidepanel = ({\n sidepanel,\n}: {\n sidepanel: Sidepanel;\n}) => {\n const {\n children,\n isSidePanelOpen,\n setIsSidePanelOpen,\n sidePanelWidth,\n onSidePanelResize,\n maxWidth = 'min(66%, calc(100% - 325px))',\n minWidth = 230,\n } = sidepanel;\n\n if (!isSidePanelOpen) {\n return null;\n }\n\n return (\n <Drawer\n className=\"ndl-graph-visualization-drawer\"\n isExpanded={isSidePanelOpen}\n onExpandedChange={(expanded) => {\n setIsSidePanelOpen?.(expanded);\n }}\n position=\"right\"\n type=\"push\"\n isResizeable\n isCloseable={false}\n resizeableProps={{\n bounds: 'window',\n defaultSize: {\n height: '100%',\n width: sidePanelWidth ?? 400,\n },\n maxWidth,\n minWidth,\n onResizeStop: (_e, _dir, ref) => {\n onSidePanelResize(ref.getBoundingClientRect().width);\n },\n }}\n >\n <div className=\"ndl-graph-visualization-sidepanel-wrapper\">\n {children}\n </div>\n </Drawer>\n );\n};\n\nconst Title = ({ children }: { children: React.ReactNode }) => {\n return (\n <Drawer.Header className=\"ndl-graph-visualization-sidepanel-title\">\n {children}\n </Drawer.Header>\n );\n};\nGraphVisualizationSidepanel.Title = Title;\n\nconst Content = ({ children }: { children: React.ReactNode }) => {\n return (\n <Drawer.Body className=\"ndl-graph-visualization-sidepanel-content\">\n {children}\n </Drawer.Body>\n );\n};\nGraphVisualizationSidepanel.Content = Content;\n"]}
1
+ {"version":3,"file":"graph-visualization-sidepanel.js","sourceRoot":"","sources":["../../src/graph-visualization-sidepanel.tsx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AyC,YAC/D,QAAQ,GACK,CACjB,CAAC;AACJ,CAAC,CAAC;AACF,2BAA2B,CAAC,KAAK,GAAG,KAAK,CAAC;AAE1C,MAAM,OAAO,GAAG,CAAC,EAAE,QAAQ,EAAiC,EAAE,EAAE;IAC9D,OAAO,CACL,KAAC,MAAM,CAAC,IAAI,IAAC,SAAS,EAAC,2CAA2C,YAC/D,QAAQ,GACG,CACf,CAAC;AACJ,CAAC,CAAC;AACF,2BAA2B,CAAC,OAAO,GAAG,OAAO,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 { Drawer } from '@neo4j-ndl/react';\n\nimport { type Sidepanel } from './graph-visualization-context';\n\nexport const GraphVisualizationSidepanel = ({\n sidepanel,\n}: {\n sidepanel: Sidepanel;\n}) => {\n const {\n children,\n isSidePanelOpen,\n setIsSidePanelOpen,\n sidePanelWidth,\n onSidePanelResize,\n maxWidth = 'min(66%, calc(100% - 325px))',\n minWidth = 230,\n } = sidepanel;\n\n if (!isSidePanelOpen) {\n return null;\n }\n\n return (\n <Drawer\n className=\"ndl-graph-visualization-drawer\"\n isExpanded={isSidePanelOpen}\n onExpandedChange={(expanded) => {\n setIsSidePanelOpen?.(expanded);\n }}\n position=\"right\"\n type=\"push\"\n isResizeable\n isCloseable={false}\n resizeableProps={{\n bounds: 'window',\n defaultSize: {\n height: '100%',\n width: sidePanelWidth ?? 400,\n },\n maxWidth,\n minWidth,\n onResizeStop: (_e, _dir, ref) => {\n onSidePanelResize(ref.getBoundingClientRect().width);\n },\n }}\n >\n <div className=\"ndl-graph-visualization-sidepanel-wrapper\">\n {children}\n </div>\n </Drawer>\n );\n};\n\nconst Title = ({ children }: { children: React.ReactNode }) => {\n return (\n <Drawer.Header className=\"ndl-graph-visualization-sidepanel-title\">\n {children}\n </Drawer.Header>\n );\n};\nGraphVisualizationSidepanel.Title = Title;\n\nconst Content = ({ children }: { children: React.ReactNode }) => {\n return (\n <Drawer.Body className=\"ndl-graph-visualization-sidepanel-content\">\n {children}\n </Drawer.Body>\n );\n};\nGraphVisualizationSidepanel.Content = Content;\n"]}
@@ -10,7 +10,7 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  return t;
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
- /**
13
+ /*!
14
14
  *
15
15
  * Copyright (c) "Neo4j"
16
16
  * Neo4j Sweden AB [http://neo4j.com]
@@ -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,MAA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AC,cAAc,GAAG,cAAc,CAAC;AAEnD;;;;;;;;;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"]}
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,MA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EACL,SAAS,IAAI,KAAC,2BAA2B,IAAC,SAAS,EAAE,SAAS,GAAI,IAChC,IAC3B,CACb,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,kBAAkB,CAAC,YAAY,GAAG,YAAY,CAAC;AAE/C;;;;;;;GAOG;AACH,kBAAkB,CAAC,aAAa,GAAG,aAAa,CAAC;AAEjD;;;;;;;GAOG;AACH,kBAAkB,CAAC,eAAe,GAAG,eAAe,CAAC;AAErD;;;;;;;;;;GAUG;AACH,kBAAkB,CAAC,qBAAqB,GAAG,qBAAqB,CAAC;AAEjE;;;;;;;;GAQG;AACH,kBAAkB,CAAC,cAAc,GAAG,cAAc,CAAC;AAEnD;;;;;;;;;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,CAA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K,CAAC,QAAQ,CAAC,CAAC;YAC/D,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAChC,CAAC;aAAM,IAAI,KAAK,CAAC,GAAG,KAAK,WAAW,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
+ {"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,EAAE,CAAC;YACjC,KAAK,CAAC,KAAK,EAAE,CAAC;QAChB,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,aAAa,GAAG,OAAO,CAC3B,GAAG,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,EACpC,CAAC,QAAQ,CAAC,CACX,CAAC;IACF,MAAM,oBAAoB,GAAG,WAAW,CACtC,CAAC,KAAa,EAAE,EAAE;QAChB,IAAI,KAAK,IAAI,aAAa,EAAE,CAAC;YAC3B,gBAAgB,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC;QACtC,CAAC;aAAM,CAAC;YACN,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;QACvC,CAAC;IACH,CAAC,EACD,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,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]