chrome-devtools-frontend 1.0.944427 → 1.0.945677

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 (327) 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 +3 -1
  6. package/front_end/core/i18n/i18nImpl.ts +7 -4
  7. package/front_end/core/i18n/locales/en-US.json +3 -60
  8. package/front_end/core/i18n/locales/en-XL.json +15 -72
  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/CSSStyleSheetHeader.ts +2 -3
  12. package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +2 -3
  13. package/front_end/core/sdk/Cookie.ts +17 -0
  14. package/front_end/core/sdk/CookieModel.ts +1 -0
  15. package/front_end/core/sdk/DebuggerModel.ts +5 -4
  16. package/front_end/core/sdk/NetworkManager.ts +4 -1
  17. package/front_end/core/sdk/NetworkRequest.ts +2 -2
  18. package/front_end/core/sdk/Resource.ts +2 -2
  19. package/front_end/core/sdk/Script.ts +2 -3
  20. package/front_end/entrypoints/main/MainImpl.ts +6 -0
  21. package/front_end/generated/protocol.d.ts +0 -4
  22. package/front_end/models/bindings/BreakpointManager.ts +3 -4
  23. package/front_end/models/bindings/ResourceMapping.ts +1 -2
  24. package/front_end/models/bindings/StylesSourceMapping.ts +1 -2
  25. package/front_end/models/emulation/EmulatedDevices.ts +2 -4
  26. package/front_end/models/persistence/IsolatedFileSystem.ts +7 -6
  27. package/front_end/models/persistence/PersistenceActions.ts +4 -1
  28. package/front_end/models/persistence/PlatformFileSystem.ts +3 -4
  29. package/front_end/models/text_utils/ContentProvider.ts +1 -2
  30. package/front_end/models/text_utils/StaticContentProvider.ts +2 -3
  31. package/front_end/models/timeline_model/TimelineJSProfile.ts +16 -3
  32. package/front_end/models/timeline_model/TimelineModel.ts +1 -0
  33. package/front_end/models/workspace/UISourceCode.ts +2 -2
  34. package/front_end/models/workspace_diff/WorkspaceDiff.ts +20 -6
  35. package/front_end/panels/animation/AnimationTimeline.ts +1 -1
  36. package/front_end/panels/animation/animationTimeline.css +2 -0
  37. package/front_end/panels/application/BackForwardCacheStrings.ts +15 -75
  38. package/front_end/panels/application/BackForwardCacheView.ts +8 -1
  39. package/front_end/panels/application/ReportingApiView.ts +15 -1
  40. package/front_end/panels/application/components/EndpointsGrid.ts +63 -4
  41. package/front_end/panels/application/components/FrameDetailsView.ts +21 -34
  42. package/front_end/panels/changes/ChangesView.ts +8 -7
  43. package/front_end/panels/elements/StyleEditorWidget.ts +7 -7
  44. package/front_end/panels/elements/StylePropertyTreeElement.ts +8 -15
  45. package/front_end/panels/elements/StylesSidebarPane.ts +35 -9
  46. package/front_end/panels/emulation/DeviceModeView.ts +3 -0
  47. package/front_end/panels/help/ReleaseNoteText.ts +3 -1
  48. package/front_end/panels/network/NetworkItemView.ts +7 -1
  49. package/front_end/panels/profiler/heapProfiler.css +2 -5
  50. package/front_end/panels/snippets/ScriptSnippetFileSystem.ts +1 -1
  51. package/front_end/panels/sources/DebuggerPlugin.ts +1 -1
  52. package/front_end/panels/sources/NavigatorView.ts +1 -1
  53. package/front_end/panels/sources/UISourceCodeFrame.ts +0 -1
  54. package/front_end/panels/timeline/TimelineController.ts +3 -0
  55. package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +3 -34
  56. package/front_end/panels/timeline/TimelineUIUtils.ts +51 -3
  57. package/front_end/panels/webauthn/WebauthnPane.ts +31 -32
  58. package/front_end/services/window_bounds/WindowBoundsService.ts +27 -0
  59. package/front_end/services/window_bounds/window_bounds.ts +9 -0
  60. package/front_end/third_party/acorn/README.chromium +2 -2
  61. package/front_end/third_party/acorn/acorn.ts +1 -1
  62. package/front_end/third_party/acorn/package/CHANGELOG.md +31 -1
  63. package/front_end/third_party/acorn/package/README.md +1 -1
  64. package/front_end/third_party/acorn/package/dist/acorn.d.ts +3 -0
  65. package/front_end/third_party/acorn/package/dist/acorn.js +772 -708
  66. package/front_end/third_party/acorn/package/dist/acorn.mjs +767 -703
  67. package/front_end/third_party/acorn/package/dist/bin.js +47 -21
  68. package/front_end/third_party/acorn/package/package.json +1 -1
  69. package/front_end/third_party/acorn-loose/README.chromium +2 -2
  70. package/front_end/third_party/acorn-loose/package/CHANGELOG.md +12 -0
  71. package/front_end/third_party/acorn-loose/package/dist/acorn-loose.js +27 -7
  72. package/front_end/third_party/acorn-loose/package/dist/acorn-loose.mjs +28 -8
  73. package/front_end/third_party/acorn-loose/package/package.json +2 -2
  74. package/front_end/third_party/codemirror.next/bundle.ts +1 -1
  75. package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
  76. package/front_end/third_party/codemirror.next/codemirror.next.d.ts +8 -1
  77. package/front_end/third_party/codemirror.next/codemirror.next.js +1 -1
  78. package/front_end/third_party/codemirror.next/package.json +1 -1
  79. package/front_end/third_party/i18n/i18n-impl.ts +1 -1
  80. package/front_end/third_party/lit-html/README.chromium +2 -2
  81. package/front_end/third_party/lit-html/package/CHANGELOG.md +216 -28
  82. package/front_end/third_party/lit-html/package/LICENSE +9 -9
  83. package/front_end/third_party/lit-html/package/README.md +12 -162
  84. package/front_end/third_party/lit-html/package/async-directive.d.ts +23 -54
  85. package/front_end/third_party/lit-html/package/async-directive.d.ts.map +1 -1
  86. package/front_end/third_party/lit-html/package/async-directive.js +2 -7
  87. package/front_end/third_party/lit-html/package/async-directive.js.map +1 -1
  88. package/front_end/third_party/lit-html/package/development/async-directive.d.ts +23 -54
  89. package/front_end/third_party/lit-html/package/development/async-directive.d.ts.map +1 -1
  90. package/front_end/third_party/lit-html/package/development/async-directive.js +44 -194
  91. package/front_end/third_party/lit-html/package/development/async-directive.js.map +1 -1
  92. package/front_end/third_party/lit-html/package/development/directive-helpers.d.ts +6 -5
  93. package/front_end/third_party/lit-html/package/development/directive-helpers.d.ts.map +1 -1
  94. package/front_end/third_party/lit-html/package/development/directive-helpers.js +25 -9
  95. package/front_end/third_party/lit-html/package/development/directive-helpers.js.map +1 -1
  96. package/front_end/third_party/lit-html/package/development/directive.d.ts +3 -16
  97. package/front_end/third_party/lit-html/package/development/directive.d.ts.map +1 -1
  98. package/front_end/third_party/lit-html/package/development/directive.js +6 -1
  99. package/front_end/third_party/lit-html/package/development/directive.js.map +1 -1
  100. package/front_end/third_party/lit-html/package/development/directives/async-append.d.ts +7 -14
  101. package/front_end/third_party/lit-html/package/development/directives/async-append.d.ts.map +1 -1
  102. package/front_end/third_party/lit-html/package/development/directives/async-append.js +17 -58
  103. package/front_end/third_party/lit-html/package/development/directives/async-append.js.map +1 -1
  104. package/front_end/third_party/lit-html/package/development/directives/async-replace.d.ts +9 -14
  105. package/front_end/third_party/lit-html/package/development/directives/async-replace.d.ts.map +1 -1
  106. package/front_end/third_party/lit-html/package/development/directives/async-replace.js +57 -37
  107. package/front_end/third_party/lit-html/package/development/directives/async-replace.js.map +1 -1
  108. package/front_end/third_party/lit-html/package/development/directives/cache.d.ts +2 -3
  109. package/front_end/third_party/lit-html/package/development/directives/cache.d.ts.map +1 -1
  110. package/front_end/third_party/lit-html/package/development/directives/cache.js +4 -6
  111. package/front_end/third_party/lit-html/package/development/directives/cache.js.map +1 -1
  112. package/front_end/third_party/lit-html/package/development/directives/class-map.d.ts +2 -2
  113. package/front_end/third_party/lit-html/package/development/directives/class-map.d.ts.map +1 -1
  114. package/front_end/third_party/lit-html/package/development/directives/class-map.js +17 -7
  115. package/front_end/third_party/lit-html/package/development/directives/class-map.js.map +1 -1
  116. package/front_end/third_party/lit-html/package/development/directives/guard.d.ts +3 -2
  117. package/front_end/third_party/lit-html/package/development/directives/guard.d.ts.map +1 -1
  118. package/front_end/third_party/lit-html/package/development/directives/guard.js +3 -2
  119. package/front_end/third_party/lit-html/package/development/directives/guard.js.map +1 -1
  120. package/front_end/third_party/lit-html/package/development/directives/live.d.ts +4 -3
  121. package/front_end/third_party/lit-html/package/development/directives/live.d.ts.map +1 -1
  122. package/front_end/third_party/lit-html/package/development/directives/live.js +5 -7
  123. package/front_end/third_party/lit-html/package/development/directives/live.js.map +1 -1
  124. package/front_end/third_party/lit-html/package/development/directives/private-async-helpers.d.ts +58 -0
  125. package/front_end/third_party/lit-html/package/development/directives/private-async-helpers.d.ts.map +1 -0
  126. package/front_end/third_party/lit-html/package/development/directives/private-async-helpers.js +85 -0
  127. package/front_end/third_party/lit-html/package/development/directives/private-async-helpers.js.map +1 -0
  128. package/front_end/third_party/lit-html/package/development/directives/ref.d.ts +14 -11
  129. package/front_end/third_party/lit-html/package/development/directives/ref.d.ts.map +1 -1
  130. package/front_end/third_party/lit-html/package/development/directives/ref.js +13 -11
  131. package/front_end/third_party/lit-html/package/development/directives/ref.js.map +1 -1
  132. package/front_end/third_party/lit-html/package/development/directives/repeat.d.ts +8 -4
  133. package/front_end/third_party/lit-html/package/development/directives/repeat.d.ts.map +1 -1
  134. package/front_end/third_party/lit-html/package/development/directives/repeat.js +23 -9
  135. package/front_end/third_party/lit-html/package/development/directives/repeat.js.map +1 -1
  136. package/front_end/third_party/lit-html/package/development/directives/style-map.d.ts +1 -2
  137. package/front_end/third_party/lit-html/package/development/directives/style-map.d.ts.map +1 -1
  138. package/front_end/third_party/lit-html/package/development/directives/style-map.js +1 -2
  139. package/front_end/third_party/lit-html/package/development/directives/style-map.js.map +1 -1
  140. package/front_end/third_party/lit-html/package/development/directives/template-content.d.ts +1 -2
  141. package/front_end/third_party/lit-html/package/development/directives/template-content.js +1 -2
  142. package/front_end/third_party/lit-html/package/development/directives/unsafe-html.d.ts +6 -4
  143. package/front_end/third_party/lit-html/package/development/directives/unsafe-html.d.ts.map +1 -1
  144. package/front_end/third_party/lit-html/package/development/directives/unsafe-html.js +7 -5
  145. package/front_end/third_party/lit-html/package/development/directives/unsafe-html.js.map +1 -1
  146. package/front_end/third_party/lit-html/package/development/directives/unsafe-svg.d.ts +4 -1
  147. package/front_end/third_party/lit-html/package/development/directives/unsafe-svg.d.ts.map +1 -1
  148. package/front_end/third_party/lit-html/package/development/directives/unsafe-svg.js +3 -0
  149. package/front_end/third_party/lit-html/package/development/directives/unsafe-svg.js.map +1 -1
  150. package/front_end/third_party/lit-html/package/development/directives/until.d.ts +12 -8
  151. package/front_end/third_party/lit-html/package/development/directives/until.d.ts.map +1 -1
  152. package/front_end/third_party/lit-html/package/development/directives/until.js +63 -23
  153. package/front_end/third_party/lit-html/package/development/directives/until.js.map +1 -1
  154. package/front_end/third_party/lit-html/package/development/experimental-hydrate.d.ts.map +1 -1
  155. package/front_end/third_party/lit-html/package/development/experimental-hydrate.js +9 -8
  156. package/front_end/third_party/lit-html/package/development/experimental-hydrate.js.map +1 -1
  157. package/front_end/third_party/lit-html/package/development/lit-html.d.ts +81 -136
  158. package/front_end/third_party/lit-html/package/development/lit-html.d.ts.map +1 -1
  159. package/front_end/third_party/lit-html/package/development/lit-html.js +249 -76
  160. package/front_end/third_party/lit-html/package/development/lit-html.js.map +1 -1
  161. package/front_end/third_party/lit-html/package/development/polyfill-support.d.ts +1 -41
  162. package/front_end/third_party/lit-html/package/development/polyfill-support.d.ts.map +1 -1
  163. package/front_end/third_party/lit-html/package/development/polyfill-support.js +40 -21
  164. package/front_end/third_party/lit-html/package/development/polyfill-support.js.map +1 -1
  165. package/front_end/third_party/lit-html/package/development/private-ssr-support.d.ts +12 -10
  166. package/front_end/third_party/lit-html/package/development/private-ssr-support.d.ts.map +1 -1
  167. package/front_end/third_party/lit-html/package/development/private-ssr-support.js +11 -3
  168. package/front_end/third_party/lit-html/package/development/private-ssr-support.js.map +1 -1
  169. package/front_end/third_party/lit-html/package/development/static.d.ts.map +1 -1
  170. package/front_end/third_party/lit-html/package/development/static.js +6 -5
  171. package/front_end/third_party/lit-html/package/development/static.js.map +1 -1
  172. package/front_end/third_party/lit-html/package/directive-helpers.d.ts +6 -5
  173. package/front_end/third_party/lit-html/package/directive-helpers.d.ts.map +1 -1
  174. package/front_end/third_party/lit-html/package/directive-helpers.js +2 -2
  175. package/front_end/third_party/lit-html/package/directive-helpers.js.map +1 -1
  176. package/front_end/third_party/lit-html/package/directive.d.ts +3 -16
  177. package/front_end/third_party/lit-html/package/directive.d.ts.map +1 -1
  178. package/front_end/third_party/lit-html/package/directive.js +1 -1
  179. package/front_end/third_party/lit-html/package/directive.js.map +1 -1
  180. package/front_end/third_party/lit-html/package/directives/async-append.d.ts +7 -14
  181. package/front_end/third_party/lit-html/package/directives/async-append.d.ts.map +1 -1
  182. package/front_end/third_party/lit-html/package/directives/async-append.js +2 -6
  183. package/front_end/third_party/lit-html/package/directives/async-append.js.map +1 -1
  184. package/front_end/third_party/lit-html/package/directives/async-replace.d.ts +9 -14
  185. package/front_end/third_party/lit-html/package/directives/async-replace.d.ts.map +1 -1
  186. package/front_end/third_party/lit-html/package/directives/async-replace.js +2 -5
  187. package/front_end/third_party/lit-html/package/directives/async-replace.js.map +1 -1
  188. package/front_end/third_party/lit-html/package/directives/cache.d.ts +2 -3
  189. package/front_end/third_party/lit-html/package/directives/cache.d.ts.map +1 -1
  190. package/front_end/third_party/lit-html/package/directives/cache.js +2 -5
  191. package/front_end/third_party/lit-html/package/directives/cache.js.map +1 -1
  192. package/front_end/third_party/lit-html/package/directives/class-map.d.ts +2 -2
  193. package/front_end/third_party/lit-html/package/directives/class-map.d.ts.map +1 -1
  194. package/front_end/third_party/lit-html/package/directives/class-map.js +2 -4
  195. package/front_end/third_party/lit-html/package/directives/class-map.js.map +1 -1
  196. package/front_end/third_party/lit-html/package/directives/guard.d.ts +3 -2
  197. package/front_end/third_party/lit-html/package/directives/guard.d.ts.map +1 -1
  198. package/front_end/third_party/lit-html/package/directives/guard.js +2 -4
  199. package/front_end/third_party/lit-html/package/directives/guard.js.map +1 -1
  200. package/front_end/third_party/lit-html/package/directives/live.d.ts +4 -3
  201. package/front_end/third_party/lit-html/package/directives/live.d.ts.map +1 -1
  202. package/front_end/third_party/lit-html/package/directives/live.js +1 -4
  203. package/front_end/third_party/lit-html/package/directives/live.js.map +1 -1
  204. package/front_end/third_party/lit-html/package/directives/private-async-helpers.d.ts +58 -0
  205. package/front_end/third_party/lit-html/package/directives/private-async-helpers.d.ts.map +1 -0
  206. package/front_end/third_party/lit-html/package/directives/private-async-helpers.js +7 -0
  207. package/front_end/third_party/lit-html/package/directives/private-async-helpers.js.map +1 -0
  208. package/front_end/third_party/lit-html/package/directives/ref.d.ts +14 -11
  209. package/front_end/third_party/lit-html/package/directives/ref.d.ts.map +1 -1
  210. package/front_end/third_party/lit-html/package/directives/ref.js +2 -5
  211. package/front_end/third_party/lit-html/package/directives/ref.js.map +1 -1
  212. package/front_end/third_party/lit-html/package/directives/repeat.d.ts +8 -4
  213. package/front_end/third_party/lit-html/package/directives/repeat.d.ts.map +1 -1
  214. package/front_end/third_party/lit-html/package/directives/repeat.js +2 -5
  215. package/front_end/third_party/lit-html/package/directives/repeat.js.map +1 -1
  216. package/front_end/third_party/lit-html/package/directives/style-map.d.ts +1 -2
  217. package/front_end/third_party/lit-html/package/directives/style-map.d.ts.map +1 -1
  218. package/front_end/third_party/lit-html/package/directives/style-map.js +2 -4
  219. package/front_end/third_party/lit-html/package/directives/style-map.js.map +1 -1
  220. package/front_end/third_party/lit-html/package/directives/template-content.d.ts +1 -2
  221. package/front_end/third_party/lit-html/package/directives/template-content.js +2 -4
  222. package/front_end/third_party/lit-html/package/directives/template-content.js.map +1 -1
  223. package/front_end/third_party/lit-html/package/directives/unsafe-html.d.ts +6 -4
  224. package/front_end/third_party/lit-html/package/directives/unsafe-html.d.ts.map +1 -1
  225. package/front_end/third_party/lit-html/package/directives/unsafe-html.js +2 -4
  226. package/front_end/third_party/lit-html/package/directives/unsafe-html.js.map +1 -1
  227. package/front_end/third_party/lit-html/package/directives/unsafe-svg.d.ts +4 -1
  228. package/front_end/third_party/lit-html/package/directives/unsafe-svg.d.ts.map +1 -1
  229. package/front_end/third_party/lit-html/package/directives/unsafe-svg.js.map +1 -1
  230. package/front_end/third_party/lit-html/package/directives/until.d.ts +12 -8
  231. package/front_end/third_party/lit-html/package/directives/until.d.ts.map +1 -1
  232. package/front_end/third_party/lit-html/package/directives/until.js +2 -6
  233. package/front_end/third_party/lit-html/package/directives/until.js.map +1 -1
  234. package/front_end/third_party/lit-html/package/experimental-hydrate.d.ts.map +1 -1
  235. package/front_end/third_party/lit-html/package/experimental-hydrate.js +2 -5
  236. package/front_end/third_party/lit-html/package/experimental-hydrate.js.map +1 -1
  237. package/front_end/third_party/lit-html/package/lit-html.d.ts +81 -136
  238. package/front_end/third_party/lit-html/package/lit-html.d.ts.map +1 -1
  239. package/front_end/third_party/lit-html/package/lit-html.js +1 -1
  240. package/front_end/third_party/lit-html/package/lit-html.js.map +1 -1
  241. package/front_end/third_party/lit-html/package/package.json +75 -24
  242. package/front_end/third_party/lit-html/package/polyfill-support.d.ts +1 -41
  243. package/front_end/third_party/lit-html/package/polyfill-support.d.ts.map +1 -1
  244. package/front_end/third_party/lit-html/package/polyfill-support.js +1 -1
  245. package/front_end/third_party/lit-html/package/polyfill-support.js.map +1 -1
  246. package/front_end/third_party/lit-html/package/private-ssr-support.d.ts +12 -10
  247. package/front_end/third_party/lit-html/package/private-ssr-support.d.ts.map +1 -1
  248. package/front_end/third_party/lit-html/package/private-ssr-support.js +2 -2
  249. package/front_end/third_party/lit-html/package/private-ssr-support.js.map +1 -1
  250. package/front_end/third_party/lit-html/package/static.d.ts.map +1 -1
  251. package/front_end/third_party/lit-html/package/static.js +1 -1
  252. package/front_end/third_party/lit-html/package/static.js.map +1 -1
  253. package/front_end/third_party/marked/README.chromium +2 -2
  254. package/front_end/third_party/marked/marked.ts +2 -2
  255. package/front_end/third_party/marked/package/README.md +7 -1
  256. package/front_end/third_party/marked/package/bin/marked.js +214 -0
  257. package/front_end/third_party/marked/package/lib/marked.cjs +2907 -0
  258. package/front_end/third_party/marked/package/lib/marked.esm.d.ts +1 -3
  259. package/front_end/third_party/marked/package/lib/marked.esm.js +627 -586
  260. package/front_end/third_party/marked/package/lib/marked.umd.js +2913 -0
  261. package/front_end/third_party/marked/package/man/marked.1 +5 -24
  262. package/front_end/third_party/marked/package/man/marked.1.txt +21 -31
  263. package/front_end/third_party/marked/package/marked.min.js +1 -1
  264. package/front_end/third_party/marked/package/package.json +41 -32
  265. package/front_end/third_party/marked/package/src/Lexer.js +109 -108
  266. package/front_end/third_party/marked/package/src/Parser.js +38 -15
  267. package/front_end/third_party/marked/package/src/Renderer.js +5 -5
  268. package/front_end/third_party/marked/package/src/Slugger.js +2 -2
  269. package/front_end/third_party/marked/package/src/TextRenderer.js +2 -2
  270. package/front_end/third_party/marked/package/src/Tokenizer.js +215 -190
  271. package/front_end/third_party/marked/package/src/defaults.js +6 -9
  272. package/front_end/third_party/marked/package/src/helpers.js +16 -27
  273. package/front_end/third_party/marked/package/src/marked.js +146 -63
  274. package/front_end/third_party/marked/package/src/rules.js +20 -45
  275. package/front_end/third_party/wasmparser/README.chromium +2 -2
  276. package/front_end/third_party/wasmparser/package/.github/workflows/main.yml +47 -0
  277. package/front_end/third_party/wasmparser/package/CHANGELOG.md +12 -0
  278. package/front_end/third_party/wasmparser/package/dist/cjs/WasmParser.js +53 -53
  279. package/front_end/third_party/wasmparser/package/dist/cjs/WasmParser.js.map +1 -1
  280. package/front_end/third_party/wasmparser/package/dist/esm/WasmParser.js +53 -53
  281. package/front_end/third_party/wasmparser/package/dist/esm/WasmParser.js.map +1 -1
  282. package/front_end/third_party/wasmparser/package/package.json +1 -1
  283. package/front_end/third_party/wasmparser/package/src/WasmParser.ts +53 -53
  284. package/front_end/ui/components/adorners/Adorner.ts +14 -14
  285. package/front_end/ui/components/buttons/Button.ts +133 -42
  286. package/front_end/ui/components/buttons/button.css +31 -0
  287. package/front_end/ui/components/data_grid/DataGrid.ts +131 -122
  288. package/front_end/ui/components/data_grid/DataGridController.ts +42 -42
  289. package/front_end/ui/components/diff_view/DiffView.ts +4 -4
  290. package/front_end/ui/components/docs/button/basic.html +3 -0
  291. package/front_end/ui/components/docs/button/basic.ts +58 -0
  292. package/front_end/ui/components/expandable_list/ExpandableList.ts +11 -11
  293. package/front_end/ui/components/icon_button/Icon.ts +24 -21
  294. package/front_end/ui/components/icon_button/IconButton.ts +31 -31
  295. package/front_end/ui/components/issue_counter/IssueCounter.ts +52 -52
  296. package/front_end/ui/components/issue_counter/IssueLinkIcon.ts +42 -42
  297. package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspector.ts +67 -67
  298. package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorController.ts +22 -22
  299. package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorPane.ts +36 -36
  300. package/front_end/ui/components/linear_memory_inspector/LinearMemoryNavigator.ts +19 -19
  301. package/front_end/ui/components/linear_memory_inspector/LinearMemoryValueInterpreter.ts +25 -25
  302. package/front_end/ui/components/linear_memory_inspector/LinearMemoryViewer.ts +52 -52
  303. package/front_end/ui/components/linear_memory_inspector/ValueInterpreterDisplay.ts +21 -21
  304. package/front_end/ui/components/linear_memory_inspector/ValueInterpreterSettings.ts +6 -6
  305. package/front_end/ui/components/markdown_view/MarkdownImage.ts +14 -14
  306. package/front_end/ui/components/markdown_view/MarkdownLink.ts +8 -8
  307. package/front_end/ui/components/markdown_view/MarkdownView.ts +6 -6
  308. package/front_end/ui/components/render_coordinator/RenderCoordinator.ts +33 -33
  309. package/front_end/ui/components/report_view/ReportView.ts +18 -18
  310. package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +53 -53
  311. package/front_end/ui/components/settings/SettingCheckbox.ts +15 -15
  312. package/front_end/ui/components/survey_link/SurveyLink.ts +28 -28
  313. package/front_end/ui/components/text_editor/TextEditor.ts +68 -36
  314. package/front_end/ui/components/text_editor/config.ts +4 -2
  315. package/front_end/ui/components/text_editor/javascript.ts +6 -6
  316. package/front_end/ui/components/text_prompt/TextPrompt.ts +19 -19
  317. package/front_end/ui/components/tree_outline/TreeOutline.ts +56 -56
  318. package/front_end/ui/legacy/Infobar.ts +9 -0
  319. package/front_end/ui/legacy/InspectorView.ts +1 -1
  320. package/front_end/ui/legacy/ListWidget.ts +2 -2
  321. package/front_end/ui/legacy/ViewManager.ts +6 -0
  322. package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +20 -0
  323. package/front_end/ui/legacy/tabbedPane.css +1 -1
  324. package/inspector_overlay/main.ts +3 -0
  325. package/package.json +1 -1
  326. package/scripts/eslint_rules/lib/l10n_filename_matches.js +17 -4
  327. package/scripts/eslint_rules/tests/l10n_filename_matches_test.js +21 -0
@@ -1 +1 @@
1
- {"version":3,"file":"polyfill-support.js","sources":["src/polyfill-support.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * lit-html patch to support browsers without native web components.\n *\n * This module should be used in addition to loading the web components\n * polyfills via @webcomponents/webcomponentjs. When using those polyfills\n * support for polyfilled Shadow DOM is automatic via the ShadyDOM polyfill.\n * Scoping classes are added to DOM nodes to facilitate CSS scoping that\n * simulates the style scoping Shadow DOM provides. ShadyDOM does this scoping\n * to all elements added to the DOM. This module provides an important\n * optimization for this process by pre-scoping lit-html template\n * DOM. This means ShadyDOM does not have to scope each instance of the\n * template DOM. Instead, each template is scoped only once.\n *\n * Creating scoped CSS is not covered by this module. It is, however, integrated\n * into the lit-element and @lit/reactive-element packages. See the ShadyCSS docs\n * for how to apply scoping to CSS:\n * https://github.com/webcomponents/polyfills/tree/master/packages/shadycss#usage.\n *\n * @packageDocumentation\n */\n\ninterface RenderOptions {\n readonly renderBefore?: ChildNode | null;\n scope?: string;\n}\n\ninterface ShadyTemplateResult {\n strings: TemplateStringsArray;\n _$litType$?: string;\n}\n\n// Note, this is a dummy type as the full type here is big.\ninterface Directive {\n __directive?: Directive;\n}\n\ninterface DirectiveParent {\n _$parent?: DirectiveParent;\n __directive?: Directive;\n __directives?: Array<Directive | undefined>;\n}\n\ninterface PatchableChildPartConstructor {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-misused-new\n new (...args: any[]): PatchableChildPart;\n}\n\ninterface PatchableChildPart {\n __directive?: Directive;\n _$committedValue: unknown;\n _$startNode: ChildNode;\n _$endNode: ChildNode | null;\n options: RenderOptions;\n _$setValue(value: unknown, directiveParent: DirectiveParent): void;\n _$getTemplate(result: ShadyTemplateResult): HTMLTemplateElement;\n}\n\ninterface PatchableTemplate {\n el: HTMLTemplateElement;\n}\n\ninterface PatchableTemplateConstructor {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-misused-new\n new (...args: any[]): PatchableTemplate;\n createElement(html: string, options?: RenderOptions): HTMLTemplateElement;\n}\n\ninterface PatchableTemplateInstance {\n _$template: PatchableTemplate;\n}\n\n// Scopes that have had styling prepared. Note, must only be done once per\n// scope.\nconst styledScopes: Set<string> = new Set();\n// Map of css per scope. This is collected during first scope render, used when\n// styling is prepared, and then discarded.\nconst scopeCssStore: Map<string, string[]> = new Map();\n\nconst ENABLE_SHADYDOM_NOPATCH = true;\n\n/**\n * lit-html patches. These properties cannot be renamed.\n * * ChildPart.prototype._$getTemplate\n * * ChildPart.prototype._$setValue\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n(globalThis as any)['litHtmlPlatformSupport'] ??= (\n Template: PatchableTemplateConstructor,\n ChildPart: PatchableChildPartConstructor\n) => {\n // polyfill-support is only needed if ShadyCSS or the ApplyShim is in use\n // We test at the point of patching, which makes it safe to load\n // webcomponentsjs and polyfill-support in either order\n if (\n window.ShadyCSS === undefined ||\n (window.ShadyCSS.nativeShadow && !window.ShadyCSS.ApplyShim)\n ) {\n return;\n }\n\n // console.log(\n // '%c Making lit-html compatible with ShadyDOM/CSS.',\n // 'color: lightgreen; font-style: italic'\n // );\n\n const wrap =\n ENABLE_SHADYDOM_NOPATCH &&\n window.ShadyDOM?.inUse &&\n window.ShadyDOM?.noPatch === true\n ? window.ShadyDOM!.wrap\n : (node: Node) => node;\n\n const needsPrepareStyles = (name: string | undefined) =>\n name !== undefined && !styledScopes.has(name);\n\n const cssForScope = (name: string) => {\n let scopeCss = scopeCssStore.get(name);\n if (scopeCss === undefined) {\n scopeCssStore.set(name, (scopeCss = []));\n }\n return scopeCss;\n };\n\n const prepareStyles = (name: string, template: HTMLTemplateElement) => {\n // Get styles\n const scopeCss = cssForScope(name);\n const hasScopeCss = scopeCss.length !== 0;\n if (hasScopeCss) {\n const style = document.createElement('style');\n style.textContent = scopeCss.join('\\n');\n // Note, it's important to add the style to the *end* of the template so\n // it doesn't mess up part indices.\n template.content.appendChild(style);\n }\n // Mark this scope as styled.\n styledScopes.add(name);\n // Remove stored data since it's no longer needed.\n scopeCssStore.delete(name);\n // ShadyCSS removes scopes and removes the style under ShadyDOM and leaves\n // it under native Shadow DOM\n window.ShadyCSS!.prepareTemplateStyles(template, name);\n // Note, under native Shadow DOM, the style is added to the beginning of the\n // template. It must be moved to the *end* of the template so it doesn't\n // mess up part indices.\n if (hasScopeCss && window.ShadyCSS!.nativeShadow) {\n template.content.appendChild(template.content.querySelector('style')!);\n }\n };\n\n const scopedTemplateCache = new Map<\n string | undefined,\n Map<TemplateStringsArray, PatchableTemplate>\n >();\n\n /**\n * Override to extract style elements from the template\n * and store all style.textContent in the shady scope data.\n * Note, it's ok to patch Template since it's only used via ChildPart.\n */\n const originalCreateElement = Template.createElement;\n Template.createElement = function (html: string, options?: RenderOptions) {\n const element = originalCreateElement.call(Template, html, options);\n const scope = options?.scope;\n if (scope !== undefined) {\n if (!window.ShadyCSS!.nativeShadow) {\n window.ShadyCSS!.prepareTemplateDom(element, scope);\n }\n const scopeCss = cssForScope(scope);\n // Remove styles and store textContent.\n const styles = element.content.querySelectorAll(\n 'style'\n ) as NodeListOf<HTMLStyleElement>;\n // Store the css in this template in the scope css and remove the <style>\n // from the template _before_ the node-walk captures part indices\n scopeCss.push(\n ...Array.from(styles).map((style) => {\n style.parentNode?.removeChild(style);\n return style.textContent!;\n })\n );\n }\n return element;\n };\n\n const renderContainer = document.createDocumentFragment();\n const renderContainerMarker = document.createComment('');\n\n const childPartProto = ChildPart.prototype;\n /**\n * Patch to apply gathered css via ShadyCSS. This is done only once per scope.\n */\n const setValue = childPartProto._$setValue;\n childPartProto._$setValue = function (\n this: PatchableChildPart,\n value: unknown,\n directiveParent: DirectiveParent = this\n ) {\n const container = wrap(this._$startNode).parentNode!;\n const scope = this.options?.scope;\n if (container instanceof ShadowRoot && needsPrepareStyles(scope)) {\n // Note, @apply requires outer => inner scope rendering on initial\n // scope renders to apply property values correctly. Style preparation\n // is tied to rendering into `shadowRoot`'s and this is typically done by\n // custom elements. If this is done in `connectedCallback`, as is typical,\n // the code below ensures the right order since content is rendered\n // into a fragment first so the hosting element can prepare styles first.\n // If rendering is done in the constructor, this won't work, but that's\n // not supported in ShadyDOM anyway.\n const startNode = this._$startNode;\n const endNode = this._$endNode;\n\n // Temporarily move this part into the renderContainer.\n renderContainer.appendChild(renderContainerMarker);\n this._$startNode = renderContainerMarker;\n this._$endNode = null;\n\n // Note, any nested template results render here and their styles will\n // be extracted and collected.\n setValue.call(this, value, directiveParent);\n\n // Get the template for this result or create a dummy one if a result\n // is not being rendered.\n const template = (value as ShadyTemplateResult)?._$litType$\n ? (this._$committedValue as PatchableTemplateInstance)._$template.el\n : document.createElement('template');\n prepareStyles(scope!, template);\n\n // Note, this is the temporary startNode.\n renderContainer.removeChild(renderContainerMarker);\n // When using native Shadow DOM, include prepared style in shadowRoot.\n if (window.ShadyCSS?.nativeShadow) {\n const style = template.content.querySelector('style');\n if (style !== null) {\n renderContainer.appendChild(style.cloneNode(true));\n }\n }\n container.insertBefore(renderContainer, endNode);\n // Move part back to original container.\n this._$startNode = startNode;\n this._$endNode = endNode;\n } else {\n setValue.call(this, value, directiveParent);\n }\n };\n\n /**\n * Patch ChildPart._$getTemplate to look up templates in a cache bucketed\n * by element name.\n */\n childPartProto._$getTemplate = function (\n this: PatchableChildPart,\n result: ShadyTemplateResult\n ) {\n const scope = this.options?.scope;\n let templateCache = scopedTemplateCache.get(scope);\n if (templateCache === undefined) {\n scopedTemplateCache.set(scope, (templateCache = new Map()));\n }\n let template = templateCache.get(result.strings);\n if (template === undefined) {\n templateCache.set(\n result.strings,\n (template = new Template(result, this.options))\n );\n }\n return template;\n };\n};\n\nif (ENABLE_SHADYDOM_NOPATCH) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-misused-new\n (globalThis as any)[\n 'litHtmlPlatformSupport'\n ].noPatchSupported = ENABLE_SHADYDOM_NOPATCH;\n}\n"],"names":["styledScopes","Set","scopeCssStore","Map","globalThis","Template","ChildPart","undefined","window","ShadyCSS","nativeShadow","ApplyShim","cssForScope","name","scopeCss","get","set","scopedTemplateCache","originalCreateElement","createElement","html","options","element","call","scope","prepareTemplateDom","styles","content","querySelectorAll","push","Array","from","map","style","parentNode","removeChild","textContent","renderContainer","document","createDocumentFragment","renderContainerMarker","createComment","childPartProto","prototype","setValue","_$setValue","value","directiveParent","container","this","_$startNode","ShadowRoot","has","startNode","endNode","_$endNode","appendChild","template","_$litType$","_$committedValue","_$template","el","hasScopeCss","length","join","add","delete","prepareTemplateStyles","querySelector","prepareStyles","cloneNode","insertBefore","_$getTemplate","result","templateCache","strings"],"mappings":"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"}
1
+ {"version":3,"file":"polyfill-support.js","sources":["src/polyfill-support.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * lit-html patch to support browsers without native web components.\n *\n * This module should be used in addition to loading the web components\n * polyfills via @webcomponents/webcomponentjs. When using those polyfills\n * support for polyfilled Shadow DOM is automatic via the ShadyDOM polyfill.\n * Scoping classes are added to DOM nodes to facilitate CSS scoping that\n * simulates the style scoping Shadow DOM provides. ShadyDOM does this scoping\n * to all elements added to the DOM. This module provides an important\n * optimization for this process by pre-scoping lit-html template\n * DOM. This means ShadyDOM does not have to scope each instance of the\n * template DOM. Instead, each template is scoped only once.\n *\n * Creating scoped CSS is not covered by this module. It is, however, integrated\n * into the lit-element and @lit/reactive-element packages. See the ShadyCSS docs\n * for how to apply scoping to CSS:\n * https://github.com/webcomponents/polyfills/tree/master/packages/shadycss#usage.\n *\n * @packageDocumentation\n */\n\nexport {};\n\ninterface RenderOptions {\n readonly renderBefore?: ChildNode | null;\n scope?: string;\n}\n\ninterface ShadyTemplateResult {\n strings: TemplateStringsArray;\n // This property needs to remain unminified.\n ['_$litType$']?: string;\n}\n\n// Note, this is a dummy type as the full type here is big.\ninterface Directive {\n __directive?: Directive;\n}\n\ninterface DirectiveParent {\n _$parent?: DirectiveParent;\n __directive?: Directive;\n __directives?: Array<Directive | undefined>;\n}\n\ninterface PatchableChildPartConstructor {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-misused-new\n new (...args: any[]): PatchableChildPart;\n}\n\ninterface PatchableChildPart {\n __directive?: Directive;\n _$committedValue: unknown;\n _$startNode: ChildNode;\n _$endNode: ChildNode | null;\n options: RenderOptions;\n _$setValue(value: unknown, directiveParent: DirectiveParent): void;\n _$getTemplate(result: ShadyTemplateResult): HTMLTemplateElement;\n}\n\ninterface PatchableTemplate {\n el: HTMLTemplateElement;\n}\n\ninterface PatchableTemplateConstructor {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-misused-new\n new (...args: any[]): PatchableTemplate;\n createElement(html: string, options?: RenderOptions): HTMLTemplateElement;\n}\n\ninterface PatchableTemplateInstance {\n _$template: PatchableTemplate;\n}\n\n// Scopes that have had styling prepared. Note, must only be done once per\n// scope.\nconst styledScopes: Set<string> = new Set();\n// Map of css per scope. This is collected during first scope render, used when\n// styling is prepared, and then discarded.\nconst scopeCssStore: Map<string, string[]> = new Map();\n\nconst ENABLE_SHADYDOM_NOPATCH = true;\n\n// Note, explicitly use `var` here so that this can be re-defined when\n// bundled.\n// eslint-disable-next-line no-var\nvar DEV_MODE = true;\n\n/**\n * lit-html patches. These properties cannot be renamed.\n * * ChildPart.prototype._$getTemplate\n * * ChildPart.prototype._$setValue\n */\nconst polyfillSupport: NonNullable<typeof litHtmlPolyfillSupport> = (\n Template: PatchableTemplateConstructor,\n ChildPart: PatchableChildPartConstructor\n) => {\n // polyfill-support is only needed if ShadyCSS or the ApplyShim is in use\n // We test at the point of patching, which makes it safe to load\n // webcomponentsjs and polyfill-support in either order\n if (\n window.ShadyCSS === undefined ||\n (window.ShadyCSS.nativeShadow && !window.ShadyCSS.ApplyShim)\n ) {\n return;\n }\n\n // console.log(\n // '%c Making lit-html compatible with ShadyDOM/CSS.',\n // 'color: lightgreen; font-style: italic'\n // );\n\n const wrap =\n ENABLE_SHADYDOM_NOPATCH &&\n window.ShadyDOM?.inUse &&\n window.ShadyDOM?.noPatch === true\n ? window.ShadyDOM!.wrap\n : (node: Node) => node;\n\n const needsPrepareStyles = (name: string | undefined) =>\n name !== undefined && !styledScopes.has(name);\n\n const cssForScope = (name: string) => {\n let scopeCss = scopeCssStore.get(name);\n if (scopeCss === undefined) {\n scopeCssStore.set(name, (scopeCss = []));\n }\n return scopeCss;\n };\n\n const prepareStyles = (name: string, template: HTMLTemplateElement) => {\n // Get styles\n const scopeCss = cssForScope(name);\n const hasScopeCss = scopeCss.length !== 0;\n if (hasScopeCss) {\n const style = document.createElement('style');\n style.textContent = scopeCss.join('\\n');\n // Note, it's important to add the style to the *end* of the template so\n // it doesn't mess up part indices.\n template.content.appendChild(style);\n }\n // Mark this scope as styled.\n styledScopes.add(name);\n // Remove stored data since it's no longer needed.\n scopeCssStore.delete(name);\n // ShadyCSS removes scopes and removes the style under ShadyDOM and leaves\n // it under native Shadow DOM\n window.ShadyCSS!.prepareTemplateStyles(template, name);\n // Note, under native Shadow DOM, the style is added to the beginning of the\n // template. It must be moved to the *end* of the template so it doesn't\n // mess up part indices.\n if (hasScopeCss && window.ShadyCSS!.nativeShadow) {\n // If there were styles but the CSS text was empty, ShadyCSS will\n // eliminate the style altogether, so the style here could be null\n const style = template.content.querySelector('style');\n if (style !== null) {\n template.content.appendChild(style);\n }\n }\n };\n\n const scopedTemplateCache = new Map<\n string | undefined,\n Map<TemplateStringsArray, PatchableTemplate>\n >();\n\n /**\n * Override to extract style elements from the template\n * and store all style.textContent in the shady scope data.\n * Note, it's ok to patch Template since it's only used via ChildPart.\n */\n const originalCreateElement = Template.createElement;\n Template.createElement = function (html: string, options?: RenderOptions) {\n const element = originalCreateElement.call(Template, html, options);\n const scope = options?.scope;\n if (scope !== undefined) {\n if (!window.ShadyCSS!.nativeShadow) {\n window.ShadyCSS!.prepareTemplateDom(element, scope);\n }\n // Process styles only if this scope is being prepared. Otherwise,\n // leave styles as is for back compat with Lit1.\n if (needsPrepareStyles(scope)) {\n const scopeCss = cssForScope(scope);\n // Remove styles and store textContent.\n const styles = element.content.querySelectorAll(\n 'style'\n ) as NodeListOf<HTMLStyleElement>;\n // Store the css in this template in the scope css and remove the <style>\n // from the template _before_ the node-walk captures part indices\n scopeCss.push(\n ...Array.from(styles).map((style) => {\n style.parentNode?.removeChild(style);\n return style.textContent!;\n })\n );\n }\n }\n return element;\n };\n\n const renderContainer = document.createDocumentFragment();\n const renderContainerMarker = document.createComment('');\n\n const childPartProto = ChildPart.prototype;\n /**\n * Patch to apply gathered css via ShadyCSS. This is done only once per scope.\n */\n const setValue = childPartProto._$setValue;\n childPartProto._$setValue = function (\n this: PatchableChildPart,\n value: unknown,\n directiveParent: DirectiveParent = this\n ) {\n const container = wrap(this._$startNode).parentNode!;\n const scope = this.options?.scope;\n if (container instanceof ShadowRoot && needsPrepareStyles(scope)) {\n // Note, @apply requires outer => inner scope rendering on initial\n // scope renders to apply property values correctly. Style preparation\n // is tied to rendering into `shadowRoot`'s and this is typically done by\n // custom elements. If this is done in `connectedCallback`, as is typical,\n // the code below ensures the right order since content is rendered\n // into a fragment first so the hosting element can prepare styles first.\n // If rendering is done in the constructor, this won't work, but that's\n // not supported in ShadyDOM anyway.\n const startNode = this._$startNode;\n const endNode = this._$endNode;\n\n // Temporarily move this part into the renderContainer.\n renderContainer.appendChild(renderContainerMarker);\n this._$startNode = renderContainerMarker;\n this._$endNode = null;\n\n // Note, any nested template results render here and their styles will\n // be extracted and collected.\n setValue.call(this, value, directiveParent);\n\n // Get the template for this result or create a dummy one if a result\n // is not being rendered.\n // This property needs to remain unminified.\n const template = (value as ShadyTemplateResult)?.['_$litType$']\n ? (this._$committedValue as PatchableTemplateInstance)._$template.el\n : document.createElement('template');\n prepareStyles(scope!, template);\n\n // Note, this is the temporary startNode.\n renderContainer.removeChild(renderContainerMarker);\n // When using native Shadow DOM, include prepared style in shadowRoot.\n if (window.ShadyCSS?.nativeShadow) {\n const style = template.content.querySelector('style');\n if (style !== null) {\n renderContainer.appendChild(style.cloneNode(true));\n }\n }\n container.insertBefore(renderContainer, endNode);\n // Move part back to original container.\n this._$startNode = startNode;\n this._$endNode = endNode;\n } else {\n setValue.call(this, value, directiveParent);\n }\n };\n\n /**\n * Patch ChildPart._$getTemplate to look up templates in a cache bucketed\n * by element name.\n */\n childPartProto._$getTemplate = function (\n this: PatchableChildPart,\n result: ShadyTemplateResult\n ) {\n const scope = this.options?.scope;\n let templateCache = scopedTemplateCache.get(scope);\n if (templateCache === undefined) {\n scopedTemplateCache.set(scope, (templateCache = new Map()));\n }\n let template = templateCache.get(result.strings);\n if (template === undefined) {\n templateCache.set(\n result.strings,\n (template = new Template(result, this.options))\n );\n }\n return template;\n };\n};\n\nif (ENABLE_SHADYDOM_NOPATCH) {\n polyfillSupport.noPatchSupported = ENABLE_SHADYDOM_NOPATCH;\n}\n\nif (DEV_MODE) {\n globalThis.litHtmlPolyfillSupportDevMode ??= polyfillSupport;\n} else {\n globalThis.litHtmlPolyfillSupport ??= polyfillSupport;\n}\n"],"names":["styledScopes","Set","scopeCssStore","Map","globalThis","litHtmlPolyfillSupport","Template","ChildPart","undefined","window","ShadyCSS","nativeShadow","ApplyShim","needsPrepareStyles","name","has","cssForScope","scopeCss","get","set","scopedTemplateCache","originalCreateElement","createElement","html","options","element","call","scope","prepareTemplateDom","styles","content","querySelectorAll","push","Array","from","map","style","parentNode","removeChild","textContent","renderContainer","document","createDocumentFragment","renderContainerMarker","createComment","childPartProto","prototype","setValue","_$setValue","value","directiveParent","container","this","_$startNode","ShadowRoot","startNode","endNode","_$endNode","appendChild","template","_$committedValue","_$template","el","hasScopeCss","length","join","add","delete","prepareTemplateStyles","querySelector","prepareStyles","cloneNode","insertBefore","_$getTemplate","result","templateCache","strings"],"mappings":"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"}
@@ -3,27 +3,26 @@
3
3
  * Copyright 2019 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
5
  */
6
- /// <reference types="trusted-types" />
7
- import { Directive, PartInfo } from './directive.js';
8
- import { AttributePart, Part } from './lit-html.js';
6
+ import { Directive, PartInfo, DirectiveClass, DirectiveResult } from './directive.js';
7
+ import { AttributePart, Part, Disconnectable } from './lit-html.js';
9
8
  export type { Template } from './lit-html.js';
10
9
  /**
11
10
  * END USERS SHOULD NOT RELY ON THIS OBJECT.
12
11
  *
13
12
  * We currently do not make a mangled rollup build of the lit-ssr code. In order
14
13
  * to keep a number of (otherwise private) top-level exports mangled in the
15
- * client side code, we export a _Σ object containing those members (or
14
+ * client side code, we export a _$LH object containing those members (or
16
15
  * helper methods for accessing private fields of those members), and then
17
16
  * re-export them for use in lit-ssr. This keeps lit-ssr agnostic to whether the
18
17
  * client-side code is being used in `dev` mode or `prod` mode.
19
18
  * @private
20
19
  */
21
- export declare const _Σ: {
20
+ export declare const _$LH: {
22
21
  boundAttributeSuffix: string;
23
22
  marker: string;
24
23
  markerMatch: string;
25
24
  HTML_RESULT: number;
26
- getTemplateHtml: (strings: TemplateStringsArray, type: 1 | 2) => [TrustedHTML, (string | undefined)[]];
25
+ getTemplateHtml: (strings: TemplateStringsArray, type: 1 | 2) => [import("trusted-types/lib").TrustedHTML, (string | undefined)[]];
27
26
  overrideDirectiveResolve: (directiveClass: new (part: PartInfo) => Directive & {
28
27
  render(): unknown;
29
28
  }, resolveOverrideFn: (directive: Directive, values: unknown[]) => unknown) => {
@@ -32,15 +31,18 @@ export declare const _Σ: {
32
31
  __part: Part;
33
32
  __attributeIndex: number | undefined;
34
33
  __directive?: Directive | undefined;
35
- _$parent: import("./lit-html.js").Disconnectable;
36
- _$disconnetableChildren?: Set<import("./lit-html.js").Disconnectable> | undefined;
37
- _$setDirectiveConnected?(isConnected: boolean): void;
38
- _$initialize(part: Part, parent: import("./lit-html.js").Disconnectable, attributeIndex: number | undefined): void;
34
+ _$parent: Disconnectable;
35
+ _$disconnectableChildren?: Set<Disconnectable> | undefined;
36
+ _$notifyDirectiveConnectionChanged?(isConnected: boolean): void;
37
+ readonly _$isConnected: boolean;
38
+ _$initialize(part: Part, parent: Disconnectable, attributeIndex: number | undefined): void;
39
39
  render: ((...props: unknown[]) => unknown) & (() => unknown);
40
40
  update(_part: Part, props: unknown[]): unknown;
41
41
  };
42
42
  };
43
+ setDirectiveClass(value: DirectiveResult, directiveClass: DirectiveClass): void;
43
44
  getAttributePartCommittedValue: (part: AttributePart, value: unknown, index: number | undefined) => unknown;
45
+ connectedDisconnectable: (props?: object | undefined) => Disconnectable;
44
46
  resolveDirective: (part: import("./lit-html.js").ChildPart | AttributePart | import("./lit-html.js").ElementPart, value: unknown, parent?: import("./lit-html.js").DirectiveParent, attributeIndex?: number | undefined) => unknown;
45
47
  AttributePart: typeof AttributePart;
46
48
  PropertyPart: typeof import("./lit-html.js").PropertyPart;
@@ -1 +1 @@
1
- {"version":3,"file":"private-ssr-support.d.ts","sourceRoot":"","sources":["../src/private-ssr-support.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAU,aAAa,EAAY,IAAI,EAAC,MAAM,eAAe,CAAC;AACrE,YAAY,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAE5C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,EAAE;;;;;;0DAOgB,QAAQ,KAAK,SAAS,GAAG;QAAC,MAAM,IAAI,OAAO,CAAA;KAAC,iCACxC,SAAS,UAAU,OAAO,EAAE,KAAK,OAAO;mBAD5C,QAAQ;4BAIjB,SAAS,SAAS,IAAI,UAAU,OAAO,EAAE,GAAG,OAAO;;;;;;;;gEAJN,OAAO;;;;2CAShE,aAAa,SACZ,OAAO,SACP,MAAM,GAAG,SAAS;;;;;;;CAkB5B,CAAC"}
1
+ {"version":3,"file":"private-ssr-support.d.ts","sourceRoot":"","sources":["../src/private-ssr-support.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,SAAS,EACT,QAAQ,EACR,cAAc,EACd,eAAe,EAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAEL,aAAa,EAEb,IAAI,EACJ,cAAc,EACf,MAAM,eAAe,CAAC;AACvB,YAAY,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAE5C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,IAAI;;;;;;0DAOc,QAAQ,KAAK,SAAS,GAAG;QAAC,MAAM,IAAI,OAAO,CAAA;KAAC,iCACxC,SAAS,UAAU,OAAO,EAAE,KAAK,OAAO;mBAD5C,QAAQ;4BAKzB,SAAS,SACR,IAAI,UACH,OAAO,EAAE,GAChB,OAAO;;;;;;;;;gEARmD,OAAO;;;;6BAY/C,eAAe,kBAAkB,cAAc;2CAKhE,aAAa,SACZ,OAAO,SACP,MAAM,GAAG,SAAS;6DAYgB,cAAc;;;;;;;CAU1D,CAAC"}
@@ -1,7 +1,7 @@
1
- import{_Σ as t,noChange as e}from"./lit-html.js";
1
+ import{_$LH as t,noChange as e}from"./lit-html.js";
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2019 Google LLC
5
5
  * SPDX-License-Identifier: BSD-3-Clause
6
- */const r={boundAttributeSuffix:t.Z,marker:t.U,markerMatch:t.Y,HTML_RESULT:t.q,getTemplateHtml:t.X,overrideDirectiveResolve:(t,e)=>class extends t{S(t,r){return e(this,r)}},getAttributePartCommittedValue:(t,r,a)=>{let i=e;return t.W=t=>i=t,t.I(r,t,a),i},resolveDirective:t.st,AttributePart:t.ot,PropertyPart:t.lt,BooleanAttributePart:t.nt,EventPart:t.rt,ElementPart:t.ht};export{r as _Σ};
6
+ */const r={boundAttributeSuffix:t.P,marker:t.V,markerMatch:t.L,HTML_RESULT:t.I,getTemplateHtml:t.N,overrideDirectiveResolve:(t,e)=>class extends t{_$AS(t,r){return e(this,r)}},setDirectiveClass(t,e){t._$litDirective$=e},getAttributePartCommittedValue:(t,r,i)=>{let a=e;return t.k=t=>a=t,t._$AI(r,t,i),a},connectedDisconnectable:t=>({...t,_$AU:!0}),resolveDirective:t.j,AttributePart:t.O,PropertyPart:t.W,BooleanAttributePart:t.F,EventPart:t.B,ElementPart:t.Z};export{r as _$LH};
7
7
  //# sourceMappingURL=private-ssr-support.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"private-ssr-support.js","sources":["src/private-ssr-support.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {Directive, PartInfo} from './directive.js';\nimport {_Σ as p, AttributePart, noChange, Part} from './lit-html.js';\nexport type {Template} from './lit-html.js';\n\n/**\n * END USERS SHOULD NOT RELY ON THIS OBJECT.\n *\n * We currently do not make a mangled rollup build of the lit-ssr code. In order\n * to keep a number of (otherwise private) top-level exports mangled in the\n * client side code, we export a _Σ object containing those members (or\n * helper methods for accessing private fields of those members), and then\n * re-export them for use in lit-ssr. This keeps lit-ssr agnostic to whether the\n * client-side code is being used in `dev` mode or `prod` mode.\n * @private\n */\nexport const _Σ = {\n boundAttributeSuffix: p._boundAttributeSuffix,\n marker: p._marker,\n markerMatch: p._markerMatch,\n HTML_RESULT: p._HTML_RESULT,\n getTemplateHtml: p._getTemplateHtml,\n overrideDirectiveResolve: (\n directiveClass: new (part: PartInfo) => Directive & {render(): unknown},\n resolveOverrideFn: (directive: Directive, values: unknown[]) => unknown\n ) =>\n class extends directiveClass {\n _$resolve(this: Directive, _part: Part, values: unknown[]): unknown {\n return resolveOverrideFn(this, values);\n }\n },\n getAttributePartCommittedValue: (\n part: AttributePart,\n value: unknown,\n index: number | undefined\n ) => {\n // Use the part setter to resolve directives/concatenate multiple parts\n // into a final value (captured by passing in a commitValue override)\n let committedValue: unknown = noChange;\n // Note that _commitValue need not be in `stableProperties` because this\n // method is only run on `AttributePart`s created by lit-ssr using the same\n // version of the library as this file\n part._commitValue = (value: unknown) => (committedValue = value);\n part._$setValue(value, part, index);\n return committedValue;\n },\n resolveDirective: p._resolveDirective,\n AttributePart: p._AttributePart,\n PropertyPart: p._PropertyPart,\n BooleanAttributePart: p._BooleanAttributePart,\n EventPart: p._EventPart,\n ElementPart: p._ElementPart,\n};\n"],"names":["_Σ","boundAttributeSuffix","p","_boundAttributeSuffix","marker","_marker","markerMatch","_markerMatch","HTML_RESULT","_HTML_RESULT","getTemplateHtml","_getTemplateHtml","overrideDirectiveResolve","directiveClass","resolveOverrideFn","[object Object]","_part","values","this","getAttributePartCommittedValue","part","value","index","committedValue","noChange","_commitValue","_$setValue","resolveDirective","_resolveDirective","AttributePart","_AttributePart","PropertyPart","_PropertyPart","BooleanAttributePart","_BooleanAttributePart","EventPart","_EventPart","ElementPart","_ElementPart"],"mappings":";;;;;SAqBaA,EAAK,CAChBC,qBAAsBC,EAAEC,EACxBC,OAAQF,EAAEG,EACVC,YAAaJ,EAAEK,EACfC,YAAaN,EAAEO,EACfC,gBAAiBR,EAAES,EACnBC,yBAA0B,CACxBC,EACAC,IAEA,cAAcD,EACZE,EAA2BC,EAAaC,GACtC,OAAOH,EAAkBI,KAAMD,KAGrCE,+BAAgC,CAC9BC,EACAC,EACAC,KAIA,IAAIC,EAA0BC,EAM9B,OAFAJ,EAAKK,EAAgBJ,GAAoBE,EAAiBF,EAC1DD,EAAKM,EAAWL,EAAOD,EAAME,GACtBC,GAETI,iBAAkBzB,EAAE0B,GACpBC,cAAe3B,EAAE4B,GACjBC,aAAc7B,EAAE8B,GAChBC,qBAAsB/B,EAAEgC,GACxBC,UAAWjC,EAAEkC,GACbC,YAAanC,EAAEoC"}
1
+ {"version":3,"file":"private-ssr-support.js","sources":["src/private-ssr-support.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {\n Directive,\n PartInfo,\n DirectiveClass,\n DirectiveResult,\n} from './directive.js';\nimport {\n _$LH as p,\n AttributePart,\n noChange,\n Part,\n Disconnectable,\n} from './lit-html.js';\nexport type {Template} from './lit-html.js';\n\n/**\n * END USERS SHOULD NOT RELY ON THIS OBJECT.\n *\n * We currently do not make a mangled rollup build of the lit-ssr code. In order\n * to keep a number of (otherwise private) top-level exports mangled in the\n * client side code, we export a _$LH object containing those members (or\n * helper methods for accessing private fields of those members), and then\n * re-export them for use in lit-ssr. This keeps lit-ssr agnostic to whether the\n * client-side code is being used in `dev` mode or `prod` mode.\n * @private\n */\nexport const _$LH = {\n boundAttributeSuffix: p._boundAttributeSuffix,\n marker: p._marker,\n markerMatch: p._markerMatch,\n HTML_RESULT: p._HTML_RESULT,\n getTemplateHtml: p._getTemplateHtml,\n overrideDirectiveResolve: (\n directiveClass: new (part: PartInfo) => Directive & {render(): unknown},\n resolveOverrideFn: (directive: Directive, values: unknown[]) => unknown\n ) =>\n class extends directiveClass {\n override _$resolve(\n this: Directive,\n _part: Part,\n values: unknown[]\n ): unknown {\n return resolveOverrideFn(this, values);\n }\n },\n setDirectiveClass(value: DirectiveResult, directiveClass: DirectiveClass) {\n // This property needs to remain unminified.\n value['_$litDirective$'] = directiveClass;\n },\n getAttributePartCommittedValue: (\n part: AttributePart,\n value: unknown,\n index: number | undefined\n ) => {\n // Use the part setter to resolve directives/concatenate multiple parts\n // into a final value (captured by passing in a commitValue override)\n let committedValue: unknown = noChange;\n // Note that _commitValue need not be in `stableProperties` because this\n // method is only run on `AttributePart`s created by lit-ssr using the same\n // version of the library as this file\n part._commitValue = (value: unknown) => (committedValue = value);\n part._$setValue(value, part, index);\n return committedValue;\n },\n connectedDisconnectable: (props?: object): Disconnectable => ({\n ...props,\n _$isConnected: true,\n }),\n resolveDirective: p._resolveDirective,\n AttributePart: p._AttributePart,\n PropertyPart: p._PropertyPart,\n BooleanAttributePart: p._BooleanAttributePart,\n EventPart: p._EventPart,\n ElementPart: p._ElementPart,\n};\n"],"names":["_$LH","boundAttributeSuffix","p","_boundAttributeSuffix","marker","_marker","markerMatch","_markerMatch","HTML_RESULT","_HTML_RESULT","getTemplateHtml","_getTemplateHtml","overrideDirectiveResolve","directiveClass","resolveOverrideFn","_$resolve","_part","values","this","setDirectiveClass","value","getAttributePartCommittedValue","part","index","committedValue","noChange","_commitValue","_$setValue","connectedDisconnectable","props","_$isConnected","resolveDirective","_resolveDirective","AttributePart","_AttributePart","PropertyPart","_PropertyPart","BooleanAttributePart","_BooleanAttributePart","EventPart","_EventPart","ElementPart","_ElementPart"],"mappings":";;;;;SAgCaA,EAAO,CAClBC,qBAAsBC,EAAEC,EACxBC,OAAQF,EAAEG,EACVC,YAAaJ,EAAEK,EACfC,YAAaN,EAAEO,EACfC,gBAAiBR,EAAES,EACnBC,yBAA0B,CACxBC,EACAC,IAEA,cAAcD,EACHE,KAEPC,EACAC,GAEA,OAAOH,EAAkBI,KAAMD,KAGrCE,kBAAkBC,EAAwBP,GAExCO,EAAuB,gBAAIP,GAE7BQ,+BAAgC,CAC9BC,EACAF,EACAG,KAIA,IAAIC,EAA0BC,EAM9B,OAFAH,EAAKI,EAAgBN,GAAoBI,EAAiBJ,EAC1DE,EAAKK,KAAWP,EAAOE,EAAMC,GACtBC,GAETI,wBAA0BC,QACrBA,EACHC,MAAe,IAEjBC,iBAAkB7B,EAAE8B,EACpBC,cAAe/B,EAAEgC,EACjBC,aAAcjC,EAAEkC,EAChBC,qBAAsBnC,EAAEoC,EACxBC,UAAWrC,EAAEsC,EACbC,YAAavC,EAAEwC"}
@@ -1 +1 @@
1
- {"version":3,"file":"static.d.ts","sourceRoot":"","sources":["../src/static.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAC,IAAI,IAAI,QAAQ,EAAE,GAAG,IAAI,OAAO,EAAE,cAAc,EAAC,MAAM,eAAe,CAAC;AAE/E;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,YAAY,UAAW,MAAM;;CAExC,CAAC;AAaH;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,OAAO,YACT,oBAAoB,aAClB,OAAO,EAAE;;CAMpB,CAAC;AAMH;;GAEG;AACH,eAAO,MAAM,UAAU,YAAa,eAAe,GAAG,cAAc,eACzD,oBAAoB,aAClB,OAAO,EAAE,KACnB,cA6CF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,IAAI,YAvDN,oBAAoB,aAClB,OAAO,EAAE,KACnB,cAqDqC,CAAC;AAEzC;;;;;GAKG;AACH,eAAO,MAAM,GAAG,YA/DL,oBAAoB,aAClB,OAAO,EAAE,KACnB,cA6DmC,CAAC"}
1
+ {"version":3,"file":"static.d.ts","sourceRoot":"","sources":["../src/static.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAC,IAAI,IAAI,QAAQ,EAAE,GAAG,IAAI,OAAO,EAAE,cAAc,EAAC,MAAM,eAAe,CAAC;AAE/E;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,YAAY,UAAW,MAAM;;CAExC,CAAC;AAaH;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,OAAO,YACT,oBAAoB,aAClB,OAAO,EAAE;;CAMpB,CAAC;AAMH;;GAEG;AACH,eAAO,MAAM,UAAU,YACX,eAAe,GAAG,cAAc,eAChC,oBAAoB,aAAa,OAAO,EAAE,KAAG,cA8CtD,CAAC;AAEJ;;;;;GAKG;AACH,eAAO,MAAM,IAAI,YAtDL,oBAAoB,aAAa,OAAO,EAAE,KAAG,cAsDjB,CAAC;AAEzC;;;;;GAKG;AACH,eAAO,MAAM,GAAG,YA9DJ,oBAAoB,aAAa,OAAO,EAAE,KAAG,cA8DnB,CAAC"}
@@ -3,5 +3,5 @@ import{html as t,svg as e}from"./lit-html.js";
3
3
  * @license
4
4
  * Copyright 2020 Google LLC
5
5
  * SPDX-License-Identifier: BSD-3-Clause
6
- */const o=t=>({It:t}),r=(t,...e)=>({It:e.reduce(((e,o,r)=>e+(t=>{if(void 0!==t.It)return t.It;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${t}. Use 'unsafeStatic' to pass non-literal values, but\n take care to ensure page security.`)})(o)+t[r+1]),t[0])}),i=new Map,a=t=>(e,...o)=>{var r;const a=o.length;let l,s;const n=[],u=[];let c,$=0,v=!1;for(;$<a;){for(c=e[$];$<a&&void 0!==(s=o[$],l=null===(r=s)||void 0===r?void 0:r.It);)c+=l+e[++$],v=!0;u.push(s),n.push(c),$++}if($===a&&n.push(e[a]),v){const t=n.join("$$lit$$");void 0===(e=i.get(t))&&i.set(t,e=n),o=u}return t(e,...o)},l=a(t),s=a(e);export{l as html,r as literal,s as svg,o as unsafeStatic,a as withStatic};
6
+ */const o=t=>({_$litStatic$:t}),r=(t,...e)=>({_$litStatic$:e.reduce(((e,o,r)=>e+(t=>{if(void 0!==t._$litStatic$)return t._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${t}. Use 'unsafeStatic' to pass non-literal values, but\n take care to ensure page security.`)})(o)+t[r+1]),t[0])}),i=new Map,a=t=>(e,...o)=>{var r;const a=o.length;let l,s;const n=[],u=[];let c,$=0,v=!1;for(;$<a;){for(c=e[$];$<a&&void 0!==(s=o[$],l=null===(r=s)||void 0===r?void 0:r._$litStatic$);)c+=l+e[++$],v=!0;u.push(s),n.push(c),$++}if($===a&&n.push(e[a]),v){const t=n.join("$$lit$$");void 0===(e=i.get(t))&&i.set(t,e=n),o=u}return t(e,...o)},l=a(t),s=a(e);export{l as html,r as literal,s as svg,o as unsafeStatic,a as withStatic};
7
7
  //# sourceMappingURL=static.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"static.js","sources":["src/static.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nimport {html as coreHtml, svg as coreSvg, TemplateResult} from './lit-html.js';\n\n/**\n * Wraps a string so that it behaves like part of the static template\n * strings instead of a dynamic value.\n *\n * Users must take care to ensure that adding the static string to the template\n * results in well-formed HTML, or else templates may break unexpectedly.\n *\n * Note that this function is unsafe to use on untrusted content, as it will be\n * directly parsed into HTML. Do not pass user input to this function\n * without sanitizing it.\n *\n * Static values can be changed, but they will cause a complete re-render\n * since they effectively create a new template.\n */\nexport const unsafeStatic = (value: string) => ({\n _$litStatic$: value,\n});\n\nconst textFromStatic = (value: StaticValue) => {\n if (value._$litStatic$ !== undefined) {\n return value._$litStatic$;\n } else {\n throw new Error(\n `Value passed to 'literal' function must be a 'literal' result: ${value}. Use 'unsafeStatic' to pass non-literal values, but\n take care to ensure page security.`\n );\n }\n};\n\n/**\n * Tags a string literal so that it behaves like part of the static template\n * strings instead of a dynamic value.\n *\n * The only values that may be used in template expressions are other tagged\n * `literal` results or `unsafeStatic` values (note that untrusted content\n * should never be passed to `unsafeStatic`).\n *\n * Users must take care to ensure that adding the static string to the template\n * results in well-formed HTML, or else templates may break unexpectedly.\n *\n * Static values can be changed, but they will cause a complete re-render since\n * they effectively create a new template.\n */\nexport const literal = (\n strings: TemplateStringsArray,\n ...values: unknown[]\n) => ({\n _$litStatic$: values.reduce(\n (acc, v, idx) => acc + textFromStatic(v as StaticValue) + strings[idx + 1],\n strings[0]\n ),\n});\n\ntype StaticValue = ReturnType<typeof unsafeStatic>;\n\nconst stringsCache = new Map<string, TemplateStringsArray>();\n\n/**\n * Wraps a lit-html template tag (`html` or `svg`) to add static value support.\n */\nexport const withStatic = (coreTag: typeof coreHtml | typeof coreSvg) => (\n strings: TemplateStringsArray,\n ...values: unknown[]\n): TemplateResult => {\n const l = values.length;\n let staticValue: string | undefined;\n let dynamicValue: unknown;\n const staticStrings: Array<string> = [];\n const dynamicValues: Array<unknown> = [];\n let i = 0;\n let hasStatics = false;\n let s: string;\n\n while (i < l) {\n s = strings[i];\n // Collect any unsafeStatic values, and their following template strings\n // so that we treat a run of template strings and unsafe static values as\n // a single template string.\n while (\n i < l &&\n ((dynamicValue = values[i]),\n (staticValue = (dynamicValue as StaticValue)?._$litStatic$)) !== undefined\n ) {\n s += staticValue + strings[++i];\n hasStatics = true;\n }\n dynamicValues.push(dynamicValue);\n staticStrings.push(s);\n i++;\n }\n // If the last value isn't static (which would have consumed the last\n // string), then we need to add the last string.\n if (i === l) {\n staticStrings.push(strings[l]);\n }\n\n if (hasStatics) {\n const key = staticStrings.join('$$lit$$');\n strings = stringsCache.get(key)!;\n if (strings === undefined) {\n stringsCache.set(\n key,\n (strings = (staticStrings as unknown) as TemplateStringsArray)\n );\n }\n values = dynamicValues;\n }\n return coreTag(strings, ...values);\n};\n\n/**\n * Interprets a template literal as an HTML template that can efficiently\n * render to and update a container.\n *\n * Includes static value support from `lit-html/static.js`.\n */\nexport const html = withStatic(coreHtml);\n\n/**\n * Interprets a template literal as an SVG template that can efficiently\n * render to and update a container.\n *\n * Includes static value support from `lit-html/static.js`.\n */\nexport const svg = withStatic(coreSvg);\n"],"names":["unsafeStatic","value","It","literal","strings","values","reduce","acc","v","idx","undefined","_$litStatic$","Error","textFromStatic","stringsCache","Map","withStatic","coreTag","l","length","staticValue","dynamicValue","staticStrings","dynamicValues","s","i","hasStatics","push","key","join","get","set","html","coreHtml","svg","coreSvg"],"mappings":";;;;;SAqBaA,EAAgBC,KAC3BC,GAAcD,IA4BHE,EAAU,CACrBC,KACGC,MAEHH,GAAcG,EAAOC,QACnB,CAACC,EAAKC,EAAGC,IAAQF,EA9BE,CAACN,IACtB,QAA2BS,IAAvBT,EAAMU,GACR,OAAOV,EAAMU,GAEb,MAAUC,MACR,kEAAkEX,0GAyB7CY,CAAeL,GAAoBJ,EAAQK,EAAM,IACxEL,EAAQ,MAMNU,EAAe,IAAIC,IAKZC,EAAcC,GAA8C,CACvEb,KACGC,WAEH,MAAMa,EAAIb,EAAOc,OACjB,IAAIC,EACAC,EACJ,MAAMC,EAA+B,GAC/BC,EAAgC,GACtC,IAEIC,EAFAC,EAAI,EACJC,GAAa,EAGjB,KAAOD,EAAIP,GAAG,CAKZ,IAJAM,EAAIpB,EAAQqB,GAKVA,EAAIP,QAE6DR,KAD/DW,EAAehB,EAAOoB,GACvBL,YAAeC,wBAA8BV,KAE9Ca,GAAKJ,EAAchB,IAAUqB,GAC7BC,GAAa,EAEfH,EAAcI,KAAKN,GACnBC,EAAcK,KAAKH,GACnBC,IAQF,GAJIA,IAAMP,GACRI,EAAcK,KAAKvB,EAAQc,IAGzBQ,EAAY,CACd,MAAME,EAAMN,EAAcO,KAAK,gBAEfnB,KADhBN,EAAUU,EAAagB,IAAIF,KAEzBd,EAAaiB,IACXH,EACCxB,EAAWkB,GAGhBjB,EAASkB,EAEX,OAAON,EAAQb,KAAYC,IAShB2B,EAAOhB,EAAWiB,GAQlBC,EAAMlB,EAAWmB"}
1
+ {"version":3,"file":"static.js","sources":["src/static.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nimport {html as coreHtml, svg as coreSvg, TemplateResult} from './lit-html.js';\n\n/**\n * Wraps a string so that it behaves like part of the static template\n * strings instead of a dynamic value.\n *\n * Users must take care to ensure that adding the static string to the template\n * results in well-formed HTML, or else templates may break unexpectedly.\n *\n * Note that this function is unsafe to use on untrusted content, as it will be\n * directly parsed into HTML. Do not pass user input to this function\n * without sanitizing it.\n *\n * Static values can be changed, but they will cause a complete re-render\n * since they effectively create a new template.\n */\nexport const unsafeStatic = (value: string) => ({\n ['_$litStatic$']: value,\n});\n\nconst textFromStatic = (value: StaticValue) => {\n if (value['_$litStatic$'] !== undefined) {\n return value['_$litStatic$'];\n } else {\n throw new Error(\n `Value passed to 'literal' function must be a 'literal' result: ${value}. Use 'unsafeStatic' to pass non-literal values, but\n take care to ensure page security.`\n );\n }\n};\n\n/**\n * Tags a string literal so that it behaves like part of the static template\n * strings instead of a dynamic value.\n *\n * The only values that may be used in template expressions are other tagged\n * `literal` results or `unsafeStatic` values (note that untrusted content\n * should never be passed to `unsafeStatic`).\n *\n * Users must take care to ensure that adding the static string to the template\n * results in well-formed HTML, or else templates may break unexpectedly.\n *\n * Static values can be changed, but they will cause a complete re-render since\n * they effectively create a new template.\n */\nexport const literal = (\n strings: TemplateStringsArray,\n ...values: unknown[]\n) => ({\n ['_$litStatic$']: values.reduce(\n (acc, v, idx) => acc + textFromStatic(v as StaticValue) + strings[idx + 1],\n strings[0]\n ),\n});\n\ntype StaticValue = ReturnType<typeof unsafeStatic>;\n\nconst stringsCache = new Map<string, TemplateStringsArray>();\n\n/**\n * Wraps a lit-html template tag (`html` or `svg`) to add static value support.\n */\nexport const withStatic =\n (coreTag: typeof coreHtml | typeof coreSvg) =>\n (strings: TemplateStringsArray, ...values: unknown[]): TemplateResult => {\n const l = values.length;\n let staticValue: string | undefined;\n let dynamicValue: unknown;\n const staticStrings: Array<string> = [];\n const dynamicValues: Array<unknown> = [];\n let i = 0;\n let hasStatics = false;\n let s: string;\n\n while (i < l) {\n s = strings[i];\n // Collect any unsafeStatic values, and their following template strings\n // so that we treat a run of template strings and unsafe static values as\n // a single template string.\n while (\n i < l &&\n ((dynamicValue = values[i]),\n (staticValue = (dynamicValue as StaticValue)?.['_$litStatic$'])) !==\n undefined\n ) {\n s += staticValue + strings[++i];\n hasStatics = true;\n }\n dynamicValues.push(dynamicValue);\n staticStrings.push(s);\n i++;\n }\n // If the last value isn't static (which would have consumed the last\n // string), then we need to add the last string.\n if (i === l) {\n staticStrings.push(strings[l]);\n }\n\n if (hasStatics) {\n const key = staticStrings.join('$$lit$$');\n strings = stringsCache.get(key)!;\n if (strings === undefined) {\n stringsCache.set(\n key,\n (strings = staticStrings as unknown as TemplateStringsArray)\n );\n }\n values = dynamicValues;\n }\n return coreTag(strings, ...values);\n };\n\n/**\n * Interprets a template literal as an HTML template that can efficiently\n * render to and update a container.\n *\n * Includes static value support from `lit-html/static.js`.\n */\nexport const html = withStatic(coreHtml);\n\n/**\n * Interprets a template literal as an SVG template that can efficiently\n * render to and update a container.\n *\n * Includes static value support from `lit-html/static.js`.\n */\nexport const svg = withStatic(coreSvg);\n"],"names":["unsafeStatic","value","_$litStatic$","literal","strings","values","reduce","acc","v","idx","undefined","Error","textFromStatic","stringsCache","Map","withStatic","coreTag","l","length","staticValue","dynamicValue","staticStrings","dynamicValues","s","i","hasStatics","push","key","join","get","set","html","coreHtml","svg","coreSvg"],"mappings":";;;;;SAqBaA,EAAgBC,KAC3BC,aAAkBD,IA4BPE,EAAU,CACrBC,KACGC,MAEHH,aAAkBG,EAAOC,QACvB,CAACC,EAAKC,EAAGC,IAAQF,EA9BE,CAACN,IACtB,QAA8BS,IAA1BT,EAAoB,aACtB,OAAOA,EAAoB,aAE3B,MAAUU,MACR,kEAAkEV,0GAyB7CW,CAAeJ,GAAoBJ,EAAQK,EAAM,IACxEL,EAAQ,MAMNS,EAAe,IAAIC,IAKZC,EACVC,GACD,CAACZ,KAAkCC,WACjC,MAAMY,EAAIZ,EAAOa,OACjB,IAAIC,EACAC,EACJ,MAAMC,EAA+B,GAC/BC,EAAgC,GACtC,IAEIC,EAFAC,EAAI,EACJC,GAAa,EAGjB,KAAOD,EAAIP,GAAG,CAKZ,IAJAM,EAAInB,EAAQoB,GAKVA,EAAIP,QAGFP,KAFAU,EAAef,EAAOmB,GACvBL,YAAeC,wBAA6C,eAG7DG,GAAKJ,EAAcf,IAAUoB,GAC7BC,GAAa,EAEfH,EAAcI,KAAKN,GACnBC,EAAcK,KAAKH,GACnBC,IAQF,GAJIA,IAAMP,GACRI,EAAcK,KAAKtB,EAAQa,IAGzBQ,EAAY,CACd,MAAME,EAAMN,EAAcO,KAAK,gBAEflB,KADhBN,EAAUS,EAAagB,IAAIF,KAEzBd,EAAaiB,IACXH,EACCvB,EAAUiB,GAGfhB,EAASiB,EAEX,OAAON,EAAQZ,KAAYC,IASlB0B,EAAOhB,EAAWiB,GAQlBC,EAAMlB,EAAWmB"}
@@ -1,7 +1,7 @@
1
1
  Name: marked
2
2
  Short Name: marked
3
3
  URL: https://github.com/markedjs/marked
4
- Version: 2.0.3
4
+ Version: 4.0.4
5
5
  License: MIT
6
6
  Security Critical: no
7
7
 
@@ -10,7 +10,7 @@ Light-weight markdown parser and renderer.
10
10
 
11
11
  To update this package, run the following command (replace version number with updated version number):
12
12
  ```bash
13
- wget -qO- https://registry.npmjs.org/marked/-/marked-2.0.3.tgz | tar xzf -
13
+ wget -qO- https://registry.npmjs.org/marked/-/marked-4.0.4.tgz | tar xzf -
14
14
  ```
15
15
 
16
16
  Local Modifications:
@@ -1,3 +1,3 @@
1
- import Marked from './package/lib/marked.esm.js';
1
+ import {marked as Marked} from './package/lib/marked.esm.js';
2
2
 
3
- export {Marked}
3
+ export {Marked}
@@ -29,6 +29,12 @@ Also read about:
29
29
  * [Options](https://marked.js.org/#/USING_ADVANCED.md)
30
30
  * [Extensibility](https://marked.js.org/#/USING_PRO.md)
31
31
 
32
+ ## Compatibility
33
+
34
+ **Node.js:** Only [current and LTS](https://nodejs.org/en/about/releases/) Node.js versions are supported. End of life Node.js versions may become incompatible with Marked at any point in time.
35
+
36
+ **Browser:** Not IE11 :)
37
+
32
38
  ## Installation
33
39
 
34
40
  **CLI:** `npm install -g marked`
@@ -63,7 +69,7 @@ $ cat hello.html
63
69
  <script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
64
70
  <script>
65
71
  document.getElementById('content').innerHTML =
66
- marked('# Marked in the browser\n\nRendered by **marked**.');
72
+ marked.parse('# Marked in the browser\n\nRendered by **marked**.');
67
73
  </script>
68
74
  </body>
69
75
  </html>
@@ -0,0 +1,214 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Marked CLI
5
+ * Copyright (c) 2011-2013, Christopher Jeffrey (MIT License)
6
+ */
7
+
8
+ import { promises } from 'fs';
9
+ import { marked } from '../lib/marked.esm.js';
10
+
11
+ const { readFile, writeFile } = promises;
12
+
13
+ /**
14
+ * Man Page
15
+ */
16
+
17
+ async function help() {
18
+ const { spawn } = await import('child_process');
19
+
20
+ const options = {
21
+ cwd: process.cwd(),
22
+ env: process.env,
23
+ setsid: false,
24
+ stdio: 'inherit'
25
+ };
26
+
27
+ const { dirname, resolve } = await import('path');
28
+ const { fileURLToPath } = await import('url');
29
+ const __dirname = dirname(fileURLToPath(import.meta.url));
30
+ const helpText = await readFile(resolve(__dirname, '../man/marked.1.txt'), 'utf8');
31
+
32
+ // eslint-disable-next-line promise/param-names
33
+ await new Promise(res => {
34
+ spawn('man', [resolve(__dirname, '../man/marked.1')], options)
35
+ .on('error', () => {
36
+ console.log(helpText);
37
+ })
38
+ .on('close', res);
39
+ });
40
+ }
41
+
42
+ async function version() {
43
+ const { createRequire } = await import('module');
44
+ const require = createRequire(import.meta.url);
45
+ const pkg = require('../package.json');
46
+ console.log(pkg.version);
47
+ }
48
+
49
+ /**
50
+ * Main
51
+ */
52
+
53
+ async function main(argv) {
54
+ const files = [];
55
+ const options = {};
56
+ let input;
57
+ let output;
58
+ let string;
59
+ let arg;
60
+ let tokens;
61
+ let opt;
62
+
63
+ function getarg() {
64
+ let arg = argv.shift();
65
+
66
+ if (arg.indexOf('--') === 0) {
67
+ // e.g. --opt
68
+ arg = arg.split('=');
69
+ if (arg.length > 1) {
70
+ // e.g. --opt=val
71
+ argv.unshift(arg.slice(1).join('='));
72
+ }
73
+ arg = arg[0];
74
+ } else if (arg[0] === '-') {
75
+ if (arg.length > 2) {
76
+ // e.g. -abc
77
+ argv = arg.substring(1).split('').map(function(ch) {
78
+ return '-' + ch;
79
+ }).concat(argv);
80
+ arg = argv.shift();
81
+ } else {
82
+ // e.g. -a
83
+ }
84
+ } else {
85
+ // e.g. foo
86
+ }
87
+
88
+ return arg;
89
+ }
90
+
91
+ while (argv.length) {
92
+ arg = getarg();
93
+ switch (arg) {
94
+ case '-o':
95
+ case '--output':
96
+ output = argv.shift();
97
+ break;
98
+ case '-i':
99
+ case '--input':
100
+ input = argv.shift();
101
+ break;
102
+ case '-s':
103
+ case '--string':
104
+ string = argv.shift();
105
+ break;
106
+ case '-t':
107
+ case '--tokens':
108
+ tokens = true;
109
+ break;
110
+ case '-h':
111
+ case '--help':
112
+ return await help();
113
+ case '-v':
114
+ case '--version':
115
+ return await version();
116
+ default:
117
+ if (arg.indexOf('--') === 0) {
118
+ opt = camelize(arg.replace(/^--(no-)?/, ''));
119
+ if (!marked.defaults.hasOwnProperty(opt)) {
120
+ continue;
121
+ }
122
+ if (arg.indexOf('--no-') === 0) {
123
+ options[opt] = typeof marked.defaults[opt] !== 'boolean'
124
+ ? null
125
+ : false;
126
+ } else {
127
+ options[opt] = typeof marked.defaults[opt] !== 'boolean'
128
+ ? argv.shift()
129
+ : true;
130
+ }
131
+ } else {
132
+ files.push(arg);
133
+ }
134
+ break;
135
+ }
136
+ }
137
+
138
+ async function getData() {
139
+ if (!input) {
140
+ if (files.length <= 2) {
141
+ if (string) {
142
+ return string;
143
+ }
144
+ return await getStdin();
145
+ }
146
+ input = files.pop();
147
+ }
148
+ return await readFile(input, 'utf8');
149
+ }
150
+
151
+ const data = await getData();
152
+
153
+ const html = tokens
154
+ ? JSON.stringify(marked.lexer(data, options), null, 2)
155
+ : marked(data, options);
156
+
157
+ if (output) {
158
+ return await writeFile(output, html);
159
+ }
160
+
161
+ process.stdout.write(html + '\n');
162
+ }
163
+
164
+ /**
165
+ * Helpers
166
+ */
167
+
168
+ function getStdin() {
169
+ return new Promise((resolve, reject) => {
170
+ const stdin = process.stdin;
171
+ let buff = '';
172
+
173
+ stdin.setEncoding('utf8');
174
+
175
+ stdin.on('data', function(data) {
176
+ buff += data;
177
+ });
178
+
179
+ stdin.on('error', function(err) {
180
+ reject(err);
181
+ });
182
+
183
+ stdin.on('end', function() {
184
+ resolve(buff);
185
+ });
186
+
187
+ stdin.resume();
188
+ });
189
+ }
190
+
191
+ function camelize(text) {
192
+ return text.replace(/(\w)-(\w)/g, function(_, a, b) {
193
+ return a + b.toUpperCase();
194
+ });
195
+ }
196
+
197
+ function handleError(err) {
198
+ if (err.code === 'ENOENT') {
199
+ console.error('marked: output to ' + err.path + ': No such directory');
200
+ return process.exit(1);
201
+ }
202
+ throw err;
203
+ }
204
+
205
+ /**
206
+ * Expose / Entry Point
207
+ */
208
+
209
+ process.title = 'marked';
210
+ main(process.argv.slice()).then(code => {
211
+ process.exit(code || 0);
212
+ }).catch(err => {
213
+ handleError(err);
214
+ });