@keenmate/web-components-devkit 1.0.0-rc01 → 1.0.0-rc03

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/CHANGELOG.md +114 -0
  2. package/README.md +70 -12
  3. package/components.json +206 -189
  4. package/package.json +4 -1
  5. package/src/cli/commands/doctor.js +1 -0
  6. package/src/cli/commands/new.js +29 -8
  7. package/src/cli/kmwc.js +1 -0
  8. package/src/config.d.ts +5 -0
  9. package/src/config.js +26 -3
  10. package/src/examples/chapter-links.js +35 -0
  11. package/src/examples/chapter-search.js +84 -0
  12. package/src/examples/constants.js +51 -0
  13. package/src/examples/css/content.css +4 -34
  14. package/src/examples/css/controls.css +30 -25
  15. package/src/examples/css/copy-link.css +1 -0
  16. package/src/examples/css/demo.css +2 -0
  17. package/src/examples/css/form-controls.css +285 -0
  18. package/src/examples/css/index-page.css +1 -1
  19. package/src/examples/css/spotlight.css +417 -0
  20. package/src/examples/css/style.css +3 -0
  21. package/src/examples/css/tables.css +141 -0
  22. package/src/examples/css/tokens.css +69 -27
  23. package/src/examples/index.d.ts +38 -0
  24. package/src/examples/index.js +6 -3
  25. package/src/examples/kit.js +11 -4
  26. package/src/examples/page-config.js +1 -0
  27. package/src/examples/sections.js +38 -1
  28. package/src/examples/spotlight.js +473 -0
  29. package/src/vite/chapter-index.js +107 -0
  30. package/src/vite/index.js +19 -1
  31. package/src/vite/page-composer.js +17 -10
  32. package/templates/claude-block.md +9 -2
  33. package/templates/new/component-variables.manifest.json +3 -3
  34. package/templates/new/docs/examples.md +1 -1
  35. package/templates/new/docs/theming.md +1 -1
  36. package/templates/new/e2e/dark-mode.spec.ts +3 -3
  37. package/templates/new/examples-theming.html +3 -3
  38. package/templates/new/src/css/base.css +5 -3
  39. package/templates/new/src/css/variables.css +10 -8
  40. package/templates/new-minimal/src/css/base.css +5 -3
  41. package/templates/new-minimal/src/css/variables.css +7 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,119 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.0.0-rc03] - 2026-11-01 [PUBLISHED]
4
+
5
+ ### Fixed
6
+
7
+ - **Example pages no longer widen the page on a phone** — on screens ≤ 768 px a
8
+ `.reference-table` scrolls inside its card, a long `.controls` label (or `<code>` in it)
9
+ wraps and a `.controls` select is capped at the row, instead of overflowing. Besides the sideways scroll, an over-wide page made mobile
10
+ browsers grow the layout viewport (a 390 px phone reporting ~600 px), so pages that
11
+ demo device / breakpoint detection showed the wrong class.
12
+ - **The scaffold's component CSS no longer sets `box-sizing` on the host page** — the
13
+ `*, *::before, *::after { box-sizing: inherit }` reset in `templates/new/src/css/base.css`
14
+ (also in the `--minimal` scaffold and the playground) reached the page through the light-DOM stylesheet, in a layer that beats
15
+ `@layer kmwc`, so every page control rendered content-box (the spotlight input overflowed, a
16
+ 36 px input came out 38 px). It is scoped to `:host *` now; components scaffolded with an
17
+ earlier devkit should make the same one-line change. A unit test now rejects any universal or
18
+ bare-element selector in the scaffold CSS.
19
+
20
+ ### Added
21
+
22
+ - **Form controls: one look for native inputs on every example page** — text fields, selects
23
+ and list boxes, textareas, checkboxes (incl. indeterminate), radios, switches
24
+ (`<input type="checkbox" role="switch">`), ranges, colour and file inputs and fieldsets are
25
+ styled without a class, modelled on pure-admin's forms: inputs, selects and buttons share
26
+ `--kmwc-control-height`, so a row of them lines up in any container (not only `.controls`);
27
+ the focus border and halo, placeholder, disabled tone, the checkbox size and the
28
+ `--base-icon-check` / `-indeterminate` tick read the `--base-*` contract. Rules are
29
+ zero-specificity (`:where()`); `kmwc-native` on an element or an ancestor keeps the
30
+ browser's own controls. Outline buttons are as tall as filled ones now (transparent border).
31
+ The playground's new `examples-forms.html` shows them all.
32
+ - **Tables: every `<table>` on an example page is styled** — a header fill, row lines, hover
33
+ tint, caption and footer, as pure-admin's `.pa-table`. `.reference-table` looks as before;
34
+ new modifiers combine with it or a bare table: `.table-full`, `.table-bordered`,
35
+ `.table-striped`, `.table-compact` (tighter cells, and the inputs / selects / buttons in it
36
+ shrink with them via `--kmwc-control-height`), plus `tr.is-highlight` on any table and a
37
+ `.num` cell (right-aligned, tabular figures). Every table, not only `.reference-table`,
38
+ scrolls inside its card on a phone. Pages no longer need their own table CSS with fixed light
39
+ colours (core's `.rs-table`, which breaks in dark mode). New playground page
40
+ `examples-tables.html`.
41
+ - **Spotlight: Ctrl/⌘+K chapter search across every example page** — matches a chapter whose
42
+ section code or heading text contains the query (`th7` finds `TH07`; uncoded `Summary` /
43
+ reference sections by title), grouped by page with the current page first; Enter jumps,
44
+ Ctrl/⌘+Enter opens a new tab. The Vite plugin builds the index (`virtual:kmwc-chapters`)
45
+ from every page's `<h2>`s; `kmwc.examples.isSpotlightEnabled: false` turns it off. It mirrors
46
+ web-commandpalette's markup, matching, keyboard map, open/close and CSS without depending on
47
+ it — `npm run check:spotlight-mirror` lists what changed there since the last alignment.
48
+ New page tokens `--kmwc-overlay-bg` and `--kmwc-focused-bg` / `-text-color` / `-outline`
49
+ read the same `--base-*` hooks as wcp, so both look alike under a theme.
50
+ - **Short chapter links** — `#th07`, `#th7` or the slug of an uncoded heading scroll to that
51
+ chapter on arrival.
52
+ - **`make dev` (and `kill-port`, `build-examples`, `preview-examples`) at the repo root** — the
53
+ standard targets, run against the playground; `make playground` is gone.
54
+ - **`kmwc doctor` runs the rulebook's new `example-pages` suite** — every example `<h2>`
55
+ carries a permanent section code (`TH07 · Title`), a prefix belongs to one page, no code
56
+ is used twice. The generated CLAUDE.md block points at the rule. The convention was
57
+ already in the scaffold and the playground but written down nowhere, so sessions
58
+ building new pages didn't know it.
59
+
60
+ ### Known issues
61
+
62
+ - **Opening the spotlight shifts the page sideways** on systems with classic scrollbars: the
63
+ mirrored core `lockBodyScroll()` only sets `overflow: hidden`, so the scrollbar disappears
64
+ (wcp has the same jump). pure-admin / pure-css avoid it with a `position: fixed` lock and
65
+ width compensation; the proposal to bring that into core is in web-commandpalette's CLAUDE.md.
66
+
67
+ ## [1.0.0-rc02] - 2026-10-31 [PUBLISHED]
68
+
69
+ ### Added
70
+
71
+ - **`kmwc new --adopt`** for migrating a component that is already in the registry:
72
+ the same scaffold, with the entry's port block and prefix (or `--prefix` when the
73
+ entry has none), no npm-name check (the package may exist) and no registry edit.
74
+ Scaffold into a scratch `--dir`, then move the component's code into it — how
75
+ web-editor's one-package monorepo was flattened.
76
+
77
+ - **`npm run check:contract`** — `base-contract-check` (from `@keenmate/base-css-variables`,
78
+ a devDependency) over the kit, the scaffold templates and the playground: every `--base-*`
79
+ read or set exists in the contract, input fallbacks equal its defaults, derived ones are its
80
+ formulas. Deliberate differences go in `contract-check.json` (the scaffolds' `inherit` font).
81
+
82
+ ### Fixed
83
+
84
+ - **Kit and scaffolds read the 2.0 `--base-*` names.** `--base-accent-color*`,
85
+ `--base-text-color-on-accent` and `--base-input-color` were removed in base-css-variables
86
+ 2.0.0, so a theme's primary never reached the example pages or a new component. Now
87
+ `--base-primary-color` / `-hover` / `-active`, `--base-primary-bg-subtle(-hover)`,
88
+ `--base-on-primary-text-color` and `--base-input-text-color`; the theming pages and docs set
89
+ `--base-primary-color`. Fallbacks are the contract's: example pages default to the blue-500
90
+ primary (was purple `#667eea`; the header gradient end now follows the accent), slate surfaces
91
+ (dark main `#1e293b`, page `#f8f9fa` / `#0f172a`) and the contract text, border, hover, shadow
92
+ and font values. The kit's status colours read `--base-<role>-text-color`; the danger button
93
+ fills with `--base-danger-color` and its text is `--base-on-danger-text-color`. The secondary
94
+ button and the index "new" badge compute their text from their own fill, so a light primary
95
+ no longer turns them black.
96
+ - **`kmwc doctor` skipped every rulebook suite once the devkit came from npm.** The
97
+ rulebook was looked up at a fixed path from the devkit (`<devkit>/../../BlissFramework`),
98
+ which lands inside `node_modules` for an installed package. It is now the nearest
99
+ `BlissFramework/guidelines/web-components` above the component (then above the
100
+ devkit); `kmwc.rulebook.path` resolves against the component root.
101
+ - **Fragment pages: a `<style>` or `<link>` inside a `<script>` stays put.** Shadow-DOM
102
+ styles and an SVG's own `<style>` written into a script were moved into `<head>`; they
103
+ are strings there, not page elements.
104
+
105
+ ### Migrated
106
+
107
+ - **web-editor** — flattened from a one-package npm-workspaces monorepo; registry entry
108
+ now carries its prefix (`km`) and no longer says monorepo.
109
+ - **pure-css** (library, 15200) and **base-css-variables** (library, 15300) added to the
110
+ registry.
111
+
112
+ ### Internal
113
+
114
+ - **Root `Makefile`** for the devkit's own tasks: test, readme / contract checks, and
115
+ `publish` / `publish-rc` gated on `kmwc check-release`.
116
+
3
117
  ## [1.0.0-rc01] - 2026-10-12 [PUBLISHED]
4
118
 
5
119
  First release of `@keenmate/web-components-devkit`, plus the component catalogue.
package/README.md CHANGED
@@ -19,15 +19,21 @@ them in the same shape: `@keenmate/web-components-devkit`.
19
19
  > positioning) lives in [`@keenmate/web-components-core`](../web-components-core).
20
20
  > Nothing here ships inside a component's bundle.
21
21
 
22
- ## What's New in v1.0.0-rc01
22
+ ## What's New in v1.0.0-rc03
23
23
 
24
- - **Devkit — one shared toolchain for every Keenmate web component** — Each `web-*` repo used to carry its own copy of the example helpers, the shared stylesheet, the Vite/Playwright configs and the deploy files, and every session "fixed" its own copy until they drifted apart. `@keenmate/web-components-devkit` owns all of it now: a component describes itself once in `package.json#kmwc` (title, prefix, ports, accent colours, analytics, image) and `defineComponentConfig()`, `definePlaywrightConfig()` and the `kmwc` CLI read it from there. A shared concern is fixed once in the devkit and every component picks it up on the next install.
25
- - **Vite preset — dev, library and examples-site builds from one config** — `defineComponentConfig()` (Vite 7) runs the dev server on the repo's registry port with `strictPort`, builds the library (`es` + `umd`, `style.css` kept under its historical name, rolled-up `.d.ts`) and, with `--mode examples`, builds every root `*.html` into a static multi-page site in `dist-examples/` with relative asset URLs. The examples plugin injects the kit into each page and loads its stylesheet render-blocking, so pages don't flash unstyled on reload.
26
- - **Examples kit — one design system and set of page helpers instead of six forks** — The `@layer kmwc` stylesheet merges six diverged `examples-shared.css` copies; its `--kmwc-*` tokens read the rulebook's `--base-*` taxonomy with `light-dark()` fallbacks, so a theme-designer theme restyles the demo page together with the component. Every page gets a light / dark / auto theme switch (it sets `data-theme` on `<html>`, the signal components react to), a chapter nav and copy-link buttons that share one slug algorithm, a version badge with the build stamp, and build-only Plausible. `attachControlsPersistence()` and `renderExamplesIndex()` replace the per-repo controls store and the 150-line inline index page.
27
- - **Fragment pages — no more copied page boilerplate** — A page without `<html>` is a fragment: `<meta name="kmwc:title">` and friends drive the shared layout (head, entry script, header with back link, container), `<kmwc-include>` pulls parameterised partials (nesting, cycle detection), and `<kmwc-demo>` renders live markup plus a code block of exactly that markup, so a snippet can no longer drift from its demo. Full documents pass through untouched, so pages migrate one at a time.
28
- - **`kmwc` CLI — generate, check and gate instead of hand-edit** — `kmwc sync` writes the Dockerfile, nginx.conf, Makefile (repo targets in `Makefile.local`), .dockerignore and a managed CLAUDE.md block from templates. `kmwc doctor` runs the devkit checks, an `npm pack` contents check (no CLAUDE.md, tests or example pages in the package) and every BlissFramework rulebook `*.checks.sh` suite. `kmwc check-vars` replaces three diverged manifest scripts (declared or consumed mode), and `kmwc check-release` gates `make publish*` on the dist-tag ⇔ version rule.
29
- - **`kmwc new` — a rulebook-shaped component on the first commit** — The scaffold runs the rulebook intake (npm name free, CSS prefix 2–4 letters and not reserved, next free port block) and generates the Element / Logic / types / logger layers, the canonical eight-file CSS set with Strategy-B dark mode, a Custom Elements Manifest, README + `docs/`, CHANGELOG, `/publish`, fragment example pages and smoke + dark-mode e2e specs. It passes every rulebook suite as generated; `--minimal` gives an empty skeleton instead of the sample toggle.
30
- - **Catalogue and port registry — every component listed, no port collisions** — `components.json` registers every Keenmate repo with its CSS prefix and a 100-port block (dev = block, preview = +1, image = +10), numbered inside a range per kind (components 12100–14900, libraries 15000–, showcases 16000–, tests 17000–), so any number of repos run side by side. The README catalogue is generated from it, with a ✅ for each repo on the devkit; web-commandpalette is the first.
24
+ - **Spotlight — Ctrl/⌘+K chapter search across every example page** — Example sites grew to dozens of chapters over several pages, and the per-page chapter nav only knew its own page. The Vite plugin now builds an index of every page's `<h2>`s (`virtual:kmwc-chapters`), coded and uncoded, and Ctrl/⌘+K opens a search that matches the section code or the heading text (`th7` finds `TH07`), grouped by page with the current one first. Enter jumps, Ctrl/⌘+Enter opens a new tab. It mirrors web-commandpalette's markup, matching, keyboard map and CSS without depending on it; `npm run check:spotlight-mirror` lists what changed there since the last alignment. Turn it off with `kmwc.examples.isSpotlightEnabled: false`.
25
+ - **Form controls — one look for native inputs on every example page** — Pages styled their own selects and inputs, or got the browser default, so a select next to the kit's buttons came out shorter and in the platform's style (a `.controls` row was the only place the kit reached). Text fields, selects and list boxes, textareas, checkboxes, radios, `role="switch"` switches, ranges, colour and file inputs are now styled with no class, modelled on pure-admin's forms. Inputs, selects and buttons share `--kmwc-control-height`, so a mixed row lines up in any container. Focus, placeholder, disabled tone, checkbox size and the tick read the `--base-*` contract. The rules are zero-specificity, and `kmwc-native` opts an element out.
26
+ - **Tables — every table styled, `.reference-table` plus modifiers** — Only `.reference-table` had a look; a bare table was unstyled and pages wrote their own table CSS with fixed light colours that break in dark mode. Any `<table>` now gets a header fill, row lines and a hover tint, and modifiers combine: `.table-full`, `.table-bordered`, `.table-striped`, and `.table-compact`, whose inputs and buttons shrink with the rows. Add `tr.is-highlight` and `.num` (tabular figures). Every wide table scrolls inside its card on a phone.
27
+ - **Scaffold — component CSS no longer restyles the host page** — The `*, *::before, *::after { box-sizing: inherit }` reset in the `kmwc new` and `--minimal` templates also reached the page through the component's light-DOM stylesheet, in a layer that beats `@layer kmwc`, so page controls rendered content-box (a 36 px input came out 38 px). It is scoped to `:host *` now, and a unit test rejects any universal or bare-element selector in scaffold CSS. Components scaffolded on rc01/rc02 should make the same one-line change in `src/css/base.css`.
28
+ - **Example pages — short chapter links, phones and the example-pages suite** — `#th07`, `#th7` or an uncoded heading's slug now scroll to that chapter on arrival. On a phone, example pages no longer grow wider than the screen, which made mobile browsers report a wrong viewport to pages that demo breakpoints. `kmwc doctor` runs the rulebook's new `example-pages` suite: every example `<h2>` carries a permanent section code.
29
+ - **`make dev` at the devkit root** — the standard `dev` / `kill-port` / `build-examples` / `preview-examples` targets, run against the playground.
30
+
31
+ ## What's New in v1.0.0-rc02
32
+
33
+ - **Theming — kit and scaffolds follow base-css-variables 2.0** — base-css-variables 2.0 dropped `--base-accent-color*`, `--base-text-color-on-accent` and `--base-input-color`, so a theme's primary colour silently stopped reaching the example pages and every newly scaffolded component. The `--kmwc-*` tokens in `src/examples/css/tokens.css` and the `templates/new*` `variables.css` now read `--base-primary-color` (with `-hover` / `-active` / `-bg-subtle`), `--base-on-primary-text-color` and `--base-input-text-color`, and the theming pages, docs and manifests set the new names. Standalone fallbacks are now the contract's own values, so a page looks the same with or without the contract loaded: a blue-500 primary instead of the old purple, slate surfaces, and on-colours computed from their fill. Re-run `kmwc new` output or diff your `variables.css` if you scaffolded on rc01.
34
+ - **`npm run check:contract` — fallbacks can't drift from the contract** — `base-contract-check` from `@keenmate/base-css-variables` now runs over the kit, the scaffold templates and the playground. It fails when a `--base-*` read doesn't exist in the contract, when an input's fallback differs from the contract default, or when a derived token's fallback isn't the contract formula. Deliberate differences, such as the scaffolds inheriting the page font, are listed with a reason in `contract-check.json`. It's part of the gate before every kit or template change.
35
+ - **`kmwc new --adopt` — migrate a component that's already registered** — Brings an existing repo onto the devkit with the same rulebook-shaped scaffold, using the registry entry's port block and CSS prefix, skipping the npm-name check (the package already exists) and leaving `components.json` untouched. Scaffold into a scratch `--dir` and move the component's code in. web-editor's one-package monorepo was flattened this way.
36
+ - **`kmwc doctor` — rulebook suites run from an npm install** — With the devkit installed from npm instead of linked, doctor looked for the BlissFramework rulebook at a path relative to the devkit, which ended up inside `node_modules`, and silently skipped every suite. It now uses the nearest `BlissFramework/guidelines/web-components` above the component (then above the devkit), and `kmwc.rulebook.path` resolves against the component root.
31
37
 
32
38
  ## Catalogue
33
39
 
@@ -42,7 +48,7 @@ them in the same shape: `@keenmate/web-components-devkit`.
42
48
  | **web-commandpalette** | `@keenmate/web-commandpalette` | `cp` | 12400 | [repo](https://github.com/keenmate/web-commandpalette) · [examples](https://examples.web-commandpalette.keenmate.dev) | ✅ | Framework-agnostic command-palette web component — modes, multi-step commands, scoped + global search,… |
43
49
  | **web-dropzone** | `@keenmate/web-dropzone` | `dz` | 12500 | [repo](https://github.com/keenmate/web-dropzone) | — | Lightweight file dropzone web component with drag-drop, previews, validation, and multiple display modes. |
44
50
  | **web-grid** | `@keenmate/web-grid` | `wg` | 12600 | [repo](https://github.com/keenmate/web-grid) · [docs](https://web-grid.keenmate.com) · [showcase](https://web-grid.keenmate.com) | — | Framework-agnostic data grid web component with sorting, filtering, inline editing, and keyboard navigation |
45
- | **web-editor** | `@keenmate/web-editor` | — | 12700 | [examples](https://examples.web-editor.keenmate.dev) | — | KeenMate Web Editor monorepo — a framework-agnostic WYSIWYG / Markdown editor built on ProseMirror. |
51
+ | **web-editor** | `@keenmate/web-editor` | `km` | 12700 | [examples](https://examples.web-editor.keenmate.dev) | ✅ | Keenmate Web Editor — a framework-agnostic WYSIWYG / Markdown editor built on ProseMirror. |
46
52
  | **web-switch** | `@keenmate/web-switch` | — | 12800 | [repo](https://github.com/keenmate/web-switch) | — | Framework-agnostic web component wrapper for @keenmate/svelte-switch. Works with React, Vue, Angular, or… |
47
53
  | **web-timepicker** | — | — | 12900 | — | — | Vanilla-JS prototypes (spiral / slider time pickers); no package yet. |
48
54
  | **web-wysiwyg** | — | — | 13000 | — | — | ProseMirror exploration; superseded by web-editor. |
@@ -53,6 +59,8 @@ them in the same shape: `@keenmate/web-components-devkit`.
53
59
  |---|---|---:|---|
54
60
  | **web-components-core** | `@keenmate/web-components-core` | 15000 | Runtime foundation: BlissElement, reactive input table, converters, logging, positioning, CEM preset. |
55
61
  | **web-components** | `@keenmate/web-components-devkit` | 15100 | This repo — dev/demo/build tooling (Vite preset, examples kit, kmwc CLI). |
62
+ | **pure-css** | `@keenmate/pure-css` | 15200 | CSS framework mirroring the base-css-variables token contract (demo site + e2e on the dev port). |
63
+ | **base-css-variables** | `@keenmate/base-css-variables` | 15300 | The shared --base-* token contract (base-variables.css) + base-contract-check; examples site + e2e on the dev port. |
56
64
 
57
65
  ### Showcases, docs & test harnesses
58
66
 
@@ -166,7 +174,8 @@ Every field is optional. Defaults are derived from the package.
166
174
  "checkMode": "declared" // or "consumed" (var() reads)
167
175
  },
168
176
  "rulebook": {
169
- "path": "../../BlissFramework/guidelines/web-components", // default; env KMWC_RULEBOOK_PATH wins
177
+ "path": "../BlissFramework/guidelines/web-components", // relative to the component; default: the nearest
178
+ // BlissFramework checkout above it. env KMWC_RULEBOOK_PATH wins
170
179
  "skippedChecks": [] // e.g. ["responsive-overlay"]
171
180
  },
172
181
  "sync": { "skippedFiles": [] } // e.g. ["Makefile"] to opt a file out
@@ -257,10 +266,26 @@ doctor` lists the ones still repeating the head/header boilerplate.
257
266
  Re-theme a site with `kmwc.theme.accentColor`. The page vocabulary is
258
267
  unchanged from the old shared CSS — `.card`, `.example-section`, `.controls`,
259
268
  `.demo-area`, `.demo-card`, `.code-block`, `.note(.warning|.info|.success|.error)`,
260
- `.grid`/`.card-grid`, `.reference-table`, `.log-panel`, `.pill`,
269
+ `.grid`/`.card-grid`, `.reference-table` (+ `.table-*` modifiers), `.log-panel`, `.pill`,
261
270
  `.status-dot`, `.control-group`, buttons (`.btn-secondary`, `.btn-outline`,
262
271
  `.btn-danger`) — while everything the kit **generates** is prefixed BEM
263
272
  (`kmwc-chapter-nav__item--active`, `kmwc-copy-link--copied`, …).
273
+ - **Form controls** look the same on every page without a class: text fields,
274
+ selects and list boxes (`multiple` / `size`), textareas, checkboxes, radios,
275
+ switches (`<input type="checkbox" role="switch">`), ranges, colour and file
276
+ inputs, fieldsets — modelled on pure-admin's forms and read through the
277
+ `--base-input-*` / `--base-checkbox-*` / `--base-icon-check` contract. Inputs,
278
+ selects and buttons share `--kmwc-control-height`, so a row of them lines up
279
+ in any container, not only `.controls`. The rules are zero-specificity
280
+ (`:where()`); `kmwc-native` on an element or an ancestor keeps the browser's
281
+ own controls (a light-DOM component that draws its own inputs). The
282
+ playground's `examples-forms.html` shows them all.
283
+ - **Tables:** any `<table>` gets a header fill, row lines and a hover tint;
284
+ `.reference-table` is the full-width, fully bordered API table. Modifiers
285
+ combine — `.table-full`, `.table-bordered`, `.table-striped`, `.table-compact`
286
+ (tighter cells; the controls in it shrink via `--kmwc-control-height`) — plus
287
+ `tr.is-highlight` and a `.num` cell (right-aligned, tabular figures). On a phone
288
+ a wide table scrolls inside its card. See the playground's `examples-tables.html`.
264
289
  - **Theme switch** (top right) cycles light → dark → auto and sets
265
290
  `data-theme` on `<html>` — the same signal components react to via
266
291
  `:host-context([data-theme])`, so every example page is a dark-mode smoke
@@ -268,6 +293,22 @@ doctor` lists the ones still repeating the head/header boilerplate.
268
293
  - **Chapter nav and copy-link** share one section/slug algorithm, so the
269
294
  jump-list hashes and copied links always match. Floating UI is bundled (no
270
295
  CDN). At the bottom of a short page, the last chapter gets highlighted.
296
+ - **Spotlight (Ctrl/⌘+K)** searches every chapter of every example page: a
297
+ chapter matches when its section code or heading text contains the query
298
+ (`th7` finds `TH07`; uncoded `Summary` / reference sections are found by
299
+ title), results are grouped by page with the current page first, ↑↓ / PgUp
300
+ / PgDn / Home / End pick, Enter jumps, Ctrl/⌘+Enter opens a new tab. The
301
+ Vite plugin builds the index from every page's `<h2>`s (includes resolved)
302
+ as `virtual:kmwc-chapters`; the current page's chapters are read live, so
303
+ script-rendered sections count too. Off with
304
+ `kmwc.examples.isSpotlightEnabled: false` (a component that owns Ctrl+K
305
+ itself; a page handler calling `preventDefault()` also keeps the key). It
306
+ **mirrors** [web-commandpalette](https://github.com/keenmate/web-commandpalette)
307
+ — markup, matching, keyboard map, open/close, CSS — without depending on it;
308
+ see *Developing the devkit*.
309
+ - **Short chapter links**: `examples-theming.html#th07` (or `#th7`, or the
310
+ slug of an uncoded heading, `#summary`) scrolls to that chapter on arrival
311
+ — the codes from the rulebook's `example-pages.md` work as URLs.
271
312
  - **Version badge**: any `[data-kmwc-version]` (or legacy `#version-badge`)
272
313
  shows `v1.2.3`, or `v1.2.3 (built …)` in a built site.
273
314
  - **Landing page**: `renderExamplesIndex({ pages })` renders the header, cards,
@@ -302,6 +343,7 @@ kmwc doctor [--json] devkit checks + package contents + the rulebook's
302
343
  kmwc check-vars [--strict] component-variables.manifest.json ⇔ CSS
303
344
  kmwc check-release --tag t latest ⇔ release version, rc ⇔ -rcN, version not yet on npm
304
345
  kmwc new web-<name> scaffold a component (--prefix, --title, --tag, --dir, --port, --minimal, --register)
346
+ --adopt: scaffold an ALREADY registered component (its port/prefix) to migrate into
305
347
  kmwc readme [--check] regenerate this README's catalogue (devkit repo only)
306
348
  ```
307
349
 
@@ -314,7 +356,7 @@ and the e2e suite before building and publishing.
314
356
  **`kmwc doctor` and the rulebook.** Doctor runs every suite in the rulebook
315
357
  (component-structure, naming-conventions, css-structure, theme-container,
316
358
  base-variables, color-scheme, readme-structure, custom-elements-manifest,
317
- responsive-overlay, publish-command) with `bash`, passing `kmwc.prefix`, and
359
+ responsive-overlay, publish-command, example-pages) with `bash`, passing `kmwc.prefix`, and
318
360
  reports each `FAIL` as an error pointing at the matching `.checks.md` entry.
319
361
  When the rulebook isn't checked out (or there's no bash) the suites are
320
362
  skipped with a warning — the rulebook stays the single source of truth; the
@@ -366,6 +408,12 @@ command prints the reminder.
366
408
 
367
409
  `kmwc doctor` lists everything that's left, so run it after each step.
368
410
 
411
+ **Repo in a different shape** (a one-package monorepo, a non-standard layout)?
412
+ Don't teach the devkit the old shape: back the repo up, run `kmwc new web-<name>
413
+ --adopt --dir <scratch>` (same files, with the registered port and prefix, no
414
+ registry edits), and move the component's own code into that layout with
415
+ `git mv`. web-editor was flattened this way.
416
+
369
417
  1. `npm i -D @keenmate/web-components-devkit vite@^7` (plus `@playwright/test`
370
418
  if the repo has e2e tests).
371
419
  2. Add `package.json#kmwc`. Take the port block (`ports.dev` = block,
@@ -404,8 +452,18 @@ npm install
404
452
  npm test # unit tests (config, registry, templates, sync, checks, intake, plugin, kit)
405
453
  npm run test:e2e # playground: the kit + scaffold in a real browser, dev server AND built site
406
454
  npm run readme # regenerate the catalogue
455
+ npm run check:spotlight-mirror # what changed in web-commandpalette since the spotlight was aligned
456
+ make dev # the playground's dev server
407
457
  ```
408
458
 
459
+ **The spotlight mirrors web-commandpalette.** `src/examples/spotlight.js`,
460
+ `chapter-search.js` and `css/spotlight.css` keep wcp's structure block for
461
+ block (devkit naming), each marked `mirrors <file> <function>`;
462
+ [`scripts/spotlight-mirror.json`](scripts/spotlight-mirror.json) lists every
463
+ pair and the wcp / core commit they're aligned to. A bug fixed in one gets
464
+ ported to the other: run `npm run check:spotlight-mirror` (add `-- --diff`
465
+ for the patches), port what applies, bump `alignedCommit`.
466
+
409
467
  [`playground/`](playground) is a real component scaffolded with `kmwc new` and
410
468
  linked to this checkout. It's the reference for "what a component looks like",
411
469
  the e2e target for every kit feature, and `npx kmwc doctor` inside it must