vuepress-plugin-comment2
Advanced tools
Comparing version 2.0.0-alpha.1 to 2.0.0-alpha.2
@@ -1,2 +0,2 @@ | ||
import{usePageFrontmatter as a,useRouteLocale as e,usePageData as n,useSiteData as o,defineClientAppEnhance as t}from"@vuepress/client";import{defineComponent as l,computed as s,h as c,toRef as r,ref as u,onMounted as i,watch as p,inject as v,resolveComponent as m}from"vue";import d from"@Waline";import{IconBase as g,useAuthor as h,useCategory as f,useBlogConfig as y,useDate as I,useThemePluginConfig as w,useTag as b,useIconPrefix as T}from"@mr-hope/vuepress-shared/client";import{useRoute as A,useRouter as z}from"vue-router";import"balloon-css";import"./styles/index.scss";const C=COMMENT_OPTIONS,M=PAGE_INFO_I18N,N=READING_TIME_I18N,V=C,H=Boolean(V&&"waline"===V.type&&V.serverURL);var L=l({name:"Comment",setup(){const e=a(),n=C.type,o=s((()=>"disable"!==C.type&&(e.value.comment||!1!==C.comment&&("waline"===C.type||!1!==e.value.comment))));return()=>"waline"===n?c(d,{style:{display:o.value?"block":"none"}}):null}});const $=()=>c(g,{name:"author"},{default:()=>c("path",{d:"M649.6 633.6c86.4-48 147.2-144 147.2-249.6 0-160-128-288-288-288s-288 128-288 288c0 108.8 57.6 201.6 147.2 249.6-121.6 48-214.4 153.6-240 288-3.2 9.6 0 19.2 6.4 25.6 3.2 9.6 12.8 12.8 22.4 12.8h704c9.6 0 19.2-3.2 25.6-12.8 6.4-6.4 9.6-16 6.4-25.6-25.6-134.4-121.6-240-243.2-288z"})});$.displayName="AuthorIcon";const P=()=>c(g,{name:"calendar"},{default:()=>c("path",{d:"M716.4 110.137c0-18.753-14.72-33.473-33.472-33.473-18.753 0-33.473 14.72-33.473 33.473v33.473h66.993v-33.473zm-334.87 0c0-18.753-14.72-33.473-33.473-33.473s-33.52 14.72-33.52 33.473v33.473h66.993v-33.473zm468.81 33.52H716.4v100.465c0 18.753-14.72 33.473-33.472 33.473a33.145 33.145 0 01-33.473-33.473V143.657H381.53v100.465c0 18.753-14.72 33.473-33.473 33.473a33.145 33.145 0 01-33.473-33.473V143.657H180.6A134.314 134.314 0 0046.66 277.595v535.756A134.314 134.314 0 00180.6 947.289h669.74a134.36 134.36 0 00133.94-133.938V277.595a134.314 134.314 0 00-133.94-133.938zm33.473 267.877H147.126a33.145 33.145 0 01-33.473-33.473c0-18.752 14.72-33.473 33.473-33.473h736.687c18.752 0 33.472 14.72 33.472 33.473a33.145 33.145 0 01-33.472 33.473z"})});P.displayName="CalendarIcon";const E=()=>c(g,{name:"category"},{default:()=>c("path",{d:"M148.41 106.992h282.176c22.263 0 40.31 18.048 40.31 40.31V429.48c0 22.263-18.047 40.31-40.31 40.31H148.41c-22.263 0-40.311-18.047-40.311-40.31V147.302c0-22.263 18.048-40.31 40.311-40.31zM147.556 553.478H429.73c22.263 0 40.311 18.048 40.311 40.31v282.176c0 22.263-18.048 40.312-40.31 40.312H147.555c-22.263 0-40.311-18.049-40.311-40.312V593.79c0-22.263 18.048-40.311 40.31-40.311zM593.927 106.992h282.176c22.263 0 40.31 18.048 40.31 40.31V429.48c0 22.263-18.047 40.31-40.31 40.31H593.927c-22.263 0-40.311-18.047-40.311-40.31V147.302c0-22.263 18.048-40.31 40.31-40.31zM730.22 920.502H623.926c-40.925 0-74.22-33.388-74.22-74.425V623.992c0-41.038 33.387-74.424 74.425-74.424h222.085c41.038 0 74.424 33.226 74.424 74.067v114.233c0 10.244-8.304 18.548-18.547 18.548s-18.548-8.304-18.548-18.548V623.635c0-20.388-16.746-36.974-37.33-36.974H624.13c-20.585 0-37.331 16.747-37.331 37.33v222.086c0 20.585 16.654 37.331 37.126 37.331H730.22c10.243 0 18.547 8.304 18.547 18.547 0 10.244-8.304 18.547-18.547 18.547z"})});E.displayName="CategoryIcon";const R=()=>c(g,{name:"eye"},{default:()=>c("path",{d:"M992 512.096c0-5.76-.992-10.592-1.28-11.136-.192-2.88-1.152-8.064-2.08-10.816-.256-.672-.544-1.376-.832-2.08-.48-1.568-1.024-3.104-1.6-4.32C897.664 290.112 707.104 160 512 160c-195.072 0-385.632 130.016-473.76 322.592-1.056 2.112-1.792 4.096-2.272 5.856a55.512 55.512 0 00-.64 1.6c-1.76 5.088-1.792 8.64-1.632 7.744-.832 3.744-1.568 11.168-1.568 11.168-.224 2.272-.224 4.032.032 6.304 0 0 .736 6.464 1.088 7.808.128 1.824.576 4.512 1.12 6.976h-.032c.448 2.08 1.12 4.096 1.984 6.08.48 1.536.992 2.976 1.472 4.032C126.432 733.856 316.992 864 512 864c195.136 0 385.696-130.048 473.216-321.696 1.376-2.496 2.24-4.832 2.848-6.912.256-.608.48-1.184.672-1.728 1.536-4.48 1.856-8.32 1.728-8.32l-.032.032c.608-3.104 1.568-7.744 1.568-13.28zM512 672c-88.224 0-160-71.776-160-160s71.776-160 160-160 160 71.776 160 160-71.776 160-160 160z"})});R.displayName="EyeIcon";const k=()=>c(g,{name:"fire"},{default:()=>c("path",{d:"M726.4 201.6c-12.8-9.6-28.8-6.4-38.4 0-9.6 9.6-16 25.6-9.6 38.4 6.4 12.8 9.6 28.8 12.8 44.8C604.8 83.2 460.8 38.4 454.4 35.2c-9.6-3.2-22.4 0-28.8 6.4-9.6 6.4-12.8 19.2-9.6 28.8 12.8 86.4-25.6 188.8-115.2 310.4-6.4-25.6-16-51.2-32-80-9.6-9.6-22.4-16-35.2-12.8-16 3.2-25.6 12.8-25.6 28.8-3.2 48-25.6 92.8-51.2 140.8C134.4 499.2 112 544 102.4 592c-32 150.4 99.2 329.6 233.6 380.8 9.6 3.2 19.2 6.4 32 9.6-25.6-19.2-41.6-51.2-48-96C294.4 691.2 505.6 640 515.2 460.8c153.6 105.6 224 336 137.6 505.6 3.2 0 6.4-3.2 9.6-3.2 0 0 3.2 0 3.2-3.2 163.2-89.6 252.8-208 259.2-345.6 16-211.2-163.2-390.4-198.4-412.8z"})});k.displayName="FireIcon";const D=()=>c(g,{name:"tag"},{default:()=>c("path",{d:"M939.902 458.563L910.17 144.567c-1.507-16.272-14.465-29.13-30.737-30.737L565.438 84.098h-.402c-3.215 0-5.726 1.005-7.634 2.913l-470.39 470.39a10.004 10.004 0 000 14.164l365.423 365.424c1.909 1.908 4.42 2.913 7.132 2.913s5.223-1.005 7.132-2.913l470.39-470.39c2.01-2.11 3.014-5.023 2.813-8.036zm-240.067-72.121c-35.458 0-64.286-28.828-64.286-64.286s28.828-64.285 64.286-64.285 64.286 28.828 64.286 64.285-28.829 64.286-64.286 64.286z"})});D.displayName="TagIcon";const _=()=>c(g,{name:"timer"},{default:()=>c("path",{d:"M799.387 122.15c4.402-2.978 7.38-7.897 7.38-13.463v-1.165c0-8.933-7.38-16.312-16.312-16.312H256.33c-8.933 0-16.311 7.38-16.311 16.312v1.165c0 5.825 2.977 10.874 7.637 13.592 4.143 194.44 97.22 354.963 220.201 392.763-122.204 37.542-214.893 196.511-220.2 389.397-4.661 5.049-7.638 11.651-7.638 19.03v5.825h566.49v-5.825c0-7.379-2.849-13.981-7.509-18.9-5.049-193.016-97.867-351.985-220.2-389.527 123.24-37.67 216.446-198.453 220.588-392.892zM531.16 450.445v352.632c117.674 1.553 211.787 40.778 211.787 88.676H304.097c0-48.286 95.149-87.382 213.728-88.676V450.445c-93.077-3.107-167.901-81.297-167.901-177.093 0-8.803 6.99-15.793 15.793-15.793 8.803 0 15.794 6.99 15.794 15.793 0 80.261 63.69 145.635 142.01 145.635s142.011-65.374 142.011-145.635c0-8.803 6.99-15.793 15.794-15.793s15.793 6.99 15.793 15.793c0 95.019-73.789 172.82-165.96 177.093z"})});_.displayName="TimerIcon";const O=()=>c(g,{name:"word"},{default:()=>[c("path",{d:"M518.217 432.64V73.143A73.143 73.143 0 01603.43 1.097a512 512 0 01419.474 419.474 73.143 73.143 0 01-72.046 85.212H591.36a73.143 73.143 0 01-73.143-73.143z"}),c("path",{d:"M493.714 566.857h340.297a73.143 73.143 0 0173.143 85.577A457.143 457.143 0 11371.566 117.76a73.143 73.143 0 0185.577 73.143v339.383a36.571 36.571 0 0036.571 36.571z"})]});O.displayName="WordIcon";var S=l({name:"AuthorInfo",components:{AuthorIcon:$},setup(){const a=e(),n=h(C.author),o=s((()=>n.value.join(", "))),t=s((()=>M[a.value].author));return()=>n.value?c("span",{class:"author-info",...!1!==C.hint?{ariaLabel:t.value,"data-balloon-pos":"down"}:{}},[c($),c("span",o.value)]):null}}),W=l({name:"CategoryInfo",components:{CategoryIcon:E},props:{categories:{type:Array,default:()=>[]}},setup(a){const n=A(),o=z(),t=e(),l=a.categories.length?r(a,"categories"):f(),u=s((()=>M[t.value].category)),i=s((()=>!1!==y().value));return()=>l.value.length?c("span",{class:"category-info",...!1!==C.hint?{ariaLabel:u.value,"data-balloon-pos":"down"}:{}},[c(E),c("ul",{class:"categories-wrapper"},l.value.map((a=>c("li",{class:{category:!0,clickable:i.value},onClick:()=>(a=>{const e=`/category/${a}/`;i.value&&n.path!==e&&o.push(e)})(a)},c("span",{role:i.value?"navigation":""},a)))))]):null}}),x=l({name:"DateInfo",components:{CalendarIcon:P},setup(){const a=e(),o=n(),t=s((()=>{const{createdTime:a}=o.value.git||{};return I({type:"date"},a?new Date(a):void 0).value?.display||""})),l=s((()=>M[a.value].date));return()=>t.value?c("span",{class:"date-info",...!1!==C.hint?{ariaLabel:l.value,"data-balloon-pos":"down"}:{}},[c(P),c("span",t.value)]):null}});var B=l({name:"PageViewInfo",components:{EyeIcon:R,FireIcon:k},setup(){const n=A(),t=o(),l=e(),r=a(),v=s((()=>M[l.value].views)),m=u(0),d=s((()=>(a=>{const e=w("comment");if(!H)return!1;const n=e.value.pageviews,o=!1!==V.pageviews,t=a.pageviews;return Boolean(t)||Boolean(o)&&!1!==t||!1!==n&&!1!==o&&!1!==t})(r.value))),g=s((()=>{const{base:a}=t.value;return`${a.slice(0,a.length-1)}${n.path}`})),h=()=>{const a=document.querySelector(".waline-visitor-count");if(a){const e=a.textContent;e&&!isNaN(Number(e))?m.value=Number(e):setTimeout((()=>{h()}),500)}};return i((()=>{setTimeout((()=>h()),1500)})),p((()=>n.path),((a,e)=>{a!==e&&setTimeout((()=>h()),500)})),()=>d.value?c("span",{class:"visitor-info",...!1!==C.hint?{ariaLabel:v.value,"data-balloon-pos":"down"}:{}},[c(m.value<1e3?R:k),c("span",{class:"waline-visitor-count",id:g.value},"...")]):null}}),F=l({name:"ReadingTimeInfo",components:{TimerIcon:_},setup(){const a=e(),o=n(),{minute:t="",time:l=""}=N[a.value]||{},r=s((()=>M[a.value].readingTime)),u=s((()=>o.value.readingTime.minutes<1?t:l.replace("$time",Math.round(o.value.readingTime.minutes).toString())));return()=>u.value?c("span",{class:"reading-time-info",...!1!==C.hint?{ariaLabel:r.value,"data-balloon-pos":"down"}:{}},[c(_),c("span",u.value)]):null}}),G=l({name:"TagInfo",components:{TagIcon:D},props:{tags:{type:Array,default:()=>[]}},setup(a){const n=A(),o=z(),t=e(),l=s((()=>M[t.value].tag)),u=a.tags.length?r(a,"tags"):b(),i=s((()=>!1!==y().value));return()=>u.value.length?c("span",!1!==C.hint?{ariaLabel:l.value,"data-balloon-pos":"down"}:{},[c(D),c("ul",{class:"tags-wrapper"},u.value.map(((a,e)=>c("li",{class:{tag:!0,["tag"+e%9]:!0,clickable:i.value},onClick:()=>(a=>{const e=`/tag/${a}/`;n.path!==e&&o.push(e)})(a)},c("span",{role:i.value?"navigation":""},a)))))]):null}}),j=l({name:"ReadTimeInfo",components:{WordIcon:O},setup(){const a=n(),o=e(),t=v("reading-time-i18n")?.[o.value].word||"",l=s((()=>t.replace("$word",a.value.readingTime.words.toString()))),r=s((()=>M[o.value].words));return()=>l.value?c("span",{class:"words-info",...!1!==C.hint?{ariaLabel:r.value,"data-balloon-pos":"down"}:{}},[c(O),c("span",l.value)]):null}}),q=l({name:"PageInfo",components:{AuthorInfo:S,CategoryInfo:W,DateInfo:x,PageViewInfo:B,ReadingTimeInfo:F,TagInfo:G,WordInfo:j},setup(){const o=n(),t=a(),l=e(),r=w("comment"),u=T(),i=s((()=>{const a=r.value.pageInfo,e=C.pageInfo,n=t.value.pageInfo;return!1!==n&&(Array.isArray(n)?n:!1!==e&&(Array.isArray(e)?e:!1!==a&&(Array.isArray(a)?a:["Author","PageView","Date","Category","Tag","ReadingTime"])))})),p=s((()=>t.value.original)),v=s((()=>M[l.value].origin));return()=>c("div",{class:"page-title"},[c("h1",[t.value.icon?c("i",{class:["iconfont",`${u.value}${t.value.icon}`]}):null,o.value.title]),i.value?c("div",{class:"page-info"},[p.value?c("span",{class:"origin"},v.value):null,i.value.map((a=>c(m(`${a}-info`))))]):null,c("hr")])}}),U=t((({app:a})=>{a.component("Comment",L),a.component("PageInfo",q)}));export default U; | ||
import{usePageFrontmatter as a,useRouteLocale as e,usePageData as n,useSiteData as o,defineClientAppEnhance as t}from"@vuepress/client";import{defineComponent as l,computed as s,h as c,toRef as r,ref as u,onMounted as i,watch as p,inject as v,resolveComponent as m}from"vue";import d from"@Waline";import{IconBase as g,useAuthor as h,useCategory as f,useBlogConfig as y,useDate as I,useThemePluginConfig as w,useTag as b,useIconPrefix as T}from"@mr-hope/vuepress-shared/client";import{useRoute as A,useRouter as z}from"vue-router";import"balloon-css";import"./styles/index.scss";const C=COMMENT_OPTIONS,M=PAGE_INFO_I18N,N=READING_TIME_I18N,V=C,H=Boolean(V&&"waline"===V.type&&V.serverURL);var L=l({name:"Comment",setup(){const e=a(),n=C.type,o=s((()=>"disable"!==C.type&&(e.value.comment||!1!==C.comment&&("waline"===C.type||!1!==e.value.comment))));return()=>"waline"===n?c(d,{style:{display:o.value?"block":"none"}}):null}});const $=()=>c(g,{name:"author"},{default:()=>c("path",{d:"M649.6 633.6c86.4-48 147.2-144 147.2-249.6 0-160-128-288-288-288s-288 128-288 288c0 108.8 57.6 201.6 147.2 249.6-121.6 48-214.4 153.6-240 288-3.2 9.6 0 19.2 6.4 25.6 3.2 9.6 12.8 12.8 22.4 12.8h704c9.6 0 19.2-3.2 25.6-12.8 6.4-6.4 9.6-16 6.4-25.6-25.6-134.4-121.6-240-243.2-288z"})});$.displayName="AuthorIcon";const P=()=>c(g,{name:"calendar"},{default:()=>c("path",{d:"M716.4 110.137c0-18.753-14.72-33.473-33.472-33.473-18.753 0-33.473 14.72-33.473 33.473v33.473h66.993v-33.473zm-334.87 0c0-18.753-14.72-33.473-33.473-33.473s-33.52 14.72-33.52 33.473v33.473h66.993v-33.473zm468.81 33.52H716.4v100.465c0 18.753-14.72 33.473-33.472 33.473a33.145 33.145 0 01-33.473-33.473V143.657H381.53v100.465c0 18.753-14.72 33.473-33.473 33.473a33.145 33.145 0 01-33.473-33.473V143.657H180.6A134.314 134.314 0 0046.66 277.595v535.756A134.314 134.314 0 00180.6 947.289h669.74a134.36 134.36 0 00133.94-133.938V277.595a134.314 134.314 0 00-133.94-133.938zm33.473 267.877H147.126a33.145 33.145 0 01-33.473-33.473c0-18.752 14.72-33.473 33.473-33.473h736.687c18.752 0 33.472 14.72 33.472 33.473a33.145 33.145 0 01-33.472 33.473z"})});P.displayName="CalendarIcon";const E=()=>c(g,{name:"category"},{default:()=>c("path",{d:"M148.41 106.992h282.176c22.263 0 40.31 18.048 40.31 40.31V429.48c0 22.263-18.047 40.31-40.31 40.31H148.41c-22.263 0-40.311-18.047-40.311-40.31V147.302c0-22.263 18.048-40.31 40.311-40.31zM147.556 553.478H429.73c22.263 0 40.311 18.048 40.311 40.31v282.176c0 22.263-18.048 40.312-40.31 40.312H147.555c-22.263 0-40.311-18.049-40.311-40.312V593.79c0-22.263 18.048-40.311 40.31-40.311zM593.927 106.992h282.176c22.263 0 40.31 18.048 40.31 40.31V429.48c0 22.263-18.047 40.31-40.31 40.31H593.927c-22.263 0-40.311-18.047-40.311-40.31V147.302c0-22.263 18.048-40.31 40.31-40.31zM730.22 920.502H623.926c-40.925 0-74.22-33.388-74.22-74.425V623.992c0-41.038 33.387-74.424 74.425-74.424h222.085c41.038 0 74.424 33.226 74.424 74.067v114.233c0 10.244-8.304 18.548-18.547 18.548s-18.548-8.304-18.548-18.548V623.635c0-20.388-16.746-36.974-37.33-36.974H624.13c-20.585 0-37.331 16.747-37.331 37.33v222.086c0 20.585 16.654 37.331 37.126 37.331H730.22c10.243 0 18.547 8.304 18.547 18.547 0 10.244-8.304 18.547-18.547 18.547z"})});E.displayName="CategoryIcon";const R=()=>c(g,{name:"eye"},{default:()=>c("path",{d:"M992 512.096c0-5.76-.992-10.592-1.28-11.136-.192-2.88-1.152-8.064-2.08-10.816-.256-.672-.544-1.376-.832-2.08-.48-1.568-1.024-3.104-1.6-4.32C897.664 290.112 707.104 160 512 160c-195.072 0-385.632 130.016-473.76 322.592-1.056 2.112-1.792 4.096-2.272 5.856a55.512 55.512 0 00-.64 1.6c-1.76 5.088-1.792 8.64-1.632 7.744-.832 3.744-1.568 11.168-1.568 11.168-.224 2.272-.224 4.032.032 6.304 0 0 .736 6.464 1.088 7.808.128 1.824.576 4.512 1.12 6.976h-.032c.448 2.08 1.12 4.096 1.984 6.08.48 1.536.992 2.976 1.472 4.032C126.432 733.856 316.992 864 512 864c195.136 0 385.696-130.048 473.216-321.696 1.376-2.496 2.24-4.832 2.848-6.912.256-.608.48-1.184.672-1.728 1.536-4.48 1.856-8.32 1.728-8.32l-.032.032c.608-3.104 1.568-7.744 1.568-13.28zM512 672c-88.224 0-160-71.776-160-160s71.776-160 160-160 160 71.776 160 160-71.776 160-160 160z"})});R.displayName="EyeIcon";const k=()=>c(g,{name:"fire"},{default:()=>c("path",{d:"M726.4 201.6c-12.8-9.6-28.8-6.4-38.4 0-9.6 9.6-16 25.6-9.6 38.4 6.4 12.8 9.6 28.8 12.8 44.8C604.8 83.2 460.8 38.4 454.4 35.2c-9.6-3.2-22.4 0-28.8 6.4-9.6 6.4-12.8 19.2-9.6 28.8 12.8 86.4-25.6 188.8-115.2 310.4-6.4-25.6-16-51.2-32-80-9.6-9.6-22.4-16-35.2-12.8-16 3.2-25.6 12.8-25.6 28.8-3.2 48-25.6 92.8-51.2 140.8C134.4 499.2 112 544 102.4 592c-32 150.4 99.2 329.6 233.6 380.8 9.6 3.2 19.2 6.4 32 9.6-25.6-19.2-41.6-51.2-48-96C294.4 691.2 505.6 640 515.2 460.8c153.6 105.6 224 336 137.6 505.6 3.2 0 6.4-3.2 9.6-3.2 0 0 3.2 0 3.2-3.2 163.2-89.6 252.8-208 259.2-345.6 16-211.2-163.2-390.4-198.4-412.8z"})});k.displayName="FireIcon";const D=()=>c(g,{name:"tag"},{default:()=>c("path",{d:"M939.902 458.563L910.17 144.567c-1.507-16.272-14.465-29.13-30.737-30.737L565.438 84.098h-.402c-3.215 0-5.726 1.005-7.634 2.913l-470.39 470.39a10.004 10.004 0 000 14.164l365.423 365.424c1.909 1.908 4.42 2.913 7.132 2.913s5.223-1.005 7.132-2.913l470.39-470.39c2.01-2.11 3.014-5.023 2.813-8.036zm-240.067-72.121c-35.458 0-64.286-28.828-64.286-64.286s28.828-64.285 64.286-64.285 64.286 28.828 64.286 64.285-28.829 64.286-64.286 64.286z"})});D.displayName="TagIcon";const _=()=>c(g,{name:"timer"},{default:()=>c("path",{d:"M799.387 122.15c4.402-2.978 7.38-7.897 7.38-13.463v-1.165c0-8.933-7.38-16.312-16.312-16.312H256.33c-8.933 0-16.311 7.38-16.311 16.312v1.165c0 5.825 2.977 10.874 7.637 13.592 4.143 194.44 97.22 354.963 220.201 392.763-122.204 37.542-214.893 196.511-220.2 389.397-4.661 5.049-7.638 11.651-7.638 19.03v5.825h566.49v-5.825c0-7.379-2.849-13.981-7.509-18.9-5.049-193.016-97.867-351.985-220.2-389.527 123.24-37.67 216.446-198.453 220.588-392.892zM531.16 450.445v352.632c117.674 1.553 211.787 40.778 211.787 88.676H304.097c0-48.286 95.149-87.382 213.728-88.676V450.445c-93.077-3.107-167.901-81.297-167.901-177.093 0-8.803 6.99-15.793 15.793-15.793 8.803 0 15.794 6.99 15.794 15.793 0 80.261 63.69 145.635 142.01 145.635s142.011-65.374 142.011-145.635c0-8.803 6.99-15.793 15.794-15.793s15.793 6.99 15.793 15.793c0 95.019-73.789 172.82-165.96 177.093z"})});_.displayName="TimerIcon";const O=()=>c(g,{name:"word"},{default:()=>[c("path",{d:"M518.217 432.64V73.143A73.143 73.143 0 01603.43 1.097a512 512 0 01419.474 419.474 73.143 73.143 0 01-72.046 85.212H591.36a73.143 73.143 0 01-73.143-73.143z"}),c("path",{d:"M493.714 566.857h340.297a73.143 73.143 0 0173.143 85.577A457.143 457.143 0 11371.566 117.76a73.143 73.143 0 0185.577 73.143v339.383a36.571 36.571 0 0036.571 36.571z"})]});O.displayName="WordIcon";var S=l({name:"AuthorInfo",components:{AuthorIcon:$},setup(){const a=e(),n=h(C.author),o=s((()=>n.value.join(", "))),t=s((()=>M[a.value].author));return()=>n.value.length?c("span",{class:"author-info",...!1!==C.hint?{ariaLabel:t.value,"data-balloon-pos":"down"}:{}},[c($),c("span",o.value)]):null}}),W=l({name:"CategoryInfo",components:{CategoryIcon:E},props:{categories:{type:Array,default:()=>[]}},setup(a){const n=A(),o=z(),t=e(),l=a.categories.length?r(a,"categories"):f(),u=s((()=>M[t.value].category)),i=s((()=>!1!==y().value));return()=>l.value.length?c("span",{class:"category-info",...!1!==C.hint?{ariaLabel:u.value,"data-balloon-pos":"down"}:{}},[c(E),c("ul",{class:"categories-wrapper"},l.value.map((a=>c("li",{class:{category:!0,clickable:i.value},onClick:()=>(a=>{const e=`/category/${a}/`;i.value&&n.path!==e&&o.push(e)})(a)},c("span",{role:i.value?"navigation":""},a)))))]):null}}),x=l({name:"DateInfo",components:{CalendarIcon:P},setup(){const a=e(),o=n(),t=s((()=>{const{createdTime:a}=o.value.git||{};return I({type:"date"},a?new Date(a):void 0).value?.display||""})),l=s((()=>M[a.value].date));return()=>t.value?c("span",{class:"date-info",...!1!==C.hint?{ariaLabel:l.value,"data-balloon-pos":"down"}:{}},[c(P),c("span",t.value)]):null}});var B=l({name:"PageViewInfo",components:{EyeIcon:R,FireIcon:k},setup(){const n=A(),t=o(),l=e(),r=a(),v=s((()=>M[l.value].views)),m=u(0),d=s((()=>(a=>{const e=w("comment");if(!H)return!1;const n=e.value.pageviews,o=!1!==V.pageviews,t=a.pageviews;return Boolean(t)||Boolean(o)&&!1!==t||!1!==n&&!1!==o&&!1!==t})(r.value))),g=s((()=>{const{base:a}=t.value;return`${a.slice(0,a.length-1)}${n.path}`})),h=()=>{const a=document.querySelector(".waline-visitor-count");if(a){const e=a.textContent;e&&!isNaN(Number(e))?m.value=Number(e):setTimeout((()=>{h()}),500)}};return i((()=>{setTimeout((()=>h()),1500)})),p((()=>n.path),((a,e)=>{a!==e&&setTimeout((()=>h()),500)})),()=>d.value?c("span",{class:"visitor-info",...!1!==C.hint?{ariaLabel:v.value,"data-balloon-pos":"down"}:{}},[c(m.value<1e3?R:k),c("span",{class:"waline-visitor-count",id:g.value},"...")]):null}}),F=l({name:"ReadingTimeInfo",components:{TimerIcon:_},setup(){const a=e(),o=n(),{minute:t="",time:l=""}=N[a.value]||{},r=s((()=>M[a.value].readingTime)),u=s((()=>o.value.readingTime.minutes<1?t:l.replace("$time",Math.round(o.value.readingTime.minutes).toString())));return()=>u.value?c("span",{class:"reading-time-info",...!1!==C.hint?{ariaLabel:r.value,"data-balloon-pos":"down"}:{}},[c(_),c("span",u.value)]):null}}),G=l({name:"TagInfo",components:{TagIcon:D},props:{tags:{type:Array,default:()=>[]}},setup(a){const n=A(),o=z(),t=e(),l=s((()=>M[t.value].tag)),u=a.tags.length?r(a,"tags"):b(),i=s((()=>!1!==y().value));return()=>u.value.length?c("span",!1!==C.hint?{ariaLabel:l.value,"data-balloon-pos":"down"}:{},[c(D),c("ul",{class:"tags-wrapper"},u.value.map(((a,e)=>c("li",{class:{tag:!0,["tag"+e%9]:!0,clickable:i.value},onClick:()=>(a=>{const e=`/tag/${a}/`;n.path!==e&&o.push(e)})(a)},c("span",{role:i.value?"navigation":""},a)))))]):null}}),j=l({name:"ReadTimeInfo",components:{WordIcon:O},setup(){const a=n(),o=e(),t=v("reading-time-i18n")?.[o.value].word||"",l=s((()=>t.replace("$word",a.value.readingTime.words.toString()))),r=s((()=>M[o.value].words));return()=>l.value?c("span",{class:"words-info",...!1!==C.hint?{ariaLabel:r.value,"data-balloon-pos":"down"}:{}},[c(O),c("span",l.value)]):null}}),q=l({name:"PageInfo",components:{AuthorInfo:S,CategoryInfo:W,DateInfo:x,PageViewInfo:B,ReadingTimeInfo:F,TagInfo:G,WordInfo:j},setup(){const o=n(),t=a(),l=e(),r=w("comment"),u=T(),i=s((()=>{const a=r.value.pageInfo,e=C.pageInfo,n=t.value.pageInfo;return!1!==n&&(Array.isArray(n)?n:!1!==e&&(Array.isArray(e)?e:!1!==a&&(Array.isArray(a)?a:["Author","PageView","Date","Category","Tag","ReadingTime"])))})),p=s((()=>t.value.original)),v=s((()=>M[l.value].origin));return()=>c("div",{class:"page-title"},[c("h1",[t.value.icon?c("i",{class:["iconfont",`${u.value}${t.value.icon}`]}):null,o.value.title]),i.value?c("div",{class:"page-info"},[p.value?c("span",{class:"origin"},v.value):null,i.value.map((a=>c(m(`${a}-info`))))]):null,c("hr")])}}),U=t((({app:a})=>{a.component("Comment",L),a.component("PageInfo",q)}));export default U; | ||
//# sourceMappingURL=appEnhance.js.map |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@mr-hope/vuepress-shared"),i=require("@vuepress/utils");const t={"/zh/":{author:"作者🖊",date:"写作日期📅",origin:"原创💡",views:"访问量🔢",category:"分类🌈",tag:"标签🏷",readingTime:"阅读时间⌛",words:"字数🔠"},"/en/":{author:"Author🖊",date:"Writing Date📅",origin:"Original💡",views:"Page views🔢",category:"Category🌈",tag:"Tags🏷",readingTime:"Reading Time⌛",words:"Words🔠"},"/de/":{author:"Autor🖊",date:"Datum📅",origin:"Original💡",views:"Besucher🔢",category:"Kategorie🌈",tag:"Tags🏷",readingTime:"Lesezeit⌛",words:"Wörter🔠"},"/vi/":{author:"Người viết🖊",date:"Ngày viết📅",origin:"Nguồn💡",views:"Views của trang🔢",category:"Category🌈",tag:"Tags🏷",readingTime:"Thời gian đọc⌛",words:"Words🔠"}},r={"/zh/":"请留言。(填写邮箱可在被回复时收到邮件提醒)","/en/":"Write a comment here (Fill in the email address to receive an email notification when being replied)","/de/":"Schreibe ein Kommentar (Geben Sie die E-Mail-Adresse ein, um eine E-Mail-Benachrichtigung zu erhalten, wenn Sie geantwortet werden)","/vi/":"Để lại bình luận (Điền địa chỉ email để nhận email thông báo khi được trả lời)"};exports.default=(n,a)=>{const{themeConfig:o}=a.options,s=e.getRootLangPath(a),g=t,d=r;g["/"]=g[s],d["/"]=d[s];const l=Object.keys(n).length>0?n:o.comment||{type:"disable"};return{name:"comment2",alias:{"@Waline":"waline"===l.type?i.path.resolve(__dirname,"../client/components/Waline"):"@mr-hope/vuepress-shared/lib/esm/noopModule"},define:()=>({COMMENT_OPTIONS:{hint:!o.pure,...l},PAGE_INFO_I18N:g,WALINE_I18N:d}),clientAppEnhanceFiles:i.path.resolve(__dirname,"../client/appEnhance.js"),plugins:[["@mr-hope/palette"],["reading-time2",{wordPerminute:n.wordPerminute}]]}}; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@mr-hope/vuepress-shared"),i=require("@vuepress/utils"),t=require("vuepress-plugin-sass-palette");const r={"/zh/":{author:"作者🖊",date:"写作日期📅",origin:"原创💡",views:"访问量🔢",category:"分类🌈",tag:"标签🏷",readingTime:"阅读时间⌛",words:"字数🔠"},"/en/":{author:"Author🖊",date:"Writing Date📅",origin:"Original💡",views:"Page views🔢",category:"Category🌈",tag:"Tags🏷",readingTime:"Reading Time⌛",words:"Words🔠"},"/de/":{author:"Autor🖊",date:"Datum📅",origin:"Original💡",views:"Besucher🔢",category:"Kategorie🌈",tag:"Tags🏷",readingTime:"Lesezeit⌛",words:"Wörter🔠"},"/vi/":{author:"Người viết🖊",date:"Ngày viết📅",origin:"Nguồn💡",views:"Views của trang🔢",category:"Category🌈",tag:"Tags🏷",readingTime:"Thời gian đọc⌛",words:"Words🔠"}},n={"/zh/":"请留言。(填写邮箱可在被回复时收到邮件提醒)","/en/":"Write a comment here (Fill in the email address to receive an email notification when being replied)","/de/":"Schreibe ein Kommentar (Geben Sie die E-Mail-Adresse ein, um eine E-Mail-Benachrichtigung zu erhalten, wenn Sie geantwortet werden)","/vi/":"Để lại bình luận (Điền địa chỉ email để nhận email thông báo khi được trả lời)"};exports.default=(a,s)=>{const{themeConfig:o}=s.options,g=e.getRootLangPath(s),l=r,d=n;l["/"]=l[g],d["/"]=d[g];const u=Object.keys(a).length>0?a:o.comment||{type:"disable"};t.usePalettePlugin(s,{id:"hope"});return{name:"vuepress-plugin-comment2",alias:{"@Waline":"waline"===u.type?i.path.resolve(__dirname,"../client/components/Waline.js"):"@mr-hope/vuepress-shared/client/noopModule.js"},define:()=>({COMMENT_OPTIONS:{hint:!o.pure,...u},PAGE_INFO_I18N:l,WALINE_I18N:d}),clientAppEnhanceFiles:i.path.resolve(__dirname,"../client/appEnhance.js"),plugins:[["reading-time2",{wordPerminute:a.wordPerminute}]]}}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "vuepress-plugin-comment2", | ||
"version": "2.0.0-alpha.1", | ||
"version": "2.0.0-alpha.2", | ||
"description": "A comment plugin for vuepress", | ||
@@ -48,7 +48,7 @@ "keywords": [ | ||
"dependencies": { | ||
"@mr-hope/vuepress-plugin-palette": "2.0.0-alpha.1", | ||
"@mr-hope/vuepress-shared": "2.0.0-alpha.1", | ||
"@mr-hope/vuepress-shared": "2.0.0-alpha.2", | ||
"@waline/client": "^1.2.3", | ||
"balloon-css": "^1.2.0", | ||
"vuepress-plugin-reading-time2": "2.0.0-alpha.1" | ||
"vuepress-plugin-reading-time2": "2.0.0-alpha.2", | ||
"vuepress-plugin-sass-palette": "2.0.0-alpha.2" | ||
}, | ||
@@ -58,3 +58,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "8bed5a9dc42796fd0996c5b4864d247753290e06" | ||
"gitHead": "cd5a7db863cc052791e63b59a00fbae6b63529f9" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
38757
+ Added@mr-hope/vuepress-shared@2.0.0-alpha.2(transitive)
+ Addedvuepress-plugin-reading-time2@2.0.0-alpha.2(transitive)
+ Addedvuepress-plugin-sass-palette@2.0.0-alpha.2(transitive)
- Removed@mr-hope/vuepress-plugin-palette@2.0.0-alpha.1(transitive)
- Removed@mr-hope/vuepress-shared@2.0.0-alpha.1(transitive)
- Removedvuepress-plugin-reading-time2@2.0.0-alpha.1(transitive)