@flanksource/clicky-ui 0.3.25 → 0.3.26

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 (470) hide show
  1. package/NOTICE.md +1 -0
  2. package/dist/ai.cjs +4 -0
  3. package/dist/ai.cjs.map +1 -1
  4. package/dist/ai.js +6 -2
  5. package/dist/ai.js.map +1 -1
  6. package/dist/chat.cjs +8 -0
  7. package/dist/chat.cjs.map +1 -1
  8. package/dist/chat.js +9 -1
  9. package/dist/chat.js.map +1 -1
  10. package/dist/comments/CommentCard.cjs +89 -14
  11. package/dist/comments/CommentCard.cjs.map +1 -1
  12. package/dist/comments/CommentCard.d.ts.map +1 -1
  13. package/dist/comments/CommentCard.js +90 -15
  14. package/dist/comments/CommentCard.js.map +1 -1
  15. package/dist/comments/CommentComposer.cjs +25 -2
  16. package/dist/comments/CommentComposer.cjs.map +1 -1
  17. package/dist/comments/CommentComposer.d.ts.map +1 -1
  18. package/dist/comments/CommentComposer.js +25 -2
  19. package/dist/comments/CommentComposer.js.map +1 -1
  20. package/dist/comments/CommentProvider.cjs +21 -14
  21. package/dist/comments/CommentProvider.cjs.map +1 -1
  22. package/dist/comments/CommentProvider.d.ts +1 -1
  23. package/dist/comments/CommentProvider.d.ts.map +1 -1
  24. package/dist/comments/CommentProvider.js +21 -14
  25. package/dist/comments/CommentProvider.js.map +1 -1
  26. package/dist/comments/CommentSidePanel.cjs +1 -1
  27. package/dist/comments/CommentSidePanel.cjs.map +1 -1
  28. package/dist/comments/CommentSidePanel.js +1 -1
  29. package/dist/comments/CommentSidePanel.js.map +1 -1
  30. package/dist/comments/comment-types.cjs.map +1 -1
  31. package/dist/comments/comment-types.d.ts +6 -0
  32. package/dist/comments/comment-types.d.ts.map +1 -1
  33. package/dist/comments/comment-types.js.map +1 -1
  34. package/dist/components/DimensionField.cjs +56 -0
  35. package/dist/components/DimensionField.cjs.map +1 -0
  36. package/dist/components/DimensionField.d.ts +17 -0
  37. package/dist/components/DimensionField.d.ts.map +1 -0
  38. package/dist/components/DimensionField.js +56 -0
  39. package/dist/components/DimensionField.js.map +1 -0
  40. package/dist/components.cjs +4 -0
  41. package/dist/components.cjs.map +1 -1
  42. package/dist/components.d.ts +2 -0
  43. package/dist/components.d.ts.map +1 -1
  44. package/dist/components.js +4 -0
  45. package/dist/components.js.map +1 -1
  46. package/dist/data/Clicky.cjs +4 -5
  47. package/dist/data/Clicky.cjs.map +1 -1
  48. package/dist/data/Clicky.d.ts.map +1 -1
  49. package/dist/data/Clicky.js +4 -5
  50. package/dist/data/Clicky.js.map +1 -1
  51. package/dist/data/TaskExecDetails.cjs +8 -3
  52. package/dist/data/TaskExecDetails.cjs.map +1 -1
  53. package/dist/data/TaskExecDetails.d.ts +4 -0
  54. package/dist/data/TaskExecDetails.d.ts.map +1 -1
  55. package/dist/data/TaskExecDetails.js +9 -4
  56. package/dist/data/TaskExecDetails.js.map +1 -1
  57. package/dist/data/TaskManagerButton.cjs +101 -7
  58. package/dist/data/TaskManagerButton.cjs.map +1 -1
  59. package/dist/data/TaskManagerButton.d.ts +6 -1
  60. package/dist/data/TaskManagerButton.d.ts.map +1 -1
  61. package/dist/data/TaskManagerButton.js +103 -9
  62. package/dist/data/TaskManagerButton.js.map +1 -1
  63. package/dist/data/TaskProcessDetails.cjs +2 -0
  64. package/dist/data/TaskProcessDetails.cjs.map +1 -1
  65. package/dist/data/TaskProcessDetails.d.ts.map +1 -1
  66. package/dist/data/TaskProcessDetails.js +2 -0
  67. package/dist/data/TaskProcessDetails.js.map +1 -1
  68. package/dist/data/TaskProgress.cjs +14 -4
  69. package/dist/data/TaskProgress.cjs.map +1 -1
  70. package/dist/data/TaskProgress.js +14 -4
  71. package/dist/data/TaskProgress.js.map +1 -1
  72. package/dist/data/TaskSnapshot.cjs.map +1 -1
  73. package/dist/data/TaskSnapshot.d.ts +1 -0
  74. package/dist/data/TaskSnapshot.d.ts.map +1 -1
  75. package/dist/data/TaskSnapshot.js.map +1 -1
  76. package/dist/data/ai/ChatWindow.cjs +18 -23
  77. package/dist/data/ai/ChatWindow.cjs.map +1 -1
  78. package/dist/data/ai/ChatWindow.d.ts +1 -1
  79. package/dist/data/ai/ChatWindow.d.ts.map +1 -1
  80. package/dist/data/ai/ChatWindow.js +19 -24
  81. package/dist/data/ai/ChatWindow.js.map +1 -1
  82. package/dist/data/ai/ChatWindow.preferences.cjs +12 -21
  83. package/dist/data/ai/ChatWindow.preferences.cjs.map +1 -1
  84. package/dist/data/ai/ChatWindow.preferences.d.ts +3 -2
  85. package/dist/data/ai/ChatWindow.preferences.d.ts.map +1 -1
  86. package/dist/data/ai/ChatWindow.preferences.js +12 -21
  87. package/dist/data/ai/ChatWindow.preferences.js.map +1 -1
  88. package/dist/data/ai/ChatWindow.tool-catalog.cjs +21 -38
  89. package/dist/data/ai/ChatWindow.tool-catalog.cjs.map +1 -1
  90. package/dist/data/ai/ChatWindow.tool-catalog.d.ts +5 -5
  91. package/dist/data/ai/ChatWindow.tool-catalog.d.ts.map +1 -1
  92. package/dist/data/ai/ChatWindow.tool-catalog.js +21 -38
  93. package/dist/data/ai/ChatWindow.tool-catalog.js.map +1 -1
  94. package/dist/data/ai/ChatWindow.types.d.ts +2 -2
  95. package/dist/data/ai/ChatWindow.types.d.ts.map +1 -1
  96. package/dist/data/ai/ChatWindowManager.cjs +2 -2
  97. package/dist/data/ai/ChatWindowManager.cjs.map +1 -1
  98. package/dist/data/ai/ChatWindowManager.js +2 -2
  99. package/dist/data/ai/ChatWindowManager.js.map +1 -1
  100. package/dist/data/ai/ChatWindowRequestBody.cjs +4 -2
  101. package/dist/data/ai/ChatWindowRequestBody.cjs.map +1 -1
  102. package/dist/data/ai/ChatWindowRequestBody.d.ts +15 -3
  103. package/dist/data/ai/ChatWindowRequestBody.d.ts.map +1 -1
  104. package/dist/data/ai/ChatWindowRequestBody.js +4 -2
  105. package/dist/data/ai/ChatWindowRequestBody.js.map +1 -1
  106. package/dist/data/ai/ToolPreferences.cjs +5 -5
  107. package/dist/data/ai/ToolPreferences.cjs.map +1 -1
  108. package/dist/data/ai/ToolPreferences.d.ts +6 -5
  109. package/dist/data/ai/ToolPreferences.d.ts.map +1 -1
  110. package/dist/data/ai/ToolPreferences.js +5 -5
  111. package/dist/data/ai/ToolPreferences.js.map +1 -1
  112. package/dist/data/ai/ToolPreferences.model.cjs +61 -37
  113. package/dist/data/ai/ToolPreferences.model.cjs.map +1 -1
  114. package/dist/data/ai/ToolPreferences.model.d.ts +32 -13
  115. package/dist/data/ai/ToolPreferences.model.d.ts.map +1 -1
  116. package/dist/data/ai/ToolPreferences.model.js +62 -38
  117. package/dist/data/ai/ToolPreferences.model.js.map +1 -1
  118. package/dist/data/ai/ToolPreferencesList.cjs +17 -20
  119. package/dist/data/ai/ToolPreferencesList.cjs.map +1 -1
  120. package/dist/data/ai/ToolPreferencesList.d.ts +16 -7
  121. package/dist/data/ai/ToolPreferencesList.d.ts.map +1 -1
  122. package/dist/data/ai/ToolPreferencesList.js +18 -21
  123. package/dist/data/ai/ToolPreferencesList.js.map +1 -1
  124. package/dist/data/ai/chat-window-context.cjs +1 -1
  125. package/dist/data/ai/chat-window-context.cjs.map +1 -1
  126. package/dist/data/ai/chat-window-context.d.ts +7 -7
  127. package/dist/data/ai/chat-window-context.d.ts.map +1 -1
  128. package/dist/data/ai/chat-window-context.js +1 -1
  129. package/dist/data/ai/chat-window-context.js.map +1 -1
  130. package/dist/data/ai/index.d.ts +3 -1
  131. package/dist/data/ai/index.d.ts.map +1 -1
  132. package/dist/data/chat/clickyOperationsToTools.cjs +2 -1
  133. package/dist/data/chat/clickyOperationsToTools.cjs.map +1 -1
  134. package/dist/data/chat/clickyOperationsToTools.d.ts.map +1 -1
  135. package/dist/data/chat/clickyOperationsToTools.js +2 -1
  136. package/dist/data/chat/clickyOperationsToTools.js.map +1 -1
  137. package/dist/data/chat/index.d.ts +2 -1
  138. package/dist/data/chat/index.d.ts.map +1 -1
  139. package/dist/data/chat/tool-policy.cjs +132 -0
  140. package/dist/data/chat/tool-policy.cjs.map +1 -0
  141. package/dist/data/chat/tool-policy.d.ts +81 -0
  142. package/dist/data/chat/tool-policy.d.ts.map +1 -0
  143. package/dist/data/chat/tool-policy.js +132 -0
  144. package/dist/data/chat/tool-policy.js.map +1 -0
  145. package/dist/data/chat/types.cjs +20 -0
  146. package/dist/data/chat/types.cjs.map +1 -1
  147. package/dist/data/chat/types.d.ts +22 -2
  148. package/dist/data/chat/types.d.ts.map +1 -1
  149. package/dist/data/chat/types.js +20 -0
  150. package/dist/data/chat/types.js.map +1 -1
  151. package/dist/data/debugConsoleSignal.cjs +64 -0
  152. package/dist/data/debugConsoleSignal.cjs.map +1 -0
  153. package/dist/data/debugConsoleSignal.d.ts +83 -0
  154. package/dist/data/debugConsoleSignal.d.ts.map +1 -0
  155. package/dist/data/debugConsoleSignal.js +64 -0
  156. package/dist/data/debugConsoleSignal.js.map +1 -0
  157. package/dist/data/har/HarPanel.cjs +20 -14
  158. package/dist/data/har/HarPanel.cjs.map +1 -1
  159. package/dist/data/har/HarPanel.d.ts.map +1 -1
  160. package/dist/data/har/HarPanel.js +20 -14
  161. package/dist/data/har/HarPanel.js.map +1 -1
  162. package/dist/data/har/types.d.ts +18 -0
  163. package/dist/data/har/types.d.ts.map +1 -1
  164. package/dist/data/query-browser/QueryBrowser.cjs +4 -42
  165. package/dist/data/query-browser/QueryBrowser.cjs.map +1 -1
  166. package/dist/data/query-browser/QueryBrowser.d.ts.map +1 -1
  167. package/dist/data/query-browser/QueryBrowser.js +5 -43
  168. package/dist/data/query-browser/QueryBrowser.js.map +1 -1
  169. package/dist/data/query-browser/QueryBrowser.types.cjs.map +1 -1
  170. package/dist/data/query-browser/QueryBrowser.types.d.ts +0 -1
  171. package/dist/data/query-browser/QueryBrowser.types.d.ts.map +1 -1
  172. package/dist/data/query-browser/QueryBrowser.types.js.map +1 -1
  173. package/dist/data/useDebugAction.cjs +29 -0
  174. package/dist/data/useDebugAction.cjs.map +1 -0
  175. package/dist/data/useDebugAction.d.ts +16 -0
  176. package/dist/data/useDebugAction.d.ts.map +1 -0
  177. package/dist/data/useDebugAction.js +29 -0
  178. package/dist/data/useDebugAction.js.map +1 -0
  179. package/dist/data/version-info.cjs +3 -3
  180. package/dist/data/version-info.js +3 -3
  181. package/dist/data.cjs +16 -8
  182. package/dist/data.cjs.map +1 -1
  183. package/dist/data.d.ts +3 -2
  184. package/dist/data.d.ts.map +1 -1
  185. package/dist/data.js +16 -8
  186. package/dist/devtools/DebugConsole.cjs +138 -0
  187. package/dist/devtools/DebugConsole.cjs.map +1 -0
  188. package/dist/devtools/DebugConsole.d.ts +23 -0
  189. package/dist/devtools/DebugConsole.d.ts.map +1 -0
  190. package/dist/devtools/DebugConsole.js +138 -0
  191. package/dist/devtools/DebugConsole.js.map +1 -0
  192. package/dist/devtools/DebugConsoleButton.cjs +59 -0
  193. package/dist/devtools/DebugConsoleButton.cjs.map +1 -0
  194. package/dist/devtools/DebugConsoleButton.d.ts +20 -0
  195. package/dist/devtools/DebugConsoleButton.d.ts.map +1 -0
  196. package/dist/devtools/DebugConsoleButton.js +59 -0
  197. package/dist/devtools/DebugConsoleButton.js.map +1 -0
  198. package/dist/devtools/DebugConsoleDock.cjs +112 -0
  199. package/dist/devtools/DebugConsoleDock.cjs.map +1 -0
  200. package/dist/devtools/DebugConsoleDock.d.ts +26 -0
  201. package/dist/devtools/DebugConsoleDock.d.ts.map +1 -0
  202. package/dist/devtools/DebugConsoleDock.js +112 -0
  203. package/dist/devtools/DebugConsoleDock.js.map +1 -0
  204. package/dist/devtools/ExecutionDetail.cjs +135 -0
  205. package/dist/devtools/ExecutionDetail.cjs.map +1 -0
  206. package/dist/devtools/ExecutionDetail.d.ts +19 -0
  207. package/dist/devtools/ExecutionDetail.d.ts.map +1 -0
  208. package/dist/devtools/ExecutionDetail.js +135 -0
  209. package/dist/devtools/ExecutionDetail.js.map +1 -0
  210. package/dist/devtools/debugClient.cjs +172 -0
  211. package/dist/devtools/debugClient.cjs.map +1 -0
  212. package/dist/devtools/debugClient.d.ts +98 -0
  213. package/dist/devtools/debugClient.d.ts.map +1 -0
  214. package/dist/devtools/debugClient.js +172 -0
  215. package/dist/devtools/debugClient.js.map +1 -0
  216. package/dist/devtools/debugStore.cjs +115 -0
  217. package/dist/devtools/debugStore.cjs.map +1 -0
  218. package/dist/devtools/debugStore.d.ts +83 -0
  219. package/dist/devtools/debugStore.d.ts.map +1 -0
  220. package/dist/devtools/debugStore.js +115 -0
  221. package/dist/devtools/debugStore.js.map +1 -0
  222. package/dist/devtools/dockState.cjs +51 -0
  223. package/dist/devtools/dockState.cjs.map +1 -0
  224. package/dist/devtools/dockState.d.ts +31 -0
  225. package/dist/devtools/dockState.d.ts.map +1 -0
  226. package/dist/devtools/dockState.js +51 -0
  227. package/dist/devtools/dockState.js.map +1 -0
  228. package/dist/devtools/tabs/ConsoleTab.cjs +36 -0
  229. package/dist/devtools/tabs/ConsoleTab.cjs.map +1 -0
  230. package/dist/devtools/tabs/ConsoleTab.d.ts +19 -0
  231. package/dist/devtools/tabs/ConsoleTab.d.ts.map +1 -0
  232. package/dist/devtools/tabs/ConsoleTab.js +36 -0
  233. package/dist/devtools/tabs/ConsoleTab.js.map +1 -0
  234. package/dist/devtools/tabs/InspectionCaches.cjs +150 -0
  235. package/dist/devtools/tabs/InspectionCaches.cjs.map +1 -0
  236. package/dist/devtools/tabs/InspectionCaches.d.ts +23 -0
  237. package/dist/devtools/tabs/InspectionCaches.d.ts.map +1 -0
  238. package/dist/devtools/tabs/InspectionCaches.js +150 -0
  239. package/dist/devtools/tabs/InspectionCaches.js.map +1 -0
  240. package/dist/devtools/tabs/InspectionTab.cjs +316 -0
  241. package/dist/devtools/tabs/InspectionTab.cjs.map +1 -0
  242. package/dist/devtools/tabs/InspectionTab.d.ts +27 -0
  243. package/dist/devtools/tabs/InspectionTab.d.ts.map +1 -0
  244. package/dist/devtools/tabs/InspectionTab.js +316 -0
  245. package/dist/devtools/tabs/InspectionTab.js.map +1 -0
  246. package/dist/devtools/tabs/NetworkTab.cjs +91 -0
  247. package/dist/devtools/tabs/NetworkTab.cjs.map +1 -0
  248. package/dist/devtools/tabs/NetworkTab.d.ts +20 -0
  249. package/dist/devtools/tabs/NetworkTab.d.ts.map +1 -0
  250. package/dist/devtools/tabs/NetworkTab.js +91 -0
  251. package/dist/devtools/tabs/NetworkTab.js.map +1 -0
  252. package/dist/devtools/tabs/QueriesTab.cjs +85 -0
  253. package/dist/devtools/tabs/QueriesTab.cjs.map +1 -0
  254. package/dist/devtools/tabs/QueriesTab.d.ts +24 -0
  255. package/dist/devtools/tabs/QueriesTab.d.ts.map +1 -0
  256. package/dist/devtools/tabs/QueriesTab.js +85 -0
  257. package/dist/devtools/tabs/QueriesTab.js.map +1 -0
  258. package/dist/devtools/types.cjs +26 -0
  259. package/dist/devtools/types.cjs.map +1 -0
  260. package/dist/devtools/types.d.ts +235 -0
  261. package/dist/devtools/types.d.ts.map +1 -0
  262. package/dist/devtools/types.js +26 -0
  263. package/dist/devtools/types.js.map +1 -0
  264. package/dist/devtools/useDebugStream.cjs +46 -0
  265. package/dist/devtools/useDebugStream.cjs.map +1 -0
  266. package/dist/devtools/useDebugStream.d.ts +23 -0
  267. package/dist/devtools/useDebugStream.d.ts.map +1 -0
  268. package/dist/devtools/useDebugStream.js +46 -0
  269. package/dist/devtools/useDebugStream.js.map +1 -0
  270. package/dist/devtools.cjs +51 -0
  271. package/dist/devtools.cjs.map +1 -0
  272. package/dist/devtools.d.ts +37 -0
  273. package/dist/devtools.d.ts.map +1 -0
  274. package/dist/devtools.js +51 -0
  275. package/dist/devtools.js.map +1 -0
  276. package/dist/icons/components/UiOpenScad.cjs +10 -0
  277. package/dist/icons/components/UiOpenScad.cjs.map +1 -0
  278. package/dist/icons/components/UiOpenScad.d.ts +9 -0
  279. package/dist/icons/components/UiOpenScad.d.ts.map +1 -0
  280. package/dist/icons/components/UiOpenScad.js +10 -0
  281. package/dist/icons/components/UiOpenScad.js.map +1 -0
  282. package/dist/icons/index.d.ts +1 -0
  283. package/dist/icons/index.d.ts.map +1 -1
  284. package/dist/icons/registry.cjs +2 -0
  285. package/dist/icons/registry.cjs.map +1 -1
  286. package/dist/icons/registry.d.ts.map +1 -1
  287. package/dist/icons/registry.js +2 -0
  288. package/dist/icons/registry.js.map +1 -1
  289. package/dist/icons.cjs +2 -0
  290. package/dist/icons.cjs.map +1 -1
  291. package/dist/icons.js +2 -0
  292. package/dist/icons.js.map +1 -1
  293. package/dist/index.cjs +20 -8
  294. package/dist/index.cjs.map +1 -1
  295. package/dist/index.js +20 -8
  296. package/dist/index.js.map +1 -1
  297. package/dist/layout/AppShell.cjs +15 -10
  298. package/dist/layout/AppShell.cjs.map +1 -1
  299. package/dist/layout/AppShell.d.ts +11 -0
  300. package/dist/layout/AppShell.d.ts.map +1 -1
  301. package/dist/layout/AppShell.js +15 -10
  302. package/dist/layout/AppShell.js.map +1 -1
  303. package/dist/layout/AppShell.nav.cjs +170 -49
  304. package/dist/layout/AppShell.nav.cjs.map +1 -1
  305. package/dist/layout/AppShell.nav.d.ts.map +1 -1
  306. package/dist/layout/AppShell.nav.js +170 -49
  307. package/dist/layout/AppShell.nav.js.map +1 -1
  308. package/dist/overlay/CellActions.cjs +18 -124
  309. package/dist/overlay/CellActions.cjs.map +1 -1
  310. package/dist/overlay/CellActions.d.ts +1 -1
  311. package/dist/overlay/CellActions.d.ts.map +1 -1
  312. package/dist/overlay/CellActions.js +18 -124
  313. package/dist/overlay/CellActions.js.map +1 -1
  314. package/dist/overlay/ContextMenu.cjs +144 -0
  315. package/dist/overlay/ContextMenu.cjs.map +1 -0
  316. package/dist/overlay/ContextMenu.d.ts +8 -0
  317. package/dist/overlay/ContextMenu.d.ts.map +1 -0
  318. package/dist/overlay/ContextMenu.js +144 -0
  319. package/dist/overlay/ContextMenu.js.map +1 -0
  320. package/dist/profiles/connections/connectionBrowserModel.cjs +14 -65
  321. package/dist/profiles/connections/connectionBrowserModel.cjs.map +1 -1
  322. package/dist/profiles/connections/connectionBrowserModel.d.ts +35 -35
  323. package/dist/profiles/connections/connectionBrowserModel.d.ts.map +1 -1
  324. package/dist/profiles/connections/connectionBrowserModel.js +14 -65
  325. package/dist/profiles/connections/connectionBrowserModel.js.map +1 -1
  326. package/dist/profiles/connections/connectionQueryWorkspace.cjs +29 -9
  327. package/dist/profiles/connections/connectionQueryWorkspace.cjs.map +1 -1
  328. package/dist/profiles/connections/connectionQueryWorkspace.d.ts +3 -2
  329. package/dist/profiles/connections/connectionQueryWorkspace.d.ts.map +1 -1
  330. package/dist/profiles/connections/connectionQueryWorkspace.js +30 -10
  331. package/dist/profiles/connections/connectionQueryWorkspace.js.map +1 -1
  332. package/dist/profiles/connections/connectionQueryWorkspaceModel.cjs +15 -0
  333. package/dist/profiles/connections/connectionQueryWorkspaceModel.cjs.map +1 -1
  334. package/dist/profiles/connections/connectionQueryWorkspaceModel.d.ts +22 -1
  335. package/dist/profiles/connections/connectionQueryWorkspaceModel.d.ts.map +1 -1
  336. package/dist/profiles/connections/connectionQueryWorkspaceModel.js +15 -0
  337. package/dist/profiles/connections/connectionQueryWorkspaceModel.js.map +1 -1
  338. package/dist/profiles/connections/index.d.ts +1 -0
  339. package/dist/profiles/connections/index.d.ts.map +1 -1
  340. package/dist/profiles/connections/inspectionStatus.cjs +44 -0
  341. package/dist/profiles/connections/inspectionStatus.cjs.map +1 -0
  342. package/dist/profiles/connections/inspectionStatus.d.ts +5 -0
  343. package/dist/profiles/connections/inspectionStatus.d.ts.map +1 -0
  344. package/dist/profiles/connections/inspectionStatus.js +44 -0
  345. package/dist/profiles/connections/inspectionStatus.js.map +1 -0
  346. package/dist/profiles/connections/useInspection.cjs +123 -0
  347. package/dist/profiles/connections/useInspection.cjs.map +1 -0
  348. package/dist/profiles/connections/useInspection.d.ts +35 -0
  349. package/dist/profiles/connections/useInspection.d.ts.map +1 -0
  350. package/dist/profiles/connections/useInspection.js +123 -0
  351. package/dist/profiles/connections/useInspection.js.map +1 -0
  352. package/dist/profiles/editor/profileBuilderWorkspace.cjs +55 -23
  353. package/dist/profiles/editor/profileBuilderWorkspace.cjs.map +1 -1
  354. package/dist/profiles/editor/profileBuilderWorkspace.d.ts.map +1 -1
  355. package/dist/profiles/editor/profileBuilderWorkspace.js +56 -24
  356. package/dist/profiles/editor/profileBuilderWorkspace.js.map +1 -1
  357. package/dist/profiles/elasticsearch/esQueryBuilder.cjs +12 -3
  358. package/dist/profiles/elasticsearch/esQueryBuilder.cjs.map +1 -1
  359. package/dist/profiles/elasticsearch/esQueryBuilder.d.ts +2 -2
  360. package/dist/profiles/elasticsearch/esQueryBuilder.d.ts.map +1 -1
  361. package/dist/profiles/elasticsearch/esQueryBuilder.js +12 -3
  362. package/dist/profiles/elasticsearch/esQueryBuilder.js.map +1 -1
  363. package/dist/profiles/fields/profileFieldEditor.cjs +137 -22
  364. package/dist/profiles/fields/profileFieldEditor.cjs.map +1 -1
  365. package/dist/profiles/fields/profileFieldEditor.d.ts.map +1 -1
  366. package/dist/profiles/fields/profileFieldEditor.js +137 -22
  367. package/dist/profiles/fields/profileFieldEditor.js.map +1 -1
  368. package/dist/profiles/fields/profileFieldFilterEditor.cjs +171 -82
  369. package/dist/profiles/fields/profileFieldFilterEditor.cjs.map +1 -1
  370. package/dist/profiles/fields/profileFieldFilterEditor.d.ts +0 -9
  371. package/dist/profiles/fields/profileFieldFilterEditor.d.ts.map +1 -1
  372. package/dist/profiles/fields/profileFieldFilterEditor.js +174 -85
  373. package/dist/profiles/fields/profileFieldFilterEditor.js.map +1 -1
  374. package/dist/profiles/fields/profileFieldIcons.cjs +6 -3
  375. package/dist/profiles/fields/profileFieldIcons.cjs.map +1 -1
  376. package/dist/profiles/fields/profileFieldIcons.js +6 -3
  377. package/dist/profiles/fields/profileFieldIcons.js.map +1 -1
  378. package/dist/profiles/query/profileSampleFilterLookup.cjs +34 -0
  379. package/dist/profiles/query/profileSampleFilterLookup.cjs.map +1 -0
  380. package/dist/profiles/query/profileSampleFilterLookup.d.ts +12 -0
  381. package/dist/profiles/query/profileSampleFilterLookup.d.ts.map +1 -0
  382. package/dist/profiles/query/profileSampleFilterLookup.js +34 -0
  383. package/dist/profiles/query/profileSampleFilterLookup.js.map +1 -0
  384. package/dist/profiles/query/profileSamplePayload.cjs +6 -4
  385. package/dist/profiles/query/profileSamplePayload.cjs.map +1 -1
  386. package/dist/profiles/query/profileSamplePayload.d.ts +11 -4
  387. package/dist/profiles/query/profileSamplePayload.d.ts.map +1 -1
  388. package/dist/profiles/query/profileSamplePayload.js +6 -4
  389. package/dist/profiles/query/profileSamplePayload.js.map +1 -1
  390. package/dist/profiles/query/profileSampleResult.cjs +26 -0
  391. package/dist/profiles/query/profileSampleResult.cjs.map +1 -0
  392. package/dist/profiles/query/profileSampleResult.d.ts +11 -0
  393. package/dist/profiles/query/profileSampleResult.d.ts.map +1 -0
  394. package/dist/profiles/query/profileSampleResult.js +26 -0
  395. package/dist/profiles/query/profileSampleResult.js.map +1 -0
  396. package/dist/profiles/query/queryTargetPicker.cjs +5 -3
  397. package/dist/profiles/query/queryTargetPicker.cjs.map +1 -1
  398. package/dist/profiles/query/queryTargetPicker.d.ts +3 -2
  399. package/dist/profiles/query/queryTargetPicker.d.ts.map +1 -1
  400. package/dist/profiles/query/queryTargetPicker.js +5 -3
  401. package/dist/profiles/query/queryTargetPicker.js.map +1 -1
  402. package/dist/profiles/wizard/profileWizard.cjs +14 -5
  403. package/dist/profiles/wizard/profileWizard.cjs.map +1 -1
  404. package/dist/profiles/wizard/profileWizard.d.ts.map +1 -1
  405. package/dist/profiles/wizard/profileWizard.js +15 -6
  406. package/dist/profiles/wizard/profileWizard.js.map +1 -1
  407. package/dist/profiles/wizard/profileWizardModel.cjs +35 -6
  408. package/dist/profiles/wizard/profileWizardModel.cjs.map +1 -1
  409. package/dist/profiles/wizard/profileWizardModel.d.ts +29 -4
  410. package/dist/profiles/wizard/profileWizardModel.d.ts.map +1 -1
  411. package/dist/profiles/wizard/profileWizardModel.js +35 -6
  412. package/dist/profiles/wizard/profileWizardModel.js.map +1 -1
  413. package/dist/profiles/wizard/profileWizardQueryStep.cjs +44 -11
  414. package/dist/profiles/wizard/profileWizardQueryStep.cjs.map +1 -1
  415. package/dist/profiles/wizard/profileWizardQueryStep.d.ts.map +1 -1
  416. package/dist/profiles/wizard/profileWizardQueryStep.js +46 -13
  417. package/dist/profiles/wizard/profileWizardQueryStep.js.map +1 -1
  418. package/dist/profiles/wizard/profileWizardSteps.cjs +33 -2
  419. package/dist/profiles/wizard/profileWizardSteps.cjs.map +1 -1
  420. package/dist/profiles/wizard/profileWizardSteps.d.ts +11 -2
  421. package/dist/profiles/wizard/profileWizardSteps.d.ts.map +1 -1
  422. package/dist/profiles/wizard/profileWizardSteps.js +33 -2
  423. package/dist/profiles/wizard/profileWizardSteps.js.map +1 -1
  424. package/dist/profiles.cjs +8 -2
  425. package/dist/profiles.cjs.map +1 -1
  426. package/dist/profiles.js +10 -4
  427. package/dist/profiles.js.map +1 -1
  428. package/dist/rpc/FilterForm.cjs +21 -237
  429. package/dist/rpc/FilterForm.cjs.map +1 -1
  430. package/dist/rpc/FilterForm.d.ts +3 -1
  431. package/dist/rpc/FilterForm.d.ts.map +1 -1
  432. package/dist/rpc/FilterForm.js +21 -237
  433. package/dist/rpc/FilterForm.js.map +1 -1
  434. package/dist/rpc/FilterFormFields.cjs +240 -0
  435. package/dist/rpc/FilterFormFields.cjs.map +1 -0
  436. package/dist/rpc/FilterFormFields.d.ts +12 -0
  437. package/dist/rpc/FilterFormFields.d.ts.map +1 -0
  438. package/dist/rpc/FilterFormFields.js +240 -0
  439. package/dist/rpc/FilterFormFields.js.map +1 -0
  440. package/dist/rpc/router.cjs +3 -2
  441. package/dist/rpc/router.cjs.map +1 -1
  442. package/dist/rpc/router.d.ts.map +1 -1
  443. package/dist/rpc/router.js +3 -2
  444. package/dist/rpc/router.js.map +1 -1
  445. package/dist/rpc/types.cjs.map +1 -1
  446. package/dist/rpc/types.d.ts +3 -1
  447. package/dist/rpc/types.d.ts.map +1 -1
  448. package/dist/rpc/types.js.map +1 -1
  449. package/dist/styles.css +1 -1
  450. package/package.json +6 -1
  451. package/dist/data/query-info/QueryInfoDialog.cjs +0 -106
  452. package/dist/data/query-info/QueryInfoDialog.cjs.map +0 -1
  453. package/dist/data/query-info/QueryInfoDialog.d.ts +0 -16
  454. package/dist/data/query-info/QueryInfoDialog.d.ts.map +0 -1
  455. package/dist/data/query-info/QueryInfoDialog.js +0 -106
  456. package/dist/data/query-info/QueryInfoDialog.js.map +0 -1
  457. package/dist/data/query-info/index.d.ts +0 -4
  458. package/dist/data/query-info/index.d.ts.map +0 -1
  459. package/dist/data/query-info/queryInfo.cjs +0 -42
  460. package/dist/data/query-info/queryInfo.cjs.map +0 -1
  461. package/dist/data/query-info/queryInfo.d.ts +0 -45
  462. package/dist/data/query-info/queryInfo.d.ts.map +0 -1
  463. package/dist/data/query-info/queryInfo.js +0 -42
  464. package/dist/data/query-info/queryInfo.js.map +0 -1
  465. package/dist/data/query-info/useQueryInfo.cjs +0 -48
  466. package/dist/data/query-info/useQueryInfo.cjs.map +0 -1
  467. package/dist/data/query-info/useQueryInfo.d.ts +0 -26
  468. package/dist/data/query-info/useQueryInfo.d.ts.map +0 -1
  469. package/dist/data/query-info/useQueryInfo.js +0 -48
  470. package/dist/data/query-info/useQueryInfo.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flanksource/clicky-ui",
3
- "version": "0.3.25",
3
+ "version": "0.3.26",
4
4
  "description": "Flanksource Clicky UI — React component library built on shadcn/ui with light/dark and density theming.",
5
5
  "homepage": "https://github.com/flanksource/clicky-ui#readme",
6
6
  "bugs": "https://github.com/flanksource/clicky-ui/issues",
@@ -67,6 +67,11 @@
67
67
  "import": "./dist/comments.js",
68
68
  "require": "./dist/comments.cjs"
69
69
  },
70
+ "./devtools": {
71
+ "types": "./dist/devtools.d.ts",
72
+ "import": "./dist/devtools.js",
73
+ "require": "./dist/devtools.cjs"
74
+ },
70
75
  "./icons": {
71
76
  "types": "./dist/icons.d.ts",
72
77
  "import": "./dist/icons.js",
@@ -1,106 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const jsxRuntime = require("react/jsx-runtime");
4
- const react = require("react");
5
- const Modal = require("../../overlay/Modal.cjs");
6
- const Properties = require("../Properties.cjs");
7
- const QueryBrowserDiagnosticsPanel = require("../query-browser/QueryBrowserDiagnosticsPanel.cjs");
8
- function QueryInfoDialog({
9
- open,
10
- onClose,
11
- load,
12
- title = "Query"
13
- }) {
14
- const [state, setState] = react.useState({ status: "pending" });
15
- react.useEffect(() => {
16
- if (!open) return;
17
- let active = true;
18
- setState({ status: "pending" });
19
- load().then((info2) => {
20
- if (active) setState({ status: "loaded", info: info2 });
21
- }).catch((error) => {
22
- if (!active) return;
23
- setState({
24
- status: "failed",
25
- message: error instanceof Error ? error.message : "Reading the query details failed"
26
- });
27
- });
28
- return () => {
29
- active = false;
30
- };
31
- }, [open, load]);
32
- const info = state.status === "loaded" ? state.info : void 0;
33
- return /* @__PURE__ */ jsxRuntime.jsxs(
34
- Modal.Modal,
35
- {
36
- open,
37
- onClose,
38
- title,
39
- subtitle: (info == null ? void 0 : info.profile) ?? (info == null ? void 0 : info.provider),
40
- size: "2xl",
41
- closeOnEsc: true,
42
- expandable: true,
43
- children: [
44
- state.status === "pending" && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: "Reading query details…" }),
45
- state.status === "failed" && /* @__PURE__ */ jsxRuntime.jsx(
46
- "div",
47
- {
48
- role: "alert",
49
- className: "rounded-md border border-destructive/40 bg-destructive/5 p-3 text-sm text-destructive",
50
- children: state.message
51
- }
52
- ),
53
- info && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
54
- info.error && /* @__PURE__ */ jsxRuntime.jsx(
55
- "div",
56
- {
57
- role: "alert",
58
- className: "rounded-md border border-destructive/40 bg-destructive/5 p-3 text-sm text-destructive",
59
- children: info.error
60
- }
61
- ),
62
- info.url && /* @__PURE__ */ jsxRuntime.jsxs("section", { "aria-label": "Request URL", className: "min-w-0", children: [
63
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "mb-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground", children: "Request" }),
64
- /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "overflow-auto whitespace-pre-wrap break-all rounded-md bg-muted/60 p-2 text-xs", children: info.url })
65
- ] }),
66
- /* @__PURE__ */ jsxRuntime.jsx(
67
- Properties.Properties,
68
- {
69
- items: summaryItems(info),
70
- density: "compact",
71
- showDensityMenu: false
72
- }
73
- ),
74
- info.diagnostics && /* @__PURE__ */ jsxRuntime.jsx(QueryBrowserDiagnosticsPanel.QueryBrowserDiagnosticsPanel, { diagnostics: info.diagnostics }),
75
- info.headers && Object.keys(info.headers).length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("section", { "aria-label": "Response headers", className: "min-w-0", children: [
76
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "mb-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground", children: "Response headers" }),
77
- /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "max-h-56 overflow-auto whitespace-pre-wrap break-all rounded-md bg-muted/60 p-2 text-xs", children: Object.entries(info.headers).map(([key, value]) => `${key}: ${value}`).join("\n") })
78
- ] })
79
- ] })
80
- ]
81
- }
82
- );
83
- }
84
- function summaryItems(info) {
85
- const items = [
86
- { key: "Profile", value: info.profile },
87
- { key: "Provider", value: info.provider },
88
- { key: "Connection", value: info.connection },
89
- { key: "Mode", value: info.mode },
90
- {
91
- key: "Rows",
92
- value: info.rows === void 0 ? void 0 : info.rows.toLocaleString()
93
- },
94
- {
95
- key: "Duration",
96
- value: info.durationMs === void 0 ? void 0 : `${Math.round(info.durationMs)} ms`
97
- },
98
- {
99
- key: "Parameters",
100
- value: info.params && Object.keys(info.params).length > 0 ? JSON.stringify(info.params) : void 0
101
- }
102
- ];
103
- return items.filter((item) => item.value !== void 0 && item.value !== "");
104
- }
105
- exports.QueryInfoDialog = QueryInfoDialog;
106
- //# sourceMappingURL=QueryInfoDialog.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"QueryInfoDialog.cjs","sources":["../../../src/data/query-info/QueryInfoDialog.tsx"],"sourcesContent":["import { useEffect, useState } from \"react\";\nimport { Modal } from \"../../overlay/Modal\";\nimport { Properties } from \"../Properties\";\nimport { QueryBrowserDiagnosticsPanel } from \"../query-browser/QueryBrowserDiagnosticsPanel\";\nimport type { QueryExecutionInfo, QueryInfoLoader } from \"./queryInfo\";\n\nexport type QueryInfoDialogProps = {\n open: boolean;\n onClose: () => void;\n /** Reads the details. Keep the reference stable — it runs on every open. */\n load: QueryInfoLoader;\n title?: string;\n};\n\ntype LoadState =\n | { status: \"pending\" }\n | { status: \"loaded\"; info: QueryExecutionInfo }\n | { status: \"failed\"; message: string };\n\n/**\n * QueryInfoDialog shows what a result surface actually ran.\n *\n * It reads on open rather than alongside the rows: the details cost a second\n * execution, and a table nobody asked a question about should not pay for one.\n */\nexport function QueryInfoDialog({\n open,\n onClose,\n load,\n title = \"Query\",\n}: QueryInfoDialogProps) {\n const [state, setState] = useState<LoadState>({ status: \"pending\" });\n\n useEffect(() => {\n if (!open) return;\n let active = true;\n setState({ status: \"pending\" });\n load()\n .then((info) => {\n if (active) setState({ status: \"loaded\", info });\n })\n .catch((error: unknown) => {\n if (!active) return;\n setState({\n status: \"failed\",\n message:\n error instanceof Error\n ? error.message\n : \"Reading the query details failed\",\n });\n });\n return () => {\n active = false;\n };\n }, [open, load]);\n\n const info = state.status === \"loaded\" ? state.info : undefined;\n\n return (\n <Modal\n open={open}\n onClose={onClose}\n title={title}\n subtitle={info?.profile ?? info?.provider}\n size=\"2xl\"\n closeOnEsc\n expandable\n >\n {state.status === \"pending\" && (\n <p className=\"text-sm text-muted-foreground\">Reading query details…</p>\n )}\n\n {state.status === \"failed\" && (\n <div\n role=\"alert\"\n className=\"rounded-md border border-destructive/40 bg-destructive/5 p-3 text-sm text-destructive\"\n >\n {state.message}\n </div>\n )}\n\n {info && (\n <div className=\"space-y-3\">\n {info.error && (\n <div\n role=\"alert\"\n className=\"rounded-md border border-destructive/40 bg-destructive/5 p-3 text-sm text-destructive\"\n >\n {info.error}\n </div>\n )}\n\n {info.url && (\n <section aria-label=\"Request URL\" className=\"min-w-0\">\n <h3 className=\"mb-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground\">\n Request\n </h3>\n <pre className=\"overflow-auto whitespace-pre-wrap break-all rounded-md bg-muted/60 p-2 text-xs\">\n {info.url}\n </pre>\n </section>\n )}\n\n <Properties\n items={summaryItems(info)}\n density=\"compact\"\n showDensityMenu={false}\n />\n\n {info.diagnostics && (\n <QueryBrowserDiagnosticsPanel diagnostics={info.diagnostics} />\n )}\n\n {info.headers && Object.keys(info.headers).length > 0 && (\n <section aria-label=\"Response headers\" className=\"min-w-0\">\n <h3 className=\"mb-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground\">\n Response headers\n </h3>\n <pre className=\"max-h-56 overflow-auto whitespace-pre-wrap break-all rounded-md bg-muted/60 p-2 text-xs\">\n {Object.entries(info.headers)\n .map(([key, value]) => `${key}: ${value}`)\n .join(\"\\n\")}\n </pre>\n </section>\n )}\n </div>\n )}\n </Modal>\n );\n}\n\nfunction summaryItems(info: QueryExecutionInfo) {\n const items: { key: string; value: unknown; hidden?: boolean }[] = [\n { key: \"Profile\", value: info.profile },\n { key: \"Provider\", value: info.provider },\n { key: \"Connection\", value: info.connection },\n { key: \"Mode\", value: info.mode },\n {\n key: \"Rows\",\n value: info.rows === undefined ? undefined : info.rows.toLocaleString(),\n },\n {\n key: \"Duration\",\n value:\n info.durationMs === undefined\n ? undefined\n : `${Math.round(info.durationMs)} ms`,\n },\n {\n key: \"Parameters\",\n value:\n info.params && Object.keys(info.params).length > 0\n ? JSON.stringify(info.params)\n : undefined,\n },\n ];\n return items.filter((item) => item.value !== undefined && item.value !== \"\");\n}\n"],"names":["useState","useEffect","info","jsxs","Modal","jsx","Properties","QueryBrowserDiagnosticsPanel"],"mappings":"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"}
@@ -1,16 +0,0 @@
1
- import { QueryInfoLoader } from './queryInfo';
2
- export type QueryInfoDialogProps = {
3
- open: boolean;
4
- onClose: () => void;
5
- /** Reads the details. Keep the reference stable — it runs on every open. */
6
- load: QueryInfoLoader;
7
- title?: string;
8
- };
9
- /**
10
- * QueryInfoDialog shows what a result surface actually ran.
11
- *
12
- * It reads on open rather than alongside the rows: the details cost a second
13
- * execution, and a table nobody asked a question about should not pay for one.
14
- */
15
- export declare function QueryInfoDialog({ open, onClose, load, title, }: QueryInfoDialogProps): import("react/jsx-runtime").JSX.Element;
16
- //# sourceMappingURL=QueryInfoDialog.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"QueryInfoDialog.d.ts","sourceRoot":"","sources":["../../../src/data/query-info/QueryInfoDialog.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAsB,eAAe,EAAE,MAAM,aAAa,CAAC;AAEvE,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,4EAA4E;IAC5E,IAAI,EAAE,eAAe,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAOF;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,KAAe,GAChB,EAAE,oBAAoB,2CAmGtB"}
@@ -1,106 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { useState, useEffect } from "react";
3
- import { Modal } from "../../overlay/Modal.js";
4
- import { Properties } from "../Properties.js";
5
- import { QueryBrowserDiagnosticsPanel } from "../query-browser/QueryBrowserDiagnosticsPanel.js";
6
- function QueryInfoDialog({
7
- open,
8
- onClose,
9
- load,
10
- title = "Query"
11
- }) {
12
- const [state, setState] = useState({ status: "pending" });
13
- useEffect(() => {
14
- if (!open) return;
15
- let active = true;
16
- setState({ status: "pending" });
17
- load().then((info2) => {
18
- if (active) setState({ status: "loaded", info: info2 });
19
- }).catch((error) => {
20
- if (!active) return;
21
- setState({
22
- status: "failed",
23
- message: error instanceof Error ? error.message : "Reading the query details failed"
24
- });
25
- });
26
- return () => {
27
- active = false;
28
- };
29
- }, [open, load]);
30
- const info = state.status === "loaded" ? state.info : void 0;
31
- return /* @__PURE__ */ jsxs(
32
- Modal,
33
- {
34
- open,
35
- onClose,
36
- title,
37
- subtitle: (info == null ? void 0 : info.profile) ?? (info == null ? void 0 : info.provider),
38
- size: "2xl",
39
- closeOnEsc: true,
40
- expandable: true,
41
- children: [
42
- state.status === "pending" && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Reading query details…" }),
43
- state.status === "failed" && /* @__PURE__ */ jsx(
44
- "div",
45
- {
46
- role: "alert",
47
- className: "rounded-md border border-destructive/40 bg-destructive/5 p-3 text-sm text-destructive",
48
- children: state.message
49
- }
50
- ),
51
- info && /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
52
- info.error && /* @__PURE__ */ jsx(
53
- "div",
54
- {
55
- role: "alert",
56
- className: "rounded-md border border-destructive/40 bg-destructive/5 p-3 text-sm text-destructive",
57
- children: info.error
58
- }
59
- ),
60
- info.url && /* @__PURE__ */ jsxs("section", { "aria-label": "Request URL", className: "min-w-0", children: [
61
- /* @__PURE__ */ jsx("h3", { className: "mb-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground", children: "Request" }),
62
- /* @__PURE__ */ jsx("pre", { className: "overflow-auto whitespace-pre-wrap break-all rounded-md bg-muted/60 p-2 text-xs", children: info.url })
63
- ] }),
64
- /* @__PURE__ */ jsx(
65
- Properties,
66
- {
67
- items: summaryItems(info),
68
- density: "compact",
69
- showDensityMenu: false
70
- }
71
- ),
72
- info.diagnostics && /* @__PURE__ */ jsx(QueryBrowserDiagnosticsPanel, { diagnostics: info.diagnostics }),
73
- info.headers && Object.keys(info.headers).length > 0 && /* @__PURE__ */ jsxs("section", { "aria-label": "Response headers", className: "min-w-0", children: [
74
- /* @__PURE__ */ jsx("h3", { className: "mb-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground", children: "Response headers" }),
75
- /* @__PURE__ */ jsx("pre", { className: "max-h-56 overflow-auto whitespace-pre-wrap break-all rounded-md bg-muted/60 p-2 text-xs", children: Object.entries(info.headers).map(([key, value]) => `${key}: ${value}`).join("\n") })
76
- ] })
77
- ] })
78
- ]
79
- }
80
- );
81
- }
82
- function summaryItems(info) {
83
- const items = [
84
- { key: "Profile", value: info.profile },
85
- { key: "Provider", value: info.provider },
86
- { key: "Connection", value: info.connection },
87
- { key: "Mode", value: info.mode },
88
- {
89
- key: "Rows",
90
- value: info.rows === void 0 ? void 0 : info.rows.toLocaleString()
91
- },
92
- {
93
- key: "Duration",
94
- value: info.durationMs === void 0 ? void 0 : `${Math.round(info.durationMs)} ms`
95
- },
96
- {
97
- key: "Parameters",
98
- value: info.params && Object.keys(info.params).length > 0 ? JSON.stringify(info.params) : void 0
99
- }
100
- ];
101
- return items.filter((item) => item.value !== void 0 && item.value !== "");
102
- }
103
- export {
104
- QueryInfoDialog
105
- };
106
- //# sourceMappingURL=QueryInfoDialog.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"QueryInfoDialog.js","sources":["../../../src/data/query-info/QueryInfoDialog.tsx"],"sourcesContent":["import { useEffect, useState } from \"react\";\nimport { Modal } from \"../../overlay/Modal\";\nimport { Properties } from \"../Properties\";\nimport { QueryBrowserDiagnosticsPanel } from \"../query-browser/QueryBrowserDiagnosticsPanel\";\nimport type { QueryExecutionInfo, QueryInfoLoader } from \"./queryInfo\";\n\nexport type QueryInfoDialogProps = {\n open: boolean;\n onClose: () => void;\n /** Reads the details. Keep the reference stable — it runs on every open. */\n load: QueryInfoLoader;\n title?: string;\n};\n\ntype LoadState =\n | { status: \"pending\" }\n | { status: \"loaded\"; info: QueryExecutionInfo }\n | { status: \"failed\"; message: string };\n\n/**\n * QueryInfoDialog shows what a result surface actually ran.\n *\n * It reads on open rather than alongside the rows: the details cost a second\n * execution, and a table nobody asked a question about should not pay for one.\n */\nexport function QueryInfoDialog({\n open,\n onClose,\n load,\n title = \"Query\",\n}: QueryInfoDialogProps) {\n const [state, setState] = useState<LoadState>({ status: \"pending\" });\n\n useEffect(() => {\n if (!open) return;\n let active = true;\n setState({ status: \"pending\" });\n load()\n .then((info) => {\n if (active) setState({ status: \"loaded\", info });\n })\n .catch((error: unknown) => {\n if (!active) return;\n setState({\n status: \"failed\",\n message:\n error instanceof Error\n ? error.message\n : \"Reading the query details failed\",\n });\n });\n return () => {\n active = false;\n };\n }, [open, load]);\n\n const info = state.status === \"loaded\" ? state.info : undefined;\n\n return (\n <Modal\n open={open}\n onClose={onClose}\n title={title}\n subtitle={info?.profile ?? info?.provider}\n size=\"2xl\"\n closeOnEsc\n expandable\n >\n {state.status === \"pending\" && (\n <p className=\"text-sm text-muted-foreground\">Reading query details…</p>\n )}\n\n {state.status === \"failed\" && (\n <div\n role=\"alert\"\n className=\"rounded-md border border-destructive/40 bg-destructive/5 p-3 text-sm text-destructive\"\n >\n {state.message}\n </div>\n )}\n\n {info && (\n <div className=\"space-y-3\">\n {info.error && (\n <div\n role=\"alert\"\n className=\"rounded-md border border-destructive/40 bg-destructive/5 p-3 text-sm text-destructive\"\n >\n {info.error}\n </div>\n )}\n\n {info.url && (\n <section aria-label=\"Request URL\" className=\"min-w-0\">\n <h3 className=\"mb-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground\">\n Request\n </h3>\n <pre className=\"overflow-auto whitespace-pre-wrap break-all rounded-md bg-muted/60 p-2 text-xs\">\n {info.url}\n </pre>\n </section>\n )}\n\n <Properties\n items={summaryItems(info)}\n density=\"compact\"\n showDensityMenu={false}\n />\n\n {info.diagnostics && (\n <QueryBrowserDiagnosticsPanel diagnostics={info.diagnostics} />\n )}\n\n {info.headers && Object.keys(info.headers).length > 0 && (\n <section aria-label=\"Response headers\" className=\"min-w-0\">\n <h3 className=\"mb-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground\">\n Response headers\n </h3>\n <pre className=\"max-h-56 overflow-auto whitespace-pre-wrap break-all rounded-md bg-muted/60 p-2 text-xs\">\n {Object.entries(info.headers)\n .map(([key, value]) => `${key}: ${value}`)\n .join(\"\\n\")}\n </pre>\n </section>\n )}\n </div>\n )}\n </Modal>\n );\n}\n\nfunction summaryItems(info: QueryExecutionInfo) {\n const items: { key: string; value: unknown; hidden?: boolean }[] = [\n { key: \"Profile\", value: info.profile },\n { key: \"Provider\", value: info.provider },\n { key: \"Connection\", value: info.connection },\n { key: \"Mode\", value: info.mode },\n {\n key: \"Rows\",\n value: info.rows === undefined ? undefined : info.rows.toLocaleString(),\n },\n {\n key: \"Duration\",\n value:\n info.durationMs === undefined\n ? undefined\n : `${Math.round(info.durationMs)} ms`,\n },\n {\n key: \"Parameters\",\n value:\n info.params && Object.keys(info.params).length > 0\n ? JSON.stringify(info.params)\n : undefined,\n },\n ];\n return items.filter((item) => item.value !== undefined && item.value !== \"\");\n}\n"],"names":["info"],"mappings":"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"}
@@ -1,4 +0,0 @@
1
- export { QueryInfoDialog, type QueryInfoDialogProps } from './QueryInfoDialog';
2
- export { useQueryInfo, type UseQueryInfoOptions, type UseQueryInfoResult, } from './useQueryInfo';
3
- export { buildQueryInfoUrl, fetchQueryInfo, QUERY_INFO_CONTENT_TYPE, type QueryExecutionInfo, type QueryInfoLoader, } from './queryInfo';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data/query-info/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EACL,YAAY,EACZ,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,GACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,uBAAuB,EACvB,KAAK,kBAAkB,EACvB,KAAK,eAAe,GACrB,MAAM,aAAa,CAAC"}
@@ -1,42 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const QUERY_INFO_CONTENT_TYPE = "application/info+json";
4
- function buildQueryInfoUrl(url) {
5
- if (/[?&]__info=/.test(url)) return url;
6
- const hashAt = url.indexOf("#");
7
- const base = hashAt === -1 ? url : url.slice(0, hashAt);
8
- const hash = hashAt === -1 ? "" : url.slice(hashAt);
9
- return `${base}${base.includes("?") ? "&" : "?"}__info=true${hash}`;
10
- }
11
- async function fetchQueryInfo(url) {
12
- const response = await fetch(buildQueryInfoUrl(url), {
13
- headers: { Accept: QUERY_INFO_CONTENT_TYPE }
14
- });
15
- const body = await response.text();
16
- const parsed = parseInfoBody(body);
17
- if (response.ok) {
18
- if (!parsed) throw new Error(`${url} did not answer with query details`);
19
- return parsed;
20
- }
21
- if (!parsed) {
22
- throw new Error(`${url} answered ${response.status} ${response.statusText}`);
23
- }
24
- return parsed;
25
- }
26
- function parseInfoBody(body) {
27
- let value;
28
- try {
29
- value = JSON.parse(body);
30
- } catch {
31
- return null;
32
- }
33
- if (!value || typeof value !== "object") return null;
34
- const info = value;
35
- const error = info.error ?? info.message;
36
- if (!error) return info;
37
- return { ...info, error };
38
- }
39
- exports.QUERY_INFO_CONTENT_TYPE = QUERY_INFO_CONTENT_TYPE;
40
- exports.buildQueryInfoUrl = buildQueryInfoUrl;
41
- exports.fetchQueryInfo = fetchQueryInfo;
42
- //# sourceMappingURL=queryInfo.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"queryInfo.cjs","sources":["../../../src/data/query-info/queryInfo.ts"],"sourcesContent":["import type { QueryBrowserDiagnostics } from \"../query-browser/QueryBrowser.types\";\n\n/** Media type a result URL answers with when asked what it runs. */\nexport const QUERY_INFO_CONTENT_TYPE = \"application/info+json\";\n\n/**\n * What a result URL says about itself: the query its backend was actually sent,\n * the arguments bound into it, how long it took and what came back.\n *\n * A table shows rows, never the query behind them — the server renders that from\n * parameters and filters which only exist at execution time. This is the answer\n * to \"what did this actually run\", and it is the same answer whether the run\n * succeeded or failed.\n */\nexport type QueryExecutionInfo = {\n profile?: string;\n provider?: string;\n connection?: string;\n url?: string;\n params?: Record<string, unknown>;\n mode?: string;\n rows?: number;\n durationMs?: number;\n headers?: Record<string, string>;\n diagnostics?: QueryBrowserDiagnostics;\n /** Set when the execution failed; its diagnostics still describe the query. */\n error?: string;\n};\n\n/** Loads the info for one surface — a URL to ask, or a console's own re-run. */\nexport type QueryInfoLoader = () => Promise<QueryExecutionInfo>;\n\n/**\n * buildQueryInfoUrl marks a result URL as a question about itself rather than a\n * request for its rows. The marker rides in the query string so the URL stays\n * one a browser can follow, and every parameter the table sent — filters, paging,\n * the lot — is carried along unchanged: an info request for a different page\n * would describe a different query.\n */\nexport function buildQueryInfoUrl(url: string): string {\n if (/[?&]__info=/.test(url)) return url;\n const hashAt = url.indexOf(\"#\");\n const base = hashAt === -1 ? url : url.slice(0, hashAt);\n const hash = hashAt === -1 ? \"\" : url.slice(hashAt);\n return `${base}${base.includes(\"?\") ? \"&\" : \"?\"}__info=true${hash}`;\n}\n\n/**\n * fetchQueryInfo asks a result URL what it runs.\n *\n * A failed execution is not a failed request: the server answers it with the\n * same document plus the error, because a query that broke is the one most worth\n * reading. Only a response that carries no document at all throws.\n */\nexport async function fetchQueryInfo(url: string): Promise<QueryExecutionInfo> {\n const response = await fetch(buildQueryInfoUrl(url), {\n headers: { Accept: QUERY_INFO_CONTENT_TYPE },\n });\n const body = await response.text();\n const parsed = parseInfoBody(body);\n if (response.ok) {\n if (!parsed) throw new Error(`${url} did not answer with query details`);\n return parsed;\n }\n if (!parsed) {\n throw new Error(`${url} answered ${response.status} ${response.statusText}`);\n }\n return parsed;\n}\n\ntype ExecutionErrorBody = {\n code?: string;\n message?: string;\n error?: string;\n diagnostics?: QueryBrowserDiagnostics;\n};\n\nfunction parseInfoBody(body: string): QueryExecutionInfo | null {\n let value: unknown;\n try {\n value = JSON.parse(body);\n } catch {\n return null;\n }\n if (!value || typeof value !== \"object\") return null;\n const info = value as QueryExecutionInfo & ExecutionErrorBody;\n const error = info.error ?? info.message;\n if (!error) return info;\n return { ...info, error };\n}\n"],"names":[],"mappings":";;AAGO,MAAM,0BAA0B;AAoChC,SAAS,kBAAkB,KAAqB;AACrD,MAAI,cAAc,KAAK,GAAG,EAAG,QAAO;AACpC,QAAM,SAAS,IAAI,QAAQ,GAAG;AAC9B,QAAM,OAAO,WAAW,KAAK,MAAM,IAAI,MAAM,GAAG,MAAM;AACtD,QAAM,OAAO,WAAW,KAAK,KAAK,IAAI,MAAM,MAAM;AAClD,SAAO,GAAG,IAAI,GAAG,KAAK,SAAS,GAAG,IAAI,MAAM,GAAG,cAAc,IAAI;AACnE;AASA,eAAsB,eAAe,KAA0C;AAC7E,QAAM,WAAW,MAAM,MAAM,kBAAkB,GAAG,GAAG;AAAA,IACnD,SAAS,EAAE,QAAQ,wBAAA;AAAA,EAAwB,CAC5C;AACD,QAAM,OAAO,MAAM,SAAS,KAAA;AAC5B,QAAM,SAAS,cAAc,IAAI;AACjC,MAAI,SAAS,IAAI;AACf,QAAI,CAAC,OAAQ,OAAM,IAAI,MAAM,GAAG,GAAG,oCAAoC;AACvE,WAAO;AAAA,EACT;AACA,MAAI,CAAC,QAAQ;AACX,UAAM,IAAI,MAAM,GAAG,GAAG,aAAa,SAAS,MAAM,IAAI,SAAS,UAAU,EAAE;AAAA,EAC7E;AACA,SAAO;AACT;AASA,SAAS,cAAc,MAAyC;AAC9D,MAAI;AACJ,MAAI;AACF,YAAQ,KAAK,MAAM,IAAI;AAAA,EACzB,QAAQ;AACN,WAAO;AAAA,EACT;AACA,MAAI,CAAC,SAAS,OAAO,UAAU,SAAU,QAAO;AAChD,QAAM,OAAO;AACb,QAAM,QAAQ,KAAK,SAAS,KAAK;AACjC,MAAI,CAAC,MAAO,QAAO;AACnB,SAAO,EAAE,GAAG,MAAM,MAAA;AACpB;;;;"}
@@ -1,45 +0,0 @@
1
- import { QueryBrowserDiagnostics } from '../query-browser/QueryBrowser.types';
2
- /** Media type a result URL answers with when asked what it runs. */
3
- export declare const QUERY_INFO_CONTENT_TYPE = "application/info+json";
4
- /**
5
- * What a result URL says about itself: the query its backend was actually sent,
6
- * the arguments bound into it, how long it took and what came back.
7
- *
8
- * A table shows rows, never the query behind them — the server renders that from
9
- * parameters and filters which only exist at execution time. This is the answer
10
- * to "what did this actually run", and it is the same answer whether the run
11
- * succeeded or failed.
12
- */
13
- export type QueryExecutionInfo = {
14
- profile?: string;
15
- provider?: string;
16
- connection?: string;
17
- url?: string;
18
- params?: Record<string, unknown>;
19
- mode?: string;
20
- rows?: number;
21
- durationMs?: number;
22
- headers?: Record<string, string>;
23
- diagnostics?: QueryBrowserDiagnostics;
24
- /** Set when the execution failed; its diagnostics still describe the query. */
25
- error?: string;
26
- };
27
- /** Loads the info for one surface — a URL to ask, or a console's own re-run. */
28
- export type QueryInfoLoader = () => Promise<QueryExecutionInfo>;
29
- /**
30
- * buildQueryInfoUrl marks a result URL as a question about itself rather than a
31
- * request for its rows. The marker rides in the query string so the URL stays
32
- * one a browser can follow, and every parameter the table sent — filters, paging,
33
- * the lot — is carried along unchanged: an info request for a different page
34
- * would describe a different query.
35
- */
36
- export declare function buildQueryInfoUrl(url: string): string;
37
- /**
38
- * fetchQueryInfo asks a result URL what it runs.
39
- *
40
- * A failed execution is not a failed request: the server answers it with the
41
- * same document plus the error, because a query that broke is the one most worth
42
- * reading. Only a response that carries no document at all throws.
43
- */
44
- export declare function fetchQueryInfo(url: string): Promise<QueryExecutionInfo>;
45
- //# sourceMappingURL=queryInfo.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"queryInfo.d.ts","sourceRoot":"","sources":["../../../src/data/query-info/queryInfo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAEnF,oEAAoE;AACpE,eAAO,MAAM,uBAAuB,0BAA0B,CAAC;AAE/D;;;;;;;;GAQG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,WAAW,CAAC,EAAE,uBAAuB,CAAC;IACtC,+EAA+E;IAC/E,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,gFAAgF;AAChF,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAEhE;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAMrD;AAED;;;;;;GAMG;AACH,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAc7E"}
@@ -1,42 +0,0 @@
1
- const QUERY_INFO_CONTENT_TYPE = "application/info+json";
2
- function buildQueryInfoUrl(url) {
3
- if (/[?&]__info=/.test(url)) return url;
4
- const hashAt = url.indexOf("#");
5
- const base = hashAt === -1 ? url : url.slice(0, hashAt);
6
- const hash = hashAt === -1 ? "" : url.slice(hashAt);
7
- return `${base}${base.includes("?") ? "&" : "?"}__info=true${hash}`;
8
- }
9
- async function fetchQueryInfo(url) {
10
- const response = await fetch(buildQueryInfoUrl(url), {
11
- headers: { Accept: QUERY_INFO_CONTENT_TYPE }
12
- });
13
- const body = await response.text();
14
- const parsed = parseInfoBody(body);
15
- if (response.ok) {
16
- if (!parsed) throw new Error(`${url} did not answer with query details`);
17
- return parsed;
18
- }
19
- if (!parsed) {
20
- throw new Error(`${url} answered ${response.status} ${response.statusText}`);
21
- }
22
- return parsed;
23
- }
24
- function parseInfoBody(body) {
25
- let value;
26
- try {
27
- value = JSON.parse(body);
28
- } catch {
29
- return null;
30
- }
31
- if (!value || typeof value !== "object") return null;
32
- const info = value;
33
- const error = info.error ?? info.message;
34
- if (!error) return info;
35
- return { ...info, error };
36
- }
37
- export {
38
- QUERY_INFO_CONTENT_TYPE,
39
- buildQueryInfoUrl,
40
- fetchQueryInfo
41
- };
42
- //# sourceMappingURL=queryInfo.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"queryInfo.js","sources":["../../../src/data/query-info/queryInfo.ts"],"sourcesContent":["import type { QueryBrowserDiagnostics } from \"../query-browser/QueryBrowser.types\";\n\n/** Media type a result URL answers with when asked what it runs. */\nexport const QUERY_INFO_CONTENT_TYPE = \"application/info+json\";\n\n/**\n * What a result URL says about itself: the query its backend was actually sent,\n * the arguments bound into it, how long it took and what came back.\n *\n * A table shows rows, never the query behind them — the server renders that from\n * parameters and filters which only exist at execution time. This is the answer\n * to \"what did this actually run\", and it is the same answer whether the run\n * succeeded or failed.\n */\nexport type QueryExecutionInfo = {\n profile?: string;\n provider?: string;\n connection?: string;\n url?: string;\n params?: Record<string, unknown>;\n mode?: string;\n rows?: number;\n durationMs?: number;\n headers?: Record<string, string>;\n diagnostics?: QueryBrowserDiagnostics;\n /** Set when the execution failed; its diagnostics still describe the query. */\n error?: string;\n};\n\n/** Loads the info for one surface — a URL to ask, or a console's own re-run. */\nexport type QueryInfoLoader = () => Promise<QueryExecutionInfo>;\n\n/**\n * buildQueryInfoUrl marks a result URL as a question about itself rather than a\n * request for its rows. The marker rides in the query string so the URL stays\n * one a browser can follow, and every parameter the table sent — filters, paging,\n * the lot — is carried along unchanged: an info request for a different page\n * would describe a different query.\n */\nexport function buildQueryInfoUrl(url: string): string {\n if (/[?&]__info=/.test(url)) return url;\n const hashAt = url.indexOf(\"#\");\n const base = hashAt === -1 ? url : url.slice(0, hashAt);\n const hash = hashAt === -1 ? \"\" : url.slice(hashAt);\n return `${base}${base.includes(\"?\") ? \"&\" : \"?\"}__info=true${hash}`;\n}\n\n/**\n * fetchQueryInfo asks a result URL what it runs.\n *\n * A failed execution is not a failed request: the server answers it with the\n * same document plus the error, because a query that broke is the one most worth\n * reading. Only a response that carries no document at all throws.\n */\nexport async function fetchQueryInfo(url: string): Promise<QueryExecutionInfo> {\n const response = await fetch(buildQueryInfoUrl(url), {\n headers: { Accept: QUERY_INFO_CONTENT_TYPE },\n });\n const body = await response.text();\n const parsed = parseInfoBody(body);\n if (response.ok) {\n if (!parsed) throw new Error(`${url} did not answer with query details`);\n return parsed;\n }\n if (!parsed) {\n throw new Error(`${url} answered ${response.status} ${response.statusText}`);\n }\n return parsed;\n}\n\ntype ExecutionErrorBody = {\n code?: string;\n message?: string;\n error?: string;\n diagnostics?: QueryBrowserDiagnostics;\n};\n\nfunction parseInfoBody(body: string): QueryExecutionInfo | null {\n let value: unknown;\n try {\n value = JSON.parse(body);\n } catch {\n return null;\n }\n if (!value || typeof value !== \"object\") return null;\n const info = value as QueryExecutionInfo & ExecutionErrorBody;\n const error = info.error ?? info.message;\n if (!error) return info;\n return { ...info, error };\n}\n"],"names":[],"mappings":"AAGO,MAAM,0BAA0B;AAoChC,SAAS,kBAAkB,KAAqB;AACrD,MAAI,cAAc,KAAK,GAAG,EAAG,QAAO;AACpC,QAAM,SAAS,IAAI,QAAQ,GAAG;AAC9B,QAAM,OAAO,WAAW,KAAK,MAAM,IAAI,MAAM,GAAG,MAAM;AACtD,QAAM,OAAO,WAAW,KAAK,KAAK,IAAI,MAAM,MAAM;AAClD,SAAO,GAAG,IAAI,GAAG,KAAK,SAAS,GAAG,IAAI,MAAM,GAAG,cAAc,IAAI;AACnE;AASA,eAAsB,eAAe,KAA0C;AAC7E,QAAM,WAAW,MAAM,MAAM,kBAAkB,GAAG,GAAG;AAAA,IACnD,SAAS,EAAE,QAAQ,wBAAA;AAAA,EAAwB,CAC5C;AACD,QAAM,OAAO,MAAM,SAAS,KAAA;AAC5B,QAAM,SAAS,cAAc,IAAI;AACjC,MAAI,SAAS,IAAI;AACf,QAAI,CAAC,OAAQ,OAAM,IAAI,MAAM,GAAG,GAAG,oCAAoC;AACvE,WAAO;AAAA,EACT;AACA,MAAI,CAAC,QAAQ;AACX,UAAM,IAAI,MAAM,GAAG,GAAG,aAAa,SAAS,MAAM,IAAI,SAAS,UAAU,EAAE;AAAA,EAC7E;AACA,SAAO;AACT;AASA,SAAS,cAAc,MAAyC;AAC9D,MAAI;AACJ,MAAI;AACF,YAAQ,KAAK,MAAM,IAAI;AAAA,EACzB,QAAQ;AACN,WAAO;AAAA,EACT;AACA,MAAI,CAAC,SAAS,OAAO,UAAU,SAAU,QAAO;AAChD,QAAM,OAAO;AACb,QAAM,QAAQ,KAAK,SAAS,KAAK;AACjC,MAAI,CAAC,MAAO,QAAO;AACnB,SAAO,EAAE,GAAG,MAAM,MAAA;AACpB;"}
@@ -1,48 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const jsxRuntime = require("react/jsx-runtime");
4
- const react = require("react");
5
- const QueryInfoDialog = require("./QueryInfoDialog.cjs");
6
- const queryInfo = require("./queryInfo.cjs");
7
- const UiDebug = require("../../icons/components/UiDebug.cjs");
8
- function useQueryInfo({
9
- url,
10
- load,
11
- title
12
- }) {
13
- const [open, setOpen] = react.useState(false);
14
- const loader = react.useMemo(() => {
15
- if (load) return load;
16
- if (!url) return void 0;
17
- return () => queryInfo.fetchQueryInfo(url);
18
- }, [load, url]);
19
- const close = react.useCallback(() => setOpen(false), []);
20
- const action = react.useMemo(
21
- () => loader ? {
22
- id: "show-query",
23
- label: "Debug",
24
- icon: UiDebug.UiDebug,
25
- // No heading and no description: one word under a "Debug" heading
26
- // beside a one-line gloss of itself is three ways of saying the
27
- // same thing in a menu with room for one.
28
- section: "",
29
- onSelect: () => setOpen(true)
30
- } : void 0,
31
- [loader]
32
- );
33
- if (!loader) return { action: void 0, dialog: null };
34
- return {
35
- action,
36
- dialog: /* @__PURE__ */ jsxRuntime.jsx(
37
- QueryInfoDialog.QueryInfoDialog,
38
- {
39
- open,
40
- onClose: close,
41
- load: loader,
42
- ...title ? { title } : {}
43
- }
44
- )
45
- };
46
- }
47
- exports.useQueryInfo = useQueryInfo;
48
- //# sourceMappingURL=useQueryInfo.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useQueryInfo.cjs","sources":["../../../src/data/query-info/useQueryInfo.tsx"],"sourcesContent":["import { useCallback, useMemo, useState, type ReactNode } from \"react\";\nimport { UiDebug } from \"../../icons\";\nimport type { DataTableMenuAction } from \"../DataTable\";\nimport { QueryInfoDialog } from \"./QueryInfoDialog\";\nimport { fetchQueryInfo, type QueryInfoLoader } from \"./queryInfo\";\n\nexport type UseQueryInfoOptions = {\n /** Result URL to ask what it runs. Ignored when `load` is given. */\n url?: string | undefined;\n /** Reads the details some other way — a console re-running its own query. */\n load?: QueryInfoLoader | undefined;\n /** Dialog heading. */\n title?: string | undefined;\n};\n\nexport type UseQueryInfoResult = {\n /** \"Debug\" for the table's overflow menu; absent with nothing to ask. */\n action: DataTableMenuAction | undefined;\n /** Render alongside the table — the dialog the action opens. */\n dialog: ReactNode;\n};\n\n/**\n * useQueryInfo puts \"Debug\" in a result table's overflow menu.\n *\n * The details are read when the menu item is chosen, never before: asking costs\n * a second execution against the same backend, which is a price only a user who\n * wants the answer should pay.\n */\nexport function useQueryInfo({\n url,\n load,\n title,\n}: UseQueryInfoOptions): UseQueryInfoResult {\n const [open, setOpen] = useState(false);\n const loader = useMemo<QueryInfoLoader | undefined>(() => {\n if (load) return load;\n if (!url) return undefined;\n return () => fetchQueryInfo(url);\n }, [load, url]);\n const close = useCallback(() => setOpen(false), []);\n // The action lands in a memoized menu-action list, so a fresh object each\n // render would rebuild that list — and the table's menu — on every render.\n const action = useMemo<DataTableMenuAction | undefined>(\n () =>\n loader\n ? {\n id: \"show-query\",\n label: \"Debug\",\n icon: UiDebug,\n // No heading and no description: one word under a \"Debug\" heading\n // beside a one-line gloss of itself is three ways of saying the\n // same thing in a menu with room for one.\n section: \"\",\n onSelect: () => setOpen(true),\n }\n : undefined,\n [loader],\n );\n\n if (!loader) return { action: undefined, dialog: null };\n\n return {\n action,\n dialog: (\n <QueryInfoDialog\n open={open}\n onClose={close}\n load={loader}\n {...(title ? { title } : {})}\n />\n ),\n };\n}\n"],"names":["useState","useMemo","fetchQueryInfo","useCallback","UiDebug","jsx","QueryInfoDialog"],"mappings":";;;;;;;AA6BO,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AACF,GAA4C;AAC1C,QAAM,CAAC,MAAM,OAAO,IAAIA,MAAAA,SAAS,KAAK;AACtC,QAAM,SAASC,MAAAA,QAAqC,MAAM;AACxD,QAAI,KAAM,QAAO;AACjB,QAAI,CAAC,IAAK,QAAO;AACjB,WAAO,MAAMC,UAAAA,eAAe,GAAG;AAAA,EACjC,GAAG,CAAC,MAAM,GAAG,CAAC;AACd,QAAM,QAAQC,MAAAA,YAAY,MAAM,QAAQ,KAAK,GAAG,CAAA,CAAE;AAGlD,QAAM,SAASF,MAAAA;AAAAA,IACb,MACE,SACI;AAAA,MACE,IAAI;AAAA,MACJ,OAAO;AAAA,MACP,MAAMG,QAAAA;AAAAA;AAAAA;AAAAA;AAAAA,MAIN,SAAS;AAAA,MACT,UAAU,MAAM,QAAQ,IAAI;AAAA,IAAA,IAE9B;AAAA,IACN,CAAC,MAAM;AAAA,EAAA;AAGT,MAAI,CAAC,OAAQ,QAAO,EAAE,QAAQ,QAAW,QAAQ,KAAA;AAEjD,SAAO;AAAA,IACL;AAAA,IACA,QACEC,2BAAAA;AAAAA,MAACC,gBAAAA;AAAAA,MAAA;AAAA,QACC;AAAA,QACA,SAAS;AAAA,QACT,MAAM;AAAA,QACL,GAAI,QAAQ,EAAE,UAAU,CAAA;AAAA,MAAC;AAAA,IAAA;AAAA,EAC5B;AAGN;;"}
@@ -1,26 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { DataTableMenuAction } from '../DataTable';
3
- import { QueryInfoLoader } from './queryInfo';
4
- export type UseQueryInfoOptions = {
5
- /** Result URL to ask what it runs. Ignored when `load` is given. */
6
- url?: string | undefined;
7
- /** Reads the details some other way — a console re-running its own query. */
8
- load?: QueryInfoLoader | undefined;
9
- /** Dialog heading. */
10
- title?: string | undefined;
11
- };
12
- export type UseQueryInfoResult = {
13
- /** "Debug" for the table's overflow menu; absent with nothing to ask. */
14
- action: DataTableMenuAction | undefined;
15
- /** Render alongside the table — the dialog the action opens. */
16
- dialog: ReactNode;
17
- };
18
- /**
19
- * useQueryInfo puts "Debug" in a result table's overflow menu.
20
- *
21
- * The details are read when the menu item is chosen, never before: asking costs
22
- * a second execution against the same backend, which is a price only a user who
23
- * wants the answer should pay.
24
- */
25
- export declare function useQueryInfo({ url, load, title, }: UseQueryInfoOptions): UseQueryInfoResult;
26
- //# sourceMappingURL=useQueryInfo.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useQueryInfo.d.ts","sourceRoot":"","sources":["../../../src/data/query-info/useQueryInfo.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAExD,OAAO,EAAkB,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnE,MAAM,MAAM,mBAAmB,GAAG;IAChC,oEAAoE;IACpE,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,6EAA6E;IAC7E,IAAI,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC;IACnC,sBAAsB;IACtB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,yEAAyE;IACzE,MAAM,EAAE,mBAAmB,GAAG,SAAS,CAAC;IACxC,gEAAgE;IAChE,MAAM,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,EAC3B,GAAG,EACH,IAAI,EACJ,KAAK,GACN,EAAE,mBAAmB,GAAG,kBAAkB,CAwC1C"}
@@ -1,48 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { useState, useMemo, useCallback } from "react";
3
- import { QueryInfoDialog } from "./QueryInfoDialog.js";
4
- import { fetchQueryInfo } from "./queryInfo.js";
5
- import { UiDebug } from "../../icons/components/UiDebug.js";
6
- function useQueryInfo({
7
- url,
8
- load,
9
- title
10
- }) {
11
- const [open, setOpen] = useState(false);
12
- const loader = useMemo(() => {
13
- if (load) return load;
14
- if (!url) return void 0;
15
- return () => fetchQueryInfo(url);
16
- }, [load, url]);
17
- const close = useCallback(() => setOpen(false), []);
18
- const action = useMemo(
19
- () => loader ? {
20
- id: "show-query",
21
- label: "Debug",
22
- icon: UiDebug,
23
- // No heading and no description: one word under a "Debug" heading
24
- // beside a one-line gloss of itself is three ways of saying the
25
- // same thing in a menu with room for one.
26
- section: "",
27
- onSelect: () => setOpen(true)
28
- } : void 0,
29
- [loader]
30
- );
31
- if (!loader) return { action: void 0, dialog: null };
32
- return {
33
- action,
34
- dialog: /* @__PURE__ */ jsx(
35
- QueryInfoDialog,
36
- {
37
- open,
38
- onClose: close,
39
- load: loader,
40
- ...title ? { title } : {}
41
- }
42
- )
43
- };
44
- }
45
- export {
46
- useQueryInfo
47
- };
48
- //# sourceMappingURL=useQueryInfo.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useQueryInfo.js","sources":["../../../src/data/query-info/useQueryInfo.tsx"],"sourcesContent":["import { useCallback, useMemo, useState, type ReactNode } from \"react\";\nimport { UiDebug } from \"../../icons\";\nimport type { DataTableMenuAction } from \"../DataTable\";\nimport { QueryInfoDialog } from \"./QueryInfoDialog\";\nimport { fetchQueryInfo, type QueryInfoLoader } from \"./queryInfo\";\n\nexport type UseQueryInfoOptions = {\n /** Result URL to ask what it runs. Ignored when `load` is given. */\n url?: string | undefined;\n /** Reads the details some other way — a console re-running its own query. */\n load?: QueryInfoLoader | undefined;\n /** Dialog heading. */\n title?: string | undefined;\n};\n\nexport type UseQueryInfoResult = {\n /** \"Debug\" for the table's overflow menu; absent with nothing to ask. */\n action: DataTableMenuAction | undefined;\n /** Render alongside the table — the dialog the action opens. */\n dialog: ReactNode;\n};\n\n/**\n * useQueryInfo puts \"Debug\" in a result table's overflow menu.\n *\n * The details are read when the menu item is chosen, never before: asking costs\n * a second execution against the same backend, which is a price only a user who\n * wants the answer should pay.\n */\nexport function useQueryInfo({\n url,\n load,\n title,\n}: UseQueryInfoOptions): UseQueryInfoResult {\n const [open, setOpen] = useState(false);\n const loader = useMemo<QueryInfoLoader | undefined>(() => {\n if (load) return load;\n if (!url) return undefined;\n return () => fetchQueryInfo(url);\n }, [load, url]);\n const close = useCallback(() => setOpen(false), []);\n // The action lands in a memoized menu-action list, so a fresh object each\n // render would rebuild that list — and the table's menu — on every render.\n const action = useMemo<DataTableMenuAction | undefined>(\n () =>\n loader\n ? {\n id: \"show-query\",\n label: \"Debug\",\n icon: UiDebug,\n // No heading and no description: one word under a \"Debug\" heading\n // beside a one-line gloss of itself is three ways of saying the\n // same thing in a menu with room for one.\n section: \"\",\n onSelect: () => setOpen(true),\n }\n : undefined,\n [loader],\n );\n\n if (!loader) return { action: undefined, dialog: null };\n\n return {\n action,\n dialog: (\n <QueryInfoDialog\n open={open}\n onClose={close}\n load={loader}\n {...(title ? { title } : {})}\n />\n ),\n };\n}\n"],"names":[],"mappings":";;;;;AA6BO,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AACF,GAA4C;AAC1C,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,KAAK;AACtC,QAAM,SAAS,QAAqC,MAAM;AACxD,QAAI,KAAM,QAAO;AACjB,QAAI,CAAC,IAAK,QAAO;AACjB,WAAO,MAAM,eAAe,GAAG;AAAA,EACjC,GAAG,CAAC,MAAM,GAAG,CAAC;AACd,QAAM,QAAQ,YAAY,MAAM,QAAQ,KAAK,GAAG,CAAA,CAAE;AAGlD,QAAM,SAAS;AAAA,IACb,MACE,SACI;AAAA,MACE,IAAI;AAAA,MACJ,OAAO;AAAA,MACP,MAAM;AAAA;AAAA;AAAA;AAAA,MAIN,SAAS;AAAA,MACT,UAAU,MAAM,QAAQ,IAAI;AAAA,IAAA,IAE9B;AAAA,IACN,CAAC,MAAM;AAAA,EAAA;AAGT,MAAI,CAAC,OAAQ,QAAO,EAAE,QAAQ,QAAW,QAAQ,KAAA;AAEjD,SAAO;AAAA,IACL;AAAA,IACA,QACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,SAAS;AAAA,QACT,MAAM;AAAA,QACL,GAAI,QAAQ,EAAE,UAAU,CAAA;AAAA,MAAC;AAAA,IAAA;AAAA,EAC5B;AAGN;"}