@featurepeek/snippet.js
Advanced tools
Comparing version 0.2.9 to 0.2.10
@@ -1,1 +0,1 @@ | ||
function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var o=[],n=!0,r=!1,a=void 0;try{for(var i,c=e[Symbol.iterator]();!(n=(i=c.next()).done)&&(o.push(i.value),!t||o.length!==t);n=!0);}catch(e){r=!0,a=e}finally{try{n||null==c.return||c.return()}finally{if(r)throw a}}return o}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(e,t):void 0}}function _iterableToArray(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o<t;o++)n[o]=e[o];return n}!function(){function r(e,t){return o=t,e.x<o.x&&(t=t,(e=e).x+e.width<t.x);var o}function a(e,t){return o=t,e.y<o.y&&(t=t,(e=e).y+e.height<t.y);var o}function o(e,t){return e.width<=t.width?e:t}function n(e,t){return e.height<=t.height?e:t}function i(e,t){return e.y!==o(e,t).y?C(t,e):{x:e.x+e.width/2,y:e.y+e.height,height:t.y-(e.y+e.height)}}function c(e,t){return e.x!==n(e,t).x?j(t,e):{x:t.x+t.width,y:e.y+e.height/2,width:e.x-(t.x+t.width)}}function d(e,t){return e.x<=t.x&&e.y<=t.y&&e.x+e.width>=t.x+t.width&&e.y+e.height>=t.y+t.height}function s(e,t,o){var n=2<arguments.length&&void 0!==o?o:"red",r={blue:{hex:"#18a0fb",data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAIAAADZrBkAAAAAPklEQVR4AWOQWPAbH5oPQpjiIG2EEC20/ScCDJi2+XTTNp9UbfPgts0hRdt8uLa55DlyHhnahkZ00z8HkIEAA7TgNxFIMYsAAAAASUVORK5CYII="},red:{hex:"#f24822",data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAIAAADZrBkAAAAAHUlEQVR4AWP45KFEBhoobf+JALTXNqptVNuQyDgAD6SjH1sbDJwAAAAASUVORK5CYII="}};return["border: 1px solid","border-image: url(".concat(r[n].data,") 30 / 9px / 5px"),"box-shadow: 0 0 0 2px ".concat(r[n].hex),"display: flex","height: ".concat(Math.max(t.height-2,0),"px"),"justify-content: center","left: ".concat(e.pageXOffset+t.x,"px"),"pointer-events: none","position: absolute","top: ".concat(e.pageYOffset+t.y,"px"),"visibility: visible","width: ".concat(Math.max(t.width-2,0),"px"),"z-index: 99999999999999999"].join(";")}function l(e,t,o){var n=2<arguments.length&&void 0!==o?o:"red";if(i=e.document.getElementById(t))return i;var r=e.document.createElement("div"),a=e.document.createElement("code"),i=e.document.createElement("span");return r.id=t,a.style=["background: #ffffc2","font-size: 11px","left: 4px","line-height: 11px","margin: 0","max-width: calc(100% - 7px)","overflow: hidden","padding: 2px 4px","position: absolute","text-overflow: ellipsis","top: -18px","white-space: nowrap","word-wrap: normal"].join(";"),i.style=["background: ".concat("red"===n?"#fdeae6":"#e6f4ff"),"border-radius: 3px","bottom: -20px","color: ".concat("red"===n?"#f24822":"#18a0fb"),"font-family: -apple-system, 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif","font-size: 11px","line-height: 11px","margin: 0","padding: 2px 4px","position: absolute","text-align: center","white-space: nowrap"].join(";"),r.appendChild(a),r.appendChild(i),e.document.body.appendChild(r),e.document.getElementById(t)}function p(e,t){var o=e.document.getElementById(t);return o||((o=e.document.createElement("div")).id=t,e.document.body.appendChild(o),e.document.getElementById(t))}function h(e){return['<span style="color:#88137f">'.concat(e.tagName.toLowerCase(),"</span>"),e.id&&'<span style="color:#1a1aa6">#'.concat(e.id,"</span>"),e.className&&'<span style="color:#9a4500">.'.concat(e.className.replace(/ /g,"."),"</span>")].filter(Boolean).join("")}function f(t){var o=["align-items: center","border-width: 1px","font-size: 11px","line-height: 11px","margin: 0","padding: 0","pointer-events: none","position: absolute","visibility: visible","z-index: 9999999999999"],n=["background: #fdeae6","border-radius: 3px","color: #f24822","font-family: -apple-system, 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif","margin: 3px","padding: 2px 4px"];Object.keys(t).forEach(function(e){e=t[e];e.el.style=[].concat(o,_toConsumableArray(e.styles),["display: ".concat(1<e.distance?"flex":"none")]).join(";"),e.el.innerHTML='<span style="'.concat(n.join(";"),'">').concat(e.distance,"</span>")})}function y(e,t,o,n){var r=(s=o,i=n,Math.round(i.x>s.x+s.width?i.x-(s.x+s.width):s.x-(i.x+i.width))),a=(c=o,d=n,Math.round(d.y>c.y+c.height?d.y-(c.y+c.height):c.y-(d.y+d.height))),i=(l=n,{horz:{x:(s=o).x<l.x?s.x+s.width:l.x+l.width,y:s.y<l.y?s.y+s.height/2:l.y+l.height},vert:{x:s.x<l.x?s.x+s.width/2:s.x,y:s.y<l.y?s.y+s.height:l.y+l.height}}),c=e.pageXOffset+i.horz.x,d=e.pageYOffset+i.horz.y,s=a+o.height/2,l=e.pageXOffset+i.vert.x,e=e.pageYOffset+i.vert.y,i=o.width/2,i={horz:{el:t[0],distance:r,styles:["border-top-style: ".concat(o.y<n.y?"solid":"dashed"),"border-right-style: dashed","border-bottom-style: ".concat(o.y>n.y?"solid":"dashed"),"border-left-style: dashed","border-top-color: #f24822","border-right-color: ".concat(o.x<n.x?"#f24822":"transparent"),"border-bottom-color: #f24822","border-left-color: ".concat(o.x>n.x?"#f24822":"transparent"),"flex-direction: column","justify-content: flex-".concat(o.y<n.y?"start":"end"),"height: ".concat(s-2,"px"),"left: ".concat(c,"px"),"top: ".concat(d,"px"),"width: ".concat(r-2,"px")]},vert:{el:t[1],distance:a,styles:["border-top-style: dashed","border-right-style: solid","border-bottom-style: dashed","border-left-style: solid","border-top-color: ".concat(o.y>n.y?"#f24822":"transparent"),"border-right-color: ".concat(o.x>n.x?"#f24822":"transparent"),"border-bottom-color: ".concat(o.y<n.y?"#f24822":"transparent"),"border-left-color: ".concat(o.x<n.x?"#f24822":"transparent"),"justify-content: flex-".concat(o.x<n.x?"start":"end"),"height: ".concat(a-2,"px"),"left: ".concat(l,"px"),"top: ".concat(e,"px"),"width: ".concat(i-2,"px")]}};f(i)}function u(e,t,o,n){o={north:{el:t[0],distance:Math.round(n.y-o.y),styles:["border-left: 1px solid #f24822","height: ".concat(n.y-o.y,"px"),"left: ".concat(e.pageXOffset+n.x+n.width/2,"px"),"top: ".concat(e.pageYOffset+o.y-2,"px")]},south:{el:t[1],distance:Math.round(o.y+o.height-(n.y+n.height)),styles:["border-left: 1px solid #f24822","height: ".concat(o.y+o.height-(n.y+n.height),"px"),"left: ".concat(e.pageXOffset+n.x+n.width/2,"px"),"top: ".concat(e.pageYOffset+n.y+n.height+2,"px")]},east:{el:t[2],distance:Math.round(o.x+o.width-(n.x+n.width)),styles:["border-top: 1px solid #f24822","flex-direction: column","left: ".concat(e.pageXOffset+n.x+n.width+2,"px"),"top: ".concat(e.pageYOffset+n.y+n.height/2,"px"),"width: ".concat(o.x+o.width-(n.x+n.width),"px")]},west:{el:t[3],distance:Math.round(n.x-o.x),styles:["border-top: 1px solid #f24822","flex-direction: column","left: ".concat(e.pageXOffset+o.x,"px"),"top: ".concat(e.pageYOffset+n.y+n.height/2,"px"),"width: ".concat(n.x-o.x-2,"px")]}},f(o)}function x(e){e.forEach(function(e){e&&(e.style.visibility="hidden")})}function g(e){var t;e&&m&&(t=e.getBoundingClientRect(),m.style=s(window,t,"blue"),w.innerHTML=h(e),A.innerText="".concat(Math.round(t.width)," × ").concat(Math.round(t.height)),x([v,O,I,T,k]))}function b(e){var t,o,n;v&&(t=m.getBoundingClientRect(),o=e.getBoundingClientRect(),v.style=s(window,o,"red"),_.innerHTML=h(e),E.innerText="".concat(Math.round(o.width)," × ").concat(Math.round(o.height)),(r(n=t,e=o)||r(e,n))&&(a(n,e)||a(e,n))?(y(window,[O,I],t,o),x([T,k])):d(t,o)?u(window,[O,I,T,k],t,o):d(o,t)?u(window,[O,I,T,k],o,t):(N(t,o)?function(e,t,o,n){n=i(o,n),n={pos:{el:t,distance:Math.round(n.height),styles:["border-left: 1px solid #f24822","height: ".concat(n.height,"px"),"left: ".concat(e.pageXOffset+n.x,"px"),"top: ".concat(e.pageYOffset+n.y,"px")]}};f(n)}(window,O,t,o):a(o,t)?function(e,t,o,n){n=C(o,n),n={pos:{el:t,distance:Math.round(n.height),styles:["border-left: 1px solid #f24822","height: ".concat(n.height,"px"),"left: ".concat(e.pageXOffset+n.x,"px"),"top: ".concat(e.pageYOffset+n.y,"px")]}};f(n)}(window,O,t,o):r(o,t)?function(e,t,o,n){n=c(o,n),n={pos:{el:t,distance:Math.round(n.width),styles:["border-top: 1px solid #f24822","flex-direction: column","left: ".concat(e.pageXOffset+n.x,"px"),"top: ".concat(e.pageYOffset+n.y,"px"),"width: ".concat(n.width,"px")]}};f(n)}(window,O,t,o):B(t,o)&&function(e,t,o,n){n=j(o,n),n={pos:{el:t,distance:Math.round(n.width),styles:["border-top: 1px solid #f24822","flex-direction: column","left: ".concat(e.pageXOffset+n.x,"px"),"top: ".concat(e.pageYOffset+n.y,"px"),"width: ".concat(n.width,"px")]}};f(n)}(window,O,t,o),x([I,T,k])))}var m,w,A,v,_,E,O,I,T,k,S,M,L,N=a,B=r,C=function(e,t){return e.y!==o(e,t).y?i(t,e):{x:e.x+e.width/2,y:t.y+t.height,height:e.y-(t.y+t.height)}},j=function(e,t){return e.x!==n(e,t).x?c(t,e):{x:e.x+e.width,y:e.y+e.height/2,width:t.x-(e.x+e.width)}},R="_featurepeek_selection_box",F="_featurepeek_comparison_box",H="_featurepeek_measure_1",Y="_featurepeek_measure_2",P="_featurepeek_measure_3",D="_featurepeek_measure_4";try{var e=document.querySelector("script[data-repo][data-id]");if(!e)return console.warn("FeaturePeek snippet: You are missing a script tag with data-repo and data-id attributes.");var t=e.dataset,X=t.repo,U=t.env,e=t.vcs;if(!/\//.test(X))return console.warn("FeaturePeek snippet: The value you set for `repo` does not contain a slash (/).");t=document.location.hostname;if(!/--pr[\d]+-/.test(t)||!/\.web\.app$/.test(t))return console.warn("FeaturePeek snippet: The hostname does not appear to be a Firebase deployment preview.");t=t.split("--pr")[1].split("-")[0];if(!t)return console.warn("FeaturePeek snippet: Something went wrong. Are you using Firebase preview channels?");var z="https://dashboard".concat("dev"===U?".dev":"",".featurepeek.com"),V=document.createElement("iframe");V.allow="display-capture",V.src="".concat(z,"/firebase/").concat(e||"github","/").concat(X,"/").concat(t),V.style=["display:block","border:0","position:fixed","left:0","bottom:0","width:52px","height:300px","z-index:9999999999"].join(";"),document.body.appendChild(V),window.addEventListener("message",function(e){var t;if(e.origin===z)switch(e.data){case"FULL_VIEWPORT":V.style.height="100vh",V.style.width="100vw";break;case"HALF_VIEWPORT":V.style.height="300px",V.style.width="240px";break;case"TINY_VIEWPORT":V.style.height="300px",V.style.width="52px";break;case"DESIGN_MODE_ON":document.designMode="on";break;case"DESIGN_MODE_OFF":document.designMode="off";break;case"BEGIN_SELECTION":!function(){document.body.style.cursor="crosshair";var e=_slicedToArray((m=l(window,R,"blue")).getElementsByTagName("code"),1);w=e[0],e=_slicedToArray(m.getElementsByTagName("span"),1),A=e[0],e=_slicedToArray((v=l(window,F,"red")).getElementsByTagName("code"),1),_=e[0],e=_slicedToArray(v.getElementsByTagName("span"),1),E=e[0],O=p(window,H),I=p(window,Y),T=p(window,P),k=p(window,D),M=function(e){m?(S?b:g)(e.target):document.body.removeEventListener("mouseover",M)},(L=function(e){e?(e.preventDefault(),e.stopPropagation(),g(e.target),S=!0):(e=document.querySelectorAll(":hover"))&&(e=e[e.length-1],g(e))})(),document.body.addEventListener("click",L),document.body.addEventListener("mouseover",M)}();break;case"END_SELECTION":S=!1,document.body.style.cursor="default",t=window,[R,F,H,Y,P,D].forEach(function(e){e=t.document.getElementById(e);e&&e.parentNode.removeChild(e)}),document.body.removeEventListener("mouseover",M),document.body.removeEventListener("click",L);break;case"LOCATION_HREF":e.source.postMessage({type:"LOCATION_HREF",value:document.location.href},e.origin)}})}catch(e){console.error("FeaturePeek snippet: ".concat(e))}}(); | ||
function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var o=[],n=!0,r=!1,a=void 0;try{for(var i,c=e[Symbol.iterator]();!(n=(i=c.next()).done)&&(o.push(i.value),!t||o.length!==t);n=!0);}catch(e){r=!0,a=e}finally{try{n||null==c.return||c.return()}finally{if(r)throw a}}return o}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(e,t):void 0}}function _iterableToArray(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o<t;o++)n[o]=e[o];return n}!function(){function r(e,t){return o=t,e.x<o.x&&(t=t,(e=e).x+e.width<t.x);var o}function a(e,t){return o=t,e.y<o.y&&(t=t,(e=e).y+e.height<t.y);var o}function o(e,t){return e.width<=t.width?e:t}function n(e,t){return e.height<=t.height?e:t}function i(e,t){return e.y!==o(e,t).y?C(t,e):{x:e.x+e.width/2,y:e.y+e.height,height:t.y-(e.y+e.height)}}function c(e,t){return e.x!==n(e,t).x?j(t,e):{x:t.x+t.width,y:e.y+e.height/2,width:e.x-(t.x+t.width)}}function d(e,t){return e.x<=t.x&&e.y<=t.y&&e.x+e.width>=t.x+t.width&&e.y+e.height>=t.y+t.height}function s(e,t,o){var n=2<arguments.length&&void 0!==o?o:"red",r={blue:{hex:"#18a0fb",data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAIAAADZrBkAAAAAPklEQVR4AWOQWPAbH5oPQpjiIG2EEC20/ScCDJi2+XTTNp9UbfPgts0hRdt8uLa55DlyHhnahkZ00z8HkIEAA7TgNxFIMYsAAAAASUVORK5CYII="},red:{hex:"#f24822",data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAIAAADZrBkAAAAAHUlEQVR4AWP45KFEBhoobf+JALTXNqptVNuQyDgAD6SjH1sbDJwAAAAASUVORK5CYII="}};return["border: 1px solid","border-image: url(".concat(r[n].data,") 30 / 9px / 5px"),"box-shadow: 0 0 0 2px ".concat(r[n].hex),"display: flex","height: ".concat(Math.max(t.height-2,0),"px"),"justify-content: center","left: ".concat(e.pageXOffset+t.x,"px"),"pointer-events: none","position: absolute","top: ".concat(e.pageYOffset+t.y,"px"),"visibility: visible","width: ".concat(Math.max(t.width-2,0),"px"),"z-index: 99999999999999999"].join(";")}function l(e,t,o){var n=2<arguments.length&&void 0!==o?o:"red";if(i=e.document.getElementById(t))return i;var r=e.document.createElement("div"),a=e.document.createElement("code"),i=e.document.createElement("span");return r.id=t,a.style=["background: #ffffc2","font-size: 11px","left: 4px","line-height: 11px","margin: 0","max-width: calc(100% - 7px)","overflow: hidden","padding: 2px 4px","position: absolute","text-overflow: ellipsis","top: -18px","white-space: nowrap","word-wrap: normal"].join(";"),i.style=["background: ".concat("red"===n?"#fdeae6":"#e6f4ff"),"border-radius: 3px","bottom: -20px","color: ".concat("red"===n?"#f24822":"#18a0fb"),"font-family: -apple-system, 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif","font-size: 11px","line-height: 11px","margin: 0","padding: 2px 4px","position: absolute","text-align: center","white-space: nowrap"].join(";"),r.appendChild(a),r.appendChild(i),e.document.body.appendChild(r),e.document.getElementById(t)}function p(e,t){var o=e.document.getElementById(t);return o||((o=e.document.createElement("div")).id=t,e.document.body.appendChild(o),e.document.getElementById(t))}function h(e){return['<span style="color:#88137f">'.concat(e.tagName.toLowerCase(),"</span>"),e.id&&'<span style="color:#1a1aa6">#'.concat(e.id,"</span>"),e.className&&'<span style="color:#9a4500">.'.concat(e.className.replace(/ /g,"."),"</span>")].filter(Boolean).join("")}function f(t){var o=["align-items: center","border-width: 1px","font-size: 11px","line-height: 11px","margin: 0","padding: 0","pointer-events: none","position: absolute","visibility: visible","z-index: 9999999999999"],n=["background: #fdeae6","border-radius: 3px","color: #f24822","font-family: -apple-system, 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif","margin: 3px","padding: 2px 4px"];Object.keys(t).forEach(function(e){e=t[e];e.el.style=[].concat(o,_toConsumableArray(e.styles),["display: ".concat(1<e.distance?"flex":"none")]).join(";"),e.el.innerHTML='<span style="'.concat(n.join(";"),'">').concat(e.distance,"</span>")})}function y(e,t,o,n){var r=(s=o,i=n,Math.round(i.x>s.x+s.width?i.x-(s.x+s.width):s.x-(i.x+i.width))),a=(c=o,d=n,Math.round(d.y>c.y+c.height?d.y-(c.y+c.height):c.y-(d.y+d.height))),i=(l=n,{horz:{x:(s=o).x<l.x?s.x+s.width:l.x+l.width,y:s.y<l.y?s.y+s.height/2:l.y+l.height},vert:{x:s.x<l.x?s.x+s.width/2:s.x,y:s.y<l.y?s.y+s.height:l.y+l.height}}),c=e.pageXOffset+i.horz.x,d=e.pageYOffset+i.horz.y,s=a+o.height/2,l=e.pageXOffset+i.vert.x,e=e.pageYOffset+i.vert.y,i=o.width/2,i={horz:{el:t[0],distance:r,styles:["border-top-style: ".concat(o.y<n.y?"solid":"dashed"),"border-right-style: dashed","border-bottom-style: ".concat(o.y>n.y?"solid":"dashed"),"border-left-style: dashed","border-top-color: #f24822","border-right-color: ".concat(o.x<n.x?"#f24822":"transparent"),"border-bottom-color: #f24822","border-left-color: ".concat(o.x>n.x?"#f24822":"transparent"),"flex-direction: column","justify-content: flex-".concat(o.y<n.y?"start":"end"),"height: ".concat(s-2,"px"),"left: ".concat(c,"px"),"top: ".concat(d,"px"),"width: ".concat(r-2,"px")]},vert:{el:t[1],distance:a,styles:["border-top-style: dashed","border-right-style: solid","border-bottom-style: dashed","border-left-style: solid","border-top-color: ".concat(o.y>n.y?"#f24822":"transparent"),"border-right-color: ".concat(o.x>n.x?"#f24822":"transparent"),"border-bottom-color: ".concat(o.y<n.y?"#f24822":"transparent"),"border-left-color: ".concat(o.x<n.x?"#f24822":"transparent"),"justify-content: flex-".concat(o.x<n.x?"start":"end"),"height: ".concat(a-2,"px"),"left: ".concat(l,"px"),"top: ".concat(e,"px"),"width: ".concat(i-2,"px")]}};f(i)}function u(e,t,o,n){o={north:{el:t[0],distance:Math.round(n.y-o.y),styles:["border-left: 1px solid #f24822","height: ".concat(n.y-o.y,"px"),"left: ".concat(e.pageXOffset+n.x+n.width/2,"px"),"top: ".concat(e.pageYOffset+o.y-2,"px")]},south:{el:t[1],distance:Math.round(o.y+o.height-(n.y+n.height)),styles:["border-left: 1px solid #f24822","height: ".concat(o.y+o.height-(n.y+n.height),"px"),"left: ".concat(e.pageXOffset+n.x+n.width/2,"px"),"top: ".concat(e.pageYOffset+n.y+n.height+2,"px")]},east:{el:t[2],distance:Math.round(o.x+o.width-(n.x+n.width)),styles:["border-top: 1px solid #f24822","flex-direction: column","left: ".concat(e.pageXOffset+n.x+n.width+2,"px"),"top: ".concat(e.pageYOffset+n.y+n.height/2,"px"),"width: ".concat(o.x+o.width-(n.x+n.width),"px")]},west:{el:t[3],distance:Math.round(n.x-o.x),styles:["border-top: 1px solid #f24822","flex-direction: column","left: ".concat(e.pageXOffset+o.x,"px"),"top: ".concat(e.pageYOffset+n.y+n.height/2,"px"),"width: ".concat(n.x-o.x-2,"px")]}},f(o)}function x(e){e.forEach(function(e){e&&(e.style.visibility="hidden")})}function g(e){var t;e&&m&&(t=e.getBoundingClientRect(),m.style=s(window,t,"blue"),w.innerHTML=h(e),A.innerText="".concat(Math.round(t.width)," × ").concat(Math.round(t.height)),x([v,O,I,T,k]))}function b(e){var t,o,n;v&&(t=m.getBoundingClientRect(),o=e.getBoundingClientRect(),v.style=s(window,o,"red"),_.innerHTML=h(e),E.innerText="".concat(Math.round(o.width)," × ").concat(Math.round(o.height)),(r(n=t,e=o)||r(e,n))&&(a(n,e)||a(e,n))?(y(window,[O,I],t,o),x([T,k])):d(t,o)?u(window,[O,I,T,k],t,o):d(o,t)?u(window,[O,I,T,k],o,t):(N(t,o)?function(e,t,o,n){n=i(o,n),n={pos:{el:t,distance:Math.round(n.height),styles:["border-left: 1px solid #f24822","height: ".concat(n.height,"px"),"left: ".concat(e.pageXOffset+n.x,"px"),"top: ".concat(e.pageYOffset+n.y,"px")]}};f(n)}(window,O,t,o):a(o,t)?function(e,t,o,n){n=C(o,n),n={pos:{el:t,distance:Math.round(n.height),styles:["border-left: 1px solid #f24822","height: ".concat(n.height,"px"),"left: ".concat(e.pageXOffset+n.x,"px"),"top: ".concat(e.pageYOffset+n.y,"px")]}};f(n)}(window,O,t,o):r(o,t)?function(e,t,o,n){n=c(o,n),n={pos:{el:t,distance:Math.round(n.width),styles:["border-top: 1px solid #f24822","flex-direction: column","left: ".concat(e.pageXOffset+n.x,"px"),"top: ".concat(e.pageYOffset+n.y,"px"),"width: ".concat(n.width,"px")]}};f(n)}(window,O,t,o):B(t,o)&&function(e,t,o,n){n=j(o,n),n={pos:{el:t,distance:Math.round(n.width),styles:["border-top: 1px solid #f24822","flex-direction: column","left: ".concat(e.pageXOffset+n.x,"px"),"top: ".concat(e.pageYOffset+n.y,"px"),"width: ".concat(n.width,"px")]}};f(n)}(window,O,t,o),x([I,T,k])))}var m,w,A,v,_,E,O,I,T,k,S,M,L,N=a,B=r,C=function(e,t){return e.y!==o(e,t).y?i(t,e):{x:e.x+e.width/2,y:t.y+t.height,height:e.y-(t.y+t.height)}},j=function(e,t){return e.x!==n(e,t).x?c(t,e):{x:e.x+e.width,y:e.y+e.height/2,width:t.x-(e.x+e.width)}},R="_featurepeek_selection_box",F="_featurepeek_comparison_box",H="_featurepeek_measure_1",Y="_featurepeek_measure_2",P="_featurepeek_measure_3",D="_featurepeek_measure_4";try{var e=document.querySelector("script[data-repo]");if(!e)return console.warn("FeaturePeek snippet: You are missing a script tag with the data-repo attribute.");var t=e.dataset,X=t.repo,U=t.env,e=t.vcs;if(!/\//.test(X))return console.warn("FeaturePeek snippet: The value you set for `repo` does not contain a slash (/).");t=document.location.hostname;if(!/--pr[\d]+-/.test(t)||!/\.web\.app$/.test(t))return console.warn("FeaturePeek snippet: The hostname does not appear to be a Firebase deployment preview.");t=t.split("--pr")[1].split("-")[0];if(!t)return console.warn("FeaturePeek snippet: Something went wrong. Are you using Firebase preview channels?");var z="https://dashboard".concat("dev"===U?".dev":"",".featurepeek.com"),V=document.createElement("iframe");V.allow="display-capture",V.src="".concat(z,"/firebase/").concat(e||"github","/").concat(X,"/").concat(t),V.style=["display:block","border:0","position:fixed","left:0","bottom:0","width:52px","height:300px","z-index:9999999999"].join(";"),document.body.appendChild(V),window.addEventListener("message",function(e){var t;if(e.origin===z)switch(e.data){case"FULL_VIEWPORT":V.style.height="100vh",V.style.width="100vw";break;case"HALF_VIEWPORT":V.style.height="300px",V.style.width="240px";break;case"TINY_VIEWPORT":V.style.height="300px",V.style.width="52px";break;case"DESIGN_MODE_ON":document.designMode="on";break;case"DESIGN_MODE_OFF":document.designMode="off";break;case"BEGIN_SELECTION":!function(){document.body.style.cursor="crosshair";var e=_slicedToArray((m=l(window,R,"blue")).getElementsByTagName("code"),1);w=e[0],e=_slicedToArray(m.getElementsByTagName("span"),1),A=e[0],e=_slicedToArray((v=l(window,F,"red")).getElementsByTagName("code"),1),_=e[0],e=_slicedToArray(v.getElementsByTagName("span"),1),E=e[0],O=p(window,H),I=p(window,Y),T=p(window,P),k=p(window,D),M=function(e){m?(S?b:g)(e.target):document.body.removeEventListener("mouseover",M)},(L=function(e){e?(e.preventDefault(),e.stopPropagation(),g(e.target),S=!0):(e=document.querySelectorAll(":hover"))&&(e=e[e.length-1],g(e))})(),document.body.addEventListener("click",L),document.body.addEventListener("mouseover",M)}();break;case"END_SELECTION":S=!1,document.body.style.cursor="default",t=window,[R,F,H,Y,P,D].forEach(function(e){e=t.document.getElementById(e);e&&e.parentNode.removeChild(e)}),document.body.removeEventListener("mouseover",M),document.body.removeEventListener("click",L);break;case"LOCATION_HREF":e.source.postMessage({type:"LOCATION_HREF",value:document.location.href},e.origin)}})}catch(e){console.error("FeaturePeek snippet: ".concat(e))}}(); |
@@ -1,1 +0,1 @@ | ||
!function(){function e(e){return e.every(function(e){return e.test(location.hostname)})}function n(e){var n=document,t=n.createElement("script");t.src="https://unpkg.com/@featurepeek/snippet.js/dist/".concat(e,".js"),n.body.appendChild(t)}e([/--pr[\d]+-/,/\.web\.app$/])?n("firebase"):e([/--/,/\.netlify\.app$/])?n("netlify"):e([/-pr-[\d]+\.onrender\.com$/])&&n("render")}(); | ||
!function(){function e(e){return e.every(function(e){return e.test(location.hostname)})}function n(e){var n=document,t=n.createElement("script");t.src="https://unpkg.com/@featurepeek/snippet.js/dist/".concat(e,".js"),n.body.appendChild(t)}e([/--/,/\.netlify\.app$/])?n("netlify"):e([/--pr[\d]+-/,/\.web\.app$/])?n("firebase"):e([/-pr-?[\d]+\.herokuapp\.com$/])?n("heroku"):e([/-pr-[\d]+\.onrender\.com$/])&&n("render")}(); |
@@ -1,1 +0,1 @@ | ||
function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var o=[],n=!0,r=!1,a=void 0;try{for(var i,c=e[Symbol.iterator]();!(n=(i=c.next()).done)&&(o.push(i.value),!t||o.length!==t);n=!0);}catch(e){r=!0,a=e}finally{try{n||null==c.return||c.return()}finally{if(r)throw a}}return o}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(e,t):void 0}}function _iterableToArray(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o<t;o++)n[o]=e[o];return n}!function(){function r(e,t){return o=t,e.x<o.x&&(t=t,(e=e).x+e.width<t.x);var o}function a(e,t){return o=t,e.y<o.y&&(t=t,(e=e).y+e.height<t.y);var o}function o(e,t){return e.width<=t.width?e:t}function n(e,t){return e.height<=t.height?e:t}function i(e,t){return e.y!==o(e,t).y?C(t,e):{x:e.x+e.width/2,y:e.y+e.height,height:t.y-(e.y+e.height)}}function c(e,t){return e.x!==n(e,t).x?R(t,e):{x:t.x+t.width,y:e.y+e.height/2,width:e.x-(t.x+t.width)}}function d(e,t){return e.x<=t.x&&e.y<=t.y&&e.x+e.width>=t.x+t.width&&e.y+e.height>=t.y+t.height}function s(e,t,o){var n=2<arguments.length&&void 0!==o?o:"red",r={blue:{hex:"#18a0fb",data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAIAAADZrBkAAAAAPklEQVR4AWOQWPAbH5oPQpjiIG2EEC20/ScCDJi2+XTTNp9UbfPgts0hRdt8uLa55DlyHhnahkZ00z8HkIEAA7TgNxFIMYsAAAAASUVORK5CYII="},red:{hex:"#f24822",data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAIAAADZrBkAAAAAHUlEQVR4AWP45KFEBhoobf+JALTXNqptVNuQyDgAD6SjH1sbDJwAAAAASUVORK5CYII="}};return["border: 1px solid","border-image: url(".concat(r[n].data,") 30 / 9px / 5px"),"box-shadow: 0 0 0 2px ".concat(r[n].hex),"display: flex","height: ".concat(Math.max(t.height-2,0),"px"),"justify-content: center","left: ".concat(e.pageXOffset+t.x,"px"),"pointer-events: none","position: absolute","top: ".concat(e.pageYOffset+t.y,"px"),"visibility: visible","width: ".concat(Math.max(t.width-2,0),"px"),"z-index: 99999999999999999"].join(";")}function l(e,t,o){var n=2<arguments.length&&void 0!==o?o:"red";if(i=e.document.getElementById(t))return i;var r=e.document.createElement("div"),a=e.document.createElement("code"),i=e.document.createElement("span");return r.id=t,a.style=["background: #ffffc2","font-size: 11px","left: 4px","line-height: 11px","margin: 0","max-width: calc(100% - 7px)","overflow: hidden","padding: 2px 4px","position: absolute","text-overflow: ellipsis","top: -18px","white-space: nowrap","word-wrap: normal"].join(";"),i.style=["background: ".concat("red"===n?"#fdeae6":"#e6f4ff"),"border-radius: 3px","bottom: -20px","color: ".concat("red"===n?"#f24822":"#18a0fb"),"font-family: -apple-system, 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif","font-size: 11px","line-height: 11px","margin: 0","padding: 2px 4px","position: absolute","text-align: center","white-space: nowrap"].join(";"),r.appendChild(a),r.appendChild(i),e.document.body.appendChild(r),e.document.getElementById(t)}function p(e,t){var o=e.document.getElementById(t);return o||((o=e.document.createElement("div")).id=t,e.document.body.appendChild(o),e.document.getElementById(t))}function h(e){return['<span style="color:#88137f">'.concat(e.tagName.toLowerCase(),"</span>"),e.id&&'<span style="color:#1a1aa6">#'.concat(e.id,"</span>"),e.className&&'<span style="color:#9a4500">.'.concat(e.className.replace(/ /g,"."),"</span>")].filter(Boolean).join("")}function f(t){var o=["align-items: center","border-width: 1px","font-size: 11px","line-height: 11px","margin: 0","padding: 0","pointer-events: none","position: absolute","visibility: visible","z-index: 9999999999999"],n=["background: #fdeae6","border-radius: 3px","color: #f24822","font-family: -apple-system, 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif","margin: 3px","padding: 2px 4px"];Object.keys(t).forEach(function(e){e=t[e];e.el.style=[].concat(o,_toConsumableArray(e.styles),["display: ".concat(1<e.distance?"flex":"none")]).join(";"),e.el.innerHTML='<span style="'.concat(n.join(";"),'">').concat(e.distance,"</span>")})}function y(e,t,o,n){var r=(s=o,i=n,Math.round(i.x>s.x+s.width?i.x-(s.x+s.width):s.x-(i.x+i.width))),a=(c=o,d=n,Math.round(d.y>c.y+c.height?d.y-(c.y+c.height):c.y-(d.y+d.height))),i=(l=n,{horz:{x:(s=o).x<l.x?s.x+s.width:l.x+l.width,y:s.y<l.y?s.y+s.height/2:l.y+l.height},vert:{x:s.x<l.x?s.x+s.width/2:s.x,y:s.y<l.y?s.y+s.height:l.y+l.height}}),c=e.pageXOffset+i.horz.x,d=e.pageYOffset+i.horz.y,s=a+o.height/2,l=e.pageXOffset+i.vert.x,e=e.pageYOffset+i.vert.y,i=o.width/2,i={horz:{el:t[0],distance:r,styles:["border-top-style: ".concat(o.y<n.y?"solid":"dashed"),"border-right-style: dashed","border-bottom-style: ".concat(o.y>n.y?"solid":"dashed"),"border-left-style: dashed","border-top-color: #f24822","border-right-color: ".concat(o.x<n.x?"#f24822":"transparent"),"border-bottom-color: #f24822","border-left-color: ".concat(o.x>n.x?"#f24822":"transparent"),"flex-direction: column","justify-content: flex-".concat(o.y<n.y?"start":"end"),"height: ".concat(s-2,"px"),"left: ".concat(c,"px"),"top: ".concat(d,"px"),"width: ".concat(r-2,"px")]},vert:{el:t[1],distance:a,styles:["border-top-style: dashed","border-right-style: solid","border-bottom-style: dashed","border-left-style: solid","border-top-color: ".concat(o.y>n.y?"#f24822":"transparent"),"border-right-color: ".concat(o.x>n.x?"#f24822":"transparent"),"border-bottom-color: ".concat(o.y<n.y?"#f24822":"transparent"),"border-left-color: ".concat(o.x<n.x?"#f24822":"transparent"),"justify-content: flex-".concat(o.x<n.x?"start":"end"),"height: ".concat(a-2,"px"),"left: ".concat(l,"px"),"top: ".concat(e,"px"),"width: ".concat(i-2,"px")]}};f(i)}function u(e,t,o,n){o={north:{el:t[0],distance:Math.round(n.y-o.y),styles:["border-left: 1px solid #f24822","height: ".concat(n.y-o.y,"px"),"left: ".concat(e.pageXOffset+n.x+n.width/2,"px"),"top: ".concat(e.pageYOffset+o.y-2,"px")]},south:{el:t[1],distance:Math.round(o.y+o.height-(n.y+n.height)),styles:["border-left: 1px solid #f24822","height: ".concat(o.y+o.height-(n.y+n.height),"px"),"left: ".concat(e.pageXOffset+n.x+n.width/2,"px"),"top: ".concat(e.pageYOffset+n.y+n.height+2,"px")]},east:{el:t[2],distance:Math.round(o.x+o.width-(n.x+n.width)),styles:["border-top: 1px solid #f24822","flex-direction: column","left: ".concat(e.pageXOffset+n.x+n.width+2,"px"),"top: ".concat(e.pageYOffset+n.y+n.height/2,"px"),"width: ".concat(o.x+o.width-(n.x+n.width),"px")]},west:{el:t[3],distance:Math.round(n.x-o.x),styles:["border-top: 1px solid #f24822","flex-direction: column","left: ".concat(e.pageXOffset+o.x,"px"),"top: ".concat(e.pageYOffset+n.y+n.height/2,"px"),"width: ".concat(n.x-o.x-2,"px")]}},f(o)}function x(e){e.forEach(function(e){e&&(e.style.visibility="hidden")})}function g(e){var t;e&&b&&(t=e.getBoundingClientRect(),b.style=s(window,t,"blue"),w.innerHTML=h(e),A.innerText="".concat(Math.round(t.width)," × ").concat(Math.round(t.height)),x([v,O,I,T,k]))}function m(e){var t,o,n;v&&(t=b.getBoundingClientRect(),o=e.getBoundingClientRect(),v.style=s(window,o,"red"),_.innerHTML=h(e),E.innerText="".concat(Math.round(o.width)," × ").concat(Math.round(o.height)),(r(n=t,e=o)||r(e,n))&&(a(n,e)||a(e,n))?(y(window,[O,I],t,o),x([T,k])):d(t,o)?u(window,[O,I,T,k],t,o):d(o,t)?u(window,[O,I,T,k],o,t):(N(t,o)?function(e,t,o,n){n=i(o,n),n={pos:{el:t,distance:Math.round(n.height),styles:["border-left: 1px solid #f24822","height: ".concat(n.height,"px"),"left: ".concat(e.pageXOffset+n.x,"px"),"top: ".concat(e.pageYOffset+n.y,"px")]}};f(n)}(window,O,t,o):a(o,t)?function(e,t,o,n){n=C(o,n),n={pos:{el:t,distance:Math.round(n.height),styles:["border-left: 1px solid #f24822","height: ".concat(n.height,"px"),"left: ".concat(e.pageXOffset+n.x,"px"),"top: ".concat(e.pageYOffset+n.y,"px")]}};f(n)}(window,O,t,o):r(o,t)?function(e,t,o,n){n=c(o,n),n={pos:{el:t,distance:Math.round(n.width),styles:["border-top: 1px solid #f24822","flex-direction: column","left: ".concat(e.pageXOffset+n.x,"px"),"top: ".concat(e.pageYOffset+n.y,"px"),"width: ".concat(n.width,"px")]}};f(n)}(window,O,t,o):B(t,o)&&function(e,t,o,n){n=R(o,n),n={pos:{el:t,distance:Math.round(n.width),styles:["border-top: 1px solid #f24822","flex-direction: column","left: ".concat(e.pageXOffset+n.x,"px"),"top: ".concat(e.pageYOffset+n.y,"px"),"width: ".concat(n.width,"px")]}};f(n)}(window,O,t,o),x([I,T,k])))}var b,w,A,v,_,E,O,I,T,k,S,M,L,N=a,B=r,C=function(e,t){return e.y!==o(e,t).y?i(t,e):{x:e.x+e.width/2,y:t.y+t.height,height:e.y-(t.y+t.height)}},R=function(e,t){return e.x!==n(e,t).x?c(t,e):{x:e.x+e.width,y:e.y+e.height/2,width:t.x-(e.x+e.width)}},j="_featurepeek_selection_box",H="_featurepeek_comparison_box",P="_featurepeek_measure_1",Y="_featurepeek_measure_2",F="_featurepeek_measure_3",D="_featurepeek_measure_4";try{var e=document.querySelector("script[data-repo][data-id]");if(!e)return console.warn("FeaturePeek snippet: You are missing a script tag with data-repo and data-id attributes.");var t=e.dataset,X=t.repo,U=t.env,e=t.vcs;if(!/\//.test(X))return console.warn("FeaturePeek snippet: The value you set for `repo` does not contain a slash (/).");t=document.location.hostname;if(!/-pr-[\d]+\.onrender\.com$/.test(t))return console.warn("FeaturePeek snippet: The hostname does not appear to be a Render.com pull request preview.");t=t.match(/-pr-([\d]+)\.onrender\.com$/)[1];if(!t)return console.warn("FeaturePeek snippet: Something went wrong. Are you using Pull Request Previews?");var z="https://dashboard".concat("dev"===U?".dev":"",".featurepeek.com"),V=document.createElement("iframe");V.allow="display-capture",V.src="".concat(z,"/render/").concat(e||"github","/").concat(X,"/").concat(t),V.style=["display:block","border:0","position:fixed","left:0","bottom:0","width:52px","height:300px","z-index:9999999999"].join(";"),document.body.appendChild(V),window.addEventListener("message",function(e){var t;if(e.origin===z)switch(e.data){case"FULL_VIEWPORT":V.style.height="100vh",V.style.width="100vw";break;case"HALF_VIEWPORT":V.style.height="300px",V.style.width="240px";break;case"TINY_VIEWPORT":V.style.height="300px",V.style.width="52px";break;case"DESIGN_MODE_ON":document.designMode="on";break;case"DESIGN_MODE_OFF":document.designMode="off";break;case"BEGIN_SELECTION":!function(){document.body.style.cursor="crosshair";var e=_slicedToArray((b=l(window,j,"blue")).getElementsByTagName("code"),1);w=e[0],e=_slicedToArray(b.getElementsByTagName("span"),1),A=e[0],e=_slicedToArray((v=l(window,H,"red")).getElementsByTagName("code"),1),_=e[0],e=_slicedToArray(v.getElementsByTagName("span"),1),E=e[0],O=p(window,P),I=p(window,Y),T=p(window,F),k=p(window,D),M=function(e){b?(S?m:g)(e.target):document.body.removeEventListener("mouseover",M)},(L=function(e){e?(e.preventDefault(),e.stopPropagation(),g(e.target),S=!0):(e=document.querySelectorAll(":hover"))&&(e=e[e.length-1],g(e))})(),document.body.addEventListener("click",L),document.body.addEventListener("mouseover",M)}();break;case"END_SELECTION":S=!1,document.body.style.cursor="default",t=window,[j,H,P,Y,F,D].forEach(function(e){e=t.document.getElementById(e);e&&e.parentNode.removeChild(e)}),document.body.removeEventListener("mouseover",M),document.body.removeEventListener("click",L);break;case"LOCATION_HREF":e.source.postMessage({type:"LOCATION_HREF",value:document.location.href},e.origin)}})}catch(e){console.error("FeaturePeek snippet: ".concat(e))}}(); | ||
function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var o=[],n=!0,r=!1,a=void 0;try{for(var i,c=e[Symbol.iterator]();!(n=(i=c.next()).done)&&(o.push(i.value),!t||o.length!==t);n=!0);}catch(e){r=!0,a=e}finally{try{n||null==c.return||c.return()}finally{if(r)throw a}}return o}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(e,t):void 0}}function _iterableToArray(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o<t;o++)n[o]=e[o];return n}!function(){function r(e,t){return o=t,e.x<o.x&&(t=t,(e=e).x+e.width<t.x);var o}function a(e,t){return o=t,e.y<o.y&&(t=t,(e=e).y+e.height<t.y);var o}function o(e,t){return e.width<=t.width?e:t}function n(e,t){return e.height<=t.height?e:t}function i(e,t){return e.y!==o(e,t).y?C(t,e):{x:e.x+e.width/2,y:e.y+e.height,height:t.y-(e.y+e.height)}}function c(e,t){return e.x!==n(e,t).x?R(t,e):{x:t.x+t.width,y:e.y+e.height/2,width:e.x-(t.x+t.width)}}function d(e,t){return e.x<=t.x&&e.y<=t.y&&e.x+e.width>=t.x+t.width&&e.y+e.height>=t.y+t.height}function s(e,t,o){var n=2<arguments.length&&void 0!==o?o:"red",r={blue:{hex:"#18a0fb",data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAIAAADZrBkAAAAAPklEQVR4AWOQWPAbH5oPQpjiIG2EEC20/ScCDJi2+XTTNp9UbfPgts0hRdt8uLa55DlyHhnahkZ00z8HkIEAA7TgNxFIMYsAAAAASUVORK5CYII="},red:{hex:"#f24822",data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAIAAADZrBkAAAAAHUlEQVR4AWP45KFEBhoobf+JALTXNqptVNuQyDgAD6SjH1sbDJwAAAAASUVORK5CYII="}};return["border: 1px solid","border-image: url(".concat(r[n].data,") 30 / 9px / 5px"),"box-shadow: 0 0 0 2px ".concat(r[n].hex),"display: flex","height: ".concat(Math.max(t.height-2,0),"px"),"justify-content: center","left: ".concat(e.pageXOffset+t.x,"px"),"pointer-events: none","position: absolute","top: ".concat(e.pageYOffset+t.y,"px"),"visibility: visible","width: ".concat(Math.max(t.width-2,0),"px"),"z-index: 99999999999999999"].join(";")}function l(e,t,o){var n=2<arguments.length&&void 0!==o?o:"red";if(i=e.document.getElementById(t))return i;var r=e.document.createElement("div"),a=e.document.createElement("code"),i=e.document.createElement("span");return r.id=t,a.style=["background: #ffffc2","font-size: 11px","left: 4px","line-height: 11px","margin: 0","max-width: calc(100% - 7px)","overflow: hidden","padding: 2px 4px","position: absolute","text-overflow: ellipsis","top: -18px","white-space: nowrap","word-wrap: normal"].join(";"),i.style=["background: ".concat("red"===n?"#fdeae6":"#e6f4ff"),"border-radius: 3px","bottom: -20px","color: ".concat("red"===n?"#f24822":"#18a0fb"),"font-family: -apple-system, 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif","font-size: 11px","line-height: 11px","margin: 0","padding: 2px 4px","position: absolute","text-align: center","white-space: nowrap"].join(";"),r.appendChild(a),r.appendChild(i),e.document.body.appendChild(r),e.document.getElementById(t)}function h(e,t){var o=e.document.getElementById(t);return o||((o=e.document.createElement("div")).id=t,e.document.body.appendChild(o),e.document.getElementById(t))}function p(e){return['<span style="color:#88137f">'.concat(e.tagName.toLowerCase(),"</span>"),e.id&&'<span style="color:#1a1aa6">#'.concat(e.id,"</span>"),e.className&&'<span style="color:#9a4500">.'.concat(e.className.replace(/ /g,"."),"</span>")].filter(Boolean).join("")}function f(t){var o=["align-items: center","border-width: 1px","font-size: 11px","line-height: 11px","margin: 0","padding: 0","pointer-events: none","position: absolute","visibility: visible","z-index: 9999999999999"],n=["background: #fdeae6","border-radius: 3px","color: #f24822","font-family: -apple-system, 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif","margin: 3px","padding: 2px 4px"];Object.keys(t).forEach(function(e){e=t[e];e.el.style=[].concat(o,_toConsumableArray(e.styles),["display: ".concat(1<e.distance?"flex":"none")]).join(";"),e.el.innerHTML='<span style="'.concat(n.join(";"),'">').concat(e.distance,"</span>")})}function y(e,t,o,n){var r=(s=o,i=n,Math.round(i.x>s.x+s.width?i.x-(s.x+s.width):s.x-(i.x+i.width))),a=(c=o,d=n,Math.round(d.y>c.y+c.height?d.y-(c.y+c.height):c.y-(d.y+d.height))),i=(l=n,{horz:{x:(s=o).x<l.x?s.x+s.width:l.x+l.width,y:s.y<l.y?s.y+s.height/2:l.y+l.height},vert:{x:s.x<l.x?s.x+s.width/2:s.x,y:s.y<l.y?s.y+s.height:l.y+l.height}}),c=e.pageXOffset+i.horz.x,d=e.pageYOffset+i.horz.y,s=a+o.height/2,l=e.pageXOffset+i.vert.x,e=e.pageYOffset+i.vert.y,i=o.width/2,i={horz:{el:t[0],distance:r,styles:["border-top-style: ".concat(o.y<n.y?"solid":"dashed"),"border-right-style: dashed","border-bottom-style: ".concat(o.y>n.y?"solid":"dashed"),"border-left-style: dashed","border-top-color: #f24822","border-right-color: ".concat(o.x<n.x?"#f24822":"transparent"),"border-bottom-color: #f24822","border-left-color: ".concat(o.x>n.x?"#f24822":"transparent"),"flex-direction: column","justify-content: flex-".concat(o.y<n.y?"start":"end"),"height: ".concat(s-2,"px"),"left: ".concat(c,"px"),"top: ".concat(d,"px"),"width: ".concat(r-2,"px")]},vert:{el:t[1],distance:a,styles:["border-top-style: dashed","border-right-style: solid","border-bottom-style: dashed","border-left-style: solid","border-top-color: ".concat(o.y>n.y?"#f24822":"transparent"),"border-right-color: ".concat(o.x>n.x?"#f24822":"transparent"),"border-bottom-color: ".concat(o.y<n.y?"#f24822":"transparent"),"border-left-color: ".concat(o.x<n.x?"#f24822":"transparent"),"justify-content: flex-".concat(o.x<n.x?"start":"end"),"height: ".concat(a-2,"px"),"left: ".concat(l,"px"),"top: ".concat(e,"px"),"width: ".concat(i-2,"px")]}};f(i)}function u(e,t,o,n){o={north:{el:t[0],distance:Math.round(n.y-o.y),styles:["border-left: 1px solid #f24822","height: ".concat(n.y-o.y,"px"),"left: ".concat(e.pageXOffset+n.x+n.width/2,"px"),"top: ".concat(e.pageYOffset+o.y-2,"px")]},south:{el:t[1],distance:Math.round(o.y+o.height-(n.y+n.height)),styles:["border-left: 1px solid #f24822","height: ".concat(o.y+o.height-(n.y+n.height),"px"),"left: ".concat(e.pageXOffset+n.x+n.width/2,"px"),"top: ".concat(e.pageYOffset+n.y+n.height+2,"px")]},east:{el:t[2],distance:Math.round(o.x+o.width-(n.x+n.width)),styles:["border-top: 1px solid #f24822","flex-direction: column","left: ".concat(e.pageXOffset+n.x+n.width+2,"px"),"top: ".concat(e.pageYOffset+n.y+n.height/2,"px"),"width: ".concat(o.x+o.width-(n.x+n.width),"px")]},west:{el:t[3],distance:Math.round(n.x-o.x),styles:["border-top: 1px solid #f24822","flex-direction: column","left: ".concat(e.pageXOffset+o.x,"px"),"top: ".concat(e.pageYOffset+n.y+n.height/2,"px"),"width: ".concat(n.x-o.x-2,"px")]}},f(o)}function x(e){e.forEach(function(e){e&&(e.style.visibility="hidden")})}function g(e){var t;e&&b&&(t=e.getBoundingClientRect(),b.style=s(window,t,"blue"),w.innerHTML=p(e),A.innerText="".concat(Math.round(t.width)," × ").concat(Math.round(t.height)),x([v,O,I,T,k]))}function m(e){var t,o,n;v&&(t=b.getBoundingClientRect(),o=e.getBoundingClientRect(),v.style=s(window,o,"red"),_.innerHTML=p(e),E.innerText="".concat(Math.round(o.width)," × ").concat(Math.round(o.height)),(r(n=t,e=o)||r(e,n))&&(a(n,e)||a(e,n))?(y(window,[O,I],t,o),x([T,k])):d(t,o)?u(window,[O,I,T,k],t,o):d(o,t)?u(window,[O,I,T,k],o,t):(N(t,o)?function(e,t,o,n){n=i(o,n),n={pos:{el:t,distance:Math.round(n.height),styles:["border-left: 1px solid #f24822","height: ".concat(n.height,"px"),"left: ".concat(e.pageXOffset+n.x,"px"),"top: ".concat(e.pageYOffset+n.y,"px")]}};f(n)}(window,O,t,o):a(o,t)?function(e,t,o,n){n=C(o,n),n={pos:{el:t,distance:Math.round(n.height),styles:["border-left: 1px solid #f24822","height: ".concat(n.height,"px"),"left: ".concat(e.pageXOffset+n.x,"px"),"top: ".concat(e.pageYOffset+n.y,"px")]}};f(n)}(window,O,t,o):r(o,t)?function(e,t,o,n){n=c(o,n),n={pos:{el:t,distance:Math.round(n.width),styles:["border-top: 1px solid #f24822","flex-direction: column","left: ".concat(e.pageXOffset+n.x,"px"),"top: ".concat(e.pageYOffset+n.y,"px"),"width: ".concat(n.width,"px")]}};f(n)}(window,O,t,o):B(t,o)&&function(e,t,o,n){n=R(o,n),n={pos:{el:t,distance:Math.round(n.width),styles:["border-top: 1px solid #f24822","flex-direction: column","left: ".concat(e.pageXOffset+n.x,"px"),"top: ".concat(e.pageYOffset+n.y,"px"),"width: ".concat(n.width,"px")]}};f(n)}(window,O,t,o),x([I,T,k])))}var b,w,A,v,_,E,O,I,T,k,S,M,L,N=a,B=r,C=function(e,t){return e.y!==o(e,t).y?i(t,e):{x:e.x+e.width/2,y:t.y+t.height,height:e.y-(t.y+t.height)}},R=function(e,t){return e.x!==n(e,t).x?c(t,e):{x:e.x+e.width,y:e.y+e.height/2,width:t.x-(e.x+e.width)}},j="_featurepeek_selection_box",H="_featurepeek_comparison_box",P="_featurepeek_measure_1",Y="_featurepeek_measure_2",F="_featurepeek_measure_3",D="_featurepeek_measure_4";try{var e=document.querySelector("script[data-repo]");if(!e)return console.warn("FeaturePeek snippet: You are missing a script tag with the data-repo attribute.");var t=e.dataset,X=t.repo,U=t.env,e=t.vcs;if(!/\//.test(X))return console.warn("FeaturePeek snippet: The value you set for `repo` does not contain a slash (/).");t=document.location.hostname;if(!/-pr-[\d]+\.onrender\.com$/.test(t))return console.warn("FeaturePeek snippet: The hostname does not appear to be a Render.com pull request preview.");t=t.match(/-pr-([\d]+)\.onrender\.com$/)[1];if(!t)return console.warn("FeaturePeek snippet: Something went wrong. Are you using Pull Request Previews?");var z="https://dashboard".concat("dev"===U?".dev":"",".featurepeek.com"),V=document.createElement("iframe");V.allow="display-capture",V.src="".concat(z,"/render/").concat(e||"github","/").concat(X,"/").concat(t),V.style=["display:block","border:0","position:fixed","left:0","bottom:0","width:52px","height:300px","z-index:9999999999"].join(";"),document.body.appendChild(V),window.addEventListener("message",function(e){var t;if(e.origin===z)switch(e.data){case"FULL_VIEWPORT":V.style.height="100vh",V.style.width="100vw";break;case"HALF_VIEWPORT":V.style.height="300px",V.style.width="240px";break;case"TINY_VIEWPORT":V.style.height="300px",V.style.width="52px";break;case"DESIGN_MODE_ON":document.designMode="on";break;case"DESIGN_MODE_OFF":document.designMode="off";break;case"BEGIN_SELECTION":!function(){document.body.style.cursor="crosshair";var e=_slicedToArray((b=l(window,j,"blue")).getElementsByTagName("code"),1);w=e[0],e=_slicedToArray(b.getElementsByTagName("span"),1),A=e[0],e=_slicedToArray((v=l(window,H,"red")).getElementsByTagName("code"),1),_=e[0],e=_slicedToArray(v.getElementsByTagName("span"),1),E=e[0],O=h(window,P),I=h(window,Y),T=h(window,F),k=h(window,D),M=function(e){b?(S?m:g)(e.target):document.body.removeEventListener("mouseover",M)},(L=function(e){e?(e.preventDefault(),e.stopPropagation(),g(e.target),S=!0):(e=document.querySelectorAll(":hover"))&&(e=e[e.length-1],g(e))})(),document.body.addEventListener("click",L),document.body.addEventListener("mouseover",M)}();break;case"END_SELECTION":S=!1,document.body.style.cursor="default",t=window,[j,H,P,Y,F,D].forEach(function(e){e=t.document.getElementById(e);e&&e.parentNode.removeChild(e)}),document.body.removeEventListener("mouseover",M),document.body.removeEventListener("click",L);break;case"LOCATION_HREF":e.source.postMessage({type:"LOCATION_HREF",value:document.location.href},e.origin)}})}catch(e){console.error("FeaturePeek snippet: ".concat(e))}}(); |
{ | ||
"name": "@featurepeek/snippet.js", | ||
"version": "0.2.9", | ||
"version": "0.2.10", | ||
"main": "dist/loader.js", | ||
@@ -22,4 +22,5 @@ "repository": "https://github.com/featurepeek/snippet.js", | ||
"scripts": { | ||
"build": "mkdir -p dist && yarn build:loader && yarn build:firebase && yarn build:netlify && yarn build:render && yarn build:vercel", | ||
"build": "mkdir -p dist && yarn build:loader && yarn build:firebase && yarn build:heroku && yarn build:netlify && yarn build:render && yarn build:vercel", | ||
"build:firebase": "babel src/firebase.js | uglifyjs --compress --mangle --output dist/firebase.js", | ||
"build:heroku": "babel src/heroku.js | uglifyjs --compress --mangle --output dist/heroku.js", | ||
"build:netlify": "babel src/netlify.js | uglifyjs --compress --mangle --output dist/netlify.js", | ||
@@ -26,0 +27,0 @@ "build:render": "babel src/render.js | uglifyjs --compress --mangle --output dist/render.js", |
@@ -599,6 +599,6 @@ ;(() => { | ||
try { | ||
const scriptTag = document.querySelector('script[data-repo][data-id]') | ||
const scriptTag = document.querySelector('script[data-repo]') | ||
if (!scriptTag) { | ||
// eslint-disable-next-line no-console | ||
console.warn('FeaturePeek snippet: You are missing a script tag with data-repo and data-id attributes.') | ||
console.warn('FeaturePeek snippet: You are missing a script tag with the data-repo attribute.') | ||
return | ||
@@ -605,0 +605,0 @@ } |
@@ -10,6 +10,8 @@ ;(() => { | ||
} | ||
if (regexesMatchHostname([/--pr[\d]+-/, /\.web\.app$/])) { | ||
if (regexesMatchHostname([/--/, /\.netlify\.app$/])) { | ||
appendScript('netlify') | ||
} else if (regexesMatchHostname([/--pr[\d]+-/, /\.web\.app$/])) { | ||
appendScript('firebase') | ||
} else if (regexesMatchHostname([/--/, /\.netlify\.app$/])) { | ||
appendScript('netlify') | ||
} else if (regexesMatchHostname([/-pr-?[\d]+\.herokuapp\.com$/])) { | ||
appendScript('heroku') | ||
} else if (regexesMatchHostname([/-pr-[\d]+\.onrender\.com$/])) { | ||
@@ -16,0 +18,0 @@ appendScript('render') |
@@ -599,6 +599,6 @@ ;(() => { | ||
try { | ||
const scriptTag = document.querySelector('script[data-repo][data-id]') | ||
const scriptTag = document.querySelector('script[data-repo]') | ||
if (!scriptTag) { | ||
// eslint-disable-next-line no-console | ||
console.warn('FeaturePeek snippet: You are missing a script tag with data-repo and data-id attributes.') | ||
console.warn('FeaturePeek snippet: You are missing a script tag with the data-repo attribute.') | ||
return | ||
@@ -605,0 +605,0 @@ } |
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
174397
18
3052