chrome-devtools-frontend 1.0.1545096 → 1.0.1547571

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 (301) hide show
  1. package/.stylelintrc.json +5 -1
  2. package/docs/contributing/infrastructure.md +2 -2
  3. package/docs/styleguide/ux/styles.md +1 -1
  4. package/eslint.config.mjs +2 -1
  5. package/front_end/Images/generate-css-vars.js +1 -1
  6. package/front_end/Images/src/arrow-down.svg +8 -1
  7. package/front_end/Images/src/arrow-up.svg +8 -1
  8. package/front_end/core/common/common.ts +0 -2
  9. package/front_end/core/host/AidaClient.ts +1 -1
  10. package/front_end/core/host/InspectorFrontendHostAPI.ts +0 -1
  11. package/front_end/core/host/UserMetrics.ts +0 -5
  12. package/front_end/core/i18n/collect-ui-strings.js +1 -1
  13. package/front_end/core/i18n/generate-locales-js.js +1 -1
  14. package/front_end/core/platform/HostRuntime.ts +25 -0
  15. package/front_end/core/platform/KeyboardUtilities.ts +2 -2
  16. package/front_end/core/platform/StringUtilities.ts +1 -1
  17. package/front_end/core/platform/api/HostRuntime.ts +45 -0
  18. package/front_end/core/platform/api/api.ts +7 -0
  19. package/front_end/core/{common/Worker.ts → platform/browser/HostRuntime.ts} +27 -12
  20. package/front_end/core/platform/browser/browser.ts +7 -0
  21. package/front_end/core/platform/node/HostRuntime.ts +85 -0
  22. package/front_end/core/platform/node/node.ts +7 -0
  23. package/front_end/core/platform/platform.ts +2 -2
  24. package/front_end/core/sdk/AnimationModel.ts +1 -1
  25. package/front_end/core/sdk/CSSModel.ts +1 -1
  26. package/front_end/core/sdk/CSSProperty.ts +1 -1
  27. package/front_end/core/sdk/CSSPropertyParserMatchers.ts +1 -1
  28. package/front_end/core/sdk/ConsoleModel.ts +1 -1
  29. package/front_end/core/sdk/Cookie.ts +1 -1
  30. package/front_end/core/sdk/DOMModel.ts +2 -2
  31. package/front_end/core/sdk/DebuggerModel.ts +1 -1
  32. package/front_end/core/sdk/NetworkManager.ts +6 -0
  33. package/front_end/core/sdk/PreloadingModel.ts +1 -1
  34. package/front_end/core/sdk/RemoteObject.ts +1 -1
  35. package/front_end/core/sdk/ResourceTreeModel.ts +1 -1
  36. package/front_end/core/sdk/Script.ts +4 -4
  37. package/front_end/core/sdk/SourceMapScopesInfo.ts +141 -23
  38. package/front_end/core/sdk/Target.ts +5 -14
  39. package/front_end/core/sdk/TargetManager.ts +26 -4
  40. package/front_end/core/sdk/sdk-meta.ts +62 -0
  41. package/front_end/devtools_compatibility.js +0 -1
  42. package/front_end/entrypoints/formatter_worker/HTMLFormatter.ts +2 -2
  43. package/front_end/entrypoints/formatter_worker/JavaScriptFormatter.ts +15 -18
  44. package/front_end/entrypoints/formatter_worker/formatter_worker-entrypoint.ts +8 -5
  45. package/front_end/entrypoints/main/ExecutionContextSelector.ts +1 -1
  46. package/front_end/entrypoints/main/MainImpl.ts +4 -4
  47. package/front_end/foundation/Universe.ts +2 -2
  48. package/front_end/generated/Deprecation.ts +26 -0
  49. package/front_end/generated/InspectorBackendCommands.ts +5 -4
  50. package/front_end/generated/SupportedCSSProperties.js +17 -15
  51. package/front_end/generated/protocol-mapping.d.ts +2 -0
  52. package/front_end/generated/protocol-proxy-api.d.ts +4 -0
  53. package/front_end/generated/protocol.ts +19 -29
  54. package/front_end/models/ai_assistance/AiConversation.ts +268 -0
  55. package/front_end/models/ai_assistance/AiHistoryStorage.ts +1 -172
  56. package/front_end/models/ai_assistance/BuiltInAi.ts +131 -134
  57. package/front_end/models/ai_assistance/ChangeManager.ts +9 -0
  58. package/front_end/models/ai_assistance/ConversationHandler.ts +27 -52
  59. package/front_end/models/ai_assistance/agents/AiAgent.ts +9 -8
  60. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +6 -2
  61. package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +1 -1
  62. package/front_end/models/ai_assistance/agents/StylingAgent.ts +3 -19
  63. package/front_end/models/ai_assistance/ai_assistance.ts +2 -0
  64. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +313 -313
  65. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +8 -6
  66. package/front_end/models/ai_assistance/performance/AICallTree.snapshot.txt +33 -33
  67. package/front_end/models/ai_assistance/performance/AICallTree.ts +9 -3
  68. package/front_end/models/bindings/CSSWorkspaceBinding.ts +5 -3
  69. package/front_end/models/bindings/SASSSourceMapping.ts +6 -4
  70. package/front_end/models/cpu_profile/CPUProfileDataModel.ts +10 -7
  71. package/front_end/models/crux-manager/CrUXManager.ts +7 -4
  72. package/front_end/models/formatter/FormatterWorkerPool.ts +9 -7
  73. package/front_end/models/har/Importer.ts +1 -1
  74. package/front_end/models/issues_manager/ContrastCheckTrigger.ts +1 -1
  75. package/front_end/models/issues_manager/GenericIssue.ts +12 -9
  76. package/front_end/models/javascript_metadata/NativeFunctions.js +4 -0
  77. package/front_end/models/persistence/AutomaticFileSystemManager.ts +1 -1
  78. package/front_end/models/trace/handlers/SamplesHandler.ts +3 -0
  79. package/front_end/models/trace/helpers/Trace.ts +13 -0
  80. package/front_end/models/trace/types/TraceEvents.ts +2 -1
  81. package/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +29 -0
  82. package/front_end/models/workspace/IgnoreListManager.ts +1 -2
  83. package/front_end/models/workspace/UISourceCode.ts +50 -0
  84. package/front_end/panels/accessibility/AccessibilityNodeView.ts +1 -1
  85. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +86 -159
  86. package/front_end/panels/ai_assistance/ai_assistance-meta.ts +8 -0
  87. package/front_end/panels/ai_assistance/components/ChatView.ts +56 -33
  88. package/front_end/panels/animation/AnimationTimeline.ts +0 -8
  89. package/front_end/panels/application/ExtensionStorageModel.ts +1 -1
  90. package/front_end/panels/application/FrameDetailsView.ts +64 -36
  91. package/front_end/panels/application/ServiceWorkerCacheViews.ts +1 -1
  92. package/front_end/panels/application/components/components.ts +0 -2
  93. package/front_end/panels/common/AiCodeGenerationTeaser.ts +80 -0
  94. package/front_end/panels/common/common.ts +2 -1
  95. package/front_end/panels/console/ConsoleInsightTeaser.ts +166 -100
  96. package/front_end/panels/console/ConsolePrompt.ts +4 -2
  97. package/front_end/panels/console/ConsoleViewMessage.ts +77 -29
  98. package/front_end/panels/console/ConsoleViewport.ts +2 -3
  99. package/front_end/panels/console/consoleInsightTeaser.css +1 -0
  100. package/front_end/panels/coverage/CoverageModel.ts +2 -2
  101. package/front_end/panels/elements/ElementIssueUtils.ts +2 -2
  102. package/front_end/panels/elements/ElementsPanel.ts +1 -1
  103. package/front_end/panels/elements/ElementsTreeOutline.ts +17 -7
  104. package/front_end/panels/elements/NodeStackTraceWidget.ts +6 -5
  105. package/front_end/panels/elements/StylePropertyTreeElement.ts +24 -21
  106. package/front_end/panels/elements/StylesSidebarPane.ts +1 -1
  107. package/front_end/panels/elements/cssValueTraceView.css +1 -1
  108. package/front_end/panels/elements/elements-meta.ts +1 -0
  109. package/front_end/panels/explain/components/ConsoleInsight.ts +44 -57
  110. package/front_end/panels/explain/components/consoleInsight.css +46 -1
  111. package/front_end/panels/layer_viewer/LayerTreeOutline.ts +1 -2
  112. package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +19 -0
  113. package/front_end/panels/network/RequestConditionsDrawer.ts +116 -42
  114. package/front_end/panels/network/networkLogView.css +11 -0
  115. package/front_end/panels/network/networkTimingTable.css +8 -6
  116. package/front_end/panels/network/requestConditionsDrawer.css +10 -1
  117. package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +1 -1
  118. package/front_end/panels/profiler/HeapSnapshotProxy.ts +15 -14
  119. package/front_end/panels/profiler/ProfilesPanel.ts +1 -2
  120. package/front_end/panels/recorder/components/StepEditor.ts +1 -1
  121. package/front_end/panels/security/SecurityPanelSidebar.ts +1 -3
  122. package/front_end/panels/settings/KeybindsSettingsTab.ts +21 -22
  123. package/front_end/panels/sources/CSSPlugin.ts +1 -1
  124. package/front_end/panels/sources/CoveragePlugin.ts +5 -5
  125. package/front_end/panels/sources/DebuggerPlugin.ts +2 -2
  126. package/front_end/panels/sources/NavigatorView.ts +1 -1
  127. package/front_end/panels/sources/Plugin.ts +1 -1
  128. package/front_end/panels/sources/ProfilePlugin.ts +22 -14
  129. package/front_end/panels/sources/SourcesSearchScope.ts +1 -1
  130. package/front_end/panels/sources/UISourceCodeFrame.ts +2 -1
  131. package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +10 -2
  132. package/front_end/panels/sources/sources-meta.ts +0 -62
  133. package/front_end/panels/timeline/README.md +1 -9
  134. package/front_end/panels/timeline/ThreadAppender.ts +0 -7
  135. package/front_end/panels/timeline/TimelineFlameChartView.ts +1 -1
  136. package/front_end/panels/timeline/TimelinePanel.ts +8 -8
  137. package/front_end/panels/timeline/TimelineUIUtils.ts +5 -1
  138. package/front_end/panels/timeline/components/ExportTraceOptions.ts +15 -1
  139. package/front_end/panels/timeline/components/LiveMetricsView.ts +37 -1
  140. package/front_end/panels/timeline/components/exportTraceOptions.css +11 -2
  141. package/front_end/panels/timeline/enable-easter-egg.js +1 -1
  142. package/front_end/panels/timeline/utils/Treemap.ts +1 -1
  143. package/front_end/third_party/chromium/README.chromium +1 -1
  144. package/front_end/third_party/puppeteer/README.chromium +2 -2
  145. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/DeviceRequestPrompt.d.ts +66 -0
  146. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/DeviceRequestPrompt.d.ts.map +1 -0
  147. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/DeviceRequestPrompt.js +57 -0
  148. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/DeviceRequestPrompt.js.map +1 -0
  149. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.d.ts +1 -1
  150. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.d.ts.map +1 -1
  151. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.js.map +1 -1
  152. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts +2 -2
  153. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts.map +1 -1
  154. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js.map +1 -1
  155. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/api.d.ts +1 -0
  156. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/api.d.ts.map +1 -1
  157. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/api.js +1 -0
  158. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/api.js.map +1 -1
  159. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
  160. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.js +1 -6
  161. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.js.map +1 -1
  162. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts +0 -4
  163. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts.map +1 -1
  164. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js +18 -23
  165. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js.map +1 -1
  166. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts +2 -0
  167. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
  168. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js +16 -0
  169. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
  170. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.d.ts +4 -62
  171. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.d.ts.map +1 -1
  172. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.js +9 -73
  173. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.js.map +1 -1
  174. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Frame.d.ts +1 -1
  175. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Frame.d.ts.map +1 -1
  176. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Frame.js.map +1 -1
  177. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts +1 -1
  178. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts.map +1 -1
  179. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js +3 -3
  180. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js.map +1 -1
  181. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.d.ts +8 -1
  182. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.d.ts.map +1 -1
  183. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.js +11 -1
  184. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.js.map +1 -1
  185. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
  186. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +3 -3
  187. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +3 -3
  188. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js.map +1 -1
  189. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
  190. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
  191. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
  192. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +9 -10
  193. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +80 -81
  194. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/DeviceRequestPrompt.d.ts +66 -0
  195. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/DeviceRequestPrompt.d.ts.map +1 -0
  196. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/DeviceRequestPrompt.js +52 -0
  197. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/DeviceRequestPrompt.js.map +1 -0
  198. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.d.ts +1 -1
  199. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.d.ts.map +1 -1
  200. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.js.map +1 -1
  201. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts +2 -2
  202. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts.map +1 -1
  203. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js.map +1 -1
  204. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/api.d.ts +1 -0
  205. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/api.d.ts.map +1 -1
  206. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/api.js +1 -0
  207. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/api.js.map +1 -1
  208. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
  209. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.js +1 -6
  210. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.js.map +1 -1
  211. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts +0 -4
  212. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts.map +1 -1
  213. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js +18 -23
  214. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js.map +1 -1
  215. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts +2 -0
  216. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
  217. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js +16 -0
  218. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
  219. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.d.ts +4 -62
  220. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.d.ts.map +1 -1
  221. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.js +6 -69
  222. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.js.map +1 -1
  223. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Frame.d.ts +1 -1
  224. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Frame.d.ts.map +1 -1
  225. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Frame.js.map +1 -1
  226. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts +1 -1
  227. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts.map +1 -1
  228. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js +3 -3
  229. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js.map +1 -1
  230. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.d.ts +8 -1
  231. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.d.ts.map +1 -1
  232. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.js +11 -1
  233. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.js.map +1 -1
  234. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +3 -3
  235. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +3 -3
  236. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js.map +1 -1
  237. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
  238. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
  239. package/front_end/third_party/puppeteer/package/lib/types.d.ts +9 -10
  240. package/front_end/third_party/puppeteer/package/package.json +3 -3
  241. package/front_end/third_party/puppeteer/package/src/api/DeviceRequestPrompt.ts +79 -0
  242. package/front_end/third_party/puppeteer/package/src/api/Frame.ts +1 -1
  243. package/front_end/third_party/puppeteer/package/src/api/Page.ts +2 -2
  244. package/front_end/third_party/puppeteer/package/src/api/api.ts +1 -0
  245. package/front_end/third_party/puppeteer/package/src/bidi/HTTPRequest.ts +1 -9
  246. package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +21 -31
  247. package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +18 -0
  248. package/front_end/third_party/puppeteer/package/src/cdp/DeviceRequestPrompt.ts +6 -72
  249. package/front_end/third_party/puppeteer/package/src/cdp/Frame.ts +2 -4
  250. package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +7 -2
  251. package/front_end/third_party/puppeteer/package/src/common/ConsoleMessage.ts +14 -0
  252. package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
  253. package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
  254. package/front_end/third_party/puppeteer/puppeteer-tsconfig.json +1 -0
  255. package/front_end/ui/components/markdown_view/MarkdownLinksMap.ts +5 -0
  256. package/front_end/ui/components/text_editor/javascript.ts +1 -1
  257. package/front_end/ui/legacy/ARIAUtils.ts +2 -2
  258. package/front_end/ui/legacy/ActionRegistration.ts +11 -0
  259. package/front_end/ui/legacy/ListWidget.ts +51 -18
  260. package/front_end/ui/legacy/ReportView.ts +1 -1
  261. package/front_end/ui/legacy/SoftDropDown.ts +2 -2
  262. package/front_end/ui/legacy/TabbedPane.ts +3 -3
  263. package/front_end/ui/legacy/TextPrompt.ts +3 -2
  264. package/front_end/ui/legacy/Treeoutline.ts +3 -2
  265. package/front_end/ui/legacy/UIUtils.ts +11 -10
  266. package/front_end/ui/legacy/Widget.ts +3 -2
  267. package/front_end/ui/legacy/components/color_picker/ContrastInfo.ts +1 -1
  268. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +5 -4
  269. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +87 -111
  270. package/front_end/ui/legacy/components/perf_ui/LineLevelProfile.ts +62 -39
  271. package/front_end/ui/legacy/components/perf_ui/OverviewGrid.ts +1 -1
  272. package/front_end/ui/legacy/components/perf_ui/TimelineGrid.ts +2 -2
  273. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +3 -9
  274. package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +41 -13
  275. package/front_end/ui/legacy/components/utils/jsUtils.css +28 -0
  276. package/front_end/ui/legacy/inspectorCommon.css +2 -2
  277. package/front_end/ui/legacy/legacy.ts +2 -0
  278. package/front_end/ui/visual_logging/KnownContextValues.ts +2 -0
  279. package/front_end/ui/visual_logging/LoggingConfig.ts +2 -1
  280. package/inspector_overlay/tool_window_controls.ts +4 -1
  281. package/mcp/mcp.ts +1 -1
  282. package/package.json +2 -3
  283. package/front_end/panels/application/components/StackTrace.ts +0 -239
  284. package/front_end/panels/application/components/stackTraceLinkButton.css +0 -16
  285. package/front_end/panels/application/components/stackTraceRow.css +0 -50
  286. package/front_end/panels/explain/components/consoleInsightSourcesList.css +0 -51
  287. package/front_end/ui/components/docs/README.md +0 -6
  288. package/front_end/ui/components/docs/building-ui-documentation/ComponentEvents.md +0 -54
  289. package/front_end/ui/components/docs/building-ui-documentation/ComponentPerformance.md +0 -136
  290. package/front_end/ui/components/docs/building-ui-documentation/CreatingComponents.md +0 -242
  291. package/front_end/ui/components/docs/building-ui-documentation/README.md +0 -23
  292. package/front_end/ui/components/docs/building-ui-documentation/StylingComponents.md +0 -66
  293. package/front_end/ui/components/docs/building-ui-documentation/TestingComponents.md +0 -111
  294. package/front_end/ui/components/docs/component_docs.ts +0 -24
  295. package/front_end/ui/components/docs/component_docs_styles.css +0 -53
  296. package/front_end/ui/components/docs/create_breadcrumbs.ts +0 -44
  297. package/front_end/ui/components/docs/slider/basic.html +0 -20
  298. package/front_end/ui/components/docs/switch/basic.html +0 -20
  299. /package/front_end/models/issues_manager/descriptions/{genericFormAriaLabelledByToNonExistingId.md → genericFormAriaLabelledByToNonExistingIdError.md} +0 -0
  300. /package/front_end/models/issues_manager/descriptions/{genericFormLabelHasNeitherForNorNestedInput.md → genericFormLabelHasNeitherForNorNestedInputError.md} +0 -0
  301. /package/front_end/{core/platform → ui/legacy}/DOMUtilities.ts +0 -0
@@ -88,6 +88,7 @@
88
88
  padding: var(--sys-size-5) 0 0;
89
89
  display: flex;
90
90
  align-items: center;
91
+ height: 34px;
91
92
 
92
93
  devtools-checkbox {
93
94
  margin-left: auto;
@@ -895,7 +895,7 @@ export const mergeSegments = (segmentsA: CoverageSegment[], segmentsB: CoverageS
895
895
  const end = Math.min(a.end, b.end);
896
896
  const last = result[result.length - 1];
897
897
  const stamp = Math.min(a.stamp, b.stamp);
898
- if (!last || last.count !== count || last.stamp !== stamp) {
898
+ if (last?.count !== count || last.stamp !== stamp) {
899
899
  result.push({end, count, stamp});
900
900
  } else {
901
901
  last.end = end;
@@ -1078,7 +1078,7 @@ export class CoverageInfo {
1078
1078
  for (const segment of this.segments) {
1079
1079
  if (segment.count) {
1080
1080
  const last = ranges.length > 0 ? ranges[ranges.length - 1] : null;
1081
- if (last && last.end === start + offset) {
1081
+ if (last?.end === start + offset) {
1082
1082
  // We can extend the last segment.
1083
1083
  last.end = segment.end + offset;
1084
1084
  } else {
@@ -124,11 +124,11 @@ function getTooltipFromGenericIssue(errorType: Protocol.Audits.GenericIssueError
124
124
  return i18nString(UIStrings.formAutocompleteAttributeEmptyError);
125
125
  case Protocol.Audits.GenericIssueErrorType.FormEmptyIdAndNameAttributesForInputError:
126
126
  return i18nString(UIStrings.formEmptyIdAndNameAttributesForInputError);
127
- case Protocol.Audits.GenericIssueErrorType.FormAriaLabelledByToNonExistingId:
127
+ case Protocol.Audits.GenericIssueErrorType.FormAriaLabelledByToNonExistingIdError:
128
128
  return i18nString(UIStrings.formAriaLabelledByToNonExistingId);
129
129
  case Protocol.Audits.GenericIssueErrorType.FormInputAssignedAutocompleteValueToIdOrNameAttributeError:
130
130
  return i18nString(UIStrings.formInputAssignedAutocompleteValueToIdOrNameAttributeError);
131
- case Protocol.Audits.GenericIssueErrorType.FormLabelHasNeitherForNorNestedInput:
131
+ case Protocol.Audits.GenericIssueErrorType.FormLabelHasNeitherForNorNestedInputError:
132
132
  return i18nString(UIStrings.formLabelHasNeitherForNorNestedInput);
133
133
  case Protocol.Audits.GenericIssueErrorType.FormLabelForMatchesNonExistingIdError:
134
134
  return i18nString(UIStrings.formLabelForMatchesNonExistingIdError);
@@ -641,7 +641,7 @@ export class ElementsPanel extends UI.Panel.Panel implements UI.SearchableView.S
641
641
  return;
642
642
  }
643
643
 
644
- if (!this.searchConfig || this.searchConfig.query !== query) {
644
+ if (this.searchConfig?.query !== query) {
645
645
  this.onSearchCanceled();
646
646
  } else {
647
647
  this.hideSearchHighlights();
@@ -104,6 +104,7 @@ interface ViewInput {
104
104
  interface ViewOutput {
105
105
  elementsTreeOutline?: ElementsTreeOutline;
106
106
  highlightedTreeElement: ElementsTreeElement|null;
107
+ isUpdatingHighlights: boolean;
107
108
  alreadyExpandedParentTreeElement: ElementsTreeElement|null;
108
109
  }
109
110
 
@@ -135,6 +136,7 @@ export const DEFAULT_VIEW = (input: ViewInput, output: ViewOutput, target: HTMLE
135
136
  // Node highlighting logic. FIXME: express as a lit template.
136
137
  const previousHighlightedNode = output.highlightedTreeElement?.node() ?? null;
137
138
  if (previousHighlightedNode !== input.currentHighlightedNode) {
139
+ output.isUpdatingHighlights = true;
138
140
  let treeElement: ElementsTreeElement|null = null;
139
141
 
140
142
  if (output.highlightedTreeElement) {
@@ -172,6 +174,7 @@ export const DEFAULT_VIEW = (input: ViewInput, output: ViewOutput, target: HTMLE
172
174
  output.highlightedTreeElement = treeElement;
173
175
  output.elementsTreeOutline.setHoverEffect(treeElement);
174
176
  treeElement?.reveal(true);
177
+ output.isUpdatingHighlights = false;
175
178
  }
176
179
  };
177
180
 
@@ -224,6 +227,7 @@ export class DOMTreeWidget extends UI.Widget.Widget {
224
227
  #viewOutput: ViewOutput = {
225
228
  highlightedTreeElement: null,
226
229
  alreadyExpandedParentTreeElement: null,
230
+ isUpdatingHighlights: false,
227
231
  };
228
232
  #highlightThrottler = new Common.Throttler.Throttler(100);
229
233
 
@@ -238,8 +242,8 @@ export class DOMTreeWidget extends UI.Widget.Widget {
238
242
  SDK.OverlayModel.OverlayModel, SDK.OverlayModel.Events.HIGHLIGHT_NODE_REQUESTED, this.#highlightNode, this,
239
243
  {scoped: true});
240
244
  SDK.TargetManager.TargetManager.instance().addModelListener(
241
- SDK.OverlayModel.OverlayModel, SDK.OverlayModel.Events.INSPECT_MODE_WILL_BE_TOGGLED, this.#clearState, this,
242
- {scoped: true});
245
+ SDK.OverlayModel.OverlayModel, SDK.OverlayModel.Events.INSPECT_MODE_WILL_BE_TOGGLED,
246
+ this.#clearHighlightedNode, this, {scoped: true});
243
247
  }
244
248
  }
245
249
 
@@ -250,7 +254,13 @@ export class DOMTreeWidget extends UI.Widget.Widget {
250
254
  });
251
255
  }
252
256
 
253
- #clearState(): void {
257
+ #clearHighlightedNode(): void {
258
+ // Highlighting an element via tree outline will emit the
259
+ // INSPECT_MODE_WILL_BE_TOGGLED event, therefore, we skip it if the view
260
+ // informed us that it is updating the element.
261
+ if (this.#viewOutput.isUpdatingHighlights) {
262
+ return;
263
+ }
254
264
  this.#currentHighlightedNode = null;
255
265
  this.requestUpdate();
256
266
  }
@@ -304,11 +314,11 @@ export class DOMTreeWidget extends UI.Widget.Widget {
304
314
  currentHighlightedNode: this.#currentHighlightedNode,
305
315
  onElementsTreeUpdated: this.onElementsTreeUpdated.bind(this),
306
316
  onSelectedNodeChanged: event => {
307
- this.#clearState();
317
+ this.#clearHighlightedNode();
308
318
  this.onSelectedNodeChanged(event);
309
319
  },
310
- onElementCollapsed: this.#clearState.bind(this),
311
- onElementExpanded: this.#clearState.bind(this),
320
+ onElementCollapsed: this.#clearHighlightedNode.bind(this),
321
+ onElementExpanded: this.#clearHighlightedNode.bind(this),
312
322
  },
313
323
  this.#viewOutput, this.contentElement);
314
324
  }
@@ -684,7 +694,7 @@ export class ElementsTreeOutline extends
684
694
  }
685
695
 
686
696
  resetClipboardIfNeeded(removedNode: SDK.DOMModel.DOMNode): void {
687
- if (this.clipboardNodeData && this.clipboardNodeData.node === removedNode) {
697
+ if (this.clipboardNodeData?.node === removedNode) {
688
698
  this.setClipboardData(null);
689
699
  }
690
700
  }
@@ -5,6 +5,7 @@
5
5
  import * as i18n from '../../core/i18n/i18n.js';
6
6
  import * as SDK from '../../core/sdk/sdk.js';
7
7
  import * as Bindings from '../../models/bindings/bindings.js';
8
+ import type * as StackTrace from '../../models/stack_trace/stack_trace.js';
8
9
  import * as Components from '../../ui/legacy/components/utils/utils.js';
9
10
  import * as UI from '../../ui/legacy/legacy.js';
10
11
  import {html, render} from '../../ui/lit/lit.js';
@@ -23,20 +24,20 @@ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
23
24
  interface ViewInput {
24
25
  target?: SDK.Target.Target;
25
26
  linkifier: Components.Linkifier.Linkifier;
26
- options: Components.JSPresentationUtils.Options;
27
+ stackTrace?: StackTrace.StackTrace.StackTrace;
27
28
  }
28
29
 
29
30
  type View = (input: ViewInput, output: object, target: HTMLElement) => void;
30
31
 
31
32
  export const DEFAULT_VIEW: View = (input, _output, target) => {
32
- const {target: sdkTarget, linkifier, options} = input;
33
+ const {target: sdkTarget, linkifier, stackTrace} = input;
33
34
  // clang-format off
34
35
  render(html`
35
36
  <style>${nodeStackTraceWidgetStyles}</style>
36
- ${target && options.stackTrace ?
37
+ ${target && stackTrace ?
37
38
  html`<devtools-widget
38
39
  class="stack-trace"
39
- .widgetConfig=${UI.Widget.widgetConfig(Components.JSPresentationUtils.StackTracePreviewContent, {target: sdkTarget, linkifier, options})}>
40
+ .widgetConfig=${UI.Widget.widgetConfig(Components.JSPresentationUtils.StackTracePreviewContent, {target: sdkTarget, linkifier, stackTrace})}>
40
41
  </devtools-widget>` :
41
42
  html`<div class="gray-info-message">${i18nString(UIStrings.noStackTraceAvailable)}</div>`}`,
42
43
  target);
@@ -75,7 +76,7 @@ export class NodeStackTraceWidget extends UI.Widget.VBox {
75
76
  const input: ViewInput = {
76
77
  target,
77
78
  linkifier: this.#linkifier,
78
- options: {stackTrace},
79
+ stackTrace,
79
80
  };
80
81
  this.#view(input, {}, this.contentElement);
81
82
  }
@@ -1610,9 +1610,8 @@ export class LengthRenderer extends rendererBase(SDK.CSSPropertyParserMatchers.L
1610
1610
  valueElement.tabIndex = -1;
1611
1611
  valueElement.textContent = match.text;
1612
1612
 
1613
- if (!context.tracing) {
1614
- void this.#attachPopover(valueElement, match, context);
1615
- }
1613
+ const tooltip = this.#getTooltip(valueElement, match, context);
1614
+
1616
1615
  const evaluation = context.tracing?.applyEvaluation([], () => {
1617
1616
  return {
1618
1617
  placeholder: [valueElement],
@@ -1620,7 +1619,11 @@ export class LengthRenderer extends rendererBase(SDK.CSSPropertyParserMatchers.L
1620
1619
  };
1621
1620
  });
1622
1621
 
1623
- return evaluation ?? [valueElement];
1622
+ if (evaluation) {
1623
+ return evaluation;
1624
+ }
1625
+
1626
+ return tooltip ? [valueElement, tooltip] : [valueElement];
1624
1627
  }
1625
1628
 
1626
1629
  async #applyEvaluation(
@@ -1635,25 +1638,26 @@ export class LengthRenderer extends rendererBase(SDK.CSSPropertyParserMatchers.L
1635
1638
  return false;
1636
1639
  }
1637
1640
 
1638
- async #attachPopover(
1639
- valueElement: HTMLElement, match: SDK.CSSPropertyParser.Match, context: RenderingContext): Promise<void> {
1640
- const pixelValue = await resolveValues(this.#stylesPane, this.#propertyName, match, context, match.text);
1641
- if (!pixelValue) {
1642
- return;
1643
- }
1644
-
1641
+ #getTooltip(valueElement: HTMLElement, match: SDK.CSSPropertyParser.Match, context: RenderingContext):
1642
+ Tooltips.Tooltip.Tooltip|undefined {
1645
1643
  const tooltipId = this.#treeElement?.getTooltipId('length');
1646
- if (tooltipId) {
1647
- valueElement.setAttribute('aria-details', tooltipId);
1648
- const tooltip = new Tooltips.Tooltip.Tooltip(
1649
- {anchor: valueElement, variant: 'rich', id: tooltipId, jslogContext: 'length-popover'});
1650
- tooltip.appendChild(document.createTextNode(pixelValue[0]));
1651
- valueElement.insertAdjacentElement('afterend', tooltip);
1644
+ if (!tooltipId) {
1645
+ return undefined;
1652
1646
  }
1653
- this.popOverAttachedForTest();
1647
+ valueElement.setAttribute('aria-details', tooltipId);
1648
+ const tooltip = new Tooltips.Tooltip.Tooltip(
1649
+ {anchor: valueElement, variant: 'rich', id: tooltipId, jslogContext: 'length-popover'});
1650
+ tooltip.addEventListener('beforetoggle', () => this.getTooltipValue(tooltip, match, context), {once: true});
1651
+ return tooltip;
1654
1652
  }
1655
1653
 
1656
- popOverAttachedForTest(): void {
1654
+ async getTooltipValue(
1655
+ tooltip: Tooltips.Tooltip.Tooltip, match: SDK.CSSPropertyParser.Match, context: RenderingContext): Promise<void> {
1656
+ const pixelValue = await resolveValues(this.#stylesPane, this.#propertyName, match, context, match.text);
1657
+ if (!pixelValue) {
1658
+ return;
1659
+ }
1660
+ tooltip.appendChild(document.createTextNode(pixelValue[0]));
1657
1661
  }
1658
1662
  }
1659
1663
 
@@ -2408,8 +2412,7 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
2408
2412
  }
2409
2413
 
2410
2414
  if (this.valueElement) {
2411
- const lineBreakValue =
2412
- this.valueElement.firstElementChild && this.valueElement.firstElementChild.tagName === 'BR';
2415
+ const lineBreakValue = this.valueElement.firstElementChild?.tagName === 'BR';
2413
2416
  const separator = lineBreakValue ? ':' : ': ';
2414
2417
  this.listItemElement.createChild('span', 'styles-name-value-separator').textContent = separator;
2415
2418
  if (this.expandElement) {
@@ -370,7 +370,7 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
370
370
  }
371
371
 
372
372
  private sectionsContainerKeyDown(event: Event): void {
373
- const activeElement = Platform.DOMUtilities.deepActiveElement(this.sectionsContainer.contentElement.ownerDocument);
373
+ const activeElement = UI.DOMUtilities.deepActiveElement(this.sectionsContainer.contentElement.ownerDocument);
374
374
  if (!activeElement) {
375
375
  return;
376
376
  }
@@ -85,6 +85,6 @@
85
85
  }
86
86
  }
87
87
 
88
- ::highlight(css-value-tracing) {
88
+ :host::highlight(css-value-tracing) {
89
89
  background-color: var(--sys-color-tonal-container);
90
90
  }
@@ -454,6 +454,7 @@ UI.ActionRegistration.registerActionExtension({
454
454
  platform: UI.ActionRegistration.Platforms.MAC,
455
455
  },
456
456
  ],
457
+ configurableBindings: false,
457
458
  });
458
459
 
459
460
  UI.ActionRegistration.registerActionExtension({
@@ -20,7 +20,6 @@ import * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';
20
20
  import * as Console from '../../console/console.js';
21
21
 
22
22
  import styles from './consoleInsight.css.js';
23
- import listStyles from './consoleInsightSourcesList.css.js';
24
23
 
25
24
  // Note: privacy and legal notices are not localized so far.
26
25
  const UIStrings = {
@@ -189,12 +188,14 @@ const SIGN_IN_URL = 'https://accounts.google.com' as Platform.DevToolsPath.UrlSt
189
188
 
190
189
  interface ViewInput {
191
190
  state: StateData;
191
+ closing: boolean;
192
192
  disableAnimations: boolean;
193
193
  renderer: MarkdownView.MarkdownView.MarkdownInsightRenderer;
194
194
  selectedRating?: boolean;
195
195
  noLogging: boolean;
196
196
  callbacks: {
197
197
  onClose: () => void,
198
+ onAnimationEnd: () => void,
198
199
  onSearch: () => void,
199
200
  onRating: (isPositive: boolean) => void,
200
201
  onReport: () => void,
@@ -363,6 +364,26 @@ function renderLoading(): Lit.TemplateResult {
363
364
  // clang-format on
364
365
  }
365
366
 
367
+ function renderInsightSourcesList(
368
+ sources: Console.PromptBuilder.Source[], isPageReloadRecommended: boolean): Lit.TemplateResult {
369
+ // clang-format off
370
+ return html`
371
+ <div class="insight-sources">
372
+ <ul>
373
+ ${Directives.repeat(sources, item => item.value, item => {
374
+ return html`<li><x-link class="link" title="${localizeType(item.type)} ${i18nString(UIStrings.opensInNewTab)}" href="data:text/plain;charset=utf-8,${encodeURIComponent(item.value)}" jslog=${VisualLogging.link('source-' + item.type).track({click: true})}>
375
+ <devtools-icon name="open-externally"></devtools-icon>
376
+ ${localizeType(item.type)}
377
+ </x-link></li>`;
378
+ })}
379
+ ${isPageReloadRecommended ? html`<li class="source-disclaimer">
380
+ <devtools-icon name="warning"></devtools-icon>
381
+ ${i18nString(UIStrings.reloadRecommendation)}</li>` : Lit.nothing}
382
+ </ul>
383
+ </div>`;
384
+ // clang-format on
385
+ }
386
+
366
387
  function renderInsight(
367
388
  insight: Extract<StateData, {type: State.INSIGHT}>, renderer: ViewInput['renderer'],
368
389
  disableAnimations: ViewInput['disableAnimations'], callbacks: ViewInput['callbacks'],
@@ -384,8 +405,7 @@ function renderInsight(
384
405
  ` : Lit.nothing}
385
406
  <details jslog=${VisualLogging.expand('sources').track({click: true})}>
386
407
  <summary>${i18nString(UIStrings.inputData)}</summary>
387
- <devtools-console-insight-sources-list .sources=${insight.sources} .isPageReloadRecommended=${insight.isPageReloadRecommended}>
388
- </devtools-console-insight-sources-list>
408
+ ${renderInsightSourcesList(insight.sources, insight.isPageReloadRecommended)}
389
409
  </details>
390
410
  <div class="buttons">
391
411
  ${renderSearchButton(callbacks.onSearch)}
@@ -652,6 +672,8 @@ export class ConsoleInsight extends HTMLElement {
652
672
  #headerRef = Directives.createRef<HTMLHeadingElement>();
653
673
  #citationLinks: HTMLElement[] = [];
654
674
  #areReferenceDetailsOpen = false;
675
+ #stateChanging = false;
676
+ #closing = false;
655
677
 
656
678
  // Rating sub-form state.
657
679
  #selectedRating?: boolean;
@@ -818,12 +840,9 @@ export class ConsoleInsight extends HTMLElement {
818
840
  }
819
841
 
820
842
  #transitionTo(newState: StateData): void {
821
- const previousState = this.#state;
843
+ this.#stateChanging = this.#state.type !== newState.type;
822
844
  this.#state = newState;
823
845
  this.#render();
824
- if (newState.type !== previousState.type) {
825
- this.#focusHeader();
826
- }
827
846
  }
828
847
 
829
848
  async #generateInsightIfNeeded(): Promise<void> {
@@ -855,10 +874,18 @@ export class ConsoleInsight extends HTMLElement {
855
874
  if (this.#state.type === State.CONSENT_REMINDER) {
856
875
  Host.userMetrics.actionTaken(Host.UserMetrics.Action.InsightsReminderTeaserCanceled);
857
876
  }
858
- this.shadowRoot?.addEventListener('animationend', () => {
877
+ this.#closing = true;
878
+ this.#render();
879
+ }
880
+
881
+ #onAnimationEnd(): void {
882
+ if (this.#closing) {
859
883
  this.dispatchEvent(new CloseEvent());
860
- }, {once: true});
861
- this.classList.add('closing');
884
+ return;
885
+ }
886
+ if (this.#stateChanging) {
887
+ this.#headerRef.value?.focus();
888
+ }
862
889
  }
863
890
 
864
891
  #onRating(isPositive: boolean): void {
@@ -1074,12 +1101,6 @@ export class ConsoleInsight extends HTMLElement {
1074
1101
  Host.InspectorFrontendHost.InspectorFrontendHostInstance.openInNewTab(SIGN_IN_URL);
1075
1102
  }
1076
1103
 
1077
- #focusHeader(): void {
1078
- this.addEventListener('animationend', () => {
1079
- this.#headerRef.value?.focus();
1080
- }, {once: true});
1081
- }
1082
-
1083
1104
  #onToggleReferenceDetails(): void {
1084
1105
  if (this.#referenceDetailsRef.value) {
1085
1106
  this.#areReferenceDetailsOpen = this.#referenceDetailsRef.value.open;
@@ -1103,6 +1124,7 @@ export class ConsoleInsight extends HTMLElement {
1103
1124
  #render(): void {
1104
1125
  const input: ViewInput = {
1105
1126
  state: this.#state,
1127
+ closing: this.#closing,
1106
1128
  disableAnimations: this.disableAnimations,
1107
1129
  renderer: this.#renderer,
1108
1130
  selectedRating: this.#selectedRating,
@@ -1110,6 +1132,7 @@ export class ConsoleInsight extends HTMLElement {
1110
1132
  Root.Runtime.GenAiEnterprisePolicyValue.ALLOW_WITHOUT_LOGGING,
1111
1133
  callbacks: {
1112
1134
  onClose: this.#onClose.bind(this),
1135
+ onAnimationEnd: this.#onAnimationEnd.bind(this),
1113
1136
  onSearch: this.#onSearch.bind(this),
1114
1137
  onRating: this.#onRating.bind(this),
1115
1138
  onReport: this.#onReport.bind(this),
@@ -1181,7 +1204,11 @@ export class ConsoleInsight extends HTMLElement {
1181
1204
  render(html`
1182
1205
  <style>${styles}</style>
1183
1206
  <style>${Input.checkboxStyles}</style>
1184
- <div class="wrapper" jslog=${VisualLogging.pane('console-insights').track({resize: true})}>
1207
+ <div
1208
+ class=${Directives.classMap({wrapper: true, closing: input.closing})}
1209
+ jslog=${VisualLogging.pane('console-insights').track({resize: true})}
1210
+ @animationend=${callbacks.onAnimationEnd}
1211
+ >
1185
1212
  <div class="animation-wrapper">
1186
1213
  ${header}
1187
1214
  <main jslog=${jslog} class=${Directives.classMap(mainClasses)}>
@@ -1205,50 +1232,10 @@ export class ConsoleInsight extends HTMLElement {
1205
1232
  }
1206
1233
  }
1207
1234
 
1208
- class ConsoleInsightSourcesList extends HTMLElement {
1209
- readonly #shadow = this.attachShadow({mode: 'open'});
1210
- #sources: Console.PromptBuilder.Source[] = [];
1211
- #isPageReloadRecommended = false;
1212
-
1213
- #render(): void {
1214
- // clang-format off
1215
- render(html`
1216
- <style>${listStyles}</style>
1217
- <style>${Input.checkboxStyles}</style>
1218
- <ul>
1219
- ${Directives.repeat(this.#sources, item => item.value, item => {
1220
- return html`<li><x-link class="link" title="${localizeType(item.type)} ${i18nString(UIStrings.opensInNewTab)}" href="data:text/plain;charset=utf-8,${encodeURIComponent(item.value)}" jslog=${VisualLogging.link('source-' + item.type).track({click: true})}>
1221
- <devtools-icon name="open-externally"></devtools-icon>
1222
- ${localizeType(item.type)}
1223
- </x-link></li>`;
1224
- })}
1225
- ${this.#isPageReloadRecommended ? html`<li class="source-disclaimer">
1226
- <devtools-icon name="warning"></devtools-icon>
1227
- ${i18nString(UIStrings.reloadRecommendation)}</li>` : Lit.nothing}
1228
- </ul>
1229
- `, this.#shadow, {
1230
- host: this,
1231
- });
1232
- // clang-format on
1233
- }
1234
-
1235
- set sources(values: Console.PromptBuilder.Source[]) {
1236
- this.#sources = values;
1237
- this.#render();
1238
- }
1239
-
1240
- set isPageReloadRecommended(isPageReloadRecommended: boolean) {
1241
- this.#isPageReloadRecommended = isPageReloadRecommended;
1242
- this.#render();
1243
- }
1244
- }
1245
-
1246
1235
  customElements.define('devtools-console-insight', ConsoleInsight);
1247
- customElements.define('devtools-console-insight-sources-list', ConsoleInsightSourcesList);
1248
1236
 
1249
1237
  declare global {
1250
1238
  interface HTMLElementTagNameMap {
1251
1239
  'devtools-console-insight': ConsoleInsight;
1252
- 'devtools-console-insight-sources-list': ConsoleInsightSourcesList;
1253
1240
  }
1254
1241
  }
@@ -24,7 +24,7 @@
24
24
  animation: expand var(--sys-motion-duration-medium2) var(--sys-motion-easing-emphasized) forwards;
25
25
  }
26
26
 
27
- :host-context(.closing) .wrapper {
27
+ .wrapper.closing {
28
28
  animation: collapse var(--sys-motion-duration-medium2) var(--sys-motion-easing-emphasized) forwards;
29
29
  }
30
30
 
@@ -393,3 +393,48 @@ details h3 {
393
393
  .error-message {
394
394
  font: var(--sys-typescale-body4-bold);
395
395
  }
396
+
397
+ @scope (.insight-sources) {
398
+ :root {
399
+ padding: 0;
400
+ margin: 0;
401
+ box-sizing: border-box;
402
+ display: block;
403
+ }
404
+
405
+ ul {
406
+ color: var(--sys-color-primary);
407
+ font-size: 12px;
408
+ font-style: normal;
409
+ font-weight: 400;
410
+ line-height: 18px;
411
+ margin-top: 8px;
412
+ padding-left: var(--sys-size-6);
413
+ }
414
+
415
+ li {
416
+ list-style-type: none;
417
+ }
418
+
419
+ ul .link {
420
+ color: var(--sys-color-primary);
421
+ display: inline-flex !important; /* stylelint-disable-line declaration-no-important */
422
+ align-items: center;
423
+ gap: 4px;
424
+ text-decoration-line: underline;
425
+ }
426
+
427
+ devtools-icon {
428
+ height: 16px;
429
+ width: 16px;
430
+ margin-right: var(--sys-size-1);
431
+ }
432
+
433
+ devtools-icon[name="open-externally"] {
434
+ color: var(--icon-link);
435
+ }
436
+
437
+ .source-disclaimer {
438
+ color: var(--sys-color-on-surface-subtle);
439
+ }
440
+ }
@@ -6,7 +6,6 @@
6
6
 
7
7
  import * as Common from '../../core/common/common.js';
8
8
  import * as i18n from '../../core/i18n/i18n.js';
9
- import * as Platform from '../../core/platform/platform.js';
10
9
  import type * as SDK from '../../core/sdk/sdk.js';
11
10
  import * as UI from '../../ui/legacy/legacy.js';
12
11
 
@@ -80,7 +79,7 @@ export class LayerTreeOutline extends Common.ObjectWrapper.eventMixin<EventTypes
80
79
  wrapperElement.appendChild(this.treeOutline.element);
81
80
  wrapperElement.appendChild(summaryElement);
82
81
  this.element = wrapperElement;
83
- Platform.DOMUtilities.appendStyle(this.element, layerTreeOutlineStyles);
82
+ UI.DOMUtilities.appendStyle(this.element, layerTreeOutlineStyles);
84
83
 
85
84
  this.layerViewHost.showInternalLayersSetting().addChangeListener(this.update, this);
86
85
  }
@@ -64,6 +64,7 @@ interface ViewInput {
64
64
  customConditionsGroup: NetworkThrottlingConditionsGroup;
65
65
  jslogContext: string|undefined;
66
66
  title: string|undefined;
67
+ disabled: boolean;
67
68
  onSelect: (conditions: SDK.NetworkManager.ThrottlingConditions) => void;
68
69
  onAddCustomConditions: () => void;
69
70
  }
@@ -108,6 +109,7 @@ export const DEFAULT_VIEW: ViewFunction = (input, output, target) => {
108
109
  render(
109
110
  // clang-format off
110
111
  html`<select
112
+ ?disabled=${input.disabled}
111
113
  aria-label=${input.title ?? nothing}
112
114
  jslog=${VisualLogging.dropDown().track({change: true}).context(input.jslogContext)}
113
115
  @change=${onSelect}>
@@ -166,6 +168,7 @@ export class NetworkThrottlingSelect extends Common.ObjectWrapper.ObjectWrapper<
166
168
  readonly #title?: string;
167
169
  readonly #view: ViewFunction;
168
170
  #variant: NetworkThrottlingSelect.Variant = NetworkThrottlingSelect.Variant.GLOBAL_CONDITIONS;
171
+ #disabled = false;
169
172
 
170
173
  static createForGlobalConditions(element: HTMLElement, title: string): NetworkThrottlingSelect {
171
174
  ThrottlingManager.instance(); // Instantiate the throttling manager to connect network manager with the setting
@@ -204,6 +207,14 @@ export class NetworkThrottlingSelect extends Common.ObjectWrapper.ObjectWrapper<
204
207
  this.#performUpdate();
205
208
  }
206
209
 
210
+ get disabled(): boolean {
211
+ return this.#disabled;
212
+ }
213
+ set disabled(disabled: boolean) {
214
+ this.#disabled = disabled;
215
+ this.#performUpdate();
216
+ }
217
+
207
218
  get recommendedConditions(): SDK.NetworkManager.Conditions|null {
208
219
  return this.#recommendedConditions;
209
220
  }
@@ -284,6 +295,7 @@ export class NetworkThrottlingSelect extends Common.ObjectWrapper.ObjectWrapper<
284
295
  selectedConditions: this.#currentConditions,
285
296
  jslogContext: this.#jslogContext,
286
297
  title: this.#title,
298
+ disabled: this.#disabled,
287
299
  onSelect,
288
300
  onAddCustomConditions,
289
301
  throttlingGroups,
@@ -308,6 +320,13 @@ export class NetworkThrottlingSelectorWidget extends UI.Widget.VBox {
308
320
  this.#select.addEventListener(Events.CONDITIONS_CHANGED, ({data}) => this.#conditionsChangedHandler?.(data));
309
321
  }
310
322
 
323
+ get disabled(): boolean {
324
+ return this.#select.disabled;
325
+ }
326
+ set disabled(disabled: boolean) {
327
+ this.#select.disabled = disabled;
328
+ }
329
+
311
330
  set variant(variant: NetworkThrottlingSelect.Variant) {
312
331
  this.#select.variant = variant;
313
332
  }