@oddsquad/vite-plugin-lit 0.0.3 → 0.1.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.
- package/index.d.ts +3 -2
- package/index.d.ts.map +1 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/lib/color-scheme.d.ts +30 -0
- package/lib/color-scheme.d.ts.map +1 -0
- package/lib/color-scheme.js +41 -0
- package/lib/color-scheme.js.map +1 -0
- package/lib/icons.d.ts +18 -0
- package/lib/icons.d.ts.map +1 -0
- package/lib/icons.js +23 -0
- package/lib/icons.js.map +1 -0
- package/lib/plugin.d.ts +117 -6
- package/lib/plugin.d.ts.map +1 -1
- package/lib/plugin.js +596 -20
- package/lib/plugin.js.map +1 -1
- package/lib/runtime/css.d.ts +94 -0
- package/lib/runtime/css.d.ts.map +1 -0
- package/lib/runtime/css.js +112 -0
- package/lib/runtime/css.js.map +1 -0
- package/lib/runtime/edge-panel.d.ts +18 -0
- package/lib/runtime/edge-panel.d.ts.map +1 -0
- package/lib/runtime/edge-panel.js +130 -0
- package/lib/runtime/edge-panel.js.map +1 -0
- package/lib/runtime/fonts.d.ts +18 -0
- package/lib/runtime/fonts.d.ts.map +1 -0
- package/lib/runtime/fonts.js +18 -0
- package/lib/runtime/fonts.js.map +1 -0
- package/lib/runtime/indicator.d.ts +7 -0
- package/lib/runtime/indicator.d.ts.map +1 -0
- package/lib/runtime/indicator.js +141 -0
- package/lib/runtime/indicator.js.map +1 -0
- package/lib/runtime/inspector/collect.d.ts +17 -0
- package/lib/runtime/inspector/collect.d.ts.map +1 -0
- package/lib/runtime/inspector/collect.js +132 -0
- package/lib/runtime/inspector/collect.js.map +1 -0
- package/lib/runtime/inspector/install.d.ts +7 -0
- package/lib/runtime/inspector/install.d.ts.map +1 -0
- package/lib/runtime/inspector/install.js +204 -0
- package/lib/runtime/inspector/install.js.map +1 -0
- package/lib/runtime/inspector/serialize.d.ts +10 -0
- package/lib/runtime/inspector/serialize.d.ts.map +1 -0
- package/lib/runtime/inspector/serialize.js +133 -0
- package/lib/runtime/inspector/serialize.js.map +1 -0
- package/lib/runtime/intern.d.ts.map +1 -1
- package/lib/runtime/intern.js +1 -1
- package/lib/runtime/intern.js.map +1 -1
- package/lib/runtime/overrides.d.ts +25 -0
- package/lib/runtime/overrides.d.ts.map +1 -0
- package/lib/runtime/overrides.js +33 -0
- package/lib/runtime/overrides.js.map +1 -0
- package/lib/runtime/patch.d.ts +6 -15
- package/lib/runtime/patch.d.ts.map +1 -1
- package/lib/runtime/patch.js +81 -28
- package/lib/runtime/patch.js.map +1 -1
- package/lib/runtime/source-meta.d.ts +16 -0
- package/lib/runtime/source-meta.d.ts.map +1 -0
- package/lib/runtime/source-meta.js +8 -0
- package/lib/runtime/source-meta.js.map +1 -0
- package/lib/runtime/source-overlay/editors.d.ts +9 -0
- package/lib/runtime/source-overlay/editors.d.ts.map +1 -0
- package/lib/runtime/source-overlay/editors.js +40 -0
- package/lib/runtime/source-overlay/editors.js.map +1 -0
- package/lib/runtime/source-overlay/mask-path.d.ts +7 -0
- package/lib/runtime/source-overlay/mask-path.d.ts.map +1 -0
- package/lib/runtime/source-overlay/mask-path.js +26 -0
- package/lib/runtime/source-overlay/mask-path.js.map +1 -0
- package/lib/runtime/source-overlay/overlay-element.d.ts +18 -0
- package/lib/runtime/source-overlay/overlay-element.d.ts.map +1 -0
- package/lib/runtime/source-overlay/overlay-element.js +381 -0
- package/lib/runtime/source-overlay/overlay-element.js.map +1 -0
- package/lib/runtime/source-overlay/source-host.d.ts +14 -0
- package/lib/runtime/source-overlay/source-host.d.ts.map +1 -0
- package/lib/runtime/source-overlay/source-host.js +94 -0
- package/lib/runtime/source-overlay/source-host.js.map +1 -0
- package/lib/runtime/source-overlay/template.d.ts +7 -0
- package/lib/runtime/source-overlay/template.d.ts.map +1 -0
- package/lib/runtime/source-overlay/template.js +125 -0
- package/lib/runtime/source-overlay/template.js.map +1 -0
- package/lib/runtime/source-overlay.d.ts +7 -0
- package/lib/runtime/source-overlay.d.ts.map +1 -0
- package/lib/runtime/source-overlay.js +11 -0
- package/lib/runtime/source-overlay.js.map +1 -0
- package/lib/runtime/timeline/clock.d.ts +10 -0
- package/lib/runtime/timeline/clock.d.ts.map +1 -0
- package/lib/runtime/timeline/clock.js +22 -0
- package/lib/runtime/timeline/clock.js.map +1 -0
- package/lib/runtime/timeline/identity.d.ts +37 -0
- package/lib/runtime/timeline/identity.d.ts.map +1 -0
- package/lib/runtime/timeline/identity.js +73 -0
- package/lib/runtime/timeline/identity.js.map +1 -0
- package/lib/runtime/timeline/input.d.ts +16 -0
- package/lib/runtime/timeline/input.d.ts.map +1 -0
- package/lib/runtime/timeline/input.js +87 -0
- package/lib/runtime/timeline/input.js.map +1 -0
- package/lib/runtime/timeline/install.d.ts +7 -0
- package/lib/runtime/timeline/install.d.ts.map +1 -0
- package/lib/runtime/timeline/install.js +69 -0
- package/lib/runtime/timeline/install.js.map +1 -0
- package/lib/runtime/timeline/lifecycle.d.ts +27 -0
- package/lib/runtime/timeline/lifecycle.d.ts.map +1 -0
- package/lib/runtime/timeline/lifecycle.js +225 -0
- package/lib/runtime/timeline/lifecycle.js.map +1 -0
- package/lib/runtime/timeline/public-api.d.ts +28 -0
- package/lib/runtime/timeline/public-api.d.ts.map +1 -0
- package/lib/runtime/timeline/public-api.js +44 -0
- package/lib/runtime/timeline/public-api.js.map +1 -0
- package/lib/runtime/timeline/render.d.ts +39 -0
- package/lib/runtime/timeline/render.d.ts.map +1 -0
- package/lib/runtime/timeline/render.js +109 -0
- package/lib/runtime/timeline/render.js.map +1 -0
- package/lib/runtime/timeline/transport.d.ts +42 -0
- package/lib/runtime/timeline/transport.d.ts.map +1 -0
- package/lib/runtime/timeline/transport.js +86 -0
- package/lib/runtime/timeline/transport.js.map +1 -0
- package/lib/segmented-tabs.d.ts +33 -0
- package/lib/segmented-tabs.d.ts.map +1 -0
- package/lib/segmented-tabs.js +129 -0
- package/lib/segmented-tabs.js.map +1 -0
- package/lib/source-meta.d.ts +26 -0
- package/lib/source-meta.d.ts.map +1 -0
- package/lib/source-meta.js +129 -0
- package/lib/source-meta.js.map +1 -0
- package/lib/timeline-plugin.d.ts +72 -0
- package/lib/timeline-plugin.d.ts.map +1 -0
- package/lib/timeline-plugin.js +376 -0
- package/lib/timeline-plugin.js.map +1 -0
- package/lib/tokens.d.ts +38 -0
- package/lib/tokens.d.ts.map +1 -0
- package/lib/tokens.js +263 -0
- package/lib/tokens.js.map +1 -0
- package/lib/transform.d.ts +5 -5
- package/lib/transform.d.ts.map +1 -1
- package/lib/transform.js +3 -3
- package/lib/transform.js.map +1 -1
- package/lib/types.d.ts +34 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +7 -0
- package/lib/types.js.map +1 -0
- package/lib/wrap-table.d.ts.map +1 -1
- package/lib/wrap-table.js.map +1 -1
- package/package.json +18 -4
- package/panel/components-view.d.ts +60 -0
- package/panel/components-view.d.ts.map +1 -0
- package/panel/components-view.js +581 -0
- package/panel/components-view.js.map +1 -0
- package/panel/devtools-settings.d.ts +41 -0
- package/panel/devtools-settings.d.ts.map +1 -0
- package/panel/devtools-settings.js +463 -0
- package/panel/devtools-settings.js.map +1 -0
- package/panel/index.html +29 -0
- package/panel/lit-devtools-panel.d.ts +37 -0
- package/panel/lit-devtools-panel.d.ts.map +1 -0
- package/panel/lit-devtools-panel.js +183 -0
- package/panel/lit-devtools-panel.js.map +1 -0
- package/panel/timeline-event-list.d.ts +43 -0
- package/panel/timeline-event-list.d.ts.map +1 -0
- package/panel/timeline-event-list.js +416 -0
- package/panel/timeline-event-list.js.map +1 -0
- package/panel/timeline-layers.d.ts +25 -0
- package/panel/timeline-layers.d.ts.map +1 -0
- package/panel/timeline-layers.js +96 -0
- package/panel/timeline-layers.js.map +1 -0
- package/panel/timeline-view.d.ts +38 -0
- package/panel/timeline-view.d.ts.map +1 -0
- package/panel/timeline-view.js +234 -0
- package/panel/timeline-view.js.map +1 -0
- package/types/inspector.d.ts +130 -0
- package/types/inspector.d.ts.map +1 -0
- package/types/inspector.js +16 -0
- package/types/inspector.js.map +1 -0
- package/types/timeline.d.ts +98 -0
- package/types/timeline.d.ts.map +1 -0
- package/types/timeline.js +39 -0
- package/types/timeline.js.map +1 -0
package/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Copyright 2026 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
5
|
*/
|
|
6
|
-
export {
|
|
7
|
-
export type {
|
|
6
|
+
export { litPlugin, litPlugin as default } from './lib/plugin.js';
|
|
7
|
+
export type { LitPluginOptions } from './lib/plugin.js';
|
|
8
|
+
export type { ElementInfo, EditorConfig, SourceOverlayOptions, } from './lib/types.js';
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/labs/vite-
|
|
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"}
|
package/index.js
CHANGED
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../packages/labs/vite-
|
|
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"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Panel color-scheme preference, persisted in `localStorage`.
|
|
8
|
+
*
|
|
9
|
+
* `auto` is the default and needs no JavaScript: the token values injected by
|
|
10
|
+
* {@link injectTokens} in `tokens.ts` react to `prefers-color-scheme` via
|
|
11
|
+
* `@media`, so the panel follows whatever scheme its host requests — the OS
|
|
12
|
+
* when standalone, or the embedding app's `color-scheme` when docked in the
|
|
13
|
+
* Vite DevTools shell (the iframe inherits it). An explicit `light`/`dark`
|
|
14
|
+
* preference pins the matching `.color-scheme-light` / `.color-scheme-dark`
|
|
15
|
+
* class on the document root, overriding the media query.
|
|
16
|
+
*/
|
|
17
|
+
export type ColorSchemePreference = 'auto' | 'dark' | 'light';
|
|
18
|
+
/** localStorage key for the panel UI color-scheme preference. */
|
|
19
|
+
export declare const COLOR_SCHEME_LS_KEY = "lit-devtools-color-scheme";
|
|
20
|
+
/** Read the saved preference, defaulting to `auto`. */
|
|
21
|
+
export declare const readColorSchemePreference: () => ColorSchemePreference;
|
|
22
|
+
/**
|
|
23
|
+
* Apply a preference to the document root. `light`/`dark` pin the matching
|
|
24
|
+
* class; `auto` removes both and lets the `prefers-color-scheme` `@media` rule
|
|
25
|
+
* in the injected tokens own the scheme (and live-update on OS changes).
|
|
26
|
+
*/
|
|
27
|
+
export declare const applyColorScheme: (pref: ColorSchemePreference) => void;
|
|
28
|
+
/** Persist a preference and apply it immediately. */
|
|
29
|
+
export declare const setColorSchemePreference: (pref: ColorSchemePreference) => void;
|
|
30
|
+
//# sourceMappingURL=color-scheme.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/
|
|
6
|
+
/** localStorage key for the panel UI color-scheme preference. */
|
|
7
|
+
export const COLOR_SCHEME_LS_KEY = 'lit-devtools-color-scheme';
|
|
8
|
+
/** Read the saved preference, defaulting to `auto`. */
|
|
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';
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Apply a preference to the document root. `light`/`dark` pin the matching
|
|
22
|
+
* class; `auto` removes both and lets the `prefers-color-scheme` `@media` rule
|
|
23
|
+
* in the injected tokens own the scheme (and live-update on OS changes).
|
|
24
|
+
*/
|
|
25
|
+
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);
|
|
30
|
+
};
|
|
31
|
+
/** Persist a preference and apply it immediately. */
|
|
32
|
+
export const setColorSchemePreference = (pref) => {
|
|
33
|
+
try {
|
|
34
|
+
localStorage.setItem(COLOR_SCHEME_LS_KEY, pref);
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
// ignore
|
|
38
|
+
}
|
|
39
|
+
applyColorScheme(pref);
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=color-scheme.js.map
|
|
@@ -0,0 +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"]}
|
package/lib/icons.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/
|
|
6
|
+
/** `cube` — Components tab. */
|
|
7
|
+
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
|
+
/** `clock` — Timeline tab. */
|
|
9
|
+
export declare const CLOCK_ICON = "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";
|
|
10
|
+
/** `gear` — Settings tab. */
|
|
11
|
+
export declare const GEAR_ICON = "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";
|
|
12
|
+
/** `code` — the source overlay's "open in editor" affordance. */
|
|
13
|
+
export declare 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>";
|
|
14
|
+
/** `copy-simple` — the source overlay's "copy path" affordance. */
|
|
15
|
+
export declare 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>";
|
|
16
|
+
/** `flame` — the HMR update indicator's mark. */
|
|
17
|
+
export declare 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>";
|
|
18
|
+
//# sourceMappingURL=icons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../packages/labs/vite-plugin-lit/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,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
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/
|
|
6
|
+
// Phosphor Icons (https://phosphoricons.com, MIT) inlined so the devtools
|
|
7
|
+
// modules stay self-contained with no extra icon library dependency.
|
|
8
|
+
// Panel icons are SVG path data used via <svg viewBox="0 0 256 256"
|
|
9
|
+
// fill="currentColor"><path d={...}/></svg>; runtime icons are full markup
|
|
10
|
+
// injected as raw HTML.
|
|
11
|
+
/** `cube` — Components tab. */
|
|
12
|
+
export 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';
|
|
13
|
+
/** `clock` — Timeline tab. */
|
|
14
|
+
export const CLOCK_ICON = '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';
|
|
15
|
+
/** `gear` — Settings tab. */
|
|
16
|
+
export const GEAR_ICON = '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';
|
|
17
|
+
/** `code` — the source overlay's "open in editor" affordance. */
|
|
18
|
+
export 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>`;
|
|
19
|
+
/** `copy-simple` — the source overlay's "copy path" affordance. */
|
|
20
|
+
export 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>`;
|
|
21
|
+
/** `flame` — the HMR update indicator's mark. */
|
|
22
|
+
export 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>`;
|
|
23
|
+
//# sourceMappingURL=icons.js.map
|
package/lib/icons.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.js","sourceRoot":"","sources":["../../../packages/labs/vite-plugin-lit/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,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/** `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/plugin.d.ts
CHANGED
|
@@ -3,11 +3,31 @@
|
|
|
3
3
|
* Copyright 2026 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
5
|
*/
|
|
6
|
-
import type
|
|
6
|
+
import { type Plugin } from 'vite';
|
|
7
|
+
import type { SourceOverlayOptions } from './types.js';
|
|
7
8
|
/**
|
|
8
|
-
*
|
|
9
|
+
* On-page HMR feedback: a small pulsing indicator in the corner of the host
|
|
10
|
+
* page that briefly animates on each HMR update, for at-a-glance feedback
|
|
11
|
+
* without watching the console.
|
|
9
12
|
*/
|
|
10
|
-
export interface
|
|
13
|
+
export interface HmrIndicatorOptions {
|
|
14
|
+
/** Inject the indicator element. Defaults to `true` (when HMR is enabled). */
|
|
15
|
+
enabled?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Show a cumulative update count next to the dot (idle opacity 0.5 instead
|
|
18
|
+
* of fully transparent). Defaults to `false`.
|
|
19
|
+
*/
|
|
20
|
+
count?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* HMR for Lit component classes and its on-page feedback.
|
|
24
|
+
*/
|
|
25
|
+
export interface HmrOptions {
|
|
26
|
+
/**
|
|
27
|
+
* Enable in-place HMR for Lit component classes. When `false`, the plugin
|
|
28
|
+
* skips all HMR transforms and runtime injection. Defaults to `true`.
|
|
29
|
+
*/
|
|
30
|
+
enabled?: boolean;
|
|
11
31
|
/**
|
|
12
32
|
* Cycle `disconnectedCallback()`/`connectedCallback()` on live instances
|
|
13
33
|
* after a hot patch. Interning makes this mostly unnecessary, so it's
|
|
@@ -19,10 +39,101 @@ export interface LitHmrOptions {
|
|
|
19
39
|
* standard `accessor` decorators). Defaults to `'reload'`.
|
|
20
40
|
*/
|
|
21
41
|
onIncompatible?: 'reload' | 'warn';
|
|
42
|
+
/**
|
|
43
|
+
* The on-page update indicator. `true` enables it without a count; an
|
|
44
|
+
* object configures it. Forced off when HMR itself is disabled. Defaults
|
|
45
|
+
* to enabled (without a count).
|
|
46
|
+
*/
|
|
47
|
+
indicator?: boolean | HmrIndicatorOptions;
|
|
22
48
|
}
|
|
23
49
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
50
|
+
* What a `?css-sheet` import compiles to under `vite build`.
|
|
51
|
+
*
|
|
52
|
+
* - `'url'`: fetch-backed sheet over the emitted `.css` asset.
|
|
53
|
+
* - `'inline'`: css text embedded in the JS chunk, processed by the css
|
|
54
|
+
* pipeline (`?inline`).
|
|
55
|
+
* - `'inline-raw'`: css text embedded verbatim, skipping the css pipeline
|
|
56
|
+
* (`?raw`).
|
|
57
|
+
* - `'auto'`: `'inline'` when `build.lib` is set, `'url'` otherwise.
|
|
58
|
+
*/
|
|
59
|
+
export type CssSheetBuild = 'auto' | 'url' | 'inline' | 'inline-raw';
|
|
60
|
+
/**
|
|
61
|
+
* Options for the Lit Vite plugin.
|
|
62
|
+
*
|
|
63
|
+
* Every option also resolves from environment variables (and `.env` files)
|
|
64
|
+
* with the `LIT_PLUGIN` prefix — e.g. `LIT_PLUGIN_HMR_INDICATOR=true`. Options
|
|
65
|
+
* passed here take precedence over env vars, which take precedence over the
|
|
66
|
+
* built-in defaults.
|
|
67
|
+
*/
|
|
68
|
+
export interface LitPluginOptions {
|
|
69
|
+
/**
|
|
70
|
+
* HMR for Lit components and its on-page feedback. `true`/`false` toggles
|
|
71
|
+
* the whole feature (patching and indicator); an object configures it.
|
|
72
|
+
* Defaults to enabled.
|
|
73
|
+
*/
|
|
74
|
+
hmr?: boolean | HmrOptions;
|
|
75
|
+
/**
|
|
76
|
+
* Dev-only click-to-open-in-IDE inspector for Lit custom elements.
|
|
77
|
+
* Toggle with Ctrl+Shift+S (configurable via `key`). Defaults to `false`.
|
|
78
|
+
*/
|
|
79
|
+
sourceOverlay?: boolean | SourceOverlayOptions;
|
|
80
|
+
/**
|
|
81
|
+
* Vite DevTools Timeline panel — a Vue DevTools–style layered event stream
|
|
82
|
+
* for Lit lifecycle, render, mouse, and keyboard events.
|
|
83
|
+
*
|
|
84
|
+
* Requires `@vitejs/devtools` in the Vite config and the `@vitejs/devtools`
|
|
85
|
+
* Vite plugin (`DevTools()`) to be active. Defaults to `false` while
|
|
86
|
+
* experimental.
|
|
87
|
+
*
|
|
88
|
+
* `true` enables all built-in layers with defaults.
|
|
89
|
+
*/
|
|
90
|
+
timeline?: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* What a `?css-sheet` import compiles to under `vite build`.
|
|
93
|
+
* - `'url'`: fetch-backed sheet over the emitted `.css` asset
|
|
94
|
+
* - `'inline'`: css text embedded in the JS chunk, processed by the css
|
|
95
|
+
* pipeline (`?inline`)
|
|
96
|
+
* - `'inline-raw'`: css text embedded verbatim, skipping the css pipeline
|
|
97
|
+
* (`?raw`)
|
|
98
|
+
* - `'auto'`: `'inline'` when `build.lib` is set, `'url'` otherwise
|
|
99
|
+
*
|
|
100
|
+
* Dev is always the fetch-backed HMR form regardless of this setting.
|
|
101
|
+
* Defaults to `'auto'`.
|
|
102
|
+
*/
|
|
103
|
+
cssSheetBuild?: CssSheetBuild;
|
|
104
|
+
}
|
|
105
|
+
/** Plugin options after merging explicit options, env vars, and defaults. */
|
|
106
|
+
export interface ResolvedOptions {
|
|
107
|
+
hmrEnabled: boolean;
|
|
108
|
+
reconnect: boolean;
|
|
109
|
+
onIncompatible: 'reload' | 'warn';
|
|
110
|
+
indicator: false | {
|
|
111
|
+
count: boolean;
|
|
112
|
+
};
|
|
113
|
+
sourceOverlay: false | SourceOverlayOptions;
|
|
114
|
+
timeline: boolean;
|
|
115
|
+
cssSheetBuild: CssSheetBuild;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Merge explicit options over env vars over defaults (in that precedence) into
|
|
119
|
+
* the flat shape the plugin hooks consume.
|
|
120
|
+
*/
|
|
121
|
+
export declare const resolveOptions: (options: LitPluginOptions, env: Record<string, string>) => ResolvedOptions;
|
|
122
|
+
/**
|
|
123
|
+
* Import-query support, served in dev and build alike (source code using
|
|
124
|
+
* `?hmr-url`/`?css-sheet` must keep working under `vite build`, where the HMR
|
|
125
|
+
* plugin doesn't apply). Exported for the baseline e2e run, which needs the
|
|
126
|
+
* queries working without the HMR plugin.
|
|
127
|
+
*
|
|
128
|
+
* `getCssSheetBuild` is a getter, not a value: `litPlugin()` re-resolves its
|
|
129
|
+
* options against the loaded env in a `config` hook, which runs after the
|
|
130
|
+
* plugin array is built. Standalone (no getter) it behaves like the `'auto'`
|
|
131
|
+
* default.
|
|
132
|
+
*/
|
|
133
|
+
export declare const litCssQueries: (getCssSheetBuild?: () => CssSheetBuild) => Plugin;
|
|
134
|
+
/**
|
|
135
|
+
* Vite plugin set providing HMR, CSS helpers, and Lightning CSS processing
|
|
136
|
+
* for Lit projects.
|
|
26
137
|
*/
|
|
27
|
-
export declare const
|
|
138
|
+
export declare const litPlugin: (options?: LitPluginOptions) => Plugin[];
|
|
28
139
|
//# sourceMappingURL=plugin.d.ts.map
|
package/lib/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../packages/labs/vite-
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../packages/labs/vite-plugin-lit/src/lib/plugin.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAA2B,KAAK,MAAM,EAAC,MAAM,MAAM,CAAC;AAI3D,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,YAAY,CAAC;AAKrD;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,8EAA8E;IAC9E,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;OAGG;IACH,cAAc,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IAEnC;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,mBAAmB,CAAC;CAC3C;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,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,cAAc,EAAE,QAAQ,GAAG,MAAM,CAAC;IAClC,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;CAC9B;AAuCD;;;GAGG;AACH,eAAO,MAAM,cAAc,GACzB,SAAS,gBAAgB,EACzB,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAC1B,eA4DF,CAAC;AA2KF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,aAAa,GACxB,mBAAkB,MAAM,aAA4B,KACnD,MAwFF,CAAC;AAuFF;;;GAGG;AACH,eAAO,MAAM,SAAS,GAAI,UAAS,gBAAqB,KAAG,MAAM,EAqRhE,CAAC"}
|