zenn-cli 0.1.154-alpha.1 → 0.1.154-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -720,7 +720,7 @@ PERFORMANCE OF THIS SOFTWARE.
720
720
  .chapter-show__content {
721
721
  padding: 3rem 0 10rem;
722
722
  }
723
- `;function fC(e){return escape(e.replace(/\./g,"%2E"))}function pC(e){return unescape(e).replace(/%2E/g,".")}const Tv=xn.Path().any("slug",{action:({slug:e})=>v(tC,{slug:e})}),Mv=xn.Path().any("slug",{action:({slug:e})=>v(oC,{slug:e})}),zv=Mv.anyRoute.attach(xn.Path()).any("chapter_filename",{action:({slug:e,chapter_filename:t})=>v(cC,{bookSlug:e,chapterFilename:pC(t)})}),Iv=xn.SingleHash("hash",{optional:!0}).attach(xn.Path()).any("slug",{action:({slug:e,hash:t})=>v(qF,{slug:e,hash:t})}),Qs=xn.Path().exact({action:()=>v(UF,{})}).route("guide",e=>e.attach(Iv)).route("articles",e=>e.attach(Tv)).route("books",e=>e.attach(zv)),hC=()=>$e.useRoutes(Qs),vC=e=>{const t=$e.useLocation(),r=M.useMemo(()=>t.key===Qs.exactRoute.key,[t]);return v($e.Link,{route:Qs.exactRoute,className:r?`active ${e.className}`:e.className,children:e.children})},mC=e=>{const t=$e.useLocation(),r=M.useMemo(()=>t.pathname===`/articles/${e.slug}`,[t]);return v($e.Link,{route:Tv.anyRoute,match:{slug:e.slug},className:r?`active ${e.className}`:e.className,children:e.children})},jv=e=>{const t=$e.useLocation(),r=M.useMemo(()=>t.pathname===`/books/${e.slug}`,[t]);return v($e.Link,{route:Mv.anyRoute,match:{slug:e.slug},className:r?`active ${e.className}`:e.className,children:e.children})},bv=e=>{const t=$e.useLocation(),r=fC(e.chapterFilename),n=M.useMemo(()=>t.pathname===`/books/${e.bookSlug}/${r}`,[t]);return v($e.Link,{route:zv.anyRoute,match:{slug:e.bookSlug,chapter_filename:r},className:n?`active ${e.className}`:e.className,children:e.children})},so=e=>{const t=$e.useLocation(),r=M.useMemo(()=>t.pathname!==`/guide/${e.slug}`?!1:e.hash?t.hash===`#${e.hash}`:!0,[t]);return v($e.Link,{route:Iv.anyRoute,match:{slug:e.slug,hash:e.hash},className:r?`active ${e.className}`:e.className,children:e.children})},DC=({article:e})=>v(mC,{slug:e.slug,children:v(Vt,{title:e.title||e.slug,label:e.published?void 0:"下書き",emoji:e.emoji||"📄"})}),gC=({bookSlug:e,chapter:t,chapterNumber:r})=>{const n=typeof r=="number";return v(bv,{bookSlug:e,chapterFilename:t.filename,children:v(Vt,{label:n?void 0:"除外",title:`${n?`${r}. `:""}${t.title||t.slug}`})})},yC=({bookSlug:e})=>{const{data:t,mutate:r}=At(`/api/books/${e}/chapters`,{revalidateOnFocus:!1}),n=t==null?void 0:t.chapters;return In(()=>{r()}),T("ul",{children:[v("li",{children:v(jv,{slug:e,children:v(Vt,{title:"設定",emoji:"📘"})})}),!!(n!=null&&n.length)&&v(Ze,{children:n==null?void 0:n.map((u,i)=>v("li",{children:v(gC,{bookSlug:e,chapter:u,chapterNumber:typeof u.position=="number"?i+1:void 0})},`dir-book-${e}-${u.slug}`))})]})},FC=({book:e})=>v(sd,{title:e.title||e.slug,uniqueKey:`dir-book-${e.slug}`,defaultOpen:!1,label:e.published?void 0:"下書き",children:v(yC,{bookSlug:e.slug})}),CC=({sort:e})=>{const{data:t,mutate:r}=At(`/api/articles?sort=${e}`,{revalidateOnFocus:!1,errorRetryCount:3}),n=t==null?void 0:t.articles;return In(()=>{r()}),v(sd,{title:"articles",uniqueKey:"dir-articles",defaultOpen:!0,children:v("ul",{children:!!(n!=null&&n.length)&&v("li",{children:n.map(u=>v(DC,{article:u},`item-article-${u.slug}`))})})})},_C=({sort:e})=>{const{data:t,mutate:r}=At(`/api/books?sort=${e}`,{revalidateOnFocus:!1}),n=t==null?void 0:t.books;return In(()=>{r()}),v(sd,{title:"books",uniqueKey:"dir-books",defaultOpen:!0,children:!!(n!=null&&n.length)&&v("ul",{children:n==null?void 0:n.map(u=>v(FC,{book:u},`item-book-${u.slug}`))})})},EC=()=>{const[e,t]=ta({cacheKey:"fold-sidebar",defaultValue:!1}),[r,n]=ta({cacheKey:"item-sort-type",defaultValue:"modified"});return T(wC,{"aria-expanded":!e,className:"sidebar",children:[v("button",{className:"sidebar__btn-fold",onClick:()=>t(!e),"aria-label":e?"メニューを開く":"折りたたむ",children:e?v(tF,{className:"sidebar__fold-icon"}):v(J3,{className:"sidebar__fold-icon"})}),T("div",{className:"sidebar__inner","aria-hidden":e,children:[T("header",{className:"sidebar__header",children:[v(vC,{children:v("img",{src:"/logo.svg",alt:"Zenn Editor",width:150,height:20,className:"sidebar__header-logo"})}),v($F,{openButtonIcon:v(Q3,{className:"sidebar__sort-open"}),openButtonAriaLabel:"ソート設定を開く",position:"right",options:[{value:"modified",label:"ファイル更新順に並べる"},{value:"system",label:"システムの表示順に従う"}],value:r,setValue:u=>n(u),width:200})]}),T("div",{className:"sidebar__items",children:[v(CC,{sort:r}),v(_C,{sort:r}),T("ul",{className:"sidebar__static-links",children:[v("li",{children:v(so,{slug:"zenn-cli-guide",hash:"cli-%E3%81%A7%E8%A8%98%E4%BA%8B%EF%BC%88article%EF%BC%89%E3%82%92%E7%AE%A1%E7%90%86%E3%81%99%E3%82%8B",children:v(Vt,{title:"記事の作成ガイド",emoji:"📝"})})}),v("li",{children:v(so,{slug:"zenn-cli-guide",hash:"cli-%E3%81%A7%E6%9C%AC%EF%BC%88book%EF%BC%89%E3%82%92%E7%AE%A1%E7%90%86%E3%81%99%E3%82%8B",children:v(Vt,{title:"本の作成ガイド",emoji:"📚"})})}),v("li",{children:v(so,{slug:"deploy-github-images",children:v(Vt,{title:"画像管理ガイド",emoji:"🏞",label:"Beta"})})}),v("li",{children:v("a",{href:"https://zenn.dev/zenn/articles/markdown-guide",target:"_blank",rel:"noopener noreferrer",children:v(Vt,{title:"マークダウン記法",emoji:"🖋️ ",showNewTabIcon:!0})})}),v("li",{children:v("a",{href:"https://zenn.dev/dashboard/uploader",target:"_blank",rel:"noopener noreferrer",children:v(Vt,{title:"画像のアップロード",emoji:"📷",showNewTabIcon:!0})})})]})]})]})]})},wC=pe.div`
723
+ `;function fC(e){return escape(e.replace(/\./g,"%2E"))}function pC(e){return unescape(e).replace(/%2E/g,".")}const Tv=xn.Path().any("slug",{action:({slug:e})=>v(tC,{slug:e})}),Mv=xn.Path().any("slug",{action:({slug:e})=>v(oC,{slug:e})}),zv=Mv.anyRoute.attach(xn.Path()).any("chapter_filename",{action:({slug:e,chapter_filename:t})=>v(cC,{bookSlug:e,chapterFilename:pC(t)})}),Iv=xn.SingleHash("hash",{optional:!0}).attach(xn.Path()).any("slug",{action:({slug:e,hash:t})=>v(qF,{slug:e,hash:t})}),Qs=xn.Path().exact({action:()=>v(UF,{})}).route("guide",e=>e.attach(Iv)).route("articles",e=>e.attach(Tv)).route("books",e=>e.attach(zv)),hC=()=>$e.useRoutes(Qs),vC=e=>{const t=$e.useLocation(),r=M.useMemo(()=>t.key===Qs.exactRoute.key,[t]);return v($e.Link,{route:Qs.exactRoute,className:r?`active ${e.className}`:e.className,children:e.children})},mC=e=>{const t=$e.useLocation(),r=M.useMemo(()=>t.pathname===`/articles/${e.slug}`,[t]);return v($e.Link,{route:Tv.anyRoute,match:{slug:e.slug},className:r?`active ${e.className}`:e.className,children:e.children})},jv=e=>{const t=$e.useLocation(),r=M.useMemo(()=>t.pathname===`/books/${e.slug}`,[t]);return v($e.Link,{route:Mv.anyRoute,match:{slug:e.slug},className:r?`active ${e.className}`:e.className,children:e.children})},bv=e=>{const t=$e.useLocation(),r=fC(e.chapterFilename),n=M.useMemo(()=>t.pathname===`/books/${e.bookSlug}/${r}`,[t]);return v($e.Link,{route:zv.anyRoute,match:{slug:e.bookSlug,chapter_filename:r},className:n?`active ${e.className}`:e.className,children:e.children})},so=e=>{const t=$e.useLocation(),r=M.useMemo(()=>t.pathname!==`/guide/${e.slug}`?!1:e.hash?t.hash===`#${e.hash}`:!0,[t]);return v($e.Link,{route:Iv.anyRoute,match:{slug:e.slug,hash:e.hash},className:r?`active ${e.className}`:e.className,children:e.children})},DC=({article:e})=>v(mC,{slug:e.slug,children:v(Vt,{title:e.title||e.slug,label:e.published?void 0:"下書き",emoji:e.emoji||"📄"})}),gC=({bookSlug:e,chapter:t,chapterNumber:r})=>{const n=typeof r=="number";return v(bv,{bookSlug:e,chapterFilename:t.filename,children:v(Vt,{label:n?void 0:"除外",title:`${n?`${r}. `:""}${t.title||t.slug}`})})},yC=({bookSlug:e})=>{const{data:t,mutate:r}=At(`/api/books/${e}/chapters`,{revalidateOnFocus:!1}),n=t==null?void 0:t.chapters;return In(()=>{r()}),T("ul",{children:[v("li",{children:v(jv,{slug:e,children:v(Vt,{title:"設定",emoji:"📘"})})}),!!(n!=null&&n.length)&&v(Ze,{children:n==null?void 0:n.map((u,i)=>v("li",{children:v(gC,{bookSlug:e,chapter:u,chapterNumber:typeof u.position=="number"?i+1:void 0})},`dir-book-${e}-${u.slug}`))})]})},FC=({book:e})=>v(sd,{title:e.title||e.slug,uniqueKey:`dir-book-${e.slug}`,defaultOpen:!1,label:e.published?void 0:"下書き",children:v(yC,{bookSlug:e.slug})}),CC=({sort:e})=>{const{data:t,mutate:r}=At(`/api/articles?sort=${e}`,{revalidateOnFocus:!1,errorRetryCount:3}),n=t==null?void 0:t.articles;return In(()=>{r()}),v(sd,{title:"articles",uniqueKey:"dir-articles",defaultOpen:!0,children:v("ul",{children:!!(n!=null&&n.length)&&v("li",{children:n.map(u=>v(DC,{article:u},`item-article-${u.slug}`))})})})},_C=({sort:e})=>{const{data:t,mutate:r}=At(`/api/books?sort=${e}`,{revalidateOnFocus:!1}),n=t==null?void 0:t.books;return In(()=>{r()}),v(sd,{title:"books",uniqueKey:"dir-books",defaultOpen:!0,children:!!(n!=null&&n.length)&&v("ul",{children:n==null?void 0:n.map(u=>v(FC,{book:u},`item-book-${u.slug}`))})})},EC=()=>{const[e,t]=ta({cacheKey:"fold-sidebar",defaultValue:!1}),[r,n]=ta({cacheKey:"item-sort-type",defaultValue:"modified"});return T(wC,{"aria-expanded":!e,className:"sidebar",children:[v("button",{className:"sidebar__btn-fold",onClick:()=>t(!e),"aria-label":e?"メニューを開く":"折りたたむ",children:e?v(tF,{className:"sidebar__fold-icon"}):v(J3,{className:"sidebar__fold-icon"})}),T("div",{className:"sidebar__inner","aria-hidden":e,children:[T("header",{className:"sidebar__header",children:[v(vC,{children:v("img",{src:"/logo.svg",alt:"Zenn Editor",width:150,height:20,className:"sidebar__header-logo"})}),v($F,{openButtonIcon:v(Q3,{className:"sidebar__sort-open"}),openButtonAriaLabel:"ソート設定を開く",position:"right",options:[{value:"modified",label:"ファイル更新順に並べる"},{value:"system",label:"システムの表示順に従う"}],value:r,setValue:u=>n(u),width:200})]}),T("div",{className:"sidebar__items",children:[v(CC,{sort:r}),v(_C,{sort:r}),T("ul",{className:"sidebar__static-links",children:[v("li",{children:v(so,{slug:"zenn-cli-guide",hash:"cli-%E3%81%A7%E8%A8%98%E4%BA%8B%EF%BC%88article%EF%BC%89%E3%82%92%E7%AE%A1%E7%90%86%E3%81%99%E3%82%8B",children:v(Vt,{title:"記事の作成ガイド",emoji:"📝"})})}),v("li",{children:v(so,{slug:"zenn-cli-guide",hash:"cli-%E3%81%A7%E6%9C%AC%EF%BC%88book%EF%BC%89%E3%82%92%E7%AE%A1%E7%90%86%E3%81%99%E3%82%8B",children:v(Vt,{title:"本の作成ガイド",emoji:"📚"})})}),v("li",{children:v(so,{slug:"deploy-github-images",children:v(Vt,{title:"画像管理ガイド",emoji:"🏞"})})}),v("li",{children:v("a",{href:"https://zenn.dev/zenn/articles/markdown-guide",target:"_blank",rel:"noopener noreferrer",children:v(Vt,{title:"マークダウン記法",emoji:"🖋️ ",showNewTabIcon:!0})})}),v("li",{children:v("a",{href:"https://zenn.dev/dashboard/uploader",target:"_blank",rel:"noopener noreferrer",children:v(Vt,{title:"画像のアップロード",emoji:"📷",showNewTabIcon:!0})})})]})]})]})]})},wC=pe.div`
724
724
  position: sticky;
725
725
  top: 0;
726
726
  height: 100vh;
@@ -12,7 +12,7 @@
12
12
 
13
13
  <!-- 埋め込み要素のイベントを処理するためのスクリプト -->
14
14
  <script src="https://embed.zenn.studio/js/listen-embed-event.js"></script>
15
- <script type="module" crossorigin src="/assets/index-d37fd9d5.js"></script>
15
+ <script type="module" crossorigin src="/assets/index-e619d1ab.js"></script>
16
16
  <link rel="stylesheet" href="/assets/index-18fe6561.css">
17
17
  </head>
18
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zenn-cli",
3
- "version": "0.1.154-alpha.1",
3
+ "version": "0.1.154-alpha.2",
4
4
  "description": "Preview Zenn content locally.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -95,10 +95,10 @@
95
95
  "webpack": "^5.75.0",
96
96
  "webpack-cli": "^5.0.1",
97
97
  "ws": "^8.12.1",
98
- "zenn-content-css": "0.1.154-alpha.1",
99
- "zenn-embed-elements": "0.1.154-alpha.1",
100
- "zenn-markdown-html": "0.1.154-alpha.1",
101
- "zenn-model": "0.1.154-alpha.1"
98
+ "zenn-content-css": "0.1.154-alpha.2",
99
+ "zenn-embed-elements": "0.1.154-alpha.2",
100
+ "zenn-markdown-html": "0.1.154-alpha.2",
101
+ "zenn-model": "0.1.154-alpha.2"
102
102
  },
103
103
  "engines": {
104
104
  "node": ">=14.0.0"
@@ -106,5 +106,5 @@
106
106
  "publishConfig": {
107
107
  "access": "public"
108
108
  },
109
- "gitHead": "e0d0abe0e2617d4b6d704405bf944496493d4ba6"
109
+ "gitHead": "9cd8a2f9fba6a5ec68e2b8189832d61b646e5538"
110
110
  }