Socket
Socket
Sign inDemoInstall

view-launcher

Package Overview
Dependencies
3
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.2 to 1.1.0

dist/editorUrl.d.ts

10

dist/index.js

@@ -1,2 +0,8 @@

(()=>{var e={453:(e,t,n)=>{"use strict";function o(e,t){return e.parentElement?t(e)?e:o(e.parentElement,t):null}var r=n(441),i=n.n(r),a=window.viewLauncher.editor,s=(navigator.platform.indexOf("Win"),{sublime:"subl://open?url=file://{path}&line={line}&column={column}",textmate:"txmt://open?url=file://{path}&line={line}&column={column}",emacs:"emacs://open?url=file://{path}&line={line}&column={column}",macvim:"mvim://open/?url=file://{path}&line={line}&column={column}",phpstorm:"phpstorm://open?file={path}&line={line}&column={column}",idea:"idea://open?file={path}&line={line}&column={column}",vscode:"vscode://file/{path}:{line}:{column}","vscode-insiders":"vscode-insiders://file/{path}:{line}:{column}",atom:"atom://core/open/file?filename={path}&line={line}&column={column}"});function c(e,t){return t?e.replace("{line}",t):e.replace("&line={line}&column={column}","").replace(":{line}:{column}","")}function l(e,t){return t?e.replace("{column}",t):e.replace("&column={column}","").replace(":{column}","")}function f(e){var t=e.getBoundingClientRect();return{width:t.width,height:t.height,top:t.top,right:t.right,bottom:t.bottom,left:t.left,x:t.left,y:t.top}}function u(e){if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function p(e){var t=u(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function d(e){return e instanceof u(e).Element||e instanceof Element}function m(e){return e instanceof u(e).HTMLElement||e instanceof HTMLElement}function h(e){return e?(e.nodeName||"").toLowerCase():null}function v(e){return((d(e)?e.ownerDocument:e.document)||window.document).documentElement}function g(e){return f(v(e)).left+p(e).scrollLeft}function b(e){return u(e).getComputedStyle(e)}function y(e){var t=b(e),n=t.overflow,o=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+o)}function w(e,t,n){void 0===n&&(n=!1);var o,r,i=v(t),a=f(e),s=m(t),c={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(s||!s&&!n)&&(("body"!==h(t)||y(i))&&(c=(o=t)!==u(o)&&m(o)?{scrollLeft:(r=o).scrollLeft,scrollTop:r.scrollTop}:p(o)),m(t)?((l=f(t)).x+=t.clientLeft,l.y+=t.clientTop):i&&(l.x=g(i))),{x:a.left+c.scrollLeft-l.x,y:a.top+c.scrollTop-l.y,width:a.width,height:a.height}}function x(e){return{x:e.offsetLeft,y:e.offsetTop,width:e.offsetWidth,height:e.offsetHeight}}function O(e){return"html"===h(e)?e:e.assignedSlot||e.parentNode||e.host||v(e)}function k(e){return["html","body","#document"].indexOf(h(e))>=0?e.ownerDocument.body:m(e)&&y(e)?e:k(O(e))}function E(e,t){void 0===t&&(t=[]);var n=k(e),o="body"===h(n),r=u(n),i=o?[r].concat(r.visualViewport||[],y(n)?n:[]):n,a=t.concat(i);return o?a:a.concat(E(O(i)))}function j(e){return["table","td","th"].indexOf(h(e))>=0}function L(e){if(!m(e)||"fixed"===b(e).position)return null;var t=e.offsetParent;if(t){var n=v(t);if("body"===h(t)&&"static"===b(t).position&&"static"!==b(n).position)return n}return t}function M(e){for(var t=u(e),n=L(e);n&&j(n)&&"static"===b(n).position;)n=L(n);return n&&"body"===h(n)&&"static"===b(n).position?t:n||function(e){for(var t=O(e);m(t)&&["html","body"].indexOf(h(t))<0;){var n=b(t);if("none"!==n.transform||"none"!==n.perspective||n.willChange&&"auto"!==n.willChange)return t;t=t.parentNode}return null}(e)||t}var P="top",D="bottom",C="right",T="left",_="auto",A=[P,D,C,T],S="start",B="end",N="viewport",q="popper",R=A.reduce((function(e,t){return e.concat([t+"-"+S,t+"-"+B])}),[]),H=[].concat(A,[_]).reduce((function(e,t){return e.concat([t,t+"-"+S,t+"-"+B])}),[]),W=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function I(e){var t=new Map,n=new Set,o=[];function r(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var o=t.get(e);o&&r(o)}})),o.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||r(e)})),o}var K={placement:"bottom",modifiers:[],strategy:"absolute"};function z(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function V(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,o=void 0===n?[]:n,r=t.defaultOptions,i=void 0===r?K:r;return function(e,t,n){void 0===n&&(n=i);var r,a,s={placement:"bottom",orderedModifiers:[],options:Object.assign(Object.assign({},K),i),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},c=[],l=!1,f={state:s,setOptions:function(n){u(),s.options=Object.assign(Object.assign(Object.assign({},i),s.options),n),s.scrollParents={reference:d(e)?E(e):e.contextElement?E(e.contextElement):[],popper:E(t)};var r=function(e){var t=I(e);return W.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}(function(e){var t=e.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign(Object.assign(Object.assign({},n),t),{},{options:Object.assign(Object.assign({},n.options),t.options),data:Object.assign(Object.assign({},n.data),t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(o,s.options.modifiers)));return s.orderedModifiers=r.filter((function(e){return e.enabled})),s.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,o=void 0===n?{}:n,r=e.effect;if("function"==typeof r){var i=r({state:s,name:t,instance:f,options:o}),a=function(){};c.push(i||a)}})),f.update()},forceUpdate:function(){if(!l){var e=s.elements,t=e.reference,n=e.popper;if(z(t,n)){s.rects={reference:w(t,M(n),"fixed"===s.options.strategy),popper:x(n)},s.reset=!1,s.placement=s.options.placement,s.orderedModifiers.forEach((function(e){return s.modifiersData[e.name]=Object.assign({},e.data)}));for(var o=0;o<s.orderedModifiers.length;o++)if(!0!==s.reset){var r=s.orderedModifiers[o],i=r.fn,a=r.options,c=void 0===a?{}:a,u=r.name;"function"==typeof i&&(s=i({state:s,options:c,name:u,instance:f})||s)}else s.reset=!1,o=-1}}},update:(r=function(){return new Promise((function(e){f.forceUpdate(),e(s)}))},function(){return a||(a=new Promise((function(e){Promise.resolve().then((function(){a=void 0,e(r())}))}))),a}),destroy:function(){u(),l=!0}};if(!z(e,t))return f;function u(){c.forEach((function(e){return e()})),c=[]}return f.setOptions(n).then((function(e){!l&&n.onFirstUpdate&&n.onFirstUpdate(e)})),f}}var U={passive:!0};function Y(e){return e.split("-")[0]}function X(e){return e.split("-")[1]}function F(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function $(e){var t,n=e.reference,o=e.element,r=e.placement,i=r?Y(r):null,a=r?X(r):null,s=n.x+n.width/2-o.width/2,c=n.y+n.height/2-o.height/2;switch(i){case P:t={x:s,y:n.y-o.height};break;case D:t={x:s,y:n.y+n.height};break;case C:t={x:n.x+n.width,y:c};break;case T:t={x:n.x-o.width,y:c};break;default:t={x:n.x,y:n.y}}var l=i?F(i):null;if(null!=l){var f="y"===l?"height":"width";switch(a){case S:t[l]=t[l]-(n[f]/2-o[f]/2);break;case B:t[l]=t[l]+(n[f]/2-o[f]/2)}}return t}var J={top:"auto",right:"auto",bottom:"auto",left:"auto"};function G(e){var t,n=e.popper,o=e.popperRect,r=e.placement,i=e.offsets,a=e.position,s=e.gpuAcceleration,c=e.adaptive,l=e.roundOffsets?function(e){var t=e.x,n=e.y,o=window.devicePixelRatio||1;return{x:Math.round(t*o)/o||0,y:Math.round(n*o)/o||0}}(i):i,f=l.x,p=void 0===f?0:f,d=l.y,m=void 0===d?0:d,h=i.hasOwnProperty("x"),g=i.hasOwnProperty("y"),b=T,y=P,w=window;if(c){var x=M(n);x===u(n)&&(x=v(n)),r===P&&(y=D,m-=x.clientHeight-o.height,m*=s?1:-1),r===T&&(b=C,p-=x.clientWidth-o.width,p*=s?1:-1)}var O,k=Object.assign({position:a},c&&J);return s?Object.assign(Object.assign({},k),{},((O={})[y]=g?"0":"",O[b]=h?"0":"",O.transform=(w.devicePixelRatio||1)<2?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",O)):Object.assign(Object.assign({},k),{},((t={})[y]=g?m+"px":"",t[b]=h?p+"px":"",t.transform="",t))}var Q={left:"right",right:"left",bottom:"top",top:"bottom"};function Z(e){return e.replace(/left|right|bottom|top/g,(function(e){return Q[e]}))}var ee={start:"end",end:"start"};function te(e){return e.replace(/start|end/g,(function(e){return ee[e]}))}function ne(e,t){var n,o=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(o&&((n=o)instanceof u(n).ShadowRoot||n instanceof ShadowRoot)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function oe(e){return Object.assign(Object.assign({},e),{},{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function re(e,t){return t===N?oe(function(e){var t=u(e),n=v(e),o=t.visualViewport,r=n.clientWidth,i=n.clientHeight,a=0,s=0;return o&&(r=o.width,i=o.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=o.offsetLeft,s=o.offsetTop)),{width:r,height:i,x:a+g(e),y:s}}(e)):m(t)?function(e){var t=f(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):oe(function(e){var t=v(e),n=p(e),o=e.ownerDocument.body,r=Math.max(t.scrollWidth,t.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),i=Math.max(t.scrollHeight,t.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-n.scrollLeft+g(e),s=-n.scrollTop;return"rtl"===b(o||t).direction&&(a+=Math.max(t.clientWidth,o?o.clientWidth:0)-r),{width:r,height:i,x:a,y:s}}(v(e)))}function ie(e,t,n){var o="clippingParents"===t?function(e){var t=E(O(e)),n=["absolute","fixed"].indexOf(b(e).position)>=0&&m(e)?M(e):e;return d(n)?t.filter((function(e){return d(e)&&ne(e,n)&&"body"!==h(e)})):[]}(e):[].concat(t),r=[].concat(o,[n]),i=r[0],a=r.reduce((function(t,n){var o=re(e,n);return t.top=Math.max(o.top,t.top),t.right=Math.min(o.right,t.right),t.bottom=Math.min(o.bottom,t.bottom),t.left=Math.max(o.left,t.left),t}),re(e,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ae(e){return Object.assign(Object.assign({},{top:0,right:0,bottom:0,left:0}),e)}function se(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function ce(e,t){void 0===t&&(t={});var n=t,o=n.placement,r=void 0===o?e.placement:o,i=n.boundary,a=void 0===i?"clippingParents":i,s=n.rootBoundary,c=void 0===s?N:s,l=n.elementContext,u=void 0===l?q:l,p=n.altBoundary,m=void 0!==p&&p,h=n.padding,g=void 0===h?0:h,b=ae("number"!=typeof g?g:se(g,A)),y=u===q?"reference":q,w=e.elements.reference,x=e.rects.popper,O=e.elements[m?y:u],k=ie(d(O)?O:O.contextElement||v(e.elements.popper),a,c),E=f(w),j=$({reference:E,element:x,strategy:"absolute",placement:r}),L=oe(Object.assign(Object.assign({},x),j)),M=u===q?L:E,T={top:k.top-M.top+b.top,bottom:M.bottom-k.bottom+b.bottom,left:k.left-M.left+b.left,right:M.right-k.right+b.right},_=e.modifiersData.offset;if(u===q&&_){var S=_[r];Object.keys(T).forEach((function(e){var t=[C,D].indexOf(e)>=0?1:-1,n=[P,D].indexOf(e)>=0?"y":"x";T[e]+=S[n]*t}))}return T}function le(e,t,n){return Math.max(e,Math.min(t,n))}function fe(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function ue(e){return[P,C,D,T].some((function(t){return e[t]>=0}))}var pe=V({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,o=e.options,r=o.scroll,i=void 0===r||r,a=o.resize,s=void 0===a||a,c=u(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&l.forEach((function(e){e.addEventListener("scroll",n.update,U)})),s&&c.addEventListener("resize",n.update,U),function(){i&&l.forEach((function(e){e.removeEventListener("scroll",n.update,U)})),s&&c.removeEventListener("resize",n.update,U)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=$({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,o=n.gpuAcceleration,r=void 0===o||o,i=n.adaptive,a=void 0===i||i,s=n.roundOffsets,c=void 0===s||s,l={placement:Y(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign(Object.assign({},t.styles.popper),G(Object.assign(Object.assign({},l),{},{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:c})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign(Object.assign({},t.styles.arrow),G(Object.assign(Object.assign({},l),{},{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign(Object.assign({},t.attributes.popper),{},{"data-popper-placement":t.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},o=t.attributes[e]||{},r=t.elements[e];m(r)&&h(r)&&(Object.assign(r.style,n),Object.keys(o).forEach((function(e){var t=o[e];!1===t?r.removeAttribute(e):r.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var o=t.elements[e],r=t.attributes[e]||{},i=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});m(o)&&h(o)&&(Object.assign(o.style,i),Object.keys(r).forEach((function(e){o.removeAttribute(e)})))}))}},requires:["computeStyles"]},{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,o=e.name,r=n.offset,i=void 0===r?[0,0]:r,a=H.reduce((function(e,n){return e[n]=function(e,t,n){var o=Y(e),r=[T,P].indexOf(o)>=0?-1:1,i="function"==typeof n?n(Object.assign(Object.assign({},t),{},{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*r,[T,C].indexOf(o)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,i),e}),{}),s=a[t.placement],c=s.x,l=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[o]=a}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,o=e.name;if(!t.modifiersData[o]._skip){for(var r=n.mainAxis,i=void 0===r||r,a=n.altAxis,s=void 0===a||a,c=n.fallbackPlacements,l=n.padding,f=n.boundary,u=n.rootBoundary,p=n.altBoundary,d=n.flipVariations,m=void 0===d||d,h=n.allowedAutoPlacements,v=t.options.placement,g=Y(v),b=c||(g===v||!m?[Z(v)]:function(e){if(Y(e)===_)return[];var t=Z(e);return[te(e),t,te(t)]}(v)),y=[v].concat(b).reduce((function(e,n){return e.concat(Y(n)===_?function(e,t){void 0===t&&(t={});var n=t,o=n.placement,r=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,l=void 0===c?H:c,f=X(o),u=f?s?R:R.filter((function(e){return X(e)===f})):A,p=u.filter((function(e){return l.indexOf(e)>=0}));0===p.length&&(p=u);var d=p.reduce((function(t,n){return t[n]=ce(e,{placement:n,boundary:r,rootBoundary:i,padding:a})[Y(n)],t}),{});return Object.keys(d).sort((function(e,t){return d[e]-d[t]}))}(t,{placement:n,boundary:f,rootBoundary:u,padding:l,flipVariations:m,allowedAutoPlacements:h}):n)}),[]),w=t.rects.reference,x=t.rects.popper,O=new Map,k=!0,E=y[0],j=0;j<y.length;j++){var L=y[j],M=Y(L),B=X(L)===S,N=[P,D].indexOf(M)>=0,q=N?"width":"height",W=ce(t,{placement:L,boundary:f,rootBoundary:u,altBoundary:p,padding:l}),I=N?B?C:T:B?D:P;w[q]>x[q]&&(I=Z(I));var K=Z(I),z=[];if(i&&z.push(W[M]<=0),s&&z.push(W[I]<=0,W[K]<=0),z.every((function(e){return e}))){E=L,k=!1;break}O.set(L,z)}if(k)for(var V=function(e){var t=y.find((function(t){var n=O.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return E=t,"break"},U=m?3:1;U>0;U--){if("break"===V(U))break}t.placement!==E&&(t.modifiersData[o]._skip=!0,t.placement=E,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,o=e.name,r=n.mainAxis,i=void 0===r||r,a=n.altAxis,s=void 0!==a&&a,c=n.boundary,l=n.rootBoundary,f=n.altBoundary,u=n.padding,p=n.tether,d=void 0===p||p,m=n.tetherOffset,h=void 0===m?0:m,v=ce(t,{boundary:c,rootBoundary:l,padding:u,altBoundary:f}),g=Y(t.placement),b=X(t.placement),y=!b,w=F(g),O="x"===w?"y":"x",k=t.modifiersData.popperOffsets,E=t.rects.reference,j=t.rects.popper,L="function"==typeof h?h(Object.assign(Object.assign({},t.rects),{},{placement:t.placement})):h,_={x:0,y:0};if(k){if(i){var A="y"===w?P:T,B="y"===w?D:C,N="y"===w?"height":"width",q=k[w],R=k[w]+v[A],H=k[w]-v[B],W=d?-j[N]/2:0,I=b===S?E[N]:j[N],K=b===S?-j[N]:-E[N],z=t.elements.arrow,V=d&&z?x(z):{width:0,height:0},U=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},$=U[A],J=U[B],G=le(0,E[N],V[N]),Q=y?E[N]/2-W-G-$-L:I-G-$-L,Z=y?-E[N]/2+W+G+J+L:K+G+J+L,ee=t.elements.arrow&&M(t.elements.arrow),te=ee?"y"===w?ee.clientTop||0:ee.clientLeft||0:0,ne=t.modifiersData.offset?t.modifiersData.offset[t.placement][w]:0,oe=k[w]+Q-ne-te,re=k[w]+Z-ne,ie=le(d?Math.min(R,oe):R,q,d?Math.max(H,re):H);k[w]=ie,_[w]=ie-q}if(s){var ae="x"===w?P:T,se="x"===w?D:C,fe=k[O],ue=le(fe+v[ae],fe,fe-v[se]);k[O]=ue,_[O]=ue-fe}t.modifiersData[o]=_}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,o=e.name,r=n.elements.arrow,i=n.modifiersData.popperOffsets,a=Y(n.placement),s=F(a),c=[T,C].indexOf(a)>=0?"height":"width";if(r&&i){var l=n.modifiersData[o+"#persistent"].padding,f=x(r),u="y"===s?P:T,p="y"===s?D:C,d=n.rects.reference[c]+n.rects.reference[s]-i[s]-n.rects.popper[c],m=i[s]-n.rects.reference[s],h=M(r),v=h?"y"===s?h.clientHeight||0:h.clientWidth||0:0,g=d/2-m/2,b=l[u],y=v-f[c]-l[p],w=v/2-f[c]/2+g,O=le(b,w,y),k=s;n.modifiersData[o]=((t={})[k]=O,t.centerOffset=O-w,t)}},effect:function(e){var t=e.state,n=e.options,o=e.name,r=n.element,i=void 0===r?"[data-popper-arrow]":r,a=n.padding,s=void 0===a?0:a;null!=i&&("string"!=typeof i||(i=t.elements.popper.querySelector(i)))&&ne(t.elements.popper,i)&&(t.elements.arrow=i,t.modifiersData[o+"#persistent"]={padding:ae("number"!=typeof s?s:se(s,A))})},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,o=t.rects.reference,r=t.rects.popper,i=t.modifiersData.preventOverflow,a=ce(t,{elementContext:"reference"}),s=ce(t,{altBoundary:!0}),c=fe(a,o),l=fe(s,r,i),f=ue(c),u=ue(l);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:f,hasPopperEscaped:u},t.attributes.popper=Object.assign(Object.assign({},t.attributes.popper),{},{"data-popper-reference-hidden":f,"data-popper-escaped":u})}}]});function de(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function me(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var he,ve=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,o;return t=e,o=[{key:"initialize",value:function(){if(!e.initialized){var t=window.viewLauncher.theme,n=document.body,o=document.createElement("div"),r=document.createElement("div"),i=document.createElement("div"),a=document.createElement("div");o.id="view-launcher-indicator",o.classList.add("--".concat(t)),r.id="view-launcher-tooltip",r.classList.add("--".concat(t)),i.classList.add("__tag-info"),a.classList.add("__view-name"),r.appendChild(i),r.appendChild(a),n.appendChild(o),n.appendChild(r),e.popper=pe(o,r,{placement:"top-start",modifiers:[{name:"offset",options:{offset:[0,5]}}]}),e.indicator=o,e.tooltip=r,e.tagInfo=i,e.viewName=a,e.initialized=!0}}},{key:"setElement",value:function(t){e.element=t,e.show(),e.update()}},{key:"hide",value:function(){[e.indicator,e.tooltip].forEach((function(e){e.style.visibility="hidden"}))}},{key:"show",value:function(){[e.indicator,e.tooltip].forEach((function(e){e.style.visibility="visible"}))}},{key:"update",value:function(){if(e.element){var t=e.indicator.style,n=e.element.getBoundingClientRect(),o=document.documentElement.clientHeight,r=n.top+n.height>o,i=n.top>0?r?o-n.top:n.height:r?o:n.height+n.top;t.width=n.width+"px",t.height=i+"px",t.left=n.left+"px",t.top=(n.top>0?n.top:0)+"px";var a=Array.from(e.element.classList).join("."),s=e.element.tagName.toLowerCase(),c=e.element.tagLocation.view.match(/[^/\\]+?$/)[0];e.tagInfo.innerText="".concat(s).concat(a?"."+a:""),e.viewName.innerText=c,e.popper.setOptions({modifiers:[{name:"offset",options:{offset:r&&n.top<0?[6,-(e.tooltip.clientHeight+5)]:[0,5]}}]}),e.popper.update()}}},{key:"enable",value:function(){e.initialize(),e.enabled=!0,e.update(),e.show()}},{key:"disable",value:function(){e.enabled=!1,e.hide()}},{key:"toggleEnable",value:function(){e.enabled?e.disable():e.enable()}}],(n=null)&&de(t.prototype,n),o&&de(t,o),e}();function ge(){var e=window.viewLauncher.shortcuts;i().bind(e.inspect,(function(){ve.toggleEnable(),document.body.classList.toggle("view-launcher-inspecting")})),i().bind(e.open,(function(){if(ve.enabled){var e=ve.element.tagLocation;window.location.href=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return l(c(s[a].replace("{path}",encodeURIComponent(e)),t),n)}(e.view,e.line,e.column)}})),i().bind("esc",(function(){ve.disable(),document.body.classList.contains("view-launcher-inspecting")&&document.body.classList.remove("view-launcher-inspecting")}))}function be(){Array.from(document.querySelectorAll("[data-tag-location]")).filter((function(e){e.tagLocation=JSON.parse(e.dataset.tagLocation),e.removeAttribute("data-tag-location");var t=getComputedStyle(e);return!(["HTML","HEAD","BODY","SCRIPT","NOSCRIPT","META","LINK","STYLE","TITLE","BASE"].includes(e.tagName)||"none"===t.display||"hidden"===t.visibility)})).forEach((function(e){e.addEventListener("mouseenter",(function(){ve.enabled&&ve.setElement(e)})),e.addEventListener("mouseleave",(function(e){if(ve.enabled&&e.relatedTarget){var t=o(e.relatedTarget,(function(e){return e.hasOwnProperty("tagLocation")}));t&&ve.setElement(t)}}))}))}me(ve,"initialized",!1),me(ve,"indicator",null),me(ve,"enabled",!1),me(ve,"element",null),function(){be();var e=function(){ve.enabled&&ve.update()};window.addEventListener("scroll",e),window.addEventListener("resize",e),ge()}(),he=document.body,new MutationObserver(be).observe(he,{attributes:!1,childList:!0,subtree:!0})},121:()=>{},441:(e,t,n)=>{var o;!function(r,i,a){if(r){for(var s,c={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},l={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},f={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},u={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},p=1;p<20;++p)c[111+p]="f"+p;for(p=0;p<=9;++p)c[p+96]=p.toString();y.prototype.bind=function(e,t,n){var o=this;return e=e instanceof Array?e:[e],o._bindMultiple.call(o,e,t,n),o},y.prototype.unbind=function(e,t){return this.bind.call(this,e,(function(){}),t)},y.prototype.trigger=function(e,t){var n=this;return n._directMap[e+":"+t]&&n._directMap[e+":"+t]({},e),n},y.prototype.reset=function(){var e=this;return e._callbacks={},e._directMap={},e},y.prototype.stopCallback=function(e,t){if((" "+t.className+" ").indexOf(" mousetrap ")>-1)return!1;if(b(t,this.target))return!1;if("composedPath"in e&&"function"==typeof e.composedPath){var n=e.composedPath()[0];n!==e.target&&(t=n)}return"INPUT"==t.tagName||"SELECT"==t.tagName||"TEXTAREA"==t.tagName||t.isContentEditable},y.prototype.handleKey=function(){var e=this;return e._handleKey.apply(e,arguments)},y.addKeycodes=function(e){for(var t in e)e.hasOwnProperty(t)&&(c[t]=e[t]);s=null},y.init=function(){var e=y(i);for(var t in e)"_"!==t.charAt(0)&&(y[t]=function(t){return function(){return e[t].apply(e,arguments)}}(t))},y.init(),r.Mousetrap=y,e.exports&&(e.exports=y),void 0===(o=function(){return y}.call(t,n,t,e))||(e.exports=o)}function d(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function m(e){if("keypress"==e.type){var t=String.fromCharCode(e.which);return e.shiftKey||(t=t.toLowerCase()),t}return c[e.which]?c[e.which]:l[e.which]?l[e.which]:String.fromCharCode(e.which).toLowerCase()}function h(e){return"shift"==e||"ctrl"==e||"alt"==e||"meta"==e}function v(e,t,n){return n||(n=function(){if(!s)for(var e in s={},c)e>95&&e<112||c.hasOwnProperty(e)&&(s[c[e]]=e);return s}()[e]?"keydown":"keypress"),"keypress"==n&&t.length&&(n="keydown"),n}function g(e,t){var n,o,r,i=[];for(n=function(e){return"+"===e?["+"]:(e=e.replace(/\+{2}/g,"+plus")).split("+")}(e),r=0;r<n.length;++r)o=n[r],u[o]&&(o=u[o]),t&&"keypress"!=t&&f[o]&&(o=f[o],i.push("shift")),h(o)&&i.push(o);return{key:o,modifiers:i,action:t=v(o,i,t)}}function b(e,t){return null!==e&&e!==i&&(e===t||b(e.parentNode,t))}function y(e){var t=this;if(e=e||i,!(t instanceof y))return new y(e);t.target=e,t._callbacks={},t._directMap={};var n,o={},r=!1,a=!1,s=!1;function c(e){e=e||{};var t,n=!1;for(t in o)e[t]?n=!0:o[t]=0;n||(s=!1)}function l(e,n,r,i,a,s){var c,l,f,u,p=[],d=r.type;if(!t._callbacks[e])return[];for("keyup"==d&&h(e)&&(n=[e]),c=0;c<t._callbacks[e].length;++c)if(l=t._callbacks[e][c],(i||!l.seq||o[l.seq]==l.level)&&d==l.action&&("keypress"==d&&!r.metaKey&&!r.ctrlKey||(f=n,u=l.modifiers,f.sort().join(",")===u.sort().join(",")))){var m=!i&&l.combo==a,v=i&&l.seq==i&&l.level==s;(m||v)&&t._callbacks[e].splice(c,1),p.push(l)}return p}function f(e,n,o,r){t.stopCallback(n,n.target||n.srcElement,o,r)||!1===e(n,o)&&(function(e){e.preventDefault?e.preventDefault():e.returnValue=!1}(n),function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}(n))}function u(e){"number"!=typeof e.which&&(e.which=e.keyCode);var n=m(e);n&&("keyup"!=e.type||r!==n?t.handleKey(n,function(e){var t=[];return e.shiftKey&&t.push("shift"),e.altKey&&t.push("alt"),e.ctrlKey&&t.push("ctrl"),e.metaKey&&t.push("meta"),t}(e),e):r=!1)}function p(e,t,i,a){function l(t){return function(){s=t,++o[e],clearTimeout(n),n=setTimeout(c,1e3)}}function u(t){f(i,t,e),"keyup"!==a&&(r=m(t)),setTimeout(c,10)}o[e]=0;for(var p=0;p<t.length;++p){var d=p+1===t.length?u:l(a||g(t[p+1]).action);v(t[p],d,a,e,p)}}function v(e,n,o,r,i){t._directMap[e+":"+o]=n;var a,s=(e=e.replace(/\s+/g," ")).split(" ");s.length>1?p(e,s,n,o):(a=g(e,o),t._callbacks[a.key]=t._callbacks[a.key]||[],l(a.key,a.modifiers,{type:a.action},r,e,i),t._callbacks[a.key][r?"unshift":"push"]({callback:n,modifiers:a.modifiers,action:a.action,seq:r,level:i,combo:e}))}t._handleKey=function(e,t,n){var o,r=l(e,t,n),i={},u=0,p=!1;for(o=0;o<r.length;++o)r[o].seq&&(u=Math.max(u,r[o].level));for(o=0;o<r.length;++o)if(r[o].seq){if(r[o].level!=u)continue;p=!0,i[r[o].seq]=1,f(r[o].callback,n,r[o].combo,r[o].seq)}else p||f(r[o].callback,n,r[o].combo);var d="keypress"==n.type&&a;n.type!=s||h(e)||d||c(i),a=p&&"keydown"==n.type},t._bindMultiple=function(e,t,n){for(var o=0;o<e.length;++o)v(e[o],t,n)},d(e,"keypress",u),d(e,"keydown",u),d(e,"keyup",u)}}("undefined"!=typeof window?window:null,"undefined"!=typeof window?document:null)}},t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={exports:{}};return e[o](r,r.exports,n),r.exports}n.m=e,n.x=e=>{},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={725:0},t=[[453],[121]],o=e=>{},r=(r,i)=>{for(var a,s,[c,l,f,u]=i,p=0,d=[];p<c.length;p++)s=c[p],n.o(e,s)&&e[s]&&d.push(e[s][0]),e[s]=0;for(a in l)n.o(l,a)&&(n.m[a]=l[a]);for(f&&f(n),r&&r(i);d.length;)d.shift()();return u&&t.push.apply(t,u),o()},i=self.webpackChunkview_launcher=self.webpackChunkview_launcher||[];function a(){for(var o,r=0;r<t.length;r++){for(var i=t[r],a=!0,s=1;s<i.length;s++){var c=i[s];0!==e[c]&&(a=!1)}a&&(t.splice(r--,1),o=n(n.s=i[0]))}return 0===t.length&&(n.x(),n.x=e=>{}),o}i.forEach(r.bind(null,0)),i.push=r.bind(null,i.push.bind(i));var s=n.x;n.x=()=>(n.x=s||(e=>{}),(o=a)())})(),n.x()})();
//# sourceMappingURL=index.js.map
'use strict'
if (process.env.NODE_ENV === 'production') {
module.exports = require('./view-launcher.cjs.production.min.js')
} else {
module.exports = require('./view-launcher.cjs.development.js')
}

94

package.json
{
"name": "view-launcher",
"version": "1.0.2",
"license": "MIT",
"main": "dist/index.js",
"files": [
"dist"
],
"scripts": {
"dev": "mix --mix-config webpack.mix.js",
"production": "mix --mix-config webpack.mix.js --production",
"watch": "npm run dev -- watch"
"name": "view-launcher",
"author": "yaquawa",
"version": "1.1.0",
"license": "MIT",
"main": "dist/index.js",
"source": "src/index.ts",
"typings": "dist/index.d.ts",
"unpkg": "dist/view-launcher.umd.production.min.js",
"module": "dist/view-launcher.esm.js",
"exports": {
"import": "./dist/view-launcher.esm.js",
"require": "./dist/view-launcher.cjs.production.min.js",
"default": "./dist/view-launcher.umd.production.min.js"
},
"files": [
"dist",
"src"
],
"engines": {
"node": ">=12"
},
"scripts": {
"start": "tsdx watch",
"build": "tsdx build --format cjs,esm,umd && sass src/style.scss dist/style.css",
"test": "tsdx test",
"lint": "tsdx lint",
"prepare": "tsdx build",
"size": "size-limit",
"analyze": "size-limit --why"
},
"husky": {
"hooks": {
"pre-commit": "tsdx lint"
}
},
"size-limit": [
{
"path": "dist/view-launcher.cjs.production.min.js",
"limit": "10 KB"
},
"devDependencies": {
"@babel/plugin-proposal-class-properties": "^7.12.1",
"@babel/preset-env": "^7.12.10",
"browser-sync": "^2.26.13",
"browser-sync-webpack-plugin": "^2.2.2",
"cross-env": "^7.0.3",
"laravel-mix": "^6.0.0",
"postcss": "^8.2.1",
"prettier": "^2.2.1",
"sass": "^1.30.0",
"sass-loader": "^8.0.2"
},
"dependencies": {
"@popperjs/core": "^2.5.4",
"mousetrap": "^1.6.5"
},
"homepage": "https://github.com/view-launcher/view-launcher"
{
"path": "dist/view-launcher.esm.js",
"limit": "10 KB"
}
],
"dependencies": {
"@popperjs/core": "^2.9.1",
"@types/mousetrap": "^1.6.5",
"mousetrap": "^1.6.5"
},
"devDependencies": {
"@size-limit/preset-small-lib": "^4.10.1",
"husky": "^5.2.0",
"sass": "^1.32.8",
"size-limit": "^4.10.1",
"tsdx": "^0.14.1",
"tslib": "^2.1.0",
"typescript": "^4.2.3"
},
"resolutions": {
"**/@typescript-eslint/eslint-plugin": "^4.19.0",
"**/@typescript-eslint/parser": "^4.19.0",
"**/jest": "^26.6.3",
"**/ts-jest": "^26.5.4",
"**/typescript": "^4.2.3",
"**/prettier": "^2.2.1"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc