@xiee/utils 1.14.153 → 1.14.155
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 +1 -1
- package/README.md +2 -1
- package/css/pages.css +64 -3
- package/css/pages.min.css +1 -1
- package/css/pages.min.css.map +1 -1
- package/css/pkgdown-like.css +1 -1
- package/css/pkgdown-like.min.css +1 -1
- package/css/pkgdown-like.min.css.map +1 -1
- package/css/site.css +13 -1
- package/css/site.min.css +1 -1
- package/css/site.min.css.map +1 -1
- package/js/lt-query.js +17 -5
- package/js/lt-query.min.js +1 -1
- package/js/lt-query.min.js.map +1 -1
- package/js/nav-highlight.js +2 -1
- package/js/nav-highlight.min.js +1 -1
- package/js/nav-highlight.min.js.map +1 -1
- package/js/number-captions.js +1 -1
- package/js/number-captions.min.js +1 -1
- package/js/number-captions.min.js.map +1 -1
- package/js/pages.js +359 -311
- package/js/pages.min.js +1 -1
- package/js/pages.min.js.map +1 -1
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -23,7 +23,7 @@ CHROMIUM_PATH=/usr/bin/chromium-browser npm test # use an installed browser
|
|
|
23
23
|
- Tests for white space at page bottoms: a filler `div` of `B - free` px (`B`: body height of a probe page) before the block, sweep `free` over a range (the page capacity is not exactly the body height), assert on page 1 (see `firstPages()`), and check that the test fails without the change.
|
|
24
24
|
- Fill mode (`pagesjs-filling`: `height: auto`, `scrollHeight` is the natural height) differs from the final layout (fixed height; the body may hang over into the space above the footer). What the reader sees must be measured in the final layout (`checkOffsets()` for `page-multiple`).
|
|
25
25
|
- Footnotes and citations are measured as a `.footnotes` block after the page body, like in the end (`syncNotes()`); in the text they are hidden markers (`span.pagesjs-note`) that go with their references. Don't measure them inline or add CSS to approximate their space.
|
|
26
|
-
- Floats (captioned `figure`/`.figure`, or `.float`): one that does not fit waits for the next page and the content after it fills the gap, so a `fragment-last` piece may follow a float (`.pagesjs-
|
|
26
|
+
- Floats (captioned `figure`/`.figure`, or `.pagesjs-float`): one that does not fit waits for the next page and the content after it fills the gap, so a `fragment-last` piece may follow a float (`.pagesjs-waited`) at the top of a page, and the order of the text changes (tests compare sorted characters). A float taller than `data-pages-float-page` percent of the body (70) gets a page of its own.
|
|
27
27
|
- By design, not bugs: a 2-line paragraph is not split (orphan/widow), a heading may end a page, `.figure`/diagrams/flex containers are never broken (they overflow small pages), `moveShortHead()` compares with one line.
|
|
28
28
|
- To compare a change: dump the `.pagesjs-page` HTML before and after (normalize file paths in link titles, random `md-<n>-<n>` ids and `data-page-number`), and check that the concatenated body text is identical.
|
|
29
29
|
|
package/README.md
CHANGED
|
@@ -141,7 +141,8 @@ expressions (by default, MathJax ignores math in `<code>`).
|
|
|
141
141
|
Highlight the links in `<nav>` that point to the current page by setting
|
|
142
142
|
`aria-current="page"` on them (style them via `nav a[aria-current]`). The
|
|
143
143
|
`.html` extension, `index.html`, trailing slashes, query strings, and hashes are
|
|
144
|
-
ignored when comparing URLs, so `foo.html` matches `foo`.
|
|
144
|
+
ignored when comparing URLs, so `foo.html` matches `foo`. Bare #hash links (e.g., `#sec`) are skipped: they
|
|
145
|
+
only jump within the current page.
|
|
145
146
|
|
|
146
147
|
## no-highlight.js
|
|
147
148
|
|
package/css/pages.css
CHANGED
|
@@ -9,11 +9,19 @@
|
|
|
9
9
|
--page-header-bottom: 40px;
|
|
10
10
|
--page-footer-height: 40px;
|
|
11
11
|
--page-footer-top: 40px;
|
|
12
|
+
/* (copies, so that a landscape page can swap the sizes without a cycle) */
|
|
13
|
+
--paper-w: var(--paper-width);
|
|
14
|
+
--paper-h: var(--paper-height);
|
|
12
15
|
}
|
|
13
16
|
@page {
|
|
14
17
|
size: var(--paper-width) var(--paper-height);
|
|
15
18
|
margin: 0;
|
|
16
19
|
}
|
|
20
|
+
/* the page of a float that is too wide for a portrait page (pages.js): the paper turned */
|
|
21
|
+
@page wide {
|
|
22
|
+
size: var(--paper-height) var(--paper-width);
|
|
23
|
+
margin: 0;
|
|
24
|
+
}
|
|
17
25
|
@page multiple {
|
|
18
26
|
margin-top: var(--paper-margin-top);
|
|
19
27
|
margin-bottom: var(--paper-margin-bottom);
|
|
@@ -21,6 +29,11 @@
|
|
|
21
29
|
.page-multiple {
|
|
22
30
|
page: multiple;
|
|
23
31
|
}
|
|
32
|
+
.page-wide {
|
|
33
|
+
page: wide;
|
|
34
|
+
--paper-width: var(--paper-h);
|
|
35
|
+
--paper-height: var(--paper-w);
|
|
36
|
+
}
|
|
24
37
|
.pagesjs {
|
|
25
38
|
padding: 0;
|
|
26
39
|
max-width: 100%;
|
|
@@ -39,8 +52,9 @@
|
|
|
39
52
|
.pagesjs-page {
|
|
40
53
|
width: var(--paper-width);
|
|
41
54
|
height: var(--paper-height);
|
|
55
|
+
flex: none; /* (keep the paper size in a narrow window: the content is laid out for it) */
|
|
42
56
|
padding: var(--paper-margin-top) var(--paper-margin-right) var(--paper-margin-bottom) var(--paper-margin-left);
|
|
43
|
-
break-after: page
|
|
57
|
+
break-before: page; /* (not break-after: a named page after a break-after gets a blank page in Chrome) */
|
|
44
58
|
display: flex;
|
|
45
59
|
flex-direction: column;
|
|
46
60
|
justify-content: space-between;
|
|
@@ -112,13 +126,11 @@
|
|
|
112
126
|
&:not(.fragment-first) {
|
|
113
127
|
border-top: none;
|
|
114
128
|
margin-top: 0;
|
|
115
|
-
padding-top: 0;
|
|
116
129
|
& > thead { opacity: .5; }
|
|
117
130
|
}
|
|
118
131
|
&:not(.fragment-last) {
|
|
119
132
|
border-bottom: none;
|
|
120
133
|
margin-bottom: 0;
|
|
121
|
-
padding-bottom: 0;
|
|
122
134
|
& > tfoot { opacity: .5; }
|
|
123
135
|
}
|
|
124
136
|
}
|
|
@@ -132,6 +144,8 @@
|
|
|
132
144
|
width: var(--paper-width);
|
|
133
145
|
margin-left: calc(0px - var(--paper-margin-left));
|
|
134
146
|
transform: none;
|
|
147
|
+
/* (article.css caps the content at the viewport, which differs between screen and print) */
|
|
148
|
+
& * { max-width: calc(var(--paper-width) - 4em); }
|
|
135
149
|
}
|
|
136
150
|
/* the page of a float that takes the whole page (the class is set by pages.js): center it */
|
|
137
151
|
&.page-float .pagesjs-body {
|
|
@@ -176,6 +190,49 @@
|
|
|
176
190
|
color: white;
|
|
177
191
|
font: 14px sans-serif;
|
|
178
192
|
}
|
|
193
|
+
.pagesjs-hit {
|
|
194
|
+
outline: 3px solid #e33;
|
|
195
|
+
outline-offset: 2px;
|
|
196
|
+
}
|
|
197
|
+
.pagesjs-tools {
|
|
198
|
+
position: absolute; /* (scrolls with the unpaginated page; fixed when paginated) */
|
|
199
|
+
top: 1em;
|
|
200
|
+
left: 1em;
|
|
201
|
+
z-index: 9999;
|
|
202
|
+
display: flex;
|
|
203
|
+
flex-direction: column;
|
|
204
|
+
align-items: flex-start;
|
|
205
|
+
gap: .5em;
|
|
206
|
+
font: 14px sans-serif;
|
|
207
|
+
button, .pagesjs-panel {
|
|
208
|
+
background: Canvas;
|
|
209
|
+
color: CanvasText;
|
|
210
|
+
border: 1px solid;
|
|
211
|
+
border-radius: .3em;
|
|
212
|
+
}
|
|
213
|
+
button {
|
|
214
|
+
width: 2.2em;
|
|
215
|
+
height: 2.2em;
|
|
216
|
+
padding: 0;
|
|
217
|
+
cursor: pointer;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
.pagesjs-panel {
|
|
221
|
+
position: absolute;
|
|
222
|
+
top: 0;
|
|
223
|
+
left: calc(100% + .5em); /* (beside the buttons) */
|
|
224
|
+
width: min(30em, calc(100vw - 5em));
|
|
225
|
+
max-height: calc(100vh - 2em); /* (the panel starts at the top of the toolbar, 1em from the top) */
|
|
226
|
+
overflow: auto;
|
|
227
|
+
padding: .5em 1em;
|
|
228
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
|
|
229
|
+
ul { margin: 0; padding-left: 1.2em; list-style: none; }
|
|
230
|
+
& > nav > ul, .pagesjs-problems { padding-left: 0; }
|
|
231
|
+
a { display: block; padding: .15em 0; color: inherit; text-decoration: none; }
|
|
232
|
+
a::before { content: attr(data-page-number); float: right; opacity: .6; }
|
|
233
|
+
a:hover { text-decoration: underline; }
|
|
234
|
+
li { cursor: pointer; padding: .15em 0; }
|
|
235
|
+
}
|
|
179
236
|
.pagesjs-settle .pagesjs-body {
|
|
180
237
|
/* the probe page that holds all content has sides, but normal pages don't */
|
|
181
238
|
padding: 0 !important;
|
|
@@ -230,8 +287,12 @@
|
|
|
230
287
|
}
|
|
231
288
|
}
|
|
232
289
|
}
|
|
290
|
+
.pagesjs .pagesjs-tools { position: fixed; }
|
|
233
291
|
@media print {
|
|
292
|
+
.pagesjs-tools { display: none; }
|
|
293
|
+
.pagesjs-hit { outline: none; }
|
|
234
294
|
.pagesjs {
|
|
295
|
+
display: block; /* (named pages, i.e., landscape ones, don't work in a flex container) */
|
|
235
296
|
margin: 0;
|
|
236
297
|
gap: 0;
|
|
237
298
|
.page-multiple {
|
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}@page{size:var(--paper-width) var(--paper-height);margin:0}@page multiple{margin-top:var(--paper-margin-top);margin-bottom:var(--paper-margin-bottom)}.page-multiple{page:multiple}.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-
|
|
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}}
|
|
2
2
|
/*# sourceMappingURL=pages.min.css.map */
|
package/css/pages.min.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"mappings":"AAAA,
|
|
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":[]}
|
package/css/pkgdown-like.css
CHANGED
package/css/pkgdown-like.min.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
:root{--pk-primary:#0054ad;--pk-fg:#212529;--pk-muted:#212529bf;--pk-bg:#fff;--pk-border:#dee2e6;--pk-code-bg:#0000000a;--pk-soft:#2125291a;--pk-nav-bg:color-mix(in oklab, var(--pk-bg) 90%, var(--pk-primary));--accent:var(--pk-primary);--muted-bg:var(--pk-code-bg);--border-color:var(--pk-border);--rule-color:var(--pk-border);--article-bg:transparent;--side-width:16rem}@media (prefers-color-scheme:dark){:root{--pk-bg:#deddd8}}body{background:var(--pk-bg);max-width:1140px;color:var(--pk-fg);padding-top:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif}a{color:var(--pk-primary)}article h2{border:0}.site-nav{background:var(--pk-nav-bg);box-shadow:0 0 0 100vmax var(--pk-nav-bg);clip-path:inset(0 -100vmax);padding:.5rem 0;&>p{align-items:center;margin:0;&,&:last-child{border:0}}& a{color:inherit;background:0 0;border-radius:.5rem;margin:0;&:hover{background:var(--pk-soft);color:inherit}&[aria-current]{box-shadow:none;background:var(--pk-soft);margin-bottom:0}&.brand{font-size:1.25rem}}& .version{color:var(--pk-muted);margin-right:1em}}article:not(.pagesjs *),.frontmatter{box-shadow:none;background:0 0;margin:0}.frontmatter{border-bottom:1px solid var(--pk-border);text-align:left;margin:1.5rem 0 .5rem;padding-bottom:.5rem}@media (width>=62em){article:not(.pagesjs *){margin-right:calc(var(--side-width) + var(--side-gap))}}.side{background:var(--pk-bg)}#TOC{position:sticky}#TOC.side{& .active{color:var(--pk-primary)}&:before{content:"On this page";margin:.5rem 0;font-size:1.25rem;font-weight:500;display:block}& a{color:inherit}}body:has(.pkg-desc) #TOC{display:none}pre>code,pre>code[class]{border:1px solid var(--pk-border);background:var(--pk-code-bg);border-radius:.5rem}:not(pre)>code{background:var(--pk-code-bg);border-radius:.5rem}footer{color:var(--pk-muted);border-top:1px solid var(--pk-border);font-size:.875em}
|
|
1
|
+
:root{--pk-primary:#0054ad;--pk-fg:#212529;--pk-muted:#212529bf;--pk-bg:#fff;--pk-border:#dee2e6;--pk-code-bg:#0000000a;--pk-soft:#2125291a;--pk-nav-bg:color-mix(in oklab, var(--pk-bg) 90%, var(--pk-primary));--accent:var(--pk-primary);--muted-bg:var(--pk-code-bg);--border-color:var(--pk-border);--rule-color:var(--pk-border);--article-bg:transparent;--side-width:16rem}@media (prefers-color-scheme:dark){:root{--pk-bg:#deddd8}}body{background:var(--pk-bg);max-width:1140px;color:var(--pk-fg);padding-top:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif}a{color:var(--pk-primary)}article h2{border:0}.site-nav{background:var(--pk-nav-bg);box-shadow:0 0 0 100vmax var(--pk-nav-bg);clip-path:inset(0 -100vmax);padding:.5rem 0;&>p{align-items:center;margin:0;&,&:last-child{border:0}}& a,& button{color:inherit;background:0 0;border-radius:.5rem;margin:0;&:hover{background:var(--pk-soft);color:inherit}&[aria-current]{box-shadow:none;background:var(--pk-soft);margin-bottom:0}&.brand{font-size:1.25rem}}& .version{color:var(--pk-muted);margin-right:1em}}article:not(.pagesjs *),.frontmatter{box-shadow:none;background:0 0;margin:0}.frontmatter{border-bottom:1px solid var(--pk-border);text-align:left;margin:1.5rem 0 .5rem;padding-bottom:.5rem}@media (width>=62em){article:not(.pagesjs *){margin-right:calc(var(--side-width) + var(--side-gap))}}.side{background:var(--pk-bg)}#TOC{position:sticky}#TOC.side{& .active{color:var(--pk-primary)}&:before{content:"On this page";margin:.5rem 0;font-size:1.25rem;font-weight:500;display:block}& a{color:inherit}}body:has(.pkg-desc) #TOC{display:none}pre>code,pre>code[class]{border:1px solid var(--pk-border);background:var(--pk-code-bg);border-radius:.5rem}:not(pre)>code{background:var(--pk-code-bg);border-radius:.5rem}footer{color:var(--pk-muted);border-top:1px solid var(--pk-border);font-size:.875em}
|
|
2
2
|
/*# sourceMappingURL=pkgdown-like.min.css.map */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"mappings":"AAIA,mXAgBA,mCACE,uBAKF,mKAOA,0BACA,oBAGA,4HAKE,gCAGE,yBAEF,
|
|
1
|
+
{"version":3,"mappings":"AAIA,mXAgBA,mCACE,uBAKF,mKAOA,0BACA,oBAGA,4HAKE,gCAGE,yBAEF,uEAKE,gDACA,0EACA,2BAEF,mDAIF,6EAKA,iHAQA,qBACE,gFAIF,8BAEA,qBACA,UACE,kCACA,+FAOA,mBAEF,sCAGA,4GAKA,gEAKA","sources":["pkgdown-like.css"],"sourcesContent":["/* Make a site look like a pkgdown site (Bootstrap 5): a tinted top navbar, a\n page header with a rule, a right sidebar (\"On this page\"), pale code blocks.\n Load it after the default site CSS. The TOC goes to the right via\n `toc: {class: \"side side-right\"}` in _litedown.yml. */\n:root {\n --pk-primary: #0054ad;\n --pk-fg: #212529;\n --pk-muted: rgba(33, 37, 41, .75);\n --pk-bg: #fff;\n --pk-border: #dee2e6;\n --pk-code-bg: rgba(0, 0, 0, .04);\n --pk-soft: rgba(33, 37, 41, .1);\n --pk-nav-bg: color-mix(in oklab, var(--pk-bg) 90%, var(--pk-primary));\n --accent: var(--pk-primary);\n --muted-bg: var(--pk-code-bg);\n --border-color: var(--pk-border);\n --rule-color: var(--pk-border);\n --article-bg: transparent;\n --side-width: 16rem;\n}\n@media (prefers-color-scheme: dark) {\n :root {\n --pk-bg: #deddd8;\n }\n}\n\nbody {\n max-width: 1140px;\n padding-top: 0;\n background: var(--pk-bg);\n color: var(--pk-fg);\n font-family: system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif;\n}\na { color: var(--pk-primary); }\narticle h2 { border: 0; }\n\n/* tinted full-bleed navbar */\n.site-nav {\n padding: .5rem 0;\n background: var(--pk-nav-bg);\n box-shadow: 0 0 0 100vmax var(--pk-nav-bg);\n clip-path: inset(0 -100vmax);\n & > p {\n align-items: center;\n margin: 0;\n &, &:last-child { border: 0; }\n }\n a, button {\n margin: 0;\n border-radius: .5rem;\n background: none;\n color: inherit;\n &:hover { background: var(--pk-soft); color: inherit; }\n &[aria-current] { box-shadow: none; margin-bottom: 0; background: var(--pk-soft); }\n &.brand { font-size: 1.25rem; }\n }\n .version { color: var(--pk-muted); margin-right: 1em; }\n}\n\n/* page without card; header with a rule below */\narticle:not(.pagesjs *), .frontmatter {\n margin: 0;\n background: none;\n box-shadow: none;\n}\n.frontmatter {\n margin: 1.5rem 0 .5rem;\n padding-bottom: .5rem;\n border-bottom: 1px solid var(--pk-border);\n text-align: left;\n}\n\n/* make room for the sidebar, which hangs in the right margin of the article */\n@media (min-width: 62em) {\n article:not(.pagesjs *) { margin-right: calc(var(--side-width) + var(--side-gap)); }\n}\n\n/* \"On this page\" */\n.side { background: var(--pk-bg); }\n\n#TOC { position: sticky; }\n#TOC.side {\n .active { color: var(--pk-primary); }\n &::before {\n content: \"On this page\";\n display: block;\n margin: .5rem 0;\n font-size: 1.25rem;\n font-weight: 500;\n }\n a { color: inherit; }\n}\nbody:has(.pkg-desc) #TOC { display: none; }\n\n/* code */\npre > code, pre > code[class] {\n border: 1px solid var(--pk-border);\n border-radius: .5rem;\n background: var(--pk-code-bg);\n}\n:not(pre) > code {\n border-radius: .5rem;\n background: var(--pk-code-bg);\n}\n\nfooter {\n font-size: .875em;\n color: var(--pk-muted);\n border-top: 1px solid var(--pk-border);\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 {
|
|
12
|
+
a, button {
|
|
13
13
|
display: inline-block;
|
|
14
14
|
background: white;
|
|
15
15
|
padding: .2em .5em;
|
|
@@ -29,6 +29,18 @@ h1, h2, h3 {
|
|
|
29
29
|
&:hover img { filter: invert(1); }
|
|
30
30
|
}
|
|
31
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
|
+
}
|
|
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) */
|
|
43
|
+
}
|
|
32
44
|
/* package version next to the name: center it in the flex row */
|
|
33
45
|
.version { align-self: center; margin-right: .5em; }
|
|
34
46
|
}
|
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{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()}}}& .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,& 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)}
|
|
2
2
|
/*# sourceMappingURL=site.min.css.map */
|
package/css/site.min.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"mappings":"AAAA,yBAGA,UACE,gCAGE,yDAIF,
|
|
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":[]}
|
package/js/lt-query.js
CHANGED
|
@@ -20,8 +20,10 @@
|
|
|
20
20
|
* | between 5 and 10 | contains has : | does not contain doesn't contain excludes
|
|
21
21
|
* | `col value` alone means contains
|
|
22
22
|
* Conditions combine with `and`, `,` or `;` (all must hold); `or` alternates.
|
|
23
|
-
*
|
|
24
|
-
*
|
|
23
|
+
* The text after `contains` runs to the next `and`, `or`, `,`, `;` or operator, so
|
|
24
|
+
* a phrase needs no quotes. Other words are free text, each must be found; "quote"
|
|
25
|
+
* a phrase. With `col0`, the condition needs no column name and free text belongs to
|
|
26
|
+
* that column.
|
|
25
27
|
* `does not contain` needs none either: alone, no cell may contain the text.
|
|
26
28
|
* Text using `x` (an expression) is kept whole.
|
|
27
29
|
*/
|
|
@@ -85,6 +87,13 @@
|
|
|
85
87
|
const val = j => toks[j]?.k === "w" || toks[j]?.k === "q" ? toks[j].t : null;
|
|
86
88
|
// a bare value after a column name (`color red`): not an operator or joiner
|
|
87
89
|
const bare = j => val(j) != null && !opAt(j) && !["and", "or"].includes(lower(toks[j]));
|
|
90
|
+
// text phrase at token i: words and quotes up to a joiner or operator -> [text, next token]
|
|
91
|
+
const phrase = i => {
|
|
92
|
+
if (val(i) == null) return;
|
|
93
|
+
let e = i + 1;
|
|
94
|
+
while (val(e) != null && !opAt(e) && !["and", "or"].includes(lower(toks[e]))) e++;
|
|
95
|
+
return [toks.slice(i, e).map(t => t.t).join(" "), e];
|
|
96
|
+
};
|
|
88
97
|
// condition at token j -> [term, next token], or undefined
|
|
89
98
|
const cond = j => {
|
|
90
99
|
const o = opAt(j);
|
|
@@ -94,8 +103,11 @@
|
|
|
94
103
|
if (o.op === "between") {
|
|
95
104
|
const b = lower(toks[i + 1]) === "and" ? val(i + 2) : null;
|
|
96
105
|
if (b != null && isNum(a) && isNum(b)) return [`x >= ${num(a)} && x <= ${num(b)}`, i + 3];
|
|
97
|
-
} else if (o.op === ":") return
|
|
98
|
-
else if (o.op === "!:")
|
|
106
|
+
} else if (o.op === ":") return phrase(i);
|
|
107
|
+
else if (o.op === "!:") {
|
|
108
|
+
const [p, e] = phrase(i);
|
|
109
|
+
return [`!String(x).toLowerCase().includes(${JSON.stringify(p.toLowerCase())})`, e, `x does not contain ${JSON.stringify(p)}`];
|
|
110
|
+
}
|
|
99
111
|
else if (o.op === "==" || o.op === "!=") {
|
|
100
112
|
if (isNum(a)) return [`x ${o.op} ${num(a)}`, i + 1];
|
|
101
113
|
// text compares ignoring case; the summary shows the plain `x == "A"`
|
|
@@ -114,7 +126,7 @@
|
|
|
114
126
|
alts.push([]); last = null; i++; continue;
|
|
115
127
|
}
|
|
116
128
|
let col, hit, n = named(i);
|
|
117
|
-
if (n && (hit = cond(n[1]) || (bare(n[1]) &&
|
|
129
|
+
if (n && (hit = cond(n[1]) || (bare(n[1]) && phrase(n[1])))) col = n[0];
|
|
118
130
|
else if ((col0 != null || opAt(i)?.op === "!:") && (hit = cond(i))) col = col0;
|
|
119
131
|
if (hit) {
|
|
120
132
|
add({ col, term: hit[0], show: hit[2] });
|
package/js/lt-query.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(t=>{"use strict";const e=Object.entries({":":["contains","has",":"],"!:":["does not contain","doesn't contain","excludes"],">":["greater than","more than","bigger than","larger than","above","over",">"],">=":["at least","greater than or equal to",">="],"<":["less than","smaller than","fewer than","below","under","<"],"<=":["at most","no more than","up to","less than or equal to","<="],"==":["is","equals","equal to","=","=="],"!=":["is not","isn't","not","other than","!="],between:["between"]}).flatMap(([t,e])=>e.map(e=>[e.split(" "),t])).sort((t,e)=>e[0].length-t[0].length),n=/"([^"]*)"|(>=|<=|!=|==|[<>=:])|(;|,(?=\s|$))|((?:!(?!=))?(?:,(?=\S)|[^\s"<>=!:;,])+)|(\S)/g,o=t=>{if(!/(^|[^\w$])x([^\w$]|$)/.test(t))return!1;try{return new Function("x",`return (${t});`),!0}catch(t){return!1}},r=t=>t.replace(/(?<=\d),(?=\d{3}\b)/g,""),l=t=>""!==t.trim()&&isFinite(r(t)),s=t=>String(t).trim().split(/\s+/).join(" ").toLowerCase(),i=t=>t?.t.toLowerCase();const u=t=>!!t&&("or"===t.op||(t.op?t.items.some(u):!t.free));const a={parse:function(t,u={},a=null){const p=String(t??"").trim();if(!p)return null;if(o(p))return{col:a,term:p,free:!0};const c=[...p.matchAll(n)].map(t=>({t:t[1]??t[0],s:t.index,e:t.index+t[0].length,k:null!=t[1]?"q":t[2]?"o":t[3]?"s":"w"})),f=new Map(Object.entries(u).map(([t,e])=>[s(t),e])),m=Math.max(1,...[...f.keys()].map(t=>t.split(" ").length)),h=t=>{for(let e=Math.min(m,c.length-t);e>0;e--){const n=c.slice(t,t+e),o=n.every(t=>"w"===t.k||"q"===t.k)?f.get(s(n.map(t=>t.t).join(" "))):void 0;if(void 0!==o)return[o,t+e]}},d=t=>{const n=e.find(([e])=>e.every((e,n)=>/^[wo]$/.test(c[t+n]?.k)&&i(c[t+n])===e));return n&&{op:n[1],n:n[0].length}},g=t=>"w"===c[t]?.k||"q"===c[t]?.k?c[t].t:null,w=t=>null!=g(t)&&!d(t)&&!["and","or"].includes(i(c[t])),$=t=>{const e=d(t);if(!e)return;const n=t+e.n,o=g(n);if(null!=o)if("between"===e.op){const t="and"===i(c[n+1])?g(n+2):null;if(null!=t&&l(o)&&l(t))return[`x >= ${r(o)} && x <= ${r(t)}`,n+3]}else{if(":"===e.op)return
|
|
1
|
+
(t=>{"use strict";const e=Object.entries({":":["contains","has",":"],"!:":["does not contain","doesn't contain","excludes"],">":["greater than","more than","bigger than","larger than","above","over",">"],">=":["at least","greater than or equal to",">="],"<":["less than","smaller than","fewer than","below","under","<"],"<=":["at most","no more than","up to","less than or equal to","<="],"==":["is","equals","equal to","=","=="],"!=":["is not","isn't","not","other than","!="],between:["between"]}).flatMap(([t,e])=>e.map(e=>[e.split(" "),t])).sort((t,e)=>e[0].length-t[0].length),n=/"([^"]*)"|(>=|<=|!=|==|[<>=:])|(;|,(?=\s|$))|((?:!(?!=))?(?:,(?=\S)|[^\s"<>=!:;,])+)|(\S)/g,o=t=>{if(!/(^|[^\w$])x([^\w$]|$)/.test(t))return!1;try{return new Function("x",`return (${t});`),!0}catch(t){return!1}},r=t=>t.replace(/(?<=\d),(?=\d{3}\b)/g,""),l=t=>""!==t.trim()&&isFinite(r(t)),s=t=>String(t).trim().split(/\s+/).join(" ").toLowerCase(),i=t=>t?.t.toLowerCase();const u=t=>!!t&&("or"===t.op||(t.op?t.items.some(u):!t.free));const a={parse:function(t,u={},a=null){const p=String(t??"").trim();if(!p)return null;if(o(p))return{col:a,term:p,free:!0};const c=[...p.matchAll(n)].map(t=>({t:t[1]??t[0],s:t.index,e:t.index+t[0].length,k:null!=t[1]?"q":t[2]?"o":t[3]?"s":"w"})),f=new Map(Object.entries(u).map(([t,e])=>[s(t),e])),m=Math.max(1,...[...f.keys()].map(t=>t.split(" ").length)),h=t=>{for(let e=Math.min(m,c.length-t);e>0;e--){const n=c.slice(t,t+e),o=n.every(t=>"w"===t.k||"q"===t.k)?f.get(s(n.map(t=>t.t).join(" "))):void 0;if(void 0!==o)return[o,t+e]}},d=t=>{const n=e.find(([e])=>e.every((e,n)=>/^[wo]$/.test(c[t+n]?.k)&&i(c[t+n])===e));return n&&{op:n[1],n:n[0].length}},g=t=>"w"===c[t]?.k||"q"===c[t]?.k?c[t].t:null,w=t=>null!=g(t)&&!d(t)&&!["and","or"].includes(i(c[t])),$=t=>{if(null==g(t))return;let e=t+1;for(;null!=g(e)&&!d(e)&&!["and","or"].includes(i(c[e]));)e++;return[c.slice(t,e).map(t=>t.t).join(" "),e]},x=t=>{const e=d(t);if(!e)return;const n=t+e.n,o=g(n);if(null!=o)if("between"===e.op){const t="and"===i(c[n+1])?g(n+2):null;if(null!=t&&l(o)&&l(t))return[`x >= ${r(o)} && x <= ${r(t)}`,n+3]}else{if(":"===e.op)return $(n);if("!:"===e.op){const[t,e]=$(n);return[`!String(x).toLowerCase().includes(${JSON.stringify(t.toLowerCase())})`,e,`x does not contain ${JSON.stringify(t)}`]}if("=="===e.op||"!="===e.op)return l(o)?[`x ${e.op} ${r(o)}`,n+1]:[`String(x).toLowerCase() ${e.op} ${JSON.stringify(o.toLowerCase())}`,n+1,`x ${e.op} ${JSON.stringify(o)}`];if(l(o))return[`x ${e.op} ${r(o)}`,n+1]}},b=[[]];let y=null,S=-1;const k=t=>{b.at(-1).push(t),y=null};for(let t=0;t<c.length;){const e=c[t];if("s"===e.k){y=null,t++;continue}if("w"===e.k&&"or"===i(e)&&b.at(-1).length){b.push([]),y=null,t++;continue}let n,o,r=h(t);r&&(o=x(r[1])||w(r[1])&&$(r[1]))?n=r[0]:null==a&&"!:"!==d(t)?.op||!(o=x(t))||(n=a),o?(k({col:n,term:o[0],show:o[2]}),t=o[1],"and"===i(c[t])&&t++):(y&&S===e.s?y.term+=e.t:(y={col:a,term:e.t,free:!0},b.at(-1).push(y)),S=e.e,t++)}const j=b.filter(t=>t.length).map(t=>t.length>1?{op:"and",items:t}:t[0]);return j.length>1?{op:"or",items:j}:j[0]??null},text:function t(e,n=t=>t){if(!e)return"";if(!e.op){const t=null!=e.col&&n(e.col);return(t?`${t}: `:"")+(o(e.term)?e.show??e.term:`"${e.term}"`)}return e.items.map(o=>o.op&&o.op!==e.op?`(${t(o,n)})`:t(o,n)).join("and"===e.op?" and ":" or ")},expr:function t(e){if(!e)return null;if(!e.op)return o(e.term)?e.term:null;const n=e.items.map(t);return n.includes(null)?null:n.map(t=>`(${t})`).join("and"===e.op?" && ":" || ")},parsed:u,isExpr:o};"object"==typeof module&&module.exports?module.exports=a:((t.LT||={}).plugins||={}).query=a})("undefined"!=typeof window?window:globalThis);
|
|
2
2
|
//# sourceMappingURL=lt-query.min.js.map
|
package/js/lt-query.min.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["root","PHRASES","Object","entries","between","flatMap","op","ps","map","p","split","sort","a","b","length","LEX","isExpr","v","test","Function","e","num","replace","isNum","trim","isFinite","norm","s","String","join","toLowerCase","lower","t","parsed","items","some","free","Q","parse","query","names","col0","raw","col","term","toks","matchAll","m","index","k","byName","Map","n","c","maxK","Math","max","keys","named","i","min","part","slice","every","get","undefined","opAt","j","hit","find","ws","w","val","bare","includes","cond","o","JSON","stringify","alts","last","lastEnd","add","leaf","at","push","show","ands","filter","text","tree","label","name","expr","parts","module","exports","LT","plugins","window","globalThis"],"sources":["lt-query.js"],"mappings":"
|
|
1
|
+
{"version":3,"names":["root","PHRASES","Object","entries","between","flatMap","op","ps","map","p","split","sort","a","b","length","LEX","isExpr","v","test","Function","e","num","replace","isNum","trim","isFinite","norm","s","String","join","toLowerCase","lower","t","parsed","items","some","free","Q","parse","query","names","col0","raw","col","term","toks","matchAll","m","index","k","byName","Map","n","c","maxK","Math","max","keys","named","i","min","part","slice","every","get","undefined","opAt","j","hit","find","ws","w","val","bare","includes","phrase","cond","o","JSON","stringify","alts","last","lastEnd","add","leaf","at","push","show","ands","filter","text","tree","label","name","expr","parts","module","exports","LT","plugins","window","globalThis"],"sources":["lt-query.js"],"mappings":"AA6BA,CAACA,IACC,aAGA,MAYMC,EAAUC,OAAOC,QAZX,CACV,IAAK,CAAC,WAAY,MAAO,KACzB,KAAM,CAAC,mBAAoB,kBAAmB,YAC9C,IAAK,CAAC,eAAgB,YAAa,cAAe,cAAe,QAAS,OAAQ,KAClF,KAAM,CAAC,WAAY,2BAA4B,MAC/C,IAAK,CAAC,YAAa,eAAgB,aAAc,QAAS,QAAS,KACnE,KAAM,CAAC,UAAW,eAAgB,QAAS,wBAAyB,MACpE,KAAM,CAAC,KAAM,SAAU,WAAY,IAAK,MACxC,KAAM,CAAC,SAAU,QAAS,MAAO,aAAc,MAC/CC,QAAS,CAAC,aAGwBC,QAAQ,EAAEC,EAAIC,KAAQA,EAAGC,IAAIC,GAAK,CAACA,EAAEC,MAAM,KAAMJ,KAClFK,KAAK,CAACC,EAAGC,IAAMA,EAAE,GAAGC,OAASF,EAAE,GAAGE,QAG/BC,EAAM,6FAGNC,EAASC,IACb,IAAK,wBAAwBC,KAAKD,GAAI,OAAO,EAC7C,IAA2C,OAArC,IAAIE,SAAS,IAAK,WAAWF,QAAe,CAAM,CAAE,MAAOG,GAAK,OAAO,CAAO,GAGhFC,EAAMJ,GAAKA,EAAEK,QAAQ,uBAAwB,IAC7CC,EAAQN,GAAkB,KAAbA,EAAEO,QAAiBC,SAASJ,EAAIJ,IAC7CS,EAAOC,GAAKC,OAAOD,GAAGH,OAAOd,MAAM,OAAOmB,K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AAXgF,QAAuBA,OAAOC,QAASD,OAAOC,QAAU5D,IAC5DrC,EAAKkG,KAAO,CAAC,GAAGC,UAAY,CAAC,GAAG5D,MAAQF,CAChD,EAlJD,CAkJqB,oBAAX+D,OAAyBA,OAASC","ignoreList":[]}
|
package/js/nav-highlight.js
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
// foo.html and foo are the same page; so are dir/index.html and dir/
|
|
4
4
|
const norm = p => p.replace(/\/index(\.html)?$/, '/').replace(/\.html$/, '').replace(/(.)\/$/, '$1'),
|
|
5
5
|
l = location, p = norm(l.pathname),
|
|
6
|
-
|
|
6
|
+
// a bare #hash link only jumps within this page, so it does not say which page is current
|
|
7
|
+
links = [...d.querySelectorAll('nav a[href]')].filter(a => a.origin === l.origin && a.getAttribute('href')[0] !== '#');
|
|
7
8
|
let cur = links.filter(a => norm(a.pathname) === p);
|
|
8
9
|
// no exact match: the deepest link (foo/ or foo.html) whose section contains this page is current
|
|
9
10
|
if (!cur.length) {
|
package/js/nav-highlight.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(
|
|
1
|
+
(t=>{const e=t=>t.replace(/\/index(\.html)?$/,"/").replace(/\.html$/,"").replace(/(.)\/$/,"$1"),a=location,r=e(a.pathname),l=[...t.querySelectorAll("nav a[href]")].filter(t=>t.origin===a.origin&&"#"!==t.getAttribute("href")[0]);let i=l.filter(t=>e(t.pathname)===r);if(!i.length){const t=l.map(t=>[t,e(t.pathname)]).filter(([,t])=>"/"!==t&&r.startsWith(t+"/")),a=Math.max(0,...t.map(([,t])=>t.length));i=t.filter(([,t])=>t.length===a).map(([t])=>t)}i.forEach(t=>t.setAttribute("aria-current","page"))})(document);
|
|
2
2
|
//# sourceMappingURL=nav-highlight.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["d","norm","p","replace","l","location","pathname","links","querySelectorAll","filter","a","origin","cur","length","dirs","map","q","startsWith","n","Math","max","forEach","setAttribute","document"],"sources":["nav-highlight.js"],"mappings":"AACA,CAACA,IAEC,MAAMC,EAAOC,GAAKA,EAAEC,QAAQ,oBAAqB,KAAKA,QAAQ,UAAW,IAAIA,QAAQ,SAAU,MAC7FC,EAAIC,SAAUH,EAAID,EAAKG,EAAEE,
|
|
1
|
+
{"version":3,"names":["d","norm","p","replace","l","location","pathname","links","querySelectorAll","filter","a","origin","getAttribute","cur","length","dirs","map","q","startsWith","n","Math","max","forEach","setAttribute","document"],"sources":["nav-highlight.js"],"mappings":"AACA,CAACA,IAEC,MAAMC,EAAOC,GAAKA,EAAEC,QAAQ,oBAAqB,KAAKA,QAAQ,UAAW,IAAIA,QAAQ,SAAU,MAC7FC,EAAIC,SAAUH,EAAID,EAAKG,EAAEE,UAEzBC,EAAQ,IAAIP,EAAEQ,iBAAiB,gBAAgBC,OAAOC,GAAKA,EAAEC,SAAWP,EAAEO,QAAwC,MAA9BD,EAAEE,aAAa,QAAQ,IAC7G,IAAIC,EAAMN,EAAME,OAAOC,GAAKT,EAAKS,EAAEJ,YAAcJ,GAEjD,IAAKW,EAAIC,OAAQ,CACf,MAAMC,EAAOR,EAAMS,IAAIN,GAAK,CAACA,EAAGT,EAAKS,EAAEJ,YAAYG,OAAO,EAAE,CAAEQ,KAAa,MAANA,GAAaf,EAAEgB,WAAWD,EAAI,MAC7FE,EAAIC,KAAKC,IAAI,KAAMN,EAAKC,IAAI,EAAE,CAAEC,KAAOA,EAAEH,SAC/CD,EAAME,EAAKN,OAAO,EAAE,CAAEQ,KAAOA,EAAEH,SAAWK,GAAGH,IAAI,EAAEN,KAAOA,EAC5D,CACAG,EAAIS,QAAQZ,GAAKA,EAAEa,aAAa,eAAgB,QACjD,EAdD,CAcGC","ignoreList":[]}
|
package/js/number-captions.js
CHANGED
|
@@ -13,6 +13,6 @@
|
|
|
13
13
|
el.insertAdjacentHTML('afterbegin', `<span class="cap-num">${label}${i + 1}${colon}</span> `);
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
|
-
NUM('figure > figcaption, .figure > p.caption, .float > .figcaption', cfg?.figLabel || 'Figure ');
|
|
16
|
+
NUM('figure > figcaption, .figure > p.caption, .pagesjs-float > .figcaption', cfg?.figLabel || 'Figure ');
|
|
17
17
|
NUM('table > caption', cfg?.tabLabel || 'Table ');
|
|
18
18
|
})(document);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(a=>{const e=a.currentScript?.dataset,t=e?.colon||":";function c(e,c){a.querySelectorAll(e).forEach((a,e)=>{a.querySelector(".cap-num")||a.insertAdjacentHTML("afterbegin",`<span class="cap-num">${c}${e+1}${t}</span> `)})}c("figure > figcaption, .figure > p.caption, .float > .figcaption",e?.figLabel||"Figure "),c("table > caption",e?.tabLabel||"Table ")})(document);
|
|
1
|
+
(a=>{const e=a.currentScript?.dataset,t=e?.colon||":";function c(e,c){a.querySelectorAll(e).forEach((a,e)=>{a.querySelector(".cap-num")||a.insertAdjacentHTML("afterbegin",`<span class="cap-num">${c}${e+1}${t}</span> `)})}c("figure > figcaption, .figure > p.caption, .pagesjs-float > .figcaption",e?.figLabel||"Figure "),c("table > caption",e?.tabLabel||"Table ")})(document);
|
|
2
2
|
//# sourceMappingURL=number-captions.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["d","cfg","currentScript","dataset","colon","NUM","target","label","querySelectorAll","forEach","el","i","querySelector","insertAdjacentHTML","figLabel","tabLabel","document"],"sources":["number-captions.js"],"mappings":"AAMA,CAACA,IACC,MAAMC,EAAMD,EAAEE,eAAeC,QAASC,EAAQH,GAAKG,OAAS,IAC5D,SAASC,EAAIC,EAAQC,GACnBP,EAAEQ,iBAAiBF,GAAQG,QAAQ,CAACC,EAAIC,KAEtCD,EAAGE,cAAc,aACfF,EAAGG,mBAAmB,aAAc,yBAAyBN,IAAQI,EAAI,IAAIP,cAEnF,CACAC,EAAI,
|
|
1
|
+
{"version":3,"names":["d","cfg","currentScript","dataset","colon","NUM","target","label","querySelectorAll","forEach","el","i","querySelector","insertAdjacentHTML","figLabel","tabLabel","document"],"sources":["number-captions.js"],"mappings":"AAMA,CAACA,IACC,MAAMC,EAAMD,EAAEE,eAAeC,QAASC,EAAQH,GAAKG,OAAS,IAC5D,SAASC,EAAIC,EAAQC,GACnBP,EAAEQ,iBAAiBF,GAAQG,QAAQ,CAACC,EAAIC,KAEtCD,EAAGE,cAAc,aACfF,EAAGG,mBAAmB,aAAc,yBAAyBN,IAAQI,EAAI,IAAIP,cAEnF,CACAC,EAAI,yEAA0EJ,GAAKa,UAAY,WAC/FT,EAAI,kBAAmBJ,GAAKc,UAAY,SACzC,EAXD,CAWGC","ignoreList":[]}
|