astro-pure 1.2.9 → 1.3.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/components/advanced/QRCode.astro +2 -2
- package/components/basic/Footer.astro +1 -2
- package/components/basic/Header.astro +7 -7
- package/components/pages/TOC.astro +1 -1
- package/components/pages/TOCHeading.astro +2 -2
- package/components/user/Collapse.astro +3 -3
- package/package.json +1 -1
- package/types/integrations-config.ts +5 -1
- package/types/theme-config.ts +2 -0
|
@@ -10,12 +10,12 @@ const { content, class: className, ...props } = Astro.props
|
|
|
10
10
|
<script is:inline define:vars={{ content }}>
|
|
11
11
|
const renderContent = content ?? window.location.href
|
|
12
12
|
// Load qrcode
|
|
13
|
-
function
|
|
13
|
+
function loadQRcode(qrcodeContainer) {
|
|
14
14
|
if (!qrcodeContainer) throw new Error('qrcode container not found')
|
|
15
15
|
if (qrcodeContainer.innerHTML !== '') return
|
|
16
16
|
new QRCode(qrcodeContainer, renderContent)
|
|
17
17
|
}
|
|
18
18
|
const qrcodeContainer = document.getElementById('qrcode-container')
|
|
19
19
|
if (!qrcodeContainer) throw new Error('qrcode container not found')
|
|
20
|
-
|
|
20
|
+
loadQRcode(qrcodeContainer)
|
|
21
21
|
</script>
|
|
@@ -3,7 +3,6 @@ import config from 'virtual:config'
|
|
|
3
3
|
|
|
4
4
|
import { Icon } from '../user'
|
|
5
5
|
|
|
6
|
-
const year = new Date().getFullYear()
|
|
7
6
|
const footerConf = config.footer
|
|
8
7
|
let social = footerConf.social || {}
|
|
9
8
|
|
|
@@ -39,7 +38,7 @@ const footerLink1 = footerConf.links?.filter(({ pos }) => pos === 1) || []
|
|
|
39
38
|
}
|
|
40
39
|
{/* Position 2 */}
|
|
41
40
|
<div>
|
|
42
|
-
|
|
41
|
+
{config.footer.year}
|
|
43
42
|
{config.author}
|
|
44
43
|
{
|
|
45
44
|
footerConf.links && footerConf.links.length > 0 && (
|
|
@@ -5,7 +5,7 @@ import { Icon } from '../user'
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<header-component
|
|
8
|
-
class='group sticky top-4 z-30 mb-12 flex items-center justify-between rounded-xl border border-transparent max-sm:py-1 sm:rounded-2xl'
|
|
8
|
+
class='group sticky top-4 z-30 md:z-50 mb-12 flex items-center justify-between rounded-xl border border-transparent max-sm:py-1 sm:rounded-2xl'
|
|
9
9
|
>
|
|
10
10
|
<a
|
|
11
11
|
class='z-30 text-xl font-semibold group-[.not-top]:ms-2 sm:group-[.not-top]:ms-3'
|
|
@@ -17,7 +17,7 @@ import { Icon } from '../user'
|
|
|
17
17
|
<div class='flex items-center gap-x-2'>
|
|
18
18
|
{/* Menu links */}
|
|
19
19
|
<div
|
|
20
|
-
id='
|
|
20
|
+
id='headerExpandContent'
|
|
21
21
|
class='end-0 start-0 top-12 grid border border-transparent group-[.not-top]:rounded-xl group-[.expanded]:opacity-100 dark:group-[.expanded.not-top]:bg-muted max-sm:absolute max-sm:opacity-0 max-sm:group-[.not-top]:border-border max-sm:group-[.expanded.not-top]:bg-background max-sm:group-[.not-top]:px-4 max-sm:group-[.not-top]:py-2 sm:grid-rows-1'
|
|
22
22
|
>
|
|
23
23
|
<div class='flex flex-col items-center justify-center overflow-hidden sm:flex-row'>
|
|
@@ -148,7 +148,7 @@ import { Icon } from '../user'
|
|
|
148
148
|
|
|
149
149
|
/* header menu */
|
|
150
150
|
@media (max-width: 640px) {
|
|
151
|
-
#
|
|
151
|
+
#headerExpandContent {
|
|
152
152
|
grid-template-rows: 0fr;
|
|
153
153
|
transition:
|
|
154
154
|
opacity 0.3s,
|
|
@@ -156,10 +156,10 @@ import { Icon } from '../user'
|
|
|
156
156
|
border-color 0.15s,
|
|
157
157
|
grid-template-rows 0.3s;
|
|
158
158
|
}
|
|
159
|
-
.expanded #
|
|
159
|
+
.expanded #headerExpandContent {
|
|
160
160
|
grid-template-rows: 1fr;
|
|
161
161
|
}
|
|
162
|
-
.expanded.not-top #
|
|
162
|
+
.expanded.not-top #headerExpandContent {
|
|
163
163
|
box-shadow:
|
|
164
164
|
rgb(255, 255, 255) 0px 0px 0px 0px,
|
|
165
165
|
rgba(24, 24, 27, 0.08) 0px 0px 0px 1px,
|
|
@@ -168,7 +168,7 @@ import { Icon } from '../user'
|
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
/* header component after */
|
|
171
|
-
header-component #
|
|
171
|
+
header-component #headerExpandContent::after {
|
|
172
172
|
box-sizing: content-box;
|
|
173
173
|
content: '';
|
|
174
174
|
position: absolute;
|
|
@@ -181,7 +181,7 @@ import { Icon } from '../user'
|
|
|
181
181
|
opacity: 0;
|
|
182
182
|
border-bottom: 1px solid transparent;
|
|
183
183
|
}
|
|
184
|
-
header-component:not(.not-top) #
|
|
184
|
+
header-component:not(.not-top) #headerExpandContent::after {
|
|
185
185
|
visibility: visible;
|
|
186
186
|
bottom: -1rem;
|
|
187
187
|
opacity: 1;
|
|
@@ -90,7 +90,7 @@ const toc = generateToc(headings)
|
|
|
90
90
|
(i == this.tocLinks.length - 1 ||
|
|
91
91
|
!this.headingProgress[this.tocLinks[i + 1]?.slug].inView)
|
|
92
92
|
)
|
|
93
|
-
bar.classList.toggle('
|
|
93
|
+
bar.classList.toggle('is-read', !inView && progress == 1)
|
|
94
94
|
bar.classList.toggle('highlight-bg', inView)
|
|
95
95
|
bar.style.setProperty('height', `${progress * 90}%`)
|
|
96
96
|
}
|
|
@@ -16,12 +16,12 @@ const text = rawText.endsWith('#') ? rawText.slice(0, -1) : rawText
|
|
|
16
16
|
<li>
|
|
17
17
|
<div class='relative'>
|
|
18
18
|
<span
|
|
19
|
-
class='absolute top-[5%] w-[2px] rounded transition-colors duration-300 [&.highlight-bg]:bg-primary [&.
|
|
19
|
+
class='absolute top-[5%] w-[2px] rounded transition-colors duration-300 [&.highlight-bg]:bg-primary [&.is-read]:bg-input'
|
|
20
20
|
></span>
|
|
21
21
|
<a
|
|
22
22
|
aria-label={`Scroll to section: ${text}`}
|
|
23
23
|
class={cn(
|
|
24
|
-
'toc-item line-clamp-2 px-3 py-1 ms-2 text-foreground/75 transition-all hover:text-foreground [&.highlight]:font-medium [&.highlight]:text-primary [&.
|
|
24
|
+
'toc-item line-clamp-2 px-3 py-1 ms-2 text-foreground/75 transition-all hover:text-foreground [&.highlight]:font-medium [&.highlight]:text-primary [&.is-read]:text-input [&.highlight-bg-translucent]:bg-muted',
|
|
25
25
|
depth > 2 && 'ps-7'
|
|
26
26
|
)}
|
|
27
27
|
href={`#${slug}`}>{text}</a
|
|
@@ -45,7 +45,7 @@ const { class: className, title, ...props } = Astro.props
|
|
|
45
45
|
</div>
|
|
46
46
|
</div>
|
|
47
47
|
<div
|
|
48
|
-
class='expand-
|
|
48
|
+
class='expand-content grid opacity-0 transition-all duration-300 ease-in-out group-[.expanded]/expand:mb-3 group-[.expanded]/expand:opacity-100 sm:group-[.expanded]/expand:mb-4'
|
|
49
49
|
>
|
|
50
50
|
<div class='overflow-hidden'>
|
|
51
51
|
<slot />
|
|
@@ -72,10 +72,10 @@ const { class: className, title, ...props } = Astro.props
|
|
|
72
72
|
</script>
|
|
73
73
|
|
|
74
74
|
<style>
|
|
75
|
-
.expand-
|
|
75
|
+
.expand-content {
|
|
76
76
|
grid-template-rows: 0fr;
|
|
77
77
|
}
|
|
78
|
-
.expanded .expand-
|
|
78
|
+
.expanded .expand-content {
|
|
79
79
|
grid-template-rows: 1fr;
|
|
80
80
|
}
|
|
81
81
|
</style>
|
package/package.json
CHANGED
|
@@ -29,7 +29,11 @@ export const IntegrationConfigSchema = () =>
|
|
|
29
29
|
/** The class to apply to the typography. */
|
|
30
30
|
class: z
|
|
31
31
|
.string()
|
|
32
|
-
.default('prose prose-pure dark:prose-invert dark:prose-pure prose-headings:font-medium')
|
|
32
|
+
.default('prose prose-pure dark:prose-invert dark:prose-pure prose-headings:font-medium'),
|
|
33
|
+
/** The style of blockquote font, normal or italic. */
|
|
34
|
+
blockquoteStyle: z.enum(['normal', 'italic']).default('italic'),
|
|
35
|
+
/** The style of inline code block, code or modern. */
|
|
36
|
+
inlineCodeBlockStyle: z.enum(['code', 'modern']).default('modern')
|
|
33
37
|
}),
|
|
34
38
|
|
|
35
39
|
/** A lightbox library that can add zoom effect */
|
package/types/theme-config.ts
CHANGED
|
@@ -119,6 +119,8 @@ export const ThemeConfigSchema = () =>
|
|
|
119
119
|
|
|
120
120
|
/** Configure the footer of your site. */
|
|
121
121
|
footer: z.object({
|
|
122
|
+
/** The footer content for your site. */
|
|
123
|
+
year: z.string().describe('The footer content for your site.'),
|
|
122
124
|
/** The footer links for your site. */
|
|
123
125
|
links: z
|
|
124
126
|
.array(
|