valaxy 0.3.11 → 0.6.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.
- package/README.md +0 -4
- package/{src/client → client}/App.vue +0 -0
- package/{src/client/composables/search/index.ts → client/app/data.ts} +0 -0
- package/{src/client → client}/components/AppLink.vue +0 -0
- package/client/components/PostCard.vue +84 -0
- package/{src/client → client}/components/PostList.vue +0 -0
- package/{src/client → client}/components/README.md +0 -0
- package/{src/client → client}/components/ValaxyBg.vue +0 -0
- package/{src/client → client}/components/ValaxyCopyright.vue +0 -0
- package/{src/client → client}/components/ValaxyFooter.vue +1 -1
- package/{src/client → client}/components/ValaxyHamburger.vue +0 -0
- package/{src/client → client}/components/ValaxyMd.vue +1 -5
- package/{src/client → client}/components/ValaxyOverlay.vue +0 -0
- package/{src/client → client}/components/ValaxyPagination.vue +0 -0
- package/{src/client → client}/components/ValaxyRightSidebar.vue +0 -0
- package/{src/client → client}/components/ValaxySidebar.vue +0 -0
- package/{src/client → client}/components/ValaxyToc.vue +3 -3
- package/{src/client → client}/composables/category.ts +0 -0
- package/{src/client → client}/composables/comments/index.ts +0 -0
- package/{src/client → client}/composables/comments/twikoo.ts +0 -0
- package/{src/client → client}/composables/comments/waline.ts +0 -0
- package/{src/client → client}/composables/common.ts +0 -0
- package/{src/client → client}/composables/dark.ts +0 -0
- package/client/composables/features/index.ts +0 -0
- package/{src/client → client}/composables/helper.ts +0 -0
- package/{src/client → client}/composables/index.ts +1 -1
- package/{src/client → client}/composables/layout.ts +0 -0
- package/client/composables/outline.ts +181 -0
- package/{src/client → client}/composables/post.ts +0 -0
- package/client/composables/search/index.ts +0 -0
- package/{src/client → client}/composables/sidebar.ts +68 -9
- package/{src/client → client}/composables/tag.ts +0 -0
- package/{src/client → client}/composables/widgets/aplayer.ts +0 -0
- package/{src/client → client}/composables/widgets/backToTop.ts +0 -0
- package/{src/client → client}/composables/widgets/codepen.ts +0 -0
- package/{src/client → client}/composables/widgets/index.ts +0 -0
- package/client/config.ts +75 -0
- package/{src/client → client}/index.html +0 -0
- package/{src/client → client}/index.ts +0 -0
- package/{src/client → client}/layouts/404.vue +0 -0
- package/{src/client → client}/layouts/README.md +0 -0
- package/{src/client → client}/locales/README.md +0 -0
- package/{src/client → client}/locales/en.yml +1 -0
- package/{src/client → client}/locales/zh-CN.yml +4 -3
- package/{src/client → client}/main.ts +8 -1
- package/{src/client → client}/modules/README.md +0 -0
- package/{src/client → client}/modules/nprogress.ts +0 -0
- package/{src/client → client}/modules/pinia.ts +0 -0
- package/{src/client → client}/modules/valaxy.ts +34 -9
- package/{src/client → client}/pages/README.md +0 -0
- package/{src/client → client}/pages/[...all].vue +0 -0
- package/{src/client → client}/pages/hi/[name].vue +0 -0
- package/{src/client → client}/pages/index.vue +0 -0
- package/{src/client → client}/pages/page/[page].vue +0 -0
- package/{src/client → client}/shims.d.ts +7 -1
- package/{src/client → client}/stores/app.ts +0 -0
- package/{src/client → client}/stores/user.ts +0 -0
- package/{src/client → client}/styles/common/button.scss +0 -0
- package/{src/client → client}/styles/common/code.scss +0 -0
- package/{src/client → client}/styles/common/custom-blocks.scss +0 -0
- package/{src/client → client}/styles/common/hamburger.scss +0 -0
- package/{src/client → client}/styles/common/markdown.scss +5 -1
- package/client/styles/common/scrollbar.scss +28 -0
- package/{src/client → client}/styles/common/sidebar.scss +0 -0
- package/{src/client → client}/styles/common/transition.scss +0 -0
- package/{src/client → client}/styles/css-vars.scss +0 -0
- package/{src/client → client}/styles/global/helper.scss +0 -0
- package/{src/client → client}/styles/global/i18n.scss +0 -0
- package/{src/client → client}/styles/global/index.scss +0 -0
- package/{src/client → client}/styles/global/nprogress.scss +0 -0
- package/{src/client → client}/styles/global/reset.scss +0 -0
- package/{src/client → client}/styles/index.scss +0 -0
- package/{src/client → client}/styles/mixins/config.scss +0 -0
- package/{src/client → client}/styles/mixins/index.scss +0 -0
- package/{src/client → client}/styles/mixins/size.scss +0 -0
- package/{src/client → client}/styles/mixins/variable.scss +0 -0
- package/{src/client → client}/styles/palette.scss +6 -2
- package/client/styles/third/katex.scss +3 -0
- package/{src/client → client}/styles/vars.scss +0 -0
- package/{src/client → client}/styles/widgets/banner.scss +0 -0
- package/{src/client → client}/types.ts +0 -0
- package/{src/client → client}/utils/helper.ts +22 -0
- package/{src/client → client}/utils/index.ts +0 -0
- package/client/utils/sidebar.ts +26 -0
- package/{src/client → client}/utils/time.ts +0 -0
- package/config/index.ts +18 -0
- package/dist/chunk-CP3UCJ2D.js +34 -0
- package/dist/chunk-EAN2KU6W.mjs +1 -0
- package/dist/chunk-HCVZ2UUO.mjs +34 -0
- package/dist/chunk-U5OMNIOK.js +1 -0
- package/dist/{config-de04677b.d.ts → config-ad23e743.d.ts} +28 -14
- package/dist/index.d.ts +67 -111
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/node/cli.js +7 -11
- package/dist/node/cli.mjs +7 -11
- package/dist/node/index.d.ts +2 -2
- package/dist/node/index.js +1 -1
- package/dist/node/index.mjs +1 -1
- package/{src/index.ts → index.ts} +1 -0
- package/{src/node → node}/build.ts +0 -0
- package/{src/node → node}/cli.ts +3 -2
- package/node/config.ts +156 -0
- package/{src/node → node}/index.ts +0 -0
- package/{src/node → node}/markdown/check.ts +0 -0
- package/{src/node → node}/markdown/highlight.ts +0 -0
- package/{src/node → node}/markdown/index.ts +21 -13
- package/{src/node → node}/markdown/markdown-it/container.ts +0 -0
- package/{src/node → node}/markdown/markdown-it/headings.ts +0 -0
- package/{src/node → node}/markdown/markdown-it/highlightLines.ts +0 -0
- package/{src/node → node}/markdown/markdown-it/katex.ts +0 -0
- package/{src/node → node}/markdown/markdown-it/parseHeader.ts +0 -0
- package/node/markdown/markdownToVue.ts +253 -0
- package/{src/node → node}/markdown/slugify.ts +0 -0
- package/{src/node → node}/options.ts +18 -2
- package/{src/node → node}/plugins/extendConfig.ts +6 -3
- package/node/plugins/index.ts +224 -0
- package/{src/node → node}/plugins/preset.ts +6 -36
- package/{src/node → node}/plugins/unocss.ts +0 -0
- package/{src/node → node}/plugins/valaxy.ts +0 -0
- package/{src/node → node}/rss.ts +1 -1
- package/{src/node → node}/server.ts +6 -4
- package/{src/node → node}/shims.d.ts +0 -0
- package/{src/node → node}/utils/cli.ts +1 -1
- package/node/utils/getGitTimestamp.ts +13 -0
- package/node/utils/index.ts +59 -0
- package/node/utils/net.ts +20 -0
- package/{src/node → node}/vite.ts +5 -1
- package/package.json +33 -13
- package/shared/index.ts +1 -0
- package/tsup.config.ts +7 -4
- package/{src/types → types}/config.ts +31 -108
- package/types/data.ts +31 -0
- package/{src/types → types}/index.ts +1 -0
- package/{src/types → types}/posts.ts +6 -1
- package/dist/chunk-6LIOFBAA.mjs +0 -1
- package/dist/chunk-ABPVSNYI.js +0 -83
- package/dist/chunk-QOANGHSR.mjs +0 -83
- package/dist/chunk-V3BMKLEW.js +0 -1
- package/src/client/components/PostCard.vue +0 -68
- package/src/client/composables/features/index.ts +0 -1
- package/src/client/composables/features/katex.ts +0 -15
- package/src/client/composables/search/algolia.ts +0 -115
- package/src/client/config.ts +0 -51
- package/src/client/modules/pwa.ts +0 -12
- package/src/client/styles/common/scrollbar.scss +0 -34
- package/src/node/config.ts +0 -52
- package/src/node/plugins/index.ts +0 -120
- package/src/node/plugins/markdown.ts +0 -57
- package/src/node/utils/index.ts +0 -26
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as w,b}from"./chunk-EAN2KU6W.mjs";import B from"@valaxyjs/config";import q from"@valaxyjs/context";import{computed as x,inject as z,readonly as I,shallowRef as P}from"vue";function h(t){let e=JSON.parse(t);return import.meta.env.DEV?I(e):e}var N=Symbol("valaxy:config"),j=P(h(B)),A=P(h(q));import.meta.hot&&(import.meta.hot.accept("/@valaxyjs/config",t=>{j.value=h(t.default)}),import.meta.hot.accept("/@valaxyjs/context",t=>{A.value=h(t.default)}));function Et(){return x(()=>j.value)}function Mt(){return x(()=>A.value)}function v(){let t=z(N);if(!t)throw new Error("[Valaxy] config not properly injected in app");return t}function y(){let t=v();return x(()=>t.value.themeConfig)}import{unref as J}from"vue";import{computed as f}from"vue";import{useRoute as K,useRouter as L}from"vue-router";import{useI18n as _}from"vue-i18n";function St(t,e){return Math.random()*(e-t)+t}function $(t,e){let o=document.createElement("div");o.className=e,t.parentNode.insertBefore(o,t),t.parentNode.removeChild(t),o.appendChild(t)}var Dt=(t=document)=>{t.querySelectorAll("table").forEach(e=>{let o=document.createElement("div");o.className="table-container",$(e,"table-container")})};function Ht(t,e){let o,n=!1;return()=>{o&&clearTimeout(o),n?o=setTimeout(t,e):(t(),n=!0,setTimeout(()=>{n=!1},e))}}import F from"dayjs";function Ot(t,e="YYYY-MM-DD"){return F(t).format(e)}function C(t,e=!0){return t.sort((o,n)=>{let i=+new Date(o.date||""),r=+new Date(n.date||"");return e?r-i:i-r})}var Ft=t=>{let{locale:e}=_();return f(()=>{let o=e.value==="zh-CN"?"zh":e.value;return t.value[`title_${o}`]||t.value.title})};function g(t={}){let e=L();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)),n=C(o.filter(r=>r.top)).sort((r,a)=>a.top-r.top),i=C(o.filter(r=>!r.top));return n.concat(i)})}function Kt(){let t=L();return f(()=>t.getRoutes().map(o=>Object.assign({path:o.path,excerpt:o.meta.excerpt},o.meta.frontmatter)))}function _t(t){let e=K(),o=f(()=>t||e.path),n=g(),i=f(()=>{let s=-1;return n.value.find((l,u)=>l.path===o.value?(s=u,!0):!1),s}),r=f(()=>i.value-1>=0?n.value[i.value-1]:null),a=f(()=>i.value+1<n.value.length?n.value[i.value+1]:null);return[r,a]}function Jt(t){if(!t)return{color:"",icon:"",styles:{}};let e=y();t in e.value.types||(t="link");let o=e.value.types[t].color,n=e.value.types[t].icon,i=f(()=>({"--card-c-primary":t&&o}));return{color:o,icon:n,styles:i}}var Zt=t=>t.children;function te(t,e=[]){var i;e.length||(e=J(g()));let o={total:e.length,children:new Map([["Uncategorized",{total:0,posts:[]}]])},n=o.children.get("Uncategorized");if(e.forEach(r=>{if(r.categories)if(Array.isArray(r.categories)){let a=r.categories.length,s=o;r.categories.forEach((l,u)=>{var m,d,p;if(u===a-1)if(s.children.has(l)){let c=s.children.get(l);c.posts&&(c.total+=1,c.posts.push(r))}else(m=s.children)==null||m.set(l,{total:1,posts:[r]});else if((d=s.children)!=null&&d.has(l)){let c=s.children.get(l);c.total+=1,s=c}else{let c={total:1,children:new Map};(p=s.children)==null||p.set(l,c),s=c}})}else{let a=r.categories;if(o.children.has(a)){let s=o.children.get(a);s.total+=1,s.posts.push(r)}else o.children.set(a,{total:1,posts:[r]})}else n.total+=1,n.posts.push(r)}),n.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}import{TinyColor as E}from"@ctrl/tinycolor";function ne(t={primary:"#0078E7"}){let e=G(),o=new E("#999999"),n=new E(t.primary);return{tags:e,getTagStyle:r=>{let a=Array.from(e).map(([d,p])=>p.count),s=Math.max(...a),l=Math.min(...a),u=s-l,m=(r-l)/u;return{"--yun-tag-color":o.mix(n,m*100).toString(),fontSize:`${m*36+12}px`}}}}function G(){let t=g(),e=new Map;return t.value.forEach(o=>{if(o.tags){let n;typeof o.tags=="string"?n=[o.tags]:n=o.tags,n.forEach(i=>{if(e.has(i)){let r=e.get(i);e.set(i,b(w({},r),{count:r.count+1}))}else e.set(i,{count:1})})}}),e}import{useRoute as M}from"vue-router";import{computed as R}from"vue";import{isClient as Q}from"@vueuse/core";function S(){let t=M();return R(()=>t.meta.frontmatter)}function ce(){let t=v(),e=M();return R(()=>((t.value.url.endsWith("/")?t.value.url.slice(0,-1):t.value.url)||Q&&window.location.origin)+e.path)}import{useElementBounding as X,useIntersectionObserver as Z}from"@vueuse/core";import{ref as tt}from"vue";function de(t){let e=tt(!1),{top:o}=X(t);return Z(t,([{isIntersecting:i}])=>{e.value=i}),{show:()=>{e.value||window.scrollTo(0,o.value)}}}import{useDark as et,useToggle as ot}from"@vueuse/core";var rt=et(),ye=ot(rt);import{computed as nt}from"vue";import{useRoute as it}from"vue-router";function Te(t){let e=it();return nt(()=>e.meta.layout===t)}import{useScriptTag as D}from"@vueuse/core";import{useHead as st}from"@vueuse/head";function je(){st({link:[{rel:"stylesheet",href:"https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css"}]}),D("https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js",()=>{D("https://cdn.jsdelivr.net/npm/meting@2/dist/Meting.min.js")})}import{isClient as at,useWindowScroll as lt}from"@vueuse/core";import{computed as H,ref as k}from"vue";function Me(t={offset:100}){if(!at)return{percentage:k(0),show:k(!1)};let{y:e}=lt(),o=H(()=>e.value/(document.body.scrollHeight-window.innerHeight)),n=H(()=>e.value>t.offset);return{percentage:o,show:n}}import{useHead as ut}from"@vueuse/head";function De(){ut({script:[{src:"https://static.codepen.io/assets/embed/ei.js",async:!0}]})}import{computed as T,onMounted as ct,onUnmounted as mt,ref as ft}from"vue";import{useRoute as W}from"vue-router";import{ensurePrefix as V}from"@antfu/utils";function O(t,e){if(Array.isArray(t))return t;e=V("/",e);for(let o in t)if(e.startsWith(V("/",o)))return t[o];return[]}function $e(){let t=W(),e=S(),o=y(),n=ft(!1),i=T(()=>{let u=o.value.sidebar,m=t.path;return u?O(u,m):[]}),r=T(()=>e.value.sidebar!==!1);function a(){n.value=!0}function s(){n.value=!1}function l(){n.value?s():a()}return{isOpen:n,sidebar:i,hasSidebar:r,open:a,close:s,toggle:l}}function Fe(t,e){let o=dt(n,200);function n(){let s=[].slice.call(document.querySelectorAll(".va-toc a.toc-link-item")),l=[].slice.call(document.querySelectorAll("main .header-anchor")).filter(u=>s.some(m=>m.hash===u.hash));for(let u=0;u<l.length;u++){let m=l[u],d=l[u+1],[p,c]=pt(u,m,d);if(p){history.replaceState(null,document.title,c||" "),r(c);return}}}let i=null;function r(s){a(i);let l=i=s==null?null:t.value.querySelector(`.va-toc a[href="${s}"]`);e.value&&(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 a(s){s&&s.classList.remove("active")}ct(()=>{requestAnimationFrame(n),window.addEventListener("scroll",o)}),mt(()=>{window.removeEventListener("scroll",o)})}function U(t){return t.parentElement.offsetTop-50}function pt(t,e,o){let n=window.scrollY;return t===0&&n===0?[!0,null]:n<U(e)?[!1,null]:!o||n<U(o)?[!0,decodeURIComponent(e.hash)]:[!1,null]}function dt(t,e){let o,n=!1;return()=>{o&&clearTimeout(o),n?o=setTimeout(t,e):(t(),n=!0,setTimeout(()=>{n=!1},e))}}function Ke(){let t=W();return{hasOutline:T(()=>t.meta.headers.length>0)}}import{isClient as gt,useScriptTag as ht}from"@vueuse/core";import{useI18n as yt}from"vue-i18n";import{useRoute as xt}from"vue-router";function Xe(t={}){let e=xt(),{locale:o}=yt();function n(i={}){if(!gt)return;let r={el:".comment #tcomment",lang:o.value,path:e.path},a=Object.assign(r,i);return window.twikoo.init(a)}ht("//cdn.jsdelivr.net/npm/twikoo@1.5.1/dist/twikoo.all.min.js",()=>{n(t)})}import{isClient as vt,useScriptTag as Ct}from"@vueuse/core";import{useHead as Tt}from"@vueuse/head";import{onUnmounted as wt,watch as Y}from"vue";import{useI18n as bt}from"vue-i18n";import{useRoute as Pt}from"vue-router";function io(t={}){Tt({link:[{rel:"stylesheet",href:"https://cdn.jsdelivr.net/npm/@waline/client/dist/waline.css"}]});let e=Pt(),{locale:o}=bt(),n;function i(r={}){if(!vt)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},s=Object.assign(a,r);return window.Waline.init(s)}return Ct("//cdn.jsdelivr.net/npm/@waline/client/dist/waline.js",()=>{n=i(t)}),Y(()=>e.path,r=>{!n||n.update({path:r})}),Y(o,r=>{!n||n.update({lang:r})}),wt(()=>{!n||n.destroy()}),n}function Mo(t){return t}function Ro(t){return t}export{Mo as defineConfig,Ro as defineConfigWithTheme,Ot as formatDate,Et as initConfig,Mt as initContext,rt as isDark,Zt as isParentCategory,St as random,C as sortByDate,Ht as throttleAndDebounce,ye as toggleDark,Fe as useActiveSidebarLinks,je as useAplayer,Me as useBackToTop,te as useCategory,De as useCodePen,v as useConfig,S as useFrontmatter,ce as useFullUrl,de as useInvisibleElement,Te as useLayout,Ke as useOutline,Kt as usePageList,g as usePostList,Jt as usePostProperty,Ft as usePostTitle,_t as usePrevNext,$e as useSidebar,G as useTag,ne as useTags,y as useThemeConfig,Xe as useTwikoo,io as useWaline,j as valaxyConfigRef,N as valaxyConfigSymbol,A as valaxyContextRef,$ as wrap,Dt as wrapTable};
|