@oddsquad/vite-plugin-lit 0.7.0 → 0.8.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 (292) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/LICENSE +1 -1
  3. package/README.md +14 -7
  4. package/bin.mjs +2 -8
  5. package/client.d.ts +0 -6
  6. package/dist/client/assets/{browser-agent-rpc-BXhoSh1z-BuCvPGjS.js → browser-agent-rpc-BXhoSh1z-ybEeG-x9.js} +2 -2
  7. package/dist/client/assets/{browser-agent-rpc-BXhoSh1z-BuCvPGjS.js.map → browser-agent-rpc-BXhoSh1z-ybEeG-x9.js.map} +1 -1
  8. package/dist/client/assets/{index-D632jo79.js → index-CgkhETVR.js} +2 -144
  9. package/dist/client/assets/index-CgkhETVR.js.map +1 -0
  10. package/dist/client/index.html +1 -1
  11. package/dist/standalone/lit-devtools.js +2 -105
  12. package/index.d.ts +0 -5
  13. package/index.d.ts.map +1 -1
  14. package/index.js +1 -5
  15. package/index.js.map +1 -1
  16. package/lib/color-scheme.d.ts +0 -5
  17. package/lib/color-scheme.d.ts.map +1 -1
  18. package/lib/color-scheme.js +0 -5
  19. package/lib/color-scheme.js.map +1 -1
  20. package/lib/confine.d.ts +0 -5
  21. package/lib/confine.d.ts.map +1 -1
  22. package/lib/confine.js +0 -5
  23. package/lib/confine.js.map +1 -1
  24. package/lib/devframe/allowed-origins.d.ts +11 -3
  25. package/lib/devframe/allowed-origins.d.ts.map +1 -1
  26. package/lib/devframe/allowed-origins.js +0 -5
  27. package/lib/devframe/allowed-origins.js.map +1 -1
  28. package/lib/devframe/definition.d.ts +7 -3
  29. package/lib/devframe/definition.d.ts.map +1 -1
  30. package/lib/devframe/definition.js +1 -6
  31. package/lib/devframe/definition.js.map +1 -1
  32. package/lib/devframe/icon.d.ts +0 -5
  33. package/lib/devframe/icon.d.ts.map +1 -1
  34. package/lib/devframe/icon.js +0 -5
  35. package/lib/devframe/icon.js.map +1 -1
  36. package/lib/devframe/launch-editor.d.ts +0 -5
  37. package/lib/devframe/launch-editor.d.ts.map +1 -1
  38. package/lib/devframe/launch-editor.js +0 -5
  39. package/lib/devframe/launch-editor.js.map +1 -1
  40. package/lib/devframe/paths.d.ts +8 -3
  41. package/lib/devframe/paths.d.ts.map +1 -1
  42. package/lib/devframe/paths.js +0 -5
  43. package/lib/devframe/paths.js.map +1 -1
  44. package/lib/devframe/protocol.d.ts +6 -3
  45. package/lib/devframe/protocol.d.ts.map +1 -1
  46. package/lib/devframe/protocol.js +0 -5
  47. package/lib/devframe/protocol.js.map +1 -1
  48. package/lib/devframe/rpc-source.d.ts +15 -3
  49. package/lib/devframe/rpc-source.d.ts.map +1 -1
  50. package/lib/devframe/rpc-source.js +0 -5
  51. package/lib/devframe/rpc-source.js.map +1 -1
  52. package/lib/devframe/source.d.ts +0 -5
  53. package/lib/devframe/source.d.ts.map +1 -1
  54. package/lib/devframe/source.js +7 -3
  55. package/lib/devframe/source.js.map +1 -1
  56. package/lib/devframe/vite.d.ts +0 -5
  57. package/lib/devframe/vite.d.ts.map +1 -1
  58. package/lib/devframe/vite.js +16 -3
  59. package/lib/devframe/vite.js.map +1 -1
  60. package/lib/http.d.ts +0 -5
  61. package/lib/http.d.ts.map +1 -1
  62. package/lib/http.js +0 -5
  63. package/lib/http.js.map +1 -1
  64. package/lib/icons.d.ts +0 -5
  65. package/lib/icons.d.ts.map +1 -1
  66. package/lib/icons.js +0 -5
  67. package/lib/icons.js.map +1 -1
  68. package/lib/options.d.ts +0 -5
  69. package/lib/options.d.ts.map +1 -1
  70. package/lib/options.js +0 -5
  71. package/lib/options.js.map +1 -1
  72. package/lib/override-baselines.d.ts +0 -5
  73. package/lib/override-baselines.d.ts.map +1 -1
  74. package/lib/override-baselines.js +0 -5
  75. package/lib/override-baselines.js.map +1 -1
  76. package/lib/plugin.d.ts +0 -5
  77. package/lib/plugin.d.ts.map +1 -1
  78. package/lib/plugin.js +0 -5
  79. package/lib/plugin.js.map +1 -1
  80. package/lib/plugins/css-literals.d.ts +0 -5
  81. package/lib/plugins/css-literals.d.ts.map +1 -1
  82. package/lib/plugins/css-literals.js +0 -5
  83. package/lib/plugins/css-literals.js.map +1 -1
  84. package/lib/plugins/css-queries.d.ts +0 -5
  85. package/lib/plugins/css-queries.d.ts.map +1 -1
  86. package/lib/plugins/css-queries.js +0 -5
  87. package/lib/plugins/css-queries.js.map +1 -1
  88. package/lib/plugins/open-in-editor.d.ts +0 -5
  89. package/lib/plugins/open-in-editor.d.ts.map +1 -1
  90. package/lib/plugins/open-in-editor.js +0 -5
  91. package/lib/plugins/open-in-editor.js.map +1 -1
  92. package/lib/plugins/private-fields.d.ts +0 -5
  93. package/lib/plugins/private-fields.d.ts.map +1 -1
  94. package/lib/plugins/private-fields.js +0 -5
  95. package/lib/plugins/private-fields.js.map +1 -1
  96. package/lib/plugins/shared.d.ts +0 -5
  97. package/lib/plugins/shared.d.ts.map +1 -1
  98. package/lib/plugins/shared.js +0 -5
  99. package/lib/plugins/shared.js.map +1 -1
  100. package/lib/plugins/timeline-virtual.d.ts +0 -5
  101. package/lib/plugins/timeline-virtual.d.ts.map +1 -1
  102. package/lib/plugins/timeline-virtual.js +0 -5
  103. package/lib/plugins/timeline-virtual.js.map +1 -1
  104. package/lib/runtime/child-state.d.ts +0 -5
  105. package/lib/runtime/child-state.d.ts.map +1 -1
  106. package/lib/runtime/child-state.js +18 -3
  107. package/lib/runtime/child-state.js.map +1 -1
  108. package/lib/runtime/css.d.ts +14 -3
  109. package/lib/runtime/css.d.ts.map +1 -1
  110. package/lib/runtime/css.js +3 -5
  111. package/lib/runtime/css.js.map +1 -1
  112. package/lib/runtime/edge-panel.d.ts +8 -3
  113. package/lib/runtime/edge-panel.d.ts.map +1 -1
  114. package/lib/runtime/edge-panel.js +0 -5
  115. package/lib/runtime/edge-panel.js.map +1 -1
  116. package/lib/runtime/fonts.d.ts +0 -5
  117. package/lib/runtime/fonts.d.ts.map +1 -1
  118. package/lib/runtime/fonts.js +0 -5
  119. package/lib/runtime/fonts.js.map +1 -1
  120. package/lib/runtime/indicator.d.ts +3 -3
  121. package/lib/runtime/indicator.js +0 -5
  122. package/lib/runtime/indicator.js.map +1 -1
  123. package/lib/runtime/inspector/collect.d.ts +3 -3
  124. package/lib/runtime/inspector/collect.d.ts.map +1 -1
  125. package/lib/runtime/inspector/collect.js +0 -5
  126. package/lib/runtime/inspector/collect.js.map +1 -1
  127. package/lib/runtime/inspector/highlight.d.ts +10 -3
  128. package/lib/runtime/inspector/highlight.d.ts.map +1 -1
  129. package/lib/runtime/inspector/highlight.js +0 -5
  130. package/lib/runtime/inspector/highlight.js.map +1 -1
  131. package/lib/runtime/inspector/install.d.ts +6 -3
  132. package/lib/runtime/inspector/install.d.ts.map +1 -1
  133. package/lib/runtime/inspector/install.js +0 -5
  134. package/lib/runtime/inspector/install.js.map +1 -1
  135. package/lib/runtime/inspector/serialize.d.ts +4 -3
  136. package/lib/runtime/inspector/serialize.d.ts.map +1 -1
  137. package/lib/runtime/inspector/serialize.js +0 -5
  138. package/lib/runtime/inspector/serialize.js.map +1 -1
  139. package/lib/runtime/intern.d.ts +11 -3
  140. package/lib/runtime/intern.d.ts.map +1 -1
  141. package/lib/runtime/intern.js +11 -3
  142. package/lib/runtime/intern.js.map +1 -1
  143. package/lib/runtime/overrides.d.ts +3 -3
  144. package/lib/runtime/overrides.d.ts.map +1 -1
  145. package/lib/runtime/overrides.js +0 -5
  146. package/lib/runtime/overrides.js.map +1 -1
  147. package/lib/runtime/page-channel.d.ts +0 -5
  148. package/lib/runtime/page-channel.d.ts.map +1 -1
  149. package/lib/runtime/page-channel.js +13 -3
  150. package/lib/runtime/page-channel.js.map +1 -1
  151. package/lib/runtime/patch.d.ts +0 -5
  152. package/lib/runtime/patch.d.ts.map +1 -1
  153. package/lib/runtime/patch.js +0 -5
  154. package/lib/runtime/patch.js.map +1 -1
  155. package/lib/runtime/rpc-transport.d.ts +13 -3
  156. package/lib/runtime/rpc-transport.d.ts.map +1 -1
  157. package/lib/runtime/rpc-transport.js +3 -5
  158. package/lib/runtime/rpc-transport.js.map +1 -1
  159. package/lib/runtime/source-meta.d.ts +0 -5
  160. package/lib/runtime/source-meta.d.ts.map +1 -1
  161. package/lib/runtime/source-meta.js +0 -5
  162. package/lib/runtime/source-meta.js.map +1 -1
  163. package/lib/runtime/source-overlay/editors.d.ts +0 -5
  164. package/lib/runtime/source-overlay/editors.d.ts.map +1 -1
  165. package/lib/runtime/source-overlay/editors.js +0 -5
  166. package/lib/runtime/source-overlay/editors.js.map +1 -1
  167. package/lib/runtime/source-overlay/mask-path.d.ts +0 -5
  168. package/lib/runtime/source-overlay/mask-path.d.ts.map +1 -1
  169. package/lib/runtime/source-overlay/mask-path.js +0 -5
  170. package/lib/runtime/source-overlay/mask-path.js.map +1 -1
  171. package/lib/runtime/source-overlay/overlay-element.d.ts +0 -5
  172. package/lib/runtime/source-overlay/overlay-element.d.ts.map +1 -1
  173. package/lib/runtime/source-overlay/overlay-element.js +0 -5
  174. package/lib/runtime/source-overlay/overlay-element.js.map +1 -1
  175. package/lib/runtime/source-overlay/source-host.d.ts +0 -5
  176. package/lib/runtime/source-overlay/source-host.d.ts.map +1 -1
  177. package/lib/runtime/source-overlay/source-host.js +0 -5
  178. package/lib/runtime/source-overlay/source-host.js.map +1 -1
  179. package/lib/runtime/source-overlay/template.d.ts +0 -5
  180. package/lib/runtime/source-overlay/template.d.ts.map +1 -1
  181. package/lib/runtime/source-overlay/template.js +0 -5
  182. package/lib/runtime/source-overlay/template.js.map +1 -1
  183. package/lib/runtime/source-overlay.d.ts +0 -5
  184. package/lib/runtime/source-overlay.d.ts.map +1 -1
  185. package/lib/runtime/source-overlay.js +0 -5
  186. package/lib/runtime/source-overlay.js.map +1 -1
  187. package/lib/runtime/standalone.d.ts +0 -5
  188. package/lib/runtime/standalone.d.ts.map +1 -1
  189. package/lib/runtime/standalone.js +0 -5
  190. package/lib/runtime/standalone.js.map +1 -1
  191. package/lib/runtime/timeline/chrome-tracks.d.ts +0 -5
  192. package/lib/runtime/timeline/chrome-tracks.d.ts.map +1 -1
  193. package/lib/runtime/timeline/chrome-tracks.js +5 -3
  194. package/lib/runtime/timeline/chrome-tracks.js.map +1 -1
  195. package/lib/runtime/timeline/clock.d.ts +7 -3
  196. package/lib/runtime/timeline/clock.d.ts.map +1 -1
  197. package/lib/runtime/timeline/clock.js +0 -5
  198. package/lib/runtime/timeline/clock.js.map +1 -1
  199. package/lib/runtime/timeline/flash.d.ts +0 -5
  200. package/lib/runtime/timeline/flash.d.ts.map +1 -1
  201. package/lib/runtime/timeline/flash.js +15 -3
  202. package/lib/runtime/timeline/flash.js.map +1 -1
  203. package/lib/runtime/timeline/identity.d.ts +0 -5
  204. package/lib/runtime/timeline/identity.d.ts.map +1 -1
  205. package/lib/runtime/timeline/identity.js +9 -3
  206. package/lib/runtime/timeline/identity.js.map +1 -1
  207. package/lib/runtime/timeline/input.d.ts +0 -5
  208. package/lib/runtime/timeline/input.d.ts.map +1 -1
  209. package/lib/runtime/timeline/input.js +2 -3
  210. package/lib/runtime/timeline/input.js.map +1 -1
  211. package/lib/runtime/timeline/install.d.ts +11 -3
  212. package/lib/runtime/timeline/install.d.ts.map +1 -1
  213. package/lib/runtime/timeline/install.js +0 -5
  214. package/lib/runtime/timeline/install.js.map +1 -1
  215. package/lib/runtime/timeline/lifecycle.d.ts +13 -3
  216. package/lib/runtime/timeline/lifecycle.d.ts.map +1 -1
  217. package/lib/runtime/timeline/lifecycle.js +0 -5
  218. package/lib/runtime/timeline/lifecycle.js.map +1 -1
  219. package/lib/runtime/timeline/public-api.d.ts +6 -3
  220. package/lib/runtime/timeline/public-api.d.ts.map +1 -1
  221. package/lib/runtime/timeline/public-api.js +0 -5
  222. package/lib/runtime/timeline/public-api.js.map +1 -1
  223. package/lib/runtime/timeline/render.d.ts +0 -5
  224. package/lib/runtime/timeline/render.d.ts.map +1 -1
  225. package/lib/runtime/timeline/render.js +21 -3
  226. package/lib/runtime/timeline/render.js.map +1 -1
  227. package/lib/runtime/timeline/transport.d.ts +0 -5
  228. package/lib/runtime/timeline/transport.d.ts.map +1 -1
  229. package/lib/runtime/timeline/transport.js +10 -3
  230. package/lib/runtime/timeline/transport.js.map +1 -1
  231. package/lib/segmented-tabs.d.ts +0 -5
  232. package/lib/segmented-tabs.d.ts.map +1 -1
  233. package/lib/segmented-tabs.js +0 -5
  234. package/lib/segmented-tabs.js.map +1 -1
  235. package/lib/snapshot.d.ts +11 -3
  236. package/lib/snapshot.d.ts.map +1 -1
  237. package/lib/snapshot.js +0 -5
  238. package/lib/snapshot.js.map +1 -1
  239. package/lib/source-meta.d.ts +0 -5
  240. package/lib/source-meta.d.ts.map +1 -1
  241. package/lib/source-meta.js +0 -5
  242. package/lib/source-meta.js.map +1 -1
  243. package/lib/timeline/derive.d.ts +0 -5
  244. package/lib/timeline/derive.d.ts.map +1 -1
  245. package/lib/timeline/derive.js +22 -3
  246. package/lib/timeline/derive.js.map +1 -1
  247. package/lib/timeline/filter.d.ts +0 -5
  248. package/lib/timeline/filter.d.ts.map +1 -1
  249. package/lib/timeline/filter.js +6 -3
  250. package/lib/timeline/filter.js.map +1 -1
  251. package/lib/timeline/tracks.d.ts +0 -5
  252. package/lib/timeline/tracks.d.ts.map +1 -1
  253. package/lib/timeline/tracks.js +12 -3
  254. package/lib/timeline/tracks.js.map +1 -1
  255. package/lib/tokens.d.ts +0 -5
  256. package/lib/tokens.d.ts.map +1 -1
  257. package/lib/tokens.js +0 -5
  258. package/lib/tokens.js.map +1 -1
  259. package/lib/transform.d.ts +0 -5
  260. package/lib/transform.d.ts.map +1 -1
  261. package/lib/transform.js +0 -5
  262. package/lib/transform.js.map +1 -1
  263. package/lib/types.d.ts +10 -5
  264. package/lib/types.d.ts.map +1 -1
  265. package/lib/types.js +0 -5
  266. package/lib/types.js.map +1 -1
  267. package/lib/wrap-table.d.ts +0 -5
  268. package/lib/wrap-table.d.ts.map +1 -1
  269. package/lib/wrap-table.js +12 -3
  270. package/lib/wrap-table.js.map +1 -1
  271. package/package.json +2 -2
  272. package/types/hmr-incompatibility.d.ts +0 -5
  273. package/types/hmr-incompatibility.d.ts.map +1 -1
  274. package/types/hmr-incompatibility.js +13 -3
  275. package/types/hmr-incompatibility.js.map +1 -1
  276. package/types/in-page.d.ts +0 -5
  277. package/types/in-page.d.ts.map +1 -1
  278. package/types/in-page.js +0 -5
  279. package/types/in-page.js.map +1 -1
  280. package/types/inspector.d.ts +0 -5
  281. package/types/inspector.d.ts.map +1 -1
  282. package/types/inspector.js +13 -3
  283. package/types/inspector.js.map +1 -1
  284. package/types/snapshot.d.ts +0 -5
  285. package/types/snapshot.d.ts.map +1 -1
  286. package/types/snapshot.js +12 -3
  287. package/types/snapshot.js.map +1 -1
  288. package/types/timeline.d.ts +0 -5
  289. package/types/timeline.d.ts.map +1 -1
  290. package/types/timeline.js +0 -5
  291. package/types/timeline.js.map +1 -1
  292. package/dist/client/assets/index-D632jo79.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../src/lib/devframe/source.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EACV,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,mBAAmB,EACpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,oCAAoC,CAAC;AAEhF,uEAAuE;AACvE,MAAM,WAAW,YAAY;IAC3B,UAAU,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC;IAC1C,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,CAAC;IACrC,gBAAgB,CAAC,GAAG,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC9C,eAAe,CAAC,KAAK,EAAE,uBAAuB,GAAG,IA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AG,IAAI,CAAC;IACtD;;;;;OAKG;IACH,YAAY,IAAI,IAAI,CAAC;CACtB;AAED,gEAAgE;AAChE,MAAM,WAAW,cAAc;IAC7B,kFAAkF;IAClF,MAAM,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,IAAI,CAAC;IACvC,aAAa,CAAC,GAAG,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC3C,aAAa,IAAI,IAAI,CAAC;IACtB,YAAY,CAAC,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC/B,SAAS,CAAC,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACxC,kEAAkE;IAClE,mBAAmB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,IAAI,CAAC;CACvD;AAED;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,WAAY,mBAAmB;IAC1D,mBAAmB;IACnB,gBAAgB;IAChB,uBAAuB;IACvB,iBAAiB;IACjB,oBAAoB;CACpB,CAAC;AAEH;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,cAAc,CAWjD"}
@@ -1,7 +1,11 @@
1
1
  /**
2
- * @license
3
- * Copyright 2026 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
2
+ * The `TimelineSource` port: the abstraction over "where page-runtime
3
+ * traffic comes from". The framework-neutral definition
4
+ * ({@link ../definition.ts}) only ever talks to this interface, so it can run
5
+ * under `createDevServer()` with no Vite installed. `vite.ts` supplies the
6
+ * real implementation (an `import.meta.hot` bridge); `createDevServer()` /
7
+ * `createBuild()` / an MCP server use {@link createNullSource} instead, since
8
+ * no page is attached.
5
9
  */
6
10
  /**
7
11
  * The wire form of {@link TimelineLayersState}: the flat map of boolean toggle
@@ -1 +1 @@
1
- {"version":3,"file":"source.js","sourceRoot":"","sources":["../../src/lib/devframe/source.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAmDH;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,MAA2B,EAAE,EAAE,CAAC,CAAC;IAChE,mBAAmB,EAAE,MAAM,CAAC,mBAAmB;IAC/C,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;IACzC,uBAAuB,EAAE,MAAM,CAAC,uBAAuB;IACvD,iBAAiB,EAAE,MAAM,CAAC,iBAAiB;IAC3C,oBAAoB,EAAE,MAAM,CAAC,oBAAoB;CAClD,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO;QACL,MAAM;YACJ,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC;QAClB,CAAC;QACD,aAAa,KAAI,CAAC;QAClB,aAAa,KAAI,CAAC;QAClB,YAAY,KAAI,CAAC;QACjB,SAAS,KAAI,CAAC;QACd,mBAAmB,KAAI,CAAC;KACzB,CAAC;AACJ,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * The `TimelineSource` port: the abstraction over \"where page-runtime\n * traffic comes from\". The framework-neutral definition\n * ({@link ../definition.ts}) only ever talks to this interface, so it can run\n * under `createDevServer()` with no Vite installed. `vite.ts` supplies the\n * real implementation (an `import.meta.hot` bridge); `createDevServer()` /\n * `createBuild()` / an MCP server use {@link createNullSource} instead, since\n * no page is attached.\n */\n\nimport type {\n InspectorCommand,\n InspectorMessage,\n} from '../../types/inspector.js';\nimport type {\n SettingsOverride,\n TimelineEvent,\n TimelineLayer,\n TimelineLayersState,\n} from '../../types/timeline.js';\nimport type {HmrIncompatibilityEvent} from '../../types/hmr-incompatibility.js';\n\n/** The definition's sink for events arriving from the page runtime. */\nexport interface TimelineSink {\n pushEvents(events: TimelineEvent[]): void;\n addLayer(layer: TimelineLayer): void;\n inspectorMessage(msg: InspectorMessage): void;\n hmrIncompatible(event: HmrIncompatibilityEvent): void;\n /**\n * A page runtime just connected (first load, reload, or HMR reconnect). It\n * starts from the compiled-in defaults, so whatever recording/layer state\n * this session already holds has to be replayed to it — otherwise a page\n * loaded while recording is on silently captures nothing.\n */\n runtimeReady(): void;\n}\n\n/** Where the definition sends/receives page-runtime traffic. */\nexport interface TimelineSource {\n /** Start forwarding page-runtime traffic to `sink`. Returns a detach function. */\n attach(sink: TimelineSink): () => void;\n sendInspector(cmd: InspectorCommand): void;\n toggleOverlay(): void;\n setRecording(r: boolean): void;\n setLayers(l: TimelineLayersState): void;\n /** Apply a live feature-settings override to the running page. */\n setSettingsOverride(override: SettingsOverride): void;\n}\n\n/**\n * The wire form of {@link TimelineLayersState}: the flat map of boolean toggle\n * fields the page runtime's `lit:timeline:layers-changed` listener expects,\n * not `{layers}`. Shared by every source so they cannot drift apart.\n */\nexport const layersWireFormat = (layers: TimelineLayersState) => ({\n litLifecycleEnabled: layers.litLifecycleEnabled,\n litRenderEnabled: layers.litRenderEnabled,\n litRenderVerboseEnabled: layers.litRenderVerboseEnabled,\n mouseEventEnabled: layers.mouseEventEnabled,\n keyboardEventEnabled: layers.keyboardEventEnabled,\n});\n\n/**\n * No-op source used wherever no page is attached (`createDevServer()`,\n * `createBuild()`, an MCP server). `attach()` never calls the sink; every\n * other method is a no-op.\n */\nexport function createNullSource(): TimelineSource {\n return {\n attach() {\n return () => {};\n },\n sendInspector() {},\n toggleOverlay() {},\n setRecording() {},\n setLayers() {},\n setSettingsOverride() {},\n };\n}\n"]}
1
+ {"version":3,"file":"source.js","sourceRoot":"","sources":["../../src/lib/devframe/source.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAyCH;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,MAA2B,EAAE,EAAE,CAAC,CAAC;IAChE,mBAAmB,EAAE,MAAM,CAAC,mBAAmB;IAC/C,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;IACzC,uBAAuB,EAAE,MAAM,CAAC,uBAAuB;IACvD,iBAAiB,EAAE,MAAM,CAAC,iBAAiB;IAC3C,oBAAoB,EAAE,MAAM,CAAC,oBAAoB;CAClD,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO;QACL,MAAM;YACJ,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC;QAClB,CAAC;QACD,aAAa,KAAI,CAAC;QAClB,aAAa,KAAI,CAAC;QAClB,YAAY,KAAI,CAAC;QACjB,SAAS,KAAI,CAAC;QACd,mBAAmB,KAAI,CAAC;KACzB,CAAC;AACJ,CAAC","sourcesContent":["/**\n * The `TimelineSource` port: the abstraction over \"where page-runtime\n * traffic comes from\". The framework-neutral definition\n * ({@link ../definition.ts}) only ever talks to this interface, so it can run\n * under `createDevServer()` with no Vite installed. `vite.ts` supplies the\n * real implementation (an `import.meta.hot` bridge); `createDevServer()` /\n * `createBuild()` / an MCP server use {@link createNullSource} instead, since\n * no page is attached.\n */\n\nimport type {\n InspectorCommand,\n InspectorMessage,\n} from '../../types/inspector.js';\nimport type {\n SettingsOverride,\n TimelineEvent,\n TimelineLayer,\n TimelineLayersState,\n} from '../../types/timeline.js';\nimport type {HmrIncompatibilityEvent} from '../../types/hmr-incompatibility.js';\n\n/** The definition's sink for events arriving from the page runtime. */\nexport interface TimelineSink {\n pushEvents(events: TimelineEvent[]): void;\n addLayer(layer: TimelineLayer): void;\n inspectorMessage(msg: InspectorMessage): void;\n hmrIncompatible(event: HmrIncompatibilityEvent): void;\n /**\n * A page runtime just connected (first load, reload, or HMR reconnect). It\n * starts from the compiled-in defaults, so whatever recording/layer state\n * this session already holds has to be replayed to it — otherwise a page\n * loaded while recording is on silently captures nothing.\n */\n runtimeReady(): void;\n}\n\n/** Where the definition sends/receives page-runtime traffic. */\nexport interface TimelineSource {\n /** Start forwarding page-runtime traffic to `sink`. Returns a detach function. */\n attach(sink: TimelineSink): () => void;\n sendInspector(cmd: InspectorCommand): void;\n toggleOverlay(): void;\n setRecording(r: boolean): void;\n setLayers(l: TimelineLayersState): void;\n /** Apply a live feature-settings override to the running page. */\n setSettingsOverride(override: SettingsOverride): void;\n}\n\n/**\n * The wire form of {@link TimelineLayersState}: the flat map of boolean toggle\n * fields the page runtime's `lit:timeline:layers-changed` listener expects,\n * not `{layers}`. Shared by every source so they cannot drift apart.\n */\nexport const layersWireFormat = (layers: TimelineLayersState) => ({\n litLifecycleEnabled: layers.litLifecycleEnabled,\n litRenderEnabled: layers.litRenderEnabled,\n litRenderVerboseEnabled: layers.litRenderVerboseEnabled,\n mouseEventEnabled: layers.mouseEventEnabled,\n keyboardEventEnabled: layers.keyboardEventEnabled,\n});\n\n/**\n * No-op source used wherever no page is attached (`createDevServer()`,\n * `createBuild()`, an MCP server). `attach()` never calls the sink; every\n * other method is a no-op.\n */\nexport function createNullSource(): TimelineSource {\n return {\n attach() {\n return () => {};\n },\n sendInspector() {},\n toggleOverlay() {},\n setRecording() {},\n setLayers() {},\n setSettingsOverride() {},\n };\n}\n"]}
@@ -1,8 +1,3 @@
1
- /**
2
- * @license
3
- * Copyright 2026 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */
6
1
  /**
7
2
  * Mounts the Lit devframe ({@link createLitDevframe}) into the Vite DevTools
8
3
  * hub and bridges the page runtime's `import.meta.hot` transport to the
@@ -1 +1 @@
1
- {"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../../src/lib/devframe/vite.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAC,MAAM,EAAE,aAAa,EAAC,MAAM,MAAM,CAAC;AAChD,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,UAAU,CAAC;AAMjD,OAAO,KAAK,EACV,gBAAgB,EAEjB,MAAM,0BAA0B,CAAC;AAIlC,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EAGhB,mBAAmB,EACpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,iBAAiB,EAAC,MAAM,iBAAiB,CAAC;AAGlD,OAAO,KAAK,EAAC,YAAY,EAAE,cAAc,EAAC,MAAM,aAAa,CAAC;AAE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yEAAyE;IACzE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;GAQG;AACH,qBAAa,iBAAkB,YAAW,cAAc;;IAKtD;;;;OAIG;IACH,IAAI,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAuC1D;IAED,2EAA2E;IAC3E,aAAa,IAAI,IAAI,CAEpB;IAED,MAAM,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,IAAI,CAKrC;IAED,aAAa,CAAC,GAAG,EAAE,gBAAgB,GAAG,IAAI,CAEzC;IAED,YAAY,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI,CAErC;IAED,SAAS,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI,CAE3C;IAED,mBAAmB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,IAAI,CAEpD;CACF;AAqJD;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,8BAA8B,GACtC,MAAM,CAuDR;AAED;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,QAAO,iBAClB,CAAC"}
@@ -1,7 +1,20 @@
1
1
  /**
2
- * @license
3
- * Copyright 2026 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
2
+ * Mounts the Lit devframe ({@link createLitDevframe}) into the Vite DevTools
3
+ * hub and bridges the page runtime's `import.meta.hot` transport to the
4
+ * definition's `TimelineSource` port. Everything Vite-specific lives here:
5
+ * the definition itself must keep running under `createDevServer()` with no
6
+ * Vite installed.
7
+ *
8
+ * Vite DevTools 0.7+ is itself built on devframe, so its plugin context is a
9
+ * devframe hub context: `ctx.install(definition)` serves the panel SPA from
10
+ * the definition's `clientAssets`, registers its dock, and exposes its RPC
11
+ * over the hub's authenticated WebSocket. That is all
12
+ * `createPluginFromDevframe()` from `@vitejs/devtools-kit` does, so calling
13
+ * `install` directly keeps DevTools an optional peer we never import at
14
+ * runtime — the hook below is duck-typed, exactly as the panel's previous
15
+ * dock registration was.
16
+ *
17
+ * @see plans/devframe-foundation.md
5
18
  */
6
19
  import {
7
20
  INSPECT_CMD_CHANNEL,
@@ -1 +1 @@
1
- {"version":3,"file":"vite.js","sourceRoot":"","sources":["../../src/lib/devframe/vite.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAuBH,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,8BAA8B,GAC/B,MAAM,0BAA0B,CAAC;AAKlC,OAAO,EAAC,wBAAwB,EAAC,MAAM,oCAAoC,CAAC;AAE5E,OAAO,EAAC,yBAAyB,EAAC,MAAM,yBAAyB,CAAC;AAQlE,OAAO,EAAC,iBAAiB,EAAC,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAC,eAAe,EAAC,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAC,gBAAgB,EAAC,MAAM,aAAa,CAAC;AAG7C,OAAO,EAAC,iBAAiB,EAAC,CAAC;AA+C3B;;;;;;;;GAQG;AACH,MAAM,OAAO,iBAAiB;IAC5B,IAAI,CAAmC;IACvC,KAAK,CAA2B;IAChC,IAAI,CAAiC;IAErC;;;;OAIG;IACH,IAAI,CAAC,MAAqB,EAAE,GAAwB;QAClD,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;QAChB,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;QAEhB,GAAG,CAAC,EAAE,CAAC,yBAAyB,EAAE,CAAC,IAAgC,EAAE,EAAE;YACrE,IAAI,CAAC,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;QAEH,GAAG,CAAC,EAAE,CAAC,2BAA2B,EAAE,CAAC,IAA6B,EAAE,EAAE;YACpE,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE;gBAAE,OAAO;YAC5B,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,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CAAC;wBACpC,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,aAAa,EAAE;qBACtC,CAAC,CAAC;gBACL,CAAC;gBAED,mEAAmE;gBACnE,mEAAmE;gBACnE,mEAAmE;gBACnE,6BAA6B,CAAC,GAAG,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC;YACtD,CAAC;SACF;KACF,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAsB,EAAE,CAC7D,IAAI,iBAAiB,EAAE,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Mounts the Lit devframe ({@link createLitDevframe}) into the Vite DevTools\n * hub and bridges the page runtime's `import.meta.hot` transport to the\n * definition's `TimelineSource` port. Everything Vite-specific lives here:\n * the definition itself must keep running under `createDevServer()` with no\n * Vite installed.\n *\n * Vite DevTools 0.7+ is itself built on devframe, so its plugin context is a\n * devframe hub context: `ctx.install(definition)` serves the panel SPA from\n * the definition's `clientAssets`, registers its dock, and exposes its RPC\n * over the hub's authenticated WebSocket. That is all\n * `createPluginFromDevframe()` from `@vitejs/devtools-kit` does, so calling\n * `install` directly keeps DevTools an optional peer we never import at\n * runtime — the hook below is duck-typed, exactly as the panel's previous\n * dock registration was.\n *\n * @see plans/devframe-foundation.md\n */\n\nimport type {Plugin, ViteDevServer} from 'vite';\nimport type {DevframeDefinition} from 'devframe';\nimport {\n INSPECT_CMD_CHANNEL,\n INSPECT_DATA_CHANNEL,\n INSPECT_OVERLAY_TOGGLE_CHANNEL,\n} from '../../types/inspector.js';\nimport type {\n InspectorCommand,\n InspectorMessage,\n} from '../../types/inspector.js';\nimport {HMR_INCOMPATIBLE_CHANNEL} from '../../types/hmr-incompatibility.js';\nimport type {HmrIncompatibilityEvent} from '../../types/hmr-incompatibility.js';\nimport {SETTINGS_OVERRIDE_CHANNEL} from '../../types/timeline.js';\nimport type {\n FeatureSettings,\n SettingsOverride,\n TimelineEvent,\n TimelineLayer,\n TimelineLayersState,\n} from '../../types/timeline.js';\nimport {createLitDevframe} from './definition.js';\nimport {LIT_DEVFRAME_ID} from './protocol.js';\nimport {layersWireFormat} from './source.js';\nimport type {TimelineSink, TimelineSource} from './source.js';\n\nexport {createLitDevframe};\n\n/**\n * The slice of the Vite DevTools hub context this plugin uses. Structurally a\n * subset of `ViteDevToolsNodeContext` from `@vitejs/devtools-kit/node`;\n * declared here so the package never imports that optional peer at runtime.\n * Install `@vitejs/devtools-kit` as a dev dependency to check it against the\n * real declarations.\n */\ninterface DevToolsHubContext {\n readonly viteServer?: ViteDevServer;\n /** Serve a devframe's SPA, register its dock, and run its `setup()`. */\n install: (\n devframe: DevframeDefinition,\n options?: {base?: string; dock?: Record<string, unknown>}\n ) => Promise<void>;\n docks?: {\n activate?: (dockId: string, params?: Record<string, unknown>) => void;\n };\n commands?: {register?: (command: Record<string, unknown>) => unknown};\n /**\n * The hub's host runtime. Structurally the slice of devframe's\n * `DevframeHost` {@link registerInstance} needs; `DevframeHubContext`\n * extends `DevframeNodeContext`, which carries it.\n */\n host?: {resolveOrigin?: () => string};\n}\n\ndeclare module 'vite' {\n interface Plugin {\n /** Vite DevTools plugin hook, contributed by `@vitejs/devtools`. */\n devtools?: {\n capabilities?: {dev?: boolean; build?: boolean};\n setup: (ctx: DevToolsHubContext) => void | Promise<void>;\n };\n }\n}\n\nexport interface CreateLitDevframePluginOptions {\n version: string;\n features?: () => FeatureSettings | null;\n /** See {@link CreateLitDevframeOptions.configuredEditor}. */\n configuredEditor?: () => string | undefined;\n /** Override the built panel SPA directory. Defaults to `dist/client`. */\n clientAssets?: string;\n}\n\n/**\n * `TimelineSource` over a Vite dev server's `hot` channel.\n *\n * `install()` runs the definition's `setup()` — and therefore\n * `source.attach()` — before it resolves, so this is attached before a dev\n * server is necessarily in hand. Calls made before {@link bind} are dropped\n * rather than buffered: nothing can emit a page-runtime event until a page\n * has connected to a bound server.\n */\nexport class HotTimelineSource implements TimelineSource {\n #hot: ViteDevServer['hot'] | undefined;\n #sink: TimelineSink | undefined;\n #hub: DevToolsHubContext | undefined;\n\n /**\n * Wire the source to a live dev server. Call once, from `devtools.setup()`.\n * `hub` is optional: without it the bridge still carries page traffic both\n * ways, it just cannot bring the dock to the front on an overlay pick.\n */\n bind(server: ViteDevServer, hub?: DevToolsHubContext): void {\n this.#hub = hub;\n const hot = server.hot;\n this.#hot = hot;\n\n hot.on('lit:timeline:push-event', (data: {events?: TimelineEvent[]}) => {\n this.#sink?.pushEvents(data.events ?? []);\n });\n\n hot.on('lit:timeline:custom-layer', (data: {layer?: TimelineLayer}) => {\n if (!data.layer?.id) return;\n this.#sink?.addLayer(data.layer);\n });\n\n hot.on(INSPECT_DATA_CHANNEL, (data: InspectorMessage) => {\n // An overlay pick means the developer clicked an element in the page and\n // wants the Components tab. Bring the dock forward from the node side\n // rather than having the panel reach into the parent frame.\n if (data.type === 'pick') {\n // Carry the target with the activation, not just the dock id: the\n // params ride the hub's `devframe:docks:active` state, so a panel\n // that mounts *because of* this pick still lands on the right\n // element instead of racing the separate `pick` message.\n this.#hub?.docks?.activate?.(LIT_DEVFRAME_ID, {componentId: data.id});\n }\n this.#sink?.inspectorMessage(data);\n });\n\n hot.on(HMR_INCOMPATIBLE_CHANNEL, (event: HmrIncompatibilityEvent) => {\n this.#sink?.hmrIncompatible(event);\n });\n\n // The runtime announces itself on every connect. It boots from the\n // compiled-in defaults (recording off), so the session's current state\n // has to be pushed back down or a page that loads while recording is on\n // captures nothing while every surface still reports `recording: true`.\n hot.on('lit:timeline:runtime-ready', () => {\n this.#sink?.runtimeReady();\n });\n }\n\n /** Toggle the page's inspect overlay. Also used by the palette command. */\n toggleOverlay(): void {\n this.#hot?.send(INSPECT_OVERLAY_TOGGLE_CHANNEL);\n }\n\n attach(sink: TimelineSink): () => void {\n this.#sink = sink;\n return () => {\n if (this.#sink === sink) this.#sink = undefined;\n };\n }\n\n sendInspector(cmd: InspectorCommand): void {\n this.#hot?.send(INSPECT_CMD_CHANNEL, cmd);\n }\n\n setRecording(recording: boolean): void {\n this.#hot?.send('lit:timeline:recording-changed', {recording});\n }\n\n setLayers(layers: TimelineLayersState): void {\n this.#hot?.send('lit:timeline:layers-changed', layersWireFormat(layers));\n }\n\n setSettingsOverride(override: SettingsOverride): void {\n this.#hot?.send(SETTINGS_OVERRIDE_CHANNEL, override);\n }\n}\n\n/**\n * One warning per process, not per dev server: a restart-heavy session\n * should not paper the terminal with the same advisory. Carries the reason,\n * because \"discovery unavailable\" with no cause is the kind of message that\n * costs an afternoon when the guess below finally goes stale.\n */\nlet warnedDiscoveryUnavailable = false;\n\nconst warnDiscoveryUnavailable = (reason: string): void => {\n if (warnedDiscoveryUnavailable) return;\n warnedDiscoveryUnavailable = true;\n console.warn(\n `[lit-plugin] devframe instance-registry discovery unavailable ` +\n `(${reason}); stdio MCP clients cannot auto-discover this dev ` +\n `server. The MCP endpoint itself is unaffected — point clients at ` +\n `<dev-server-origin>/__devtools/__mcp directly.`\n );\n};\n\n/**\n * Publish this devframe in devframe's global instance registry\n * (`~/.devframe/instances/`), so stdio MCP connectors — `devframe connect`,\n * this package's own `lit-devtools mcp` — find the running dev server\n * without port guessing.\n *\n * `createDevServer()` registers itself, but this plugin never goes through\n * it: it mounts into the Vite DevTools hub, and `@vitejs/devtools@0.7.5`\n * calls `initHub()` with no `register` option, which defaults to off. So a\n * Vite-hosted devframe is invisible to discovery unless a plugin publishes\n * the record itself — which is all this does. `registerDevframeInstance()`\n * is documented for exactly this case (\"custom hosts that serve a devframe\n * in-process call this explicitly with the origin they are reachable at\"),\n * and the registry is a directory of per-`pid`+`port` JSON files, so\n * registrants coexist.\n *\n * The mount path is the soft spot: `/__devtools/` is where this version of\n * Vite DevTools mounts, not a promise about where a devframe host mounts in\n * general. So the guess is verified before it is published — the same\n * `probeDevframeOrigin()` primitive the registry's own liveness check uses\n * has to answer at that base, or nothing is registered. A record that\n * doesn't answer is worse than no record: an agent dials it and gets 404s\n * from a server that claimed to be there.\n *\n * The MCP path is then taken from what that probe *reports* rather than\n * assumed to be the `__mcp` default, which removes the second guess\n * entirely. Note the two path conventions in play: `__connection.json`\n * serves `mcp.path` **relative** to the base (`\"__mcp\"`), while a registry\n * record stores it **absolute** (`\"/__devtools/__mcp\"`) because the\n * connector dials `origin + record.mcp.path` directly. Joining the two is\n * exactly what devframe's own `probePort()` does with its root-mounted\n * probe.\n *\n * Known sharp edge: records are keyed by `pid`+`port` alone. Another\n * devframe-hosting plugin in the same Vite process would share this file,\n * and whichever unregisters first removes it for both. Single-devframe use\n * is the common case and there is no cross-plugin coordination primitive\n * today.\n */\nasync function registerInstance(\n ctx: DevToolsHubContext,\n name: string\n): Promise<{unregister: () => void} | {reason: string}> {\n // Both imports are dynamic and optional: `@vitejs/devtools-kit` is an\n // optional peer this package must never hard-resolve, and `devframe`'s\n // `internal` subpath is only needed on this path.\n const constants = await import('@vitejs/devtools-kit/constants').catch(\n () => null\n );\n const internal = await import('devframe/internal').catch(() => null);\n if (!constants) return {reason: '@vitejs/devtools-kit not resolvable'};\n if (!internal) return {reason: 'devframe/internal not resolvable'};\n\n const basePath = constants.DEVTOOLS_MOUNT_PATH;\n const origin = ctx.host?.resolveOrigin?.();\n if (!origin) return {reason: 'host origin unavailable'};\n\n const probed = await internal.probeDevframeOrigin(origin, basePath);\n if (!probed) {\n return {reason: `no devframe answered at ${origin}${basePath}`};\n }\n\n // Relative (`\"__mcp\"`) as served, absolute as stored — see above. A host\n // that already reports an absolute path is passed through unchanged.\n const reported = probed.meta.mcp?.path;\n const mcpPath =\n reported === undefined\n ? null\n : reported.startsWith('/')\n ? reported\n : `${basePath}${reported}`;\n\n const {unregister} = internal.registerDevframeInstance({\n pid: process.pid,\n // The probe reports the origin that actually answered — a `localhost`\n // bind may only be dialable as `127.0.0.1` or `[::1]` — so its port is\n // the one truly listening, which `config.server.port` is not when the\n // configured port was taken.\n port: Number(new URL(probed.origin).port) || 0,\n origin: probed.origin,\n basePath,\n id: LIT_DEVFRAME_ID,\n name,\n rootDir: process.cwd(),\n // Registering with `mcp: null` is honest rather than useless: the\n // connector surfaces the instance with its own \"MCP disabled\" hint,\n // which beats the instance being invisible.\n mcp: mcpPath === null ? null : {path: mcpPath},\n startedAt: Date.now(),\n });\n return {unregister};\n}\n\n/**\n * Register once the dev server is actually accepting connections. The\n * DevTools `setup()` hook runs during server construction, well before\n * `listen()` resolves, so probing from there always fails to connect — the\n * record has to wait for the port it is about to advertise to be real.\n */\nfunction registerInstanceWhenListening(\n ctx: DevToolsHubContext,\n name: string\n): void {\n const httpServer = ctx.viteServer?.httpServer;\n if (!httpServer) {\n // Middleware mode: no server of our own to advertise.\n warnDiscoveryUnavailable('no HTTP server (middleware mode?)');\n return;\n }\n\n const run = (): void => {\n registerInstance(ctx, name)\n .then((result) => {\n if ('unregister' in result) {\n httpServer.once('close', result.unregister);\n } else {\n warnDiscoveryUnavailable(result.reason);\n }\n })\n .catch((error: unknown) => {\n warnDiscoveryUnavailable(String(error));\n });\n };\n\n if (httpServer.listening) run();\n else httpServer.once('listening', run);\n}\n\n/**\n * The Vite plugin that mounts the Lit devframe on the DevTools hub. A no-op\n * when DevTools is not active: without it nothing calls `devtools.setup()`,\n * so the definition is never installed and the panel simply isn't there.\n */\nexport function createLitDevframePlugin(\n options: CreateLitDevframePluginOptions\n): Plugin {\n const source = new HotTimelineSource();\n // Only known once `setup()` has the dev server, which is after the\n // definition is built -- hence the getter.\n let viteRoot: string | undefined;\n let fsAllow: readonly string[] = [];\n const definition = createLitDevframe({\n source,\n version: options.version,\n features: options.features,\n configuredEditor: options.configuredEditor,\n clientAssets: options.clientAssets,\n sourceRoot: () => viteRoot,\n allowedRoots: () => fsAllow,\n });\n\n return {\n name: `devframe:${LIT_DEVFRAME_ID}`,\n devtools: {\n // The panel reflects a running page, so there is nothing to mount\n // during `vite build`. A static snapshot goes through\n // `devframe/adapters/build` instead.\n capabilities: {dev: true, build: false},\n async setup(ctx) {\n // Bind before installing: `install()` runs the definition's `setup()`,\n // which attaches to this source, and the dev server is already\n // available on the context by now.\n if (ctx.viteServer) source.bind(ctx.viteServer, ctx);\n viteRoot = ctx.viteServer?.config.root;\n fsAllow = ctx.viteServer?.config.server.fs?.allow ?? [];\n await ctx.install(definition);\n\n // The overlay picker as a palette command with a managed shortcut.\n // Only meaningful when the source overlay is enabled, since that is\n // what draws the picker in the page.\n if (options.features?.()?.sourceOverlay.enabled) {\n ctx.commands?.register?.({\n id: 'lit:overlay:toggle',\n title: 'Pick Lit Element',\n description:\n 'Click to inspect in the Components panel, hold Meta/Ctrl and click to open in your editor',\n icon: 'ph:crosshair-duotone',\n category: 'Lit',\n keybindings: [{key: 'Meta+Shift+E'}],\n handler: () => source.toggleOverlay(),\n });\n }\n\n // Discovery is a convenience on top of a panel that already works,\n // so this never blocks `setup()` and never throws: a failure costs\n // the user the stdio MCP shortcut, and the direct URL still works.\n registerInstanceWhenListening(ctx, definition.name);\n },\n },\n };\n}\n\n/**\n * The page-runtime bridge on its own, for a host that drives its own mount\n * (or a test that wants to observe page traffic without a hub). Bind it to a\n * dev server, then either hand it to {@link createLitDevframe} or\n * {@link TimelineSource.attach} your own sink.\n */\nexport const createHotTimelineSource = (): HotTimelineSource =>\n new HotTimelineSource();\n"]}
1
+ {"version":3,"file":"vite.js","sourceRoot":"","sources":["../../src/lib/devframe/vite.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAIH,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,8BAA8B,GAC/B,MAAM,0BAA0B,CAAC;AAKlC,OAAO,EAAC,wBAAwB,EAAC,MAAM,oCAAoC,CAAC;AAE5E,OAAO,EAAC,yBAAyB,EAAC,MAAM,yBAAyB,CAAC;AAQlE,OAAO,EAAC,iBAAiB,EAAC,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAC,eAAe,EAAC,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAC,gBAAgB,EA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gBAC/D,mCAAmC;gBACnC,IAAI,GAAG,CAAC,UAAU;oBAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;gBACrD,QAAQ,GAAG,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC;gBACvC,OAAO,GAAG,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,IAAI,EAAE,CAAC;gBACxD,MAAM,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;gBAE9B,mEAAmE;gBACnE,oEAAoE;gBACpE,qCAAqC;gBACrC,IAAI,OAAO,CAAC,QAAQ,EAAE,EAAE,EAAE,aAAa,CAAC,OAAO,EAAE,CAAC;oBAChD,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,CAAC;wBACvB,EAAE,EAAE,oBAAoB;wBACxB,KAAK,EAAE,kBAAkB;wBACzB,WAAW,EACT,2FAA2F;wBAC7F,IAAI,EAAE,sBAAsB;wBAC5B,QAAQ,EAAE,KAAK;wBACf,WAAW,EAAE,CAAC,EAAC,GAAG,EAAE,cAAc,EAAC,CAAC;wBACpC,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,aAAa,EAAE;qBACtC,CAAC,CAAC;gBACL,CAAC;gBAED,mEAAmE;gBACnE,mEAAmE;gBACnE,mEAAmE;gBACnE,6BAA6B,CAAC,GAAG,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC;YACtD,CAAC;SACF;KACF,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAsB,EAAE,CAC7D,IAAI,iBAAiB,EAAE,CAAC","sourcesContent":["/**\n * Mounts the Lit devframe ({@link createLitDevframe}) into the Vite DevTools\n * hub and bridges the page runtime's `import.meta.hot` transport to the\n * definition's `TimelineSource` port. Everything Vite-specific lives here:\n * the definition itself must keep running under `createDevServer()` with no\n * Vite installed.\n *\n * Vite DevTools 0.7+ is itself built on devframe, so its plugin context is a\n * devframe hub context: `ctx.install(definition)` serves the panel SPA from\n * the definition's `clientAssets`, registers its dock, and exposes its RPC\n * over the hub's authenticated WebSocket. That is all\n * `createPluginFromDevframe()` from `@vitejs/devtools-kit` does, so calling\n * `install` directly keeps DevTools an optional peer we never import at\n * runtime — the hook below is duck-typed, exactly as the panel's previous\n * dock registration was.\n *\n * @see plans/devframe-foundation.md\n */\n\nimport type {Plugin, ViteDevServer} from 'vite';\nimport type {DevframeDefinition} from 'devframe';\nimport {\n INSPECT_CMD_CHANNEL,\n INSPECT_DATA_CHANNEL,\n INSPECT_OVERLAY_TOGGLE_CHANNEL,\n} from '../../types/inspector.js';\nimport type {\n InspectorCommand,\n InspectorMessage,\n} from '../../types/inspector.js';\nimport {HMR_INCOMPATIBLE_CHANNEL} from '../../types/hmr-incompatibility.js';\nimport type {HmrIncompatibilityEvent} from '../../types/hmr-incompatibility.js';\nimport {SETTINGS_OVERRIDE_CHANNEL} from '../../types/timeline.js';\nimport type {\n FeatureSettings,\n SettingsOverride,\n TimelineEvent,\n TimelineLayer,\n TimelineLayersState,\n} from '../../types/timeline.js';\nimport {createLitDevframe} from './definition.js';\nimport {LIT_DEVFRAME_ID} from './protocol.js';\nimport {layersWireFormat} from './source.js';\nimport type {TimelineSink, TimelineSource} from './source.js';\n\nexport {createLitDevframe};\n\n/**\n * The slice of the Vite DevTools hub context this plugin uses. Structurally a\n * subset of `ViteDevToolsNodeContext` from `@vitejs/devtools-kit/node`;\n * declared here so the package never imports that optional peer at runtime.\n * Install `@vitejs/devtools-kit` as a dev dependency to check it against the\n * real declarations.\n */\ninterface DevToolsHubContext {\n readonly viteServer?: ViteDevServer;\n /** Serve a devframe's SPA, register its dock, and run its `setup()`. */\n install: (\n devframe: DevframeDefinition,\n options?: {base?: string; dock?: Record<string, unknown>}\n ) => Promise<void>;\n docks?: {\n activate?: (dockId: string, params?: Record<string, unknown>) => void;\n };\n commands?: {register?: (command: Record<string, unknown>) => unknown};\n /**\n * The hub's host runtime. Structurally the slice of devframe's\n * `DevframeHost` {@link registerInstance} needs; `DevframeHubContext`\n * extends `DevframeNodeContext`, which carries it.\n */\n host?: {resolveOrigin?: () => string};\n}\n\ndeclare module 'vite' {\n interface Plugin {\n /** Vite DevTools plugin hook, contributed by `@vitejs/devtools`. */\n devtools?: {\n capabilities?: {dev?: boolean; build?: boolean};\n setup: (ctx: DevToolsHubContext) => void | Promise<void>;\n };\n }\n}\n\nexport interface CreateLitDevframePluginOptions {\n version: string;\n features?: () => FeatureSettings | null;\n /** See {@link CreateLitDevframeOptions.configuredEditor}. */\n configuredEditor?: () => string | undefined;\n /** Override the built panel SPA directory. Defaults to `dist/client`. */\n clientAssets?: string;\n}\n\n/**\n * `TimelineSource` over a Vite dev server's `hot` channel.\n *\n * `install()` runs the definition's `setup()` — and therefore\n * `source.attach()` — before it resolves, so this is attached before a dev\n * server is necessarily in hand. Calls made before {@link bind} are dropped\n * rather than buffered: nothing can emit a page-runtime event until a page\n * has connected to a bound server.\n */\nexport class HotTimelineSource implements TimelineSource {\n #hot: ViteDevServer['hot'] | undefined;\n #sink: TimelineSink | undefined;\n #hub: DevToolsHubContext | undefined;\n\n /**\n * Wire the source to a live dev server. Call once, from `devtools.setup()`.\n * `hub` is optional: without it the bridge still carries page traffic both\n * ways, it just cannot bring the dock to the front on an overlay pick.\n */\n bind(server: ViteDevServer, hub?: DevToolsHubContext): void {\n this.#hub = hub;\n const hot = server.hot;\n this.#hot = hot;\n\n hot.on('lit:timeline:push-event', (data: {events?: TimelineEvent[]}) => {\n this.#sink?.pushEvents(data.events ?? []);\n });\n\n hot.on('lit:timeline:custom-layer', (data: {layer?: TimelineLayer}) => {\n if (!data.layer?.id) return;\n this.#sink?.addLayer(data.layer);\n });\n\n hot.on(INSPECT_DATA_CHANNEL, (data: InspectorMessage) => {\n // An overlay pick means the developer clicked an element in the page and\n // wants the Components tab. Bring the dock forward from the node side\n // rather than having the panel reach into the parent frame.\n if (data.type === 'pick') {\n // Carry the target with the activation, not just the dock id: the\n // params ride the hub's `devframe:docks:active` state, so a panel\n // that mounts *because of* this pick still lands on the right\n // element instead of racing the separate `pick` message.\n this.#hub?.docks?.activate?.(LIT_DEVFRAME_ID, {componentId: data.id});\n }\n this.#sink?.inspectorMessage(data);\n });\n\n hot.on(HMR_INCOMPATIBLE_CHANNEL, (event: HmrIncompatibilityEvent) => {\n this.#sink?.hmrIncompatible(event);\n });\n\n // The runtime announces itself on every connect. It boots from the\n // compiled-in defaults (recording off), so the session's current state\n // has to be pushed back down or a page that loads while recording is on\n // captures nothing while every surface still reports `recording: true`.\n hot.on('lit:timeline:runtime-ready', () => {\n this.#sink?.runtimeReady();\n });\n }\n\n /** Toggle the page's inspect overlay. Also used by the palette command. */\n toggleOverlay(): void {\n this.#hot?.send(INSPECT_OVERLAY_TOGGLE_CHANNEL);\n }\n\n attach(sink: TimelineSink): () => void {\n this.#sink = sink;\n return () => {\n if (this.#sink === sink) this.#sink = undefined;\n };\n }\n\n sendInspector(cmd: InspectorCommand): void {\n this.#hot?.send(INSPECT_CMD_CHANNEL, cmd);\n }\n\n setRecording(recording: boolean): void {\n this.#hot?.send('lit:timeline:recording-changed', {recording});\n }\n\n setLayers(layers: TimelineLayersState): void {\n this.#hot?.send('lit:timeline:layers-changed', layersWireFormat(layers));\n }\n\n setSettingsOverride(override: SettingsOverride): void {\n this.#hot?.send(SETTINGS_OVERRIDE_CHANNEL, override);\n }\n}\n\n/**\n * One warning per process, not per dev server: a restart-heavy session\n * should not paper the terminal with the same advisory. Carries the reason,\n * because \"discovery unavailable\" with no cause is the kind of message that\n * costs an afternoon when the guess below finally goes stale.\n */\nlet warnedDiscoveryUnavailable = false;\n\nconst warnDiscoveryUnavailable = (reason: string): void => {\n if (warnedDiscoveryUnavailable) return;\n warnedDiscoveryUnavailable = true;\n console.warn(\n `[lit-plugin] devframe instance-registry discovery unavailable ` +\n `(${reason}); stdio MCP clients cannot auto-discover this dev ` +\n `server. The MCP endpoint itself is unaffected — point clients at ` +\n `<dev-server-origin>/__devtools/__mcp directly.`\n );\n};\n\n/**\n * Publish this devframe in devframe's global instance registry\n * (`~/.devframe/instances/`), so stdio MCP connectors — `devframe connect`,\n * this package's own `lit-devtools mcp` — find the running dev server\n * without port guessing.\n *\n * `createDevServer()` registers itself, but this plugin never goes through\n * it: it mounts into the Vite DevTools hub, and `@vitejs/devtools@0.7.5`\n * calls `initHub()` with no `register` option, which defaults to off. So a\n * Vite-hosted devframe is invisible to discovery unless a plugin publishes\n * the record itself — which is all this does. `registerDevframeInstance()`\n * is documented for exactly this case (\"custom hosts that serve a devframe\n * in-process call this explicitly with the origin they are reachable at\"),\n * and the registry is a directory of per-`pid`+`port` JSON files, so\n * registrants coexist.\n *\n * The mount path is the soft spot: `/__devtools/` is where this version of\n * Vite DevTools mounts, not a promise about where a devframe host mounts in\n * general. So the guess is verified before it is published — the same\n * `probeDevframeOrigin()` primitive the registry's own liveness check uses\n * has to answer at that base, or nothing is registered. A record that\n * doesn't answer is worse than no record: an agent dials it and gets 404s\n * from a server that claimed to be there.\n *\n * The MCP path is then taken from what that probe *reports* rather than\n * assumed to be the `__mcp` default, which removes the second guess\n * entirely. Note the two path conventions in play: `__connection.json`\n * serves `mcp.path` **relative** to the base (`\"__mcp\"`), while a registry\n * record stores it **absolute** (`\"/__devtools/__mcp\"`) because the\n * connector dials `origin + record.mcp.path` directly. Joining the two is\n * exactly what devframe's own `probePort()` does with its root-mounted\n * probe.\n *\n * Known sharp edge: records are keyed by `pid`+`port` alone. Another\n * devframe-hosting plugin in the same Vite process would share this file,\n * and whichever unregisters first removes it for both. Single-devframe use\n * is the common case and there is no cross-plugin coordination primitive\n * today.\n */\nasync function registerInstance(\n ctx: DevToolsHubContext,\n name: string\n): Promise<{unregister: () => void} | {reason: string}> {\n // Both imports are dynamic and optional: `@vitejs/devtools-kit` is an\n // optional peer this package must never hard-resolve, and `devframe`'s\n // `internal` subpath is only needed on this path.\n const constants = await import('@vitejs/devtools-kit/constants').catch(\n () => null\n );\n const internal = await import('devframe/internal').catch(() => null);\n if (!constants) return {reason: '@vitejs/devtools-kit not resolvable'};\n if (!internal) return {reason: 'devframe/internal not resolvable'};\n\n const basePath = constants.DEVTOOLS_MOUNT_PATH;\n const origin = ctx.host?.resolveOrigin?.();\n if (!origin) return {reason: 'host origin unavailable'};\n\n const probed = await internal.probeDevframeOrigin(origin, basePath);\n if (!probed) {\n return {reason: `no devframe answered at ${origin}${basePath}`};\n }\n\n // Relative (`\"__mcp\"`) as served, absolute as stored — see above. A host\n // that already reports an absolute path is passed through unchanged.\n const reported = probed.meta.mcp?.path;\n const mcpPath =\n reported === undefined\n ? null\n : reported.startsWith('/')\n ? reported\n : `${basePath}${reported}`;\n\n const {unregister} = internal.registerDevframeInstance({\n pid: process.pid,\n // The probe reports the origin that actually answered — a `localhost`\n // bind may only be dialable as `127.0.0.1` or `[::1]` — so its port is\n // the one truly listening, which `config.server.port` is not when the\n // configured port was taken.\n port: Number(new URL(probed.origin).port) || 0,\n origin: probed.origin,\n basePath,\n id: LIT_DEVFRAME_ID,\n name,\n rootDir: process.cwd(),\n // Registering with `mcp: null` is honest rather than useless: the\n // connector surfaces the instance with its own \"MCP disabled\" hint,\n // which beats the instance being invisible.\n mcp: mcpPath === null ? null : {path: mcpPath},\n startedAt: Date.now(),\n });\n return {unregister};\n}\n\n/**\n * Register once the dev server is actually accepting connections. The\n * DevTools `setup()` hook runs during server construction, well before\n * `listen()` resolves, so probing from there always fails to connect — the\n * record has to wait for the port it is about to advertise to be real.\n */\nfunction registerInstanceWhenListening(\n ctx: DevToolsHubContext,\n name: string\n): void {\n const httpServer = ctx.viteServer?.httpServer;\n if (!httpServer) {\n // Middleware mode: no server of our own to advertise.\n warnDiscoveryUnavailable('no HTTP server (middleware mode?)');\n return;\n }\n\n const run = (): void => {\n registerInstance(ctx, name)\n .then((result) => {\n if ('unregister' in result) {\n httpServer.once('close', result.unregister);\n } else {\n warnDiscoveryUnavailable(result.reason);\n }\n })\n .catch((error: unknown) => {\n warnDiscoveryUnavailable(String(error));\n });\n };\n\n if (httpServer.listening) run();\n else httpServer.once('listening', run);\n}\n\n/**\n * The Vite plugin that mounts the Lit devframe on the DevTools hub. A no-op\n * when DevTools is not active: without it nothing calls `devtools.setup()`,\n * so the definition is never installed and the panel simply isn't there.\n */\nexport function createLitDevframePlugin(\n options: CreateLitDevframePluginOptions\n): Plugin {\n const source = new HotTimelineSource();\n // Only known once `setup()` has the dev server, which is after the\n // definition is built -- hence the getter.\n let viteRoot: string | undefined;\n let fsAllow: readonly string[] = [];\n const definition = createLitDevframe({\n source,\n version: options.version,\n features: options.features,\n configuredEditor: options.configuredEditor,\n clientAssets: options.clientAssets,\n sourceRoot: () => viteRoot,\n allowedRoots: () => fsAllow,\n });\n\n return {\n name: `devframe:${LIT_DEVFRAME_ID}`,\n devtools: {\n // The panel reflects a running page, so there is nothing to mount\n // during `vite build`. A static snapshot goes through\n // `devframe/adapters/build` instead.\n capabilities: {dev: true, build: false},\n async setup(ctx) {\n // Bind before installing: `install()` runs the definition's `setup()`,\n // which attaches to this source, and the dev server is already\n // available on the context by now.\n if (ctx.viteServer) source.bind(ctx.viteServer, ctx);\n viteRoot = ctx.viteServer?.config.root;\n fsAllow = ctx.viteServer?.config.server.fs?.allow ?? [];\n await ctx.install(definition);\n\n // The overlay picker as a palette command with a managed shortcut.\n // Only meaningful when the source overlay is enabled, since that is\n // what draws the picker in the page.\n if (options.features?.()?.sourceOverlay.enabled) {\n ctx.commands?.register?.({\n id: 'lit:overlay:toggle',\n title: 'Pick Lit Element',\n description:\n 'Click to inspect in the Components panel, hold Meta/Ctrl and click to open in your editor',\n icon: 'ph:crosshair-duotone',\n category: 'Lit',\n keybindings: [{key: 'Meta+Shift+E'}],\n handler: () => source.toggleOverlay(),\n });\n }\n\n // Discovery is a convenience on top of a panel that already works,\n // so this never blocks `setup()` and never throws: a failure costs\n // the user the stdio MCP shortcut, and the direct URL still works.\n registerInstanceWhenListening(ctx, definition.name);\n },\n },\n };\n}\n\n/**\n * The page-runtime bridge on its own, for a host that drives its own mount\n * (or a test that wants to observe page traffic without a hub). Bind it to a\n * dev server, then either hand it to {@link createLitDevframe} or\n * {@link TimelineSource.attach} your own sink.\n */\nexport const createHotTimelineSource = (): HotTimelineSource =>\n new HotTimelineSource();\n"]}
package/lib/http.d.ts CHANGED
@@ -1,8 +1,3 @@
1
- /**
2
- * @license
3
- * Copyright 2026 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */
6
1
  /**
7
2
  * Headers the trust check looks at. Both the open-in-editor endpoint and the
8
3
  * timeline/inspector endpoints are local-only dev tooling: only the page the
package/lib/http.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../src/lib/http.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,gBAAgB,YAAa,YAAY,KAAG,OAgBxD,CAAC"}
1
+ {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../src/lib/http.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,gBAAgB,YAAa,YAAY,KAAG,OAgBxD,CAAC"}
package/lib/http.js CHANGED
@@ -1,8 +1,3 @@
1
- /**
2
- * @license
3
- * Copyright 2026 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */
6
1
  /**
7
2
  * True when the request demonstrably comes from the dev server's own page.
8
3
  *
package/lib/http.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"http.js","sourceRoot":"","sources":["../src/lib/http.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAaH;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,OAAqB,EAAW,EAAE;IACjE,MAAM,IAAI,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACvC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,IAAI,IAAI,KAAK,aAAa,IAAI,IAAI,KAAK,MAAM;YAAE,OAAO,KAAK,CAAC;IAC9D,CAAC;IACD,MAAM,EAAC,MAAM,EAAE,IAAI,EAAC,GAAG,OAAO,CAAC;IAC/B,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QAC9C,IAAI,CAAC;YACH,IAAI,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,IAAI;gBAAE,OAAO,KAAK,CAAC;QAClD,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACf,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,sEAAsE;IACtE,OAAO,IAAI,KAAK,SAAS,CAAC;AAC5B,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Headers the trust check looks at. Both the open-in-editor endpoint and the\n * timeline/inspector endpoints are local-only dev tooling: only the page the\n * dev server itself served may drive them.\n */\nexport interface TrustHeaders {\n origin?: string;\n host?: string;\n 'sec-fetch-site'?: string;\n}\n\n/**\n * True when the request demonstrably comes from the dev server's own page.\n *\n * Two independent signals, because neither is present on every request:\n * - `Origin` is sent on CORS-mode fetches and on every non-GET/HEAD request,\n * but NOT on a plain cross-site GET (`<img>`, `<iframe>`, a navigation).\n * - `Sec-Fetch-Site` is sent by Chromium and Firefox on every request and is\n * the signal that covers exactly that gap; `same-origin` and `none` (a\n * user-typed URL) are ours, `cross-site`/`same-site` are not.\n * A request is trusted only when every signal it does carry says same-origin,\n * and at least one of them is present.\n *\n * This does not stop DNS rebinding, where a hostile page reaches the server\n * under its own name and `Origin` and `Host` agree. Vite's\n * `server.allowedHosts` check does, and it runs before any plugin middleware,\n * so this doesn't repeat it (source-overlay_test pins that ordering).\n */\nexport const isTrustedRequest = (headers: TrustHeaders): boolean => {\n const site = headers['sec-fetch-site'];\n if (site !== undefined) {\n if (site !== 'same-origin' && site !== 'none') return false;\n }\n const {origin, host} = headers;\n if (origin !== undefined && origin !== 'null') {\n try {\n if (new URL(origin).host !== host) return false;\n } catch {\n return false;\n }\n return true;\n }\n // No `Origin`: trust only when `Sec-Fetch-Site` vouched for it above.\n return site !== undefined;\n};\n"]}
1
+ {"version":3,"file":"http.js","sourceRoot":"","sources":["../src/lib/http.ts"],"names":[],"mappings":"AAWA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,OAAqB,EAAW,EAAE;IACjE,MAAM,IAAI,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACvC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,IAAI,IAAI,KAAK,aAAa,IAAI,IAAI,KAAK,MAAM;YAAE,OAAO,KAAK,CAAC;IAC9D,CAAC;IACD,MAAM,EAAC,MAAM,EAAE,IAAI,EAAC,GAAG,OAAO,CAAC;IAC/B,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QAC9C,IAAI,CAAC;YACH,IAAI,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,IAAI;gBAAE,OAAO,KAAK,CAAC;QAClD,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACf,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,sEAAsE;IACtE,OAAO,IAAI,KAAK,SAAS,CAAC;AAC5B,CAAC,CAAC","sourcesContent":["/**\n * Headers the trust check looks at. Both the open-in-editor endpoint and the\n * timeline/inspector endpoints are local-only dev tooling: only the page the\n * dev server itself served may drive them.\n */\nexport interface TrustHeaders {\n origin?: string;\n host?: string;\n 'sec-fetch-site'?: string;\n}\n\n/**\n * True when the request demonstrably comes from the dev server's own page.\n *\n * Two independent signals, because neither is present on every request:\n * - `Origin` is sent on CORS-mode fetches and on every non-GET/HEAD request,\n * but NOT on a plain cross-site GET (`<img>`, `<iframe>`, a navigation).\n * - `Sec-Fetch-Site` is sent by Chromium and Firefox on every request and is\n * the signal that covers exactly that gap; `same-origin` and `none` (a\n * user-typed URL) are ours, `cross-site`/`same-site` are not.\n * A request is trusted only when every signal it does carry says same-origin,\n * and at least one of them is present.\n *\n * This does not stop DNS rebinding, where a hostile page reaches the server\n * under its own name and `Origin` and `Host` agree. Vite's\n * `server.allowedHosts` check does, and it runs before any plugin middleware,\n * so this doesn't repeat it (source-overlay_test pins that ordering).\n */\nexport const isTrustedRequest = (headers: TrustHeaders): boolean => {\n const site = headers['sec-fetch-site'];\n if (site !== undefined) {\n if (site !== 'same-origin' && site !== 'none') return false;\n }\n const {origin, host} = headers;\n if (origin !== undefined && origin !== 'null') {\n try {\n if (new URL(origin).host !== host) return false;\n } catch {\n return false;\n }\n return true;\n }\n // No `Origin`: trust only when `Sec-Fetch-Site` vouched for it above.\n return site !== undefined;\n};\n"]}
package/lib/icons.d.ts CHANGED
@@ -1,8 +1,3 @@
1
- /**
2
- * @license
3
- * Copyright 2026 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */
6
1
  /** `cube` — Components tab. */
7
2
  export declare const CUBE_ICON = "M223.68,66.15,135.68,18h0a15.88,15.88,0,0,0-15.36,0l-88,48.17a16,16,0,0,0-8.32,14v95.64a16,16,0,0,0,8.32,14l88,48.17a15.88,15.88,0,0,0,15.36,0l88-48.17a16,16,0,0,0,8.32-14V80.18A16,16,0,0,0,223.68,66.15ZM128,32h0l80.34,44L128,120,47.66,76ZM40,90l80,43.78v85.79L40,175.82Zm96,129.57V133.82L216,90v85.78Z";
8
3
  /** `clock` — Timeline tab. */
@@ -1 +1 @@
1
- {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../src/lib/icons.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,+BAA+B;AAC/B,eAAO,MAAM,SAAS,mTAC4R,CAAC;AAEnT,8BAA8B;AAC9B,eAAO,MAAM,UAAU,gMACwK,CAAC;AAEhM,oCAAoC;AACpC,eAAO,MAAM,iBAAiB,qNACsL,CAAC;AAErN,6BAA6B;AAC7B,eAAO,MAAM,SAAS,01DACm0D,CAAC;AAE11D,iEAAiE;AACjE,eAAO,MAAM,SAAS,gbAA0a,CAAC;AAEjc,mEAAmE;AACnE,eAAO,MAAM,SAAS,yPAAmP,CAAC;AAE1Q,iDAAiD;AACjD,eAAO,MAAM,UAAU,kfAA4e,CAAC"}
1
+ {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../src/lib/icons.ts"],"names":[],"mappings":"AAMA,+BAA+B;AAC/B,eAAO,MAAM,SAAS,mTAC4R,CAAC;AAEnT,8BAA8B;AAC9B,eAAO,MAAM,UAAU,gMACwK,CAAC;AAEhM,oCAAoC;AACpC,eAAO,MAAM,iBAAiB,qNACsL,CAAC;AAErN,6BAA6B;AAC7B,eAAO,MAAM,SAAS,01DACm0D,CAAC;AAE11D,iEAAiE;AACjE,eAAO,MAAM,SAAS,gbAA0a,CAAC;AAEjc,mEAAmE;AACnE,eAAO,MAAM,SAAS,yPAAmP,CAAC;AAE1Q,iDAAiD;AACjD,eAAO,MAAM,UAAU,kfAA4e,CAAC"}
package/lib/icons.js CHANGED
@@ -1,8 +1,3 @@
1
- /**
2
- * @license
3
- * Copyright 2026 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */
6
1
  // Phosphor Icons (https://phosphoricons.com, MIT) inlined so the devtools
7
2
  // modules stay self-contained with no extra icon library dependency.
8
3
  // Panel icons are SVG path data used via <svg viewBox="0 0 256 256"
package/lib/icons.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"icons.js","sourceRoot":"","sources":["../src/lib/icons.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,0EAA0E;AAC1E,qEAAqE;AACrE,oEAAoE;AACpE,2EAA2E;AAC3E,wBAAwB;AAExB,+BAA+B;AAC/B,MAAM,CAAC,MAAM,SAAS,GACpB,gTAAgT,CAAC;AAEnT,8BAA8B;AAC9B,MAAM,CAAC,MAAM,UAAU,GACrB,6LAA6L,CAAC;AAEhM,oCAAoC;AACpC,MAAM,CAAC,MAAM,iBAAiB,GAC5B,kNAAkN,CAAC;AAErN,6BAA6B;AAC7B,MAAM,CAAC,MAAM,SAAS,GACpB,u1DAAu1D,CAAC;AAE11D,iEAAiE;AACjE,MAAM,CAAC,MAAM,SAAS,GAAG,uaAAua,CAAC;AAEjc,mEAAmE;AACnE,MAAM,CAAC,MAAM,SAAS,GAAG,gPAAgP,CAAC;AAE1Q,iDAAiD;AACjD,MAAM,CAAC,MAAM,UAAU,GAAG,yeAAye,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n// Phosphor Icons (https://phosphoricons.com, MIT) inlined so the devtools\n// modules stay self-contained with no extra icon library dependency.\n// Panel icons are SVG path data used via <svg viewBox=\"0 0 256 256\"\n// fill=\"currentColor\"><path d={...}/></svg>; runtime icons are full markup\n// injected as raw HTML.\n\n/** `cube` — Components tab. */\nexport const CUBE_ICON =\n 'M223.68,66.15,135.68,18h0a15.88,15.88,0,0,0-15.36,0l-88,48.17a16,16,0,0,0-8.32,14v95.64a16,16,0,0,0,8.32,14l88,48.17a15.88,15.88,0,0,0,15.36,0l88-48.17a16,16,0,0,0,8.32-14V80.18A16,16,0,0,0,223.68,66.15ZM128,32h0l80.34,44L128,120,47.66,76ZM40,90l80,43.78v85.79L40,175.82Zm96,129.57V133.82L216,90v85.78Z';\n\n/** `clock` — Timeline tab. */\nexport const CLOCK_ICON =\n 'M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z';\n\n/** `notification` — Updates tab. */\nexport const NOTIFICATION_ICON =\n 'M216,128v80a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V56A16,16,0,0,1,48,40h80a8,8,0,0,1,0,16H48V208H200V128a8,8,0,0,1,16,0Zm16-68a36,36,0,1,1-36-36A36,36,0,0,1,232,60Zm-16,0a20,20,0,1,0-20,20A20,20,0,0,0,216,60Z';\n\n/** `gear` — Settings tab. */\nexport const GEAR_ICON =\n 'M128,80a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Zm88-29.84q.06-2.16,0-4.32l14.92-18.64a8,8,0,0,0,1.48-7.06,107.21,107.21,0,0,0-10.88-26.25,8,8,0,0,0-6-3.93l-23.72-2.64q-1.48-1.56-3-3L186,40.54a8,8,0,0,0-3.94-6,107.71,107.71,0,0,0-26.25-10.87,8,8,0,0,0-7.06,1.49L130.16,40Q128,40,125.84,40L107.2,25.11a8,8,0,0,0-7.06-1.48A107.6,107.6,0,0,0,73.89,34.51a8,8,0,0,0-3.93,6L67.32,64.27q-1.56,1.49-3,3L40.54,70a8,8,0,0,0-6,3.94,107.71,107.71,0,0,0-10.87,26.25,8,8,0,0,0,1.49,7.06L40,125.84Q40,128,40,130.16L25.11,148.8a8,8,0,0,0-1.48,7.06,107.21,107.21,0,0,0,10.88,26.25,8,8,0,0,0,6,3.93l23.72,2.64q1.49,1.56,3,3L70,215.46a8,8,0,0,0,3.94,6,107.71,107.71,0,0,0,26.25,10.87,8,8,0,0,0,7.06-1.49L125.84,216q2.16.06,4.32,0l18.64,14.92a8,8,0,0,0,7.06,1.48,107.21,107.21,0,0,0,26.25-10.88,8,8,0,0,0,3.93-6l2.64-23.72q1.56-1.48,3-3L215.46,186a8,8,0,0,0,6-3.94,107.71,107.71,0,0,0,10.87-26.25,8,8,0,0,0-1.49-7.06Zm-16.1-6.5a73.93,73.93,0,0,1,0,8.68,8,8,0,0,0,1.74,5.48l14.19,17.73a91.57,91.57,0,0,1-6.23,15L187,173.11a8,8,0,0,0-5.1,2.64,74.11,74.11,0,0,1-6.14,6.14,8,8,0,0,0-2.64,5.1l-2.51,22.58a91.32,91.32,0,0,1-15,6.23l-17.74-14.19a8,8,0,0,0-5-1.75h-.48a73.93,73.93,0,0,1-8.68,0,8,8,0,0,0-5.48,1.74L100.45,215.8a91.57,91.57,0,0,1-15-6.23L82.89,187a8,8,0,0,0-2.64-5.1,74.11,74.11,0,0,1-6.14-6.14,8,8,0,0,0-5.1-2.64L46.43,170.6a91.32,91.32,0,0,1-6.23-15l14.19-17.74a8,8,0,0,0,1.74-5.48,73.93,73.93,0,0,1,0-8.68,8,8,0,0,0-1.74-5.48L40.2,100.45a91.57,91.57,0,0,1,6.23-15L69,82.89a8,8,0,0,0,5.1-2.64,74.11,74.11,0,0,1,6.14-6.14A8,8,0,0,0,82.89,69L85.4,46.43a91.32,91.32,0,0,1,15-6.23l17.74,14.19a8,8,0,0,0,5.48,1.74,73.93,73.93,0,0,1,8.68,0,8,8,0,0,0,5.48-1.74L155.55,40.2a91.57,91.57,0,0,1,15,6.23L173.11,69a8,8,0,0,0,2.64,5.1,74.11,74.11,0,0,1,6.14,6.14,8,8,0,0,0,5.1,2.64l22.58,2.51a91.32,91.32,0,0,1,6.23,15l-14.19,17.74A8,8,0,0,0,199.87,123.66Z';\n\n/** `code` — the source overlay's \"open in editor\" affordance. */\nexport const CODE_ICON = `<svg viewBox=\"0 0 256 256\" aria-hidden=\"true\"><path d=\"M69.12,94.15,28.5,128l40.62,33.85a8,8,0,1,1-10.24,12.29l-48-40a8,8,0,0,1,0-12.29l48-40a8,8,0,0,1,10.24,12.3Zm176,27.7-48-40a8,8,0,1,0-10.24,12.3L227.5,128l-40.62,33.85a8,8,0,1,0,10.24,12.29l48-40a8,8,0,0,0,0-12.29ZM162.73,32.48a8,8,0,0,0-10.25,4.79l-64,176a8,8,0,0,0,4.79,10.26A8.14,8.14,0,0,0,96,224a8,8,0,0,0,7.52-5.27l64-176A8,8,0,0,0,162.73,32.48Z\"></path></svg>`;\n\n/** `copy-simple` — the source overlay's \"copy path\" affordance. */\nexport const COPY_ICON = `<svg viewBox=\"0 0 256 256\" aria-hidden=\"true\"><path d=\"M184,64H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H184a8,8,0,0,0,8-8V72A8,8,0,0,0,184,64Zm-8,144H48V80H176ZM224,40V184a8,8,0,0,1-16,0V48H72a8,8,0,0,1,0-16H216A8,8,0,0,1,224,40Z\"></path></svg>`;\n\n/** `flame` — the HMR update indicator's mark. */\nexport const FLAME_ICON = `<svg viewBox=\"0 0 256 256\" aria-hidden=\"true\"><path d=\"M183.89,153.34a57.6,57.6,0,0,1-46.56,46.55A8.75,8.75,0,0,1,136,200a8,8,0,0,1-1.32-15.89c16.57-2.79,30.63-16.85,33.44-33.45a8,8,0,0,1,15.78,2.68ZM216,144a88,88,0,0,1-176,0c0-27.92,11-56.47,32.66-84.85a8,8,0,0,1,11.93-.89l24.12,23.41,22-60.41a8,8,0,0,1,12.63-3.41C165.21,36,216,84.55,216,144Zm-16,0c0-46.09-35.79-85.92-58.21-106.33L119.52,98.74a8,8,0,0,1-13.09,3L80.06,76.16C64.09,99.21,56,122,56,144a72,72,0,0,0,144,0Z\"></path></svg>`;\n"]}
1
+ {"version":3,"file":"icons.js","sourceRoot":"","sources":["../src/lib/icons.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qEAAqE;AACrE,oEAAoE;AACpE,2EAA2E;AAC3E,wBAAwB;AAExB,+BAA+B;AAC/B,MAAM,CAAC,MAAM,SAAS,GACpB,gTAAgT,CAAC;AAEnT,8BAA8B;AAC9B,MAAM,CAAC,MAAM,UAAU,GACrB,6LAA6L,CAAC;AAEhM,oCAAoC;AACpC,MAAM,CAAC,MAAM,iBAAiB,GAC5B,kNAAkN,CAAC;AAErN,6BAA6B;AAC7B,MAAM,CAAC,MAAM,SAAS,GACpB,u1DAAu1D,CAAC;AAE11D,iEAAiE;AACjE,MAAM,CAAC,MAAM,SAAS,GAAG,uaAAua,CAAC;AAEjc,mEAAmE;AACnE,MAAM,CAAC,MAAM,SAAS,GAAG,gPAAgP,CAAC;AAE1Q,iDAAiD;AACjD,MAAM,CAAC,MAAM,UAAU,GAAG,yeAAye,CAAC","sourcesContent":["// Phosphor Icons (https://phosphoricons.com, MIT) inlined so the devtools\n// modules stay self-contained with no extra icon library dependency.\n// Panel icons are SVG path data used via <svg viewBox=\"0 0 256 256\"\n// fill=\"currentColor\"><path d={...}/></svg>; runtime icons are full markup\n// injected as raw HTML.\n\n/** `cube` — Components tab. */\nexport const CUBE_ICON =\n 'M223.68,66.15,135.68,18h0a15.88,15.88,0,0,0-15.36,0l-88,48.17a16,16,0,0,0-8.32,14v95.64a16,16,0,0,0,8.32,14l88,48.17a15.88,15.88,0,0,0,15.36,0l88-48.17a16,16,0,0,0,8.32-14V80.18A16,16,0,0,0,223.68,66.15ZM128,32h0l80.34,44L128,120,47.66,76ZM40,90l80,43.78v85.79L40,175.82Zm96,129.57V133.82L216,90v85.78Z';\n\n/** `clock` — Timeline tab. */\nexport const CLOCK_ICON =\n 'M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z';\n\n/** `notification` — Updates tab. */\nexport const NOTIFICATION_ICON =\n 'M216,128v80a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V56A16,16,0,0,1,48,40h80a8,8,0,0,1,0,16H48V208H200V128a8,8,0,0,1,16,0Zm16-68a36,36,0,1,1-36-36A36,36,0,0,1,232,60Zm-16,0a20,20,0,1,0-20,20A20,20,0,0,0,216,60Z';\n\n/** `gear` — Settings tab. */\nexport const GEAR_ICON =\n 'M128,80a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Zm88-29.84q.06-2.16,0-4.32l14.92-18.64a8,8,0,0,0,1.48-7.06,107.21,107.21,0,0,0-10.88-26.25,8,8,0,0,0-6-3.93l-23.72-2.64q-1.48-1.56-3-3L186,40.54a8,8,0,0,0-3.94-6,107.71,107.71,0,0,0-26.25-10.87,8,8,0,0,0-7.06,1.49L130.16,40Q128,40,125.84,40L107.2,25.11a8,8,0,0,0-7.06-1.48A107.6,107.6,0,0,0,73.89,34.51a8,8,0,0,0-3.93,6L67.32,64.27q-1.56,1.49-3,3L40.54,70a8,8,0,0,0-6,3.94,107.71,107.71,0,0,0-10.87,26.25,8,8,0,0,0,1.49,7.06L40,125.84Q40,128,40,130.16L25.11,148.8a8,8,0,0,0-1.48,7.06,107.21,107.21,0,0,0,10.88,26.25,8,8,0,0,0,6,3.93l23.72,2.64q1.49,1.56,3,3L70,215.46a8,8,0,0,0,3.94,6,107.71,107.71,0,0,0,26.25,10.87,8,8,0,0,0,7.06-1.49L125.84,216q2.16.06,4.32,0l18.64,14.92a8,8,0,0,0,7.06,1.48,107.21,107.21,0,0,0,26.25-10.88,8,8,0,0,0,3.93-6l2.64-23.72q1.56-1.48,3-3L215.46,186a8,8,0,0,0,6-3.94,107.71,107.71,0,0,0,10.87-26.25,8,8,0,0,0-1.49-7.06Zm-16.1-6.5a73.93,73.93,0,0,1,0,8.68,8,8,0,0,0,1.74,5.48l14.19,17.73a91.57,91.57,0,0,1-6.23,15L187,173.11a8,8,0,0,0-5.1,2.64,74.11,74.11,0,0,1-6.14,6.14,8,8,0,0,0-2.64,5.1l-2.51,22.58a91.32,91.32,0,0,1-15,6.23l-17.74-14.19a8,8,0,0,0-5-1.75h-.48a73.93,73.93,0,0,1-8.68,0,8,8,0,0,0-5.48,1.74L100.45,215.8a91.57,91.57,0,0,1-15-6.23L82.89,187a8,8,0,0,0-2.64-5.1,74.11,74.11,0,0,1-6.14-6.14,8,8,0,0,0-5.1-2.64L46.43,170.6a91.32,91.32,0,0,1-6.23-15l14.19-17.74a8,8,0,0,0,1.74-5.48,73.93,73.93,0,0,1,0-8.68,8,8,0,0,0-1.74-5.48L40.2,100.45a91.57,91.57,0,0,1,6.23-15L69,82.89a8,8,0,0,0,5.1-2.64,74.11,74.11,0,0,1,6.14-6.14A8,8,0,0,0,82.89,69L85.4,46.43a91.32,91.32,0,0,1,15-6.23l17.74,14.19a8,8,0,0,0,5.48,1.74,73.93,73.93,0,0,1,8.68,0,8,8,0,0,0,5.48-1.74L155.55,40.2a91.57,91.57,0,0,1,15,6.23L173.11,69a8,8,0,0,0,2.64,5.1,74.11,74.11,0,0,1,6.14,6.14,8,8,0,0,0,5.1,2.64l22.58,2.51a91.32,91.32,0,0,1,6.23,15l-14.19,17.74A8,8,0,0,0,199.87,123.66Z';\n\n/** `code` — the source overlay's \"open in editor\" affordance. */\nexport const CODE_ICON = `<svg viewBox=\"0 0 256 256\" aria-hidden=\"true\"><path d=\"M69.12,94.15,28.5,128l40.62,33.85a8,8,0,1,1-10.24,12.29l-48-40a8,8,0,0,1,0-12.29l48-40a8,8,0,0,1,10.24,12.3Zm176,27.7-48-40a8,8,0,1,0-10.24,12.3L227.5,128l-40.62,33.85a8,8,0,1,0,10.24,12.29l48-40a8,8,0,0,0,0-12.29ZM162.73,32.48a8,8,0,0,0-10.25,4.79l-64,176a8,8,0,0,0,4.79,10.26A8.14,8.14,0,0,0,96,224a8,8,0,0,0,7.52-5.27l64-176A8,8,0,0,0,162.73,32.48Z\"></path></svg>`;\n\n/** `copy-simple` — the source overlay's \"copy path\" affordance. */\nexport const COPY_ICON = `<svg viewBox=\"0 0 256 256\" aria-hidden=\"true\"><path d=\"M184,64H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H184a8,8,0,0,0,8-8V72A8,8,0,0,0,184,64Zm-8,144H48V80H176ZM224,40V184a8,8,0,0,1-16,0V48H72a8,8,0,0,1,0-16H216A8,8,0,0,1,224,40Z\"></path></svg>`;\n\n/** `flame` — the HMR update indicator's mark. */\nexport const FLAME_ICON = `<svg viewBox=\"0 0 256 256\" aria-hidden=\"true\"><path d=\"M183.89,153.34a57.6,57.6,0,0,1-46.56,46.55A8.75,8.75,0,0,1,136,200a8,8,0,0,1-1.32-15.89c16.57-2.79,30.63-16.85,33.44-33.45a8,8,0,0,1,15.78,2.68ZM216,144a88,88,0,0,1-176,0c0-27.92,11-56.47,32.66-84.85a8,8,0,0,1,11.93-.89l24.12,23.41,22-60.41a8,8,0,0,1,12.63-3.41C165.21,36,216,84.55,216,144Zm-16,0c0-46.09-35.79-85.92-58.21-106.33L119.52,98.74a8,8,0,0,1-13.09,3L80.06,76.16C64.09,99.21,56,122,56,144a72,72,0,0,0,144,0Z\"></path></svg>`;\n"]}
package/lib/options.d.ts CHANGED
@@ -1,8 +1,3 @@
1
- /**
2
- * @license
3
- * Copyright 2026 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */
6
1
  import type { SourceOverlayOptions } from './types.js';
7
2
  import type { FeatureSettings, SettingSources } from '../types/timeline.js';
8
3
  import type { ChildStateMode } from './runtime/child-state.js';
@@ -1 +1 @@
1
- {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../src/lib/options.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,YAAY,CAAC;AACrD,OAAO,KAAK,EACV,eAAe,EAEf,cAAc,EACf,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,0BAA0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,KAAK,GAAG,QAAQ,GAAG,YAAY,CAAC;AASrE;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,GAAG,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IAE3B;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG,oBAAoB,CAAC;IAE/C;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;;;;;;;OAWG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B;AAED,6EAA6E;AAC7E,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,OAAO,CAAC;IACvB,cAAc,EAAE,QAAQ,GAAG,MAAM,CAAC;IAClC,UAAU,EAAE,cAAc,CAAC;IAC3B,SAAS,EAAE,KAAK,GAAG;QAAC,KAAK,EAAE,OAAO,CAAA;KAAC,CAAC;IACpC,aAAa,EAAE,KAAK,GAAG,oBAAoB,CAAC;IAC5C,QAAQ,EAAE,OAAO,CAAC;IAClB,aAAa,EAAE,aAAa,CAAC;IAC7B;;;OAGG;IACH,OAAO,EAAE,cAAc,CAAC;CACzB;AAED,8CAA8C;AAC9C,eAAO,MAAM,UAAU,eAAe,CAAC;AAmEvC;;;GAGG;AACH,eAAO,MAAM,cAAc,YAChB,gBAAgB,OACpB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAC1B,eAkHF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,MAAO,eAAe,KAAG,eAsBtD,CAAC"}
package/lib/options.js CHANGED
@@ -1,8 +1,3 @@
1
- /**
2
- * @license
3
- * Copyright 2026 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */
6
1
  import {BUILTIN_EDITORS} from './runtime/source-overlay/editors.js';
7
2
  const CSS_SHEET_BUILD_MODES = ['auto', 'url', 'inline', 'inline-raw'];
8
3
  /** Env var prefix consumed at config time. */
@@ -1 +1 @@
1
- {"version":3,"file":"options.js","sourceRoot":"","sources":["../src/lib/options.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,OAAO,EAAC,eAAe,EAAC,MAAM,qCAAqC,CAAC;AAuFpE,MAAM,qBAAqB,GAA6B;IACtD,MAAM;IACN,KAAK;IACL,QAAQ;IACR,YAAY;CACb,CAAC;AAqEF,8CAA8C;AAC9C,MAAM,CAAC,MAAM,UAAU,GAAG,YAAY,CAAC;AAEvC,MAAM,qBAAqB,GAAmC;IAC5D,QAAQ;IACR,MAAM;CACP,CAAC;AAEF,MAAM,iBAAiB,GAA8B;IACnD,OAAO;IACP,UAAU;IACV,OAAO;CACR,CAAC;AAEF,2EAA2E;AAC3E,MAAM,OAAO,GAAG,CAAC,CAAqB,EAAuB,EAAE,CAC7D,CAAC,KAAK,MAAM,IAAI,CAAC,KAAK,GAAG;IACvB,CAAC,CAAC,IAAI;IACN,CAAC,CAAC,CAAC,KAAK,OAAO,IAAI,CAAC,KAAK,GAAG;QAC1B,CAAC,CAAC,KAAK;QACP,CAAC,CAAC,SAAS,CAAC;AAElB,sEAAsE;AACtE,MAAM,MAAM,GAAG,CAAC,CAAqB,EAAsB,EAAE;IAC3D,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,EAAE;QAAE,OAAO,SAAS,CAAC;IAClD,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IACpB,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;AACzC,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,OAAO,GAAG,CACd,CAAqB,EACrB,OAAqB,EACrB,MAAc,EACC,EAAE;IACjB,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,EAAE;QAAE,OAAO,SAAS,CAAC;IAClD,IAAK,OAA6B,CAAC,QAAQ,CAAC,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,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC;IACpD,OAAO;QACL,GAAG,EAAE;YACH,OAAO,EAAE,CAAC,CAAC,UAAU;YACrB,SAAS,EAAE,CAAC,CAAC,SAAS;YACtB,cAAc,EAAE,CAAC,CAAC,cAAc;YAChC,UAAU,EAAE,CAAC,CAAC,UAAU;YACxB,gBAAgB,EAAE,CAAC,CAAC,SAAS,KAAK,KAAK;YACvC,cAAc,EAAE,CAAC,CAAC,SAAS,KAAK,KAAK,IAAI,CAAC,CAAC,SAAS,CAAC,KAAK;SAC3D;QACD,aAAa,EAAE;YACb,OAAO,EAAE,EAAE,KAAK,KAAK;YACrB,GAAG,EAAE,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,GAAG;YAC/C,MAAM,EACJ,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ;YACpE,UAAU,EAAE,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE;SAC7D;QACD,QAAQ,EAAE,CAAC,CAAC,QAAQ;QACpB,OAAO,EAAE,EAAC,GAAG,CAAC,CAAC,OAAO,EAAC;KACxB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport type {SourceOverlayOptions} from './types.js';\nimport type {\n FeatureSettings,\n SettingSource,\n SettingSources,\n} from '../types/timeline.js';\nimport {BUILTIN_EDITORS} from './runtime/source-overlay/editors.js';\nimport type {ChildStateMode} from './runtime/child-state.js';\n\n/**\n * On-page HMR feedback: a small pulsing indicator in the corner of the host\n * page that briefly animates on each HMR update, for at-a-glance feedback\n * without watching the console.\n */\nexport interface HmrIndicatorOptions {\n /** Inject the indicator element. Defaults to `true` (when HMR is enabled). */\n enabled?: boolean;\n\n /**\n * Show a cumulative update count next to the dot (idle opacity 0.5 instead\n * of fully transparent). Defaults to `false`.\n */\n count?: boolean;\n}\n\n/**\n * HMR for Lit component classes and its on-page feedback.\n */\nexport interface HmrOptions {\n /**\n * Enable in-place HMR for Lit component classes. When `false`, the plugin\n * skips all HMR transforms and runtime injection. Defaults to `true`.\n */\n enabled?: boolean;\n\n /**\n * Cycle `disconnectedCallback()`/`connectedCallback()` on live instances\n * after a hot patch. Interning makes this mostly unnecessary, so it's\n * opt-in. Defaults to `false`.\n */\n reconnect?: boolean;\n\n /**\n * Rewrite native `#private` class members to stable `Symbol.for` keys in\n * dev so classes using them can be hot-patched in place. This trades real\n * privacy and brand checks for working HMR, in dev only; builds are never\n * touched. Defaults to `true`.\n */\n privateFields?: boolean;\n\n /**\n * What to do when a component can't be hot-patched in place (e.g.\n * standard `accessor` decorators). Defaults to `'reload'`.\n */\n onIncompatible?: 'reload' | 'warn';\n\n /**\n * What happens to custom elements inside a template whose text a hot patch\n * changed. lit-html clones fresh DOM for the edited template, so those\n * elements are re-created.\n *\n * - `'reset'`: they start over from their defaults.\n * - `'transfer'`: each new element takes the old one's reactive properties\n * and `#private` state (keys the new template binds or sets as an\n * attribute keep the template's value).\n * - `'reuse'`: where the new element carries no bindings, the old element\n * (identity, shadow DOM, controllers) is put back in its place; elsewhere\n * as `'transfer'`.\n *\n * Defaults to `'transfer'`.\n */\n childState?: ChildStateMode;\n\n /**\n * The on-page update indicator. `true` enables it without a count; an\n * object configures it. Forced off when HMR itself is disabled. Defaults\n * to enabled (without a count).\n */\n indicator?: boolean | HmrIndicatorOptions;\n}\n\n/**\n * What a `?css-sheet` import compiles to under `vite build`.\n *\n * - `'url'`: fetch-backed sheet over the emitted `.css` asset.\n * - `'inline'`: css text embedded in the JS chunk, processed by the css\n * pipeline (`?inline`).\n * - `'inline-raw'`: css text embedded verbatim, skipping the css pipeline\n * (`?raw`).\n * - `'auto'`: `'inline'` when `build.lib` is set, `'url'` otherwise.\n */\nexport type CssSheetBuild = 'auto' | 'url' | 'inline' | 'inline-raw';\n\nconst CSS_SHEET_BUILD_MODES: readonly CssSheetBuild[] = [\n 'auto',\n 'url',\n 'inline',\n 'inline-raw',\n];\n\n/**\n * Options for the Lit Vite plugin.\n *\n * Every option also resolves from environment variables (and `.env` files)\n * with the `LIT_PLUGIN` prefix — e.g. `LIT_PLUGIN_HMR_INDICATOR=true`. Options\n * passed here take precedence over env vars, which take precedence over the\n * built-in defaults.\n */\nexport interface LitPluginOptions {\n /**\n * HMR for Lit components and its on-page feedback. `true`/`false` toggles\n * the whole feature (patching and indicator); an object configures it.\n * Defaults to enabled.\n */\n hmr?: boolean | HmrOptions;\n\n /**\n * Dev-only click-to-open-in-IDE inspector for Lit custom elements.\n * Toggle with Ctrl+Shift+S (configurable via `key`). Defaults to `false`.\n */\n sourceOverlay?: boolean | SourceOverlayOptions;\n\n /**\n * Vite DevTools Timeline panel — a Vue DevTools–style layered event stream\n * for Lit lifecycle, render, mouse, and keyboard events.\n *\n * Requires `@vitejs/devtools` in the Vite config and the `@vitejs/devtools`\n * Vite plugin (`DevTools()`) to be active. Defaults to `false` while\n * experimental.\n *\n * `true` enables all built-in layers with defaults.\n */\n timeline?: boolean;\n\n /**\n * What a `?css-sheet` import compiles to under `vite build`.\n * - `'url'`: fetch-backed sheet over the emitted `.css` asset\n * - `'inline'`: css text embedded in the JS chunk, processed by the css\n * pipeline (`?inline`)\n * - `'inline-raw'`: css text embedded verbatim, skipping the css pipeline\n * (`?raw`)\n * - `'auto'`: `'inline'` when `build.lib` is set, `'url'` otherwise\n *\n * Dev is always the fetch-backed HMR form regardless of this setting.\n * Defaults to `'auto'`.\n */\n cssSheetBuild?: CssSheetBuild;\n}\n\n/** Plugin options after merging explicit options, env vars, and defaults. */\nexport interface ResolvedOptions {\n hmrEnabled: boolean;\n reconnect: boolean;\n privateFields: boolean;\n onIncompatible: 'reload' | 'warn';\n childState: ChildStateMode;\n indicator: false | {count: boolean};\n sourceOverlay: false | SourceOverlayOptions;\n timeline: boolean;\n cssSheetBuild: CssSheetBuild;\n /**\n * Which layer each panel-visible setting came from. Source-overlay keys are\n * present only when the overlay is enabled.\n */\n sources: SettingSources;\n}\n\n/** Env var prefix consumed at config time. */\nexport const ENV_PREFIX = 'LIT_PLUGIN';\n\nconst ON_INCOMPATIBLE_MODES: readonly ('reload' | 'warn')[] = [\n 'reload',\n 'warn',\n];\n\nconst CHILD_STATE_MODES: readonly ChildStateMode[] = [\n 'reset',\n 'transfer',\n 'reuse',\n];\n\n/** Parse a boolean-ish env string; `undefined` when unset/unrecognized. */\nconst envBool = (v: string | undefined): boolean | undefined =>\n v === 'true' || v === '1'\n ? true\n : v === 'false' || v === '0'\n ? false\n : undefined;\n\n/** Parse a numeric env string; `undefined` when unset/non-numeric. */\nconst envNum = (v: string | undefined): number | undefined => {\n if (v === undefined || v === '') return undefined;\n const n = Number(v);\n return Number.isNaN(n) ? undefined : n;\n};\n\n/**\n * Parse a string against a closed set of values; `undefined` (with a warning)\n * when set to something outside it, so a typo falls back to the default\n * instead of silently disabling a feature.\n */\nconst envEnum = <T extends string>(\n v: string | undefined,\n allowed: readonly T[],\n source: string\n): T | undefined => {\n if (v === undefined || v === '') return undefined;\n if ((allowed as readonly string[]).includes(v)) return v as T;\n console.warn(\n `[lit-plugin] ignoring ${source}=${JSON.stringify(v)}; expected one of ` +\n allowed.map((a) => JSON.stringify(a)).join(', ')\n );\n return undefined;\n};\n\n/** Keys a `LIT_PLUGIN_SOURCE_OVERLAY_EDITOR` value may name. */\nconst EDITOR_KEYS: readonly string[] = Object.keys(BUILTIN_EDITORS);\n\n/** Which layer supplied a value: the first of option, env that is defined. */\nconst sourceOf = (option: unknown, env: unknown): SettingSource =>\n option !== undefined ? 'option' : env !== undefined ? 'env' : 'default';\n\n/**\n * Take the first defined of an explicit option and an env value, else the\n * default, and record which layer won.\n */\nconst pick = <T>(\n option: T | undefined,\n env: T | undefined,\n fallback: T\n): {value: T; source: SettingSource} => ({\n value: option ?? env ?? fallback,\n source: sourceOf(option, env),\n});\n\n/**\n * Merge explicit options over env vars over defaults (in that precedence) into\n * the flat shape the plugin hooks consume.\n */\nexport const resolveOptions = (\n options: LitPluginOptions,\n env: Record<string, string>\n): ResolvedOptions => {\n const hmr = options.hmr;\n const hmrObj = typeof hmr === 'object' ? hmr : undefined;\n const hmrEnabled =\n (typeof hmr === 'boolean' ? hmr : hmrObj?.enabled) ??\n envBool(env[`${ENV_PREFIX}_HMR`]) ??\n true;\n const reconnect = pick(\n hmrObj?.reconnect,\n envBool(env[`${ENV_PREFIX}_HMR_RECONNECT`]),\n false\n );\n const privateFields = pick(\n hmrObj?.privateFields,\n envBool(env[`${ENV_PREFIX}_HMR_PRIVATE_FIELDS`]),\n true\n );\n const onIncompatible = pick<'reload' | 'warn'>(\n hmrObj?.onIncompatible,\n envEnum(\n env[`${ENV_PREFIX}_HMR_ON_INCOMPATIBLE`],\n ON_INCOMPATIBLE_MODES,\n `${ENV_PREFIX}_HMR_ON_INCOMPATIBLE`\n ),\n 'reload'\n );\n const childState = pick<ChildStateMode>(\n hmrObj?.childState,\n envEnum(\n env[`${ENV_PREFIX}_HMR_CHILD_STATE`],\n CHILD_STATE_MODES,\n `${ENV_PREFIX}_HMR_CHILD_STATE`\n ),\n 'transfer'\n );\n\n const ind = hmrObj?.indicator;\n const indObj = typeof ind === 'object' ? ind : undefined;\n const indEnabled = pick(\n typeof ind === 'boolean' ? ind : indObj?.enabled,\n envBool(env[`${ENV_PREFIX}_HMR_INDICATOR`]),\n true\n );\n const indCount = pick(\n indObj?.count,\n envBool(env[`${ENV_PREFIX}_HMR_INDICATOR_COUNT`]),\n false\n );\n // The indicator is meaningless without HMR, so it follows the master toggle.\n const indicator =\n hmrEnabled && indEnabled.value ? {count: indCount.value} : false;\n\n const sources: SettingSources = {\n hmrReconnect: reconnect.source,\n hmrOnIncompatible: onIncompatible.source,\n hmrChildState: childState.source,\n hmrIndicatorVisible: indEnabled.source,\n hmrIndicatorCount: indCount.source,\n };\n\n const so = options.sourceOverlay;\n const soExplicit =\n typeof so === 'boolean' ? so : so === undefined ? undefined : true;\n const soEnabled =\n soExplicit ?? envBool(env[`${ENV_PREFIX}_SOURCE_OVERLAY`]) ?? false;\n let sourceOverlay: false | SourceOverlayOptions = false;\n if (soEnabled) {\n const base: SourceOverlayOptions = typeof so === 'object' ? {...so} : {};\n // Defaults for these are applied later (toFeatureSettings / the runtime),\n // so only option-vs-env is decided here; neither set means 'default'.\n const envKey = env[`${ENV_PREFIX}_SOURCE_OVERLAY_KEY`] || undefined;\n const envThrottle = envNum(env[`${ENV_PREFIX}_SOURCE_OVERLAY_THROTTLE_MS`]);\n // Only read (and warn about) the env editor when no option supplies one.\n const envEditor =\n base.editor === undefined\n ? envEnum(\n env[`${ENV_PREFIX}_SOURCE_OVERLAY_EDITOR`],\n EDITOR_KEYS,\n `${ENV_PREFIX}_SOURCE_OVERLAY_EDITOR`\n )\n : undefined;\n sources.sourceOverlayKey = sourceOf(base.key, envKey);\n sources.sourceOverlayEditor = sourceOf(base.editor, envEditor);\n sources.sourceOverlayThrottleMs = sourceOf(base.throttleMs, envThrottle);\n base.key ??= envKey;\n base.editor ??= envEditor;\n base.throttleMs ??= envThrottle;\n sourceOverlay = base;\n }\n\n const timeline =\n options.timeline ?? envBool(env[`${ENV_PREFIX}_TIMELINE`]) ?? false;\n\n const cssSheetBuild =\n envEnum(options.cssSheetBuild, CSS_SHEET_BUILD_MODES, 'cssSheetBuild') ??\n envEnum(\n env[`${ENV_PREFIX}_CSS_SHEET_BUILD`],\n CSS_SHEET_BUILD_MODES,\n `${ENV_PREFIX}_CSS_SHEET_BUILD`\n ) ??\n 'auto';\n\n return {\n hmrEnabled,\n reconnect: reconnect.value,\n privateFields: privateFields.value,\n onIncompatible: onIncompatible.value,\n childState: childState.value,\n indicator,\n sourceOverlay,\n timeline,\n cssSheetBuild,\n sources,\n };\n};\n\n/**\n * Flattens resolved options into the JSON-serializable shape the panel's\n * Settings tab consumes (callback options like `exclude`/`onSelect` dropped;\n * a custom editor object reported as `\"custom\"`). Default key/editor/throttle\n * are applied here so the panel shows the effective values the runtime uses.\n */\nexport const toFeatureSettings = (r: ResolvedOptions): FeatureSettings => {\n const so = r.sourceOverlay;\n const editor = so === false ? undefined : so.editor;\n return {\n hmr: {\n enabled: r.hmrEnabled,\n reconnect: r.reconnect,\n onIncompatible: r.onIncompatible,\n childState: r.childState,\n indicatorEnabled: r.indicator !== false,\n indicatorCount: r.indicator !== false && r.indicator.count,\n },\n sourceOverlay: {\n enabled: so !== false,\n key: (so === false ? undefined : so.key) ?? 's',\n editor:\n typeof editor === 'string' ? editor : editor ? 'custom' : 'vscode',\n throttleMs: (so === false ? undefined : so.throttleMs) ?? 50,\n },\n timeline: r.timeline,\n sources: {...r.sources},\n };\n};\n"]}
1
+ {"version":3,"file":"options.js","sourceRoot":"","sources":["../src/lib/options.ts"],"names":[],"mappings":"AAMA,OAAO,EAAC,eAAe,EAAC,MAAM,qCAAqC,CAAC;AAuFpE,MAAM,qBAAqB,GAA6B;IACtD,MAAM;IACN,KAAK;IACL,QAAQ;IACR,YAAY;CACb,CAAC;AAqEF,8CAA8C;AAC9C,MAAM,CAAC,MAAM,UAAU,GAAG,YAAY,CAAC;AAEvC,MAAM,qBAAqB,GAAmC;IAC5D,QAAQ;IACR,MAAM;CACP,CAAC;AAEF,MAAM,iBAAiB,GAA8B;IACnD,OAAO;IACP,UAAU;IACV,OAAO;CACR,CAAC;AAEF,2EAA2E;AAC3E,MAAM,OAAO,GAAG,CAAC,CAAqB,EAAuB,EAAE,CAC7D,CAAC,KAAK,MAAM,IAAI,CAAC,KAAK,GAAG;IACvB,CAAC,CAAC,IAAI;IACN,CAAC,CAAC,CAAC,KAAK,OAAO,IAAI,CAAC,KAAK,GAAG;QAC1B,CAAC,CAAC,KAAK;QACP,CAAC,CAAC,S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AK,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE;SAC7D;QACD,QAAQ,EAAE,CAAC,CAAC,QAAQ;QACpB,OAAO,EAAE,EAAC,GAAG,CAAC,CAAC,OAAO,EAAC;KACxB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import type {SourceOverlayOptions} from './types.js';\nimport type {\n FeatureSettings,\n SettingSource,\n SettingSources,\n} from '../types/timeline.js';\nimport {BUILTIN_EDITORS} from './runtime/source-overlay/editors.js';\nimport type {ChildStateMode} from './runtime/child-state.js';\n\n/**\n * On-page HMR feedback: a small pulsing indicator in the corner of the host\n * page that briefly animates on each HMR update, for at-a-glance feedback\n * without watching the console.\n */\nexport interface HmrIndicatorOptions {\n /** Inject the indicator element. Defaults to `true` (when HMR is enabled). */\n enabled?: boolean;\n\n /**\n * Show a cumulative update count next to the dot (idle opacity 0.5 instead\n * of fully transparent). Defaults to `false`.\n */\n count?: boolean;\n}\n\n/**\n * HMR for Lit component classes and its on-page feedback.\n */\nexport interface HmrOptions {\n /**\n * Enable in-place HMR for Lit component classes. When `false`, the plugin\n * skips all HMR transforms and runtime injection. Defaults to `true`.\n */\n enabled?: boolean;\n\n /**\n * Cycle `disconnectedCallback()`/`connectedCallback()` on live instances\n * after a hot patch. Interning makes this mostly unnecessary, so it's\n * opt-in. Defaults to `false`.\n */\n reconnect?: boolean;\n\n /**\n * Rewrite native `#private` class members to stable `Symbol.for` keys in\n * dev so classes using them can be hot-patched in place. This trades real\n * privacy and brand checks for working HMR, in dev only; builds are never\n * touched. Defaults to `true`.\n */\n privateFields?: boolean;\n\n /**\n * What to do when a component can't be hot-patched in place (e.g.\n * standard `accessor` decorators). Defaults to `'reload'`.\n */\n onIncompatible?: 'reload' | 'warn';\n\n /**\n * What happens to custom elements inside a template whose text a hot patch\n * changed. lit-html clones fresh DOM for the edited template, so those\n * elements are re-created.\n *\n * - `'reset'`: they start over from their defaults.\n * - `'transfer'`: each new element takes the old one's reactive properties\n * and `#private` state (keys the new template binds or sets as an\n * attribute keep the template's value).\n * - `'reuse'`: where the new element carries no bindings, the old element\n * (identity, shadow DOM, controllers) is put back in its place; elsewhere\n * as `'transfer'`.\n *\n * Defaults to `'transfer'`.\n */\n childState?: ChildStateMode;\n\n /**\n * The on-page update indicator. `true` enables it without a count; an\n * object configures it. Forced off when HMR itself is disabled. Defaults\n * to enabled (without a count).\n */\n indicator?: boolean | HmrIndicatorOptions;\n}\n\n/**\n * What a `?css-sheet` import compiles to under `vite build`.\n *\n * - `'url'`: fetch-backed sheet over the emitted `.css` asset.\n * - `'inline'`: css text embedded in the JS chunk, processed by the css\n * pipeline (`?inline`).\n * - `'inline-raw'`: css text embedded verbatim, skipping the css pipeline\n * (`?raw`).\n * - `'auto'`: `'inline'` when `build.lib` is set, `'url'` otherwise.\n */\nexport type CssSheetBuild = 'auto' | 'url' | 'inline' | 'inline-raw';\n\nconst CSS_SHEET_BUILD_MODES: readonly CssSheetBuild[] = [\n 'auto',\n 'url',\n 'inline',\n 'inline-raw',\n];\n\n/**\n * Options for the Lit Vite plugin.\n *\n * Every option also resolves from environment variables (and `.env` files)\n * with the `LIT_PLUGIN` prefix — e.g. `LIT_PLUGIN_HMR_INDICATOR=true`. Options\n * passed here take precedence over env vars, which take precedence over the\n * built-in defaults.\n */\nexport interface LitPluginOptions {\n /**\n * HMR for Lit components and its on-page feedback. `true`/`false` toggles\n * the whole feature (patching and indicator); an object configures it.\n * Defaults to enabled.\n */\n hmr?: boolean | HmrOptions;\n\n /**\n * Dev-only click-to-open-in-IDE inspector for Lit custom elements.\n * Toggle with Ctrl+Shift+S (configurable via `key`). Defaults to `false`.\n */\n sourceOverlay?: boolean | SourceOverlayOptions;\n\n /**\n * Vite DevTools Timeline panel — a Vue DevTools–style layered event stream\n * for Lit lifecycle, render, mouse, and keyboard events.\n *\n * Requires `@vitejs/devtools` in the Vite config and the `@vitejs/devtools`\n * Vite plugin (`DevTools()`) to be active. Defaults to `false` while\n * experimental.\n *\n * `true` enables all built-in layers with defaults.\n */\n timeline?: boolean;\n\n /**\n * What a `?css-sheet` import compiles to under `vite build`.\n * - `'url'`: fetch-backed sheet over the emitted `.css` asset\n * - `'inline'`: css text embedded in the JS chunk, processed by the css\n * pipeline (`?inline`)\n * - `'inline-raw'`: css text embedded verbatim, skipping the css pipeline\n * (`?raw`)\n * - `'auto'`: `'inline'` when `build.lib` is set, `'url'` otherwise\n *\n * Dev is always the fetch-backed HMR form regardless of this setting.\n * Defaults to `'auto'`.\n */\n cssSheetBuild?: CssSheetBuild;\n}\n\n/** Plugin options after merging explicit options, env vars, and defaults. */\nexport interface ResolvedOptions {\n hmrEnabled: boolean;\n reconnect: boolean;\n privateFields: boolean;\n onIncompatible: 'reload' | 'warn';\n childState: ChildStateMode;\n indicator: false | {count: boolean};\n sourceOverlay: false | SourceOverlayOptions;\n timeline: boolean;\n cssSheetBuild: CssSheetBuild;\n /**\n * Which layer each panel-visible setting came from. Source-overlay keys are\n * present only when the overlay is enabled.\n */\n sources: SettingSources;\n}\n\n/** Env var prefix consumed at config time. */\nexport const ENV_PREFIX = 'LIT_PLUGIN';\n\nconst ON_INCOMPATIBLE_MODES: readonly ('reload' | 'warn')[] = [\n 'reload',\n 'warn',\n];\n\nconst CHILD_STATE_MODES: readonly ChildStateMode[] = [\n 'reset',\n 'transfer',\n 'reuse',\n];\n\n/** Parse a boolean-ish env string; `undefined` when unset/unrecognized. */\nconst envBool = (v: string | undefined): boolean | undefined =>\n v === 'true' || v === '1'\n ? true\n : v === 'false' || v === '0'\n ? false\n : undefined;\n\n/** Parse a numeric env string; `undefined` when unset/non-numeric. */\nconst envNum = (v: string | undefined): number | undefined => {\n if (v === undefined || v === '') return undefined;\n const n = Number(v);\n return Number.isNaN(n) ? undefined : n;\n};\n\n/**\n * Parse a string against a closed set of values; `undefined` (with a warning)\n * when set to something outside it, so a typo falls back to the default\n * instead of silently disabling a feature.\n */\nconst envEnum = <T extends string>(\n v: string | undefined,\n allowed: readonly T[],\n source: string\n): T | undefined => {\n if (v === undefined || v === '') return undefined;\n if ((allowed as readonly string[]).includes(v)) return v as T;\n console.warn(\n `[lit-plugin] ignoring ${source}=${JSON.stringify(v)}; expected one of ` +\n allowed.map((a) => JSON.stringify(a)).join(', ')\n );\n return undefined;\n};\n\n/** Keys a `LIT_PLUGIN_SOURCE_OVERLAY_EDITOR` value may name. */\nconst EDITOR_KEYS: readonly string[] = Object.keys(BUILTIN_EDITORS);\n\n/** Which layer supplied a value: the first of option, env that is defined. */\nconst sourceOf = (option: unknown, env: unknown): SettingSource =>\n option !== undefined ? 'option' : env !== undefined ? 'env' : 'default';\n\n/**\n * Take the first defined of an explicit option and an env value, else the\n * default, and record which layer won.\n */\nconst pick = <T>(\n option: T | undefined,\n env: T | undefined,\n fallback: T\n): {value: T; source: SettingSource} => ({\n value: option ?? env ?? fallback,\n source: sourceOf(option, env),\n});\n\n/**\n * Merge explicit options over env vars over defaults (in that precedence) into\n * the flat shape the plugin hooks consume.\n */\nexport const resolveOptions = (\n options: LitPluginOptions,\n env: Record<string, string>\n): ResolvedOptions => {\n const hmr = options.hmr;\n const hmrObj = typeof hmr === 'object' ? hmr : undefined;\n const hmrEnabled =\n (typeof hmr === 'boolean' ? hmr : hmrObj?.enabled) ??\n envBool(env[`${ENV_PREFIX}_HMR`]) ??\n true;\n const reconnect = pick(\n hmrObj?.reconnect,\n envBool(env[`${ENV_PREFIX}_HMR_RECONNECT`]),\n false\n );\n const privateFields = pick(\n hmrObj?.privateFields,\n envBool(env[`${ENV_PREFIX}_HMR_PRIVATE_FIELDS`]),\n true\n );\n const onIncompatible = pick<'reload' | 'warn'>(\n hmrObj?.onIncompatible,\n envEnum(\n env[`${ENV_PREFIX}_HMR_ON_INCOMPATIBLE`],\n ON_INCOMPATIBLE_MODES,\n `${ENV_PREFIX}_HMR_ON_INCOMPATIBLE`\n ),\n 'reload'\n );\n const childState = pick<ChildStateMode>(\n hmrObj?.childState,\n envEnum(\n env[`${ENV_PREFIX}_HMR_CHILD_STATE`],\n CHILD_STATE_MODES,\n `${ENV_PREFIX}_HMR_CHILD_STATE`\n ),\n 'transfer'\n );\n\n const ind = hmrObj?.indicator;\n const indObj = typeof ind === 'object' ? ind : undefined;\n const indEnabled = pick(\n typeof ind === 'boolean' ? ind : indObj?.enabled,\n envBool(env[`${ENV_PREFIX}_HMR_INDICATOR`]),\n true\n );\n const indCount = pick(\n indObj?.count,\n envBool(env[`${ENV_PREFIX}_HMR_INDICATOR_COUNT`]),\n false\n );\n // The indicator is meaningless without HMR, so it follows the master toggle.\n const indicator =\n hmrEnabled && indEnabled.value ? {count: indCount.value} : false;\n\n const sources: SettingSources = {\n hmrReconnect: reconnect.source,\n hmrOnIncompatible: onIncompatible.source,\n hmrChildState: childState.source,\n hmrIndicatorVisible: indEnabled.source,\n hmrIndicatorCount: indCount.source,\n };\n\n const so = options.sourceOverlay;\n const soExplicit =\n typeof so === 'boolean' ? so : so === undefined ? undefined : true;\n const soEnabled =\n soExplicit ?? envBool(env[`${ENV_PREFIX}_SOURCE_OVERLAY`]) ?? false;\n let sourceOverlay: false | SourceOverlayOptions = false;\n if (soEnabled) {\n const base: SourceOverlayOptions = typeof so === 'object' ? {...so} : {};\n // Defaults for these are applied later (toFeatureSettings / the runtime),\n // so only option-vs-env is decided here; neither set means 'default'.\n const envKey = env[`${ENV_PREFIX}_SOURCE_OVERLAY_KEY`] || undefined;\n const envThrottle = envNum(env[`${ENV_PREFIX}_SOURCE_OVERLAY_THROTTLE_MS`]);\n // Only read (and warn about) the env editor when no option supplies one.\n const envEditor =\n base.editor === undefined\n ? envEnum(\n env[`${ENV_PREFIX}_SOURCE_OVERLAY_EDITOR`],\n EDITOR_KEYS,\n `${ENV_PREFIX}_SOURCE_OVERLAY_EDITOR`\n )\n : undefined;\n sources.sourceOverlayKey = sourceOf(base.key, envKey);\n sources.sourceOverlayEditor = sourceOf(base.editor, envEditor);\n sources.sourceOverlayThrottleMs = sourceOf(base.throttleMs, envThrottle);\n base.key ??= envKey;\n base.editor ??= envEditor;\n base.throttleMs ??= envThrottle;\n sourceOverlay = base;\n }\n\n const timeline =\n options.timeline ?? envBool(env[`${ENV_PREFIX}_TIMELINE`]) ?? false;\n\n const cssSheetBuild =\n envEnum(options.cssSheetBuild, CSS_SHEET_BUILD_MODES, 'cssSheetBuild') ??\n envEnum(\n env[`${ENV_PREFIX}_CSS_SHEET_BUILD`],\n CSS_SHEET_BUILD_MODES,\n `${ENV_PREFIX}_CSS_SHEET_BUILD`\n ) ??\n 'auto';\n\n return {\n hmrEnabled,\n reconnect: reconnect.value,\n privateFields: privateFields.value,\n onIncompatible: onIncompatible.value,\n childState: childState.value,\n indicator,\n sourceOverlay,\n timeline,\n cssSheetBuild,\n sources,\n };\n};\n\n/**\n * Flattens resolved options into the JSON-serializable shape the panel's\n * Settings tab consumes (callback options like `exclude`/`onSelect` dropped;\n * a custom editor object reported as `\"custom\"`). Default key/editor/throttle\n * are applied here so the panel shows the effective values the runtime uses.\n */\nexport const toFeatureSettings = (r: ResolvedOptions): FeatureSettings => {\n const so = r.sourceOverlay;\n const editor = so === false ? undefined : so.editor;\n return {\n hmr: {\n enabled: r.hmrEnabled,\n reconnect: r.reconnect,\n onIncompatible: r.onIncompatible,\n childState: r.childState,\n indicatorEnabled: r.indicator !== false,\n indicatorCount: r.indicator !== false && r.indicator.count,\n },\n sourceOverlay: {\n enabled: so !== false,\n key: (so === false ? undefined : so.key) ?? 's',\n editor:\n typeof editor === 'string' ? editor : editor ? 'custom' : 'vscode',\n throttleMs: (so === false ? undefined : so.throttleMs) ?? 50,\n },\n timeline: r.timeline,\n sources: {...r.sources},\n };\n};\n"]}
@@ -1,8 +1,3 @@
1
- /**
2
- * @license
3
- * Copyright 2026 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */
6
1
  import type { OverrideBaselines } from '../types/timeline.js';
7
2
  /**
8
3
  * Whether the config value an override was made against has since changed.
@@ -1 +1 @@
1
- {"version":3,"file":"override-baselines.d.ts","sourceRoot":"","sources":["../src/lib/override-baselines.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,sBAAsB,CAAC;AAE5D;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,QACrB,MAAM,iBAAiB,YAClB,OAAO,WACR,OAAO,KACf,OASF,CAAC"}
1
+ {"version":3,"file":"override-baselines.d.ts","sourceRoot":"","sources":["../src/lib/override-baselines.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,sBAAsB,CAAC;AAE5D;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,QACrB,MAAM,iBAAiB,YAClB,OAAO,WACR,OAAO,KACf,OASF,CAAC"}
@@ -1,8 +1,3 @@
1
- /**
2
- * @license
3
- * Copyright 2026 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */
6
1
  /**
7
2
  * Whether the config value an override was made against has since changed.
8
3
  *
@@ -1 +1 @@
1
- {"version":3,"file":"override-baselines.js","sourceRoot":"","sources":["../src/lib/override-baselines.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,GAA4B,EAC5B,QAAiB,EACjB,OAAgB,EACP,EAAE;IACX,IAAI,QAAQ,KAAK,SAAS,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IAClE,IACE,GAAG,KAAK,qBAAqB;QAC7B,CAAC,QAAQ,KAAK,QAAQ,IAAI,OAAO,KAAK,QAAQ,CAAC,EAC/C,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AAC9D,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport type {OverrideBaselines} from '../types/timeline.js';\n\n/**\n * Whether the config value an override was made against has since changed.\n *\n * `recorded` is `undefined` for a legacy override that predates baseline\n * tracking, which never counts as a change (no false positives). Values are\n * compared structurally. The source-overlay editor reports `'custom'` for an\n * `EditorConfig` object, which can't be compared meaningfully, so any side\n * being `'custom'` skips the check.\n */\nexport const baselineChanged = (\n key: keyof OverrideBaselines,\n recorded: unknown,\n current: unknown\n): boolean => {\n if (recorded === undefined || current === undefined) return false;\n if (\n key === 'sourceOverlayEditor' &&\n (recorded === 'custom' || current === 'custom')\n ) {\n return false;\n }\n return JSON.stringify(recorded) !== JSON.stringify(current);\n};\n"]}
1
+ {"version":3,"file":"override-baselines.js","sourceRoot":"","sources":["../src/lib/override-baselines.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,GAA4B,EAC5B,QAAiB,EACjB,OAAgB,EACP,EAAE;IACX,IAAI,QAAQ,KAAK,SAAS,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IAClE,IACE,GAAG,KAAK,qBAAqB;QAC7B,CAAC,QAAQ,KAAK,QAAQ,IAAI,OAAO,KAAK,QAAQ,CAAC,EAC/C,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AAC9D,CAAC,CAAC","sourcesContent":["import type {OverrideBaselines} from '../types/timeline.js';\n\n/**\n * Whether the config value an override was made against has since changed.\n *\n * `recorded` is `undefined` for a legacy override that predates baseline\n * tracking, which never counts as a change (no false positives). Values are\n * compared structurally. The source-overlay editor reports `'custom'` for an\n * `EditorConfig` object, which can't be compared meaningfully, so any side\n * being `'custom'` skips the check.\n */\nexport const baselineChanged = (\n key: keyof OverrideBaselines,\n recorded: unknown,\n current: unknown\n): boolean => {\n if (recorded === undefined || current === undefined) return false;\n if (\n key === 'sourceOverlayEditor' &&\n (recorded === 'custom' || current === 'custom')\n ) {\n return false;\n }\n return JSON.stringify(recorded) !== JSON.stringify(current);\n};\n"]}
package/lib/plugin.d.ts CHANGED
@@ -1,8 +1,3 @@
1
- /**
2
- * @license
3
- * Copyright 2026 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */
6
1
  import { type Plugin } from 'vite';
7
2
  import { type LitPluginOptions } from './options.js';
8
3
  export { createOpenInEditorMiddleware } from './plugins/open-in-editor.js';
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/lib/plugin.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAU,KAAK,MAAM,EAAC,MAAM,MAAM,CAAC;AAO1C,OAAO,EAEL,KAAK,gBAAgB,EAItB,MAAM,cAAc,CAAC;AAWtB,OAAO,EAAC,4BAA4B,EAAC,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAC,aAAa,EAAC,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAC,kBAAkB,EAAC,MAAM,+BAA+B,CAAC;AACjE,YAAY,EACV,mBAAmB,EACnB,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,eAAe,GAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAC,cAAc,EAAC,MAAM,cAAc,CAAC;AAE5C;;;GAGG;AACH,eAAO,MAAM,SAAS,aAAa,gBAAgB,KAAQ,MAAM,EAyRhE,CAAC"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/lib/plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,KAAK,MAAM,EAAC,MAAM,MAAM,CAAC;AAO1C,OAAO,EAEL,KAAK,gBAAgB,EAItB,MAAM,cAAc,CAAC;AAWtB,OAAO,EAAC,4BAA4B,EAAC,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAC,aAAa,EAAC,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAC,kBAAkB,EAAC,MAAM,+BAA+B,CAAC;AACjE,YAAY,EACV,mBAAmB,EACnB,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,eAAe,GAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAC,cAAc,EAAC,MAAM,cAAc,CAAC;AAE5C;;;GAGG;AACH,eAAO,MAAM,SAAS,aAAa,gBAAgB,KAAQ,MAAM,EAyRhE,CAAC"}
package/lib/plugin.js CHANGED
@@ -1,8 +1,3 @@
1
- /**
2
- * @license
3
- * Copyright 2026 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */
6
1
  import {resolve as resolvePath} from 'node:path';
7
2
  import {loadEnv} from 'vite';
8
3
  import MagicString from 'magic-string';