vuepress-plugin-comment2
Advanced tools
Comparing version
@@ -5,2 +5,2 @@ import * as _vuepress_client from '@vuepress/client'; | ||
export default _default; | ||
export { _default as default }; |
@@ -1,2 +0,2 @@ | ||
import{usePageFrontmatter as a,usePageData as e,useSiteData as n,defineClientAppEnhance as t}from"@vuepress/client";import{defineComponent as o,computed as l,h as s,toRef as r,ref as c,onMounted as i,watch as u,resolveComponent as p}from"vue";import v from"@Waline";import{IconBase as m,useAuthor as d,useLocaleConfig as g,useCategory as h,useBlogConfig as f,useDate as y,useThemePluginConfig as I,useTag as w,useIconPrefix as b}from"@mr-hope/vuepress-shared/client";import{useRoute as T,useRouter as M}from"vue-router";import"balloon-css/balloon.css";import"./styles/index.scss";const z=COMMENT_OPTIONS,A=PAGE_INFO_I18N,N=READING_TIME_I18N,C=z,V=Boolean(C&&"waline"===C.type&&C.serverURL);var H=o({name:"Comment",setup(){const e=a(),n=z.type,t=l((()=>"disable"!==z.type&&(e.value.comment||!1!==z.comment&&("waline"===z.type||!1!==e.value.comment))));return()=>"waline"===n?s(v,{style:{display:t.value?"block":"none"}}):null}});const L=()=>s(m,{name:"author"},{default:()=>s("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"})});L.displayName="AuthorIcon";const P=()=>s(m,{name:"calendar"},{default:()=>s("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 $=()=>s(m,{name:"category"},{default:()=>s("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"})});$.displayName="CategoryIcon";const R=()=>s(m,{name:"eye"},{default:()=>s("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 S=()=>s(m,{name:"fire"},{default:()=>s("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"})});S.displayName="FireIcon";const k=()=>s(m,{name:"tag"},{default:()=>s("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"})});k.displayName="TagIcon";const D=()=>s(m,{name:"timer"},{default:()=>s("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"})});D.displayName="TimerIcon";const E=()=>s(m,{name:"word"},{default:()=>[s("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"}),s("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"})]});E.displayName="WordIcon";var O=o({name:"AuthorInfo",setup(){const a=d(z.author),e=g(A);return()=>a.value.length?s("span",{class:"author-info",...!1!==z.hint?{ariaLabel:e.value.author,"data-balloon-pos":"down"}:{}},[s(L),s("span",a.value.join(", ")),s("span",{property:"author",content:a.value.join(", ")})]):null}}),_=o({name:"CategoryInfo",props:{categories:{type:Array,default:()=>[]}},setup(a){const e=T(),n=M(),t=a.categories.length?r(a,"categories"):h(),o=g(A),c=l((()=>!1!==f().value));return()=>t.value.length?s("span",{class:"category-info",...!1!==z.hint?{ariaLabel:o.value.category,"data-balloon-pos":"down"}:{}},[s($),s("ul",{class:"categories-wrapper"},[t.value.map((a=>s("li",{class:{category:!0,clickable:c.value},onClick:()=>(a=>{const t=`/category/${a}/`;c.value&&e.path!==t&&n.push(t)})(a)},s("span",{role:c.value?"navigation":""},a)))),s("meta",{property:"articleSection",content:t.value.join(",")})])]):null}}),j=o({name:"DateInfo",setup(){const a=e(),n=l((()=>{const{createdTime:e}=a.value.git||{};return y({type:"date"},e?new Date(e):void 0).value})),t=g(A);return()=>n.value?s("span",{class:"date-info",...!1!==z.hint?{ariaLabel:t.value.date,"data-balloon-pos":"down"}:{}},[s(P),s("span",n.value?.display),s("meta",{property:"datePublished",content:n.value?.value?.toISOString()||""})]):null}});var x=o({name:"PageViewInfo",setup(){const e=T(),t=n(),o=a(),r=g(A),p=c(0),v=l((()=>(a=>{const e=I("comment");if(!V)return!1;const n=e.value.pageviews,t=!1!==C.pageviews,o=a.pageviews;return Boolean(o)||Boolean(t)&&!1!==o||!1!==n&&!1!==t&&!1!==o})(o.value))),m=l((()=>{const{base:a}=t.value;return`${a.slice(0,a.length-1)}${e.path}`})),d=()=>{const a=document.querySelector(".waline-visitor-count");if(a){const e=a.textContent;e&&!isNaN(Number(e))?p.value=Number(e):setTimeout((()=>{d()}),500)}};return i((()=>{setTimeout((()=>d()),1500)})),u((()=>e.path),((a,e)=>{a!==e&&setTimeout((()=>d()),500)})),()=>v.value?s("span",{class:"visitor-info",...!1!==z.hint?{ariaLabel:r.value.views,"data-balloon-pos":"down"}:{}},[s(p.value<1e3?R:S),s("span",{class:"waline-visitor-count",id:m.value},"...")]):null}}),B=o({name:"ReadingTimeInfo",setup(){const a=e(),n=g(A),t=g(N),o=l((()=>a.value.readingTime.minutes<1?[t.value.minute,"PT1M"]:[t.value.time.replace("$time",Math.round(a.value.readingTime.minutes).toString()),`PT${Math.round(a.value.readingTime.minutes)}M`]));return()=>s("span",{class:"reading-time-info",...!1!==z.hint?{ariaLabel:n.value.readingTime,"data-balloon-pos":"down"}:{}},[s(D),s("span",o.value[0]),s("meta",{property:"timeRequired",content:o.value[1]})])}}),W=o({name:"TagInfo",props:{tags:{type:Array,default:()=>[]}},setup(a){const e=T(),n=M(),t=g(A),o=a.tags.length?r(a,"tags"):w(),c=l((()=>!1!==f().value));return()=>o.value.length?s("span",!1!==z.hint?{ariaLabel:t.value.tag,"data-balloon-pos":"down"}:{},[s(k),s("ul",{class:"tags-wrapper"},[o.value.map(((a,t)=>s("li",{class:{tag:!0,["tag"+t%9]:!0,clickable:c.value},onClick:()=>(a=>{const t=`/tag/${a}/`;e.path!==t&&n.push(t)})(a)},s("span",{role:c.value?"navigation":""},a)))),s("meta",{property:"keywords",content:o.value.join(",")})])]):null}}),q=o({name:"ReadTimeInfo",setup(){const a=e(),n=g(A),t=g(N),o=l((()=>a.value.readingTime.words.toString())),r=l((()=>t.value.word.replace("$word",o.value)));return()=>r.value?s("span",{class:"words-info",...!1!==z.hint?{ariaLabel:n.value.words,"data-balloon-pos":"down"}:{}},[s(E),s("span",r.value),s("meta",{property:"wordCount",content:o.value})]):null}}),F=o({name:"PageInfo",components:{AuthorInfo:O,CategoryInfo:_,DateInfo:j,PageViewInfo:x,ReadingTimeInfo:B,TagInfo:W,WordInfo:q},setup(){const n=e(),t=a(),o=I("comment"),r=b(),c=l((()=>{const a=o.value.pageInfo,e=z.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"])))})),i=l((()=>t.value.original)),u=g(A);return()=>s("div",{class:"page-title"},[s("h1",[t.value.icon?s("i",{class:["iconfont",`${r.value}${t.value.icon}`]}):null,n.value.title]),c.value?s("div",{class:"page-info"},[i.value?s("span",{class:"origin"},u.value.origin):null,c.value.map((a=>s(p(`${a}-info`))))]):null,s("hr")])}}),G=t((({app:a})=>{a.component("Comment",H),a.component("PageInfo",F)}));export default G; | ||
import{usePageFrontmatter as a,usePageData as e,useSiteData as n,defineClientAppEnhance as t}from"@vuepress/client";import{defineComponent as o,computed as l,h as s,toRef as r,ref as c,onMounted as i,watch as u,resolveComponent as p}from"vue";import v from"@Waline";import{IconBase as m,useAuthor as d,useLocaleConfig as g,useCategory as h,useBlogConfig as f,useDate as y,useThemePluginConfig as I,useTag as w,useIconPrefix as b}from"@mr-hope/vuepress-shared/client";import{useRoute as T,useRouter as M}from"vue-router";import"balloon-css/balloon.css";import"./styles/index.scss";const z=COMMENT_OPTIONS,A=PAGE_INFO_I18N,N=READING_TIME_I18N,C=z,V=Boolean(C&&"waline"===C.type&&C.serverURL);var H=o({name:"Comment",setup(){const e=a(),n=z.type,t=l((()=>"disable"!==z.type&&(e.value.comment||!1!==z.comment&&("waline"===z.type||!1!==e.value.comment))));return()=>"waline"===n?s(v,{style:{display:t.value?"block":"none"}}):null}});const L=()=>s(m,{name:"author"},{default:()=>s("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"})});L.displayName="AuthorIcon";const P=()=>s(m,{name:"calendar"},{default:()=>s("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 $=()=>s(m,{name:"category"},{default:()=>s("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"})});$.displayName="CategoryIcon";const R=()=>s(m,{name:"eye"},{default:()=>s("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 S=()=>s(m,{name:"fire"},{default:()=>s("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"})});S.displayName="FireIcon";const k=()=>s(m,{name:"tag"},{default:()=>s("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"})});k.displayName="TagIcon";const D=()=>s(m,{name:"timer"},{default:()=>s("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"})});D.displayName="TimerIcon";const E=()=>s(m,{name:"word"},{default:()=>[s("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"}),s("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"})]});E.displayName="WordIcon";var O=o({name:"AuthorInfo",setup(){const a=d(z.author),e=g(A);return()=>a.value.length?s("span",{class:"author-info",...!1!==z.hint?{ariaLabel:e.value.author,"data-balloon-pos":"down"}:{}},[s(L),s("span",a.value.join(", ")),s("span",{property:"author",content:a.value.join(", ")})]):null}}),_=o({name:"CategoryInfo",props:{categories:{type:Array,default:()=>[]}},setup(a){const e=T(),n=M(),t=a.categories.length?r(a,"categories"):h(),o=g(A),c=l((()=>!1!==f().value));return()=>t.value.length?s("span",{class:"category-info",...!1!==z.hint?{ariaLabel:o.value.category,"data-balloon-pos":"down"}:{}},[s($),s("ul",{class:"categories-wrapper"},[t.value.map((a=>s("li",{class:{category:!0,clickable:c.value},onClick:()=>(a=>{const t=`/category/${a}/`;c.value&&e.path!==t&&n.push(t)})(a)},s("span",{role:c.value?"navigation":""},a)))),s("meta",{property:"articleSection",content:t.value.join(",")})])]):null}}),j=o({name:"DateInfo",setup(){const a=e(),n=l((()=>{const{createdTime:e}=a.value.git||{};return y({type:"date"},e?new Date(e):void 0).value})),t=g(A);return()=>n.value?s("span",{class:"date-info",...!1!==z.hint?{ariaLabel:t.value.date,"data-balloon-pos":"down"}:{}},[s(P),s("span",n.value?.display),s("meta",{property:"datePublished",content:n.value?.value?.toISOString()||""})]):null}});var x=o({name:"PageViewInfo",setup(){const e=T(),t=n(),o=a(),r=g(A),p=c(0),v=l((()=>(a=>{const e=I("comment");if(!V)return!1;const n=e.value.pageviews,t=!1!==C.pageviews,o=a.pageviews;return Boolean(o)||Boolean(t)&&!1!==o||!1!==n&&!1!==t&&!1!==o})(o.value))),m=l((()=>{const{base:a}=t.value;return`${a.slice(0,a.length-1)}${e.path}`})),d=()=>{const a=document.querySelector(".waline-visitor-count");if(a){const e=a.textContent;e&&!isNaN(Number(e))?p.value=Number(e):setTimeout((()=>{d()}),500)}};return i((()=>{setTimeout((()=>d()),1500)})),u((()=>e.path),((a,e)=>{a!==e&&setTimeout((()=>d()),500)})),()=>v.value?s("span",{class:"visitor-info",...!1!==z.hint?{ariaLabel:r.value.views,"data-balloon-pos":"down"}:{}},[s(p.value<1e3?R:S),s("span",{class:"waline-visitor-count",id:m.value},"...")]):null}}),B=o({name:"ReadingTimeInfo",setup(){const a=e(),n=g(A),t=g(N),o=l((()=>a.value.readingTime.minutes<1?[t.value.minute,"PT1M"]:[t.value.time.replace("$time",Math.round(a.value.readingTime.minutes).toString()),`PT${Math.round(a.value.readingTime.minutes)}M`]));return()=>s("span",{class:"reading-time-info",...!1!==z.hint?{ariaLabel:n.value.readingTime,"data-balloon-pos":"down"}:{}},[s(D),s("span",o.value[0]),s("meta",{property:"timeRequired",content:o.value[1]})])}}),W=o({name:"TagInfo",props:{tags:{type:Array,default:()=>[]}},setup(a){const e=T(),n=M(),t=g(A),o=a.tags.length?r(a,"tags"):w(),c=l((()=>!1!==f().value));return()=>o.value.length?s("span",!1!==z.hint?{ariaLabel:t.value.tag,"data-balloon-pos":"down"}:{},[s(k),s("ul",{class:"tags-wrapper"},[o.value.map(((a,t)=>s("li",{class:{tag:!0,["tag"+t%9]:!0,clickable:c.value},onClick:()=>(a=>{const t=`/tag/${a}/`;e.path!==t&&n.push(t)})(a)},s("span",{role:c.value?"navigation":""},a))))]),s("meta",{property:"keywords",content:o.value.join(",")})]):null}}),q=o({name:"ReadTimeInfo",setup(){const a=e(),n=g(A),t=g(N),o=l((()=>a.value.readingTime.words.toString())),r=l((()=>t.value.word.replace("$word",o.value)));return()=>r.value?s("span",{class:"words-info",...!1!==z.hint?{ariaLabel:n.value.words,"data-balloon-pos":"down"}:{}},[s(E),s("span",r.value),s("meta",{property:"wordCount",content:o.value})]):null}}),F=o({name:"PageInfo",components:{AuthorInfo:O,CategoryInfo:_,DateInfo:j,PageViewInfo:x,ReadingTimeInfo:B,TagInfo:W,WordInfo:q},setup(){const n=e(),t=a(),o=I("comment"),r=b(),c=l((()=>{const a=o.value.pageInfo,e=z.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"])))})),i=l((()=>t.value.original)),u=g(A);return()=>s("div",{class:"page-title"},[s("h1",[t.value.icon?s("i",{class:["iconfont",`${r.value}${t.value.icon}`]}):null,n.value.title]),c.value?s("div",{class:"page-info"},[i.value?s("span",{class:"origin"},u.value.origin):null,c.value.map((a=>s(p(`${a}-info`))))]):null,s("hr")])}}),G=t((({app:a})=>{a.component("Comment",H),a.component("PageInfo",F)}));export{G as default}; | ||
//# sourceMappingURL=appEnhance.js.map |
import * as vue from 'vue'; | ||
import { VNode } from 'vue'; | ||
declare const _default: vue.DefineComponent<{}, () => VNode, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<{} & {}>, {}>; | ||
declare const _default: vue.DefineComponent<{}, () => VNode, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<{} & {} & {}>, {}>; | ||
export default _default; | ||
export { _default as default }; |
@@ -1,2 +0,2 @@ | ||
import{useThemePluginConfig as e,useLocaleConfig as l}from"@mr-hope/vuepress-shared/client";import{usePageFrontmatter as t,usePageLang as o}from"@vuepress/client";import{defineComponent as n,computed as a,onMounted as i,onBeforeUnmount as r,watch as s,nextTick as m,h as u}from"vue";import{useRoute as c}from"vue-router";import"../styles/waline.scss";const v=COMMENT_OPTIONS,p=Boolean(v&&"waline"===v.type&&v.serverURL),d=WALINE_I18N;var w=n({name:"Waline",setup(){const n=c(),w=t(),h=o(),f=e("comment"),g=l(d);let y,N=null;const j=a((()=>{if(!p)return!1;const e=f.value.comment,l=!1!==v.comment,t=w.value.comment;return Boolean(t)||Boolean(l)&&!1!==t||!1!==e&&!1!==l&&!1!==t})),T=a((()=>(l=>{const t=e("comment");if(!p)return!1;const o=t.value.pageviews,n=!1!==v.pageviews,a=l.pageviews;return Boolean(a)||Boolean(n)&&!1!==a||!1!==o&&!1!==n&&!1!==a})(w.value))),b=new Promise((e=>{setTimeout((()=>e()),v.delay)})),B=()=>{const e=y=(new Date).getTime();N?setTimeout((()=>{e===y&&N.update({lang:"zh-CN"===h.value?"zh-CN":"en",locale:{...g.value,...v.locale||{}}})}),v.delay):Promise.all([import("@waline/client"),b]).then((([{default:l}])=>{e===y&&(N=l({lang:"zh-CN"===h.value?"zh-CN":"en",locale:{...g.value,...v.locale||{}},emoji:["https://cdn.jsdelivr.net/gh/walinejs/emojis@1.0.0/weibo","https://cdn.jsdelivr.net/gh/walinejs/emojis@1.0.0/bilibili"],dark:'body[data-theme="dark"]',...v,el:"#waline-comment",visitor:T.value}))}))};return i((()=>{p&&B()})),r((()=>{N&&N.destroy()})),s((()=>n.path),(()=>m((()=>B())))),()=>u("div",{class:"waline-wrapper",style:{display:j.value?"block":"none"},innerHTML:'<div id="waline-comment" />'})}});export default w; | ||
import{useThemePluginConfig as e,useLocaleConfig as l}from"@mr-hope/vuepress-shared/client";import{usePageFrontmatter as t,usePageLang as o}from"@vuepress/client";import{defineComponent as n,computed as a,onMounted as i,onBeforeUnmount as r,watch as s,nextTick as m,h as u}from"vue";import{useRoute as c}from"vue-router";import"../styles/waline.scss";const v=COMMENT_OPTIONS,p=Boolean(v&&"waline"===v.type&&v.serverURL),d=WALINE_I18N;var w=n({name:"Waline",setup(){const n=c(),w=t(),h=o(),f=e("comment"),g=l(d);let y,N=null;const j=a((()=>{if(!p)return!1;const e=f.value.comment,l=!1!==v.comment,t=w.value.comment;return Boolean(t)||Boolean(l)&&!1!==t||!1!==e&&!1!==l&&!1!==t})),T=a((()=>(l=>{const t=e("comment");if(!p)return!1;const o=t.value.pageviews,n=!1!==v.pageviews,a=l.pageviews;return Boolean(a)||Boolean(n)&&!1!==a||!1!==o&&!1!==n&&!1!==a})(w.value))),b=new Promise((e=>{setTimeout((()=>e()),v.delay)})),B=()=>{const e=y=(new Date).getTime();N?setTimeout((()=>{e===y&&N.update({lang:"zh-CN"===h.value?"zh-CN":"en",locale:{...g.value,...v.locale||{}}})}),v.delay):Promise.all([import("@waline/client"),b]).then((([{default:l}])=>{e===y&&(N=l({lang:"zh-CN"===h.value?"zh-CN":"en",locale:{...g.value,...v.locale||{}},emoji:["https://cdn.jsdelivr.net/gh/walinejs/emojis@1.0.0/weibo","https://cdn.jsdelivr.net/gh/walinejs/emojis@1.0.0/bilibili"],dark:'body[data-theme="dark"]',...v,el:"#waline-comment",visitor:T.value}))}))};return i((()=>{p&&B()})),r((()=>{N&&N.destroy()})),s((()=>n.path),(()=>m((()=>B())))),()=>u("div",{class:"waline-wrapper",style:{display:j.value?"block":"none"},innerHTML:'<div id="waline-comment" />'})}});export{w as default}; | ||
//# sourceMappingURL=Waline.js.map |
@@ -157,3 +157,2 @@ import { ResolvedLocaleConfig, BasePageFrontMatter } from '@mr-hope/vuepress-shared'; | ||
export default commentPlugin; | ||
export { CommentOptions, CommentPluginFrontmatter, CommentPluginThemeData, DisableCommentOptions, PageInfoI18nConfig, PageInfoLocaleConfig, PageInfoType, WalineI18nConfig, WalineLocaleConfig, WalineOptions }; | ||
export { CommentOptions, CommentPluginFrontmatter, CommentPluginThemeData, DisableCommentOptions, PageInfoI18nConfig, PageInfoLocaleConfig, PageInfoType, WalineI18nConfig, WalineLocaleConfig, WalineOptions, commentPlugin as default }; |
{ | ||
"name": "vuepress-plugin-comment2", | ||
"version": "2.0.0-alpha.5", | ||
"version": "2.0.0-alpha.6", | ||
"description": "A comment plugin for vuepress", | ||
@@ -48,7 +48,7 @@ "keywords": [ | ||
"dependencies": { | ||
"@mr-hope/vuepress-shared": "2.0.0-alpha.5", | ||
"@waline/client": "^1.3.1", | ||
"@mr-hope/vuepress-shared": "2.0.0-alpha.6", | ||
"@waline/client": "^1.3.3", | ||
"balloon-css": "^1.2.0", | ||
"vuepress-plugin-reading-time2": "2.0.0-alpha.5", | ||
"vuepress-plugin-sass-palette": "2.0.0-alpha.5" | ||
"vuepress-plugin-reading-time2": "2.0.0-alpha.6", | ||
"vuepress-plugin-sass-palette": "2.0.0-alpha.6" | ||
}, | ||
@@ -58,3 +58,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "4e4fb1c3d529c25913738550b9c74d574022a541" | ||
"gitHead": "a3bbd5850499d6708af92d189f4503d0c1d8d4a8" | ||
} |
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
39916
-0.21%217
-0.46%+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
Updated