@flanksource/clicky-ui 0.3.78 → 0.3.80

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 (775) hide show
  1. package/dist/ai.cjs +2 -2
  2. package/dist/ai.js +2 -2
  3. package/dist/comments/CommentThreadList.cjs +13 -14
  4. package/dist/comments/CommentThreadList.cjs.map +1 -1
  5. package/dist/comments/CommentThreadList.d.ts.map +1 -1
  6. package/dist/comments/CommentThreadList.js +13 -14
  7. package/dist/comments/CommentThreadList.js.map +1 -1
  8. package/dist/components/Combobox.cjs +9 -3
  9. package/dist/components/Combobox.cjs.map +1 -1
  10. package/dist/components/Combobox.d.ts.map +1 -1
  11. package/dist/components/Combobox.js +9 -3
  12. package/dist/components/Combobox.js.map +1 -1
  13. package/dist/components/ComboboxMenu.cjs +1 -1
  14. package/dist/components/ComboboxMenu.cjs.map +1 -1
  15. package/dist/components/ComboboxMenu.js +1 -1
  16. package/dist/components/ComboboxMenu.js.map +1 -1
  17. package/dist/components/EndpointSelector.cjs +7 -1
  18. package/dist/components/EndpointSelector.cjs.map +1 -1
  19. package/dist/components/EndpointSelector.d.ts.map +1 -1
  20. package/dist/components/EndpointSelector.js +7 -1
  21. package/dist/components/EndpointSelector.js.map +1 -1
  22. package/dist/components/FilterBar.cjs +36 -12
  23. package/dist/components/FilterBar.cjs.map +1 -1
  24. package/dist/components/FilterBar.d.ts +14 -2
  25. package/dist/components/FilterBar.d.ts.map +1 -1
  26. package/dist/components/FilterBar.js +36 -12
  27. package/dist/components/FilterBar.js.map +1 -1
  28. package/dist/components/FormLookupProvider.cjs +12 -4
  29. package/dist/components/FormLookupProvider.cjs.map +1 -1
  30. package/dist/components/FormLookupProvider.d.ts.map +1 -1
  31. package/dist/components/FormLookupProvider.js +13 -5
  32. package/dist/components/FormLookupProvider.js.map +1 -1
  33. package/dist/components/JSONPathPlayground.cjs +124 -233
  34. package/dist/components/JSONPathPlayground.cjs.map +1 -1
  35. package/dist/components/JSONPathPlayground.d.ts +15 -13
  36. package/dist/components/JSONPathPlayground.d.ts.map +1 -1
  37. package/dist/components/JSONPathPlayground.js +125 -234
  38. package/dist/components/JSONPathPlayground.js.map +1 -1
  39. package/dist/components/JsonSchemaForm.cjs +6 -0
  40. package/dist/components/JsonSchemaForm.cjs.map +1 -1
  41. package/dist/components/JsonSchemaForm.js +6 -0
  42. package/dist/components/JsonSchemaForm.js.map +1 -1
  43. package/dist/components/SegmentedControl.cjs +1 -1
  44. package/dist/components/SegmentedControl.cjs.map +1 -1
  45. package/dist/components/SegmentedControl.d.ts.map +1 -1
  46. package/dist/components/SegmentedControl.js +1 -1
  47. package/dist/components/SegmentedControl.js.map +1 -1
  48. package/dist/components/TimeRange.cjs +133 -60
  49. package/dist/components/TimeRange.cjs.map +1 -1
  50. package/dist/components/TimeRange.d.ts +8 -1
  51. package/dist/components/TimeRange.d.ts.map +1 -1
  52. package/dist/components/TimeRange.js +133 -60
  53. package/dist/components/TimeRange.js.map +1 -1
  54. package/dist/components/json-schema-form-accordion-array.cjs +8 -6
  55. package/dist/components/json-schema-form-accordion-array.cjs.map +1 -1
  56. package/dist/components/json-schema-form-accordion-array.d.ts.map +1 -1
  57. package/dist/components/json-schema-form-accordion-array.js +9 -7
  58. package/dist/components/json-schema-form-accordion-array.js.map +1 -1
  59. package/dist/components/json-schema-form-array-rows.cjs +45 -0
  60. package/dist/components/json-schema-form-array-rows.cjs.map +1 -0
  61. package/dist/components/json-schema-form-array-rows.d.ts +10 -0
  62. package/dist/components/json-schema-form-array-rows.d.ts.map +1 -0
  63. package/dist/components/json-schema-form-array-rows.js +45 -0
  64. package/dist/components/json-schema-form-array-rows.js.map +1 -0
  65. package/dist/components/json-schema-form-item-summary.cjs +3 -5
  66. package/dist/components/json-schema-form-item-summary.cjs.map +1 -1
  67. package/dist/components/json-schema-form-item-summary.d.ts +1 -1
  68. package/dist/components/json-schema-form-item-summary.d.ts.map +1 -1
  69. package/dist/components/json-schema-form-item-summary.js +3 -5
  70. package/dist/components/json-schema-form-item-summary.js.map +1 -1
  71. package/dist/components/json-schema-form-render.cjs +11 -2
  72. package/dist/components/json-schema-form-render.cjs.map +1 -1
  73. package/dist/components/json-schema-form-render.d.ts.map +1 -1
  74. package/dist/components/json-schema-form-render.js +12 -3
  75. package/dist/components/json-schema-form-render.js.map +1 -1
  76. package/dist/components/json-schema-form-resolve.cjs +10 -0
  77. package/dist/components/json-schema-form-resolve.cjs.map +1 -1
  78. package/dist/components/json-schema-form-resolve.d.ts +1 -0
  79. package/dist/components/json-schema-form-resolve.d.ts.map +1 -1
  80. package/dist/components/json-schema-form-resolve.js +10 -1
  81. package/dist/components/json-schema-form-resolve.js.map +1 -1
  82. package/dist/components/json-schema-form-runtime-types.d.ts +4 -0
  83. package/dist/components/json-schema-form-runtime-types.d.ts.map +1 -1
  84. package/dist/components/json-schema-form-table-array.cjs +25 -16
  85. package/dist/components/json-schema-form-table-array.cjs.map +1 -1
  86. package/dist/components/json-schema-form-table-array.d.ts +1 -1
  87. package/dist/components/json-schema-form-table-array.d.ts.map +1 -1
  88. package/dist/components/json-schema-form-table-array.js +26 -17
  89. package/dist/components/json-schema-form-table-array.js.map +1 -1
  90. package/dist/components/json-schema-form-types.d.ts +0 -2
  91. package/dist/components/json-schema-form-types.d.ts.map +1 -1
  92. package/dist/components/jsonPathPlaygroundEvaluator.cjs +53 -0
  93. package/dist/components/jsonPathPlaygroundEvaluator.cjs.map +1 -0
  94. package/dist/components/jsonPathPlaygroundEvaluator.d.ts +23 -0
  95. package/dist/components/jsonPathPlaygroundEvaluator.d.ts.map +1 -0
  96. package/dist/components/jsonPathPlaygroundEvaluator.js +53 -0
  97. package/dist/components/jsonPathPlaygroundEvaluator.js.map +1 -0
  98. package/dist/components/jsonPathTree.cjs +1 -0
  99. package/dist/components/jsonPathTree.cjs.map +1 -1
  100. package/dist/components/jsonPathTree.d.ts +6 -0
  101. package/dist/components/jsonPathTree.d.ts.map +1 -1
  102. package/dist/components/jsonPathTree.js +1 -0
  103. package/dist/components/jsonPathTree.js.map +1 -1
  104. package/dist/data/Clicky.cjs +37 -18
  105. package/dist/data/Clicky.cjs.map +1 -1
  106. package/dist/data/Clicky.d.ts +5 -0
  107. package/dist/data/Clicky.d.ts.map +1 -1
  108. package/dist/data/Clicky.js +37 -18
  109. package/dist/data/Clicky.js.map +1 -1
  110. package/dist/data/DataTable.cjs +49 -12
  111. package/dist/data/DataTable.cjs.map +1 -1
  112. package/dist/data/DataTable.d.ts +17 -2
  113. package/dist/data/DataTable.d.ts.map +1 -1
  114. package/dist/data/DataTable.js +49 -12
  115. package/dist/data/DataTable.js.map +1 -1
  116. package/dist/data/TaskPoolUsage.cjs +2 -1
  117. package/dist/data/TaskPoolUsage.cjs.map +1 -1
  118. package/dist/data/TaskPoolUsage.d.ts.map +1 -1
  119. package/dist/data/TaskPoolUsage.js +2 -1
  120. package/dist/data/TaskPoolUsage.js.map +1 -1
  121. package/dist/data/TimeseriesPanel.axes.cjs +18 -3
  122. package/dist/data/TimeseriesPanel.axes.cjs.map +1 -1
  123. package/dist/data/TimeseriesPanel.axes.d.ts +10 -1
  124. package/dist/data/TimeseriesPanel.axes.d.ts.map +1 -1
  125. package/dist/data/TimeseriesPanel.axes.js +17 -4
  126. package/dist/data/TimeseriesPanel.axes.js.map +1 -1
  127. package/dist/data/TimeseriesPanel.cjs +57 -23
  128. package/dist/data/TimeseriesPanel.cjs.map +1 -1
  129. package/dist/data/TimeseriesPanel.d.ts.map +1 -1
  130. package/dist/data/TimeseriesPanel.js +59 -25
  131. package/dist/data/TimeseriesPanel.js.map +1 -1
  132. package/dist/data/TimeseriesPanel.model.cjs +10 -7
  133. package/dist/data/TimeseriesPanel.model.cjs.map +1 -1
  134. package/dist/data/TimeseriesPanel.model.d.ts +7 -4
  135. package/dist/data/TimeseriesPanel.model.d.ts.map +1 -1
  136. package/dist/data/TimeseriesPanel.model.js +11 -8
  137. package/dist/data/TimeseriesPanel.model.js.map +1 -1
  138. package/dist/data/TimeseriesPanel.readout.cjs +11 -0
  139. package/dist/data/TimeseriesPanel.readout.cjs.map +1 -0
  140. package/dist/data/TimeseriesPanel.readout.d.ts +4 -0
  141. package/dist/data/TimeseriesPanel.readout.d.ts.map +1 -0
  142. package/dist/data/TimeseriesPanel.readout.js +10 -0
  143. package/dist/data/TimeseriesPanel.readout.js.map +1 -0
  144. package/dist/data/TimeseriesPanel.segments.cjs +67 -0
  145. package/dist/data/TimeseriesPanel.segments.cjs.map +1 -0
  146. package/dist/data/TimeseriesPanel.segments.d.ts +27 -0
  147. package/dist/data/TimeseriesPanel.segments.d.ts.map +1 -0
  148. package/dist/data/TimeseriesPanel.segments.js +67 -0
  149. package/dist/data/TimeseriesPanel.segments.js.map +1 -0
  150. package/dist/data/TreeDataTable.cjs +12 -3
  151. package/dist/data/TreeDataTable.cjs.map +1 -1
  152. package/dist/data/TreeDataTable.d.ts +15 -3
  153. package/dist/data/TreeDataTable.d.ts.map +1 -1
  154. package/dist/data/TreeDataTable.js +12 -3
  155. package/dist/data/TreeDataTable.js.map +1 -1
  156. package/dist/data/TreeNode.cjs +18 -3
  157. package/dist/data/TreeNode.cjs.map +1 -1
  158. package/dist/data/TreeNode.d.ts +7 -1
  159. package/dist/data/TreeNode.d.ts.map +1 -1
  160. package/dist/data/TreeNode.js +18 -3
  161. package/dist/data/TreeNode.js.map +1 -1
  162. package/dist/data/ai/SessionChatComposer.cjs +2 -0
  163. package/dist/data/ai/SessionChatComposer.cjs.map +1 -1
  164. package/dist/data/ai/SessionChatComposer.d.ts.map +1 -1
  165. package/dist/data/ai/SessionChatComposer.js +2 -0
  166. package/dist/data/ai/SessionChatComposer.js.map +1 -1
  167. package/dist/data/ai/SessionInspector.panels.cjs +47 -1
  168. package/dist/data/ai/SessionInspector.panels.cjs.map +1 -1
  169. package/dist/data/ai/SessionInspector.panels.d.ts.map +1 -1
  170. package/dist/data/ai/SessionInspector.panels.js +48 -2
  171. package/dist/data/ai/SessionInspector.panels.js.map +1 -1
  172. package/dist/data/ai/SessionViewer.unified.d.ts +48 -0
  173. package/dist/data/ai/SessionViewer.unified.d.ts.map +1 -1
  174. package/dist/data/ai/index.d.ts +2 -2
  175. package/dist/data/ai/index.d.ts.map +1 -1
  176. package/dist/data/ai/runtime-profiles/PresetWorkspace.cjs +97 -100
  177. package/dist/data/ai/runtime-profiles/PresetWorkspace.cjs.map +1 -1
  178. package/dist/data/ai/runtime-profiles/PresetWorkspace.d.ts.map +1 -1
  179. package/dist/data/ai/runtime-profiles/PresetWorkspace.js +97 -100
  180. package/dist/data/ai/runtime-profiles/PresetWorkspace.js.map +1 -1
  181. package/dist/data/ai/runtime-profiles/ProfileWorkspace.cjs +40 -38
  182. package/dist/data/ai/runtime-profiles/ProfileWorkspace.cjs.map +1 -1
  183. package/dist/data/ai/runtime-profiles/ProfileWorkspace.d.ts.map +1 -1
  184. package/dist/data/ai/runtime-profiles/ProfileWorkspace.js +41 -39
  185. package/dist/data/ai/runtime-profiles/ProfileWorkspace.js.map +1 -1
  186. package/dist/data/ai/runtime-profiles/ResolutionPreview.cjs +53 -0
  187. package/dist/data/ai/runtime-profiles/ResolutionPreview.cjs.map +1 -0
  188. package/dist/data/ai/runtime-profiles/ResolutionPreview.d.ts +7 -0
  189. package/dist/data/ai/runtime-profiles/ResolutionPreview.d.ts.map +1 -0
  190. package/dist/data/ai/runtime-profiles/ResolutionPreview.js +53 -0
  191. package/dist/data/ai/runtime-profiles/ResolutionPreview.js.map +1 -0
  192. package/dist/data/ai/runtime-profiles/index.d.ts +1 -1
  193. package/dist/data/ai/runtime-profiles/index.d.ts.map +1 -1
  194. package/dist/data/ai/sessionSubmitVariant.cjs +30 -0
  195. package/dist/data/ai/sessionSubmitVariant.cjs.map +1 -0
  196. package/dist/data/ai/sessionSubmitVariant.d.ts +7 -0
  197. package/dist/data/ai/sessionSubmitVariant.d.ts.map +1 -0
  198. package/dist/data/ai/sessionSubmitVariant.js +30 -0
  199. package/dist/data/ai/sessionSubmitVariant.js.map +1 -0
  200. package/dist/data/cells/Timestamp.cjs +15 -4
  201. package/dist/data/cells/Timestamp.cjs.map +1 -1
  202. package/dist/data/cells/Timestamp.d.ts.map +1 -1
  203. package/dist/data/cells/Timestamp.js +15 -4
  204. package/dist/data/cells/Timestamp.js.map +1 -1
  205. package/dist/data/cells/timestamp-format.cjs +28 -8
  206. package/dist/data/cells/timestamp-format.cjs.map +1 -1
  207. package/dist/data/cells/timestamp-format.d.ts +3 -1
  208. package/dist/data/cells/timestamp-format.d.ts.map +1 -1
  209. package/dist/data/cells/timestamp-format.js +28 -8
  210. package/dist/data/cells/timestamp-format.js.map +1 -1
  211. package/dist/data/charts/TrendChart.cjs +65 -31
  212. package/dist/data/charts/TrendChart.cjs.map +1 -1
  213. package/dist/data/charts/TrendChart.d.ts +12 -3
  214. package/dist/data/charts/TrendChart.d.ts.map +1 -1
  215. package/dist/data/charts/TrendChart.js +67 -33
  216. package/dist/data/charts/TrendChart.js.map +1 -1
  217. package/dist/data/charts/index.d.ts +1 -1
  218. package/dist/data/charts/index.d.ts.map +1 -1
  219. package/dist/data/chat/PromptInput.cjs +11 -2
  220. package/dist/data/chat/PromptInput.cjs.map +1 -1
  221. package/dist/data/chat/PromptInput.d.ts +15 -1
  222. package/dist/data/chat/PromptInput.d.ts.map +1 -1
  223. package/dist/data/chat/PromptInput.js +11 -2
  224. package/dist/data/chat/PromptInput.js.map +1 -1
  225. package/dist/data/chat/index.d.ts +1 -1
  226. package/dist/data/chat/index.d.ts.map +1 -1
  227. package/dist/data/data-table-filter-values.cjs.map +1 -1
  228. package/dist/data/data-table-filter-values.d.ts +1 -1
  229. package/dist/data/data-table-filter-values.d.ts.map +1 -1
  230. package/dist/data/data-table-filter-values.js.map +1 -1
  231. package/dist/data/data-table-server-filters.cjs +2 -6
  232. package/dist/data/data-table-server-filters.cjs.map +1 -1
  233. package/dist/data/data-table-server-filters.d.ts +1 -1
  234. package/dist/data/data-table-server-filters.d.ts.map +1 -1
  235. package/dist/data/data-table-server-filters.js +1 -5
  236. package/dist/data/data-table-server-filters.js.map +1 -1
  237. package/dist/data/diagnostics/ErrorDetails.cjs +2 -1
  238. package/dist/data/diagnostics/ErrorDetails.cjs.map +1 -1
  239. package/dist/data/diagnostics/ErrorDetails.d.ts +2 -1
  240. package/dist/data/diagnostics/ErrorDetails.d.ts.map +1 -1
  241. package/dist/data/diagnostics/ErrorDetails.js +2 -1
  242. package/dist/data/diagnostics/ErrorDetails.js.map +1 -1
  243. package/dist/data/gauge-stats.cjs +7 -3
  244. package/dist/data/gauge-stats.cjs.map +1 -1
  245. package/dist/data/gauge-stats.d.ts.map +1 -1
  246. package/dist/data/gauge-stats.js +7 -3
  247. package/dist/data/gauge-stats.js.map +1 -1
  248. package/dist/data/query-browser/QueryBrowser.cjs +41 -17
  249. package/dist/data/query-browser/QueryBrowser.cjs.map +1 -1
  250. package/dist/data/query-browser/QueryBrowser.d.ts +1 -1
  251. package/dist/data/query-browser/QueryBrowser.d.ts.map +1 -1
  252. package/dist/data/query-browser/QueryBrowser.fieldNames.cjs +23 -0
  253. package/dist/data/query-browser/QueryBrowser.fieldNames.cjs.map +1 -0
  254. package/dist/data/query-browser/QueryBrowser.fieldNames.d.ts +11 -0
  255. package/dist/data/query-browser/QueryBrowser.fieldNames.d.ts.map +1 -0
  256. package/dist/data/query-browser/QueryBrowser.fieldNames.js +23 -0
  257. package/dist/data/query-browser/QueryBrowser.fieldNames.js.map +1 -0
  258. package/dist/data/query-browser/QueryBrowser.js +41 -17
  259. package/dist/data/query-browser/QueryBrowser.js.map +1 -1
  260. package/dist/data/query-browser/QueryBrowser.types.cjs.map +1 -1
  261. package/dist/data/query-browser/QueryBrowser.types.d.ts +18 -0
  262. package/dist/data/query-browser/QueryBrowser.types.d.ts.map +1 -1
  263. package/dist/data/query-browser/QueryBrowser.types.js.map +1 -1
  264. package/dist/data/runtime/RuntimeBarLayout.cjs +3 -2
  265. package/dist/data/runtime/RuntimeBarLayout.cjs.map +1 -1
  266. package/dist/data/runtime/RuntimeBarLayout.d.ts.map +1 -1
  267. package/dist/data/runtime/RuntimeBarLayout.js +3 -2
  268. package/dist/data/runtime/RuntimeBarLayout.js.map +1 -1
  269. package/dist/data/test-runner/TestRunner.cjs +3 -1
  270. package/dist/data/test-runner/TestRunner.cjs.map +1 -1
  271. package/dist/data/test-runner/TestRunner.d.ts +8 -1
  272. package/dist/data/test-runner/TestRunner.d.ts.map +1 -1
  273. package/dist/data/test-runner/TestRunner.js +3 -1
  274. package/dist/data/test-runner/TestRunner.js.map +1 -1
  275. package/dist/data/test-runner/TestTree.cjs +1 -0
  276. package/dist/data/test-runner/TestTree.cjs.map +1 -1
  277. package/dist/data/test-runner/TestTree.d.ts.map +1 -1
  278. package/dist/data/test-runner/TestTree.js +1 -0
  279. package/dist/data/test-runner/TestTree.js.map +1 -1
  280. package/dist/data/test-runner/context.cjs.map +1 -1
  281. package/dist/data/test-runner/context.d.ts +2 -0
  282. package/dist/data/test-runner/context.d.ts.map +1 -1
  283. package/dist/data/test-runner/context.js.map +1 -1
  284. package/dist/data/timeseries-query.cjs +2 -2
  285. package/dist/data/timeseries-query.cjs.map +1 -1
  286. package/dist/data/timeseries-query.d.ts +1 -1
  287. package/dist/data/timeseries-query.d.ts.map +1 -1
  288. package/dist/data/timeseries-query.js +2 -2
  289. package/dist/data/timeseries-query.js.map +1 -1
  290. package/dist/data/traces/otel/OtelTraceBrowser.cjs +18 -9
  291. package/dist/data/traces/otel/OtelTraceBrowser.cjs.map +1 -1
  292. package/dist/data/traces/otel/OtelTraceBrowser.d.ts.map +1 -1
  293. package/dist/data/traces/otel/OtelTraceBrowser.js +19 -10
  294. package/dist/data/traces/otel/OtelTraceBrowser.js.map +1 -1
  295. package/dist/data/traces/otel/OtelTraceTable.cjs +10 -8
  296. package/dist/data/traces/otel/OtelTraceTable.cjs.map +1 -1
  297. package/dist/data/traces/otel/OtelTraceTable.d.ts.map +1 -1
  298. package/dist/data/traces/otel/OtelTraceTable.js +10 -8
  299. package/dist/data/traces/otel/OtelTraceTable.js.map +1 -1
  300. package/dist/data/traces/otel/QueryBar.cjs +6 -5
  301. package/dist/data/traces/otel/QueryBar.cjs.map +1 -1
  302. package/dist/data/traces/otel/QueryBar.d.ts.map +1 -1
  303. package/dist/data/traces/otel/QueryBar.js +6 -5
  304. package/dist/data/traces/otel/QueryBar.js.map +1 -1
  305. package/dist/data/traces/otel/browser-state.cjs +17 -4
  306. package/dist/data/traces/otel/browser-state.cjs.map +1 -1
  307. package/dist/data/traces/otel/browser-state.d.ts +2 -1
  308. package/dist/data/traces/otel/browser-state.d.ts.map +1 -1
  309. package/dist/data/traces/otel/browser-state.js +17 -4
  310. package/dist/data/traces/otel/browser-state.js.map +1 -1
  311. package/dist/data/version-info.cjs +3 -3
  312. package/dist/data/version-info.js +3 -3
  313. package/dist/data.cjs +1 -0
  314. package/dist/data.d.ts +1 -1
  315. package/dist/data.d.ts.map +1 -1
  316. package/dist/data.js +2 -2
  317. package/dist/expressions/playground/EmbeddedPlayground.cjs +40 -0
  318. package/dist/expressions/playground/EmbeddedPlayground.cjs.map +1 -0
  319. package/dist/expressions/playground/EmbeddedPlayground.d.ts +30 -0
  320. package/dist/expressions/playground/EmbeddedPlayground.d.ts.map +1 -0
  321. package/dist/expressions/playground/EmbeddedPlayground.js +40 -0
  322. package/dist/expressions/playground/EmbeddedPlayground.js.map +1 -0
  323. package/dist/expressions/playground/ExpressionPlayground.cjs +6 -6
  324. package/dist/expressions/playground/ExpressionPlayground.cjs.map +1 -1
  325. package/dist/expressions/playground/ExpressionPlayground.d.ts +10 -3
  326. package/dist/expressions/playground/ExpressionPlayground.d.ts.map +1 -1
  327. package/dist/expressions/playground/ExpressionPlayground.js +6 -6
  328. package/dist/expressions/playground/ExpressionPlayground.js.map +1 -1
  329. package/dist/expressions/playground/LazyEmbeddedPlayground.cjs +22 -0
  330. package/dist/expressions/playground/LazyEmbeddedPlayground.cjs.map +1 -0
  331. package/dist/expressions/playground/LazyEmbeddedPlayground.d.ts +4 -0
  332. package/dist/expressions/playground/LazyEmbeddedPlayground.d.ts.map +1 -0
  333. package/dist/expressions/playground/LazyEmbeddedPlayground.js +22 -0
  334. package/dist/expressions/playground/LazyEmbeddedPlayground.js.map +1 -0
  335. package/dist/expressions/playground/api.cjs.map +1 -1
  336. package/dist/expressions/playground/api.d.ts +10 -0
  337. package/dist/expressions/playground/api.d.ts.map +1 -1
  338. package/dist/expressions/playground/api.js.map +1 -1
  339. package/dist/expressions/playground/hostEvaluation.cjs +67 -0
  340. package/dist/expressions/playground/hostEvaluation.cjs.map +1 -0
  341. package/dist/expressions/playground/hostEvaluation.d.ts +39 -0
  342. package/dist/expressions/playground/hostEvaluation.d.ts.map +1 -0
  343. package/dist/expressions/playground/hostEvaluation.js +63 -0
  344. package/dist/expressions/playground/hostEvaluation.js.map +1 -0
  345. package/dist/expressions/playground/panels/GraphPanel.cjs +8 -3
  346. package/dist/expressions/playground/panels/GraphPanel.cjs.map +1 -1
  347. package/dist/expressions/playground/panels/GraphPanel.d.ts +2 -1
  348. package/dist/expressions/playground/panels/GraphPanel.d.ts.map +1 -1
  349. package/dist/expressions/playground/panels/GraphPanel.js +8 -3
  350. package/dist/expressions/playground/panels/GraphPanel.js.map +1 -1
  351. package/dist/expressions/playground/panels/graphNodes.cjs +6 -2
  352. package/dist/expressions/playground/panels/graphNodes.cjs.map +1 -1
  353. package/dist/expressions/playground/panels/graphNodes.d.ts +6 -2
  354. package/dist/expressions/playground/panels/graphNodes.d.ts.map +1 -1
  355. package/dist/expressions/playground/panels/graphNodes.js +6 -2
  356. package/dist/expressions/playground/panels/graphNodes.js.map +1 -1
  357. package/dist/expressions/playground.d.ts +1 -1
  358. package/dist/expressions/playground.d.ts.map +1 -1
  359. package/dist/hooks/use-element-height.cjs +26 -0
  360. package/dist/hooks/use-element-height.cjs.map +1 -0
  361. package/dist/hooks/use-element-height.d.ts +10 -0
  362. package/dist/hooks/use-element-height.d.ts.map +1 -0
  363. package/dist/hooks/use-element-height.js +26 -0
  364. package/dist/hooks/use-element-height.js.map +1 -0
  365. package/dist/index.cjs +6 -5
  366. package/dist/index.js +7 -7
  367. package/dist/jvm/classes/PatchedClassList.cjs +11 -2
  368. package/dist/jvm/classes/PatchedClassList.cjs.map +1 -1
  369. package/dist/jvm/classes/PatchedClassList.d.ts.map +1 -1
  370. package/dist/jvm/classes/PatchedClassList.js +11 -2
  371. package/dist/jvm/classes/PatchedClassList.js.map +1 -1
  372. package/dist/jvm/fixtures/fake-client.d.ts.map +1 -1
  373. package/dist/jvm/model/patches.cjs +4 -2
  374. package/dist/jvm/model/patches.cjs.map +1 -1
  375. package/dist/jvm/model/patches.d.ts +3 -1
  376. package/dist/jvm/model/patches.d.ts.map +1 -1
  377. package/dist/jvm/model/patches.js +4 -2
  378. package/dist/jvm/model/patches.js.map +1 -1
  379. package/dist/jvm/protocol/client.d.ts +7 -2
  380. package/dist/jvm/protocol/client.d.ts.map +1 -1
  381. package/dist/jvm/protocol/operation-client.cjs +30 -11
  382. package/dist/jvm/protocol/operation-client.cjs.map +1 -1
  383. package/dist/jvm/protocol/operation-client.d.ts.map +1 -1
  384. package/dist/jvm/protocol/operation-client.js +30 -11
  385. package/dist/jvm/protocol/operation-client.js.map +1 -1
  386. package/dist/jvm/protocol/query-keys.cjs +1 -1
  387. package/dist/jvm/protocol/query-keys.cjs.map +1 -1
  388. package/dist/jvm/protocol/query-keys.d.ts +1 -1
  389. package/dist/jvm/protocol/query-keys.d.ts.map +1 -1
  390. package/dist/jvm/protocol/query-keys.js +1 -1
  391. package/dist/jvm/protocol/query-keys.js.map +1 -1
  392. package/dist/jvm/protocol/status.cjs +38 -0
  393. package/dist/jvm/protocol/status.cjs.map +1 -0
  394. package/dist/jvm/protocol/status.d.ts +13 -0
  395. package/dist/jvm/protocol/status.d.ts.map +1 -0
  396. package/dist/jvm/protocol/status.js +38 -0
  397. package/dist/jvm/protocol/status.js.map +1 -0
  398. package/dist/jvm/protocol/types.d.ts +16 -4
  399. package/dist/jvm/protocol/types.d.ts.map +1 -1
  400. package/dist/jvm/runtime/GcSummary.cjs +7 -1
  401. package/dist/jvm/runtime/GcSummary.cjs.map +1 -1
  402. package/dist/jvm/runtime/GcSummary.d.ts.map +1 -1
  403. package/dist/jvm/runtime/GcSummary.js +7 -1
  404. package/dist/jvm/runtime/GcSummary.js.map +1 -1
  405. package/dist/jvm/surfaces/ClassesSurface.cjs +11 -10
  406. package/dist/jvm/surfaces/ClassesSurface.cjs.map +1 -1
  407. package/dist/jvm/surfaces/ClassesSurface.d.ts.map +1 -1
  408. package/dist/jvm/surfaces/ClassesSurface.js +12 -11
  409. package/dist/jvm/surfaces/ClassesSurface.js.map +1 -1
  410. package/dist/jvm/surfaces/JvmDiagnosticsWorkspace.cjs +11 -3
  411. package/dist/jvm/surfaces/JvmDiagnosticsWorkspace.cjs.map +1 -1
  412. package/dist/jvm/surfaces/JvmDiagnosticsWorkspace.d.ts +2 -0
  413. package/dist/jvm/surfaces/JvmDiagnosticsWorkspace.d.ts.map +1 -1
  414. package/dist/jvm/surfaces/JvmDiagnosticsWorkspace.js +11 -3
  415. package/dist/jvm/surfaces/JvmDiagnosticsWorkspace.js.map +1 -1
  416. package/dist/jvm/surfaces/PatchesSurface.cjs +3 -8
  417. package/dist/jvm/surfaces/PatchesSurface.cjs.map +1 -1
  418. package/dist/jvm/surfaces/PatchesSurface.d.ts +2 -1
  419. package/dist/jvm/surfaces/PatchesSurface.d.ts.map +1 -1
  420. package/dist/jvm/surfaces/PatchesSurface.js +4 -9
  421. package/dist/jvm/surfaces/PatchesSurface.js.map +1 -1
  422. package/dist/jvm/surfaces/ThreadsSurface.cjs +7 -4
  423. package/dist/jvm/surfaces/ThreadsSurface.cjs.map +1 -1
  424. package/dist/jvm/surfaces/ThreadsSurface.d.ts +4 -1
  425. package/dist/jvm/surfaces/ThreadsSurface.d.ts.map +1 -1
  426. package/dist/jvm/surfaces/ThreadsSurface.js +7 -4
  427. package/dist/jvm/surfaces/ThreadsSurface.js.map +1 -1
  428. package/dist/jvm/surfaces/jvm-context.cjs +23 -4
  429. package/dist/jvm/surfaces/jvm-context.cjs.map +1 -1
  430. package/dist/jvm/surfaces/jvm-context.d.ts +7 -0
  431. package/dist/jvm/surfaces/jvm-context.d.ts.map +1 -1
  432. package/dist/jvm/surfaces/jvm-context.js +23 -5
  433. package/dist/jvm/surfaces/jvm-context.js.map +1 -1
  434. package/dist/jvm/surfaces/use-patch-actions.cjs +2 -2
  435. package/dist/jvm/surfaces/use-patch-actions.cjs.map +1 -1
  436. package/dist/jvm/surfaces/use-patch-actions.js +2 -2
  437. package/dist/jvm/surfaces/use-patch-actions.js.map +1 -1
  438. package/dist/jvm/threads/FoldedStackTrace.cjs +3 -2
  439. package/dist/jvm/threads/FoldedStackTrace.cjs.map +1 -1
  440. package/dist/jvm/threads/FoldedStackTrace.d.ts +4 -1
  441. package/dist/jvm/threads/FoldedStackTrace.d.ts.map +1 -1
  442. package/dist/jvm/threads/FoldedStackTrace.js +3 -2
  443. package/dist/jvm/threads/FoldedStackTrace.js.map +1 -1
  444. package/dist/jvm/threads/ThreadDetail.cjs +6 -2
  445. package/dist/jvm/threads/ThreadDetail.cjs.map +1 -1
  446. package/dist/jvm/threads/ThreadDetail.d.ts +4 -1
  447. package/dist/jvm/threads/ThreadDetail.d.ts.map +1 -1
  448. package/dist/jvm/threads/ThreadDetail.js +6 -2
  449. package/dist/jvm/threads/ThreadDetail.js.map +1 -1
  450. package/dist/jvm.cjs +3 -0
  451. package/dist/jvm.d.ts +2 -1
  452. package/dist/jvm.d.ts.map +1 -1
  453. package/dist/jvm.js +3 -2
  454. package/dist/layout/AppShell.cjs.map +1 -1
  455. package/dist/layout/AppShell.d.ts +16 -0
  456. package/dist/layout/AppShell.d.ts.map +1 -1
  457. package/dist/layout/AppShell.js.map +1 -1
  458. package/dist/layout/AppShell.nav.cjs +21 -2
  459. package/dist/layout/AppShell.nav.cjs.map +1 -1
  460. package/dist/layout/AppShell.nav.js +21 -2
  461. package/dist/layout/AppShell.nav.js.map +1 -1
  462. package/dist/layout/Workspace.cjs +66 -21
  463. package/dist/layout/Workspace.cjs.map +1 -1
  464. package/dist/layout/Workspace.d.ts +6 -1
  465. package/dist/layout/Workspace.d.ts.map +1 -1
  466. package/dist/layout/Workspace.js +66 -21
  467. package/dist/layout/Workspace.js.map +1 -1
  468. package/dist/layout/Workspace.model.cjs +20 -0
  469. package/dist/layout/Workspace.model.cjs.map +1 -1
  470. package/dist/layout/Workspace.model.d.ts +17 -0
  471. package/dist/layout/Workspace.model.d.ts.map +1 -1
  472. package/dist/layout/Workspace.model.js +20 -1
  473. package/dist/layout/Workspace.model.js.map +1 -1
  474. package/dist/layout/Workspace.regions.cjs +10 -6
  475. package/dist/layout/Workspace.regions.cjs.map +1 -1
  476. package/dist/layout/Workspace.regions.d.ts +4 -1
  477. package/dist/layout/Workspace.regions.d.ts.map +1 -1
  478. package/dist/layout/Workspace.regions.js +10 -6
  479. package/dist/layout/Workspace.regions.js.map +1 -1
  480. package/dist/lib/duration.cjs +20 -0
  481. package/dist/lib/duration.cjs.map +1 -1
  482. package/dist/lib/duration.d.ts +8 -0
  483. package/dist/lib/duration.d.ts.map +1 -1
  484. package/dist/lib/duration.js +19 -1
  485. package/dist/lib/duration.js.map +1 -1
  486. package/dist/monaco/MonacoEditor.cjs +34 -30
  487. package/dist/monaco/MonacoEditor.cjs.map +1 -1
  488. package/dist/monaco/MonacoEditor.d.ts.map +1 -1
  489. package/dist/monaco/MonacoEditor.js +34 -30
  490. package/dist/monaco/MonacoEditor.js.map +1 -1
  491. package/dist/overlay/ConfirmDialog.cjs +5 -2
  492. package/dist/overlay/ConfirmDialog.cjs.map +1 -1
  493. package/dist/overlay/ConfirmDialog.d.ts +14 -2
  494. package/dist/overlay/ConfirmDialog.d.ts.map +1 -1
  495. package/dist/overlay/ConfirmDialog.js +5 -2
  496. package/dist/overlay/ConfirmDialog.js.map +1 -1
  497. package/dist/profiles/cel/celEditor.cjs +94 -285
  498. package/dist/profiles/cel/celEditor.cjs.map +1 -1
  499. package/dist/profiles/cel/celEditor.d.ts +10 -15
  500. package/dist/profiles/cel/celEditor.d.ts.map +1 -1
  501. package/dist/profiles/cel/celEditor.js +97 -287
  502. package/dist/profiles/cel/celEditor.js.map +1 -1
  503. package/dist/profiles/cel/celExpression.cjs +1 -61
  504. package/dist/profiles/cel/celExpression.cjs.map +1 -1
  505. package/dist/profiles/cel/celExpression.d.ts +2 -38
  506. package/dist/profiles/cel/celExpression.d.ts.map +1 -1
  507. package/dist/profiles/cel/celExpression.js +2 -58
  508. package/dist/profiles/cel/celExpression.js.map +1 -1
  509. package/dist/profiles/cel/celPlayground.cjs +122 -0
  510. package/dist/profiles/cel/celPlayground.cjs.map +1 -0
  511. package/dist/profiles/cel/celPlayground.d.ts +43 -0
  512. package/dist/profiles/cel/celPlayground.d.ts.map +1 -0
  513. package/dist/profiles/cel/celPlayground.js +118 -0
  514. package/dist/profiles/cel/celPlayground.js.map +1 -0
  515. package/dist/profiles/connections/connectionBrowserModel.cjs +2 -2
  516. package/dist/profiles/connections/connectionBrowserModel.cjs.map +1 -1
  517. package/dist/profiles/connections/connectionBrowserModel.d.ts +5 -1
  518. package/dist/profiles/connections/connectionBrowserModel.d.ts.map +1 -1
  519. package/dist/profiles/connections/connectionBrowserModel.js +2 -2
  520. package/dist/profiles/connections/connectionBrowserModel.js.map +1 -1
  521. package/dist/profiles/connections/connectionQueryWorkspace.cjs +2 -1
  522. package/dist/profiles/connections/connectionQueryWorkspace.cjs.map +1 -1
  523. package/dist/profiles/connections/connectionQueryWorkspace.d.ts +3 -1
  524. package/dist/profiles/connections/connectionQueryWorkspace.d.ts.map +1 -1
  525. package/dist/profiles/connections/connectionQueryWorkspace.js +2 -1
  526. package/dist/profiles/connections/connectionQueryWorkspace.js.map +1 -1
  527. package/dist/profiles/editor/UnwrapPreviewList.cjs +90 -0
  528. package/dist/profiles/editor/UnwrapPreviewList.cjs.map +1 -0
  529. package/dist/profiles/editor/UnwrapPreviewList.d.ts +7 -0
  530. package/dist/profiles/editor/UnwrapPreviewList.d.ts.map +1 -0
  531. package/dist/profiles/editor/UnwrapPreviewList.js +90 -0
  532. package/dist/profiles/editor/UnwrapPreviewList.js.map +1 -0
  533. package/dist/profiles/editor/profileCanonicalQuery.cjs +6 -58
  534. package/dist/profiles/editor/profileCanonicalQuery.cjs.map +1 -1
  535. package/dist/profiles/editor/profileCanonicalQuery.d.ts +1 -1
  536. package/dist/profiles/editor/profileCanonicalQuery.d.ts.map +1 -1
  537. package/dist/profiles/editor/profileCanonicalQuery.js +4 -56
  538. package/dist/profiles/editor/profileCanonicalQuery.js.map +1 -1
  539. package/dist/profiles/editor/profileCanonicalTranslate.cjs +48 -0
  540. package/dist/profiles/editor/profileCanonicalTranslate.cjs.map +1 -0
  541. package/dist/profiles/editor/profileCanonicalTranslate.d.ts +24 -0
  542. package/dist/profiles/editor/profileCanonicalTranslate.d.ts.map +1 -0
  543. package/dist/profiles/editor/profileCanonicalTranslate.js +47 -0
  544. package/dist/profiles/editor/profileCanonicalTranslate.js.map +1 -0
  545. package/dist/profiles/editor/profileEditor.cjs +106 -37
  546. package/dist/profiles/editor/profileEditor.cjs.map +1 -1
  547. package/dist/profiles/editor/profileEditor.d.ts.map +1 -1
  548. package/dist/profiles/editor/profileEditor.js +107 -38
  549. package/dist/profiles/editor/profileEditor.js.map +1 -1
  550. package/dist/profiles/editor/profileEditorModel.cjs +65 -19
  551. package/dist/profiles/editor/profileEditorModel.cjs.map +1 -1
  552. package/dist/profiles/editor/profileEditorModel.d.ts +24 -8
  553. package/dist/profiles/editor/profileEditorModel.d.ts.map +1 -1
  554. package/dist/profiles/editor/profileEditorModel.js +64 -18
  555. package/dist/profiles/editor/profileEditorModel.js.map +1 -1
  556. package/dist/profiles/editor/profileEditorPreview.cjs +129 -29
  557. package/dist/profiles/editor/profileEditorPreview.cjs.map +1 -1
  558. package/dist/profiles/editor/profileEditorPreview.d.ts +18 -5
  559. package/dist/profiles/editor/profileEditorPreview.d.ts.map +1 -1
  560. package/dist/profiles/editor/profileEditorPreview.js +129 -29
  561. package/dist/profiles/editor/profileEditorPreview.js.map +1 -1
  562. package/dist/profiles/editor/profileEditorSections.cjs +137 -88
  563. package/dist/profiles/editor/profileEditorSections.cjs.map +1 -1
  564. package/dist/profiles/editor/profileEditorSections.d.ts +18 -2
  565. package/dist/profiles/editor/profileEditorSections.d.ts.map +1 -1
  566. package/dist/profiles/editor/profileEditorSections.js +138 -90
  567. package/dist/profiles/editor/profileEditorSections.js.map +1 -1
  568. package/dist/profiles/editor/profileMappingPreview.cjs +22 -6
  569. package/dist/profiles/editor/profileMappingPreview.cjs.map +1 -1
  570. package/dist/profiles/editor/profileMappingPreview.d.ts +17 -1
  571. package/dist/profiles/editor/profileMappingPreview.d.ts.map +1 -1
  572. package/dist/profiles/editor/profileMappingPreview.js +23 -7
  573. package/dist/profiles/editor/profileMappingPreview.js.map +1 -1
  574. package/dist/profiles/editor/profileSaveAsDialog.cjs +21 -13
  575. package/dist/profiles/editor/profileSaveAsDialog.cjs.map +1 -1
  576. package/dist/profiles/editor/profileSaveAsDialog.d.ts.map +1 -1
  577. package/dist/profiles/editor/profileSaveAsDialog.js +21 -13
  578. package/dist/profiles/editor/profileSaveAsDialog.js.map +1 -1
  579. package/dist/profiles/editor/profileSourceExtensions.cjs +71 -0
  580. package/dist/profiles/editor/profileSourceExtensions.cjs.map +1 -0
  581. package/dist/profiles/editor/profileSourceExtensions.d.ts +26 -0
  582. package/dist/profiles/editor/profileSourceExtensions.d.ts.map +1 -0
  583. package/dist/profiles/editor/profileSourceExtensions.js +70 -0
  584. package/dist/profiles/editor/profileSourceExtensions.js.map +1 -0
  585. package/dist/profiles/editor/samplePaths.cjs +54 -0
  586. package/dist/profiles/editor/samplePaths.cjs.map +1 -0
  587. package/dist/profiles/editor/samplePaths.d.ts +27 -0
  588. package/dist/profiles/editor/samplePaths.d.ts.map +1 -0
  589. package/dist/profiles/editor/samplePaths.js +53 -0
  590. package/dist/profiles/editor/samplePaths.js.map +1 -0
  591. package/dist/profiles/editor/testSchema.d.ts.map +1 -1
  592. package/dist/profiles/editor/useUnwrapPreviews.cjs +60 -0
  593. package/dist/profiles/editor/useUnwrapPreviews.cjs.map +1 -0
  594. package/dist/profiles/editor/useUnwrapPreviews.d.ts +38 -0
  595. package/dist/profiles/editor/useUnwrapPreviews.d.ts.map +1 -0
  596. package/dist/profiles/editor/useUnwrapPreviews.js +60 -0
  597. package/dist/profiles/editor/useUnwrapPreviews.js.map +1 -0
  598. package/dist/profiles/elasticsearch/esQueryBuilder.cjs +10 -1
  599. package/dist/profiles/elasticsearch/esQueryBuilder.cjs.map +1 -1
  600. package/dist/profiles/elasticsearch/esQueryBuilder.d.ts.map +1 -1
  601. package/dist/profiles/elasticsearch/esQueryBuilder.js +11 -2
  602. package/dist/profiles/elasticsearch/esQueryBuilder.js.map +1 -1
  603. package/dist/profiles/elasticsearch/esQueryBuilderForm.cjs +38 -0
  604. package/dist/profiles/elasticsearch/esQueryBuilderForm.cjs.map +1 -1
  605. package/dist/profiles/elasticsearch/esQueryBuilderForm.d.ts +17 -0
  606. package/dist/profiles/elasticsearch/esQueryBuilderForm.d.ts.map +1 -1
  607. package/dist/profiles/elasticsearch/esQueryBuilderForm.js +37 -1
  608. package/dist/profiles/elasticsearch/esQueryBuilderForm.js.map +1 -1
  609. package/dist/profiles/elasticsearch/esQueryConditionRow.cjs +4 -3
  610. package/dist/profiles/elasticsearch/esQueryConditionRow.cjs.map +1 -1
  611. package/dist/profiles/elasticsearch/esQueryConditionRow.d.ts.map +1 -1
  612. package/dist/profiles/elasticsearch/esQueryConditionRow.js +4 -3
  613. package/dist/profiles/elasticsearch/esQueryConditionRow.js.map +1 -1
  614. package/dist/profiles/elasticsearch/esQueryOperators.cjs.map +1 -1
  615. package/dist/profiles/elasticsearch/esQueryOperators.d.ts +8 -0
  616. package/dist/profiles/elasticsearch/esQueryOperators.d.ts.map +1 -1
  617. package/dist/profiles/elasticsearch/esQueryOperators.js.map +1 -1
  618. package/dist/profiles/fields/profileFieldControls.cjs +3 -2
  619. package/dist/profiles/fields/profileFieldControls.cjs.map +1 -1
  620. package/dist/profiles/fields/profileFieldControls.d.ts +3 -1
  621. package/dist/profiles/fields/profileFieldControls.d.ts.map +1 -1
  622. package/dist/profiles/fields/profileFieldControls.js +3 -2
  623. package/dist/profiles/fields/profileFieldControls.js.map +1 -1
  624. package/dist/profiles/fields/profileFieldEditor.cjs +98 -185
  625. package/dist/profiles/fields/profileFieldEditor.cjs.map +1 -1
  626. package/dist/profiles/fields/profileFieldEditor.d.ts +11 -3
  627. package/dist/profiles/fields/profileFieldEditor.d.ts.map +1 -1
  628. package/dist/profiles/fields/profileFieldEditor.js +99 -186
  629. package/dist/profiles/fields/profileFieldEditor.js.map +1 -1
  630. package/dist/profiles/fields/profileFieldFilterEditor.cjs +115 -81
  631. package/dist/profiles/fields/profileFieldFilterEditor.cjs.map +1 -1
  632. package/dist/profiles/fields/profileFieldFilterEditor.d.ts.map +1 -1
  633. package/dist/profiles/fields/profileFieldFilterEditor.js +116 -82
  634. package/dist/profiles/fields/profileFieldFilterEditor.js.map +1 -1
  635. package/dist/profiles/fields/profileFieldIcons.cjs +2 -0
  636. package/dist/profiles/fields/profileFieldIcons.cjs.map +1 -1
  637. package/dist/profiles/fields/profileFieldIcons.d.ts.map +1 -1
  638. package/dist/profiles/fields/profileFieldIcons.js +2 -0
  639. package/dist/profiles/fields/profileFieldIcons.js.map +1 -1
  640. package/dist/profiles/fields/profileFieldList.cjs +23 -1
  641. package/dist/profiles/fields/profileFieldList.cjs.map +1 -1
  642. package/dist/profiles/fields/profileFieldList.d.ts.map +1 -1
  643. package/dist/profiles/fields/profileFieldList.js +23 -1
  644. package/dist/profiles/fields/profileFieldList.js.map +1 -1
  645. package/dist/profiles/fields/profileFieldPreview.cjs +111 -0
  646. package/dist/profiles/fields/profileFieldPreview.cjs.map +1 -0
  647. package/dist/profiles/fields/profileFieldPreview.d.ts +25 -0
  648. package/dist/profiles/fields/profileFieldPreview.d.ts.map +1 -0
  649. package/dist/profiles/fields/profileFieldPreview.js +110 -0
  650. package/dist/profiles/fields/profileFieldPreview.js.map +1 -0
  651. package/dist/profiles/fields/profileFieldSample.cjs +182 -0
  652. package/dist/profiles/fields/profileFieldSample.cjs.map +1 -0
  653. package/dist/profiles/fields/profileFieldSample.d.ts +35 -0
  654. package/dist/profiles/fields/profileFieldSample.d.ts.map +1 -0
  655. package/dist/profiles/fields/profileFieldSample.js +180 -0
  656. package/dist/profiles/fields/profileFieldSample.js.map +1 -0
  657. package/dist/profiles/fields/profileFieldTypeField.cjs +104 -0
  658. package/dist/profiles/fields/profileFieldTypeField.cjs.map +1 -0
  659. package/dist/profiles/fields/profileFieldTypeField.d.ts +17 -0
  660. package/dist/profiles/fields/profileFieldTypeField.d.ts.map +1 -0
  661. package/dist/profiles/fields/profileFieldTypeField.js +104 -0
  662. package/dist/profiles/fields/profileFieldTypeField.js.map +1 -0
  663. package/dist/profiles/fields/profileFieldTypes.cjs +1 -0
  664. package/dist/profiles/fields/profileFieldTypes.cjs.map +1 -1
  665. package/dist/profiles/fields/profileFieldTypes.d.ts +1 -1
  666. package/dist/profiles/fields/profileFieldTypes.d.ts.map +1 -1
  667. package/dist/profiles/fields/profileFieldTypes.js +1 -0
  668. package/dist/profiles/fields/profileFieldTypes.js.map +1 -1
  669. package/dist/profiles/fields/profileFieldValueEditor.cjs +298 -0
  670. package/dist/profiles/fields/profileFieldValueEditor.cjs.map +1 -0
  671. package/dist/profiles/fields/profileFieldValueEditor.d.ts +18 -0
  672. package/dist/profiles/fields/profileFieldValueEditor.d.ts.map +1 -0
  673. package/dist/profiles/fields/profileFieldValueEditor.js +298 -0
  674. package/dist/profiles/fields/profileFieldValueEditor.js.map +1 -0
  675. package/dist/profiles/fields/profileFieldValueMode.cjs +61 -0
  676. package/dist/profiles/fields/profileFieldValueMode.cjs.map +1 -0
  677. package/dist/profiles/fields/profileFieldValueMode.d.ts +34 -0
  678. package/dist/profiles/fields/profileFieldValueMode.d.ts.map +1 -0
  679. package/dist/profiles/fields/profileFieldValueMode.js +59 -0
  680. package/dist/profiles/fields/profileFieldValueMode.js.map +1 -0
  681. package/dist/profiles/processor/processorConfig.cjs +79 -79
  682. package/dist/profiles/processor/processorConfig.cjs.map +1 -1
  683. package/dist/profiles/processor/processorConfig.d.ts +30 -3
  684. package/dist/profiles/processor/processorConfig.d.ts.map +1 -1
  685. package/dist/profiles/processor/processorConfig.js +78 -78
  686. package/dist/profiles/processor/processorConfig.js.map +1 -1
  687. package/dist/profiles/processor/processorPipeline.cjs +8 -6
  688. package/dist/profiles/processor/processorPipeline.cjs.map +1 -1
  689. package/dist/profiles/processor/processorPipeline.d.ts +3 -3
  690. package/dist/profiles/processor/processorPipeline.d.ts.map +1 -1
  691. package/dist/profiles/processor/processorPipeline.js +9 -7
  692. package/dist/profiles/processor/processorPipeline.js.map +1 -1
  693. package/dist/profiles/processor/processorPipelineEditor.cjs +38 -94
  694. package/dist/profiles/processor/processorPipelineEditor.cjs.map +1 -1
  695. package/dist/profiles/processor/processorPipelineEditor.d.ts +3 -3
  696. package/dist/profiles/processor/processorPipelineEditor.d.ts.map +1 -1
  697. package/dist/profiles/processor/processorPipelineEditor.js +39 -95
  698. package/dist/profiles/processor/processorPipelineEditor.js.map +1 -1
  699. package/dist/profiles/processor/processorPipelineExtension.cjs +3 -2
  700. package/dist/profiles/processor/processorPipelineExtension.cjs.map +1 -1
  701. package/dist/profiles/processor/processorPipelineExtension.d.ts.map +1 -1
  702. package/dist/profiles/processor/processorPipelineExtension.js +3 -2
  703. package/dist/profiles/processor/processorPipelineExtension.js.map +1 -1
  704. package/dist/profiles/query/profileSampleFilterLookup.cjs.map +1 -1
  705. package/dist/profiles/query/profileSampleFilterLookup.d.ts +6 -3
  706. package/dist/profiles/query/profileSampleFilterLookup.d.ts.map +1 -1
  707. package/dist/profiles/query/profileSampleFilterLookup.js.map +1 -1
  708. package/dist/profiles/wizard/profileWizardModel.cjs +10 -1
  709. package/dist/profiles/wizard/profileWizardModel.cjs.map +1 -1
  710. package/dist/profiles/wizard/profileWizardModel.d.ts +6 -0
  711. package/dist/profiles/wizard/profileWizardModel.d.ts.map +1 -1
  712. package/dist/profiles/wizard/profileWizardModel.js +10 -1
  713. package/dist/profiles/wizard/profileWizardModel.js.map +1 -1
  714. package/dist/profiles/wizard/profileWizardQueryStep.cjs +10 -22
  715. package/dist/profiles/wizard/profileWizardQueryStep.cjs.map +1 -1
  716. package/dist/profiles/wizard/profileWizardQueryStep.d.ts +8 -1
  717. package/dist/profiles/wizard/profileWizardQueryStep.d.ts.map +1 -1
  718. package/dist/profiles/wizard/profileWizardQueryStep.js +11 -23
  719. package/dist/profiles/wizard/profileWizardQueryStep.js.map +1 -1
  720. package/dist/profiles/wizard/useProfileInspection.cjs +39 -0
  721. package/dist/profiles/wizard/useProfileInspection.cjs.map +1 -0
  722. package/dist/profiles/wizard/useProfileInspection.d.ts +21 -0
  723. package/dist/profiles/wizard/useProfileInspection.d.ts.map +1 -0
  724. package/dist/profiles/wizard/useProfileInspection.js +39 -0
  725. package/dist/profiles/wizard/useProfileInspection.js.map +1 -0
  726. package/dist/profiles.cjs +9 -11
  727. package/dist/profiles.js +8 -8
  728. package/dist/rpc/EntityExplorerApp.cjs +7 -3
  729. package/dist/rpc/EntityExplorerApp.cjs.map +1 -1
  730. package/dist/rpc/EntityExplorerApp.d.ts +16 -1
  731. package/dist/rpc/EntityExplorerApp.d.ts.map +1 -1
  732. package/dist/rpc/EntityExplorerApp.js +7 -3
  733. package/dist/rpc/EntityExplorerApp.js.map +1 -1
  734. package/dist/rpc/InlineError.cjs +30 -10
  735. package/dist/rpc/InlineError.cjs.map +1 -1
  736. package/dist/rpc/InlineError.d.ts +10 -1
  737. package/dist/rpc/InlineError.d.ts.map +1 -1
  738. package/dist/rpc/InlineError.js +30 -10
  739. package/dist/rpc/InlineError.js.map +1 -1
  740. package/dist/rpc/SchemaActionForm.cjs +9 -6
  741. package/dist/rpc/SchemaActionForm.cjs.map +1 -1
  742. package/dist/rpc/SchemaActionForm.d.ts.map +1 -1
  743. package/dist/rpc/SchemaActionForm.js +9 -6
  744. package/dist/rpc/SchemaActionForm.js.map +1 -1
  745. package/dist/rpc/SessionHeader.cjs +3 -3
  746. package/dist/rpc/SessionHeader.cjs.map +1 -1
  747. package/dist/rpc/SessionHeader.d.ts.map +1 -1
  748. package/dist/rpc/SessionHeader.js +3 -3
  749. package/dist/rpc/SessionHeader.js.map +1 -1
  750. package/dist/rpc/formMetadata.cjs +2 -6
  751. package/dist/rpc/formMetadata.cjs.map +1 -1
  752. package/dist/rpc/formMetadata.d.ts.map +1 -1
  753. package/dist/rpc/formMetadata.js +1 -5
  754. package/dist/rpc/formMetadata.js.map +1 -1
  755. package/dist/rpc/surfaceNav.cjs +5 -0
  756. package/dist/rpc/surfaceNav.cjs.map +1 -1
  757. package/dist/rpc/surfaceNav.d.ts.map +1 -1
  758. package/dist/rpc/surfaceNav.js +5 -0
  759. package/dist/rpc/surfaceNav.js.map +1 -1
  760. package/dist/runtime/barrels.json +4982 -4979
  761. package/dist/runtime/importmap.json +2168 -2146
  762. package/dist/styles.css +1 -1
  763. package/package.json +1 -1
  764. package/dist/data/ai/runtime-profiles/ResolutionInspector.cjs +0 -91
  765. package/dist/data/ai/runtime-profiles/ResolutionInspector.cjs.map +0 -1
  766. package/dist/data/ai/runtime-profiles/ResolutionInspector.d.ts +0 -7
  767. package/dist/data/ai/runtime-profiles/ResolutionInspector.d.ts.map +0 -1
  768. package/dist/data/ai/runtime-profiles/ResolutionInspector.js +0 -91
  769. package/dist/data/ai/runtime-profiles/ResolutionInspector.js.map +0 -1
  770. package/dist/profiles/cel/celEditorResults.cjs +0 -158
  771. package/dist/profiles/cel/celEditorResults.cjs.map +0 -1
  772. package/dist/profiles/cel/celEditorResults.d.ts +0 -37
  773. package/dist/profiles/cel/celEditorResults.d.ts.map +0 -1
  774. package/dist/profiles/cel/celEditorResults.js +0 -156
  775. package/dist/profiles/cel/celEditorResults.js.map +0 -1
@@ -0,0 +1,67 @@
1
+ const require_TimeseriesPanel_axes = require("./TimeseriesPanel.axes.cjs");
2
+ // src/data/TimeseriesPanel.segments.ts
3
+ var runKey = (seriesKey, run) => `${seriesKey}::run${run}`;
4
+ /**
5
+ * Turns merged rows into what recharts draws, keeping an explicit gap (`null`) visible without
6
+ * touching how rows that merely lack a series' key (another series' timestamps) are bridged.
7
+ *
8
+ * Recharts' `connectNulls` cannot tell the two apart: off, it breaks a series at every row that does
9
+ * not carry it, and with interleaved timestamps nothing is left to draw. So a series that has an
10
+ * explicit null is split into runs, the samples between its gaps, each under its own row key and
11
+ * drawn as its own line with bridging on; no run spans a gap, and a gap is never bridged. A series
12
+ * without a null is returned as is. A leading, trailing or only gap just produces fewer runs, and a
13
+ * series that is all gaps produces none. Rows are copied only to add run keys; the series' own key,
14
+ * with its nulls, stays on every row for the tooltip and the legend.
15
+ */
16
+ function splitGapRuns(series, rows) {
17
+ const gapped = series.filter((s) => require_TimeseriesPanel_axes.seriesHasGap(rows, s.key));
18
+ if (gapped.length === 0) return {
19
+ rows,
20
+ plots: series.map((s) => ({
21
+ dataKey: s.key,
22
+ series: s,
23
+ isolatedSample: false
24
+ }))
25
+ };
26
+ const withRuns = rows.map((row) => ({ ...row }));
27
+ const plots = [];
28
+ for (const s of series) {
29
+ if (!gapped.includes(s)) {
30
+ plots.push({
31
+ dataKey: s.key,
32
+ series: s,
33
+ isolatedSample: false
34
+ });
35
+ continue;
36
+ }
37
+ const counts = [];
38
+ let run = 0;
39
+ let samplesInRun = 0;
40
+ for (const row of withRuns) {
41
+ const value = row[s.key];
42
+ if (value === null) {
43
+ if (samplesInRun > 0) {
44
+ counts.push(samplesInRun);
45
+ run++;
46
+ samplesInRun = 0;
47
+ }
48
+ } else if (typeof value === "number") {
49
+ row[runKey(s.key, run)] = value;
50
+ samplesInRun++;
51
+ }
52
+ }
53
+ if (samplesInRun > 0) counts.push(samplesInRun);
54
+ counts.forEach((count, i) => plots.push({
55
+ dataKey: runKey(s.key, i),
56
+ series: s,
57
+ isolatedSample: count === 1
58
+ }));
59
+ }
60
+ return {
61
+ rows: withRuns,
62
+ plots
63
+ };
64
+ }
65
+ exports.splitGapRuns = splitGapRuns;
66
+
67
+ //# sourceMappingURL=TimeseriesPanel.segments.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TimeseriesPanel.segments.cjs","names":["seriesHasGap"],"sources":["../../src/data/TimeseriesPanel.segments.ts"],"sourcesContent":["import type { MergedRow, ResolvedSeries } from \"./TimeseriesPanel.model\";\nimport { seriesHasGap } from \"./TimeseriesPanel.axes\";\n\n/** One line or area the chart draws: a whole series, or one contiguous run of a series that has gaps. */\nexport interface PlotSeries {\n /** The row key this plot reads; a run's own key when its series was split. */\n dataKey: string;\n /** The series this plot belongs to: legend entry, color, axis and stack group are the series'. */\n series: ResolvedSeries;\n /** A run of exactly one sample draws no line, so the chart marks it with a dot. */\n isolatedSample: boolean;\n}\n\nconst runKey = (seriesKey: string, run: number) => `${seriesKey}::run${run}`;\n\n/**\n * Turns merged rows into what recharts draws, keeping an explicit gap (`null`) visible without\n * touching how rows that merely lack a series' key (another series' timestamps) are bridged.\n *\n * Recharts' `connectNulls` cannot tell the two apart: off, it breaks a series at every row that does\n * not carry it, and with interleaved timestamps nothing is left to draw. So a series that has an\n * explicit null is split into runs, the samples between its gaps, each under its own row key and\n * drawn as its own line with bridging on; no run spans a gap, and a gap is never bridged. A series\n * without a null is returned as is. A leading, trailing or only gap just produces fewer runs, and a\n * series that is all gaps produces none. Rows are copied only to add run keys; the series' own key,\n * with its nulls, stays on every row for the tooltip and the legend.\n */\nexport function splitGapRuns(series: ResolvedSeries[], rows: MergedRow[]): { rows: MergedRow[]; plots: PlotSeries[] } {\n const gapped = series.filter((s) => seriesHasGap(rows, s.key));\n if (gapped.length === 0) {\n return { rows, plots: series.map((s) => ({ dataKey: s.key, series: s, isolatedSample: false })) };\n }\n const withRuns = rows.map((row) => ({ ...row }));\n const plots: PlotSeries[] = [];\n for (const s of series) {\n if (!gapped.includes(s)) {\n plots.push({ dataKey: s.key, series: s, isolatedSample: false });\n continue;\n }\n const counts: number[] = [];\n let run = 0;\n let samplesInRun = 0;\n for (const row of withRuns) {\n const value = row[s.key];\n if (value === null) {\n if (samplesInRun > 0) {\n counts.push(samplesInRun);\n run++;\n samplesInRun = 0;\n }\n } else if (typeof value === \"number\") {\n row[runKey(s.key, run)] = value;\n samplesInRun++;\n }\n }\n if (samplesInRun > 0) counts.push(samplesInRun);\n counts.forEach((count, i) => plots.push({ dataKey: runKey(s.key, i), series: s, isolatedSample: count === 1 }));\n }\n return { rows: withRuns, plots };\n}\n"],"mappings":";;AAaA,IAAM,UAAU,WAAmB,QAAgB,GAAG,UAAU,OAAO;;;;;;;;;;;;;AAcvE,SAAgB,aAAa,QAA0B,MAA+D;CACpH,MAAM,SAAS,OAAO,QAAQ,MAAMA,6BAAAA,aAAa,MAAM,EAAE,GAAG,CAAC;CAC7D,IAAI,OAAO,WAAW,GACpB,OAAO;EAAE;EAAM,OAAO,OAAO,KAAK,OAAO;GAAE,SAAS,EAAE;GAAK,QAAQ;GAAG,gBAAgB;EAAM,EAAE;CAAE;CAElG,MAAM,WAAW,KAAK,KAAK,SAAS,EAAE,GAAG,IAAI,EAAE;CAC/C,MAAM,QAAsB,CAAC;CAC7B,KAAK,MAAM,KAAK,QAAQ;EACtB,IAAI,CAAC,OAAO,SAAS,CAAC,GAAG;GACvB,MAAM,KAAK;IAAE,SAAS,EAAE;IAAK,QAAQ;IAAG,gBAAgB;GAAM,CAAC;GAC/D;EACF;EACA,MAAM,SAAmB,CAAC;EAC1B,IAAI,MAAM;EACV,IAAI,eAAe;EACnB,KAAK,MAAM,OAAO,UAAU;GAC1B,MAAM,QAAQ,IAAI,EAAE;GACpB,IAAI,UAAU,MACR;QAAA,eAAe,GAAG;KACpB,OAAO,KAAK,YAAY;KACxB;KACA,eAAe;IACjB;UACK,IAAI,OAAO,UAAU,UAAU;IACpC,IAAI,OAAO,EAAE,KAAK,GAAG,KAAK;IAC1B;GACF;EACF;EACA,IAAI,eAAe,GAAG,OAAO,KAAK,YAAY;EAC9C,OAAO,SAAS,OAAO,MAAM,MAAM,KAAK;GAAE,SAAS,OAAO,EAAE,KAAK,CAAC;GAAG,QAAQ;GAAG,gBAAgB,UAAU;EAAE,CAAC,CAAC;CAChH;CACA,OAAO;EAAE,MAAM;EAAU;CAAM;AACjC"}
@@ -0,0 +1,27 @@
1
+ import { MergedRow, ResolvedSeries } from './TimeseriesPanel.model.js';
2
+ /** One line or area the chart draws: a whole series, or one contiguous run of a series that has gaps. */
3
+ export interface PlotSeries {
4
+ /** The row key this plot reads; a run's own key when its series was split. */
5
+ dataKey: string;
6
+ /** The series this plot belongs to: legend entry, color, axis and stack group are the series'. */
7
+ series: ResolvedSeries;
8
+ /** A run of exactly one sample draws no line, so the chart marks it with a dot. */
9
+ isolatedSample: boolean;
10
+ }
11
+ /**
12
+ * Turns merged rows into what recharts draws, keeping an explicit gap (`null`) visible without
13
+ * touching how rows that merely lack a series' key (another series' timestamps) are bridged.
14
+ *
15
+ * Recharts' `connectNulls` cannot tell the two apart: off, it breaks a series at every row that does
16
+ * not carry it, and with interleaved timestamps nothing is left to draw. So a series that has an
17
+ * explicit null is split into runs, the samples between its gaps, each under its own row key and
18
+ * drawn as its own line with bridging on; no run spans a gap, and a gap is never bridged. A series
19
+ * without a null is returned as is. A leading, trailing or only gap just produces fewer runs, and a
20
+ * series that is all gaps produces none. Rows are copied only to add run keys; the series' own key,
21
+ * with its nulls, stays on every row for the tooltip and the legend.
22
+ */
23
+ export declare function splitGapRuns(series: ResolvedSeries[], rows: MergedRow[]): {
24
+ rows: MergedRow[];
25
+ plots: PlotSeries[];
26
+ };
27
+ //# sourceMappingURL=TimeseriesPanel.segments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TimeseriesPanel.segments.d.ts","sourceRoot":"","sources":["../../src/data/TimeseriesPanel.segments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAGzE,yGAAyG;AACzG,MAAM,WAAW,UAAU;IACzB,8EAA8E;IAC9E,OAAO,EAAE,MAAM,CAAC;IAChB,kGAAkG;IAClG,MAAM,EAAE,cAAc,CAAC;IACvB,mFAAmF;IACnF,cAAc,EAAE,OAAO,CAAC;CACzB;AAID;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,cAAc,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG;IAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAAC,KAAK,EAAE,UAAU,EAAE,CAAA;CAAE,CAgCpH"}
@@ -0,0 +1,67 @@
1
+ import { seriesHasGap } from "./TimeseriesPanel.axes.js";
2
+ // src/data/TimeseriesPanel.segments.ts
3
+ var runKey = (seriesKey, run) => `${seriesKey}::run${run}`;
4
+ /**
5
+ * Turns merged rows into what recharts draws, keeping an explicit gap (`null`) visible without
6
+ * touching how rows that merely lack a series' key (another series' timestamps) are bridged.
7
+ *
8
+ * Recharts' `connectNulls` cannot tell the two apart: off, it breaks a series at every row that does
9
+ * not carry it, and with interleaved timestamps nothing is left to draw. So a series that has an
10
+ * explicit null is split into runs, the samples between its gaps, each under its own row key and
11
+ * drawn as its own line with bridging on; no run spans a gap, and a gap is never bridged. A series
12
+ * without a null is returned as is. A leading, trailing or only gap just produces fewer runs, and a
13
+ * series that is all gaps produces none. Rows are copied only to add run keys; the series' own key,
14
+ * with its nulls, stays on every row for the tooltip and the legend.
15
+ */
16
+ function splitGapRuns(series, rows) {
17
+ const gapped = series.filter((s) => seriesHasGap(rows, s.key));
18
+ if (gapped.length === 0) return {
19
+ rows,
20
+ plots: series.map((s) => ({
21
+ dataKey: s.key,
22
+ series: s,
23
+ isolatedSample: false
24
+ }))
25
+ };
26
+ const withRuns = rows.map((row) => ({ ...row }));
27
+ const plots = [];
28
+ for (const s of series) {
29
+ if (!gapped.includes(s)) {
30
+ plots.push({
31
+ dataKey: s.key,
32
+ series: s,
33
+ isolatedSample: false
34
+ });
35
+ continue;
36
+ }
37
+ const counts = [];
38
+ let run = 0;
39
+ let samplesInRun = 0;
40
+ for (const row of withRuns) {
41
+ const value = row[s.key];
42
+ if (value === null) {
43
+ if (samplesInRun > 0) {
44
+ counts.push(samplesInRun);
45
+ run++;
46
+ samplesInRun = 0;
47
+ }
48
+ } else if (typeof value === "number") {
49
+ row[runKey(s.key, run)] = value;
50
+ samplesInRun++;
51
+ }
52
+ }
53
+ if (samplesInRun > 0) counts.push(samplesInRun);
54
+ counts.forEach((count, i) => plots.push({
55
+ dataKey: runKey(s.key, i),
56
+ series: s,
57
+ isolatedSample: count === 1
58
+ }));
59
+ }
60
+ return {
61
+ rows: withRuns,
62
+ plots
63
+ };
64
+ }
65
+ export { splitGapRuns };
66
+
67
+ //# sourceMappingURL=TimeseriesPanel.segments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TimeseriesPanel.segments.js","names":[],"sources":["../../src/data/TimeseriesPanel.segments.ts"],"sourcesContent":["import type { MergedRow, ResolvedSeries } from \"./TimeseriesPanel.model\";\nimport { seriesHasGap } from \"./TimeseriesPanel.axes\";\n\n/** One line or area the chart draws: a whole series, or one contiguous run of a series that has gaps. */\nexport interface PlotSeries {\n /** The row key this plot reads; a run's own key when its series was split. */\n dataKey: string;\n /** The series this plot belongs to: legend entry, color, axis and stack group are the series'. */\n series: ResolvedSeries;\n /** A run of exactly one sample draws no line, so the chart marks it with a dot. */\n isolatedSample: boolean;\n}\n\nconst runKey = (seriesKey: string, run: number) => `${seriesKey}::run${run}`;\n\n/**\n * Turns merged rows into what recharts draws, keeping an explicit gap (`null`) visible without\n * touching how rows that merely lack a series' key (another series' timestamps) are bridged.\n *\n * Recharts' `connectNulls` cannot tell the two apart: off, it breaks a series at every row that does\n * not carry it, and with interleaved timestamps nothing is left to draw. So a series that has an\n * explicit null is split into runs, the samples between its gaps, each under its own row key and\n * drawn as its own line with bridging on; no run spans a gap, and a gap is never bridged. A series\n * without a null is returned as is. A leading, trailing or only gap just produces fewer runs, and a\n * series that is all gaps produces none. Rows are copied only to add run keys; the series' own key,\n * with its nulls, stays on every row for the tooltip and the legend.\n */\nexport function splitGapRuns(series: ResolvedSeries[], rows: MergedRow[]): { rows: MergedRow[]; plots: PlotSeries[] } {\n const gapped = series.filter((s) => seriesHasGap(rows, s.key));\n if (gapped.length === 0) {\n return { rows, plots: series.map((s) => ({ dataKey: s.key, series: s, isolatedSample: false })) };\n }\n const withRuns = rows.map((row) => ({ ...row }));\n const plots: PlotSeries[] = [];\n for (const s of series) {\n if (!gapped.includes(s)) {\n plots.push({ dataKey: s.key, series: s, isolatedSample: false });\n continue;\n }\n const counts: number[] = [];\n let run = 0;\n let samplesInRun = 0;\n for (const row of withRuns) {\n const value = row[s.key];\n if (value === null) {\n if (samplesInRun > 0) {\n counts.push(samplesInRun);\n run++;\n samplesInRun = 0;\n }\n } else if (typeof value === \"number\") {\n row[runKey(s.key, run)] = value;\n samplesInRun++;\n }\n }\n if (samplesInRun > 0) counts.push(samplesInRun);\n counts.forEach((count, i) => plots.push({ dataKey: runKey(s.key, i), series: s, isolatedSample: count === 1 }));\n }\n return { rows: withRuns, plots };\n}\n"],"mappings":";;AAaA,IAAM,UAAU,WAAmB,QAAgB,GAAG,UAAU,OAAO;;;;;;;;;;;;;AAcvE,SAAgB,aAAa,QAA0B,MAA+D;CACpH,MAAM,SAAS,OAAO,QAAQ,MAAM,aAAa,MAAM,EAAE,GAAG,CAAC;CAC7D,IAAI,OAAO,WAAW,GACpB,OAAO;EAAE;EAAM,OAAO,OAAO,KAAK,OAAO;GAAE,SAAS,EAAE;GAAK,QAAQ;GAAG,gBAAgB;EAAM,EAAE;CAAE;CAElG,MAAM,WAAW,KAAK,KAAK,SAAS,EAAE,GAAG,IAAI,EAAE;CAC/C,MAAM,QAAsB,CAAC;CAC7B,KAAK,MAAM,KAAK,QAAQ;EACtB,IAAI,CAAC,OAAO,SAAS,CAAC,GAAG;GACvB,MAAM,KAAK;IAAE,SAAS,EAAE;IAAK,QAAQ;IAAG,gBAAgB;GAAM,CAAC;GAC/D;EACF;EACA,MAAM,SAAmB,CAAC;EAC1B,IAAI,MAAM;EACV,IAAI,eAAe;EACnB,KAAK,MAAM,OAAO,UAAU;GAC1B,MAAM,QAAQ,IAAI,EAAE;GACpB,IAAI,UAAU,MACR;QAAA,eAAe,GAAG;KACpB,OAAO,KAAK,YAAY;KACxB;KACA,eAAe;IACjB;UACK,IAAI,OAAO,UAAU,UAAU;IACpC,IAAI,OAAO,EAAE,KAAK,GAAG,KAAK;IAC1B;GACF;EACF;EACA,IAAI,eAAe,GAAG,OAAO,KAAK,YAAY;EAC9C,OAAO,SAAS,OAAO,MAAM,MAAM,KAAK;GAAE,SAAS,OAAO,EAAE,KAAK,CAAC;GAAG,QAAQ;GAAG,gBAAgB,UAAU;EAAE,CAAC,CAAC;CAChH;CACA,OAAO;EAAE,MAAM;EAAU;CAAM;AACjC"}
@@ -6,10 +6,18 @@ let react_jsx_runtime = require("react/jsx-runtime");
6
6
  /**
7
7
  * A DataTable whose rows form a tree. Parent and leaf nodes share the columns;
8
8
  * the tree column indents each row by depth and gives parents a chevron. Tree
9
- * order is the row order, so sorting and grouping are not offered.
9
+ * order is the row order, so the table never sorts or groups rows itself. A host
10
+ * that orders siblings can pass a controlled `sort` + `onSortChange` to get
11
+ * clickable sort headers; without them every header is inert.
10
12
  */
11
- function TreeDataTable({ roots, getChildren, getKey, getAriaLabel, treeColumn, columns, expanded, onExpandedChange, defaultExpanded, ...table }) {
13
+ function TreeDataTable({ roots, getChildren, getKey, getAriaLabel, treeColumn, columns, expanded, onExpandedChange, defaultExpanded, sort, onSortChange, ...table }) {
12
14
  if (!columns.some((column) => column.key === treeColumn)) throw new Error(`TreeDataTable treeColumn "${treeColumn}" is not one of its columns`);
15
+ if (sort === void 0 !== (onSortChange === void 0)) throw new Error("TreeDataTable takes sort and onSortChange together: the table never sorts rows itself, so the host must own both");
16
+ const controlledSort = sort !== void 0 && onSortChange !== void 0 ? {
17
+ sort,
18
+ onSortChange,
19
+ manualSort: true
20
+ } : null;
13
21
  const { rows, toggle } = require_tree_rows.useTreeRows(roots, {
14
22
  getChildren,
15
23
  getKey
@@ -20,7 +28,7 @@ function TreeDataTable({ roots, getChildren, getKey, getAriaLabel, treeColumn, c
20
28
  });
21
29
  const byNode = new Map(rows.map((row) => [row.node, row]));
22
30
  const treeColumns = columns.map((column) => {
23
- const rest = {
31
+ const rest = controlledSort ? column : {
24
32
  ...column,
25
33
  sortable: false
26
34
  };
@@ -45,6 +53,7 @@ function TreeDataTable({ roots, getChildren, getKey, getAriaLabel, treeColumn, c
45
53
  });
46
54
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_DataTable.DataTable, {
47
55
  ...table,
56
+ ...controlledSort,
48
57
  columns: treeColumns,
49
58
  data: rows.map((row) => row.node),
50
59
  getRowId: (node) => byNode.get(node).key
@@ -1 +1 @@
1
- {"version":3,"file":"TreeDataTable.cjs","names":["useTreeRows","TreeRowLead","DataTable"],"sources":["../../src/data/TreeDataTable.tsx"],"sourcesContent":["import { useTreeRows, type TreeExpansionProps, type TreeRow, type TreeRowsAccessors } from \"../lib/tree-rows\";\nimport { DataTable, type DataTableColumn, type DataTableProps } from \"./DataTable\";\nimport { TreeRowLead } from \"./MatrixTreeTable\";\n\nexport type TreeDataTableProps<T extends Record<string, unknown>> = Omit<\n DataTableProps<T>,\n \"data\" | \"columns\" | \"getRowId\" | \"grouping\" | \"groupingModes\" | \"groupingMode\" | \"defaultGroupingMode\" | \"onGroupingModeChange\" | \"defaultSort\" | \"sort\" | \"onSortChange\"\n> &\n TreeRowsAccessors<T> &\n TreeExpansionProps<T> & {\n roots: T[];\n columns: DataTableColumn<T>[];\n /** Key of the column that carries the indent and the expand/collapse chevron. */\n treeColumn: string;\n /** Names a parent node in its expand/collapse button. */\n getAriaLabel: (node: T) => string;\n };\n\n/**\n * A DataTable whose rows form a tree. Parent and leaf nodes share the columns;\n * the tree column indents each row by depth and gives parents a chevron. Tree\n * order is the row order, so sorting and grouping are not offered.\n */\nexport function TreeDataTable<T extends Record<string, unknown>>({\n roots,\n getChildren,\n getKey,\n getAriaLabel,\n treeColumn,\n columns,\n expanded,\n onExpandedChange,\n defaultExpanded,\n ...table\n}: TreeDataTableProps<T>) {\n if (!columns.some((column) => column.key === treeColumn)) {\n throw new Error(`TreeDataTable treeColumn \"${treeColumn}\" is not one of its columns`);\n }\n const { rows, toggle } = useTreeRows(roots, { getChildren, getKey }, {\n ...(expanded !== undefined ? { expanded } : {}),\n ...(onExpandedChange ? { onExpandedChange } : {}),\n ...(defaultExpanded !== undefined ? { defaultExpanded } : {}),\n });\n const byNode = new Map<T, TreeRow<T>>(rows.map((row) => [row.node, row]));\n const treeColumns = columns.map((column): DataTableColumn<T> => {\n const rest = { ...column, sortable: false };\n if (column.key !== treeColumn) return rest;\n return {\n ...rest,\n render: (value, node) => {\n const row = byNode.get(node)!;\n const content = column.render ? column.render(value, node) : String(value ?? \"\");\n return row.hasChildren\n ? <TreeRowLead depth={row.depth} open={row.open} label={getAriaLabel(node)} onToggle={() => toggle(row)}>{content}</TreeRowLead>\n : <TreeRowLead depth={row.depth}>{content}</TreeRowLead>;\n },\n };\n });\n return <DataTable<T> {...table} columns={treeColumns} data={rows.map((row) => row.node)} getRowId={(node) => byNode.get(node)!.key} />;\n}\n"],"mappings":";;;;;;;;;;AAuBA,SAAgB,cAAiD,EAC/D,OACA,aACA,QACA,cACA,YACA,SACA,UACA,kBACA,iBACA,GAAG,SACqB;CACxB,IAAI,CAAC,QAAQ,MAAM,WAAW,OAAO,QAAQ,UAAU,GACrD,MAAM,IAAI,MAAM,6BAA6B,WAAW,4BAA4B;CAEtF,MAAM,EAAE,MAAM,WAAWA,kBAAAA,YAAY,OAAO;EAAE;EAAa;CAAO,GAAG;EACnE,GAAI,aAAa,KAAA,IAAY,EAAE,SAAS,IAAI,CAAC;EAC7C,GAAI,mBAAmB,EAAE,iBAAiB,IAAI,CAAC;EAC/C,GAAI,oBAAoB,KAAA,IAAY,EAAE,gBAAgB,IAAI,CAAC;CAC7D,CAAC;CACD,MAAM,SAAS,IAAI,IAAmB,KAAK,KAAK,QAAQ,CAAC,IAAI,MAAM,GAAG,CAAC,CAAC;CACxE,MAAM,cAAc,QAAQ,KAAK,WAA+B;EAC9D,MAAM,OAAO;GAAE,GAAG;GAAQ,UAAU;EAAM;EAC1C,IAAI,OAAO,QAAQ,YAAY,OAAO;EACtC,OAAO;GACL,GAAG;GACH,SAAS,OAAO,SAAS;IACvB,MAAM,MAAM,OAAO,IAAI,IAAI;IAC3B,MAAM,UAAU,OAAO,SAAS,OAAO,OAAO,OAAO,IAAI,IAAI,OAAO,SAAS,EAAE;IAC/E,OAAO,IAAI,cACP,iBAAA,GAAA,kBAAA,IAAA,CAACC,wBAAAA,aAAD;KAAa,OAAO,IAAI;KAAO,MAAM,IAAI;KAAM,OAAO,aAAa,IAAI;KAAG,gBAAgB,OAAO,GAAG;KAAI,UAAA;IAAqB,CAAA,IAC7H,iBAAA,GAAA,kBAAA,IAAA,CAACA,wBAAAA,aAAD;KAAa,OAAO,IAAI;KAAQ,UAAA;IAAqB,CAAA;GAC3D;EACF;CACF,CAAC;CACD,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACC,kBAAAA,WAAD;EAAc,GAAI;EAAO,SAAS;EAAa,MAAM,KAAK,KAAK,QAAQ,IAAI,IAAI;EAAG,WAAW,SAAS,OAAO,IAAI,IAAI,CAAC,CAAE;CAAM,CAAA;AACvI"}
1
+ {"version":3,"file":"TreeDataTable.cjs","names":["useTreeRows","TreeRowLead","DataTable"],"sources":["../../src/data/TreeDataTable.tsx"],"sourcesContent":["import type { SortState } from \"../hooks/use-sort\";\nimport { useTreeRows, type TreeExpansionProps, type TreeRow, type TreeRowsAccessors } from \"../lib/tree-rows\";\nimport { DataTable, type DataTableColumn, type DataTableProps } from \"./DataTable\";\nimport { TreeRowLead } from \"./MatrixTreeTable\";\n\nexport type TreeDataTableProps<T extends Record<string, unknown>> = Omit<\n DataTableProps<T>,\n \"data\" | \"columns\" | \"getRowId\" | \"grouping\" | \"groupingModes\" | \"groupingMode\" | \"defaultGroupingMode\" | \"onGroupingModeChange\" | \"defaultSort\" | \"sort\" | \"onSortChange\" | \"manualSort\"\n> &\n TreeRowsAccessors<T> &\n TreeExpansionProps<T> & {\n /** Siblings in the order to show them; with a controlled `sort` the host orders them. */\n roots: T[];\n /**\n * Controlled sort state for the header affordance. Always given together with `onSortChange`.\n * The table never reorders rows itself: `roots` carries the order, so the host re-orders\n * siblings (not rows across parents) when this changes.\n */\n sort?: SortState | null;\n /** Called when a sortable header changes `sort`. */\n onSortChange?: (sort: SortState | null) => void;\n columns: DataTableColumn<T>[];\n /** Key of the column that carries the indent and the expand/collapse chevron. */\n treeColumn: string;\n /** Names a parent node in its expand/collapse button. */\n getAriaLabel: (node: T) => string;\n };\n\n/**\n * A DataTable whose rows form a tree. Parent and leaf nodes share the columns;\n * the tree column indents each row by depth and gives parents a chevron. Tree\n * order is the row order, so the table never sorts or groups rows itself. A host\n * that orders siblings can pass a controlled `sort` + `onSortChange` to get\n * clickable sort headers; without them every header is inert.\n */\nexport function TreeDataTable<T extends Record<string, unknown>>({\n roots,\n getChildren,\n getKey,\n getAriaLabel,\n treeColumn,\n columns,\n expanded,\n onExpandedChange,\n defaultExpanded,\n sort,\n onSortChange,\n ...table\n}: TreeDataTableProps<T>) {\n if (!columns.some((column) => column.key === treeColumn)) {\n throw new Error(`TreeDataTable treeColumn \"${treeColumn}\" is not one of its columns`);\n }\n if ((sort === undefined) !== (onSortChange === undefined)) {\n throw new Error(\"TreeDataTable takes sort and onSortChange together: the table never sorts rows itself, so the host must own both\");\n }\n const controlledSort = sort !== undefined && onSortChange !== undefined ? { sort, onSortChange, manualSort: true } : null;\n const { rows, toggle } = useTreeRows(roots, { getChildren, getKey }, {\n ...(expanded !== undefined ? { expanded } : {}),\n ...(onExpandedChange ? { onExpandedChange } : {}),\n ...(defaultExpanded !== undefined ? { defaultExpanded } : {}),\n });\n const byNode = new Map<T, TreeRow<T>>(rows.map((row) => [row.node, row]));\n const treeColumns = columns.map((column): DataTableColumn<T> => {\n const rest = controlledSort ? column : { ...column, sortable: false };\n if (column.key !== treeColumn) return rest;\n return {\n ...rest,\n render: (value, node) => {\n const row = byNode.get(node)!;\n const content = column.render ? column.render(value, node) : String(value ?? \"\");\n return row.hasChildren\n ? <TreeRowLead depth={row.depth} open={row.open} label={getAriaLabel(node)} onToggle={() => toggle(row)}>{content}</TreeRowLead>\n : <TreeRowLead depth={row.depth}>{content}</TreeRowLead>;\n },\n };\n });\n return <DataTable<T> {...table} {...controlledSort} columns={treeColumns} data={rows.map((row) => row.node)} getRowId={(node) => byNode.get(node)!.key} />;\n}\n"],"mappings":";;;;;;;;;;;;AAmCA,SAAgB,cAAiD,EAC/D,OACA,aACA,QACA,cACA,YACA,SACA,UACA,kBACA,iBACA,MACA,cACA,GAAG,SACqB;CACxB,IAAI,CAAC,QAAQ,MAAM,WAAW,OAAO,QAAQ,UAAU,GACrD,MAAM,IAAI,MAAM,6BAA6B,WAAW,4BAA4B;CAEtF,IAAK,SAAS,KAAA,OAAgB,iBAAiB,KAAA,IAC7C,MAAM,IAAI,MAAM,kHAAkH;CAEpI,MAAM,iBAAiB,SAAS,KAAA,KAAa,iBAAiB,KAAA,IAAY;EAAE;EAAM;EAAc,YAAY;CAAK,IAAI;CACrH,MAAM,EAAE,MAAM,WAAWA,kBAAAA,YAAY,OAAO;EAAE;EAAa;CAAO,GAAG;EACnE,GAAI,aAAa,KAAA,IAAY,EAAE,SAAS,IAAI,CAAC;EAC7C,GAAI,mBAAmB,EAAE,iBAAiB,IAAI,CAAC;EAC/C,GAAI,oBAAoB,KAAA,IAAY,EAAE,gBAAgB,IAAI,CAAC;CAC7D,CAAC;CACD,MAAM,SAAS,IAAI,IAAmB,KAAK,KAAK,QAAQ,CAAC,IAAI,MAAM,GAAG,CAAC,CAAC;CACxE,MAAM,cAAc,QAAQ,KAAK,WAA+B;EAC9D,MAAM,OAAO,iBAAiB,SAAS;GAAE,GAAG;GAAQ,UAAU;EAAM;EACpE,IAAI,OAAO,QAAQ,YAAY,OAAO;EACtC,OAAO;GACL,GAAG;GACH,SAAS,OAAO,SAAS;IACvB,MAAM,MAAM,OAAO,IAAI,IAAI;IAC3B,MAAM,UAAU,OAAO,SAAS,OAAO,OAAO,OAAO,IAAI,IAAI,OAAO,SAAS,EAAE;IAC/E,OAAO,IAAI,cACP,iBAAA,GAAA,kBAAA,IAAA,CAACC,wBAAAA,aAAD;KAAa,OAAO,IAAI;KAAO,MAAM,IAAI;KAAM,OAAO,aAAa,IAAI;KAAG,gBAAgB,OAAO,GAAG;KAAI,UAAA;IAAqB,CAAA,IAC7H,iBAAA,GAAA,kBAAA,IAAA,CAACA,wBAAAA,aAAD;KAAa,OAAO,IAAI;KAAQ,UAAA;IAAqB,CAAA;GAC3D;EACF;CACF,CAAC;CACD,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACC,kBAAAA,WAAD;EAAc,GAAI;EAAO,GAAI;EAAgB,SAAS;EAAa,MAAM,KAAK,KAAK,QAAQ,IAAI,IAAI;EAAG,WAAW,SAAS,OAAO,IAAI,IAAI,CAAC,CAAE;CAAM,CAAA;AAC3J"}
@@ -1,7 +1,17 @@
1
+ import { SortState } from '../hooks/use-sort.js';
1
2
  import { TreeExpansionProps, TreeRowsAccessors } from '../lib/tree-rows.js';
2
3
  import { DataTableColumn, DataTableProps } from './DataTable.js';
3
- export type TreeDataTableProps<T extends Record<string, unknown>> = Omit<DataTableProps<T>, "data" | "columns" | "getRowId" | "grouping" | "groupingModes" | "groupingMode" | "defaultGroupingMode" | "onGroupingModeChange" | "defaultSort" | "sort" | "onSortChange"> & TreeRowsAccessors<T> & TreeExpansionProps<T> & {
4
+ export type TreeDataTableProps<T extends Record<string, unknown>> = Omit<DataTableProps<T>, "data" | "columns" | "getRowId" | "grouping" | "groupingModes" | "groupingMode" | "defaultGroupingMode" | "onGroupingModeChange" | "defaultSort" | "sort" | "onSortChange" | "manualSort"> & TreeRowsAccessors<T> & TreeExpansionProps<T> & {
5
+ /** Siblings in the order to show them; with a controlled `sort` the host orders them. */
4
6
  roots: T[];
7
+ /**
8
+ * Controlled sort state for the header affordance. Always given together with `onSortChange`.
9
+ * The table never reorders rows itself: `roots` carries the order, so the host re-orders
10
+ * siblings (not rows across parents) when this changes.
11
+ */
12
+ sort?: SortState | null;
13
+ /** Called when a sortable header changes `sort`. */
14
+ onSortChange?: (sort: SortState | null) => void;
5
15
  columns: DataTableColumn<T>[];
6
16
  /** Key of the column that carries the indent and the expand/collapse chevron. */
7
17
  treeColumn: string;
@@ -11,7 +21,9 @@ export type TreeDataTableProps<T extends Record<string, unknown>> = Omit<DataTab
11
21
  /**
12
22
  * A DataTable whose rows form a tree. Parent and leaf nodes share the columns;
13
23
  * the tree column indents each row by depth and gives parents a chevron. Tree
14
- * order is the row order, so sorting and grouping are not offered.
24
+ * order is the row order, so the table never sorts or groups rows itself. A host
25
+ * that orders siblings can pass a controlled `sort` + `onSortChange` to get
26
+ * clickable sort headers; without them every header is inert.
15
27
  */
16
- export declare function TreeDataTable<T extends Record<string, unknown>>({ roots, getChildren, getKey, getAriaLabel, treeColumn, columns, expanded, onExpandedChange, defaultExpanded, ...table }: TreeDataTableProps<T>): import("react").JSX.Element;
28
+ export declare function TreeDataTable<T extends Record<string, unknown>>({ roots, getChildren, getKey, getAriaLabel, treeColumn, columns, expanded, onExpandedChange, defaultExpanded, sort, onSortChange, ...table }: TreeDataTableProps<T>): import("react").JSX.Element;
17
29
  //# sourceMappingURL=TreeDataTable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TreeDataTable.d.ts","sourceRoot":"","sources":["../../src/data/TreeDataTable.tsx"],"names":[],"mappings":"AAAA,OAAO,E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,cAAc,EAAE,MAAM,aAAa,CAAC;AAGnF,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,IAAI,CACtE,cAAc,CAAC,CAAC,CAAC,EACjB,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,eAAe,GAAG,cAAc,GAAG,qBAAqB,GAAG,sBAAsB,GAAG,aAAa,GAAG,MAAM,GAAG,cAAc,GAAG,YAAY,CAC1L,GACC,iBAAiB,CAAC,CAAC,CAAC,GACpB,kBAAkB,CAAC,CAAC,CAAC,GAAG;IACtB,yFAAyF;IACzF,KAAK,EAAE,CAAC,EAAE,CAAC;IACX;;;;OAIG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACxB,oDAAoD;IACpD,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,KAAK,IAAI,CAAC;IAChD,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9B,iFAAiF;IACjF,UAAU,EAAE,MAAM,CAAC;IACnB,yDAAyD;IACzD,YAAY,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;CACnC,CAAC;AAEJ;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAC/D,KAAK,EACL,WAAW,EACX,MAAM,EACN,YAAY,EACZ,UAAU,EACV,OAAO,EACP,QAAQ,EACR,gBAAgB,EAChB,eAAe,EACf,IAAI,EACJ,YAAY,EACZ,GAAG,KAAK,EACT,EAAE,kBAAkB,CAAC,CAAC,CAAC,+BA6BvB"}
@@ -6,10 +6,18 @@ import { jsx } from "react/jsx-runtime";
6
6
  /**
7
7
  * A DataTable whose rows form a tree. Parent and leaf nodes share the columns;
8
8
  * the tree column indents each row by depth and gives parents a chevron. Tree
9
- * order is the row order, so sorting and grouping are not offered.
9
+ * order is the row order, so the table never sorts or groups rows itself. A host
10
+ * that orders siblings can pass a controlled `sort` + `onSortChange` to get
11
+ * clickable sort headers; without them every header is inert.
10
12
  */
11
- function TreeDataTable({ roots, getChildren, getKey, getAriaLabel, treeColumn, columns, expanded, onExpandedChange, defaultExpanded, ...table }) {
13
+ function TreeDataTable({ roots, getChildren, getKey, getAriaLabel, treeColumn, columns, expanded, onExpandedChange, defaultExpanded, sort, onSortChange, ...table }) {
12
14
  if (!columns.some((column) => column.key === treeColumn)) throw new Error(`TreeDataTable treeColumn "${treeColumn}" is not one of its columns`);
15
+ if (sort === void 0 !== (onSortChange === void 0)) throw new Error("TreeDataTable takes sort and onSortChange together: the table never sorts rows itself, so the host must own both");
16
+ const controlledSort = sort !== void 0 && onSortChange !== void 0 ? {
17
+ sort,
18
+ onSortChange,
19
+ manualSort: true
20
+ } : null;
13
21
  const { rows, toggle } = useTreeRows(roots, {
14
22
  getChildren,
15
23
  getKey
@@ -20,7 +28,7 @@ function TreeDataTable({ roots, getChildren, getKey, getAriaLabel, treeColumn, c
20
28
  });
21
29
  const byNode = new Map(rows.map((row) => [row.node, row]));
22
30
  const treeColumns = columns.map((column) => {
23
- const rest = {
31
+ const rest = controlledSort ? column : {
24
32
  ...column,
25
33
  sortable: false
26
34
  };
@@ -45,6 +53,7 @@ function TreeDataTable({ roots, getChildren, getKey, getAriaLabel, treeColumn, c
45
53
  });
46
54
  return /* @__PURE__ */ jsx(DataTable, {
47
55
  ...table,
56
+ ...controlledSort,
48
57
  columns: treeColumns,
49
58
  data: rows.map((row) => row.node),
50
59
  getRowId: (node) => byNode.get(node).key
@@ -1 +1 @@
1
- {"version":3,"file":"TreeDataTable.js","names":[],"sources":["../../src/data/TreeDataTable.tsx"],"sourcesContent":["import { useTreeRows, type TreeExpansionProps, type TreeRow, type TreeRowsAccessors } from \"../lib/tree-rows\";\nimport { DataTable, type DataTableColumn, type DataTableProps } from \"./DataTable\";\nimport { TreeRowLead } from \"./MatrixTreeTable\";\n\nexport type TreeDataTableProps<T extends Record<string, unknown>> = Omit<\n DataTableProps<T>,\n \"data\" | \"columns\" | \"getRowId\" | \"grouping\" | \"groupingModes\" | \"groupingMode\" | \"defaultGroupingMode\" | \"onGroupingModeChange\" | \"defaultSort\" | \"sort\" | \"onSortChange\"\n> &\n TreeRowsAccessors<T> &\n TreeExpansionProps<T> & {\n roots: T[];\n columns: DataTableColumn<T>[];\n /** Key of the column that carries the indent and the expand/collapse chevron. */\n treeColumn: string;\n /** Names a parent node in its expand/collapse button. */\n getAriaLabel: (node: T) => string;\n };\n\n/**\n * A DataTable whose rows form a tree. Parent and leaf nodes share the columns;\n * the tree column indents each row by depth and gives parents a chevron. Tree\n * order is the row order, so sorting and grouping are not offered.\n */\nexport function TreeDataTable<T extends Record<string, unknown>>({\n roots,\n getChildren,\n getKey,\n getAriaLabel,\n treeColumn,\n columns,\n expanded,\n onExpandedChange,\n defaultExpanded,\n ...table\n}: TreeDataTableProps<T>) {\n if (!columns.some((column) => column.key === treeColumn)) {\n throw new Error(`TreeDataTable treeColumn \"${treeColumn}\" is not one of its columns`);\n }\n const { rows, toggle } = useTreeRows(roots, { getChildren, getKey }, {\n ...(expanded !== undefined ? { expanded } : {}),\n ...(onExpandedChange ? { onExpandedChange } : {}),\n ...(defaultExpanded !== undefined ? { defaultExpanded } : {}),\n });\n const byNode = new Map<T, TreeRow<T>>(rows.map((row) => [row.node, row]));\n const treeColumns = columns.map((column): DataTableColumn<T> => {\n const rest = { ...column, sortable: false };\n if (column.key !== treeColumn) return rest;\n return {\n ...rest,\n render: (value, node) => {\n const row = byNode.get(node)!;\n const content = column.render ? column.render(value, node) : String(value ?? \"\");\n return row.hasChildren\n ? <TreeRowLead depth={row.depth} open={row.open} label={getAriaLabel(node)} onToggle={() => toggle(row)}>{content}</TreeRowLead>\n : <TreeRowLead depth={row.depth}>{content}</TreeRowLead>;\n },\n };\n });\n return <DataTable<T> {...table} columns={treeColumns} data={rows.map((row) => row.node)} getRowId={(node)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M,CAAA;AACvI"}
1
+ {"version":3,"file":"TreeDataTable.js","names":[],"sources":["../../src/data/TreeDataTable.tsx"],"sourcesContent":["import type { SortState } from \"../hooks/use-sort\";\nimport { useTreeRows, type TreeExpansionProps, type TreeRow, type TreeRowsAccessors } from \"../lib/tree-rows\";\nimport { DataTable, type DataTableColumn, type DataTableProps } from \"./DataTable\";\nimport { TreeRowLead } from \"./MatrixTreeTable\";\n\nexport type TreeDataTableProps<T extends Record<string, unknown>> = Omit<\n DataTableProps<T>,\n \"data\" | \"columns\" | \"getRowId\" | \"grouping\" | \"groupingModes\" | \"groupingMode\" | \"defaultGroupingMode\" | \"onGroupingModeChange\" | \"defaultSort\" | \"sort\" | \"onSortChange\" | \"manualSort\"\n> &\n TreeRowsAccessors<T> &\n TreeExpansionProps<T> & {\n /** Siblings in the order to show them; with a controlled `sort` the host orders them. */\n roots: T[];\n /**\n * Controlled sort state for the header affordance. Always given together with `onSortChange`.\n * The table never reorders rows itself: `roots` carries the order, so the host re-orders\n * siblings (not rows across parents) when this changes.\n */\n sort?: SortState | null;\n /** Called when a sortable header changes `sort`. */\n onSortChange?: (sort: SortState | null) => void;\n columns: DataTableColumn<T>[];\n /** Key of the column that carries the indent and the expand/collapse chevron. */\n treeColumn: string;\n /** Names a parent node in its expand/collapse button. */\n getAriaLabel: (node: T) => string;\n };\n\n/**\n * A DataTable whose rows form a tree. Parent and leaf nodes share the columns;\n * the tree column indents each row by depth and gives parents a chevron. Tree\n * order is the row order, so the table never sorts or groups rows itself. A host\n * that orders siblings can pass a controlled `sort` + `onSortChange` to get\n * clickable sort headers; without them every header is inert.\n */\nexport function TreeDataTable<T extends Record<string, unknown>>({\n roots,\n getChildren,\n getKey,\n getAriaLabel,\n treeColumn,\n columns,\n expanded,\n onExpandedChange,\n defaultExpanded,\n sort,\n onSortChange,\n ...table\n}: TreeDataTableProps<T>) {\n if (!columns.some((column) => column.key === treeColumn)) {\n throw new Error(`TreeDataTable treeColumn \"${treeColumn}\" is not one of its columns`);\n }\n if ((sort === undefined) !== (onSortChange === undefined)) {\n throw new Error(\"TreeDataTable takes sort and onSortChange together: the table never sorts rows itself, so the host must own both\");\n }\n const controlledSort = sort !== undefined && onSortChange !== undefined ? { sort, onSortChange, manualSort: true } : null;\n const { rows, toggle } = useTreeRows(roots, { getChildren, getKey }, {\n ...(expanded !== undefined ? { expanded } : {}),\n ...(onExpandedChange ? { onExpandedChange } : {}),\n ...(defaultExpanded !== undefined ? { defaultExpanded } : {}),\n });\n const byNode = new Map<T, TreeRow<T>>(rows.map((row) => [row.node, row]));\n const treeColumns = columns.map((column): DataTableColumn<T> => {\n const rest = controlledSort ? column : { ...column, sortable: false };\n if (column.key !== treeColumn) return rest;\n return {\n ...rest,\n render: (value, node) => {\n const row = byNode.get(node)!;\n const content = column.render ? column.render(value, node) : String(value ?? \"\");\n return row.hasChildren\n ? <TreeRowLead depth={row.depth} open={row.open} label={getAriaLabel(node)} onToggle={() => toggle(row)}>{content}</TreeRowLead>\n : <TreeRowLead depth={row.depth}>{content}</TreeRowLead>;\n },\n };\n });\n return <DataTable<T> {...table} {...controlledSort} columns={treeColumns} data={rows.map((row) => row.node)} getRowId={(node) => byNode.get(node)!.key} />;\n}\n"],"mappings":";;;;;;;;;;;;AAmCA,SAAgB,cAAiD,EAC/D,OACA,aACA,QACA,cACA,YACA,SACA,UACA,kBACA,iBACA,MACA,cACA,GAAG,SACqB;CACxB,IAAI,CAAC,QAAQ,MAAM,WAAW,OAAO,QAAQ,UAAU,GACrD,MAAM,IAAI,MAAM,6BAA6B,WAAW,4BAA4B;CAEtF,IAAK,SAAS,KAAA,OAAgB,iBAAiB,KAAA,IAC7C,MAAM,IAAI,MAAM,kHAAkH;CAEpI,MAAM,iBAAiB,SAAS,KAAA,KAAa,iBAAiB,KAAA,IAAY;EAAE;EAAM;EAAc,YAAY;CAAK,IAAI;CACrH,MAAM,EAAE,MAAM,WAAW,YAAY,OAAO;EAAE;EAAa;CAAO,GAAG;EACnE,GAAI,aAAa,KAAA,IAAY,EAAE,SAAS,IAAI,CAAC;EAC7C,GAAI,mBAAmB,EAAE,iBAAiB,IAAI,CAAC;EAC/C,GAAI,oBAAoB,KAAA,IAAY,EAAE,gBAAgB,IAAI,CAAC;CAC7D,CAAC;CACD,MAAM,SAAS,IAAI,IAAmB,KAAK,KAAK,QAAQ,CAAC,IAAI,MAAM,GAAG,CAAC,CAAC;CACxE,MAAM,cAAc,QAAQ,KAAK,WAA+B;EAC9D,MAAM,OAAO,iBAAiB,SAAS;GAAE,GAAG;GAAQ,UAAU;EAAM;EACpE,IAAI,OAAO,QAAQ,YAAY,OAAO;EACtC,OAAO;GACL,GAAG;GACH,SAAS,OAAO,SAAS;IACvB,MAAM,MAAM,OAAO,IAAI,IAAI;IAC3B,MAAM,UAAU,OAAO,SAAS,OAAO,OAAO,OAAO,IAAI,IAAI,OAAO,SAAS,EAAE;IAC/E,OAAO,IAAI,cACP,oBAAC,aAAD;KAAa,OAAO,IAAI;KAAO,MAAM,IAAI;KAAM,OAAO,aAAa,IAAI;KAAG,gBAAgB,OAAO,GAAG;KAAI,UAAA;IAAqB,CAAA,IAC7H,oBAAC,aAAD;KAAa,OAAO,IAAI;KAAQ,UAAA;IAAqB,CAAA;GAC3D;EACF;CACF,CAAC;CACD,OAAO,oBAAC,WAAD;EAAc,GAAI;EAAO,GAAI;EAAgB,SAAS;EAAa,MAAM,KAAK,KAAK,QAAQ,IAAI,IAAI;EAAG,WAAW,SAAS,OAAO,IAAI,IAAI,CAAC,CAAE;CAAM,CAAA;AAC3J"}
@@ -12,7 +12,7 @@ function mergeChildrenByKey(loaded, sync, getKey) {
12
12
  const loadedKeys = new Set(loaded.map(getKey));
13
13
  return [...loaded.map((child) => current.get(getKey(child)) ?? child), ...sync.filter((child) => !loadedKeys.has(getKey(child)))];
14
14
  }
15
- function TreeNode({ node, depth = 0, expandAll = null, forcedOpenKeys = null, revealPath = null, revealOverrides = null, onRevealToggle, selected = null, defaultOpen, getExpanded, onExpandedChange, getChildren, getKey, getAriaLabel, onSelect, renderRow, renderDetail, renderAfterChildren, rowClass, indentPx = 16, basePaddingPx = 8, isSecondary, hasMoreChildren, loadChildren, reloadOnOpen = false, getChildrenVersion }) {
15
+ function TreeNode({ node, depth = 0, expandAll = null, forcedOpenKeys = null, revealPath = null, revealOverrides = null, onRevealToggle, selected = null, defaultOpen, collapseWhen, getExpanded, onExpandedChange, getChildren, getKey, getAriaLabel, onSelect, renderRow, renderDetail, renderAfterChildren, rowClass, indentPx = 16, basePaddingPx = 8, isSecondary, hasMoreChildren, loadChildren, reloadOnOpen = false, getChildrenVersion }) {
16
16
  if (getExpanded && !onExpandedChange) throw new Error("Controlled tree expansion requires onExpandedChange");
17
17
  const [loadedChildren, setLoadedChildren] = (0, react.useState)(null);
18
18
  const [loading, setLoading] = (0, react.useState)(false);
@@ -24,8 +24,9 @@ function TreeNode({ node, depth = 0, expandAll = null, forcedOpenKeys = null, re
24
24
  const expandable = hasChildren || lazyUnloaded || Boolean(reloadOnOpen && hasMoreChildren?.(node));
25
25
  const secondaryNode = isSecondary?.(node) ?? false;
26
26
  const childrenAllSecondary = hasChildren && isSecondary != null && children.every((c) => isSecondary(c));
27
- const skipExpandAll = secondaryNode || childrenAllSecondary || expandAll === true && lazyUnloaded;
28
- const initialOpen = expandAll !== null && !skipExpandAll ? expandAll : defaultOpen ? defaultOpen(node, depth) : depth < 1;
27
+ const collapsed = collapseWhen?.(node) ?? false;
28
+ const skipExpandAll = secondaryNode || childrenAllSecondary || expandAll === true && (lazyUnloaded || collapsed);
29
+ const initialOpen = collapsed ? false : expandAll !== null && !skipExpandAll ? expandAll : defaultOpen ? defaultOpen(node, depth) : depth < 1;
29
30
  const [open, setOpen] = (0, react.useState)(initialOpen);
30
31
  const prevExpandAll = (0, react.useRef)(getExpanded ? null : expandAll);
31
32
  const key = getKey(node);
@@ -50,6 +51,19 @@ function TreeNode({ node, depth = 0, expandAll = null, forcedOpenKeys = null, re
50
51
  onExpandedChange,
51
52
  node
52
53
  ]);
54
+ const prevCollapsed = (0, react.useRef)(collapsed);
55
+ (0, react.useEffect)(() => {
56
+ if (collapsed && !prevCollapsed.current) {
57
+ if (getExpanded) onExpandedChange(node, false);
58
+ else setOpen(false);
59
+ }
60
+ prevCollapsed.current = collapsed;
61
+ }, [
62
+ collapsed,
63
+ getExpanded,
64
+ onExpandedChange,
65
+ node
66
+ ]);
53
67
  const loadRequested = (0, react.useRef)(false);
54
68
  const nodeKey = getKey(node);
55
69
  const loadKeyRef = (0, react.useRef)(nodeKey);
@@ -173,6 +187,7 @@ function TreeNode({ node, depth = 0, expandAll = null, forcedOpenKeys = null, re
173
187
  indentPx,
174
188
  basePaddingPx,
175
189
  ...defaultOpen ? { defaultOpen } : {},
190
+ ...collapseWhen ? { collapseWhen } : {},
176
191
  ...getExpanded ? { getExpanded } : {},
177
192
  ...onExpandedChange ? { onExpandedChange } : {},
178
193
  ...renderDetail ? { renderDetail } : {},
@@ -1 +1 @@
1
- {"version":3,"file":"TreeNode.cjs","names":["useState","useRef","cn","Icon","UiChevronDown","UiChevronRight"],"sources":["../../src/data/TreeNode.tsx"],"sourcesContent":["import { useEffect, useRef, useState, type ReactNode } from \"react\";\nimport { cn } from \"../lib/utils\";\nimport { Icon } from \"./Icon\";\nimport { UiChevronDown, UiChevronRight } from \"../icons\";\n\n// A row's content column starts after the chevron (`w-3`, 12px) plus the row's\n// `gap-1.5` (6px) — fixed regardless of indentPx/basePaddingPx, since the\n// chevron/spacer width and gap are not configurable. renderDetail's wrapper\n// adds this on top of the row's own paddingLeft so it lines up under the label.\nconst ROW_CONTENT_OFFSET_PX = 18;\nexport type TreeKey = string | number;\n\nexport type TreeRowContext<T> = {\n node: T;\n depth: number;\n open: boolean;\n selected: boolean;\n hasChildren: boolean;\n toggle: () => void;\n /** True while this node's lazy children are being fetched via loadChildren. */\n loading: boolean;\n /** The rejection value from loadChildren, or null when there was no error. */\n error: unknown;\n};\n\nexport type TreeNodeProps<T> = {\n node: T;\n depth?: number;\n expandAll?: boolean | null;\n forcedOpenKeys?: Set<string | number> | null;\n revealPath?: Map<TreeKey, TreeKey | null> | null;\n revealOverrides?: Map<TreeKey, boolean> | null;\n onRevealToggle?: (key: TreeKey, open: boolean) => void;\n selected?: T | null;\n defaultOpen?: (node: T, depth: number) => boolean;\n /** Controlled expansion, shared between tree instances. Requires onExpandedChange. */\n getExpanded?: (node: T) => boolean;\n /** Receives user and bulk expansion changes for controlled trees. */\n onExpandedChange?: (node: T, expanded: boolean) => void;\n getChildren: (node: T) => T[] | undefined;\n getKey: (node: T) => string | number;\n getAriaLabel?: (node: T) => string;\n onSelect?: (node: T) => void;\n renderRow: (ctx: TreeRowContext<T>) => ReactNode;\n /**\n * Render extra content beneath a node's row and above its children (e.g. the\n * decompiled source line a call was made from). Rendered for leaf and parent\n * nodes alike, regardless of open/collapsed state, and left-aligned with the\n * row's content column (after the depth indent and chevron). Returning\n * `null`/`undefined`/`false` renders nothing — no wrapper, no extra spacing.\n * A click or keydown inside it is stopped from propagating, so it can never\n * toggle the row's expand/collapse state.\n */\n renderDetail?: (node: T) => ReactNode;\n /** Render a node's result after its children, including when the children are collapsed. */\n renderAfterChildren?: (node: T) => ReactNode;\n rowClass?: (node: T, selected: boolean) => string;\n indentPx?: number;\n basePaddingPx?: number;\n /**\n * Reports that a node has children that are not yet loaded — it renders an\n * expand chevron even when `getChildren` returns nothing. On the first open\n * the node fetches them via `loadChildren`. Without this (the default), a\n * node is expandable only when `getChildren` already returns children.\n */\n hasMoreChildren?: (node: T) => boolean;\n /**\n * Lazily fetch a node's children the first time it is opened. Resolves to the\n * child nodes (which may themselves be lazy). A rejection is surfaced to\n * `renderRow` via `ctx.error` and is not retried until the node is collapsed\n * and reopened. Required for any node `hasMoreChildren` returns true for.\n */\n loadChildren?: (node: T) => Promise<T[]>;\n /** Refresh lazy children on each manual reopen, retaining the row and its children while loading. */\n reloadOnOpen?: boolean;\n /** Host-controlled invalidation; open nodes refresh when their version changes. */\n getChildrenVersion?: (node: T) => string | number;\n /**\n * Marks a node as a **secondary child** of its parent. Secondary\n * children keep the full tree structure (they render, they can be\n * opened manually) but opt out of the bulk behaviours a caller\n * typically wants when they click the toolbar:\n *\n * - Tree-wide filter: their text is skipped during match detection\n * so typing in the search box never surfaces a row because one\n * of its secondary children happened to match.\n * - Expand all: secondary nodes stay at their default-open state\n * instead of being forced open, preventing 28k field rows from\n * flooding the viewport when an operator hits the button on a\n * schema with hundreds of tables.\n *\n * Default: every node is primary (returns false).\n */\n isSecondary?: (node: T) => boolean;\n};\n\nfunction mergeChildrenByKey<T>(loaded: T[], sync: T[] | undefined, getKey: (node: T) => TreeKey): T[] {\n if (!sync?.length) return loaded;\n const current = new Map(sync.map((child) => [getKey(child), child]));\n const loadedKeys = new Set(loaded.map(getKey));\n return [...loaded.map((child) => current.get(getKey(child)) ?? child), ...sync.filter((child) => !loadedKeys.has(getKey(child)))];\n}\n\nexport function TreeNode<T>({\n node,\n depth = 0,\n expandAll = null,\n forcedOpenKeys = null,\n revealPath = null,\n revealOverrides = null,\n onRevealToggle,\n selected = null,\n defaultOpen,\n getExpanded,\n onExpandedChange,\n getChildren,\n getKey,\n getAriaLabel,\n onSelect,\n renderRow,\n renderDetail,\n renderAfterChildren,\n rowClass,\n indentPx = 16,\n basePaddingPx = 8,\n isSecondary,\n hasMoreChildren,\n loadChildren,\n reloadOnOpen = false,\n getChildrenVersion,\n}: TreeNodeProps<T>) {\n if (getExpanded && !onExpandedChange) throw new Error(\"Controlled tree expansion requires onExpandedChange\");\n // Lazily-fetched children are the base set once a load has resolved; until\n // then `loadedChildren` is null and we use getChildren. A node can be \"lazy\"\n // (hasMoreChildren) with no sync children. The loaded copy is a snapshot, so\n // the host's current sync children win by key (fresh `active`, `to`, ...) and\n // sync-only children are appended rather than hidden behind the stale snapshot.\n const [loadedChildren, setLoadedChildren] = useState<T[] | null>(null);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<unknown>(null);\n const syncChildren = getChildren(node);\n const children = loadedChildren === null ? syncChildren : mergeChildrenByKey(loadedChildren, syncChildren, getKey);\n const hasChildren = (children?.length ?? 0) > 0;\n const lazyUnloaded = (hasMoreChildren?.(node) ?? false) && loadedChildren === null;\n // The chevron shows when there is something to reveal: either real children\n // are present, or the node is lazy and has not been loaded yet.\n const expandable = hasChildren || lazyUnloaded || Boolean(reloadOnOpen && hasMoreChildren?.(node));\n // A node opts out of bulk expand-all in two distinct cases:\n //\n // 1. The node itself is secondary (its edge from the parent is\n // secondary) — rare at the root, but the rule is symmetric.\n // 2. All of the node's children are secondary — the common case.\n // This is what keeps an \"Expand all\" on a schema tree from\n // flooding the viewport with every table's field rows: the\n // table opens to nothing structural worth seeing in bulk, so\n // we leave it closed until the operator clicks it manually.\n //\n // In both cases the manual toggle still works, and filter matches\n // still force the row open via forcedOpenKeys, so users never\n // lose access — they just don't get auto-flooded.\n const secondaryNode = isSecondary?.(node) ?? false;\n const childrenAllSecondary =\n hasChildren && isSecondary != null && children!.every((c) => isSecondary(c));\n // An unloaded lazy node never opens in bulk either: opening it would fetch,\n // and bulk operations never trigger loads. Collapse-all still closes it.\n const skipExpandAll = secondaryNode || childrenAllSecondary || (expandAll === true && lazyUnloaded);\n // A non-null `expandAll` is a live bulk state, not just a one-off change\n // signal: a node mounted *while* expand-all is active (because an ancestor\n // just opened) inherits it as its initial open state, so opening a parent\n // cascades all the way down — expand/collapse-all are recursive. The\n // skipExpandAll guard keeps secondary subtrees from auto-flooding. When\n // expandAll is null (before any toolbar click) we fall back to defaultOpen.\n const initialOpen =\n expandAll !== null && !skipExpandAll\n ? expandAll\n : defaultOpen\n ? defaultOpen(node, depth)\n : depth < 1;\n const [open, setOpen] = useState(initialOpen);\n const prevExpandAll = useRef(getExpanded ? null : expandAll);\n const key = getKey(node);\n const isSelected = selected != null && getKey(selected) === key;\n const isForcedOpen = forcedOpenKeys?.has(key) ?? false;\n // Only the selection's ancestors are on the reveal path; the selected node\n // itself (mapped to null) keeps its own expansion.\n const revealNextKey = revealPath?.get(key) ?? null;\n const isOnRevealPath = revealNextKey !== null;\n const revealOverride = revealOverrides?.get(key);\n const ownOpen = getExpanded ? getExpanded(node) : open;\n // An ancestor that is already open keeps all its children; only a closed one\n // opens to just the next path node.\n const pathOnly = isOnRevealPath && revealOverride === undefined && !ownOpen;\n const isOpen = isForcedOpen || pathOnly || (revealOverride ?? ownOpen);\n\n useEffect(() => {\n if (expandAll !== null && expandAll !== prevExpandAll.current && !skipExpandAll) {\n if (getExpanded) onExpandedChange!(node, expandAll);\n else setOpen(expandAll);\n }\n prevExpandAll.current = expandAll;\n }, [expandAll, skipExpandAll, getExpanded, onExpandedChange, node]);\n\n // Guards a lazy fetch so a node loads its children at most once per mount and\n // a resolution arriving after the node was reused (key changed) is ignored.\n const loadRequested = useRef(false);\n const nodeKey = getKey(node);\n const loadKeyRef = useRef(nodeKey);\n const loadGeneration = useRef(0);\n const childrenVersion = getChildrenVersion?.(node);\n const previousChildrenVersion = useRef(childrenVersion);\n\n function loadLazyChildren() {\n if (!loadChildren || loadRequested.current) return;\n loadRequested.current = true;\n const generation = ++loadGeneration.current;\n loadKeyRef.current = nodeKey;\n setLoading(true);\n setError(null);\n loadChildren(node)\n .then((kids) => {\n if (loadKeyRef.current !== nodeKey || generation !== loadGeneration.current) return;\n setLoadedChildren(kids);\n setLoading(false);\n })\n .catch((err) => {\n if (loadKeyRef.current !== nodeKey || generation !== loadGeneration.current) return;\n // Surfaced to renderRow via ctx.error; allow a retry on re-toggle.\n loadRequested.current = false;\n setError(err);\n setLoading(false);\n });\n }\n\n // A lazy node can be open without ever having been clicked — defaultOpen said\n // so, expand-all did, or the filter forced it open to reveal a match. Loading\n // only on the open transition would leave every one of those showing a caret\n // over nothing.\n //\n // A node that already failed is skipped: loadLazyChildren clears its own retry\n // guard on failure so a re-toggle can try again, and re-running here would\n // turn that into an unbounded retry loop instead.\n useEffect(() => {\n if (isOpen && lazyUnloaded && error === null) loadLazyChildren();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isOpen, lazyUnloaded, error]);\n\n useEffect(() => {\n if (!getChildrenVersion || previousChildrenVersion.current === childrenVersion) return;\n previousChildrenVersion.current = childrenVersion;\n loadRequested.current = false;\n if (isOpen && hasMoreChildren?.(node)) loadLazyChildren();\n // The host version, rather than callback identity, invalidates this node.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [childrenVersion]);\n\n useEffect(() => () => { loadGeneration.current++; loadRequested.current = false; }, []);\n\n function toggle() {\n if (!expandable) return;\n if (isOnRevealPath) {\n if (!onRevealToggle) throw new Error(\"A revealed tree path requires onRevealToggle\");\n const next = pathOnly || !(revealOverride ?? ownOpen);\n if (next && lazyUnloaded) loadLazyChildren();\n onRevealToggle(key, next);\n return;\n }\n const next = !ownOpen;\n if (next && reloadOnOpen && hasMoreChildren?.(node)) loadRequested.current = false;\n if (next && (lazyUnloaded || reloadOnOpen)) loadLazyChildren();\n if (getExpanded) onExpandedChange!(node, next);\n else setOpen(next);\n }\n\n const defaultRowBg = isSelected ? \"bg-primary/10 border-l-2 border-primary\" : \"hover:bg-accent\";\n const rowClassName = rowClass ? rowClass(node, isSelected) : defaultRowBg;\n const detail = renderDetail?.(node);\n const afterChildren = renderAfterChildren?.(node);\n\n return (\n <div\n role=\"treeitem\"\n aria-label={getAriaLabel?.(node)}\n aria-expanded={expandable ? isOpen : undefined}\n aria-selected={isSelected}\n >\n <div\n className={cn(\"flex items-center gap-1.5 py-1 px-2 cursor-pointer text-sm\", rowClassName)}\n style={{ paddingLeft: `${depth * indentPx + basePaddingPx}px` }}\n onClick={(e) => {\n e.stopPropagation();\n onSelect?.(node);\n toggle();\n }}\n >\n {expandable ? (\n <button\n type=\"button\"\n aria-label={pathOnly ? \"Show all children\" : isOpen ? \"Collapse\" : \"Expand\"}\n // The caret only toggles expansion — stopPropagation keeps the row's\n // onClick (which selects) from firing, so expanding a node never\n // selects it.\n onClick={(e) => {\n e.stopPropagation();\n toggle();\n }}\n className=\"flex shrink-0 items-center text-muted-foreground\"\n >\n <Icon icon={isOpen && !pathOnly ? UiChevronDown : UiChevronRight} className=\"text-xs w-3\" />\n </button>\n ) : (\n <span className=\"w-3 shrink-0\" aria-hidden />\n )}\n {renderRow({\n node,\n depth,\n open: isOpen,\n selected: isSelected,\n hasChildren,\n toggle,\n loading,\n error,\n })}\n </div>\n {detail != null && detail !== false && (\n <div\n className=\"pb-1 pr-2\"\n style={{ paddingLeft: `${depth * indentPx + basePaddingPx + ROW_CONTENT_OFFSET_PX}px` }}\n onClick={(e) => e.stopPropagation()}\n onKeyDown={(e) => e.stopPropagation()}\n >\n {detail}\n </div>\n )}\n {isOpen && hasChildren && (\n <div role=\"group\">\n {(pathOnly ? children!.filter((child) => getKey(child) === revealNextKey) : children!).map((child) => (\n <TreeNode\n key={getKey(child)}\n node={child}\n depth={depth + 1}\n expandAll={expandAll}\n forcedOpenKeys={forcedOpenKeys}\n revealPath={revealPath}\n revealOverrides={revealOverrides}\n {...(onRevealToggle ? { onRevealToggle } : {})}\n selected={selected}\n getChildren={getChildren}\n getKey={getKey}\n renderRow={renderRow}\n indentPx={indentPx}\n basePaddingPx={basePaddingPx}\n {...(defaultOpen ? { defaultOpen } : {})}\n {...(getExpanded ? { getExpanded } : {})}\n {...(onExpandedChange ? { onExpandedChange } : {})}\n {...(renderDetail ? { renderDetail } : {})}\n {...(renderAfterChildren ? { renderAfterChildren } : {})}\n {...(getAriaLabel ? { getAriaLabel } : {})}\n {...(onSelect ? { onSelect } : {})}\n {...(rowClass ? { rowClass } : {})}\n {...(isSecondary ? { isSecondary } : {})}\n {...(hasMoreChildren ? { hasMoreChildren } : {})}\n {...(loadChildren ? { loadChildren } : {})}\n reloadOnOpen={reloadOnOpen}\n {...(getChildrenVersion ? { getChildrenVersion } : {})}\n />\n ))}\n </div>\n )}\n {afterChildren != null && afterChildren !== false && (\n <div\n className=\"pb-1 pr-2\"\n style={{ paddingLeft: `${depth * indentPx + basePaddingPx + ROW_CONTENT_OFFSET_PX}px`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AAgB;IAEnC,UAAA;GACE,CAAA;EAEJ;;AAET"}
1
+ {"version":3,"file":"TreeNode.cjs","names":["useState","useRef","cn","Icon","UiChevronDown","UiChevronRight"],"sources":["../../src/data/TreeNode.tsx"],"sourcesContent":["import { useEffect, useRef, useState, type ReactNode } from \"react\";\nimport { cn } from \"../lib/utils\";\nimport { Icon } from \"./Icon\";\nimport { UiChevronDown, UiChevronRight } from \"../icons\";\n\n// A row's content column starts after the chevron (`w-3`, 12px) plus the row's\n// `gap-1.5` (6px) — fixed regardless of indentPx/basePaddingPx, since the\n// chevron/spacer width and gap are not configurable. renderDetail's wrapper\n// adds this on top of the row's own paddingLeft so it lines up under the label.\nconst ROW_CONTENT_OFFSET_PX = 18;\nexport type TreeKey = string | number;\n\nexport type TreeRowContext<T> = {\n node: T;\n depth: number;\n open: boolean;\n selected: boolean;\n hasChildren: boolean;\n toggle: () => void;\n /** True while this node's lazy children are being fetched via loadChildren. */\n loading: boolean;\n /** The rejection value from loadChildren, or null when there was no error. */\n error: unknown;\n};\n\nexport type TreeNodeProps<T> = {\n node: T;\n depth?: number;\n expandAll?: boolean | null;\n forcedOpenKeys?: Set<string | number> | null;\n revealPath?: Map<TreeKey, TreeKey | null> | null;\n revealOverrides?: Map<TreeKey, boolean> | null;\n onRevealToggle?: (key: TreeKey, open: boolean) => void;\n selected?: T | null;\n defaultOpen?: (node: T, depth: number) => boolean;\n /**\n * Closes the node whenever this turns true (e.g. a step that just finished\n * successfully). A node that mounts with it already true starts closed and\n * stays out of a bulk Expand all; clicking it still opens it.\n */\n collapseWhen?: (node: T) => boolean;\n /** Controlled expansion, shared between tree instances. Requires onExpandedChange. */\n getExpanded?: (node: T) => boolean;\n /** Receives user and bulk expansion changes for controlled trees. */\n onExpandedChange?: (node: T, expanded: boolean) => void;\n getChildren: (node: T) => T[] | undefined;\n getKey: (node: T) => string | number;\n getAriaLabel?: (node: T) => string;\n onSelect?: (node: T) => void;\n renderRow: (ctx: TreeRowContext<T>) => ReactNode;\n /**\n * Render extra content beneath a node's row and above its children (e.g. the\n * decompiled source line a call was made from). Rendered for leaf and parent\n * nodes alike, regardless of open/collapsed state, and left-aligned with the\n * row's content column (after the depth indent and chevron). Returning\n * `null`/`undefined`/`false` renders nothing — no wrapper, no extra spacing.\n * A click or keydown inside it is stopped from propagating, so it can never\n * toggle the row's expand/collapse state.\n */\n renderDetail?: (node: T) => ReactNode;\n /** Render a node's result after its children, including when the children are collapsed. */\n renderAfterChildren?: (node: T) => ReactNode;\n rowClass?: (node: T, selected: boolean) => string;\n indentPx?: number;\n basePaddingPx?: number;\n /**\n * Reports that a node has children that are not yet loaded — it renders an\n * expand chevron even when `getChildren` returns nothing. On the first open\n * the node fetches them via `loadChildren`. Without this (the default), a\n * node is expandable only when `getChildren` already returns children.\n */\n hasMoreChildren?: (node: T) => boolean;\n /**\n * Lazily fetch a node's children the first time it is opened. Resolves to the\n * child nodes (which may themselves be lazy). A rejection is surfaced to\n * `renderRow` via `ctx.error` and is not retried until the node is collapsed\n * and reopened. Required for any node `hasMoreChildren` returns true for.\n */\n loadChildren?: (node: T) => Promise<T[]>;\n /** Refresh lazy children on each manual reopen, retaining the row and its children while loading. */\n reloadOnOpen?: boolean;\n /** Host-controlled invalidation; open nodes refresh when their version changes. */\n getChildrenVersion?: (node: T) => string | number;\n /**\n * Marks a node as a **secondary child** of its parent. Secondary\n * children keep the full tree structure (they render, they can be\n * opened manually) but opt out of the bulk behaviours a caller\n * typically wants when they click the toolbar:\n *\n * - Tree-wide filter: their text is skipped during match detection\n * so typing in the search box never surfaces a row because one\n * of its secondary children happened to match.\n * - Expand all: secondary nodes stay at their default-open state\n * instead of being forced open, preventing 28k field rows from\n * flooding the viewport when an operator hits the button on a\n * schema with hundreds of tables.\n *\n * Default: every node is primary (returns false).\n */\n isSecondary?: (node: T) => boolean;\n};\n\nfunction mergeChildrenByKey<T>(loaded: T[], sync: T[] | undefined, getKey: (node: T) => TreeKey): T[] {\n if (!sync?.length) return loaded;\n const current = new Map(sync.map((child) => [getKey(child), child]));\n const loadedKeys = new Set(loaded.map(getKey));\n return [...loaded.map((child) => current.get(getKey(child)) ?? child), ...sync.filter((child) => !loadedKeys.has(getKey(child)))];\n}\n\nexport function TreeNode<T>({\n node,\n depth = 0,\n expandAll = null,\n forcedOpenKeys = null,\n revealPath = null,\n revealOverrides = null,\n onRevealToggle,\n selected = null,\n defaultOpen,\n collapseWhen,\n getExpanded,\n onExpandedChange,\n getChildren,\n getKey,\n getAriaLabel,\n onSelect,\n renderRow,\n renderDetail,\n renderAfterChildren,\n rowClass,\n indentPx = 16,\n basePaddingPx = 8,\n isSecondary,\n hasMoreChildren,\n loadChildren,\n reloadOnOpen = false,\n getChildrenVersion,\n}: TreeNodeProps<T>) {\n if (getExpanded && !onExpandedChange) throw new Error(\"Controlled tree expansion requires onExpandedChange\");\n // Lazily-fetched children are the base set once a load has resolved; until\n // then `loadedChildren` is null and we use getChildren. A node can be \"lazy\"\n // (hasMoreChildren) with no sync children. The loaded copy is a snapshot, so\n // the host's current sync children win by key (fresh `active`, `to`, ...) and\n // sync-only children are appended rather than hidden behind the stale snapshot.\n const [loadedChildren, setLoadedChildren] = useState<T[] | null>(null);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<unknown>(null);\n const syncChildren = getChildren(node);\n const children = loadedChildren === null ? syncChildren : mergeChildrenByKey(loadedChildren, syncChildren, getKey);\n const hasChildren = (children?.length ?? 0) > 0;\n const lazyUnloaded = (hasMoreChildren?.(node) ?? false) && loadedChildren === null;\n // The chevron shows when there is something to reveal: either real children\n // are present, or the node is lazy and has not been loaded yet.\n const expandable = hasChildren || lazyUnloaded || Boolean(reloadOnOpen && hasMoreChildren?.(node));\n // A node opts out of bulk expand-all in two distinct cases:\n //\n // 1. The node itself is secondary (its edge from the parent is\n // secondary) — rare at the root, but the rule is symmetric.\n // 2. All of the node's children are secondary — the common case.\n // This is what keeps an \"Expand all\" on a schema tree from\n // flooding the viewport with every table's field rows: the\n // table opens to nothing structural worth seeing in bulk, so\n // we leave it closed until the operator clicks it manually.\n //\n // In both cases the manual toggle still works, and filter matches\n // still force the row open via forcedOpenKeys, so users never\n // lose access — they just don't get auto-flooded.\n const secondaryNode = isSecondary?.(node) ?? false;\n const childrenAllSecondary =\n hasChildren && isSecondary != null && children!.every((c) => isSecondary(c));\n // An unloaded lazy node never opens in bulk either: opening it would fetch,\n // and bulk operations never trigger loads. Collapse-all still closes it.\n const collapsed = collapseWhen?.(node) ?? false;\n const skipExpandAll = secondaryNode || childrenAllSecondary || (expandAll === true && (lazyUnloaded || collapsed));\n // A non-null `expandAll` is a live bulk state, not just a one-off change\n // signal: a node mounted *while* expand-all is active (because an ancestor\n // just opened) inherits it as its initial open state, so opening a parent\n // cascades all the way down — expand/collapse-all are recursive. The\n // skipExpandAll guard keeps secondary subtrees from auto-flooding. When\n // expandAll is null (before any toolbar click) we fall back to defaultOpen.\n const initialOpen = collapsed\n ? false\n : expandAll !== null && !skipExpandAll\n ? expandAll\n : defaultOpen\n ? defaultOpen(node, depth)\n : depth < 1;\n const [open, setOpen] = useState(initialOpen);\n const prevExpandAll = useRef(getExpanded ? null : expandAll);\n const key = getKey(node);\n const isSelected = selected != null && getKey(selected) === key;\n const isForcedOpen = forcedOpenKeys?.has(key) ?? false;\n // Only the selection's ancestors are on the reveal path; the selected node\n // itself (mapped to null) keeps its own expansion.\n const revealNextKey = revealPath?.get(key) ?? null;\n const isOnRevealPath = revealNextKey !== null;\n const revealOverride = revealOverrides?.get(key);\n const ownOpen = getExpanded ? getExpanded(node) : open;\n // An ancestor that is already open keeps all its children; only a closed one\n // opens to just the next path node.\n const pathOnly = isOnRevealPath && revealOverride === undefined && !ownOpen;\n const isOpen = isForcedOpen || pathOnly || (revealOverride ?? ownOpen);\n\n useEffect(() => {\n if (expandAll !== null && expandAll !== prevExpandAll.current && !skipExpandAll) {\n if (getExpanded) onExpandedChange!(node, expandAll);\n else setOpen(expandAll);\n }\n prevExpandAll.current = expandAll;\n }, [expandAll, skipExpandAll, getExpanded, onExpandedChange, node]);\n\n const prevCollapsed = useRef(collapsed);\n useEffect(() => {\n if (collapsed && !prevCollapsed.current) {\n if (getExpanded) onExpandedChange!(node, false);\n else setOpen(false);\n }\n prevCollapsed.current = collapsed;\n }, [collapsed, getExpanded, onExpandedChange, node]);\n\n // Guards a lazy fetch so a node loads its children at most once per mount and\n // a resolution arriving after the node was reused (key changed) is ignored.\n const loadRequested = useRef(false);\n const nodeKey = getKey(node);\n const loadKeyRef = useRef(nodeKey);\n const loadGeneration = useRef(0);\n const childrenVersion = getChildrenVersion?.(node);\n const previousChildrenVersion = useRef(childrenVersion);\n\n function loadLazyChildren() {\n if (!loadChildren || loadRequested.current) return;\n loadRequested.current = true;\n const generation = ++loadGeneration.current;\n loadKeyRef.current = nodeKey;\n setLoading(true);\n setError(null);\n loadChildren(node)\n .then((kids) => {\n if (loadKeyRef.current !== nodeKey || generation !== loadGeneration.current) return;\n setLoadedChildren(kids);\n setLoading(false);\n })\n .catch((err) => {\n if (loadKeyRef.current !== nodeKey || generation !== loadGeneration.current) return;\n // Surfaced to renderRow via ctx.error; allow a retry on re-toggle.\n loadRequested.current = false;\n setError(err);\n setLoading(false);\n });\n }\n\n // A lazy node can be open without ever having been clicked — defaultOpen said\n // so, expand-all did, or the filter forced it open to reveal a match. Loading\n // only on the open transition would leave every one of those showing a caret\n // over nothing.\n //\n // A node that already failed is skipped: loadLazyChildren clears its own retry\n // guard on failure so a re-toggle can try again, and re-running here would\n // turn that into an unbounded retry loop instead.\n useEffect(() => {\n if (isOpen && lazyUnloaded && error === null) loadLazyChildren();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isOpen, lazyUnloaded, error]);\n\n useEffect(() => {\n if (!getChildrenVersion || previousChildrenVersion.current === childrenVersion) return;\n previousChildrenVersion.current = childrenVersion;\n loadRequested.current = false;\n if (isOpen && hasMoreChildren?.(node)) loadLazyChildren();\n // The host version, rather than callback identity, invalidates this node.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [childrenVersion]);\n\n useEffect(() => () => { loadGeneration.current++; loadRequested.current = false; }, []);\n\n function toggle() {\n if (!expandable) return;\n if (isOnRevealPath) {\n if (!onRevealToggle) throw new Error(\"A revealed tree path requires onRevealToggle\");\n const next = pathOnly || !(revealOverride ?? ownOpen);\n if (next && lazyUnloaded) loadLazyChildren();\n onRevealToggle(key, next);\n return;\n }\n const next = !ownOpen;\n if (next && reloadOnOpen && hasMoreChildren?.(node)) loadRequested.current = false;\n if (next && (lazyUnloaded || reloadOnOpen)) loadLazyChildren();\n if (getExpanded) onExpandedChange!(node, next);\n else setOpen(next);\n }\n\n const defaultRowBg = isSelected ? \"bg-primary/10 border-l-2 border-primary\" : \"hover:bg-accent\";\n const rowClassName = rowClass ? rowClass(node, isSelected) : defaultRowBg;\n const detail = renderDetail?.(node);\n const afterChildren = renderAfterChildren?.(node);\n\n return (\n <div\n role=\"treeitem\"\n aria-label={getAriaLabel?.(node)}\n aria-expanded={expandable ? isOpen : undefined}\n aria-selected={isSelected}\n >\n <div\n className={cn(\"flex items-center gap-1.5 py-1 px-2 cursor-pointer text-sm\", rowClassName)}\n style={{ paddingLeft: `${depth * indentPx + basePaddingPx}px` }}\n onClick={(e) => {\n e.stopPropagation();\n onSelect?.(node);\n toggle();\n }}\n >\n {expandable ? (\n <button\n type=\"button\"\n aria-label={pathOnly ? \"Show all children\" : isOpen ? \"Collapse\" : \"Expand\"}\n // The caret only toggles expansion — stopPropagation keeps the row's\n // onClick (which selects) from firing, so expanding a node never\n // selects it.\n onClick={(e) => {\n e.stopPropagation();\n toggle();\n }}\n className=\"flex shrink-0 items-center text-muted-foreground\"\n >\n <Icon icon={isOpen && !pathOnly ? UiChevronDown : UiChevronRight} className=\"text-xs w-3\" />\n </button>\n ) : (\n <span className=\"w-3 shrink-0\" aria-hidden />\n )}\n {renderRow({\n node,\n depth,\n open: isOpen,\n selected: isSelected,\n hasChildren,\n toggle,\n loading,\n error,\n })}\n </div>\n {detail != null && detail !== false && (\n <div\n className=\"pb-1 pr-2\"\n style={{ paddingLeft: `${depth * indentPx + basePaddingPx + ROW_CONTENT_OFFSET_PX}px` }}\n onClick={(e) => e.stopPropagation()}\n onKeyDown={(e) => e.stopPropagation()}\n >\n {detail}\n </div>\n )}\n {isOpen && hasChildren && (\n <div role=\"group\">\n {(pathOnly ? children!.filter((child) => getKey(child) === revealNextKey) : children!).map((child) => (\n <TreeNode\n key={getKey(child)}\n node={child}\n depth={depth + 1}\n expandAll={expandAll}\n forcedOpenKeys={forcedOpenKeys}\n revealPath={revealPath}\n revealOverrides={revealOverrides}\n {...(onRevealToggle ? { onRevealToggle } : {})}\n selected={selected}\n getChildren={getChildren}\n getKey={getKey}\n renderRow={renderRow}\n indentPx={indentPx}\n basePaddingPx={basePaddingPx}\n {...(defaultOpen ? { defaultOpen } : {})}\n {...(collapseWhen ? { collapseWhen } : {})}\n {...(getExpanded ? { getExpanded } : {})}\n {...(onExpandedChange ? { onExpandedChange } : {})}\n {...(renderDetail ? { renderDetail } : {})}\n {...(renderAfterChildren ? { renderAfterChildren } : {})}\n {...(getAriaLabel ? { getAriaLabel } : {})}\n {...(onSelect ? { onSelect } : {})}\n {...(rowClass ? { rowClass } : {})}\n {...(isSecondary ? { isSecondary } : {})}\n {...(hasMoreChildren ? { hasMoreChildren } : {})}\n {...(loadChildren ? { loadChildren } : {})}\n reloadOnOpen={reloadOnOpen}\n {...(getChildrenVersion ? { getChildrenVersion } : {})}\n />\n ))}\n </div>\n )}\n {afterChildren != null && afterChildren !== false && (\n <div\n className=\"pb-1 pr-2\"\n style={{ paddingLeft: `${depth * indentPx + basePaddingPx + ROW_CONTENT_OFFSET_PX}px` }}\n onClick={(e) => e.stopPropagation()}\n onKeyDown={(e) => e.stopPropagation()}\n >\n {afterChildren}\n </div>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;AASA,IAAM,wBAAwB;AA6F9B,SAAS,mBAAsB,QAAa,MAAuB,QAAmC;CACpG,IAAI,C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AAA,GAAA,kBAAA,IAAA,CAAC,OAAD;IACE,WAAU;IACV,OAAO,EAAE,aAAa,GAAG,QAAQ,WAAW,gBAAgB,sBAAsB,IAAI;IACtF,UAAU,MAAM,EAAE,gBAAgB;IAClC,YAAY,MAAM,EAAE,gBAAgB;IAEnC,UAAA;GACE,CAAA;EAEJ;;AAET"}
@@ -22,6 +22,12 @@ export type TreeNodeProps<T> = {
22
22
  onRevealToggle?: (key: TreeKey, open: boolean) => void;
23
23
  selected?: T | null;
24
24
  defaultOpen?: (node: T, depth: number) => boolean;
25
+ /**
26
+ * Closes the node whenever this turns true (e.g. a step that just finished
27
+ * successfully). A node that mounts with it already true starts closed and
28
+ * stays out of a bulk Expand all; clicking it still opens it.
29
+ */
30
+ collapseWhen?: (node: T) => boolean;
25
31
  /** Controlled expansion, shared between tree instances. Requires onExpandedChange. */
26
32
  getExpanded?: (node: T) => boolean;
27
33
  /** Receives user and bulk expansion changes for controlled trees. */
@@ -82,5 +88,5 @@ export type TreeNodeProps<T> = {
82
88
  */
83
89
  isSecondary?: (node: T) => boolean;
84
90
  };
85
- export declare function TreeNode<T>({ node, depth, expandAll, forcedOpenKeys, revealPath, revealOverrides, onRevealToggle, selected, defaultOpen, getExpanded, onExpandedChange, getChildren, getKey, getAriaLabel, onSelect, renderRow, renderDetail, renderAfterChildren, rowClass, indentPx, basePaddingPx, isSecondary, hasMoreChildren, loadChildren, reloadOnOpen, getChildrenVersion, }: TreeNodeProps<T>): import("react").JSX.Element;
91
+ export declare function TreeNode<T>({ node, depth, expandAll, forcedOpenKeys, revealPath, revealOverrides, onRevealToggle, selected, defaultOpen, collapseWhen, getExpanded, onExpandedChange, getChildren, getKey, getAriaLabel, onSelect, renderRow, renderDetail, renderAfterChildren, rowClass, indentPx, basePaddingPx, isSecondary, hasMoreChildren, loadChildren, reloadOnOpen, getChildrenVersion, }: TreeNodeProps<T>): import("react").JSX.Element;
86
92
  //# sourceMappingURL=TreeNode.d.ts.map
@@ -1 +1 @@
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K,MAAM,CAAC;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC;IACvC;;;;;OAKG;IACH,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;IACzC,qGAAqG;IACrG,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,mFAAmF;IACnF,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,GAAG,MAAM,CAAC;IAClD;;;;;;;;;;;;;;;OAeG;IACH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC;CACpC,CAAC;AASF,wBAAgB,QAAQ,CAAC,CAAC,EAAE,EAC1B,IAAI,EACJ,KAAS,EACT,SAAgB,EAChB,cAAqB,EACrB,UAAiB,EACjB,eAAsB,EACtB,cAAc,EACd,QAAe,EACf,WAAW,EACX,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,MAAM,EACN,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,mBAAmB,EACnB,QAAQ,EACR,QAAa,EACb,aAAiB,EACjB,WAAW,EACX,eAAe,EACf,YAAY,EACZ,YAAoB,EACpB,kBAAkB,GACnB,EAAE,aAAa,CAAC,CAAC,CAAC,+BAsQlB"}
@@ -12,7 +12,7 @@ function mergeChildrenByKey(loaded, sync, getKey) {
12
12
  const loadedKeys = new Set(loaded.map(getKey));
13
13
  return [...loaded.map((child) => current.get(getKey(child)) ?? child), ...sync.filter((child) => !loadedKeys.has(getKey(child)))];
14
14
  }
15
- function TreeNode({ node, depth = 0, expandAll = null, forcedOpenKeys = null, revealPath = null, revealOverrides = null, onRevealToggle, selected = null, defaultOpen, getExpanded, onExpandedChange, getChildren, getKey, getAriaLabel, onSelect, renderRow, renderDetail, renderAfterChildren, rowClass, indentPx = 16, basePaddingPx = 8, isSecondary, hasMoreChildren, loadChildren, reloadOnOpen = false, getChildrenVersion }) {
15
+ function TreeNode({ node, depth = 0, expandAll = null, forcedOpenKeys = null, revealPath = null, revealOverrides = null, onRevealToggle, selected = null, defaultOpen, collapseWhen, getExpanded, onExpandedChange, getChildren, getKey, getAriaLabel, onSelect, renderRow, renderDetail, renderAfterChildren, rowClass, indentPx = 16, basePaddingPx = 8, isSecondary, hasMoreChildren, loadChildren, reloadOnOpen = false, getChildrenVersion }) {
16
16
  if (getExpanded && !onExpandedChange) throw new Error("Controlled tree expansion requires onExpandedChange");
17
17
  const [loadedChildren, setLoadedChildren] = useState(null);
18
18
  const [loading, setLoading] = useState(false);
@@ -24,8 +24,9 @@ function TreeNode({ node, depth = 0, expandAll = null, forcedOpenKeys = null, re
24
24
  const expandable = hasChildren || lazyUnloaded || Boolean(reloadOnOpen && hasMoreChildren?.(node));
25
25
  const secondaryNode = isSecondary?.(node) ?? false;
26
26
  const childrenAllSecondary = hasChildren && isSecondary != null && children.every((c) => isSecondary(c));
27
- const skipExpandAll = secondaryNode || childrenAllSecondary || expandAll === true && lazyUnloaded;
28
- const initialOpen = expandAll !== null && !skipExpandAll ? expandAll : defaultOpen ? defaultOpen(node, depth) : depth < 1;
27
+ const collapsed = collapseWhen?.(node) ?? false;
28
+ const skipExpandAll = secondaryNode || childrenAllSecondary || expandAll === true && (lazyUnloaded || collapsed);
29
+ const initialOpen = collapsed ? false : expandAll !== null && !skipExpandAll ? expandAll : defaultOpen ? defaultOpen(node, depth) : depth < 1;
29
30
  const [open, setOpen] = useState(initialOpen);
30
31
  const prevExpandAll = useRef(getExpanded ? null : expandAll);
31
32
  const key = getKey(node);
@@ -50,6 +51,19 @@ function TreeNode({ node, depth = 0, expandAll = null, forcedOpenKeys = null, re
50
51
  onExpandedChange,
51
52
  node
52
53
  ]);
54
+ const prevCollapsed = useRef(collapsed);
55
+ useEffect(() => {
56
+ if (collapsed && !prevCollapsed.current) {
57
+ if (getExpanded) onExpandedChange(node, false);
58
+ else setOpen(false);
59
+ }
60
+ prevCollapsed.current = collapsed;
61
+ }, [
62
+ collapsed,
63
+ getExpanded,
64
+ onExpandedChange,
65
+ node
66
+ ]);
53
67
  const loadRequested = useRef(false);
54
68
  const nodeKey = getKey(node);
55
69
  const loadKeyRef = useRef(nodeKey);
@@ -173,6 +187,7 @@ function TreeNode({ node, depth = 0, expandAll = null, forcedOpenKeys = null, re
173
187
  indentPx,
174
188
  basePaddingPx,
175
189
  ...defaultOpen ? { defaultOpen } : {},
190
+ ...collapseWhen ? { collapseWhen } : {},
176
191
  ...getExpanded ? { getExpanded } : {},
177
192
  ...onExpandedChange ? { onExpandedChange } : {},
178
193
  ...renderDetail ? { renderDetail } : {},