@metacensus/library-ui 0.20.0 → 0.20.1
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/README.md +1 -1
- package/dist/tools/CiteThisPage.d.ts +2 -2
- package/dist/tools/CiteThisPage.js +2 -2
- package/package.json +1 -1
- package/src/css/styles.css +8 -17
package/README.md
CHANGED
|
@@ -60,7 +60,7 @@ import { Header, Nav, Button, displayScript } from '@metacensus/library-ui'
|
|
|
60
60
|
<Button variant="danger">Delete account</Button>
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
-
`CiteThisPage` takes a `citation` (`title`, `authors` as `Family, Given`, an ISO `date`, `publisher` and `url`) plus `risHref` and `bibHref`, and renders a round `Cite this page` button fixed at the viewport's
|
|
63
|
+
`CiteThisPage` takes a `citation` (`title`, `authors` as `Family, Given`, an ISO `date`, `publisher` and `url`) plus `risHref` and `bibHref`, and renders a round `Cite this page` button fixed at the viewport's bottom-right corner, mirroring `DisplayControls` at the bottom-left. Hover, focus or a tap opens a panel above it with the citation as text and a download link to each file. Render it once per page, from the layout, and hydrate it alone (`client:load`); it renders nothing when `citation.url` is empty. The page owns the URL and its permanence. The formatters are pure functions: a page writes the two files at build and links to them.
|
|
64
64
|
|
|
65
65
|
```astro
|
|
66
66
|
---
|
|
@@ -7,8 +7,8 @@ type CiteThisPageProps = {
|
|
|
7
7
|
bibHref: string;
|
|
8
8
|
className?: string;
|
|
9
9
|
};
|
|
10
|
-
/** A round `Cite this page` button fixed at the viewport's
|
|
11
|
-
*
|
|
10
|
+
/** A round `Cite this page` button fixed at the viewport's bottom-right
|
|
11
|
+
* corner. Hover, focus or a tap opens a panel above it with the citation as
|
|
12
12
|
* text and a download link to each file; Escape, moving away or a tap
|
|
13
13
|
* elsewhere closes it. It formats what the page gives it and renders nothing
|
|
14
14
|
* without a url. Render it once per page, from the layout; hydrate it alone. */
|
|
@@ -3,8 +3,8 @@ import { formatCitationText } from './cite.js';
|
|
|
3
3
|
import { Button } from './Button.js';
|
|
4
4
|
import { cn } from './cn.js';
|
|
5
5
|
import { Float } from './Float.js';
|
|
6
|
-
/** A round `Cite this page` button fixed at the viewport's
|
|
7
|
-
*
|
|
6
|
+
/** A round `Cite this page` button fixed at the viewport's bottom-right
|
|
7
|
+
* corner. Hover, focus or a tap opens a panel above it with the citation as
|
|
8
8
|
* text and a download link to each file; Escape, moving away or a tap
|
|
9
9
|
* elsewhere closes it. It formats what the page gives it and renders nothing
|
|
10
10
|
* without a url. Render it once per page, from the layout; hydrate it alone. */
|
package/package.json
CHANGED
package/src/css/styles.css
CHANGED
|
@@ -407,26 +407,17 @@
|
|
|
407
407
|
color: var(--mc-tint-blue-ink);
|
|
408
408
|
}
|
|
409
409
|
|
|
410
|
-
/* CiteThisPage: a floating button at the
|
|
411
|
-
its panel
|
|
410
|
+
/* CiteThisPage: a floating button at the bottom-right corner, mirroring the
|
|
411
|
+
display controls, with its panel above and growing leftward. */
|
|
412
412
|
.mc-cite {
|
|
413
|
-
inset-block-
|
|
414
|
-
inset-inline-
|
|
415
|
-
transform: translateY(-50%);
|
|
413
|
+
inset-block-end: 1rem;
|
|
414
|
+
inset-inline-end: 1rem;
|
|
416
415
|
}
|
|
417
416
|
.mc-cite .mc-float-panel {
|
|
418
|
-
inset-block-
|
|
419
|
-
inset-inline-
|
|
420
|
-
transform: translateY(-50%);
|
|
417
|
+
inset-block-end: calc(100% + 0.5rem);
|
|
418
|
+
inset-inline-end: 0;
|
|
421
419
|
width: 18rem;
|
|
422
|
-
max-width: calc(100vw -
|
|
423
|
-
}
|
|
424
|
-
.mc-cite .mc-float-panel::before {
|
|
425
|
-
inset-block: 0;
|
|
426
|
-
inset-inline-start: -0.5rem;
|
|
427
|
-
inset-inline-end: auto;
|
|
428
|
-
width: 0.5rem;
|
|
429
|
-
height: auto;
|
|
420
|
+
max-width: calc(100vw - 2rem);
|
|
430
421
|
}
|
|
431
422
|
.mc-cite-text {
|
|
432
423
|
margin: 0;
|
|
@@ -491,7 +482,7 @@
|
|
|
491
482
|
|
|
492
483
|
/* Floating controls: a round icon button fixed to the viewport, with a panel
|
|
493
484
|
beside it. DisplayControls sits at the bottom-left corner, the panel above;
|
|
494
|
-
CiteThisPage
|
|
485
|
+
CiteThisPage sits at the bottom-right. */
|
|
495
486
|
.mc-float {
|
|
496
487
|
position: fixed;
|
|
497
488
|
z-index: 40;
|