@observablehq/inspector
Advanced tools
Comparing version 3.2.0 to 3.2.1
@@ -1,2 +0,2 @@ | ||
// @observablehq/inspector v3.2.0 Copyright 2019 Observable, Inc. | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e=e||self).observablehq=e.observablehq||{})}(this,function(e){"use strict";function n(e,n,t){t=t||{};var o=e.ownerDocument,r=o.defaultView.CustomEvent;"function"==typeof r?r=new r(n,{detail:t}):((r=o.createEvent("Event")).initEvent(n,!1,!1),r.detail=t),e.dispatchEvent(r)}function t(e){return Array.isArray(e)||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function o(e){return e===(0|e)+""}function r(e){const n=document.createElement("span");return n.className="observablehq--cellname",n.textContent=`${e} = `,n}const a=Symbol.prototype.toString;function s(e){return a.call(e)}const{getOwnPropertySymbols:c,prototype:{hasOwnProperty:i}}=Object,{toStringTag:l}=Symbol,d={},u=c;function p(e,n){return i.call(e,n)}function f(e){return e[l]||e.constructor&&e.constructor.name||"Object"}function m(e,n){try{const t=e[n];return t&&t.constructor,t}catch(e){return d}}const h=[{symbol:"@@__IMMUTABLE_INDEXED__@@",name:"Indexed",modifier:!0},{symbol:"@@__IMMUTABLE_KEYED__@@",name:"Keyed",modifier:!0},{symbol:"@@__IMMUTABLE_LIST__@@",name:"List",arrayish:!0},{symbol:"@@__IMMUTABLE_MAP__@@",name:"Map"},{symbol:"@@__IMMUTABLE_ORDERED__@@",name:"Ordered",modifier:!0,prefix:!0},{symbol:"@@__IMMUTABLE_RECORD__@@",name:"Record"},{symbol:"@@__IMMUTABLE_SET__@@",name:"Set",arrayish:!0,setish:!0},{symbol:"@@__IMMUTABLE_STACK__@@",name:"Stack",arrayish:!0}];function b(e){try{let n=h.filter(({symbol:n})=>!0===e[n]);if(!n.length)return;const t=n.find(e=>!e.modifier),o="Map"===t.name&&n.find(e=>e.modifier&&e.prefix),r=n.some(e=>e.arrayish),a=n.some(e=>e.setish);return{name:`${o?o.name:""}${t.name}`,symbols:n,arrayish:r&&!a,setish:a}}catch(e){return null}}const{getPrototypeOf:y,getOwnPropertyDescriptors:v}=Object,C=y({});function g(e,o,a,s){let c,i,l,d,u=t(e);e instanceof Map?(c=`Map(${e.size})`,i=x):e instanceof Set?(c=`Set(${e.size})`,i=E):u?(c=`${e.constructor.name}(${e.length})`,i=N):(d=b(e))?(c=`Immutable.${d.name}${"Record"===d.name?"":`(${e.size})`}`,u=d.arrayish,i=d.arrayish?_:d.setish?q:S):s?(c=f(e),i=T):(c=f(e),i=M);const p=document.createElement("span");p.className="observablehq--expanded",a&&p.appendChild(r(a));const m=p.appendChild(document.createElement("a"));m.innerHTML="<svg width=8 height=8 class='observablehq--caret'>\n <path d='M4 7L0 1h8z' fill='currentColor' />\n </svg>",m.appendChild(document.createTextNode(`${c}${u?" [":" {"}`)),m.addEventListener("mouseup",function(n){n.stopPropagation(),ie(p,U(e,null,a,s))}),i=i(e);for(let e=0;!(l=i.next()).done&&e<20;++e)p.appendChild(l.value);if(!l.done){const e=p.appendChild(document.createElement("a"));e.className="observablehq--field",e.style.display="block",e.appendChild(document.createTextNode(" … more")),e.addEventListener("mouseup",function(e){e.stopPropagation(),p.insertBefore(l.value,p.lastChild.previousSibling);for(let e=0;!(l=i.next()).done&&e<19;++e)p.insertBefore(l.value,p.lastChild.previousSibling);l.done&&p.removeChild(p.lastChild.previousSibling),n(p,"load")})}return p.appendChild(document.createTextNode(u?"]":"}")),p}function*x(e){for(const[n,t]of e)yield w(n,t);yield*M(e)}function*E(e){for(const n of e)yield A(n);yield*M(e)}function*q(e){for(const n of e)yield A(n)}function*N(e){for(let n=0,t=e.length;n<t;++n)n in e&&(yield L(n,m(e,n),"observablehq--index"));for(const n in e)!o(n)&&p(e,n)&&(yield L(n,m(e,n),"observablehq--key"));for(const n of u(e))yield L(s(n),m(e,n),"observablehq--symbol")}function*_(e){let n=0;for(const t=e.size;n<t;++n)yield L(n,e.get(n),!0)}function*T(e){for(const n in v(e))yield L(n,m(e,n),"observablehq--key");for(const n of u(e))yield L(s(n),m(e,n),"observablehq--symbol");const n=y(e);n&&n!==C&&(yield $(n))}function*M(e){for(const n in e)p(e,n)&&(yield L(n,m(e,n),"observablehq--key"));for(const n of u(e))yield L(s(n),m(e,n),"observablehq--symbol");const n=y(e);n&&n!==C&&(yield $(n))}function*S(e){for(const[n,t]of e)yield L(n,t,"observablehq--key")}function $(e){const n=document.createElement("div"),t=n.appendChild(document.createElement("span"));n.className="observablehq--field",t.className="observablehq--prototype-key";const o=e.constructor.name;return t.textContent=` <${o} prototype>`,n.appendChild(document.createTextNode(": ")),n.appendChild(ce(e,void 0,void 0,void 0,!0)),n}function L(e,n,t){const o=document.createElement("div"),r=o.appendChild(document.createElement("span"));return o.className="observablehq--field",r.className=t,r.textContent=` ${e}`,o.appendChild(document.createTextNode(": ")),o.appendChild(ce(n)),o}function w(e,n){const t=document.createElement("div");return t.className="observablehq--field",t.appendChild(document.createTextNode(" ")),t.appendChild(ce(e)),t.appendChild(document.createTextNode(" => ")),t.appendChild(ce(n)),t}function A(e){const n=document.createElement("div");return n.className="observablehq--field",n.appendChild(document.createTextNode(" ")),n.appendChild(ce(e)),n}function k(e){const n=window.getSelection();return"Range"===n.type&&(n.containsNode(e,!0)||n.anchorNode.isSelfOrDescendant(e)||n.focusNode.isSelfOrDescendant(e))}function U(e,n,o,a){let s,c,i,l,d=t(e);if(e instanceof Map?(s=`Map(${e.size})`,c=I):e instanceof Set?(s=`Set(${e.size})`,c=D):d?(s=`${e.constructor.name}(${e.length})`,c=P):(l=b(e))?(s=`Immutable.${l.name}${"Record"===l.name?"":`(${e.size})`}`,d=l.arrayish,c=l.arrayish?j:l.setish?O:B):(s=f(e),c=z),n){const n=document.createElement("span");return n.className="observablehq--shallow",o&&n.appendChild(r(o)),n.appendChild(document.createTextNode(s)),n.addEventListener("mouseup",function(t){k(n)||(t.stopPropagation(),ie(n,U(e)))}),n}const u=document.createElement("span");u.className="observablehq--collapsed",o&&u.appendChild(r(o));const p=u.appendChild(document.createElement("a"));p.innerHTML="<svg width=8 height=8 class='observablehq--caret'>\n <path d='M7 4L1 8V0z' fill='currentColor' />\n </svg>",p.appendChild(document.createTextNode(`${s}${d?" [":" {"}`)),u.addEventListener("mouseup",function(n){k(u)||(n.stopPropagation(),ie(u,g(e,0,o,a)))},!0),c=c(e);for(let e=0;!(i=c.next()).done&&e<20;++e)e>0&&u.appendChild(document.createTextNode(", ")),u.appendChild(i.value);return i.done||u.appendChild(document.createTextNode(", …")),u.appendChild(document.createTextNode(d?"]":"}")),u}function*I(e){for(const[n,t]of e)yield H(n,t);yield*z(e)}function*D(e){for(const n of e)yield ce(n,!0);yield*z(e)}function*O(e){for(const n of e)yield ce(n,!0)}function*j(e){let n=-1,t=0;for(const o=e.size;t<o;++t)t>n+1&&(yield F(t-n-1)),yield ce(e.get(t),!0),n=t;t>n+1&&(yield F(t-n-1))}function*P(e){let n=-1,t=0;for(const o=e.length;t<o;++t)t in e&&(t>n+1&&(yield F(t-n-1)),yield ce(m(e,t),!0),n=t);t>n+1&&(yield F(t-n-1));for(const n in e)!o(n)&&p(e,n)&&(yield R(n,m(e,n),"observablehq--key"));for(const n of u(e))yield R(s(n),m(e,n),"observablehq--symbol")}function*z(e){for(const n in e)p(e,n)&&(yield R(n,m(e,n),"observablehq--key"));for(const n of u(e))yield R(s(n),m(e,n),"observablehq--symbol")}function*B(e){for(const[n,t]of e)yield R(n,t,"observablehq--key")}function F(e){const n=document.createElement("span");return n.className="observablehq--empty",n.textContent=1===e?"empty":`empty × ${e}`,n}function R(e,n,t){const o=document.createDocumentFragment(),r=o.appendChild(document.createElement("span"));return r.className=t,r.textContent=e,o.appendChild(document.createTextNode(": ")),o.appendChild(ce(n,!0)),o}function H(e,n){const t=document.createDocumentFragment();return t.appendChild(ce(e,!0)),t.appendChild(document.createTextNode(" => ")),t.appendChild(ce(n,!0)),t}function K(e,n){var t=e+"",o=t.length;return o<n?new Array(n-o+1).join(0)+t:t}function Y(e){return e<0?"-"+K(-e,6):e>9999?"+"+K(e,6):K(e,4)}var G=Error.prototype.toString;var J=RegExp.prototype.toString;const V=20;function X(e){return e.replace(/[\\`\x00-\x09\x0b-\x19]|\${/g,Q)}function Q(e){var n=e.charCodeAt(0);switch(n){case 8:return"\\b";case 9:return"\\t";case 11:return"\\v";case 12:return"\\f";case 13:return"\\r"}return n<16?"\\x0"+n.toString(16):n<32?"\\x"+n.toString(16):"\\"+e}function W(e,n){for(var t=0;n.exec(e);)++t;return t}var Z=Function.prototype.toString,ee={prefix:"async ƒ"},ne={prefix:"async ƒ*"},te={prefix:"class"},oe={prefix:"ƒ"},re={prefix:"ƒ*"};function ae(e,n,t){var o=document.createElement("span");o.className="observablehq--function",t&&o.appendChild(r(t));var a=o.appendChild(document.createElement("span"));return a.className="observablehq--keyword",a.textContent=e.prefix,o.appendChild(document.createTextNode(n)),o}const{prototype:{toString:se}}=Object;function ce(e,n,t,o,a){let c=typeof e;switch(c){case"boolean":case"undefined":e+="";break;case"number":e=0===e&&1/e<0?"-0":e+"";break;case"bigint":e+="n";break;case"symbol":e=s(e);break;case"function":return function(e,n){var t,o,r=Z.call(e);switch(e.constructor&&e.constructor.name){case"AsyncFunction":t=ee;break;case"AsyncGeneratorFunction":t=ne;break;case"GeneratorFunction":t=re;break;default:t=/^class\b/.test(r)?te:oe}return t===te?ae(t,"",n):(o=/^(?:async\s*)?(\w+)\s*=>/.exec(r))?ae(t,"("+o[1]+")",n):(o=/^(?:async\s*)?\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(r))?ae(t,o[1]?"("+o[1].replace(/\s*,\s*/g,", ")+")":"()",n):(o=/^(?:async\s*)?function(?:\s*\*)?(?:\s*\w+)?\s*\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(r))?ae(t,o[1]?"("+o[1].replace(/\s*,\s*/g,", ")+")":"()",n):ae(t,"(…)",n)}(e,o);case"string":return function(e,n,t,o){if(!1===n){if(W(e,/["\n]/g)<=W(e,/`|\${/g)){const n=document.createElement("span");o&&n.appendChild(r(o));const t=n.appendChild(document.createElement("span"));return t.className="observablehq--string",t.textContent=JSON.stringify(e),n}const a=e.split("\n");if(a.length>V&&!t){const t=document.createElement("div");o&&t.appendChild(r(o));const s=t.appendChild(document.createElement("span"));s.className="observablehq--string",s.textContent="`"+X(a.slice(0,V).join("\n"));const c=t.appendChild(document.createElement("span")),i=a.length-V;return c.textContent=`Show ${i} truncated line${i>1?"s":""}`,c.className="observablehq--string-expand",c.addEventListener("mouseup",function(r){r.stopPropagation(),ie(t,ce(e,n,!0,o))}),t}const s=document.createElement("span");o&&s.appendChild(r(o));const c=s.appendChild(document.createElement("span"));return c.className=`observablehq--string${t?" observablehq--expanded":""}`,c.textContent="`"+X(e)+"`",s}const a=document.createElement("span");o&&a.appendChild(r(o));const s=a.appendChild(document.createElement("span"));return s.className="observablehq--string",s.textContent=JSON.stringify(e.length>100?`${e.slice(0,50)}…${e.slice(-49)}`:e),a}(e,n,t,o);default:if(null===e){c=null,e="null";break}if(e instanceof Date){c="date",i=e,e=isNaN(i)?"Invalid Date":function(e){return 0===e.getUTCMilliseconds()&&0===e.getUTCSeconds()&&0===e.getUTCMinutes()&&0===e.getUTCHours()}(i)?Y(i.getUTCFullYear())+"-"+K(i.getUTCMonth()+1,2)+"-"+K(i.getUTCDate(),2):Y(i.getFullYear())+"-"+K(i.getMonth()+1,2)+"-"+K(i.getDate(),2)+"T"+K(i.getHours(),2)+":"+K(i.getMinutes(),2)+(i.getMilliseconds()?":"+K(i.getSeconds(),2)+"."+K(i.getMilliseconds(),3):i.getSeconds()?":"+K(i.getSeconds(),2):"");break}if(e===d){c="forbidden",e="[forbidden]";break}switch(se.call(e)){case"[object RegExp]":c="regexp",e=function(e){return J.call(e)}(e);break;case"[object Error]":case"[object DOMException]":c="error",e=function(e){return e.stack||G.call(e)}(e);break;default:return(t?g:U)(e,n,o,a)}}var i;const l=document.createElement("span");o&&l.appendChild(r(o));const u=l.appendChild(document.createElement("span"));return u.className=`observablehq--${c}`,u.textContent=e,l}function ie(e,t){e.classList.contains("observablehq--inspect")&&t.classList.add("observablehq--inspect"),e.parentNode.replaceChild(t,e),n(t,"load")}const le=/\s+\(\d+:\d+\)$/m;class de{constructor(e){if(!e)throw new Error("invalid node");this._node=e,e.classList.add("observablehq")}pending(){const{_node:e}=this;e.classList.remove("observablehq--error"),e.classList.add("observablehq--running")}fulfilled(e,t){const{_node:o}=this;if((!(e instanceof Element||e instanceof Text)||e.parentNode&&e.parentNode!==o)&&(e=ce(e,!1,o.firstChild&&o.firstChild.classList&&o.firstChild.classList.contains("observablehq--expanded"),t)).classList.add("observablehq--inspect"),o.classList.remove("observablehq--running","observablehq--error"),o.firstChild!==e)if(o.firstChild){for(;o.lastChild!==o.firstChild;)o.removeChild(o.lastChild);o.replaceChild(e,o.firstChild)}else o.appendChild(e);n(o,"update")}rejected(e,t){const{_node:o}=this;for(o.classList.remove("observablehq--running"),o.classList.add("observablehq--error");o.lastChild;)o.removeChild(o.lastChild);var a=document.createElement("div");a.className="observablehq--inspect",t&&a.appendChild(r(t)),a.appendChild(document.createTextNode((e+"").replace(le,""))),o.appendChild(a),n(o,"error",{error:e})}}de.into=function(e){if("string"==typeof e&&null==(e=document.querySelector(e)))throw new Error("container not found");return function(){return new de(e.appendChild(document.createElement("div")))}},e.Inspector=de,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
// @observablehq/inspector v3.2.1 Copyright 2019 Observable, Inc. | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e=e||self).observablehq=e.observablehq||{})}(this,function(e){"use strict";function n(e,n,t){t=t||{};var o=e.ownerDocument,r=o.defaultView.CustomEvent;"function"==typeof r?r=new r(n,{detail:t}):((r=o.createEvent("Event")).initEvent(n,!1,!1),r.detail=t),e.dispatchEvent(r)}function t(e){return Array.isArray(e)||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function o(e){return e===(0|e)+""}function r(e){const n=document.createElement("span");return n.className="observablehq--cellname",n.textContent=`${e} = `,n}const a=Symbol.prototype.toString;function s(e){return a.call(e)}const{getOwnPropertySymbols:c,prototype:{hasOwnProperty:i}}=Object,{toStringTag:l}=Symbol,d={},u=c;function p(e,n){return i.call(e,n)}function f(e){return e[l]||e.constructor&&e.constructor.name||"Object"}function m(e,n){try{const t=e[n];return t&&t.constructor,t}catch(e){return d}}const h=[{symbol:"@@__IMMUTABLE_INDEXED__@@",name:"Indexed",modifier:!0},{symbol:"@@__IMMUTABLE_KEYED__@@",name:"Keyed",modifier:!0},{symbol:"@@__IMMUTABLE_LIST__@@",name:"List",arrayish:!0},{symbol:"@@__IMMUTABLE_MAP__@@",name:"Map"},{symbol:"@@__IMMUTABLE_ORDERED__@@",name:"Ordered",modifier:!0,prefix:!0},{symbol:"@@__IMMUTABLE_RECORD__@@",name:"Record"},{symbol:"@@__IMMUTABLE_SET__@@",name:"Set",arrayish:!0,setish:!0},{symbol:"@@__IMMUTABLE_STACK__@@",name:"Stack",arrayish:!0}];function b(e){try{let n=h.filter(({symbol:n})=>!0===e[n]);if(!n.length)return;const t=n.find(e=>!e.modifier),o="Map"===t.name&&n.find(e=>e.modifier&&e.prefix),r=n.some(e=>e.arrayish),a=n.some(e=>e.setish);return{name:`${o?o.name:""}${t.name}`,symbols:n,arrayish:r&&!a,setish:a}}catch(e){return null}}const{getPrototypeOf:y,getOwnPropertyDescriptors:v}=Object,C=y({});function g(e,o,a,s){let c,i,l,d,u=t(e);e instanceof Map?(c=`Map(${e.size})`,i=x):e instanceof Set?(c=`Set(${e.size})`,i=E):u?(c=`${e.constructor.name}(${e.length})`,i=N):(d=b(e))?(c=`Immutable.${d.name}${"Record"===d.name?"":`(${e.size})`}`,u=d.arrayish,i=d.arrayish?_:d.setish?q:S):s?(c=f(e),i=T):(c=f(e),i=M);const p=document.createElement("span");p.className="observablehq--expanded",a&&p.appendChild(r(a));const m=p.appendChild(document.createElement("a"));m.innerHTML="<svg width=8 height=8 class='observablehq--caret'>\n <path d='M4 7L0 1h8z' fill='currentColor' />\n </svg>",m.appendChild(document.createTextNode(`${c}${u?" [":" {"}`)),m.addEventListener("mouseup",function(n){n.stopPropagation(),ie(p,U(e,null,a,s))}),i=i(e);for(let e=0;!(l=i.next()).done&&e<20;++e)p.appendChild(l.value);if(!l.done){const e=p.appendChild(document.createElement("a"));e.className="observablehq--field",e.style.display="block",e.appendChild(document.createTextNode(" … more")),e.addEventListener("mouseup",function(e){e.stopPropagation(),p.insertBefore(l.value,p.lastChild.previousSibling);for(let e=0;!(l=i.next()).done&&e<19;++e)p.insertBefore(l.value,p.lastChild.previousSibling);l.done&&p.removeChild(p.lastChild.previousSibling),n(p,"load")})}return p.appendChild(document.createTextNode(u?"]":"}")),p}function*x(e){for(const[n,t]of e)yield w(n,t);yield*M(e)}function*E(e){for(const n of e)yield A(n);yield*M(e)}function*q(e){for(const n of e)yield A(n)}function*N(e){for(let n=0,t=e.length;n<t;++n)n in e&&(yield L(n,m(e,n),"observablehq--index"));for(const n in e)!o(n)&&p(e,n)&&(yield L(n,m(e,n),"observablehq--key"));for(const n of u(e))yield L(s(n),m(e,n),"observablehq--symbol")}function*_(e){let n=0;for(const t=e.size;n<t;++n)yield L(n,e.get(n),!0)}function*T(e){for(const n in v(e))yield L(n,m(e,n),"observablehq--key");for(const n of u(e))yield L(s(n),m(e,n),"observablehq--symbol");const n=y(e);n&&n!==C&&(yield $(n))}function*M(e){for(const n in e)p(e,n)&&(yield L(n,m(e,n),"observablehq--key"));for(const n of u(e))yield L(s(n),m(e,n),"observablehq--symbol");const n=y(e);n&&n!==C&&(yield $(n))}function*S(e){for(const[n,t]of e)yield L(n,t,"observablehq--key")}function $(e){const n=document.createElement("div"),t=n.appendChild(document.createElement("span"));return n.className="observablehq--field",t.className="observablehq--prototype-key",t.textContent=" <prototype>",n.appendChild(document.createTextNode(": ")),n.appendChild(ce(e,void 0,void 0,void 0,!0)),n}function L(e,n,t){const o=document.createElement("div"),r=o.appendChild(document.createElement("span"));return o.className="observablehq--field",r.className=t,r.textContent=` ${e}`,o.appendChild(document.createTextNode(": ")),o.appendChild(ce(n)),o}function w(e,n){const t=document.createElement("div");return t.className="observablehq--field",t.appendChild(document.createTextNode(" ")),t.appendChild(ce(e)),t.appendChild(document.createTextNode(" => ")),t.appendChild(ce(n)),t}function A(e){const n=document.createElement("div");return n.className="observablehq--field",n.appendChild(document.createTextNode(" ")),n.appendChild(ce(e)),n}function k(e){const n=window.getSelection();return"Range"===n.type&&(n.containsNode(e,!0)||n.anchorNode.isSelfOrDescendant(e)||n.focusNode.isSelfOrDescendant(e))}function U(e,n,o,a){let s,c,i,l,d=t(e);if(e instanceof Map?(s=`Map(${e.size})`,c=I):e instanceof Set?(s=`Set(${e.size})`,c=D):d?(s=`${e.constructor.name}(${e.length})`,c=P):(l=b(e))?(s=`Immutable.${l.name}${"Record"===l.name?"":`(${e.size})`}`,d=l.arrayish,c=l.arrayish?j:l.setish?O:B):(s=f(e),c=z),n){const n=document.createElement("span");return n.className="observablehq--shallow",o&&n.appendChild(r(o)),n.appendChild(document.createTextNode(s)),n.addEventListener("mouseup",function(t){k(n)||(t.stopPropagation(),ie(n,U(e)))}),n}const u=document.createElement("span");u.className="observablehq--collapsed",o&&u.appendChild(r(o));const p=u.appendChild(document.createElement("a"));p.innerHTML="<svg width=8 height=8 class='observablehq--caret'>\n <path d='M7 4L1 8V0z' fill='currentColor' />\n </svg>",p.appendChild(document.createTextNode(`${s}${d?" [":" {"}`)),u.addEventListener("mouseup",function(n){k(u)||(n.stopPropagation(),ie(u,g(e,0,o,a)))},!0),c=c(e);for(let e=0;!(i=c.next()).done&&e<20;++e)e>0&&u.appendChild(document.createTextNode(", ")),u.appendChild(i.value);return i.done||u.appendChild(document.createTextNode(", …")),u.appendChild(document.createTextNode(d?"]":"}")),u}function*I(e){for(const[n,t]of e)yield H(n,t);yield*z(e)}function*D(e){for(const n of e)yield ce(n,!0);yield*z(e)}function*O(e){for(const n of e)yield ce(n,!0)}function*j(e){let n=-1,t=0;for(const o=e.size;t<o;++t)t>n+1&&(yield F(t-n-1)),yield ce(e.get(t),!0),n=t;t>n+1&&(yield F(t-n-1))}function*P(e){let n=-1,t=0;for(const o=e.length;t<o;++t)t in e&&(t>n+1&&(yield F(t-n-1)),yield ce(m(e,t),!0),n=t);t>n+1&&(yield F(t-n-1));for(const n in e)!o(n)&&p(e,n)&&(yield R(n,m(e,n),"observablehq--key"));for(const n of u(e))yield R(s(n),m(e,n),"observablehq--symbol")}function*z(e){for(const n in e)p(e,n)&&(yield R(n,m(e,n),"observablehq--key"));for(const n of u(e))yield R(s(n),m(e,n),"observablehq--symbol")}function*B(e){for(const[n,t]of e)yield R(n,t,"observablehq--key")}function F(e){const n=document.createElement("span");return n.className="observablehq--empty",n.textContent=1===e?"empty":`empty × ${e}`,n}function R(e,n,t){const o=document.createDocumentFragment(),r=o.appendChild(document.createElement("span"));return r.className=t,r.textContent=e,o.appendChild(document.createTextNode(": ")),o.appendChild(ce(n,!0)),o}function H(e,n){const t=document.createDocumentFragment();return t.appendChild(ce(e,!0)),t.appendChild(document.createTextNode(" => ")),t.appendChild(ce(n,!0)),t}function K(e,n){var t=e+"",o=t.length;return o<n?new Array(n-o+1).join(0)+t:t}function Y(e){return e<0?"-"+K(-e,6):e>9999?"+"+K(e,6):K(e,4)}var G=Error.prototype.toString;var J=RegExp.prototype.toString;const V=20;function X(e){return e.replace(/[\\`\x00-\x09\x0b-\x19]|\${/g,Q)}function Q(e){var n=e.charCodeAt(0);switch(n){case 8:return"\\b";case 9:return"\\t";case 11:return"\\v";case 12:return"\\f";case 13:return"\\r"}return n<16?"\\x0"+n.toString(16):n<32?"\\x"+n.toString(16):"\\"+e}function W(e,n){for(var t=0;n.exec(e);)++t;return t}var Z=Function.prototype.toString,ee={prefix:"async ƒ"},ne={prefix:"async ƒ*"},te={prefix:"class"},oe={prefix:"ƒ"},re={prefix:"ƒ*"};function ae(e,n,t){var o=document.createElement("span");o.className="observablehq--function",t&&o.appendChild(r(t));var a=o.appendChild(document.createElement("span"));return a.className="observablehq--keyword",a.textContent=e.prefix,o.appendChild(document.createTextNode(n)),o}const{prototype:{toString:se}}=Object;function ce(e,n,t,o,a){let c=typeof e;switch(c){case"boolean":case"undefined":e+="";break;case"number":e=0===e&&1/e<0?"-0":e+"";break;case"bigint":e+="n";break;case"symbol":e=s(e);break;case"function":return function(e,n){var t,o,r=Z.call(e);switch(e.constructor&&e.constructor.name){case"AsyncFunction":t=ee;break;case"AsyncGeneratorFunction":t=ne;break;case"GeneratorFunction":t=re;break;default:t=/^class\b/.test(r)?te:oe}return t===te?ae(t,"",n):(o=/^(?:async\s*)?(\w+)\s*=>/.exec(r))?ae(t,"("+o[1]+")",n):(o=/^(?:async\s*)?\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(r))?ae(t,o[1]?"("+o[1].replace(/\s*,\s*/g,", ")+")":"()",n):(o=/^(?:async\s*)?function(?:\s*\*)?(?:\s*\w+)?\s*\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(r))?ae(t,o[1]?"("+o[1].replace(/\s*,\s*/g,", ")+")":"()",n):ae(t,"(…)",n)}(e,o);case"string":return function(e,n,t,o){if(!1===n){if(W(e,/["\n]/g)<=W(e,/`|\${/g)){const n=document.createElement("span");o&&n.appendChild(r(o));const t=n.appendChild(document.createElement("span"));return t.className="observablehq--string",t.textContent=JSON.stringify(e),n}const a=e.split("\n");if(a.length>V&&!t){const t=document.createElement("div");o&&t.appendChild(r(o));const s=t.appendChild(document.createElement("span"));s.className="observablehq--string",s.textContent="`"+X(a.slice(0,V).join("\n"));const c=t.appendChild(document.createElement("span")),i=a.length-V;return c.textContent=`Show ${i} truncated line${i>1?"s":""}`,c.className="observablehq--string-expand",c.addEventListener("mouseup",function(r){r.stopPropagation(),ie(t,ce(e,n,!0,o))}),t}const s=document.createElement("span");o&&s.appendChild(r(o));const c=s.appendChild(document.createElement("span"));return c.className=`observablehq--string${t?" observablehq--expanded":""}`,c.textContent="`"+X(e)+"`",s}const a=document.createElement("span");o&&a.appendChild(r(o));const s=a.appendChild(document.createElement("span"));return s.className="observablehq--string",s.textContent=JSON.stringify(e.length>100?`${e.slice(0,50)}…${e.slice(-49)}`:e),a}(e,n,t,o);default:if(null===e){c=null,e="null";break}if(e instanceof Date){c="date",i=e,e=isNaN(i)?"Invalid Date":function(e){return 0===e.getUTCMilliseconds()&&0===e.getUTCSeconds()&&0===e.getUTCMinutes()&&0===e.getUTCHours()}(i)?Y(i.getUTCFullYear())+"-"+K(i.getUTCMonth()+1,2)+"-"+K(i.getUTCDate(),2):Y(i.getFullYear())+"-"+K(i.getMonth()+1,2)+"-"+K(i.getDate(),2)+"T"+K(i.getHours(),2)+":"+K(i.getMinutes(),2)+(i.getMilliseconds()?":"+K(i.getSeconds(),2)+"."+K(i.getMilliseconds(),3):i.getSeconds()?":"+K(i.getSeconds(),2):"");break}if(e===d){c="forbidden",e="[forbidden]";break}switch(se.call(e)){case"[object RegExp]":c="regexp",e=function(e){return J.call(e)}(e);break;case"[object Error]":case"[object DOMException]":c="error",e=function(e){return e.stack||G.call(e)}(e);break;default:return(t?g:U)(e,n,o,a)}}var i;const l=document.createElement("span");o&&l.appendChild(r(o));const u=l.appendChild(document.createElement("span"));return u.className=`observablehq--${c}`,u.textContent=e,l}function ie(e,t){e.classList.contains("observablehq--inspect")&&t.classList.add("observablehq--inspect"),e.parentNode.replaceChild(t,e),n(t,"load")}const le=/\s+\(\d+:\d+\)$/m;class de{constructor(e){if(!e)throw new Error("invalid node");this._node=e,e.classList.add("observablehq")}pending(){const{_node:e}=this;e.classList.remove("observablehq--error"),e.classList.add("observablehq--running")}fulfilled(e,t){const{_node:o}=this;if((!(e instanceof Element||e instanceof Text)||e.parentNode&&e.parentNode!==o)&&(e=ce(e,!1,o.firstChild&&o.firstChild.classList&&o.firstChild.classList.contains("observablehq--expanded"),t)).classList.add("observablehq--inspect"),o.classList.remove("observablehq--running","observablehq--error"),o.firstChild!==e)if(o.firstChild){for(;o.lastChild!==o.firstChild;)o.removeChild(o.lastChild);o.replaceChild(e,o.firstChild)}else o.appendChild(e);n(o,"update")}rejected(e,t){const{_node:o}=this;for(o.classList.remove("observablehq--running"),o.classList.add("observablehq--error");o.lastChild;)o.removeChild(o.lastChild);var a=document.createElement("div");a.className="observablehq--inspect",t&&a.appendChild(r(t)),a.appendChild(document.createTextNode((e+"").replace(le,""))),o.appendChild(a),n(o,"error",{error:e})}}de.into=function(e){if("string"==typeof e&&null==(e=document.querySelector(e)))throw new Error("container not found");return function(){return new de(e.appendChild(document.createElement("div")))}},e.Inspector=de,Object.defineProperty(e,"__esModule",{value:!0})}); |
{ | ||
"name": "@observablehq/inspector", | ||
"version": "3.2.0", | ||
"version": "3.2.1", | ||
"license": "ISC", | ||
@@ -5,0 +5,0 @@ "main": "dist/inspector.js", |
@@ -179,4 +179,3 @@ import dispatch from "./dispatch.js"; | ||
span.className = "observablehq--prototype-key"; | ||
const name = value.constructor.name; | ||
span.textContent = ` <${name} prototype>`; | ||
span.textContent = ` <prototype>`; | ||
item.appendChild(document.createTextNode(": ")); | ||
@@ -183,0 +182,0 @@ item.appendChild(inspect(value, undefined, undefined, undefined, true)); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
47699
843