@xiee/utils 1.14.155 → 1.14.157

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/AGENTS.md CHANGED
@@ -35,6 +35,6 @@ CHROMIUM_PATH=/usr/bin/chromium-browser npm test # use an installed browser
35
35
 
36
36
  ## Releases
37
37
 
38
- Use `./release.sh [-p] [-t] [patch|minor|major|X.Y.Z]` (default: patch). It runs the tests (`-t` skips them), bumps the version in `package.json` and `package-lock.json`, commits `Bump to X.Y.Z`, and tags `vX.Y.Z`. `-p` also pushes the commit and the tag; pushing a `v*` tag triggers `.github/workflows/npm-publish.yml`, which builds the minified files, runs `npm publish`, and purges the CDN cache.
38
+ Use `./release.sh [-t] [patch|minor|major|X.Y.Z]` (default: patch). It pushes `main`, waits for the CI tests (`test.yml`; `-t` skips the wait) and, only if they pass, bumps the version in `package.json` and `package-lock.json`, commits `Bump to X.Y.Z`, tags `vX.Y.Z`, and pushes both. Pushing a `v*` tag triggers `.github/workflows/npm-publish.yml`, which builds the minified files, runs `npm publish`, and purges the CDN cache. The tests are not run locally: on a shared machine with a low thread limit (`ulimit -u`) too many parallel browsers crash.
39
39
 
40
- Pushing and tagging are outward-facing: run the script (and pass `-p`) only when the user asks for a release.
40
+ Pushing and tagging are outward-facing: run the script only when the user asks for a release.
@@ -141,10 +141,10 @@
141
141
  height: 1.2em;
142
142
  }
143
143
 
144
- /* column-visibility menu: eye button + checklist popup */
145
- .lti-cols {
144
+ /* popup menus: column-visibility checklist (eye button) and download formats */
145
+ .lti-cols, .lti-dl {
146
146
  position: relative;
147
- & > button {
147
+ & > button:not(.lti-download) {
148
148
  background: center / contain no-repeat url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none" stroke="gray" stroke-width="1.5"><path d="M1 8s2.5-4.5 7-4.5 7 4.5 7 4.5-2.5 4.5-7 4.5-7-4.5-7-4.5z"/><circle cx="8" cy="8" r="2"/></svg>');
149
149
  }
150
150
  .lti-menu {
@@ -167,11 +167,12 @@
167
167
  }
168
168
  .lti-sub { padding-left: 1em; }
169
169
  }
170
- /* a labeled chip sits at the bar's end: open leftward, inside the table */
171
- .lti-chip + .lti-menu { left: auto; right: 0; }
170
+ /* a labeled chip sits at the bar's end, as does the download button: open
171
+ leftward, inside the table */
172
+ .lti-chip + .lti-menu, &.lti-dl .lti-menu { left: auto; right: 0; }
172
173
  }
173
174
 
174
- /* CSV download icon button */
175
+ /* download icon button */
175
176
  .lti-download {
176
177
  background: center / contain no-repeat url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none" stroke="gray" stroke-width="1.5"><path d="M8 1v9m0 0L4.5 6.5M8 10l3.5-3.5"/><path d="M2 11v3h12v-3"/></svg>');
177
178
  }
@@ -1,2 +1,2 @@
1
- .lt-table{--lti-accent:#ffc800;& :is(.lti-head,.lti-pager-row) td{padding-left:0;padding-right:0}& .lti-search{background:url("data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"gray\" stroke-width=\"2\"><circle cx=\"6.5\" cy=\"6.5\" r=\"4.5\"/><path d=\"M10 10l5 5\"/></svg>") .4em/1em no-repeat;width:100%;padding:.5em 0 .5em 1.6em;&:focus{background-image:none;padding-left:.5em}}& .lti-nl{color:#555;font-size:.85em;&:empty{display:none}}& .lti-sortable .lti-label{cursor:pointer;user-select:none}& .lti-sort{margin-left:.3em;font-size:.8em}& .lti-prof svg{fill:currentColor;width:100%;min-width:4em;height:1.5em;& rect{opacity:.25}& rect.s{fill:var(--lti-accent);opacity:1}}& .lti-empty td{text-align:center}& .lti-expand{cursor:pointer;background:0 0;border:none;margin-right:.4em;padding:0}& .lti-detail>td{padding-left:1.5em}& th:has(.lti-resizer){position:relative}& .lti-resizer{cursor:col-resize;user-select:none;touch-action:none;width:5px;height:100%;position:absolute;top:0;right:0;&:hover{opacity:.3;background:currentColor}}&.lti-resizing{cursor:col-resize;user-select:none}&.lti-fixed{table-layout:fixed;& tbody tr:not(.lti-detail) td,& thead .lti-label{overflow:hidden}& thead .lti-label{vertical-align:bottom;max-width:100%;display:inline-block}}& .lti-bar{align-items:center;gap:1.2em;display:flex;& .lti-icons,& .lti-chips{flex:none;align-items:center;gap:.3em;display:flex}& .lti-chips{gap:.5em;&:empty{display:none}}&>.lti-search{flex:8em;min-width:6em}}& .lti-cols>button,& .lti-download{border:none;width:1.2em;height:1.2em;padding:0}& .lti-cols{position:relative;&>button{background:url("data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"gray\" stroke-width=\"1.5\"><path d=\"M1 8s2.5-4.5 7-4.5 7 4.5 7 4.5-2.5 4.5-7 4.5-7-4.5-7-4.5z\"/><circle cx=\"8\" cy=\"8\" r=\"2\"/></svg>") 50%/contain no-repeat}& .lti-menu{z-index:1;background:canvas;border:1px solid;padding:.3em .6em;position:absolute;top:100%;left:0;& label{white-space:nowrap;cursor:pointer;display:block}& .lti-group{white-space:nowrap;font-weight:600}& .lti-sub{padding-left:1em}}& .lti-chip+.lti-menu{left:auto;right:0}}& .lti-download{background:url("data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"gray\" stroke-width=\"1.5\"><path d=\"M8 1v9m0 0L4.5 6.5M8 10l3.5-3.5\"/><path d=\"M2 11v3h12v-3\"/></svg>") 50%/contain no-repeat}& .lti-chip{cursor:pointer;background:#f7f7f7;border:1px solid #ccc;border-radius:4px;align-items:center;gap:.3em;padding:.05em .5em;display:inline-flex;position:relative;&.lti-on{border-color:#999;& .lti-chip-name{font-weight:600}}& .lti-chip-cur{color:#555;font-variant-numeric:tabular-nums}& .lti-pop{position:static}}& .lti-pop{position:relative;& .lti-funnel{opacity:.4;background:currentColor;border:none;width:1.1em;height:1.1em;padding:0;mask:url("data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path d=\"M1 2h14l-5.5 6.5V14l-3 1V8.5z\"/></svg>") 50%/contain no-repeat}& .lti-off{mask:url("data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"black\" stroke-width=\"1.5\" stroke-linejoin=\"round\"><path d=\"M1 2h14l-5.5 6.5V14l-3 1V8.5z\"/></svg>") 50%/contain no-repeat}&.lti-on .lti-funnel{background:var(--lti-accent);opacity:1}& .lti-pop-panel{z-index:1;background:canvas;border:1px solid;flex-direction:column;gap:.5em;min-width:14em;max-width:90vw;padding:.6em;display:flex;position:absolute;top:100%;left:0;& .lti-widget{display:contents}&[hidden],& [hidden]{display:none}& .lti-check{white-space:nowrap;cursor:pointer;align-items:center;gap:.4em;display:flex}}}& .lti-slider{height:1.2em;margin:.4em .6em;position:relative;&:before{content:"";background:#c8c8c8;border-radius:3px;height:3px;position:absolute;inset:50% 0 auto;transform:translateY(-50%)}& .lti-slider-fill{background:#4a90d9;height:3px;position:absolute;inset:50% 0;transform:translateY(-50%)}& .lti-thumb{cursor:pointer;touch-action:none;background:#4a90d9;border:2px solid #fff;border-radius:50%;width:14px;height:14px;padding:0;position:absolute;top:50%;transform:translate(-50%,-50%);box-shadow:0 0 2px #0006}}& .lti-slider-out{text-align:center;font-variant-numeric:tabular-nums}& .lti-pager{align-items:center;gap:.3em;display:flex}& button,& select{font:inherit;cursor:pointer}& .lti-pos{margin:0 auto 0 .3em}}.lti-busy{&,& *{cursor:wait!important}& tbody{opacity:.5}}
1
+ .lt-table{--lti-accent:#ffc800;& :is(.lti-head,.lti-pager-row) td{padding-left:0;padding-right:0}& .lti-search{background:url("data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"gray\" stroke-width=\"2\"><circle cx=\"6.5\" cy=\"6.5\" r=\"4.5\"/><path d=\"M10 10l5 5\"/></svg>") .4em/1em no-repeat;width:100%;padding:.5em 0 .5em 1.6em;&:focus{background-image:none;padding-left:.5em}}& .lti-nl{color:#555;font-size:.85em;&:empty{display:none}}& .lti-sortable .lti-label{cursor:pointer;user-select:none}& .lti-sort{margin-left:.3em;font-size:.8em}& .lti-prof svg{fill:currentColor;width:100%;min-width:4em;height:1.5em;& rect{opacity:.25}& rect.s{fill:var(--lti-accent);opacity:1}}& .lti-empty td{text-align:center}& .lti-expand{cursor:pointer;background:0 0;border:none;margin-right:.4em;padding:0}& .lti-detail>td{padding-left:1.5em}& th:has(.lti-resizer){position:relative}& .lti-resizer{cursor:col-resize;user-select:none;touch-action:none;width:5px;height:100%;position:absolute;top:0;right:0;&:hover{opacity:.3;background:currentColor}}&.lti-resizing{cursor:col-resize;user-select:none}&.lti-fixed{table-layout:fixed;& tbody tr:not(.lti-detail) td,& thead .lti-label{overflow:hidden}& thead .lti-label{vertical-align:bottom;max-width:100%;display:inline-block}}& .lti-bar{align-items:center;gap:1.2em;display:flex;& .lti-icons,& .lti-chips{flex:none;align-items:center;gap:.3em;display:flex}& .lti-chips{gap:.5em;&:empty{display:none}}&>.lti-search{flex:8em;min-width:6em}}& .lti-cols>button,& .lti-download{border:none;width:1.2em;height:1.2em;padding:0}& .lti-cols,& .lti-dl{position:relative;&>button:not(.lti-download){background:url("data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"gray\" stroke-width=\"1.5\"><path d=\"M1 8s2.5-4.5 7-4.5 7 4.5 7 4.5-2.5 4.5-7 4.5-7-4.5-7-4.5z\"/><circle cx=\"8\" cy=\"8\" r=\"2\"/></svg>") 50%/contain no-repeat}& .lti-menu{z-index:1;background:canvas;border:1px solid;padding:.3em .6em;position:absolute;top:100%;left:0;& label{white-space:nowrap;cursor:pointer;display:block}& .lti-group{white-space:nowrap;font-weight:600}& .lti-sub{padding-left:1em}}& .lti-chip+.lti-menu,&.lti-dl .lti-menu{left:auto;right:0}}& .lti-download{background:url("data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"gray\" stroke-width=\"1.5\"><path d=\"M8 1v9m0 0L4.5 6.5M8 10l3.5-3.5\"/><path d=\"M2 11v3h12v-3\"/></svg>") 50%/contain no-repeat}& .lti-chip{cursor:pointer;background:#f7f7f7;border:1px solid #ccc;border-radius:4px;align-items:center;gap:.3em;padding:.05em .5em;display:inline-flex;position:relative;&.lti-on{border-color:#999;& .lti-chip-name{font-weight:600}}& .lti-chip-cur{color:#555;font-variant-numeric:tabular-nums}& .lti-pop{position:static}}& .lti-pop{position:relative;& .lti-funnel{opacity:.4;background:currentColor;border:none;width:1.1em;height:1.1em;padding:0;mask:url("data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path d=\"M1 2h14l-5.5 6.5V14l-3 1V8.5z\"/></svg>") 50%/contain no-repeat}& .lti-off{mask:url("data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"black\" stroke-width=\"1.5\" stroke-linejoin=\"round\"><path d=\"M1 2h14l-5.5 6.5V14l-3 1V8.5z\"/></svg>") 50%/contain no-repeat}&.lti-on .lti-funnel{background:var(--lti-accent);opacity:1}& .lti-pop-panel{z-index:1;background:canvas;border:1px solid;flex-direction:column;gap:.5em;min-width:14em;max-width:90vw;padding:.6em;display:flex;position:absolute;top:100%;left:0;& .lti-widget{display:contents}&[hidden],& [hidden]{display:none}& .lti-check{white-space:nowrap;cursor:pointer;align-items:center;gap:.4em;display:flex}}}& .lti-slider{height:1.2em;margin:.4em .6em;position:relative;&:before{content:"";background:#c8c8c8;border-radius:3px;height:3px;position:absolute;inset:50% 0 auto;transform:translateY(-50%)}& .lti-slider-fill{background:#4a90d9;height:3px;position:absolute;inset:50% 0;transform:translateY(-50%)}& .lti-thumb{cursor:pointer;touch-action:none;background:#4a90d9;border:2px solid #fff;border-radius:50%;width:14px;height:14px;padding:0;position:absolute;top:50%;transform:translate(-50%,-50%);box-shadow:0 0 2px #0006}}& .lti-slider-out{text-align:center;font-variant-numeric:tabular-nums}& .lti-pager{align-items:center;gap:.3em;display:flex}& button,& select{font:inherit;cursor:pointer}& .lti-pos{margin:0 auto 0 .3em}}.lti-busy{&,& *{cursor:wait!important}& tbody{opacity:.5}}
2
2
  /*# sourceMappingURL=lt-interactive.min.css.map */
@@ -1 +1 @@
1
- {"version":3,"mappings":"AAGA,+BAIE,kEAOA,oSAKE,iDAOF,qCAGE,sBAIF,2DAKA,4CAMA,wEAKE,mBACA,2CAGF,kCAKA,oFAQA,oCAKA,yCAGA,0HASE,4CAMF,kDAKA,+BAIE,kEAGA,8EASF,qDAKE,6EAOA,sBAIE,sBAGF,sCAOF,kFAQA,8BAEE,wSAGA,6GAQE,wDAMA,gDAIA,6BAGF,yCAIF,6QAKA,2KAYE,2BAEE,kCAEF,6DAKA,4BAEF,6BAEE,uQAUA,gQAIA,4DAIA,uLAaE,+BACA,kCAEA,0FAWJ,8DAIE,kIASA,0GAOA,6NAeF,sEAKA,sDAKA,8CAKA,iCAMF,UAEE,4BAGA","sources":["lt-interactive.css"],"sourcesContent":["/* Controls for lt-interactive.js. `lti-*` classes avoid clashing with core\n * `lt-*`. Declare only properties that change a default. */\n\n.lt-table {\n /* accent for active filter and profile highlight */\n --lti-accent: #ffc800;\n /* full-width rows: align with table edges, not cell text */\n :is(.lti-head, .lti-pager-row) td {\n padding-left: 0;\n padding-right: 0;\n }\n\n /* Box fills its cell. Faded magnifier replaces a (translatable) placeholder;\n * hidden on focus. */\n .lti-search {\n width: 100%;\n padding: .5em 0 .5em 1.6em;\n background: url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"gray\" stroke-width=\"2\"><circle cx=\"6.5\" cy=\"6.5\" r=\"4.5\"/><path d=\"M10 10l5 5\"/></svg>') 0.4em center / 1em no-repeat;\n /* no icon on focus: smaller left pad so caret sits near the edge */\n &:focus {\n padding-left: .5em;\n background-image: none;\n }\n }\n\n /* how a query was read: shown only when conditions were recognized */\n .lti-nl {\n font-size: .85em;\n color: #555;\n &:empty { display: none; }\n }\n\n /* click target is the label, not the cell (keeps resize grip separate) */\n .lti-sortable .lti-label {\n cursor: pointer;\n user-select: none;\n }\n /* ▲/▼ indicator */\n .lti-sort {\n margin-left: 0.3em;\n font-size: 0.8em;\n }\n\n /* column profile: mini histogram in the header */\n .lti-prof svg {\n width: 100%;\n height: 1.5em;\n min-width: 4em;\n fill: currentColor;\n rect { opacity: 0.25; }\n rect.s { fill: var(--lti-accent); opacity: 1; }\n }\n\n .lti-empty td {\n text-align: center;\n }\n\n /* expand caret: glyph is its own (▸ / ▾), so strip button chrome */\n .lti-expand {\n border: none;\n background: none;\n padding: 0;\n margin-right: 0.4em;\n cursor: pointer;\n }\n /* inset ties the detail to the row above */\n .lti-detail > td {\n padding-left: 1.5em;\n }\n\n /* drag grip on a column's right edge */\n th:has(.lti-resizer) {\n position: relative;\n }\n .lti-resizer {\n position: absolute;\n top: 0;\n right: 0;\n width: 5px;\n height: 100%;\n cursor: col-resize;\n user-select: none;\n touch-action: none;\n &:hover {\n background: currentColor;\n opacity: 0.3;\n }\n }\n /* keep resize cursor and block text selection during drag */\n &.lti-resizing {\n cursor: col-resize;\n user-select: none;\n }\n /* frozen widths are authoritative: a drag moves one edge only */\n &.lti-fixed {\n table-layout: fixed;\n /* clip a shrunk column's cells and labels so the grip can shrink it freely;\n * header cells (holding filter popovers) and the detail row must overflow */\n tbody tr:not(.lti-detail) td, thead .lti-label {\n overflow: hidden;\n }\n thead .lti-label {\n display: inline-block;\n max-width: 100%;\n vertical-align: bottom;\n }\n }\n\n /* control bar: search, chips, icons. Only search grows, taking free space; it\n * fills the bar when alone. */\n .lti-bar {\n display: flex;\n align-items: center;\n /* wide gap between parts ... */\n gap: 1.2em;\n .lti-icons, .lti-chips {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n /* ... tight within a part */\n gap: 0.3em;\n }\n .lti-chips {\n gap: 0.5em;\n /* always present as a drop target for caller chips (el._lt.chips);\n collapse when empty to avoid a stray gap */\n &:empty { display: none; }\n }\n /* direct child only: chip popovers hold their own `.lti-search` */\n & > .lti-search {\n flex: 1 1 8em;\n min-width: 6em;\n }\n }\n\n /* shared size of eye and download buttons */\n .lti-cols > button, .lti-download {\n border: none;\n padding: 0;\n width: 1.2em;\n height: 1.2em;\n }\n\n /* column-visibility menu: eye button + checklist popup */\n .lti-cols {\n position: relative;\n & > button {\n background: center / contain no-repeat url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"gray\" stroke-width=\"1.5\"><path d=\"M1 8s2.5-4.5 7-4.5 7 4.5 7 4.5-2.5 4.5-7 4.5-7-4.5-7-4.5z\"/><circle cx=\"8\" cy=\"8\" r=\"2\"/></svg>');\n }\n .lti-menu {\n position: absolute;\n z-index: 1;\n top: 100%;\n left: 0;\n background: Canvas;\n border: 1px solid;\n padding: 0.3em 0.6em;\n label {\n display: block;\n white-space: nowrap;\n cursor: pointer;\n }\n /* spanner label above its indented columns */\n .lti-group {\n font-weight: 600;\n white-space: nowrap;\n }\n .lti-sub { padding-left: 1em; }\n }\n /* a labeled chip sits at the bar's end: open leftward, inside the table */\n .lti-chip + .lti-menu { left: auto; right: 0; }\n }\n\n /* CSV download icon button */\n .lti-download {\n background: center / contain no-repeat url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"gray\" stroke-width=\"1.5\"><path d=\"M8 1v9m0 0L4.5 6.5M8 10l3.5-3.5\"/><path d=\"M2 11v3h12v-3\"/></svg>');\n }\n\n /* typed filter chip: label, filter summary, funnel opening widget + box */\n .lti-chip {\n /* whole chip is the click target and panel anchor (panel flush with chip) */\n position: relative;\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n gap: 0.3em;\n /* pill look separates chips */\n padding: 0.05em 0.5em;\n border: 1px solid #ccc;\n border-radius: 4px;\n background: #f7f7f7;\n &.lti-on {\n border-color: #999;\n .lti-chip-name { font-weight: 600; }\n }\n .lti-chip-cur {\n color: #555;\n font-variant-numeric: tabular-nums;\n }\n /* panel positions against the chip, not the funnel wrap */\n .lti-pop { position: static; }\n }\n .lti-pop {\n position: relative;\n .lti-funnel {\n border: none;\n padding: 0;\n width: 1.1em;\n height: 1.1em;\n background: currentColor;\n opacity: 0.4;\n mask: center / contain no-repeat url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path d=\"M1 2h14l-5.5 6.5V14l-3 1V8.5z\"/></svg>');\n }\n /* disabled column filter: outline funnel (stroke, no fill), inert */\n .lti-off {\n mask: center / contain no-repeat url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"black\" stroke-width=\"1.5\" stroke-linejoin=\"round\"><path d=\"M1 2h14l-5.5 6.5V14l-3 1V8.5z\"/></svg>');\n }\n /* active when the column has a live term: accent funnel */\n &.lti-on .lti-funnel {\n background: var(--lti-accent);\n opacity: 1;\n }\n .lti-pop-panel {\n position: absolute;\n z-index: 1;\n top: 100%;\n left: 0;\n display: flex;\n flex-direction: column;\n gap: 0.5em;\n min-width: 14em;\n max-width: 90vw;\n padding: 0.6em;\n background: Canvas;\n border: 1px solid;\n .lti-widget { display: contents; }\n &[hidden], [hidden] { display: none; }\n /* checklist row: checkbox + label */\n .lti-check {\n display: flex;\n align-items: center;\n gap: 0.4em;\n white-space: nowrap;\n cursor: pointer;\n }\n }\n }\n\n /* range slider: track, fill band, two button thumbs */\n .lti-slider {\n position: relative;\n height: 1.2em;\n margin: 0.4em 0.6em;\n &::before {\n content: \"\";\n position: absolute;\n inset: 50% 0 auto;\n height: 3px;\n transform: translateY(-50%);\n background: #c8c8c8;\n border-radius: 3px;\n }\n .lti-slider-fill {\n position: absolute;\n inset: 50% 0;\n height: 3px;\n transform: translateY(-50%);\n background: #4a90d9;\n }\n .lti-thumb {\n position: absolute;\n top: 50%;\n width: 14px;\n height: 14px;\n padding: 0;\n transform: translate(-50%, -50%);\n border: 2px solid #fff;\n border-radius: 50%;\n background: #4a90d9;\n box-shadow: 0 0 2px rgba(0, 0, 0, 0.4);\n cursor: pointer;\n touch-action: none;\n }\n }\n .lti-slider-out {\n text-align: center;\n font-variant-numeric: tabular-nums;\n }\n\n .lti-pager {\n display: flex;\n align-items: center;\n gap: 0.3em;\n }\n button, select {\n font: inherit;\n cursor: pointer;\n }\n /* row count away from arrows; page size pushed to far end */\n .lti-pos {\n margin: 0 auto 0 0.3em;\n }\n}\n\n/* Busy state during a page-freezing recompute (see lt-interactive.js). */\n.lti-busy {\n /* beat controls' own cursors */\n &, & * {\n cursor: wait !important;\n }\n & tbody {\n opacity: 0.5;\n }\n}\n"],"names":[]}
1
+ {"version":3,"mappings":"AAGA,+BAIE,kEAOA,oSAKE,iDAOF,qCAGE,sBAIF,2DAKA,4CAMA,wEAKE,mBACA,2CAGF,kCAKA,oFAQA,oCAKA,yCAGA,0HASE,4CAMF,kDAKA,+BAIE,kEAGA,8EASF,qDAKE,6EAOA,sBAIE,sBAGF,sCAOF,kFAQA,wCAEE,2TAGA,6GAQE,wDAMA,gDAIA,6BAIF,4DAIF,6QAKA,2KAYE,2BAEE,kCAEF,6DAKA,4BAEF,6BAEE,uQAUA,gQAIA,4DAIA,uLAaE,+BACA,kCAEA,0FAWJ,8DAIE,kIASA,0GAOA,6NAeF,sEAKA,sDAKA,8CAKA,iCAMF,UAEE,4BAGA","sources":["lt-interactive.css"],"sourcesContent":["/* Controls for lt-interactive.js. `lti-*` classes avoid clashing with core\n * `lt-*`. Declare only properties that change a default. */\n\n.lt-table {\n /* accent for active filter and profile highlight */\n --lti-accent: #ffc800;\n /* full-width rows: align with table edges, not cell text */\n :is(.lti-head, .lti-pager-row) td {\n padding-left: 0;\n padding-right: 0;\n }\n\n /* Box fills its cell. Faded magnifier replaces a (translatable) placeholder;\n * hidden on focus. */\n .lti-search {\n width: 100%;\n padding: .5em 0 .5em 1.6em;\n background: url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"gray\" stroke-width=\"2\"><circle cx=\"6.5\" cy=\"6.5\" r=\"4.5\"/><path d=\"M10 10l5 5\"/></svg>') 0.4em center / 1em no-repeat;\n /* no icon on focus: smaller left pad so caret sits near the edge */\n &:focus {\n padding-left: .5em;\n background-image: none;\n }\n }\n\n /* how a query was read: shown only when conditions were recognized */\n .lti-nl {\n font-size: .85em;\n color: #555;\n &:empty { display: none; }\n }\n\n /* click target is the label, not the cell (keeps resize grip separate) */\n .lti-sortable .lti-label {\n cursor: pointer;\n user-select: none;\n }\n /* ▲/▼ indicator */\n .lti-sort {\n margin-left: 0.3em;\n font-size: 0.8em;\n }\n\n /* column profile: mini histogram in the header */\n .lti-prof svg {\n width: 100%;\n height: 1.5em;\n min-width: 4em;\n fill: currentColor;\n rect { opacity: 0.25; }\n rect.s { fill: var(--lti-accent); opacity: 1; }\n }\n\n .lti-empty td {\n text-align: center;\n }\n\n /* expand caret: glyph is its own (▸ / ▾), so strip button chrome */\n .lti-expand {\n border: none;\n background: none;\n padding: 0;\n margin-right: 0.4em;\n cursor: pointer;\n }\n /* inset ties the detail to the row above */\n .lti-detail > td {\n padding-left: 1.5em;\n }\n\n /* drag grip on a column's right edge */\n th:has(.lti-resizer) {\n position: relative;\n }\n .lti-resizer {\n position: absolute;\n top: 0;\n right: 0;\n width: 5px;\n height: 100%;\n cursor: col-resize;\n user-select: none;\n touch-action: none;\n &:hover {\n background: currentColor;\n opacity: 0.3;\n }\n }\n /* keep resize cursor and block text selection during drag */\n &.lti-resizing {\n cursor: col-resize;\n user-select: none;\n }\n /* frozen widths are authoritative: a drag moves one edge only */\n &.lti-fixed {\n table-layout: fixed;\n /* clip a shrunk column's cells and labels so the grip can shrink it freely;\n * header cells (holding filter popovers) and the detail row must overflow */\n tbody tr:not(.lti-detail) td, thead .lti-label {\n overflow: hidden;\n }\n thead .lti-label {\n display: inline-block;\n max-width: 100%;\n vertical-align: bottom;\n }\n }\n\n /* control bar: search, chips, icons. Only search grows, taking free space; it\n * fills the bar when alone. */\n .lti-bar {\n display: flex;\n align-items: center;\n /* wide gap between parts ... */\n gap: 1.2em;\n .lti-icons, .lti-chips {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n /* ... tight within a part */\n gap: 0.3em;\n }\n .lti-chips {\n gap: 0.5em;\n /* always present as a drop target for caller chips (el._lt.chips);\n collapse when empty to avoid a stray gap */\n &:empty { display: none; }\n }\n /* direct child only: chip popovers hold their own `.lti-search` */\n & > .lti-search {\n flex: 1 1 8em;\n min-width: 6em;\n }\n }\n\n /* shared size of eye and download buttons */\n .lti-cols > button, .lti-download {\n border: none;\n padding: 0;\n width: 1.2em;\n height: 1.2em;\n }\n\n /* popup menus: column-visibility checklist (eye button) and download formats */\n .lti-cols, .lti-dl {\n position: relative;\n & > button:not(.lti-download) {\n background: center / contain no-repeat url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"gray\" stroke-width=\"1.5\"><path d=\"M1 8s2.5-4.5 7-4.5 7 4.5 7 4.5-2.5 4.5-7 4.5-7-4.5-7-4.5z\"/><circle cx=\"8\" cy=\"8\" r=\"2\"/></svg>');\n }\n .lti-menu {\n position: absolute;\n z-index: 1;\n top: 100%;\n left: 0;\n background: Canvas;\n border: 1px solid;\n padding: 0.3em 0.6em;\n label {\n display: block;\n white-space: nowrap;\n cursor: pointer;\n }\n /* spanner label above its indented columns */\n .lti-group {\n font-weight: 600;\n white-space: nowrap;\n }\n .lti-sub { padding-left: 1em; }\n }\n /* a labeled chip sits at the bar's end, as does the download button: open\n leftward, inside the table */\n .lti-chip + .lti-menu, &.lti-dl .lti-menu { left: auto; right: 0; }\n }\n\n /* download icon button */\n .lti-download {\n background: center / contain no-repeat url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"gray\" stroke-width=\"1.5\"><path d=\"M8 1v9m0 0L4.5 6.5M8 10l3.5-3.5\"/><path d=\"M2 11v3h12v-3\"/></svg>');\n }\n\n /* typed filter chip: label, filter summary, funnel opening widget + box */\n .lti-chip {\n /* whole chip is the click target and panel anchor (panel flush with chip) */\n position: relative;\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n gap: 0.3em;\n /* pill look separates chips */\n padding: 0.05em 0.5em;\n border: 1px solid #ccc;\n border-radius: 4px;\n background: #f7f7f7;\n &.lti-on {\n border-color: #999;\n .lti-chip-name { font-weight: 600; }\n }\n .lti-chip-cur {\n color: #555;\n font-variant-numeric: tabular-nums;\n }\n /* panel positions against the chip, not the funnel wrap */\n .lti-pop { position: static; }\n }\n .lti-pop {\n position: relative;\n .lti-funnel {\n border: none;\n padding: 0;\n width: 1.1em;\n height: 1.1em;\n background: currentColor;\n opacity: 0.4;\n mask: center / contain no-repeat url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path d=\"M1 2h14l-5.5 6.5V14l-3 1V8.5z\"/></svg>');\n }\n /* disabled column filter: outline funnel (stroke, no fill), inert */\n .lti-off {\n mask: center / contain no-repeat url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"black\" stroke-width=\"1.5\" stroke-linejoin=\"round\"><path d=\"M1 2h14l-5.5 6.5V14l-3 1V8.5z\"/></svg>');\n }\n /* active when the column has a live term: accent funnel */\n &.lti-on .lti-funnel {\n background: var(--lti-accent);\n opacity: 1;\n }\n .lti-pop-panel {\n position: absolute;\n z-index: 1;\n top: 100%;\n left: 0;\n display: flex;\n flex-direction: column;\n gap: 0.5em;\n min-width: 14em;\n max-width: 90vw;\n padding: 0.6em;\n background: Canvas;\n border: 1px solid;\n .lti-widget { display: contents; }\n &[hidden], [hidden] { display: none; }\n /* checklist row: checkbox + label */\n .lti-check {\n display: flex;\n align-items: center;\n gap: 0.4em;\n white-space: nowrap;\n cursor: pointer;\n }\n }\n }\n\n /* range slider: track, fill band, two button thumbs */\n .lti-slider {\n position: relative;\n height: 1.2em;\n margin: 0.4em 0.6em;\n &::before {\n content: \"\";\n position: absolute;\n inset: 50% 0 auto;\n height: 3px;\n transform: translateY(-50%);\n background: #c8c8c8;\n border-radius: 3px;\n }\n .lti-slider-fill {\n position: absolute;\n inset: 50% 0;\n height: 3px;\n transform: translateY(-50%);\n background: #4a90d9;\n }\n .lti-thumb {\n position: absolute;\n top: 50%;\n width: 14px;\n height: 14px;\n padding: 0;\n transform: translate(-50%, -50%);\n border: 2px solid #fff;\n border-radius: 50%;\n background: #4a90d9;\n box-shadow: 0 0 2px rgba(0, 0, 0, 0.4);\n cursor: pointer;\n touch-action: none;\n }\n }\n .lti-slider-out {\n text-align: center;\n font-variant-numeric: tabular-nums;\n }\n\n .lti-pager {\n display: flex;\n align-items: center;\n gap: 0.3em;\n }\n button, select {\n font: inherit;\n cursor: pointer;\n }\n /* row count away from arrows; page size pushed to far end */\n .lti-pos {\n margin: 0 auto 0 0.3em;\n }\n}\n\n/* Busy state during a page-freezing recompute (see lt-interactive.js). */\n.lti-busy {\n /* beat controls' own cursors */\n &, & * {\n cursor: wait !important;\n }\n & tbody {\n opacity: 0.5;\n }\n}\n"],"names":[]}
package/css/pages.css CHANGED
@@ -204,17 +204,19 @@
204
204
  align-items: flex-start;
205
205
  gap: .5em;
206
206
  font: 14px sans-serif;
207
- button, .pagesjs-panel {
207
+ & > a, .pagesjs-panel {
208
208
  background: Canvas;
209
209
  color: CanvasText;
210
210
  border: 1px solid;
211
211
  border-radius: .3em;
212
212
  }
213
- button {
213
+ & > a {
214
+ display: flex;
215
+ align-items: center;
216
+ justify-content: center;
214
217
  width: 2.2em;
215
218
  height: 2.2em;
216
- padding: 0;
217
- cursor: pointer;
219
+ text-decoration: none;
218
220
  }
219
221
  }
220
222
  .pagesjs-panel {
package/css/pages.min.css CHANGED
@@ -1,2 +1,2 @@
1
- :root{--paper-width:210mm;--paper-height:297mm;--paper-margin-top:40px;--paper-margin-right:80px;--paper-margin-bottom:40px;--paper-margin-left:80px;--page-header-height:40px;--page-header-bottom:40px;--page-footer-height:40px;--page-footer-top:40px;--paper-w:var(--paper-width);--paper-h:var(--paper-height)}@page{size:var(--paper-width) var(--paper-height);margin:0}@page wide{size:var(--paper-height) var(--paper-width);margin:0}@page multiple{margin-top:var(--paper-margin-top);margin-bottom:var(--paper-margin-bottom)}.page-multiple{page:multiple}.page-wide{page:wide;--paper-width:var(--paper-h);--paper-height:var(--paper-w)}.pagesjs{flex-wrap:wrap;justify-content:center;gap:5mm;max-width:100%;margin:5mm;padding:0;display:flex;& .pagesjs-front,& .chapter{min-height:unset;box-shadow:none}&>*,&:not(:has(.pagesjs-front)):has(.chapter-toc) #TOC:not(.chapter-toc){display:none}& .pagesjs-page{width:var(--paper-width);height:var(--paper-height);padding:var(--paper-margin-top) var(--paper-margin-right) var(--paper-margin-bottom) var(--paper-margin-left);break-before:page;flex-direction:column;flex:none;justify-content:space-between;display:flex;overflow:hidden;& img{max-width:100%}& .chapter-before,& .chapter-after,& .buttons:has(+.chapter-before){display:none}& #TOC{border:none;margin-left:auto;padding:0;&:not(.chapter-toc):is(.fragment-first,:not(.pagesjs-fragmented)):before{content:"Contents";margin-bottom:1em;font-size:1.5em;font-weight:700;display:block}& a{display:flex;&:after{content:attr(data-page-number);align-self:end;margin-left:1ch}& .section-number{margin-right:.3em}& .toc-text{flex:1 0;position:relative;overflow:hidden;&:after{content:"";border-bottom:1px dashed;width:100%;margin-left:1ch;position:absolute;bottom:1.5ex}}}}& .pagesjs-wrap{box-shadow:none!important;float:none!important;background:0 0!important;border:none!important;width:auto!important;max-width:none!important;height:auto!important;min-height:0!important;margin:0!important;padding:0!important;display:block!important;position:static!important;transform:none!important}& .pagesjs-run{display:block}& .pagesjs-fragmented{&:not(.fragment-first){border-top:none;margin-top:0;&>thead{opacity:.5}}&:not(.fragment-last){border-bottom:none;margin-bottom:0;&>tfoot{opacity:.5}}}& li.pagesjs-fragmented:not(.fragment-first)::marker{content:""}& .fullwidth{float:none;max-width:none;width:var(--paper-width);margin-left:calc(0px - var(--paper-margin-left));transform:none;& *{max-width:calc(var(--paper-width) - 4em)}}&.page-float .pagesjs-body{flex-direction:column;justify-content:safe center;display:flex}& .footnotes{margin-top:1.5em}& .footnotes:before{content:"";border-top:1px solid;max-width:20em;display:block}&:has(.side-left,.embed-left) .pagesjs-body{padding-left:calc(0px - var(--side-margin));& .fullwidth{transform:translate(var(--side-margin))}}&:has(.side-right,.embed-right) .pagesjs-body{padding-right:calc(0px - var(--side-margin))}& .side{background:0 0;font-size:.9em}}}.pagesjs>.pagesjs-progress{z-index:9999;color:#fff;background:#000000bf;border-radius:1em;padding:.3em .8em;font:14px sans-serif;display:block;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%)}.pagesjs-hit{outline-offset:2px;outline:3px solid #e33}.pagesjs-tools{z-index:9999;flex-direction:column;align-items:flex-start;gap:.5em;font:14px sans-serif;display:flex;position:absolute;top:1em;left:1em;& button,& .pagesjs-panel{color:canvastext;background:canvas;border:1px solid;border-radius:.3em}& button{cursor:pointer;width:2.2em;height:2.2em;padding:0}}.pagesjs-panel{width:min(30em,100vw - 5em);max-height:calc(100vh - 2em);padding:.5em 1em;position:absolute;top:0;left:calc(100% + .5em);overflow:auto;box-shadow:0 2px 8px #0000004d;& ul{margin:0;padding-left:1.2em;list-style:none}&>nav>ul,& .pagesjs-problems{padding-left:0}& a{color:inherit;padding:.15em 0;text-decoration:none;display:block}& a:before{content:attr(data-page-number);float:right;opacity:.6}& a:hover{text-decoration:underline}& li{cursor:pointer;padding:.15em 0}}.pagesjs-settle .pagesjs-body{padding:0!important}.pagesjs-header,.pagesjs-footer{justify-content:space-between;font-size:.9em;display:flex}.pagesjs-header{flex:0 0 var(--page-header-height);margin-bottom:var(--page-header-bottom);align-items:end;&:before{content:attr(data-main-title)}&:after{content:attr(data-page-title)}}.pagesjs-footer{flex:0 0 var(--page-footer-height);margin-top:var(--page-footer-top);align-items:start;&:before{content:attr(data-page-url)}&:after{content:attr(data-page-number)}}.pagesjs-body{flex-grow:1;min-height:0;position:relative}@media only screen{.pagesjs{background:#f7f7f7;& .pagesjs-page{background:#fff}& .page-multiple{overflow-y:auto}}.pagesjs-filling{display:block;& .pagesjs-page{opacity:0;height:auto}}}.pagesjs .pagesjs-tools{position:fixed}@media print{.pagesjs-tools{display:none}.pagesjs-hit{outline:none}.pagesjs{gap:0;margin:0;display:block;& .page-multiple{height:auto;padding-top:0;padding-bottom:0}}}@media (prefers-color-scheme:dark){.pagesjs-page{box-shadow:0 0 0 1px #bbb}}
1
+ :root{--paper-width:210mm;--paper-height:297mm;--paper-margin-top:40px;--paper-margin-right:80px;--paper-margin-bottom:40px;--paper-margin-left:80px;--page-header-height:40px;--page-header-bottom:40px;--page-footer-height:40px;--page-footer-top:40px;--paper-w:var(--paper-width);--paper-h:var(--paper-height)}@page{size:var(--paper-width) var(--paper-height);margin:0}@page wide{size:var(--paper-height) var(--paper-width);margin:0}@page multiple{margin-top:var(--paper-margin-top);margin-bottom:var(--paper-margin-bottom)}.page-multiple{page:multiple}.page-wide{page:wide;--paper-width:var(--paper-h);--paper-height:var(--paper-w)}.pagesjs{flex-wrap:wrap;justify-content:center;gap:5mm;max-width:100%;margin:5mm;padding:0;display:flex;& .pagesjs-front,& .chapter{min-height:unset;box-shadow:none}&>*,&:not(:has(.pagesjs-front)):has(.chapter-toc) #TOC:not(.chapter-toc){display:none}& .pagesjs-page{width:var(--paper-width);height:var(--paper-height);padding:var(--paper-margin-top) var(--paper-margin-right) var(--paper-margin-bottom) var(--paper-margin-left);break-before:page;flex-direction:column;flex:none;justify-content:space-between;display:flex;overflow:hidden;& img{max-width:100%}& .chapter-before,& .chapter-after,& .buttons:has(+.chapter-before){display:none}& #TOC{border:none;margin-left:auto;padding:0;&:not(.chapter-toc):is(.fragment-first,:not(.pagesjs-fragmented)):before{content:"Contents";margin-bottom:1em;font-size:1.5em;font-weight:700;display:block}& a{display:flex;&:after{content:attr(data-page-number);align-self:end;margin-left:1ch}& .section-number{margin-right:.3em}& .toc-text{flex:1 0;position:relative;overflow:hidden;&:after{content:"";border-bottom:1px dashed;width:100%;margin-left:1ch;position:absolute;bottom:1.5ex}}}}& .pagesjs-wrap{box-shadow:none!important;float:none!important;background:0 0!important;border:none!important;width:auto!important;max-width:none!important;height:auto!important;min-height:0!important;margin:0!important;padding:0!important;display:block!important;position:static!important;transform:none!important}& .pagesjs-run{display:block}& .pagesjs-fragmented{&:not(.fragment-first){border-top:none;margin-top:0;&>thead{opacity:.5}}&:not(.fragment-last){border-bottom:none;margin-bottom:0;&>tfoot{opacity:.5}}}& li.pagesjs-fragmented:not(.fragment-first)::marker{content:""}& .fullwidth{float:none;max-width:none;width:var(--paper-width);margin-left:calc(0px - var(--paper-margin-left));transform:none;& *{max-width:calc(var(--paper-width) - 4em)}}&.page-float .pagesjs-body{flex-direction:column;justify-content:safe center;display:flex}& .footnotes{margin-top:1.5em}& .footnotes:before{content:"";border-top:1px solid;max-width:20em;display:block}&:has(.side-left,.embed-left) .pagesjs-body{padding-left:calc(0px - var(--side-margin));& .fullwidth{transform:translate(var(--side-margin))}}&:has(.side-right,.embed-right) .pagesjs-body{padding-right:calc(0px - var(--side-margin))}& .side{background:0 0;font-size:.9em}}}.pagesjs>.pagesjs-progress{z-index:9999;color:#fff;background:#000000bf;border-radius:1em;padding:.3em .8em;font:14px sans-serif;display:block;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%)}.pagesjs-hit{outline-offset:2px;outline:3px solid #e33}.pagesjs-tools{z-index:9999;flex-direction:column;align-items:flex-start;gap:.5em;font:14px sans-serif;display:flex;position:absolute;top:1em;left:1em;&>a,& .pagesjs-panel{color:canvastext;background:canvas;border:1px solid;border-radius:.3em}&>a{justify-content:center;align-items:center;width:2.2em;height:2.2em;text-decoration:none;display:flex}}.pagesjs-panel{width:min(30em,100vw - 5em);max-height:calc(100vh - 2em);padding:.5em 1em;position:absolute;top:0;left:calc(100% + .5em);overflow:auto;box-shadow:0 2px 8px #0000004d;& ul{margin:0;padding-left:1.2em;list-style:none}&>nav>ul,& .pagesjs-problems{padding-left:0}& a{color:inherit;padding:.15em 0;text-decoration:none;display:block}& a:before{content:attr(data-page-number);float:right;opacity:.6}& a:hover{text-decoration:underline}& li{cursor:pointer;padding:.15em 0}}.pagesjs-settle .pagesjs-body{padding:0!important}.pagesjs-header,.pagesjs-footer{justify-content:space-between;font-size:.9em;display:flex}.pagesjs-header{flex:0 0 var(--page-header-height);margin-bottom:var(--page-header-bottom);align-items:end;&:before{content:attr(data-main-title)}&:after{content:attr(data-page-title)}}.pagesjs-footer{flex:0 0 var(--page-footer-height);margin-top:var(--page-footer-top);align-items:start;&:before{content:attr(data-page-url)}&:after{content:attr(data-page-number)}}.pagesjs-body{flex-grow:1;min-height:0;position:relative}@media only screen{.pagesjs{background:#f7f7f7;& .pagesjs-page{background:#fff}& .page-multiple{overflow-y:auto}}.pagesjs-filling{display:block;& .pagesjs-page{opacity:0;height:auto}}}.pagesjs .pagesjs-tools{position:fixed}@media print{.pagesjs-tools{display:none}.pagesjs-hit{outline:none}.pagesjs{gap:0;margin:0;display:block;& .page-multiple{height:auto;padding-top:0;padding-bottom:0}}}@media (prefers-color-scheme:dark){.pagesjs-page{box-shadow:0 0 0 1px #bbb}}
2
2
  /*# sourceMappingURL=pages.min.css.map */
@@ -1 +1 @@
1
- {"version":3,"mappings":"AAAA,qTAeA,2DAKA,gEAIA,2FAIA,6BAGA,gFAKA,wGAQE,6DAIA,sFAGA,+RAUE,qBAGA,iFAGA,8CAIE,4JAOA,iBAEE,sEAKA,oCAGA,uDAIE,yGAaN,2TAeA,6BAIA,sBACE,oDAGE,oBAEF,yDAGE,qBAIJ,gEAGA,gIAOE,8CAGF,0FAKA,8BAGA,iFAMA,wFAEE,sDAIF,2FAGA,wCAMJ,8MAaA,uDAIA,uJAUE,iGAMA,4DAOF,qLASE,iDACA,4CACA,qEACA,iEACA,oCACA,qCAEF,kDAIA,0FAKA,2GAIE,uCAGA,uCAIF,uGAIE,qCAGA,wCAIF,yDAKA,mBACE,4BAEE,gCAGA,kCAIF,+BAEE,wCAMJ,uCACA,aACE,4BACA,0BACA,sCAIE,8DAOJ,mCACE","sources":["pages.css"],"sourcesContent":[":root {\n --paper-width: 210mm;\n --paper-height: 297mm;\n --paper-margin-top: 40px;\n --paper-margin-right: 80px;\n --paper-margin-bottom: 40px;\n --paper-margin-left: 80px;\n --page-header-height: 40px;\n --page-header-bottom: 40px;\n --page-footer-height: 40px;\n --page-footer-top: 40px;\n /* (copies, so that a landscape page can swap the sizes without a cycle) */\n --paper-w: var(--paper-width);\n --paper-h: var(--paper-height);\n}\n@page {\n size: var(--paper-width) var(--paper-height);\n margin: 0;\n}\n/* the page of a float that is too wide for a portrait page (pages.js): the paper turned */\n@page wide {\n size: var(--paper-height) var(--paper-width);\n margin: 0;\n}\n@page multiple {\n margin-top: var(--paper-margin-top);\n margin-bottom: var(--paper-margin-bottom);\n}\n.page-multiple {\n page: multiple;\n}\n.page-wide {\n page: wide;\n --paper-width: var(--paper-h);\n --paper-height: var(--paper-w);\n}\n.pagesjs {\n padding: 0;\n max-width: 100%;\n margin: 5mm;\n display: flex;\n justify-content: center;\n flex-wrap: wrap;\n gap: 5mm;\n .pagesjs-front, .chapter {\n min-height: unset;\n box-shadow: none;\n }\n & > *, &:not(:has(.pagesjs-front)):has(.chapter-toc) #TOC:not(.chapter-toc) {\n display: none;\n }\n .pagesjs-page {\n width: var(--paper-width);\n height: var(--paper-height);\n flex: none; /* (keep the paper size in a narrow window: the content is laid out for it) */\n padding: var(--paper-margin-top) var(--paper-margin-right) var(--paper-margin-bottom) var(--paper-margin-left);\n break-before: page; /* (not break-after: a named page after a break-after gets a blank page in Chrome) */\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n overflow: hidden;\n img {\n max-width: 100%;\n }\n .chapter-before, .chapter-after, .buttons:has(+ .chapter-before) {\n display: none;\n }\n #TOC {\n border: none;\n padding: 0;\n margin-left: auto;\n &:not(.chapter-toc):is(.fragment-first, :not(.pagesjs-fragmented))::before {\n content: \"Contents\";\n display: block;\n font-weight: bold;\n font-size: 1.5em;\n margin-bottom: 1em;\n }\n a {\n display: flex;\n &::after {\n content: attr(data-page-number);\n align-self: end;\n margin-left: 1ch;\n }\n .section-number {\n margin-right: .3em;\n }\n .toc-text {\n position: relative;\n flex: 1 0;\n overflow: hidden;\n &::after {\n content: \"\";\n width: 100%;\n position: absolute;\n bottom: 1.5ex;\n margin-left: 1ch;\n border-bottom: dashed 1px;\n }\n }\n }\n }\n /* wrappers cloned from the content root and its ancestors: keep their\n context for CSS selectors, but not their boxes */\n .pagesjs-wrap {\n display: block !important;\n margin: 0 !important;\n padding: 0 !important;\n border: none !important;\n box-shadow: none !important;\n background: none !important;\n width: auto !important;\n max-width: none !important;\n min-height: 0 !important;\n height: auto !important;\n float: none !important;\n position: static !important;\n transform: none !important;\n }\n .pagesjs-run {\n display: block;\n }\n /* pieces of a fragmented element: slice it (instead of decorating each piece) */\n .pagesjs-fragmented {\n &:not(.fragment-first) {\n border-top: none;\n margin-top: 0;\n & > thead { opacity: .5; }\n }\n &:not(.fragment-last) {\n border-bottom: none;\n margin-bottom: 0;\n & > tfoot { opacity: .5; }\n }\n }\n /* a list item continued from the previous page has no marker */\n li.pagesjs-fragmented:not(.fragment-first)::marker {\n content: \"\";\n }\n .fullwidth {\n float: none;\n max-width: none;\n width: var(--paper-width);\n margin-left: calc(0px - var(--paper-margin-left));\n transform: none;\n /* (article.css caps the content at the viewport, which differs between screen and print) */\n & * { max-width: calc(var(--paper-width) - 4em); }\n }\n /* the page of a float that takes the whole page (the class is set by pages.js): center it */\n &.page-float .pagesjs-body {\n display: flex;\n flex-direction: column;\n justify-content: safe center; /* (a float taller than the page starts at the top) */\n }\n .footnotes {\n margin-top: 1.5em;\n }\n .footnotes::before {\n content: \"\";\n display: block;\n max-width: 20em;\n border-top: solid 1px;\n }\n &:has(.side-left, .embed-left) .pagesjs-body {\n padding-left: calc(0px - var(--side-margin));\n .fullwidth {\n transform: translate(var(--side-margin));\n }\n }\n &:has(.side-right, .embed-right) .pagesjs-body {\n padding-right: calc(0px - var(--side-margin));\n }\n .side {\n font-size: .9em;\n background: none;\n }\n }\n}\n.pagesjs > .pagesjs-progress {\n display: block;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 9999;\n padding: .3em .8em;\n border-radius: 1em;\n background: rgba(0, 0, 0, .75);\n color: white;\n font: 14px sans-serif;\n}\n.pagesjs-hit {\n outline: 3px solid #e33;\n outline-offset: 2px;\n}\n.pagesjs-tools {\n position: absolute; /* (scrolls with the unpaginated page; fixed when paginated) */\n top: 1em;\n left: 1em;\n z-index: 9999;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: .5em;\n font: 14px sans-serif;\n button, .pagesjs-panel {\n background: Canvas;\n color: CanvasText;\n border: 1px solid;\n border-radius: .3em;\n }\n button {\n width: 2.2em;\n height: 2.2em;\n padding: 0;\n cursor: pointer;\n }\n}\n.pagesjs-panel {\n position: absolute;\n top: 0;\n left: calc(100% + .5em); /* (beside the buttons) */\n width: min(30em, calc(100vw - 5em));\n max-height: calc(100vh - 2em); /* (the panel starts at the top of the toolbar, 1em from the top) */\n overflow: auto;\n padding: .5em 1em;\n box-shadow: 0 2px 8px rgba(0, 0, 0, .3);\n ul { margin: 0; padding-left: 1.2em; list-style: none; }\n & > nav > ul, .pagesjs-problems { padding-left: 0; }\n a { display: block; padding: .15em 0; color: inherit; text-decoration: none; }\n a::before { content: attr(data-page-number); float: right; opacity: .6; }\n a:hover { text-decoration: underline; }\n li { cursor: pointer; padding: .15em 0; }\n}\n.pagesjs-settle .pagesjs-body {\n /* the probe page that holds all content has sides, but normal pages don't */\n padding: 0 !important;\n}\n.pagesjs-header, .pagesjs-footer {\n font-size: .9em;\n display: flex;\n justify-content: space-between;\n}\n.pagesjs-header {\n flex: 0 0 var(--page-header-height);\n margin-bottom: var(--page-header-bottom);\n align-items: end;\n &::before {\n content: attr(data-main-title);\n }\n &::after {\n content: attr(data-page-title);\n }\n}\n.pagesjs-footer {\n flex: 0 0 var(--page-footer-height);\n margin-top: var(--page-footer-top);\n align-items: start;\n &::before {\n content: attr(data-page-url);\n }\n &::after {\n content: attr(data-page-number);\n }\n}\n.pagesjs-body {\n flex-grow: 1;\n min-height: 0; /* don't let the body push the footer down when content overhangs by a few pixels */\n position: relative;\n}\n@media only screen {\n .pagesjs {\n background: #f7f7f7;\n .pagesjs-page {\n background: white;\n }\n .page-multiple {\n overflow-y: auto;\n }\n }\n .pagesjs-filling {\n display: block;\n .pagesjs-page {\n opacity: 0; /* don't show the page that is being filled (only the progress) */\n height: auto;\n }\n }\n}\n.pagesjs .pagesjs-tools { position: fixed; }\n@media print {\n .pagesjs-tools { display: none; }\n .pagesjs-hit { outline: none; }\n .pagesjs {\n display: block; /* (named pages, i.e., landscape ones, don't work in a flex container) */\n margin: 0;\n gap: 0;\n .page-multiple {\n padding-top: 0;\n padding-bottom: 0;\n height: auto;\n }\n }\n}\n@media (prefers-color-scheme: dark) {\n .pagesjs-page {\n box-shadow: 0 0 0 1px #bbb;\n }\n}\n"],"names":[]}
1
+ {"version":3,"mappings":"AAAA,qTAeA,2DAKA,gEAIA,2FAIA,6BAGA,gFAKA,wGAQE,6DAIA,sFAGA,+RAUE,qBAGA,iFAGA,8CAIE,4JAOA,iBAEE,sEAKA,oCAGA,uDAIE,yGAaN,2TAeA,6BAIA,sBACE,oDAGE,oBAEF,yDAGE,qBAIJ,gEAGA,gIAOE,8CAGF,0FAKA,8BAGA,iFAMA,wFAEE,sDAIF,2FAGA,wCAMJ,8MAaA,uDAIA,uJAUE,4FAMA,0GASF,qLASE,iDACA,4CACA,qEACA,iEACA,oCACA,qCAEF,kDAIA,0FAKA,2GAIE,uCAGA,uCAIF,uGAIE,qCAGA,wCAIF,yDAKA,mBACE,4BAEE,gCAGA,kCAIF,+BAEE,wCAMJ,uCACA,aACE,4BACA,0BACA,sCAIE,8DAOJ,mCACE","sources":["pages.css"],"sourcesContent":[":root {\n --paper-width: 210mm;\n --paper-height: 297mm;\n --paper-margin-top: 40px;\n --paper-margin-right: 80px;\n --paper-margin-bottom: 40px;\n --paper-margin-left: 80px;\n --page-header-height: 40px;\n --page-header-bottom: 40px;\n --page-footer-height: 40px;\n --page-footer-top: 40px;\n /* (copies, so that a landscape page can swap the sizes without a cycle) */\n --paper-w: var(--paper-width);\n --paper-h: var(--paper-height);\n}\n@page {\n size: var(--paper-width) var(--paper-height);\n margin: 0;\n}\n/* the page of a float that is too wide for a portrait page (pages.js): the paper turned */\n@page wide {\n size: var(--paper-height) var(--paper-width);\n margin: 0;\n}\n@page multiple {\n margin-top: var(--paper-margin-top);\n margin-bottom: var(--paper-margin-bottom);\n}\n.page-multiple {\n page: multiple;\n}\n.page-wide {\n page: wide;\n --paper-width: var(--paper-h);\n --paper-height: var(--paper-w);\n}\n.pagesjs {\n padding: 0;\n max-width: 100%;\n margin: 5mm;\n display: flex;\n justify-content: center;\n flex-wrap: wrap;\n gap: 5mm;\n .pagesjs-front, .chapter {\n min-height: unset;\n box-shadow: none;\n }\n & > *, &:not(:has(.pagesjs-front)):has(.chapter-toc) #TOC:not(.chapter-toc) {\n display: none;\n }\n .pagesjs-page {\n width: var(--paper-width);\n height: var(--paper-height);\n flex: none; /* (keep the paper size in a narrow window: the content is laid out for it) */\n padding: var(--paper-margin-top) var(--paper-margin-right) var(--paper-margin-bottom) var(--paper-margin-left);\n break-before: page; /* (not break-after: a named page after a break-after gets a blank page in Chrome) */\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n overflow: hidden;\n img {\n max-width: 100%;\n }\n .chapter-before, .chapter-after, .buttons:has(+ .chapter-before) {\n display: none;\n }\n #TOC {\n border: none;\n padding: 0;\n margin-left: auto;\n &:not(.chapter-toc):is(.fragment-first, :not(.pagesjs-fragmented))::before {\n content: \"Contents\";\n display: block;\n font-weight: bold;\n font-size: 1.5em;\n margin-bottom: 1em;\n }\n a {\n display: flex;\n &::after {\n content: attr(data-page-number);\n align-self: end;\n margin-left: 1ch;\n }\n .section-number {\n margin-right: .3em;\n }\n .toc-text {\n position: relative;\n flex: 1 0;\n overflow: hidden;\n &::after {\n content: \"\";\n width: 100%;\n position: absolute;\n bottom: 1.5ex;\n margin-left: 1ch;\n border-bottom: dashed 1px;\n }\n }\n }\n }\n /* wrappers cloned from the content root and its ancestors: keep their\n context for CSS selectors, but not their boxes */\n .pagesjs-wrap {\n display: block !important;\n margin: 0 !important;\n padding: 0 !important;\n border: none !important;\n box-shadow: none !important;\n background: none !important;\n width: auto !important;\n max-width: none !important;\n min-height: 0 !important;\n height: auto !important;\n float: none !important;\n position: static !important;\n transform: none !important;\n }\n .pagesjs-run {\n display: block;\n }\n /* pieces of a fragmented element: slice it (instead of decorating each piece) */\n .pagesjs-fragmented {\n &:not(.fragment-first) {\n border-top: none;\n margin-top: 0;\n & > thead { opacity: .5; }\n }\n &:not(.fragment-last) {\n border-bottom: none;\n margin-bottom: 0;\n & > tfoot { opacity: .5; }\n }\n }\n /* a list item continued from the previous page has no marker */\n li.pagesjs-fragmented:not(.fragment-first)::marker {\n content: \"\";\n }\n .fullwidth {\n float: none;\n max-width: none;\n width: var(--paper-width);\n margin-left: calc(0px - var(--paper-margin-left));\n transform: none;\n /* (article.css caps the content at the viewport, which differs between screen and print) */\n & * { max-width: calc(var(--paper-width) - 4em); }\n }\n /* the page of a float that takes the whole page (the class is set by pages.js): center it */\n &.page-float .pagesjs-body {\n display: flex;\n flex-direction: column;\n justify-content: safe center; /* (a float taller than the page starts at the top) */\n }\n .footnotes {\n margin-top: 1.5em;\n }\n .footnotes::before {\n content: \"\";\n display: block;\n max-width: 20em;\n border-top: solid 1px;\n }\n &:has(.side-left, .embed-left) .pagesjs-body {\n padding-left: calc(0px - var(--side-margin));\n .fullwidth {\n transform: translate(var(--side-margin));\n }\n }\n &:has(.side-right, .embed-right) .pagesjs-body {\n padding-right: calc(0px - var(--side-margin));\n }\n .side {\n font-size: .9em;\n background: none;\n }\n }\n}\n.pagesjs > .pagesjs-progress {\n display: block;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 9999;\n padding: .3em .8em;\n border-radius: 1em;\n background: rgba(0, 0, 0, .75);\n color: white;\n font: 14px sans-serif;\n}\n.pagesjs-hit {\n outline: 3px solid #e33;\n outline-offset: 2px;\n}\n.pagesjs-tools {\n position: absolute; /* (scrolls with the unpaginated page; fixed when paginated) */\n top: 1em;\n left: 1em;\n z-index: 9999;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: .5em;\n font: 14px sans-serif;\n & > a, .pagesjs-panel {\n background: Canvas;\n color: CanvasText;\n border: 1px solid;\n border-radius: .3em;\n }\n & > a {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 2.2em;\n height: 2.2em;\n text-decoration: none;\n }\n}\n.pagesjs-panel {\n position: absolute;\n top: 0;\n left: calc(100% + .5em); /* (beside the buttons) */\n width: min(30em, calc(100vw - 5em));\n max-height: calc(100vh - 2em); /* (the panel starts at the top of the toolbar, 1em from the top) */\n overflow: auto;\n padding: .5em 1em;\n box-shadow: 0 2px 8px rgba(0, 0, 0, .3);\n ul { margin: 0; padding-left: 1.2em; list-style: none; }\n & > nav > ul, .pagesjs-problems { padding-left: 0; }\n a { display: block; padding: .15em 0; color: inherit; text-decoration: none; }\n a::before { content: attr(data-page-number); float: right; opacity: .6; }\n a:hover { text-decoration: underline; }\n li { cursor: pointer; padding: .15em 0; }\n}\n.pagesjs-settle .pagesjs-body {\n /* the probe page that holds all content has sides, but normal pages don't */\n padding: 0 !important;\n}\n.pagesjs-header, .pagesjs-footer {\n font-size: .9em;\n display: flex;\n justify-content: space-between;\n}\n.pagesjs-header {\n flex: 0 0 var(--page-header-height);\n margin-bottom: var(--page-header-bottom);\n align-items: end;\n &::before {\n content: attr(data-main-title);\n }\n &::after {\n content: attr(data-page-title);\n }\n}\n.pagesjs-footer {\n flex: 0 0 var(--page-footer-height);\n margin-top: var(--page-footer-top);\n align-items: start;\n &::before {\n content: attr(data-page-url);\n }\n &::after {\n content: attr(data-page-number);\n }\n}\n.pagesjs-body {\n flex-grow: 1;\n min-height: 0; /* don't let the body push the footer down when content overhangs by a few pixels */\n position: relative;\n}\n@media only screen {\n .pagesjs {\n background: #f7f7f7;\n .pagesjs-page {\n background: white;\n }\n .page-multiple {\n overflow-y: auto;\n }\n }\n .pagesjs-filling {\n display: block;\n .pagesjs-page {\n opacity: 0; /* don't show the page that is being filled (only the progress) */\n height: auto;\n }\n }\n}\n.pagesjs .pagesjs-tools { position: fixed; }\n@media print {\n .pagesjs-tools { display: none; }\n .pagesjs-hit { outline: none; }\n .pagesjs {\n display: block; /* (named pages, i.e., landscape ones, don't work in a flex container) */\n margin: 0;\n gap: 0;\n .page-multiple {\n padding-top: 0;\n padding-bottom: 0;\n height: auto;\n }\n }\n}\n@media (prefers-color-scheme: dark) {\n .pagesjs-page {\n box-shadow: 0 0 0 1px #bbb;\n }\n}\n"],"names":[]}
package/css/site.css CHANGED
@@ -9,7 +9,7 @@ h1, h2, h3 {
9
9
  border-bottom: 1px dashed var(--rule-color);
10
10
  }
11
11
  }
12
- a, button {
12
+ a {
13
13
  display: inline-block;
14
14
  background: white;
15
15
  padding: .2em .5em;
@@ -22,25 +22,24 @@ h1, h2, h3 {
22
22
  box-shadow: 0 1.5px var(--accent), inset 0 -1px var(--accent);
23
23
  margin-bottom: -1px;
24
24
  }
25
- &.right {
26
- margin-left: auto;
27
- margin-right: 0;
28
- img { vertical-align: middle; }
29
- &:hover img { filter: invert(1); }
30
- }
31
- }
32
- /* the print button of pages.js (<span class="pagesjs-toggle">) takes the place of
33
- the right alignment of the GitHub icon that follows it */
34
- .pagesjs-toggle {
35
- display: flex;
36
- margin-left: auto;
37
- & + .right { margin-left: 0; }
38
25
  }
39
- button {
40
- display: flex; /* (the icon is a block, so that it is centered like the img in a link) */
41
- border: 0; font: inherit; color: inherit; cursor: pointer;
42
- svg { width: 24px; height: 24px; } /* (as big as the GitHub icon) */
26
+ /* icons (e.g., GitHub) and the print button of pages.js (<span class="pagesjs-toggle">,
27
+ which pushes the icons after it to the right): same size, 1.5em on hover */
28
+ img, svg { width: 1.1em; height: 1.1em; vertical-align: middle; transition: transform .15s; }
29
+ a:hover :is(img, svg) { transform: scale(1.36); }
30
+ a:hover img { filter: invert(1); }
31
+ /* square boxes around the icons (1.1em + padding), centered in the row */
32
+ a:has(> :is(img, svg)) {
33
+ display: inline-flex;
34
+ align-items: center;
35
+ justify-content: center;
36
+ align-self: center;
37
+ width: 1.6em;
38
+ height: 1.6em;
39
+ padding: 0;
40
+ margin-right: 0;
43
41
  }
42
+ .pagesjs-toggle { display: flex; align-self: center; margin-left: auto; }
44
43
  /* package version next to the name: center it in the flex row */
45
44
  .version { align-self: center; margin-right: .5em; }
46
45
  }
package/css/site.min.css CHANGED
@@ -1,2 +1,2 @@
1
- h1,h2,h3{font-weight:500}.site-nav{&>p{flex-wrap:wrap;display:flex;&:last-child{border-bottom:1px dashed var(--rule-color)}}& a,& button{background:#fff;margin-right:.5em;padding:.2em .5em;display:inline-block;&:hover{background:var(--accent);color:#fff}&[aria-current]{box-shadow:0 1.5px var(--accent), inset 0 -1px var(--accent);margin-bottom:-1px}&.right{margin-left:auto;margin-right:0;& img{vertical-align:middle}&:hover img{filter:invert()}}}& .pagesjs-toggle{margin-left:auto;display:flex;&+.right{margin-left:0}}& button{font:inherit;color:inherit;cursor:pointer;border:0;display:flex;& svg{width:24px;height:24px}}& .version{align-self:center;margin-right:.5em}}.logo{float:right;width:120px;margin:0 0 1em 1em}.comments{margin-top:2em}footer{border-top:1px dashed var(--rule-color);margin-top:2em;& .flex-col{gap:2em}}:is(.site-nav,footer) a{text-decoration:none}article:not(.pagesjs *),.frontmatter{box-shadow:none;margin-top:auto;@media (prefers-color-scheme:dark){box-shadow:0 0 0 1px #bbb}}.frontmatter{background:linear-gradient(#f0f8ff,#fff)}
1
+ h1,h2,h3{font-weight:500}.site-nav{&>p{flex-wrap:wrap;display:flex;&:last-child{border-bottom:1px dashed var(--rule-color)}}& a{background:#fff;margin-right:.5em;padding:.2em .5em;display:inline-block;&:hover{background:var(--accent);color:#fff}&[aria-current]{box-shadow:0 1.5px var(--accent), inset 0 -1px var(--accent);margin-bottom:-1px}}& img,& svg{vertical-align:middle;width:1.1em;height:1.1em;transition:transform .15s}& a:hover :is(img,svg){transform:scale(1.36)}& a:hover img{filter:invert()}& a:has(>:is(img,svg)){justify-content:center;align-self:center;align-items:center;width:1.6em;height:1.6em;margin-right:0;padding:0;display:inline-flex}& .pagesjs-toggle{align-self:center;margin-left:auto;display:flex}& .version{align-self:center;margin-right:.5em}}.logo{float:right;width:120px;margin:0 0 1em 1em}.comments{margin-top:2em}footer{border-top:1px dashed var(--rule-color);margin-top:2em;& .flex-col{gap:2em}}:is(.site-nav,footer) a{text-decoration:none}article:not(.pagesjs *),.frontmatter{box-shadow:none;margin-top:auto;@media (prefers-color-scheme:dark){box-shadow:0 0 0 1px #bbb}}.frontmatter{background:linear-gradient(#f0f8ff,#fff)}
2
2
  /*# sourceMappingURL=site.min.css.map */
@@ -1 +1 @@
1
- {"version":3,"mappings":"AAAA,yBAGA,UACE,gCAGE,yDAIF,sFAKE,4CAIA,gGAIA,wCAGE,4BACA,8BAKJ,gDAGE,wBAEF,yEAGE,8BAGF,gDAGF,iDAKA,yBAGA,8DAGE,qBAIF,6CAGA,qEAGE,mCAAqC,2BAIvC","sources":["site.css"],"sourcesContent":["h1, h2, h3 {\n font-weight: 500;\n}\n.site-nav {\n & > p {\n display: flex;\n flex-wrap: wrap;\n &:last-child {\n border-bottom: 1px dashed var(--rule-color);\n }\n }\n a, button {\n display: inline-block;\n background: white;\n padding: .2em .5em;\n margin-right: .5em;\n &:hover {\n background: var(--accent);\n color: white;\n }\n &[aria-current] {\n box-shadow: 0 1.5px var(--accent), inset 0 -1px var(--accent);\n margin-bottom: -1px;\n }\n &.right {\n margin-left: auto;\n margin-right: 0;\n img { vertical-align: middle; }\n &:hover img { filter: invert(1); }\n }\n }\n /* the print button of pages.js (<span class=\"pagesjs-toggle\">) takes the place of\n the right alignment of the GitHub icon that follows it */\n .pagesjs-toggle {\n display: flex;\n margin-left: auto;\n & + .right { margin-left: 0; }\n }\n button {\n display: flex; /* (the icon is a block, so that it is centered like the img in a link) */\n border: 0; font: inherit; color: inherit; cursor: pointer;\n svg { width: 24px; height: 24px; } /* (as big as the GitHub icon) */\n }\n /* package version next to the name: center it in the flex row */\n .version { align-self: center; margin-right: .5em; }\n}\n/* package logo (e.g., a hex sticker) on the home page of a package site */\n.logo {\n float: right;\n width: 120px;\n margin: 0 0 1em 1em;\n}\n.comments {\n margin-top: 2em;\n}\nfooter {\n border-top: 1px dashed var(--rule-color);\n margin-top: 2em;\n .flex-col {\n gap: 2em;\n }\n}\n:is(.site-nav, footer) a {\n text-decoration: none;\n}\narticle:not(.pagesjs *), .frontmatter {\n box-shadow: none;\n margin-top: auto;\n @media (prefers-color-scheme: dark) {\n box-shadow: 0 0 0 1px #bbb;\n }\n}\n.frontmatter {\n background: linear-gradient(0, white, aliceblue);\n}\n"],"names":[]}
1
+ {"version":3,"mappings":"AAAA,yBAGA,UACE,gCAGE,yDAIF,6EAKE,4CAIA,iGAOF,qFACA,6CACA,8BAEA,yJAUA,kEAEA,gDAGF,iDAKA,yBAGA,8DAGE,qBAIF,6CAGA,qEAGE,mCAAqC,2BAIvC","sources":["site.css"],"sourcesContent":["h1, h2, h3 {\n font-weight: 500;\n}\n.site-nav {\n & > p {\n display: flex;\n flex-wrap: wrap;\n &:last-child {\n border-bottom: 1px dashed var(--rule-color);\n }\n }\n a {\n display: inline-block;\n background: white;\n padding: .2em .5em;\n margin-right: .5em;\n &:hover {\n background: var(--accent);\n color: white;\n }\n &[aria-current] {\n box-shadow: 0 1.5px var(--accent), inset 0 -1px var(--accent);\n margin-bottom: -1px;\n }\n }\n /* icons (e.g., GitHub) and the print button of pages.js (<span class=\"pagesjs-toggle\">,\n which pushes the icons after it to the right): same size, 1.5em on hover */\n img, svg { width: 1.1em; height: 1.1em; vertical-align: middle; transition: transform .15s; }\n a:hover :is(img, svg) { transform: scale(1.36); }\n a:hover img { filter: invert(1); }\n /* square boxes around the icons (1.1em + padding), centered in the row */\n a:has(> :is(img, svg)) {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n align-self: center;\n width: 1.6em;\n height: 1.6em;\n padding: 0;\n margin-right: 0;\n }\n .pagesjs-toggle { display: flex; align-self: center; margin-left: auto; }\n /* package version next to the name: center it in the flex row */\n .version { align-self: center; margin-right: .5em; }\n}\n/* package logo (e.g., a hex sticker) on the home page of a package site */\n.logo {\n float: right;\n width: 120px;\n margin: 0 0 1em 1em;\n}\n.comments {\n margin-top: 2em;\n}\nfooter {\n border-top: 1px dashed var(--rule-color);\n margin-top: 2em;\n .flex-col {\n gap: 2em;\n }\n}\n:is(.site-nav, footer) a {\n text-decoration: none;\n}\narticle:not(.pagesjs *), .frontmatter {\n box-shadow: none;\n margin-top: auto;\n @media (prefers-color-scheme: dark) {\n box-shadow: 0 0 0 1px #bbb;\n }\n}\n.frontmatter {\n background: linear-gradient(0, white, aliceblue);\n}\n"],"names":[]}
@@ -0,0 +1,96 @@
1
+ /* lt-export.js — table export formats (CSV, RTF) for lt.
2
+ *
3
+ * Plugin on the LT global (see lt.js), loaded after core. No DOM: each format
4
+ * turns a plain model of the table into a string, so the same code serves the
5
+ * download button of lt-interactive.js and Node (`lt_export()` in R). Add a
6
+ * format by adding an entry to `formats`; the download menu lists them all.
7
+ *
8
+ * LT.plugins.export.text(format, spec, rows?, src?)
9
+ *
10
+ * `spec` is a built spec (after LT.buildHtml), `rows` 1-based row indices
11
+ * (default: all), `src` the cell text by column (default: displayed text).
12
+ */
13
+ (root => {
14
+ "use strict";
15
+ const LT = root.LT;
16
+ if (!LT?.plugins || LT.plugins.export) return;
17
+
18
+ // Text fields are a plain string or, if wrapped in I() in R, a one-element
19
+ // array of raw HTML (tags dropped).
20
+ const plain = v => Array.isArray(v) ? String(v[0] ?? "").replace(/<[^>]*>/g, "") : String(v ?? "");
21
+
22
+ // CSV: quote (doubling quotes) only if comma, quote, or newline.
23
+ const csvField = v => /[",\n]/.test(v) ? '"' + v.replace(/"/g, '""') + '"' : v;
24
+ const csv = m => [m.head, ...m.rows].map(r => r.map(csvField).join(",")).join("\n");
25
+
26
+ // RTF: escape \ { }, line breaks, and non-ASCII (as signed 16-bit \u codes).
27
+ const rtfEsc = v => v.replace(/[\\{}]/g, "\\$&").replace(/\r?\n/g, "\\line ")
28
+ .replace(/[^\x00-\x7f]/g, c => `\\u${(c.charCodeAt(0) << 16) >> 16}?`);
29
+ // A fixed look: rules above and below the header and below the last row, bold
30
+ // header, spanners as merged cells, title above and notes below, column
31
+ // widths by text length.
32
+ const rtf = ({ head, rows, align, indent, spans, title, subtitle, notes }) => {
33
+ const W = 9360, // text width in twips (6.5in)
34
+ len = head.map((h, j) => Math.min(30, rows.reduce((n, r) => Math.max(n, r[j].length), Math.max(4, h.length)))),
35
+ tot = len.reduce((a, b) => a + b, 0);
36
+ let x = 0;
37
+ const edge = len.map(l => x += Math.round(l / tot * W)),
38
+ // cells: [text, {a: align, b: bold, li: indent, bd: border sides, m: merge}]
39
+ row = cells => "\\trowd\\trgaph60" + cells.map(([, o], j) =>
40
+ (o.m || "") + [...(o.bd || "")].map(s => `\\clbrdr${s}\\brdrs\\brdrw10`).join("") + `\\cellx${edge[j]}`
41
+ ).join("") + cells.map(([t, o]) =>
42
+ `\\pard\\intbl\\q${o.a || "l"}${o.li ? `\\li${o.li}` : ""} ${o.b ? `{\\b ${rtfEsc(t)}}` : rtfEsc(t)}\\cell`
43
+ ).join("") + "\\row\n",
44
+ out = ["{\\rtf1\\ansi\\deff0{\\fonttbl{\\f0 Arial;}}\\fs18\n"];
45
+ if (title) out.push(`{\\pard\\qc\\b ${rtfEsc(title)}\\par}\n`);
46
+ if (subtitle) out.push(`{\\pard\\qc ${rtfEsc(subtitle)}\\par}\n`);
47
+ if (spans.length) {
48
+ const cells = [];
49
+ for (let j = 0; j < head.length;) {
50
+ const s = spans.find(s => s.from === j);
51
+ if (!s) { cells.push(["", { bd: "t" }]); j++; continue; }
52
+ cells.push([s.label, { a: "c", bd: "tb", m: "\\clmgf" }]);
53
+ for (let k = 1; k < s.n; k++) cells.push(["", { bd: "tb", m: "\\clmrg" }]);
54
+ j += s.n;
55
+ }
56
+ out.push(row(cells));
57
+ }
58
+ out.push(row(head.map((h, j) => [h, { a: align[j], b: 1, bd: (spans.length ? "" : "t") + "b" }])));
59
+ rows.forEach((r, i) => out.push(row(r.map((t, j) => [t, {
60
+ a: align[j], li: j ? 0 : indent[i] * 240, bd: i === rows.length - 1 ? "b" : ""
61
+ }]))));
62
+ for (const n of notes) out.push(`{\\pard\\fs16 ${rtfEsc(n)}\\par}\n`);
63
+ return out.join("") + "}";
64
+ };
65
+
66
+ // Registered formats: key (also the file extension) -> label, MIME type, and
67
+ // `fn(model)`.
68
+ const formats = {
69
+ csv: { label: "CSV", mime: "text/csv", fn: csv },
70
+ rtf: { label: "RTF", mime: "application/rtf", fn: rtf },
71
+ };
72
+
73
+ // The table as plain strings: header, body rows, and what a format may use
74
+ // beyond them (alignment, row indents, spanners as column ranges, title,
75
+ // notes).
76
+ const model = (spec, rows, src = spec._display) => {
77
+ const cols = spec._cols, t = spec._tbl, ind = spec._indent;
78
+ rows ||= Array.from({ length: src[cols[0]]?.length ?? 0 }, (_, i) => i + 1);
79
+ return {
80
+ head: t.labels.map(plain),
81
+ rows: rows.map(r => cols.map(c => String(src[c]?.[r - 1] ?? ""))),
82
+ align: t.align.map(a => ({ center: "c", right: "r" })[a] || "l"),
83
+ indent: rows.map(r => ind?.[r - 1] || 0),
84
+ spans: (t.spanners || []).map(s => ({
85
+ label: plain(s.label), from: cols.indexOf(s.columns[0]), n: s.columns.length
86
+ })),
87
+ title: plain(t.header.title), subtitle: plain(t.header.subtitle),
88
+ notes: (t.notes || []).map(plain)
89
+ };
90
+ };
91
+
92
+ LT.plugins.export = {
93
+ formats, model,
94
+ text: (fmt, spec, rows, src) => formats[fmt].fn(model(spec, rows, src))
95
+ };
96
+ })(window);
@@ -0,0 +1,2 @@
1
+ (()=>{"use strict";const t=window.LT;if(!t?.plugins||t.plugins.export)return;const n=t=>Array.isArray(t)?String(t[0]??"").replace(/<[^>]*>/g,""):String(t??""),e=t=>/[",\n]/.test(t)?'"'+t.replace(/"/g,'""')+'"':t,a=t=>t.replace(/[\\{}]/g,"\\$&").replace(/\r?\n/g,"\\line ").replace(/[^\x00-\x7f]/g,t=>`\\u${t.charCodeAt(0)<<16>>16}?`),l={csv:{label:"CSV",mime:"text/csv",fn:t=>[t.head,...t.rows].map(t=>t.map(e).join(",")).join("\n")},rtf:{label:"RTF",mime:"application/rtf",fn:({head:t,rows:n,align:e,indent:l,spans:r,title:s,subtitle:p,notes:i})=>{const o=t.map((t,e)=>Math.min(30,n.reduce((t,n)=>Math.max(t,n[e].length),Math.max(4,t.length)))),m=o.reduce((t,n)=>t+n,0);let c=0;const d=o.map(t=>c+=Math.round(t/m*9360)),h=t=>"\\trowd\\trgaph60"+t.map(([,t],n)=>(t.m||"")+[...t.bd||""].map(t=>`\\clbrdr${t}\\brdrs\\brdrw10`).join("")+`\\cellx${d[n]}`).join("")+t.map(([t,n])=>`\\pard\\intbl\\q${n.a||"l"}${n.li?`\\li${n.li}`:""} ${n.b?`{\\b ${a(t)}}`:a(t)}\\cell`).join("")+"\\row\n",b=["{\\rtf1\\ansi\\deff0{\\fonttbl{\\f0 Arial;}}\\fs18\n"];if(s&&b.push(`{\\pard\\qc\\b ${a(s)}\\par}\n`),p&&b.push(`{\\pard\\qc ${a(p)}\\par}\n`),r.length){const n=[];for(let e=0;e<t.length;){const t=r.find(t=>t.from===e);if(t){n.push([t.label,{a:"c",bd:"tb",m:"\\clmgf"}]);for(let e=1;e<t.n;e++)n.push(["",{bd:"tb",m:"\\clmrg"}]);e+=t.n}else n.push(["",{bd:"t"}]),e++}b.push(h(n))}b.push(h(t.map((t,n)=>[t,{a:e[n],b:1,bd:(r.length?"":"t")+"b"}]))),n.forEach((t,a)=>b.push(h(t.map((t,r)=>[t,{a:e[r],li:r?0:240*l[a],bd:a===n.length-1?"b":""}]))));for(const t of i)b.push(`{\\pard\\fs16 ${a(t)}\\par}\n`);return b.join("")+"}"}}},r=(t,e,a=t._display)=>{const l=t._cols,r=t._tbl,s=t._indent;return e||=Array.from({length:a[l[0]]?.length??0},(t,n)=>n+1),{head:r.labels.map(n),rows:e.map(t=>l.map(n=>String(a[n]?.[t-1]??""))),align:r.align.map(t=>({center:"c",right:"r"}[t]||"l")),indent:e.map(t=>s?.[t-1]||0),spans:(r.spanners||[]).map(t=>({label:n(t.label),from:l.indexOf(t.columns[0]),n:t.columns.length})),title:n(r.header.title),subtitle:n(r.header.subtitle),notes:(r.notes||[]).map(n)}};t.plugins.export={formats:l,model:r,text:(t,n,e,a)=>l[t].fn(r(n,e,a))}})();
2
+ //# sourceMappingURL=lt-export.min.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["LT","window","plugins","export","plain","v","Array","isArray","String","replace","csvField","test","rtfEsc","c","charCodeAt","formats","csv","label","mime","fn","m","head","rows","map","r","join","rtf","align","indent","spans","title","subtitle","notes","len","h","j","Math","min","reduce","n","max","length","tot","a","b","x","edge","l","round","row","cells","o","bd","s","t","li","out","push","find","from","k","forEach","i","model","spec","src","_display","cols","_cols","_tbl","ind","_indent","_","labels","center","right","spanners","indexOf","columns","header","text","fmt"],"sources":["lt-export.js"],"mappings":"AAYA,MACE,aACA,MAAMA,EAiFLC,OAjFeD,GAChB,IAAKA,GAAIE,SAAWF,EAAGE,QAAQC,OAAQ,OAIvC,MAAMC,EAAQC,GAAKC,MAAMC,QAAQF,GAAKG,OAAOH,EAAE,IAAM,IAAII,QAAQ,WAAY,IAAMD,OAAOH,GAAK,IAGzFK,EAAWL,GAAK,SAASM,KAAKN,GAAK,IAAMA,EAAEI,QAAQ,KAAM,MAAQ,IAAMJ,EAIvEO,EAASP,GAAKA,EAAEI,QAAQ,UAAW,QAAQA,QAAQ,SAAU,WAChEA,QAAQ,gBAAiBI,GAAK,MAAOA,EAAEC,WAAW,IAAM,IAAO,OAwC5DC,EAAU,CACdC,IAAK,CAAEC,MAAO,MAAOC,KAAM,WAAYC,GA7C7BC,GAAK,CAACA,EAAEC,QAASD,EAAEE,MAAMC,IAAIC,GAAKA,EAAED,IAAIb,GAAUe,KAAK,MAAMA,KAAK,OA8C5EC,IAAK,CAAET,MAAO,MAAOC,KAAM,kBAAmBC,GAtCpC,EAAGE,OAAMC,OAAMK,QAAOC,SAAQC,QAAOC,QAAOC,WAAUC,YAChE,MACMC,EAAMZ,EAAKE,IAAI,CAACW,EAAGC,IAAMC,KAAKC,IAAI,GAAIf,EAAKgB,OAAO,CAACC,EAAGf,IAAMY,KAAKI,IAAID,EAAGf,EAAEW,GAAGM,QAASL,KAAKI,IAAI,EAAGN,EAAEO,WACpGC,EAAMT,EAAIK,OAAO,CAACK,EAAGC,IAAMD,EAAIC,EAAG,GACxC,IAAIC,EAAI,EACR,MAAMC,EAAOb,EAAIV,IAAIwB,GAAKF,GAAKT,KAAKY,MAAMD,EAAIL,EAJpC,OAMJO,EAAMC,GAAS,oBAAsBA,EAAM3B,IAAI,EAAE,CAAE4B,GAAIhB,KACpDgB,EAAE/B,GAAK,IAAM,IAAK+B,EAAEC,IAAM,IAAK7B,IAAI8B,GAAK,WAAWA,qBAAqB5B,KAAK,IAAM,UAAUqB,EAAKX,MACnGV,KAAK,IAAMyB,EAAM3B,IAAI,EAAE+B,EAAGH,KAC1B,mBAAmBA,EAAER,GAAK,MAAMQ,EAAEI,GAAK,OAAOJ,EAAEI,KAAO,MAAMJ,EAAEP,EAAI,QAAQhC,EAAO0C,MAAQ1C,EAAO0C,YACjG7B,KAAK,IAAM,UACb+B,EAAM,CAAC,wDAGb,GAFI1B,GAAO0B,EAAIC,KAAK,kBAAkB7C,EAAOkB,cACzCC,GAAUyB,EAAIC,KAAK,eAAe7C,EAAOmB,cACzCF,EAAMY,OAAQ,CAChB,MAAMS,EAAQ,GACd,IAAK,IAAIf,EAAI,EAAGA,EAAId,EAAKoB,QAAS,CAChC,MAAMY,EAAIxB,EAAM6B,KAAKL,GAAKA,EAAEM,OAASxB,GACrC,GAAKkB,EAAL,CACAH,EAAMO,KAAK,CAACJ,EAAEpC,MAAO,CAAE0B,EAAG,IAAKS,GAAI,KAAMhC,EAAG,aAC5C,IAAK,IAAIwC,EAAI,EAAGA,EAAIP,EAAEd,EAAGqB,IAAKV,EAAMO,KAAK,CAAC,GAAI,CAAEL,GAAI,KAAMhC,EAAG,aAC7De,GAAKkB,EAAEd,CAHiD,MAA9CW,EAAMO,KAAK,CAAC,GAAI,CAAEL,GAAI,OAASjB,GAI3C,CACAqB,EAAIC,KAAKR,EAAIC,GACf,CACAM,EAAIC,KAAKR,EAAI5B,EAAKE,IAAI,CAACW,EAAGC,IAAM,CAACD,EAAG,CAAES,EAAGhB,EAAMQ,GAAIS,EAAG,EAAGQ,IAAKvB,EAAMY,OAAS,GAAK,KAAO,SACzFnB,EAAKuC,QAAQ,CAACrC,EAAGsC,IAAMN,EAAIC,KAAKR,EAAIzB,EAAED,IAAI,CAAC+B,EAAGnB,IAAM,CAACmB,EAAG,CACtDX,EAAGhB,EAAMQ,GAAIoB,GAAIpB,EAAI,EAAgB,IAAZP,EAAOkC,GAAUV,GAAIU,IAAMxC,EAAKmB,OAAS,EAAI,IAAM,SAE9E,IAAK,MAAMF,KAAKP,EAAOwB,EAAIC,KAAK,iBAAiB7C,EAAO2B,cACxD,OAAOiB,EAAI/B,KAAK,IAAM,OAalBsC,EAAQ,CAACC,EAAM1C,EAAM2C,EAAMD,EAAKE,YACpC,MAAMC,EAAOH,EAAKI,MAAOd,EAAIU,EAAKK,KAAMC,EAAMN,EAAKO,QAEnD,OADAjD,IAAShB,MAAMqD,KAAK,CAAElB,OAAQwB,EAAIE,EAAK,KAAK1B,QAAU,GAAK,CAAC+B,EAAGV,IAAMA,EAAI,GAClE,CACLzC,KAAMiC,EAAEmB,OAAOlD,IAAInB,GACnBkB,KAAMA,EAAKC,IAAIC,GAAK2C,EAAK5C,IAAIV,GAAKL,OAAOyD,EAAIpD,KAAKW,EAAI,IAAM,MAC5DG,MAAO2B,EAAE3B,MAAMJ,IAAIoB,IAAK,CAAG+B,OAAQ,IAAKC,MAAO,KAAOhC,IAAM,MAC5Df,OAAQN,EAAKC,IAAIC,GAAK8C,IAAM9C,EAAI,IAAM,GACtCK,OAAQyB,EAAEsB,UAAY,IAAIrD,IAAI8B,IAAK,CACjCpC,MAAOb,EAAMiD,EAAEpC,OAAQ0C,KAAMQ,EAAKU,QAAQxB,EAAEyB,QAAQ,IAAKvC,EAAGc,EAAEyB,QAAQrC,UAExEX,MAAO1B,EAAMkD,EAAEyB,OAAOjD,OAAQC,SAAU3B,EAAMkD,EAAEyB,OAAOhD,UACvDC,OAAQsB,EAAEtB,OAAS,IAAIT,IAAInB,KAI/BJ,EAAGE,QAAQC,OAAS,CAClBY,UAASgD,QACTiB,KAAM,CAACC,EAAKjB,EAAM1C,EAAM2C,IAAQlD,EAAQkE,GAAK9D,GAAG4C,EAAMC,EAAM1C,EAAM2C,IAErE,EAnFD","ignoreList":[]}
@@ -445,7 +445,7 @@
445
445
  elem(el.ownerDocument, "div", { className: "lti-icons" }, headBar) : null;
446
446
  if (opts.hide)
447
447
  addColumnToggle(icons, el, hrow, cols, labels, opts.hide, layout, postSwap);
448
- if (opts.download) addDownload(icons, el, spec, cols, labels, opts.download);
448
+ if (opts.download) addDownload(icons, el, spec, opts.download);
449
449
  // Control bar (`.lti-bar`; null if no table-wide controls) for callers to add
450
450
  // widgets to; `chips` is its chip group (null only without a bar), home for
451
451
  // caller chips
@@ -614,40 +614,58 @@
614
614
  });
615
615
  }
616
616
 
617
- // CSV-escape: quote (doubling quotes) only if comma, quote, or newline.
618
- function csvField(v) {
619
- const s = v == null ? "" : String(v);
620
- return /[",\n]/.test(s) ? '"' + s.replace(/"/g, '""') + '"' : s;
621
- }
622
-
623
- // Button downloading the current view (all pages, `el._lt.view()`) as CSV.
624
- // `opt` = file name or `{file?, mode?}`; `mode: "raw"` exports `spec.data`
625
- // instead of displayed text (`spec._display`). Skips group columns (null in
626
- // `cols`). Uses Blob + <a>, no library.
627
- function addDownload(cell, el, spec, cols, labels, opt) {
628
- const doc = el.ownerDocument,
617
+ // Download button for the current view (all pages, `el._lt.view()`) in the
618
+ // formats of lt-export.js: a menu of them, or a direct download if only one.
619
+ // `opt` = file name or `{file?, mode?, formats?}`; `mode: "raw"` exports
620
+ // `spec.data` instead of displayed text. The file name is a stem: a format
621
+ // extension is replaced by the chosen format's. Uses Blob + <a>, no library.
622
+ function addDownload(cell, el, spec, opt) {
623
+ const doc = el.ownerDocument, X = LT.plugins.export,
629
624
  o = typeof opt === "object" ? opt : { file: opt },
630
- raw = o.mode === "raw",
631
- file = (typeof o.file === "string" && o.file ? o.file : "table")
632
- .replace(/(\.csv)?$/i, ".csv"),
633
- keep = cols.map((c, i) => i).filter(i => cols[i] != null),
625
+ fmts = o.formats ? [].concat(o.formats) : Object.keys(X.formats),
626
+ stem = (typeof o.file === "string" && o.file ? o.file : "lt-table")
627
+ .replace(new RegExp(`\\.(${Object.keys(X.formats).join("|")})$`, "i"), ""),
628
+ one = fmts.length === 1, name = X.formats[fmts[0]].label,
629
+ wrap = elem(doc, "span", { className: "lti-dl" }, cell),
634
630
  btn = elem(doc, "button", {
635
- type: "button", className: "lti-download", title: "Download CSV",
636
- "aria-label": "Download table as CSV"
637
- }, cell);
638
- btn.onclick = async () => {
631
+ type: "button", className: "lti-download",
632
+ title: one ? `Download ${name}` : "Download",
633
+ "aria-label": one ? `Download table as ${name}` : "Download table"
634
+ }, wrap);
635
+ const save = async fmt => {
639
636
  // server mode: fetch every row of the view first
640
637
  const all = await el._lt.server?.load(el._lt.state, true), s = all ? { ...spec, data: all.data } : spec;
641
638
  if (all) LT.buildHtml(s);
642
- const src = (raw ? textual(s) : s._display) || {},
643
- lines = [keep.map(i => csvField(labels[i] ?? cols[i])).join(",")];
644
- for (const r of all ? Array.from({ length: all.rows }, (_, i) => i + 1) : el._lt.view())
645
- lines.push(keep.map(i => csvField((src[cols[i]] || [])[r - 1])).join(","));
646
- const url = URL.createObjectURL(
647
- new Blob([lines.join("\n")], { type: "text/csv" }));
648
- elem(doc, "a", { href: url, download: file }).click();
639
+ const rows = all ? Array.from({ length: all.rows }, (_, i) => i + 1) : el._lt.view(),
640
+ url = URL.createObjectURL(new Blob(
641
+ [X.text(fmt, s, rows, o.mode === "raw" ? textual(s) : undefined)],
642
+ { type: X.formats[fmt].mime }));
643
+ elem(doc, "a", { href: url, download: `${stem}.${fmt}` }).click();
649
644
  URL.revokeObjectURL(url);
650
645
  };
646
+ if (one) return btn.onclick = () => save(fmts[0]);
647
+ const menu = elem(doc, "div", { className: "lti-menu", hidden: true, role: "menu" }, wrap),
648
+ close = dropdown(doc, wrap, btn, menu);
649
+ for (const f of fmts) {
650
+ const item = elem(doc, "label", { textContent: X.formats[f].label, role: "menuitem", tabIndex: 0 }, menu);
651
+ item.onclick = () => { close(); save(f); };
652
+ item.onkeydown = e => { if (e.key === "Enter" || e.key === " ") { e.preventDefault(); item.click(); } };
653
+ }
654
+ }
655
+
656
+ // Open/close the popup `menu` from `btn`; it closes on an outside click or
657
+ // Escape. Returns the closer.
658
+ function dropdown(doc, wrap, btn, menu) {
659
+ const open = on => {
660
+ menu.hidden = !on;
661
+ btn.setAttribute("aria-expanded", String(on));
662
+ };
663
+ open(false);
664
+ btn.onclick = e => { e.stopPropagation(); open(menu.hidden); };
665
+ btn.onkeydown = e => { if (e.key === "Enter" || e.key === " ") { e.preventDefault(); btn.click(); } };
666
+ on(doc, "click", e => { if (!wrap.contains(e.target)) open(false); });
667
+ on(doc, "keydown", e => { if (e.key === "Escape") open(false); });
668
+ return () => open(false);
651
669
  }
652
670
 
653
671
  // Cycle a column asc -> desc -> unsorted in `state.sort`. Plain click sorts by
@@ -1066,7 +1084,6 @@
1066
1084
  type: "button", title: "Show/Hide columns",
1067
1085
  "aria-label": "Show/Hide columns"
1068
1086
  });
1069
- btn.setAttribute("aria-expanded", "false");
1070
1087
  wrap.append(btn);
1071
1088
  const menu = elem(doc, "div", { className: "lti-menu", hidden: true }, wrap);
1072
1089
  // checkbox per column; `sub` indents under a spanner header
@@ -1092,14 +1109,7 @@
1092
1109
  for (let i = c._start; i < c._start + c._span; i++) addBox(i, span);
1093
1110
  } else cols.forEach((_, i) => addBox(i));
1094
1111
  cols.forEach((_, i) => apply(i)); // apply initially hidden columns
1095
- const open = on => {
1096
- menu.hidden = !on;
1097
- btn.setAttribute("aria-expanded", String(on));
1098
- };
1099
- btn.onclick = e => { e.stopPropagation(); open(menu.hidden); };
1100
- btn.onkeydown = e => { if (e.key === "Enter" || e.key === " ") { e.preventDefault(); btn.click(); } };
1101
- on(doc, "click", e => { if (!wrap.contains(e.target)) open(false); });
1102
- on(doc, "keydown", e => { if (e.key === "Escape") open(false); });
1112
+ dropdown(doc, wrap, btn, menu);
1103
1113
  }
1104
1114
 
1105
1115
  // --- Typed column filters (`filter` named-list form). A typed spec is