@oddsquad/vite-plugin-lit 0.2.2 → 0.3.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 (210) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/LICENSE +28 -0
  3. package/README.md +153 -0
  4. package/bin.mjs +154 -0
  5. package/client.d.ts +61 -0
  6. package/dist/client/assets/browser-agent-rpc-BXhoSh1z-BvWe4sTJ.js +69 -0
  7. package/dist/client/assets/browser-agent-rpc-BXhoSh1z-BvWe4sTJ.js.map +1 -0
  8. package/dist/client/assets/index-CFrVgNfS.js +9740 -0
  9. package/dist/client/assets/index-CFrVgNfS.js.map +1 -0
  10. package/{panel → dist/client}/index.html +1 -0
  11. package/index.d.ts.map +1 -1
  12. package/index.js +2 -2
  13. package/index.js.map +1 -1
  14. package/lib/color-scheme.d.ts.map +1 -1
  15. package/lib/color-scheme.js +17 -21
  16. package/lib/color-scheme.js.map +1 -1
  17. package/lib/devframe/definition.d.ts +45 -0
  18. package/lib/devframe/definition.d.ts.map +1 -0
  19. package/lib/devframe/definition.js +547 -0
  20. package/lib/devframe/definition.js.map +1 -0
  21. package/lib/devframe/icon.d.ts +8 -0
  22. package/lib/devframe/icon.d.ts.map +1 -0
  23. package/lib/devframe/icon.js +21 -0
  24. package/lib/devframe/icon.js.map +1 -0
  25. package/lib/devframe/paths.d.ts +12 -0
  26. package/lib/devframe/paths.d.ts.map +1 -0
  27. package/lib/devframe/paths.js +38 -0
  28. package/lib/devframe/paths.js.map +1 -0
  29. package/lib/devframe/protocol.d.ts +218 -0
  30. package/lib/devframe/protocol.d.ts.map +1 -0
  31. package/lib/devframe/protocol.js +76 -0
  32. package/lib/devframe/protocol.js.map +1 -0
  33. package/lib/devframe/source.d.ts +49 -0
  34. package/lib/devframe/source.d.ts.map +1 -0
  35. package/lib/devframe/source.js +23 -0
  36. package/lib/devframe/source.js.map +1 -0
  37. package/lib/devframe/vite.d.ts +116 -0
  38. package/lib/devframe/vite.d.ts.map +1 -0
  39. package/lib/devframe/vite.js +291 -0
  40. package/lib/devframe/vite.js.map +1 -0
  41. package/lib/http.d.ts +29 -0
  42. package/lib/http.d.ts.map +1 -0
  43. package/lib/http.js +35 -0
  44. package/lib/http.js.map +1 -0
  45. package/lib/icons.d.ts +2 -0
  46. package/lib/icons.d.ts.map +1 -1
  47. package/lib/icons.js +10 -4
  48. package/lib/icons.js.map +1 -1
  49. package/lib/plugin.d.ts +15 -4
  50. package/lib/plugin.d.ts.map +1 -1
  51. package/lib/plugin.js +640 -574
  52. package/lib/plugin.js.map +1 -1
  53. package/lib/runtime/css.d.ts +2 -16
  54. package/lib/runtime/css.d.ts.map +1 -1
  55. package/lib/runtime/css.js +43 -36
  56. package/lib/runtime/css.js.map +1 -1
  57. package/lib/runtime/edge-panel.d.ts.map +1 -1
  58. package/lib/runtime/edge-panel.js +82 -91
  59. package/lib/runtime/edge-panel.js.map +1 -1
  60. package/lib/runtime/fonts.d.ts.map +1 -1
  61. package/lib/runtime/fonts.js +1 -1
  62. package/lib/runtime/fonts.js.map +1 -1
  63. package/lib/runtime/indicator.d.ts.map +1 -1
  64. package/lib/runtime/indicator.js +71 -74
  65. package/lib/runtime/indicator.js.map +1 -1
  66. package/lib/runtime/inspector/collect.d.ts.map +1 -1
  67. package/lib/runtime/inspector/collect.js +83 -90
  68. package/lib/runtime/inspector/collect.js.map +1 -1
  69. package/lib/runtime/inspector/highlight.d.ts +16 -0
  70. package/lib/runtime/inspector/highlight.d.ts.map +1 -0
  71. package/lib/runtime/inspector/highlight.js +66 -0
  72. package/lib/runtime/inspector/highlight.js.map +1 -0
  73. package/lib/runtime/inspector/install.d.ts.map +1 -1
  74. package/lib/runtime/inspector/install.js +180 -205
  75. package/lib/runtime/inspector/install.js.map +1 -1
  76. package/lib/runtime/inspector/serialize.d.ts.map +1 -1
  77. package/lib/runtime/inspector/serialize.js +86 -107
  78. package/lib/runtime/inspector/serialize.js.map +1 -1
  79. package/lib/runtime/intern.d.ts.map +1 -1
  80. package/lib/runtime/intern.js +31 -29
  81. package/lib/runtime/intern.js.map +1 -1
  82. package/lib/runtime/overrides.d.ts.map +1 -1
  83. package/lib/runtime/overrides.js +14 -13
  84. package/lib/runtime/overrides.js.map +1 -1
  85. package/lib/runtime/patch.d.ts +8 -0
  86. package/lib/runtime/patch.d.ts.map +1 -1
  87. package/lib/runtime/patch.js +321 -282
  88. package/lib/runtime/patch.js.map +1 -1
  89. package/lib/runtime/source-meta.d.ts.map +1 -1
  90. package/lib/runtime/source-meta.js +1 -1
  91. package/lib/runtime/source-meta.js.map +1 -1
  92. package/lib/runtime/source-overlay/editors.d.ts.map +1 -1
  93. package/lib/runtime/source-overlay/editors.js +27 -27
  94. package/lib/runtime/source-overlay/editors.js.map +1 -1
  95. package/lib/runtime/source-overlay/mask-path.d.ts.map +1 -1
  96. package/lib/runtime/source-overlay/mask-path.js +15 -15
  97. package/lib/runtime/source-overlay/mask-path.js.map +1 -1
  98. package/lib/runtime/source-overlay/overlay-element.d.ts.map +1 -1
  99. package/lib/runtime/source-overlay/overlay-element.js +347 -356
  100. package/lib/runtime/source-overlay/overlay-element.js.map +1 -1
  101. package/lib/runtime/source-overlay/source-host.d.ts.map +1 -1
  102. package/lib/runtime/source-overlay/source-host.js +64 -71
  103. package/lib/runtime/source-overlay/source-host.js.map +1 -1
  104. package/lib/runtime/source-overlay/template.d.ts.map +1 -1
  105. package/lib/runtime/source-overlay/template.js +3 -3
  106. package/lib/runtime/source-overlay/template.js.map +1 -1
  107. package/lib/runtime/source-overlay.d.ts.map +1 -1
  108. package/lib/runtime/source-overlay.js +5 -2
  109. package/lib/runtime/source-overlay.js.map +1 -1
  110. package/lib/runtime/timeline/clock.d.ts.map +1 -1
  111. package/lib/runtime/timeline/clock.js +2 -2
  112. package/lib/runtime/timeline/clock.js.map +1 -1
  113. package/lib/runtime/timeline/flash.d.ts +39 -0
  114. package/lib/runtime/timeline/flash.d.ts.map +1 -0
  115. package/lib/runtime/timeline/flash.js +169 -0
  116. package/lib/runtime/timeline/flash.js.map +1 -0
  117. package/lib/runtime/timeline/identity.d.ts.map +1 -1
  118. package/lib/runtime/timeline/identity.js +27 -27
  119. package/lib/runtime/timeline/identity.js.map +1 -1
  120. package/lib/runtime/timeline/input.d.ts.map +1 -1
  121. package/lib/runtime/timeline/input.js +54 -67
  122. package/lib/runtime/timeline/input.js.map +1 -1
  123. package/lib/runtime/timeline/install.d.ts.map +1 -1
  124. package/lib/runtime/timeline/install.js +38 -29
  125. package/lib/runtime/timeline/install.js.map +1 -1
  126. package/lib/runtime/timeline/lifecycle.d.ts +8 -0
  127. package/lib/runtime/timeline/lifecycle.d.ts.map +1 -1
  128. package/lib/runtime/timeline/lifecycle.js +149 -133
  129. package/lib/runtime/timeline/lifecycle.js.map +1 -1
  130. package/lib/runtime/timeline/public-api.d.ts.map +1 -1
  131. package/lib/runtime/timeline/public-api.js +9 -9
  132. package/lib/runtime/timeline/public-api.js.map +1 -1
  133. package/lib/runtime/timeline/render.d.ts.map +1 -1
  134. package/lib/runtime/timeline/render.js +70 -75
  135. package/lib/runtime/timeline/render.js.map +1 -1
  136. package/lib/runtime/timeline/transport.d.ts.map +1 -1
  137. package/lib/runtime/timeline/transport.js +39 -43
  138. package/lib/runtime/timeline/transport.js.map +1 -1
  139. package/lib/segmented-tabs.d.ts +3 -1
  140. package/lib/segmented-tabs.d.ts.map +1 -1
  141. package/lib/segmented-tabs.js +136 -107
  142. package/lib/segmented-tabs.js.map +1 -1
  143. package/lib/snapshot.d.ts +28 -0
  144. package/lib/snapshot.d.ts.map +1 -0
  145. package/lib/snapshot.js +57 -0
  146. package/lib/snapshot.js.map +1 -0
  147. package/lib/source-meta.d.ts.map +1 -1
  148. package/lib/source-meta.js +176 -162
  149. package/lib/source-meta.js.map +1 -1
  150. package/lib/timeline/derive.d.ts +152 -0
  151. package/lib/timeline/derive.d.ts.map +1 -0
  152. package/lib/timeline/derive.js +242 -0
  153. package/lib/timeline/derive.js.map +1 -0
  154. package/lib/timeline-plugin.d.ts.map +1 -1
  155. package/lib/timeline-plugin.js +304 -321
  156. package/lib/timeline-plugin.js.map +1 -1
  157. package/lib/tokens.d.ts.map +1 -1
  158. package/lib/tokens.js +17 -18
  159. package/lib/tokens.js.map +1 -1
  160. package/lib/transform.d.ts.map +1 -1
  161. package/lib/transform.js +62 -57
  162. package/lib/transform.js.map +1 -1
  163. package/lib/types.d.ts.map +1 -1
  164. package/lib/types.js +1 -1
  165. package/lib/types.js.map +1 -1
  166. package/lib/wrap-table.d.ts.map +1 -1
  167. package/lib/wrap-table.js +19 -17
  168. package/lib/wrap-table.js.map +1 -1
  169. package/package.json +77 -13
  170. package/types/hmr-incompatibility.d.ts +59 -0
  171. package/types/hmr-incompatibility.d.ts.map +1 -0
  172. package/types/hmr-incompatibility.js +30 -0
  173. package/types/hmr-incompatibility.js.map +1 -0
  174. package/types/in-page.d.ts +49 -0
  175. package/types/in-page.d.ts.map +1 -0
  176. package/types/in-page.js +33 -0
  177. package/types/in-page.js.map +1 -0
  178. package/types/inspector.d.ts.map +1 -1
  179. package/types/inspector.js.map +1 -1
  180. package/types/snapshot.d.ts +44 -0
  181. package/types/snapshot.d.ts.map +1 -0
  182. package/types/snapshot.js +7 -0
  183. package/types/snapshot.js.map +1 -0
  184. package/types/timeline.d.ts +11 -0
  185. package/types/timeline.d.ts.map +1 -1
  186. package/types/timeline.js.map +1 -1
  187. package/panel/components-view.d.ts +0 -60
  188. package/panel/components-view.d.ts.map +0 -1
  189. package/panel/components-view.js +0 -587
  190. package/panel/components-view.js.map +0 -1
  191. package/panel/devtools-settings.d.ts +0 -41
  192. package/panel/devtools-settings.d.ts.map +0 -1
  193. package/panel/devtools-settings.js +0 -463
  194. package/panel/devtools-settings.js.map +0 -1
  195. package/panel/lit-devtools-panel.d.ts +0 -37
  196. package/panel/lit-devtools-panel.d.ts.map +0 -1
  197. package/panel/lit-devtools-panel.js +0 -185
  198. package/panel/lit-devtools-panel.js.map +0 -1
  199. package/panel/timeline-event-list.d.ts +0 -43
  200. package/panel/timeline-event-list.d.ts.map +0 -1
  201. package/panel/timeline-event-list.js +0 -416
  202. package/panel/timeline-event-list.js.map +0 -1
  203. package/panel/timeline-layers.d.ts +0 -25
  204. package/panel/timeline-layers.d.ts.map +0 -1
  205. package/panel/timeline-layers.js +0 -96
  206. package/panel/timeline-layers.js.map +0 -1
  207. package/panel/timeline-view.d.ts +0 -38
  208. package/panel/timeline-view.d.ts.map +0 -1
  209. package/panel/timeline-view.js +0 -234
  210. package/panel/timeline-view.js.map +0 -1
@@ -22,6 +22,7 @@
22
22
  `prefers-color-scheme` @media owns it, following the host/OS; an explicit
23
23
  light/dark pins a `.color-scheme-*` class on :root.
24
24
  -->
25
+ <script type="module" crossorigin src="./assets/index-CFrVgNfS.js"></script>
25
26
  </head>
26
27
  <body>
27
28
  <lit-devtools-panel></lit-devtools-panel>
package/index.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/labs/vite-plugin-lit/src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,SAAS,EAAE,SAAS,IAAI,OAAO,EAAC,MAAM,iBAAiB,CAAC;AAChE,YAAY,EAAC,gBAAgB,EAAC,MAAM,iBAAiB,CAAC;AACtD,YAAY,EACV,WAAW,EACX,YAAY,EACZ,oBAAoB,GACrB,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,SAAS,EAAE,SAAS,IAAI,OAAO,EAAC,MAAM,iBAAiB,CAAC;AAChE,YAAY,EAAC,gBAAgB,EAAC,MAAM,iBAAiB,CAAC;AACtD,YAAY,EACV,WAAW,EACX,YAAY,EACZ,oBAAoB,GACrB,MAAM,gBAAgB,CAAC"}
package/index.js CHANGED
@@ -3,5 +3,5 @@
3
3
  * Copyright 2026 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
5
  */
6
- export { litPlugin, litPlugin as default } from './lib/plugin.js';
7
- //# sourceMappingURL=index.js.map
6
+ export {litPlugin, litPlugin as default} from './lib/plugin.js';
7
+ //# sourceMappingURL=index.js.map
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../packages/labs/vite-plugin-lit/src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,SAAS,EAAE,SAAS,IAAI,OAAO,EAAC,MAAM,iBAAiB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nexport {litPlugin, litPlugin as default} from './lib/plugin.js';\nexport type {LitPluginOptions} from './lib/plugin.js';\nexport type {\n ElementInfo,\n EditorConfig,\n SourceOverlayOptions,\n} from './lib/types.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,SAAS,EAAE,SAAS,IAAI,OAAO,EAAC,MAAM,iBAAiB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nexport {litPlugin, litPlugin as default} from './lib/plugin.js';\nexport type {LitPluginOptions} from './lib/plugin.js';\nexport type {\n ElementInfo,\n EditorConfig,\n SourceOverlayOptions,\n} from './lib/types.js';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"color-scheme.d.ts","sourceRoot":"","sources":["../../../packages/labs/vite-plugin-lit/src/lib/color-scheme.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;GAUG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAE9D,iEAAiE;AACjE,eAAO,MAAM,mBAAmB,8BAA8B,CAAC;AAE/D,uDAAuD;AACvD,eAAO,MAAM,yBAAyB,QAAO,qBAQ5C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAAI,MAAM,qBAAqB,KAAG,IAI9D,CAAC;AAEF,qDAAqD;AACrD,eAAO,MAAM,wBAAwB,GAAI,MAAM,qBAAqB,KAAG,IAOtE,CAAC"}
1
+ {"version":3,"file":"color-scheme.d.ts","sourceRoot":"","sources":["../src/lib/color-scheme.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;GAUG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAE9D,iEAAiE;AACjE,eAAO,MAAM,mBAAmB,8BAA8B,CAAC;AAE/D,uDAAuD;AACvD,eAAO,MAAM,yBAAyB,QAAO,qBAQ5C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,SAAU,qBAAqB,KAAG,IAI9D,CAAC;AAEF,qDAAqD;AACrD,eAAO,MAAM,wBAAwB,SAAU,qBAAqB,KAAG,IAOtE,CAAC"}
@@ -7,15 +7,13 @@
7
7
  export const COLOR_SCHEME_LS_KEY = 'lit-devtools-color-scheme';
8
8
  /** Read the saved preference, defaulting to `auto`. */
9
9
  export const readColorSchemePreference = () => {
10
- try {
11
- const raw = localStorage.getItem(COLOR_SCHEME_LS_KEY);
12
- if (raw === 'auto' || raw === 'dark' || raw === 'light')
13
- return raw;
14
- }
15
- catch {
16
- // ignore
17
- }
18
- return 'auto';
10
+ try {
11
+ const raw = localStorage.getItem(COLOR_SCHEME_LS_KEY);
12
+ if (raw === 'auto' || raw === 'dark' || raw === 'light') return raw;
13
+ } catch {
14
+ // ignore
15
+ }
16
+ return 'auto';
19
17
  };
20
18
  /**
21
19
  * Apply a preference to the document root. `light`/`dark` pin the matching
@@ -23,19 +21,17 @@ export const readColorSchemePreference = () => {
23
21
  * in the injected tokens own the scheme (and live-update on OS changes).
24
22
  */
25
23
  export const applyColorScheme = (pref) => {
26
- const root = document.documentElement;
27
- root.classList.remove('color-scheme-light', 'color-scheme-dark');
28
- if (pref !== 'auto')
29
- root.classList.add('color-scheme-' + pref);
24
+ const root = document.documentElement;
25
+ root.classList.remove('color-scheme-light', 'color-scheme-dark');
26
+ if (pref !== 'auto') root.classList.add('color-scheme-' + pref);
30
27
  };
31
28
  /** Persist a preference and apply it immediately. */
32
29
  export const setColorSchemePreference = (pref) => {
33
- try {
34
- localStorage.setItem(COLOR_SCHEME_LS_KEY, pref);
35
- }
36
- catch {
37
- // ignore
38
- }
39
- applyColorScheme(pref);
30
+ try {
31
+ localStorage.setItem(COLOR_SCHEME_LS_KEY, pref);
32
+ } catch {
33
+ // ignore
34
+ }
35
+ applyColorScheme(pref);
40
36
  };
41
- //# sourceMappingURL=color-scheme.js.map
37
+ //# sourceMappingURL=color-scheme.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"color-scheme.js","sourceRoot":"","sources":["../../../packages/labs/vite-plugin-lit/src/lib/color-scheme.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAeH,iEAAiE;AACjE,MAAM,CAAC,MAAM,mBAAmB,GAAG,2BAA2B,CAAC;AAE/D,uDAAuD;AACvD,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAA0B,EAAE;IACnE,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,YAAY,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;QACtD,IAAI,GAAG,KAAK,MAAM,IAAI,GAAG,KAAK,MAAM,IAAI,GAAG,KAAK,OAAO;YAAE,OAAO,GAAG,CAAC;IACtE,CAAC;IAAC,MAAM,CAAC;QACP,SAAS;IACX,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,IAA2B,EAAQ,EAAE;IACpE,MAAM,IAAI,GAAG,QAAQ,CAAC,eAAe,CAAC;IACtC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,oBAAoB,EAAE,mBAAmB,CAAC,CAAC;IACjE,IAAI,IAAI,KAAK,MAAM;QAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC;AAClE,CAAC,CAAC;AAEF,qDAAqD;AACrD,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,IAA2B,EAAQ,EAAE;IAC5E,IAAI,CAAC;QACH,YAAY,CAAC,OAAO,CAAC,mBAAmB,EAAE,IAAI,CAAC,CAAC;IAClD,CAAC;IAAC,MAAM,CAAC;QACP,SAAS;IACX,CAAC;IACD,gBAAgB,CAAC,IAAI,CAAC,CAAC;AACzB,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Panel color-scheme preference, persisted in `localStorage`.\n *\n * `auto` is the default and needs no JavaScript: the token values injected by\n * {@link injectTokens} in `tokens.ts` react to `prefers-color-scheme` via\n * `@media`, so the panel follows whatever scheme its host requests — the OS\n * when standalone, or the embedding app's `color-scheme` when docked in the\n * Vite DevTools shell (the iframe inherits it). An explicit `light`/`dark`\n * preference pins the matching `.color-scheme-light` / `.color-scheme-dark`\n * class on the document root, overriding the media query.\n */\nexport type ColorSchemePreference = 'auto' | 'dark' | 'light';\n\n/** localStorage key for the panel UI color-scheme preference. */\nexport const COLOR_SCHEME_LS_KEY = 'lit-devtools-color-scheme';\n\n/** Read the saved preference, defaulting to `auto`. */\nexport const readColorSchemePreference = (): ColorSchemePreference => {\n try {\n const raw = localStorage.getItem(COLOR_SCHEME_LS_KEY);\n if (raw === 'auto' || raw === 'dark' || raw === 'light') return raw;\n } catch {\n // ignore\n }\n return 'auto';\n};\n\n/**\n * Apply a preference to the document root. `light`/`dark` pin the matching\n * class; `auto` removes both and lets the `prefers-color-scheme` `@media` rule\n * in the injected tokens own the scheme (and live-update on OS changes).\n */\nexport const applyColorScheme = (pref: ColorSchemePreference): void => {\n const root = document.documentElement;\n root.classList.remove('color-scheme-light', 'color-scheme-dark');\n if (pref !== 'auto') root.classList.add('color-scheme-' + pref);\n};\n\n/** Persist a preference and apply it immediately. */\nexport const setColorSchemePreference = (pref: ColorSchemePreference): void => {\n try {\n localStorage.setItem(COLOR_SCHEME_LS_KEY, pref);\n } catch {\n // ignore\n }\n applyColorScheme(pref);\n};\n"]}
1
+ {"version":3,"file":"color-scheme.js","sourceRoot":"","sources":["../src/lib/color-scheme.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAeH,iEAAiE;AACjE,MAAM,CAAC,MAAM,mBAAmB,GAAG,2BAA2B,CAAC;AAE/D,uDAAuD;AACvD,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAA0B,EAAE;IACnE,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,YAAY,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;QACtD,IAAI,GAAG,KAAK,MAAM,IAAI,GAAG,KAAK,MAAM,IAAI,GAAG,KAAK,OAAO;YAAE,OAAO,GAAG,CAAC;IACtE,CAAC;IAAC,MAAM,CAAC;QACP,SAAS;IACX,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,IAA2B,EAAQ,EAAE;IACpE,MAAM,IAAI,GAAG,QAAQ,CAAC,eAAe,CAAC;IACtC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,oBAAoB,EAAE,mBAAmB,CAAC,CAAC;IACjE,IAAI,IAAI,KAAK,MAAM;QAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC;AAClE,CAAC,CAAC;AAEF,qDAAqD;AACrD,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,IAA2B,EAAQ,EAAE;IAC5E,IAAI,CAAC;QACH,YAAY,CAAC,OAAO,CAAC,mBAAmB,EAAE,IAAI,CAAC,CAAC;IAClD,CAAC;IAAC,MAAM,CAAC;QACP,SAAS;IACX,CAAC;IACD,gBAAgB,CAAC,IAAI,CAAC,CAAC;AACzB,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Panel color-scheme preference, persisted in `localStorage`.\n *\n * `auto` is the default and needs no JavaScript: the token values injected by\n * {@link injectTokens} in `tokens.ts` react to `prefers-color-scheme` via\n * `@media`, so the panel follows whatever scheme its host requests — the OS\n * when standalone, or the embedding app's `color-scheme` when docked in the\n * Vite DevTools shell (the iframe inherits it). An explicit `light`/`dark`\n * preference pins the matching `.color-scheme-light` / `.color-scheme-dark`\n * class on the document root, overriding the media query.\n */\nexport type ColorSchemePreference = 'auto' | 'dark' | 'light';\n\n/** localStorage key for the panel UI color-scheme preference. */\nexport const COLOR_SCHEME_LS_KEY = 'lit-devtools-color-scheme';\n\n/** Read the saved preference, defaulting to `auto`. */\nexport const readColorSchemePreference = (): ColorSchemePreference => {\n try {\n const raw = localStorage.getItem(COLOR_SCHEME_LS_KEY);\n if (raw === 'auto' || raw === 'dark' || raw === 'light') return raw;\n } catch {\n // ignore\n }\n return 'auto';\n};\n\n/**\n * Apply a preference to the document root. `light`/`dark` pin the matching\n * class; `auto` removes both and lets the `prefers-color-scheme` `@media` rule\n * in the injected tokens own the scheme (and live-update on OS changes).\n */\nexport const applyColorScheme = (pref: ColorSchemePreference): void => {\n const root = document.documentElement;\n root.classList.remove('color-scheme-light', 'color-scheme-dark');\n if (pref !== 'auto') root.classList.add('color-scheme-' + pref);\n};\n\n/** Persist a preference and apply it immediately. */\nexport const setColorSchemePreference = (pref: ColorSchemePreference): void => {\n try {\n localStorage.setItem(COLOR_SCHEME_LS_KEY, pref);\n } catch {\n // ignore\n }\n applyColorScheme(pref);\n};\n"]}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Google LLC
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */
6
+ import type { DevframeDefinition } from 'devframe';
7
+ import type { FeatureSettings } from '../../types/timeline.js';
8
+ import { type TimelineSource } from './source.js';
9
+ import type { SessionSnapshot } from '../../types/snapshot.js';
10
+ export interface CreateLitDevframeOptions {
11
+ /** Page-runtime bridge. Use {@link createNullSource} when no page is attached. */
12
+ source: TimelineSource;
13
+ /** Plugin version, surfaced by `get-meta` and the devframe's own `version`. */
14
+ version: string;
15
+ /** Resolved feature settings, surfaced by `get-meta`. */
16
+ features?: () => FeatureSettings | null;
17
+ /**
18
+ * Directory holding the built panel SPA. Defaults to the package's own
19
+ * `dist/client`; the dev-time panel build points it elsewhere.
20
+ */
21
+ clientAssets?: string;
22
+ /**
23
+ * Absolute directory the injected `ElementSource.file` paths are relative
24
+ * to (the Vite root). Read per call, since a host only knows it once its
25
+ * dev server is up. Without it `open-source` can only open paths that are
26
+ * already absolute.
27
+ */
28
+ sourceRoot?: () => string | undefined;
29
+ /**
30
+ * Boot from a recorded session instead of a live one. Set only by the
31
+ * static-snapshot build (see `lib/snapshot.ts`): the caches below start
32
+ * populated, so the frozen panel has a timeline and a component tree to
33
+ * render with no page and no dev server behind it.
34
+ */
35
+ replay?: SessionSnapshot;
36
+ }
37
+ /**
38
+ * Builds the Lit devframe definition. Framework-neutral: everything here
39
+ * runs the same whether the host is Vite (`vite.ts`), a standalone dev
40
+ * server, a static build, or an MCP server.
41
+ */
42
+ export declare function createLitDevframe(options: CreateLitDevframeOptions): DevframeDefinition;
43
+ declare const _default: DevframeDefinition;
44
+ export default _default;
45
+ //# sourceMappingURL=definition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../src/lib/devframe/definition.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAkBH,OAAO,KAAK,EAAC,kBAAkB,EAAsB,MAAM,UAAU,CAAC;AAWtE,OAAO,KAAK,EACV,eAAe,EAGhB,MAAM,yBAAyB,CAAC;AA2CjC,OAAO,EAAmB,KAAK,cAAc,EAAC,MAAM,aAAa,CAAC;AAClE,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAC;AAE7D,MAAM,WAAW,wBAAwB;IACvC,kFAAkF;IAClF,MAAM,EAAE,cAAc,CAAC;IACvB,+EAA+E;IAC/E,OAAO,EAAE,MAAM,CAAC;IAChB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,MAAM,eAAe,GAAG,IAAI,CAAC;IACxC;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;IACtC;;;;;OAKG;IACH,MAAM,CAAC,EAAE,eAAe,CAAC;CAC1B;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,wBAAwB,GAChC,kBAAkB,CAkhBpB"}