chrome-devtools-frontend 1.0.1558690 → 1.0.1561080

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 (167) hide show
  1. package/front_end/Images/src/container.svg +4 -0
  2. package/front_end/core/common/Gzip.ts +15 -0
  3. package/front_end/core/host/InspectorFrontendHostStub.ts +0 -3
  4. package/front_end/core/platform/ArrayUtilities.ts +13 -0
  5. package/front_end/core/root/Runtime.ts +0 -5
  6. package/front_end/core/sdk/CSSMetadata.ts +6 -6
  7. package/front_end/core/sdk/CSSModel.ts +2 -2
  8. package/front_end/core/sdk/DOMModel.ts +15 -3
  9. package/front_end/core/sdk/NetworkManager.ts +4 -0
  10. package/front_end/core/sdk/NetworkRequest.ts +9 -0
  11. package/front_end/core/sdk/OverlayModel.ts +20 -9
  12. package/front_end/entrypoints/main/MainImpl.ts +2 -1
  13. package/front_end/generated/InspectorBackendCommands.ts +6 -3
  14. package/front_end/generated/SupportedCSSProperties.js +64 -32
  15. package/front_end/generated/protocol-mapping.d.ts +16 -0
  16. package/front_end/generated/protocol-proxy-api.d.ts +12 -0
  17. package/front_end/generated/protocol.ts +38 -1
  18. package/front_end/models/ai_assistance/agents/StylingAgent.ts +1 -1
  19. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +11 -7
  20. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +23 -22
  21. package/front_end/models/badges/UserBadges.ts +48 -16
  22. package/front_end/models/greendev/Prototypes.ts +6 -1
  23. package/front_end/models/trace/LanternComputationData.ts +4 -3
  24. package/front_end/models/trace/Processor.ts +6 -5
  25. package/front_end/models/trace/Styles.ts +10 -1
  26. package/front_end/models/trace/extras/TraceTree.ts +1 -1
  27. package/front_end/models/trace/handlers/LargestImagePaintHandler.ts +2 -2
  28. package/front_end/models/trace/handlers/MetaHandler.ts +14 -0
  29. package/front_end/models/trace/handlers/PageLoadMetricsHandler.ts +59 -34
  30. package/front_end/models/trace/helpers/Timing.ts +8 -1
  31. package/front_end/models/trace/insights/Common.ts +1 -1
  32. package/front_end/models/trace/insights/LCPBreakdown.ts +4 -4
  33. package/front_end/models/trace/insights/LCPDiscovery.ts +3 -3
  34. package/front_end/models/trace/insights/RenderBlocking.ts +1 -1
  35. package/front_end/models/trace/insights/types.ts +1 -1
  36. package/front_end/models/trace/types/TraceEvents.ts +62 -10
  37. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +11 -142
  38. package/front_end/panels/ai_assistance/PatchWidget.ts +90 -72
  39. package/front_end/panels/ai_assistance/ai_assistance.ts +1 -0
  40. package/front_end/panels/ai_assistance/components/ChatInput.ts +701 -0
  41. package/front_end/panels/ai_assistance/components/ChatView.ts +71 -1268
  42. package/front_end/panels/ai_assistance/components/UserActionRow.ts +514 -31
  43. package/front_end/panels/ai_assistance/components/chatInput.css +387 -0
  44. package/front_end/panels/ai_assistance/components/chatView.css +38 -599
  45. package/front_end/panels/ai_assistance/components/userActionRow.css +230 -0
  46. package/front_end/panels/autofill/AutofillView.ts +2 -2
  47. package/front_end/panels/changes/ChangesView.ts +15 -1
  48. package/front_end/panels/changes/changesView.css +6 -0
  49. package/front_end/panels/common/AiCodeGenerationTeaser.ts +48 -12
  50. package/front_end/panels/common/BadgeNotification.ts +44 -58
  51. package/front_end/panels/common/CopyChangesToPrompt.ts +233 -0
  52. package/front_end/panels/common/aiCodeGenerationTeaser.css +14 -0
  53. package/front_end/panels/common/common.ts +2 -1
  54. package/front_end/panels/console/consoleView.css +1 -1
  55. package/front_end/panels/elements/CSSRuleValidator.ts +38 -0
  56. package/front_end/panels/elements/ElementsTreeElement.ts +222 -377
  57. package/front_end/panels/elements/ElementsTreeOutline.ts +0 -23
  58. package/front_end/panels/elements/ShortcutTreeElement.ts +57 -50
  59. package/front_end/panels/elements/StylePropertiesSection.ts +1 -3
  60. package/front_end/panels/elements/StylesSidebarPane.ts +15 -4
  61. package/front_end/panels/elements/components/AdornerManager.ts +5 -149
  62. package/front_end/panels/issues/HiddenIssuesRow.ts +1 -2
  63. package/front_end/panels/issues/IssueKindView.ts +2 -4
  64. package/front_end/panels/issues/IssueView.ts +2 -4
  65. package/front_end/panels/network/NetworkDataGridNode.ts +65 -1
  66. package/front_end/panels/network/NetworkLogView.ts +2 -4
  67. package/front_end/panels/network/NetworkLogViewColumns.ts +9 -0
  68. package/front_end/panels/screencast/ScreencastApp.ts +1 -0
  69. package/front_end/panels/settings/SettingsScreen.ts +3 -2
  70. package/front_end/panels/timeline/CompatibilityTracksAppender.ts +14 -1
  71. package/front_end/panels/timeline/StatusDialog.ts +4 -3
  72. package/front_end/panels/timeline/ThirdPartyTreeView.ts +1 -4
  73. package/front_end/panels/timeline/TimelineController.ts +185 -3
  74. package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +52 -25
  75. package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +3 -16
  76. package/front_end/panels/timeline/TimelineFlameChartView.ts +65 -21
  77. package/front_end/panels/timeline/TimelinePanel.ts +86 -126
  78. package/front_end/panels/timeline/TimelineTreeView.ts +1 -0
  79. package/front_end/panels/timeline/TimelineUIUtils.ts +28 -2
  80. package/front_end/panels/timeline/TimingsTrackAppender.ts +3 -1
  81. package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +1 -1
  82. package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +2 -2
  83. package/front_end/panels/timeline/components/insights/RenderBlocking.ts +6 -4
  84. package/front_end/panels/timeline/components/insights/Table.ts +3 -3
  85. package/front_end/panels/timeline/overlays/OverlaysImpl.ts +4 -0
  86. package/front_end/panels/timeline/timelinePanel.css +8 -1
  87. package/front_end/panels/timeline/utils/EntryNodes.ts +2 -1
  88. package/front_end/panels/whats_new/ReleaseNoteText.ts +15 -9
  89. package/front_end/panels/whats_new/resources/WNDT.md +6 -6
  90. package/front_end/third_party/chromium/README.chromium +1 -1
  91. package/front_end/third_party/codemirror.next/rebuild.sh +1 -1
  92. package/front_end/third_party/lit/rebuild.sh +1 -1
  93. package/front_end/third_party/puppeteer/README.chromium +2 -2
  94. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts +2 -3
  95. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts.map +1 -1
  96. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js.map +1 -1
  97. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
  98. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.js +9 -0
  99. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.js.map +1 -1
  100. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPResponse.d.ts +3 -0
  101. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPResponse.d.ts.map +1 -1
  102. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPResponse.js +9 -0
  103. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPResponse.js.map +1 -1
  104. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Request.d.ts +3 -0
  105. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Request.d.ts.map +1 -1
  106. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Request.js +10 -0
  107. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Request.js.map +1 -1
  108. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts.map +1 -1
  109. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js +8 -4
  110. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js.map +1 -1
  111. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/injected.d.ts +1 -1
  112. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/injected.d.ts.map +1 -1
  113. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/injected.js +1 -1
  114. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/injected.js.map +1 -1
  115. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
  116. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +3 -3
  117. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +3 -3
  118. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js.map +1 -1
  119. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
  120. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
  121. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
  122. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +10 -1
  123. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +13 -7
  124. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts +2 -3
  125. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts.map +1 -1
  126. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js.map +1 -1
  127. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
  128. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.js +9 -0
  129. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.js.map +1 -1
  130. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPResponse.d.ts +3 -0
  131. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPResponse.d.ts.map +1 -1
  132. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPResponse.js +9 -0
  133. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPResponse.js.map +1 -1
  134. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Request.d.ts +3 -0
  135. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Request.d.ts.map +1 -1
  136. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Request.js +10 -0
  137. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Request.js.map +1 -1
  138. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts.map +1 -1
  139. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js +8 -4
  140. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js.map +1 -1
  141. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/injected.d.ts +1 -1
  142. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/injected.d.ts.map +1 -1
  143. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/injected.js +1 -1
  144. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/injected.js.map +1 -1
  145. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +3 -3
  146. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +3 -3
  147. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js.map +1 -1
  148. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
  149. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
  150. package/front_end/third_party/puppeteer/package/lib/types.d.ts +10 -1
  151. package/front_end/third_party/puppeteer/package/package.json +3 -3
  152. package/front_end/third_party/puppeteer/package/src/api/Page.ts +2 -3
  153. package/front_end/third_party/puppeteer/package/src/bidi/HTTPRequest.ts +13 -0
  154. package/front_end/third_party/puppeteer/package/src/bidi/HTTPResponse.ts +10 -0
  155. package/front_end/third_party/puppeteer/package/src/bidi/core/Request.ts +15 -0
  156. package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +9 -4
  157. package/front_end/third_party/puppeteer/package/src/generated/injected.ts +1 -1
  158. package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
  159. package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
  160. package/front_end/ui/components/adorners/Adorner.ts +8 -68
  161. package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +70 -28
  162. package/front_end/ui/legacy/SearchableView.ts +11 -5
  163. package/front_end/ui/legacy/SplitWidget.ts +1 -1
  164. package/front_end/ui/legacy/TabbedPane.ts +1 -1
  165. package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +43 -9
  166. package/front_end/ui/visual_logging/KnownContextValues.ts +16 -0
  167. package/package.json +2 -1
@@ -5,4 +5,4 @@
5
5
  *
6
6
  * @internal
7
7
  */
8
- export const source = "\"use strict\";var g=Object.defineProperty;var X=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var Y=Object.prototype.hasOwnProperty;var l=(t,e)=>{for(var r in e)g(t,r,{get:e[r],enumerable:!0})},G=(t,e,r,o)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(let s of B(e))!Y.call(t,s)&&s!==r&&g(t,s,{get:()=>e[s],enumerable:!(o=X(e,s))||o.enumerable});return t};var J=t=>G(g({},\"__esModule\",{value:!0}),t);var pe={};l(pe,{default:()=>he});module.exports=J(pe);var N=class extends Error{constructor(e,r){super(e,r),this.name=this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}},p=class extends N{};var c=class t{static create(e){return new t(e)}static async race(e){let r=new Set;try{let o=e.map(s=>s instanceof t?(s.#s&&r.add(s),s.valueOrThrow()):s);return await Promise.race(o)}finally{for(let o of r)o.reject(new Error(\"Timeout cleared\"))}}#e=!1;#r=!1;#o;#t;#a=new Promise(e=>{this.#t=e});#s;#i;constructor(e){e&&e.timeout>0&&(this.#i=new p(e.message),this.#s=setTimeout(()=>{this.reject(this.#i)},e.timeout))}#l(e){clearTimeout(this.#s),this.#o=e,this.#t()}resolve(e){this.#r||this.#e||(this.#e=!0,this.#l(e))}reject(e){this.#r||this.#e||(this.#r=!0,this.#l(e))}resolved(){return this.#e}finished(){return this.#e||this.#r}value(){return this.#o}#n;valueOrThrow(){return this.#n||(this.#n=(async()=>{if(await this.#a,this.#r)throw this.#o;return this.#o})()),this.#n}};var L=new Map,W=t=>{let e=L.get(t);return e||(e=new Function(`return ${t}`)(),L.set(t,e),e)};var b={};l(b,{ariaQuerySelector:()=>z,ariaQuerySelectorAll:()=>x});var z=(t,e)=>globalThis.__ariaQuerySelector(t,e),x=async function*(t,e){yield*await globalThis.__ariaQuerySelectorAll(t,e)};var E={};l(E,{cssQuerySelector:()=>K,cssQuerySelectorAll:()=>Z});var K=(t,e)=>t.querySelector(e),Z=function(t,e){return t.querySelectorAll(e)};var A={};l(A,{customQuerySelectors:()=>P});var v=class{#e=new Map;register(e,r){if(!r.queryOne&&r.queryAll){let o=r.queryAll;r.queryOne=(s,i)=>{for(let n of o(s,i))return n;return null}}else if(r.queryOne&&!r.queryAll){let o=r.queryOne;r.queryAll=(s,i)=>{let n=o(s,i);return n?[n]:[]}}else if(!r.queryOne||!r.queryAll)throw new Error(\"At least one query method must be defined.\");this.#e.set(e,{querySelector:r.queryOne,querySelectorAll:r.queryAll})}unregister(e){this.#e.delete(e)}get(e){return this.#e.get(e)}clear(){this.#e.clear()}},P=new v;var R={};l(R,{pierceQuerySelector:()=>ee,pierceQuerySelectorAll:()=>te});var ee=(t,e)=>{let r=null,o=s=>{let i=document.createTreeWalker(s,NodeFilter.SHOW_ELEMENT);do{let n=i.currentNode;n.shadowRoot&&o(n.shadowRoot),!(n instanceof ShadowRoot)&&n!==s&&!r&&n.matches(e)&&(r=n)}while(!r&&i.nextNode())};return t instanceof Document&&(t=t.documentElement),o(t),r},te=(t,e)=>{let r=[],o=s=>{let i=document.createTreeWalker(s,NodeFilter.SHOW_ELEMENT);do{let n=i.currentNode;n.shadowRoot&&o(n.shadowRoot),!(n instanceof ShadowRoot)&&n!==s&&n.matches(e)&&r.push(n)}while(i.nextNode())};return t instanceof Document&&(t=t.documentElement),o(t),r};var u=(t,e)=>{if(!t)throw new Error(e)};var y=class{#e;#r;#o;#t;constructor(e,r){this.#e=e,this.#r=r}async start(){let e=this.#t=c.create(),r=await this.#e();if(r){e.resolve(r);return}this.#o=new MutationObserver(async()=>{let o=await this.#e();o&&(e.resolve(o),await this.stop())}),this.#o.observe(this.#r,{childList:!0,subtree:!0,attributes:!0})}async stop(){u(this.#t,\"Polling never started.\"),this.#t.finished()||this.#t.reject(new Error(\"Polling stopped\")),this.#o&&(this.#o.disconnect(),this.#o=void 0)}result(){return u(this.#t,\"Polling never started.\"),this.#t.valueOrThrow()}},w=class{#e;#r;constructor(e){this.#e=e}async start(){let e=this.#r=c.create(),r=await this.#e();if(r){e.resolve(r);return}let o=async()=>{if(e.finished())return;let s=await this.#e();if(!s){window.requestAnimationFrame(o);return}e.resolve(s),await this.stop()};window.requestAnimationFrame(o)}async stop(){u(this.#r,\"Polling never started.\"),this.#r.finished()||this.#r.reject(new Error(\"Polling stopped\"))}result(){return u(this.#r,\"Polling never started.\"),this.#r.valueOrThrow()}},T=class{#e;#r;#o;#t;constructor(e,r){this.#e=e,this.#r=r}async start(){let e=this.#t=c.create(),r=await this.#e();if(r){e.resolve(r);return}this.#o=setInterval(async()=>{let o=await this.#e();o&&(e.resolve(o),await this.stop())},this.#r)}async stop(){u(this.#t,\"Polling never started.\"),this.#t.finished()||this.#t.reject(new Error(\"Polling stopped\")),this.#o&&(clearInterval(this.#o),this.#o=void 0)}result(){return u(this.#t,\"Polling never started.\"),this.#t.valueOrThrow()}};var _={};l(_,{PCombinator:()=>H,pQuerySelector:()=>fe,pQuerySelectorAll:()=>$});var a=class{static async*map(e,r){for await(let o of e)yield await r(o)}static async*flatMap(e,r){for await(let o of e)yield*r(o)}static async collect(e){let r=[];for await(let o of e)r.push(o);return r}static async first(e){for await(let r of e)return r}};var C={};l(C,{textQuerySelectorAll:()=>m});var re=new Set([\"checkbox\",\"image\",\"radio\"]),oe=t=>t instanceof HTMLSelectElement||t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement&&!re.has(t.type),se=new Set([\"SCRIPT\",\"STYLE\"]),f=t=>!se.has(t.nodeName)&&!document.head?.contains(t),I=new WeakMap,F=t=>{for(;t;)I.delete(t),t instanceof ShadowRoot?t=t.host:t=t.parentNode},j=new WeakSet,ne=new MutationObserver(t=>{for(let e of t)F(e.target)}),d=t=>{let e=I.get(t);if(e||(e={full:\"\",immediate:[]},!f(t)))return e;let r=\"\";if(oe(t))e.full=t.value,e.immediate.push(t.value),t.addEventListener(\"input\",o=>{F(o.target)},{once:!0,capture:!0});else{for(let o=t.firstChild;o;o=o.nextSibling){if(o.nodeType===Node.TEXT_NODE){e.full+=o.nodeValue??\"\",r+=o.nodeValue??\"\";continue}r&&e.immediate.push(r),r=\"\",o.nodeType===Node.ELEMENT_NODE&&(e.full+=d(o).full)}r&&e.immediate.push(r),t instanceof Element&&t.shadowRoot&&(e.full+=d(t.shadowRoot).full),j.has(t)||(ne.observe(t,{childList:!0,characterData:!0,subtree:!0}),j.add(t))}return I.set(t,e),e};var m=function*(t,e){let r=!1;for(let o of t.childNodes)if(o instanceof Element&&f(o)){let s;o.shadowRoot?s=m(o.shadowRoot,e):s=m(o,e);for(let i of s)yield i,r=!0}r||t instanceof Element&&f(t)&&d(t).full.includes(e)&&(yield t)};var k={};l(k,{checkVisibility:()=>le,pierce:()=>S,pierceAll:()=>O});var ie=[\"hidden\",\"collapse\"],le=(t,e)=>{if(!t)return e===!1;if(e===void 0)return t;let r=t.nodeType===Node.TEXT_NODE?t.parentElement:t,o=window.getComputedStyle(r),s=o&&!ie.includes(o.visibility)&&!ae(r);return e===s?t:!1};function ae(t){let e=t.getBoundingClientRect();return e.width===0||e.height===0}var ce=t=>\"shadowRoot\"in t&&t.shadowRoot instanceof ShadowRoot;function*S(t){ce(t)?yield t.shadowRoot:yield t}function*O(t){t=S(t).next().value,yield t;let e=[document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT)];for(let r of e){let o;for(;o=r.nextNode();)o.shadowRoot&&(yield o.shadowRoot,e.push(document.createTreeWalker(o.shadowRoot,NodeFilter.SHOW_ELEMENT)))}}var D={};l(D,{xpathQuerySelectorAll:()=>q});var q=function*(t,e,r=-1){let s=(t.ownerDocument||document).evaluate(e,t,null,XPathResult.ORDERED_NODE_ITERATOR_TYPE),i=[],n;for(;(n=s.iterateNext())&&(i.push(n),!(r&&i.length===r)););for(let h=0;h<i.length;h++)n=i[h],yield n,delete i[h]};var ue=/[-\\w\\P{ASCII}*]/u,H=(r=>(r.Descendent=\">>>\",r.Child=\">>>>\",r))(H||{}),V=t=>\"querySelectorAll\"in t,Q=class{#e;#r=[];#o=void 0;elements;constructor(e,r){this.elements=[e],this.#e=r,this.#t()}async run(){if(typeof this.#o==\"string\")switch(this.#o.trimStart()){case\":scope\":this.#t();break}for(;this.#o!==void 0;this.#t()){let e=this.#o;typeof e==\"string\"?e[0]&&ue.test(e[0])?this.elements=a.flatMap(this.elements,async function*(r){V(r)&&(yield*r.querySelectorAll(e))}):this.elements=a.flatMap(this.elements,async function*(r){if(!r.parentElement){if(!V(r))return;yield*r.querySelectorAll(e);return}let o=0;for(let s of r.parentElement.children)if(++o,s===r)break;yield*r.parentElement.querySelectorAll(`:scope>:nth-child(${o})${e}`)}):this.elements=a.flatMap(this.elements,async function*(r){switch(e.name){case\"text\":yield*m(r,e.value);break;case\"xpath\":yield*q(r,e.value);break;case\"aria\":yield*x(r,e.value);break;default:let o=P.get(e.name);if(!o)throw new Error(`Unknown selector type: ${e.name}`);yield*o.querySelectorAll(r,e.value)}})}}#t(){if(this.#r.length!==0){this.#o=this.#r.shift();return}if(this.#e.length===0){this.#o=void 0;return}let e=this.#e.shift();switch(e){case\">>>>\":{this.elements=a.flatMap(this.elements,S),this.#t();break}case\">>>\":{this.elements=a.flatMap(this.elements,O),this.#t();break}default:this.#r=e,this.#t();break}}},M=class{#e=new WeakMap;calculate(e,r=[]){if(e===null)return r;e instanceof ShadowRoot&&(e=e.host);let o=this.#e.get(e);if(o)return[...o,...r];let s=0;for(let n=e.previousSibling;n;n=n.previousSibling)++s;let i=this.calculate(e.parentNode,[s]);return this.#e.set(e,i),[...i,...r]}},U=(t,e)=>{if(t.length+e.length===0)return 0;let[r=-1,...o]=t,[s=-1,...i]=e;return r===s?U(o,i):r<s?-1:1},de=async function*(t){let e=new Set;for await(let o of t)e.add(o);let r=new M;yield*[...e.values()].map(o=>[o,r.calculate(o)]).sort(([,o],[,s])=>U(o,s)).map(([o])=>o)},$=function(t,e){let r=JSON.parse(e);if(r.some(o=>{let s=0;return o.some(i=>(typeof i==\"string\"?++s:s=0,s>1))}))throw new Error(\"Multiple deep combinators found in sequence.\");return de(a.flatMap(r,o=>{let s=new Q(t,o);return s.run(),s.elements}))},fe=async function(t,e){for await(let r of $(t,e))return r;return null};var me=Object.freeze({...b,...A,...R,..._,...C,...k,...D,...E,Deferred:c,createFunction:W,createTextContent:d,IntervalPoller:T,isSuitableNodeForTextMatching:f,MutationPoller:y,RAFPoller:w}),he=me;\n";
8
+ export const source = "\"use strict\";var g=Object.defineProperty;var X=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var Y=Object.prototype.hasOwnProperty;var l=(t,e)=>{for(var r in e)g(t,r,{get:e[r],enumerable:!0})},G=(t,e,r,o)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(let s of B(e))!Y.call(t,s)&&s!==r&&g(t,s,{get:()=>e[s],enumerable:!(o=X(e,s))||o.enumerable});return t};var J=t=>G(g({},\"__esModule\",{value:!0}),t);var pe={};l(pe,{default:()=>he});module.exports=J(pe);var N=class extends Error{constructor(e,r){super(e,r),this.name=this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}},p=class extends N{};var c=class t{static create(e){return new t(e)}static async race(e){let r=new Set;try{let o=e.map(s=>s instanceof t?(s.#s&&r.add(s),s.valueOrThrow()):s);return await Promise.race(o)}finally{for(let o of r)o.reject(new Error(\"Timeout cleared\"))}}#e=!1;#r=!1;#o;#t;#a=new Promise(e=>{this.#t=e});#s;#i;constructor(e){e&&e.timeout>0&&(this.#i=new p(e.message),this.#s=setTimeout(()=>{this.reject(this.#i)},e.timeout))}#l(e){clearTimeout(this.#s),this.#o=e,this.#t()}resolve(e){this.#r||this.#e||(this.#e=!0,this.#l(e))}reject(e){this.#r||this.#e||(this.#r=!0,this.#l(e))}resolved(){return this.#e}finished(){return this.#e||this.#r}value(){return this.#o}#n;valueOrThrow(){return this.#n||(this.#n=(async()=>{if(await this.#a,this.#r)throw this.#o;return this.#o})()),this.#n}};var L=new Map,W=t=>{let e=L.get(t);return e||(e=new Function(`return ${t}`)(),L.set(t,e),e)};var b={};l(b,{ariaQuerySelector:()=>z,ariaQuerySelectorAll:()=>x});var z=(t,e)=>globalThis.__ariaQuerySelector(t,e),x=async function*(t,e){yield*await globalThis.__ariaQuerySelectorAll(t,e)};var E={};l(E,{cssQuerySelector:()=>K,cssQuerySelectorAll:()=>Z});var K=(t,e)=>t.querySelector(e),Z=function(t,e){return t.querySelectorAll(e)};var A={};l(A,{customQuerySelectors:()=>P});var v=class{#e=new Map;register(e,r){if(!r.queryOne&&r.queryAll){let o=r.queryAll;r.queryOne=(s,i)=>{for(let n of o(s,i))return n;return null}}else if(r.queryOne&&!r.queryAll){let o=r.queryOne;r.queryAll=(s,i)=>{let n=o(s,i);return n?[n]:[]}}else if(!r.queryOne||!r.queryAll)throw new Error(\"At least one query method must be defined.\");this.#e.set(e,{querySelector:r.queryOne,querySelectorAll:r.queryAll})}unregister(e){this.#e.delete(e)}get(e){return this.#e.get(e)}clear(){this.#e.clear()}},P=new v;var R={};l(R,{pierceQuerySelector:()=>ee,pierceQuerySelectorAll:()=>te});var ee=(t,e)=>{let r=null,o=s=>{let i=document.createTreeWalker(s,NodeFilter.SHOW_ELEMENT);do{let n=i.currentNode;n.shadowRoot&&o(n.shadowRoot),!(n instanceof ShadowRoot)&&n!==s&&!r&&n.matches(e)&&(r=n)}while(!r&&i.nextNode())};return t instanceof Document&&(t=t.documentElement),o(t),r},te=(t,e)=>{let r=[],o=s=>{let i=document.createTreeWalker(s,NodeFilter.SHOW_ELEMENT);do{let n=i.currentNode;n.shadowRoot&&o(n.shadowRoot),!(n instanceof ShadowRoot)&&n!==s&&n.matches(e)&&r.push(n)}while(i.nextNode())};return t instanceof Document&&(t=t.documentElement),o(t),r};var u=(t,e)=>{if(!t)throw new Error(e)};var y=class{#e;#r;#o;#t;constructor(e,r){this.#e=e,this.#r=r}async start(){let e=this.#t=c.create(),r=await this.#e();if(r){e.resolve(r);return}this.#o=new MutationObserver(async()=>{let o=await this.#e();o&&(e.resolve(o),await this.stop())}),this.#o.observe(this.#r,{childList:!0,subtree:!0,attributes:!0})}async stop(){u(this.#t,\"Polling never started.\"),this.#t.finished()||this.#t.reject(new Error(\"Polling stopped\")),this.#o&&(this.#o.disconnect(),this.#o=void 0)}result(){return u(this.#t,\"Polling never started.\"),this.#t.valueOrThrow()}},w=class{#e;#r;constructor(e){this.#e=e}async start(){let e=this.#r=c.create(),r=await this.#e();if(r){e.resolve(r);return}let o=async()=>{if(e.finished())return;let s=await this.#e();if(!s){window.requestAnimationFrame(o);return}e.resolve(s),await this.stop()};window.requestAnimationFrame(o)}async stop(){u(this.#r,\"Polling never started.\"),this.#r.finished()||this.#r.reject(new Error(\"Polling stopped\"))}result(){return u(this.#r,\"Polling never started.\"),this.#r.valueOrThrow()}},T=class{#e;#r;#o;#t;constructor(e,r){this.#e=e,this.#r=r}async start(){let e=this.#t=c.create(),r=await this.#e();if(r){e.resolve(r);return}this.#o=setInterval(async()=>{let o=await this.#e();o&&(e.resolve(o),await this.stop())},this.#r)}async stop(){u(this.#t,\"Polling never started.\"),this.#t.finished()||this.#t.reject(new Error(\"Polling stopped\")),this.#o&&(clearInterval(this.#o),this.#o=void 0)}result(){return u(this.#t,\"Polling never started.\"),this.#t.valueOrThrow()}};var _={};l(_,{PCombinator:()=>H,pQuerySelector:()=>fe,pQuerySelectorAll:()=>$});var a=class{static async*map(e,r){for await(let o of e)yield await r(o)}static async*flatMap(e,r){for await(let o of e)yield*r(o)}static async collect(e){let r=[];for await(let o of e)r.push(o);return r}static async first(e){for await(let r of e)return r}};var C={};l(C,{textQuerySelectorAll:()=>m});var re=new Set([\"checkbox\",\"image\",\"radio\"]),oe=t=>t instanceof HTMLSelectElement||t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement&&!re.has(t.type),se=new Set([\"SCRIPT\",\"STYLE\"]),f=t=>!se.has(t.nodeName)&&!document.head?.contains(t),I=new WeakMap,F=t=>{for(;t;)I.delete(t),t instanceof ShadowRoot?t=t.host:t=t.parentNode},j=new WeakSet,ne=new MutationObserver(t=>{for(let e of t)F(e.target)}),d=t=>{let e=I.get(t);if(e||(e={full:\"\",immediate:[]},!f(t)))return e;let r=\"\";if(oe(t))e.full=t.value,e.immediate.push(t.value),t.addEventListener(\"input\",o=>{F(o.target)},{once:!0,capture:!0});else{for(let o=t.firstChild;o;o=o.nextSibling){if(o.nodeType===Node.TEXT_NODE){e.full+=o.nodeValue??\"\",r+=o.nodeValue??\"\";continue}r&&e.immediate.push(r),r=\"\",o.nodeType===Node.ELEMENT_NODE&&(e.full+=d(o).full)}r&&e.immediate.push(r),t instanceof Element&&t.shadowRoot&&(e.full+=d(t.shadowRoot).full),j.has(t)||(ne.observe(t,{childList:!0,characterData:!0,subtree:!0}),j.add(t))}return I.set(t,e),e};var m=function*(t,e){let r=!1;for(let o of t.childNodes)if(o instanceof Element&&f(o)){let s;o.shadowRoot?s=m(o.shadowRoot,e):s=m(o,e);for(let i of s)yield i,r=!0}r||t instanceof Element&&f(t)&&d(t).full.includes(e)&&(yield t)};var k={};l(k,{checkVisibility:()=>le,pierce:()=>S,pierceAll:()=>O});var ie=[\"hidden\",\"collapse\"],le=(t,e)=>{if(!t)return e===!1;if(e===void 0)return t;let r=t.nodeType===Node.TEXT_NODE?t.parentElement:t,o=window.getComputedStyle(r),s=o&&!ie.includes(o.visibility)&&!ae(r);return e===s?t:!1};function ae(t){let e=t.getBoundingClientRect();return e.width===0||e.height===0}var ce=t=>\"shadowRoot\"in t&&t.shadowRoot instanceof ShadowRoot;function*S(t){ce(t)?yield t.shadowRoot:yield t}function*O(t){t=S(t).next().value,yield t;let e=[document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT)];for(let r of e){let o;for(;o=r.nextNode();)o.shadowRoot&&(yield o.shadowRoot,e.push(document.createTreeWalker(o.shadowRoot,NodeFilter.SHOW_ELEMENT)))}}var D={};l(D,{xpathQuerySelectorAll:()=>q});var q=function*(t,e,r=-1){let s=(t.ownerDocument||document).evaluate(e,t,null,XPathResult.ORDERED_NODE_ITERATOR_TYPE),i=[],n;for(;(n=s.iterateNext())&&(i.push(n),!(r&&i.length===r)););for(let h=0;h<i.length;h++)n=i[h],yield n,delete i[h]};var ue=/[-\\w\\P{ASCII}*]/u,H=(r=>(r.Descendent=\">>>\",r.Child=\">>>>\",r))(H||{}),V=t=>\"querySelectorAll\"in t,Q=class{#e;#r=[];#o=void 0;elements;constructor(e,r){this.elements=[e],this.#e=r,this.#t()}async run(){for(typeof this.#o==\"string\"&&this.#o.trimStart()===\":scope\"&&this.#t();this.#o!==void 0;this.#t()){let e=this.#o;typeof e==\"string\"?e[0]&&ue.test(e[0])?this.elements=a.flatMap(this.elements,async function*(r){V(r)&&(yield*r.querySelectorAll(e))}):this.elements=a.flatMap(this.elements,async function*(r){if(!r.parentElement){if(!V(r))return;yield*r.querySelectorAll(e);return}let o=0;for(let s of r.parentElement.children)if(++o,s===r)break;yield*r.parentElement.querySelectorAll(`:scope>:nth-child(${o})${e}`)}):this.elements=a.flatMap(this.elements,async function*(r){switch(e.name){case\"text\":yield*m(r,e.value);break;case\"xpath\":yield*q(r,e.value);break;case\"aria\":yield*x(r,e.value);break;default:let o=P.get(e.name);if(!o)throw new Error(`Unknown selector type: ${e.name}`);yield*o.querySelectorAll(r,e.value)}})}}#t(){if(this.#r.length!==0){this.#o=this.#r.shift();return}if(this.#e.length===0){this.#o=void 0;return}let e=this.#e.shift();switch(e){case\">>>>\":{this.elements=a.flatMap(this.elements,S),this.#t();break}case\">>>\":{this.elements=a.flatMap(this.elements,O),this.#t();break}default:this.#r=e,this.#t();break}}},M=class{#e=new WeakMap;calculate(e,r=[]){if(e===null)return r;e instanceof ShadowRoot&&(e=e.host);let o=this.#e.get(e);if(o)return[...o,...r];let s=0;for(let n=e.previousSibling;n;n=n.previousSibling)++s;let i=this.calculate(e.parentNode,[s]);return this.#e.set(e,i),[...i,...r]}},U=(t,e)=>{if(t.length+e.length===0)return 0;let[r=-1,...o]=t,[s=-1,...i]=e;return r===s?U(o,i):r<s?-1:1},de=async function*(t){let e=new Set;for await(let o of t)e.add(o);let r=new M;yield*[...e.values()].map(o=>[o,r.calculate(o)]).sort(([,o],[,s])=>U(o,s)).map(([o])=>o)},$=function(t,e){let r=JSON.parse(e);if(r.some(o=>{let s=0;return o.some(i=>(typeof i==\"string\"?++s:s=0,s>1))}))throw new Error(\"Multiple deep combinators found in sequence.\");return de(a.flatMap(r,o=>{let s=new Q(t,o);return s.run(),s.elements}))},fe=async function(t,e){for await(let r of $(t,e))return r;return null};var me=Object.freeze({...b,...A,...R,..._,...C,...k,...D,...E,Deferred:c,createFunction:W,createTextContent:d,IntervalPoller:T,isSuitableNodeForTextMatching:f,MutationPoller:y,RAFPoller:w}),he=me;\n";
@@ -8,7 +8,7 @@
8
8
  * @internal
9
9
  */
10
10
  export const PUPPETEER_REVISIONS = Object.freeze({
11
- chrome: '143.0.7499.42',
12
- 'chrome-headless-shell': '143.0.7499.42',
13
- firefox: 'stable_146.0',
11
+ chrome: '143.0.7499.169',
12
+ 'chrome-headless-shell': '143.0.7499.169',
13
+ firefox: 'stable_146.0.1',
14
14
  });
@@ -6,5 +6,5 @@
6
6
 
7
7
  // If moved update release-please config
8
8
  // x-release-please-start-version
9
- export const packageVersion = '24.33.0';
9
+ export const packageVersion = '24.34.0';
10
10
  // x-release-please-end
@@ -3,10 +3,8 @@
3
3
  // found in the LICENSE file.
4
4
  /* eslint-disable @devtools/no-lit-render-outside-of-view, @devtools/enforce-custom-element-definitions-location */
5
5
 
6
- import type * as Platform from '../../../core/platform/platform.js';
7
6
  import {html, render} from '../../../ui/lit/lit.js';
8
7
  import * as UI from '../../legacy/legacy.js';
9
- import * as VisualElements from '../../visual_logging/visual_logging.js';
10
8
 
11
9
  import adornerStyles from './adorner.css.js';
12
10
 
@@ -21,30 +19,16 @@ export interface AdornerData {
21
19
  * embedded into the corresponding views.
22
20
  */
23
21
  export class Adorner extends HTMLElement {
24
- static readonly observedAttributes = ['active', 'toggleable'];
25
22
  name = '';
26
23
 
27
24
  readonly #shadow = this.attachShadow({mode: 'open'});
25
+
28
26
  #isToggle = false;
29
- #ariaLabelDefault?: string;
30
- #ariaLabelActive?: string;
31
- #content?: HTMLElement;
32
- #jslogContext?: string;
33
-
34
- set data(data: AdornerData) {
35
- this.name = data.name;
36
- this.#jslogContext = data.jslogContext;
37
- if (data.content) {
38
- this.#content?.remove();
39
- this.append(data.content);
40
- this.#content = data.content;
41
- }
42
- this.#render();
43
- }
44
27
 
45
28
  override cloneNode(deep?: boolean): Node {
46
29
  const node = UI.UIUtils.cloneCustomElement(this, deep);
47
- node.data = {name: this.name, content: this.#content, jslogContext: this.#jslogContext};
30
+ node.name = this.name;
31
+ node.#isToggle = this.#isToggle;
48
32
  return node;
49
33
  }
50
34
 
@@ -52,12 +36,10 @@ export class Adorner extends HTMLElement {
52
36
  if (!this.getAttribute('aria-label')) {
53
37
  this.setAttribute('aria-label', this.name);
54
38
  }
55
- if (this.#jslogContext && !this.getAttribute('jslog')) {
56
- this.setAttribute('jslog', `${VisualElements.adorner(this.#jslogContext)}`);
57
- }
58
39
  this.#render();
59
40
  }
60
41
 
42
+ static readonly observedAttributes = ['active', 'toggleable'];
61
43
  attributeChangedCallback(name: string, oldValue: string, newValue: string): void {
62
44
  if (oldValue === newValue) {
63
45
  return;
@@ -65,10 +47,11 @@ export class Adorner extends HTMLElement {
65
47
 
66
48
  switch (name) {
67
49
  case 'active':
68
- this.toggle(newValue === 'true');
50
+ this.#toggle(newValue === 'true');
69
51
  break;
70
52
  case 'toggleable':
71
53
  this.#isToggle = newValue === 'true';
54
+ this.#toggle(this.getAttribute('active') === 'true');
72
55
  break;
73
56
  }
74
57
  }
@@ -81,13 +64,13 @@ export class Adorner extends HTMLElement {
81
64
  * Toggle the active state of the adorner. Optionally pass `true` to force-set
82
65
  * an active state; pass `false` to force-set an inactive state.
83
66
  */
84
- toggle(forceActiveState?: boolean): void {
67
+ #toggle(forceActiveState?: boolean): void {
85
68
  if (!this.#isToggle) {
86
69
  return;
87
70
  }
88
71
  const shouldBecomeActive = forceActiveState === undefined ? !this.isActive() : forceActiveState;
72
+ this.setAttribute('role', 'button');
89
73
  this.setAttribute('aria-pressed', Boolean(shouldBecomeActive).toString());
90
- this.setAttribute('aria-label', (shouldBecomeActive ? this.#ariaLabelActive : this.#ariaLabelDefault) || this.name);
91
74
  }
92
75
 
93
76
  show(): void {
@@ -98,49 +81,6 @@ export class Adorner extends HTMLElement {
98
81
  this.classList.add('hidden');
99
82
  }
100
83
 
101
- /**
102
- * Make adorner interactive by responding to click events with the provided action
103
- * and simulating ARIA-capable toggle button behavior.
104
- */
105
- addInteraction(action: EventListener, options: {
106
- ariaLabelDefault: Platform.UIString.LocalizedString,
107
- ariaLabelActive: Platform.UIString.LocalizedString,
108
- isToggle?: boolean,
109
- shouldPropagateOnKeydown?: boolean,
110
- }): void {
111
- const {isToggle = false, shouldPropagateOnKeydown = false, ariaLabelDefault, ariaLabelActive} = options;
112
-
113
- this.#isToggle = isToggle;
114
- this.#ariaLabelDefault = ariaLabelDefault;
115
- this.#ariaLabelActive = ariaLabelActive;
116
- this.setAttribute('aria-label', ariaLabelDefault);
117
- if (this.#jslogContext) {
118
- this.setAttribute('jslog', `${VisualElements.adorner(this.#jslogContext).track({click: true})}`);
119
- }
120
-
121
- if (isToggle) {
122
- this.addEventListener('click', () => {
123
- this.toggle();
124
- });
125
- this.toggle(false /* initialize inactive state */);
126
- }
127
-
128
- this.addEventListener('click', action);
129
-
130
- // Simulate an ARIA-capable toggle button
131
- this.classList.add('clickable');
132
- this.setAttribute('role', 'button');
133
- this.tabIndex = 0;
134
- this.addEventListener('keydown', event => {
135
- if (event.code === 'Enter' || event.code === 'Space') {
136
- this.click();
137
- if (!shouldPropagateOnKeydown) {
138
- event.stopPropagation();
139
- }
140
- }
141
- });
142
- }
143
-
144
84
  #render(): void {
145
85
  render(html`<style>${adornerStyles}</style><slot></slot>`, this.#shadow, {host: this});
146
86
  }
@@ -49,7 +49,7 @@ export class AiCodeGenerationProvider {
49
49
  #devtoolsLocale: string;
50
50
  #aiCodeCompletionSetting = Common.Settings.Settings.instance().createSetting('ai-code-completion-enabled', false);
51
51
  #generationTeaserCompartment = new CodeMirror.Compartment();
52
- #generationTeaser: PanelCommon.AiCodeGenerationTeaser;
52
+ #generationTeaser: PanelCommon.AiCodeGenerationTeaser.AiCodeGenerationTeaser;
53
53
  #editor?: TextEditor;
54
54
  #aiCodeGenerationConfig: AiCodeGenerationConfig;
55
55
  #aiCodeGeneration?: AiCodeGeneration.AiCodeGeneration.AiCodeGeneration;
@@ -63,7 +63,7 @@ export class AiCodeGenerationProvider {
63
63
  if (!AiCodeGeneration.AiCodeGeneration.AiCodeGeneration.isAiCodeGenerationEnabled(this.#devtoolsLocale)) {
64
64
  throw new Error('AI code generation feature is not enabled.');
65
65
  }
66
- this.#generationTeaser = new PanelCommon.AiCodeGenerationTeaser();
66
+ this.#generationTeaser = new PanelCommon.AiCodeGenerationTeaser.AiCodeGenerationTeaser();
67
67
  this.#aiCodeGenerationConfig = aiCodeGenerationConfig;
68
68
  }
69
69
 
@@ -73,7 +73,8 @@ export class AiCodeGenerationProvider {
73
73
 
74
74
  extension(): CodeMirror.Extension[] {
75
75
  return [
76
- CodeMirror.EditorView.updateListener.of(update => this.activateTeaser(update)),
76
+ CodeMirror.EditorView.updateListener.of(update => this.#activateTeaser(update)),
77
+ CodeMirror.EditorView.updateListener.of(update => this.#abortGenerationDuringUpdate(update)),
77
78
  aiAutoCompleteSuggestion,
78
79
  aiAutoCompleteSuggestionState,
79
80
  aiCodeGenerationTeaserModeState,
@@ -141,7 +142,9 @@ export class AiCodeGenerationProvider {
141
142
  });
142
143
  return true;
143
144
  }
144
- if (this.#generationTeaser.isShowing() && this.#generationTeaser.loading) {
145
+ const generationTeaserIsLoading = this.#generationTeaser.displayState ===
146
+ PanelCommon.AiCodeGenerationTeaser.AiCodeGenerationTeaserDisplayState.LOADING;
147
+ if (this.#generationTeaser.isShowing() && generationTeaserIsLoading) {
145
148
  this.#controller.abort();
146
149
  this.#controller = new AbortController();
147
150
  this.#dismissTeaser();
@@ -187,11 +190,11 @@ export class AiCodeGenerationProvider {
187
190
  }
188
191
 
189
192
  #dismissTeaser(): void {
190
- this.#generationTeaser.loading = false;
193
+ this.#generationTeaser.displayState = PanelCommon.AiCodeGenerationTeaser.AiCodeGenerationTeaserDisplayState.TRIGGER;
191
194
  this.#editor?.dispatch({effects: setAiCodeGenerationTeaserMode.of(AiCodeGenerationTeaserMode.DISMISSED)});
192
195
  }
193
196
 
194
- async activateTeaser(update: CodeMirror.ViewUpdate): Promise<void> {
197
+ #activateTeaser(update: CodeMirror.ViewUpdate): void {
195
198
  const currentTeaserMode = update.state.field(aiCodeGenerationTeaserModeState);
196
199
  if (currentTeaserMode === AiCodeGenerationTeaserMode.ACTIVE) {
197
200
  return;
@@ -202,12 +205,35 @@ export class AiCodeGenerationProvider {
202
205
  update.view.dispatch({effects: setAiCodeGenerationTeaserMode.of(AiCodeGenerationTeaserMode.ACTIVE)});
203
206
  }
204
207
 
208
+ /**
209
+ * Monitors editor changes to cancel an ongoing AI generation.
210
+ * We abort the request and dismiss the teaser if the user modifies the
211
+ * document or moves their cursor/selection. These actions indicate the user
212
+ * is no longer focused on the current generation point or has manually
213
+ * resumed editing, making the pending suggestion irrelevant.
214
+ */
215
+ #abortGenerationDuringUpdate(update: CodeMirror.ViewUpdate): void {
216
+ if (!update.docChanged && update.state.selection.main.head === update.startState.selection.main.head) {
217
+ return;
218
+ }
219
+ const currentTeaserMode = update.state.field(aiCodeGenerationTeaserModeState);
220
+ const generationTeaserIsLoading = this.#generationTeaser.displayState ===
221
+ PanelCommon.AiCodeGenerationTeaser.AiCodeGenerationTeaserDisplayState.LOADING;
222
+ // Generation should be in progress
223
+ if (currentTeaserMode === AiCodeGenerationTeaserMode.DISMISSED || !generationTeaserIsLoading) {
224
+ return;
225
+ }
226
+ this.#controller.abort();
227
+ this.#controller = new AbortController();
228
+ this.#dismissTeaser();
229
+ }
230
+
205
231
  async #triggerAiCodeGeneration(options?: {signal?: AbortSignal}): Promise<void> {
206
232
  if (!this.#editor || !this.#aiCodeGeneration) {
207
233
  return;
208
234
  }
209
235
 
210
- this.#generationTeaser.loading = true;
236
+ this.#generationTeaser.displayState = PanelCommon.AiCodeGenerationTeaser.AiCodeGenerationTeaserDisplayState.LOADING;
211
237
  const cursor = this.#editor.state.selection.main.head;
212
238
  // TODO(b/445899453): Detect all types of comments
213
239
  const query = this.#editor.state.doc.lineAt(cursor).text;
@@ -265,44 +291,60 @@ export class AiCodeGenerationProvider {
265
291
  }
266
292
  }
267
293
 
268
- // TODO(b/445899453): Handle teaser's discovery mode
269
- function aiCodeGenerationTeaserExtension(teaser: PanelCommon.AiCodeGenerationTeaser): CodeMirror.Extension {
294
+ function aiCodeGenerationTeaserExtension(teaser: PanelCommon.AiCodeGenerationTeaser.AiCodeGenerationTeaser):
295
+ CodeMirror.Extension {
270
296
  return CodeMirror.ViewPlugin.fromClass(class {
271
- #teaserMode: AiCodeGenerationTeaserMode;
297
+ #view: CodeMirror.EditorView;
272
298
 
273
- constructor(readonly view: CodeMirror.EditorView) {
274
- this.#teaserMode = view.state.field(aiCodeGenerationTeaserModeState);
299
+ constructor(view: CodeMirror.EditorView) {
300
+ this.#view = view;
301
+ this.#updateTeaserState(view.state);
275
302
  }
276
303
 
277
304
  update(update: CodeMirror.ViewUpdate): void {
278
- const currentTeaserMode = update.state.field(aiCodeGenerationTeaserModeState);
279
- if (currentTeaserMode !== this.#teaserMode) {
280
- this.#teaserMode = currentTeaserMode;
281
- }
282
305
  if (!update.docChanged && update.state.selection.main.head === update.startState.selection.main.head) {
283
306
  return;
284
307
  }
285
- if (teaser.loading) {
286
- teaser.loading = false;
287
- }
308
+ this.#updateTeaserState(update.state);
288
309
  }
289
310
 
290
311
  get decorations(): CodeMirror.DecorationSet {
291
- if (this.#teaserMode === AiCodeGenerationTeaserMode.DISMISSED) {
312
+ const teaserMode = this.#view.state.field(aiCodeGenerationTeaserModeState);
313
+ if (teaserMode === AiCodeGenerationTeaserMode.DISMISSED) {
292
314
  return CodeMirror.Decoration.none;
293
315
  }
294
- const cursorPosition = this.view.state.selection.main.head;
295
- const line = this.view.state.doc.lineAt(cursorPosition);
316
+
317
+ const cursorPosition = this.#view.state.selection.main.head;
318
+ const line = this.#view.state.doc.lineAt(cursorPosition);
319
+
320
+ const isEmptyLine = line.length === 0;
296
321
  // TODO(b/445899453): Detect all types of comments
297
322
  const isComment = line.text.startsWith('//');
298
323
  const isCursorAtEndOfLine = cursorPosition >= line.to;
299
- if (!isComment || !isCursorAtEndOfLine) {
300
- return CodeMirror.Decoration.none;
324
+
325
+ if ((isEmptyLine) || (isComment && isCursorAtEndOfLine)) {
326
+ return CodeMirror.Decoration.set([
327
+ CodeMirror.Decoration.widget({widget: new AiCodeCompletionTeaserPlaceholder(teaser), side: 1})
328
+ .range(cursorPosition),
329
+ ]);
330
+ }
331
+ return CodeMirror.Decoration.none;
332
+ }
333
+
334
+ #updateTeaserState(state: CodeMirror.EditorState): void {
335
+ // Only handle non loading states, as updates during generation are handled by
336
+ // #abortGenerationDuringUpdate in AiCodeGenerationProvider
337
+ if (teaser.displayState === PanelCommon.AiCodeGenerationTeaser.AiCodeGenerationTeaserDisplayState.LOADING) {
338
+ return;
339
+ }
340
+ const cursorPosition = state.selection.main.head;
341
+ const line = state.doc.lineAt(cursorPosition);
342
+ const isEmptyLine = line.length === 0;
343
+ if (isEmptyLine) {
344
+ teaser.displayState = PanelCommon.AiCodeGenerationTeaser.AiCodeGenerationTeaserDisplayState.DISCOVERY;
345
+ } else {
346
+ teaser.displayState = PanelCommon.AiCodeGenerationTeaser.AiCodeGenerationTeaserDisplayState.TRIGGER;
301
347
  }
302
- return CodeMirror.Decoration.set([
303
- CodeMirror.Decoration.widget({widget: new AiCodeCompletionTeaserPlaceholder(teaser), side: 1})
304
- .range(cursorPosition),
305
- ]);
306
348
  }
307
349
  }, {
308
350
  decorations: v => v.decorations,
@@ -150,6 +150,7 @@ export class SearchableView extends VBox {
150
150
  private replaceToggleButton: ToolbarToggle;
151
151
  private searchInputElement: HTMLInputElement;
152
152
  private matchesElement: HTMLElement;
153
+ private matchesElementValue: HTMLElement;
153
154
  private searchNavigationPrevElement: ToolbarButton;
154
155
  private searchNavigationNextElement: ToolbarButton;
155
156
  private readonly replaceInputElement: HTMLInputElement;
@@ -314,6 +315,9 @@ export class SearchableView extends VBox {
314
315
  this.matchesElement.style.color = 'var(--sys-color-on-surface-subtle)';
315
316
  this.matchesElement.style.padding = '0 var(--sys-size-3)';
316
317
  this.matchesElement.classList.add('search-results-matches');
318
+ ARIAUtils.markAsPoliteLiveRegion(this.matchesElement, false);
319
+ this.matchesElementValue = this.matchesElement.createChild('span');
320
+ ARIAUtils.setHidden(this.matchesElementValue, true);
317
321
  toolbar.appendToolbarItem(matchesText);
318
322
 
319
323
  const cancelButtonElement = new Buttons.Button.Button();
@@ -455,7 +459,7 @@ export class SearchableView extends VBox {
455
459
  resetSearch(): void {
456
460
  this.clearSearch();
457
461
  this.updateReplaceVisibility();
458
- this.matchesElement.textContent = '';
462
+ this.matchesElementValue.textContent = '';
459
463
  }
460
464
 
461
465
  refreshSearch(): void {
@@ -504,15 +508,17 @@ export class SearchableView extends VBox {
504
508
 
505
509
  private updateSearchMatchesCountAndCurrentMatchIndex(matches: number, currentMatchIndex: number): void {
506
510
  if (!this.currentQuery) {
507
- this.matchesElement.textContent = '';
511
+ this.matchesElementValue.textContent = '';
508
512
  } else if (matches === 0 || currentMatchIndex >= 0) {
509
- this.matchesElement.textContent = i18nString(UIStrings.dOfD, {PH1: currentMatchIndex + 1, PH2: matches});
513
+ this.matchesElementValue.textContent = i18nString(UIStrings.dOfD, {PH1: currentMatchIndex + 1, PH2: matches});
510
514
  ARIAUtils.setLabel(
511
515
  this.matchesElement, i18nString(UIStrings.accessibledOfD, {PH1: currentMatchIndex + 1, PH2: matches}));
512
516
  } else if (matches === 1) {
513
- this.matchesElement.textContent = i18nString(UIStrings.matchString);
517
+ this.matchesElementValue.textContent = i18nString(UIStrings.matchString);
518
+ ARIAUtils.setLabel(this.matchesElement, i18nString(UIStrings.matchString));
514
519
  } else {
515
- this.matchesElement.textContent = i18nString(UIStrings.dMatches, {PH1: matches});
520
+ this.matchesElementValue.textContent = i18nString(UIStrings.dMatches, {PH1: matches});
521
+ ARIAUtils.setLabel(this.matchesElement, i18nString(UIStrings.dMatches, {PH1: matches}));
516
522
  }
517
523
  this.updateSearchNavigationButtonState(matches > 0);
518
524
  }
@@ -236,7 +236,7 @@ export class SplitWidget extends Common.ObjectWrapper.eventMixin<EventTypes, typ
236
236
  this.#restoreAndApplyShowModeFromSettings();
237
237
  }
238
238
 
239
- showMode(): string {
239
+ showMode(): ShowMode {
240
240
  return this.#showMode;
241
241
  }
242
242
 
@@ -1352,11 +1352,11 @@ export class TabbedPaneTab {
1352
1352
  const tabElement = document.createElement('div');
1353
1353
  tabElement.classList.add('tabbed-pane-header-tab');
1354
1354
  tabElement.id = 'tab-' + this.#id;
1355
- ARIAUtils.markAsTab(tabElement);
1356
1355
  ARIAUtils.setSelected(tabElement, false);
1357
1356
  ARIAUtils.setLabel(tabElement, this.title);
1358
1357
 
1359
1358
  const titleElement = tabElement.createChild('span', 'tabbed-pane-header-tab-title');
1359
+ ARIAUtils.markAsTab(titleElement);
1360
1360
  titleElement.textContent = this.title;
1361
1361
  Tooltip.install(titleElement, this.tooltip || '');
1362
1362
  this.createIconElement(tabElement, titleElement, measuring);
@@ -1187,6 +1187,39 @@ export class FlameChart extends Common.ObjectWrapper.eventMixin<EventTypes, type
1187
1187
  this.expandGroup(groupIndex, !this.rawTimelineData.groups[groupIndex].expanded /* setExpanded */);
1188
1188
  }
1189
1189
 
1190
+ bulkExpandGroups(indexes: number[]): void {
1191
+ if (indexes.length === 0) {
1192
+ return;
1193
+ }
1194
+ if (!this.rawTimelineData) {
1195
+ return;
1196
+ }
1197
+
1198
+ const groups = this.rawTimelineData.groups;
1199
+ if (!groups) {
1200
+ return;
1201
+ }
1202
+
1203
+ let didUpdate = false;
1204
+ for (const index of indexes) {
1205
+ if (!this.isGroupCollapsible(index) || groups[index].expanded) {
1206
+ continue;
1207
+ }
1208
+ didUpdate = true;
1209
+ groups[index].expanded = true;
1210
+ }
1211
+ if (didUpdate) {
1212
+ this.#updateAfterGroupExpansionChange();
1213
+ }
1214
+ }
1215
+
1216
+ #updateAfterGroupExpansionChange(): void {
1217
+ this.updateLevelPositions();
1218
+ this.updateHeight();
1219
+ this.draw();
1220
+ this.#notifyProviderOfConfigurationChange();
1221
+ }
1222
+
1190
1223
  private expandGroup(
1191
1224
  groupIndex: number, setExpanded: boolean|undefined = true, propagatedExpand: boolean|undefined = false): void {
1192
1225
  if (groupIndex < 0 || !this.isGroupCollapsible(groupIndex)) {
@@ -1203,12 +1236,10 @@ export class FlameChart extends Common.ObjectWrapper.eventMixin<EventTypes, type
1203
1236
  }
1204
1237
 
1205
1238
  const group = groups[groupIndex];
1206
- group.expanded = setExpanded;
1207
-
1208
- this.updateLevelPositions();
1209
1239
 
1210
- this.updateHighlight();
1211
- if (!group.expanded) {
1240
+ // If a group was expanded and is now being collapsed, and the selected
1241
+ // entry is within that group, then we have to deselect it.
1242
+ if (!setExpanded) {
1212
1243
  const timelineData = this.timelineData();
1213
1244
  if (timelineData) {
1214
1245
  const level = timelineData.entryLevels[this.selectedEntryIndex];
@@ -1220,10 +1251,13 @@ export class FlameChart extends Common.ObjectWrapper.eventMixin<EventTypes, type
1220
1251
  }
1221
1252
  }
1222
1253
  }
1223
-
1224
- this.updateHeight();
1225
- this.draw();
1226
- this.#notifyProviderOfConfigurationChange();
1254
+ if (group.expanded === setExpanded) {
1255
+ // If the state isn't changing, early exit so we don't waste cycles
1256
+ // redrawing.
1257
+ return;
1258
+ }
1259
+ group.expanded = setExpanded;
1260
+ this.#updateAfterGroupExpansionChange();
1227
1261
 
1228
1262
  this.scrollGroupIntoView(groupIndex);
1229
1263
  // We only want to read expanded/collapsed state on user inputted expand/collapse
@@ -551,6 +551,7 @@ export const knownContextValues = new Set([
551
551
  'bars',
552
552
  'base-64',
553
553
  'base-palette',
554
+ 'base-url',
554
555
  'baseline-shift',
555
556
  'baseline-source',
556
557
  'be',
@@ -812,11 +813,15 @@ export const knownContextValues = new Set([
812
813
  'column-rule-color',
813
814
  'column-rule-edge-end-inset',
814
815
  'column-rule-edge-end-outset',
816
+ 'column-rule-edge-inset-end',
817
+ 'column-rule-edge-inset-start',
815
818
  'column-rule-edge-start-inset',
816
819
  'column-rule-edge-start-outset',
817
820
  'column-rule-inset',
818
821
  'column-rule-interior-end-inset',
819
822
  'column-rule-interior-end-outset',
823
+ 'column-rule-interior-inset-end',
824
+ 'column-rule-interior-inset-start',
820
825
  'column-rule-interior-start-inset',
821
826
  'column-rule-interior-start-outset',
822
827
  'column-rule-outset',
@@ -1744,6 +1749,7 @@ export const knownContextValues = new Set([
1744
1749
  'grace-period-mitigation-disabled',
1745
1750
  'greendev-ai-annotations-enabled',
1746
1751
  'greendev-artifact-viewer-enabled',
1752
+ 'greendev-copy-to-gemini-enabled',
1747
1753
  'greendev-in-devtools-floaty-enabled',
1748
1754
  'greendev-inline-widgets-enabled',
1749
1755
  'greendev-prototypes',
@@ -1787,6 +1793,7 @@ export const knownContextValues = new Set([
1787
1793
  'has-overrides',
1788
1794
  'has-profile',
1789
1795
  'has-touch',
1796
+ 'hash',
1790
1797
  'hashchange',
1791
1798
  'he',
1792
1799
  'header-editor',
@@ -1835,6 +1842,7 @@ export const knownContextValues = new Set([
1835
1842
  'history',
1836
1843
  'historyRedo',
1837
1844
  'historyUndo',
1845
+ 'hostname',
1838
1846
  'hover',
1839
1847
  'hr',
1840
1848
  'http-only',
@@ -2702,6 +2710,7 @@ export const knownContextValues = new Set([
2702
2710
  'no-override',
2703
2711
  'no-profile-and-eligible',
2704
2712
  'no-profile-and-not-eligible',
2713
+ 'no-thanks',
2705
2714
  'no-throttling',
2706
2715
  'node',
2707
2716
  'node-connection',
@@ -2856,6 +2865,7 @@ export const knownContextValues = new Set([
2856
2865
  'patch-widget.save-all',
2857
2866
  'patch-widget.workspace',
2858
2867
  'path',
2868
+ 'pathname',
2859
2869
  'pattern',
2860
2870
  'pause',
2861
2871
  'pause-on-caught-exception',
@@ -2916,6 +2926,7 @@ export const knownContextValues = new Set([
2916
2926
  'popover-show-delay',
2917
2927
  'popstate',
2918
2928
  'population',
2929
+ 'port',
2919
2930
  'portrait',
2920
2931
  'portrait-upside-down',
2921
2932
  'position',
@@ -3096,6 +3107,7 @@ export const knownContextValues = new Set([
3096
3107
  'removed-count',
3097
3108
  'removed-size',
3098
3109
  'rename',
3110
+ 'render-blocking',
3099
3111
  'rendering',
3100
3112
  'rendering-emulations',
3101
3113
  'rendering.toggle-prefers-color-scheme',
@@ -3187,11 +3199,15 @@ export const knownContextValues = new Set([
3187
3199
  'row-rule-color',
3188
3200
  'row-rule-edge-end-inset',
3189
3201
  'row-rule-edge-end-outset',
3202
+ 'row-rule-edge-inset-end',
3203
+ 'row-rule-edge-inset-start',
3190
3204
  'row-rule-edge-start-inset',
3191
3205
  'row-rule-edge-start-outset',
3192
3206
  'row-rule-inset',
3193
3207
  'row-rule-interior-end-inset',
3194
3208
  'row-rule-interior-end-outset',
3209
+ 'row-rule-interior-inset-end',
3210
+ 'row-rule-interior-inset-start',
3195
3211
  'row-rule-interior-start-inset',
3196
3212
  'row-rule-interior-start-outset',
3197
3213
  'row-rule-outset',
package/package.json CHANGED
@@ -81,6 +81,7 @@
81
81
  "ora": "9.0.0",
82
82
  "postcss": "8.5.6",
83
83
  "puppeteer-core": "24.30.0",
84
+ "rollup": "4.22.4",
84
85
  "rollup-plugin-sourcemaps2": "0.5.4",
85
86
  "sinon": "21.0.0",
86
87
  "source-map-support": "0.5.21",
@@ -104,5 +105,5 @@
104
105
  "flat-cache": "6.1.12"
105
106
  }
106
107
  },
107
- "version": "1.0.1558690"
108
+ "version": "1.0.1561080"
108
109
  }