@gravity-ui/querieskit 1.5.1 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (338) hide show
  1. package/README.md +28 -0
  2. package/build/cjs/components/QueryGraph/QueryGraph.css +70 -0
  3. package/build/cjs/components/QueryGraph/QueryGraph.css.map +1 -0
  4. package/build/cjs/components/QueryGraph/QueryGraph.d.ts +4 -0
  5. package/build/cjs/components/QueryGraph/QueryGraph.js +517 -0
  6. package/build/cjs/components/QueryGraph/QueryGraph.js.map +1 -0
  7. package/build/cjs/components/QueryGraph/QueryGraph.stories.d.ts +16 -0
  8. package/build/cjs/components/QueryGraph/QueryGraph.stories.js +339 -0
  9. package/build/cjs/components/QueryGraph/QueryGraph.stories.js.map +1 -0
  10. package/build/cjs/components/QueryGraph/helpers/layout.d.ts +9 -0
  11. package/build/cjs/components/QueryGraph/helpers/layout.js +138 -0
  12. package/build/cjs/components/QueryGraph/helpers/layout.js.map +1 -0
  13. package/build/cjs/components/QueryGraph/helpers/presentation.d.ts +18 -0
  14. package/build/cjs/components/QueryGraph/helpers/presentation.js +44 -0
  15. package/build/cjs/components/QueryGraph/helpers/presentation.js.map +1 -0
  16. package/build/cjs/components/QueryGraph/i18n/dicts.d.ts +55 -0
  17. package/build/cjs/components/QueryGraph/i18n/dicts.js +14 -0
  18. package/build/cjs/components/QueryGraph/i18n/dicts.js.map +1 -0
  19. package/build/cjs/components/QueryGraph/i18n/en.json +26 -0
  20. package/build/cjs/components/QueryGraph/i18n/index.d.ts +6 -0
  21. package/build/cjs/components/QueryGraph/i18n/index.js +11 -0
  22. package/build/cjs/components/QueryGraph/i18n/index.js.map +1 -0
  23. package/build/cjs/components/QueryGraph/i18n/ru.json +26 -0
  24. package/build/cjs/components/QueryGraph/index.d.ts +2 -0
  25. package/build/cjs/components/QueryGraph/index.js +13 -0
  26. package/build/cjs/components/QueryGraph/index.js.map +1 -0
  27. package/build/cjs/components/QueryGraph/internal/QueryGraphCanvasBlock.d.ts +24 -0
  28. package/build/cjs/components/QueryGraph/internal/QueryGraphCanvasBlock.js +307 -0
  29. package/build/cjs/components/QueryGraph/internal/QueryGraphCanvasBlock.js.map +1 -0
  30. package/build/cjs/components/QueryGraph/internal/QueryGraphPopup.d.ts +5 -0
  31. package/build/cjs/components/QueryGraph/internal/QueryGraphPopup.js +242 -0
  32. package/build/cjs/components/QueryGraph/internal/QueryGraphPopup.js.map +1 -0
  33. package/build/cjs/components/QueryGraph/internal/queryGraphIcons.d.ts +12 -0
  34. package/build/cjs/components/QueryGraph/internal/queryGraphIcons.js +161 -0
  35. package/build/cjs/components/QueryGraph/internal/queryGraphIcons.js.map +1 -0
  36. package/build/cjs/components/QueryGraph/internal/useQueryGraphLayout.d.ts +22 -0
  37. package/build/cjs/components/QueryGraph/internal/useQueryGraphLayout.js +60 -0
  38. package/build/cjs/components/QueryGraph/internal/useQueryGraphLayout.js.map +1 -0
  39. package/build/cjs/components/QueryGraph/story/largeGraphData.d.ts +3 -0
  40. package/build/cjs/components/QueryGraph/story/largeGraphData.js +227 -0
  41. package/build/cjs/components/QueryGraph/story/largeGraphData.js.map +1 -0
  42. package/build/cjs/components/index.d.ts +2 -0
  43. package/build/cjs/components/index.js +9 -1
  44. package/build/cjs/components/index.js.map +1 -1
  45. package/build/cjs/helpers/buildColumnsFromKeys.d.ts +1 -1
  46. package/build/cjs/helpers/buildColumnsFromKeys.js.map +1 -1
  47. package/build/cjs/index.d.ts +1 -0
  48. package/build/cjs/index.js +11 -0
  49. package/build/cjs/index.js.map +1 -1
  50. package/build/cjs/modules/ClustersList/ClustersList.d.ts +1 -1
  51. package/build/cjs/modules/ClustersList/ClustersList.js +4 -3
  52. package/build/cjs/modules/ClustersList/ClustersList.js.map +1 -1
  53. package/build/cjs/modules/HistoryHeader/HistoryHeader.js +4 -3
  54. package/build/cjs/modules/HistoryHeader/HistoryHeader.js.map +1 -1
  55. package/build/cjs/modules/HistoryRow/HistoryRow.js +12 -7
  56. package/build/cjs/modules/HistoryRow/HistoryRow.js.map +1 -1
  57. package/build/cjs/modules/HistorySearchRow/HistorySearchRow.js +8 -5
  58. package/build/cjs/modules/HistorySearchRow/HistorySearchRow.js.map +1 -1
  59. package/build/cjs/modules/HistorySearchRow/helpers/resolveMonacoLanguage.d.ts +1 -1
  60. package/build/cjs/modules/HistorySearchRow/helpers/resolveMonacoLanguage.js +5 -5
  61. package/build/cjs/modules/HistorySearchRow/helpers/resolveMonacoLanguage.js.map +1 -1
  62. package/build/cjs/modules/NavigationDetail/NavigationDetail.d.ts +1 -1
  63. package/build/cjs/modules/NavigationDetail/NavigationDetail.js +2 -2
  64. package/build/cjs/modules/NavigationDetail/NavigationDetail.js.map +1 -1
  65. package/build/cjs/modules/NavigationHeader/NavigationHeader.d.ts +1 -1
  66. package/build/cjs/modules/NavigationHeader/NavigationHeader.js +2 -2
  67. package/build/cjs/modules/NavigationHeader/NavigationHeader.js.map +1 -1
  68. package/build/cjs/modules/NavigationItemsList/NavigationItemsList.d.ts +1 -1
  69. package/build/cjs/modules/NavigationItemsList/NavigationItemsList.js +4 -3
  70. package/build/cjs/modules/NavigationItemsList/NavigationItemsList.js.map +1 -1
  71. package/build/cjs/modules/NavigationItemsList/internal/NavigationItemsListEmptyState.d.ts +1 -1
  72. package/build/cjs/modules/NavigationItemsList/internal/NavigationItemsListEmptyState.js +2 -2
  73. package/build/cjs/modules/NavigationItemsList/internal/NavigationItemsListEmptyState.js.map +1 -1
  74. package/build/cjs/modules/NavigationMeta/NavigationMeta.js +4 -3
  75. package/build/cjs/modules/NavigationMeta/NavigationMeta.js.map +1 -1
  76. package/build/cjs/modules/NavigationMeta/i18n/index.d.ts +2 -2
  77. package/build/cjs/modules/NavigationPreview/NavigationPreview.d.ts +1 -1
  78. package/build/cjs/modules/NavigationPreview/NavigationPreview.js +6 -4
  79. package/build/cjs/modules/NavigationPreview/NavigationPreview.js.map +1 -1
  80. package/build/cjs/modules/NavigationPreview/helpers/buildPreviewColumns.d.ts +1 -1
  81. package/build/cjs/modules/NavigationPreview/helpers/buildPreviewColumns.js.map +1 -1
  82. package/build/cjs/modules/NavigationSchema/NavigationSchema.d.ts +1 -1
  83. package/build/cjs/modules/NavigationSchema/NavigationSchema.js +4 -3
  84. package/build/cjs/modules/NavigationSchema/NavigationSchema.js.map +1 -1
  85. package/build/cjs/modules/NavigationSchema/helpers/buildSchemaColumns.d.ts +1 -1
  86. package/build/cjs/modules/NavigationSchema/helpers/buildSchemaColumns.js.map +1 -1
  87. package/build/cjs/modules/NavigationView/NavigationView.d.ts +1 -1
  88. package/build/cjs/modules/NavigationView/NavigationView.js +4 -3
  89. package/build/cjs/modules/NavigationView/NavigationView.js.map +1 -1
  90. package/build/cjs/modules/NavigationView/helpers/buildViewColumns.d.ts +1 -1
  91. package/build/cjs/modules/NavigationView/helpers/buildViewColumns.js.map +1 -1
  92. package/build/cjs/modules/NavigationView/internal/NavigationViewSectionItem.d.ts +1 -1
  93. package/build/cjs/modules/NavigationView/internal/NavigationViewSectionItem.js +4 -3
  94. package/build/cjs/modules/NavigationView/internal/NavigationViewSectionItem.js.map +1 -1
  95. package/build/cjs/modules/QueriesList/QueriesList.js +2 -2
  96. package/build/cjs/modules/QueriesList/QueriesList.js.map +1 -1
  97. package/build/cjs/modules/QueryProgress/QueryProgress.css +64 -0
  98. package/build/cjs/modules/QueryProgress/QueryProgress.css.map +1 -0
  99. package/build/cjs/modules/QueryProgress/QueryProgress.d.ts +4 -0
  100. package/build/cjs/modules/QueryProgress/QueryProgress.js +135 -0
  101. package/build/cjs/modules/QueryProgress/QueryProgress.js.map +1 -0
  102. package/build/cjs/modules/QueryProgress/QueryProgress.stories.d.ts +7 -0
  103. package/build/cjs/modules/QueryProgress/QueryProgress.stories.js +38 -0
  104. package/build/cjs/modules/QueryProgress/QueryProgress.stories.js.map +1 -0
  105. package/build/cjs/modules/QueryProgress/i18n/dicts.d.ts +25 -0
  106. package/build/cjs/modules/QueryProgress/i18n/dicts.js +14 -0
  107. package/build/cjs/modules/QueryProgress/i18n/dicts.js.map +1 -0
  108. package/build/cjs/modules/QueryProgress/i18n/en.json +11 -0
  109. package/build/cjs/modules/QueryProgress/i18n/index.d.ts +6 -0
  110. package/build/cjs/modules/QueryProgress/i18n/index.js +11 -0
  111. package/build/cjs/modules/QueryProgress/i18n/index.js.map +1 -0
  112. package/build/cjs/modules/QueryProgress/i18n/ru.json +11 -0
  113. package/build/cjs/modules/QueryProgress/index.d.ts +2 -0
  114. package/build/cjs/modules/QueryProgress/index.js +13 -0
  115. package/build/cjs/modules/QueryProgress/index.js.map +1 -0
  116. package/build/cjs/modules/QueryStatistics/i18n/index.d.ts +2 -2
  117. package/build/cjs/modules/RowsList/RowsList.js +4 -3
  118. package/build/cjs/modules/RowsList/RowsList.js.map +1 -1
  119. package/build/cjs/modules/SavedQueryRow/SavedQueryRow.d.ts +2 -2
  120. package/build/cjs/modules/SavedQueryRow/SavedQueryRow.js +6 -4
  121. package/build/cjs/modules/SavedQueryRow/SavedQueryRow.js.map +1 -1
  122. package/build/cjs/modules/SavedQuerySearchRow/SavedQuerySearchRow.d.ts +2 -2
  123. package/build/cjs/modules/SavedQuerySearchRow/SavedQuerySearchRow.js +4 -3
  124. package/build/cjs/modules/SavedQuerySearchRow/SavedQuerySearchRow.js.map +1 -1
  125. package/build/cjs/modules/TutorialRow/TutorialRow.d.ts +1 -1
  126. package/build/cjs/modules/TutorialRow/TutorialRow.js +2 -2
  127. package/build/cjs/modules/TutorialRow/TutorialRow.js.map +1 -1
  128. package/build/cjs/modules/TutorialSearchRow/TutorialSearchRow.d.ts +1 -1
  129. package/build/cjs/modules/TutorialSearchRow/TutorialSearchRow.js +4 -3
  130. package/build/cjs/modules/TutorialSearchRow/TutorialSearchRow.js.map +1 -1
  131. package/build/cjs/modules/index.d.ts +2 -0
  132. package/build/cjs/modules/index.js +8 -0
  133. package/build/cjs/modules/index.js.map +1 -1
  134. package/build/cjs/types/queryGraph.d.ts +87 -0
  135. package/build/cjs/types/queryGraph.js +6 -0
  136. package/build/cjs/types/queryGraph.js.map +1 -0
  137. package/build/cjs/widgets/DashboardCharts/DashboardCharts.js +8 -6
  138. package/build/cjs/widgets/DashboardCharts/DashboardCharts.js.map +1 -1
  139. package/build/cjs/widgets/DashboardCharts/types.d.ts +3 -3
  140. package/build/cjs/widgets/DashboardCharts/types.js.map +1 -1
  141. package/build/cjs/widgets/QueriesHistory/QueriesHistory.js +2 -2
  142. package/build/cjs/widgets/QueriesHistory/QueriesHistory.js.map +1 -1
  143. package/build/cjs/widgets/QueriesHistory/internal/HistoryRowContent.js +6 -5
  144. package/build/cjs/widgets/QueriesHistory/internal/HistoryRowContent.js.map +1 -1
  145. package/build/cjs/widgets/QueriesNavigation/QueriesNavigation.d.ts +1 -1
  146. package/build/cjs/widgets/QueriesNavigation/QueriesNavigation.js +13 -9
  147. package/build/cjs/widgets/QueriesNavigation/QueriesNavigation.js.map +1 -1
  148. package/build/cjs/widgets/QueriesNavigation/helpers/createEmptyDetailConfig.js +2 -2
  149. package/build/cjs/widgets/QueriesNavigation/helpers/createEmptyDetailConfig.js.map +1 -1
  150. package/build/cjs/widgets/QueriesNavigation/helpers/createTableDetailConfig.js +8 -5
  151. package/build/cjs/widgets/QueriesNavigation/helpers/createTableDetailConfig.js.map +1 -1
  152. package/build/cjs/widgets/QueryResults/QueryResults.js +2 -2
  153. package/build/cjs/widgets/QueryResults/QueryResults.js.map +1 -1
  154. package/build/cjs/widgets/QueryResults/i18n/index.d.ts +2 -2
  155. package/build/cjs/widgets/QueryResults/internal/QueryResultsSchema.js +4 -3
  156. package/build/cjs/widgets/QueryResults/internal/QueryResultsSchema.js.map +1 -1
  157. package/build/cjs/widgets/SavedQueries/SavedQueries.d.ts +2 -2
  158. package/build/cjs/widgets/SavedQueries/SavedQueries.js +2 -2
  159. package/build/cjs/widgets/SavedQueries/SavedQueries.js.map +1 -1
  160. package/build/cjs/widgets/SavedQueries/SavedQueryRowContent.d.ts +2 -2
  161. package/build/cjs/widgets/SavedQueries/SavedQueryRowContent.js +6 -5
  162. package/build/cjs/widgets/SavedQueries/SavedQueryRowContent.js.map +1 -1
  163. package/build/cjs/widgets/TutorialsHistory/TutorialRowContent.d.ts +2 -2
  164. package/build/cjs/widgets/TutorialsHistory/TutorialRowContent.js +6 -5
  165. package/build/cjs/widgets/TutorialsHistory/TutorialRowContent.js.map +1 -1
  166. package/build/cjs/widgets/TutorialsHistory/TutorialsHistory.d.ts +2 -2
  167. package/build/cjs/widgets/TutorialsHistory/TutorialsHistory.js +6 -4
  168. package/build/cjs/widgets/TutorialsHistory/TutorialsHistory.js.map +1 -1
  169. package/build/esm/components/QueryGraph/QueryGraph.css +70 -0
  170. package/build/esm/components/QueryGraph/QueryGraph.css.map +1 -0
  171. package/build/esm/components/QueryGraph/QueryGraph.d.ts +4 -0
  172. package/build/esm/components/QueryGraph/QueryGraph.js +510 -0
  173. package/build/esm/components/QueryGraph/QueryGraph.js.map +1 -0
  174. package/build/esm/components/QueryGraph/QueryGraph.scss +81 -0
  175. package/build/esm/components/QueryGraph/QueryGraph.stories.d.ts +16 -0
  176. package/build/esm/components/QueryGraph/QueryGraph.stories.js +331 -0
  177. package/build/esm/components/QueryGraph/QueryGraph.stories.js.map +1 -0
  178. package/build/esm/components/QueryGraph/helpers/layout.d.ts +9 -0
  179. package/build/esm/components/QueryGraph/helpers/layout.js +128 -0
  180. package/build/esm/components/QueryGraph/helpers/layout.js.map +1 -0
  181. package/build/esm/components/QueryGraph/helpers/presentation.d.ts +18 -0
  182. package/build/esm/components/QueryGraph/helpers/presentation.js +35 -0
  183. package/build/esm/components/QueryGraph/helpers/presentation.js.map +1 -0
  184. package/build/esm/components/QueryGraph/i18n/dicts.d.ts +55 -0
  185. package/build/esm/components/QueryGraph/i18n/dicts.js +7 -0
  186. package/build/esm/components/QueryGraph/i18n/dicts.js.map +1 -0
  187. package/build/esm/components/QueryGraph/i18n/en.json +26 -0
  188. package/build/esm/components/QueryGraph/i18n/index.d.ts +6 -0
  189. package/build/esm/components/QueryGraph/i18n/index.js +4 -0
  190. package/build/esm/components/QueryGraph/i18n/index.js.map +1 -0
  191. package/build/esm/components/QueryGraph/i18n/ru.json +26 -0
  192. package/build/esm/components/QueryGraph/index.d.ts +2 -0
  193. package/build/esm/components/QueryGraph/index.js +2 -0
  194. package/build/esm/components/QueryGraph/index.js.map +1 -0
  195. package/build/esm/components/QueryGraph/internal/QueryGraphCanvasBlock.d.ts +24 -0
  196. package/build/esm/components/QueryGraph/internal/QueryGraphCanvasBlock.js +299 -0
  197. package/build/esm/components/QueryGraph/internal/QueryGraphCanvasBlock.js.map +1 -0
  198. package/build/esm/components/QueryGraph/internal/QueryGraphPopup.d.ts +5 -0
  199. package/build/esm/components/QueryGraph/internal/QueryGraphPopup.js +234 -0
  200. package/build/esm/components/QueryGraph/internal/QueryGraphPopup.js.map +1 -0
  201. package/build/esm/components/QueryGraph/internal/queryGraphIcons.d.ts +12 -0
  202. package/build/esm/components/QueryGraph/internal/queryGraphIcons.js +150 -0
  203. package/build/esm/components/QueryGraph/internal/queryGraphIcons.js.map +1 -0
  204. package/build/esm/components/QueryGraph/internal/useQueryGraphLayout.d.ts +22 -0
  205. package/build/esm/components/QueryGraph/internal/useQueryGraphLayout.js +53 -0
  206. package/build/esm/components/QueryGraph/internal/useQueryGraphLayout.js.map +1 -0
  207. package/build/esm/components/QueryGraph/story/largeGraphData.d.ts +3 -0
  208. package/build/esm/components/QueryGraph/story/largeGraphData.js +220 -0
  209. package/build/esm/components/QueryGraph/story/largeGraphData.js.map +1 -0
  210. package/build/esm/components/index.d.ts +2 -0
  211. package/build/esm/components/index.js +1 -0
  212. package/build/esm/components/index.js.map +1 -1
  213. package/build/esm/helpers/buildColumnsFromKeys.d.ts +1 -1
  214. package/build/esm/helpers/buildColumnsFromKeys.js.map +1 -1
  215. package/build/esm/index.d.ts +1 -0
  216. package/build/esm/index.js +1 -0
  217. package/build/esm/index.js.map +1 -1
  218. package/build/esm/modules/ClustersList/ClustersList.d.ts +1 -1
  219. package/build/esm/modules/ClustersList/ClustersList.js +2 -1
  220. package/build/esm/modules/ClustersList/ClustersList.js.map +1 -1
  221. package/build/esm/modules/HistoryHeader/HistoryHeader.js +2 -1
  222. package/build/esm/modules/HistoryHeader/HistoryHeader.js.map +1 -1
  223. package/build/esm/modules/HistoryRow/HistoryRow.js +6 -1
  224. package/build/esm/modules/HistoryRow/HistoryRow.js.map +1 -1
  225. package/build/esm/modules/HistorySearchRow/HistorySearchRow.js +4 -1
  226. package/build/esm/modules/HistorySearchRow/HistorySearchRow.js.map +1 -1
  227. package/build/esm/modules/HistorySearchRow/helpers/resolveMonacoLanguage.d.ts +1 -1
  228. package/build/esm/modules/HistorySearchRow/helpers/resolveMonacoLanguage.js +1 -1
  229. package/build/esm/modules/HistorySearchRow/helpers/resolveMonacoLanguage.js.map +1 -1
  230. package/build/esm/modules/NavigationDetail/NavigationDetail.d.ts +1 -1
  231. package/build/esm/modules/NavigationDetail/NavigationDetail.js +1 -1
  232. package/build/esm/modules/NavigationDetail/NavigationDetail.js.map +1 -1
  233. package/build/esm/modules/NavigationHeader/NavigationHeader.d.ts +1 -1
  234. package/build/esm/modules/NavigationHeader/NavigationHeader.js +1 -1
  235. package/build/esm/modules/NavigationHeader/NavigationHeader.js.map +1 -1
  236. package/build/esm/modules/NavigationItemsList/NavigationItemsList.d.ts +1 -1
  237. package/build/esm/modules/NavigationItemsList/NavigationItemsList.js +2 -1
  238. package/build/esm/modules/NavigationItemsList/NavigationItemsList.js.map +1 -1
  239. package/build/esm/modules/NavigationItemsList/internal/NavigationItemsListEmptyState.d.ts +1 -1
  240. package/build/esm/modules/NavigationItemsList/internal/NavigationItemsListEmptyState.js +1 -1
  241. package/build/esm/modules/NavigationItemsList/internal/NavigationItemsListEmptyState.js.map +1 -1
  242. package/build/esm/modules/NavigationMeta/NavigationMeta.js +2 -1
  243. package/build/esm/modules/NavigationMeta/NavigationMeta.js.map +1 -1
  244. package/build/esm/modules/NavigationMeta/i18n/index.d.ts +2 -2
  245. package/build/esm/modules/NavigationPreview/NavigationPreview.d.ts +1 -1
  246. package/build/esm/modules/NavigationPreview/NavigationPreview.js +3 -1
  247. package/build/esm/modules/NavigationPreview/NavigationPreview.js.map +1 -1
  248. package/build/esm/modules/NavigationPreview/helpers/buildPreviewColumns.d.ts +1 -1
  249. package/build/esm/modules/NavigationPreview/helpers/buildPreviewColumns.js.map +1 -1
  250. package/build/esm/modules/NavigationSchema/NavigationSchema.d.ts +1 -1
  251. package/build/esm/modules/NavigationSchema/NavigationSchema.js +2 -1
  252. package/build/esm/modules/NavigationSchema/NavigationSchema.js.map +1 -1
  253. package/build/esm/modules/NavigationSchema/helpers/buildSchemaColumns.d.ts +1 -1
  254. package/build/esm/modules/NavigationSchema/helpers/buildSchemaColumns.js.map +1 -1
  255. package/build/esm/modules/NavigationView/NavigationView.d.ts +1 -1
  256. package/build/esm/modules/NavigationView/NavigationView.js +2 -1
  257. package/build/esm/modules/NavigationView/NavigationView.js.map +1 -1
  258. package/build/esm/modules/NavigationView/helpers/buildViewColumns.d.ts +1 -1
  259. package/build/esm/modules/NavigationView/helpers/buildViewColumns.js.map +1 -1
  260. package/build/esm/modules/NavigationView/internal/NavigationViewSectionItem.d.ts +1 -1
  261. package/build/esm/modules/NavigationView/internal/NavigationViewSectionItem.js +2 -1
  262. package/build/esm/modules/NavigationView/internal/NavigationViewSectionItem.js.map +1 -1
  263. package/build/esm/modules/QueriesList/QueriesList.js +1 -1
  264. package/build/esm/modules/QueriesList/QueriesList.js.map +1 -1
  265. package/build/esm/modules/QueryProgress/QueryProgress.css +64 -0
  266. package/build/esm/modules/QueryProgress/QueryProgress.css.map +1 -0
  267. package/build/esm/modules/QueryProgress/QueryProgress.d.ts +4 -0
  268. package/build/esm/modules/QueryProgress/QueryProgress.js +127 -0
  269. package/build/esm/modules/QueryProgress/QueryProgress.js.map +1 -0
  270. package/build/esm/modules/QueryProgress/QueryProgress.scss +72 -0
  271. package/build/esm/modules/QueryProgress/QueryProgress.stories.d.ts +7 -0
  272. package/build/esm/modules/QueryProgress/QueryProgress.stories.js +31 -0
  273. package/build/esm/modules/QueryProgress/QueryProgress.stories.js.map +1 -0
  274. package/build/esm/modules/QueryProgress/i18n/dicts.d.ts +25 -0
  275. package/build/esm/modules/QueryProgress/i18n/dicts.js +7 -0
  276. package/build/esm/modules/QueryProgress/i18n/dicts.js.map +1 -0
  277. package/build/esm/modules/QueryProgress/i18n/en.json +11 -0
  278. package/build/esm/modules/QueryProgress/i18n/index.d.ts +6 -0
  279. package/build/esm/modules/QueryProgress/i18n/index.js +4 -0
  280. package/build/esm/modules/QueryProgress/i18n/index.js.map +1 -0
  281. package/build/esm/modules/QueryProgress/i18n/ru.json +11 -0
  282. package/build/esm/modules/QueryProgress/index.d.ts +2 -0
  283. package/build/esm/modules/QueryProgress/index.js +2 -0
  284. package/build/esm/modules/QueryProgress/index.js.map +1 -0
  285. package/build/esm/modules/QueryStatistics/i18n/index.d.ts +2 -2
  286. package/build/esm/modules/RowsList/RowsList.js +2 -1
  287. package/build/esm/modules/RowsList/RowsList.js.map +1 -1
  288. package/build/esm/modules/SavedQueryRow/SavedQueryRow.d.ts +2 -2
  289. package/build/esm/modules/SavedQueryRow/SavedQueryRow.js +3 -1
  290. package/build/esm/modules/SavedQueryRow/SavedQueryRow.js.map +1 -1
  291. package/build/esm/modules/SavedQuerySearchRow/SavedQuerySearchRow.d.ts +2 -2
  292. package/build/esm/modules/SavedQuerySearchRow/SavedQuerySearchRow.js +2 -1
  293. package/build/esm/modules/SavedQuerySearchRow/SavedQuerySearchRow.js.map +1 -1
  294. package/build/esm/modules/TutorialRow/TutorialRow.d.ts +1 -1
  295. package/build/esm/modules/TutorialRow/TutorialRow.js +1 -1
  296. package/build/esm/modules/TutorialRow/TutorialRow.js.map +1 -1
  297. package/build/esm/modules/TutorialSearchRow/TutorialSearchRow.d.ts +1 -1
  298. package/build/esm/modules/TutorialSearchRow/TutorialSearchRow.js +2 -1
  299. package/build/esm/modules/TutorialSearchRow/TutorialSearchRow.js.map +1 -1
  300. package/build/esm/modules/index.d.ts +2 -0
  301. package/build/esm/modules/index.js +1 -0
  302. package/build/esm/modules/index.js.map +1 -1
  303. package/build/esm/types/queryGraph.d.ts +87 -0
  304. package/build/esm/types/queryGraph.js +2 -0
  305. package/build/esm/types/queryGraph.js.map +1 -0
  306. package/build/esm/widgets/DashboardCharts/DashboardCharts.js +4 -2
  307. package/build/esm/widgets/DashboardCharts/DashboardCharts.js.map +1 -1
  308. package/build/esm/widgets/DashboardCharts/types.d.ts +3 -3
  309. package/build/esm/widgets/DashboardCharts/types.js.map +1 -1
  310. package/build/esm/widgets/QueriesHistory/QueriesHistory.js +1 -1
  311. package/build/esm/widgets/QueriesHistory/QueriesHistory.js.map +1 -1
  312. package/build/esm/widgets/QueriesHistory/internal/HistoryRowContent.js +3 -2
  313. package/build/esm/widgets/QueriesHistory/internal/HistoryRowContent.js.map +1 -1
  314. package/build/esm/widgets/QueriesNavigation/QueriesNavigation.d.ts +1 -1
  315. package/build/esm/widgets/QueriesNavigation/QueriesNavigation.js +6 -2
  316. package/build/esm/widgets/QueriesNavigation/QueriesNavigation.js.map +1 -1
  317. package/build/esm/widgets/QueriesNavigation/helpers/createEmptyDetailConfig.js +1 -1
  318. package/build/esm/widgets/QueriesNavigation/helpers/createEmptyDetailConfig.js.map +1 -1
  319. package/build/esm/widgets/QueriesNavigation/helpers/createTableDetailConfig.js +4 -1
  320. package/build/esm/widgets/QueriesNavigation/helpers/createTableDetailConfig.js.map +1 -1
  321. package/build/esm/widgets/QueryResults/QueryResults.js +1 -1
  322. package/build/esm/widgets/QueryResults/QueryResults.js.map +1 -1
  323. package/build/esm/widgets/QueryResults/i18n/index.d.ts +2 -2
  324. package/build/esm/widgets/QueryResults/internal/QueryResultsSchema.js +2 -1
  325. package/build/esm/widgets/QueryResults/internal/QueryResultsSchema.js.map +1 -1
  326. package/build/esm/widgets/SavedQueries/SavedQueries.d.ts +2 -2
  327. package/build/esm/widgets/SavedQueries/SavedQueries.js +1 -1
  328. package/build/esm/widgets/SavedQueries/SavedQueries.js.map +1 -1
  329. package/build/esm/widgets/SavedQueries/SavedQueryRowContent.d.ts +2 -2
  330. package/build/esm/widgets/SavedQueries/SavedQueryRowContent.js +3 -2
  331. package/build/esm/widgets/SavedQueries/SavedQueryRowContent.js.map +1 -1
  332. package/build/esm/widgets/TutorialsHistory/TutorialRowContent.d.ts +2 -2
  333. package/build/esm/widgets/TutorialsHistory/TutorialRowContent.js +3 -2
  334. package/build/esm/widgets/TutorialsHistory/TutorialRowContent.js.map +1 -1
  335. package/build/esm/widgets/TutorialsHistory/TutorialsHistory.d.ts +2 -2
  336. package/build/esm/widgets/TutorialsHistory/TutorialsHistory.js +3 -1
  337. package/build/esm/widgets/TutorialsHistory/TutorialsHistory.js.map +1 -1
  338. package/package.json +84 -5
package/README.md CHANGED
@@ -57,6 +57,34 @@ Prefer widgets for product screens. Use modules and components when you need a c
57
57
 
58
58
  ## Usage
59
59
 
60
+ ### Widget imports
61
+
62
+ All six widgets support both root and individual imports:
63
+
64
+ ```tsx
65
+ import {SavedQueries} from '@gravity-ui/querieskit';
66
+ ```
67
+
68
+ Alternatively, start directly from the widget's entrypoint:
69
+
70
+ ```tsx
71
+ import {SavedQueries} from '@gravity-ui/querieskit/widgets/SavedQueries';
72
+ import type {SavedQueriesProps} from '@gravity-ui/querieskit/widgets/SavedQueries';
73
+ ```
74
+
75
+ Individual entrypoints are available for `QueriesHistory`, `SavedQueries`,
76
+ `TutorialsHistory`, `QueriesNavigation`, `QueryResults`, and `DashboardCharts`.
77
+ They expose each widget's existing public exports, including its props and helpers.
78
+ Shared data types remain available from the package root.
79
+
80
+ Individual imports limit the dependency graph the bundler needs to traverse.
81
+ Both forms support tree-shaking with an ESM-aware bundler; individual imports do
82
+ not necessarily produce a smaller bundle. Existing root imports remain supported.
83
+ Keep CSS processing enabled so that the selected widget's styles are included.
84
+ Some bundlers, including esbuild, retain CSS from unused root re-exports even when
85
+ their JavaScript is removed. Individual widget imports avoid introducing those
86
+ unrelated styles.
87
+
60
88
  ### QueriesHistory
61
89
 
62
90
  Ready-made query history sidebar: search, filters, editable titles, row actions, and optional compare mode.
@@ -0,0 +1,70 @@
1
+ .qp-query-graph {
2
+ position: relative;
3
+ min-height: 360px;
4
+ height: 100%;
5
+ overflow: hidden;
6
+ background: var(--g-color-base-background);
7
+ }
8
+ .qp-query-graph__canvas {
9
+ width: 100%;
10
+ height: 100%;
11
+ min-height: 360px;
12
+ }
13
+ .qp-query-graph__toolbox {
14
+ position: absolute;
15
+ z-index: 4;
16
+ top: var(--g-spacing-4);
17
+ left: var(--g-spacing-4);
18
+ display: flex;
19
+ width: 28px;
20
+ flex-direction: column;
21
+ }
22
+ .qp-query-graph__popup {
23
+ position: absolute;
24
+ z-index: 5;
25
+ width: min(440px, 100% - var(--g-spacing-8));
26
+ max-height: calc(100% - var(--g-spacing-8));
27
+ overflow: auto;
28
+ padding: var(--g-spacing-4);
29
+ border: 1px solid var(--g-color-line-generic);
30
+ border-radius: var(--g-border-radius-l);
31
+ box-shadow: 0 4px 24px var(--g-color-sfx-shadow);
32
+ background: var(--g-color-base-float);
33
+ }
34
+ .qp-query-graph__popup-content, .qp-query-graph__jobs, .qp-query-graph__schemas, .qp-query-graph__details {
35
+ display: flex;
36
+ flex-direction: column;
37
+ gap: var(--g-spacing-3);
38
+ }
39
+ .qp-query-graph__popup-title {
40
+ display: flex;
41
+ align-items: center;
42
+ gap: var(--g-spacing-2);
43
+ }
44
+ .qp-query-graph__popup-title > div {
45
+ display: flex;
46
+ min-width: 0;
47
+ flex-direction: column;
48
+ }
49
+ .qp-query-graph__detail-row {
50
+ display: flex;
51
+ justify-content: space-between;
52
+ gap: var(--g-spacing-3);
53
+ }
54
+ .qp-query-graph__state {
55
+ height: 100%;
56
+ min-height: 360px;
57
+ display: flex;
58
+ align-items: center;
59
+ justify-content: center;
60
+ padding: var(--g-spacing-6);
61
+ text-align: center;
62
+ }
63
+ .qp-query-graph__large-graph {
64
+ display: flex;
65
+ max-width: 480px;
66
+ flex-direction: column;
67
+ align-items: center;
68
+ gap: var(--g-spacing-4);
69
+ }
70
+ /*# sourceMappingURL=QueryGraph.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["QueryGraph.scss"],"names":[],"mappings":"AAAA;EACI,kBAAA;EACA,iBAAA;EACA,YAAA;EACA,gBAAA;EACA,0CAAA;AACJ;AACI;EACI,WAAA;EACA,YAAA;EACA,iBAAA;AACR;AAEI;EACI,kBAAA;EACA,UAAA;EACA,uBAAA;EACA,wBAAA;EACA,aAAA;EACA,WAAA;EACA,sBAAA;AAAR;AAGI;EACI,kBAAA;EACA,UAAA;EACA,4CAAA;EACA,2CAAA;EACA,cAAA;EACA,2BAAA;EACA,6CAAA;EACA,uCAAA;EACA,gDAAA;EACA,qCAAA;AADR;AAII;EAII,aAAA;EACA,sBAAA;EACA,uBAAA;AALR;AAQI;EACI,aAAA;EACA,mBAAA;EACA,uBAAA;AANR;AAQQ;EACI,aAAA;EACA,YAAA;EACA,sBAAA;AANZ;AAUI;EACI,aAAA;EACA,8BAAA;EACA,uBAAA;AARR;AAWI;EACI,YAAA;EACA,iBAAA;EACA,aAAA;EACA,mBAAA;EACA,uBAAA;EACA,2BAAA;EACA,kBAAA;AATR;AAYI;EACI,aAAA;EACA,gBAAA;EACA,sBAAA;EACA,mBAAA;EACA,uBAAA;AAVR","file":"QueryGraph.css","sourcesContent":[".qp-query-graph {\n position: relative;\n min-height: 360px;\n height: 100%;\n overflow: hidden;\n background: var(--g-color-base-background);\n\n &__canvas {\n width: 100%;\n height: 100%;\n min-height: 360px;\n }\n\n &__toolbox {\n position: absolute;\n z-index: 4;\n top: var(--g-spacing-4);\n left: var(--g-spacing-4);\n display: flex;\n width: 28px;\n flex-direction: column;\n }\n\n &__popup {\n position: absolute;\n z-index: 5;\n width: min(440px, calc(100% - var(--g-spacing-8)));\n max-height: calc(100% - var(--g-spacing-8));\n overflow: auto;\n padding: var(--g-spacing-4);\n border: 1px solid var(--g-color-line-generic);\n border-radius: var(--g-border-radius-l);\n box-shadow: 0 4px 24px var(--g-color-sfx-shadow);\n background: var(--g-color-base-float);\n }\n\n &__popup-content,\n &__jobs,\n &__schemas,\n &__details {\n display: flex;\n flex-direction: column;\n gap: var(--g-spacing-3);\n }\n\n &__popup-title {\n display: flex;\n align-items: center;\n gap: var(--g-spacing-2);\n\n > div {\n display: flex;\n min-width: 0;\n flex-direction: column;\n }\n }\n\n &__detail-row {\n display: flex;\n justify-content: space-between;\n gap: var(--g-spacing-3);\n }\n\n &__state {\n height: 100%;\n min-height: 360px;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: var(--g-spacing-6);\n text-align: center;\n }\n\n &__large-graph {\n display: flex;\n max-width: 480px;\n flex-direction: column;\n align-items: center;\n gap: var(--g-spacing-4);\n }\n}\n"],"sourceRoot":""}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import type { QueryGraphProps } from '../../types/queryGraph';
3
+ import './QueryGraph.scss';
4
+ export declare function QueryGraph({ nodes, edges, loading, errorContent, className, autoCenter, active, largeGraphThreshold, renderNodePopup, onNodeClick, onError, }: QueryGraphProps): React.JSX.Element;
@@ -0,0 +1,517 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.QueryGraph = QueryGraph;
7
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
8
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
+ require("core-js/modules/es.error.cause.js");
10
+ require("core-js/modules/es.error.to-string.js");
11
+ require("core-js/modules/es.array.concat.js");
12
+ require("core-js/modules/es.array.find.js");
13
+ require("core-js/modules/es.array.flat-map.js");
14
+ require("core-js/modules/es.array.join.js");
15
+ require("core-js/modules/es.array.map.js");
16
+ require("core-js/modules/es.array.unscopables.flat-map.js");
17
+ require("core-js/modules/es.function.name.js");
18
+ require("core-js/modules/es.iterator.constructor.js");
19
+ require("core-js/modules/es.iterator.find.js");
20
+ require("core-js/modules/es.iterator.flat-map.js");
21
+ require("core-js/modules/es.iterator.map.js");
22
+ require("core-js/modules/es.object.to-string.js");
23
+ require("core-js/modules/es.string.trim.js");
24
+ var _react = _interopRequireWildcard(require("react"));
25
+ var _graph = require("@gravity-ui/graph");
26
+ var _react2 = require("@gravity-ui/graph/react");
27
+ var _icons = require("@gravity-ui/icons");
28
+ var _uikit = require("@gravity-ui/uikit");
29
+ var _bemCnLite = _interopRequireDefault(require("bem-cn-lite"));
30
+ var _layout = require("./helpers/layout");
31
+ var _i18n = _interopRequireDefault(require("./i18n"));
32
+ var _QueryGraphCanvasBlock = require("./internal/QueryGraphCanvasBlock");
33
+ var _QueryGraphPopup = require("./internal/QueryGraphPopup");
34
+ var _queryGraphIcons = require("./internal/queryGraphIcons");
35
+ var _useQueryGraphLayout2 = require("./internal/useQueryGraphLayout");
36
+ require("./QueryGraph.css");
37
+ var _jsxRuntime = require("react/jsx-runtime");
38
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
39
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
40
+ var block = (0, _bemCnLite.default)('qp-query-graph');
41
+ var FIT_PADDING = 120;
42
+ var ZOOM_STEP = 0.08;
43
+ var renderEmptyBlock = function renderEmptyBlock() {
44
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.default.Fragment, {});
45
+ };
46
+ function QueryGraph(_ref) {
47
+ var nodes = _ref.nodes,
48
+ edges = _ref.edges,
49
+ loading = _ref.loading,
50
+ errorContent = _ref.errorContent,
51
+ className = _ref.className,
52
+ _ref$autoCenter = _ref.autoCenter,
53
+ autoCenter = _ref$autoCenter === void 0 ? true : _ref$autoCenter,
54
+ _ref$active = _ref.active,
55
+ active = _ref$active === void 0 ? true : _ref$active,
56
+ _ref$largeGraphThresh = _ref.largeGraphThreshold,
57
+ largeGraphThreshold = _ref$largeGraphThresh === void 0 ? 250 : _ref$largeGraphThresh,
58
+ renderNodePopup = _ref.renderNodePopup,
59
+ onNodeClick = _ref.onNodeClick,
60
+ onError = _ref.onError;
61
+ var _useState = (0, _react.useState)(false),
62
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
63
+ showLargeGraph = _useState2[0],
64
+ setShowLargeGraph = _useState2[1];
65
+ var nodesRef = (0, _react.useRef)(nodes);
66
+ var edgesRef = (0, _react.useRef)(edges);
67
+ nodesRef.current = nodes;
68
+ edgesRef.current = edges;
69
+ var structureKey = (0, _react.useMemo)(function () {
70
+ return "".concat(nodes.map(function (_ref2) {
71
+ var id = _ref2.id,
72
+ kind = _ref2.kind;
73
+ return "".concat(id, ":").concat(kind);
74
+ }).join('|'), "::").concat(edges.map(function (_ref3) {
75
+ var id = _ref3.id,
76
+ source = _ref3.source,
77
+ target = _ref3.target;
78
+ return "".concat(id, ":").concat(source, ":").concat(target);
79
+ }).join('|'));
80
+ }, [edges, nodes]);
81
+ var validationError = (0, _react.useMemo)(function () {
82
+ try {
83
+ (0, _layout.validateQueryGraph)(nodesRef.current, edgesRef.current);
84
+ return undefined;
85
+ } catch (nextError) {
86
+ return nextError instanceof Error ? nextError : new Error('Unable to build query graph');
87
+ }
88
+ // Only graph structure affects validation.
89
+ // eslint-disable-next-line react-hooks/exhaustive-deps
90
+ }, [structureKey]);
91
+ (0, _react.useEffect)(function () {
92
+ if (validationError) onError === null || onError === void 0 || onError(validationError);
93
+ }, [onError, validationError]);
94
+ var shouldConfirm = largeGraphThreshold !== false && nodes.length > largeGraphThreshold;
95
+ if (loading) return /*#__PURE__*/(0, _jsxRuntime.jsx)(State, {
96
+ className: className,
97
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_uikit.Loader, {
98
+ size: "m"
99
+ })
100
+ });
101
+ if (errorContent) return /*#__PURE__*/(0, _jsxRuntime.jsx)(State, {
102
+ className: className,
103
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_uikit.Text, {
104
+ color: "danger",
105
+ children: errorContent
106
+ })
107
+ });
108
+ if (validationError) return /*#__PURE__*/(0, _jsxRuntime.jsx)(State, {
109
+ className: className,
110
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_uikit.Text, {
111
+ color: "danger",
112
+ children: validationError.message
113
+ })
114
+ });
115
+ if (!nodes.length) return /*#__PURE__*/(0, _jsxRuntime.jsx)(State, {
116
+ className: className,
117
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_uikit.Text, {
118
+ color: "secondary",
119
+ children: (0, _i18n.default)('context_empty')
120
+ })
121
+ });
122
+ if (shouldConfirm && !showLargeGraph) {
123
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(State, {
124
+ className: className,
125
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
126
+ className: block('large-graph'),
127
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_uikit.Text, {
128
+ children: (0, _i18n.default)('context_large-graph', {
129
+ count: nodes.length
130
+ })
131
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_uikit.Button, {
132
+ view: "action",
133
+ onClick: function onClick() {
134
+ return setShowLargeGraph(true);
135
+ },
136
+ children: (0, _i18n.default)('action_show-graph')
137
+ })]
138
+ })
139
+ });
140
+ }
141
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(QueryGraphWithLayout, {
142
+ nodes: nodes,
143
+ edges: edges,
144
+ structureKey: structureKey,
145
+ autoCenter: autoCenter,
146
+ active: active,
147
+ renderNodePopup: renderNodePopup,
148
+ onNodeClick: onNodeClick,
149
+ onError: onError,
150
+ className: className
151
+ });
152
+ }
153
+ function QueryGraphWithLayout(_ref4) {
154
+ var nodes = _ref4.nodes,
155
+ edges = _ref4.edges,
156
+ structureKey = _ref4.structureKey,
157
+ autoCenter = _ref4.autoCenter,
158
+ active = _ref4.active,
159
+ renderNodePopup = _ref4.renderNodePopup,
160
+ onNodeClick = _ref4.onNodeClick,
161
+ onError = _ref4.onError,
162
+ className = _ref4.className;
163
+ var _useState3 = (0, _react.useState)(),
164
+ _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
165
+ popup = _useState4[0],
166
+ setPopup = _useState4[1];
167
+ var rootRef = (0, _react.useRef)(null);
168
+ var nodesRef = (0, _react.useRef)(nodes);
169
+ var edgesRef = (0, _react.useRef)(edges);
170
+ nodesRef.current = nodes;
171
+ edgesRef.current = edges;
172
+ var layoutBlocks = (0, _react.useMemo)(function () {
173
+ return nodesRef.current.map(function (node) {
174
+ return (0, _objectSpread2.default)({
175
+ id: node.id
176
+ }, (0, _layout.getQueryGraphNodeSize)(node));
177
+ });
178
+ },
179
+ // Node status and presentation do not affect layout.
180
+ // eslint-disable-next-line react-hooks/exhaustive-deps
181
+ [structureKey]);
182
+ var layoutConnections = (0, _react.useMemo)(function () {
183
+ return edgesRef.current.map(function (edge) {
184
+ return {
185
+ id: edge.id,
186
+ sourceBlockId: edge.source,
187
+ targetBlockId: edge.target
188
+ };
189
+ });
190
+ },
191
+ // Only graph structure affects layout.
192
+ // eslint-disable-next-line react-hooks/exhaustive-deps
193
+ [structureKey]);
194
+ var _useQueryGraphLayout = (0, _useQueryGraphLayout2.useQueryGraphLayout)({
195
+ structureKey: structureKey,
196
+ blocks: layoutBlocks,
197
+ connections: layoutConnections,
198
+ onError: onError
199
+ }),
200
+ result = _useQueryGraphLayout.result,
201
+ resolvedStructureKey = _useQueryGraphLayout.resolvedStructureKey,
202
+ isInitialLoading = _useQueryGraphLayout.isInitialLoading,
203
+ error = _useQueryGraphLayout.error;
204
+ var graphBlocks = (0, _react.useMemo)(function () {
205
+ return nodes.flatMap(function (node) {
206
+ var position = result === null || result === void 0 ? void 0 : result.blocks[node.id];
207
+ if (!position) return [];
208
+ var _getQueryGraphNodeIco = (0, _queryGraphIcons.getQueryGraphNodeIconSvgs)(node),
209
+ iconSvg = _getQueryGraphNodeIco.iconSvg,
210
+ fallbackIconSvg = _getQueryGraphNodeIco.fallbackIconSvg,
211
+ iconColorToken = _getQueryGraphNodeIco.iconColorToken,
212
+ fallbackIconColorToken = _getQueryGraphNodeIco.fallbackIconColorToken;
213
+ return [(0, _objectSpread2.default)((0, _objectSpread2.default)({
214
+ id: node.id,
215
+ is: 'query-node',
216
+ name: node.name,
217
+ selected: false,
218
+ anchors: [],
219
+ meta: {
220
+ node: node,
221
+ iconSvg: iconSvg,
222
+ fallbackIconSvg: fallbackIconSvg,
223
+ iconColorToken: iconColorToken,
224
+ fallbackIconColorToken: fallbackIconColorToken
225
+ }
226
+ }, (0, _layout.getQueryGraphNodeSize)(node)), position)];
227
+ });
228
+ }, [nodes, result]);
229
+ var graphConnections = (0, _react.useMemo)(function () {
230
+ return (0, _layout.createQueryGraphConnections)(edges, result === null || result === void 0 ? void 0 : result.edges);
231
+ }, [edges, result]);
232
+ if (error) return /*#__PURE__*/(0, _jsxRuntime.jsx)(State, {
233
+ className: className,
234
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_uikit.Text, {
235
+ color: "danger",
236
+ children: error.message
237
+ })
238
+ });
239
+ if (isInitialLoading || !result || !resolvedStructureKey) return /*#__PURE__*/(0, _jsxRuntime.jsx)(State, {
240
+ className: className,
241
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_uikit.Loader, {
242
+ size: "m"
243
+ })
244
+ });
245
+ return (/*#__PURE__*/
246
+ // The renderer is declared below to keep the public component and its states together.
247
+ // eslint-disable-next-line @typescript-eslint/no-use-before-define
248
+ (0, _jsxRuntime.jsx)(QueryGraphRenderer, {
249
+ ref: rootRef,
250
+ blocks: graphBlocks,
251
+ connections: graphConnections,
252
+ nodes: nodes,
253
+ structureKey: resolvedStructureKey,
254
+ autoCenter: autoCenter,
255
+ active: active,
256
+ popup: popup,
257
+ setPopup: setPopup,
258
+ renderNodePopup: renderNodePopup,
259
+ onNodeClick: onNodeClick,
260
+ className: className
261
+ })
262
+ );
263
+ }
264
+ var QueryGraphRenderer = /*#__PURE__*/_react.default.forwardRef(function QueryGraphRendererComponent(_ref5, forwardedRef) {
265
+ var blocks = _ref5.blocks,
266
+ connections = _ref5.connections,
267
+ nodes = _ref5.nodes,
268
+ structureKey = _ref5.structureKey,
269
+ autoCenter = _ref5.autoCenter,
270
+ active = _ref5.active,
271
+ popup = _ref5.popup,
272
+ setPopup = _ref5.setPopup,
273
+ renderNodePopup = _ref5.renderNodePopup,
274
+ onNodeClick = _ref5.onNodeClick,
275
+ className = _ref5.className;
276
+ var rootRef = (0, _react.useRef)(null);
277
+ (0, _react.useImperativeHandle)(forwardedRef, function () {
278
+ return rootRef.current;
279
+ });
280
+ var attachedRef = (0, _react.useRef)(false);
281
+ var centeredRef = (0, _react.useRef)(false);
282
+ var previousActiveRef = (0, _react.useRef)(false);
283
+ var previousStructureRef = (0, _react.useRef)(structureKey);
284
+ var _useState5 = (0, _react.useState)(false),
285
+ _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
286
+ attached = _useState6[0],
287
+ setAttached = _useState6[1];
288
+ var _useState7 = (0, _react.useState)(),
289
+ _useState8 = (0, _slicedToArray2.default)(_useState7, 2),
290
+ hoveredNodeId = _useState8[0],
291
+ setHoveredNodeId = _useState8[1];
292
+ var themeValue = (0, _uikit.useThemeValue)();
293
+ var _useGraph = (0, _react2.useGraph)({
294
+ name: 'query-graph',
295
+ settings: {
296
+ connection: _graph.BezierMultipointConnection,
297
+ canDrag: _graph.ECanDrag.NONE,
298
+ canDragCamera: true,
299
+ canZoomCamera: true,
300
+ canCreateNewConnections: false,
301
+ useBezierConnections: true,
302
+ bezierConnectionDirection: 'horizontal',
303
+ showConnectionArrows: true,
304
+ useBlocksAnchors: false,
305
+ blockComponents: {
306
+ 'query-node': _QueryGraphCanvasBlock.QueryGraphCanvasBlock
307
+ }
308
+ }
309
+ }),
310
+ graph = _useGraph.graph,
311
+ api = _useGraph.api,
312
+ setEntities = _useGraph.setEntities,
313
+ start = _useGraph.start,
314
+ stop = _useGraph.stop;
315
+ var _useState9 = (0, _react.useState)(graph.cameraService.getCameraState().scale),
316
+ _useState0 = (0, _slicedToArray2.default)(_useState9, 2),
317
+ scale = _useState0[0],
318
+ setScale = _useState0[1];
319
+ var _graph$cameraService$ = graph.cameraService.getCameraState(),
320
+ scaleMin = _graph$cameraService$.scaleMin,
321
+ scaleMax = _graph$cameraService$.scaleMax;
322
+ (0, _react2.useGraphEvent)(graph, 'camera-change', function (_ref6) {
323
+ var nextScale = _ref6.scale;
324
+ return setScale(nextScale);
325
+ });
326
+ (0, _react2.useGraphEvent)(graph, 'mouseenter', function (_ref7) {
327
+ var _state$meta;
328
+ var target = _ref7.target;
329
+ var state = target === null || target === void 0 ? void 0 : target.state;
330
+ if (state !== null && state !== void 0 && (_state$meta = state.meta) !== null && _state$meta !== void 0 && _state$meta.node) setHoveredNodeId(state.meta.node.id);
331
+ });
332
+ (0, _react2.useGraphEvent)(graph, 'mouseleave', function (_ref8) {
333
+ var _state$meta2;
334
+ var target = _ref8.target;
335
+ var state = target === null || target === void 0 ? void 0 : target.state;
336
+ if (state !== null && state !== void 0 && (_state$meta2 = state.meta) !== null && _state$meta2 !== void 0 && _state$meta2.node) setHoveredNodeId(undefined);
337
+ });
338
+ (0, _react.useEffect)(function () {
339
+ if (!rootRef.current) return;
340
+ var background = getComputedStyle(rootRef.current).getPropertyValue('--g-color-base-background').trim();
341
+ var connection = getComputedStyle(rootRef.current).getPropertyValue('--g-color-line-generic-accent').trim();
342
+ if (!background || !connection) return;
343
+ var colors = api.getGraphColors();
344
+ api.updateGraphColors((0, _objectSpread2.default)((0, _objectSpread2.default)({}, colors), {}, {
345
+ canvas: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, colors.canvas), {}, {
346
+ belowLayerBackground: background,
347
+ layerBackground: background,
348
+ border: background,
349
+ dots: background
350
+ }),
351
+ connection: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, colors.connection), {}, {
352
+ background: connection
353
+ })
354
+ }));
355
+ }, [api, themeValue]);
356
+ var visibleConnections = (0, _react.useMemo)(function () {
357
+ return connections.map(function (connection) {
358
+ return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, connection), {}, {
359
+ selected: Boolean(hoveredNodeId && (connection.sourceBlockId === hoveredNodeId || connection.targetBlockId === hoveredNodeId))
360
+ });
361
+ });
362
+ }, [connections, hoveredNodeId]);
363
+ (0, _react.useEffect)(function () {
364
+ return setEntities({
365
+ blocks: blocks,
366
+ connections: visibleConnections
367
+ });
368
+ }, [blocks, setEntities, visibleConnections]);
369
+ (0, _react.useEffect)(function () {
370
+ if (!attachedRef.current) return;
371
+ if (active) start();else stop();
372
+ }, [active, start, stop]);
373
+ (0, _react.useEffect)(function () {
374
+ var changed = previousStructureRef.current !== structureKey;
375
+ var becameActive = active && !previousActiveRef.current;
376
+ var frame;
377
+ if (attached && active && (!centeredRef.current || becameActive || autoCenter && changed)) {
378
+ frame = requestAnimationFrame(function () {
379
+ api.zoomToViewPort({
380
+ padding: FIT_PADDING
381
+ });
382
+ centeredRef.current = true;
383
+ });
384
+ }
385
+ previousActiveRef.current = Boolean(active);
386
+ previousStructureRef.current = structureKey;
387
+ setPopup(undefined);
388
+ return function () {
389
+ if (frame !== undefined) cancelAnimationFrame(frame);
390
+ };
391
+ }, [active, api, attached, autoCenter, setPopup, structureKey]);
392
+ var handleClick = function handleClick(_ref9) {
393
+ var _state$meta3;
394
+ var target = _ref9.target,
395
+ sourceEvent = _ref9.sourceEvent;
396
+ var state = target === null || target === void 0 ? void 0 : target.state;
397
+ if (!(state !== null && state !== void 0 && (_state$meta3 = state.meta) !== null && _state$meta3 !== void 0 && _state$meta3.node) || !rootRef.current) {
398
+ setPopup(undefined);
399
+ return;
400
+ }
401
+ var mouseEvent = sourceEvent;
402
+ var rect = rootRef.current.getBoundingClientRect();
403
+ var left = Math.min(Math.max(16, mouseEvent.clientX - rect.left + 12), rect.width - 456);
404
+ var top = Math.min(Math.max(16, mouseEvent.clientY - rect.top + 12), rect.height - 240);
405
+ setPopup({
406
+ nodeId: state.meta.node.id,
407
+ left: Math.max(16, left),
408
+ top: Math.max(16, top)
409
+ });
410
+ onNodeClick === null || onNodeClick === void 0 || onNodeClick(state.meta.node, mouseEvent);
411
+ };
412
+ var selectedNode = popup ? nodes.find(function (node) {
413
+ return node.id === popup.nodeId;
414
+ }) : undefined;
415
+ var defaultContent = selectedNode ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_QueryGraphPopup.QueryGraphPopup, {
416
+ node: selectedNode
417
+ }) : null;
418
+ var popupContent = null;
419
+ if (selectedNode) {
420
+ popupContent = renderNodePopup ? renderNodePopup({
421
+ node: selectedNode,
422
+ defaultContent: defaultContent
423
+ }) : defaultContent;
424
+ }
425
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
426
+ ref: rootRef,
427
+ className: block(null, className),
428
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_react2.GraphCanvas, {
429
+ graph: graph,
430
+ className: block('canvas'),
431
+ click: handleClick,
432
+ renderBlock: renderEmptyBlock,
433
+ onStateChanged: function onStateChanged(_ref0) {
434
+ var state = _ref0.state;
435
+ if (state === _graph.GraphState.ATTACHED) {
436
+ if (active) start();
437
+ attachedRef.current = true;
438
+ setAttached(true);
439
+ }
440
+ }
441
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
442
+ className: block('toolbox'),
443
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_uikit.Tooltip, {
444
+ content: (0, _i18n.default)('action_zoom-in'),
445
+ placement: "right",
446
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_uikit.Button, {
447
+ view: "raised",
448
+ pin: "round-brick",
449
+ "aria-label": (0, _i18n.default)('action_zoom-in'),
450
+ disabled: scale >= scaleMax,
451
+ onClick: function onClick() {
452
+ return changeZoom(graph, ZOOM_STEP);
453
+ },
454
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_uikit.Icon, {
455
+ data: _icons.MagnifierPlus
456
+ })
457
+ })
458
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_uikit.Tooltip, {
459
+ content: (0, _i18n.default)('action_fit'),
460
+ placement: "right",
461
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_uikit.Button, {
462
+ view: "raised",
463
+ pin: "brick-brick",
464
+ "aria-label": (0, _i18n.default)('action_fit'),
465
+ onClick: function onClick() {
466
+ return api.zoomToViewPort({
467
+ padding: FIT_PADDING
468
+ });
469
+ },
470
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_uikit.Icon, {
471
+ data: _icons.SquareDashed
472
+ })
473
+ })
474
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_uikit.Tooltip, {
475
+ content: (0, _i18n.default)('action_zoom-out'),
476
+ placement: "right",
477
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_uikit.Button, {
478
+ view: "raised",
479
+ pin: "brick-round",
480
+ "aria-label": (0, _i18n.default)('action_zoom-out'),
481
+ disabled: scale <= scaleMin,
482
+ onClick: function onClick() {
483
+ return changeZoom(graph, -ZOOM_STEP);
484
+ },
485
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_uikit.Icon, {
486
+ data: _icons.MagnifierMinus
487
+ })
488
+ })
489
+ })]
490
+ }), popup && popupContent !== null && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
491
+ className: block('popup'),
492
+ style: {
493
+ left: popup.left,
494
+ top: popup.top
495
+ },
496
+ children: popupContent
497
+ })]
498
+ });
499
+ });
500
+ function changeZoom(graph, delta) {
501
+ var camera = graph.cameraService;
502
+ var state = camera.getCameraState();
503
+ var nextScale = Math.min(state.scaleMax, Math.max(state.scaleMin, state.scale + delta));
504
+ camera.zoom(state.width / 2, state.height / 2, nextScale);
505
+ }
506
+ function State(_ref1) {
507
+ var className = _ref1.className,
508
+ children = _ref1.children;
509
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
510
+ className: block(null, className),
511
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
512
+ className: block('state'),
513
+ children: children
514
+ })
515
+ });
516
+ }
517
+ // #sourceMappingURL=QueryGraph.js.map