@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
@@ -19,11 +19,11 @@ const PANEL_ID = 'vite-devtools-edge-panel';
19
19
  const GAP = 12;
20
20
  /** Tolerance (px) for treating the panel as touching a viewport edge. */
21
21
  const EDGE = 2;
22
- const ZERO = { top: 0, right: 0, bottom: 0, left: 0 };
22
+ const ZERO = {top: 0, right: 0, bottom: 0, left: 0};
23
23
  const findPanel = () => {
24
- const host = document.querySelector(HOST_TAG);
25
- const root = host?.shadowRoot;
26
- return root?.getElementById(PANEL_ID) ?? null;
24
+ const host = document.querySelector(HOST_TAG);
25
+ const root = host?.shadowRoot;
26
+ return root?.getElementById(PANEL_ID) ?? null;
27
27
  };
28
28
  /**
29
29
  * Inset (px + gap) the docked panel occupies, on the single edge it's docked
@@ -33,34 +33,27 @@ const findPanel = () => {
33
33
  * wrongly flag a full-width bottom panel as also docked left and right.)
34
34
  */
35
35
  const computeInsets = () => {
36
- const panel = findPanel();
37
- if (panel === null)
38
- return ZERO;
39
- const r = panel.getBoundingClientRect();
40
- if (r.width === 0 || r.height === 0)
41
- return ZERO;
42
- // Use the layout viewport (excludes scrollbars) — a fixed `right:0`/`bottom:0`
43
- // panel aligns to clientWidth/Height, not innerWidth/Height, so comparing
44
- // against the latter would miss a full-width panel whenever a scrollbar is
45
- // present.
46
- const vw = document.documentElement.clientWidth;
47
- const vh = document.documentElement.clientHeight;
48
- const spansWidth = r.left <= EDGE && r.right >= vw - EDGE;
49
- const spansHeight = r.top <= EDGE && r.bottom >= vh - EDGE;
50
- const insets = { ...ZERO };
51
- if (spansWidth && !spansHeight) {
52
- if (r.top <= EDGE)
53
- insets.top = r.bottom + GAP;
54
- else if (r.bottom >= vh - EDGE)
55
- insets.bottom = vh - r.top + GAP;
56
- }
57
- else if (spansHeight && !spansWidth) {
58
- if (r.left <= EDGE)
59
- insets.left = r.right + GAP;
60
- else if (r.right >= vw - EDGE)
61
- insets.right = vw - r.left + GAP;
62
- }
63
- return insets;
36
+ const panel = findPanel();
37
+ if (panel === null) return ZERO;
38
+ const r = panel.getBoundingClientRect();
39
+ if (r.width === 0 || r.height === 0) return ZERO;
40
+ // Use the layout viewport (excludes scrollbars) — a fixed `right:0`/`bottom:0`
41
+ // panel aligns to clientWidth/Height, not innerWidth/Height, so comparing
42
+ // against the latter would miss a full-width panel whenever a scrollbar is
43
+ // present.
44
+ const vw = document.documentElement.clientWidth;
45
+ const vh = document.documentElement.clientHeight;
46
+ const spansWidth = r.left <= EDGE && r.right >= vw - EDGE;
47
+ const spansHeight = r.top <= EDGE && r.bottom >= vh - EDGE;
48
+ const insets = {...ZERO};
49
+ if (spansWidth && !spansHeight) {
50
+ if (r.top <= EDGE) insets.top = r.bottom + GAP;
51
+ else if (r.bottom >= vh - EDGE) insets.bottom = vh - r.top + GAP;
52
+ } else if (spansHeight && !spansWidth) {
53
+ if (r.left <= EDGE) insets.left = r.right + GAP;
54
+ else if (r.right >= vw - EDGE) insets.right = vw - r.left + GAP;
55
+ }
56
+ return insets;
64
57
  };
65
58
  /**
66
59
  * Calls `onChange` with the current insets and again whenever they change — the
@@ -68,63 +61,61 @@ const computeInsets = () => {
68
61
  * mounting after us. Returns a disposer.
69
62
  */
70
63
  export const observeEdgeInsets = (onChange) => {
71
- let raf = 0;
72
- let last = '';
73
- let observedPanel = null;
74
- let observingRoot = false;
75
- const emit = () => {
76
- raf = 0;
77
- const insets = computeInsets();
78
- const key = `${insets.top}|${insets.right}|${insets.bottom}|${insets.left}`;
79
- if (key !== last) {
80
- last = key;
81
- onChange(insets);
82
- }
83
- };
84
- const schedule = () => {
85
- if (raf === 0)
86
- raf = requestAnimationFrame(emit);
87
- };
88
- const ro = new ResizeObserver(schedule);
89
- // Re-attach on any devtools DOM change (panel mounting, docking to a new edge)
90
- // then recompute; cheap thanks to the rAF + diff above.
91
- const mo = new MutationObserver(() => attach());
92
- const attach = () => {
93
- const host = document.querySelector(HOST_TAG);
94
- const root = host?.shadowRoot;
95
- if (root && !observingRoot) {
96
- observingRoot = true;
97
- mo.observe(root, {
98
- childList: true,
99
- subtree: true,
100
- attributes: true,
101
- attributeFilter: ['style', 'class'],
102
- });
103
- }
104
- const panel = findPanel();
105
- if (panel !== null && panel !== observedPanel) {
106
- observedPanel = panel;
107
- ro.observe(panel);
108
- }
109
- schedule();
110
- };
111
- // The devtools host mounts asynchronously; poll until it's present, then let
112
- // the observers drive updates.
113
- let tries = 0;
114
- const poll = () => {
115
- attach();
116
- if (!observingRoot && tries++ < 60) {
117
- setTimeout(poll, 250);
118
- }
119
- };
120
- poll();
121
- window.addEventListener('resize', schedule);
122
- return () => {
123
- window.removeEventListener('resize', schedule);
124
- ro.disconnect();
125
- mo.disconnect();
126
- if (raf !== 0)
127
- cancelAnimationFrame(raf);
128
- };
64
+ let raf = 0;
65
+ let last = '';
66
+ let observedPanel = null;
67
+ let observingRoot = false;
68
+ const emit = () => {
69
+ raf = 0;
70
+ const insets = computeInsets();
71
+ const key = `${insets.top}|${insets.right}|${insets.bottom}|${insets.left}`;
72
+ if (key !== last) {
73
+ last = key;
74
+ onChange(insets);
75
+ }
76
+ };
77
+ const schedule = () => {
78
+ if (raf === 0) raf = requestAnimationFrame(emit);
79
+ };
80
+ const ro = new ResizeObserver(schedule);
81
+ // Re-attach on any devtools DOM change (panel mounting, docking to a new edge)
82
+ // then recompute; cheap thanks to the rAF + diff above.
83
+ const mo = new MutationObserver(() => attach());
84
+ const attach = () => {
85
+ const host = document.querySelector(HOST_TAG);
86
+ const root = host?.shadowRoot;
87
+ if (root && !observingRoot) {
88
+ observingRoot = true;
89
+ mo.observe(root, {
90
+ childList: true,
91
+ subtree: true,
92
+ attributes: true,
93
+ attributeFilter: ['style', 'class'],
94
+ });
95
+ }
96
+ const panel = findPanel();
97
+ if (panel !== null && panel !== observedPanel) {
98
+ observedPanel = panel;
99
+ ro.observe(panel);
100
+ }
101
+ schedule();
102
+ };
103
+ // The devtools host mounts asynchronously; poll until it's present, then let
104
+ // the observers drive updates.
105
+ let tries = 0;
106
+ const poll = () => {
107
+ attach();
108
+ if (!observingRoot && tries++ < 60) {
109
+ setTimeout(poll, 250);
110
+ }
111
+ };
112
+ poll();
113
+ window.addEventListener('resize', schedule);
114
+ return () => {
115
+ window.removeEventListener('resize', schedule);
116
+ ro.disconnect();
117
+ mo.disconnect();
118
+ if (raf !== 0) cancelAnimationFrame(raf);
119
+ };
129
120
  };
130
- //# sourceMappingURL=edge-panel.js.map
121
+ //# sourceMappingURL=edge-panel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"edge-panel.js","sourceRoot":"","sources":["../../../../packages/labs/vite-plugin-lit/src/lib/runtime/edge-panel.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;GASG;AAEH,MAAM,QAAQ,GAAG,6BAA6B,CAAC;AAC/C,MAAM,QAAQ,GAAG,0BAA0B,CAAC;AAC5C,0DAA0D;AAC1D,MAAM,GAAG,GAAG,EAAE,CAAC;AACf,yEAAyE;AACzE,MAAM,IAAI,GAAG,CAAC,CAAC;AASf,MAAM,IAAI,GAAe,EAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAC,CAAC;AAEhE,MAAM,SAAS,GAAG,GAAuB,EAAE;IACzC,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAC9C,MAAM,IAAI,GAAI,IAAgD,EAAE,UAAU,CAAC;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,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Keeps our on-page dev UI (HMR indicator, source-overlay tooltip) clear of the\n * Vite DevTools edge panel so they don't sit on top of it.\n *\n * The panel is `#vite-devtools-edge-panel` inside the open shadow root of the\n * `<vite-devtools-dock-embedded>` host, and only exists while the dock is\n * docked to an edge (it can be moved/resized). We report the inset, in px, that\n * the panel occupies on each viewport edge it touches — plus a small gap — so\n * callers can offset themselves.\n */\n\nconst HOST_TAG = 'vite-devtools-dock-embedded';\nconst PANEL_ID = 'vite-devtools-edge-panel';\n/** Gap to leave between our UI and the devtools panel. */\nconst GAP = 12;\n/** Tolerance (px) for treating the panel as touching a viewport edge. */\nconst EDGE = 2;\n\nexport interface EdgeInsets {\n top: number;\n right: number;\n bottom: number;\n left: number;\n}\n\nconst ZERO: EdgeInsets = {top: 0, right: 0, bottom: 0, left: 0};\n\nconst findPanel = (): HTMLElement | null => {\n const host = document.querySelector(HOST_TAG);\n const root = (host as {shadowRoot?: ShadowRoot | null} | null)?.shadowRoot;\n return (root?.getElementById(PANEL_ID) as HTMLElement | null) ?? null;\n};\n\n/**\n * Inset (px + gap) the docked panel occupies, on the single edge it's docked\n * to. The panel docks to one edge and spans the perpendicular axis fully, so we\n * pick the dock edge from which axis it spans — a full-width panel is docked\n * top/bottom, a full-height one left/right. (Inferring the edge per-side would\n * wrongly flag a full-width bottom panel as also docked left and right.)\n */\nconst computeInsets = (): EdgeInsets => {\n const panel = findPanel();\n if (panel === null) return ZERO;\n const r = panel.getBoundingClientRect();\n if (r.width === 0 || r.height === 0) return ZERO;\n // Use the layout viewport (excludes scrollbars) — a fixed `right:0`/`bottom:0`\n // panel aligns to clientWidth/Height, not innerWidth/Height, so comparing\n // against the latter would miss a full-width panel whenever a scrollbar is\n // present.\n const vw = document.documentElement.clientWidth;\n const vh = document.documentElement.clientHeight;\n const spansWidth = r.left <= EDGE && r.right >= vw - EDGE;\n const spansHeight = r.top <= EDGE && r.bottom >= vh - EDGE;\n const insets = {...ZERO};\n if (spansWidth && !spansHeight) {\n if (r.top <= EDGE) insets.top = r.bottom + GAP;\n else if (r.bottom >= vh - EDGE) insets.bottom = vh - r.top + GAP;\n } else if (spansHeight && !spansWidth) {\n if (r.left <= EDGE) insets.left = r.right + GAP;\n else if (r.right >= vw - EDGE) insets.right = vw - r.left + GAP;\n }\n return insets;\n};\n\n/**\n * Calls `onChange` with the current insets and again whenever they change — the\n * panel being docked/resized/moved, the window resizing, or the devtools\n * mounting after us. Returns a disposer.\n */\nexport const observeEdgeInsets = (\n onChange: (insets: EdgeInsets) => void\n): (() => void) => {\n let raf = 0;\n let last = '';\n let observedPanel: Element | null = null;\n let observingRoot = false;\n\n const emit = () => {\n raf = 0;\n const insets = computeInsets();\n const key = `${insets.top}|${insets.right}|${insets.bottom}|${insets.left}`;\n if (key !== last) {\n last = key;\n onChange(insets);\n }\n };\n const schedule = () => {\n if (raf === 0) raf = requestAnimationFrame(emit);\n };\n\n const ro = new ResizeObserver(schedule);\n // Re-attach on any devtools DOM change (panel mounting, docking to a new edge)\n // then recompute; cheap thanks to the rAF + diff above.\n const mo = new MutationObserver(() => attach());\n\n const attach = () => {\n const host = document.querySelector(HOST_TAG);\n const root = (host as {shadowRoot?: ShadowRoot | null} | null)?.shadowRoot;\n if (root && !observingRoot) {\n observingRoot = true;\n mo.observe(root, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['style', 'class'],\n });\n }\n const panel = findPanel();\n if (panel !== null && panel !== observedPanel) {\n observedPanel = panel;\n ro.observe(panel);\n }\n schedule();\n };\n\n // The devtools host mounts asynchronously; poll until it's present, then let\n // the observers drive updates.\n let tries = 0;\n const poll = () => {\n attach();\n if (!observingRoot && tries++ < 60) {\n setTimeout(poll, 250);\n }\n };\n poll();\n\n window.addEventListener('resize', schedule);\n\n return () => {\n window.removeEventListener('resize', schedule);\n ro.disconnect();\n mo.disconnect();\n if (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IACb,CAAC,CAAC;IAEF,6EAA6E;IAC7E,+BAA+B;IAC/B,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,MAAM,IAAI,GAAG,GAAG,EAAE;QAChB,MAAM,EAAE,CAAC;QACT,IAAI,CAAC,aAAa,IAAI,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC;YACnC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QACxB,CAAC;IACH,CAAC,CAAC;IACF,IAAI,EAAE,CAAC;IAEP,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAE5C,OAAO,GAAG,EAAE;QACV,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAC/C,EAAE,CAAC,UAAU,EAAE,CAAC;QAChB,EAAE,CAAC,UAAU,EAAE,CAAC;QAChB,IAAI,GAAG,KAAK,CAAC;YAAE,oBAAoB,CAAC,GAAG,CAAC,CAAC;IAC3C,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Keeps our on-page dev UI (HMR indicator, source-overlay tooltip) clear of the\n * Vite DevTools edge panel so they don't sit on top of it.\n *\n * The panel is `#vite-devtools-edge-panel` inside the open shadow root of the\n * `<vite-devtools-dock-embedded>` host, and only exists while the dock is\n * docked to an edge (it can be moved/resized). We report the inset, in px, that\n * the panel occupies on each viewport edge it touches — plus a small gap — so\n * callers can offset themselves.\n */\n\nconst HOST_TAG = 'vite-devtools-dock-embedded';\nconst PANEL_ID = 'vite-devtools-edge-panel';\n/** Gap to leave between our UI and the devtools panel. */\nconst GAP = 12;\n/** Tolerance (px) for treating the panel as touching a viewport edge. */\nconst EDGE = 2;\n\nexport interface EdgeInsets {\n top: number;\n right: number;\n bottom: number;\n left: number;\n}\n\nconst ZERO: EdgeInsets = {top: 0, right: 0, bottom: 0, left: 0};\n\nconst findPanel = (): HTMLElement | null => {\n const host = document.querySelector(HOST_TAG);\n const root = (host as {shadowRoot?: ShadowRoot | null} | null)?.shadowRoot;\n return (root?.getElementById(PANEL_ID) as HTMLElement | null) ?? null;\n};\n\n/**\n * Inset (px + gap) the docked panel occupies, on the single edge it's docked\n * to. The panel docks to one edge and spans the perpendicular axis fully, so we\n * pick the dock edge from which axis it spans — a full-width panel is docked\n * top/bottom, a full-height one left/right. (Inferring the edge per-side would\n * wrongly flag a full-width bottom panel as also docked left and right.)\n */\nconst computeInsets = (): EdgeInsets => {\n const panel = findPanel();\n if (panel === null) return ZERO;\n const r = panel.getBoundingClientRect();\n if (r.width === 0 || r.height === 0) return ZERO;\n // Use the layout viewport (excludes scrollbars) — a fixed `right:0`/`bottom:0`\n // panel aligns to clientWidth/Height, not innerWidth/Height, so comparing\n // against the latter would miss a full-width panel whenever a scrollbar is\n // present.\n const vw = document.documentElement.clientWidth;\n const vh = document.documentElement.clientHeight;\n const spansWidth = r.left <= EDGE && r.right >= vw - EDGE;\n const spansHeight = r.top <= EDGE && r.bottom >= vh - EDGE;\n const insets = {...ZERO};\n if (spansWidth && !spansHeight) {\n if (r.top <= EDGE) insets.top = r.bottom + GAP;\n else if (r.bottom >= vh - EDGE) insets.bottom = vh - r.top + GAP;\n } else if (spansHeight && !spansWidth) {\n if (r.left <= EDGE) insets.left = r.right + GAP;\n else if (r.right >= vw - EDGE) insets.right = vw - r.left + GAP;\n }\n return insets;\n};\n\n/**\n * Calls `onChange` with the current insets and again whenever they change — the\n * panel being docked/resized/moved, the window resizing, or the devtools\n * mounting after us. Returns a disposer.\n */\nexport const observeEdgeInsets = (\n onChange: (insets: EdgeInsets) => void\n): (() => void) => {\n let raf = 0;\n let last = '';\n let observedPanel: Element | null = null;\n let observingRoot = false;\n\n const emit = () => {\n raf = 0;\n const insets = computeInsets();\n const key = `${insets.top}|${insets.right}|${insets.bottom}|${insets.left}`;\n if (key !== last) {\n last = key;\n onChange(insets);\n }\n };\n const schedule = () => {\n if (raf === 0) raf = requestAnimationFrame(emit);\n };\n\n const ro = new ResizeObserver(schedule);\n // Re-attach on any devtools DOM change (panel mounting, docking to a new edge)\n // then recompute; cheap thanks to the rAF + diff above.\n const mo = new MutationObserver(() => attach());\n\n const attach = () => {\n const host = document.querySelector(HOST_TAG);\n const root = (host as {shadowRoot?: ShadowRoot | null} | null)?.shadowRoot;\n if (root && !observingRoot) {\n observingRoot = true;\n mo.observe(root, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['style', 'class'],\n });\n }\n const panel = findPanel();\n if (panel !== null && panel !== observedPanel) {\n observedPanel = panel;\n ro.observe(panel);\n }\n schedule();\n };\n\n // The devtools host mounts asynchronously; poll until it's present, then let\n // the observers drive updates.\n let tries = 0;\n const poll = () => {\n attach();\n if (!observingRoot && tries++ < 60) {\n setTimeout(poll, 250);\n }\n };\n poll();\n\n window.addEventListener('resize', schedule);\n\n return () => {\n window.removeEventListener('resize', schedule);\n ro.disconnect();\n mo.disconnect();\n if (raf !== 0) cancelAnimationFrame(raf);\n };\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"fonts.d.ts","sourceRoot":"","sources":["../../../../packages/labs/vite-plugin-lit/src/lib/runtime/fonts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,qGAAqG,CAAC;AAEzI,kFAAkF;AAClF,eAAO,MAAM,aAAa,oIAA6D,CAAC"}
1
+ {"version":3,"file":"fonts.d.ts","sourceRoot":"","sources":["../../src/lib/runtime/fonts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,qGAAqG,CAAC;AAEzI,kFAAkF;AAClF,eAAO,MAAM,aAAa,oIAA6D,CAAC"}
@@ -15,4 +15,4 @@
15
15
  export const LIT_DEVTOOLS_FONT_MONO = `ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace`;
16
16
  /** `var()` reference to the devtools mono font with the default stack inlined. */
17
17
  export const FONT_MONO_VAR = `var(--lit-devtools-font-mono, ${LIT_DEVTOOLS_FONT_MONO})`;
18
- //# sourceMappingURL=fonts.js.map
18
+ //# sourceMappingURL=fonts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fonts.js","sourceRoot":"","sources":["../../../../packages/labs/vite-plugin-lit/src/lib/runtime/fonts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,kGAAkG,CAAC;AAEzI,kFAAkF;AAClF,MAAM,CAAC,MAAM,aAAa,GAAG,iCAAiC,sBAAsB,GAAG,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Default monospace font stack for the devtools UI (HMR indicator, source\n * overlay). Surfaced through the `--lit-devtools-font-mono` custom property so\n * consumers can override it; this constant is the fallback default, mirroring\n * the `--lit-devtools-radius` convention.\n *\n * The devtools only render code-adjacent text, so monospace is the only stack\n * they need.\n */\nexport const LIT_DEVTOOLS_FONT_MONO = `ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace`;\n\n/** `var()` reference to the devtools mono font with the default stack inlined. */\nexport const FONT_MONO_VAR = `var(--lit-devtools-font-mono, ${LIT_DEVTOOLS_FONT_MONO})`;\n"]}
1
+ {"version":3,"file":"fonts.js","sourceRoot":"","sources":["../../src/lib/runtime/fonts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,kGAAkG,CAAC;AAEzI,kFAAkF;AAClF,MAAM,CAAC,MAAM,aAAa,GAAG,iCAAiC,sBAAsB,GAAG,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Default monospace font stack for the devtools UI (HMR indicator, source\n * overlay). Surfaced through the `--lit-devtools-font-mono` custom property so\n * consumers can override it; this constant is the fallback default, mirroring\n * the `--lit-devtools-radius` convention.\n *\n * The devtools only render code-adjacent text, so monospace is the only stack\n * they need.\n */\nexport const LIT_DEVTOOLS_FONT_MONO = `ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace`;\n\n/** `var()` reference to the devtools mono font with the default stack inlined. */\nexport const FONT_MONO_VAR = `var(--lit-devtools-font-mono, ${LIT_DEVTOOLS_FONT_MONO})`;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"indicator.d.ts","sourceRoot":"","sources":["../../../../packages/labs/vite-plugin-lit/src/lib/runtime/indicator.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
1
+ {"version":3,"file":"indicator.d.ts","sourceRoot":"","sources":["../../src/lib/runtime/indicator.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
@@ -8,11 +8,11 @@
8
8
  * Injected by the Vite plugin as an external module so that
9
9
  * `import.meta.hot` is available.
10
10
  */
11
- import { FONT_MONO_VAR } from './fonts.js';
12
- import { FLAME_ICON } from '../icons.js';
13
- import { subscribeOverride } from './overrides.js';
14
- import { observeEdgeInsets } from './edge-panel.js';
15
- import { injectTokens } from '../tokens.js';
11
+ import {FONT_MONO_VAR} from './fonts.js';
12
+ import {FLAME_ICON} from '../icons.js';
13
+ import {subscribeOverride} from './overrides.js';
14
+ import {observeEdgeInsets} from './edge-panel.js';
15
+ import {injectTokens} from '../tokens.js';
16
16
  /**
17
17
  * True when an HMR batch is purely a stylesheet swap — every update is either
18
18
  * a `css-update` or a `js-update` whose accepted module is a `.css` source
@@ -26,31 +26,29 @@ import { injectTokens } from '../tokens.js';
26
26
  * rather than being silently dropped.
27
27
  */
28
28
  function isStyleSwap(data) {
29
- const updates = data?.updates;
30
- if (!Array.isArray(updates) || updates.length === 0)
31
- return false;
32
- return updates.every((u) => {
33
- if (u.type === 'css-update')
34
- return true;
35
- if (u.type === 'js-update') {
36
- return (u.acceptedPath ?? u.path ?? '').split('?')[0].endsWith('.css');
37
- }
38
- return false;
39
- });
29
+ const updates = data?.updates;
30
+ if (!Array.isArray(updates) || updates.length === 0) return false;
31
+ return updates.every((u) => {
32
+ if (u.type === 'css-update') return true;
33
+ if (u.type === 'js-update') {
34
+ return (u.acceptedPath ?? u.path ?? '').split('?')[0].endsWith('.css');
35
+ }
36
+ return false;
37
+ });
40
38
  }
41
39
  class LitDevtoolsIndicator extends HTMLElement {
42
- #initialized = false;
43
- #count = 0;
44
- #container;
45
- #countEl = null;
46
- constructor() {
47
- super();
48
- const root = this.attachShadow({ mode: 'closed' });
49
- // `--idle-op` is the at-rest opacity: 0 (invisible until a pulse) without a
50
- // count, .5 (count stays legible) with one. The count display and idle
51
- // opacity are both driven by the `.with-count` class so the panel can
52
- // toggle the count on/off live (see #setCount).
53
- root.innerHTML = `
40
+ #initialized = false;
41
+ #count = 0;
42
+ #container;
43
+ #countEl = null;
44
+ constructor() {
45
+ super();
46
+ const root = this.attachShadow({mode: 'closed'});
47
+ // `--idle-op` is the at-rest opacity: 0 (invisible until a pulse) without a
48
+ // count, .5 (count stays legible) with one. The count display and idle
49
+ // opacity are both driven by the `.with-count` class so the panel can
50
+ // toggle the count on/off live (see #setCount).
51
+ root.innerHTML = `
54
52
  <style>
55
53
  @keyframes pulse{0%{opacity:var(--idle-op,0)}15%{opacity:1}80%{opacity:1}100%{opacity:var(--idle-op,0)}}
56
54
  :host{
@@ -91,51 +89,50 @@ class LitDevtoolsIndicator extends HTMLElement {
91
89
  </style>
92
90
  <div id="container"><span id="icon">${FLAME_ICON}</span><span id="indicator"><span class="dot"></span><span class="count">0</span></span></div>
93
91
  `;
94
- this.#container = root.getElementById('container');
95
- this.#countEl = root.querySelector('.count');
96
- this.#setCount(this.hasAttribute('count'));
97
- }
98
- /** Show/hide the cumulative update count (and the at-rest opacity). */
99
- #setCount(enabled) {
100
- this.#container.classList.toggle('with-count', enabled);
101
- }
102
- connectedCallback() {
103
- if (this.#initialized)
104
- return;
105
- this.#initialized = true;
106
- injectTokens();
107
- const hot = import.meta.hot;
108
- hot?.on('vite:afterUpdate', (data) => {
109
- // Count only updates that actually re-render/re-execute a component;
110
- // a pure shared-stylesheet swap (?css-sheet / ?raw / ?url adopted sheet)
111
- // restyles in place without re-rendering, so it pulses but doesn't count.
112
- const styleSwap = isStyleSwap(data);
113
- if (!styleSwap && this.#countEl !== null) {
114
- this.#countEl.textContent = String(++this.#count);
115
- }
116
- this.#container.classList.toggle('style-swap', styleSwap);
117
- this.#container.classList.remove('active');
118
- void this.#container.offsetWidth;
119
- this.#container.classList.add('active');
120
- });
121
- // Let the DevTools panel hide/show the indicator and its count live (and
122
- // across reloads).
123
- subscribeOverride(hot, (o) => {
124
- if (o.hmrIndicatorVisible !== undefined) {
125
- this.style.display = o.hmrIndicatorVisible ? '' : 'none';
126
- }
127
- if (o.hmrIndicatorCount !== undefined) {
128
- this.#setCount(o.hmrIndicatorCount);
129
- }
130
- });
131
- // Stay clear of the Vite DevTools edge panel.
132
- observeEdgeInsets((insets) => {
133
- this.style.setProperty('--edge-top', `${insets.top}px`);
134
- this.style.setProperty('--edge-right', `${insets.right}px`);
135
- this.style.setProperty('--edge-bottom', `${insets.bottom}px`);
136
- this.style.setProperty('--edge-left', `${insets.left}px`);
137
- });
138
- }
92
+ this.#container = root.getElementById('container');
93
+ this.#countEl = root.querySelector('.count');
94
+ this.#setCount(this.hasAttribute('count'));
95
+ }
96
+ /** Show/hide the cumulative update count (and the at-rest opacity). */
97
+ #setCount(enabled) {
98
+ this.#container.classList.toggle('with-count', enabled);
99
+ }
100
+ connectedCallback() {
101
+ if (this.#initialized) return;
102
+ this.#initialized = true;
103
+ injectTokens();
104
+ const hot = import.meta.hot;
105
+ hot?.on('vite:afterUpdate', (data) => {
106
+ // Count only updates that actually re-render/re-execute a component;
107
+ // a pure shared-stylesheet swap (?css-sheet / ?raw / ?url adopted sheet)
108
+ // restyles in place without re-rendering, so it pulses but doesn't count.
109
+ const styleSwap = isStyleSwap(data);
110
+ if (!styleSwap && this.#countEl !== null) {
111
+ this.#countEl.textContent = String(++this.#count);
112
+ }
113
+ this.#container.classList.toggle('style-swap', styleSwap);
114
+ this.#container.classList.remove('active');
115
+ void this.#container.offsetWidth;
116
+ this.#container.classList.add('active');
117
+ });
118
+ // Let the DevTools panel hide/show the indicator and its count live (and
119
+ // across reloads).
120
+ subscribeOverride(hot, (o) => {
121
+ if (o.hmrIndicatorVisible !== undefined) {
122
+ this.style.display = o.hmrIndicatorVisible ? '' : 'none';
123
+ }
124
+ if (o.hmrIndicatorCount !== undefined) {
125
+ this.#setCount(o.hmrIndicatorCount);
126
+ }
127
+ });
128
+ // Stay clear of the Vite DevTools edge panel.
129
+ observeEdgeInsets((insets) => {
130
+ this.style.setProperty('--edge-top', `${insets.top}px`);
131
+ this.style.setProperty('--edge-right', `${insets.right}px`);
132
+ this.style.setProperty('--edge-bottom', `${insets.bottom}px`);
133
+ this.style.setProperty('--edge-left', `${insets.left}px`);
134
+ });
135
+ }
139
136
  }
140
137
  customElements.define('lit-devtools-hmr-indicator', LitDevtoolsIndicator);
141
- //# sourceMappingURL=indicator.js.map
138
+ //# sourceMappingURL=indicator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"indicator.js","sourceRoot":"","sources":["../../../../packages/labs/vite-plugin-lit/src/lib/runtime/indicator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AAEH,OAAO,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AACzC,OAAO,EAAC,UAAU,EAAC,MAAM,aAAa,CAAC;AACvC,OAAO,EAAC,iBAAiB,EAAC,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAC,iBAAiB,EAAC,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAC,YAAY,EAAC,MAAM,cAAc,CAAC;AAS1C;;;;;;;;;;;GAWG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C,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;YAC3D,CAAC;YACD,IAAI,CAAC,CAAC,iBAAiB,KAAK,SAAS,EAAE,CAAC;gBACtC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC;YACtC,CAAC;QACH,CAAC,CAAC,CAAC;QACH,8CAA8C;QAC9C,iBAAiB,CAAC,CAAC,MAAM,EAAE,EAAE;YAC3B,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,YAAY,EAAE,GAAG,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC;YACxD,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,cAAc,EAAE,GAAG,MAAM,CAAC,KAAK,IAAI,CAAC,CAAC;YAC5D,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,eAAe,EAAE,GAAG,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC;YAC9D,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,aAAa,EAAE,GAAG,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC;QAC5D,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAED,cAAc,CAAC,MAAM,CAAC,4BAA4B,EAAE,oBAAoB,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Custom element for the HMR update indicator.\n * Injected by the Vite plugin as an external module so that\n * `import.meta.hot` is available.\n */\n\nimport {FONT_MONO_VAR} from './fonts.js';\nimport {FLAME_ICON} from '../icons.js';\nimport {subscribeOverride} from './overrides.js';\nimport {observeEdgeInsets} from './edge-panel.js';\nimport {injectTokens} from '../tokens.js';\n\n/** One entry of a Vite `vite:afterUpdate` payload. */\ninterface ViteUpdate {\n type?: string;\n path?: string;\n acceptedPath?: string;\n}\n\n/**\n * True when an HMR batch is purely a stylesheet swap — every update is either\n * a `css-update` or a `js-update` whose accepted module is a `.css` source\n * (the shared-sheet queries `?css-sheet`/`?raw`/`?url` all accept a `.css`\n * path). Such a batch restyles adopted sheets in place with no re-render.\n *\n * Heuristic: keyed on the accepted path ending in `.css`. Robust for this\n * plugin's own queries; a user hand-wiring `import.meta.hot.accept` on a raw\n * `.css` would also read as a style swap, which is the intended grouping. An\n * empty/missing payload can't be classified, so it counts as a re-render\n * rather than being silently dropped.\n */\nfunction isStyleSwap(data: unknown): boolean {\n const updates = (data as {updates?: ViteUpdate[]} | undefined)?.updates;\n if (!Array.isArray(updates) || updates.length === 0) return false;\n return updates.every((u) => {\n if (u.type === 'css-update') return true;\n if (u.type === 'js-update') {\n return (u.acceptedPath ?? u.path ?? '').split('?')[0].endsWith('.css');\n }\n return false;\n });\n}\n\nclass LitDevtoolsIndicator extends HTMLElement {\n #initialized = false;\n #count = 0;\n #container: HTMLElement;\n #countEl: HTMLElement | null = null;\n\n constructor() {\n super();\n const root = this.attachShadow({mode: 'closed'});\n // `--idle-op` is the at-rest opacity: 0 (invisible until a pulse) without a\n // count, .5 (count stays legible) with one. The count display and idle\n // opacity are both driven by the `.with-count` class so the panel can\n // toggle the count on/off live (see #setCount).\n root.innerHTML = `\n <style>\n @keyframes pulse{0%{opacity:var(--idle-op,0)}15%{opacity:1}80%{opacity:1}100%{opacity:var(--idle-op,0)}}\n :host{\n position:fixed;inset:0;display:grid;\n z-index:2147483647;pointer-events:none;\n /* Base padding plus the inset the Vite DevTools edge panel occupies\n on each edge (set from JS), so the indicator never sits on it. */\n padding:\n calc(var(--lit-devtools-hmr-indicator-padding,16px) + var(--edge-top,0px))\n calc(var(--lit-devtools-hmr-indicator-padding,16px) + var(--edge-right,0px))\n calc(var(--lit-devtools-hmr-indicator-padding,16px) + var(--edge-bottom,0px))\n calc(var(--lit-devtools-hmr-indicator-padding,16px) + var(--edge-left,0px))\n }\n #container{\n place-self:var(--lit-devtools-hmr-indicator-align,end end);\n display:flex;align-items:stretch;\n background:var(--lit-devtools-surface-elevated);color:var(--lit-devtools-text-strong);\n backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);\n border-radius:var(--lit-devtools-radius-md);\n font:12px/1 ${FONT_MONO_VAR};font-variant-numeric:tabular-nums;\n overflow:hidden;opacity:var(--idle-op,0)\n }\n #container.with-count{--idle-op:.5}\n #container.active{animation:pulse 2.5s ease-out forwards}\n #icon{display:flex;align-items:center;justify-content:center;padding:0 10px}\n #icon svg{width:16px;height:16px;display:block;fill:currentColor}\n #indicator{\n display:flex;align-items:center;gap:6px;\n padding:7px 12px;\n border-left:1px solid var(--lit-devtools-border-subtle)\n }\n .dot{width:8px;height:8px;border-radius:50%;background:var(--lit-devtools-success);flex-shrink:0}\n /* Style-only swaps (shared adopted stylesheet hot-swap, no re-render)\n pulse in the calmer info color and don't bump the count. */\n #container.style-swap .dot{background:var(--lit-devtools-info)}\n .count{display:none}\n #container.with-count .count{display:inline}\n </style>\n <div id=\"container\"><span id=\"icon\">${FLAME_ICON}</span><span id=\"indicator\"><span class=\"dot\"></span><span class=\"count\">0</span></span></div>\n `;\n this.#container = root.getElementById('container')!;\n this.#countEl = root.querySelector('.count');\n this.#setCount(this.hasAttribute('count'));\n }\n\n /** Show/hide the cumulative update count (and the at-rest opacity). */\n #setCount(enabled: boolean) {\n this.#container.classList.toggle('with-count', enabled);\n }\n\n connectedCallback() {\n if (this.#initialized) return;\n this.#initialized = true;\n injectTokens();\n const hot = (\n import.meta as {\n hot?: {on: (event: string, cb: (data?: unknown) => void) => void};\n }\n ).hot;\n hot?.on('vite:afterUpdate', (data) => {\n // Count only updates that actually re-render/re-execute a component;\n // a pure shared-stylesheet swap (?css-sheet / ?raw / ?url adopted sheet)\n // restyles in place without re-rendering, so it pulses but doesn't count.\n const styleSwap = isStyleSwap(data);\n if (!styleSwap && this.#countEl !== null) {\n this.#countEl.textContent = String(++this.#count);\n }\n this.#container.classList.toggle('style-swap', styleSwap);\n this.#container.classList.remove('active');\n void this.#container.offsetWidth;\n this.#container.classList.add('active');\n });\n // Let the DevTools panel hide/show the indicator and its count live (and\n // across reloads).\n subscribeOverride(hot, (o) => {\n if (o.hmrIndicatorVisible !== undefined) {\n this.style.display = o.hmrIndicatorVisible ? '' : 'none';\n }\n if (o.hmrIndicatorCount !== undefined) {\n this.#setCount(o.hmrIndicatorCount);\n }\n });\n // Stay clear of the Vite DevTools edge panel.\n observeEdgeInsets((insets) => {\n this.style.setProperty('--edge-top', `${insets.top}px`);\n this.style.setProperty('--edge-right', `${insets.right}px`);\n this.style.setProperty('--edge-bottom', `${insets.bottom}px`);\n this.style.setProperty('--edge-left', `${insets.left}px`);\n });\n }\n}\n\ncustomElements.define('lit-devtools-hmr-indicator', LitDevtoolsIndicator);\n"]}
1
+ {"version":3,"file":"indicator.js","sourceRoot":"","sources":["../../src/lib/runtime/indicator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AAEH,OAAO,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AACzC,OAAO,EAAC,UAAU,EAAC,MAAM,aAAa,CAAC;AACvC,OAAO,EAAC,iBAAiB,EAAC,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAC,iBAAiB,EAAC,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAC,YAAY,EAAC,MAAM,cAAc,CAAC;AAS1C;;;;;;;;;;;GAWG;AACH,SAAS,WAAW,CAAC,IAAa;IAChC,MAAM,OAAO,GAAI,IAA6C,EAAE,OAAO,CAAC;IACxE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAClE,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;QACzB,IAAI,CAAC,CAAC,IAAI,KAAK,YAAY;YAAE,OAAO,IAAI,CAAC;QACzC,IAAI,CAAC,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;YAC3B,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,CAAC,CAAC,IAAI,IAAI,EA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I,CAAC,CAAC;YAC5D,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,eAAe,EAAE,GAAG,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC;YAC9D,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,aAAa,EAAE,GAAG,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC;QAC5D,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAED,cAAc,CAAC,MAAM,CAAC,4BAA4B,EAAE,oBAAoB,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Custom element for the HMR update indicator.\n * Injected by the Vite plugin as an external module so that\n * `import.meta.hot` is available.\n */\n\nimport {FONT_MONO_VAR} from './fonts.js';\nimport {FLAME_ICON} from '../icons.js';\nimport {subscribeOverride} from './overrides.js';\nimport {observeEdgeInsets} from './edge-panel.js';\nimport {injectTokens} from '../tokens.js';\n\n/** One entry of a Vite `vite:afterUpdate` payload. */\ninterface ViteUpdate {\n type?: string;\n path?: string;\n acceptedPath?: string;\n}\n\n/**\n * True when an HMR batch is purely a stylesheet swap — every update is either\n * a `css-update` or a `js-update` whose accepted module is a `.css` source\n * (the shared-sheet queries `?css-sheet`/`?raw`/`?url` all accept a `.css`\n * path). Such a batch restyles adopted sheets in place with no re-render.\n *\n * Heuristic: keyed on the accepted path ending in `.css`. Robust for this\n * plugin's own queries; a user hand-wiring `import.meta.hot.accept` on a raw\n * `.css` would also read as a style swap, which is the intended grouping. An\n * empty/missing payload can't be classified, so it counts as a re-render\n * rather than being silently dropped.\n */\nfunction isStyleSwap(data: unknown): boolean {\n const updates = (data as {updates?: ViteUpdate[]} | undefined)?.updates;\n if (!Array.isArray(updates) || updates.length === 0) return false;\n return updates.every((u) => {\n if (u.type === 'css-update') return true;\n if (u.type === 'js-update') {\n return (u.acceptedPath ?? u.path ?? '').split('?')[0].endsWith('.css');\n }\n return false;\n });\n}\n\nclass LitDevtoolsIndicator extends HTMLElement {\n #initialized = false;\n #count = 0;\n #container: HTMLElement;\n #countEl: HTMLElement | null = null;\n\n constructor() {\n super();\n const root = this.attachShadow({mode: 'closed'});\n // `--idle-op` is the at-rest opacity: 0 (invisible until a pulse) without a\n // count, .5 (count stays legible) with one. The count display and idle\n // opacity are both driven by the `.with-count` class so the panel can\n // toggle the count on/off live (see #setCount).\n root.innerHTML = `\n <style>\n @keyframes pulse{0%{opacity:var(--idle-op,0)}15%{opacity:1}80%{opacity:1}100%{opacity:var(--idle-op,0)}}\n :host{\n position:fixed;inset:0;display:grid;\n z-index:2147483647;pointer-events:none;\n /* Base padding plus the inset the Vite DevTools edge panel occupies\n on each edge (set from JS), so the indicator never sits on it. */\n padding:\n calc(var(--lit-devtools-hmr-indicator-padding,16px) + var(--edge-top,0px))\n calc(var(--lit-devtools-hmr-indicator-padding,16px) + var(--edge-right,0px))\n calc(var(--lit-devtools-hmr-indicator-padding,16px) + var(--edge-bottom,0px))\n calc(var(--lit-devtools-hmr-indicator-padding,16px) + var(--edge-left,0px))\n }\n #container{\n place-self:var(--lit-devtools-hmr-indicator-align,end end);\n display:flex;align-items:stretch;\n background:var(--lit-devtools-surface-elevated);color:var(--lit-devtools-text-strong);\n backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);\n border-radius:var(--lit-devtools-radius-md);\n font:12px/1 ${FONT_MONO_VAR};font-variant-numeric:tabular-nums;\n overflow:hidden;opacity:var(--idle-op,0)\n }\n #container.with-count{--idle-op:.5}\n #container.active{animation:pulse 2.5s ease-out forwards}\n #icon{display:flex;align-items:center;justify-content:center;padding:0 10px}\n #icon svg{width:16px;height:16px;display:block;fill:currentColor}\n #indicator{\n display:flex;align-items:center;gap:6px;\n padding:7px 12px;\n border-left:1px solid var(--lit-devtools-border-subtle)\n }\n .dot{width:8px;height:8px;border-radius:50%;background:var(--lit-devtools-success);flex-shrink:0}\n /* Style-only swaps (shared adopted stylesheet hot-swap, no re-render)\n pulse in the calmer info color and don't bump the count. */\n #container.style-swap .dot{background:var(--lit-devtools-info)}\n .count{display:none}\n #container.with-count .count{display:inline}\n </style>\n <div id=\"container\"><span id=\"icon\">${FLAME_ICON}</span><span id=\"indicator\"><span class=\"dot\"></span><span class=\"count\">0</span></span></div>\n `;\n this.#container = root.getElementById('container')!;\n this.#countEl = root.querySelector('.count');\n this.#setCount(this.hasAttribute('count'));\n }\n\n /** Show/hide the cumulative update count (and the at-rest opacity). */\n #setCount(enabled: boolean) {\n this.#container.classList.toggle('with-count', enabled);\n }\n\n connectedCallback() {\n if (this.#initialized) return;\n this.#initialized = true;\n injectTokens();\n const hot = (\n import.meta as {\n hot?: {on: (event: string, cb: (data?: unknown) => void) => void};\n }\n ).hot;\n hot?.on('vite:afterUpdate', (data) => {\n // Count only updates that actually re-render/re-execute a component;\n // a pure shared-stylesheet swap (?css-sheet / ?raw / ?url adopted sheet)\n // restyles in place without re-rendering, so it pulses but doesn't count.\n const styleSwap = isStyleSwap(data);\n if (!styleSwap && this.#countEl !== null) {\n this.#countEl.textContent = String(++this.#count);\n }\n this.#container.classList.toggle('style-swap', styleSwap);\n this.#container.classList.remove('active');\n void this.#container.offsetWidth;\n this.#container.classList.add('active');\n });\n // Let the DevTools panel hide/show the indicator and its count live (and\n // across reloads).\n subscribeOverride(hot, (o) => {\n if (o.hmrIndicatorVisible !== undefined) {\n this.style.display = o.hmrIndicatorVisible ? '' : 'none';\n }\n if (o.hmrIndicatorCount !== undefined) {\n this.#setCount(o.hmrIndicatorCount);\n }\n });\n // Stay clear of the Vite DevTools edge panel.\n observeEdgeInsets((insets) => {\n this.style.setProperty('--edge-top', `${insets.top}px`);\n this.style.setProperty('--edge-right', `${insets.right}px`);\n this.style.setProperty('--edge-bottom', `${insets.bottom}px`);\n this.style.setProperty('--edge-left', `${insets.left}px`);\n });\n }\n}\n\ncustomElements.define('lit-devtools-hmr-indicator', LitDevtoolsIndicator);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"collect.d.ts","sourceRoot":"","sources":["../../../../../packages/labs/vite-plugin-lit/src/lib/runtime/inspector/collect.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAUH,OAAO,KAAK,EAEV,gBAAgB,EAEhB,iBAAiB,EAClB,MAAM,6BAA6B,CAAC;AAsCrC;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,IAAI,OAAO,KAAG,OAO3C,CAAC;AA2CF,wEAAwE;AACxE,eAAO,MAAM,SAAS,QAAO,iBAAiB,EAI7C,CAAC;AAWF,yEAAyE;AACzE,eAAO,MAAM,cAAc,GAAI,IAAI,OAAO,KAAG,gBA6C5C,CAAC"}
1
+ {"version":3,"file":"collect.d.ts","sourceRoot":"","sources":["../../../src/lib/runtime/inspector/collect.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAUH,OAAO,KAAK,EAEV,gBAAgB,EAEhB,iBAAiB,EAClB,MAAM,6BAA6B,CAAC;AAsCrC;;;;GAIG;AACH,eAAO,MAAM,aAAa,OAAQ,OAAO,KAAG,OAO3C,CAAC;AA2CF,wEAAwE;AACxE,eAAO,MAAM,SAAS,QAAO,iBAAiB,EAI7C,CAAC;AAWF,yEAAyE;AACzE,eAAO,MAAM,cAAc,OAAQ,OAAO,KAAG,gBA6C5C,CAAC"}