@uniweb/scholar 1.0.1 → 1.1.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniweb/scholar",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Academic content utilities for Uniweb - numbered equations with cross-references, bibliographic references, and inline citations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"url": "https://github.com/uniweb/scholar/issues"
|
|
38
38
|
},
|
|
39
39
|
"engines": {
|
|
40
|
-
"node": ">=
|
|
40
|
+
"node": ">=22.12"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@citestyle/bibtex": "^1.0.0",
|
|
@@ -50,8 +50,8 @@ export function BibtexBlock({
|
|
|
50
50
|
className={className}
|
|
51
51
|
style={{
|
|
52
52
|
position: 'relative',
|
|
53
|
-
backgroundColor: '#f8fafc',
|
|
54
|
-
border: '1px solid #e2e8f0',
|
|
53
|
+
backgroundColor: 'var(--card, #f8fafc)',
|
|
54
|
+
border: '1px solid var(--border, #e2e8f0)',
|
|
55
55
|
borderRadius: '0.5rem',
|
|
56
56
|
overflow: 'hidden',
|
|
57
57
|
}}
|
|
@@ -64,15 +64,15 @@ export function BibtexBlock({
|
|
|
64
64
|
justifyContent: 'space-between',
|
|
65
65
|
alignItems: 'center',
|
|
66
66
|
padding: '0.5rem 1rem',
|
|
67
|
-
backgroundColor: '#f1f5f9',
|
|
68
|
-
borderBottom: '1px solid #e2e8f0',
|
|
67
|
+
backgroundColor: 'var(--muted, #f1f5f9)',
|
|
68
|
+
borderBottom: '1px solid var(--border, #e2e8f0)',
|
|
69
69
|
}}
|
|
70
70
|
>
|
|
71
71
|
<span
|
|
72
72
|
style={{
|
|
73
73
|
fontSize: '0.75rem',
|
|
74
74
|
fontWeight: '600',
|
|
75
|
-
color: '#64748b',
|
|
75
|
+
color: 'var(--subtle, #64748b)',
|
|
76
76
|
textTransform: 'uppercase',
|
|
77
77
|
letterSpacing: '0.05em',
|
|
78
78
|
}}
|
|
@@ -90,8 +90,8 @@ export function BibtexBlock({
|
|
|
90
90
|
gap: '0.25rem',
|
|
91
91
|
padding: '0.25rem 0.5rem',
|
|
92
92
|
fontSize: '0.75rem',
|
|
93
|
-
color: copied ? '#059669' : '#64748b',
|
|
94
|
-
backgroundColor: copied ? '#ecfdf5' : 'transparent',
|
|
93
|
+
color: copied ? 'var(--success, #059669)' : 'var(--subtle, #64748b)',
|
|
94
|
+
backgroundColor: copied ? 'var(--success-subtle, #ecfdf5)' : 'transparent',
|
|
95
95
|
border: 'none',
|
|
96
96
|
borderRadius: '0.25rem',
|
|
97
97
|
cursor: 'pointer',
|
|
@@ -145,7 +145,7 @@ export function BibtexBlock({
|
|
|
145
145
|
lineHeight: '1.6',
|
|
146
146
|
fontFamily:
|
|
147
147
|
'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace',
|
|
148
|
-
color: '#334155',
|
|
148
|
+
color: 'var(--body, #334155)',
|
|
149
149
|
overflowX: 'auto',
|
|
150
150
|
whiteSpace: 'pre-wrap',
|
|
151
151
|
wordBreak: 'break-word',
|
|
@@ -18,6 +18,8 @@ import { exportBibtex } from '../bibliography/parsers/index.js'
|
|
|
18
18
|
* @param {Object} props.publication - Publication data (Scholar or CSL-JSON)
|
|
19
19
|
* @param {Array<string>} [props.styles] - Style names to show (defaults to all + bibtex)
|
|
20
20
|
* @param {string} [props.label='Cite'] - Button label
|
|
21
|
+
* @param {string} [props.copiedLabel] - What a style's entry says once its citation is copied.
|
|
22
|
+
* Without one it says ✓ and the style's name, so the button brings no words of its own there.
|
|
21
23
|
* @param {string} [props.className] - Additional CSS classes
|
|
22
24
|
*
|
|
23
25
|
* @example
|
|
@@ -27,6 +29,7 @@ export function CiteButton({
|
|
|
27
29
|
publication,
|
|
28
30
|
styles,
|
|
29
31
|
label = 'Cite',
|
|
32
|
+
copiedLabel,
|
|
30
33
|
className,
|
|
31
34
|
...props
|
|
32
35
|
}) {
|
|
@@ -177,8 +180,8 @@ export function CiteButton({
|
|
|
177
180
|
padding: '0.375rem 0.625rem',
|
|
178
181
|
fontSize: '0.8125rem',
|
|
179
182
|
textAlign: 'left',
|
|
180
|
-
color: copied === style ? '#059669' : 'var(--body, #374151)',
|
|
181
|
-
backgroundColor: copied === style ? '#ecfdf5' : 'transparent',
|
|
183
|
+
color: copied === style ? 'var(--success, #059669)' : 'var(--body, #374151)',
|
|
184
|
+
backgroundColor: copied === style ? 'var(--success-subtle, #ecfdf5)' : 'transparent',
|
|
182
185
|
border: 'none',
|
|
183
186
|
borderRadius: '0.25rem',
|
|
184
187
|
cursor: 'pointer',
|
|
@@ -195,7 +198,7 @@ export function CiteButton({
|
|
|
195
198
|
}}
|
|
196
199
|
>
|
|
197
200
|
{copied === style
|
|
198
|
-
?
|
|
201
|
+
? copiedLabel || `✓ ${styleLabels[style] || style.toUpperCase()}`
|
|
199
202
|
: styleLabels[style] || style.toUpperCase()}
|
|
200
203
|
</button>
|
|
201
204
|
))}
|