@gravity-ui/querieskit 1.5.1 → 1.7.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 (344) hide show
  1. package/README.md +62 -3
  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 +309 -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 +4 -2
  126. package/build/cjs/modules/TutorialRow/TutorialRow.js +5 -3
  127. package/build/cjs/modules/TutorialRow/TutorialRow.js.map +1 -1
  128. package/build/cjs/modules/TutorialSearchRow/TutorialSearchRow.d.ts +4 -2
  129. package/build/cjs/modules/TutorialSearchRow/TutorialSearchRow.js +7 -4
  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 +3 -3
  164. package/build/cjs/widgets/TutorialsHistory/TutorialRowContent.js +12 -8
  165. package/build/cjs/widgets/TutorialsHistory/TutorialRowContent.js.map +1 -1
  166. package/build/cjs/widgets/TutorialsHistory/TutorialsHistory.d.ts +8 -3
  167. package/build/cjs/widgets/TutorialsHistory/TutorialsHistory.js +19 -7
  168. package/build/cjs/widgets/TutorialsHistory/TutorialsHistory.js.map +1 -1
  169. package/build/cjs/widgets/TutorialsHistory/TutorialsHistory.stories.d.ts +5 -0
  170. package/build/cjs/widgets/TutorialsHistory/TutorialsHistory.stories.js +244 -1
  171. package/build/cjs/widgets/TutorialsHistory/TutorialsHistory.stories.js.map +1 -1
  172. package/build/esm/components/QueryGraph/QueryGraph.css +70 -0
  173. package/build/esm/components/QueryGraph/QueryGraph.css.map +1 -0
  174. package/build/esm/components/QueryGraph/QueryGraph.d.ts +4 -0
  175. package/build/esm/components/QueryGraph/QueryGraph.js +510 -0
  176. package/build/esm/components/QueryGraph/QueryGraph.js.map +1 -0
  177. package/build/esm/components/QueryGraph/QueryGraph.scss +81 -0
  178. package/build/esm/components/QueryGraph/QueryGraph.stories.d.ts +16 -0
  179. package/build/esm/components/QueryGraph/QueryGraph.stories.js +331 -0
  180. package/build/esm/components/QueryGraph/QueryGraph.stories.js.map +1 -0
  181. package/build/esm/components/QueryGraph/helpers/layout.d.ts +9 -0
  182. package/build/esm/components/QueryGraph/helpers/layout.js +128 -0
  183. package/build/esm/components/QueryGraph/helpers/layout.js.map +1 -0
  184. package/build/esm/components/QueryGraph/helpers/presentation.d.ts +18 -0
  185. package/build/esm/components/QueryGraph/helpers/presentation.js +35 -0
  186. package/build/esm/components/QueryGraph/helpers/presentation.js.map +1 -0
  187. package/build/esm/components/QueryGraph/i18n/dicts.d.ts +55 -0
  188. package/build/esm/components/QueryGraph/i18n/dicts.js +7 -0
  189. package/build/esm/components/QueryGraph/i18n/dicts.js.map +1 -0
  190. package/build/esm/components/QueryGraph/i18n/en.json +26 -0
  191. package/build/esm/components/QueryGraph/i18n/index.d.ts +6 -0
  192. package/build/esm/components/QueryGraph/i18n/index.js +4 -0
  193. package/build/esm/components/QueryGraph/i18n/index.js.map +1 -0
  194. package/build/esm/components/QueryGraph/i18n/ru.json +26 -0
  195. package/build/esm/components/QueryGraph/index.d.ts +2 -0
  196. package/build/esm/components/QueryGraph/index.js +2 -0
  197. package/build/esm/components/QueryGraph/index.js.map +1 -0
  198. package/build/esm/components/QueryGraph/internal/QueryGraphCanvasBlock.d.ts +24 -0
  199. package/build/esm/components/QueryGraph/internal/QueryGraphCanvasBlock.js +301 -0
  200. package/build/esm/components/QueryGraph/internal/QueryGraphCanvasBlock.js.map +1 -0
  201. package/build/esm/components/QueryGraph/internal/QueryGraphPopup.d.ts +5 -0
  202. package/build/esm/components/QueryGraph/internal/QueryGraphPopup.js +234 -0
  203. package/build/esm/components/QueryGraph/internal/QueryGraphPopup.js.map +1 -0
  204. package/build/esm/components/QueryGraph/internal/queryGraphIcons.d.ts +12 -0
  205. package/build/esm/components/QueryGraph/internal/queryGraphIcons.js +150 -0
  206. package/build/esm/components/QueryGraph/internal/queryGraphIcons.js.map +1 -0
  207. package/build/esm/components/QueryGraph/internal/useQueryGraphLayout.d.ts +22 -0
  208. package/build/esm/components/QueryGraph/internal/useQueryGraphLayout.js +53 -0
  209. package/build/esm/components/QueryGraph/internal/useQueryGraphLayout.js.map +1 -0
  210. package/build/esm/components/QueryGraph/story/largeGraphData.d.ts +3 -0
  211. package/build/esm/components/QueryGraph/story/largeGraphData.js +220 -0
  212. package/build/esm/components/QueryGraph/story/largeGraphData.js.map +1 -0
  213. package/build/esm/components/index.d.ts +2 -0
  214. package/build/esm/components/index.js +1 -0
  215. package/build/esm/components/index.js.map +1 -1
  216. package/build/esm/helpers/buildColumnsFromKeys.d.ts +1 -1
  217. package/build/esm/helpers/buildColumnsFromKeys.js.map +1 -1
  218. package/build/esm/index.d.ts +1 -0
  219. package/build/esm/index.js +1 -0
  220. package/build/esm/index.js.map +1 -1
  221. package/build/esm/modules/ClustersList/ClustersList.d.ts +1 -1
  222. package/build/esm/modules/ClustersList/ClustersList.js +2 -1
  223. package/build/esm/modules/ClustersList/ClustersList.js.map +1 -1
  224. package/build/esm/modules/HistoryHeader/HistoryHeader.js +2 -1
  225. package/build/esm/modules/HistoryHeader/HistoryHeader.js.map +1 -1
  226. package/build/esm/modules/HistoryRow/HistoryRow.js +6 -1
  227. package/build/esm/modules/HistoryRow/HistoryRow.js.map +1 -1
  228. package/build/esm/modules/HistorySearchRow/HistorySearchRow.js +4 -1
  229. package/build/esm/modules/HistorySearchRow/HistorySearchRow.js.map +1 -1
  230. package/build/esm/modules/HistorySearchRow/helpers/resolveMonacoLanguage.d.ts +1 -1
  231. package/build/esm/modules/HistorySearchRow/helpers/resolveMonacoLanguage.js +1 -1
  232. package/build/esm/modules/HistorySearchRow/helpers/resolveMonacoLanguage.js.map +1 -1
  233. package/build/esm/modules/NavigationDetail/NavigationDetail.d.ts +1 -1
  234. package/build/esm/modules/NavigationDetail/NavigationDetail.js +1 -1
  235. package/build/esm/modules/NavigationDetail/NavigationDetail.js.map +1 -1
  236. package/build/esm/modules/NavigationHeader/NavigationHeader.d.ts +1 -1
  237. package/build/esm/modules/NavigationHeader/NavigationHeader.js +1 -1
  238. package/build/esm/modules/NavigationHeader/NavigationHeader.js.map +1 -1
  239. package/build/esm/modules/NavigationItemsList/NavigationItemsList.d.ts +1 -1
  240. package/build/esm/modules/NavigationItemsList/NavigationItemsList.js +2 -1
  241. package/build/esm/modules/NavigationItemsList/NavigationItemsList.js.map +1 -1
  242. package/build/esm/modules/NavigationItemsList/internal/NavigationItemsListEmptyState.d.ts +1 -1
  243. package/build/esm/modules/NavigationItemsList/internal/NavigationItemsListEmptyState.js +1 -1
  244. package/build/esm/modules/NavigationItemsList/internal/NavigationItemsListEmptyState.js.map +1 -1
  245. package/build/esm/modules/NavigationMeta/NavigationMeta.js +2 -1
  246. package/build/esm/modules/NavigationMeta/NavigationMeta.js.map +1 -1
  247. package/build/esm/modules/NavigationMeta/i18n/index.d.ts +2 -2
  248. package/build/esm/modules/NavigationPreview/NavigationPreview.d.ts +1 -1
  249. package/build/esm/modules/NavigationPreview/NavigationPreview.js +3 -1
  250. package/build/esm/modules/NavigationPreview/NavigationPreview.js.map +1 -1
  251. package/build/esm/modules/NavigationPreview/helpers/buildPreviewColumns.d.ts +1 -1
  252. package/build/esm/modules/NavigationPreview/helpers/buildPreviewColumns.js.map +1 -1
  253. package/build/esm/modules/NavigationSchema/NavigationSchema.d.ts +1 -1
  254. package/build/esm/modules/NavigationSchema/NavigationSchema.js +2 -1
  255. package/build/esm/modules/NavigationSchema/NavigationSchema.js.map +1 -1
  256. package/build/esm/modules/NavigationSchema/helpers/buildSchemaColumns.d.ts +1 -1
  257. package/build/esm/modules/NavigationSchema/helpers/buildSchemaColumns.js.map +1 -1
  258. package/build/esm/modules/NavigationView/NavigationView.d.ts +1 -1
  259. package/build/esm/modules/NavigationView/NavigationView.js +2 -1
  260. package/build/esm/modules/NavigationView/NavigationView.js.map +1 -1
  261. package/build/esm/modules/NavigationView/helpers/buildViewColumns.d.ts +1 -1
  262. package/build/esm/modules/NavigationView/helpers/buildViewColumns.js.map +1 -1
  263. package/build/esm/modules/NavigationView/internal/NavigationViewSectionItem.d.ts +1 -1
  264. package/build/esm/modules/NavigationView/internal/NavigationViewSectionItem.js +2 -1
  265. package/build/esm/modules/NavigationView/internal/NavigationViewSectionItem.js.map +1 -1
  266. package/build/esm/modules/QueriesList/QueriesList.js +1 -1
  267. package/build/esm/modules/QueriesList/QueriesList.js.map +1 -1
  268. package/build/esm/modules/QueryProgress/QueryProgress.css +64 -0
  269. package/build/esm/modules/QueryProgress/QueryProgress.css.map +1 -0
  270. package/build/esm/modules/QueryProgress/QueryProgress.d.ts +4 -0
  271. package/build/esm/modules/QueryProgress/QueryProgress.js +127 -0
  272. package/build/esm/modules/QueryProgress/QueryProgress.js.map +1 -0
  273. package/build/esm/modules/QueryProgress/QueryProgress.scss +72 -0
  274. package/build/esm/modules/QueryProgress/QueryProgress.stories.d.ts +7 -0
  275. package/build/esm/modules/QueryProgress/QueryProgress.stories.js +31 -0
  276. package/build/esm/modules/QueryProgress/QueryProgress.stories.js.map +1 -0
  277. package/build/esm/modules/QueryProgress/i18n/dicts.d.ts +25 -0
  278. package/build/esm/modules/QueryProgress/i18n/dicts.js +7 -0
  279. package/build/esm/modules/QueryProgress/i18n/dicts.js.map +1 -0
  280. package/build/esm/modules/QueryProgress/i18n/en.json +11 -0
  281. package/build/esm/modules/QueryProgress/i18n/index.d.ts +6 -0
  282. package/build/esm/modules/QueryProgress/i18n/index.js +4 -0
  283. package/build/esm/modules/QueryProgress/i18n/index.js.map +1 -0
  284. package/build/esm/modules/QueryProgress/i18n/ru.json +11 -0
  285. package/build/esm/modules/QueryProgress/index.d.ts +2 -0
  286. package/build/esm/modules/QueryProgress/index.js +2 -0
  287. package/build/esm/modules/QueryProgress/index.js.map +1 -0
  288. package/build/esm/modules/QueryStatistics/i18n/index.d.ts +2 -2
  289. package/build/esm/modules/RowsList/RowsList.js +2 -1
  290. package/build/esm/modules/RowsList/RowsList.js.map +1 -1
  291. package/build/esm/modules/SavedQueryRow/SavedQueryRow.d.ts +2 -2
  292. package/build/esm/modules/SavedQueryRow/SavedQueryRow.js +3 -1
  293. package/build/esm/modules/SavedQueryRow/SavedQueryRow.js.map +1 -1
  294. package/build/esm/modules/SavedQuerySearchRow/SavedQuerySearchRow.d.ts +2 -2
  295. package/build/esm/modules/SavedQuerySearchRow/SavedQuerySearchRow.js +2 -1
  296. package/build/esm/modules/SavedQuerySearchRow/SavedQuerySearchRow.js.map +1 -1
  297. package/build/esm/modules/TutorialRow/TutorialRow.d.ts +4 -2
  298. package/build/esm/modules/TutorialRow/TutorialRow.js +4 -2
  299. package/build/esm/modules/TutorialRow/TutorialRow.js.map +1 -1
  300. package/build/esm/modules/TutorialSearchRow/TutorialSearchRow.d.ts +4 -2
  301. package/build/esm/modules/TutorialSearchRow/TutorialSearchRow.js +5 -2
  302. package/build/esm/modules/TutorialSearchRow/TutorialSearchRow.js.map +1 -1
  303. package/build/esm/modules/index.d.ts +2 -0
  304. package/build/esm/modules/index.js +1 -0
  305. package/build/esm/modules/index.js.map +1 -1
  306. package/build/esm/types/queryGraph.d.ts +87 -0
  307. package/build/esm/types/queryGraph.js +2 -0
  308. package/build/esm/types/queryGraph.js.map +1 -0
  309. package/build/esm/widgets/DashboardCharts/DashboardCharts.js +4 -2
  310. package/build/esm/widgets/DashboardCharts/DashboardCharts.js.map +1 -1
  311. package/build/esm/widgets/DashboardCharts/types.d.ts +3 -3
  312. package/build/esm/widgets/DashboardCharts/types.js.map +1 -1
  313. package/build/esm/widgets/QueriesHistory/QueriesHistory.js +1 -1
  314. package/build/esm/widgets/QueriesHistory/QueriesHistory.js.map +1 -1
  315. package/build/esm/widgets/QueriesHistory/internal/HistoryRowContent.js +3 -2
  316. package/build/esm/widgets/QueriesHistory/internal/HistoryRowContent.js.map +1 -1
  317. package/build/esm/widgets/QueriesNavigation/QueriesNavigation.d.ts +1 -1
  318. package/build/esm/widgets/QueriesNavigation/QueriesNavigation.js +6 -2
  319. package/build/esm/widgets/QueriesNavigation/QueriesNavigation.js.map +1 -1
  320. package/build/esm/widgets/QueriesNavigation/helpers/createEmptyDetailConfig.js +1 -1
  321. package/build/esm/widgets/QueriesNavigation/helpers/createEmptyDetailConfig.js.map +1 -1
  322. package/build/esm/widgets/QueriesNavigation/helpers/createTableDetailConfig.js +4 -1
  323. package/build/esm/widgets/QueriesNavigation/helpers/createTableDetailConfig.js.map +1 -1
  324. package/build/esm/widgets/QueryResults/QueryResults.js +1 -1
  325. package/build/esm/widgets/QueryResults/QueryResults.js.map +1 -1
  326. package/build/esm/widgets/QueryResults/i18n/index.d.ts +2 -2
  327. package/build/esm/widgets/QueryResults/internal/QueryResultsSchema.js +2 -1
  328. package/build/esm/widgets/QueryResults/internal/QueryResultsSchema.js.map +1 -1
  329. package/build/esm/widgets/SavedQueries/SavedQueries.d.ts +2 -2
  330. package/build/esm/widgets/SavedQueries/SavedQueries.js +1 -1
  331. package/build/esm/widgets/SavedQueries/SavedQueries.js.map +1 -1
  332. package/build/esm/widgets/SavedQueries/SavedQueryRowContent.d.ts +2 -2
  333. package/build/esm/widgets/SavedQueries/SavedQueryRowContent.js +3 -2
  334. package/build/esm/widgets/SavedQueries/SavedQueryRowContent.js.map +1 -1
  335. package/build/esm/widgets/TutorialsHistory/TutorialRowContent.d.ts +3 -3
  336. package/build/esm/widgets/TutorialsHistory/TutorialRowContent.js +9 -5
  337. package/build/esm/widgets/TutorialsHistory/TutorialRowContent.js.map +1 -1
  338. package/build/esm/widgets/TutorialsHistory/TutorialsHistory.d.ts +8 -3
  339. package/build/esm/widgets/TutorialsHistory/TutorialsHistory.js +16 -4
  340. package/build/esm/widgets/TutorialsHistory/TutorialsHistory.js.map +1 -1
  341. package/build/esm/widgets/TutorialsHistory/TutorialsHistory.stories.d.ts +5 -0
  342. package/build/esm/widgets/TutorialsHistory/TutorialsHistory.stories.js +244 -1
  343. package/build/esm/widgets/TutorialsHistory/TutorialsHistory.stories.js.map +1 -1
  344. package/package.json +84 -5
@@ -0,0 +1,16 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import type { QueryGraphEdge, QueryGraphNode } from '../../types/queryGraph';
3
+ import { QueryGraph } from './QueryGraph';
4
+ export declare const demoNodes: QueryGraphNode[];
5
+ export declare const demoEdges: QueryGraphEdge[];
6
+ declare const meta: Meta<typeof QueryGraph>;
7
+ export default meta;
8
+ type Story = StoryObj<typeof QueryGraph>;
9
+ export declare const Default: Story;
10
+ export declare const Statuses: Story;
11
+ export declare const OperationTypes: Story;
12
+ export declare const CustomIcon: Story;
13
+ export declare const UpdatingProgress: Story;
14
+ export declare const LargeGraph: Story;
15
+ export declare const LargeGraphThreshold: Story;
16
+ export declare const InvalidGraph: Story;
@@ -0,0 +1,331 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
+ import _objectSpread from "@babel/runtime/helpers/objectSpread2";
3
+ import "core-js/modules/es.array.from.js";
4
+ import "core-js/modules/es.array.map.js";
5
+ import "core-js/modules/es.iterator.constructor.js";
6
+ import "core-js/modules/es.iterator.map.js";
7
+ import "core-js/modules/es.object.to-string.js";
8
+ import "core-js/modules/es.string.iterator.js";
9
+ import "core-js/modules/web.timers.js";
10
+ import React, { useEffect, useState } from 'react';
11
+ import { QueryGraph } from "./QueryGraph";
12
+ import { largeGraphEdges, largeGraphNodes } from "./story/largeGraphData";
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ export var demoNodes = [{
15
+ id: 'source',
16
+ kind: 'input',
17
+ name: 'orders',
18
+ label: 'warehouse.orders'
19
+ }, {
20
+ id: 'read',
21
+ kind: 'operation',
22
+ name: 'Read',
23
+ operationType: 'read',
24
+ status: 'completed',
25
+ progress: {
26
+ total: 12,
27
+ completed: 12
28
+ }
29
+ }, {
30
+ id: 'map',
31
+ kind: 'operation',
32
+ name: 'Map',
33
+ operationType: 'map',
34
+ status: 'running',
35
+ progress: {
36
+ total: 100,
37
+ completed: 68,
38
+ running: 8,
39
+ pending: 24
40
+ },
41
+ popup: {
42
+ stages: [{
43
+ name: 'Preparing',
44
+ duration: 1300
45
+ }, {
46
+ name: 'Executing',
47
+ duration: 8400
48
+ }],
49
+ details: [{
50
+ name: 'Columns',
51
+ value: ['id', 'price', 'created_at']
52
+ }, {
53
+ name: 'Settings',
54
+ children: [{
55
+ name: 'Workers',
56
+ value: 8
57
+ }]
58
+ }],
59
+ jobs: {
60
+ total: 100,
61
+ completed: 68,
62
+ running: 8,
63
+ pending: 24
64
+ },
65
+ inputs: [{
66
+ name: 'orders',
67
+ columns: [{
68
+ name: 'id',
69
+ type: 'Uint64'
70
+ }, {
71
+ name: 'price',
72
+ type: 'Double'
73
+ }]
74
+ }],
75
+ outputs: [{
76
+ name: 'mapped',
77
+ columns: [{
78
+ name: 'total',
79
+ type: 'Double'
80
+ }]
81
+ }]
82
+ }
83
+ }, {
84
+ id: 'reduce',
85
+ kind: 'operation',
86
+ name: 'Reduce',
87
+ operationType: 'reduce',
88
+ status: 'waiting',
89
+ progress: {
90
+ total: 20
91
+ }
92
+ }, {
93
+ id: 'sink',
94
+ kind: 'output',
95
+ name: 'result',
96
+ label: 'warehouse.result'
97
+ }];
98
+ export var demoEdges = [{
99
+ id: 'source-read',
100
+ source: 'source',
101
+ target: 'read'
102
+ }, {
103
+ id: 'read-map',
104
+ source: 'read',
105
+ target: 'map'
106
+ }, {
107
+ id: 'map-reduce',
108
+ source: 'map',
109
+ target: 'reduce'
110
+ }, {
111
+ id: 'reduce-sink',
112
+ source: 'reduce',
113
+ target: 'sink'
114
+ }];
115
+ var meta = {
116
+ title: 'Components/QueryGraph',
117
+ component: QueryGraph,
118
+ tags: ['autodocs'],
119
+ args: {
120
+ nodes: demoNodes,
121
+ edges: demoEdges
122
+ },
123
+ render: function render(args) {
124
+ return /*#__PURE__*/_jsx(QueryGraph, _objectSpread(_objectSpread({}, args), {}, {
125
+ className: "query-graph-story"
126
+ }));
127
+ },
128
+ decorators: [function (Story) {
129
+ return /*#__PURE__*/_jsx("div", {
130
+ style: {
131
+ height: 600
132
+ },
133
+ children: /*#__PURE__*/_jsx(Story, {})
134
+ });
135
+ }]
136
+ };
137
+ export default meta;
138
+ export var Default = {};
139
+ export var Statuses = {
140
+ args: {
141
+ nodes: [{
142
+ id: 'not-started',
143
+ kind: 'operation',
144
+ name: 'Map',
145
+ status: 'not-started'
146
+ }, {
147
+ id: 'waiting',
148
+ kind: 'operation',
149
+ name: 'Map',
150
+ status: 'waiting'
151
+ }, {
152
+ id: 'running',
153
+ kind: 'operation',
154
+ name: 'Map',
155
+ status: 'running'
156
+ }, {
157
+ id: 'completed',
158
+ kind: 'operation',
159
+ name: 'Map',
160
+ status: 'completed'
161
+ }, {
162
+ id: 'failed',
163
+ kind: 'operation',
164
+ name: 'Map',
165
+ status: 'failed'
166
+ }, {
167
+ id: 'aborted',
168
+ kind: 'operation',
169
+ name: 'Map',
170
+ status: 'aborted'
171
+ }].map(function (node, index) {
172
+ return _objectSpread(_objectSpread({}, node), {}, {
173
+ progress: {
174
+ total: index === 5 ? 23 : 2684677
175
+ }
176
+ });
177
+ }),
178
+ edges: [],
179
+ largeGraphThreshold: false
180
+ }
181
+ };
182
+ export var OperationTypes = {
183
+ args: {
184
+ nodes: ['read', 'map', 'reduce', 'map-reduce', 'merge', 'sort', 'erase', 'commit', 'operation'].map(function (operationType) {
185
+ return {
186
+ id: operationType,
187
+ kind: 'operation',
188
+ name: operationType,
189
+ label: operationType === 'map-reduce' ? 'A very long reusable MapReduce operation label' : operationType,
190
+ operationType: operationType,
191
+ status: 'not-started'
192
+ };
193
+ }),
194
+ edges: [{
195
+ id: 'read-map',
196
+ source: 'read',
197
+ target: 'map'
198
+ }, {
199
+ id: 'map-reduce',
200
+ source: 'map',
201
+ target: 'reduce'
202
+ }, {
203
+ id: 'map-reduce-merge',
204
+ source: 'map-reduce',
205
+ target: 'merge'
206
+ }, {
207
+ id: 'merge-sort',
208
+ source: 'merge',
209
+ target: 'sort'
210
+ }, {
211
+ id: 'erase-commit',
212
+ source: 'erase',
213
+ target: 'commit'
214
+ }, {
215
+ id: 'commit-operation',
216
+ source: 'commit',
217
+ target: 'operation'
218
+ }],
219
+ largeGraphThreshold: false
220
+ }
221
+ };
222
+ export var CustomIcon = {
223
+ args: {
224
+ nodes: [{
225
+ id: 'custom',
226
+ kind: 'operation',
227
+ name: 'Custom operation',
228
+ status: 'not-started',
229
+ icon: /*#__PURE__*/_jsx("svg", {
230
+ width: "16",
231
+ height: "16",
232
+ viewBox: "0 0 16 16",
233
+ xmlns: "http://www.w3.org/2000/svg",
234
+ children: /*#__PURE__*/_jsx("path", {
235
+ fill: "currentColor",
236
+ d: "M8 1 15 8 8 15 1 8z"
237
+ })
238
+ })
239
+ }],
240
+ edges: [],
241
+ largeGraphThreshold: false
242
+ }
243
+ };
244
+ function UpdatingProgressStory(props) {
245
+ var _useState = useState(0),
246
+ _useState2 = _slicedToArray(_useState, 2),
247
+ completed = _useState2[0],
248
+ setCompleted = _useState2[1];
249
+ useEffect(function () {
250
+ var timer = window.setInterval(function () {
251
+ return setCompleted(function (value) {
252
+ return (value + 5) % 105;
253
+ });
254
+ }, 500);
255
+ return function () {
256
+ return window.clearInterval(timer);
257
+ };
258
+ }, []);
259
+ return /*#__PURE__*/_jsx(QueryGraph, _objectSpread(_objectSpread({}, props), {}, {
260
+ nodes: props.nodes.map(function (node) {
261
+ return node.id === 'progress' ? _objectSpread(_objectSpread({}, node), {}, {
262
+ progress: {
263
+ total: 100,
264
+ completed: completed,
265
+ fraction: completed / 100
266
+ }
267
+ }) : node;
268
+ })
269
+ }));
270
+ }
271
+ export var UpdatingProgress = {
272
+ args: {
273
+ nodes: [{
274
+ id: 'progress',
275
+ kind: 'operation',
276
+ name: 'Map',
277
+ operationType: 'map',
278
+ status: 'running',
279
+ progress: {
280
+ total: 100,
281
+ completed: 0
282
+ }
283
+ }],
284
+ edges: [],
285
+ largeGraphThreshold: false
286
+ },
287
+ render: function render(args) {
288
+ return /*#__PURE__*/_jsx(UpdatingProgressStory, _objectSpread({}, args));
289
+ }
290
+ };
291
+ export var LargeGraph = {
292
+ args: {
293
+ nodes: largeGraphNodes,
294
+ edges: largeGraphEdges,
295
+ largeGraphThreshold: false
296
+ }
297
+ };
298
+ export var LargeGraphThreshold = {
299
+ args: {
300
+ nodes: Array.from({
301
+ length: 701
302
+ }, function (_, index) {
303
+ return {
304
+ id: "node-".concat(index),
305
+ kind: 'operation',
306
+ name: "Operation ".concat(index),
307
+ status: index % 3 ? 'completed' : 'running'
308
+ };
309
+ }),
310
+ edges: Array.from({
311
+ length: 700
312
+ }, function (_, index) {
313
+ return {
314
+ id: "edge-".concat(index),
315
+ source: "node-".concat(index),
316
+ target: "node-".concat(index + 1)
317
+ };
318
+ })
319
+ }
320
+ };
321
+ export var InvalidGraph = {
322
+ args: {
323
+ nodes: demoNodes,
324
+ edges: [{
325
+ id: 'bad',
326
+ source: 'source',
327
+ target: 'missing'
328
+ }]
329
+ }
330
+ };
331
+ // #sourceMappingURL=QueryGraph.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useEffect","useState","QueryGraph","largeGraphEdges","largeGraphNodes","jsx","_jsx","demoNodes","id","kind","name","label","operationType","status","progress","total","completed","running","pending","popup","stages","duration","details","value","children","jobs","inputs","columns","type","outputs","demoEdges","source","target","meta","title","component","tags","args","nodes","edges","render","_objectSpread","className","decorators","Story","style","height","Default","Statuses","map","node","index","largeGraphThreshold","OperationTypes","CustomIcon","icon","width","viewBox","xmlns","fill","d","UpdatingProgressStory","props","_useState","_useState2","_slicedToArray","setCompleted","timer","window","setInterval","clearInterval","fraction","UpdatingProgress","LargeGraph","LargeGraphThreshold","Array","from","length","_","concat","InvalidGraph"],"sources":["QueryGraph.stories.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport type {Meta, StoryObj} from '@storybook/react';\n\nimport type {QueryGraphEdge, QueryGraphNode} from '../../types/queryGraph';\nimport {QueryGraph} from './QueryGraph';\nimport {largeGraphEdges, largeGraphNodes} from './story/largeGraphData';\n\nexport const demoNodes: QueryGraphNode[] = [\n {id: 'source', kind: 'input', name: 'orders', label: 'warehouse.orders'},\n {\n id: 'read',\n kind: 'operation',\n name: 'Read',\n operationType: 'read',\n status: 'completed',\n progress: {total: 12, completed: 12},\n },\n {\n id: 'map',\n kind: 'operation',\n name: 'Map',\n operationType: 'map',\n status: 'running',\n progress: {total: 100, completed: 68, running: 8, pending: 24},\n popup: {\n stages: [\n {name: 'Preparing', duration: 1300},\n {name: 'Executing', duration: 8400},\n ],\n details: [\n {name: 'Columns', value: ['id', 'price', 'created_at']},\n {name: 'Settings', children: [{name: 'Workers', value: 8}]},\n ],\n jobs: {total: 100, completed: 68, running: 8, pending: 24},\n inputs: [\n {\n name: 'orders',\n columns: [\n {name: 'id', type: 'Uint64'},\n {name: 'price', type: 'Double'},\n ],\n },\n ],\n outputs: [{name: 'mapped', columns: [{name: 'total', type: 'Double'}]}],\n },\n },\n {\n id: 'reduce',\n kind: 'operation',\n name: 'Reduce',\n operationType: 'reduce',\n status: 'waiting',\n progress: {total: 20},\n },\n {id: 'sink', kind: 'output', name: 'result', label: 'warehouse.result'},\n];\n\nexport const demoEdges: QueryGraphEdge[] = [\n {id: 'source-read', source: 'source', target: 'read'},\n {id: 'read-map', source: 'read', target: 'map'},\n {id: 'map-reduce', source: 'map', target: 'reduce'},\n {id: 'reduce-sink', source: 'reduce', target: 'sink'},\n];\n\nconst meta: Meta<typeof QueryGraph> = {\n title: 'Components/QueryGraph',\n component: QueryGraph,\n tags: ['autodocs'],\n args: {nodes: demoNodes, edges: demoEdges},\n render: (args) => <QueryGraph {...args} className=\"query-graph-story\" />,\n decorators: [\n (Story) => (\n <div style={{height: 600}}>\n <Story />\n </div>\n ),\n ],\n};\n\nexport default meta;\ntype Story = StoryObj<typeof QueryGraph>;\n\nexport const Default: Story = {};\n\nexport const Statuses: Story = {\n args: {\n nodes: [\n {id: 'not-started', kind: 'operation', name: 'Map', status: 'not-started'},\n {id: 'waiting', kind: 'operation', name: 'Map', status: 'waiting'},\n {id: 'running', kind: 'operation', name: 'Map', status: 'running'},\n {id: 'completed', kind: 'operation', name: 'Map', status: 'completed'},\n {id: 'failed', kind: 'operation', name: 'Map', status: 'failed'},\n {id: 'aborted', kind: 'operation', name: 'Map', status: 'aborted'},\n ].map((node, index) => ({\n ...node,\n progress: {total: index === 5 ? 23 : 2_684_677},\n })) as QueryGraphNode[],\n edges: [],\n largeGraphThreshold: false,\n },\n};\n\nexport const OperationTypes: Story = {\n args: {\n nodes: (\n [\n 'read',\n 'map',\n 'reduce',\n 'map-reduce',\n 'merge',\n 'sort',\n 'erase',\n 'commit',\n 'operation',\n ] as const\n ).map((operationType) => ({\n id: operationType,\n kind: 'operation' as const,\n name: operationType,\n label:\n operationType === 'map-reduce'\n ? 'A very long reusable MapReduce operation label'\n : operationType,\n operationType,\n status: 'not-started' as const,\n })),\n edges: [\n {id: 'read-map', source: 'read', target: 'map'},\n {id: 'map-reduce', source: 'map', target: 'reduce'},\n {id: 'map-reduce-merge', source: 'map-reduce', target: 'merge'},\n {id: 'merge-sort', source: 'merge', target: 'sort'},\n {id: 'erase-commit', source: 'erase', target: 'commit'},\n {id: 'commit-operation', source: 'commit', target: 'operation'},\n ],\n largeGraphThreshold: false,\n },\n};\n\nexport const CustomIcon: Story = {\n args: {\n nodes: [\n {\n id: 'custom',\n kind: 'operation',\n name: 'Custom operation',\n status: 'not-started',\n icon: (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path fill=\"currentColor\" d=\"M8 1 15 8 8 15 1 8z\" />\n </svg>\n ),\n },\n ],\n edges: [],\n largeGraphThreshold: false,\n },\n};\n\nfunction UpdatingProgressStory(props: React.ComponentProps<typeof QueryGraph>) {\n const [completed, setCompleted] = useState(0);\n useEffect(() => {\n const timer = window.setInterval(() => setCompleted((value) => (value + 5) % 105), 500);\n return () => window.clearInterval(timer);\n }, []);\n return (\n <QueryGraph\n {...props}\n nodes={props.nodes.map((node) =>\n node.id === 'progress'\n ? {...node, progress: {total: 100, completed, fraction: completed / 100}}\n : node,\n )}\n />\n );\n}\n\nexport const UpdatingProgress: Story = {\n args: {\n nodes: [\n {\n id: 'progress',\n kind: 'operation',\n name: 'Map',\n operationType: 'map',\n status: 'running',\n progress: {total: 100, completed: 0},\n },\n ],\n edges: [],\n largeGraphThreshold: false,\n },\n render: (args) => <UpdatingProgressStory {...args} />,\n};\n\nexport const LargeGraph: Story = {\n args: {\n nodes: largeGraphNodes,\n edges: largeGraphEdges,\n largeGraphThreshold: false,\n },\n};\n\nexport const LargeGraphThreshold: Story = {\n args: {\n nodes: Array.from({length: 701}, (_, index) => ({\n id: `node-${index}`,\n kind: 'operation' as const,\n name: `Operation ${index}`,\n status: index % 3 ? ('completed' as const) : ('running' as const),\n })),\n edges: Array.from({length: 700}, (_, index) => ({\n id: `edge-${index}`,\n source: `node-${index}`,\n target: `node-${index + 1}`,\n })),\n },\n};\n\nexport const InvalidGraph: Story = {\n args: {nodes: demoNodes, edges: [{id: 'bad', source: 'source', target: 'missing'}]},\n};\n"],"mappings":";;;;;;;;;AAAA,OAAOA,KAAK,IAAGC,SAAS,EAAEC,QAAQ,QAAO,OAAO;AAIhD,SAAQC,UAAU;AAClB,SAAQC,eAAe,EAAEC,eAAe;AAAgC,SAAAC,GAAA,IAAAC,IAAA;AAExE,OAAO,IAAMC,SAA2B,GAAG,CACvC;EAACC,EAAE,EAAE,QAAQ;EAAEC,IAAI,EAAE,OAAO;EAAEC,IAAI,EAAE,QAAQ;EAAEC,KAAK,EAAE;AAAkB,CAAC,EACxE;EACIH,EAAE,EAAE,MAAM;EACVC,IAAI,EAAE,WAAW;EACjBC,IAAI,EAAE,MAAM;EACZE,aAAa,EAAE,MAAM;EACrBC,MAAM,EAAE,WAAW;EACnBC,QAAQ,EAAE;IAACC,KAAK,EAAE,EAAE;IAAEC,SAAS,EAAE;EAAE;AACvC,CAAC,EACD;EACIR,EAAE,EAAE,KAAK;EACTC,IAAI,EAAE,WAAW;EACjBC,IAAI,EAAE,KAAK;EACXE,aAAa,EAAE,KAAK;EACpBC,MAAM,EAAE,SAAS;EACjBC,QAAQ,EAAE;IAACC,KAAK,EAAE,GAAG;IAAEC,SAAS,EAAE,EAAE;IAAEC,OAAO,EAAE,CAAC;IAAEC,OAAO,EAAE;EAAE,CAAC;EAC9DC,KAAK,EAAE;IACHC,MAAM,EAAE,CACJ;MAACV,IAAI,EAAE,WAAW;MAAEW,QAAQ,EAAE;IAAI,CAAC,EACnC;MAACX,IAAI,EAAE,W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,EAAEpC,eAAe;IACtBiD,mBAAmB,EAAE;EACzB;AACJ,CAAC;AAED,OAAO,IAAMsB,mBAA0B,GAAG;EACtCrC,IAAI,EAAE;IACFC,KAAK,EAAEqC,KAAK,CAACC,IAAI,CAAC;MAACC,MAAM,EAAE;IAAG,CAAC,EAAE,UAACC,CAAC,EAAE3B,KAAK;MAAA,OAAM;QAC5C3C,EAAE,UAAAuE,MAAA,CAAU5B,KAAK,CAAE;QACnB1C,IAAI,EAAE,WAAoB;QAC1BC,IAAI,eAAAqE,MAAA,CAAe5B,KAAK,CAAE;QAC1BtC,MAAM,EAAEsC,KAAK,GAAG,CAAC,GAAI,WAAW,GAAc;MAClD,CAAC;IAAA,CAAC,CAAC;IACHZ,KAAK,EAAEoC,KAAK,CAACC,IAAI,CAAC;MAACC,MAAM,EAAE;IAAG,CAAC,EAAE,UAACC,CAAC,EAAE3B,KAAK;MAAA,OAAM;QAC5C3C,EAAE,UAAAuE,MAAA,CAAU5B,KAAK,CAAE;QACnBpB,MAAM,UAAAgD,MAAA,CAAU5B,KAAK,CAAE;QACvBnB,MAAM,UAAA+C,MAAA,CAAU5B,KAAK,GAAG,CAAC;MAC7B,CAAC;IAAA,CAAC;EACN;AACJ,CAAC;AAED,OAAO,IAAM6B,YAAmB,GAAG;EAC/B3C,IAAI,EAAE;IAACC,KAAK,EAAE/B,SAAS;IAAEgC,KAAK,EAAE,CAAC;MAAC/B,EAAE,EAAE,KAAK;MAAEuB,MAAM,EAAE,QAAQ;MAAEC,MAAM,EAAE;IAAS,CAAC;EAAC;AACtF,CAAC","ignoreList":[]}
@@ -0,0 +1,9 @@
1
+ import type { TMultipointConnection } from '@gravity-ui/graph';
2
+ import type { QueryGraphEdge, QueryGraphNode } from '../../../types/queryGraph';
3
+ export declare function getQueryGraphNodeSize(node: QueryGraphNode): {
4
+ width: number;
5
+ height: number;
6
+ };
7
+ export declare function validateQueryGraph(nodes: QueryGraphNode[], edges: QueryGraphEdge[]): void;
8
+ export declare function createQueryGraphConnections(edges: QueryGraphEdge[], routes?: Record<string | number | symbol, Pick<TMultipointConnection, 'points' | 'labels'>>): TMultipointConnection[];
9
+ export declare function getQueryGraphProgress(node: QueryGraphNode): number;
@@ -0,0 +1,128 @@
1
+ import _objectSpread from "@babel/runtime/helpers/objectSpread2";
2
+ import _createForOfIteratorHelper from "@babel/runtime/helpers/createForOfIteratorHelper";
3
+ import "core-js/modules/es.error.cause.js";
4
+ import "core-js/modules/es.error.to-string.js";
5
+ import "core-js/modules/es.array.filter.js";
6
+ import "core-js/modules/es.array.for-each.js";
7
+ import "core-js/modules/es.array.iterator.js";
8
+ import "core-js/modules/es.array.map.js";
9
+ import "core-js/modules/es.array.push.js";
10
+ import "core-js/modules/es.iterator.constructor.js";
11
+ import "core-js/modules/es.iterator.filter.js";
12
+ import "core-js/modules/es.iterator.for-each.js";
13
+ import "core-js/modules/es.iterator.map.js";
14
+ import "core-js/modules/es.map.js";
15
+ import "core-js/modules/es.object.to-string.js";
16
+ import "core-js/modules/es.set.js";
17
+ import "core-js/modules/es.set.difference.v2.js";
18
+ import "core-js/modules/es.set.intersection.v2.js";
19
+ import "core-js/modules/es.set.is-disjoint-from.v2.js";
20
+ import "core-js/modules/es.set.is-subset-of.v2.js";
21
+ import "core-js/modules/es.set.is-superset-of.v2.js";
22
+ import "core-js/modules/es.set.symmetric-difference.v2.js";
23
+ import "core-js/modules/es.set.union.v2.js";
24
+ import "core-js/modules/es.string.iterator.js";
25
+ import "core-js/modules/esnext.map.get-or-insert.js";
26
+ import "core-js/modules/esnext.map.get-or-insert-computed.js";
27
+ import "core-js/modules/web.dom-collections.for-each.js";
28
+ import "core-js/modules/web.dom-collections.iterator.js";
29
+ var OPERATION_SIZE = 65;
30
+ var RESOURCE_WIDTH = 36;
31
+ var RESOURCE_HEIGHT = 36;
32
+ export function getQueryGraphNodeSize(node) {
33
+ return node.kind === 'operation' ? {
34
+ width: OPERATION_SIZE,
35
+ height: OPERATION_SIZE
36
+ } : {
37
+ width: RESOURCE_WIDTH,
38
+ height: RESOURCE_HEIGHT
39
+ };
40
+ }
41
+ export function validateQueryGraph(nodes, edges) {
42
+ var ids = new Set();
43
+ var _iterator = _createForOfIteratorHelper(nodes),
44
+ _step;
45
+ try {
46
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
47
+ var node = _step.value;
48
+ if (ids.has(node.id)) throw new Error("Duplicate query graph node id: ".concat(node.id));
49
+ ids.add(node.id);
50
+ }
51
+ } catch (err) {
52
+ _iterator.e(err);
53
+ } finally {
54
+ _iterator.f();
55
+ }
56
+ var edgeIds = new Set();
57
+ var _iterator2 = _createForOfIteratorHelper(edges),
58
+ _step2;
59
+ try {
60
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
61
+ var edge = _step2.value;
62
+ if (edgeIds.has(edge.id)) throw new Error("Duplicate query graph edge id: ".concat(edge.id));
63
+ edgeIds.add(edge.id);
64
+ if (!ids.has(edge.source)) throw new Error("Unknown source node: ".concat(edge.source));
65
+ if (!ids.has(edge.target)) throw new Error("Unknown target node: ".concat(edge.target));
66
+ }
67
+ } catch (err) {
68
+ _iterator2.e(err);
69
+ } finally {
70
+ _iterator2.f();
71
+ }
72
+ var incoming = new Map(nodes.map(function (node) {
73
+ return [node.id, 0];
74
+ }));
75
+ var outgoing = new Map(nodes.map(function (node) {
76
+ return [node.id, []];
77
+ }));
78
+ edges.forEach(function (edge) {
79
+ var _incoming$get, _outgoing$get;
80
+ incoming.set(edge.target, ((_incoming$get = incoming.get(edge.target)) !== null && _incoming$get !== void 0 ? _incoming$get : 0) + 1);
81
+ (_outgoing$get = outgoing.get(edge.source)) === null || _outgoing$get === void 0 || _outgoing$get.push(edge.target);
82
+ });
83
+ var queue = nodes.filter(function (node) {
84
+ return incoming.get(node.id) === 0;
85
+ }).map(function (node) {
86
+ return node.id;
87
+ });
88
+ var visited = 0;
89
+ for (var index = 0; index < queue.length; index++) {
90
+ var _outgoing$get2;
91
+ var id = queue[index];
92
+ visited++;
93
+ var _iterator3 = _createForOfIteratorHelper((_outgoing$get2 = outgoing.get(id)) !== null && _outgoing$get2 !== void 0 ? _outgoing$get2 : []),
94
+ _step3;
95
+ try {
96
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
97
+ var _incoming$get2;
98
+ var target = _step3.value;
99
+ var nextIncoming = ((_incoming$get2 = incoming.get(target)) !== null && _incoming$get2 !== void 0 ? _incoming$get2 : 0) - 1;
100
+ incoming.set(target, nextIncoming);
101
+ if (nextIncoming === 0) queue.push(target);
102
+ }
103
+ } catch (err) {
104
+ _iterator3.e(err);
105
+ } finally {
106
+ _iterator3.f();
107
+ }
108
+ }
109
+ if (visited !== nodes.length) throw new Error('Query graph contains a cycle');
110
+ }
111
+ export function createQueryGraphConnections(edges, routes) {
112
+ return edges.map(function (edge) {
113
+ return _objectSpread({
114
+ id: edge.id,
115
+ sourceBlockId: edge.source,
116
+ targetBlockId: edge.target
117
+ }, routes === null || routes === void 0 ? void 0 : routes[edge.id]);
118
+ });
119
+ }
120
+ export function getQueryGraphProgress(node) {
121
+ var _node$progress, _node$progress$total, _node$progress2, _node$progress$comple, _node$progress3;
122
+ var fraction = (_node$progress = node.progress) === null || _node$progress === void 0 ? void 0 : _node$progress.fraction;
123
+ if (typeof fraction === 'number') return Math.min(1, Math.max(0, fraction));
124
+ var total = (_node$progress$total = (_node$progress2 = node.progress) === null || _node$progress2 === void 0 ? void 0 : _node$progress2.total) !== null && _node$progress$total !== void 0 ? _node$progress$total : 0;
125
+ if (total <= 0) return 0;
126
+ return Math.min(1, Math.max(0, ((_node$progress$comple = (_node$progress3 = node.progress) === null || _node$progress3 === void 0 ? void 0 : _node$progress3.completed) !== null && _node$progress$comple !== void 0 ? _node$progress$comple : 0) / total));
127
+ }
128
+ // #sourceMappingURL=layout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["OPERATION_SIZE","RESOURCE_WIDTH","RESOURCE_HEIGHT","getQueryGraphNodeSize","node","kind","width","height","validateQueryGraph","nodes","edges","ids","Set","_iterator","_createForOfIteratorHelper","_step","s","n","done","value","has","id","Error","concat","add","err","e","f","edgeIds","_iterator2","_step2","edge","source","target","incoming","Map","map","outgoing","forEach","_incoming$get","_outgoing$get","set","get","push","queue","filter","visited","index","length","_outgoing$get2","_iterator3","_step3","_incoming$get2","nextIncoming","createQueryGraphConnections","routes","_objectSpread","sourceBlockId","targetBlockId","getQueryGraphProgress","_node$progress","_node$progress$total","_node$progress2","_node$progress$comple","_node$progress3","fraction","progress","Math","min","max","total","completed"],"sources":["layout.ts"],"sourcesContent":["import type {TMultipointConnection} from '@gravity-ui/graph';\n\nimport type {QueryGraphEdge, QueryGraphNode} from '../../../types/queryGraph';\n\nconst OPERATION_SIZE = 65;\nconst RESOURCE_WIDTH = 36;\nconst RESOURCE_HEIGHT = 36;\n\nexport function getQueryGraphNodeSize(node: QueryGraphNode) {\n return node.kind === 'operation'\n ? {width: OPERATION_SIZE, height: OPERATION_SIZE}\n : {width: RESOURCE_WIDTH, height: RESOURCE_HEIGHT};\n}\n\nexport function validateQueryGraph(nodes: QueryGraphNode[], edges: QueryGraphEdge[]) {\n const ids = new Set<string>();\n for (const node of nodes) {\n if (ids.has(node.id)) throw new Error(`Duplicate query graph node id: ${node.id}`);\n ids.add(node.id);\n }\n\n const edgeIds = new Set<string>();\n for (const edge of edges) {\n if (edgeIds.has(edge.id)) throw new Error(`Duplicate query graph edge id: ${edge.id}`);\n edgeIds.add(edge.id);\n if (!ids.has(edge.source)) throw new Error(`Unknown source node: ${edge.source}`);\n if (!ids.has(edge.target)) throw new Error(`Unknown target node: ${edge.target}`);\n }\n\n const incoming = new Map(nodes.map((node) => [node.id, 0]));\n const outgoing = new Map(nodes.map((node) => [node.id, [] as string[]]));\n edges.forEach((edge) => {\n incoming.set(edge.target, (incoming.get(edge.target) ?? 0) + 1);\n outgoing.get(edge.source)?.push(edge.target);\n });\n\n const queue = nodes.filter((node) => incoming.get(node.id) === 0).map((node) => node.id);\n let visited = 0;\n for (let index = 0; index < queue.length; index++) {\n const id = queue[index];\n visited++;\n for (const target of outgoing.get(id) ?? []) {\n const nextIncoming = (incoming.get(target) ?? 0) - 1;\n incoming.set(target, nextIncoming);\n if (nextIncoming === 0) queue.push(target);\n }\n }\n if (visited !== nodes.length) throw new Error('Query graph contains a cycle');\n}\n\nexport function createQueryGraphConnections(\n edges: QueryGraphEdge[],\n routes?: Record<string | number | symbol, Pick<TMultipointConnection, 'points' | 'labels'>>,\n): TMultipointConnection[] {\n return edges.map((edge) => ({\n id: edge.id,\n sourceBlockId: edge.source,\n targetBlockId: edge.target,\n ...routes?.[edge.id],\n }));\n}\n\nexport function getQueryGraphProgress(node: QueryGraphNode) {\n const fraction = node.progress?.fraction;\n if (typeof fraction === 'number') return Math.min(1, Math.max(0, fraction));\n const total = node.progress?.total ?? 0;\n if (total <= 0) return 0;\n return Math.min(1, Math.max(0, (node.progress?.completed ?? 0) / total));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,IAAMA,cAAc,GAAG,EAAE;AACzB,IAAMC,cAAc,GAAG,EAAE;AACzB,IAAMC,eAAe,GAAG,EAAE;AAE1B,OAAO,SAASC,qBAAqBA,CAACC,IAAoB,EAAE;EACxD,OAAOA,IAAI,CAACC,IAAI,KAAK,WAAW,GAC1B;IAACC,KAAK,EAAEN,cAAc;IAAEO,MAAM,EAAEP;EAAc,CAAC,GAC/C;IAACM,KAAK,EAAEL,cAAc;IAAEM,MAAM,EAAEL;EAAe,CAAC;AAC1D;AAEA,OAAO,SAASM,kBAAkBA,CAACC,KAAuB,EAAEC,KAAuB,EAAE;EACjF,IAAMC,GAAG,GAAG,IAAIC,GAAG,CAAS,CAAC;EAAC,IAAAC,SAAA,GAAAC,0BAAA,CACXL,KAAK;IAAAM,KAAA;EAAA;IAAxB,KAAAF,SAAA,CAAAG,CAAA,MAAAD,KAAA,GAAAF,SAAA,CAAAI,CAAA,IAAAC,IAAA,GAA0B;MAAA,IAAfd,IAAI,G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AMC,QAAQ,IAAAL,cAAA,GAAGxD,IAAI,CAAC8D,QAAQ,cAAAN,cAAA,uBAAbA,cAAA,CAAeK,QAAQ;EACxC,IAAI,OAAOA,QAAQ,KAAK,QAAQ,EAAE,OAAOE,IAAI,CAACC,GAAG,CAAC,CAAC,EAAED,IAAI,CAACE,GAAG,CAAC,CAAC,EAAEJ,QAAQ,CAAC,CAAC;EAC3E,IAAMK,KAAK,IAAAT,oBAAA,IAAAC,eAAA,GAAG1D,IAAI,CAAC8D,QAAQ,cAAAJ,eAAA,uBAAbA,eAAA,CAAeQ,KAAK,cAAAT,oBAAA,cAAAA,oBAAA,GAAI,CAAC;EACvC,IAAIS,KAAK,IAAI,CAAC,EAAE,OAAO,CAAC;EACxB,OAAOH,IAAI,CAACC,GAAG,CAAC,CAAC,EAAED,IAAI,CAACE,GAAG,CAAC,CAAC,EAAE,EAAAN,qBAAA,IAAAC,eAAA,GAAC5D,IAAI,CAAC8D,QAAQ,cAAAF,eAAA,uBAAbA,eAAA,CAAeO,SAAS,cAAAR,qBAAA,cAAAA,qBAAA,GAAI,CAAC,IAAIO,KAAK,CAAC,CAAC;AAC5E","ignoreList":[]}
@@ -0,0 +1,18 @@
1
+ import type { QueryGraphNode } from '../../../types/queryGraph';
2
+ export declare function getQueryGraphNodeContent(node: QueryGraphNode): {
3
+ readonly kind: "icon";
4
+ readonly value?: undefined;
5
+ } | {
6
+ readonly kind: "counter";
7
+ readonly value: string;
8
+ } | {
9
+ readonly kind: "empty";
10
+ readonly value?: undefined;
11
+ };
12
+ export declare function getScaleAdjustedFontSize(fontSize: number, cameraScale: number): number;
13
+ export declare function fitCanvasFontSize(fontSize: number, measuredWidth: number, maxWidth: number): number;
14
+ export declare function fitCanvasText(context: {
15
+ measureText: (text: string) => {
16
+ width: number;
17
+ };
18
+ }, text: string, maxWidth: number, trimStart: boolean): string;
@@ -0,0 +1,35 @@
1
+ import "core-js/modules/es.array.slice.js";
2
+ export function getQueryGraphNodeContent(node) {
3
+ var _node$status, _node$progress;
4
+ var status = (_node$status = node.status) !== null && _node$status !== void 0 ? _node$status : 'not-started';
5
+ if (status === 'not-started') return {
6
+ kind: 'icon'
7
+ };
8
+ var total = (_node$progress = node.progress) === null || _node$progress === void 0 ? void 0 : _node$progress.total;
9
+ return typeof total === 'number' && total > 0 ? {
10
+ kind: 'counter',
11
+ value: String(total)
12
+ } : {
13
+ kind: 'empty'
14
+ };
15
+ }
16
+ export function getScaleAdjustedFontSize(fontSize, cameraScale) {
17
+ return cameraScale > 0 ? fontSize / cameraScale : fontSize;
18
+ }
19
+ export function fitCanvasFontSize(fontSize, measuredWidth, maxWidth) {
20
+ if (measuredWidth <= 0 || measuredWidth <= maxWidth) return fontSize;
21
+ return fontSize * (maxWidth / measuredWidth);
22
+ }
23
+ export function fitCanvasText(context, text, maxWidth, trimStart) {
24
+ if (context.measureText(text).width <= maxWidth) return text;
25
+ var ellipsis = '…';
26
+ var low = 0;
27
+ var high = text.length;
28
+ while (low < high) {
29
+ var length = Math.ceil((low + high) / 2);
30
+ var candidate = trimStart ? ellipsis + text.slice(text.length - length) : text.slice(0, length) + ellipsis;
31
+ if (context.measureText(candidate).width <= maxWidth) low = length;else high = length - 1;
32
+ }
33
+ return trimStart ? ellipsis + text.slice(text.length - low) : text.slice(0, low) + ellipsis;
34
+ }
35
+ // #sourceMappingURL=presentation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["getQueryGraphNodeContent","node","_node$status","_node$progress","status","kind","total","progress","value","String","getScaleAdjustedFontSize","fontSize","cameraScale","fitCanvasFontSize","measuredWidth","maxWidth","fitCanvasText","context","text","trimStart","measureText","width","ellipsis","low","high","length","Math","ceil","candidate","slice"],"sources":["presentation.ts"],"sourcesContent":["import type {QueryGraphNode} from '../../../types/queryGraph';\n\nexport function getQueryGraphNodeContent(node: QueryGraphNode) {\n const status = node.status ?? 'not-started';\n if (status === 'not-started') return {kind: 'icon'} as const;\n const total = node.progress?.total;\n return typeof total === 'number' && total > 0\n ? ({kind: 'counter', value: String(total)} as const)\n : ({kind: 'empty'} as const);\n}\n\nexport function getScaleAdjustedFontSize(fontSize: number, cameraScale: number) {\n return cameraScale > 0 ? fontSize / cameraScale : fontSize;\n}\n\nexport function fitCanvasFontSize(fontSize: number, measuredWidth: number, maxWidth: number) {\n if (measuredWidth <= 0 || measuredWidth <= maxWidth) return fontSize;\n return fontSize * (maxWidth / measuredWidth);\n}\n\nexport function fitCanvasText(\n context: {measureText: (text: string) => {width: number}},\n text: string,\n maxWidth: number,\n trimStart: boolean,\n) {\n if (context.measureText(text).width <= maxWidth) return text;\n const ellipsis = '…';\n let low = 0;\n let high = text.length;\n while (low < high) {\n const length = Math.ceil((low + high) / 2);\n const candidate = trimStart\n ? ellipsis + text.slice(text.length - length)\n : text.slice(0, length) + ellipsis;\n if (context.measureText(candidate).width <= maxWidth) low = length;\n else high = length - 1;\n }\n return trimStart ? ellipsis + text.slice(text.length - low) : text.slice(0, low) + ellipsis;\n}\n"],"mappings":";AAEA,OAAO,SAASA,wBAAwBA,CAACC,IAAoB,EAAE;EAAA,IAAAC,YAAA,EAAAC,cAAA;EAC3D,IAAMC,MAAM,IAAAF,YAAA,GAAGD,IAAI,CAACG,MAAM,cAAAF,YAAA,cAAAA,YAAA,GAAI,aAAa;EAC3C,IAAIE,MAAM,KAAK,aAAa,EAAE,OAAO;IAACC,IAAI,EAAE;EAAM,CAAC;EACnD,IAAMC,KAAK,IAAAH,cAAA,GAAGF,IAAI,CAACM,QAAQ,cAAAJ,cAAA,uBAAbA,cAAA,CAAeG,KAAK;EAClC,OAAO,OAAOA,KAAK,KAAK,QAAQ,IAAIA,KAAK,GAAG,CAAC,GACtC;IAACD,IAAI,EAAE,SAAS;IAAEG,KAAK,EAAEC,MAAM,CAACH,KAAK;EAAC,CAAC,GACvC;IAACD,IAAI,EAAE;EAAO,CAAW;AACpC;AAEA,OAAO,SAASK,wBAAwBA,CAACC,QAAgB,EAAEC,WAAmB,EAAE;EAC5E,OAAOA,W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oreList":[]}
@@ -0,0 +1,55 @@
1
+ declare const _default: {
2
+ en: {
3
+ action_fit: string;
4
+ "action_zoom-in": string;
5
+ "action_zoom-out": string;
6
+ "action_show-graph": string;
7
+ "context_large-graph": string;
8
+ context_empty: string;
9
+ value_stages: string;
10
+ value_details: string;
11
+ value_jobs: string;
12
+ value_schemas: string;
13
+ field_stage: string;
14
+ field_duration: string;
15
+ field_status: string;
16
+ field_count: string;
17
+ field_name: string;
18
+ field_type: string;
19
+ value_total: string;
20
+ value_inputs: string;
21
+ value_outputs: string;
22
+ status_pending: string;
23
+ status_running: string;
24
+ status_completed: string;
25
+ status_failed: string;
26
+ status_aborted: string;
27
+ };
28
+ ru: {
29
+ action_fit: string;
30
+ "action_zoom-in": string;
31
+ "action_zoom-out": string;
32
+ "action_show-graph": string;
33
+ "context_large-graph": string;
34
+ context_empty: string;
35
+ value_stages: string;
36
+ value_details: string;
37
+ value_jobs: string;
38
+ value_schemas: string;
39
+ field_stage: string;
40
+ field_duration: string;
41
+ field_status: string;
42
+ field_count: string;
43
+ field_name: string;
44
+ field_type: string;
45
+ value_total: string;
46
+ value_inputs: string;
47
+ value_outputs: string;
48
+ status_pending: string;
49
+ status_running: string;
50
+ status_completed: string;
51
+ status_failed: string;
52
+ status_aborted: string;
53
+ };
54
+ };
55
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import en from "./en.json";
2
+ import ru from "./ru.json";
3
+ export default {
4
+ en: en,
5
+ ru: ru
6
+ };
7
+ // #sourceMappingURL=dicts.js.map