@oddsquad/vite-plugin-lit 0.2.3 → 0.4.0

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 (240) hide show
  1. package/CHANGELOG.md +112 -0
  2. package/LICENSE +28 -0
  3. package/README.md +157 -0
  4. package/bin.mjs +154 -0
  5. package/client.d.ts +61 -0
  6. package/dist/client/assets/browser-agent-rpc-BXhoSh1z-CdtPhBL-.js +69 -0
  7. package/dist/client/assets/browser-agent-rpc-BXhoSh1z-CdtPhBL-.js.map +1 -0
  8. package/dist/client/assets/flow-DK8vmxvN.js +745 -0
  9. package/dist/client/assets/flow-DK8vmxvN.js.map +1 -0
  10. package/dist/client/assets/index-DVe6M4HV.js +10614 -0
  11. package/dist/client/assets/index-DVe6M4HV.js.map +1 -0
  12. package/{panel → dist/client}/index.html +1 -0
  13. package/index.d.ts.map +1 -1
  14. package/index.js +2 -2
  15. package/index.js.map +1 -1
  16. package/lib/color-scheme.d.ts.map +1 -1
  17. package/lib/color-scheme.js +17 -21
  18. package/lib/color-scheme.js.map +1 -1
  19. package/lib/devframe/definition.d.ts +45 -0
  20. package/lib/devframe/definition.d.ts.map +1 -0
  21. package/lib/devframe/definition.js +547 -0
  22. package/lib/devframe/definition.js.map +1 -0
  23. package/lib/devframe/icon.d.ts +8 -0
  24. package/lib/devframe/icon.d.ts.map +1 -0
  25. package/lib/devframe/icon.js +21 -0
  26. package/lib/devframe/icon.js.map +1 -0
  27. package/lib/devframe/paths.d.ts +12 -0
  28. package/lib/devframe/paths.d.ts.map +1 -0
  29. package/lib/devframe/paths.js +38 -0
  30. package/lib/devframe/paths.js.map +1 -0
  31. package/lib/devframe/protocol.d.ts +218 -0
  32. package/lib/devframe/protocol.d.ts.map +1 -0
  33. package/lib/devframe/protocol.js +77 -0
  34. package/lib/devframe/protocol.js.map +1 -0
  35. package/lib/devframe/source.d.ts +49 -0
  36. package/lib/devframe/source.d.ts.map +1 -0
  37. package/lib/devframe/source.js +23 -0
  38. package/lib/devframe/source.js.map +1 -0
  39. package/lib/devframe/vite.d.ts +116 -0
  40. package/lib/devframe/vite.d.ts.map +1 -0
  41. package/lib/devframe/vite.js +292 -0
  42. package/lib/devframe/vite.js.map +1 -0
  43. package/lib/http.d.ts +29 -0
  44. package/lib/http.d.ts.map +1 -0
  45. package/lib/http.js +35 -0
  46. package/lib/http.js.map +1 -0
  47. package/lib/icons.d.ts +2 -0
  48. package/lib/icons.d.ts.map +1 -1
  49. package/lib/icons.js +10 -4
  50. package/lib/icons.js.map +1 -1
  51. package/lib/options.d.ts +131 -0
  52. package/lib/options.d.ts.map +1 -0
  53. package/lib/options.js +128 -0
  54. package/lib/options.js.map +1 -0
  55. package/lib/plugin.d.ts +6 -137
  56. package/lib/plugin.d.ts.map +1 -1
  57. package/lib/plugin.js +280 -677
  58. package/lib/plugin.js.map +1 -1
  59. package/lib/plugins/css-literals.d.ts +15 -0
  60. package/lib/plugins/css-literals.d.ts.map +1 -0
  61. package/lib/plugins/css-literals.js +154 -0
  62. package/lib/plugins/css-literals.js.map +1 -0
  63. package/lib/plugins/css-queries.d.ts +20 -0
  64. package/lib/plugins/css-queries.d.ts.map +1 -0
  65. package/lib/plugins/css-queries.js +139 -0
  66. package/lib/plugins/css-queries.js.map +1 -0
  67. package/lib/plugins/open-in-editor.d.ts +16 -0
  68. package/lib/plugins/open-in-editor.d.ts.map +1 -0
  69. package/lib/plugins/open-in-editor.js +91 -0
  70. package/lib/plugins/open-in-editor.js.map +1 -0
  71. package/lib/plugins/shared.d.ts +13 -0
  72. package/lib/plugins/shared.d.ts.map +1 -0
  73. package/lib/plugins/shared.js +23 -0
  74. package/lib/plugins/shared.js.map +1 -0
  75. package/lib/plugins/timeline-virtual.d.ts +19 -0
  76. package/lib/plugins/timeline-virtual.d.ts.map +1 -0
  77. package/lib/plugins/timeline-virtual.js +53 -0
  78. package/lib/plugins/timeline-virtual.js.map +1 -0
  79. package/lib/runtime/css.d.ts +2 -2
  80. package/lib/runtime/css.d.ts.map +1 -1
  81. package/lib/runtime/css.js +41 -34
  82. package/lib/runtime/css.js.map +1 -1
  83. package/lib/runtime/edge-panel.d.ts.map +1 -1
  84. package/lib/runtime/edge-panel.js +82 -91
  85. package/lib/runtime/edge-panel.js.map +1 -1
  86. package/lib/runtime/fonts.d.ts.map +1 -1
  87. package/lib/runtime/fonts.js +1 -1
  88. package/lib/runtime/fonts.js.map +1 -1
  89. package/lib/runtime/indicator.d.ts.map +1 -1
  90. package/lib/runtime/indicator.js +71 -74
  91. package/lib/runtime/indicator.js.map +1 -1
  92. package/lib/runtime/inspector/collect.d.ts.map +1 -1
  93. package/lib/runtime/inspector/collect.js +83 -90
  94. package/lib/runtime/inspector/collect.js.map +1 -1
  95. package/lib/runtime/inspector/highlight.d.ts +16 -0
  96. package/lib/runtime/inspector/highlight.d.ts.map +1 -0
  97. package/lib/runtime/inspector/highlight.js +66 -0
  98. package/lib/runtime/inspector/highlight.js.map +1 -0
  99. package/lib/runtime/inspector/install.d.ts.map +1 -1
  100. package/lib/runtime/inspector/install.js +230 -205
  101. package/lib/runtime/inspector/install.js.map +1 -1
  102. package/lib/runtime/inspector/serialize.d.ts.map +1 -1
  103. package/lib/runtime/inspector/serialize.js +86 -107
  104. package/lib/runtime/inspector/serialize.js.map +1 -1
  105. package/lib/runtime/intern.d.ts.map +1 -1
  106. package/lib/runtime/intern.js +31 -29
  107. package/lib/runtime/intern.js.map +1 -1
  108. package/lib/runtime/overrides.d.ts.map +1 -1
  109. package/lib/runtime/overrides.js +14 -13
  110. package/lib/runtime/overrides.js.map +1 -1
  111. package/lib/runtime/patch.d.ts +8 -0
  112. package/lib/runtime/patch.d.ts.map +1 -1
  113. package/lib/runtime/patch.js +321 -282
  114. package/lib/runtime/patch.js.map +1 -1
  115. package/lib/runtime/source-meta.d.ts.map +1 -1
  116. package/lib/runtime/source-meta.js +1 -1
  117. package/lib/runtime/source-meta.js.map +1 -1
  118. package/lib/runtime/source-overlay/editors.d.ts.map +1 -1
  119. package/lib/runtime/source-overlay/editors.js +27 -27
  120. package/lib/runtime/source-overlay/editors.js.map +1 -1
  121. package/lib/runtime/source-overlay/mask-path.d.ts.map +1 -1
  122. package/lib/runtime/source-overlay/mask-path.js +15 -15
  123. package/lib/runtime/source-overlay/mask-path.js.map +1 -1
  124. package/lib/runtime/source-overlay/overlay-element.d.ts.map +1 -1
  125. package/lib/runtime/source-overlay/overlay-element.js +359 -355
  126. package/lib/runtime/source-overlay/overlay-element.js.map +1 -1
  127. package/lib/runtime/source-overlay/source-host.d.ts.map +1 -1
  128. package/lib/runtime/source-overlay/source-host.js +64 -71
  129. package/lib/runtime/source-overlay/source-host.js.map +1 -1
  130. package/lib/runtime/source-overlay/template.d.ts.map +1 -1
  131. package/lib/runtime/source-overlay/template.js +3 -3
  132. package/lib/runtime/source-overlay/template.js.map +1 -1
  133. package/lib/runtime/source-overlay.d.ts.map +1 -1
  134. package/lib/runtime/source-overlay.js +5 -2
  135. package/lib/runtime/source-overlay.js.map +1 -1
  136. package/lib/runtime/timeline/clock.d.ts.map +1 -1
  137. package/lib/runtime/timeline/clock.js +2 -2
  138. package/lib/runtime/timeline/clock.js.map +1 -1
  139. package/lib/runtime/timeline/flash.d.ts +39 -0
  140. package/lib/runtime/timeline/flash.d.ts.map +1 -0
  141. package/lib/runtime/timeline/flash.js +169 -0
  142. package/lib/runtime/timeline/flash.js.map +1 -0
  143. package/lib/runtime/timeline/identity.d.ts.map +1 -1
  144. package/lib/runtime/timeline/identity.js +27 -27
  145. package/lib/runtime/timeline/identity.js.map +1 -1
  146. package/lib/runtime/timeline/input.d.ts.map +1 -1
  147. package/lib/runtime/timeline/input.js +54 -67
  148. package/lib/runtime/timeline/input.js.map +1 -1
  149. package/lib/runtime/timeline/install.d.ts.map +1 -1
  150. package/lib/runtime/timeline/install.js +47 -33
  151. package/lib/runtime/timeline/install.js.map +1 -1
  152. package/lib/runtime/timeline/lifecycle.d.ts +8 -0
  153. package/lib/runtime/timeline/lifecycle.d.ts.map +1 -1
  154. package/lib/runtime/timeline/lifecycle.js +149 -133
  155. package/lib/runtime/timeline/lifecycle.js.map +1 -1
  156. package/lib/runtime/timeline/public-api.d.ts +2 -2
  157. package/lib/runtime/timeline/public-api.d.ts.map +1 -1
  158. package/lib/runtime/timeline/public-api.js +11 -11
  159. package/lib/runtime/timeline/public-api.js.map +1 -1
  160. package/lib/runtime/timeline/render.d.ts +15 -6
  161. package/lib/runtime/timeline/render.d.ts.map +1 -1
  162. package/lib/runtime/timeline/render.js +212 -78
  163. package/lib/runtime/timeline/render.js.map +1 -1
  164. package/lib/runtime/timeline/transport.d.ts.map +1 -1
  165. package/lib/runtime/timeline/transport.js +39 -43
  166. package/lib/runtime/timeline/transport.js.map +1 -1
  167. package/lib/segmented-tabs.d.ts +3 -1
  168. package/lib/segmented-tabs.d.ts.map +1 -1
  169. package/lib/segmented-tabs.js +136 -107
  170. package/lib/segmented-tabs.js.map +1 -1
  171. package/lib/snapshot.d.ts +28 -0
  172. package/lib/snapshot.d.ts.map +1 -0
  173. package/lib/snapshot.js +57 -0
  174. package/lib/snapshot.js.map +1 -0
  175. package/lib/source-meta.d.ts.map +1 -1
  176. package/lib/source-meta.js +176 -162
  177. package/lib/source-meta.js.map +1 -1
  178. package/lib/timeline/derive.d.ts +152 -0
  179. package/lib/timeline/derive.d.ts.map +1 -0
  180. package/lib/timeline/derive.js +242 -0
  181. package/lib/timeline/derive.js.map +1 -0
  182. package/lib/tokens.d.ts.map +1 -1
  183. package/lib/tokens.js +17 -18
  184. package/lib/tokens.js.map +1 -1
  185. package/lib/transform.d.ts.map +1 -1
  186. package/lib/transform.js +62 -57
  187. package/lib/transform.js.map +1 -1
  188. package/lib/types.d.ts.map +1 -1
  189. package/lib/types.js +1 -1
  190. package/lib/types.js.map +1 -1
  191. package/lib/wrap-table.d.ts.map +1 -1
  192. package/lib/wrap-table.js +19 -17
  193. package/lib/wrap-table.js.map +1 -1
  194. package/package.json +80 -13
  195. package/types/hmr-incompatibility.d.ts +59 -0
  196. package/types/hmr-incompatibility.d.ts.map +1 -0
  197. package/types/hmr-incompatibility.js +30 -0
  198. package/types/hmr-incompatibility.js.map +1 -0
  199. package/types/in-page.d.ts +49 -0
  200. package/types/in-page.d.ts.map +1 -0
  201. package/types/in-page.js +33 -0
  202. package/types/in-page.js.map +1 -0
  203. package/types/inspector.d.ts.map +1 -1
  204. package/types/inspector.js.map +1 -1
  205. package/types/snapshot.d.ts +44 -0
  206. package/types/snapshot.d.ts.map +1 -0
  207. package/types/snapshot.js +7 -0
  208. package/types/snapshot.js.map +1 -0
  209. package/types/timeline.d.ts +23 -1
  210. package/types/timeline.d.ts.map +1 -1
  211. package/types/timeline.js +2 -0
  212. package/types/timeline.js.map +1 -1
  213. package/lib/timeline-plugin.d.ts +0 -72
  214. package/lib/timeline-plugin.d.ts.map +0 -1
  215. package/lib/timeline-plugin.js +0 -376
  216. package/lib/timeline-plugin.js.map +0 -1
  217. package/panel/components-view.d.ts +0 -60
  218. package/panel/components-view.d.ts.map +0 -1
  219. package/panel/components-view.js +0 -587
  220. package/panel/components-view.js.map +0 -1
  221. package/panel/devtools-settings.d.ts +0 -41
  222. package/panel/devtools-settings.d.ts.map +0 -1
  223. package/panel/devtools-settings.js +0 -463
  224. package/panel/devtools-settings.js.map +0 -1
  225. package/panel/lit-devtools-panel.d.ts +0 -37
  226. package/panel/lit-devtools-panel.d.ts.map +0 -1
  227. package/panel/lit-devtools-panel.js +0 -185
  228. package/panel/lit-devtools-panel.js.map +0 -1
  229. package/panel/timeline-event-list.d.ts +0 -43
  230. package/panel/timeline-event-list.d.ts.map +0 -1
  231. package/panel/timeline-event-list.js +0 -416
  232. package/panel/timeline-event-list.js.map +0 -1
  233. package/panel/timeline-layers.d.ts +0 -25
  234. package/panel/timeline-layers.d.ts.map +0 -1
  235. package/panel/timeline-layers.js +0 -96
  236. package/panel/timeline-layers.js.map +0 -1
  237. package/panel/timeline-view.d.ts +0 -38
  238. package/panel/timeline-view.d.ts.map +0 -1
  239. package/panel/timeline-view.js +0 -234
  240. package/panel/timeline-view.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"wrap-table.d.ts","sourceRoot":"","sources":["../../../packages/labs/vite-plugin-lit/src/lib/wrap-table.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;GAaG;AAEH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,KAAK,CAAC;IACvD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB;AAQD,eAAO,MAAM,UAAU,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,UAAU,EAAE,CAehE,CAAC"}
1
+ {"version":3,"file":"wrap-table.d.ts","sourceRoot":"","sources":["../src/lib/wrap-table.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;GAaG;AAEH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,KAAK,CAAC;IACvD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB;AAQD,eAAO,MAAM,UAAU,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,UAAU,EAAE,CAehE,CAAC"}
package/lib/wrap-table.js CHANGED
@@ -3,22 +3,24 @@
3
3
  * Copyright 2026 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
5
  */
6
- const tags = (...names) => names.map((exportName) => ({ exportName, ns: exportName }));
7
- const staticTags = (...names) => names.map((exportName) => ({ exportName, ns: `static-${exportName}` }));
6
+ const tags = (...names) =>
7
+ names.map((exportName) => ({exportName, ns: exportName}));
8
+ const staticTags = (...names) =>
9
+ names.map((exportName) => ({exportName, ns: `static-${exportName}`}));
8
10
  export const WRAP_TABLE = new Map([
9
- ['lit', tags('html', 'svg', 'mathml', 'css')],
10
- ['lit/html.js', tags('html', 'svg', 'mathml')],
11
- ['lit/static-html.js', staticTags('html', 'svg', 'mathml')],
12
- ['lit-html', tags('html', 'svg', 'mathml')],
13
- ['lit-html/static.js', staticTags('html', 'svg', 'mathml')],
14
- ['lit-element', tags('html', 'svg', 'mathml', 'css')],
15
- ['lit-element/lit-element.js', tags('html', 'svg', 'mathml', 'css')],
16
- ['@lit/reactive-element', tags('css')],
17
- ['@lit/reactive-element/css-tag.js', tags('css')],
18
- // The signals tags wrap the user's values but pass the strings array
19
- // straight through to lit-html's core tags, so they intern in the same
20
- // namespaces as plain html/svg (content-equal templates share a cache
21
- // entry either way).
22
- ['@lit-labs/signals', tags('html', 'svg')],
11
+ ['lit', tags('html', 'svg', 'mathml', 'css')],
12
+ ['lit/html.js', tags('html', 'svg', 'mathml')],
13
+ ['lit/static-html.js', staticTags('html', 'svg', 'mathml')],
14
+ ['lit-html', tags('html', 'svg', 'mathml')],
15
+ ['lit-html/static.js', staticTags('html', 'svg', 'mathml')],
16
+ ['lit-element', tags('html', 'svg', 'mathml', 'css')],
17
+ ['lit-element/lit-element.js', tags('html', 'svg', 'mathml', 'css')],
18
+ ['@lit/reactive-element', tags('css')],
19
+ ['@lit/reactive-element/css-tag.js', tags('css')],
20
+ // The signals tags wrap the user's values but pass the strings array
21
+ // straight through to lit-html's core tags, so they intern in the same
22
+ // namespaces as plain html/svg (content-equal templates share a cache
23
+ // entry either way).
24
+ ['@lit-labs/signals', tags('html', 'svg')],
23
25
  ]);
24
- //# sourceMappingURL=wrap-table.js.map
26
+ //# sourceMappingURL=wrap-table.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"wrap-table.js","sourceRoot":"","sources":["../../../packages/labs/vite-plugin-lit/src/lib/wrap-table.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAsBH,MAAM,IAAI,GAAG,CAAC,GAAG,KAAsC,EAAgB,EAAE,CACvE,KAAK,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,EAAC,UAAU,EAAE,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\n/**\n * The exact wrap surface: which template-tag exports of which lit-family\n * module specifiers get interned, and in which namespace.\n *\n * Namespaces are per tag *type*, not per module — `html` from `'lit'` and\n * from `'lit-html'` feed the same lit-html template cache, so they must\n * share canonical arrays. But content-equal `html` and `svg` templates must\n * never share one (a shared Template would parse SVG as HTML), and the\n * static-html tags pass zero-statics calls straight through to lit-html, so\n * they get their own namespaces too.\n *\n * Specifiers must be valid export-map subpaths (e.g. `lit/index.js` and\n * `lit-html/lit-html.js` are not, and are deliberately absent).\n */\n\nexport interface WrappedTag {\n readonly exportName: 'html' | 'svg' | 'mathml' | 'css';\n readonly ns: string;\n}\n\nconst tags = (...names: Array<WrappedTag['exportName']>): WrappedTag[] =>\n names.map((exportName) => ({exportName, ns: exportName}));\n\nconst staticTags = (...names: Array<WrappedTag['exportName']>): WrappedTag[] =>\n names.map((exportName) => ({exportName, ns: `static-${exportName}`}));\n\nexport const WRAP_TABLE: ReadonlyMap<string, readonly WrappedTag[]> = new Map([\n ['lit', tags('html', 'svg', 'mathml', 'css')],\n ['lit/html.js', tags('html', 'svg', 'mathml')],\n ['lit/static-html.js', staticTags('html', 'svg', 'mathml')],\n ['lit-html', tags('html', 'svg', 'mathml')],\n ['lit-html/static.js', staticTags('html', 'svg', 'mathml')],\n ['lit-element', tags('html', 'svg', 'mathml', 'css')],\n ['lit-element/lit-element.js', tags('html', 'svg', 'mathml', 'css')],\n ['@lit/reactive-element', tags('css')],\n ['@lit/reactive-element/css-tag.js', tags('css')],\n // The signals tags wrap the user's values but pass the strings array\n // straight through to lit-html's core tags, so they intern in the same\n // namespaces as plain html/svg (content-equal templates share a cache\n // entry either way).\n ['@lit-labs/signals', tags('html', 'svg')],\n]);\n"]}
1
+ {"version":3,"file":"wrap-table.js","sourceRoot":"","sources":["../src/lib/wrap-table.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAsBH,MAAM,IAAI,GAAG,CAAC,GAAG,KAAsC,EAAgB,EAAE,CACvE,KAAK,CAAC,GAAG,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\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * The exact wrap surface: which template-tag exports of which lit-family\n * module specifiers get interned, and in which namespace.\n *\n * Namespaces are per tag *type*, not per module — `html` from `'lit'` and\n * from `'lit-html'` feed the same lit-html template cache, so they must\n * share canonical arrays. But content-equal `html` and `svg` templates must\n * never share one (a shared Template would parse SVG as HTML), and the\n * static-html tags pass zero-statics calls straight through to lit-html, so\n * they get their own namespaces too.\n *\n * Specifiers must be valid export-map subpaths (e.g. `lit/index.js` and\n * `lit-html/lit-html.js` are not, and are deliberately absent).\n */\n\nexport interface WrappedTag {\n readonly exportName: 'html' | 'svg' | 'mathml' | 'css';\n readonly ns: string;\n}\n\nconst tags = (...names: Array<WrappedTag['exportName']>): WrappedTag[] =>\n names.map((exportName) => ({exportName, ns: exportName}));\n\nconst staticTags = (...names: Array<WrappedTag['exportName']>): WrappedTag[] =>\n names.map((exportName) => ({exportName, ns: `static-${exportName}`}));\n\nexport const WRAP_TABLE: ReadonlyMap<string, readonly WrappedTag[]> = new Map([\n ['lit', tags('html', 'svg', 'mathml', 'css')],\n ['lit/html.js', tags('html', 'svg', 'mathml')],\n ['lit/static-html.js', staticTags('html', 'svg', 'mathml')],\n ['lit-html', tags('html', 'svg', 'mathml')],\n ['lit-html/static.js', staticTags('html', 'svg', 'mathml')],\n ['lit-element', tags('html', 'svg', 'mathml', 'css')],\n ['lit-element/lit-element.js', tags('html', 'svg', 'mathml', 'css')],\n ['@lit/reactive-element', tags('css')],\n ['@lit/reactive-element/css-tag.js', tags('css')],\n // The signals tags wrap the user's values but pass the strings array\n // straight through to lit-html's core tags, so they intern in the same\n // namespaces as plain html/svg (content-equal templates share a cache\n // entry either way).\n ['@lit-labs/signals', tags('html', 'svg')],\n]);\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oddsquad/vite-plugin-lit",
3
- "version": "0.2.3",
3
+ "version": "0.4.0",
4
4
  "description": "Vite plugin providing true HMR for Lit components, plus CSS helpers and a DevTools panel",
5
5
  "license": "BSD-3-Clause",
6
6
  "author": "Oddsquad (based on @lit-labs/vite-hmr by Google LLC)",
@@ -8,11 +8,17 @@
8
8
  "main": "index.js",
9
9
  "module": "index.js",
10
10
  "files": [
11
+ "/CHANGELOG.md",
11
12
  "/lib/",
13
+ "/dist/client/",
12
14
  "/types/",
13
- "/panel/",
14
- "/index.{d.ts,d.ts.map,js,js.map}"
15
+ "/index.{d.ts,d.ts.map,js,js.map}",
16
+ "/client.d.ts",
17
+ "/bin.mjs"
15
18
  ],
19
+ "bin": {
20
+ "lit-devtools": "./bin.mjs"
21
+ },
16
22
  "exports": {
17
23
  ".": {
18
24
  "types": "./index.d.ts",
@@ -21,34 +27,95 @@
21
27
  "./css.js": {
22
28
  "types": "./lib/runtime/css.d.ts",
23
29
  "default": "./lib/runtime/css.js"
30
+ },
31
+ "./client": {
32
+ "types": "./client.d.ts"
24
33
  }
25
34
  },
26
- "scripts": {
27
- "build": "tsc && node scripts/copy-panel-html.mjs",
28
- "prepublishOnly": "npm run build"
35
+ "repository": {
36
+ "type": "git",
37
+ "url": "git+https://github.com/oddcelot/vite-plugin-lit.git"
38
+ },
39
+ "bugs": {
40
+ "url": "https://github.com/oddcelot/vite-plugin-lit/issues"
29
41
  },
30
42
  "dependencies": {
31
- "es-module-lexer": "^1.5.4",
32
- "launch-editor": "^2.10.0",
33
- "magic-string": "^0.30.11"
43
+ "devframe": "1.0.0",
44
+ "es-module-lexer": "^3.0.2",
45
+ "launch-editor": "^2.14.1",
46
+ "magic-string": "^1.4.1"
34
47
  },
35
48
  "peerDependencies": {
49
+ "@devframes/agentic": "1.0.0",
50
+ "@vitejs/devtools-kit": "^0.7.5",
51
+ "cac": "^7.0.0",
36
52
  "lightningcss": "^1.30.0",
37
53
  "lit": "^3.0.0",
38
54
  "vite": "^7.0.0 || ^8.0.0"
39
55
  },
40
56
  "peerDependenciesMeta": {
57
+ "@devframes/agentic": {
58
+ "optional": true
59
+ },
60
+ "@vitejs/devtools-kit": {
61
+ "optional": true
62
+ },
63
+ "cac": {
64
+ "optional": true
65
+ },
41
66
  "lightningcss": {
42
67
  "optional": true
43
68
  }
44
69
  },
45
70
  "devDependencies": {
46
- "typescript": "^5.7.0"
71
+ "@devframes/agentic": "1.0.0",
72
+ "@devframes/service-open": "1.0.0",
73
+ "@lit-labs/signals": "^0.3.0",
74
+ "@lit-labs/virtualizer": "^2.1.1",
75
+ "@lit/context": "^1.1.6",
76
+ "@lit/task": "^1.0.3",
77
+ "@types/node": "^26.6.1",
78
+ "@vitejs/devtools-kit": "0.7.5",
79
+ "cac": "7.0.0",
80
+ "git-cliff": "^2.13.1",
81
+ "lightningcss": "^1.33.0",
82
+ "lit": "^3.3.3",
83
+ "playwright-core": "^1.63.0",
84
+ "typescript": "^7.0.2",
85
+ "vite": "npm:@voidzero-dev/vite-plus-core@0.3.2",
86
+ "vite-plus": "0.3.2"
87
+ },
88
+ "engines": {
89
+ "node": ">=20"
90
+ },
91
+ "devEngines": {
92
+ "runtime": {
93
+ "name": "node",
94
+ "version": ">=26"
95
+ },
96
+ "packageManager": {
97
+ "name": "pnpm",
98
+ "version": ">=12"
99
+ }
47
100
  },
48
101
  "publishConfig": {
49
102
  "access": "public"
50
103
  },
51
- "engines": {
52
- "node": ">=20"
104
+ "scripts": {
105
+ "build": "tsc --pretty && pnpm run build:panel && node scripts/format-build-output.mjs",
106
+ "build:lit-canary": "node scripts/build-lit-canary.mjs",
107
+ "dev": "pnpm run build && vp dev playground",
108
+ "test": "pnpm run test:unit && pnpm run test:e2e",
109
+ "test:unit": "node scripts/check-client-types.mjs && vp test run --project unit",
110
+ "test:e2e": "pnpm run build && vp test run --project e2e",
111
+ "changelog": "git-cliff --unreleased",
112
+ "bench": "node bench/run.mjs",
113
+ "bench:serve": "node bench/run.mjs --serve",
114
+ "docs:dev": "pnpm --filter ./docs dev",
115
+ "docs:build": "pnpm --filter ./docs build",
116
+ "docs:shots": "pnpm run build && node scripts/docs-shots.mjs",
117
+ "format": "vp fmt \"**/*.{cjs,html,js,json,md,mdx,ts,yaml}\"",
118
+ "format:check": "vp fmt \"**/*.{cjs,html,js,json,md,mdx,ts,yaml}\" --check",
119
+ "build:panel": "vp build src/panel"
53
120
  }
54
- }
121
+ }
@@ -0,0 +1,59 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Google LLC
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */
6
+ /**
7
+ * Shared types and channel constant for HMR-incompatibility reporting.
8
+ *
9
+ * When the browser runtime can't hot-patch a component in place it logs one
10
+ * line to the console and, by default, full-reloads the page — which clears
11
+ * the console before anyone reads it. These types carry the same reason, in
12
+ * structured form, from the page runtime to the node side over the HMR
13
+ * {@link HMR_INCOMPATIBLE_CHANNEL}, where it is cached so the DevTools panel
14
+ * and an agent-facing query RPC can both read it back after the reload.
15
+ *
16
+ * The three reasons mirror the "Cannot be patched in place" cases documented
17
+ * in `docs/src/content/docs/reference/limitations.mdx`; adding a fourth means
18
+ * extending {@link HmrIncompatibilityReason} and {@link describeHmrReason}
19
+ * together, plus the docs page.
20
+ */
21
+ /** Why a component couldn't be hot-patched in place, or a related silent case. */
22
+ export type HmrIncompatibilityReason = {
23
+ code: 'accessor-decorators';
24
+ } | {
25
+ code: 'patch-failed';
26
+ detail: string;
27
+ } | {
28
+ code: 'observed-attributes-changed';
29
+ };
30
+ /**
31
+ * One HMR-incompatibility notice from the page runtime. `action` reflects
32
+ * what actually happened for *this* event, not just the configured default:
33
+ * 'reload' / 'warn' come from `hmr.onIncompatible`; 'none' is the
34
+ * `observed-attributes-changed` case, which never reloads regardless of that
35
+ * setting (the patch already succeeded).
36
+ */
37
+ export interface HmrIncompatibilityEvent {
38
+ tagName: string;
39
+ /** `Date.now()` in the browser — there is no shared clock with the timeline's `performance.now()`. */
40
+ time: number;
41
+ reason: HmrIncompatibilityReason;
42
+ action: 'reload' | 'warn' | 'none';
43
+ }
44
+ /** HMR channel the page runtime uses to report an {@link HmrIncompatibilityEvent}. */
45
+ export declare const HMR_INCOMPATIBLE_CHANNEL = "lit:hmr:incompatible";
46
+ /**
47
+ * How many events the node-side cache keeps, and the panel mirrors. A dev
48
+ * session with many failing edits must not grow either without bound; the
49
+ * newest are the ones worth keeping.
50
+ */
51
+ export declare const MAX_HMR_INCOMPATIBILITIES = 50;
52
+ /**
53
+ * Human-readable text for a reason, shared by the browser console message in
54
+ * `src/lib/runtime/patch.ts` and the DevTools panel's banner so the two can't
55
+ * drift apart. The wording of the first two cases is asserted verbatim by
56
+ * `src/test/unit/patch_test.ts` — it is part of the console output contract.
57
+ */
58
+ export declare const describeHmrReason: (reason: HmrIncompatibilityReason) => string;
59
+ //# sourceMappingURL=hmr-incompatibility.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hmr-incompatibility.d.ts","sourceRoot":"","sources":["../src/types/hmr-incompatibility.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;;GAcG;AAEH,kFAAkF;AAClF,MAAM,MAAM,wBAAwB,GAChC;IAAC,IAAI,EAAE,qBAAqB,CAAA;CAAC,GAC7B;IAAC,IAAI,EAAE,cAAc,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAC,GACtC;IAAC,IAAI,EAAE,6BAA6B,CAAA;CAAC,CAAC;AAE1C;;;;;;GAMG;AACH,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,sGAAsG;IACtG,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,wBAAwB,CAAC;IACjC,MAAM,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;CACpC;AAED,sFAAsF;AACtF,eAAO,MAAM,wBAAwB,yBAAyB,CAAC;AAE/D;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAE5C;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,WAAY,wBAAwB,KAAG,MASpE,CAAC"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Google LLC
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */
6
+ /** HMR channel the page runtime uses to report an {@link HmrIncompatibilityEvent}. */
7
+ export const HMR_INCOMPATIBLE_CHANNEL = 'lit:hmr:incompatible';
8
+ /**
9
+ * How many events the node-side cache keeps, and the panel mirrors. A dev
10
+ * session with many failing edits must not grow either without bound; the
11
+ * newest are the ones worth keeping.
12
+ */
13
+ export const MAX_HMR_INCOMPATIBILITIES = 50;
14
+ /**
15
+ * Human-readable text for a reason, shared by the browser console message in
16
+ * `src/lib/runtime/patch.ts` and the DevTools panel's banner so the two can't
17
+ * drift apart. The wording of the first two cases is asserted verbatim by
18
+ * `src/test/unit/patch_test.ts` — it is part of the console output contract.
19
+ */
20
+ export const describeHmrReason = (reason) => {
21
+ switch (reason.code) {
22
+ case 'accessor-decorators':
23
+ return 'standard accessor decorators';
24
+ case 'patch-failed':
25
+ return `patching failed: ${reason.detail}`;
26
+ case 'observed-attributes-changed':
27
+ return "observedAttributes changed; the platform registry can't pick this up";
28
+ }
29
+ };
30
+ //# sourceMappingURL=hmr-incompatibility.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hmr-incompatibility.js","sourceRoot":"","sources":["../src/types/hmr-incompatibility.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAuCH,sFAAsF;AACtF,MAAM,CAAC,MAAM,wBAAwB,GAAG,sBAAsB,CAAC;AAE/D;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAE5C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,MAAgC,EAAU,EAAE;IAC5E,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,qBAAqB;YACxB,OAAO,8BAA8B,CAAC;QACxC,KAAK,cAAc;YACjB,OAAO,oBAAoB,MAAM,CAAC,MAAM,EAAE,CAAC;QAC7C,KAAK,6BAA6B;YAChC,OAAO,sEAAsE,CAAC;IAClF,CAAC;AACH,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Shared types and channel constant for HMR-incompatibility reporting.\n *\n * When the browser runtime can't hot-patch a component in place it logs one\n * line to the console and, by default, full-reloads the page — which clears\n * the console before anyone reads it. These types carry the same reason, in\n * structured form, from the page runtime to the node side over the HMR\n * {@link HMR_INCOMPATIBLE_CHANNEL}, where it is cached so the DevTools panel\n * and an agent-facing query RPC can both read it back after the reload.\n *\n * The three reasons mirror the \"Cannot be patched in place\" cases documented\n * in `docs/src/content/docs/reference/limitations.mdx`; adding a fourth means\n * extending {@link HmrIncompatibilityReason} and {@link describeHmrReason}\n * together, plus the docs page.\n */\n\n/** Why a component couldn't be hot-patched in place, or a related silent case. */\nexport type HmrIncompatibilityReason =\n | {code: 'accessor-decorators'}\n | {code: 'patch-failed'; detail: string}\n | {code: 'observed-attributes-changed'};\n\n/**\n * One HMR-incompatibility notice from the page runtime. `action` reflects\n * what actually happened for *this* event, not just the configured default:\n * 'reload' / 'warn' come from `hmr.onIncompatible`; 'none' is the\n * `observed-attributes-changed` case, which never reloads regardless of that\n * setting (the patch already succeeded).\n */\nexport interface HmrIncompatibilityEvent {\n tagName: string;\n /** `Date.now()` in the browser — there is no shared clock with the timeline's `performance.now()`. */\n time: number;\n reason: HmrIncompatibilityReason;\n action: 'reload' | 'warn' | 'none';\n}\n\n/** HMR channel the page runtime uses to report an {@link HmrIncompatibilityEvent}. */\nexport const HMR_INCOMPATIBLE_CHANNEL = 'lit:hmr:incompatible';\n\n/**\n * How many events the node-side cache keeps, and the panel mirrors. A dev\n * session with many failing edits must not grow either without bound; the\n * newest are the ones worth keeping.\n */\nexport const MAX_HMR_INCOMPATIBILITIES = 50;\n\n/**\n * Human-readable text for a reason, shared by the browser console message in\n * `src/lib/runtime/patch.ts` and the DevTools panel's banner so the two can't\n * drift apart. The wording of the first two cases is asserted verbatim by\n * `src/test/unit/patch_test.ts` — it is part of the console output contract.\n */\nexport const describeHmrReason = (reason: HmrIncompatibilityReason): string => {\n switch (reason.code) {\n case 'accessor-decorators':\n return 'standard accessor decorators';\n case 'patch-failed':\n return `patching failed: ${reason.detail}`;\n case 'observed-attributes-changed':\n return \"observedAttributes changed; the platform registry can't pick this up\";\n }\n};\n"]}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Google LLC
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */
6
+ /**
7
+ * The direct page ↔ panel channel, for interactions that never need the node
8
+ * side.
9
+ *
10
+ * Everything else the Components tab does goes panel → node → page over RPC
11
+ * and Vite's HMR channel, and should keep going that way: the node side caches
12
+ * the tree and the last details so a panel that connects late has something to
13
+ * render, and so the MCP tools can answer without a panel open. None of that
14
+ * is true of the hover outline — it is pure page-local drawing, it is issued
15
+ * on every `mouseenter` in the tree, and nothing but the page itself ever
16
+ * wants to know about it.
17
+ *
18
+ * Devframe's in-page channel connects a page script to a panel iframe over a
19
+ * `MessageChannel` with no server in the path (same-origin, handshake by
20
+ * posting to the ancestor chain). Two consequences:
21
+ *
22
+ * - The outline stops paying a full round trip through node on every pointer
23
+ * move.
24
+ * - It keeps working where there is no node side at all, which is what a
25
+ * static snapshot of the panel needs to be more than a screenshot.
26
+ *
27
+ * The channel is best-effort by construction. A panel opened as its own tab
28
+ * has no ancestor page script to handshake with, so both sides must treat
29
+ * "not connected" as normal and fall back to the RPC path.
30
+ */
31
+ /** Channel name, shared by both endpoints. */
32
+ export declare const LIT_IN_PAGE_CHANNEL = "lit:in-page";
33
+ /**
34
+ * Contract for {@link LIT_IN_PAGE_CHANNEL}.
35
+ *
36
+ * `highlight` is an event, not a query: the panel does not want an answer, and
37
+ * a fire-and-forget emit is what keeps a hover cheap. `id` is the same stable
38
+ * numeric element id used everywhere else (the timeline's `idOf()` WeakMap),
39
+ * so a tree node, a details payload, and an outline all agree on identity.
40
+ * `null` clears the outline.
41
+ */
42
+ export interface LitInPageProtocol {
43
+ events: {
44
+ pageScript: {
45
+ highlight: (id: number | null) => void;
46
+ };
47
+ };
48
+ }
49
+ //# sourceMappingURL=in-page.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"in-page.d.ts","sourceRoot":"","sources":["../src/types/in-page.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,8CAA8C;AAC9C,eAAO,MAAM,mBAAmB,gBAAgB,CAAC;AAEjD;;;;;;;;GAQG;AACH,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE;QACN,UAAU,EAAE;YACV,SAAS,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;SACxC,CAAC;KACH,CAAC;CACH"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Google LLC
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */
6
+ /**
7
+ * The direct page ↔ panel channel, for interactions that never need the node
8
+ * side.
9
+ *
10
+ * Everything else the Components tab does goes panel → node → page over RPC
11
+ * and Vite's HMR channel, and should keep going that way: the node side caches
12
+ * the tree and the last details so a panel that connects late has something to
13
+ * render, and so the MCP tools can answer without a panel open. None of that
14
+ * is true of the hover outline — it is pure page-local drawing, it is issued
15
+ * on every `mouseenter` in the tree, and nothing but the page itself ever
16
+ * wants to know about it.
17
+ *
18
+ * Devframe's in-page channel connects a page script to a panel iframe over a
19
+ * `MessageChannel` with no server in the path (same-origin, handshake by
20
+ * posting to the ancestor chain). Two consequences:
21
+ *
22
+ * - The outline stops paying a full round trip through node on every pointer
23
+ * move.
24
+ * - It keeps working where there is no node side at all, which is what a
25
+ * static snapshot of the panel needs to be more than a screenshot.
26
+ *
27
+ * The channel is best-effort by construction. A panel opened as its own tab
28
+ * has no ancestor page script to handshake with, so both sides must treat
29
+ * "not connected" as normal and fall back to the RPC path.
30
+ */
31
+ /** Channel name, shared by both endpoints. */
32
+ export const LIT_IN_PAGE_CHANNEL = 'lit:in-page';
33
+ //# sourceMappingURL=in-page.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"in-page.js","sourceRoot":"","sources":["../src/types/in-page.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,8CAA8C;AAC9C,MAAM,CAAC,MAAM,mBAAmB,GAAG,aAAa,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * The direct page ↔ panel channel, for interactions that never need the node\n * side.\n *\n * Everything else the Components tab does goes panel → node → page over RPC\n * and Vite's HMR channel, and should keep going that way: the node side caches\n * the tree and the last details so a panel that connects late has something to\n * render, and so the MCP tools can answer without a panel open. None of that\n * is true of the hover outline — it is pure page-local drawing, it is issued\n * on every `mouseenter` in the tree, and nothing but the page itself ever\n * wants to know about it.\n *\n * Devframe's in-page channel connects a page script to a panel iframe over a\n * `MessageChannel` with no server in the path (same-origin, handshake by\n * posting to the ancestor chain). Two consequences:\n *\n * - The outline stops paying a full round trip through node on every pointer\n * move.\n * - It keeps working where there is no node side at all, which is what a\n * static snapshot of the panel needs to be more than a screenshot.\n *\n * The channel is best-effort by construction. A panel opened as its own tab\n * has no ancestor page script to handshake with, so both sides must treat\n * \"not connected\" as normal and fall back to the RPC path.\n */\n\n/** Channel name, shared by both endpoints. */\nexport const LIT_IN_PAGE_CHANNEL = 'lit:in-page';\n\n/**\n * Contract for {@link LIT_IN_PAGE_CHANNEL}.\n *\n * `highlight` is an event, not a query: the panel does not want an answer, and\n * a fire-and-forget emit is what keeps a hover cheap. `id` is the same stable\n * numeric element id used everywhere else (the timeline's `idOf()` WeakMap),\n * so a tree node, a details payload, and an outline all agree on identity.\n * `null` clears the outline.\n */\nexport interface LitInPageProtocol {\n events: {\n pageScript: {\n highlight: (id: number | null) => void;\n };\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"inspector.d.ts","sourceRoot":"","sources":["../../../packages/labs/vite-plugin-lit/src/types/inspector.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;;GAcG;AAEH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,yEAAyE;AACzE,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,QAAQ,EAAE,iBAAiB,EAAE,CAAC;CAC/B;AAED,4EAA4E;AAC5E,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,8DAA8D;IAC9D,KAAK,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,IAAI,EAAE,MAAM,CAAC;IACb,wEAAwE;IACxE,SAAS,EAAE,MAAM,GAAG,KAAK,CAAC;IAC1B,sDAAsD;IACtD,QAAQ,EAAE,OAAO,CAAC;IAClB,iEAAiE;IACjE,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,2DAA2D;AAC3D,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,UAAU,EAAE,KAAK,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,CAAC,CAAC;IACjD,UAAU,EAAE,aAAa,EAAE,CAAC;IAC5B,KAAK,EAAE;QACL,UAAU,EAAE,OAAO,CAAC;QACpB,eAAe,EAAE,OAAO,CAAC;QACzB,aAAa,EAAE,OAAO,CA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/vite-plugin-lit/src/types/inspector.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA8FH,iFAAiF;AACjF,MAAM,CAAC,MAAM,mBAAmB,GAAG,iBAAiB,CAAC;AAErD,4EAA4E;AAC5E,MAAM,CAAC,MAAM,oBAAoB,GAAG,kBAAkB,CAAC;AAEvD,6EAA6E;AAC7E,MAAM,CAAC,MAAM,8BAA8B,GAAG,6BAA6B,CAAC;AAE5E,wEAAwE;AACxE,MAAM,CAAC,MAAM,YAAY,GAAG,yBAAyB,CAAC;AAEtD,mFAAmF;AACnF,MAAM,CAAC,MAAM,iBAAiB,GAAG,SAAS,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Shared types and channel/path constants for the Components inspector.\n *\n * The inspector lets the DevTools panel show a hierarchical tree of the Lit\n * components on the page plus a detail view (reactive properties, internal\n * state, attributes, source) of a selected element. The panel can't touch the\n * page DOM directly (separate iframe document), so everything flows over the\n * existing transport: panel → server (POST {@link INSPECT_PATH}) → app runtime\n * (HMR {@link INSPECT_CMD_CHANNEL}); app → server (HMR\n * {@link INSPECT_DATA_CHANNEL}) → panel (SSE `event: {@link INSPECT_SSE_EVENT}`).\n *\n * Elements are referenced across the boundary by the stable numeric id from the\n * timeline's `idOf()` WeakMap, so a tree node, a details payload, and an\n * inspector pick all agree on identity.\n */\n\nexport interface ElementSource {\n file: string;\n line: number;\n}\n\n/** A node in the component render tree (one inspectable Lit element). */\nexport interface InspectorTreeNode {\n id: number;\n tagName: string;\n componentName?: string;\n source?: ElementSource;\n children: InspectorTreeNode[];\n}\n\n/** One reactive property (or internal `@state`) of an inspected element. */\nexport interface InspectorProp {\n name: string;\n /** Serialized, depth-limited preview of the current value. */\n value: string;\n /** A short type tag (`string`, `number`, `Array(3)`, `MyClass`, …). */\n type: string;\n /** The reflected attribute name, or `false` when `attribute: false`. */\n attribute: string | false;\n /** Whether the property reflects to its attribute. */\n reflects: boolean;\n /** Whether it's an internal `@state()` (no public attribute). */\n state: boolean;\n}\n\n/** Full detail snapshot for a single inspected element. */\nexport interface InspectorDetails {\n id: number;\n tagName: string;\n componentName?: string;\n source?: ElementSource;\n attributes: Array<{name: string; value: string}>;\n properties: InspectorProp[];\n flags: {\n hasUpdated: boolean;\n isUpdatePending: boolean;\n hasShadowRoot: boolean;\n };\n}\n\n/** App runtime → panel messages, carried on SSE `event: inspect`. */\nexport type InspectorMessage =\n /** The runtime came online; the panel should (re)request the tree. */\n | {type: 'ready'}\n | {type: 'tree'; roots: InspectorTreeNode[]}\n | {type: 'details'; details: InspectorDetails}\n /** The requested element id couldn't be resolved (removed / GC'd). */\n | {type: 'gone'; id: number}\n /** An inspect-mode overlay pick — select this element in the panel. */\n | {type: 'pick'; id: number};\n\n/** Panel → app runtime commands, POSTed to {@link INSPECT_PATH}. */\nexport type InspectorCommand =\n | {type: 'tree'}\n | {type: 'details'; id: number}\n /** Keep pushing fresh details for `id` as it updates; `null` stops. */\n | {type: 'watch'; id: number | null}\n /** Outline element `id` in the page on tree hover; `null` clears it. */\n | {type: 'highlight'; id: number | null}\n /**\n * Opt-in live tree: when enabled, the runtime watches the DOM and pushes a\n * fresh `tree` message whenever the component hierarchy changes. Off by\n * default (the panel otherwise refreshes on demand / on pick).\n */\n | {type: 'observe'; enabled: boolean}\n /**\n * Start the overlay's inspect-mode picker (the panel's \"Pick\" button). Handled\n * by the server (it broadcasts {@link INSPECT_OVERLAY_TOGGLE_CHANNEL}), not the\n * app runtime, so it never reaches the runtime's command handler.\n */\n | {type: 'pick'};\n\n/** HMR channel the server uses to forward a panel command to the app runtime. */\nexport const INSPECT_CMD_CHANNEL = 'lit:inspect:cmd';\n\n/** HMR channel the app runtime uses to push an {@link InspectorMessage}. */\nexport const INSPECT_DATA_CHANNEL = 'lit:inspect:data';\n\n/** Vite HMR channel the DevTools \"inspect element\" command broadcasts on. */\nexport const INSPECT_OVERLAY_TOGGLE_CHANNEL = 'lit-devtools:toggle-inspect';\n\n/** POST endpoint the panel uses to send an {@link InspectorCommand}. */\nexport const INSPECT_PATH = '/__lit-devtools-inspect';\n\n/** Named SSE event the server relays {@link InspectorMessage}s to the panel on. */\nexport const INSPECT_SSE_EVENT = 'inspect';\n"]}
1
+ {"version":3,"file":"inspector.js","sourceRoot":"","sources":["../src/types/inspector.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA8FH,iFAAiF;AACjF,MAAM,CAAC,MAAM,mBAAmB,GAAG,iBAAiB,CAAC;AAErD,4EAA4E;AAC5E,MAAM,CAAC,MAAM,oBAAoB,GAAG,kBAAkB,CAAC;AAEvD,6EAA6E;AAC7E,MAAM,CAAC,MAAM,8BAA8B,GAAG,6BAA6B,CAAC;AAE5E,wEAAwE;AACxE,MAAM,CAAC,MAAM,YAAY,GAAG,yBAAyB,CAAC;AAEtD,mFAAmF;AACnF,MAAM,CAAC,MAAM,iBAAiB,GAAG,SAAS,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Shared types and channel/path constants for the Components inspector.\n *\n * The inspector lets the DevTools panel show a hierarchical tree of the Lit\n * components on the page plus a detail view (reactive properties, internal\n * state, attributes, source) of a selected element. The panel can't touch the\n * page DOM directly (separate iframe document), so everything flows over the\n * existing transport: panel → server (POST {@link INSPECT_PATH}) → app runtime\n * (HMR {@link INSPECT_CMD_CHANNEL}); app → server (HMR\n * {@link INSPECT_DATA_CHANNEL}) → panel (SSE `event: {@link INSPECT_SSE_EVENT}`).\n *\n * Elements are referenced across the boundary by the stable numeric id from the\n * timeline's `idOf()` WeakMap, so a tree node, a details payload, and an\n * inspector pick all agree on identity.\n */\n\nexport interface ElementSource {\n file: string;\n line: number;\n}\n\n/** A node in the component render tree (one inspectable Lit element). */\nexport interface InspectorTreeNode {\n id: number;\n tagName: string;\n componentName?: string;\n source?: ElementSource;\n children: InspectorTreeNode[];\n}\n\n/** One reactive property (or internal `@state`) of an inspected element. */\nexport interface InspectorProp {\n name: string;\n /** Serialized, depth-limited preview of the current value. */\n value: string;\n /** A short type tag (`string`, `number`, `Array(3)`, `MyClass`, …). */\n type: string;\n /** The reflected attribute name, or `false` when `attribute: false`. */\n attribute: string | false;\n /** Whether the property reflects to its attribute. */\n reflects: boolean;\n /** Whether it's an internal `@state()` (no public attribute). */\n state: boolean;\n}\n\n/** Full detail snapshot for a single inspected element. */\nexport interface InspectorDetails {\n id: number;\n tagName: string;\n componentName?: string;\n source?: ElementSource;\n attributes: Array<{name: string; value: string}>;\n properties: InspectorProp[];\n flags: {\n hasUpdated: boolean;\n isUpdatePending: boolean;\n hasShadowRoot: boolean;\n };\n}\n\n/** App runtime → panel messages, carried on SSE `event: inspect`. */\nexport type InspectorMessage =\n /** The runtime came online; the panel should (re)request the tree. */\n | {type: 'ready'}\n | {type: 'tree'; roots: InspectorTreeNode[]}\n | {type: 'details'; details: InspectorDetails}\n /** The requested element id couldn't be resolved (removed / GC'd). */\n | {type: 'gone'; id: number}\n /** An inspect-mode overlay pick — select this element in the panel. */\n | {type: 'pick'; id: number};\n\n/** Panel → app runtime commands, POSTed to {@link INSPECT_PATH}. */\nexport type InspectorCommand =\n | {type: 'tree'}\n | {type: 'details'; id: number}\n /** Keep pushing fresh details for `id` as it updates; `null` stops. */\n | {type: 'watch'; id: number | null}\n /** Outline element `id` in the page on tree hover; `null` clears it. */\n | {type: 'highlight'; id: number | null}\n /**\n * Opt-in live tree: when enabled, the runtime watches the DOM and pushes a\n * fresh `tree` message whenever the component hierarchy changes. Off by\n * default (the panel otherwise refreshes on demand / on pick).\n */\n | {type: 'observe'; enabled: boolean}\n /**\n * Start the overlay's inspect-mode picker (the panel's \"Pick\" button). Handled\n * by the server (it broadcasts {@link INSPECT_OVERLAY_TOGGLE_CHANNEL}), not the\n * app runtime, so it never reaches the runtime's command handler.\n */\n | {type: 'pick'};\n\n/** HMR channel the server uses to forward a panel command to the app runtime. */\nexport const INSPECT_CMD_CHANNEL = 'lit:inspect:cmd';\n\n/** HMR channel the app runtime uses to push an {@link InspectorMessage}. */\nexport const INSPECT_DATA_CHANNEL = 'lit:inspect:data';\n\n/** Vite HMR channel the DevTools \"inspect element\" command broadcasts on. */\nexport const INSPECT_OVERLAY_TOGGLE_CHANNEL = 'lit-devtools:toggle-inspect';\n\n/** POST endpoint the panel uses to send an {@link InspectorCommand}. */\nexport const INSPECT_PATH = '/__lit-devtools-inspect';\n\n/** Named SSE event the server relays {@link InspectorMessage}s to the panel on. */\nexport const INSPECT_SSE_EVENT = 'inspect';\n"]}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Google LLC
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */
6
+ /**
7
+ * A recorded DevTools session, frozen so someone else can open it.
8
+ *
9
+ * The point is not "a static copy of the panel". It is a bug report a
10
+ * maintainer can actually act on: the timeline of what happened, the component
11
+ * tree as it stood, the details of the components that were inspected, and any
12
+ * HMR incompatibilities that fired — opened in a browser with no checkout of
13
+ * the reporter's app and no reproduction steps.
14
+ *
15
+ * Everything here is already in the node side's hands during a live session
16
+ * (see `lib/devframe/definition.ts`, which caches exactly these four things),
17
+ * which is why capture needs no new transport: the dev server exports its own
18
+ * state.
19
+ */
20
+ import type { HmrIncompatibilityEvent } from './hmr-incompatibility.js';
21
+ import type { InspectorDetails, InspectorTreeNode } from './inspector.js';
22
+ import type { TimelineEvent, TimelineLayer } from './timeline.js';
23
+ /** Everything a frozen panel needs to render a past session. */
24
+ export interface SessionSnapshot {
25
+ /** ISO timestamp of the export, shown by the frozen panel. */
26
+ capturedAt: string;
27
+ /** Plugin version the session was recorded on. */
28
+ version: string;
29
+ /** Custom layers registered by the app, so recorded events keep their labels. */
30
+ customLayers: TimelineLayer[];
31
+ /** The component tree as it stood at export time. */
32
+ roots: InspectorTreeNode[];
33
+ /**
34
+ * Details for every component whose details were fetched during the
35
+ * session. Only these ids can be baked — details are collected from live
36
+ * DOM, so a component nobody opened has none to freeze.
37
+ */
38
+ details: InspectorDetails[];
39
+ /** The recorded timeline, up to the node side's ring-buffer cap. */
40
+ events: TimelineEvent[];
41
+ /** HMR incompatibilities reported during the session. */
42
+ hmrIncompatibilities: HmrIncompatibilityEvent[];
43
+ }
44
+ //# sourceMappingURL=snapshot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snapshot.d.ts","sourceRoot":"","sources":["../src/types/snapshot.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,0BAA0B,CAAC;AACtE,OAAO,KAAK,EAAC,gBAAgB,EAAE,iBAAiB,EAAC,MAAM,gBAAgB,CAAC;AACxE,OAAO,KAAK,EAAC,aAAa,EAAE,aAAa,EAAC,MAAM,eAAe,CAAC;AAEhE,gEAAgE;AAChE,MAAM,WAAW,eAAe;IAC9B,8DAA8D;IAC9D,UAAU,EAAE,MAAM,CAAC;IACnB,kDAAkD;IAClD,OAAO,EAAE,MAAM,CAAC;IAChB,iFAAiF;IACjF,YAAY,EAAE,aAAa,EAAE,CAAC;IAC9B,qDAAqD;IACrD,KAAK,EAAE,iBAAiB,EAAE,CAAC;IAC3B;;;;OAIG;IACH,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,oEAAoE;IACpE,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,yDAAyD;IACzD,oBAAoB,EAAE,uBAAuB,EAAE,CAAC;CACjD"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Google LLC
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=snapshot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snapshot.js","sourceRoot":"","sources":["../src/types/snapshot.ts"],"names":[],"mappings":"AAAA;;;;GAIG","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * A recorded DevTools session, frozen so someone else can open it.\n *\n * The point is not \"a static copy of the panel\". It is a bug report a\n * maintainer can actually act on: the timeline of what happened, the component\n * tree as it stood, the details of the components that were inspected, and any\n * HMR incompatibilities that fired — opened in a browser with no checkout of\n * the reporter's app and no reproduction steps.\n *\n * Everything here is already in the node side's hands during a live session\n * (see `lib/devframe/definition.ts`, which caches exactly these four things),\n * which is why capture needs no new transport: the dev server exports its own\n * state.\n */\n\nimport type {HmrIncompatibilityEvent} from './hmr-incompatibility.js';\nimport type {InspectorDetails, InspectorTreeNode} from './inspector.js';\nimport type {TimelineEvent, TimelineLayer} from './timeline.js';\n\n/** Everything a frozen panel needs to render a past session. */\nexport interface SessionSnapshot {\n /** ISO timestamp of the export, shown by the frozen panel. */\n capturedAt: string;\n /** Plugin version the session was recorded on. */\n version: string;\n /** Custom layers registered by the app, so recorded events keep their labels. */\n customLayers: TimelineLayer[];\n /** The component tree as it stood at export time. */\n roots: InspectorTreeNode[];\n /**\n * Details for every component whose details were fetched during the\n * session. Only these ids can be baked — details are collected from live\n * DOM, so a component nobody opened has none to freeze.\n */\n details: InspectorDetails[];\n /** The recorded timeline, up to the node side's ring-buffer cap. */\n events: TimelineEvent[];\n /** HMR incompatibilities reported during the session. */\n hmrIncompatibilities: HmrIncompatibilityEvent[];\n}\n"]}
@@ -10,7 +10,11 @@ export interface TimelineLayer {
10
10
  }
11
11
  export interface TimelineEvent<TData = unknown> {
12
12
  layerId: string;
13
- /** `performance.now()` timestamp in the browser. */
13
+ /**
14
+ * Milliseconds since recording started, stamped in the browser page
15
+ * (`performance.now()` re-zeroed on each recording start; see
16
+ * `runtime/timeline/clock.ts`). Not comparable to any Node-side clock.
17
+ */
14
18
  time: number;
15
19
  data: TData;
16
20
  title?: string;
@@ -31,6 +35,13 @@ export interface TimelineLayersState {
31
35
  recordingState: boolean;
32
36
  litLifecycleEnabled: boolean;
33
37
  litRenderEnabled: boolean;
38
+ /**
39
+ * Per-part `lit-debug` events (`template updating`, `set part`, `commit
40
+ * *`, …) — one per binding on *every* render, so a ticking clock or
41
+ * animation floods the layer. Off by default; the `lit-render` layer's
42
+ * begin/end render pair already covers the common case.
43
+ */
44
+ litRenderVerboseEnabled: boolean;
34
45
  mouseEventEnabled: boolean;
35
46
  keyboardEventEnabled: boolean;
36
47
  }
@@ -77,6 +88,17 @@ export interface SettingsOverride {
77
88
  hmrIndicatorCount?: boolean;
78
89
  /** Built-in editor key for the source overlay's open-in-editor target. */
79
90
  sourceOverlayEditor?: string;
91
+ /**
92
+ * Flash a short outline over every Lit element that completes an update.
93
+ * Pure preference (no config-time baseline), so `undefined` reads as off.
94
+ */
95
+ flashUpdates?: boolean;
96
+ /**
97
+ * Colour the flash by how often the element updated in the last second,
98
+ * calm to hot, instead of one flat colour. Only meaningful with
99
+ * {@link SettingsOverride.flashUpdates}.
100
+ */
101
+ flashUpdatesRamp?: boolean;
80
102
  }
81
103
  /**
82
104
  * Built-in editors the source overlay can open files in. Keep in sync with
@@ -1 +1 @@
1
- {"version":3,"file":"timeline.d.ts","sourceRoot":"","sources":["../../../packages/labs/vite-plugin-lit/src/types/timeline.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,aAAa,CAAC,KAAK,GAAG,OAAO;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,KAAK,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gFAAgF;IAChF,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IAC1C,IAAI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eAAO,MAAM,6BAA6B,uCACJ,CAAC"}
package/types/timeline.js CHANGED
@@ -6,6 +6,7 @@
6
6
  export const TIMELINE_LAYERS = [
7
7
  { id: 'lit-lifecycle', label: 'Lit Lifecycle', color: 0x4d63ff },
8
8
  { id: 'lit-render', label: 'Lit Render', color: 0x325cff },
9
+ { id: 'lit-render-verbose', label: 'Lit Render (verbose)', color: 0x99aeff },
9
10
  { id: 'mouse', label: 'Mouse', color: 0xa451af },
10
11
  { id: 'keyboard', label: 'Keyboard', color: 0x8151af },
11
12
  ];
@@ -13,6 +14,7 @@ export const DEFAULT_LAYERS_STATE = {
13
14
  recordingState: false,
14
15
  litLifecycleEnabled: true,
15
16
  litRenderEnabled: true,
17
+ litRenderVerboseEnabled: false,
16
18
  mouseEventEnabled: false,
17
19
  keyboardEventEnabled: false,
18
20
  };
@@ -1 +1 @@
1
- {"version":3,"file":"timeline.js","sourceRoot":"","sources":["../../../packages/labs/vite-plugin-lit/src/types/timeline.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAiCH,MAAM,CAAC,MAAM,eAAe,GAA6B;IACvD,EAAC,EAAE,EAAE,eAAe,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,QAAQ,EAAC;IAC9D,EAAC,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,QAAQ,EAAC;IACxD,EAAC,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAC;IAC9C,EAAC,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAC;CACrD,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAwB;IACvD,cAAc,EAAE,KAAK;IACrB,mBAAmB,EAAE,IAAI;IACzB,gBAAgB,EAAE,IAAI;IACtB,iBAAiB,EAAE,KAAK;IACxB,oBAAoB,EAAE,KAAK;CAC5B,CAAC;AA8CF;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAG9B;IACH,EAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAC;IACnC,EAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAC;IAClC,EAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAC;IAC5B,EAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAC;IAClC,EAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAC;CACvC,CAAC;AAEF,6DAA6D;AAC7D,MAAM,CAAC,MAAM,wBAAwB,GAAG,wBAAwB,CAAC;AAEjE,6EAA6E;AAC7E,MAAM,CAAC,MAAM,yBAAyB,GAAG,gCAAgC,CAAC;AAE1E;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GACxC,oCAAoC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nexport interface TimelineLayer {\n id: string;\n label: string;\n color: number; // 0xRRGGBB\n}\n\nexport interface TimelineEvent<TData = unknown> {\n layerId: string;\n /** `performance.now()` timestamp in the browser. */\n time: number;\n data: TData;\n title?: string;\n subtitle?: string;\n /** Pairs a start event with its matching end event in the same update group. */\n groupId?: number | string;\n logType?: 'default' | 'warning' | 'error';\n meta?: {\n elementId?: number;\n tagName?: string;\n source?: {file: string; line: number};\n };\n}\n\nexport interface TimelineLayersState {\n recordingState: boolean;\n litLifecycleEnabled: boolean;\n litRenderEnabled: boolean;\n mouseEventEnabled: boolean;\n keyboardEventEnabled: boolean;\n}\n\nexport const TIMELINE_LAYERS: readonly TimelineLayer[] = [\n {id: 'lit-lifecycle', label: 'Lit Lifecycle', color: 0x4d63ff},\n {id: 'lit-render', label: 'Lit Render', color: 0x325cff},\n {id: 'mouse', label: 'Mouse', color: 0xa451af},\n {id: 'keyboard', label: 'Keyboard', color: 0x8151af},\n];\n\nexport const DEFAULT_LAYERS_STATE: TimelineLayersState = {\n recordingState: false,\n litLifecycleEnabled: true,\n litRenderEnabled: true,\n mouseEventEnabled: false,\n keyboardEventEnabled: false,\n};\n\n/**\n * Snapshot of the plugin's resolved feature settings, surfaced in the panel's\n * Settings tab. The plugin produces this at config time (explicit options >\n * LIT_PLUGIN_* env > defaults) and serves it from the panel server. It's the\n * baseline the panel shows; some HMR settings can then be overridden live (see\n * {@link SettingsOverride}).\n */\nexport interface FeatureSettings {\n hmr: {\n enabled: boolean;\n reconnect: boolean;\n onIncompatible: 'reload' | 'warn';\n indicatorEnabled: boolean;\n indicatorCount: boolean;\n };\n sourceOverlay: {\n enabled: boolean;\n /** Hotkey letter combined with Ctrl+Shift to toggle the overlay. */\n key: string;\n editor: string;\n throttleMs: number;\n };\n timeline: boolean;\n}\n\n/**\n * Runtime overrides the panel applies on top of the resolved env config, for\n * settings whose runtime is already injected (so they can change live). A\n * feature disabled at config time has no runtime, so it can't be enabled here\n * — only the behaviour of already-enabled features is overridable.\n *\n * Persisted under {@link SETTINGS_OVERRIDE_LS_KEY} (the panel and app share an\n * origin) so overrides survive reloads, and pushed live over\n * {@link SETTINGS_OVERRIDE_CHANNEL} via Vite HMR for immediate effect.\n */\nexport interface SettingsOverride {\n hmrReconnect?: boolean;\n hmrOnIncompatible?: 'reload' | 'warn';\n hmrIndicatorVisible?: boolean;\n hmrIndicatorCount?: boolean;\n /** Built-in editor key for the source overlay's open-in-editor target. */\n sourceOverlayEditor?: string;\n}\n\n/**\n * Built-in editors the source overlay can open files in. Keep in sync with\n * BUILTIN_EDITORS in lib/runtime/source-overlay/editors.ts.\n */\nexport const SOURCE_OVERLAY_EDITORS: ReadonlyArray<{\n value: string;\n label: string;\n}> = [\n {value: 'vscode', label: 'VS Code'},\n {value: 'cursor', label: 'Cursor'},\n {value: 'zed', label: 'Zed'},\n {value: 'idea', label: 'IntelliJ'},\n {value: 'windsurf', label: 'Windsurf'},\n];\n\n/** localStorage key holding the {@link SettingsOverride}. */\nexport const SETTINGS_OVERRIDE_LS_KEY = 'lit-devtools-overrides';\n\n/** Vite HMR channel the server uses to push overrides to the app runtime. */\nexport const SETTINGS_OVERRIDE_CHANNEL = 'lit-devtools:settings-override';\n\n/**\n * Vite HMR channel the DevTools \"toggle source overlay\" command uses to tell\n * the app runtime to toggle the overlay (the command handler runs server-side).\n */\nexport const SOURCE_OVERLAY_TOGGLE_CHANNEL =\n 'lit-devtools:toggle-source-overlay';\n"]}
1
+ {"version":3,"file":"timeline.js","sourceRoot":"","sources":["../src/types/timeline.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA4CH,MAAM,CAAC,MAAM,eAAe,GAA6B;IACvD,EAAC,EAAE,EAAE,eAAe,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,QAAQ,EAAC;IAC9D,EAAC,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,QAAQ,EAAC;IACxD,EAAC,EAAE,EAAE,oBAAoB,EAAE,KAAK,EAAE,sBAAsB,EAAE,KAAK,EAAE,QAAQ,EAAC;IAC1E,EAAC,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAC;IAC9C,EAAC,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAC;CACrD,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAwB;IACvD,cAAc,EAAE,KAAK;IACrB,mBAAmB,EAAE,IAAI;IACzB,gBAAgB,EAAE,IAAI;IACtB,uBAAuB,EAAE,KAAK;IAC9B,iBAAiB,EAAE,KAAK;IACxB,oBAAoB,EAAE,KAAK;CAC5B,CAAC;AAyDF;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAG9B;IACH,EAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAC;IACnC,EAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAC;IAClC,EAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAC;IAC5B,EAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAC;IAClC,EAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAC;CACvC,CAAC;AAEF,6DAA6D;AAC7D,MAAM,CAAC,MAAM,wBAAwB,GAAG,wBAAwB,CAAC;AAEjE,6EAA6E;AAC7E,MAAM,CAAC,MAAM,yBAAyB,GAAG,gCAAgC,CAAC;AAE1E;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GACxC,oCAAoC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nexport interface TimelineLayer {\n id: string;\n label: string;\n color: number; // 0xRRGGBB\n}\n\nexport interface TimelineEvent<TData = unknown> {\n layerId: string;\n /**\n * Milliseconds since recording started, stamped in the browser page\n * (`performance.now()` re-zeroed on each recording start; see\n * `runtime/timeline/clock.ts`). Not comparable to any Node-side clock.\n */\n time: number;\n data: TData;\n title?: string;\n subtitle?: string;\n /** Pairs a start event with its matching end event in the same update group. */\n groupId?: number | string;\n logType?: 'default' | 'warning' | 'error';\n meta?: {\n elementId?: number;\n tagName?: string;\n source?: {file: string; line: number};\n };\n}\n\nexport interface TimelineLayersState {\n recordingState: boolean;\n litLifecycleEnabled: boolean;\n litRenderEnabled: boolean;\n /**\n * Per-part `lit-debug` events (`template updating`, `set part`, `commit\n * *`, …) — one per binding on *every* render, so a ticking clock or\n * animation floods the layer. Off by default; the `lit-render` layer's\n * begin/end render pair already covers the common case.\n */\n litRenderVerboseEnabled: boolean;\n mouseEventEnabled: boolean;\n keyboardEventEnabled: boolean;\n}\n\nexport const TIMELINE_LAYERS: readonly TimelineLayer[] = [\n {id: 'lit-lifecycle', label: 'Lit Lifecycle', color: 0x4d63ff},\n {id: 'lit-render', label: 'Lit Render', color: 0x325cff},\n {id: 'lit-render-verbose', label: 'Lit Render (verbose)', color: 0x99aeff},\n {id: 'mouse', label: 'Mouse', color: 0xa451af},\n {id: 'keyboard', label: 'Keyboard', color: 0x8151af},\n];\n\nexport const DEFAULT_LAYERS_STATE: TimelineLayersState = {\n recordingState: false,\n litLifecycleEnabled: true,\n litRenderEnabled: true,\n litRenderVerboseEnabled: false,\n mouseEventEnabled: false,\n keyboardEventEnabled: false,\n};\n\n/**\n * Snapshot of the plugin's resolved feature settings, surfaced in the panel's\n * Settings tab. The plugin produces this at config time (explicit options >\n * LIT_PLUGIN_* env > defaults) and serves it from the panel server. It's the\n * baseline the panel shows; some HMR settings can then be overridden live (see\n * {@link SettingsOverride}).\n */\nexport interface FeatureSettings {\n hmr: {\n enabled: boolean;\n reconnect: boolean;\n onIncompatible: 'reload' | 'warn';\n indicatorEnabled: boolean;\n indicatorCount: boolean;\n };\n sourceOverlay: {\n enabled: boolean;\n /** Hotkey letter combined with Ctrl+Shift to toggle the overlay. */\n key: string;\n editor: string;\n throttleMs: number;\n };\n timeline: boolean;\n}\n\n/**\n * Runtime overrides the panel applies on top of the resolved env config, for\n * settings whose runtime is already injected (so they can change live). A\n * feature disabled at config time has no runtime, so it can't be enabled here\n * — only the behaviour of already-enabled features is overridable.\n *\n * Persisted under {@link SETTINGS_OVERRIDE_LS_KEY} (the panel and app share an\n * origin) so overrides survive reloads, and pushed live over\n * {@link SETTINGS_OVERRIDE_CHANNEL} via Vite HMR for immediate effect.\n */\nexport interface SettingsOverride {\n hmrReconnect?: boolean;\n hmrOnIncompatible?: 'reload' | 'warn';\n hmrIndicatorVisible?: boolean;\n hmrIndicatorCount?: boolean;\n /** Built-in editor key for the source overlay's open-in-editor target. */\n sourceOverlayEditor?: string;\n /**\n * Flash a short outline over every Lit element that completes an update.\n * Pure preference (no config-time baseline), so `undefined` reads as off.\n */\n flashUpdates?: boolean;\n /**\n * Colour the flash by how often the element updated in the last second,\n * calm to hot, instead of one flat colour. Only meaningful with\n * {@link SettingsOverride.flashUpdates}.\n */\n flashUpdatesRamp?: boolean;\n}\n\n/**\n * Built-in editors the source overlay can open files in. Keep in sync with\n * BUILTIN_EDITORS in lib/runtime/source-overlay/editors.ts.\n */\nexport const SOURCE_OVERLAY_EDITORS: ReadonlyArray<{\n value: string;\n label: string;\n}> = [\n {value: 'vscode', label: 'VS Code'},\n {value: 'cursor', label: 'Cursor'},\n {value: 'zed', label: 'Zed'},\n {value: 'idea', label: 'IntelliJ'},\n {value: 'windsurf', label: 'Windsurf'},\n];\n\n/** localStorage key holding the {@link SettingsOverride}. */\nexport const SETTINGS_OVERRIDE_LS_KEY = 'lit-devtools-overrides';\n\n/** Vite HMR channel the server uses to push overrides to the app runtime. */\nexport const SETTINGS_OVERRIDE_CHANNEL = 'lit-devtools:settings-override';\n\n/**\n * Vite HMR channel the DevTools \"toggle source overlay\" command uses to tell\n * the app runtime to toggle the overlay (the command handler runs server-side).\n */\nexport const SOURCE_OVERLAY_TOGGLE_CHANNEL =\n 'lit-devtools:toggle-source-overlay';\n"]}