@ansidev-oss/vitepress-theme-ansidev 1.0.12 → 1.1.0

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.
Files changed (40) hide show
  1. package/dist/client/Donation-BBPb8v5p.js +66 -0
  2. package/dist/client/GoogleAnalytics-34XEM7eO.js +25 -0
  3. package/dist/client/Sharing-CpagX9oy.js +185 -0
  4. package/dist/client/Swetrix-k7SUudua.js +624 -0
  5. package/dist/client/components/PostDate.test.d.ts +1 -0
  6. package/dist/client/composables/index.d.ts +1 -0
  7. package/dist/client/composables/lang.d.ts +27 -0
  8. package/dist/client/composables/lang.test.d.ts +1 -0
  9. package/dist/client/index.js +3769 -9
  10. package/dist/client/medium-zoom-DPl0T7qn.js +266 -0
  11. package/dist/client/record-Cgv_fXDH.js +2739 -0
  12. package/dist/client/styles.css +2 -1
  13. package/dist/node/composables.d.mts +7 -17
  14. package/dist/node/composables.mjs +7 -15
  15. package/dist/node/config.d.mts +2 -17
  16. package/dist/node/config.mjs +9 -6
  17. package/package.json +14 -6
  18. package/src/client/components/PostDate.test.ts +73 -0
  19. package/src/client/components/PostDate.vue +18 -8
  20. package/src/client/components/PostItem.vue +1 -1
  21. package/src/client/composables/index.ts +1 -0
  22. package/src/client/composables/lang.test.ts +52 -0
  23. package/src/client/composables/lang.ts +58 -0
  24. package/src/client/index.ts +5 -0
  25. package/src/client/plugins/sharing/index.ts +3 -1
  26. package/src/client/styles/base.css +30 -0
  27. package/src/client/styles/blog.css +352 -0
  28. package/src/client/styles/index.css +3 -30
  29. package/src/vite-env.d.ts +1 -0
  30. package/dist/client/Donation-D9Xn0MPt.js +0 -76
  31. package/dist/client/GoogleAnalytics-Dp3EGn1x.js +0 -29
  32. package/dist/client/Sharing-ZrU7YF-x.js +0 -190
  33. package/dist/client/Swetrix-CM1mbD6X.js +0 -450
  34. package/dist/client/VPAlgoliaSearchBox-C18GEhLm.js +0 -126
  35. package/dist/client/VPCarbonAds-DwoamMao.js +0 -31
  36. package/dist/client/VPLocalSearchBox-DyteUinQ.js +0 -4086
  37. package/dist/client/index-BtT3qA6T.js +0 -12663
  38. package/dist/client/index-CCR5sUM8.js +0 -10688
  39. package/dist/client/index-CkmxezC0.js +0 -7616
  40. package/dist/client/index-DuYWs0vj.js +0 -265
@@ -0,0 +1,352 @@
1
+ :root {
2
+ --vp-font-family-base: 'Inter', ui-sans-serif, system-ui, sans-serif;
3
+ --vp-font-family-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
4
+ /* Light palette, based on Dracula's Alucard variant */
5
+ --accent: #644ac9;
6
+ --accent-soft: #8668e0;
7
+ --green: #14710a;
8
+ --vp-c-bg: #fffbeb;
9
+ --vp-c-bg-alt: #f5f1df;
10
+ --vp-c-bg-elv: #ece8d3;
11
+ --vp-c-bg-soft: #f7f3e1;
12
+ --vp-c-divider: #d9d4bb;
13
+ --vp-c-gutter: #f5f1df;
14
+ --vp-c-text-1: #1f1f1f;
15
+ --vp-c-text-2: #4b4b52;
16
+ --vp-c-text-3: #6c664b;
17
+ --vp-c-brand-1: #644ac9;
18
+ --vp-c-brand-2: #7459d8;
19
+ --vp-c-brand-3: #644ac9;
20
+ --vp-c-brand-soft: rgba(100, 74, 201, 0.12);
21
+ /* theme utilities (link-alt, link) read these Tailwind variables with !important */
22
+ --color-primary: #644ac9;
23
+ --color-primary-alt: #4f39a8;
24
+ --color-primary-alt-dark: #8668e0;
25
+ --color-secondary: #3b2a8a;
26
+ --color-secondary-dark: #3b2a8a;
27
+ /* "Active" status badge: bg-green-100 / text-green-800 in light, swapped in dark */
28
+ --color-green-100: #d4f2cf;
29
+ --color-green-800: #14710a;
30
+ }
31
+
32
+ /* Dracula-inspired dark palette */
33
+ .dark {
34
+ --accent: #bd93f9;
35
+ --accent-soft: #d6bcfa;
36
+ --green: #50fa7b;
37
+ --color-primary: #9d6ff0;
38
+ --color-primary-alt: #8a5cd8;
39
+ --color-primary-alt-dark: #d6bcfa;
40
+ --color-secondary: #f8f8f2;
41
+ --color-secondary-dark: #f8f8f2;
42
+ --color-green-100: #50fa7b;
43
+ --color-green-800: #1f4d33;
44
+ --vp-c-bg: #282a36;
45
+ --vp-c-bg-alt: #21222c;
46
+ --vp-c-bg-elv: #343746;
47
+ --vp-c-bg-soft: #2f3241;
48
+ --vp-c-divider: #44475a;
49
+ --vp-c-gutter: #21222c;
50
+ --vp-c-text-1: #f8f8f2;
51
+ --vp-c-text-2: #b6b8c9;
52
+ --vp-c-text-3: #8e94b3;
53
+ --vp-c-brand-1: var(--accent);
54
+ --vp-c-brand-2: var(--accent);
55
+ --vp-c-brand-3: #9d6ff0;
56
+ --vp-c-brand-soft: rgba(189, 147, 249, 0.16);
57
+ }
58
+
59
+ body {
60
+ letter-spacing: -0.005em;
61
+ }
62
+
63
+ /* Nav */
64
+ .VPNav .VPNavBar,
65
+ .VPNavBar .content-body {
66
+ backdrop-filter: saturate(180%) blur(12px);
67
+ }
68
+ .VPNavBar:not(.has-sidebar):not(.home.top) {
69
+ background-color: rgba(255, 251, 235, 0.85);
70
+ }
71
+ .dark .VPNavBar:not(.has-sidebar):not(.home.top) {
72
+ background-color: rgba(40, 42, 54, 0.8);
73
+ }
74
+
75
+ /* Cards (post list, project cards, term chips) */
76
+ .component-border {
77
+ background: var(--vp-c-bg-soft);
78
+ border: 1px solid var(--vp-c-divider);
79
+ border-radius: 0;
80
+ transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
81
+ }
82
+ .component-border:hover,
83
+ .component-border:focus-within {
84
+ border-color: color-mix(in srgb, var(--accent) 55%, transparent);
85
+ background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, var(--vp-c-bg-soft)), var(--vp-c-bg-soft));
86
+ box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent), 0 8px 30px -12px color-mix(in srgb, var(--accent) 45%, transparent);
87
+ }
88
+
89
+ /* Titles inside cards: neutral text, accent on hover */
90
+ .component-border > .pl-8 a.text-2xl,
91
+ .component-border a.text-2xl {
92
+ color: var(--vp-c-text-1);
93
+ font-weight: 600;
94
+ letter-spacing: -0.02em;
95
+ }
96
+ /* Card hover only glows; the link itself gets its own hover/pressed feedback */
97
+ .component-border a.text-2xl {
98
+ transition: color 0.15s ease, text-shadow 0.15s ease;
99
+ }
100
+ .component-border a.text-2xl:hover {
101
+ color: var(--accent);
102
+ text-shadow: 0 0 18px color-mix(in srgb, var(--accent) 45%, transparent);
103
+ }
104
+ .component-border a.text-2xl:active {
105
+ color: var(--accent-soft);
106
+ text-shadow: none;
107
+ }
108
+
109
+ /* Date block: mono, muted */
110
+ .component-border .text-6xl {
111
+ font-family: var(--vp-font-family-mono);
112
+ font-weight: 500;
113
+ color: var(--vp-c-text-1);
114
+ font-size: 2.5rem;
115
+ line-height: 1;
116
+ }
117
+
118
+ /* Category / tech chips as pills */
119
+ a.link-alt.uppercase,
120
+ .component-border a.uppercase {
121
+ display: inline-block;
122
+ padding: 2px 10px;
123
+ margin-bottom: 4px;
124
+ border-radius: 0;
125
+ border: 1px solid var(--vp-c-divider);
126
+ background: var(--vp-c-bg-elv);
127
+ font-size: 0.7rem;
128
+ font-weight: 500;
129
+ letter-spacing: 0.04em;
130
+ transition: border-color 0.2s ease;
131
+ }
132
+ a.link-alt.uppercase:hover {
133
+ border-color: var(--accent);
134
+ background: color-mix(in srgb, var(--accent) 16%, var(--vp-c-bg-elv));
135
+ }
136
+ a.link-alt.uppercase:active {
137
+ background: color-mix(in srgb, var(--accent) 30%, var(--vp-c-bg-elv));
138
+ transform: translateY(1px);
139
+ }
140
+
141
+ /* Technology filter buttons on /projects */
142
+ a.component-border {
143
+ border-radius: 0;
144
+ }
145
+
146
+ /* Links in content */
147
+ .vp-doc a,
148
+ .vp-doc a:hover {
149
+ color: var(--vp-c-brand-1);
150
+ text-decoration: none;
151
+ font-weight: 500;
152
+ }
153
+ .vp-doc a:hover {
154
+ color: var(--vp-c-brand-2);
155
+ }
156
+
157
+ /* No underlines on any link (VitePress adds one to .vp-doc a via its own rules) */
158
+ a,
159
+ a:hover,
160
+ .vp-doc a,
161
+ .vp-doc a:hover,
162
+ .vp-doc .header-anchor {
163
+ text-decoration: none !important;
164
+ }
165
+
166
+ /* Post typography */
167
+ .vp-doc h1 {
168
+ letter-spacing: -0.03em;
169
+ font-weight: 700;
170
+ }
171
+ .vp-doc h2 {
172
+ letter-spacing: -0.02em;
173
+ border-top-color: var(--vp-c-divider);
174
+ }
175
+ .vp-doc p,
176
+ .vp-doc li {
177
+ line-height: 1.75;
178
+ }
179
+ .vp-doc :not(pre) > code {
180
+ color: var(--green);
181
+ font-family: var(--vp-font-family-mono);
182
+ font-size: 0.85em;
183
+ border: 1px solid var(--vp-c-divider);
184
+ border-radius: 0;
185
+ }
186
+ .vp-doc div[class*='language-'] {
187
+ border: 1px solid var(--vp-c-divider);
188
+ border-radius: 0;
189
+ }
190
+
191
+ /* Focus visibility */
192
+ a:focus-visible,
193
+ button:focus-visible {
194
+ outline: 2px solid var(--accent);
195
+ outline-offset: 2px;
196
+ border-radius: 0;
197
+ }
198
+
199
+ /* Home hero */
200
+ .home-hero {
201
+ padding: 56px 0 8px;
202
+ }
203
+ .home-hero h1 {
204
+ margin: 0;
205
+ font-size: clamp(2rem, 5vw, 3.25rem);
206
+ line-height: 1.1;
207
+ font-weight: 700;
208
+ letter-spacing: -0.04em;
209
+ }
210
+ .home-hero h1 span {
211
+ background: linear-gradient(90deg, var(--vp-c-text-1), var(--accent-soft) 70%, var(--accent));
212
+ -webkit-background-clip: text;
213
+ background-clip: text;
214
+ color: transparent;
215
+ }
216
+ .home-hero p {
217
+ margin: 16px 0 0;
218
+ max-width: 36rem;
219
+ color: var(--vp-c-text-2);
220
+ font-size: 1.1rem;
221
+ line-height: 1.6;
222
+ }
223
+
224
+ @media (prefers-reduced-motion: reduce) {
225
+ .component-border,
226
+ a.link-alt.uppercase {
227
+ transition: none;
228
+ }
229
+ }
230
+
231
+ /* Square corners everywhere (theme uses Tailwind rounded-* utilities) */
232
+ [class*='rounded'],
233
+ .VPNavBarSearchButton,
234
+ .vp-doc [class*='language-'],
235
+ .vp-doc :not(pre) > code,
236
+ .vp-doc img,
237
+ .vp-doc table,
238
+ .custom-block,
239
+ .VPLocalSearchBox .results .result,
240
+ .VPSkipLink,
241
+ .keys,
242
+ button.copy,
243
+ .VPSwitch,
244
+ .VPSwitch .check {
245
+ border-radius: 0 !important;
246
+ }
247
+
248
+ /* Technology filter buttons on /projects: roomier horizontal padding */
249
+ p.flex.flex-wrap > a.border.m-1 {
250
+ padding: 0.25rem 0.875rem;
251
+ margin: 0.25rem;
252
+ transition: border-color 0.15s ease, background-color 0.15s ease;
253
+ }
254
+ p.flex.flex-wrap > a.border.m-1:hover {
255
+ border-color: var(--accent);
256
+ background-color: color-mix(in srgb, var(--accent) 14%, transparent);
257
+ }
258
+
259
+ /* Mobile */
260
+ @media (max-width: 639px) {
261
+ /* Post cards: stack the date above the title instead of a fixed 80px side column */
262
+ .component-border.flex:has(> .text-center) {
263
+ flex-direction: column;
264
+ }
265
+ .component-border > .text-center {
266
+ min-width: 0 !important;
267
+ display: flex;
268
+ align-items: baseline;
269
+ gap: 0.5rem;
270
+ text-align: left;
271
+ margin-bottom: 0.5rem;
272
+ }
273
+ .component-border > .text-center .text-6xl {
274
+ font-size: 1.75rem;
275
+ }
276
+ .component-border > .pl-8 {
277
+ padding-left: 0;
278
+ }
279
+
280
+ /* Technology filter: one horizontally scrollable row instead of 40 wrapped buttons */
281
+ p.flex.flex-wrap:has(> a.border.m-1) {
282
+ flex-wrap: nowrap;
283
+ overflow-x: auto;
284
+ -webkit-overflow-scrolling: touch;
285
+ scrollbar-width: none;
286
+ margin-inline: -0.25rem;
287
+ padding-bottom: 0.25rem;
288
+ }
289
+ p.flex.flex-wrap:has(> a.border.m-1)::-webkit-scrollbar {
290
+ display: none;
291
+ }
292
+ p.flex.flex-wrap > a.border.m-1 {
293
+ flex: 0 0 auto;
294
+ white-space: nowrap;
295
+ min-height: 2.25rem;
296
+ display: inline-flex;
297
+ align-items: center;
298
+ }
299
+
300
+ /* Tighter gap under page headings (theme adds pt-6 pb-8 + mb-6) */
301
+ div.pt-6.pb-8 {
302
+ padding-top: 0.75rem;
303
+ padding-bottom: 0.5rem;
304
+ }
305
+ div.pt-6.pb-8 > h1.mb-6 {
306
+ margin-bottom: 0.75rem;
307
+ }
308
+
309
+ /* Larger tap targets for category / tech chips */
310
+ a.link-alt.uppercase,
311
+ .component-border a.uppercase {
312
+ padding: 6px 12px;
313
+ margin-bottom: 6px;
314
+ }
315
+ }
316
+
317
+ /* Donation buttons: equal-size slots, even spacing. The theme sets img width/height
318
+ inline with !important and uses space-y-4 (sidebar) or space-x-4 (home page, wraps
319
+ unevenly), so reset its margins and size the link box instead. */
320
+ div.flex.flex-wrap.py-4.items-center.justify-center:has(> a[href*='ko-fi.com']) {
321
+ gap: 12px;
322
+ }
323
+ div.flex.flex-wrap.py-4.items-center.justify-center:has(> a[href*='ko-fi.com']) > a {
324
+ margin: 0 !important;
325
+ width: 200px;
326
+ height: 56px;
327
+ display: flex;
328
+ align-items: center;
329
+ justify-content: center;
330
+ }
331
+ div.flex.flex-wrap.py-4.items-center.justify-center:has(> a[href*='ko-fi.com']) > a img {
332
+ max-width: 100%;
333
+ max-height: 100%;
334
+ object-fit: contain;
335
+ }
336
+ /* Sidebar variant: single column */
337
+ div.flex.flex-wrap.py-4.items-center.justify-center.space-y-4:has(> a[href*='ko-fi.com']) {
338
+ flex-direction: column;
339
+ flex-wrap: nowrap;
340
+ }
341
+
342
+ /* Footer variant (home page): 2x2 grid of equal slots */
343
+ div.flex.flex-wrap.py-4.items-center.justify-center.space-x-4:has(> a[href*='ko-fi.com']) {
344
+ display: grid;
345
+ grid-template-columns: repeat(2, 168px);
346
+ justify-content: center;
347
+ gap: 12px;
348
+ }
349
+ div.flex.flex-wrap.py-4.items-center.justify-center.space-x-4:has(> a[href*='ko-fi.com']) > a {
350
+ width: 168px;
351
+ height: 52px;
352
+ }
@@ -1,30 +1,3 @@
1
- @import "tailwindcss";
2
- @variant dark (&:where(.dark, .dark *));
3
-
4
- @theme {
5
- --color-primary: rgb(59, 130, 246);
6
- --color-primary-alt: rgb(29, 78, 216);
7
- --color-primary-alt-dark: rgb(147, 197, 253);
8
- --color-secondary: rgb(239, 68, 68);
9
- --color-secondary-dark: rgb(234, 179, 8);
10
- }
11
-
12
- @utility component-border {
13
- @apply border rounded-md border-gray-500 hover:border-secondary dark:hover:border-secondary-dark;
14
- }
15
-
16
- @utility link {
17
- @apply no-underline hover:text-secondary dark:hover:text-secondary-dark;
18
- }
19
-
20
- @utility link-alt {
21
- @apply text-primary-alt! dark:text-primary-alt-dark! link!;
22
- }
23
-
24
- :root {
25
- --vp-c-brand-1: var(--color-primary);
26
- }
27
-
28
- .vp-doc a {
29
- @apply link;
30
- }
1
+ @import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap");
2
+ @import "./base.css";
3
+ @import "./blog.css";
package/src/vite-env.d.ts CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  declare module '*.vue' {
4
4
  import type { Component } from 'vue'
5
+
5
6
  const component: Component
6
7
  export default component
7
8
  }
@@ -1,76 +0,0 @@
1
- import { defineComponent as c, computed as d, openBlock as r, createElementBlock as l, createElementVNode as p, normalizeStyle as u, Fragment as f, renderList as g, createBlock as h, mergeProps as B } from "vue";
2
- const _ = {
3
- buymeacoffee: {
4
- donationBaseUrl: "https://buymeacoffee.com",
5
- donationButtonImage: "https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png",
6
- donationButtonStyle: {
7
- height: "60px !important",
8
- width: "217px !important"
9
- }
10
- },
11
- kofi: {
12
- donationBaseUrl: "https://ko-fi.com",
13
- donationButtonImage: "https://storage.ko-fi.com/cdn/brandasset/kofi_bg_tag_white.png",
14
- donationButtonStyle: {
15
- height: "60px !important"
16
- }
17
- },
18
- paypal: {
19
- donationBaseUrl: "https://paypal.me",
20
- donationButtonImage: "https://paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif"
21
- }
22
- }, y = ["href"], b = ["src", "alt"], k = /* @__PURE__ */ c({
23
- __name: "DonationButton",
24
- props: {
25
- donationPlatform: {},
26
- donationId: {},
27
- donationBaseUrl: {},
28
- donationButtonImage: {},
29
- donationButtonStyle: {}
30
- },
31
- setup(t) {
32
- const i = t, o = d(() => new URL(i.donationId, i.donationBaseUrl).toString());
33
- return (s, e) => (r(), l("a", {
34
- href: o.value,
35
- target: "_blank"
36
- }, [
37
- p("img", {
38
- src: t.donationButtonImage,
39
- alt: t.donationPlatform,
40
- style: u(t.donationButtonStyle)
41
- }, null, 12, b)
42
- ], 8, y));
43
- }
44
- }), U = /* @__PURE__ */ c({
45
- __name: "Donation",
46
- props: {
47
- donation: {}
48
- },
49
- setup(t) {
50
- const o = t.donation, s = d(() => {
51
- const e = {};
52
- for (const n in o) {
53
- if (n === "custom")
54
- continue;
55
- const a = o[n];
56
- e[n] = {
57
- ..._[n],
58
- donationId: a
59
- };
60
- }
61
- return {
62
- ...e,
63
- ...o.custom
64
- };
65
- });
66
- return (e, n) => (r(!0), l(f, null, g(s.value, (a, m) => (r(), h(k, B({
67
- key: a?.name,
68
- ref_for: !0
69
- }, a, {
70
- "donation-platform": m
71
- }), null, 16, ["donation-platform"]))), 128));
72
- }
73
- });
74
- export {
75
- U as default
76
- };
@@ -1,29 +0,0 @@
1
- import { defineComponent as c, onMounted as r } from "vue";
2
- const g = /* @__PURE__ */ c({
3
- __name: "GoogleAnalytics",
4
- props: {
5
- googleAnalytics: {}
6
- },
7
- setup(o) {
8
- const e = o.googleAnalytics;
9
- let a = !1;
10
- function i() {
11
- if (!(window.dataLayer && window.gtag) && !a) {
12
- a = !0;
13
- const t = document.createElement("script");
14
- t.src = `https://www.googletagmanager.com/gtag/js?id=${e.id}`, t.async = !0, document.head.appendChild(t);
15
- const n = document.createElement("script");
16
- n.textContent = `
17
- window.dataLayer = window.dataLayer || [];
18
- function gtag(){dataLayer.push(arguments);}
19
- gtag('js', new Date());
20
- gtag('config', '${e.id}');
21
- `, document.head.appendChild(n);
22
- }
23
- }
24
- return e && r(i), (t, n) => null;
25
- }
26
- });
27
- export {
28
- g as default
29
- };
@@ -1,190 +0,0 @@
1
- import { defineComponent as h, computed as a, openBlock as l, createElementBlock as u, createBlock as b, unref as z, createCommentVNode as m, Fragment as w, createTextVNode as B, toDisplayString as y, normalizeClass as p, createElementVNode as v, renderList as U } from "vue";
2
- import { useData as L } from "vitepress";
3
- import { Icon as R } from "@iconify/vue";
4
- const _ = (s) => {
5
- if (!s)
6
- return "";
7
- const t = encodeURIComponent, r = Object.keys(s);
8
- return r.length < 1 ? "" : `?${r.filter((e) => s[e] !== void 0).map((e) => `${t(e)}=${t(s[e])}`).join("&")}`;
9
- }, P = ["href", "aria-label"], M = /* @__PURE__ */ h({
10
- __name: "SharingButton",
11
- props: {
12
- url: {},
13
- text: {},
14
- network: {},
15
- buttonSize: {},
16
- iconStyle: {},
17
- iconSize: { default: 32 },
18
- displayMode: { default: "icon" }
19
- },
20
- setup(s) {
21
- const t = s, r = a(() => {
22
- switch (t.network) {
23
- case "email":
24
- return {
25
- name: "E-mail",
26
- shareBaseURL: "mailto:",
27
- icon: "bi:envelope-fill",
28
- params: { subject: t.text, body: t.url },
29
- allowedParams: ["subject", "body"]
30
- };
31
- case "facebook":
32
- return {
33
- name: "Facebook",
34
- shareBaseURL: "https://facebook.com/sharer/sharer.php",
35
- icon: "bi:facebook",
36
- params: { u: t.url },
37
- allowedParams: ["u", "display", "redirect_uri"]
38
- };
39
- case "linkedin":
40
- return {
41
- name: "LinkedIn",
42
- shareBaseURL: "https://www.linkedin.com/sharing/share-offsite",
43
- icon: "bi:linkedin",
44
- params: { url: t.url },
45
- allowedParams: ["url"]
46
- };
47
- case "pinterest":
48
- return {
49
- name: "Pinterest",
50
- shareBaseURL: "https://pinterest.com/pin/create/button",
51
- icon: "bi:pinterest",
52
- params: { posttype: "link", title: t.text, url: t.url },
53
- allowedParams: ["posttype", "tags", "title", "content", "caption", "show-via", "canonicalUrl"]
54
- };
55
- case "reddit":
56
- return {
57
- name: "Reddit",
58
- shareBaseURL: "https://www.reddit.com/submit",
59
- icon: "bi:reddit",
60
- params: { title: t.text, url: t.url },
61
- allowedParams: ["title", "url"]
62
- };
63
- case "telegram":
64
- return {
65
- name: "Telegram",
66
- shareBaseURL: "https://telegram.me/share/url",
67
- icon: "bi:telegram",
68
- params: { text: t.text, url: t.url },
69
- allowedParams: ["text", "url"]
70
- };
71
- // case 'tumblr':
72
- // return {
73
- // name: 'Tumblr',
74
- // shareBaseURL: 'https://www.tumblr.com/widgets/share/tool',
75
- // icon: 'bi:tumblr',
76
- // params: { posttype: 'link', title: props.text, url: props.url },
77
- // allowedParams: ['posttype', 'tags', 'title', 'content', 'caption', 'show-via', 'canonicalUrl'],
78
- // }
79
- case "twitter":
80
- return {
81
- name: "Twitter",
82
- shareBaseURL: "https://twitter.com/intent/tweet",
83
- icon: "bi:twitter",
84
- params: { text: t.text, url: t.url },
85
- allowedParams: ["text", "url", "hashtag", "via"]
86
- };
87
- // case 'vk':
88
- // return {
89
- // name: 'VK',
90
- // shareBaseURL: 'https://vk.com/share.php',
91
- // icon: 'vk-icon',
92
- // params: { title: props.text, url: props.url },
93
- // allowedParams: ['title', 'url'],
94
- // }
95
- case "whatsapp":
96
- return {
97
- name: "WhatsApp",
98
- shareBaseURL: "whatsapp://send",
99
- icon: "bi:whatsapp",
100
- params: { text: t.url },
101
- allowedParams: ["text"]
102
- };
103
- default:
104
- return {};
105
- }
106
- }), n = a(() => r.value.name), e = a(() => r.value.icon), c = a(() => {
107
- const o = r.value.shareBaseURL, i = _(r.value.params);
108
- return `${o}${i}`;
109
- });
110
- return (o, i) => (l(), u("a", {
111
- href: c.value,
112
- target: "_blank",
113
- rel: "noopener",
114
- "aria-label": n.value,
115
- style: { "padding-left": "0.25rem", "padding-right": "0.25rem" }
116
- }, [
117
- ["icon", "both"].includes(t.displayMode) ? (l(), b(z(R), {
118
- key: 0,
119
- icon: e.value,
120
- width: s.iconSize,
121
- height: s.iconSize,
122
- class: "fill-current text-gray-700 dark:text-gray-200 hover:text-blue-500 dark:hover:text-blue-400"
123
- }, null, 8, ["icon", "width", "height"])) : m("", !0),
124
- ["text", "both"].includes(t.displayMode) ? (l(), u(w, { key: 1 }, [
125
- B(" " + y(n.value), 1)
126
- ], 64)) : m("", !0)
127
- ], 8, P));
128
- }
129
- }), E = /* @__PURE__ */ h({
130
- __name: "Sharing",
131
- props: {
132
- url: {},
133
- text: {}
134
- },
135
- setup(s) {
136
- const t = {
137
- wrapperCssClass: "pl-4 py-4",
138
- titleCssClass: "text-sm/[32px] font-semibold mb-2",
139
- buttonCssClass: "flex flex-wrap space-x-1",
140
- title: "Share",
141
- networks: ["email", "facebook", "twitter", "telegram", "reddit", "linkedin", "whatsapp", "pinterest", "tumblr", "vk"],
142
- buttonSize: 18,
143
- iconSize: 20,
144
- iconStyle: "solid",
145
- displayMode: "both"
146
- }, r = s, { theme: n } = L(), e = a(() => n.value.sharing || !1), c = a(
147
- () => e.value && typeof e.value.wrapperCssClass == "string" ? e.value.wrapperCssClass : t.wrapperCssClass
148
- ), o = a(
149
- () => e.value && typeof e.value.title == "string" ? e.value.title : t.title
150
- ), i = a(
151
- () => e.value && typeof e.value.titleCssClass == "string" ? e.value.titleCssClass : t.titleCssClass
152
- ), f = a(
153
- () => e.value && typeof e.value.buttonCssClass == "string" ? e.value.buttonCssClass : t.buttonCssClass
154
- ), C = a(
155
- () => e.value && Array.isArray(e.value.networks) ? e.value.networks : t.networks
156
- ), g = a(
157
- () => e.value && Number.isInteger(e.value.buttonSize) && e.value.buttonSize > 0 ? e.value.buttonSize : t.buttonSize
158
- ), k = a(
159
- () => e.value && Number.isInteger(e.value.iconSize) && e.value.iconSize > 0 ? e.value.iconSize : t.iconSize
160
- ), x = a(
161
- () => e.value && typeof e.value.iconStyle == "string" ? e.value.iconStyle : t.iconStyle
162
- ), S = a(
163
- () => e.value && typeof e.value.displayMode == "string" ? e.value.displayMode : t.displayMode
164
- );
165
- return (I, N) => (l(), u("div", {
166
- class: p(c.value)
167
- }, [
168
- v("p", {
169
- class: p(i.value)
170
- }, y(o.value), 3),
171
- v("div", {
172
- class: p(f.value)
173
- }, [
174
- (l(!0), u(w, null, U(C.value, (d) => (l(), b(M, {
175
- key: d,
176
- url: r.url,
177
- text: r.text,
178
- network: d,
179
- "button-size": g.value,
180
- "icon-size": k.value,
181
- "icon-style": x.value,
182
- "display-mode": S.value
183
- }, null, 8, ["url", "text", "network", "button-size", "icon-size", "icon-style", "display-mode"]))), 128))
184
- ], 2)
185
- ], 2));
186
- }
187
- });
188
- export {
189
- E as default
190
- };