astro-pure 1.3.2 → 1.3.4

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.
@@ -1,148 +0,0 @@
1
- ---
2
- import config from 'virtual:config'
3
-
4
- import '@waline/client/style'
5
-
6
- import { cn } from '../../utils'
7
-
8
- const { class: className } = Astro.props
9
- ---
10
-
11
- {
12
- config.integ.waline.enable && (
13
- <comment-component>
14
- <div id='waline' class={cn('not-prose', className)}>
15
- Comment seems to stuck. Try to refresh?✨
16
- </div>
17
- </comment-component>
18
- )
19
- }
20
-
21
- <script>
22
- import { init as walineInit } from '@waline/client'
23
- import type { WalineEmojiPresets } from '@waline/client'
24
- import config from 'virtual:config'
25
-
26
- const walineConfig = config.integ.waline
27
-
28
- class Comment extends HTMLElement {
29
- constructor() {
30
- super()
31
- }
32
-
33
- connectedCallback() {
34
- // Prevent Vue log errors
35
- ;(globalThis as unknown as { __VUE_OPTIONS_API__: boolean }).__VUE_OPTIONS_API__ = true
36
- ;(globalThis as unknown as { __VUE_PROD_DEVTOOLS__: boolean }).__VUE_PROD_DEVTOOLS__ = false
37
- ;(
38
- globalThis as unknown as { __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: boolean }
39
- ).__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ = false
40
-
41
- const emoji = walineConfig.emoji?.map(
42
- (preset) => `${config.npmCDN}/@waline/emojis@1.2.0/${preset}` as WalineEmojiPresets
43
- )
44
-
45
- walineInit({
46
- el: '#waline',
47
- serverURL: walineConfig.server || '',
48
- emoji,
49
- reaction: ['/icons/heart-item.svg'],
50
- ...walineConfig.additionalConfigs
51
- })
52
- }
53
- }
54
-
55
- if (walineConfig.enable) customElements.define('comment-component', Comment)
56
- </script>
57
-
58
- <style>
59
- /* Basic theme */
60
- #waline {
61
- /* Font size */
62
- --waline-font-size: 16px;
63
- /* Basic color */
64
- --waline-white: hsl(var(--background) / var(--un-bg-opacity, 1));
65
- --waline-light-grey: #999;
66
- --waline-dark-grey: #666;
67
- /* Theme color */
68
- --waline-theme-color: hsl(var(--foreground) / var(--un-text-opacity, 1));
69
- --waline-active-color: hsl(var(--primary) / var(--un-text-opacity, 1));
70
- /* Layout */
71
- --waline-color: hsl(var(--muted-foreground) / var(--un-text-opacity, 1));
72
- --waline-bg-color: hsl(var(--muted) / var(--un-bg-opacity, 1));
73
- --waline-bg-color-light: hsl(var(--input) / var(--un-text-opacity, 1));
74
- --waline-bg-color-hover: #f0f0f0;
75
- --waline-border-color: hsl(var(--border) / var(--un-border-opacity, 1));
76
- --waline-disable-bg-color: #f8f8f8;
77
- --waline-disable-color: #bbb;
78
- --waline-code-bg-color: #282c34;
79
- /* Special */
80
- --waline-bq-color: #f0f0f0;
81
- /* Avatar */
82
- --waline-avatar-size: 3.25rem;
83
- --waline-m-avatar-size: calc(var(--waline-avatar-size) * 9 / 13);
84
- /* Badge */
85
- --waline-badge-color: hsl(var(--border) / var(--un-border-opacity, 1));
86
- --waline-badge-font-size: 0.775em;
87
- /* Info */
88
- --waline-info-bg-color: var(--waline-bg-color-light);
89
- --waline-info-color: var(--waline-color);
90
- --waline-info-font-size: 0.625em;
91
- /* Render selection */
92
- --waline-border: 1px solid var(--waline-border-color);
93
- --waline-avatar-radius: 50%;
94
- --waline-box-shadow: none;
95
- }
96
-
97
- /* Reaction buttons */
98
- #waline :global(.wl-reaction-title, .wl-reaction-text) {
99
- display: none;
100
- }
101
- #waline :global(.wl-reaction) {
102
- overflow: visible;
103
- margin-bottom: 0.5em;
104
- }
105
- #waline :global(.wl-reaction-img) {
106
- width: auto;
107
- display: flex;
108
- height: 35px;
109
- align-items: center;
110
- column-gap: 0.4rem;
111
- }
112
- #waline :global(.wl-reaction-votes) {
113
- position: inherit;
114
- top: inherit;
115
- min-width: inherit;
116
- inset-inline-end: inherit;
117
- display: flex;
118
- font-weight: normal;
119
- border: none;
120
- background: none;
121
- color: inherit;
122
- padding: 0.2rem 0.4rem;
123
- border-radius: 6px;
124
- }
125
- #waline :global(.wl-reaction-loading) {
126
- position: inherit;
127
- top: inherit;
128
- min-width: inherit;
129
- }
130
- #waline :global(.wl-reaction-item.active .wl-reaction-votes) {
131
- background: var(--waline-theme-color);
132
- color: var(--waline-bg-color);
133
- }
134
-
135
- #waline :global(.wl-reaction-votes:after) {
136
- margin-left: 0.25em;
137
- content: 'Like(s)';
138
- display: inline-block;
139
- clear: both;
140
- border: 0;
141
- }
142
- #waline :global(.wl-reaction img) {
143
- filter: invert(25%);
144
- }
145
- :global(.dark) #waline :global(.wl-reaction img) {
146
- filter: invert(75%);
147
- }
148
- </style>
@@ -1,18 +0,0 @@
1
- ---
2
- import { cn } from '../../utils'
3
-
4
- const { class: className, hideComment, ...props } = Astro.props
5
-
6
- const path = Astro.url.pathname
7
- ---
8
-
9
- <div class={cn('text-base text-sm text-muted-foreground', className)} {...props}>
10
- <span class='waline-pageview-count' data-path={path}></span> views
11
- {
12
- !hideComment && (
13
- <a href='#waline'>
14
- | <span class='waline-comment-count' data-path={path} /> comments
15
- </a>
16
- )
17
- }
18
- </div>