valaxy 0.2.3 → 0.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/dist/{chunk-2K6ROMWQ.mjs → chunk-F4NM2FOU.mjs} +43 -43
- package/dist/{chunk-NBGVYWSW.js → chunk-PQWGL22E.js} +42 -42
- package/dist/{chunk-U4ZDCBEC.mjs → chunk-R2IXLA5A.mjs} +1 -1
- package/dist/{chunk-TSLYS2VY.js → chunk-WNLPZSAR.js} +1 -1
- package/dist/{config-24b4f209.d.ts → config-408070e9.d.ts} +8 -1
- package/dist/index.d.ts +23 -9
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/node/cli.js +8 -8
- package/dist/node/cli.mjs +8 -8
- 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 +26 -27
- package/src/client/App.vue +5 -2
- package/src/client/components/AppLink.vue +1 -1
- package/src/client/components/PostCard.vue +2 -2
- package/src/client/components/ValaxyCopyright.vue +2 -2
- package/src/client/components/ValaxyFooter.vue +1 -2
- package/src/client/components/ValaxyMd.vue +1 -1
- package/src/client/components/ValaxyOverlay.vue +1 -1
- package/src/client/components/ValaxyPagination.vue +2 -2
- package/src/client/components/ValaxyRightSidebar.vue +44 -3
- package/src/client/components/ValaxySidebar.vue +1 -1
- package/src/client/components/ValaxyToc.vue +30 -8
- package/src/client/composables/category.ts +7 -3
- package/src/client/composables/comments/twikoo.ts +4 -9
- package/src/client/composables/comments/waline.ts +11 -2
- package/src/client/composables/sidebar.ts +29 -44
- package/src/client/locales/zh-CN.yml +1 -1
- package/src/client/modules/pwa.ts +1 -1
- package/src/client/pages/[...all].vue +0 -0
- package/src/client/stores/app.ts +5 -0
- package/src/client/styles/common/custom-blocks.scss +2 -2
- package/src/client/styles/common/sidebar.scss +3 -1
- package/src/client/styles/global/i18n.scss +29 -1
- package/src/client/styles/global/reset.scss +1 -1
- package/src/node/cli.ts +3 -3
- package/src/node/config.ts +9 -0
- package/src/node/markdown/headings.ts +7 -1
- package/src/node/markdown/index.ts +6 -1
- package/src/node/markdown/markdown-it-katex.ts +4 -4
- package/src/node/plugins/index.ts +1 -1
- package/src/node/plugins/markdown.ts +1 -0
- package/src/node/plugins/preset.ts +1 -1
- package/src/node/plugins/unocss.ts +8 -7
- package/src/node/utils/cli.ts +1 -1
- package/src/node/vite.ts +2 -0
- package/src/types/config.ts +16 -4
- package/src/types/posts.ts +5 -0
- package/src/client/public/_headers +0 -3
- package/src/client/public/favicon.svg +0 -21
- package/src/client/public/pwa-192x192.png +0 -0
- package/src/client/public/pwa-512x512.png +0 -0
- package/src/client/public/safari-pinned-tab.svg +0 -41
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var m=Object.create;var a=Object.defineProperty,p=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)=>p(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?m(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",description:"A blog generated by Valaxy.",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:[],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:{pkg:{name:"",version:""}},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};
|
|
@@ -1 +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},
|
|
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},k= exports.b =(e,n)=>p(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=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",description:"A blog generated by Valaxy.",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:[],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:{pkg:{name:"",version:""}},unocss:{},markdown:{excerpt:"<!-- more -->"},markdownIt:{toc:{includeLevel:[1,2,3,4],listType:"ol"},katex:{}}};o();o();exports.a = x; exports.b = k; exports.c = w; exports.d = v; exports.e = C; exports.f = o; exports.g = Y;
|
|
@@ -127,7 +127,14 @@ interface ValaxyConfig<T = ValaxyThemeConfig> {
|
|
|
127
127
|
* The config of theme
|
|
128
128
|
* @description 主题配置
|
|
129
129
|
*/
|
|
130
|
-
themeConfig: T
|
|
130
|
+
themeConfig: T & {
|
|
131
|
+
pkg: {
|
|
132
|
+
name: string;
|
|
133
|
+
version: string;
|
|
134
|
+
homepage?: string;
|
|
135
|
+
[key: string]: any;
|
|
136
|
+
};
|
|
137
|
+
};
|
|
131
138
|
/**
|
|
132
139
|
* Unocss Config
|
|
133
140
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as vue from 'vue';
|
|
2
2
|
import { InjectionKey, ComputedRef, Ref, StyleValue } from 'vue';
|
|
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-
|
|
3
|
+
import { V as ValaxyConfig, a as ValaxyThemeConfig } from './config-408070e9.js';
|
|
4
|
+
export { S as SocialLink, U as UserConfig, V as ValaxyConfig, a as ValaxyThemeConfig, d as defaultValaxyConfig } from './config-408070e9.js';
|
|
5
5
|
import 'type-fest';
|
|
6
6
|
import 'unocss/vite';
|
|
7
7
|
import 'markdown-it';
|
|
@@ -113,6 +113,11 @@ interface Post extends Record<string, any> {
|
|
|
113
113
|
* @description 是否为草稿
|
|
114
114
|
*/
|
|
115
115
|
draft?: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* enable markdown-body class
|
|
118
|
+
* @description 是否启用默认的 markdown 样式
|
|
119
|
+
*/
|
|
120
|
+
markdown: boolean;
|
|
116
121
|
}
|
|
117
122
|
|
|
118
123
|
/**
|
|
@@ -227,18 +232,27 @@ declare function useConfig(): ComputedRef<ValaxyConfig<ThemeConfig>>;
|
|
|
227
232
|
* getThemeConfig
|
|
228
233
|
* @returns
|
|
229
234
|
*/
|
|
230
|
-
declare function useThemeConfig(): ComputedRef<ThemeConfig
|
|
235
|
+
declare function useThemeConfig(): ComputedRef<ThemeConfig & {
|
|
236
|
+
pkg: {
|
|
237
|
+
[key: string]: any;
|
|
238
|
+
name: string;
|
|
239
|
+
version: string;
|
|
240
|
+
homepage?: string | undefined;
|
|
241
|
+
};
|
|
242
|
+
}>;
|
|
231
243
|
|
|
232
|
-
interface
|
|
244
|
+
interface BaseCategory {
|
|
233
245
|
total: number;
|
|
246
|
+
}
|
|
247
|
+
interface ParentCategory extends BaseCategory {
|
|
234
248
|
children: Categories;
|
|
235
249
|
}
|
|
236
|
-
interface PostCategory {
|
|
237
|
-
total: number;
|
|
250
|
+
interface PostCategory extends BaseCategory {
|
|
238
251
|
posts: Post[];
|
|
239
252
|
}
|
|
240
253
|
declare type Category = ParentCategory | PostCategory;
|
|
241
254
|
declare type Categories = Map<string, Category>;
|
|
255
|
+
declare const isParentCategory: (category: any) => category is ParentCategory;
|
|
242
256
|
/**
|
|
243
257
|
* get categories from posts
|
|
244
258
|
* @returns
|
|
@@ -352,11 +366,11 @@ declare function useBackToTop(options?: {
|
|
|
352
366
|
|
|
353
367
|
declare function useCodePen(): void;
|
|
354
368
|
|
|
355
|
-
declare function useActiveSidebarLinks(): void;
|
|
369
|
+
declare function useActiveSidebarLinks(container: Ref<HTMLElement>, marker: Ref<HTMLElement>): void;
|
|
356
370
|
|
|
357
371
|
declare function useTwikoo(options?: {}): void;
|
|
358
372
|
|
|
359
|
-
declare function useWaline(options?: {}):
|
|
373
|
+
declare function useWaline(options?: {}): any;
|
|
360
374
|
|
|
361
375
|
/**
|
|
362
376
|
* 生成介于 min 与 max 之间的随机数
|
|
@@ -387,4 +401,4 @@ declare function formatDate(date: string | number | Date, template?: string): st
|
|
|
387
401
|
*/
|
|
388
402
|
declare function sortByDate(posts: Post[], desc?: boolean): Post[];
|
|
389
403
|
|
|
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 };
|
|
404
|
+
export { BaseCategory, Categories, Category, ParentCategory, Post, PostCategory, Tags, formatDate, initConfig, isDark, isParentCategory, 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 _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;
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkWNLPZSARjs = require('./chunk-WNLPZSAR.js');_chunkWNLPZSARjs.f.call(void 0, );_chunkWNLPZSARjs.f.call(void 0, );_chunkWNLPZSARjs.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"),P= exports.valaxyConfigRef =_vue.shallowRef.call(void 0, T(_config2.default));import.meta.hot&&import.meta.hot.accept("/@valaxyjs/config",t=>{P.value=T(t.default)});function Tt(){return _vue.computed.call(void 0, ()=>P.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 b(){let t=y();return _vue.computed.call(void 0, ()=>t.value.themeConfig)}_chunkWNLPZSARjs.f.call(void 0, );_chunkWNLPZSARjs.f.call(void 0, );_chunkWNLPZSARjs.f.call(void 0, );var _vuerouter = require('vue-router');var _vuei18n = require('vue-i18n');_chunkWNLPZSARjs.f.call(void 0, );_chunkWNLPZSARjs.f.call(void 0, );function bt(t,e){return Math.random()*(e-t)+t}function B(t,e){let o=document.createElement("div");o.className=e,t.parentNode.insertBefore(o,t),t.parentNode.removeChild(t),o.appendChild(t)}var jt=(t=document)=>{t.querySelectorAll("table").forEach(e=>{let o=document.createElement("div");o.className="table-container",B(e,"table-container")})};_chunkWNLPZSARjs.f.call(void 0, );var _dayjs = require('dayjs'); var _dayjs2 = _interopRequireDefault(_dayjs);function Mt(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 qt=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,c)=>c.top-r.top),i=x(o.filter(r=>!r.top));return s.concat(i)})}function Bt(){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 zt(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((l,u)=>l.path===o.value?(a=u,!0):!1),a}),r=_vue.computed.call(void 0, ()=>i.value-1>=0?s.value[i.value-1]:null),c=_vue.computed.call(void 0, ()=>i.value+1<s.value.length?s.value[i.value+1]:null);return[r,c]}function It(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}}var $t=t=>t.children;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 c=r.categories.length,a=o;r.categories.forEach((l,u)=>{var p,h,d;if(u===c-1)if(a.children.has(l)){let m=a.children.get(l);m.posts&&(m.total+=1,m.posts.push(r))}else(p=a.children)==null||p.set(l,{total:1,posts:[r]});else if((h=a.children)!=null&&h.has(l)){let m=a.children.get(l);m.total+=1,a=m}else{let m={total:1,children:new Map};(d=a.children)==null||d.set(l,m),a=m}})}else{let c=r.categories;if(o.children.has(c)){let a=o.children.get(c);a.total+=1,a.posts.push(r)}else o.children.set(c,{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}_chunkWNLPZSARjs.f.call(void 0, );var _tinycolor = require('@ctrl/tinycolor');function Gt(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 c=Array.from(e).map(([h,d])=>d.count),a=Math.max(...c),l=Math.min(...c),u=a-l,p=(r-l)/u;return{"--yun-tag-color":o.mix(s,p*100).toString(),fontSize:`${p*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,_chunkWNLPZSARjs.b.call(void 0, _chunkWNLPZSARjs.a.call(void 0, {},r),{count:r.count+1}))}else e.set(i,{count:1})})}}),e}_chunkWNLPZSARjs.f.call(void 0, );var _core = require('@vueuse/core');function oe(){let t=_vuerouter.useRoute.call(void 0, );return _vue.computed.call(void 0, ()=>t.meta.frontmatter)}function re(){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)}_chunkWNLPZSARjs.f.call(void 0, );_chunkWNLPZSARjs.f.call(void 0, );var _head = require('@vueuse/head');function ie(){_head.useHead.call(void 0, {link:[{rel:"stylesheet",href:"https://cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.css"}]})}_chunkWNLPZSARjs.f.call(void 0, );function pe(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)}}}_chunkWNLPZSARjs.f.call(void 0, );var X=_core.useDark.call(void 0, ),he= exports.toggleDark =_core.useToggle.call(void 0, X);_chunkWNLPZSARjs.f.call(void 0, );function ve(t){let e=_vuerouter.useRoute.call(void 0, );return _vue.computed.call(void 0, ()=>e.meta.layout===t)}_chunkWNLPZSARjs.f.call(void 0, );_chunkWNLPZSARjs.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")})}_chunkWNLPZSARjs.f.call(void 0, );function Ee(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}}_chunkWNLPZSARjs.f.call(void 0, );function ke(){_head.useHead.call(void 0, {script:[{src:"https://static.codepen.io/assets/embed/ei.js",async:!0}]})}_chunkWNLPZSARjs.f.call(void 0, );function Ue(t,e){let o=lt(s,200);function s(){let a=[].slice.call(document.querySelectorAll(".va-toc a.toc-link-item")),l=[].slice.call(document.querySelectorAll("main .header-anchor")).filter(u=>a.some(p=>p.hash===u.hash));for(let u=0;u<l.length;u++){let p=l[u],h=l[u+1],[d,m]=at(u,p,h);if(d){history.replaceState(null,document.title,m||" "),r(m);return}}}let i=null;function r(a){c(i);let l=i=a==null?null:t.value.querySelector(`.va-toc a[href="${a}"]`);l?(l.classList.add("active"),e.value.style.opacity="1",e.value.style.top=`${l.offsetTop+2}px`):(e.value.style.opacity="0",e.value.style.top="54px")}function c(a){a&&a.classList.remove("active")}_vue.onMounted.call(void 0, ()=>{requestAnimationFrame(s),window.addEventListener("scroll",o)}),_vue.onUnmounted.call(void 0, ()=>{window.removeEventListener("scroll",o)})}function R(t){return t.parentElement.offsetTop-50}function at(t,e,o){let s=window.scrollY;return t===0&&s===0?[!0,null]:s<R(e)?[!1,null]:!o||s<R(o)?[!0,decodeURIComponent(e.hash)]:[!1,null]}function lt(t,e){let o,s=!1;return()=>{o&&clearTimeout(o),s?o=setTimeout(t,e):(t(),s=!0,setTimeout(()=>{s=!1},e))}}_chunkWNLPZSARjs.f.call(void 0, );_chunkWNLPZSARjs.f.call(void 0, );function Ne(t={}){let e=_vuerouter.useRoute.call(void 0, ),{locale:o}=_vuei18n.useI18n.call(void 0, );function s(i={}){if(!_core.isClient)return;let r={el:".comment #tcomment",lang:o.value,path:e.path},c=Object.assign(r,i);return window.twikoo.init(c)}_core.useScriptTag.call(void 0, "//cdn.jsdelivr.net/npm/twikoo@1.5.1/dist/twikoo.all.min.js",()=>{s(t)})}_chunkWNLPZSARjs.f.call(void 0, );function Je(t={}){_head.useHead.call(void 0, {link:[{rel:"stylesheet",href:"https://cdn.jsdelivr.net/npm/@waline/client/dist/waline.css"}]});let e=_vuerouter.useRoute.call(void 0, ),{locale:o}=_vuei18n.useI18n.call(void 0, ),s;function i(r={}){if(!_core.isClient)return;let c={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(c,r);return window.Waline.init(a)}return _core.useScriptTag.call(void 0, "//cdn.jsdelivr.net/npm/@waline/client/dist/waline.js",()=>{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()}),s}exports.defaultValaxyConfig = _chunkWNLPZSARjs.g; exports.formatDate = Mt; exports.initConfig = Tt; exports.isDark = X; exports.isParentCategory = $t; exports.random = bt; exports.sortByDate = x; exports.toggleDark = he; exports.useActiveSidebarLinks = Ue; exports.useAplayer = Pe; exports.useBackToTop = Ee; exports.useCategory = Ft; exports.useCodePen = ke; exports.useConfig = y; exports.useFrontmatter = oe; exports.useFullUrl = re; exports.useInvisibleElement = pe; exports.useKatex = ie; exports.useLayout = ve; exports.usePageList = Bt; exports.usePostList = g; exports.usePostProperty = It; exports.usePostTitle = qt; exports.usePrevNext = zt; exports.useTag = Y; exports.useTags = Gt; exports.useThemeConfig = b; exports.useTwikoo = Ne; exports.useWaline = Je; exports.valaxyConfigRef = P; exports.valaxyConfigSymbol = q; exports.wrap = B; exports.wrapTable = jt;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as v,b as w,f as n,g as
|
|
1
|
+
import{a as v,b as w,f as n,g as vt}from"./chunk-R2IXLA5A.mjs";n();n();n();import D from"@valaxyjs/config";import{computed as C,inject as O,readonly as V,shallowRef as U}from"vue";function T(t){let e=JSON.parse(t);return import.meta.env.DEV?V(e):e}var q=Symbol("valaxy:config"),P=U(T(D));import.meta.hot&&import.meta.hot.accept("/@valaxyjs/config",t=>{P.value=T(t.default)});function Tt(){return C(()=>P.value)}function y(){let t=O(q);if(!t)throw new Error("[Valaxy] config not properly injected in qpp");return t}function b(){let t=y();return C(()=>t.value.themeConfig)}n();n();import{unref as W}from"vue";n();import{computed as f}from"vue";import{useRoute as I,useRouter as j}from"vue-router";import{useI18n as N}from"vue-i18n";n();n();function bt(t,e){return Math.random()*(e-t)+t}function B(t,e){let o=document.createElement("div");o.className=e,t.parentNode.insertBefore(o,t),t.parentNode.removeChild(t),o.appendChild(t)}var jt=(t=document)=>{t.querySelectorAll("table").forEach(e=>{let o=document.createElement("div");o.className="table-container",B(e,"table-container")})};n();import z from"dayjs";function Mt(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 qt=t=>{let{locale:e}=N();return f(()=>{let o=e.value==="zh-CN"?"zh":e.value;return t.value[`title_${o}`]||t.value.title})};function g(t={}){let e=j();return f(()=>{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,c)=>c.top-r.top),i=x(o.filter(r=>!r.top));return s.concat(i)})}function Bt(){let t=j();return f(()=>t.getRoutes().map(o=>Object.assign({path:o.path,excerpt:o.meta.excerpt},o.meta.frontmatter)))}function zt(t){let e=I(),o=f(()=>t||e.path),s=g(),i=f(()=>{let a=-1;return s.value.find((l,u)=>l.path===o.value?(a=u,!0):!1),a}),r=f(()=>i.value-1>=0?s.value[i.value-1]:null),c=f(()=>i.value+1<s.value.length?s.value[i.value+1]:null);return[r,c]}function It(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=f(()=>({"--card-c-primary":t&&o}));return{color:o,icon:s,styles:i}}var $t=t=>t.children;function Ft(t,e=[]){var i;e.length||(e=W(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 c=r.categories.length,a=o;r.categories.forEach((l,u)=>{var p,h,d;if(u===c-1)if(a.children.has(l)){let m=a.children.get(l);m.posts&&(m.total+=1,m.posts.push(r))}else(p=a.children)==null||p.set(l,{total:1,posts:[r]});else if((h=a.children)!=null&&h.has(l)){let m=a.children.get(l);m.total+=1,a=m}else{let m={total:1,children:new Map};(d=a.children)==null||d.set(l,m),a=m}})}else{let c=r.categories;if(o.children.has(c)){let a=o.children.get(c);a.total+=1,a.posts.push(r)}else o.children.set(c,{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 L}from"@ctrl/tinycolor";function Gt(t={primary:"#0078E7"}){let e=Y(),o=new L("#999999"),s=new L(t.primary);return{tags:e,getTagStyle:r=>{let c=Array.from(e).map(([h,d])=>d.count),a=Math.max(...c),l=Math.min(...c),u=a-l,p=(r-l)/u;return{"--yun-tag-color":o.mix(s,p*100).toString(),fontSize:`${p*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 M}from"vue";import{isClient as $}from"@vueuse/core";function oe(){let t=E();return M(()=>t.meta.frontmatter)}function re(){let t=y(),e=E();return M(()=>((t.value.url.endsWith("/")?t.value.url.slice(0,-1):t.value.url)||$&&window.location.origin)+e.path)}n();n();import{useHead as F}from"@vueuse/head";function ie(){F({link:[{rel:"stylesheet",href:"https://cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.css"}]})}n();import{useElementBounding as K,useIntersectionObserver as _}from"@vueuse/core";import{ref as J}from"vue";function pe(t){let e=J(!1),{top:o}=K(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(),he=Q(X);n();import{computed as Z}from"vue";import{useRoute as tt}from"vue-router";function ve(t){let e=tt();return Z(()=>e.meta.layout===t)}n();n();import{useScriptTag as A}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"}]}),A("https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js",()=>{A("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 H}from"vue";function Ee(t={offset:100}){if(!ot)return{percentage:H(0),show:H(!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 ke(){nt({script:[{src:"https://static.codepen.io/assets/embed/ei.js",async:!0}]})}n();import{onMounted as st,onUnmounted as it}from"vue";function Ue(t,e){let o=lt(s,200);function s(){let a=[].slice.call(document.querySelectorAll(".va-toc a.toc-link-item")),l=[].slice.call(document.querySelectorAll("main .header-anchor")).filter(u=>a.some(p=>p.hash===u.hash));for(let u=0;u<l.length;u++){let p=l[u],h=l[u+1],[d,m]=at(u,p,h);if(d){history.replaceState(null,document.title,m||" "),r(m);return}}}let i=null;function r(a){c(i);let l=i=a==null?null:t.value.querySelector(`.va-toc a[href="${a}"]`);l?(l.classList.add("active"),e.value.style.opacity="1",e.value.style.top=`${l.offsetTop+2}px`):(e.value.style.opacity="0",e.value.style.top="54px")}function c(a){a&&a.classList.remove("active")}st(()=>{requestAnimationFrame(s),window.addEventListener("scroll",o)}),it(()=>{window.removeEventListener("scroll",o)})}function R(t){return t.parentElement.offsetTop-50}function at(t,e,o){let s=window.scrollY;return t===0&&s===0?[!0,null]:s<R(e)?[!1,null]:!o||s<R(o)?[!0,decodeURIComponent(e.hash)]:[!1,null]}function lt(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 ct,useScriptTag as ut}from"@vueuse/core";import{useI18n as mt}from"vue-i18n";import{useRoute as pt}from"vue-router";function Ne(t={}){let e=pt(),{locale:o}=mt();function s(i={}){if(!ct)return;let r={el:".comment #tcomment",lang:o.value,path:e.path},c=Object.assign(r,i);return window.twikoo.init(c)}ut("//cdn.jsdelivr.net/npm/twikoo@1.5.1/dist/twikoo.all.min.js",()=>{s(t)})}n();import{isClient as ft,useScriptTag as dt}from"@vueuse/core";import{useHead as ht}from"@vueuse/head";import{onUnmounted as gt,watch as S}from"vue";import{useI18n as yt}from"vue-i18n";import{useRoute as xt}from"vue-router";function Je(t={}){ht({link:[{rel:"stylesheet",href:"https://cdn.jsdelivr.net/npm/@waline/client/dist/waline.css"}]});let e=xt(),{locale:o}=yt(),s;function i(r={}){if(!ft)return;let c={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(c,r);return window.Waline.init(a)}return dt("//cdn.jsdelivr.net/npm/@waline/client/dist/waline.js",()=>{s=i(t)}),S(()=>e.path,r=>{!s||s.update({path:r})}),S(o,r=>{!s||s.update({lang:r})}),gt(()=>{!s||s.destroy()}),s}export{vt as defaultValaxyConfig,Mt as formatDate,Tt as initConfig,X as isDark,$t as isParentCategory,bt as random,x as sortByDate,he as toggleDark,Ue as useActiveSidebarLinks,Pe as useAplayer,Ee as useBackToTop,Ft as useCategory,ke as useCodePen,y as useConfig,oe as useFrontmatter,re as useFullUrl,pe as useInvisibleElement,ie as useKatex,ve as useLayout,Bt as usePageList,g as usePostList,It as usePostProperty,qt as usePostTitle,zt as usePrevNext,Y as useTag,Gt as useTags,b as useThemeConfig,Ne as useTwikoo,Je as useWaline,P as valaxyConfigRef,q as valaxyConfigSymbol,B as wrap,jt as wrapTable};
|