@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/lib/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../packages/labs/vite-hmr/src/lib/plugin.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,UAAU,EAAC,MAAM,SAAS,CAAC;AACnC,OAAO,EAAC,aAAa,EAAC,MAAM,UAAU,CAAC;AAEvC,OAAO,EAAC,UAAU,EAAE,cAAc,EAAE,kBAAkB,EAAC,MAAM,gBAAgB,CAAC;AAC9E,OAAO,EAAC,UAAU,EAAC,MAAM,iBAAiB,CAAC;AAoB3C;;;;GAIG;AACH,MAAM,oBAAoB,GAAG,CAAC,IAAY,EAAU,EAAE;IACpD,KAAK,MAAM,GAAG,IAAI,CAAC,IAAI,EAAE,IAAI,CAAU,EAAE,CAAC;QACxC,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,aAAa,IAAI,IAAI,GAAG,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACjE,IAAI,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACpB,OAAO,aAAa,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAChD,CAAC;IACH,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,uCAAuC,IAAI,EAAE,CAAC,CAAC;AACjE,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,iBAAiB,CAAC;AAErC;;;GAGG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,UAAyB,EAAE,EAAU,EAAE;IAC5D,MAAM,cAAc,GAAG;QACrB,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,KAAK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AyB,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG;gBACtD,iBAAiB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG;aACzC,CAAC;YACF,KAAK,MAAM,EAAC,UAAU,EAAE,EAAE,EAAC,IAAI,WAAW,EAAE,CAAC;gBAC3C,KAAK,CAAC,IAAI,CACR,gBAAgB,UAAU,oBAAoB,UAAU,KAAK,IAAI,CAAC,SAAS,CACzE,EAAE,CACH,IAAI,CACN,CAAC;YACJ,CAAC;YACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;QACjC,CAAC;QACD,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,EAAE,gBAAgB;YACxC,IAAI,gBAAgB,EAAE,GAAG,EAAE,CAAC;gBAC1B,OAAO,IAAI,CAAC;YACd,CAAC;YACD,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC;gBACzD,OAAO,IAAI,CAAC;YACd,CAAC;YACD,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;YAChC,4DAA4D;YAC5D,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;gBAC1D,OAAO,IAAI,CAAC;YACd,CAAC;YACD,OAAO,kBAAkB,CAAC,IAAI,CAAC,CAAC;QAClC,CAAC;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {existsSync} from 'node:fs';\nimport {fileURLToPath} from 'node:url';\nimport type {Plugin} from 'vite';\nimport {INSTALL_ID, VIRTUAL_PREFIX, transformLitModule} from './transform.js';\nimport {WRAP_TABLE} from './wrap-table.js';\n\n/**\n * Options for the Lit HMR Vite plugin.\n */\nexport interface LitHmrOptions {\n /**\n * Cycle `disconnectedCallback()`/`connectedCallback()` on live instances\n * after a hot patch. Interning makes this mostly unnecessary, so it's\n * opt-in. Defaults to `false`.\n */\n reconnect?: boolean;\n\n /**\n * What to do when a component can't be hot-patched in place (e.g.\n * standard `accessor` decorators). Defaults to `'reload'`.\n */\n onIncompatible?: 'reload' | 'warn';\n}\n\n/**\n * Resolves a runtime module to an absolute fs path (served via `/@fs/`), so\n * the plugin works from any served root. Falls back from the built `.js` to\n * the `.ts` source when running un-built (e.g. under vitest).\n */\nconst resolveRuntimeModule = (name: string): string => {\n for (const ext of ['js', 'ts'] as const) {\n const url = new URL(`./runtime/${name}.${ext}`, import.meta.url);\n if (existsSync(url)) {\n return fileURLToPath(url).replace(/\\\\/g, '/');\n }\n }\n throw new Error(`[lit-hmr] runtime module not found: ${name}`);\n};\n\nconst JS_FILE_RE = /\\.[cm]?[jt]sx?$/;\n\n/**\n * Dev-only Vite plugin providing true HMR for Lit: template-strings\n * interning plus in-place custom element class patching.\n */\nexport const litHmr = (options: LitHmrOptions = {}): Plugin => {\n const runtimeOptions = {\n reconnect: options.reconnect ?? false,\n onIncompatible: options.onIncompatible ?? 'reload',\n };\n return {\n name: 'lit-hmr',\n apply: 'serve',\n // The injected runtime imports are invisible to the dep scanner. The\n // lit family stays prebundle-eligible on purpose: the wrapper modules'\n // bare imports then resolve to the same URL every other importer gets —\n // single lit instance, single template cache.\n config: () => ({\n optimizeDeps: {exclude: ['@lit-labs/vite-hmr']},\n }),\n resolveId(id) {\n if (id.startsWith(VIRTUAL_PREFIX)) {\n return id;\n }\n return null;\n },\n load(id) {\n if (!id.startsWith(VIRTUAL_PREFIX)) {\n return null;\n }\n if (id === INSTALL_ID) {\n const patchPath = resolveRuntimeModule('patch');\n return (\n `import {install} from ${JSON.stringify(patchPath)};\\n` +\n `install(${JSON.stringify(runtimeOptions)});\\n`\n );\n }\n const spec = id.slice(VIRTUAL_PREFIX.length);\n const wrappedTags = WRAP_TABLE.get(spec);\n if (wrappedTags === undefined) {\n return null;\n }\n const internPath = resolveRuntimeModule('intern');\n // Browser-native ESM: explicit local exports shadow `export *` names\n // (spec-guaranteed), so everything except the wrapped tags passes\n // through unchanged.\n const lines = [\n `import * as __lit from ${JSON.stringify(spec)};`,\n `import {wrapTag} from ${JSON.stringify(internPath)};`,\n `export * from ${JSON.stringify(spec)};`,\n ];\n for (const {exportName, ns} of wrappedTags) {\n lines.push(\n `export const ${exportName} = wrapTag(__lit.${exportName}, ${JSON.stringify(\n ns\n )});`\n );\n }\n return lines.join('\\n') + '\\n';\n },\n async transform(code, id, transformOptions) {\n if (transformOptions?.ssr) {\n return null;\n }\n if (id.startsWith('\\0') || id.includes('/node_modules/')) {\n return null;\n }\n const [file] = id.split('?', 2);\n // Allow inline scripts extracted from HTML (`?html-proxy`).\n if (!JS_FILE_RE.test(file) && !id.includes('?html-proxy')) {\n return null;\n }\n return transformLitModule(code);\n },\n };\n};\n"]}
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../packages/labs/vite-plugin-lit/src/lib/plugin.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,UAAU,EAAC,MAAM,SAAS,CAAC;AACnC,OAAO,EAAC,OAAO,IAAI,WAAW,EAAE,GAAG,EAAC,MAAM,WAAW,CAAC;AACtD,OAAO,EAAC,aAAa,EAAC,MAAM,UAAU,CAAC;AACvC,OAAO,EAAC,OAAO,EAA+B,MAAM,MAAM,CAAC;AAC3D,OAAO,WAAW,MAAM,cAAc,CAAC;AACvC,OAAO,EAAC,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAC,UAAU,EAAE,cAAc,EAAE,kBAAkB,EAAC,MAAM,gBAAgB,CAAC;AAG9E,OAAO,EAAC,UAAU,EAAC,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAC,iBAAiB,EAAC,MAAM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AC,GAAG,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC;QAC3C,cAAc,EAAE;QAChB,mBAAmB;QACnB,GAAG;KACJ,CAAC;IACF,IAAI,QAAQ,CAAC,QAAQ,EAAE,CAAC;QACtB,uEAAuE;QACvE,yEAAyE;QACzE,2EAA2E;QAC3E,WAAW;QACX,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,GAAG,EAAE,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IACrE,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {existsSync} from 'node:fs';\nimport {resolve as resolvePath, sep} from 'node:path';\nimport {fileURLToPath} from 'node:url';\nimport {loadEnv, type CSSOptions, type Plugin} from 'vite';\nimport MagicString from 'magic-string';\nimport {injectSourceMeta} from './source-meta.js';\nimport {INSTALL_ID, VIRTUAL_PREFIX, transformLitModule} from './transform.js';\nimport type {SourceOverlayOptions} from './types.js';\nimport type {FeatureSettings} from '../types/timeline.js';\nimport {WRAP_TABLE} from './wrap-table.js';\nimport {litTimelinePlugin} from './timeline-plugin.js';\n\n/**\n * On-page HMR feedback: a small pulsing indicator in the corner of the host\n * page that briefly animates on each HMR update, for at-a-glance feedback\n * without watching the console.\n */\nexport interface HmrIndicatorOptions {\n /** Inject the indicator element. Defaults to `true` (when HMR is enabled). */\n enabled?: boolean;\n\n /**\n * Show a cumulative update count next to the dot (idle opacity 0.5 instead\n * of fully transparent). Defaults to `false`.\n */\n count?: boolean;\n}\n\n/**\n * HMR for Lit component classes and its on-page feedback.\n */\nexport interface HmrOptions {\n /**\n * Enable in-place HMR for Lit component classes. When `false`, the plugin\n * skips all HMR transforms and runtime injection. Defaults to `true`.\n */\n enabled?: boolean;\n\n /**\n * Cycle `disconnectedCallback()`/`connectedCallback()` on live instances\n * after a hot patch. Interning makes this mostly unnecessary, so it's\n * opt-in. Defaults to `false`.\n */\n reconnect?: boolean;\n\n /**\n * What to do when a component can't be hot-patched in place (e.g.\n * standard `accessor` decorators). Defaults to `'reload'`.\n */\n onIncompatible?: 'reload' | 'warn';\n\n /**\n * The on-page update indicator. `true` enables it without a count; an\n * object configures it. Forced off when HMR itself is disabled. Defaults\n * to enabled (without a count).\n */\n indicator?: boolean | HmrIndicatorOptions;\n}\n\n/**\n * What a `?css-sheet` import compiles to under `vite build`.\n *\n * - `'url'`: fetch-backed sheet over the emitted `.css` asset.\n * - `'inline'`: css text embedded in the JS chunk, processed by the css\n * pipeline (`?inline`).\n * - `'inline-raw'`: css text embedded verbatim, skipping the css pipeline\n * (`?raw`).\n * - `'auto'`: `'inline'` when `build.lib` is set, `'url'` otherwise.\n */\nexport type CssSheetBuild = 'auto' | 'url' | 'inline' | 'inline-raw';\n\nconst CSS_SHEET_BUILD_MODES: readonly CssSheetBuild[] = [\n 'auto',\n 'url',\n 'inline',\n 'inline-raw',\n];\n\n/**\n * Options for the Lit Vite plugin.\n *\n * Every option also resolves from environment variables (and `.env` files)\n * with the `LIT_PLUGIN` prefix — e.g. `LIT_PLUGIN_HMR_INDICATOR=true`. Options\n * passed here take precedence over env vars, which take precedence over the\n * built-in defaults.\n */\nexport interface LitPluginOptions {\n /**\n * HMR for Lit components and its on-page feedback. `true`/`false` toggles\n * the whole feature (patching and indicator); an object configures it.\n * Defaults to enabled.\n */\n hmr?: boolean | HmrOptions;\n\n /**\n * Dev-only click-to-open-in-IDE inspector for Lit custom elements.\n * Toggle with Ctrl+Shift+S (configurable via `key`). Defaults to `false`.\n */\n sourceOverlay?: boolean | SourceOverlayOptions;\n\n /**\n * Vite DevTools Timeline panel — a Vue DevTools–style layered event stream\n * for Lit lifecycle, render, mouse, and keyboard events.\n *\n * Requires `@vitejs/devtools` in the Vite config and the `@vitejs/devtools`\n * Vite plugin (`DevTools()`) to be active. Defaults to `false` while\n * experimental.\n *\n * `true` enables all built-in layers with defaults.\n */\n timeline?: boolean;\n\n /**\n * What a `?css-sheet` import compiles to under `vite build`.\n * - `'url'`: fetch-backed sheet over the emitted `.css` asset\n * - `'inline'`: css text embedded in the JS chunk, processed by the css\n * pipeline (`?inline`)\n * - `'inline-raw'`: css text embedded verbatim, skipping the css pipeline\n * (`?raw`)\n * - `'auto'`: `'inline'` when `build.lib` is set, `'url'` otherwise\n *\n * Dev is always the fetch-backed HMR form regardless of this setting.\n * Defaults to `'auto'`.\n */\n cssSheetBuild?: CssSheetBuild;\n}\n\n/** Plugin options after merging explicit options, env vars, and defaults. */\nexport interface ResolvedOptions {\n hmrEnabled: boolean;\n reconnect: boolean;\n onIncompatible: 'reload' | 'warn';\n indicator: false | {count: boolean};\n sourceOverlay: false | SourceOverlayOptions;\n timeline: boolean;\n cssSheetBuild: CssSheetBuild;\n}\n\n/** Env var prefix consumed at config time. */\nconst ENV_PREFIX = 'LIT_PLUGIN';\n\n/** Parse a boolean-ish env string; `undefined` when unset/unrecognized. */\nconst envBool = (v: string | undefined): boolean | undefined =>\n v === 'true' || v === '1'\n ? true\n : v === 'false' || v === '0'\n ? false\n : undefined;\n\n/** Parse a numeric env string; `undefined` when unset/non-numeric. */\nconst envNum = (v: string | undefined): number | undefined => {\n if (v === undefined || v === '') return undefined;\n const n = Number(v);\n return Number.isNaN(n) ? undefined : n;\n};\n\n/**\n * Parse a string against a closed set of values; `undefined` (with a warning)\n * when set to something outside it, so a typo falls back to the default\n * instead of silently disabling a feature.\n */\nconst envEnum = <T extends string>(\n v: string | undefined,\n allowed: readonly T[],\n source: string\n): T | undefined => {\n if (v === undefined || v === '') return undefined;\n if ((allowed as readonly string[]).includes(v)) return v as T;\n console.warn(\n `[lit-plugin] ignoring ${source}=${JSON.stringify(v)}; expected one of ` +\n allowed.map((a) => JSON.stringify(a)).join(', ')\n );\n return undefined;\n};\n\n/**\n * Merge explicit options over env vars over defaults (in that precedence) into\n * the flat shape the plugin hooks consume.\n */\nexport const resolveOptions = (\n options: LitPluginOptions,\n env: Record<string, string>\n): ResolvedOptions => {\n const hmr = options.hmr;\n const hmrObj = typeof hmr === 'object' ? hmr : undefined;\n const hmrEnabled =\n (typeof hmr === 'boolean' ? hmr : hmrObj?.enabled) ??\n envBool(env[`${ENV_PREFIX}_HMR`]) ??\n true;\n const reconnect =\n hmrObj?.reconnect ?? envBool(env[`${ENV_PREFIX}_HMR_RECONNECT`]) ?? false;\n const onIncompatible =\n hmrObj?.onIncompatible ??\n (env[`${ENV_PREFIX}_HMR_ON_INCOMPATIBLE`] as 'reload' | 'warn') ??\n 'reload';\n\n const ind = hmrObj?.indicator;\n const indObj = typeof ind === 'object' ? ind : undefined;\n const indEnabled =\n (typeof ind === 'boolean' ? ind : indObj?.enabled) ??\n envBool(env[`${ENV_PREFIX}_HMR_INDICATOR`]) ??\n true;\n const indCount =\n indObj?.count ?? envBool(env[`${ENV_PREFIX}_HMR_INDICATOR_COUNT`]) ?? false;\n // The indicator is meaningless without HMR, so it follows the master toggle.\n const indicator = hmrEnabled && indEnabled ? {count: indCount} : false;\n\n const so = options.sourceOverlay;\n const soExplicit =\n typeof so === 'boolean' ? so : so === undefined ? undefined : true;\n const soEnabled =\n soExplicit ?? envBool(env[`${ENV_PREFIX}_SOURCE_OVERLAY`]) ?? false;\n let sourceOverlay: false | SourceOverlayOptions = false;\n if (soEnabled) {\n const base: SourceOverlayOptions = typeof so === 'object' ? {...so} : {};\n base.key ??= env[`${ENV_PREFIX}_SOURCE_OVERLAY_KEY`] || undefined;\n base.editor ??= env[`${ENV_PREFIX}_SOURCE_OVERLAY_EDITOR`] || undefined;\n base.throttleMs ??= envNum(env[`${ENV_PREFIX}_SOURCE_OVERLAY_THROTTLE_MS`]);\n sourceOverlay = base;\n }\n\n const timeline =\n options.timeline ?? envBool(env[`${ENV_PREFIX}_TIMELINE`]) ?? false;\n\n const cssSheetBuild =\n envEnum(options.cssSheetBuild, CSS_SHEET_BUILD_MODES, 'cssSheetBuild') ??\n envEnum(\n env[`${ENV_PREFIX}_CSS_SHEET_BUILD`],\n CSS_SHEET_BUILD_MODES,\n `${ENV_PREFIX}_CSS_SHEET_BUILD`\n ) ??\n 'auto';\n\n return {\n hmrEnabled,\n reconnect,\n onIncompatible,\n indicator,\n sourceOverlay,\n timeline,\n cssSheetBuild,\n };\n};\n\n/**\n * Flattens resolved options into the JSON-serializable shape the panel's\n * Settings tab consumes (callback options like `exclude`/`onSelect` dropped;\n * a custom editor object reported as `\"custom\"`). Default key/editor/throttle\n * are applied here so the panel shows the effective values the runtime uses.\n */\nconst toFeatureSettings = (r: ResolvedOptions): FeatureSettings => {\n const so = r.sourceOverlay;\n const editor = so === false ? undefined : so.editor;\n return {\n hmr: {\n enabled: r.hmrEnabled,\n reconnect: r.reconnect,\n onIncompatible: r.onIncompatible,\n indicatorEnabled: r.indicator !== false,\n indicatorCount: r.indicator !== false && r.indicator.count,\n },\n sourceOverlay: {\n enabled: so !== false,\n key: (so === false ? undefined : so.key) ?? 's',\n editor:\n typeof editor === 'string' ? editor : editor ? 'custom' : 'vscode',\n throttleMs: (so === false ? undefined : so.throttleMs) ?? 50,\n },\n timeline: r.timeline,\n };\n};\n\n/**\n * Resolves a runtime module to an absolute fs path (served via `/@fs/`), so\n * the plugin works from any served root. Falls back from the built `.js` to\n * the `.ts` source when running un-built (e.g. under vitest).\n */\nconst resolveRuntimeModule = (name: string): string => {\n for (const ext of ['js', 'ts'] as const) {\n const url = new URL(`./runtime/${name}.${ext}`, import.meta.url);\n if (existsSync(url)) {\n return fileURLToPath(url).replace(/\\\\/g, '/');\n }\n }\n throw new Error(`[lit-plugin] runtime module not found: ${name}`);\n};\n\nconst JS_FILE_RE = /\\.[cm]?[jt]sx?$/;\n\nconst OPEN_IN_EDITOR_PATH = '/__lit-open-in-editor';\n\n/** Reject requests whose `Origin` is a different host than the dev server, so\n * a page the developer happens to visit can't drive these local-only\n * endpoints. Same-origin requests (no `Origin`, or matching `Host`) pass. */\nconst isSameOrigin = (headers: {origin?: string; host?: string}): boolean => {\n const {origin, host} = headers;\n if (origin === undefined || origin === 'null') return true;\n try {\n return new URL(origin).host === host;\n } catch {\n return false;\n }\n};\n\nconst createOpenInEditorMiddleware = (root: string) => {\n return (\n req: {url?: string; headers?: {origin?: string; host?: string}},\n res: {statusCode: number; end: (msg: string) => void},\n next: (err?: unknown) => void\n ) => {\n if (req.url === undefined) {\n next();\n return;\n }\n if (!isSameOrigin(req.headers ?? {})) {\n res.statusCode = 403;\n res.end('forbidden');\n return;\n }\n const query = req.url.includes('?')\n ? req.url.slice(req.url.indexOf('?') + 1)\n : '';\n const params = new URLSearchParams(query);\n const file = params.get('file');\n if (file === null) {\n res.statusCode = 400;\n res.end('missing file parameter');\n return;\n }\n // Confine the open to the project root: resolve the requested path and\n // reject anything that escapes `root` (path traversal, absolute paths to\n // arbitrary files). `launch-editor` spawns the user's editor on this path,\n // so an unvalidated `file` is a local-file-open / arg-injection vector.\n const resolved = resolvePath(root, file);\n if (resolved !== root && !resolved.startsWith(root + sep)) {\n res.statusCode = 403;\n res.end('file outside project root');\n return;\n }\n if (!existsSync(resolved)) {\n res.statusCode = 404;\n res.end('file not found');\n return;\n }\n // Coerce to integers so a crafted `line`/`column` can't smuggle extra\n // shell-visible content through the `file:line:column` ref.\n const line = String(\n Math.max(1, Number.parseInt(params.get('line') ?? '1', 10) || 1)\n );\n const column = String(\n Math.max(1, Number.parseInt(params.get('column') ?? '1', 10) || 1)\n );\n const fileRef = `${resolved}:${line}:${column}`;\n import('launch-editor')\n .then(\n (mod: {\n default?: (\n file: string,\n cb: (fileName: string, errorMessage: string | null) => void\n ) => void;\n }) => {\n const launch = (mod.default ?? mod) as (\n file: string,\n cb: (fileName: string, errorMessage: string | null) => void\n ) => void;\n launch(fileRef, (_fileName: string, errorMessage: string | null) => {\n if (errorMessage !== null) {\n res.statusCode = 500;\n res.end(errorMessage);\n return;\n }\n res.end('ok');\n });\n }\n )\n .catch(next);\n };\n};\n\n/**\n * `import href from './x.css?hmr-url'` — `?url` semantics with working HMR.\n * The string is a real stylesheet URL (dev-served CSS file; hashed `.css`\n * asset on build) for shadow-root `<link>` hrefs and `@import url()`s. In\n * dev, each HMR re-execution yields a freshly cache-busted href, so the\n * browser refetches the changed stylesheet; in build the `?url` asset URL\n * passes through unchanged.\n */\nconst CSS_URL_QUERY_RE = /^([^?]+\\.css)\\?(?:[^&]*&)*hmr-url(?:&.*)?$/;\nconst CSS_URL_VIRTUAL_PREFIX = '\\0lit-plugin:hmr-url:';\n\n/**\n * `import sheet from './x.css?css-sheet'` — a constructed, shareable\n * `CSSStyleSheet` backed by the `.css` asset that hot-swaps in place. Adopt it\n * from any number of components (`static styles = [sheet]`); a source edit\n * re-fetches and `replaceSync()`s it, updating every shadow root that adopted\n * it without re-rendering a component or reloading the page.\n *\n * This is the `urlSheet()` helper plus its irreducible HMR wiring, lifted into\n * a plugin-generated module: the `import.meta.hot.accept` lives here (where\n * Vite's static analysis sees the literal specifier), so callers write a bare\n * import and never touch `import.meta.hot` themselves.\n *\n * Under `vite build` the generated module can instead inline the css text (see\n * `cssSheetBuild`) — a library's consumers bundle its JS only, so a\n * fetch-backed sheet would 404 on the `.css` asset that never reached their\n * build.\n */\nconst CSS_SHEET_QUERY_RE = /^([^?]+\\.css)\\?(?:[^&]*&)*css-sheet(?:&.*)?$/;\nconst CSS_SHEET_VIRTUAL_PREFIX = '\\0lit-plugin:css-sheet:';\n// The virtual id must not end in `.css`, or Vite's CSS plugins (which match\n// the id's extension regardless of `\\0`) would compile the wrapper as CSS.\nconst CSS_VIRTUAL_SUFFIX = '.js';\n\n/**\n * Import-query support, served in dev and build alike (source code using\n * `?hmr-url`/`?css-sheet` must keep working under `vite build`, where the HMR\n * plugin doesn't apply). Exported for the baseline e2e run, which needs the\n * queries working without the HMR plugin.\n *\n * `getCssSheetBuild` is a getter, not a value: `litPlugin()` re-resolves its\n * options against the loaded env in a `config` hook, which runs after the\n * plugin array is built. Standalone (no getter) it behaves like the `'auto'`\n * default.\n */\nexport const litCssQueries = (\n getCssSheetBuild: () => CssSheetBuild = () => 'auto'\n): Plugin => {\n let isBuild = false;\n let isLib = false;\n return {\n name: 'lit-css-query',\n // Vite's core resolver claims `./x.css?hmr-url` for the CSS pipeline\n // before normal plugins get a look, so resolve ahead of it.\n enforce: 'pre',\n configResolved(config) {\n isBuild = config.command === 'build';\n isLib = config.build.lib !== false && config.build.lib !== undefined;\n },\n async resolveId(id, importer) {\n const prefix = CSS_URL_QUERY_RE.test(id)\n ? CSS_URL_VIRTUAL_PREFIX\n : CSS_SHEET_QUERY_RE.test(id)\n ? CSS_SHEET_VIRTUAL_PREFIX\n : null;\n if (prefix === null) {\n return null;\n }\n const file = id.slice(0, id.indexOf('?'));\n const resolved = await this.resolve(file, importer);\n if (resolved === null) {\n return null;\n }\n return prefix + resolved.id + CSS_VIRTUAL_SUFFIX;\n },\n load(id) {\n const helperPath = resolveRuntimeModule('css');\n if (id.startsWith(CSS_URL_VIRTUAL_PREFIX)) {\n const file = id.slice(\n CSS_URL_VIRTUAL_PREFIX.length,\n -CSS_VIRTUAL_SUFFIX.length\n );\n return {\n code:\n `import url from ${JSON.stringify(`${file}?url`)};\\n` +\n `import {devCacheBust} from ${JSON.stringify(helperPath)};\\n` +\n `export default devCacheBust(url);\\n`,\n moduleType: 'js',\n };\n }\n if (id.startsWith(CSS_SHEET_VIRTUAL_PREFIX)) {\n const file = id.slice(\n CSS_SHEET_VIRTUAL_PREFIX.length,\n -CSS_VIRTUAL_SUFFIX.length\n );\n const mode = getCssSheetBuild();\n const inlineQuery =\n !isBuild || mode === 'url' || (mode === 'auto' && !isLib)\n ? null\n : mode === 'inline-raw'\n ? '?raw'\n : '?inline';\n if (inlineQuery !== null) {\n // Build only, so no `import.meta.hot` block. The sheet is still\n // constructed once per virtual module, so adopters share it exactly\n // as they do in the fetch-backed form.\n return {\n code:\n `import css from ${JSON.stringify(`${file}${inlineQuery}`)};\\n` +\n `const sheet = new CSSStyleSheet();\\n` +\n `sheet.replaceSync(css);\\n` +\n `export default sheet;\\n`,\n moduleType: 'js',\n };\n }\n // The accept specifier must be byte-identical to the import above —\n // Vite resolves accepted HMR deps by static analysis. Generating both\n // here is exactly what frees the caller from writing it. The swap is\n // self-accepted at this boundary, so it never propagates to adopters.\n const urlSpecifier = JSON.stringify(`${file}?url`);\n return {\n code:\n `import url from ${urlSpecifier};\\n` +\n `import {urlSheet} from ${JSON.stringify(helperPath)};\\n` +\n `const {sheet, onHotUpdate} = urlSheet(url);\\n` +\n `export default sheet;\\n` +\n `if (import.meta.hot) {\\n` +\n ` import.meta.hot.accept(${urlSpecifier}, onHotUpdate);\\n` +\n `}\\n`,\n moduleType: 'js',\n };\n }\n return null;\n },\n };\n};\n\n/**\n * A `css` tagged template literal with no interpolations and no escape\n * sequences — the only kind we can hand to a CSS parser as-is. Literals\n * with `${…}` holes or backslashes simply don't match and stay untouched.\n * The lookbehind keeps `unsafeCSS`/`myCss`-style tags from matching.\n */\nconst CSS_LITERAL_RE = /(?<![\\w$.])css`((?:[^`\\\\$]|\\$(?!\\{))*)`/g;\n\n/**\n * Runs Vite's configured Lightning CSS over `css` tagged template literals\n * in user modules, which the CSS pipeline itself never sees (they're plain\n * JS strings to it). Inert unless `css.transformer` is `'lightningcss'`;\n * options come from `css.lightningcss`, so component styles get the same\n * treatment (targets, drafts, …) as `.css` files. Applies in dev and build.\n */\nconst litCssLiterals = (): Plugin => {\n let lightningcss: typeof import('lightningcss') | null = null;\n let options: CSSOptions['lightningcss'];\n let minify = false;\n return {\n name: 'lit-css-literals',\n async configResolved(config) {\n if (config.css.transformer !== 'lightningcss') {\n return;\n }\n // The transformer setting guarantees the dependency: Vite itself\n // can't process .css files without it.\n lightningcss = await import('lightningcss');\n // cssModules makes no sense for a literal; everything else carries\n // over.\n const {cssModules: _cssModules, ...rest} = config.css.lightningcss ?? {};\n options = rest;\n minify = config.command === 'build';\n },\n transform(code, id) {\n if (lightningcss === null) {\n return null;\n }\n if (id.startsWith('\\0') || id.includes('/node_modules/')) {\n return null;\n }\n const [file] = id.split('?', 2);\n if (!JS_FILE_RE.test(file) || !code.includes('css`')) {\n return null;\n }\n const ms = new MagicString(code);\n let changed = false;\n for (const m of code.matchAll(CSS_LITERAL_RE)) {\n const literal = m[1];\n if (literal.trim() === '') {\n continue;\n }\n let out: string;\n try {\n const result = lightningcss.transform({\n ...options,\n filename: file,\n code: Buffer.from(literal),\n minify,\n });\n out = Buffer.from(result.code).toString();\n } catch (e) {\n this.warn(\n `[lit-plugin] skipping css literal Lightning CSS couldn't parse: ${\n (e as Error).message\n }`\n );\n continue;\n }\n // Re-escape for the template literal the output goes back into.\n out = out.replace(/[\\\\`$]/g, '\\\\$&');\n if (out !== literal) {\n const start = m.index + 'css`'.length;\n ms.overwrite(start, start + literal.length, out);\n changed = true;\n }\n }\n if (!changed) {\n return null;\n }\n return {code: ms.toString(), map: ms.generateMap({hires: true})};\n },\n };\n};\n\n/**\n * Vite plugin set providing HMR, CSS helpers, and Lightning CSS processing\n * for Lit projects.\n */\nexport const litPlugin = (options: LitPluginOptions = {}): Plugin[] => {\n // Resolved from explicit options first, env vars second, defaults last. The\n // `lit-plugin-options` `config` hook below re-resolves with the loaded env\n // once Vite hands us the mode; this initial pass covers code paths that run\n // before (or without) it.\n let resolved: ResolvedOptions = resolveOptions(options, {});\n let root = '';\n // Env resolution lives in its own always-applied plugin: `?css-sheet` is a\n // build-time feature too, and the HMR plugin (`apply: 'serve'`) never gets a\n // `config` hook under `vite build`. `enforce: 'pre'` and first position put\n // it ahead of every other hook that reads `resolved`.\n const optionsPlugin: Plugin = {\n name: 'lit-plugin-options',\n enforce: 'pre',\n config(viteConfig, {mode}) {\n // `loadEnv` reads `.env*` files from the env dir (root by default) and\n // merges in matching `process.env` keys, filtered to the `LIT_PLUGIN`\n // prefix. Explicit options still win (handled in resolveOptions).\n const envDir = viteConfig.envDir\n ? resolvePath(viteConfig.envDir)\n : viteConfig.root\n ? resolvePath(viteConfig.root)\n : process.cwd();\n resolved = resolveOptions(options, loadEnv(mode, envDir, ENV_PREFIX));\n },\n };\n const sourceOverlayPlugin: Plugin = {\n name: 'lit-source-overlay',\n apply: 'serve',\n // Run before Vite's esbuild TS transform so source-meta line numbers are\n // measured against the author's raw source (and the `@customElement … class`\n // forms are still intact), not against transpiled output.\n enforce: 'pre',\n configResolved(config) {\n root = config.root;\n },\n resolveId(id) {\n if (id === '@lit-labs/vite-plugin-lit/source-overlay.js') {\n return resolveRuntimeModule('source-overlay');\n }\n return null;\n },\n configureServer(server) {\n if (!resolved.sourceOverlay) return;\n server.middlewares.use(\n OPEN_IN_EDITOR_PATH,\n createOpenInEditorMiddleware(root)\n );\n },\n transform(code, id, transformOptions) {\n if (!resolved.sourceOverlay) return null;\n if (transformOptions?.ssr) return null;\n if (\n id.startsWith('\\0') ||\n id.includes('__x00__') ||\n id.includes('lit-plugin:') ||\n id.includes('/node_modules/')\n ) {\n return null;\n }\n const [file] = id.split('?', 2);\n if (!JS_FILE_RE.test(file) && !id.includes('?html-proxy')) {\n return null;\n }\n if (!code.includes('customElement') && !code.includes('customElements')) {\n return null;\n }\n const ms = new MagicString(code);\n const relativeFile = file.startsWith(root + '/')\n ? file.slice(root.length + 1)\n : file;\n if (!injectSourceMeta(code, relativeFile, ms)) {\n return null;\n }\n return {code: ms.toString(), map: ms.generateMap({hires: true})};\n },\n transformIndexHtml() {\n if (!resolved.sourceOverlay) return;\n const overlayUrl = `/@fs/${resolveRuntimeModule('source-overlay')}`;\n const {\n exclude: _exclude,\n onSelect: _onSelect,\n ...overlayInit\n } = resolved.sourceOverlay;\n const initConfig = {\n ...overlayInit,\n openInEditorPath: OPEN_IN_EDITOR_PATH,\n };\n return [\n {\n tag: 'script',\n attrs: {type: 'module'},\n children: `import {initSourceOverlay} from ${JSON.stringify(overlayUrl)};\\ninitSourceOverlay(${JSON.stringify(initConfig)});\\n`,\n injectTo: 'body',\n },\n ];\n },\n };\n const hmr: Plugin = {\n name: 'lit-plugin',\n apply: 'serve',\n config: () => {\n // Options are already resolved against the loaded env by\n // `lit-plugin-options`, which runs first.\n if (!resolved.hmrEnabled) {\n return;\n }\n // The injected runtime imports are invisible to the dep scanner. The\n // lit family stays prebundle-eligible on purpose: the wrapper modules'\n // bare imports then resolve to the same URL every other importer gets —\n // single lit instance, single template cache.\n return {optimizeDeps: {exclude: ['@lit-labs/vite-plugin-lit']}};\n },\n resolveId(id) {\n // Public timeline API virtual module.\n if (id === 'virtual:lit-plugin/timeline') {\n return '\\0virtual:lit-plugin/timeline';\n }\n // Resolve the browser CSS helpers and indicator runtime to the copy\n // shipped next to this plugin, so they work even when the package\n // isn't reachable through node resolution from the served root (and\n // stay out of prebundling).\n if (id === '@lit-labs/vite-plugin-lit/css.js') {\n return resolveRuntimeModule('css');\n }\n if (id === '@lit-labs/vite-plugin-lit/indicator.js') {\n return resolveRuntimeModule('indicator');\n }\n if (id === '@lit-labs/vite-plugin-lit/source-overlay.js') {\n return resolveRuntimeModule('source-overlay');\n }\n if (resolved.hmrEnabled && id.startsWith(VIRTUAL_PREFIX)) {\n return id;\n }\n return null;\n },\n load(id) {\n // Public timeline API — re-export the runtime module when timeline is\n // enabled, otherwise a no-op stub so imports don't throw in prod builds.\n if (id === '\\0virtual:lit-plugin/timeline') {\n if (!resolved.timeline) {\n return {\n code:\n 'export const addTimelineEvent = () => {};\\n' +\n 'export const addTimelineLayer = () => {};\\n',\n moduleType: 'js',\n };\n }\n const apiPath = resolveRuntimeModule('timeline/public-api');\n return {\n code: `export * from ${JSON.stringify(apiPath)};\\n`,\n moduleType: 'js',\n };\n }\n if (!resolved.hmrEnabled || !id.startsWith(VIRTUAL_PREFIX)) {\n return null;\n }\n if (id === INSTALL_ID) {\n const patchPath = resolveRuntimeModule('patch');\n const runtimeOptions = {\n reconnect: resolved.reconnect,\n onIncompatible: resolved.onIncompatible,\n };\n return {\n code:\n `import {install} from ${JSON.stringify(patchPath)};\\n` +\n `install(${JSON.stringify(runtimeOptions)});\\n`,\n moduleType: 'js',\n };\n }\n const spec = id.slice(VIRTUAL_PREFIX.length);\n const wrappedTags = WRAP_TABLE.get(spec);\n if (wrappedTags === undefined) {\n return null;\n }\n const internPath = resolveRuntimeModule('intern');\n // Browser-native ESM: explicit local exports shadow `export *` names\n // (spec-guaranteed), so everything except the wrapped tags passes\n // through unchanged.\n const lines = [\n `import * as __lit from ${JSON.stringify(spec)};`,\n `import {wrapTag} from ${JSON.stringify(internPath)};`,\n `export * from ${JSON.stringify(spec)};`,\n ];\n for (const {exportName, ns} of wrappedTags) {\n lines.push(\n `export const ${exportName} = wrapTag(__lit.${exportName}, ${JSON.stringify(\n ns\n )});`\n );\n }\n return {code: lines.join('\\n') + '\\n', moduleType: 'js'};\n },\n async transform(code, id, transformOptions) {\n if (!resolved.hmrEnabled) {\n return null;\n }\n if (transformOptions?.ssr) {\n return null;\n }\n if (id.startsWith('\\0') || id.includes('/node_modules/')) {\n return null;\n }\n const [file] = id.split('?', 2);\n // Allow inline scripts extracted from HTML (`?html-proxy`).\n if (!JS_FILE_RE.test(file) && !id.includes('?html-proxy')) {\n return null;\n }\n return transformLitModule(code);\n },\n transformIndexHtml() {\n const tags: {\n tag: string;\n attrs?: Record<string, string | undefined | boolean>;\n children?: string;\n injectTo: 'body';\n }[] = [];\n\n const indicator = resolved.indicator;\n if (indicator) {\n const indicatorUrl = `/@fs/` + resolveRuntimeModule('indicator');\n tags.push(\n {\n tag: 'script',\n attrs: {type: 'module', src: indicatorUrl},\n injectTo: 'body',\n },\n {\n tag: 'lit-devtools-hmr-indicator',\n attrs: indicator.count ? {count: ''} : undefined,\n children: '',\n injectTo: 'body',\n }\n );\n }\n\n if (resolved.timeline) {\n const installUrl = `/@fs/` + resolveRuntimeModule('timeline/install');\n tags.push({\n tag: 'script',\n attrs: {type: 'module', src: installUrl},\n injectTo: 'body',\n });\n // Components inspector runtime — answers the panel's tree/details\n // requests. Paired with the timeline panel, which hosts its tab.\n const inspectorUrl =\n `/@fs/` + resolveRuntimeModule('inspector/install');\n tags.push({\n tag: 'script',\n attrs: {type: 'module', src: inspectorUrl},\n injectTo: 'body',\n });\n }\n\n return tags.length > 0 ? tags : undefined;\n },\n };\n // The source-overlay plugin is always present; its hooks no-op when the\n // feature is disabled (which env may decide), so inclusion can't be gated\n // on the synchronously-known options here.\n const plugins: Plugin[] = [\n optionsPlugin,\n // Getter, not a snapshot: `resolved` is re-resolved against the loaded env\n // in `optionsPlugin`'s `config` hook, which runs after this array is built.\n litCssQueries(() => resolved.cssSheetBuild),\n litCssLiterals(),\n sourceOverlayPlugin,\n hmr,\n ];\n if (resolved.timeline) {\n // Pass a getter, not a snapshot: `resolved` is re-resolved against the\n // loaded env in the `config` hook, which runs after this plugin array is\n // built. The settings endpoint reads it per-request, by which point env is\n // applied.\n plugins.push(litTimelinePlugin(() => toFeatureSettings(resolved)));\n }\n return plugins;\n};\n"]}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Browser helpers for referencing CSS files from shadow roots via Vite's
|
|
8
|
+
* `?url` imports.
|
|
9
|
+
*
|
|
10
|
+
* A `?url` import yields a real stylesheet URL — the dev server serves the
|
|
11
|
+
* file as CSS, and `vite build` emits it as a hashed `.css` asset. That
|
|
12
|
+
* makes it the right base for `<link>` hrefs and `@import url()`s inside
|
|
13
|
+
* shadow roots. The one gap is dev HMR: the imported URL string is identical
|
|
14
|
+
* across module re-executions, so the browser would keep the stale
|
|
15
|
+
* stylesheet. These helpers close that gap.
|
|
16
|
+
*
|
|
17
|
+
* This module is dependency-free and must stay safe to load in any
|
|
18
|
+
* environment.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* Appends a cache-busting query to a `?url`-imported CSS file URL in dev.
|
|
22
|
+
*
|
|
23
|
+
* Call this at *module scope* (not in `render()`, where every render would
|
|
24
|
+
* refetch): each HMR re-execution then yields a fresh href and the browser
|
|
25
|
+
* refetches the changed stylesheet.
|
|
26
|
+
*
|
|
27
|
+
* In production builds the URL is a content-hashed asset, so the input is
|
|
28
|
+
* returned unchanged.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* import cssUrl from './my-element.css?url';
|
|
33
|
+
* import {devCacheBust} from '@lit-labs/vite-plugin-lit/css.js';
|
|
34
|
+
*
|
|
35
|
+
* const href = devCacheBust(cssUrl); // module scope
|
|
36
|
+
* html`<link rel="stylesheet" href="${href}" />`;
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare const devCacheBust: (url: string) => string;
|
|
40
|
+
/**
|
|
41
|
+
* A shared `CSSStyleSheet` backed by a `?url` CSS asset, plus the callback to
|
|
42
|
+
* hot-swap it in place. Returned by {@link urlSheet}.
|
|
43
|
+
*/
|
|
44
|
+
export interface UrlSheet {
|
|
45
|
+
/**
|
|
46
|
+
* The constructed stylesheet. Adopt it from any number of components
|
|
47
|
+
* (`static styles = [sheet]`); an edit to the source CSS re-fetches and
|
|
48
|
+
* `replaceSync()`s it, updating every shadow root that adopted it without
|
|
49
|
+
* re-rendering a component or reloading the page.
|
|
50
|
+
*
|
|
51
|
+
* It is empty until the first fetch resolves, so expect a brief flash of
|
|
52
|
+
* unstyled content on initial load — the cost of keeping the CSS as a real
|
|
53
|
+
* asset rather than inlining it into the JS bundle.
|
|
54
|
+
*/
|
|
55
|
+
sheet: CSSStyleSheet;
|
|
56
|
+
/**
|
|
57
|
+
* Vite HMR accept callback for the `?url` dependency. Wire it up with the
|
|
58
|
+
* *same literal specifier* you imported — Vite resolves accepted deps by
|
|
59
|
+
* static analysis, so the string has to appear in your module:
|
|
60
|
+
*
|
|
61
|
+
* ```ts
|
|
62
|
+
* import.meta.hot?.accept('./utils.css?url', onHotUpdate);
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
* Typed to match Vite's accept callback (`ModuleNamespace | undefined`) so
|
|
66
|
+
* it drops straight in; the new module's `default` export is the updated
|
|
67
|
+
* `?url` string.
|
|
68
|
+
*/
|
|
69
|
+
onHotUpdate: (mod: Record<string, unknown> | undefined) => void;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Builds a {@link UrlSheet} from a `?url`-imported CSS asset: a single
|
|
73
|
+
* constructed `CSSStyleSheet`, shareable across shadow roots via
|
|
74
|
+
* `adoptedStyleSheets`, that hot-swaps in place on edits — no component
|
|
75
|
+
* re-render, no full-page reload.
|
|
76
|
+
*
|
|
77
|
+
* `?url` keeps the stylesheet as a standalone, pipeline-processed `.css` file
|
|
78
|
+
* in the build output (unlike `?inline`/`?raw`, which inline it into the JS
|
|
79
|
+
* chunk). The file is read into the sheet at runtime via `fetch()`, with the
|
|
80
|
+
* dev/build path difference handled internally.
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```ts
|
|
84
|
+
* import {urlSheet} from '@lit-labs/vite-plugin-lit/css.js';
|
|
85
|
+
* import sheetUrl from './utils.css?url';
|
|
86
|
+
*
|
|
87
|
+
* const {sheet, onHotUpdate} = urlSheet(sheetUrl);
|
|
88
|
+
* export default sheet; // `static styles = [sheet]` in components
|
|
89
|
+
*
|
|
90
|
+
* import.meta.hot?.accept('./utils.css?url', onHotUpdate);
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
export declare const urlSheet: (url: string) => UrlSheet;
|
|
94
|
+
//# sourceMappingURL=css.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"css.d.ts","sourceRoot":"","sources":["../../../../packages/labs/vite-plugin-lit/src/lib/runtime/css.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,KAAG,MAG1C,CAAC;AAsBF;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB;;;;;;;;;OASG;IACH,KAAK,EAAE,aAAa,CAAC;IACrB;;;;;;;;;;;;OAYG;IACH,WAAW,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,KAAK,IAAI,CAAC;CACjE;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,QAAQ,GAAI,KAAK,MAAM,KAAG,QA2BtC,CAAC"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Browser helpers for referencing CSS files from shadow roots via Vite's
|
|
8
|
+
* `?url` imports.
|
|
9
|
+
*
|
|
10
|
+
* A `?url` import yields a real stylesheet URL — the dev server serves the
|
|
11
|
+
* file as CSS, and `vite build` emits it as a hashed `.css` asset. That
|
|
12
|
+
* makes it the right base for `<link>` hrefs and `@import url()`s inside
|
|
13
|
+
* shadow roots. The one gap is dev HMR: the imported URL string is identical
|
|
14
|
+
* across module re-executions, so the browser would keep the stale
|
|
15
|
+
* stylesheet. These helpers close that gap.
|
|
16
|
+
*
|
|
17
|
+
* This module is dependency-free and must stay safe to load in any
|
|
18
|
+
* environment.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* Appends a cache-busting query to a `?url`-imported CSS file URL in dev.
|
|
22
|
+
*
|
|
23
|
+
* Call this at *module scope* (not in `render()`, where every render would
|
|
24
|
+
* refetch): each HMR re-execution then yields a fresh href and the browser
|
|
25
|
+
* refetches the changed stylesheet.
|
|
26
|
+
*
|
|
27
|
+
* In production builds the URL is a content-hashed asset, so the input is
|
|
28
|
+
* returned unchanged.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* import cssUrl from './my-element.css?url';
|
|
33
|
+
* import {devCacheBust} from '@lit-labs/vite-plugin-lit/css.js';
|
|
34
|
+
*
|
|
35
|
+
* const href = devCacheBust(cssUrl); // module scope
|
|
36
|
+
* html`<link rel="stylesheet" href="${href}" />`;
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export const devCacheBust = (url) => {
|
|
40
|
+
const env = import.meta.env;
|
|
41
|
+
return env?.DEV ? `${url}?t=${Date.now()}` : url;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* In dev, turns a `?url`-imported CSS path into one that fetches the
|
|
45
|
+
* *compiled CSS bytes* (`text/css`). Vite serves a `?url` CSS path as a JS
|
|
46
|
+
* module (`__vite__updateStyle(…)`), so a plain `fetch().text()` returns
|
|
47
|
+
* JavaScript; the `direct` query makes it return the stylesheet instead,
|
|
48
|
+
* pipeline-processed the same way the build asset is. In production the URL
|
|
49
|
+
* is already a real `.css` asset, so it's returned unchanged.
|
|
50
|
+
*
|
|
51
|
+
* Joined with `?` or `&` depending on whether the URL already carries a query
|
|
52
|
+
* (a freshly started dev server yields a bare path; after an HMR cache-bust
|
|
53
|
+
* it carries `?t=…`).
|
|
54
|
+
*/
|
|
55
|
+
const devDirect = (url) => {
|
|
56
|
+
const env = import.meta.env;
|
|
57
|
+
if (!env?.DEV) {
|
|
58
|
+
return url;
|
|
59
|
+
}
|
|
60
|
+
return `${url}${url.includes('?') ? '&' : '?'}direct`;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Builds a {@link UrlSheet} from a `?url`-imported CSS asset: a single
|
|
64
|
+
* constructed `CSSStyleSheet`, shareable across shadow roots via
|
|
65
|
+
* `adoptedStyleSheets`, that hot-swaps in place on edits — no component
|
|
66
|
+
* re-render, no full-page reload.
|
|
67
|
+
*
|
|
68
|
+
* `?url` keeps the stylesheet as a standalone, pipeline-processed `.css` file
|
|
69
|
+
* in the build output (unlike `?inline`/`?raw`, which inline it into the JS
|
|
70
|
+
* chunk). The file is read into the sheet at runtime via `fetch()`, with the
|
|
71
|
+
* dev/build path difference handled internally.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* import {urlSheet} from '@lit-labs/vite-plugin-lit/css.js';
|
|
76
|
+
* import sheetUrl from './utils.css?url';
|
|
77
|
+
*
|
|
78
|
+
* const {sheet, onHotUpdate} = urlSheet(sheetUrl);
|
|
79
|
+
* export default sheet; // `static styles = [sheet]` in components
|
|
80
|
+
*
|
|
81
|
+
* import.meta.hot?.accept('./utils.css?url', onHotUpdate);
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
export const urlSheet = (url) => {
|
|
85
|
+
const sheet = new CSSStyleSheet();
|
|
86
|
+
// Guards against out-of-order fetch resolution: two rapid edits fire
|
|
87
|
+
// overlapping fetches, and a slower earlier one must not land after (and
|
|
88
|
+
// clobber) a newer one. Only the most recently issued request applies.
|
|
89
|
+
let latest = 0;
|
|
90
|
+
const update = (next) => {
|
|
91
|
+
const token = ++latest;
|
|
92
|
+
return fetch(devDirect(next))
|
|
93
|
+
.then((r) => r.text())
|
|
94
|
+
.then((css) => {
|
|
95
|
+
if (token === latest) {
|
|
96
|
+
sheet.replaceSync(css);
|
|
97
|
+
}
|
|
98
|
+
})
|
|
99
|
+
.catch(() => { });
|
|
100
|
+
};
|
|
101
|
+
update(url);
|
|
102
|
+
return {
|
|
103
|
+
sheet,
|
|
104
|
+
onHotUpdate: (mod) => {
|
|
105
|
+
const next = mod?.['default'];
|
|
106
|
+
if (typeof next === 'string') {
|
|
107
|
+
update(next);
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
//# sourceMappingURL=css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"css.js","sourceRoot":"","sources":["../../../../packages/labs/vite-plugin-lit/src/lib/runtime/css.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;GAaG;AAEH;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AAC;YACzB,CAAC;QACH,CAAC,CAAC;aACD,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IACrB,CAAC,CAAC;IACF,MAAM,CAAC,GAAG,CAAC,CAAC;IACZ,OAAO;QACL,KAAK;QACL,WAAW,EAAE,CAAC,GAAG,EAAE,EAAE;YACnB,MAAM,IAAI,GAAG,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;YAC9B,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;gBAC7B,MAAM,CAAC,IAAI,CAAC,CAAC;YACf,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Browser helpers for referencing CSS files from shadow roots via Vite's\n * `?url` imports.\n *\n * A `?url` import yields a real stylesheet URL — the dev server serves the\n * file as CSS, and `vite build` emits it as a hashed `.css` asset. That\n * makes it the right base for `<link>` hrefs and `@import url()`s inside\n * shadow roots. The one gap is dev HMR: the imported URL string is identical\n * across module re-executions, so the browser would keep the stale\n * stylesheet. These helpers close that gap.\n *\n * This module is dependency-free and must stay safe to load in any\n * environment.\n */\n\n/**\n * Appends a cache-busting query to a `?url`-imported CSS file URL in dev.\n *\n * Call this at *module scope* (not in `render()`, where every render would\n * refetch): each HMR re-execution then yields a fresh href and the browser\n * refetches the changed stylesheet.\n *\n * In production builds the URL is a content-hashed asset, so the input is\n * returned unchanged.\n *\n * @example\n * ```ts\n * import cssUrl from './my-element.css?url';\n * import {devCacheBust} from '@lit-labs/vite-plugin-lit/css.js';\n *\n * const href = devCacheBust(cssUrl); // module scope\n * html`<link rel=\"stylesheet\" href=\"${href}\" />`;\n * ```\n */\nexport const devCacheBust = (url: string): string => {\n const env = (import.meta as {env?: {DEV?: boolean}}).env;\n return env?.DEV ? `${url}?t=${Date.now()}` : url;\n};\n\n/**\n * In dev, turns a `?url`-imported CSS path into one that fetches the\n * *compiled CSS bytes* (`text/css`). Vite serves a `?url` CSS path as a JS\n * module (`__vite__updateStyle(…)`), so a plain `fetch().text()` returns\n * JavaScript; the `direct` query makes it return the stylesheet instead,\n * pipeline-processed the same way the build asset is. In production the URL\n * is already a real `.css` asset, so it's returned unchanged.\n *\n * Joined with `?` or `&` depending on whether the URL already carries a query\n * (a freshly started dev server yields a bare path; after an HMR cache-bust\n * it carries `?t=…`).\n */\nconst devDirect = (url: string): string => {\n const env = (import.meta as {env?: {DEV?: boolean}}).env;\n if (!env?.DEV) {\n return url;\n }\n return `${url}${url.includes('?') ? '&' : '?'}direct`;\n};\n\n/**\n * A shared `CSSStyleSheet` backed by a `?url` CSS asset, plus the callback to\n * hot-swap it in place. Returned by {@link urlSheet}.\n */\nexport interface UrlSheet {\n /**\n * The constructed stylesheet. Adopt it from any number of components\n * (`static styles = [sheet]`); an edit to the source CSS re-fetches and\n * `replaceSync()`s it, updating every shadow root that adopted it without\n * re-rendering a component or reloading the page.\n *\n * It is empty until the first fetch resolves, so expect a brief flash of\n * unstyled content on initial load — the cost of keeping the CSS as a real\n * asset rather than inlining it into the JS bundle.\n */\n sheet: CSSStyleSheet;\n /**\n * Vite HMR accept callback for the `?url` dependency. Wire it up with the\n * *same literal specifier* you imported — Vite resolves accepted deps by\n * static analysis, so the string has to appear in your module:\n *\n * ```ts\n * import.meta.hot?.accept('./utils.css?url', onHotUpdate);\n * ```\n *\n * Typed to match Vite's accept callback (`ModuleNamespace | undefined`) so\n * it drops straight in; the new module's `default` export is the updated\n * `?url` string.\n */\n onHotUpdate: (mod: Record<string, unknown> | undefined) => void;\n}\n\n/**\n * Builds a {@link UrlSheet} from a `?url`-imported CSS asset: a single\n * constructed `CSSStyleSheet`, shareable across shadow roots via\n * `adoptedStyleSheets`, that hot-swaps in place on edits — no component\n * re-render, no full-page reload.\n *\n * `?url` keeps the stylesheet as a standalone, pipeline-processed `.css` file\n * in the build output (unlike `?inline`/`?raw`, which inline it into the JS\n * chunk). The file is read into the sheet at runtime via `fetch()`, with the\n * dev/build path difference handled internally.\n *\n * @example\n * ```ts\n * import {urlSheet} from '@lit-labs/vite-plugin-lit/css.js';\n * import sheetUrl from './utils.css?url';\n *\n * const {sheet, onHotUpdate} = urlSheet(sheetUrl);\n * export default sheet; // `static styles = [sheet]` in components\n *\n * import.meta.hot?.accept('./utils.css?url', onHotUpdate);\n * ```\n */\nexport const urlSheet = (url: string): UrlSheet => {\n const sheet = new CSSStyleSheet();\n // Guards against out-of-order fetch resolution: two rapid edits fire\n // overlapping fetches, and a slower earlier one must not land after (and\n // clobber) a newer one. Only the most recently issued request applies.\n let latest = 0;\n const update = (next: string): Promise<void> => {\n const token = ++latest;\n return fetch(devDirect(next))\n .then((r) => r.text())\n .then((css) => {\n if (token === latest) {\n sheet.replaceSync(css);\n }\n })\n .catch(() => {});\n };\n update(url);\n return {\n sheet,\n onHotUpdate: (mod) => {\n const next = mod?.['default'];\n if (typeof next === 'string') {\n update(next);\n }\n },\n };\n};\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/
|
|
6
|
+
export interface EdgeInsets {
|
|
7
|
+
top: number;
|
|
8
|
+
right: number;
|
|
9
|
+
bottom: number;
|
|
10
|
+
left: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Calls `onChange` with the current insets and again whenever they change — the
|
|
14
|
+
* panel being docked/resized/moved, the window resizing, or the devtools
|
|
15
|
+
* mounting after us. Returns a disposer.
|
|
16
|
+
*/
|
|
17
|
+
export declare const observeEdgeInsets: (onChange: (insets: EdgeInsets) => void) => (() => void);
|
|
18
|
+
//# sourceMappingURL=edge-panel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edge-panel.d.ts","sourceRoot":"","sources":["../../../../packages/labs/vite-plugin-lit/src/lib/runtime/edge-panel.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAoBH,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAyCD;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAC5B,UAAU,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,KACrC,CAAC,MAAM,IAAI,CA+Db,CAAC"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Keeps our on-page dev UI (HMR indicator, source-overlay tooltip) clear of the
|
|
8
|
+
* Vite DevTools edge panel so they don't sit on top of it.
|
|
9
|
+
*
|
|
10
|
+
* The panel is `#vite-devtools-edge-panel` inside the open shadow root of the
|
|
11
|
+
* `<vite-devtools-dock-embedded>` host, and only exists while the dock is
|
|
12
|
+
* docked to an edge (it can be moved/resized). We report the inset, in px, that
|
|
13
|
+
* the panel occupies on each viewport edge it touches — plus a small gap — so
|
|
14
|
+
* callers can offset themselves.
|
|
15
|
+
*/
|
|
16
|
+
const HOST_TAG = 'vite-devtools-dock-embedded';
|
|
17
|
+
const PANEL_ID = 'vite-devtools-edge-panel';
|
|
18
|
+
/** Gap to leave between our UI and the devtools panel. */
|
|
19
|
+
const GAP = 12;
|
|
20
|
+
/** Tolerance (px) for treating the panel as touching a viewport edge. */
|
|
21
|
+
const EDGE = 2;
|
|
22
|
+
const ZERO = { top: 0, right: 0, bottom: 0, left: 0 };
|
|
23
|
+
const findPanel = () => {
|
|
24
|
+
const host = document.querySelector(HOST_TAG);
|
|
25
|
+
const root = host?.shadowRoot;
|
|
26
|
+
return root?.getElementById(PANEL_ID) ?? null;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Inset (px + gap) the docked panel occupies, on the single edge it's docked
|
|
30
|
+
* to. The panel docks to one edge and spans the perpendicular axis fully, so we
|
|
31
|
+
* pick the dock edge from which axis it spans — a full-width panel is docked
|
|
32
|
+
* top/bottom, a full-height one left/right. (Inferring the edge per-side would
|
|
33
|
+
* wrongly flag a full-width bottom panel as also docked left and right.)
|
|
34
|
+
*/
|
|
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;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Calls `onChange` with the current insets and again whenever they change — the
|
|
67
|
+
* panel being docked/resized/moved, the window resizing, or the devtools
|
|
68
|
+
* mounting after us. Returns a disposer.
|
|
69
|
+
*/
|
|
70
|
+
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
|
+
};
|
|
129
|
+
};
|
|
130
|
+
//# sourceMappingURL=edge-panel.js.map
|
|
@@ -0,0 +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;IAC3E,OAAQ,IAAI,EAAE,cAAc,CAAC,QAAQ,CAAwB,IAAI,IAAI,CAAC;AACxE,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,aAAa,GAAG,GAAe,EAAE;IACrC,MAAM,KAAK,GAAG,SAAS,EAAE,CAAC;IAC1B,IAAI,KAAK,KAAK,IAAI;QAAE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AI,EAAE;gBACf,SAAS,EAAE,IAAI;gBACf,OAAO,EAAE,IAAI;gBACb,UAAU,EAAE,IAAI;gBAChB,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC;aACpC,CAAC,CAAC;QACL,CAAC;QACD,MAAM,KAAK,GAAG,SAAS,EAAE,CAAC;QAC1B,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,aAAa,EAAE,CAAC;YAC9C,aAAa,GAAG,KAAK,CAAC;YACtB,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC;QACD,QAAQ,EAAE,CAAC;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"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Default monospace font stack for the devtools UI (HMR indicator, source
|
|
8
|
+
* overlay). Surfaced through the `--lit-devtools-font-mono` custom property so
|
|
9
|
+
* consumers can override it; this constant is the fallback default, mirroring
|
|
10
|
+
* the `--lit-devtools-radius` convention.
|
|
11
|
+
*
|
|
12
|
+
* The devtools only render code-adjacent text, so monospace is the only stack
|
|
13
|
+
* they need.
|
|
14
|
+
*/
|
|
15
|
+
export declare const LIT_DEVTOOLS_FONT_MONO = "ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace";
|
|
16
|
+
/** `var()` reference to the devtools mono font with the default stack inlined. */
|
|
17
|
+
export declare const FONT_MONO_VAR = "var(--lit-devtools-font-mono, ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace)";
|
|
18
|
+
//# sourceMappingURL=fonts.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Default monospace font stack for the devtools UI (HMR indicator, source
|
|
8
|
+
* overlay). Surfaced through the `--lit-devtools-font-mono` custom property so
|
|
9
|
+
* consumers can override it; this constant is the fallback default, mirroring
|
|
10
|
+
* the `--lit-devtools-radius` convention.
|
|
11
|
+
*
|
|
12
|
+
* The devtools only render code-adjacent text, so monospace is the only stack
|
|
13
|
+
* they need.
|
|
14
|
+
*/
|
|
15
|
+
export const LIT_DEVTOOLS_FONT_MONO = `ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace`;
|
|
16
|
+
/** `var()` reference to the devtools mono font with the default stack inlined. */
|
|
17
|
+
export const FONT_MONO_VAR = `var(--lit-devtools-font-mono, ${LIT_DEVTOOLS_FONT_MONO})`;
|
|
18
|
+
//# sourceMappingURL=fonts.js.map
|
|
@@ -0,0 +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"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"indicator.d.ts","sourceRoot":"","sources":["../../../../packages/labs/vite-plugin-lit/src/lib/runtime/indicator.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|