@epa-wg/custom-element-dist 0.0.37 → 0.0.39
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/.yarn/install-state.gz +0 -0
- package/AGENTS.md +1 -0
- package/CLAUDE.md +89 -0
- package/README.md +5 -5
- package/bin/postinstall.sh +18 -10
- package/coverage/base.css +224 -0
- package/coverage/block-navigation.js +87 -0
- package/coverage/coverage-final.json +12 -0
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +176 -0
- package/coverage/prettify.css +1 -0
- package/coverage/prettify.js +2 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +210 -0
- package/coverage/src/coverage.svg +10 -0
- package/coverage/src/custom-element/coverage.svg +10 -0
- package/coverage/src/custom-element/custom-element.js/coverage.svg +10 -0
- package/coverage/src/custom-element/custom-element.js.html +3058 -0
- package/coverage/src/custom-element/http-request.js/coverage.svg +10 -0
- package/coverage/src/custom-element/http-request.js.html +373 -0
- package/coverage/src/custom-element/index.html +176 -0
- package/coverage/src/custom-element/local-storage.js/coverage.svg +10 -0
- package/coverage/src/custom-element/local-storage.js.html +361 -0
- package/coverage/src/custom-element/location-element.js/coverage.svg +10 -0
- package/coverage/src/custom-element/location-element.js.html +412 -0
- package/coverage/src/custom-element/module-url.js/coverage.svg +10 -0
- package/coverage/src/custom-element/module-url.js.html +187 -0
- package/coverage/src/index.html +116 -0
- package/coverage/src/material/theme/colors.js/coverage.svg +10 -0
- package/coverage/src/material/theme/colors.js.html +217 -0
- package/coverage/src/material/theme/coverage.svg +10 -0
- package/coverage/src/material/theme/index.html +116 -0
- package/coverage/src/mocks/coverage.svg +10 -0
- package/coverage/src/mocks/handlers.ts/coverage.svg +10 -0
- package/coverage/src/mocks/handlers.ts.html +196 -0
- package/coverage/src/mocks/index.html +116 -0
- package/coverage/src/stories/coverage.svg +10 -0
- package/coverage/src/stories/frame.canvas.ts/coverage.svg +10 -0
- package/coverage/src/stories/frame.canvas.ts.html +217 -0
- package/coverage/src/stories/http-request.stories.ts/coverage.svg +10 -0
- package/coverage/src/stories/http-request.stories.ts.html +820 -0
- package/coverage/src/stories/index.html +146 -0
- package/coverage/src/stories/testStoryBook.ts/coverage.svg +10 -0
- package/coverage/src/stories/testStoryBook.ts.html +160 -0
- package/coverage/src/sum.ts/coverage.svg +10 -0
- package/coverage/src/sum.ts.html +94 -0
- package/dist/{custom-element-BqBcmDiN.js → custom-element-Cr_I3Xd-.js} +69 -65
- package/dist/custom-element-D5IF46oF.cjs +97 -0
- package/dist/custom-element-bundle.cjs +1 -1
- package/dist/custom-element-bundle.js +3 -3
- package/dist/demo/a.html +41 -64
- package/dist/demo/s.xslt +94 -350
- package/dist/{local-storage-DzmNKzgN.js → local-storage-w0k66UWM.js} +4 -4
- package/package.json +3 -2
- package/public/demo/a.html +41 -64
- package/public/demo/s.xslt +94 -350
- package/src/css/cem-combined.css +1058 -0
- package/src/custom-element/custom-element.js +9 -4
- package/src/custom-element/demo/a.html +41 -64
- package/src/custom-element/demo/s.xslt +94 -350
- package/src/custom-element/ide/customData-dce.json +8 -8
- package/src/custom-element/ide/web-types-dce.json +8 -8
- package/src/custom-element/ide/web-types-xsl.json +1 -1
- package/src/material/components/action.html +77 -22
- package/src/material/components/autocomplete.html +7 -6
- package/src/material/components/badge.html +33 -34
- package/src/material/components/cem-theme-components.css +131 -0
- package/src/material/components/dropdown.html +27 -12
- package/src/material/components/icon-link.html +25 -18
- package/src/material/components/icon.html +15 -14
- package/src/material/components/input.html +27 -24
- package/src/material/components/menu.html +23 -18
- package/src/material/components.html +31 -23
- package/src/material/demo.css +24 -12
- package/src/material/index.html +16 -10
- package/src/material/theme/consumer-theme.css +0 -733
- package/src/material/theme/semantic.css +1 -85
- package/src/mocks/versions.mock.ts +1 -1
- package/src/stories/__screenshots__/http-request.test.ts/http-request-url-change-1.png +0 -0
- package/src/stories/__screenshots__/location-element.test.stories.ts/location-element-location-element-Demo-1.png +0 -0
- package/src/stories/frame.canvas.ts +17 -4
- package/src/stories/testStoryBook.ts +2 -5
- package/storybook-static/assets/{Color-F6OSRLHC-FZZzFn7T.js → Color-F6OSRLHC-DM-zIDJc.js} +1 -1
- package/storybook-static/assets/{Configure-DyfktOJO.js → Configure-Bv7Hf8nO.js} +1 -1
- package/storybook-static/assets/{DocsRenderer-CFRXHY34-5isVpCzj.js → DocsRenderer-CFRXHY34-BNrvQCFF.js} +2 -2
- package/storybook-static/assets/{attributes.test.stories-CrDC-RXf.js → attributes.test.stories-Bs0zZtYO.js} +1 -1
- package/storybook-static/assets/{css.test.stories-ChWnZJwa.js → css.test.stories-CK4N9Fqq.js} +1 -1
- package/storybook-static/assets/custom-element-PxTx2W9y.js +97 -0
- package/storybook-static/assets/{dom-merge.test.stories-DkarPqD_.js → dom-merge.test.stories-DLFviA8F.js} +1 -1
- package/storybook-static/assets/{external-template.test.stories-DCboR8sG.js → external-template.test.stories-CqR1aaHv.js} +1 -1
- package/storybook-static/assets/{form.test.stories-BjeeUu0b.js → form.test.stories-Cinvg_DI.js} +1 -1
- package/storybook-static/assets/frame.canvas-BB4_DNn6.js +1 -0
- package/storybook-static/assets/handlers-C9n1hhtS.js +291 -0
- package/storybook-static/assets/{http-request.stories-WIldq1MC.js → http-request.stories-CwYdgaOh.js} +1 -1
- package/storybook-static/assets/{iframe-CBHPj1E5.js → iframe-DX9w3Kge.js} +2 -2
- package/storybook-static/assets/{index-CzwPLrca.js → index-C8cHSFtw.js} +1 -1
- package/storybook-static/assets/{index-BL0FQnAE.js → index-DgXlQmnf.js} +3 -3
- package/storybook-static/assets/{local-storage.test.stories-DLMK0p2s.js → local-storage.test.stories-M4WOSQC5.js} +1 -1
- package/storybook-static/assets/{location-element.test.stories-BroqoLMS.js → location-element.test.stories-Ce6Ma8hE.js} +1 -1
- package/storybook-static/assets/{module-url.test.stories-B-0dibET.js → module-url.test.stories-PwnZWqKL.js} +1 -1
- package/storybook-static/assets/{preview-C1KnQPMW.js → preview-DxO5Yt9a.js} +1 -1
- package/storybook-static/assets/{preview-BG24UPL5.js → preview-ln0vFKa2.js} +2 -2
- package/storybook-static/assets/{set-url.test.stories-Dhq4YQyr.js → set-url.test.stories-BdNTYEwI.js} +1 -1
- package/storybook-static/assets/{slice-events.test.stories-BZJGIFku.js → slice-events.test.stories-BdvLtK0h.js} +1 -1
- package/storybook-static/assets/{slots.test.stories-DKivHwZH.js → slots.test.stories-CoTPvRog.js} +1 -1
- package/storybook-static/assets/{version-select.test.stories-Dntyd7qb.js → version-select.test.stories-hs-HsDVE.js} +1 -1
- package/storybook-static/assets/{xslt-conditionals.test.stories-Iq5iQNRj.js → xslt-conditionals.test.stories-C4oXVQWa.js} +1 -1
- package/storybook-static/assets/{xslt-for-each.test.stories-BMygBmj8.js → xslt-for-each.test.stories-Da4vCZe1.js} +1 -1
- package/storybook-static/assets/{xslt-if.test.stories-CVrFWdAX.js → xslt-if.test.stories-CMlnBGX2.js} +1 -1
- package/storybook-static/demo/a.html +41 -64
- package/storybook-static/demo/s.xslt +94 -350
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/project.json +1 -1
- package/dist/custom-element-jpOyXHF6.cjs +0 -97
- package/storybook-static/assets/custom-element-wuk8gYiP.js +0 -97
- package/storybook-static/assets/frame.canvas-E5n9h6j1.js +0 -1
- package/storybook-static/assets/handlers-B7UMnC7v.js +0 -291
package/.yarn/install-state.gz
CHANGED
|
Binary file
|
package/AGENTS.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
use CLAUDE.md for codex session.
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## What This Repo Is
|
|
6
|
+
|
|
7
|
+
`@epa-wg/custom-element-dist` is a **distribution and test harness** for the `@epa-wg/custom-element` library. It does not own the core source — `src/custom-element/*.js` and `*.d.ts` files are **copied from the `@epa-wg/custom-element` npm package** by `bin/postinstall.sh` at install time. Do not edit those copied files directly.
|
|
8
|
+
|
|
9
|
+
The repo exists to:
|
|
10
|
+
- Run tests with coverage against the library
|
|
11
|
+
- Build and publish the Storybook static site
|
|
12
|
+
- Produce the `dist/` bundle for CDN use
|
|
13
|
+
|
|
14
|
+
## Setup
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
yarn cache clean @epa-wg/custom-element # if checksum mismatch on install
|
|
18
|
+
yarn install # installs deps + runs postinstall (copies src/custom-element files)
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
`postinstall` resolves `@epa-wg/custom-element` via `node -e "require.resolve(...)"` — works with both yarn PnP and node-modules linker.
|
|
22
|
+
|
|
23
|
+
## Commands
|
|
24
|
+
|
|
25
|
+
| Command | Purpose |
|
|
26
|
+
|---|---|
|
|
27
|
+
| `yarn test` | Full test suite with coverage (chromium, headless) |
|
|
28
|
+
| `yarn test:ff` | Same but Firefox |
|
|
29
|
+
| `yarn test:watch` | Interactive watch mode, browser visible |
|
|
30
|
+
| `yarn t` | Watch a single file: `module-url.test.stories.ts` |
|
|
31
|
+
| `yarn tt` | Watch a single file: `external-template.test.stories.ts` |
|
|
32
|
+
| `yarn storybook` / `yarn sb` | Dev storybook on port 6006 |
|
|
33
|
+
| `yarn build` | `tsc` + vite library build → `dist/` |
|
|
34
|
+
| `yarn build-storybook` | Static storybook → `storybook-static/` |
|
|
35
|
+
| `bash bin/build.sh` | Full CI build: clean + test + build + build-storybook |
|
|
36
|
+
| `bash bin/clean.sh` | Nuke `node_modules/`, `dist/`, `coverage/`, `storybook-static/` |
|
|
37
|
+
|
|
38
|
+
To run a single test file:
|
|
39
|
+
```bash
|
|
40
|
+
vitest --no-file-parallelism --watch=false src/stories/some-feature.test.stories.ts
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Architecture
|
|
44
|
+
|
|
45
|
+
### Source layout
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
src/
|
|
49
|
+
custom-element/ ← copied from @epa-wg/custom-element by postinstall (do not edit)
|
|
50
|
+
index.js ← library entry point (used by vite build)
|
|
51
|
+
custom-element.js ← core DCE implementation
|
|
52
|
+
demo/ ← also copied to public/demo/
|
|
53
|
+
ide/ ← web-types for IDE integration
|
|
54
|
+
stories/ ← Storybook stories AND tests
|
|
55
|
+
mocks/ ← MSW handlers (shared by storybook + vitest)
|
|
56
|
+
material/ ← Material design theme layer (independent)
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Testing approach
|
|
60
|
+
|
|
61
|
+
Tests live in `src/stories/` and follow two patterns:
|
|
62
|
+
- `*.test.stories.ts` — Storybook stories used as vitest browser tests via `testStoryBook.ts` helper
|
|
63
|
+
- `*.test.ts` — standard vitest unit tests
|
|
64
|
+
|
|
65
|
+
Tests run **without file parallelism** (`--no-file-parallelism`) due to shared browser/DOM state.
|
|
66
|
+
|
|
67
|
+
Before running tests, `bin/vitest/vitest-browser-importmaps.mjs` patches the vitest browser HTML to inject import maps for `lib-root/` → `demo/lib-dir/` resolution (needed by `module-url.test.stories.ts`).
|
|
68
|
+
|
|
69
|
+
MSW is active in both Storybook and vitest. Handlers are in `src/mocks/handlers.ts`. The vitest config sets `dangerouslyIgnoreUnhandledErrors: true` to suppress MSW service worker noise.
|
|
70
|
+
|
|
71
|
+
### Build output
|
|
72
|
+
|
|
73
|
+
Vite builds in **lib mode**: entry `src/custom-element/index.js`, outputs `dist/assets/custom-element-bundle.js` (ESM) and `.cjs`. Each source file also gets its own hashed chunk via `manualChunks`.
|
|
74
|
+
|
|
75
|
+
`dist/`, `coverage/`, and `storybook-static/` are **committed to git** as compliance/release artifacts.
|
|
76
|
+
|
|
77
|
+
## Package manager
|
|
78
|
+
|
|
79
|
+
Yarn 4.12.0 with `nodeLinker: node-modules` (see `.yarnrc.yml`). Use `yarn` for all package operations, not `npm`.
|
|
80
|
+
|
|
81
|
+
## CEM Theme
|
|
82
|
+
Apply CEM theme styling to this existing project using the installed `@epa-wg/cem-theme` package.
|
|
83
|
+
|
|
84
|
+
Before changing styles, read the installed package-local AI instructions:
|
|
85
|
+
`node_modules/@epa-wg/cem-theme/dist/lib/tokens/cem-theme-ai-instructions.md`.
|
|
86
|
+
|
|
87
|
+
Follow that file's read order, token-selection rules, stylesheet setup, theme scoping, and verification checklist.
|
|
88
|
+
Prefer these installed Markdown docs over GitHub because they match the installed npm package version. Do not infer CEM
|
|
89
|
+
semantics from generated CSS values alone.
|
package/README.md
CHANGED
|
@@ -27,8 +27,8 @@ CDN version of StoryBook.
|
|
|
27
27
|
[github-image]: https://cdnjs.cloudflare.com/ajax/libs/octicons/8.5.0/svg/mark-github.svg
|
|
28
28
|
[npm-image]: https://img.shields.io/npm/v/@epa-wg/custom-element-dist.svg
|
|
29
29
|
[npm-url]: https://npmjs.org/package/@epa-wg/custom-element-dist
|
|
30
|
-
[coverage-image]: https://unpkg.com/@epa-wg/custom-element-dist@0.0.
|
|
31
|
-
[coverage-url]: https://unpkg.com/@epa-wg/custom-element-dist@0.0.
|
|
32
|
-
[sb-url]: https://unpkg.com/@epa-wg/custom-element-dist@0.0.
|
|
33
|
-
[bundle-url]: https://unpkg.com/@epa-wg/custom-element-dist@0.0.
|
|
34
|
-
[cem-url]: https://unpkg.com/@epa-wg/custom-element-dist@0.0.
|
|
30
|
+
[coverage-image]: https://unpkg.com/@epa-wg/custom-element-dist@0.0.39/coverage/src/custom-element/coverage.svg
|
|
31
|
+
[coverage-url]: https://unpkg.com/@epa-wg/custom-element-dist@0.0.39/coverage/src/custom-element/index.html
|
|
32
|
+
[sb-url]: https://unpkg.com/@epa-wg/custom-element-dist@0.0.39/storybook-static/index.html
|
|
33
|
+
[bundle-url]: https://unpkg.com/@epa-wg/custom-element-dist@0.0.39/dist/custom-element-bundle.js
|
|
34
|
+
[cem-url]: https://unpkg.com/@epa-wg/custom-element-dist@0.0.39/src/material/components.html
|
package/bin/postinstall.sh
CHANGED
|
@@ -2,17 +2,25 @@
|
|
|
2
2
|
# to be treated as internal by test coverage
|
|
3
3
|
#npm link @epa-wg/custom-element
|
|
4
4
|
|
|
5
|
+
# Resolve package path — works with yarn PnP, yarn node-modules linker, and npm
|
|
6
|
+
PKG_DIR=$(node -e "console.log(require.resolve('@epa-wg/custom-element/package.json').replace(/[\/\\\\]package\\.json\$/, '').replace(/\\\\/g, '/'))")
|
|
7
|
+
CEM_THEME_DIR=$(node -e "console.log(require.resolve('@epa-wg/cem-theme/package.json').replace(/[\/\\\\]package\\.json\$/, '').replace(/\\\\/g, '/'))")
|
|
8
|
+
|
|
5
9
|
cd src/custom-element
|
|
6
|
-
mkdir demo
|
|
7
|
-
mkdir ide
|
|
10
|
+
mkdir -p demo
|
|
11
|
+
mkdir -p ide
|
|
8
12
|
|
|
9
|
-
rm *.d.ts
|
|
10
|
-
rm *.js
|
|
13
|
+
rm -f *.d.ts
|
|
14
|
+
rm -f *.js
|
|
11
15
|
pwd
|
|
12
|
-
cp
|
|
13
|
-
cp
|
|
14
|
-
cp
|
|
15
|
-
cp -r
|
|
16
|
-
cp -r
|
|
16
|
+
cp "$PKG_DIR"/*.d.ts .
|
|
17
|
+
cp "$PKG_DIR"/*.js .
|
|
18
|
+
cp "$PKG_DIR"/index.html index.html
|
|
19
|
+
cp -r "$PKG_DIR"/demo/* demo/
|
|
20
|
+
cp -r "$PKG_DIR"/ide/* ide/
|
|
21
|
+
|
|
22
|
+
cd ..
|
|
23
|
+
mkdir -p css
|
|
24
|
+
cp "$CEM_THEME_DIR"/dist/lib/css/cem-combined.css css/
|
|
17
25
|
|
|
18
|
-
cp -r demo ../../public
|
|
26
|
+
cp -r demo ../../public
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
body, html {
|
|
2
|
+
margin:0; padding: 0;
|
|
3
|
+
height: 100%;
|
|
4
|
+
}
|
|
5
|
+
body {
|
|
6
|
+
font-family: Helvetica Neue, Helvetica, Arial;
|
|
7
|
+
font-size: 14px;
|
|
8
|
+
color:#333;
|
|
9
|
+
}
|
|
10
|
+
.small { font-size: 12px; }
|
|
11
|
+
*, *:after, *:before {
|
|
12
|
+
-webkit-box-sizing:border-box;
|
|
13
|
+
-moz-box-sizing:border-box;
|
|
14
|
+
box-sizing:border-box;
|
|
15
|
+
}
|
|
16
|
+
h1 { font-size: 20px; margin: 0;}
|
|
17
|
+
h2 { font-size: 14px; }
|
|
18
|
+
pre {
|
|
19
|
+
font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
|
20
|
+
margin: 0;
|
|
21
|
+
padding: 0;
|
|
22
|
+
-moz-tab-size: 2;
|
|
23
|
+
-o-tab-size: 2;
|
|
24
|
+
tab-size: 2;
|
|
25
|
+
}
|
|
26
|
+
a { color:#0074D9; text-decoration:none; }
|
|
27
|
+
a:hover { text-decoration:underline; }
|
|
28
|
+
.strong { font-weight: bold; }
|
|
29
|
+
.space-top1 { padding: 10px 0 0 0; }
|
|
30
|
+
.pad2y { padding: 20px 0; }
|
|
31
|
+
.pad1y { padding: 10px 0; }
|
|
32
|
+
.pad2x { padding: 0 20px; }
|
|
33
|
+
.pad2 { padding: 20px; }
|
|
34
|
+
.pad1 { padding: 10px; }
|
|
35
|
+
.space-left2 { padding-left:55px; }
|
|
36
|
+
.space-right2 { padding-right:20px; }
|
|
37
|
+
.center { text-align:center; }
|
|
38
|
+
.clearfix { display:block; }
|
|
39
|
+
.clearfix:after {
|
|
40
|
+
content:'';
|
|
41
|
+
display:block;
|
|
42
|
+
height:0;
|
|
43
|
+
clear:both;
|
|
44
|
+
visibility:hidden;
|
|
45
|
+
}
|
|
46
|
+
.fl { float: left; }
|
|
47
|
+
@media only screen and (max-width:640px) {
|
|
48
|
+
.col3 { width:100%; max-width:100%; }
|
|
49
|
+
.hide-mobile { display:none!important; }
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.quiet {
|
|
53
|
+
color: #7f7f7f;
|
|
54
|
+
color: rgba(0,0,0,0.5);
|
|
55
|
+
}
|
|
56
|
+
.quiet a { opacity: 0.7; }
|
|
57
|
+
|
|
58
|
+
.fraction {
|
|
59
|
+
font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
|
|
60
|
+
font-size: 10px;
|
|
61
|
+
color: #555;
|
|
62
|
+
background: #E8E8E8;
|
|
63
|
+
padding: 4px 5px;
|
|
64
|
+
border-radius: 3px;
|
|
65
|
+
vertical-align: middle;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
div.path a:link, div.path a:visited { color: #333; }
|
|
69
|
+
table.coverage {
|
|
70
|
+
border-collapse: collapse;
|
|
71
|
+
margin: 10px 0 0 0;
|
|
72
|
+
padding: 0;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
table.coverage td {
|
|
76
|
+
margin: 0;
|
|
77
|
+
padding: 0;
|
|
78
|
+
vertical-align: top;
|
|
79
|
+
}
|
|
80
|
+
table.coverage td.line-count {
|
|
81
|
+
text-align: right;
|
|
82
|
+
padding: 0 5px 0 20px;
|
|
83
|
+
}
|
|
84
|
+
table.coverage td.line-coverage {
|
|
85
|
+
text-align: right;
|
|
86
|
+
padding-right: 10px;
|
|
87
|
+
min-width:20px;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
table.coverage td span.cline-any {
|
|
91
|
+
display: inline-block;
|
|
92
|
+
padding: 0 5px;
|
|
93
|
+
width: 100%;
|
|
94
|
+
}
|
|
95
|
+
.missing-if-branch {
|
|
96
|
+
display: inline-block;
|
|
97
|
+
margin-right: 5px;
|
|
98
|
+
border-radius: 3px;
|
|
99
|
+
position: relative;
|
|
100
|
+
padding: 0 4px;
|
|
101
|
+
background: #333;
|
|
102
|
+
color: yellow;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.skip-if-branch {
|
|
106
|
+
display: none;
|
|
107
|
+
margin-right: 10px;
|
|
108
|
+
position: relative;
|
|
109
|
+
padding: 0 4px;
|
|
110
|
+
background: #ccc;
|
|
111
|
+
color: white;
|
|
112
|
+
}
|
|
113
|
+
.missing-if-branch .typ, .skip-if-branch .typ {
|
|
114
|
+
color: inherit !important;
|
|
115
|
+
}
|
|
116
|
+
.coverage-summary {
|
|
117
|
+
border-collapse: collapse;
|
|
118
|
+
width: 100%;
|
|
119
|
+
}
|
|
120
|
+
.coverage-summary tr { border-bottom: 1px solid #bbb; }
|
|
121
|
+
.keyline-all { border: 1px solid #ddd; }
|
|
122
|
+
.coverage-summary td, .coverage-summary th { padding: 10px; }
|
|
123
|
+
.coverage-summary tbody { border: 1px solid #bbb; }
|
|
124
|
+
.coverage-summary td { border-right: 1px solid #bbb; }
|
|
125
|
+
.coverage-summary td:last-child { border-right: none; }
|
|
126
|
+
.coverage-summary th {
|
|
127
|
+
text-align: left;
|
|
128
|
+
font-weight: normal;
|
|
129
|
+
white-space: nowrap;
|
|
130
|
+
}
|
|
131
|
+
.coverage-summary th.file { border-right: none !important; }
|
|
132
|
+
.coverage-summary th.pct { }
|
|
133
|
+
.coverage-summary th.pic,
|
|
134
|
+
.coverage-summary th.abs,
|
|
135
|
+
.coverage-summary td.pct,
|
|
136
|
+
.coverage-summary td.abs { text-align: right; }
|
|
137
|
+
.coverage-summary td.file { white-space: nowrap; }
|
|
138
|
+
.coverage-summary td.pic { min-width: 120px !important; }
|
|
139
|
+
.coverage-summary tfoot td { }
|
|
140
|
+
|
|
141
|
+
.coverage-summary .sorter {
|
|
142
|
+
height: 10px;
|
|
143
|
+
width: 7px;
|
|
144
|
+
display: inline-block;
|
|
145
|
+
margin-left: 0.5em;
|
|
146
|
+
background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent;
|
|
147
|
+
}
|
|
148
|
+
.coverage-summary .sorted .sorter {
|
|
149
|
+
background-position: 0 -20px;
|
|
150
|
+
}
|
|
151
|
+
.coverage-summary .sorted-desc .sorter {
|
|
152
|
+
background-position: 0 -10px;
|
|
153
|
+
}
|
|
154
|
+
.status-line { height: 10px; }
|
|
155
|
+
/* yellow */
|
|
156
|
+
.cbranch-no { background: yellow !important; color: #111; }
|
|
157
|
+
/* dark red */
|
|
158
|
+
.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 }
|
|
159
|
+
.low .chart { border:1px solid #C21F39 }
|
|
160
|
+
.highlighted,
|
|
161
|
+
.highlighted .cstat-no, .highlighted .fstat-no, .highlighted .cbranch-no{
|
|
162
|
+
background: #C21F39 !important;
|
|
163
|
+
}
|
|
164
|
+
/* medium red */
|
|
165
|
+
.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE }
|
|
166
|
+
/* light red */
|
|
167
|
+
.low, .cline-no { background:#FCE1E5 }
|
|
168
|
+
/* light green */
|
|
169
|
+
.high, .cline-yes { background:rgb(230,245,208) }
|
|
170
|
+
/* medium green */
|
|
171
|
+
.cstat-yes { background:rgb(161,215,106) }
|
|
172
|
+
/* dark green */
|
|
173
|
+
.status-line.high, .high .cover-fill { background:rgb(77,146,33) }
|
|
174
|
+
.high .chart { border:1px solid rgb(77,146,33) }
|
|
175
|
+
/* dark yellow (gold) */
|
|
176
|
+
.status-line.medium, .medium .cover-fill { background: #f9cd0b; }
|
|
177
|
+
.medium .chart { border:1px solid #f9cd0b; }
|
|
178
|
+
/* light yellow */
|
|
179
|
+
.medium { background: #fff4c2; }
|
|
180
|
+
|
|
181
|
+
.cstat-skip { background: #ddd; color: #111; }
|
|
182
|
+
.fstat-skip { background: #ddd; color: #111 !important; }
|
|
183
|
+
.cbranch-skip { background: #ddd !important; color: #111; }
|
|
184
|
+
|
|
185
|
+
span.cline-neutral { background: #eaeaea; }
|
|
186
|
+
|
|
187
|
+
.coverage-summary td.empty {
|
|
188
|
+
opacity: .5;
|
|
189
|
+
padding-top: 4px;
|
|
190
|
+
padding-bottom: 4px;
|
|
191
|
+
line-height: 1;
|
|
192
|
+
color: #888;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.cover-fill, .cover-empty {
|
|
196
|
+
display:inline-block;
|
|
197
|
+
height: 12px;
|
|
198
|
+
}
|
|
199
|
+
.chart {
|
|
200
|
+
line-height: 0;
|
|
201
|
+
}
|
|
202
|
+
.cover-empty {
|
|
203
|
+
background: white;
|
|
204
|
+
}
|
|
205
|
+
.cover-full {
|
|
206
|
+
border-right: none !important;
|
|
207
|
+
}
|
|
208
|
+
pre.prettyprint {
|
|
209
|
+
border: none !important;
|
|
210
|
+
padding: 0 !important;
|
|
211
|
+
margin: 0 !important;
|
|
212
|
+
}
|
|
213
|
+
.com { color: #999 !important; }
|
|
214
|
+
.ignore-none { color: #999; font-weight: normal; }
|
|
215
|
+
|
|
216
|
+
.wrapper {
|
|
217
|
+
min-height: 100%;
|
|
218
|
+
height: auto !important;
|
|
219
|
+
height: 100%;
|
|
220
|
+
margin: 0 auto -48px;
|
|
221
|
+
}
|
|
222
|
+
.footer, .push {
|
|
223
|
+
height: 48px;
|
|
224
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
var jumpToCode = (function init() {
|
|
3
|
+
// Classes of code we would like to highlight in the file view
|
|
4
|
+
var missingCoverageClasses = ['.cbranch-no', '.cstat-no', '.fstat-no'];
|
|
5
|
+
|
|
6
|
+
// Elements to highlight in the file listing view
|
|
7
|
+
var fileListingElements = ['td.pct.low'];
|
|
8
|
+
|
|
9
|
+
// We don't want to select elements that are direct descendants of another match
|
|
10
|
+
var notSelector = ':not(' + missingCoverageClasses.join('):not(') + ') > '; // becomes `:not(a):not(b) > `
|
|
11
|
+
|
|
12
|
+
// Selector that finds elements on the page to which we can jump
|
|
13
|
+
var selector =
|
|
14
|
+
fileListingElements.join(', ') +
|
|
15
|
+
', ' +
|
|
16
|
+
notSelector +
|
|
17
|
+
missingCoverageClasses.join(', ' + notSelector); // becomes `:not(a):not(b) > a, :not(a):not(b) > b`
|
|
18
|
+
|
|
19
|
+
// The NodeList of matching elements
|
|
20
|
+
var missingCoverageElements = document.querySelectorAll(selector);
|
|
21
|
+
|
|
22
|
+
var currentIndex;
|
|
23
|
+
|
|
24
|
+
function toggleClass(index) {
|
|
25
|
+
missingCoverageElements
|
|
26
|
+
.item(currentIndex)
|
|
27
|
+
.classList.remove('highlighted');
|
|
28
|
+
missingCoverageElements.item(index).classList.add('highlighted');
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function makeCurrent(index) {
|
|
32
|
+
toggleClass(index);
|
|
33
|
+
currentIndex = index;
|
|
34
|
+
missingCoverageElements.item(index).scrollIntoView({
|
|
35
|
+
behavior: 'smooth',
|
|
36
|
+
block: 'center',
|
|
37
|
+
inline: 'center'
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function goToPrevious() {
|
|
42
|
+
var nextIndex = 0;
|
|
43
|
+
if (typeof currentIndex !== 'number' || currentIndex === 0) {
|
|
44
|
+
nextIndex = missingCoverageElements.length - 1;
|
|
45
|
+
} else if (missingCoverageElements.length > 1) {
|
|
46
|
+
nextIndex = currentIndex - 1;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
makeCurrent(nextIndex);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function goToNext() {
|
|
53
|
+
var nextIndex = 0;
|
|
54
|
+
|
|
55
|
+
if (
|
|
56
|
+
typeof currentIndex === 'number' &&
|
|
57
|
+
currentIndex < missingCoverageElements.length - 1
|
|
58
|
+
) {
|
|
59
|
+
nextIndex = currentIndex + 1;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
makeCurrent(nextIndex);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return function jump(event) {
|
|
66
|
+
if (
|
|
67
|
+
document.getElementById('fileSearch') === document.activeElement &&
|
|
68
|
+
document.activeElement != null
|
|
69
|
+
) {
|
|
70
|
+
// if we're currently focused on the search input, we don't want to navigate
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
switch (event.which) {
|
|
75
|
+
case 78: // n
|
|
76
|
+
case 74: // j
|
|
77
|
+
goToNext();
|
|
78
|
+
break;
|
|
79
|
+
case 66: // b
|
|
80
|
+
case 75: // k
|
|
81
|
+
case 80: // p
|
|
82
|
+
goToPrevious();
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
})();
|
|
87
|
+
window.addEventListener('keydown', jumpToCode);
|