zenn-cli 0.1.103-alpha.0 → 0.1.103-alpha.1
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=Object.defineProperty,t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,i=(t,n,r)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r;const s=document.getElementsByTagName("head")[0];let o=null;function a(){o&&clearTimeout(o)}const c=(e,t)=>{try{delete window[e]}catch(r){window[e]=void 0}const n=document.getElementById(t);n&&s.removeChild(n)};const d={};class l extends HTMLElement{constructor(){super();const e=this.attachShadow({mode:"open"}),t=d[this.getCacheKey()];t&&(e.innerHTML=t)}render(e){if(!(this.shadowRoot&&e.stylesheet&&e.div))return void this.renderError();const t=`<link rel="stylesheet" href="${e.stylesheet}"><div>${e.div}</div>`;d[this.getCacheKey()]=t,this.shadowRoot.innerHTML=t}renderError(){this.innerHTML=`<div style="text-align: center; margin: 1.5rem 0; color: gray; font-size: 0.9rem;">\n Gistの読み込みに失敗しました<br> \n ${this.getAttribute("page-url")}\n </div>`}getCacheKey(){return encodeURIComponent(`${this.getAttribute("page-url")}-${this.getAttribute("encoded-filename")}`)}async connectedCallback(){if(d[this.getCacheKey()])return;const e=this.getAttribute("page-url"),t=this.getAttribute("encoded-filename");if(!e)return;const n=((r=e).endsWith(".json")?r:r.endsWith(".js")?r.replace(".js",".json"):`${r}.json`)+((null==t?void 0:t.length)?`?file=${t}`:"");var r;try{const e=await function(e){const t=`jsonp_${Date.now()}_${Math.ceil(1e4*Math.random())}`,n=`id_${t}`;return new Promise(((r,i)=>{window[t]=e=>{r(e),a(),c(t,n)};const d=e+(e.includes("?")?"&":"?")+`callback=${t}`,l=document.createElement("script");l.setAttribute("src",d),l.setAttribute("charset","UTF-8"),l.id=n,s.appendChild(l),o=setTimeout((()=>{i(new Error(`Request to ${e} timed out.`)),c(t,n),window[t]=()=>c(t,n)}),6e3),l.addEventListener("error",(()=>{i(new Error(`JSONP request to ${e} failed`)),c(t,n),a()}))}))}(n);this.render(e)}catch(i){console.log(i),this.renderError()}}}const m={};class h extends HTMLElement{constructor(){super();const e=this.getAttribute("src");if(!e)return;this.url=e;const t=e.match(/https?:\/\/twitter.com\/(.*?)\/status\/(\d+)[/?]?/);t&&t[2]&&(this.tweetId=t[2])}async connectedCallback(){this.render(),this.embedTweet()}render(){const e=this.tweetId&&m[this.tweetId]?`style="min-height: ${encodeURIComponent(m[this.tweetId])};"`:"";this.innerHTML=`<div class="embed-tweet-container" ${e}>\n <a href="${this.url}" class="embed-tweet-link" rel="nofollow">${this.url}</a>\n </div>`}async embedTweet(){const e=this.tweetId;if(!this.url||!e)return void console.log(`Invalid tweet URL:${this.url}`);const s=this.querySelector(".embed-tweet-container"),o=this.url.includes("?conversation=none");window.twttr.widgets.createTweet(this.tweetId,s,((e,s)=>{for(var o in s||(s={}))n.call(s,o)&&i(e,o,s[o]);if(t)for(var o of t(s))r.call(s,o)&&i(e,o,s[o]);return e})({align:"center"},o?{conversation:"none"}:{})).then((()=>{var t;null==(t=this.querySelector(".embed-tweet-link"))||t.remove();const n=this.querySelector("iframe");n&&setTimeout((()=>{m[e]=n.style.height}),1e3)}))}}const u={};function
|
|
1
|
+
var e=Object.defineProperty,t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,i=(t,n,r)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r;const s=document.getElementsByTagName("head")[0];let o=null;function a(){o&&clearTimeout(o)}const c=(e,t)=>{try{delete window[e]}catch(r){window[e]=void 0}const n=document.getElementById(t);n&&s.removeChild(n)};const d={};class l extends HTMLElement{constructor(){super();const e=this.attachShadow({mode:"open"}),t=d[this.getCacheKey()];t&&(e.innerHTML=t)}render(e){if(!(this.shadowRoot&&e.stylesheet&&e.div))return void this.renderError();const t=`<link rel="stylesheet" href="${e.stylesheet}"><div>${e.div}</div>`;d[this.getCacheKey()]=t,this.shadowRoot.innerHTML=t}renderError(){this.innerHTML=`<div style="text-align: center; margin: 1.5rem 0; color: gray; font-size: 0.9rem;">\n Gistの読み込みに失敗しました<br> \n ${this.getAttribute("page-url")}\n </div>`}getCacheKey(){return encodeURIComponent(`${this.getAttribute("page-url")}-${this.getAttribute("encoded-filename")}`)}async connectedCallback(){if(d[this.getCacheKey()])return;const e=this.getAttribute("page-url"),t=this.getAttribute("encoded-filename");if(!e)return;const n=((r=e).endsWith(".json")?r:r.endsWith(".js")?r.replace(".js",".json"):`${r}.json`)+((null==t?void 0:t.length)?`?file=${t}`:"");var r;try{const e=await function(e){const t=`jsonp_${Date.now()}_${Math.ceil(1e4*Math.random())}`,n=`id_${t}`;return new Promise(((r,i)=>{window[t]=e=>{r(e),a(),c(t,n)};const d=e+(e.includes("?")?"&":"?")+`callback=${t}`,l=document.createElement("script");l.setAttribute("src",d),l.setAttribute("charset","UTF-8"),l.id=n,s.appendChild(l),o=setTimeout((()=>{i(new Error(`Request to ${e} timed out.`)),c(t,n),window[t]=()=>c(t,n)}),6e3),l.addEventListener("error",(()=>{i(new Error(`JSONP request to ${e} failed`)),c(t,n),a()}))}))}(n);this.render(e)}catch(i){console.log(i),this.renderError()}}}const m={};class h extends HTMLElement{constructor(){super();const e=this.getAttribute("src");if(!e)return;this.url=e;const t=e.match(/https?:\/\/twitter.com\/(.*?)\/status\/(\d+)[/?]?/);t&&t[2]&&(this.tweetId=t[2])}async connectedCallback(){this.render(),this.embedTweet()}render(){const e=this.tweetId&&m[this.tweetId]?`style="min-height: ${encodeURIComponent(m[this.tweetId])};"`:"";this.innerHTML=`<div class="embed-tweet-container" ${e}>\n <a href="${this.url}" class="embed-tweet-link" rel="nofollow">${this.url}</a>\n </div>`}async embedTweet(){const e=this.tweetId;if(!this.url||!e)return void console.log(`Invalid tweet URL:${this.url}`);const s=this.querySelector(".embed-tweet-container"),o=this.url.includes("?conversation=none");window.twttr.widgets.createTweet(this.tweetId,s,((e,s)=>{for(var o in s||(s={}))n.call(s,o)&&i(e,o,s[o]);if(t)for(var o of t(s))r.call(s,o)&&i(e,o,s[o]);return e})({align:"center"},o?{conversation:"none"}:{})).then((()=>{var t;null==(t=this.querySelector(".embed-tweet-link"))||t.remove();const n=this.querySelector("iframe");n&&setTimeout((()=>{m[e]=n.style.height}),1e3)}))}}const u={};function p({src:e,id:t}){return new Promise(((n,r)=>{if(document.getElementById(t)){const e=setInterval((()=>{u[t]&&(clearInterval(e),n())}),100)}else{const i=document.createElement("script");i.setAttribute("src",e),i.setAttribute("id",t),document.head.appendChild(i),i.onload=()=>{u[t]=!0,n()},i.onerror=e=>r(e)}}))}class b extends HTMLElement{constructor(){super();const e=document.createElement("div");e.setAttribute("id","katex-container"),this._container=e}async connectedCallback(){this.render()}async render(){"undefined"==typeof katex&&await p({src:"https://cdn.jsdelivr.net/npm/katex@0.13.13/dist/katex.min.js",id:"katex-js"}),function({href:e,id:t}){new Promise(((n,r)=>{if(document.getElementById(t))return n();const i=document.createElement("link");i.setAttribute("href",e),i.setAttribute("rel","stylesheet"),i.setAttribute("id",t),document.head.appendChild(i),i.onload=()=>{n()},i.onerror=e=>r(e)}))}({href:"https://cdn.jsdelivr.net/npm/katex@0.13.13/dist/katex.min.css",id:"katex-css"});const e=!!this.getAttribute("display-mode"),t=this.textContent||this.innerText;null==katex||katex.render(t,this._container,{macros:{"\\RR":"\\mathbb{R}"},throwOnError:!1,displayMode:e}),this.innerHTML=this._container.innerHTML}}class v extends HTMLElement{async connectedCallback(){const e=document.createElement("div");this.appendChild(e),this._tmpContainer=e,this.observer=new IntersectionObserver((e=>{e.forEach((e=>{var t;if(e.isIntersecting){if(this.render(),!this._tmpContainer)return void console.error("Something wrong with _tmpContainer");null==(t=this.observer)||t.unobserve(this._tmpContainer)}}))}),{rootMargin:"1000px 0px"}),this._tmpContainer&&this.observer.observe(this._tmpContainer)}disconnectedCallback(){this.observer&&(this._tmpContainer&&this.observer.unobserve(this._tmpContainer),this.observer.disconnect())}async render(){await async function(){if("undefined"==typeof mermaid){await p({src:"https://cdn.jsdelivr.net/npm/mermaid@8.13/dist/mermaid.min.js",id:"mermaid-js"});const e="default";mermaid.initialize({mermaid:{startOnLoad:!1}}),mermaid.mermaidAPI.initialize({startOnLoad:!1,securityLevel:"strict",theme:e,er:{useMaxWidth:!0},flowchart:{useMaxWidth:!0,htmlLabels:!1},sequence:{useMaxWidth:!0},class:{useMaxWidth:!0},journey:{useMaxWidth:!0}})}}();const e=this.textContent||this.innerText;if(!e)return;this.childNodes[0].setAttribute("style","display:none");const t=(n=e,{syntaxError:{yes:!(()=>{try{return mermaid.mermaidAPI.parse(n),!0}catch(e){return console.log("mermaid.js のレンダリングでシンタックスエラーが発生しました",e),!1}})(),message:"<li>シンタックスエラーです</li>"},charLimitOver:{yes:n.length>2e3,message:"<li>ブロックあたりの文字数上限は2000です</li>"},chainingOfLinksOver:{yes:(n.match(/&/g)||[]).length>10,message:"<li>ブロックあたりの<code>&</code>によるチェイン上限は10です</li>"}});var n;if(Object.values(t).map((e=>e.yes)).includes(!0))return void(this.innerHTML=`\n <p>\n <span>mermaidをレンダリングできません。</span>\n <ul>\n ${t.syntaxError.yes?t.syntaxError.message:""}\n ${t.charLimitOver.yes?t.charLimitOver.message:""}\n ${t.chainingOfLinksOver.yes?t.chainingOfLinksOver.message:""}\n </ul>\n </p>\n `);null==mermaid||mermaid.mermaidAPI.render(`mermaid-container-${Date.now().valueOf()}-render`,e,(e=>{const t=document.createElement("div");this.appendChild(t),t.innerHTML=e}),this._tmpContainer)}}customElements.define("embed-gist",l),customElements.define("embed-tweet",h),customElements.define("embed-katex",b),customElements.define("embed-mermaid",v);
|
|
@@ -611,4 +611,4 @@ var e=Object.defineProperty,t=Object.getOwnPropertySymbols,r=Object.prototype.ha
|
|
|
611
611
|
.layout__main {
|
|
612
612
|
flex: 1;
|
|
613
613
|
}
|
|
614
|
-
`;const ht=()=>{const e=s.useLocation();return m.exports.useEffect((()=>{e.hash||window.scrollTo(0,0)}),[e]),null},_t=()=>(m.exports.useEffect((()=>{!function(e,t){if(!t)return e();if(void 0===x){const e=document.createElement("link").relList;x=e&&e.supports&&e.supports("modulepreload")?"modulepreload":"preload"}Promise.all(t.map((e=>{if(e in k)return;k[e]=!0;const t=e.endsWith(".css"),r=t?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${e}"]${r}`))return;const a=document.createElement("link");return a.rel=t?"stylesheet":x,t||(a.as="script",a.crossOrigin=""),a.href=e,document.head.appendChild(a),t?new Promise(((e,t)=>{a.addEventListener("load",e),a.addEventListener("error",t)})):void 0}))).then((()=>e()))}((()=>import("./index.
|
|
614
|
+
`;const ht=()=>{const e=s.useLocation();return m.exports.useEffect((()=>{e.hash||window.scrollTo(0,0)}),[e]),null},_t=()=>(m.exports.useEffect((()=>{!function(e,t){if(!t)return e();if(void 0===x){const e=document.createElement("link").relList;x=e&&e.supports&&e.supports("modulepreload")?"modulepreload":"preload"}Promise.all(t.map((e=>{if(e in k)return;k[e]=!0;const t=e.endsWith(".css"),r=t?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${e}"]${r}`))return;const a=document.createElement("link");return a.rel=t?"stylesheet":x,t||(a.as="script",a.crossOrigin=""),a.href=e,document.head.appendChild(a),t?new Promise(((e,t)=>{a.addEventListener("load",e),a.addEventListener("error",t)})):void 0}))).then((()=>e()))}((()=>import("./index.4ffda0fe.js")),void 0)}),[]),o.createElement($,null,o.createElement(j,null,o.createElement(s.RoconRoot,null,o.createElement(ht,null),o.createElement(ut,null,o.createElement(Qe,null))))));y.render(o.createElement(_t,null),document.getElementById("root"));
|
package/dist/client/index.html
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
content="no-cache, no-store, must-revalidate"
|
|
10
10
|
/>
|
|
11
11
|
<title>Zenn CLI</title>
|
|
12
|
-
<script type="module" crossorigin src="/assets/index.
|
|
12
|
+
<script type="module" crossorigin src="/assets/index.9d6359d1.js"></script>
|
|
13
13
|
<link rel="modulepreload" href="/assets/vendor.63f776be.js">
|
|
14
14
|
<link rel="stylesheet" href="/assets/index.9a2c789f.css">
|
|
15
15
|
<script>window.twttr=(function(f,b,g){var e,c=f.getElementsByTagName(b)[0],a=window.twttr||{};if(f.getElementById(g)){return a}e=f.createElement(b);e.id=g;e.src="https://platform.twitter.com/widgets.js";c.parentNode.insertBefore(e,c);a._e=[];a.ready=function(d){a._e.push(d)};return a}(document,"script","twitter-wjs"));</script></head>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zenn-cli",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "0.1.103-alpha.
|
|
4
|
+
"version": "0.1.103-alpha.1",
|
|
5
5
|
"description": "Preview Zenn content locally.",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"node-fetch": "^2.6.1",
|
|
49
49
|
"open": "^8.2.0",
|
|
50
50
|
"ws": "^7.4.6",
|
|
51
|
-
"zenn-markdown-html": "^0.1.103-alpha.
|
|
51
|
+
"zenn-markdown-html": "^0.1.103-alpha.1"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@material-ui/core": "^4.11.4",
|
|
@@ -88,10 +88,10 @@
|
|
|
88
88
|
"typescript": "^4.2.4",
|
|
89
89
|
"vite": "^2.3.7",
|
|
90
90
|
"wait-on": "^6.0.0",
|
|
91
|
-
"zenn-content-css": "^0.1.103-alpha.
|
|
92
|
-
"zenn-embed-elements": "^0.1.103-alpha.
|
|
91
|
+
"zenn-content-css": "^0.1.103-alpha.1",
|
|
92
|
+
"zenn-embed-elements": "^0.1.103-alpha.1"
|
|
93
93
|
},
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "fbc22a3bd78996526bedf97899c945c841e60ff1",
|
|
95
95
|
"publishConfig": {
|
|
96
96
|
"access": "public"
|
|
97
97
|
},
|