valaxy 0.1.2 → 0.2.2
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/dist/chunk-2K6ROMWQ.mjs +88 -0
- package/dist/chunk-NBGVYWSW.js +88 -0
- package/dist/chunk-TSLYS2VY.js +1 -0
- package/dist/chunk-U4ZDCBEC.mjs +1 -0
- package/dist/{config-d6527c8c.d.ts → config-24b4f209.d.ts} +16 -2
- package/dist/index.d.ts +37 -7
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/node/cli.js +44 -5
- package/dist/node/cli.mjs +44 -5
- package/dist/node/index.d.ts +1 -1
- package/dist/node/index.js +1 -1
- package/dist/node/index.mjs +1 -1
- package/package.json +15 -13
- package/src/client/components/PostCard.vue +15 -16
- package/src/client/components/ValaxyMd.vue +1 -1
- package/src/client/components/ValaxySidebar.vue +0 -2
- package/src/client/components/ValaxyToc.vue +1 -1
- package/src/client/composables/category.ts +24 -5
- package/src/client/composables/comments/index.ts +1 -0
- package/src/client/composables/comments/twikoo.ts +37 -0
- package/src/client/composables/comments/waline.ts +0 -1
- package/src/client/composables/common.ts +2 -1
- package/src/client/composables/post.ts +26 -1
- package/src/client/composables/tag.ts +9 -2
- package/src/client/index.html +5 -0
- package/src/client/layouts/404.vue +5 -1
- package/src/client/main.ts +1 -3
- package/src/client/modules/valaxy.ts +3 -2
- package/src/client/shims.d.ts +0 -5
- package/src/client/styles/common/code.scss +181 -9
- package/src/client/styles/common/custom-blocks.scss +84 -0
- package/src/client/styles/common/markdown.scss +1 -4
- package/src/client/styles/css-vars.scss +12 -5
- package/src/client/styles/global/i18n.scss +20 -0
- package/src/client/styles/index.scss +21 -8
- package/src/client/styles/palette.scss +57 -48
- package/src/node/cli.ts +15 -0
- package/src/node/markdown/headings.ts +3 -2
- package/src/node/markdown/highlight.ts +50 -0
- package/src/node/markdown/highlightLines.ts +96 -0
- package/src/node/markdown/index.ts +20 -11
- package/src/node/markdown/markdown-it-container.ts +9 -1
- package/src/node/plugins/index.ts +1 -1
- package/src/node/plugins/preset.ts +2 -2
- package/src/node/plugins/unocss.ts +9 -12
- package/src/node/rss.ts +127 -0
- package/src/node/shims.d.ts +10 -0
- package/src/types/config.ts +28 -2
- package/src/types/posts.ts +6 -1
- package/dist/chunk-5D7M5SQP.js +0 -1
- package/dist/chunk-CF6MGLH2.mjs +0 -84
- package/dist/chunk-L22LX2G6.mjs +0 -1
- package/dist/chunk-W5MJCUNY.js +0 -84
- package/src/client/pages/posts/index.md +0 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var c=Object.create;var a=Object.defineProperty,p=Object.defineProperties,m=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertyNames,s=Object.getOwnPropertySymbols,y=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable;var l=(e,n,t)=>n in e?a(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,x= exports.a =(e,n)=>{for(var t in n||(n={}))g.call(n,t)&&l(e,t,n[t]);if(s)for(var t of s(n))b.call(n,t)&&l(e,t,n[t]);return e},w= exports.b =(e,n)=>p(e,d(n));var k=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(n,t)=>(typeof require!="undefined"?require:n)[t]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var f=(e,n)=>()=>(e&&(n=e(e=0)),n);var v=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports);var h=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of u(n))!g.call(e,i)&&i!==t&&a(e,i,{get:()=>n[i],enumerable:!(r=m(n,i))||r.enumerable});return e};var C=(e,n,t)=>(t=e!=null?c(y(e)):{},h(n||!e||!e.__esModule?a(t,"default",{value:e,enumerable:!0}):t,e));var o=f(()=>{});o();var Y={url:"",lang:"en",title:"Valaxy Blog",subtitle:"Next Generation Static Blog Framework.",author:{avatar:"https://cdn.jsdelivr.net/gh/YunYouJun/yun/images/meme/yun-good-with-bg.jpg",email:"me@yunyoujun.cn",link:"https://www.yunyoujun.cn",name:"YunYouJun",status:{emoji:"\u{1F60A}",message:"All at sea."}},feed:{name:"",favicon:"favicon.png"},social:[],description:"A blog generated by Valaxy.",license:{enabled:!0,language:"",type:"by-nc-sa"},sponsor:{enable:!0,title:"\u6211\u5F88\u53EF\u7231\uFF0C\u8BF7\u7ED9\u6211\u94B1",methods:[{name:"\u652F\u4ED8\u5B9D",url:"https://cdn.jsdelivr.net/gh/YunYouJun/cdn/img/donate/alipay-qrcode.jpg",color:"#00A3EE",icon:"i-ri-alipay-line"},{name:"QQ \u652F\u4ED8",url:"https://cdn.jsdelivr.net/gh/YunYouJun/cdn/img/donate/qqpay-qrcode.png",color:"#12B7F5",icon:"i-ri-qq-line"},{name:"\u5FAE\u4FE1\u652F\u4ED8",url:"https://cdn.jsdelivr.net/gh/YunYouJun/cdn/img/donate/wechatpay-qrcode.jpg",color:"#2DC100",icon:"i-ri-wechat-pay-line"}]},search:{algolia:{enable:!1,appId:"",apiKey:"",indexName:"",chunkSize:5e3}},comment:{waline:{enable:!1,serverURL:""},twikoo:{enable:!1,envId:"https://twikoo.vercel.app"}},theme:"yun",themeConfig:{},unocss:{},markdown:{excerpt:"<!-- more -->"},markdownIt:{toc:{includeLevel:[1,2,3,4],listType:"ol"},katex:{}}};o();o();exports.a = x; exports.b = w; exports.c = k; exports.d = v; exports.e = C; exports.f = o; exports.g = Y;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var p=Object.create;var a=Object.defineProperty,m=Object.defineProperties,c=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertyNames,s=Object.getOwnPropertySymbols,y=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable;var l=(e,n,t)=>n in e?a(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,x=(e,n)=>{for(var t in n||(n={}))g.call(n,t)&&l(e,t,n[t]);if(s)for(var t of s(n))b.call(n,t)&&l(e,t,n[t]);return e},k=(e,n)=>m(e,d(n));var w=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(n,t)=>(typeof require!="undefined"?require:n)[t]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var f=(e,n)=>()=>(e&&(n=e(e=0)),n);var v=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports);var h=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of u(n))!g.call(e,i)&&i!==t&&a(e,i,{get:()=>n[i],enumerable:!(r=c(n,i))||r.enumerable});return e};var C=(e,n,t)=>(t=e!=null?p(y(e)):{},h(n||!e||!e.__esModule?a(t,"default",{value:e,enumerable:!0}):t,e));var o=f(()=>{});o();var Y={url:"",lang:"en",title:"Valaxy Blog",subtitle:"Next Generation Static Blog Framework.",author:{avatar:"https://cdn.jsdelivr.net/gh/YunYouJun/yun/images/meme/yun-good-with-bg.jpg",email:"me@yunyoujun.cn",link:"https://www.yunyoujun.cn",name:"YunYouJun",status:{emoji:"\u{1F60A}",message:"All at sea."}},feed:{name:"",favicon:"favicon.png"},social:[],description:"A blog generated by Valaxy.",license:{enabled:!0,language:"",type:"by-nc-sa"},sponsor:{enable:!0,title:"\u6211\u5F88\u53EF\u7231\uFF0C\u8BF7\u7ED9\u6211\u94B1",methods:[{name:"\u652F\u4ED8\u5B9D",url:"https://cdn.jsdelivr.net/gh/YunYouJun/cdn/img/donate/alipay-qrcode.jpg",color:"#00A3EE",icon:"i-ri-alipay-line"},{name:"QQ \u652F\u4ED8",url:"https://cdn.jsdelivr.net/gh/YunYouJun/cdn/img/donate/qqpay-qrcode.png",color:"#12B7F5",icon:"i-ri-qq-line"},{name:"\u5FAE\u4FE1\u652F\u4ED8",url:"https://cdn.jsdelivr.net/gh/YunYouJun/cdn/img/donate/wechatpay-qrcode.jpg",color:"#2DC100",icon:"i-ri-wechat-pay-line"}]},search:{algolia:{enable:!1,appId:"",apiKey:"",indexName:"",chunkSize:5e3}},comment:{waline:{enable:!1,serverURL:""},twikoo:{enable:!1,envId:"https://twikoo.vercel.app"}},theme:"yun",themeConfig:{},unocss:{},markdown:{excerpt:"<!-- more -->"},markdownIt:{toc:{includeLevel:[1,2,3,4],listType:"ol"},katex:{}}};o();o();export{x as a,k as b,w as c,v as d,C as e,o as f,Y as g};
|
|
@@ -38,8 +38,8 @@ interface ValaxyConfig<T = ValaxyThemeConfig> {
|
|
|
38
38
|
*/
|
|
39
39
|
lang: string;
|
|
40
40
|
/**
|
|
41
|
-
* You site url in web, required for ssg
|
|
42
|
-
* @description 站点的 URL,SSG
|
|
41
|
+
* You site url in web, required for ssg & rss
|
|
42
|
+
* @description 站点的 URL,SSG & RSS 需要(譬如生成版权处文章永久链接)
|
|
43
43
|
*/
|
|
44
44
|
url: string;
|
|
45
45
|
/**
|
|
@@ -65,6 +65,8 @@ interface ValaxyConfig<T = ValaxyThemeConfig> {
|
|
|
65
65
|
* @description 你的名字
|
|
66
66
|
*/
|
|
67
67
|
name: string;
|
|
68
|
+
email: string;
|
|
69
|
+
link: string;
|
|
68
70
|
avatar: string;
|
|
69
71
|
/**
|
|
70
72
|
* The status of you
|
|
@@ -79,6 +81,14 @@ interface ValaxyConfig<T = ValaxyThemeConfig> {
|
|
|
79
81
|
message: string;
|
|
80
82
|
};
|
|
81
83
|
};
|
|
84
|
+
feed: {
|
|
85
|
+
/**
|
|
86
|
+
* name: feed -> feed.xml / feed.atom / feed.json
|
|
87
|
+
* @default '' -> feed.xml / atom.xml / feed.json
|
|
88
|
+
*/
|
|
89
|
+
name: string;
|
|
90
|
+
favicon: string;
|
|
91
|
+
};
|
|
82
92
|
/**
|
|
83
93
|
* 社交链接
|
|
84
94
|
*/
|
|
@@ -103,6 +113,10 @@ interface ValaxyConfig<T = ValaxyThemeConfig> {
|
|
|
103
113
|
enable: boolean;
|
|
104
114
|
serverURL: string;
|
|
105
115
|
};
|
|
116
|
+
twikoo: {
|
|
117
|
+
enable: boolean;
|
|
118
|
+
envId: string;
|
|
119
|
+
};
|
|
106
120
|
};
|
|
107
121
|
/**
|
|
108
122
|
* The name of theme
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as vue from 'vue';
|
|
2
|
-
import { InjectionKey, ComputedRef,
|
|
3
|
-
import { V as ValaxyConfig, a as ValaxyThemeConfig } from './config-
|
|
4
|
-
export { S as SocialLink, U as UserConfig, V as ValaxyConfig, a as ValaxyThemeConfig, d as defaultValaxyConfig } from './config-
|
|
2
|
+
import { InjectionKey, ComputedRef, Ref, StyleValue } from 'vue';
|
|
3
|
+
import { V as ValaxyConfig, a as ValaxyThemeConfig } from './config-24b4f209.js';
|
|
4
|
+
export { S as SocialLink, U as UserConfig, V as ValaxyConfig, a as ValaxyThemeConfig, d as defaultValaxyConfig } from './config-24b4f209.js';
|
|
5
5
|
import 'type-fest';
|
|
6
6
|
import 'unocss/vite';
|
|
7
7
|
import 'markdown-it';
|
|
@@ -9,7 +9,7 @@ import 'markdown-it-anchor';
|
|
|
9
9
|
import 'katex';
|
|
10
10
|
import 'vite-plugin-md';
|
|
11
11
|
|
|
12
|
-
interface Post {
|
|
12
|
+
interface Post extends Record<string, any> {
|
|
13
13
|
/**
|
|
14
14
|
* Path of post
|
|
15
15
|
* route.path
|
|
@@ -108,15 +108,22 @@ interface Post {
|
|
|
108
108
|
* @description 是否显示目录
|
|
109
109
|
*/
|
|
110
110
|
toc?: boolean;
|
|
111
|
+
/**
|
|
112
|
+
* is draft
|
|
113
|
+
* @description 是否为草稿
|
|
114
|
+
*/
|
|
115
|
+
draft?: boolean;
|
|
111
116
|
}
|
|
112
117
|
|
|
113
118
|
/**
|
|
114
119
|
* Theme Config
|
|
115
120
|
*/
|
|
116
121
|
interface ThemeConfig {
|
|
122
|
+
safelist: string[];
|
|
117
123
|
colors: {
|
|
118
124
|
/**
|
|
119
125
|
* primary color
|
|
126
|
+
* @default '#0078E7'
|
|
120
127
|
*/
|
|
121
128
|
primary: string;
|
|
122
129
|
};
|
|
@@ -200,6 +207,16 @@ interface ThemeConfig {
|
|
|
200
207
|
color: string;
|
|
201
208
|
icon: string;
|
|
202
209
|
}>;
|
|
210
|
+
/**
|
|
211
|
+
* 菜单栏
|
|
212
|
+
*/
|
|
213
|
+
menu: {
|
|
214
|
+
custom: {
|
|
215
|
+
title: string;
|
|
216
|
+
url: string;
|
|
217
|
+
icon: string;
|
|
218
|
+
};
|
|
219
|
+
};
|
|
203
220
|
}
|
|
204
221
|
|
|
205
222
|
declare const valaxyConfigSymbol: InjectionKey<ComputedRef<ValaxyConfig<ThemeConfig>>>;
|
|
@@ -226,8 +243,9 @@ declare type Categories = Map<string, Category>;
|
|
|
226
243
|
* get categories from posts
|
|
227
244
|
* @returns
|
|
228
245
|
*/
|
|
229
|
-
declare function useCategory(): ParentCategory;
|
|
246
|
+
declare function useCategory(category?: string, posts?: Post[]): ParentCategory;
|
|
230
247
|
|
|
248
|
+
declare const usePostTitle: (post: Ref<Post>) => vue.ComputedRef<any>;
|
|
231
249
|
/**
|
|
232
250
|
* get post list
|
|
233
251
|
* todo: use vue provide/inject to global
|
|
@@ -237,6 +255,11 @@ declare function useCategory(): ParentCategory;
|
|
|
237
255
|
declare function usePostList(params?: {
|
|
238
256
|
type?: string;
|
|
239
257
|
}): vue.ComputedRef<Post[]>;
|
|
258
|
+
/**
|
|
259
|
+
* get all page
|
|
260
|
+
* @returns
|
|
261
|
+
*/
|
|
262
|
+
declare function usePageList(): vue.ComputedRef<any[]>;
|
|
240
263
|
/**
|
|
241
264
|
* get prev and next post
|
|
242
265
|
* @param path
|
|
@@ -263,7 +286,12 @@ declare type Tags = Map<string, {
|
|
|
263
286
|
/**
|
|
264
287
|
* get utils about tags
|
|
265
288
|
*/
|
|
266
|
-
declare function useTags(
|
|
289
|
+
declare function useTags(options?: {
|
|
290
|
+
/**
|
|
291
|
+
* Primary Color
|
|
292
|
+
*/
|
|
293
|
+
primary: string;
|
|
294
|
+
}): {
|
|
267
295
|
tags: Tags;
|
|
268
296
|
getTagStyle: (count: number) => {
|
|
269
297
|
'--yun-tag-color': string;
|
|
@@ -326,6 +354,8 @@ declare function useCodePen(): void;
|
|
|
326
354
|
|
|
327
355
|
declare function useActiveSidebarLinks(): void;
|
|
328
356
|
|
|
357
|
+
declare function useTwikoo(options?: {}): void;
|
|
358
|
+
|
|
329
359
|
declare function useWaline(options?: {}): void;
|
|
330
360
|
|
|
331
361
|
/**
|
|
@@ -357,4 +387,4 @@ declare function formatDate(date: string | number | Date, template?: string): st
|
|
|
357
387
|
*/
|
|
358
388
|
declare function sortByDate(posts: Post[], desc?: boolean): Post[];
|
|
359
389
|
|
|
360
|
-
export { Categories, Category, ParentCategory, Post, PostCategory, Tags, formatDate, initConfig, isDark, random, sortByDate, toggleDark, useActiveSidebarLinks, useAplayer, useBackToTop, useCategory, useCodePen, useConfig, useFrontmatter, useFullUrl, useInvisibleElement, useKatex, useLayout, usePostList, usePostProperty, usePrevNext, useTag, useTags, useThemeConfig, useWaline, valaxyConfigRef, valaxyConfigSymbol, wrap, wrapTable };
|
|
390
|
+
export { Categories, Category, ParentCategory, Post, PostCategory, Tags, formatDate, initConfig, isDark, random, sortByDate, toggleDark, useActiveSidebarLinks, useAplayer, useBackToTop, useCategory, useCodePen, useConfig, useFrontmatter, useFullUrl, useInvisibleElement, useKatex, useLayout, usePageList, usePostList, usePostProperty, usePostTitle, usePrevNext, useTag, useTags, useThemeConfig, useTwikoo, useWaline, valaxyConfigRef, valaxyConfigSymbol, wrap, wrapTable };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunk5D7M5SQPjs = require('./chunk-5D7M5SQP.js');_chunk5D7M5SQPjs.f.call(void 0, );_chunk5D7M5SQPjs.f.call(void 0, );_chunk5D7M5SQPjs.f.call(void 0, );var _config = require('@valaxyjs/config'); var _config2 = _interopRequireDefault(_config);var _vue = require('vue');function w(t){let e=JSON.parse(t);return import.meta.env.DEV?_vue.readonly.call(void 0, e):e}var U=Symbol("valaxy:config"),T= exports.valaxyConfigRef =_vue.shallowRef.call(void 0, w(_config2.default));import.meta.hot&&import.meta.hot.accept("/@valaxyjs/config",t=>{T.value=w(t.default)});function yt(){return _vue.computed.call(void 0, ()=>T.value)}function g(){let t=_vue.inject.call(void 0, U);if(!t)throw new Error("[Valaxy] config not properly injected in qpp");return t}function b(){let t=g();return _vue.computed.call(void 0, ()=>t.value.themeConfig)}_chunk5D7M5SQPjs.f.call(void 0, );_chunk5D7M5SQPjs.f.call(void 0, );_chunk5D7M5SQPjs.f.call(void 0, );var _vuerouter = require('vue-router');_chunk5D7M5SQPjs.f.call(void 0, );_chunk5D7M5SQPjs.f.call(void 0, );function vt(t,e){return Math.random()*(e-t)+t}function q(t,e){let o=document.createElement("div");o.className=e,t.parentNode.insertBefore(o,t),t.parentNode.removeChild(t),o.appendChild(t)}var Ct=(t=document)=>{t.querySelectorAll("table").forEach(e=>{let o=document.createElement("div");o.className="table-container",q(e,"table-container")})};_chunk5D7M5SQPjs.f.call(void 0, );var _dayjs = require('dayjs'); var _dayjs2 = _interopRequireDefault(_dayjs);function bt(t,e="YYYY-MM-DD"){return _dayjs2.default.call(void 0, t).format(e)}function y(t,e=!0){return t.sort((o,s)=>{let i=+new Date(o.date||""),n=+new Date(s.date||"");return e?n-i:i-n})}function h(t={}){let e=_vuerouter.useRouter.call(void 0, );return _vue.computed.call(void 0, ()=>{let o=e.getRoutes().filter(n=>n.path.startsWith("/posts")&&n.meta.frontmatter&&n.meta.frontmatter.date).filter(n=>!n.path.endsWith(".html")).filter(n=>!t.type||n.meta.frontmatter.type===t.type).map(n=>Object.assign({path:n.path,excerpt:n.meta.excerpt},n.meta.frontmatter)),s=y(o.filter(n=>n.top)).sort((n,a)=>a.top-n.top),i=y(o.filter(n=>!n.top));return s.concat(i)})}function Ht(t){let e=_vuerouter.useRoute.call(void 0, ),o=_vue.computed.call(void 0, ()=>t||e.path),s=h(),i=_vue.computed.call(void 0, ()=>{let c=-1;return s.value.find((u,m)=>u.path===o.value?(c=m,!0):!1),c}),n=_vue.computed.call(void 0, ()=>i.value-1>=0?s.value[i.value-1]:null),a=_vue.computed.call(void 0, ()=>i.value+1<s.value.length?s.value[i.value+1]:null);return[n,a]}function Dt(t){if(!t)return{color:"",icon:"",styles:{}};let e=b();t in e.value.types||(t="link");let o=e.value.types[t].color,s=e.value.types[t].icon,i=_vue.computed.call(void 0, ()=>({"--card-c-primary":t&&o}));return{color:o,icon:s,styles:i}}function Ut(){var s;let t=h(),e={total:t.value.length,children:new Map([["Uncategorized",{total:0,posts:[]}]])},o=e.children.get("Uncategorized");return t.value.forEach(i=>{if(i.categories)if(Array.isArray(i.categories)){let n=i.categories.length,a=e;i.categories.forEach((c,u)=>{var m,d,p;if(u===n-1)if(a.children.has(c)){let l=a.children.get(c);l.posts&&(l.total+=1,l.posts.push(i))}else(m=a.children)==null||m.set(c,{total:1,posts:[i]});else if((d=a.children)!=null&&d.has(c)){let l=a.children.get(c);l.total+=1,a=l}else{let l={total:1,children:new Map};(p=a.children)==null||p.set(c,l),a=l}})}else{let n=i.categories;if(e.children.has(n)){let a=e.children.get(n);a.total+=1,a.posts.push(i)}else e.children.set(n,{total:1,posts:[i]})}else o.total+=1,o.posts.push(i)}),o.total===0&&((s=e.children)==null||s.delete("Uncategorized")),e}_chunk5D7M5SQPjs.f.call(void 0, );var _tinycolor = require('@ctrl/tinycolor');function Ot(){let t=W(),e=new (0, _tinycolor.TinyColor)("#999999"),o=new (0, _tinycolor.TinyColor)(getComputedStyle(document.documentElement).getPropertyValue("--va-c-primary"));return{tags:t,getTagStyle:i=>{let n=Array.from(t).map(([d,p])=>p.count),a=Math.max(...n),c=Math.min(...n),u=a-c,m=(i-c)/u;return{"--yun-tag-color":e.mix(o,m*100).toString(),fontSize:`${m*36+12}px`}}}}function W(){let t=h(),e=new Map;return t.value.forEach(o=>{if(o.tags){let s;typeof o.tags=="string"?s=[o.tags]:s=o.tags,s.forEach(i=>{if(e.has(i)){let n=e.get(i);e.set(i,_chunk5D7M5SQPjs.b.call(void 0, _chunk5D7M5SQPjs.a.call(void 0, {},n),{count:n.count+1}))}else e.set(i,{count:1})})}}),e}_chunk5D7M5SQPjs.f.call(void 0, );var _core = require('@vueuse/core');function Ft(){let t=_vuerouter.useRoute.call(void 0, );return _vue.computed.call(void 0, ()=>t.meta.frontmatter)}function $t(){let t=g(),e=_vuerouter.useRoute.call(void 0, );return _vue.computed.call(void 0, ()=>(t.value.url||_core.isClient&&window.location.origin)+e.path)}_chunk5D7M5SQPjs.f.call(void 0, );_chunk5D7M5SQPjs.f.call(void 0, );var _head = require('@vueuse/head');function Gt(){_head.useHead.call(void 0, {link:[{rel:"stylesheet",href:"https://cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.css"}]})}_chunk5D7M5SQPjs.f.call(void 0, );function oe(t){let e=_vue.ref.call(void 0, !1),{top:o}=_core.useElementBounding.call(void 0, t);return _core.useIntersectionObserver.call(void 0, t,([{isIntersecting:i}])=>{e.value=i}),{show:()=>{e.value||window.scrollTo(0,o.value)}}}_chunk5D7M5SQPjs.f.call(void 0, );var _=_core.useDark.call(void 0, ),se= exports.toggleDark =_core.useToggle.call(void 0, _);_chunk5D7M5SQPjs.f.call(void 0, );function le(t){let e=_vuerouter.useRoute.call(void 0, );return _vue.computed.call(void 0, ()=>e.meta.layout===t)}_chunk5D7M5SQPjs.f.call(void 0, );_chunk5D7M5SQPjs.f.call(void 0, );function fe(){_head.useHead.call(void 0, {link:[{rel:"stylesheet",href:"https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css"}]}),_core.useScriptTag.call(void 0, "https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js",()=>{_core.useScriptTag.call(void 0, "https://cdn.jsdelivr.net/npm/meting@2/dist/Meting.min.js")})}_chunk5D7M5SQPjs.f.call(void 0, );function ye(t={offset:100}){if(!_core.isClient)return{percentage:_vue.ref.call(void 0, 0),show:_vue.ref.call(void 0, !1)};let{y:e}=_core.useWindowScroll.call(void 0, ),o=_vue.computed.call(void 0, ()=>e.value/(document.body.scrollHeight-window.innerHeight)),s=_vue.computed.call(void 0, ()=>e.value>t.offset);return{percentage:o,show:s}}_chunk5D7M5SQPjs.f.call(void 0, );function Ce(){_head.useHead.call(void 0, {script:[{src:"https://static.codepen.io/assets/embed/ei.js",async:!0}]})}_chunk5D7M5SQPjs.f.call(void 0, );function Ae(){let t=null,e=null,o=ct(s,200);function s(){let a=st(),c=it(a);for(let u=0;u<c.length;u++){let m=c[u],d=c[u+1],[p,l]=at(u,m,d);if(p){history.replaceState(null,document.title,l||" "),i(l);return}}}function i(a){if(n(e),n(t),e=document.querySelector(`.va-toc a[href="${a}"]`),!e)return;e.classList.add("active");let c=e.closest(".right-sidebar-container > ul > li");c&&c!==e.parentElement?(t=c.querySelector("a"),t&&t.classList.add("active")):t=null}function n(a){a&&a.classList.remove("active")}_vue.onMounted.call(void 0, ()=>{s(),window.addEventListener("scroll",o)}),_vue.onUpdated.call(void 0, ()=>{i(decodeURIComponent(location.hash))}),_vue.onUnmounted.call(void 0, ()=>{window.removeEventListener("scroll",o)})}function st(){return[].slice.call(document.querySelectorAll(".va-toc a.toc-link-item"))}function it(t){return[].slice.call(document.querySelectorAll(".header-anchor")).filter(e=>t.some(o=>o.hash===e.hash))}function S(t){return t.parentElement.offsetTop-50}function at(t,e,o){let s=window.scrollY;return t===0&&s===0?[!0,null]:s<S(e)?[!1,null]:!o||s<S(o)?[!0,decodeURIComponent(e.hash)]:[!1,null]}function ct(t,e){let o,s=!1;return()=>{o&&clearTimeout(o),s?o=setTimeout(t,e):(t(),s=!0,setTimeout(()=>{s=!1},e))}}_chunk5D7M5SQPjs.f.call(void 0, );_chunk5D7M5SQPjs.f.call(void 0, );var _vuei18n = require('vue-i18n');function De(t={}){let e=_vuerouter.useRoute.call(void 0, ),{locale:o}=_vuei18n.useI18n.call(void 0, ),s;function i(n={}){if(!_core.isClient)return;let a={el:".comment #waline",lang:o.value,dark:"html.dark",emoji:["https://cdn.jsdelivr.net/gh/walinejs/emojis@1.0.0/bilibili","https://cdn.jsdelivr.net/gh/walinejs/emojis@1.0.0/qq","https://cdn.jsdelivr.net/gh/walinejs/emojis@1.0.0/weibo"],path:e.path},c=Object.assign(a,n);return window.Waline(c)}_core.useScriptTag.call(void 0, "//cdn.jsdelivr.net/npm/@waline/client",()=>{s=i(t)}),_vue.watch.call(void 0, ()=>e.path,n=>{!s||s.update({path:n})}),_vue.watch.call(void 0, o,n=>{!s||s.update({lang:n})}),_vue.onUnmounted.call(void 0, ()=>{!s||s.destroy()})}exports.defaultValaxyConfig = _chunk5D7M5SQPjs.g; exports.formatDate = bt; exports.initConfig = yt; exports.isDark = _; exports.random = vt; exports.sortByDate = y; exports.toggleDark = se; exports.useActiveSidebarLinks = Ae; exports.useAplayer = fe; exports.useBackToTop = ye; exports.useCategory = Ut; exports.useCodePen = Ce; exports.useConfig = g; exports.useFrontmatter = Ft; exports.useFullUrl = $t; exports.useInvisibleElement = oe; exports.useKatex = Gt; exports.useLayout = le; exports.usePostList = h; exports.usePostProperty = Dt; exports.usePrevNext = Ht; exports.useTag = W; exports.useTags = Ot; exports.useThemeConfig = b; exports.useWaline = De; exports.valaxyConfigRef = T; exports.valaxyConfigSymbol = U; exports.wrap = q; exports.wrapTable = Ct;
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkTSLYS2VYjs = require('./chunk-TSLYS2VY.js');_chunkTSLYS2VYjs.f.call(void 0, );_chunkTSLYS2VYjs.f.call(void 0, );_chunkTSLYS2VYjs.f.call(void 0, );var _config = require('@valaxyjs/config'); var _config2 = _interopRequireDefault(_config);var _vue = require('vue');function T(t){let e=JSON.parse(t);return import.meta.env.DEV?_vue.readonly.call(void 0, e):e}var q=Symbol("valaxy:config"),b= exports.valaxyConfigRef =_vue.shallowRef.call(void 0, T(_config2.default));import.meta.hot&&import.meta.hot.accept("/@valaxyjs/config",t=>{b.value=T(t.default)});function Pt(){return _vue.computed.call(void 0, ()=>b.value)}function y(){let t=_vue.inject.call(void 0, q);if(!t)throw new Error("[Valaxy] config not properly injected in qpp");return t}function P(){let t=y();return _vue.computed.call(void 0, ()=>t.value.themeConfig)}_chunkTSLYS2VYjs.f.call(void 0, );_chunkTSLYS2VYjs.f.call(void 0, );_chunkTSLYS2VYjs.f.call(void 0, );var _vuerouter = require('vue-router');var _vuei18n = require('vue-i18n');_chunkTSLYS2VYjs.f.call(void 0, );_chunkTSLYS2VYjs.f.call(void 0, );function jt(t,e){return Math.random()*(e-t)+t}function I(t,e){let o=document.createElement("div");o.className=e,t.parentNode.insertBefore(o,t),t.parentNode.removeChild(t),o.appendChild(t)}var Et=(t=document)=>{t.querySelectorAll("table").forEach(e=>{let o=document.createElement("div");o.className="table-container",I(e,"table-container")})};_chunkTSLYS2VYjs.f.call(void 0, );var _dayjs = require('dayjs'); var _dayjs2 = _interopRequireDefault(_dayjs);function kt(t,e="YYYY-MM-DD"){return _dayjs2.default.call(void 0, t).format(e)}function x(t,e=!0){return t.sort((o,s)=>{let i=+new Date(o.date||""),r=+new Date(s.date||"");return e?r-i:i-r})}var zt=t=>{let{locale:e}=_vuei18n.useI18n.call(void 0, );return _vue.computed.call(void 0, ()=>{let o=e.value==="zh-CN"?"zh":e.value;return t.value[`title_${o}`]||t.value.title})};function g(t={}){let e=_vuerouter.useRouter.call(void 0, );return _vue.computed.call(void 0, ()=>{let o=e.getRoutes().filter(r=>r.path.startsWith("/posts")&&r.meta.frontmatter&&r.meta.frontmatter.date).filter(r=>!r.path.endsWith(".html")).filter(r=>!t.type||r.meta.frontmatter.type===t.type).map(r=>Object.assign({path:r.path,excerpt:r.meta.excerpt},r.meta.frontmatter)),s=x(o.filter(r=>r.top)).sort((r,l)=>l.top-r.top),i=x(o.filter(r=>!r.top));return s.concat(i)})}function Nt(){let t=_vuerouter.useRouter.call(void 0, );return _vue.computed.call(void 0, ()=>t.getRoutes().map(o=>Object.assign({path:o.path,excerpt:o.meta.excerpt},o.meta.frontmatter)))}function Wt(t){let e=_vuerouter.useRoute.call(void 0, ),o=_vue.computed.call(void 0, ()=>t||e.path),s=g(),i=_vue.computed.call(void 0, ()=>{let a=-1;return s.value.find((c,p)=>c.path===o.value?(a=p,!0):!1),a}),r=_vue.computed.call(void 0, ()=>i.value-1>=0?s.value[i.value-1]:null),l=_vue.computed.call(void 0, ()=>i.value+1<s.value.length?s.value[i.value+1]:null);return[r,l]}function Bt(t){if(!t)return{color:"",icon:"",styles:{}};let e=P();t in e.value.types||(t="link");let o=e.value.types[t].color,s=e.value.types[t].icon,i=_vue.computed.call(void 0, ()=>({"--card-c-primary":t&&o}));return{color:o,icon:s,styles:i}}function Ft(t,e=[]){var i;e.length||(e=_vue.unref.call(void 0, g()));let o={total:e.length,children:new Map([["Uncategorized",{total:0,posts:[]}]])},s=o.children.get("Uncategorized");if(e.forEach(r=>{if(r.categories)if(Array.isArray(r.categories)){let l=r.categories.length,a=o;r.categories.forEach((c,p)=>{var f,h,d;if(p===l-1)if(a.children.has(c)){let u=a.children.get(c);u.posts&&(u.total+=1,u.posts.push(r))}else(f=a.children)==null||f.set(c,{total:1,posts:[r]});else if((h=a.children)!=null&&h.has(c)){let u=a.children.get(c);u.total+=1,a=u}else{let u={total:1,children:new Map};(d=a.children)==null||d.set(c,u),a=u}})}else{let l=r.categories;if(o.children.has(l)){let a=o.children.get(l);a.total+=1,a.posts.push(r)}else o.children.set(l,{total:1,posts:[r]})}else s.total+=1,s.posts.push(r)}),s.total===0&&((i=o.children)==null||i.delete("Uncategorized")),t){let r=o.children.get(t);return r?{total:r==null?void 0:r.total,children:new Map([[t,r]])}:(console.warn(`Do not have category: ${t}`),o)}else return o}_chunkTSLYS2VYjs.f.call(void 0, );var _tinycolor = require('@ctrl/tinycolor');function Qt(t={primary:"#0078E7"}){let e=Y(),o=new (0, _tinycolor.TinyColor)("#999999"),s=new (0, _tinycolor.TinyColor)(t.primary);return{tags:e,getTagStyle:r=>{let l=Array.from(e).map(([h,d])=>d.count),a=Math.max(...l),c=Math.min(...l),p=a-c,f=(r-c)/p;return{"--yun-tag-color":o.mix(s,f*100).toString(),fontSize:`${f*36+12}px`}}}}function Y(){let t=g(),e=new Map;return t.value.forEach(o=>{if(o.tags){let s;typeof o.tags=="string"?s=[o.tags]:s=o.tags,s.forEach(i=>{if(e.has(i)){let r=e.get(i);e.set(i,_chunkTSLYS2VYjs.b.call(void 0, _chunkTSLYS2VYjs.a.call(void 0, {},r),{count:r.count+1}))}else e.set(i,{count:1})})}}),e}_chunkTSLYS2VYjs.f.call(void 0, );var _core = require('@vueuse/core');function re(){let t=_vuerouter.useRoute.call(void 0, );return _vue.computed.call(void 0, ()=>t.meta.frontmatter)}function ne(){let t=y(),e=_vuerouter.useRoute.call(void 0, );return _vue.computed.call(void 0, ()=>((t.value.url.endsWith("/")?t.value.url.slice(0,-1):t.value.url)||_core.isClient&&window.location.origin)+e.path)}_chunkTSLYS2VYjs.f.call(void 0, );_chunkTSLYS2VYjs.f.call(void 0, );var _head = require('@vueuse/head');function ae(){_head.useHead.call(void 0, {link:[{rel:"stylesheet",href:"https://cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.css"}]})}_chunkTSLYS2VYjs.f.call(void 0, );function fe(t){let e=_vue.ref.call(void 0, !1),{top:o}=_core.useElementBounding.call(void 0, t);return _core.useIntersectionObserver.call(void 0, t,([{isIntersecting:i}])=>{e.value=i}),{show:()=>{e.value||window.scrollTo(0,o.value)}}}_chunkTSLYS2VYjs.f.call(void 0, );var X=_core.useDark.call(void 0, ),ge= exports.toggleDark =_core.useToggle.call(void 0, X);_chunkTSLYS2VYjs.f.call(void 0, );function we(t){let e=_vuerouter.useRoute.call(void 0, );return _vue.computed.call(void 0, ()=>e.meta.layout===t)}_chunkTSLYS2VYjs.f.call(void 0, );_chunkTSLYS2VYjs.f.call(void 0, );function Pe(){_head.useHead.call(void 0, {link:[{rel:"stylesheet",href:"https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css"}]}),_core.useScriptTag.call(void 0, "https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js",()=>{_core.useScriptTag.call(void 0, "https://cdn.jsdelivr.net/npm/meting@2/dist/Meting.min.js")})}_chunkTSLYS2VYjs.f.call(void 0, );function Ae(t={offset:100}){if(!_core.isClient)return{percentage:_vue.ref.call(void 0, 0),show:_vue.ref.call(void 0, !1)};let{y:e}=_core.useWindowScroll.call(void 0, ),o=_vue.computed.call(void 0, ()=>e.value/(document.body.scrollHeight-window.innerHeight)),s=_vue.computed.call(void 0, ()=>e.value>t.offset);return{percentage:o,show:s}}_chunkTSLYS2VYjs.f.call(void 0, );function Se(){_head.useHead.call(void 0, {script:[{src:"https://static.codepen.io/assets/embed/ei.js",async:!0}]})}_chunkTSLYS2VYjs.f.call(void 0, );function qe(){let t=null,e=null,o=mt(s,200);function s(){let l=lt(),a=ct(l);for(let c=0;c<a.length;c++){let p=a[c],f=a[c+1],[h,d]=ut(c,p,f);if(h){history.replaceState(null,document.title,d||" "),i(d);return}}}function i(l){if(r(e),r(t),e=document.querySelector(`.va-toc a[href="${l}"]`),!e)return;e.classList.add("active");let a=e.closest(".right-sidebar-container > ul > li");a&&a!==e.parentElement?(t=a.querySelector("a"),t&&t.classList.add("active")):t=null}function r(l){l&&l.classList.remove("active")}_vue.onMounted.call(void 0, ()=>{s(),window.addEventListener("scroll",o)}),_vue.onUpdated.call(void 0, ()=>{i(decodeURIComponent(location.hash))}),_vue.onUnmounted.call(void 0, ()=>{window.removeEventListener("scroll",o)})}function lt(){return[].slice.call(document.querySelectorAll(".va-toc a.toc-link-item"))}function ct(t){return[].slice.call(document.querySelectorAll(".header-anchor")).filter(e=>t.some(o=>o.hash===e.hash))}function H(t){return t.parentElement.offsetTop-50}function ut(t,e,o){let s=window.scrollY;return t===0&&s===0?[!0,null]:s<H(e)?[!1,null]:!o||s<H(o)?[!0,decodeURIComponent(e.hash)]:[!1,null]}function mt(t,e){let o,s=!1;return()=>{o&&clearTimeout(o),s?o=setTimeout(t,e):(t(),s=!0,setTimeout(()=>{s=!1},e))}}_chunkTSLYS2VYjs.f.call(void 0, );_chunkTSLYS2VYjs.f.call(void 0, );function Be(t={}){let e=_vuerouter.useRoute.call(void 0, ),{locale:o}=_vuei18n.useI18n.call(void 0, ),s;function i(r={}){if(!_core.isClient)return;let l={el:".comment #tcomment",lang:o.value,path:e.path},a=Object.assign(l,r);return window.twikoo.init(a)}_core.useScriptTag.call(void 0, "//cdn.jsdelivr.net/npm/twikoo@1.5.1/dist/twikoo.all.min.js",()=>{s=i(t)}),console.log(s)}_chunkTSLYS2VYjs.f.call(void 0, );function Je(t={}){let e=_vuerouter.useRoute.call(void 0, ),{locale:o}=_vuei18n.useI18n.call(void 0, ),s;function i(r={}){if(!_core.isClient)return;let l={el:".comment #waline",lang:o.value,dark:"html.dark",emoji:["https://cdn.jsdelivr.net/gh/walinejs/emojis@1.0.0/bilibili","https://cdn.jsdelivr.net/gh/walinejs/emojis@1.0.0/qq","https://cdn.jsdelivr.net/gh/walinejs/emojis@1.0.0/weibo"],path:e.path},a=Object.assign(l,r);return window.Waline(a)}_core.useScriptTag.call(void 0, "//cdn.jsdelivr.net/npm/@waline/client",()=>{s=i(t)}),_vue.watch.call(void 0, ()=>e.path,r=>{!s||s.update({path:r})}),_vue.watch.call(void 0, o,r=>{!s||s.update({lang:r})}),_vue.onUnmounted.call(void 0, ()=>{!s||s.destroy()})}exports.defaultValaxyConfig = _chunkTSLYS2VYjs.g; exports.formatDate = kt; exports.initConfig = Pt; exports.isDark = X; exports.random = jt; exports.sortByDate = x; exports.toggleDark = ge; exports.useActiveSidebarLinks = qe; exports.useAplayer = Pe; exports.useBackToTop = Ae; exports.useCategory = Ft; exports.useCodePen = Se; exports.useConfig = y; exports.useFrontmatter = re; exports.useFullUrl = ne; exports.useInvisibleElement = fe; exports.useKatex = ae; exports.useLayout = we; exports.usePageList = Nt; exports.usePostList = g; exports.usePostProperty = Bt; exports.usePostTitle = zt; exports.usePrevNext = Wt; exports.useTag = Y; exports.useTags = Qt; exports.useThemeConfig = P; exports.useTwikoo = Be; exports.useWaline = Je; exports.valaxyConfigRef = b; exports.valaxyConfigSymbol = q; exports.wrap = I; exports.wrapTable = Et;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as v,b as w,f as n,g as Ct}from"./chunk-U4ZDCBEC.mjs";n();n();n();import D from"@valaxyjs/config";import{computed as C,inject as U,readonly as O,shallowRef as V}from"vue";function T(t){let e=JSON.parse(t);return import.meta.env.DEV?O(e):e}var q=Symbol("valaxy:config"),b=V(T(D));import.meta.hot&&import.meta.hot.accept("/@valaxyjs/config",t=>{b.value=T(t.default)});function Pt(){return C(()=>b.value)}function y(){let t=U(q);if(!t)throw new Error("[Valaxy] config not properly injected in qpp");return t}function P(){let t=y();return C(()=>t.value.themeConfig)}n();n();import{unref as B}from"vue";n();import{computed as m}from"vue";import{useRoute as N,useRouter as L}from"vue-router";import{useI18n as W}from"vue-i18n";n();n();function jt(t,e){return Math.random()*(e-t)+t}function I(t,e){let o=document.createElement("div");o.className=e,t.parentNode.insertBefore(o,t),t.parentNode.removeChild(t),o.appendChild(t)}var Et=(t=document)=>{t.querySelectorAll("table").forEach(e=>{let o=document.createElement("div");o.className="table-container",I(e,"table-container")})};n();import z from"dayjs";function kt(t,e="YYYY-MM-DD"){return z(t).format(e)}function x(t,e=!0){return t.sort((o,s)=>{let i=+new Date(o.date||""),r=+new Date(s.date||"");return e?r-i:i-r})}var zt=t=>{let{locale:e}=W();return m(()=>{let o=e.value==="zh-CN"?"zh":e.value;return t.value[`title_${o}`]||t.value.title})};function g(t={}){let e=L();return m(()=>{let o=e.getRoutes().filter(r=>r.path.startsWith("/posts")&&r.meta.frontmatter&&r.meta.frontmatter.date).filter(r=>!r.path.endsWith(".html")).filter(r=>!t.type||r.meta.frontmatter.type===t.type).map(r=>Object.assign({path:r.path,excerpt:r.meta.excerpt},r.meta.frontmatter)),s=x(o.filter(r=>r.top)).sort((r,l)=>l.top-r.top),i=x(o.filter(r=>!r.top));return s.concat(i)})}function Nt(){let t=L();return m(()=>t.getRoutes().map(o=>Object.assign({path:o.path,excerpt:o.meta.excerpt},o.meta.frontmatter)))}function Wt(t){let e=N(),o=m(()=>t||e.path),s=g(),i=m(()=>{let a=-1;return s.value.find((c,p)=>c.path===o.value?(a=p,!0):!1),a}),r=m(()=>i.value-1>=0?s.value[i.value-1]:null),l=m(()=>i.value+1<s.value.length?s.value[i.value+1]:null);return[r,l]}function Bt(t){if(!t)return{color:"",icon:"",styles:{}};let e=P();t in e.value.types||(t="link");let o=e.value.types[t].color,s=e.value.types[t].icon,i=m(()=>({"--card-c-primary":t&&o}));return{color:o,icon:s,styles:i}}function Ft(t,e=[]){var i;e.length||(e=B(g()));let o={total:e.length,children:new Map([["Uncategorized",{total:0,posts:[]}]])},s=o.children.get("Uncategorized");if(e.forEach(r=>{if(r.categories)if(Array.isArray(r.categories)){let l=r.categories.length,a=o;r.categories.forEach((c,p)=>{var f,h,d;if(p===l-1)if(a.children.has(c)){let u=a.children.get(c);u.posts&&(u.total+=1,u.posts.push(r))}else(f=a.children)==null||f.set(c,{total:1,posts:[r]});else if((h=a.children)!=null&&h.has(c)){let u=a.children.get(c);u.total+=1,a=u}else{let u={total:1,children:new Map};(d=a.children)==null||d.set(c,u),a=u}})}else{let l=r.categories;if(o.children.has(l)){let a=o.children.get(l);a.total+=1,a.posts.push(r)}else o.children.set(l,{total:1,posts:[r]})}else s.total+=1,s.posts.push(r)}),s.total===0&&((i=o.children)==null||i.delete("Uncategorized")),t){let r=o.children.get(t);return r?{total:r==null?void 0:r.total,children:new Map([[t,r]])}:(console.warn(`Do not have category: ${t}`),o)}else return o}n();import{TinyColor as j}from"@ctrl/tinycolor";function Qt(t={primary:"#0078E7"}){let e=Y(),o=new j("#999999"),s=new j(t.primary);return{tags:e,getTagStyle:r=>{let l=Array.from(e).map(([h,d])=>d.count),a=Math.max(...l),c=Math.min(...l),p=a-c,f=(r-c)/p;return{"--yun-tag-color":o.mix(s,f*100).toString(),fontSize:`${f*36+12}px`}}}}function Y(){let t=g(),e=new Map;return t.value.forEach(o=>{if(o.tags){let s;typeof o.tags=="string"?s=[o.tags]:s=o.tags,s.forEach(i=>{if(e.has(i)){let r=e.get(i);e.set(i,w(v({},r),{count:r.count+1}))}else e.set(i,{count:1})})}}),e}n();import{useRoute as E}from"vue-router";import{computed as A}from"vue";import{isClient as $}from"@vueuse/core";function re(){let t=E();return A(()=>t.meta.frontmatter)}function ne(){let t=y(),e=E();return A(()=>((t.value.url.endsWith("/")?t.value.url.slice(0,-1):t.value.url)||$&&window.location.origin)+e.path)}n();n();import{useHead as K}from"@vueuse/head";function ae(){K({link:[{rel:"stylesheet",href:"https://cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.css"}]})}n();import{useElementBounding as F,useIntersectionObserver as _}from"@vueuse/core";import{ref as J}from"vue";function fe(t){let e=J(!1),{top:o}=F(t);return _(t,([{isIntersecting:i}])=>{e.value=i}),{show:()=>{e.value||window.scrollTo(0,o.value)}}}n();import{useDark as G,useToggle as Q}from"@vueuse/core";var X=G(),ge=Q(X);n();import{computed as Z}from"vue";import{useRoute as tt}from"vue-router";function we(t){let e=tt();return Z(()=>e.meta.layout===t)}n();n();import{useScriptTag as M}from"@vueuse/core";import{useHead as et}from"@vueuse/head";function Pe(){et({link:[{rel:"stylesheet",href:"https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css"}]}),M("https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js",()=>{M("https://cdn.jsdelivr.net/npm/meting@2/dist/Meting.min.js")})}n();import{isClient as ot,useWindowScroll as rt}from"@vueuse/core";import{computed as k,ref as S}from"vue";function Ae(t={offset:100}){if(!ot)return{percentage:S(0),show:S(!1)};let{y:e}=rt(),o=k(()=>e.value/(document.body.scrollHeight-window.innerHeight)),s=k(()=>e.value>t.offset);return{percentage:o,show:s}}n();import{useHead as nt}from"@vueuse/head";function Se(){nt({script:[{src:"https://static.codepen.io/assets/embed/ei.js",async:!0}]})}n();import{onMounted as st,onUnmounted as it,onUpdated as at}from"vue";function qe(){let t=null,e=null,o=mt(s,200);function s(){let l=lt(),a=ct(l);for(let c=0;c<a.length;c++){let p=a[c],f=a[c+1],[h,d]=ut(c,p,f);if(h){history.replaceState(null,document.title,d||" "),i(d);return}}}function i(l){if(r(e),r(t),e=document.querySelector(`.va-toc a[href="${l}"]`),!e)return;e.classList.add("active");let a=e.closest(".right-sidebar-container > ul > li");a&&a!==e.parentElement?(t=a.querySelector("a"),t&&t.classList.add("active")):t=null}function r(l){l&&l.classList.remove("active")}st(()=>{s(),window.addEventListener("scroll",o)}),at(()=>{i(decodeURIComponent(location.hash))}),it(()=>{window.removeEventListener("scroll",o)})}function lt(){return[].slice.call(document.querySelectorAll(".va-toc a.toc-link-item"))}function ct(t){return[].slice.call(document.querySelectorAll(".header-anchor")).filter(e=>t.some(o=>o.hash===e.hash))}function H(t){return t.parentElement.offsetTop-50}function ut(t,e,o){let s=window.scrollY;return t===0&&s===0?[!0,null]:s<H(e)?[!1,null]:!o||s<H(o)?[!0,decodeURIComponent(e.hash)]:[!1,null]}function mt(t,e){let o,s=!1;return()=>{o&&clearTimeout(o),s?o=setTimeout(t,e):(t(),s=!0,setTimeout(()=>{s=!1},e))}}n();n();import{isClient as pt,useScriptTag as ft}from"@vueuse/core";import{useI18n as dt}from"vue-i18n";import{useRoute as ht}from"vue-router";function Be(t={}){let e=ht(),{locale:o}=dt(),s;function i(r={}){if(!pt)return;let l={el:".comment #tcomment",lang:o.value,path:e.path},a=Object.assign(l,r);return window.twikoo.init(a)}ft("//cdn.jsdelivr.net/npm/twikoo@1.5.1/dist/twikoo.all.min.js",()=>{s=i(t)}),console.log(s)}n();import{isClient as gt,useScriptTag as yt}from"@vueuse/core";import{onUnmounted as xt,watch as R}from"vue";import{useI18n as vt}from"vue-i18n";import{useRoute as wt}from"vue-router";function Je(t={}){let e=wt(),{locale:o}=vt(),s;function i(r={}){if(!gt)return;let l={el:".comment #waline",lang:o.value,dark:"html.dark",emoji:["https://cdn.jsdelivr.net/gh/walinejs/emojis@1.0.0/bilibili","https://cdn.jsdelivr.net/gh/walinejs/emojis@1.0.0/qq","https://cdn.jsdelivr.net/gh/walinejs/emojis@1.0.0/weibo"],path:e.path},a=Object.assign(l,r);return window.Waline(a)}yt("//cdn.jsdelivr.net/npm/@waline/client",()=>{s=i(t)}),R(()=>e.path,r=>{!s||s.update({path:r})}),R(o,r=>{!s||s.update({lang:r})}),xt(()=>{!s||s.destroy()})}export{Ct as defaultValaxyConfig,kt as formatDate,Pt as initConfig,X as isDark,jt as random,x as sortByDate,ge as toggleDark,qe as useActiveSidebarLinks,Pe as useAplayer,Ae as useBackToTop,Ft as useCategory,Se as useCodePen,y as useConfig,re as useFrontmatter,ne as useFullUrl,fe as useInvisibleElement,ae as useKatex,we as useLayout,Nt as usePageList,g as usePostList,Bt as usePostProperty,zt as usePostTitle,Wt as usePrevNext,Y as useTag,Qt as useTags,P as useThemeConfig,Be as useTwikoo,Je as useWaline,b as valaxyConfigRef,q as valaxyConfigSymbol,I as wrap,Et as wrapTable};
|