@discoveryjs/discovery
Advanced tools
Comparing version 1.0.0-beta.62 to 1.0.0-beta.63
@@ -1,2 +0,2 @@ | ||
var ge=Object.create,w=Object.defineProperty,me=Object.getPrototypeOf,be=Object.prototype.hasOwnProperty,Se=Object.getOwnPropertyNames,we=Object.getOwnPropertyDescriptor;var ve=t=>w(t,"__esModule",{value:!0});var v=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var xe=(t,e,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Se(e))!be.call(t,r)&&r!=="default"&&w(t,r,{get:()=>e[r],enumerable:!(s=we(e,r))||s.enumerable});return t},De=t=>xe(ve(w(t!=null?ge(me(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var K=v((ot,I)=>{var k=1,O=2,P=3,J=4,$=5,U=6,je={8:"\\b",9:"\\t",10:"\\n",12:"\\f",13:"\\r",34:'\\"',92:"\\\\"};function Ce(t){return t>=55296&&t<=56319}function Ae(t){return t>=56320&&t<=57343}function W(t){return typeof t.pipe=="function"&&typeof t._read=="function"&&typeof t._readableState=="object"&&t._readableState!==null}function Ee(t,e,s,r){switch(s&&typeof s.toJSON=="function"&&(s=s.toJSON()),r!==null&&(s=r.call(t,String(e),s)),typeof s){case"function":case"symbol":s=void 0;break;case"object":if(s!==null){let n=s.constructor;(n===String||n===Number||n===Boolean)&&(s=s.valueOf())}break}return s}function Re(t){return t===null||typeof t!="object"?k:Array.isArray(t)?P:O}function Te(t){return t===null||typeof t!="object"?k:typeof t.then=="function"?J:W(t)?t._readableState.objectMode?U:$:Array.isArray(t)?P:O}function Fe(t){if(typeof t=="function")return t;if(Array.isArray(t)){let e=new Set(t.map(s=>typeof s=="string"||typeof s=="number"?String(s):null).filter(s=>typeof s=="string"));return e.add(""),(s,r)=>e.has(s)?r:void 0}return null}function Ne(t){return typeof t=="number"?!Number.isFinite(t)||t<1?!1:" ".repeat(Math.min(t,10)):typeof t=="string"&&t.slice(0,10)||!1}I.exports={escapableCharCodeSubstitution:je,isLeadingSurrogate:Ce,isTrailingSurrogate:Ae,type:{PRIMITIVE:k,PROMISE:J,ARRAY:P,OBJECT:O,STRING_STREAM:$,OBJECT_STREAM:U},isReadableStream:W,replaceValue:Ee,getTypeNative:Re,getTypeAsync:Te,normalizeReplacer:Fe,normalizeSpace:Ne}});var Q=v((lt,H)=>{H.exports=TextDecoder});var X=v((ct,Y)=>{var{isReadableStream:Be}=K(),Le=Q(),d=1,Me=2,ze=new Le;function G(t){return t!==null&&typeof t=="object"}function j(t,e){return t.name==="SyntaxError"&&e.jsonParseOffset&&(t.message=t.message.replace(/at position (\d+)/,(s,r)=>"at position "+(Number(r)+e.jsonParseOffset))),t}function C(t,e){let s=t.length;t.length+=e.length;for(let r=0;r<e.length;r++)t[s+r]=e[r]}Y.exports=function(t){let e=new Z;if(G(t)&&Be(t))return new Promise((s,r)=>{t.on("data",n=>{try{e.push(n)}catch(i){r(j(i,e)),e=null}}).on("error",n=>{e=null,r(n)}).on("end",()=>{try{s(e.finish())}catch(n){r(j(n,e))}finally{e=null}})});if(typeof t=="function"){let s=t();if(G(s)&&(Symbol.iterator in s||Symbol.asyncIterator in s))return new Promise(async(r,n)=>{try{for await(let i of s)e.push(i);r(e.finish())}catch(i){n(j(i,e))}finally{e=null}})}throw new Error("Chunk emitter should be readable stream, generator, async generator or function returning an iterable object")};var Z=class{constructor(){this.value=void 0,this.valueStack=null,this.stack=new Array(100),this.lastFlushDepth=0,this.flushDepth=0,this.stateString=!1,this.stateStringEscape=!1,this.pendingByteSeq=null,this.pendingChunk=null,this.pos=0,this.jsonParseOffset=0}flush(e,s,r){let n=e.slice(s,r);if(this.jsonParseOffset=this.pos,this.pendingChunk!==null&&(n=this.pendingChunk+n,this.pendingChunk=null),n[0]===","&&(n=n.slice(1),this.jsonParseOffset++),this.flushDepth===this.lastFlushDepth)this.flushDepth>0?(this.jsonParseOffset--,this.stack[this.flushDepth-1]===d?Object.assign(this.valueStack.value,JSON.parse("{"+n+"}")):C(this.valueStack.value,JSON.parse("["+n+"]"))):(this.value=JSON.parse(n),this.valueStack={value:this.value,prev:null});else if(this.flushDepth>this.lastFlushDepth){for(let i=this.flushDepth-1;i>=this.lastFlushDepth;i--)n+=this.stack[i]===d?"}":"]";this.lastFlushDepth===0?(this.value=JSON.parse(n),this.valueStack={value:this.value,prev:null}):(this.jsonParseOffset--,this.stack[this.lastFlushDepth-1]===d?Object.assign(this.valueStack.value,JSON.parse("{"+n+"}")):C(this.valueStack.value,JSON.parse("["+n+"]")));for(let i=this.lastFlushDepth||1;i<this.flushDepth;i++){let a=this.valueStack.value;if(this.stack[i-1]===d){let o;for(o in a);a=a[o]}else a=a[a.length-1];this.valueStack={value:a,prev:this.valueStack}}}else{for(let i=this.lastFlushDepth-1;i>=this.flushDepth;i--)this.jsonParseOffset--,n=(this.stack[i]===d?"{":"[")+n;this.stack[this.lastFlushDepth-1]===d?Object.assign(this.valueStack.value,JSON.parse(n)):C(this.valueStack.value,JSON.parse(n));for(let i=this.lastFlushDepth-1;i>=this.flushDepth;i--)this.valueStack=this.valueStack.prev}this.pos+=r-s,this.lastFlushDepth=this.flushDepth}push(e){if(typeof e!="string"){if(this.pendingByteSeq!==null){let i=e;e=new Uint8Array(this.pendingByteSeq.length+i.length),e.set(this.pendingByteSeq),e.set(i,this.pendingByteSeq.length),this.pendingByteSeq=null}if(e[e.length-1]>127)for(let i=0;i<e.length;i++){let a=e[e.length-1-i];if(a>>6==3){i++,(i!==4&&a>>3==30||i!==3&&a>>4==14||i!==2&&a>>5==6)&&(this.pendingByteSeq=e.slice(e.length-i),e=e.slice(0,-i));break}}e=ze.decode(e)}let s=e.length,r=0,n=0;e:for(let i=0;i<s;i++){if(this.stateString){for(;i<s;i++)if(this.stateStringEscape)this.stateStringEscape=!1;else switch(e.charCodeAt(i)){case 34:this.stateString=!1;continue e;case 92:this.stateStringEscape=!0}break}switch(e.charCodeAt(i)){case 34:this.stateString=!0,this.stateStringEscape=!1;break;case 44:n=i;break;case 123:n=i+1,this.stack[this.flushDepth++]=d;break;case 91:n=i+1,this.stack[this.flushDepth++]=Me;break;case 93:case 125:n=i+1,this.flushDepth--,this.flushDepth<this.lastFlushDepth&&(this.flush(e,r,n),r=n);break}}if(n>r&&this.flush(e,r,n),n<s){let i=e.slice(n,s);this.pendingChunk=this.pendingChunk!==null?this.pendingChunk+i:i}}finish(){return this.pendingChunk!==null&&(/[^ \t\r\n]/.test(this.pendingChunk)&&this.flush("",0,0),this.pendingChunk=null),this.value}}});function f(t,e,s){let r=document.createElement(t);typeof e=="string"&&(e={class:e});for(let n in e)if(hasOwnProperty.call(e,n)){if(e[n]===void 0)continue;n.startsWith("on")?r.addEventListener(n.substr(2),e[n]):r.setAttribute(n,e[n])}return Array.isArray(s)?s.forEach(n=>r.appendChild(n instanceof Node?n:ke(n))):typeof s=="string"&&(r.innerHTML=s),r}function ke(t){return document.createTextNode(String(t))}var Oe=(()=>{let t=!1;try{let e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){}return t})(),st=Oe?Object.freeze({passive:!0,capture:!0}):!0;var y={request:{value:0,title:"Awaiting data"},receive:{value:.1,title:"Receiving data"},parse:{value:.9,title:"Processing data (parse)"},prepare:{value:.925,title:"Processing data (prepare)"},initui:{value:.975,title:"Preparing UI"},done:{value:1,title:"Done!"}};Object.values(y).forEach((t,e,s)=>{t.duration=(e!==s.length-1?s[e+1].value:0)-t.value});var Pe=async()=>{if(await new Promise(t=>setTimeout(t,1)),!document.hidden)return Promise.race([new Promise(requestAnimationFrame),new Promise(t=>setTimeout(t,8))])},x=class{constructor({onTiming:e,delay:s}){this.finished=!1,this.awaitRepaint=null,this.lastStage=null,this.lastStageStart=null,this.timings=[],this.onTiming=typeof e=="function"?e:()=>{},this.el=f("div",{class:"view-progress init",style:`--appearance-delay: ${s===!0?200:Number(s)||0}ms`},[f("div","title"),f("div","progress")])}async setState(e){let{stage:s,progress:r,error:n}=e;if(n||this.finished)return;let{value:i,title:a,duration:o}=y[s],l=s!==this.lastStage,c=Date.now(),u=0,h;if(this.lastStage||(this.startTime=c,requestAnimationFrame(()=>this.el.classList.remove("init"))),l){if(this.lastStageStart!==null){let p={stage:this.lastStage,title:y[this.lastStage].title,duration:c-this.lastStageStart};this.timings.push(p),this.onTiming(p)}this.lastStage=s,this.lastStageStart=c,this.awaitRepaint=c}if(r){let{done:p,elapsed:ye,units:N,completed:g,total:S}=r;S?(u=p?1:g/S,h=N==="bytes"?Math.round(u*100)+"%":`${g}/${S}`):(u=p?1:.1+Math.min(.9,ye/2e4),h=N==="bytes"?(g/(1024*1024)).toFixed(1)+"MB":g)}this.el.style.setProperty("--progress",i+u*o),this.el.querySelector(".title").textContent=h?`${a} (${h})...`:s!=="done"?`${a}...`:a,(l||c-this.awaitRepaint>65&&c-this.lastStageStart>200)&&(await Pe(),this.awaitRepaint=Date.now())}finish(){if(!this.finished&&this.lastStageStart!==null){let e=this.lastStage,s=Date.now()-this.lastStageStart,r=y[e].title,n={stage:e,title:r,duration:s};this.timings.push(n),this.onTiming(n),this.onTiming({stage:"done",title:y.done.title,duration:Date.now()-this.startTime})}this.finished=!0}dispose(){this.finish(),this.el.remove()}},B=x;var D=class{static setValue(e,s){if(!e.shouldPublish(s,e.value))return!1;let r=[],n=e.subscriber;for(e.value=s;n!==null;){let{callback:i,thisArg:a}=n;i!==null&&r.push(i.call(a,s,()=>e.unsubscribe(i,a))),n=n.subscriber}return r}constructor(e,s){this.value=e,this.shouldPublish=typeof s=="function"?s:this.shouldPublish,this.subscriber=null}get readonly(){let e=this;return{subscribe:this.subscribe.bind(this),subscribeSync:this.subscribeSync.bind(this),unsubscribe:this.unsubscribe.bind(this),get value(){return e.value}}}subscribe(e,s){return this.subscriber={callback:e,thisArg:s,subscriber:this.subscriber},()=>this.unsubscribe(e,s)}subscribeSync(e,s){let r=this.subscribe(e,s);return e.call(s,this.value,r),r}unsubscribe(e,s){let r=this,n=this.subscriber;for(;n!==null;){if(n.callback===e&&n.thisArg===s){n.callback=null,n.thisArg=null,r.subscriber=n.subscriber;break}r=n,n=n.subscriber}}shouldPublish(e,s){return e!==s}set(e){return this.constructor.setValue(this,e)!==!1}asyncSet(e){let s=this.constructor.setValue(this,e);return s===!1?Promise.resolve(!1):Promise.all(s).then(r=>r!==!1)}},L=D;var M=!1,z=!1,q=!1;try{new ReadableStream({}),z=!0}catch(t){}try{new ReadableStream({type:"bytes"}),M=!0}catch(t){}try{new Response(new Blob).getReader(),q=!0}catch(t){}function V(t){return typeof t.arrayBuffer=="function"?t.arrayBuffer():new Promise((e,s)=>{let r=new FileReader;r.readAsArrayBuffer(t),r.onload=r.onerror=({type:n})=>{r.onload=r.onerror=null,n==="load"?e(r.result||r):s(new Error("Failed to read the blob/file"))}})}function _(t){let e=0;if(typeof t.stream=="function"&&!/Version\/14\.1/.test(navigator.userAgent))return t.stream();if(M)return new ReadableStream({type:"bytes",autoAllocateChunkSize:512*1024,pull(s){let r=s.byobRequest.view,n=t.slice(e,e+r.byteLength);return V(n).then(function(i){let a=new Uint8Array(i),o=a.byteLength;e+=o,r.set(a),s.byobRequest.respond(o),e>=t.size&&s.close()})}});if(z)return new ReadableStream({pull(s){let r=t.slice(e,e+512*1024);return V(r).then(function(n){e+=n.byteLength,s.enqueue(new Uint8Array(n)),e==t.size&&s.close()})}});if(q)return new Response(t).body;throw new Error("Include https://github.com/creatorrr/web-streams-polyfill")}var ee=De(X()),A={stream:m,event:qe,file:te,url:Ve,push:_e};function Ie(t){try{return new URL(t,location.origin).origin===location.origin}catch(e){return!1}}function Je(t,e,s){let r=1024*1024,n=0;return(0,ee.default)(async function*(){let i=t.getReader(),a=Date.now();try{for(;;){let{done:o,value:l}=await i.read();if(o){await s({done:!0,elapsed:Date.now()-a,units:"bytes",completed:n,total:e});break}for(let c=0;c<l.length;c+=r){let u=c===0&&l.length-c<r?l:l.slice(c,c+r);n+=u.length,yield u,await s({done:!1,elapsed:Date.now()-a,units:"bytes",completed:n,total:e})}}}finally{i.releaseLock()}}).then(i=>({data:i,size:n}))}async function $e(t,e){let s=async(r,n)=>(await e.asyncSet({stage:r}),await n());try{let r=Date.now(),{stream:n,data:i,size:a,validateData:o}=await s("request",t),l=Date.now()-r,{data:c,size:u}=i||await s("receive",()=>Je(n,Number(a)||0,h=>e.asyncSet({stage:"receive",progress:h})));return typeof o=="function"&&o(c),await e.asyncSet({stage:"done"}),{data:c,size:u,payloadSize:Number(a)||0,time:Date.now()-r,requestTime:l}}catch(r){throw console.error("[Discovery] Error loading data:",r),await e.asyncSet({stage:"error",error:r}),r}}function m(t,e,s){let r=new L;return{state:r,result:$e(t,r).then(n=>({...n,...e(n.data)})),...s}}function te(t){return m(()=>{if(t.type!=="application/json")throw new Error("Not a JSON file");return{stream:_(t),size:t.size}},e=>({data:e,context:{name:`File: ${t.name}`,createdAt:new Date(t.lastModified||Date.now()),data:e}}))}function qe(t){let e=t.dataTransfer||t.target,s=e&&e.files&&e.files[0];return t.stopPropagation(),t.preventDefault(),te(s)}function Ve(t,e,s){s=s||{};let r=typeof t=="string"?void 0:t,n=s.isResponseOk||(a=>a.ok),i=s.getContentSize||((a,o)=>Ie(a)&&!o.headers.get("content-encoding")?o.headers.get("content-length"):o.headers.get("x-file-size"));return m(async()=>{let a=await fetch(r?"data:application/json,{}":t,s.fetch);if(n(a))return r?{data:r}:{stream:a.body,size:i(t,a),validateData:s.validateData};let o=a.headers.get("content-type")||"",l=await a.text();if(o.toLowerCase().startsWith("application/json")){let c=JSON.parse(l);l=c.error||c}throw l=new Error(l),l.stack=null,l},a=>({data:e?a[e]:a,context:{name:"Discovery",createdAt:e&&a.createdAt?new Date(Date.parse(a.createdAt)):new Date,...e?a:{data:a}}}))}function _e(t,e){let s;return m(()=>({size:t,stream:new ReadableStream({start(r){s=r},cancel(){s=null}})}),r=>({data:r.data,context:{name:r.name||"Discovery",createdAt:e||r.createdAt||Date.now(),data:r.data}}),{push(r){s.enqueue(r)},finish(){s.close(),s=null}})}function se({result:t,state:e},s){return new Promise((r,n)=>{let i=e.subscribeSync(({stage:a,progress:o,error:l})=>{if(l){i(),n(l);return}if(a==="done"){i(),r(t);return}s.setState({stage:a,progress:o})})})}var E=class{constructor(){this.listeners=Object.create(null)}on(e,s){return this.listeners[e]={callback:s,next:this.listeners[e]||null},this}once(e,s){return this.on(e,function r(...n){s.apply(this,n),this.off(e,r)})}off(e,s){let r=this.listeners[e]||null,n=null;for(;r!==null;){if(r.callback===s){r.callback=null,n?n.next=r.next:this.listeners[e]=r.next;break}n=r,r=r.next}return this}emit(e,...s){let r=this.listeners[e]||null,n=!1;for(;r!==null;)typeof r.callback=="function"&&r.callback.apply(this,s),n=!0,r=r.next;return n}},re=E;function Ue(t){let e="__storage_test__"+Math.random(),s;try{s=window[t]}catch(r){return null}try{s.setItem(e,e),s.removeItem(e)}catch(r){if(!(r instanceof DOMException&&(r.code===22||r.code===1014||r.name==="QuotaExceededError"||r.name==="NS_ERROR_DOM_QUOTA_REACHED")&&s.length!==0))return null}return s}function ne(t){let e=new Map;return e.storage=Ue(t),e.getOrCreate=s=>e.get(s)||We(s,e),e.getOrCreate.available=e.storage!==null,e}var R=new Map([["session",ne("sessionStorage")],["local",ne("localStorage")]]),gt=R.get("session").getOrCreate,ie=R.get("local").getOrCreate;addEventListener("storage",t=>{for(let[,e]of R)e.storage===t.storageArea&&e.has(t.key)&&e.get(t.key).forceSync()});function We(t,e){let s=null,r=new re,n=(a=e.storage.getItem(t))=>{s!==a&&r.emit("change",s=a)},i={get value(){return this.get()},get(){return s},set(a){e.storage&&(e.storage.setItem(t,a),n())},delete(){e.storage&&(e.storage.removeItem(t),n())},forceSync(){return e.storage&&n(),this.get()},on(a,o){return r.on("change",a),o&&a(s),()=>r.off("change",a)},off(a){r.off("change",a)}};return e.set(t,i),i.forceSync(),i}var Ke=new Set([!0,!1,"auto","disabled"]),ae=new Set,oe=matchMedia("(prefers-color-scheme:dark)"),le=ie("discoveryjs:darkmode"),ce=new Map([["true",!0],["false",!1],["auto","auto"]]),b=null;function He(){for(let t of ae)t.mode==="auto"&&t.set("auto")}function ue(t){let e=ce.has(t)?ce.get(t):null;if(b!==e){b=e;for(let s of ae)s.persistent&&s.mode!=="disabled"&&s.set(e!==null?e:"auto")}}ue(le.value);le.on(ue);oe.addListener(He);function Qe(t,e){return(t==="off"||t==="disable")&&(t="disabled"),t!=="disabled"&&e&&b!==null&&(t=b),t}function Ye(t){return Ke.has(t)||(t="disabled"),t==="auto"?oe.matches:t===!0}function he(t,e){return Ye(Qe(t,e))}var Ge={"font-family":"Tahoma, Verdana, Arial, sans-serif","font-size":"16px","line-height":"1.6","-webkit-text-size-adjust":"none","text-size-adjust":"none","background-color":"var(--discovery-background-color, white)",color:"var(--discovery-color, black)","transition-property":"background-color, color","transition-duration":".25s","transition-timing-function":"ease-in"},Ze={"--discovery-background-color":"#242424","--discovery-color":"#cccccc"},fe=new WeakSet,T=new WeakMap;function de(t,e,s){e in s||(s[e]=[t.style.getPropertyValue(e),t.style.getPropertyPriority(e)])}function pe(t,e){e=e||{},T.has(t)||T.set(t,Object.create(null));let s=he(e.darkmode,e.darkmodePersistent),r=T.get(t);for(let[n,i]of Object.entries(Ge))(fe.has(t)||!/^transition/.test(n))&&(de(t,n,r),t.style.setProperty(n,i));for(let[n,i]of Object.entries(Ze))de(t,n,r),s?t.style.setProperty(n,i):t.style.removeProperty(n);fe.add(t)}function F(t,e){let s=f("style",null,":host{display:none}"),r=new Set,n=Promise.resolve();return Array.isArray(e)&&(t.append(...e.map(i=>{switch(typeof i=="string"&&(i={type:"style",content:i}),i.type){case"style":return f("style",null,i.content);case"link":{let a,o,l=new Promise((u,h)=>{a=u,o=h});return r.add(l),f("link",{rel:"stylesheet",href:i.href,media:i.media,onerror(u){r.delete(l),o(u),r.size||s.remove()},onload(){r.delete(l),a(),r.size||s.remove()}})}default:throw new Error(`Unknown type "${i.type}" for a style descriptor`)}})),r.size&&(n=Promise.all(r),t.append(s))),n}function Xe(){return new B({delay:300,onTiming:({title:t,duration:e})=>console.log(`[Discovery/loader] ${t} \u2013 ${e}ms`)})}function Ct(t){t=t||{};let e=t.container||document.body,s=t.progressbar||Xe(),r=document.createElement("div"),n=r.attachShadow({mode:"open"});if(t.dataSource&&!A.hasOwnProperty(t.dataSource))throw new Error(`dataSource "${t.dataSource}" is not supported`);pe(e,t);let i=A[t.dataSource||"url"],a=t.data?t.dataSource==="push"?i():i(t.data,"data"):{result:Promise.resolve({})};return a.push&&(window.discoveryLoader={push:a.push,finish:()=>{delete window.discoveryLoader,a.finish()}}),a.state&&se(a,s),F(n,t.styles),n.append(s.el),e.append(r),Object.assign(a.result,{el:r,shadowRoot:n,progressbar:s})}export{Ct as preloader}; | ||
var fe=Object.create;var D=Object.defineProperty;var de=Object.getOwnPropertyDescriptor;var pe=Object.getOwnPropertyNames;var ye=Object.getPrototypeOf,ge=Object.prototype.hasOwnProperty;var me=t=>D(t,"__esModule",{value:!0});var k=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var be=(t,e,s,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of pe(e))!ge.call(t,n)&&(s||n!=="default")&&D(t,n,{get:()=>e[n],enumerable:!(r=de(e,n))||r.enumerable});return t},Se=(t,e)=>be(me(D(t!=null?fe(ye(t)):{},"default",!e&&t&&t.__esModule?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var J=k((nt,$)=>{var A=1,P=2,O=3,q=4,V=5,_=6,De={8:"\\b",9:"\\t",10:"\\n",12:"\\f",13:"\\r",34:'\\"',92:"\\\\"};function ke(t){return t>=55296&&t<=56319}function Ae(t){return t>=56320&&t<=57343}function I(t){return typeof t.pipe=="function"&&typeof t._read=="function"&&typeof t._readableState=="object"&&t._readableState!==null}function Pe(t,e,s,r){switch(s&&typeof s.toJSON=="function"&&(s=s.toJSON()),r!==null&&(s=r.call(t,String(e),s)),typeof s){case"function":case"symbol":s=void 0;break;case"object":if(s!==null){let n=s.constructor;(n===String||n===Number||n===Boolean)&&(s=s.valueOf())}break}return s}function Oe(t){return t===null||typeof t!="object"?A:Array.isArray(t)?O:P}function Ce(t){return t===null||typeof t!="object"?A:typeof t.then=="function"?q:I(t)?t._readableState.objectMode?_:V:Array.isArray(t)?O:P}function Ee(t){return typeof t=="function"?t:Array.isArray(t)?[...new Set(t.map(s=>{let r=s&&s.constructor;return r===String||r===Number?String(s):null}).filter(s=>typeof s=="string"))]:null}function Re(t){return typeof t=="number"?!Number.isFinite(t)||t<1?!1:" ".repeat(Math.min(t,10)):typeof t=="string"&&t.slice(0,10)||!1}$.exports={escapableCharCodeSubstitution:De,isLeadingSurrogate:ke,isTrailingSurrogate:Ae,type:{PRIMITIVE:A,PROMISE:q,ARRAY:O,OBJECT:P,STRING_STREAM:V,OBJECT_STREAM:_},isReadableStream:I,replaceValue:Pe,getTypeNative:Oe,getTypeAsync:Ce,normalizeReplacer:Ee,normalizeSpace:Re}});var W=k((it,U)=>{U.exports=TextDecoder});var Y=k((at,Q)=>{var{isReadableStream:je}=J(),Te=W(),y=1,Fe=2,Be=new Te;function K(t){return t!==null&&typeof t=="object"}function C(t,e){return t.name==="SyntaxError"&&e.jsonParseOffset&&(t.message=t.message.replace(/at position (\d+)/,(s,r)=>"at position "+(Number(r)+e.jsonParseOffset))),t}function Le(t,e){let s=t.length;t.length+=e.length;for(let r=0;r<e.length;r++)t[s+r]=e[r]}Q.exports=function(t){let e=new H;if(K(t)&&je(t))return new Promise((s,r)=>{t.on("data",n=>{try{e.push(n)}catch(i){r(C(i,e)),e=null}}).on("error",n=>{e=null,r(n)}).on("end",()=>{try{s(e.finish())}catch(n){r(C(n,e))}finally{e=null}})});if(typeof t=="function"){let s=t();if(K(s)&&(Symbol.iterator in s||Symbol.asyncIterator in s))return new Promise(async(r,n)=>{try{for await(let i of s)e.push(i);r(e.finish())}catch(i){n(C(i,e))}finally{e=null}})}throw new Error("Chunk emitter should be readable stream, generator, async generator or function returning an iterable object")};var H=class{constructor(){this.value=void 0,this.valueStack=null,this.stack=new Array(100),this.lastFlushDepth=0,this.flushDepth=0,this.stateString=!1,this.stateStringEscape=!1,this.pendingByteSeq=null,this.pendingChunk=null,this.chunkOffset=0,this.jsonParseOffset=0}parseAndAppend(e,s){this.stack[this.lastFlushDepth-1]===y?(s&&(this.jsonParseOffset--,e="{"+e+"}"),Object.assign(this.valueStack.value,JSON.parse(e))):(s&&(this.jsonParseOffset--,e="["+e+"]"),Le(this.valueStack.value,JSON.parse(e)))}prepareAddition(e){let{value:s}=this.valueStack;if(Array.isArray(s)?s.length!==0:Object.keys(s).length!==0){if(e[0]===",")return this.jsonParseOffset++,e.slice(1);if(e[0]!=="}"&&e[0]!=="]")return this.jsonParseOffset-=3,"[[]"+e}return e}flush(e,s,r){let n=e.slice(s,r);if(this.jsonParseOffset=this.chunkOffset+s,this.pendingChunk!==null&&(n=this.pendingChunk+n,this.jsonParseOffset-=this.pendingChunk.length,this.pendingChunk=null),this.flushDepth===this.lastFlushDepth)this.flushDepth>0?this.parseAndAppend(this.prepareAddition(n),!0):(this.value=JSON.parse(n),this.valueStack={value:this.value,prev:null});else if(this.flushDepth>this.lastFlushDepth){for(let i=this.flushDepth-1;i>=this.lastFlushDepth;i--)n+=this.stack[i]===y?"}":"]";this.lastFlushDepth===0?(this.value=JSON.parse(n),this.valueStack={value:this.value,prev:null}):this.parseAndAppend(this.prepareAddition(n),!0);for(let i=this.lastFlushDepth||1;i<this.flushDepth;i++){let a=this.valueStack.value;if(this.stack[i-1]===y){let o;for(o in a);a=a[o]}else a=a[a.length-1];this.valueStack={value:a,prev:this.valueStack}}}else{n=this.prepareAddition(n);for(let i=this.lastFlushDepth-1;i>=this.flushDepth;i--)this.jsonParseOffset--,n=(this.stack[i]===y?"{":"[")+n;this.parseAndAppend(n,!1);for(let i=this.lastFlushDepth-1;i>=this.flushDepth;i--)this.valueStack=this.valueStack.prev}this.lastFlushDepth=this.flushDepth}push(e){if(typeof e!="string"){if(this.pendingByteSeq!==null){let i=e;e=new Uint8Array(this.pendingByteSeq.length+i.length),e.set(this.pendingByteSeq),e.set(i,this.pendingByteSeq.length),this.pendingByteSeq=null}if(e[e.length-1]>127)for(let i=0;i<e.length;i++){let a=e[e.length-1-i];if(a>>6===3){i++,(i!==4&&a>>3===30||i!==3&&a>>4===14||i!==2&&a>>5===6)&&(this.pendingByteSeq=e.slice(e.length-i),e=e.slice(0,-i));break}}e=Be.decode(e)}let s=e.length,r=0,n=0;e:for(let i=0;i<s;i++){if(this.stateString){for(;i<s;i++)if(this.stateStringEscape)this.stateStringEscape=!1;else switch(e.charCodeAt(i)){case 34:this.stateString=!1;continue e;case 92:this.stateStringEscape=!0}break}switch(e.charCodeAt(i)){case 34:this.stateString=!0,this.stateStringEscape=!1;break;case 44:n=i;break;case 123:n=i+1,this.stack[this.flushDepth++]=y;break;case 91:n=i+1,this.stack[this.flushDepth++]=Fe;break;case 93:case 125:n=i+1,this.flushDepth--,this.flushDepth<this.lastFlushDepth&&(this.flush(e,r,n),r=n);break;case 9:case 10:case 13:case 32:r===i&&r++,n===i&&n++;break}}n>r&&this.flush(e,r,n),n<s&&(this.pendingChunk!==null?this.pendingChunk+=e:this.pendingChunk=e.slice(n,s)),this.chunkOffset+=s}finish(){return this.pendingChunk!==null&&(this.flush("",0,0),this.pendingChunk=null),this.value}}});function f(t,e,s){let r=document.createElement(t);typeof e=="string"&&(e={class:e});for(let n in e)if(hasOwnProperty.call(e,n)){if(e[n]===void 0)continue;n.startsWith("on")?r.addEventListener(n.substr(2),e[n]):r.setAttribute(n,e[n])}return Array.isArray(s)?s.forEach(n=>r.appendChild(n instanceof Node?n:we(n))):typeof s=="string"&&(r.innerHTML=s),r}function we(t){return document.createTextNode(String(t))}var xe=(()=>{let t=!1;try{let e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch{}return t})(),Ze=xe?Object.freeze({passive:!0,capture:!0}):!0;var p={request:{value:0,title:"Awaiting data"},receive:{value:.1,title:"Receiving data"},parse:{value:.9,title:"Processing data (parse)"},prepare:{value:.925,title:"Processing data (prepare)"},initui:{value:.975,title:"Preparing UI"},done:{value:1,title:"Done!"}};Object.values(p).forEach((t,e,s)=>{t.duration=(e!==s.length-1?s[e+1].value:0)-t.value});var ve=async()=>{if(await new Promise(t=>setTimeout(t,1)),!document.hidden)return Promise.race([new Promise(requestAnimationFrame),new Promise(t=>setTimeout(t,8))])},m=class{constructor({onTiming:e,delay:s}){this.finished=!1,this.awaitRepaint=null,this.lastStage=null,this.lastStageStart=null,this.timings=[],this.onTiming=typeof e=="function"?e:()=>{},this.el=f("div",{class:"view-progress init",style:`--appearance-delay: ${s===!0?200:Number(s)||0}ms`},[f("div","title"),f("div","progress")])}async setState(e){let{stage:s,progress:r,error:n}=e;if(n||this.finished)return;let{value:i,title:a,duration:o}=p[s],l=s!==this.lastStage,c=Date.now(),u=0,h;if(this.lastStage||(this.startTime=c,requestAnimationFrame(()=>this.el.classList.remove("init"))),l){if(this.lastStageStart!==null){let d={stage:this.lastStage,title:p[this.lastStage].title,duration:c-this.lastStageStart};this.timings.push(d),this.onTiming(d)}this.lastStage=s,this.lastStageStart=c,this.awaitRepaint=c}if(r){let{done:d,elapsed:he,units:F,completed:g,total:v}=r;v?(u=d?1:g/v,h=F==="bytes"?Math.round(u*100)+"%":`${g}/${v}`):(u=d?1:.1+Math.min(.9,he/2e4),h=F==="bytes"?(g/(1024*1024)).toFixed(1)+"MB":g)}this.el.style.setProperty("--progress",i+u*o),this.el.querySelector(".title").textContent=h?`${a} (${h})...`:s!=="done"?`${a}...`:a,(l||c-this.awaitRepaint>65&&c-this.lastStageStart>200)&&(await ve(),this.awaitRepaint=Date.now())}finish(){if(!this.finished&&this.lastStageStart!==null){let e=this.lastStage,s=Date.now()-this.lastStageStart,r=p[e].title,n={stage:e,title:r,duration:s};this.timings.push(n),this.onTiming(n),this.onTiming({stage:"done",title:p.done.title,duration:Date.now()-this.startTime})}this.finished=!0}dispose(){this.finish(),this.el.remove()}};var b=class{static setValue(e,s){if(!e.shouldPublish(s,e.value))return!1;let r=[],n=e.subscriber;for(e.value=s;n!==null;){let{callback:i,thisArg:a}=n;i!==null&&r.push(i.call(a,s,()=>e.unsubscribe(i,a))),n=n.subscriber}return r}constructor(e,s){this.value=e,this.shouldPublish=typeof s=="function"?s:this.shouldPublish,this.subscriber=null}get readonly(){let e=this;return{subscribe:this.subscribe.bind(this),subscribeSync:this.subscribeSync.bind(this),unsubscribe:this.unsubscribe.bind(this),get value(){return e.value}}}subscribe(e,s){return this.subscriber={callback:e,thisArg:s,subscriber:this.subscriber},()=>this.unsubscribe(e,s)}subscribeSync(e,s){let r=this.subscribe(e,s);return e.call(s,this.value,r),r}unsubscribe(e,s){let r=this,n=this.subscriber;for(;n!==null;){if(n.callback===e&&n.thisArg===s){n.callback=null,n.thisArg=null,r.subscriber=n.subscriber;break}r=n,n=n.subscriber}}shouldPublish(e,s){return e!==s}set(e){return this.constructor.setValue(this,e)!==!1}asyncSet(e){let s=this.constructor.setValue(this,e);return s===!1?Promise.resolve(!1):Promise.all(s).then(r=>r!==!1)}};var B=!1,L=!1,M=!1;try{new ReadableStream({}),L=!0}catch{}try{new ReadableStream({type:"bytes"}),B=!0}catch{}try{new Response(new Blob).getReader(),M=!0}catch{}function N(t){return typeof t.arrayBuffer=="function"?t.arrayBuffer():new Promise((e,s)=>{let r=new FileReader;r.readAsArrayBuffer(t),r.onload=r.onerror=({type:n})=>{r.onload=r.onerror=null,n==="load"?e(r.result||r):s(new Error("Failed to read the blob/file"))}})}function z(t){let e=0;if(typeof t.stream=="function"&&!/Version\/14\.1/.test(navigator.userAgent))return t.stream();if(B)return new ReadableStream({type:"bytes",autoAllocateChunkSize:512*1024,pull(s){let r=s.byobRequest.view,n=t.slice(e,e+r.byteLength);return N(n).then(function(i){let a=new Uint8Array(i),o=a.byteLength;e+=o,r.set(a),s.byobRequest.respond(o),e>=t.size&&s.close()})}});if(L)return new ReadableStream({pull(s){let r=t.slice(e,e+512*1024);return N(r).then(function(n){e+=n.byteLength,s.enqueue(new Uint8Array(n)),e==t.size&&s.close()})}});if(M)return new Response(t).body;throw new Error("Include https://github.com/creatorrr/web-streams-polyfill")}var G=Se(Y()),E={stream:S,event:qe,file:Z,url:Ve,push:_e};function Me(t){try{return new URL(t,location.origin).origin===location.origin}catch{return!1}}function Ne(t,e,s){let r=1024*1024,n=0;return(0,G.default)(async function*(){let i=t.getReader(),a=Date.now();try{for(;;){let{done:o,value:l}=await i.read();if(o){await s({done:!0,elapsed:Date.now()-a,units:"bytes",completed:n,total:e});break}for(let c=0;c<l.length;c+=r){let u=c===0&&l.length-c<r?l:l.slice(c,c+r);n+=u.length,yield u,await s({done:!1,elapsed:Date.now()-a,units:"bytes",completed:n,total:e})}}}finally{i.releaseLock()}}).then(i=>({data:i,size:n}))}async function ze(t,e){let s=async(r,n)=>(await e.asyncSet({stage:r}),await n());try{let r=Date.now(),{stream:n,data:i,size:a,validateData:o}=await s("request",t),l=Date.now()-r,{data:c,size:u}=i||await s("receive",()=>Ne(n,Number(a)||0,h=>e.asyncSet({stage:"receive",progress:h})));return typeof o=="function"&&o(c),await e.asyncSet({stage:"done"}),{data:c,size:u,payloadSize:Number(a)||0,time:Date.now()-r,requestTime:l}}catch(r){throw console.error("[Discovery] Error loading data:",r),await e.asyncSet({stage:"error",error:r}),r}}function S(t,e,s){let r=new b;return{state:r,result:ze(t,r).then(n=>({...n,...e(n.data)})),...s}}function Z(t){return S(()=>({stream:z(t),size:t.size}),e=>({data:e,context:{name:`File: ${t.name}`,createdAt:new Date(t.lastModified||Date.now()),data:e}}))}function qe(t){let e=t.dataTransfer||t.target,s=e&&e.files&&e.files[0];return t.stopPropagation(),t.preventDefault(),Z(s)}function Ve(t,e,s){s=s||{};let r=typeof t=="string"?void 0:t,n=s.isResponseOk||(a=>a.ok),i=s.getContentSize||((a,o)=>Me(a)&&!o.headers.get("content-encoding")?o.headers.get("content-length"):o.headers.get("x-file-size"));return S(async()=>{let a=await fetch(r?"data:application/json,{}":t,s.fetch);if(n(a))return r?{data:r}:{stream:a.body,size:i(t,a),validateData:s.validateData};let o=a.headers.get("content-type")||"",l=await a.text();if(o.toLowerCase().startsWith("application/json")){let c=JSON.parse(l);l=c.error||c}throw l=new Error(l),l.stack=null,l},a=>({data:e?a[e]:a,context:{name:"Discovery",createdAt:e&&a.createdAt?new Date(Date.parse(a.createdAt)):new Date,...e?a:{data:a}}}))}function _e(t,e){let s;return S(()=>({size:t,stream:new ReadableStream({start(r){s=r},cancel(){s=null}})}),r=>({data:r.data,context:{name:r.name||"Discovery",createdAt:e||r.createdAt||Date.now(),data:r.data}}),{push(r){s.enqueue(r)},finish(){s.close(),s=null}})}function X({result:t,state:e},s){return new Promise((r,n)=>{let i=e.subscribeSync(({stage:a,progress:o,error:l})=>{if(l){i(),n(l);return}if(a==="done"){i(),r(t);return}return s.setState({stage:a,progress:o})})})}var w=class{constructor(){this.listeners=Object.create(null)}on(e,s){return this.listeners[e]={callback:s,next:this.listeners[e]||null},this}once(e,s){return this.on(e,function r(...n){s.apply(this,n),this.off(e,r)})}off(e,s){let r=this.listeners[e]||null,n=null;for(;r!==null;){if(r.callback===s){r.callback=null,n?n.next=r.next:this.listeners[e]=r.next;break}n=r,r=r.next}return this}emit(e,...s){let r=this.listeners[e]||null,n=!1;for(;r!==null;)typeof r.callback=="function"&&r.callback.apply(this,s),n=!0,r=r.next;return n}};function Ie(t){let e="__storage_test__"+Math.random(),s;try{s=window[t]}catch{return null}try{s.setItem(e,e),s.removeItem(e)}catch(r){if(!(r instanceof DOMException&&(r.code===22||r.code===1014||r.name==="QuotaExceededError"||r.name==="NS_ERROR_DOM_QUOTA_REACHED")&&s.length!==0))return null}return s}function ee(t){let e=new Map;return e.storage=Ie(t),e.getOrCreate=s=>e.get(s)||$e(s,e),e.getOrCreate.available=e.storage!==null,e}var R=new Map([["session",ee("sessionStorage")],["local",ee("localStorage")]]),ft=R.get("session").getOrCreate,te=R.get("local").getOrCreate;addEventListener("storage",t=>{for(let[,e]of R)e.storage===t.storageArea&&e.has(t.key)&&e.get(t.key).forceSync()});function $e(t,e){let s=null,r=new w,n=(a=e.storage.getItem(t))=>{s!==a&&r.emit("change",s=a)},i={get value(){return this.get()},get(){return s},set(a){e.storage&&(e.storage.setItem(t,a),n())},delete(){e.storage&&(e.storage.removeItem(t),n())},forceSync(){return e.storage&&n(),this.get()},on(a,o){return r.on("change",a),o&&a(s),()=>r.off("change",a)},off(a){r.off("change",a)}};return e.set(t,i),i.forceSync(),i}var Je=new Set([!0,!1,"auto","disabled"]),se=new Set,re=matchMedia("(prefers-color-scheme:dark)"),ne=te("discoveryjs:darkmode"),ie=new Map([["true",!0],["false",!1],["auto","auto"]]),x=null;function Ue(){for(let t of se)t.mode==="auto"&&t.set("auto")}function ae(t){let e=ie.has(t)?ie.get(t):null;if(x!==e){x=e;for(let s of se)s.persistent&&s.mode!=="disabled"&&s.set(e!==null?e:"auto")}}ae(ne.value);ne.on(ae);re.addListener(Ue);function We(t,e){return(t==="off"||t==="disable")&&(t="disabled"),t!=="disabled"&&e&&x!==null&&(t=x),t}function Ke(t){return Je.has(t)||(t="disabled"),t==="auto"?re.matches:t===!0}function oe(t,e){return Ke(We(t,e))}var He={"font-family":"Tahoma, Verdana, Arial, sans-serif","font-size":"16px","line-height":"1.6","-webkit-text-size-adjust":"none","text-size-adjust":"none","background-color":"var(--discovery-background-color, white)",color:"var(--discovery-color, black)","transition-property":"background-color, color","transition-duration":".25s","transition-timing-function":"ease-in"},Qe={"--discovery-background-color":"#242424","--discovery-color":"#cccccc"},le=new WeakSet,j=new WeakMap;function ce(t,e,s){e in s||(s[e]=[t.style.getPropertyValue(e),t.style.getPropertyPriority(e)])}function ue(t,e){e=e||{},j.has(t)||j.set(t,Object.create(null));let s=oe(e.darkmode,e.darkmodePersistent),r=j.get(t);for(let[n,i]of Object.entries(He))(le.has(t)||!/^transition/.test(n))&&(ce(t,n,r),t.style.setProperty(n,i));for(let[n,i]of Object.entries(Qe))ce(t,n,r),s?t.style.setProperty(n,i):t.style.removeProperty(n);le.add(t)}function T(t,e){let s=f("style",null,":host{display:none}"),r=new Set,n=Promise.resolve();return Array.isArray(e)&&(t.append(...e.map(i=>{switch(typeof i=="string"&&(i={type:"style",content:i}),i.type){case"style":return f("style",null,i.content);case"link":{let a,o,l=new Promise((u,h)=>{a=u,o=h});return r.add(l),f("link",{rel:"stylesheet",href:i.href,media:i.media,onerror(u){r.delete(l),o(u),r.size||s.remove()},onload(){r.delete(l),a(),r.size||s.remove()}})}default:throw new Error(`Unknown type "${i.type}" for a style descriptor`)}})),r.size&&(n=Promise.all(r),t.append(s))),n}function Ye(){return new m({delay:300,onTiming:({title:t,duration:e})=>console.log(`[Discovery/loader] ${t} \u2013 ${e}ms`)})}function kt(t){t=t||{};let e=t.container||document.body,s=t.progressbar||Ye(),r=document.createElement("div"),n=r.attachShadow({mode:"open"});if(t.dataSource&&!E.hasOwnProperty(t.dataSource))throw new Error(`dataSource "${t.dataSource}" is not supported`);ue(e,t);let i=E[t.dataSource||"url"],a=t.data?t.dataSource==="push"?i():i(t.data,"data"):{result:Promise.resolve({})};return a.push&&(window.discoveryLoader={push:a.push,finish:()=>{delete window.discoveryLoader,a.finish()}}),a.state&&X(a,s),T(n,t.styles),n.append(s.el),e.append(r),Object.assign(a.result,{el:r,shadowRoot:n,progressbar:s})}export{kt as preloader}; | ||
//# sourceMappingURL=discovery-preloader.js.map |
{ | ||
"name": "@discoveryjs/discovery", | ||
"version": "1.0.0-beta.62", | ||
"description": "Hackable JSON discovery tool", | ||
"version": "1.0.0-beta.63", | ||
"description": "Frontend framework for rapid data (JSON) analysis, shareable serverless reports and dashboards", | ||
"author": "Roman Dvornov <rdvornov@gmail.com> (https://github.com/lahmatiy)", | ||
@@ -31,14 +31,14 @@ "license": "MIT", | ||
"dependencies": { | ||
"@discoveryjs/json-ext": "^0.5.2", | ||
"codemirror": "^5.59.0", | ||
"@discoveryjs/json-ext": "^0.5.6", | ||
"codemirror": "^5.65.1", | ||
"hitext": "^1.0.0-beta.1", | ||
"jora": "1.0.0-beta.5", | ||
"marked": "^2.0.0" | ||
"marked": "^4.0.2" | ||
}, | ||
"devDependencies": { | ||
"@discoveryjs/cli": "^2.0.0-beta.12", | ||
"cypress": "^8.6.0", | ||
"esbuild": "~0.11.2", | ||
"eslint": "^8.0.1", | ||
"eslint-plugin-cypress": "^2.11.2" | ||
"cypress": "^9.3.1", | ||
"esbuild": "~0.14.14", | ||
"eslint": "^8.4.0", | ||
"eslint-plugin-cypress": "^2.12.1" | ||
}, | ||
@@ -45,0 +45,0 @@ "files": [ |
@@ -19,4 +19,5 @@ <img align="right" width="128" height="128" | ||
## Examples | ||
## Examples of usage | ||
- [Statoscope](https://github.com/statoscope/statoscope) – a toolkit to analyze and validate webpack bundle | ||
- [CSS syntax reference](https://csstree.github.io/docs/syntax/) ([source](https://github.com/csstree/docs/tree/master/src/syntax)) | ||
@@ -23,0 +24,0 @@ - [CSSWG spec drafts index](https://csstree.github.io/csswg-drafts-index/) ([source](https://github.com/csstree/csswg-drafts-index)) |
/* eslint-env browser */ | ||
import Widget from '../widget/index.js'; | ||
import upload from '../core/upload.js'; | ||
import router from '../core/router.js'; | ||
@@ -20,15 +21,8 @@ import { createElement } from '../core/utils/dom.js'; | ||
export default class App extends Widget { | ||
static modelfreeLoadData(instance, event) { | ||
if (instance.defaultPageId !== instance.reportPageId) { | ||
instance.defaultPageId = instance.reportPageId; | ||
instance.setPageHash(instance.pageHash, true); | ||
instance.cancelScheduledRender(); | ||
} | ||
return instance.loadDataFromEvent(event); | ||
} | ||
constructor(container, options = {}) { | ||
const extensions = options.extensions ? [options.extensions] : []; | ||
const isModelfree = options.mode === 'modelfree'; | ||
extensions.push(navButtons.darkmodeToggle); | ||
if (coalesceOption(options.router, true)) { | ||
@@ -38,7 +32,3 @@ extensions.push(router); | ||
extensions.push(navButtons.darkmodeToggle); | ||
if (options.mode === 'modelfree') { | ||
extensions.push(navButtons.loadData); | ||
} else { | ||
if (!isModelfree) { | ||
extensions.push(navButtons.indexPage); | ||
@@ -48,2 +38,7 @@ extensions.push(navButtons.reportPage); | ||
if (coalesceOption(options.upload, false) || isModelfree) { | ||
extensions.push(upload); | ||
extensions.push(navButtons.loadData); | ||
} | ||
if (coalesceOption(options.inspector, true)) { | ||
@@ -56,2 +51,3 @@ extensions.push(navButtons.inspect); | ||
extensions: options.extensions ? extensions.concat(options.extensions) : extensions, | ||
upload: options.upload, | ||
darkmode: coalesceOption(options.darkmode, 'auto'), | ||
@@ -123,2 +119,9 @@ darkmodePersistent: coalesceOption(options.darkmodePersistent, true) | ||
loadDataFromEvent(event) { | ||
if (this.mode === 'modelfree' && this.defaultPageId !== this.reportPageId) { | ||
this._defaultPageId = this.defaultPageId; | ||
this.defaultPageId = this.reportPageId; | ||
this.setPageHash(this.pageHash, true); | ||
this.cancelScheduledRender(); | ||
} | ||
return this.trackLoadDataProgress(loadDataFromEvent(event)); | ||
@@ -135,2 +138,12 @@ } | ||
unloadData() { | ||
if (this.dataLoaded && this.mode === 'modelfree' && this._defaultPageId !== this.defaultPageId) { | ||
this.defaultPageId = this._defaultPageId; | ||
this.setPageHash(this.pageHash, true); | ||
this.cancelScheduledRender(); | ||
} | ||
super.unloadData(); | ||
} | ||
initDom() { | ||
@@ -142,11 +155,2 @@ super.initDom(); | ||
); | ||
// setup the drag&drop listeners for model free mode | ||
if (this.options.mode === 'modelfree') { | ||
this.dom.container.addEventListener('drop', event => this.constructor.modelfreeLoadData(this, event), true); | ||
this.dom.container.addEventListener('dragover', event => { | ||
event.stopPropagation(); | ||
event.preventDefault(); | ||
}, true); | ||
} | ||
} | ||
@@ -153,0 +157,0 @@ |
export function escapeHtml(str) { | ||
return str | ||
.replace(/&/g, '&') | ||
.replace(/"/g, '"') | ||
.replace(/</g, '<') | ||
.replace(/>/g, '>'); | ||
} |
@@ -127,12 +127,6 @@ import Publisher from '../publisher.js'; | ||
return loadDataFromStream( | ||
() => { | ||
if (file.type !== 'application/json') { | ||
throw new Error('Not a JSON file'); | ||
} | ||
return { | ||
stream: streamFromBlob(file), | ||
size: file.size | ||
}; | ||
}, | ||
() => ({ | ||
stream: streamFromBlob(file), | ||
size: file.size | ||
}), | ||
data => ({ | ||
@@ -255,5 +249,5 @@ data, | ||
progressbar.setState({ stage, progress }); | ||
return progressbar.setState({ stage, progress }); | ||
}); | ||
}); | ||
} |
@@ -441,2 +441,4 @@ /* eslint-env browser */ | ||
// attach to host | ||
host.actions.startInspect = enableInspect; | ||
host.actions.stopInspect = disableInspect; | ||
host.inspectMode.subscribeSync( | ||
@@ -443,0 +445,0 @@ enabled => enabled ? enableInspect() : disableInspect() |
@@ -6,2 +6,3 @@ import App from './app/index.js'; | ||
import inspector from './inspector/index.js'; | ||
import upload from './core/upload.js'; | ||
import router from './core/router.js'; | ||
@@ -18,4 +19,5 @@ import utils from './core/utils/index.js'; | ||
inspector, | ||
upload, | ||
router, | ||
utils | ||
}; |
@@ -1,3 +0,1 @@ | ||
import { createElement } from '../core/utils/dom.js'; | ||
export function indexPage(host) { | ||
@@ -22,8 +20,5 @@ host.nav.append({ | ||
name: 'load-data', | ||
content: 'text:"Load data"', | ||
onClick: () => createElement('input', { | ||
type: 'file', | ||
accept: 'application/json,.json', | ||
onchange: event => host.constructor.modelfreeLoadData(host, event) | ||
}).click() | ||
when: '#.actions.uploadFile and (#.dataLoaded or (#.widget | pageId != defaultPageId))', | ||
content: 'text:"Open file…"', | ||
onClick: '=#.actions.uploadFile' | ||
}); | ||
@@ -30,0 +25,0 @@ } |
@@ -1,3 +0,1 @@ | ||
import { createElement } from '../core/utils/dom.js'; | ||
export default function(host) { | ||
@@ -8,24 +6,27 @@ host.page.define('default', { | ||
{ | ||
when: '#.modelfree', | ||
when: 'not #.dataLoaded', | ||
content: [ | ||
{ | ||
view: 'h1', | ||
className: 'modelfree', | ||
content: [ | ||
'text:"Discovery "', | ||
'badge:{ text: "model free mode" }' | ||
] | ||
className: 'no-data-loaded', | ||
content: 'text:"Discovery.js"' | ||
}, | ||
'html:"<p>Running in <b>model free mode</b>, because no config or models are set up. Please, read <a class=\\"view-link\\" href=\\"https://github.com/discoveryjs/discovery/blob/master/README.md\\" href=\\"_blank\\">documention</a> for more details."', | ||
'html:"<p>Load data (JSON) with a button or just drop a file on the page.</p>"', | ||
{ | ||
view: 'markdown', | ||
when: '#.modelfree', | ||
source: 'Running in `model free mode` since no config or model is set. However, you can load the JSON file, analyse it, and create your own report.\n\nSee <a class="view-link" href="https://github.com/discoveryjs/discovery/blob/master/README.md" href="_blank">documention</a> for details.' | ||
}, | ||
{ | ||
view: 'markdown', | ||
when: 'meta.description', | ||
source: '=meta.description' | ||
}, | ||
'html:"<br>"', | ||
{ | ||
view: 'button-primary', | ||
onClick: () => createElement('input', { | ||
type: 'file', | ||
accept: 'application/json,.json', | ||
onchange: event => host.constructor.modelfreeLoadData(host, event) | ||
}).click(), | ||
content: 'text:"Load data"' | ||
} | ||
onClick: '=#.actions.uploadFile', | ||
content: 'text:`Open file ${#.actions.uploadFile.fileExtensions | $ ? "(" + join(", ") + ")" : ""}`' | ||
}, | ||
'html:"<span style=\\"color: #888; padding: 0 1ex\\"> or </span>"', | ||
'text:"drop a file on the page"' | ||
] | ||
@@ -32,0 +33,0 @@ }, |
@@ -130,3 +130,3 @@ /* eslint-env browser */ | ||
className: 'discovery-view-usage', | ||
data: ({ name, options }) => { | ||
data({ name, options }) { | ||
const group = [...host.view.values] | ||
@@ -133,0 +133,0 @@ .filter(view => view.options.usage === options.usage) |
/* eslint-env browser */ | ||
import usage from './image-preview.usage.js'; | ||
export default function(host) { | ||
host.view.define('image-preview', function(el, config) { | ||
host.view.define('image-preview', function(el, config, data, context) { | ||
this.render(el, { | ||
view: 'image', | ||
...config | ||
}); | ||
}); | ||
}, data, context); | ||
}, { usage }); | ||
} |
/* eslint-env browser */ | ||
import usage from './image.usage.js'; | ||
export default function(host) { | ||
@@ -7,3 +9,3 @@ host.view.define('image', function(el, config) { | ||
el.onload = () => el.classList.add('loaded'); | ||
}, { tag: 'img' }); | ||
}, { tag: 'img', usage }); | ||
} |
@@ -38,7 +38,7 @@ export { default as alerts } from './alerts.js'; | ||
export { default as switch } from './switch.js'; | ||
export { default as table } from './table.js'; | ||
export { default as tableRow } from './table-row.js'; | ||
export { default as tableCell } from './table-cell.js'; | ||
export { default as tableRow } from './table-row.js'; | ||
export { default as table } from './table.js'; | ||
export { default as tabs } from './tabs.js'; | ||
export { default as tab } from './tab.js'; | ||
export { default as tabs } from './tabs.js'; | ||
export { default as text } from './text.js'; | ||
@@ -49,3 +49,3 @@ export { default as textMatch } from './text-match.js'; | ||
export { default as toggleGroup } from './toggle-group.js'; | ||
export { default as tree } from './tree.js'; | ||
export { default as treeItem } from './tree-leaf.js'; | ||
export { default as tree } from './tree.js'; |
@@ -13,3 +13,3 @@ export default (view, group) => ({ | ||
content: group.map(view => [ | ||
'header:' + JSON.stringify('# ' + view), | ||
`header{ content: 'md:${JSON.stringify('`view: \\"' + view + '\\"`')}' }`, | ||
view | ||
@@ -16,0 +16,0 @@ ]) |
/* eslint-env browser */ | ||
import marked from 'marked'; | ||
import { marked } from 'marked'; | ||
import usage from './markdown.usage.js'; | ||
@@ -19,3 +19,3 @@ import { escapeHtml } from '../core/utils/html.js'; | ||
anchor = `<a class="view-header__anchor" id="!anchor:${slug}" href="${href}"></a>`; | ||
anchor = `<a class="view-header__anchor" id="!anchor:${escapeHtml(slug)}" href="${href}"></a>`; | ||
} | ||
@@ -34,3 +34,3 @@ | ||
if (title) { | ||
out += ' title="' + title + '"'; | ||
out += ' title="' + escapeHtml(title) + '"'; | ||
} | ||
@@ -47,2 +47,24 @@ | ||
checkbox(checked) { | ||
return ( | ||
'<label class="view-checkbox"><input type="checkbox" disabled' + | ||
(checked ? ' checked' : '') + | ||
'/></label> ' | ||
); | ||
} | ||
list(body, ordered, start) { | ||
const tag = ordered ? 'ol' : 'ul'; | ||
const startAttr = ordered && start !== 1 ? ` start="${start}"` : ''; | ||
return ( | ||
`<${tag} class="view-${tag}"${startAttr}>\n` + | ||
body + | ||
`\n</${tag}>\n` | ||
); | ||
} | ||
listitem(text) { | ||
return '<li class="view-list-item">' + text + '</li>\n'; | ||
} | ||
table(header, body) { | ||
@@ -63,6 +85,8 @@ return '<table class="view-table">\n' + | ||
const type = flags.header ? 'th' : 'td'; | ||
const tag = flags.align | ||
? '<' + type + ' align="' + flags.align + '" class="view-table-cell">' | ||
: '<' + type + '>'; | ||
return tag + content + '</' + type + '>\n'; | ||
return ( | ||
`<${type} class="view-table-cell"${flags.align ? ` align="${flags.align}"` : ''}>` + | ||
content + | ||
`</${type}>\n` | ||
); | ||
} | ||
@@ -80,3 +104,3 @@ } | ||
discovery: host, | ||
highlight: function(content, syntax, callback) { | ||
highlight(content, syntax, callback) { | ||
const buffer = document.createDocumentFragment(); | ||
@@ -88,5 +112,44 @@ host.view.render(buffer, 'source', { syntax, content }) | ||
function render(el, config, data) { | ||
function applyTextInterpolation(value, values) { | ||
return value.replace(/{{(\d+)}}/gs, (_, index) => values[index]); | ||
} | ||
function applyInterpolations(el, values) { | ||
for (const child of el.childNodes) { | ||
switch (child.nodeType) { | ||
case document.ELEMENT_NODE: | ||
if (!child.classList.contains('view-source')) { | ||
applyInterpolations(child, values); | ||
for (const attribute of child.attributes) { | ||
attribute.nodeValue = applyTextInterpolation(attribute.nodeValue, values); | ||
} | ||
} | ||
break; | ||
case document.TEXT_NODE: | ||
child.nodeValue = applyTextInterpolation(child.nodeValue, values); | ||
break; | ||
} | ||
} | ||
} | ||
function render(el, config, data, context) { | ||
const { source, anchors = true } = config; | ||
const interpolations = new Map(); | ||
let mdSource = typeof data === 'string' ? data : source || ''; | ||
if (Array.isArray(mdSource)) { | ||
mdSource = mdSource.join('\n'); | ||
} | ||
mdSource = mdSource.replace(/{{(.+?)}}/gs, (_, query) => { | ||
query = query.trim(); | ||
if (!interpolations.has(query)) { | ||
interpolations.set(query, interpolations.size); | ||
} | ||
return `{{${interpolations.get(query)}}}`; | ||
}); | ||
el.classList.add('view-markdown'); | ||
@@ -96,6 +159,21 @@ | ||
marked( | ||
typeof data === 'string' ? data : source || '', | ||
mdSource, | ||
{ ...opts, anchors }, | ||
(er, html) => { | ||
el.innerHTML = html.replace(/\n(<\/code>)/g, '$1'); // FIXME: marked adds extra newline before </code> for unknown reason | ||
if (interpolations.size > 0) { | ||
const interpolationValues = new Array(interpolations.size); | ||
for (const [query, index] of interpolations.entries()) { | ||
try { | ||
interpolationValues[index] = host.query(query, data, context); | ||
} catch (e) { | ||
console.error('Interpolation query error: ' + e.message); | ||
} | ||
} | ||
applyInterpolations(el, interpolationValues); | ||
} | ||
resolve(); | ||
@@ -102,0 +180,0 @@ } |
export default { | ||
demo: { | ||
view: 'markdown', | ||
source: '# Example\n\n> NOTE: That\'s an experimental view based on [marked](https://github.com/markedjs/marked)\n\nMarkdown is good because:\n* You\'ll get **formatted** *text* with _no tags_\n* It\'s much simpler than `HTML`\n\n```html\n<b>bold</b><i>italic</i>\n```\n[Read more](https://guides.github.com/features/mastering-markdown/)' | ||
source: '# Markdown example\n\n> NOTE: That\'s an experimental view based on [marked](https://github.com/markedjs/marked)\n\nMarkdown is good because:\n* You\'ll get **formatted** *text* with _no tags_\n* It\'s much simpler than `HTML`\n\n```html\n<b>bold</b><i>italic</i>\n```\n[Read more](https://guides.github.com/features/mastering-markdown/)' | ||
}, | ||
@@ -12,18 +12,38 @@ examples: [ | ||
{ | ||
title: 'Shortest example', | ||
beforeDemo: ['md:"You can use `md` alias for `markdown` with a string as data. That\'s a **shortest** definition for a marked text"'], | ||
title: 'Shorthand syntax', | ||
beforeDemo: ['md:"You can use `md` as an alias for `markdown` with a string as data. That\'s a **shortest** definition for a marked text"'], | ||
demo: 'md:"**Hello** `world`!"' | ||
}, | ||
{ | ||
title: 'Array of strings as a source', | ||
beforeDemo: ['md:"Array of strings might be passed as a value for `source` property which is useful for a long sources\\n> NOTE: This doesn\'t work a source passed via data"'], | ||
demo: { | ||
view: 'markdown', | ||
source: ['Array', 'of', '`strings`'] | ||
} | ||
}, | ||
{ | ||
title: 'Interpolation', | ||
beforeDemo: ['md:"Interpolation can be used almost anywhere in a markdown to embed the result of a jora query into resulting HTML. Just wrap a jora query in `{{`{{}` + `}`}}`:"'], | ||
demo: { | ||
view: 'md', | ||
source: [ | ||
'Simple evaluation: 2 + 2 = `{{ 2 + 2 }}`', | ||
'', | ||
'Markdown view has {{ viewDef.examples.size() }} examples' | ||
] | ||
} | ||
}, | ||
{ | ||
title: 'Disable anchors for headers', | ||
beforeDemo: 'Hover a header to see chain icon on left side when anchors are enabled', | ||
beforeDemo: 'Hover a header to see a chain icon on the left side of header when anchors are enabled:', | ||
demo: [ | ||
{ | ||
view: 'markdown', | ||
anchors: false, | ||
source: '## header with disabled anchor' | ||
source: '## header with default settings' | ||
}, | ||
{ | ||
view: 'markdown', | ||
source: '## header with default settings' | ||
anchors: false, | ||
source: '## header with disabled anchor' | ||
} | ||
@@ -49,6 +69,9 @@ ] | ||
6. Six | ||
- [ ] Task 1 | ||
- [{{ true }}] Task 1 | ||
- [x] Task 2 | ||
Interpolation in text: 2 + 2 = \`{{ 2 + 2 }}\`, or in attribute: [link](#dummy-link/{{"exam" + "ple"}} "{{ "example" + " title" }}") | ||
Paragraph **bold** __bold__ *italic* _italic_ ~line-through~ \`code\` [link](#href) | ||
>Blockquote | ||
@@ -66,3 +89,3 @@ > > Line 2 | ||
3 | E | ||
` | ||
`.trim().split(/\n/) | ||
} | ||
@@ -69,0 +92,0 @@ } |
@@ -6,4 +6,4 @@ /* eslint-env browser */ | ||
demo: { | ||
data: { text: 'I am nav button' }, | ||
view: 'nav-button' | ||
view: 'nav-button', | ||
data: { text: 'I am nav button' } | ||
}, | ||
@@ -30,3 +30,3 @@ examples: [ | ||
data: { text: 'I am nav button'}, | ||
onClick: onClick | ||
onClick | ||
} | ||
@@ -33,0 +33,0 @@ } |
@@ -28,5 +28,12 @@ /* eslint-env browser */ | ||
function isElementNullOrInDocument(element) { | ||
return element ? element.getRootNode({ composed: true }) === document : true; | ||
} | ||
function hideIfEventOutside(event) { | ||
openedPopups.slice().forEach(popup => popup.hideIfEventOutside(event)); | ||
} | ||
function hideIfTriggerElementNotInDocument() { | ||
openedPopups.slice().forEach(popup => popup.hideIfTriggerElementNotInDocument()); | ||
} | ||
function hideOnResize(event) { | ||
@@ -80,3 +87,3 @@ openedPopups.slice().forEach(popup => popup.hideOnResize(event)); | ||
for (const instance of hoverTriggerInstances) { | ||
if (instance.lastHoverTriggerEl && instance.lastHoverTriggerEl === target) { | ||
if (instance.lastHoverTriggerEl === target) { | ||
instance.lastHoverTriggerEl = null; | ||
@@ -89,5 +96,3 @@ instance.hideTimer = setTimeout(instance.hide, 100); | ||
host.addGlobalEventListener('scroll', (event) => { | ||
hideAllPopups = setTimeout(() => { | ||
hideIfEventOutside(event); | ||
}, 0); | ||
hideAllPopups = setTimeout(() => hideIfEventOutside(event), 0); | ||
}, true), | ||
@@ -101,5 +106,3 @@ | ||
host.addGlobalEventListener('click', (event) => { | ||
hideAllPopups = setTimeout(() => { | ||
hideIfEventOutside(event); | ||
}, 0); | ||
hideAllPopups = setTimeout(() => hideIfEventOutside(event), 0); | ||
}, true), | ||
@@ -110,2 +113,3 @@ | ||
hideIfEventOutside(event); | ||
setTimeout(hideIfTriggerElementNotInDocument, 0); | ||
@@ -335,2 +339,9 @@ for (const instance of hoverTriggerInstances) { | ||
hideIfTriggerElementNotInDocument() { | ||
if (!isElementNullOrInDocument(this.lastHoverTriggerEl) || | ||
!isElementNullOrInDocument(this.lastTriggerEl)) { | ||
this.hide(); | ||
} | ||
} | ||
hideOnResize() { | ||
@@ -337,0 +348,0 @@ if (!this.options.hideOnResize || inspectorLockedInstances.has(this)) { |
@@ -6,2 +6,3 @@ /* eslint-env browser */ | ||
import { renderPropertyDetails, renderTypeDetails } from './render-details.js'; | ||
import usage from './signature.usage.js'; | ||
@@ -102,3 +103,5 @@ export default function(host) { | ||
renderStat(el, stat, elementToData, normPath); | ||
}, { | ||
usage | ||
}); | ||
} |
@@ -8,3 +8,3 @@ /* eslint-env browser */ | ||
import renderAnnotations from './render-annotations.js'; | ||
import usage from './index.usage.js'; | ||
import usage from './struct.usage.js'; | ||
import { | ||
@@ -441,3 +441,3 @@ stringValueProto, | ||
host.view.define('struct', function(el, config, data) { | ||
const { expanded, limit, limitCollapsed, annotations } = config; // FIXME: add limit option | ||
const { expanded, limit, limitCollapsed, annotations } = config; | ||
const expandable = isValueExpandable(data); | ||
@@ -444,0 +444,0 @@ const options = { |
@@ -42,8 +42,8 @@ import { escapeHtml } from '../../core/utils/html.js'; | ||
'string', | ||
escapeHtml(JSON.stringify(value.substr(0, maxLength))) | ||
.replace(/"$/, more(value.length - maxLength) + '"') | ||
escapeHtml(JSON.stringify(value.slice(0, maxLength)).slice(0, -1)) + | ||
more(value.length - maxLength) + '"' | ||
); | ||
} | ||
const str = escapeHtml(JSON.stringify(value)); | ||
const str = JSON.stringify(value); | ||
@@ -53,4 +53,4 @@ return token( | ||
!linear && (value[0] === 'h' || value[0] === '/') && urlRx.test(value) | ||
? `"<a href="${escapeHtml(value)}" target="_blank">${str.substr(1, str.length - 2)}</a>"` | ||
: str | ||
? `"<a href="${escapeHtml(value)}" target="_blank">${escapeHtml(str.slice(1, -1))}</a>"` | ||
: escapeHtml(str) | ||
); | ||
@@ -57,0 +57,0 @@ } |
@@ -14,2 +14,3 @@ /* eslint-env browser */ | ||
el.classList.add('complex'); | ||
for (let k in data) { | ||
@@ -21,2 +22,3 @@ if (Object.prototype.hasOwnProperty.call(data, k)) { | ||
} | ||
el.textContent = '{}'; | ||
@@ -32,3 +34,13 @@ return; | ||
if (typeof data === 'number') { | ||
let str = String(data); | ||
el.classList.add('number'); | ||
if (str.length > 3) { | ||
el.innerHTML = str.replace(/\..+$|\B(?=(\d{3})+(\D|$))/g, m => m || '<span class="num-delim"></span>'); | ||
} else { | ||
el.textContent = str; | ||
} | ||
return; | ||
} | ||
@@ -35,0 +47,0 @@ |
@@ -12,3 +12,3 @@ /* eslint-env browser */ | ||
import injectStyles from '../core/utils/inject-styles.js'; | ||
import attachViewInspector from '../inspector/index.js'; | ||
import inspector from '../inspector/index.js'; | ||
import { equal, fuzzyStringCompare } from '../core/utils/compare.js'; | ||
@@ -59,5 +59,10 @@ import { DarkModeController } from '../core/darkmode.js'; | ||
this.options = options || {}; | ||
this.actions = {}; | ||
const { | ||
darkmode = 'disabled', | ||
darkmodePersistent = false | ||
darkmodePersistent = false, | ||
defaultPageId, | ||
reportPageId, | ||
extensions, | ||
inspector: useInspector = false | ||
} = this.options; | ||
@@ -90,7 +95,10 @@ | ||
this.dataLoaded = false; | ||
this.data = undefined; | ||
this.context = undefined; | ||
this.prepare = data => data; | ||
createDataExtensionApi(this).apply(); | ||
this.defaultPageId = this.options.defaultPageId || 'default'; | ||
this.reportPageId = this.options.reportPageId || 'report'; | ||
this.defaultPageId = defaultPageId || 'default'; | ||
this.reportPageId = reportPageId || 'report'; | ||
this.pageId = this.defaultPageId; | ||
@@ -108,8 +116,8 @@ this.pageRef = null; | ||
if (this.options.extensions) { | ||
this.apply(this.options.extensions); | ||
if (extensions) { | ||
this.apply(extensions); | ||
} | ||
if (this.options.inspector || this.options.inspector === undefined) { | ||
this.apply(attachViewInspector); | ||
if (useInspector) { | ||
this.apply(inspector); | ||
} | ||
@@ -167,2 +175,3 @@ | ||
this.dataLoaded = true; | ||
this.data = data; | ||
@@ -205,2 +214,15 @@ this.context = context; | ||
unloadData() { | ||
if (!this.dataLoaded) { | ||
return; | ||
} | ||
this.dataLoaded = false; | ||
this.data = undefined; | ||
this.context = undefined; | ||
this.scheduleRender('sidebar'); | ||
this.scheduleRender('page'); | ||
} | ||
// TODO: remove | ||
@@ -490,2 +512,4 @@ addEntityResolver() { | ||
params: this.pageParams, | ||
actions: this.actions, | ||
dataLoaded: this.dataLoaded, | ||
...this.context | ||
@@ -503,3 +527,3 @@ }; | ||
if (this.view.isDefined('sidebar')) { | ||
if (this.dataLoaded && this.view.isDefined('sidebar')) { | ||
const renderStartTime = Date.now(); | ||
@@ -506,0 +530,0 @@ const data = this.data; |
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 too big to display
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
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
250
16415
119
1142622
+ Addedmarked@4.3.0(transitive)
- Removedmarked@2.1.3(transitive)
Updated@discoveryjs/json-ext@^0.5.6
Updatedcodemirror@^5.65.1
Updatedmarked@^4.0.2