chrome-devtools-frontend 1.0.943986 → 1.0.945579

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 (335) hide show
  1. package/config/gni/devtools_grd_files.gni +4 -0
  2. package/config/gni/devtools_image_files.gni +1 -0
  3. package/front_end/Images/src/circled_exclamation_icon.svg +3 -0
  4. package/front_end/core/common/ParsedURL.ts +1 -1
  5. package/front_end/core/host/UserMetrics.ts +2 -1
  6. package/front_end/core/i18n/i18nImpl.ts +7 -4
  7. package/front_end/core/i18n/locales/en-US.json +3 -72
  8. package/front_end/core/i18n/locales/en-XL.json +15 -84
  9. package/front_end/core/protocol_client/NodeURL.ts +1 -0
  10. package/front_end/core/sdk/CSSMetadata.ts +0 -1
  11. package/front_end/core/sdk/CSSStyleDeclaration.ts +4 -0
  12. package/front_end/core/sdk/CSSStyleSheetHeader.ts +2 -3
  13. package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +2 -3
  14. package/front_end/core/sdk/Cookie.ts +17 -0
  15. package/front_end/core/sdk/CookieModel.ts +1 -0
  16. package/front_end/core/sdk/DebuggerModel.ts +5 -4
  17. package/front_end/core/sdk/NetworkManager.ts +4 -1
  18. package/front_end/core/sdk/NetworkRequest.ts +2 -2
  19. package/front_end/core/sdk/OverlayModel.ts +0 -9
  20. package/front_end/core/sdk/Resource.ts +2 -2
  21. package/front_end/core/sdk/Script.ts +2 -3
  22. package/front_end/core/sdk/sdk-meta.ts +0 -26
  23. package/front_end/entrypoints/inspector_main/RenderingOptions.ts +0 -13
  24. package/front_end/entrypoints/main/MainImpl.ts +4 -0
  25. package/front_end/generated/protocol.d.ts +0 -4
  26. package/front_end/models/bindings/BreakpointManager.ts +3 -4
  27. package/front_end/models/bindings/ResourceMapping.ts +1 -2
  28. package/front_end/models/bindings/StylesSourceMapping.ts +1 -2
  29. package/front_end/models/emulation/EmulatedDevices.ts +2 -4
  30. package/front_end/models/persistence/IsolatedFileSystem.ts +7 -6
  31. package/front_end/models/persistence/PersistenceActions.ts +4 -1
  32. package/front_end/models/persistence/PlatformFileSystem.ts +3 -4
  33. package/front_end/models/text_utils/ContentProvider.ts +1 -2
  34. package/front_end/models/text_utils/StaticContentProvider.ts +2 -3
  35. package/front_end/models/workspace/UISourceCode.ts +2 -2
  36. package/front_end/models/workspace_diff/WorkspaceDiff.ts +20 -6
  37. package/front_end/panels/animation/animationTimeline.css +2 -0
  38. package/front_end/panels/application/BackForwardCacheStrings.ts +15 -75
  39. package/front_end/panels/application/BackForwardCacheView.ts +8 -1
  40. package/front_end/panels/application/ReportingApiView.ts +15 -1
  41. package/front_end/panels/application/components/EndpointsGrid.ts +63 -4
  42. package/front_end/panels/application/components/FrameDetailsView.ts +21 -34
  43. package/front_end/panels/changes/ChangesView.ts +8 -7
  44. package/front_end/panels/console/ConsolePinPane.ts +1 -0
  45. package/front_end/panels/console/ConsolePrompt.ts +121 -171
  46. package/front_end/panels/console/ConsoleView.ts +1 -1
  47. package/front_end/panels/console/consoleView.css +1 -1
  48. package/front_end/panels/css_overview/cssOverviewCompletedView.css +2 -2
  49. package/front_end/panels/elements/AccessibilityTreeUtils.ts +2 -1
  50. package/front_end/panels/elements/ElementsTreeElement.ts +1 -0
  51. package/front_end/panels/elements/StyleEditorWidget.ts +13 -2
  52. package/front_end/panels/elements/StylePropertyHighlighter.ts +29 -19
  53. package/front_end/panels/elements/StylePropertyTreeElement.ts +8 -12
  54. package/front_end/panels/elements/StylesSidebarPane.ts +36 -10
  55. package/front_end/panels/elements/components/AccessibilityTreeNode.ts +27 -3
  56. package/front_end/panels/emulation/DeviceModeView.ts +3 -0
  57. package/front_end/panels/help/ReleaseNoteText.ts +3 -1
  58. package/front_end/panels/network/NetworkDataGridNode.ts +5 -1
  59. package/front_end/panels/snippets/ScriptSnippetFileSystem.ts +1 -1
  60. package/front_end/panels/sources/BreakpointEditDialog.ts +1 -0
  61. package/front_end/panels/sources/DebuggerPlugin.ts +1 -1
  62. package/front_end/panels/sources/NavigatorView.ts +1 -1
  63. package/front_end/panels/sources/UISourceCodeFrame.ts +0 -1
  64. package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +3 -34
  65. package/front_end/panels/timeline/TimelineUIUtils.ts +51 -3
  66. package/front_end/services/window_bounds/WindowBoundsService.ts +27 -0
  67. package/front_end/services/window_bounds/window_bounds.ts +9 -0
  68. package/front_end/third_party/acorn/README.chromium +2 -2
  69. package/front_end/third_party/acorn/acorn.ts +1 -1
  70. package/front_end/third_party/acorn/package/CHANGELOG.md +31 -1
  71. package/front_end/third_party/acorn/package/README.md +1 -1
  72. package/front_end/third_party/acorn/package/dist/acorn.d.ts +3 -0
  73. package/front_end/third_party/acorn/package/dist/acorn.js +772 -708
  74. package/front_end/third_party/acorn/package/dist/acorn.mjs +767 -703
  75. package/front_end/third_party/acorn/package/dist/bin.js +47 -21
  76. package/front_end/third_party/acorn/package/package.json +1 -1
  77. package/front_end/third_party/acorn-loose/README.chromium +2 -2
  78. package/front_end/third_party/acorn-loose/package/CHANGELOG.md +12 -0
  79. package/front_end/third_party/acorn-loose/package/dist/acorn-loose.js +27 -7
  80. package/front_end/third_party/acorn-loose/package/dist/acorn-loose.mjs +28 -8
  81. package/front_end/third_party/acorn-loose/package/package.json +2 -2
  82. package/front_end/third_party/codemirror.next/bundle.ts +4 -3
  83. package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
  84. package/front_end/third_party/codemirror.next/codemirror.next.d.ts +39 -1
  85. package/front_end/third_party/codemirror.next/codemirror.next.js +1 -1
  86. package/front_end/third_party/codemirror.next/package.json +4 -4
  87. package/front_end/third_party/i18n/i18n-impl.ts +1 -1
  88. package/front_end/third_party/lit-html/README.chromium +2 -2
  89. package/front_end/third_party/lit-html/package/CHANGELOG.md +216 -28
  90. package/front_end/third_party/lit-html/package/LICENSE +9 -9
  91. package/front_end/third_party/lit-html/package/README.md +12 -162
  92. package/front_end/third_party/lit-html/package/async-directive.d.ts +23 -54
  93. package/front_end/third_party/lit-html/package/async-directive.d.ts.map +1 -1
  94. package/front_end/third_party/lit-html/package/async-directive.js +2 -7
  95. package/front_end/third_party/lit-html/package/async-directive.js.map +1 -1
  96. package/front_end/third_party/lit-html/package/development/async-directive.d.ts +23 -54
  97. package/front_end/third_party/lit-html/package/development/async-directive.d.ts.map +1 -1
  98. package/front_end/third_party/lit-html/package/development/async-directive.js +44 -194
  99. package/front_end/third_party/lit-html/package/development/async-directive.js.map +1 -1
  100. package/front_end/third_party/lit-html/package/development/directive-helpers.d.ts +6 -5
  101. package/front_end/third_party/lit-html/package/development/directive-helpers.d.ts.map +1 -1
  102. package/front_end/third_party/lit-html/package/development/directive-helpers.js +25 -9
  103. package/front_end/third_party/lit-html/package/development/directive-helpers.js.map +1 -1
  104. package/front_end/third_party/lit-html/package/development/directive.d.ts +3 -16
  105. package/front_end/third_party/lit-html/package/development/directive.d.ts.map +1 -1
  106. package/front_end/third_party/lit-html/package/development/directive.js +6 -1
  107. package/front_end/third_party/lit-html/package/development/directive.js.map +1 -1
  108. package/front_end/third_party/lit-html/package/development/directives/async-append.d.ts +7 -14
  109. package/front_end/third_party/lit-html/package/development/directives/async-append.d.ts.map +1 -1
  110. package/front_end/third_party/lit-html/package/development/directives/async-append.js +17 -58
  111. package/front_end/third_party/lit-html/package/development/directives/async-append.js.map +1 -1
  112. package/front_end/third_party/lit-html/package/development/directives/async-replace.d.ts +9 -14
  113. package/front_end/third_party/lit-html/package/development/directives/async-replace.d.ts.map +1 -1
  114. package/front_end/third_party/lit-html/package/development/directives/async-replace.js +57 -37
  115. package/front_end/third_party/lit-html/package/development/directives/async-replace.js.map +1 -1
  116. package/front_end/third_party/lit-html/package/development/directives/cache.d.ts +2 -3
  117. package/front_end/third_party/lit-html/package/development/directives/cache.d.ts.map +1 -1
  118. package/front_end/third_party/lit-html/package/development/directives/cache.js +4 -6
  119. package/front_end/third_party/lit-html/package/development/directives/cache.js.map +1 -1
  120. package/front_end/third_party/lit-html/package/development/directives/class-map.d.ts +2 -2
  121. package/front_end/third_party/lit-html/package/development/directives/class-map.d.ts.map +1 -1
  122. package/front_end/third_party/lit-html/package/development/directives/class-map.js +17 -7
  123. package/front_end/third_party/lit-html/package/development/directives/class-map.js.map +1 -1
  124. package/front_end/third_party/lit-html/package/development/directives/guard.d.ts +3 -2
  125. package/front_end/third_party/lit-html/package/development/directives/guard.d.ts.map +1 -1
  126. package/front_end/third_party/lit-html/package/development/directives/guard.js +3 -2
  127. package/front_end/third_party/lit-html/package/development/directives/guard.js.map +1 -1
  128. package/front_end/third_party/lit-html/package/development/directives/live.d.ts +4 -3
  129. package/front_end/third_party/lit-html/package/development/directives/live.d.ts.map +1 -1
  130. package/front_end/third_party/lit-html/package/development/directives/live.js +5 -7
  131. package/front_end/third_party/lit-html/package/development/directives/live.js.map +1 -1
  132. package/front_end/third_party/lit-html/package/development/directives/private-async-helpers.d.ts +58 -0
  133. package/front_end/third_party/lit-html/package/development/directives/private-async-helpers.d.ts.map +1 -0
  134. package/front_end/third_party/lit-html/package/development/directives/private-async-helpers.js +85 -0
  135. package/front_end/third_party/lit-html/package/development/directives/private-async-helpers.js.map +1 -0
  136. package/front_end/third_party/lit-html/package/development/directives/ref.d.ts +14 -11
  137. package/front_end/third_party/lit-html/package/development/directives/ref.d.ts.map +1 -1
  138. package/front_end/third_party/lit-html/package/development/directives/ref.js +13 -11
  139. package/front_end/third_party/lit-html/package/development/directives/ref.js.map +1 -1
  140. package/front_end/third_party/lit-html/package/development/directives/repeat.d.ts +8 -4
  141. package/front_end/third_party/lit-html/package/development/directives/repeat.d.ts.map +1 -1
  142. package/front_end/third_party/lit-html/package/development/directives/repeat.js +23 -9
  143. package/front_end/third_party/lit-html/package/development/directives/repeat.js.map +1 -1
  144. package/front_end/third_party/lit-html/package/development/directives/style-map.d.ts +1 -2
  145. package/front_end/third_party/lit-html/package/development/directives/style-map.d.ts.map +1 -1
  146. package/front_end/third_party/lit-html/package/development/directives/style-map.js +1 -2
  147. package/front_end/third_party/lit-html/package/development/directives/style-map.js.map +1 -1
  148. package/front_end/third_party/lit-html/package/development/directives/template-content.d.ts +1 -2
  149. package/front_end/third_party/lit-html/package/development/directives/template-content.js +1 -2
  150. package/front_end/third_party/lit-html/package/development/directives/unsafe-html.d.ts +6 -4
  151. package/front_end/third_party/lit-html/package/development/directives/unsafe-html.d.ts.map +1 -1
  152. package/front_end/third_party/lit-html/package/development/directives/unsafe-html.js +7 -5
  153. package/front_end/third_party/lit-html/package/development/directives/unsafe-html.js.map +1 -1
  154. package/front_end/third_party/lit-html/package/development/directives/unsafe-svg.d.ts +4 -1
  155. package/front_end/third_party/lit-html/package/development/directives/unsafe-svg.d.ts.map +1 -1
  156. package/front_end/third_party/lit-html/package/development/directives/unsafe-svg.js +3 -0
  157. package/front_end/third_party/lit-html/package/development/directives/unsafe-svg.js.map +1 -1
  158. package/front_end/third_party/lit-html/package/development/directives/until.d.ts +12 -8
  159. package/front_end/third_party/lit-html/package/development/directives/until.d.ts.map +1 -1
  160. package/front_end/third_party/lit-html/package/development/directives/until.js +63 -23
  161. package/front_end/third_party/lit-html/package/development/directives/until.js.map +1 -1
  162. package/front_end/third_party/lit-html/package/development/experimental-hydrate.d.ts.map +1 -1
  163. package/front_end/third_party/lit-html/package/development/experimental-hydrate.js +9 -8
  164. package/front_end/third_party/lit-html/package/development/experimental-hydrate.js.map +1 -1
  165. package/front_end/third_party/lit-html/package/development/lit-html.d.ts +81 -136
  166. package/front_end/third_party/lit-html/package/development/lit-html.d.ts.map +1 -1
  167. package/front_end/third_party/lit-html/package/development/lit-html.js +249 -76
  168. package/front_end/third_party/lit-html/package/development/lit-html.js.map +1 -1
  169. package/front_end/third_party/lit-html/package/development/polyfill-support.d.ts +1 -41
  170. package/front_end/third_party/lit-html/package/development/polyfill-support.d.ts.map +1 -1
  171. package/front_end/third_party/lit-html/package/development/polyfill-support.js +40 -21
  172. package/front_end/third_party/lit-html/package/development/polyfill-support.js.map +1 -1
  173. package/front_end/third_party/lit-html/package/development/private-ssr-support.d.ts +12 -10
  174. package/front_end/third_party/lit-html/package/development/private-ssr-support.d.ts.map +1 -1
  175. package/front_end/third_party/lit-html/package/development/private-ssr-support.js +11 -3
  176. package/front_end/third_party/lit-html/package/development/private-ssr-support.js.map +1 -1
  177. package/front_end/third_party/lit-html/package/development/static.d.ts.map +1 -1
  178. package/front_end/third_party/lit-html/package/development/static.js +6 -5
  179. package/front_end/third_party/lit-html/package/development/static.js.map +1 -1
  180. package/front_end/third_party/lit-html/package/directive-helpers.d.ts +6 -5
  181. package/front_end/third_party/lit-html/package/directive-helpers.d.ts.map +1 -1
  182. package/front_end/third_party/lit-html/package/directive-helpers.js +2 -2
  183. package/front_end/third_party/lit-html/package/directive-helpers.js.map +1 -1
  184. package/front_end/third_party/lit-html/package/directive.d.ts +3 -16
  185. package/front_end/third_party/lit-html/package/directive.d.ts.map +1 -1
  186. package/front_end/third_party/lit-html/package/directive.js +1 -1
  187. package/front_end/third_party/lit-html/package/directive.js.map +1 -1
  188. package/front_end/third_party/lit-html/package/directives/async-append.d.ts +7 -14
  189. package/front_end/third_party/lit-html/package/directives/async-append.d.ts.map +1 -1
  190. package/front_end/third_party/lit-html/package/directives/async-append.js +2 -6
  191. package/front_end/third_party/lit-html/package/directives/async-append.js.map +1 -1
  192. package/front_end/third_party/lit-html/package/directives/async-replace.d.ts +9 -14
  193. package/front_end/third_party/lit-html/package/directives/async-replace.d.ts.map +1 -1
  194. package/front_end/third_party/lit-html/package/directives/async-replace.js +2 -5
  195. package/front_end/third_party/lit-html/package/directives/async-replace.js.map +1 -1
  196. package/front_end/third_party/lit-html/package/directives/cache.d.ts +2 -3
  197. package/front_end/third_party/lit-html/package/directives/cache.d.ts.map +1 -1
  198. package/front_end/third_party/lit-html/package/directives/cache.js +2 -5
  199. package/front_end/third_party/lit-html/package/directives/cache.js.map +1 -1
  200. package/front_end/third_party/lit-html/package/directives/class-map.d.ts +2 -2
  201. package/front_end/third_party/lit-html/package/directives/class-map.d.ts.map +1 -1
  202. package/front_end/third_party/lit-html/package/directives/class-map.js +2 -4
  203. package/front_end/third_party/lit-html/package/directives/class-map.js.map +1 -1
  204. package/front_end/third_party/lit-html/package/directives/guard.d.ts +3 -2
  205. package/front_end/third_party/lit-html/package/directives/guard.d.ts.map +1 -1
  206. package/front_end/third_party/lit-html/package/directives/guard.js +2 -4
  207. package/front_end/third_party/lit-html/package/directives/guard.js.map +1 -1
  208. package/front_end/third_party/lit-html/package/directives/live.d.ts +4 -3
  209. package/front_end/third_party/lit-html/package/directives/live.d.ts.map +1 -1
  210. package/front_end/third_party/lit-html/package/directives/live.js +1 -4
  211. package/front_end/third_party/lit-html/package/directives/live.js.map +1 -1
  212. package/front_end/third_party/lit-html/package/directives/private-async-helpers.d.ts +58 -0
  213. package/front_end/third_party/lit-html/package/directives/private-async-helpers.d.ts.map +1 -0
  214. package/front_end/third_party/lit-html/package/directives/private-async-helpers.js +7 -0
  215. package/front_end/third_party/lit-html/package/directives/private-async-helpers.js.map +1 -0
  216. package/front_end/third_party/lit-html/package/directives/ref.d.ts +14 -11
  217. package/front_end/third_party/lit-html/package/directives/ref.d.ts.map +1 -1
  218. package/front_end/third_party/lit-html/package/directives/ref.js +2 -5
  219. package/front_end/third_party/lit-html/package/directives/ref.js.map +1 -1
  220. package/front_end/third_party/lit-html/package/directives/repeat.d.ts +8 -4
  221. package/front_end/third_party/lit-html/package/directives/repeat.d.ts.map +1 -1
  222. package/front_end/third_party/lit-html/package/directives/repeat.js +2 -5
  223. package/front_end/third_party/lit-html/package/directives/repeat.js.map +1 -1
  224. package/front_end/third_party/lit-html/package/directives/style-map.d.ts +1 -2
  225. package/front_end/third_party/lit-html/package/directives/style-map.d.ts.map +1 -1
  226. package/front_end/third_party/lit-html/package/directives/style-map.js +2 -4
  227. package/front_end/third_party/lit-html/package/directives/style-map.js.map +1 -1
  228. package/front_end/third_party/lit-html/package/directives/template-content.d.ts +1 -2
  229. package/front_end/third_party/lit-html/package/directives/template-content.js +2 -4
  230. package/front_end/third_party/lit-html/package/directives/template-content.js.map +1 -1
  231. package/front_end/third_party/lit-html/package/directives/unsafe-html.d.ts +6 -4
  232. package/front_end/third_party/lit-html/package/directives/unsafe-html.d.ts.map +1 -1
  233. package/front_end/third_party/lit-html/package/directives/unsafe-html.js +2 -4
  234. package/front_end/third_party/lit-html/package/directives/unsafe-html.js.map +1 -1
  235. package/front_end/third_party/lit-html/package/directives/unsafe-svg.d.ts +4 -1
  236. package/front_end/third_party/lit-html/package/directives/unsafe-svg.d.ts.map +1 -1
  237. package/front_end/third_party/lit-html/package/directives/unsafe-svg.js.map +1 -1
  238. package/front_end/third_party/lit-html/package/directives/until.d.ts +12 -8
  239. package/front_end/third_party/lit-html/package/directives/until.d.ts.map +1 -1
  240. package/front_end/third_party/lit-html/package/directives/until.js +2 -6
  241. package/front_end/third_party/lit-html/package/directives/until.js.map +1 -1
  242. package/front_end/third_party/lit-html/package/experimental-hydrate.d.ts.map +1 -1
  243. package/front_end/third_party/lit-html/package/experimental-hydrate.js +2 -5
  244. package/front_end/third_party/lit-html/package/experimental-hydrate.js.map +1 -1
  245. package/front_end/third_party/lit-html/package/lit-html.d.ts +81 -136
  246. package/front_end/third_party/lit-html/package/lit-html.d.ts.map +1 -1
  247. package/front_end/third_party/lit-html/package/lit-html.js +1 -1
  248. package/front_end/third_party/lit-html/package/lit-html.js.map +1 -1
  249. package/front_end/third_party/lit-html/package/package.json +75 -24
  250. package/front_end/third_party/lit-html/package/polyfill-support.d.ts +1 -41
  251. package/front_end/third_party/lit-html/package/polyfill-support.d.ts.map +1 -1
  252. package/front_end/third_party/lit-html/package/polyfill-support.js +1 -1
  253. package/front_end/third_party/lit-html/package/polyfill-support.js.map +1 -1
  254. package/front_end/third_party/lit-html/package/private-ssr-support.d.ts +12 -10
  255. package/front_end/third_party/lit-html/package/private-ssr-support.d.ts.map +1 -1
  256. package/front_end/third_party/lit-html/package/private-ssr-support.js +2 -2
  257. package/front_end/third_party/lit-html/package/private-ssr-support.js.map +1 -1
  258. package/front_end/third_party/lit-html/package/static.d.ts.map +1 -1
  259. package/front_end/third_party/lit-html/package/static.js +1 -1
  260. package/front_end/third_party/lit-html/package/static.js.map +1 -1
  261. package/front_end/third_party/marked/README.chromium +2 -2
  262. package/front_end/third_party/marked/marked.ts +2 -2
  263. package/front_end/third_party/marked/package/README.md +7 -1
  264. package/front_end/third_party/marked/package/bin/marked.js +214 -0
  265. package/front_end/third_party/marked/package/lib/marked.cjs +2907 -0
  266. package/front_end/third_party/marked/package/lib/marked.esm.d.ts +1 -3
  267. package/front_end/third_party/marked/package/lib/marked.esm.js +627 -586
  268. package/front_end/third_party/marked/package/lib/marked.umd.js +2913 -0
  269. package/front_end/third_party/marked/package/man/marked.1 +5 -24
  270. package/front_end/third_party/marked/package/man/marked.1.txt +21 -31
  271. package/front_end/third_party/marked/package/marked.min.js +1 -1
  272. package/front_end/third_party/marked/package/package.json +41 -32
  273. package/front_end/third_party/marked/package/src/Lexer.js +109 -108
  274. package/front_end/third_party/marked/package/src/Parser.js +38 -15
  275. package/front_end/third_party/marked/package/src/Renderer.js +5 -5
  276. package/front_end/third_party/marked/package/src/Slugger.js +2 -2
  277. package/front_end/third_party/marked/package/src/TextRenderer.js +2 -2
  278. package/front_end/third_party/marked/package/src/Tokenizer.js +215 -190
  279. package/front_end/third_party/marked/package/src/defaults.js +6 -9
  280. package/front_end/third_party/marked/package/src/helpers.js +16 -27
  281. package/front_end/third_party/marked/package/src/marked.js +146 -63
  282. package/front_end/third_party/marked/package/src/rules.js +20 -45
  283. package/front_end/third_party/wasmparser/README.chromium +2 -2
  284. package/front_end/third_party/wasmparser/package/.github/workflows/main.yml +47 -0
  285. package/front_end/third_party/wasmparser/package/CHANGELOG.md +12 -0
  286. package/front_end/third_party/wasmparser/package/dist/cjs/WasmParser.js +53 -53
  287. package/front_end/third_party/wasmparser/package/dist/cjs/WasmParser.js.map +1 -1
  288. package/front_end/third_party/wasmparser/package/dist/esm/WasmParser.js +53 -53
  289. package/front_end/third_party/wasmparser/package/dist/esm/WasmParser.js.map +1 -1
  290. package/front_end/third_party/wasmparser/package/package.json +1 -1
  291. package/front_end/third_party/wasmparser/package/src/WasmParser.ts +53 -53
  292. package/front_end/ui/components/adorners/Adorner.ts +14 -14
  293. package/front_end/ui/components/buttons/Button.ts +116 -42
  294. package/front_end/ui/components/data_grid/DataGrid.ts +122 -122
  295. package/front_end/ui/components/data_grid/DataGridController.ts +42 -42
  296. package/front_end/ui/components/diff_view/DiffView.ts +4 -4
  297. package/front_end/ui/components/docs/button/basic.html +3 -0
  298. package/front_end/ui/components/docs/button/basic.ts +16 -0
  299. package/front_end/ui/components/expandable_list/ExpandableList.ts +11 -11
  300. package/front_end/ui/components/icon_button/Icon.ts +24 -21
  301. package/front_end/ui/components/icon_button/IconButton.ts +31 -31
  302. package/front_end/ui/components/issue_counter/IssueCounter.ts +52 -52
  303. package/front_end/ui/components/issue_counter/IssueLinkIcon.ts +42 -42
  304. package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspector.ts +67 -67
  305. package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorController.ts +22 -22
  306. package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorPane.ts +36 -36
  307. package/front_end/ui/components/linear_memory_inspector/LinearMemoryNavigator.ts +19 -19
  308. package/front_end/ui/components/linear_memory_inspector/LinearMemoryValueInterpreter.ts +25 -25
  309. package/front_end/ui/components/linear_memory_inspector/LinearMemoryViewer.ts +52 -52
  310. package/front_end/ui/components/linear_memory_inspector/ValueInterpreterDisplay.ts +21 -21
  311. package/front_end/ui/components/linear_memory_inspector/ValueInterpreterSettings.ts +6 -6
  312. package/front_end/ui/components/markdown_view/MarkdownImage.ts +14 -14
  313. package/front_end/ui/components/markdown_view/MarkdownLink.ts +8 -8
  314. package/front_end/ui/components/markdown_view/MarkdownView.ts +6 -6
  315. package/front_end/ui/components/render_coordinator/RenderCoordinator.ts +33 -33
  316. package/front_end/ui/components/report_view/ReportView.ts +18 -18
  317. package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +53 -53
  318. package/front_end/ui/components/settings/SettingCheckbox.ts +15 -15
  319. package/front_end/ui/components/survey_link/SurveyLink.ts +28 -28
  320. package/front_end/ui/components/text_editor/TextEditor.ts +65 -36
  321. package/front_end/ui/components/text_editor/config.ts +36 -14
  322. package/front_end/ui/components/text_editor/javascript.ts +20 -15
  323. package/front_end/ui/components/text_editor/theme.ts +29 -4
  324. package/front_end/ui/components/text_prompt/TextPrompt.ts +19 -19
  325. package/front_end/ui/components/tree_outline/TreeOutline.ts +56 -56
  326. package/front_end/ui/legacy/Infobar.ts +9 -0
  327. package/front_end/ui/legacy/InspectorView.ts +1 -1
  328. package/front_end/ui/legacy/ViewManager.ts +6 -0
  329. package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +20 -0
  330. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +1 -0
  331. package/front_end/ui/legacy/components/utils/Linkifier.ts +49 -79
  332. package/front_end/ui/legacy/tabbedPane.css +1 -1
  333. package/front_end/ui/legacy/themeColors.css +2 -0
  334. package/inspector_overlay/main.ts +3 -0
  335. package/package.json +1 -1
@@ -55,73 +55,73 @@ const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();
55
55
 
56
56
  export class RequestLinkIcon extends HTMLElement {
57
57
  static readonly litTagName = LitHtml.literal`devtools-request-link-icon`;
58
- private readonly shadow = this.attachShadow({mode: 'open'});
59
- private linkToPreflight?: boolean;
58
+ readonly #shadow = this.attachShadow({mode: 'open'});
59
+ #linkToPreflight?: boolean;
60
60
  // The value `null` indicates that the request is not available,
61
61
  // `undefined` that it is still being resolved.
62
- private request?: SDK.NetworkRequest.NetworkRequest|null;
63
- private highlightHeader?: {section: NetworkForward.UIRequestLocation.UIHeaderSection, name: string};
64
- private requestResolver?: Logs.RequestResolver.RequestResolver;
65
- private displayURL: boolean = false;
66
- private networkTab?: NetworkForward.UIRequestLocation.UIRequestTabs;
67
- private affectedRequest?: {requestId: Protocol.Network.RequestId, url?: string};
68
- private additionalOnClickAction?: () => void;
69
- private reveal = Common.Revealer.reveal;
70
- private requestResolvedPromise = Promise.resolve<void>(undefined);
62
+ #request?: SDK.NetworkRequest.NetworkRequest|null;
63
+ #highlightHeader?: {section: NetworkForward.UIRequestLocation.UIHeaderSection, name: string};
64
+ #requestResolver?: Logs.RequestResolver.RequestResolver;
65
+ #displayURL: boolean = false;
66
+ #networkTab?: NetworkForward.UIRequestLocation.UIRequestTabs;
67
+ #affectedRequest?: {requestId: Protocol.Network.RequestId, url?: string};
68
+ #additionalOnClickAction?: () => void;
69
+ #reveal = Common.Revealer.reveal;
70
+ #requestResolvedPromise = Promise.resolve<void>(undefined);
71
71
 
72
72
  set data(data: RequestLinkIconData) {
73
- this.linkToPreflight = data.linkToPreflight;
74
- this.request = data.request;
73
+ this.#linkToPreflight = data.linkToPreflight;
74
+ this.#request = data.request;
75
75
  if (data.affectedRequest) {
76
- this.affectedRequest = {...data.affectedRequest};
76
+ this.#affectedRequest = {...data.affectedRequest};
77
77
  }
78
- this.highlightHeader = data.highlightHeader;
79
- this.networkTab = data.networkTab;
80
- this.requestResolver = data.requestResolver;
81
- this.displayURL = data.displayURL ?? false;
82
- this.additionalOnClickAction = data.additionalOnClickAction;
78
+ this.#highlightHeader = data.highlightHeader;
79
+ this.#networkTab = data.networkTab;
80
+ this.#requestResolver = data.requestResolver;
81
+ this.#displayURL = data.displayURL ?? false;
82
+ this.#additionalOnClickAction = data.additionalOnClickAction;
83
83
  if (data.revealOverride) {
84
- this.reveal = data.revealOverride;
84
+ this.#reveal = data.revealOverride;
85
85
  }
86
- if (!this.request && data.affectedRequest) {
87
- this.requestResolvedPromise = this.resolveRequest(data.affectedRequest.requestId);
86
+ if (!this.#request && data.affectedRequest) {
87
+ this.#requestResolvedPromise = this.resolveRequest(data.affectedRequest.requestId);
88
88
  }
89
89
  this.render();
90
90
  }
91
91
 
92
92
  connectedCallback(): void {
93
- this.shadow.adoptedStyleSheets = [requestLinkIconStyles];
93
+ this.#shadow.adoptedStyleSheets = [requestLinkIconStyles];
94
94
  }
95
95
 
96
96
  private resolveRequest(requestId: Protocol.Network.RequestId): Promise<void> {
97
- if (!this.requestResolver) {
97
+ if (!this.#requestResolver) {
98
98
  throw new Error('A `RequestResolver` must be provided if an `affectedRequest` is provided.');
99
99
  }
100
- return this.requestResolver.waitFor(requestId)
100
+ return this.#requestResolver.waitFor(requestId)
101
101
  .then(request => {
102
- this.request = request;
102
+ this.#request = request;
103
103
  })
104
104
  .catch(() => {
105
- this.request = null;
105
+ this.#request = null;
106
106
  });
107
107
  }
108
108
 
109
109
  get data(): RequestLinkIconData {
110
110
  return {
111
- linkToPreflight: this.linkToPreflight,
112
- request: this.request,
113
- affectedRequest: this.affectedRequest,
114
- highlightHeader: this.highlightHeader,
115
- networkTab: this.networkTab,
116
- requestResolver: this.requestResolver,
117
- displayURL: this.displayURL,
118
- additionalOnClickAction: this.additionalOnClickAction,
119
- revealOverride: this.reveal !== Common.Revealer.reveal ? this.reveal : undefined,
111
+ linkToPreflight: this.#linkToPreflight,
112
+ request: this.#request,
113
+ affectedRequest: this.#affectedRequest,
114
+ highlightHeader: this.#highlightHeader,
115
+ networkTab: this.#networkTab,
116
+ requestResolver: this.#requestResolver,
117
+ displayURL: this.#displayURL,
118
+ additionalOnClickAction: this.#additionalOnClickAction,
119
+ revealOverride: this.#reveal !== Common.Revealer.reveal ? this.#reveal : undefined,
120
120
  };
121
121
  }
122
122
 
123
123
  private iconColor(): string {
124
- if (!this.request) {
124
+ if (!this.#request) {
125
125
  return '--issue-color-yellow';
126
126
  }
127
127
  return '--color-link';
@@ -140,38 +140,38 @@ export class RequestLinkIcon extends HTMLElement {
140
140
  if (event.button !== 0) {
141
141
  return; // Only handle left-click for now.
142
142
  }
143
- const linkedRequest = this.linkToPreflight ? this.request?.preflightRequest() : this.request;
143
+ const linkedRequest = this.#linkToPreflight ? this.#request?.preflightRequest() : this.#request;
144
144
  if (!linkedRequest) {
145
145
  return;
146
146
  }
147
- if (this.highlightHeader) {
147
+ if (this.#highlightHeader) {
148
148
  const requestLocation = NetworkForward.UIRequestLocation.UIRequestLocation.header(
149
- linkedRequest, this.highlightHeader.section, this.highlightHeader.name);
150
- this.reveal(requestLocation);
149
+ linkedRequest, this.#highlightHeader.section, this.#highlightHeader.name);
150
+ this.#reveal(requestLocation);
151
151
  } else {
152
152
  const requestLocation = NetworkForward.UIRequestLocation.UIRequestLocation.tab(
153
- linkedRequest, this.networkTab ?? NetworkForward.UIRequestLocation.UIRequestTabs.Headers);
154
- this.reveal(requestLocation);
153
+ linkedRequest, this.#networkTab ?? NetworkForward.UIRequestLocation.UIRequestTabs.Headers);
154
+ this.#reveal(requestLocation);
155
155
  }
156
- this.additionalOnClickAction?.();
156
+ this.#additionalOnClickAction?.();
157
157
  }
158
158
 
159
159
  private getTooltip(): Platform.UIString.LocalizedString {
160
- if (this.request) {
161
- return i18nString(UIStrings.clickToShowRequestInTheNetwork, {url: this.request.url()});
160
+ if (this.#request) {
161
+ return i18nString(UIStrings.clickToShowRequestInTheNetwork, {url: this.#request.url()});
162
162
  }
163
163
  return i18nString(UIStrings.requestUnavailableInTheNetwork);
164
164
  }
165
165
 
166
166
  private getUrlForDisplaying(): string|undefined {
167
- if (!this.request) {
168
- return this.affectedRequest?.url;
167
+ if (!this.#request) {
168
+ return this.#affectedRequest?.url;
169
169
  }
170
- return this.request.url();
170
+ return this.#request.url();
171
171
  }
172
172
 
173
173
  private maybeRenderURL(): LitHtml.TemplateResult|{} {
174
- if (!this.displayURL) {
174
+ if (!this.#displayURL) {
175
175
  return LitHtml.nothing;
176
176
  }
177
177
  const url = this.getUrlForDisplaying();
@@ -186,9 +186,9 @@ export class RequestLinkIcon extends HTMLElement {
186
186
  return coordinator.write(() => {
187
187
  // clang-format off
188
188
  LitHtml.render(LitHtml.html`
189
- ${LitHtml.Directives.until(this.requestResolvedPromise.then(() => this.renderComponent()), this.renderComponent())}
189
+ ${LitHtml.Directives.until(this.#requestResolvedPromise.then(() => this.renderComponent()), this.renderComponent())}
190
190
  `,
191
- this.shadow, {host: this});
191
+ this.#shadow, {host: this});
192
192
  // clang-format on
193
193
  });
194
194
  }
@@ -196,7 +196,7 @@ export class RequestLinkIcon extends HTMLElement {
196
196
  private renderComponent(): LitHtml.TemplateResult {
197
197
  // clang-format off
198
198
  return LitHtml.html`
199
- <span class=${LitHtml.Directives.classMap({'link': Boolean(this.request)})}
199
+ <span class=${LitHtml.Directives.classMap({'link': Boolean(this.#request)})}
200
200
  tabindex="0"
201
201
  @click=${this.handleClick}>
202
202
  <${IconButton.Icon.Icon.litTagName} .data=${this.iconData() as IconButton.Icon.IconData}
@@ -22,32 +22,32 @@ export interface SettingCheckboxData {
22
22
  */
23
23
  export class SettingCheckbox extends HTMLElement {
24
24
  static readonly litTagName = LitHtml.literal`setting-checkbox`;
25
- private readonly shadow = this.attachShadow({mode: 'open'});
25
+ readonly #shadow = this.attachShadow({mode: 'open'});
26
26
 
27
- private setting?: Common.Settings.Setting<boolean>;
28
- private disabled: boolean = false;
29
- private changeListenerDescriptor?: Common.EventTarget.EventDescriptor;
27
+ #setting?: Common.Settings.Setting<boolean>;
28
+ #disabled: boolean = false;
29
+ #changeListenerDescriptor?: Common.EventTarget.EventDescriptor;
30
30
 
31
31
  connectedCallback(): void {
32
- this.shadow.adoptedStyleSheets = [settingCheckboxStyles];
32
+ this.#shadow.adoptedStyleSheets = [settingCheckboxStyles];
33
33
  }
34
34
 
35
35
  set data(data: SettingCheckboxData) {
36
- if (this.changeListenerDescriptor && this.setting) {
37
- this.setting.removeChangeListener(this.changeListenerDescriptor.listener);
36
+ if (this.#changeListenerDescriptor && this.#setting) {
37
+ this.#setting.removeChangeListener(this.#changeListenerDescriptor.listener);
38
38
  }
39
39
 
40
- this.setting = data.setting;
41
- this.disabled = Boolean(data.disabled);
40
+ this.#setting = data.setting;
41
+ this.#disabled = Boolean(data.disabled);
42
42
 
43
- this.changeListenerDescriptor = this.setting.addChangeListener(() => {
43
+ this.#changeListenerDescriptor = this.#setting.addChangeListener(() => {
44
44
  this.render();
45
45
  });
46
46
  this.render();
47
47
  }
48
48
 
49
49
  private render(): void {
50
- if (!this.setting) {
50
+ if (!this.#setting) {
51
51
  throw new Error('No "Setting" object provided for rendering');
52
52
  }
53
53
 
@@ -55,15 +55,15 @@ export class SettingCheckbox extends HTMLElement {
55
55
  LitHtml.html`
56
56
  <p>
57
57
  <label>
58
- <input type="checkbox" ?checked=${this.setting.get()} ?disabled=${this.disabled} @change="${
59
- this.checkboxChanged}" aria-label="${this.setting.title()}" /> ${this.setting.title()}
58
+ <input type="checkbox" ?checked=${this.#setting.get()} ?disabled=${this.#disabled} @change="${
59
+ this.checkboxChanged}" aria-label="${this.#setting.title()}" /> ${this.#setting.title()}
60
60
  </label>
61
61
  </p>`,
62
- this.shadow, {host: this});
62
+ this.#shadow, {host: this});
63
63
  }
64
64
 
65
65
  private checkboxChanged(e: Event): void {
66
- this.setting?.set((e.target as HTMLInputElement).checked);
66
+ this.#setting?.set((e.target as HTMLInputElement).checked);
67
67
  }
68
68
  }
69
69
 
@@ -51,74 +51,74 @@ const enum State {
51
51
  export class SurveyLink extends HTMLElement {
52
52
  static readonly litTagName = LitHtml.literal`devtools-survey-link`;
53
53
 
54
- private readonly shadow = this.attachShadow({mode: 'open'});
55
- private trigger = '';
56
- private promptText = Common.UIString.LocalizedEmptyString;
57
- private canShowSurvey: (trigger: string, callback: CanShowSurveyCallback) => void = () => {};
58
- private showSurvey: (trigger: string, callback: ShowSurveyCallback) => void = () => {};
59
- private state: State = State.Checking;
54
+ readonly #shadow = this.attachShadow({mode: 'open'});
55
+ #trigger = '';
56
+ #promptText = Common.UIString.LocalizedEmptyString;
57
+ #canShowSurvey: (trigger: string, callback: CanShowSurveyCallback) => void = () => {};
58
+ #showSurvey: (trigger: string, callback: ShowSurveyCallback) => void = () => {};
59
+ #state: State = State.Checking;
60
60
 
61
61
  connectedCallback(): void {
62
- this.shadow.adoptedStyleSheets = [surveyLinkStyles];
62
+ this.#shadow.adoptedStyleSheets = [surveyLinkStyles];
63
63
  }
64
64
 
65
65
  // Re-setting data will cause the state to go back to 'Checking' which hides the link.
66
66
  set data(data: SurveyLinkData) {
67
- this.trigger = data.trigger;
68
- this.promptText = data.promptText;
69
- this.canShowSurvey = data.canShowSurvey;
70
- this.showSurvey = data.showSurvey;
67
+ this.#trigger = data.trigger;
68
+ this.#promptText = data.promptText;
69
+ this.#canShowSurvey = data.canShowSurvey;
70
+ this.#showSurvey = data.showSurvey;
71
71
 
72
72
  this.checkSurvey();
73
73
  }
74
74
 
75
75
  private checkSurvey(): void {
76
- this.state = State.Checking;
77
- this.canShowSurvey(this.trigger, ({canShowSurvey}) => {
76
+ this.#state = State.Checking;
77
+ this.#canShowSurvey(this.#trigger, ({canShowSurvey}) => {
78
78
  if (!canShowSurvey) {
79
- this.state = State.DontShowLink;
79
+ this.#state = State.DontShowLink;
80
80
  } else {
81
- this.state = State.ShowLink;
81
+ this.#state = State.ShowLink;
82
82
  }
83
83
  this.render();
84
84
  });
85
85
  }
86
86
 
87
87
  private sendSurvey(): void {
88
- this.state = State.Sending;
88
+ this.#state = State.Sending;
89
89
  this.render();
90
- this.showSurvey(this.trigger, ({surveyShown}) => {
90
+ this.#showSurvey(this.#trigger, ({surveyShown}) => {
91
91
  if (!surveyShown) {
92
- this.state = State.Failed;
92
+ this.#state = State.Failed;
93
93
  } else {
94
- this.state = State.SurveyShown;
94
+ this.#state = State.SurveyShown;
95
95
  }
96
96
  this.render();
97
97
  });
98
98
  }
99
99
 
100
100
  private render(): void {
101
- if (this.state === State.Checking || this.state === State.DontShowLink) {
101
+ if (this.#state === State.Checking || this.#state === State.DontShowLink) {
102
102
  return;
103
103
  }
104
104
 
105
- let linkText = this.promptText;
106
- if (this.state === State.Sending) {
105
+ let linkText = this.#promptText;
106
+ if (this.#state === State.Sending) {
107
107
  linkText = i18nString(UIStrings.openingSurvey);
108
- } else if (this.state === State.SurveyShown) {
108
+ } else if (this.#state === State.SurveyShown) {
109
109
  linkText = i18nString(UIStrings.thankYouForYourFeedback);
110
- } else if (this.state === State.Failed) {
110
+ } else if (this.#state === State.Failed) {
111
111
  linkText = i18nString(UIStrings.anErrorOccurredWithTheSurvey);
112
112
  }
113
113
 
114
114
  let linkState = '';
115
- if (this.state === State.Sending) {
115
+ if (this.#state === State.Sending) {
116
116
  linkState = 'pending-link';
117
- } else if (this.state === State.Failed || this.state === State.SurveyShown) {
117
+ } else if (this.#state === State.Failed || this.#state === State.SurveyShown) {
118
118
  linkState = 'disabled-link';
119
119
  }
120
120
 
121
- const ariaDisabled = this.state !== State.ShowLink;
121
+ const ariaDisabled = this.#state !== State.ShowLink;
122
122
 
123
123
  // clang-format off
124
124
  // eslint-disable-next-line rulesdir/ban_style_tags_in_lit_html
@@ -129,7 +129,7 @@ export class SurveyLink extends HTMLElement {
129
129
  </button>
130
130
  `;
131
131
  // clang-format on
132
- LitHtml.render(output, this.shadow, {host: this});
132
+ LitHtml.render(output, this.#shadow, {host: this});
133
133
  }
134
134
  }
135
135
 
@@ -3,6 +3,7 @@
3
3
  // found in the LICENSE file.
4
4
 
5
5
  import * as Common from '../../../core/common/common.js';
6
+ import * as WindowBoundsService from '../../../services/window_bounds/window_bounds.js';
6
7
  import * as CodeMirror from '../../../third_party/codemirror.next/codemirror.next.js';
7
8
  import * as LitHtml from '../../lit-html/lit-html.js';
8
9
  import * as CodeHighlighter from '../code_highlighter/code_highlighter.js';
@@ -20,23 +21,35 @@ declare global {
20
21
  export class TextEditor extends HTMLElement {
21
22
  static readonly litTagName = LitHtml.literal`devtools-text-editor`;
22
23
 
23
- private readonly shadow = this.attachShadow({mode: 'open'});
24
- private activeEditor: CodeMirror.EditorView|undefined = undefined;
25
- private dynamicSettings: readonly DynamicSetting<unknown>[] = DynamicSetting.none;
26
- private activeSettingListeners: [Common.Settings.Setting<unknown>, (event: {data: unknown}) => void][] = [];
27
- private pendingState: CodeMirror.EditorState|undefined;
24
+ readonly #shadow = this.attachShadow({mode: 'open'});
25
+ #activeEditor: CodeMirror.EditorView|undefined = undefined;
26
+ #dynamicSettings: readonly DynamicSetting<unknown>[] = DynamicSetting.none;
27
+ #activeSettingListeners: [Common.Settings.Setting<unknown>, (event: {data: unknown}) => void][] = [];
28
+ #pendingState: CodeMirror.EditorState|undefined;
29
+ #lastScrollPos = {left: 0, top: 0};
30
+ #resizeTimeout = -1;
31
+ #devtoolsResizeObserver = new ResizeObserver(() => {
32
+ if (this.#resizeTimeout < 0) {
33
+ this.#resizeTimeout = window.setTimeout(() => {
34
+ this.#resizeTimeout = -1;
35
+ if (this.#activeEditor) {
36
+ CodeMirror.repositionTooltips(this.#activeEditor);
37
+ }
38
+ }, 50);
39
+ }
40
+ });
28
41
 
29
42
  constructor(pendingState?: CodeMirror.EditorState) {
30
43
  super();
31
- this.pendingState = pendingState;
32
- this.shadow.adoptedStyleSheets = [CodeHighlighter.Style.default];
44
+ this.#pendingState = pendingState;
45
+ this.#shadow.adoptedStyleSheets = [CodeHighlighter.Style.default];
33
46
  }
34
47
 
35
48
  private createEditor(): CodeMirror.EditorView {
36
- this.activeEditor = new CodeMirror.EditorView({
49
+ this.#activeEditor = new CodeMirror.EditorView({
37
50
  state: this.state,
38
- parent: this.shadow,
39
- root: this.shadow,
51
+ parent: this.#shadow,
52
+ root: this.#shadow,
40
53
  dispatch: (tr: CodeMirror.Transaction): void => {
41
54
  this.editor.update([tr]);
42
55
  if (tr.reconfigured) {
@@ -44,12 +57,19 @@ export class TextEditor extends HTMLElement {
44
57
  }
45
58
  },
46
59
  });
60
+ this.#activeEditor.scrollDOM.scrollTop = this.#lastScrollPos.top;
61
+ this.#activeEditor.scrollDOM.scrollLeft = this.#lastScrollPos.left;
62
+ this.#activeEditor.scrollDOM.addEventListener('scroll', (event): void => {
63
+ this.#lastScrollPos.left = (event.target as HTMLElement).scrollLeft;
64
+ this.#lastScrollPos.top = (event.target as HTMLElement).scrollTop;
65
+ });
47
66
  this.ensureSettingListeners();
48
- return this.activeEditor;
67
+ this.startObservingResize();
68
+ return this.#activeEditor;
49
69
  }
50
70
 
51
71
  get editor(): CodeMirror.EditorView {
52
- return this.activeEditor || this.createEditor();
72
+ return this.#activeEditor || this.createEditor();
53
73
  }
54
74
 
55
75
  dispatch(spec: CodeMirror.TransactionSpec): void {
@@ -57,72 +77,81 @@ export class TextEditor extends HTMLElement {
57
77
  }
58
78
 
59
79
  get state(): CodeMirror.EditorState {
60
- if (this.activeEditor) {
61
- return this.activeEditor.state;
80
+ if (this.#activeEditor) {
81
+ return this.#activeEditor.state;
62
82
  }
63
- if (!this.pendingState) {
64
- this.pendingState = CodeMirror.EditorState.create({extensions: baseConfiguration('')});
83
+ if (!this.#pendingState) {
84
+ this.#pendingState = CodeMirror.EditorState.create({extensions: baseConfiguration('')});
65
85
  }
66
- return this.pendingState;
86
+ return this.#pendingState;
67
87
  }
68
88
 
69
89
  set state(state: CodeMirror.EditorState) {
70
- if (this.activeEditor) {
71
- this.activeEditor.setState(state);
90
+ if (this.#activeEditor) {
91
+ this.#activeEditor.setState(state);
72
92
  } else {
73
- this.pendingState = state;
93
+ this.#pendingState = state;
74
94
  }
75
95
  }
76
96
 
77
97
  connectedCallback(): void {
78
- if (!this.activeEditor) {
98
+ if (!this.#activeEditor) {
79
99
  this.createEditor();
80
100
  }
81
101
  }
82
102
 
83
103
  disconnectedCallback(): void {
84
- if (this.activeEditor) {
85
- this.pendingState = this.activeEditor.state;
86
- this.activeEditor.destroy();
87
- this.activeEditor = undefined;
104
+ if (this.#activeEditor) {
105
+ this.#pendingState = this.#activeEditor.state;
106
+ this.#devtoolsResizeObserver.disconnect();
107
+ this.#activeEditor.destroy();
108
+ this.#activeEditor = undefined;
88
109
  this.ensureSettingListeners();
89
110
  }
90
111
  }
91
112
 
92
113
  focus(): void {
93
- if (this.activeEditor) {
94
- this.activeEditor.focus();
114
+ if (this.#activeEditor) {
115
+ this.#activeEditor.focus();
95
116
  }
96
117
  }
97
118
 
98
119
  private ensureSettingListeners(): void {
99
- const dynamicSettings = this.activeEditor ? this.activeEditor.state.facet(dynamicSetting) : DynamicSetting.none;
100
- if (dynamicSettings === this.dynamicSettings) {
120
+ const dynamicSettings = this.#activeEditor ? this.#activeEditor.state.facet(dynamicSetting) : DynamicSetting.none;
121
+ if (dynamicSettings === this.#dynamicSettings) {
101
122
  return;
102
123
  }
103
- this.dynamicSettings = dynamicSettings;
124
+ this.#dynamicSettings = dynamicSettings;
104
125
 
105
- for (const [setting, listener] of this.activeSettingListeners) {
126
+ for (const [setting, listener] of this.#activeSettingListeners) {
106
127
  setting.removeChangeListener(listener);
107
128
  }
108
- this.activeSettingListeners = [];
129
+ this.#activeSettingListeners = [];
109
130
 
110
131
  const settings = Common.Settings.Settings.instance();
111
132
  for (const dynamicSetting of dynamicSettings) {
112
133
  const handler = ({data}: {data: unknown}): void => {
113
134
  const change = dynamicSetting.sync(this.state, data);
114
- if (change && this.activeEditor) {
115
- this.activeEditor.dispatch({effects: change});
135
+ if (change && this.#activeEditor) {
136
+ this.#activeEditor.dispatch({effects: change});
116
137
  }
117
138
  };
118
139
  const setting = settings.moduleSetting(dynamicSetting.settingName);
119
140
  setting.addChangeListener(handler);
120
- this.activeSettingListeners.push([setting, handler]);
141
+ this.#activeSettingListeners.push([setting, handler]);
142
+ }
143
+ }
144
+
145
+ private startObservingResize(): void {
146
+ const devtoolsElement =
147
+ WindowBoundsService.WindowBoundsService.WindowBoundsServiceImpl.instance().getDevToolsBoundingElement();
148
+ if (devtoolsElement) {
149
+ this.#devtoolsResizeObserver.observe(devtoolsElement);
121
150
  }
122
151
  }
123
152
 
124
153
  revealPosition(selection: CodeMirror.EditorSelection, highlight: boolean = true): void {
125
- const view = this.activeEditor;
154
+ const view = this.#activeEditor;
126
155
  if (!view) {
127
156
  return;
128
157
  }
@@ -4,6 +4,7 @@
4
4
 
5
5
  import * as Common from '../../../core/common/common.js';
6
6
  import * as i18n from '../../../core/i18n/i18n.js';
7
+ import * as WindowBoundsService from '../../../services/window_bounds/window_bounds.js';
7
8
  import * as CM from '../../../third_party/codemirror.next/codemirror.next.js';
8
9
  import * as CodeHighlighter from '../code_highlighter/code_highlighter.js';
9
10
 
@@ -68,7 +69,10 @@ export const tabMovesFocus = DynamicSetting.bool('textEditorTabMovesFocus', CM.k
68
69
  shift: (view: CM.EditorView): boolean => view.state.doc.length ? CM.indentLess(view) : false,
69
70
  }]));
70
71
 
71
- export const autocompletion = CM.autocompletion({icons: false});
72
+ export const autocompletion = CM.autocompletion({
73
+ icons: false,
74
+ optionClass: (option: CM.Completion): string => option.type === 'secondary' ? 'cm-secondaryCompletion' : '',
75
+ });
72
76
 
73
77
  export const sourcesAutocompletion = DynamicSetting.bool('textEditorAutocompletion', autocompletion);
74
78
 
@@ -185,7 +189,6 @@ const baseKeymap = CM.keymap.of([
185
189
  {key: 'Mod-d', run: CM.selectNextOccurrence},
186
190
  {key: 'Alt-ArrowLeft', mac: 'Ctrl-ArrowLeft', run: CM.cursorSubwordBackward, shift: CM.selectSubwordBackward},
187
191
  {key: 'Alt-ArrowRight', mac: 'Ctrl-ArrowRight', run: CM.cursorSubwordForward, shift: CM.selectSubwordForward},
188
- ...CM.closeBracketsKeymap,
189
192
  ...CM.standardKeymap,
190
193
  ...CM.historyKeymap,
191
194
  ]);
@@ -201,6 +204,16 @@ export function theme(): CM.Extension {
201
204
  return [editorTheme, themeIsDark() ? dummyDarkTheme : []];
202
205
  }
203
206
 
207
+ let sideBarElement: HTMLElement|null = null;
208
+
209
+ function getTooltipSpace(): DOMRect {
210
+ if (!sideBarElement) {
211
+ sideBarElement =
212
+ WindowBoundsService.WindowBoundsService.WindowBoundsServiceImpl.instance().getDevToolsBoundingElement();
213
+ }
214
+ return sideBarElement.getBoundingClientRect();
215
+ }
216
+
204
217
  export function baseConfiguration(text: string): CM.Extension {
205
218
  return [
206
219
  theme(),
@@ -210,7 +223,6 @@ export function baseConfiguration(text: string): CM.Extension {
210
223
  CM.EditorState.allowMultipleSelections.of(true),
211
224
  CM.indentOnInput(),
212
225
  CodeHighlighter.CodeHighlighter.highlightStyle,
213
- CM.closeBrackets(),
214
226
  baseKeymap,
215
227
  tabMovesFocus.instance(),
216
228
  bracketMatching.instance(),
@@ -218,10 +230,18 @@ export function baseConfiguration(text: string): CM.Extension {
218
230
  CM.Prec.lowest(CM.EditorView.contentAttributes.of({'aria-label': i18nString(UIStrings.codeEditor)})),
219
231
  detectLineSeparator(text),
220
232
  autocompletion,
221
- CM.tooltips({parent: getTooltipHost() as unknown as HTMLElement}),
233
+ CM.tooltips({
234
+ parent: getTooltipHost() as unknown as HTMLElement,
235
+ tooltipSpace: getTooltipSpace,
236
+ }),
222
237
  ];
223
238
  }
224
239
 
240
+ export const closeBrackets: CM.Extension = [
241
+ CM.closeBrackets(),
242
+ CM.keymap.of(CM.closeBracketsKeymap),
243
+ ];
244
+
225
245
  // Root editor tooltips at the top of the document, creating a special
226
246
  // element with the editor styles mounted in it for them. This is
227
247
  // annoying, but necessary because a scrollable parent node clips them
@@ -287,12 +307,16 @@ export const showCompletionHint = CM.ViewPlugin.fromClass(class {
287
307
  }
288
308
 
289
309
  topCompletion(state: CM.EditorState): string|null {
290
- const completions = CM.currentCompletions(state);
291
- if (!completions.length) {
310
+ const completion = CM.selectedCompletion(state);
311
+ if (!completion) {
292
312
  return null;
293
313
  }
294
- const {label} = completions[0];
295
- if (label.length > 100 || label.indexOf('\n') > -1) {
314
+ let {label, apply} = completion;
315
+ if (typeof apply === 'string') {
316
+ label = apply;
317
+ apply = undefined;
318
+ }
319
+ if (apply || label.length > 100 || label.indexOf('\n') > -1 || completion.type === 'secondary') {
296
320
  return null;
297
321
  }
298
322
  const pos = state.selection.main.head;
@@ -300,13 +324,11 @@ export const showCompletionHint = CM.ViewPlugin.fromClass(class {
300
324
  if (pos !== lineBefore.to) {
301
325
  return null;
302
326
  }
303
- const textBefore = lineBefore.text.slice(0, pos - lineBefore.from);
304
- for (let i = label.length - 1; i > 0; i--) {
305
- if (textBefore.endsWith(label.slice(0, i)) && !/\w/.test(textBefore.charAt(textBefore.length - i - 1))) {
306
- return label.slice(i);
307
- }
327
+ const wordBefore = /[\w$]+$/.exec(lineBefore.text);
328
+ if (wordBefore && !label.startsWith(wordBefore[0])) {
329
+ return null;
308
330
  }
309
- return null;
331
+ return label.slice(wordBefore ? wordBefore[0].length : 0);
310
332
  }
311
333
  }, {decorations: p => p.decorations});
312
334