zenn-cli 0.5.4-alpha.0 → 0.5.4-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.
|
@@ -155,7 +155,7 @@ Error generating stack: `+e.message+`
|
|
|
155
155
|
opacity: 0;
|
|
156
156
|
color: var(--c-primary);
|
|
157
157
|
}
|
|
158
|
-
`,jo=e=>(0,M.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 748.96 88.3`,...e,children:[(0,M.jsx)(`title`,{children:`Zenn Editor`}),(0,M.jsx)(`path`,{fill:`currentColor`,d:`M233,56.8H194a15.59,15.59,0,0,0,4.8,9.2,14.48,14.48,0,0,0,9.8,3.4,19.46,19.46,0,0,0,8.2-1.7,16.74,16.74,0,0,0,6.5-5l8.2,9.5a25.07,25.07,0,0,1-9.5,7.9,32.49,32.49,0,0,1-14.7,3.2,33,33,0,0,1-16.5-4,27.37,27.37,0,0,1-10.7-10.9,30.43,30.43,0,0,1-3.7-15.1V51.1a37.68,37.68,0,0,1,3.5-16.5A26.31,26.31,0,0,1,190,23.3a29.29,29.29,0,0,1,15.5-4.1,28.93,28.93,0,0,1,14.9,3.7,24.46,24.46,0,0,1,9.4,10.5A38.61,38.61,0,0,1,233,49.5ZM216.1,43.9a11.45,11.45,0,0,0-2.8-7.9c-1.8-1.9-4.4-2.9-7.9-2.9a10,10,0,0,0-7.7,3.2,17.38,17.38,0,0,0-3.6,9h22Z`}),(0,M.jsx)(`path`,{fill:`currentColor`,d:`M128.3,67.9h36.1V82.6H107.5V72l35.8-54.3H107.1V2.9h56.6V13.3Z`}),(0,M.jsx)(`path`,{fill:`currentColor`,d:`M248.8,50.7c0-19.1,12.7-29.2,28.2-29.2s27.9,10.1,27.9,29.2V82h-16V51.4c0-10.6-4.8-16.1-12-16.1s-12.4,5.5-12.4,16.1V82.1H248.7l.1-31.4Z`}),(0,M.jsx)(`path`,{fill:`currentColor`,d:`M320.3,50.7c0-19.1,12.7-29.2,28.2-29.2s27.9,10.1,27.9,29.2V82h-16V51.4c0-10.6-4.8-16.1-12-16.1S336,40.8,336,51.4V82.1H320.2l.1-31.4Z`}),(0,M.jsx)(`path`,{fill:`#3ea8ff`,d:`M2.4,83.3h17a2.75,2.75,0,0,0,2.2-1.2L68.4,5.2A1.44,1.44,0,0,0,67.1,3H51a2.14,2.14,0,0,0-1.9,1.1L1.6,81.9A1,1,0,0,0,2.4,83.3Z`}),(0,M.jsx)(`path`,{fill:`#3ea8ff`,d:`M61,82.1,83.1,46.6a1.63,1.63,0,0,0-1.4-2.5h-16a1.76,1.76,0,0,0-1.5.8L41.5,81.2a1.37,1.37,0,0,0,1.2,2.1H59A2.2,2.2,0,0,0,61,82.1Z`}),(0,M.jsx)(`path`,{fill:`currentColor`,d:`M408.71,84.07V7.62h49V20.83H424.32V38.09h33.42V51.3H424.32V70.85h33.42V84.07Z`}),(0,M.jsx)(`path`,{fill:`currentColor`,d:`M517.26,84.07,515.94,77c-4,6.33-11.79,8.41-17.69,8.41-15.18,0-26.75-13.55-26.75-30.25,0-16.17,11.35-29.82,27-29.82,5.46,0,12.34,2,16.71,6.88v-30h15.51V84.07Zm-2.08-39.21a16.71,16.71,0,0,0-13.32-6.22c-9.94,0-14.53,8.84-14.53,16.92,0,8.41,5.46,16.49,14.31,16.49a15,15,0,0,0,13.54-7.53Z`}),(0,M.jsx)(`path`,{fill:`currentColor`,d:`M550.12,18.65V5.44h15.51V18.65Zm0,65.42V26.62h15.51V84.07Z`}),(0,M.jsx)(`path`,{fill:`currentColor`,d:`M601.23,39.51V61.79a35.94,35.94,0,0,0,.22,4.91c.44,3.39,1.75,5.46,5,5.46a13.13,13.13,0,0,0,6.23-1.64L617.5,82a29.08,29.08,0,0,1-13.65,3.39c-9,0-15-4.92-17-12.34a33.5,33.5,0,0,1-1.09-9.62V39.51h-6.88V26.62h6.88L588.13,14h13.1V26.62h14.64V39.51Z`}),(0,M.jsx)(`path`,{fill:`currentColor`,d:`M687,55.34c0,16.93-12.56,30-30,30s-30.14-13.11-30.14-30,12.55-30,30.14-30S687,38.42,687,55.34Zm-30-16.7c-8.52,0-14.31,7.31-14.31,16.7s5.79,16.71,14.31,16.71,14.19-7.31,14.19-16.71S665.44,38.64,656.93,38.64Z`}),(0,M.jsx)(`path`,{fill:`currentColor`,d:`M717.1,34.27c3.27-5.35,7.75-9,13.43-9A21.64,21.64,0,0,1,738,26.62l-3.72,13.54a11.53,11.53,0,0,0-5.46-1.31A12.73,12.73,0,0,0,718,45.19V84.07H702.46V26.62H715.9Z`})]}),Mo=({width:e=150,height:t=20,className:n})=>(0,M.jsx)(jo,{width:e,height:t,className:n,"aria-label":`Zenn Editor`}),No=({bodyHtml:e,children:t})=>{let n=(0,A.useRef)(null);return(0,A.useEffect)(()=>{if(!n.current||!e?.length)return;let t=Array.from(n.current.getElementsByTagName(`details`)),r=e=>()=>{t.forEach(t=>{t.open=e})},i=r(!0),a=r(!1);return window.addEventListener(`beforeprint`,i),window.addEventListener(`afterprint`,a),()=>{window.removeEventListener(`beforeprint`,i),window.removeEventListener(`afterprint`,a)}},[e]),(0,M.jsx)(`div`,{ref:n,className:`___print-details-opener`,children:t})},Po=e
|
|
158
|
+
`,jo=e=>(0,M.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 748.96 88.3`,...e,children:[(0,M.jsx)(`title`,{children:`Zenn Editor`}),(0,M.jsx)(`path`,{fill:`currentColor`,d:`M233,56.8H194a15.59,15.59,0,0,0,4.8,9.2,14.48,14.48,0,0,0,9.8,3.4,19.46,19.46,0,0,0,8.2-1.7,16.74,16.74,0,0,0,6.5-5l8.2,9.5a25.07,25.07,0,0,1-9.5,7.9,32.49,32.49,0,0,1-14.7,3.2,33,33,0,0,1-16.5-4,27.37,27.37,0,0,1-10.7-10.9,30.43,30.43,0,0,1-3.7-15.1V51.1a37.68,37.68,0,0,1,3.5-16.5A26.31,26.31,0,0,1,190,23.3a29.29,29.29,0,0,1,15.5-4.1,28.93,28.93,0,0,1,14.9,3.7,24.46,24.46,0,0,1,9.4,10.5A38.61,38.61,0,0,1,233,49.5ZM216.1,43.9a11.45,11.45,0,0,0-2.8-7.9c-1.8-1.9-4.4-2.9-7.9-2.9a10,10,0,0,0-7.7,3.2,17.38,17.38,0,0,0-3.6,9h22Z`}),(0,M.jsx)(`path`,{fill:`currentColor`,d:`M128.3,67.9h36.1V82.6H107.5V72l35.8-54.3H107.1V2.9h56.6V13.3Z`}),(0,M.jsx)(`path`,{fill:`currentColor`,d:`M248.8,50.7c0-19.1,12.7-29.2,28.2-29.2s27.9,10.1,27.9,29.2V82h-16V51.4c0-10.6-4.8-16.1-12-16.1s-12.4,5.5-12.4,16.1V82.1H248.7l.1-31.4Z`}),(0,M.jsx)(`path`,{fill:`currentColor`,d:`M320.3,50.7c0-19.1,12.7-29.2,28.2-29.2s27.9,10.1,27.9,29.2V82h-16V51.4c0-10.6-4.8-16.1-12-16.1S336,40.8,336,51.4V82.1H320.2l.1-31.4Z`}),(0,M.jsx)(`path`,{fill:`#3ea8ff`,d:`M2.4,83.3h17a2.75,2.75,0,0,0,2.2-1.2L68.4,5.2A1.44,1.44,0,0,0,67.1,3H51a2.14,2.14,0,0,0-1.9,1.1L1.6,81.9A1,1,0,0,0,2.4,83.3Z`}),(0,M.jsx)(`path`,{fill:`#3ea8ff`,d:`M61,82.1,83.1,46.6a1.63,1.63,0,0,0-1.4-2.5h-16a1.76,1.76,0,0,0-1.5.8L41.5,81.2a1.37,1.37,0,0,0,1.2,2.1H59A2.2,2.2,0,0,0,61,82.1Z`}),(0,M.jsx)(`path`,{fill:`currentColor`,d:`M408.71,84.07V7.62h49V20.83H424.32V38.09h33.42V51.3H424.32V70.85h33.42V84.07Z`}),(0,M.jsx)(`path`,{fill:`currentColor`,d:`M517.26,84.07,515.94,77c-4,6.33-11.79,8.41-17.69,8.41-15.18,0-26.75-13.55-26.75-30.25,0-16.17,11.35-29.82,27-29.82,5.46,0,12.34,2,16.71,6.88v-30h15.51V84.07Zm-2.08-39.21a16.71,16.71,0,0,0-13.32-6.22c-9.94,0-14.53,8.84-14.53,16.92,0,8.41,5.46,16.49,14.31,16.49a15,15,0,0,0,13.54-7.53Z`}),(0,M.jsx)(`path`,{fill:`currentColor`,d:`M550.12,18.65V5.44h15.51V18.65Zm0,65.42V26.62h15.51V84.07Z`}),(0,M.jsx)(`path`,{fill:`currentColor`,d:`M601.23,39.51V61.79a35.94,35.94,0,0,0,.22,4.91c.44,3.39,1.75,5.46,5,5.46a13.13,13.13,0,0,0,6.23-1.64L617.5,82a29.08,29.08,0,0,1-13.65,3.39c-9,0-15-4.92-17-12.34a33.5,33.5,0,0,1-1.09-9.62V39.51h-6.88V26.62h6.88L588.13,14h13.1V26.62h14.64V39.51Z`}),(0,M.jsx)(`path`,{fill:`currentColor`,d:`M687,55.34c0,16.93-12.56,30-30,30s-30.14-13.11-30.14-30,12.55-30,30.14-30S687,38.42,687,55.34Zm-30-16.7c-8.52,0-14.31,7.31-14.31,16.7s5.79,16.71,14.31,16.71,14.19-7.31,14.19-16.71S665.44,38.64,656.93,38.64Z`}),(0,M.jsx)(`path`,{fill:`currentColor`,d:`M717.1,34.27c3.27-5.35,7.75-9,13.43-9A21.64,21.64,0,0,1,738,26.62l-3.72,13.54a11.53,11.53,0,0,0-5.46-1.31A12.73,12.73,0,0,0,718,45.19V84.07H702.46V26.62H715.9Z`})]}),Mo=({width:e=150,height:t=20,className:n})=>(0,M.jsx)(jo,{width:e,height:t,className:n,"aria-label":`Zenn Editor`}),No=({bodyHtml:e,children:t})=>{let n=(0,A.useRef)(null);return(0,A.useEffect)(()=>{if(!n.current||!e?.length)return;let t=Array.from(n.current.getElementsByTagName(`details`)),r=e=>()=>{t.forEach(t=>{t.open=e})},i=r(!0),a=r(!1);return window.addEventListener(`beforeprint`,i),window.addEventListener(`afterprint`,a),()=>{window.removeEventListener(`beforeprint`,i),window.removeEventListener(`afterprint`,a)}},[e]),(0,M.jsx)(`div`,{ref:n,className:`___print-details-opener`,children:t})},Po=e=>{let t=`rawHtml`in e?e.rawHtml:void 0,n=(0,A.useMemo)(()=>t===void 0?void 0:{__html:t},[t]);return`rawHtml`in e?e.rawHtml?.length?(0,M.jsx)(No,{bodyHtml:e.rawHtml,children:(0,M.jsx)(`div`,{className:`znc`,dangerouslySetInnerHTML:n})}):(0,M.jsx)(Fo,{children:`本文を入力してください`}):(0,M.jsx)(`div`,{className:`znc`,children:e.children})},Fo=j.div`
|
|
159
159
|
text-align: center;
|
|
160
160
|
font-size: 1.1rem;
|
|
161
161
|
color: var(--c-gray);
|
|
@@ -388,7 +388,7 @@ Error generating stack: `+e.message+`
|
|
|
388
388
|
.article-header__validation-errors {
|
|
389
389
|
margin-top: 1.4rem;
|
|
390
390
|
}
|
|
391
|
-
`;function Fy(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Fy(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Iy(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Fy(e))&&(r&&(r+=` `),r+=t);return r}var Ly=({children:
|
|
391
|
+
`;function Fy(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Fy(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Iy(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Fy(e))&&(r&&(r+=` `),r+=t);return r}var Ly=({bodyHtml:e,children:t})=>{let n=(0,A.useRef)(null);return(0,A.useEffect)(()=>{let e=n.current;if(!e)return;let t=e.querySelectorAll(`.header-anchor-link`);return t.forEach(e=>{let t=document.createElement(`button`);t.setAttribute(`class`,`anchor__button`);let n=e.parentElement;n&&(n.setAttribute(`class`,Iy(n.getAttribute(`class`),`heading`)),n.insertBefore(t,e),t.setAttribute(`data-tooltip-position`,`top-left`),t.setAttribute(`aria-label`,`見出しのアンカーリンクをクリップボードにコピー`),t.addEventListener(`click`,async()=>{let n=e.getAttribute(`href`)??``;await navigator.clipboard.writeText(n),t.setAttribute(`role`,`tooltip`),t.setAttribute(`aria-label`,`アンカーリンクをコピーしました!`),setTimeout(()=>{t.removeAttribute(`role`),t.setAttribute(`aria-label`,`見出しのアンカーリンクをクリップボードにコピー`)},3e3)}))}),()=>{t.forEach(e=>{let t=e.parentElement;if(!t)return;let n=t.getAttribute(`class`);n&&t.setAttribute(`class`,n.replace(`heading`,``));let r=t.querySelector(`.anchor__button`);r&&t.removeChild(r)})}},[e]),(0,M.jsx)(Ry,{children:(0,M.jsx)(`div`,{ref:n,children:t})})},Ry=j.div`
|
|
392
392
|
.heading {
|
|
393
393
|
position: relative;
|
|
394
394
|
}
|
|
@@ -512,7 +512,7 @@ Error generating stack: `+e.message+`
|
|
|
512
512
|
transition: all 0.2s;
|
|
513
513
|
}
|
|
514
514
|
}
|
|
515
|
-
`,Hy=({bodyHtml:e,toc:t})=>(0,M.jsxs)(M.Fragment,{children:[!!t?.length&&(0,M.jsx)(By,{maxDepth:2,toc:t}),(0,M.jsx)(Ly,{children:(0,M.jsx)(Po,{rawHtml:e||``})})]}),Uy=({slug:e})=>{let{data:t,error:n,isValidating:r,mutate:i}=fo(`/api/articles/${e}`,{revalidateOnFocus:!1,revalidateOnReconnect:!1,errorRetryCount:3}),a=t?.article;return Lo(`${a?.title||e}のプレビュー`),ho(()=>{i()}),a?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(Ny,{article:a}),(0,M.jsx)(Io,{children:(0,M.jsx)(Wy,{className:`article-show`,children:(0,M.jsx)(`div`,{className:`article-show__content`,children:(0,M.jsx)(Hy,{bodyHtml:a.bodyHtml,toc:a.toc})})})})]}):r?(0,M.jsx)(Uo,{margin:`5rem auto`}):(0,M.jsx)(Si,{message:n?.message})},Wy=j.div`
|
|
515
|
+
`,Hy=({bodyHtml:e,toc:t})=>(0,M.jsxs)(M.Fragment,{children:[!!t?.length&&(0,M.jsx)(By,{maxDepth:2,toc:t}),(0,M.jsx)(Ly,{bodyHtml:e,children:(0,M.jsx)(Po,{rawHtml:e||``})})]}),Uy=({slug:e})=>{let{data:t,error:n,isValidating:r,mutate:i}=fo(`/api/articles/${e}`,{revalidateOnFocus:!1,revalidateOnReconnect:!1,errorRetryCount:3}),a=t?.article;return Lo(`${a?.title||e}のプレビュー`),ho(()=>{i()}),a?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(Ny,{article:a}),(0,M.jsx)(Io,{children:(0,M.jsx)(Wy,{className:`article-show`,children:(0,M.jsx)(`div`,{className:`article-show__content`,children:(0,M.jsx)(Hy,{bodyHtml:a.bodyHtml,toc:a.toc})})})})]}):r?(0,M.jsx)(Uo,{margin:`5rem auto`}):(0,M.jsx)(Si,{message:n?.message})},Wy=j.div`
|
|
516
516
|
.article-show__content {
|
|
517
517
|
padding: 3rem 0 18rem;
|
|
518
518
|
}
|
package/dist/client/index.html
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
|
|
28
28
|
<!-- 埋め込み要素のイベントを処理するためのスクリプト -->
|
|
29
29
|
<script src="https://embed.zenn.studio/js/listen-embed-event.js"></script>
|
|
30
|
-
<script type="module" crossorigin src="/assets/index-
|
|
30
|
+
<script type="module" crossorigin src="/assets/index-Clj1FlNM.js"></script>
|
|
31
31
|
<link rel="stylesheet" crossorigin href="/assets/index-rqkWbNGi.css">
|
|
32
32
|
</head>
|
|
33
33
|
|