Socket
Socket
Sign inDemoInstall

@crishellco/vue-hubble

Package Overview
Dependencies
0
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.6.5 to 3.6.6

40

dist/vue-hubble.es.js

@@ -1,9 +0,9 @@

const E = "//", c = "vue-hubble";
const $ = (e) => e.$hubble.environment.includes(process.env.NODE_ENV), w = (e) => e.$hubble.enableSelectorPicker, A = (e, n, t) => {
const w = "//", c = "vue-hubble";
const $ = (e) => e.$hubble.environment.includes(process.env.NODE_ENV), E = (e) => e.$hubble.enableSelectorPicker, A = (e, n, t) => {
const s = (u) => String.prototype.split.call(n, u).filter(Boolean).reduce((r, o) => r != null ? r[o] : r, e), i = s(/[,[\]]+?/) || s(/[,[\].]+?/);
return i === void 0 || i === e ? t : i;
}, g = (e) => `${E} ${e}`, b = (e) => {
}, g = (e) => `${w} ${e}`, b = (e) => {
const n = A(e.$options, ["hubble"], {});
return typeof n == "string" ? n : n.namespace;
}, p = (e, n) => {
}, h = (e, n) => {
if (!n)

@@ -23,3 +23,3 @@ return "";

return (e.$hubble.prefix ? `${e.$hubble.prefix}--` : "") + t.filter((u) => !!u).reverse().join("--");
}, y = (e) => `${e}`, h = (e, n, t) => {
}, y = (e) => `${e}`, p = (e, n, t) => {
const s = t.$hubble.enableGroupedSelectors ? `[${c}]` : "";

@@ -52,3 +52,3 @@ switch (n) {

n = n || i.$hubble.defaultSelectorType;
const u = e.parentElement, r = p(i, t), o = p(i, s), l = h(r, n, i), d = h(o, n, i);
const u = e.parentElement, r = h(i, t), o = h(i, s), l = p(r, n, i), d = p(o, n, i);
if (i.$hubble.enableComments && u)

@@ -108,6 +108,6 @@ M({ newQuerySelector: l, oldQuerySelector: d, element: e, value: t, parent: u });

const { target: i } = s, u = document.querySelector(`[${c}-tooltip-id="${t}"]`), r = document.querySelector(`[${c}-highlight-id="${t}"]`);
if (!(i === n || i === u || n.contains(i)) || !w(e))
if (!(i === n || i === u || n.contains(i)) || !E(e))
return u && u.remove(), r && r.remove();
u || (T(n, t), O(n, t));
}, D = async (e, n, { context: t }) => {
}, _ = async (e, n, { context: t }) => {
if (!t.hubbleUnwatch && (t.hubbleUnwatch = t.$watch(

@@ -123,10 +123,10 @@ "$hubble",

e.hubbleMouseover = C(t, e, s), document.addEventListener("mouseover", e.hubbleMouseover);
}, _ = async (e) => {
e.hubbleMouseover && document.removeEventListener("mouseover", e.hubbleMouseover);
}, D = async (e, n, { context: t }) => {
e.hubbleMouseover && document.removeEventListener("mouseover", e.hubbleMouseover), t.hubbleUnwatch && t.hubbleUnwatch();
}, k = {
bind: D,
bind: _,
inserted: f,
update: f,
unbind: _
}, B = (e) => ({
unbind: D
}, U = (e) => ({
all() {

@@ -161,3 +161,3 @@ return [...document.querySelectorAll(`[${c}]`)];

}
const L = {
const B = {
defaultSelectorType: "attr",

@@ -171,4 +171,4 @@ enableComments: !1,

};
function R(e, n = {}) {
const t = Object.assign(L, n);
function L(e, n = {}) {
const t = Object.assign(B, n);
t.environment = [].concat(t.environment), Object.defineProperty(t, "NODE_ENV", { value: process.env.NODE_ENV, writable: !1 });

@@ -193,11 +193,11 @@ let s = new e({

}), window.$hubble = {
...B({ ...t }),
...U({ ...t }),
options: s.$data.$hubble
}, e.directive("hubble", k);
}
typeof window < "u" && window.Vue && window.Vue.use(R);
typeof window < "u" && window.Vue && window.Vue.use(L);
export {
R as default,
L as defaultConfig
L as default,
B as defaultConfig
};
//# sourceMappingURL=vue-hubble.es.js.map

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

(function(c,a){typeof exports=="object"&&typeof module<"u"?a(exports):typeof define=="function"&&define.amd?define(["exports"],a):(c=typeof globalThis<"u"?globalThis:c||self,a(c.VueHubble={}))})(this,function(c){"use strict";const a="//",d="vue-hubble",h=e=>e.$hubble.environment.includes(process.env.NODE_ENV),S=e=>e.$hubble.enableSelectorPicker,x=(e,n,t)=>{const i=u=>String.prototype.split.call(n,u).filter(Boolean).reduce((r,o)=>r!=null?r[o]:r,e),s=i(/[,[\]]+?/)||i(/[,[\].]+?/);return s===void 0||s===e?t:s},f=e=>`${a} ${e}`,m=e=>{const n=x(e.$options,["hubble"],{});return typeof n=="string"?n:n.namespace},$=(e,n)=>{if(!n)return"";const t=[n];let i=e.$hubble.enableDeepNamespacing,s=m(e);if(!i)t.push(s);else{let u=e;do{const r=m(u);r&&t.push(r),u=u.$parent}while(u)}return(e.$hubble.prefix?`${e.$hubble.prefix}--`:"")+t.filter(u=>!!u).reverse().join("--")},g=e=>`${e}`,y=(e,n,t)=>{const i=t.$hubble.enableGroupedSelectors?`[${d}]`:"";switch(n){case"class":return`${i}.${e}`;case"id":return`${i}#${e}`;case"attr":return`${i}[${e}]`;default:return`${i}[${e}]`}},T=({newQuerySelector:e,oldQuerySelector:n,element:t,value:i,parent:s})=>{const u=f(e),r=g(e),o=s.childNodes;if(C({nodes:o,element:t,parent:s,oldQuerySelector:n}),i&&i.length){const l=document.createComment(u),b=document.createComment(r);s.insertBefore(b,t),s.insertBefore(l,t.nextSibling)}},v=async(e,{arg:n,value:t,oldValue:i},{context:s})=>{if(!h(s)){e.hubbleMouseover&&(document.removeEventListener("mouseover",e.hubbleMouseover),e.hubbleMouseover=void 0);return}if(!e.hubbleMouseover){const p=Math.random().toString(36).substr(2,11);e.hubbleMouseover=E(s,e,p),document.addEventListener("mouseover",e.hubbleMouseover)}n=n||s.$hubble.defaultSelectorType;const u=e.parentElement,r=$(s,t),o=$(s,i),l=y(r,n,s),b=y(o,n,s);if(s.$hubble.enableComments&&u)T({newQuerySelector:l,oldQuerySelector:b,element:e,value:t,parent:u});else if(u){const p=u.childNodes;C({nodes:p,element:e,parent:u,oldQuerySelector:b})}O({element:e,oldSelector:o,newSelector:r,newQuerySelector:l}),N({arg:n,element:e,oldSelector:o,newSelector:r,newQuerySelector:l})},N=({arg:e,element:n,oldSelector:t,newSelector:i,newQuerySelector:s})=>{switch(e){case"class":t&&n.classList.remove(t),i&&(n.classList.add(i),n.setAttribute(`${d}-selector`,s));break;case"id":n.id=i;break;case"attr":t&&n.removeAttribute(t),i&&n.setAttributeNode(n.ownerDocument.createAttribute(i));break;default:console.warn(`${e} is not a valid selector type, using attr instead`),t&&n.removeAttribute(t),i&&n.setAttributeNode(n.ownerDocument.createAttribute(i));break}},O=({element:e,oldSelector:n,newSelector:t,newQuerySelector:i})=>{n&&e.removeAttribute(d),e.setAttributeNode(e.ownerDocument.createAttribute(d)),e.setAttribute(`${d}-selector`,t?i:"")},C=({nodes:e,element:n,parent:t,oldQuerySelector:i})=>{const s=f(i),u=g(i);for(let r=0;r<e.length;r++){const o=e[r+1],l=e[r-1];e[r]===n&&o&&o.nodeType===8&&o.textContent===s&&t.removeChild(o),e[r]===n&&l&&l.nodeType===8&&l.textContent===u&&t.removeChild(l)}},_=e=>`'${e}'`,D=(e,n)=>{const{top:t,left:i,width:s}=e.getBoundingClientRect(),u=e.getAttribute(`${d}-selector`),r=_(u),o=document.createElement("span");o.style.position="fixed",o.style.padding="6px",o.style.background="#374151",o.style.borderRadius="2px",o.style.boxShadow="0 10px 15px -3px rgba(0,0,0,0.1),0 4px 6px -2px rgba(0,0,0,0.05)",o.style.color="#A5B4FC",o.style.fontWeight="400",o.style.userSelect="all",o.style.zIndex="99999999",o.style.cursor="pointer",o.style.fontSize="16px",o.style.fontFamily="monospace",o.style.whiteSpace="nowrap",o.style.textAlign="center",o.innerText=r,o.setAttribute(`${d}-tooltip-id`,n),o.setAttributeNode(o.ownerDocument.createAttribute(`${d}-tooltip`)),document.body.appendChild(o),o.style.width=`${o.offsetWidth}px`,o.style.left=`${Math.min(window.innerWidth-o.offsetWidth,Math.max(0,i+s/2-o.offsetWidth/2))}px`,o.style.top=`${Math.min(window.outerHeight-o.offsetHeight,Math.max(0,t-o.offsetHeight))}px`,o.addEventListener("click",()=>{document.execCommand("copy"),o.innerText="Copied!",setTimeout(()=>{o.innerText=r},1e3)})},k=(e,n)=>{const t=document.createElement("div"),{top:i,left:s,height:u,width:r}=e.getBoundingClientRect();t.style.position="fixed",t.style.width=`${r}px`,t.style.height=`${u}px`,t.style.left=`${s}px`,t.style.top=`${i}px`,t.style.pointerEvents="none",t.style.zIndex="99999998",t.style.background="rgba(99, 102, 241, .1)",t.style.border="2px solid #6366F1",t.setAttribute(`${d}-highlight-id`,n),document.body.appendChild(t)},E=(e,n,t)=>i=>{const{target:s}=i,u=document.querySelector(`[${d}-tooltip-id="${t}"]`),r=document.querySelector(`[${d}-highlight-id="${t}"]`);if(!(s===n||s===u||n.contains(s))||!S(e))return u&&u.remove(),r&&r.remove();u||(D(n,t),k(n,t))},B={bind:async(e,n,{context:t})=>{if(!t.hubbleUnwatch&&(t.hubbleUnwatch=t.$watch("$hubble",function(){t.$forceUpdate()},{deep:!0})),!h(t))return;const i=Math.random().toString(36).substr(2,11);e.hubbleMouseover=E(t,e,i),document.addEventListener("mouseover",e.hubbleMouseover)},inserted:v,update:v,unbind:async e=>{e.hubbleMouseover&&document.removeEventListener("mouseover",e.hubbleMouseover)}},L=e=>({all(){return[...document.querySelectorAll(`[${d}]`)]},allMapped(){return w(this.all())},find(n){return[...document.querySelectorAll(`[${d}][${n}]`),...document.querySelectorAll(`[${d}][class*="${n}"]`),...document.querySelectorAll(`[${d}][id*="${n}"]`)]},findMapped(n){return w(this.find(n))},first(n){return this.find(n).shift()},resetOptions(){window.$hubble.options={...e}}});function w(e){return[...e].reduce((n,t)=>({...n,[t.getAttribute(`${d}-selector`)]:t}),{})}const A={defaultSelectorType:"attr",enableComments:!1,enableDeepNamespacing:!0,enableSelectorPicker:!1,environment:"test",enableGroupedSelectors:!0,prefix:""};function M(e,n={}){const t=Object.assign(A,n);t.environment=[].concat(t.environment),Object.defineProperty(t,"NODE_ENV",{value:process.env.NODE_ENV,writable:!1});let i=new e({data:{$hubble:t}});e.mixin({computed:{$hubble:{get(){return{...i.$data.$hubble}},set(s){i.$data.$hubble={...s,environment:[].concat(s.environment)}}}}}),window.$hubble={...L({...t}),options:i.$data.$hubble},e.directive("hubble",B)}typeof window<"u"&&window.Vue&&window.Vue.use(M),c.default=M,c.defaultConfig=A,Object.defineProperties(c,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
(function(c,a){typeof exports=="object"&&typeof module<"u"?a(exports):typeof define=="function"&&define.amd?define(["exports"],a):(c=typeof globalThis<"u"?globalThis:c||self,a(c.VueHubble={}))})(this,function(c){"use strict";const a="//",d="vue-hubble",p=e=>e.$hubble.environment.includes(process.env.NODE_ENV),S=e=>e.$hubble.enableSelectorPicker,x=(e,n,t)=>{const i=u=>String.prototype.split.call(n,u).filter(Boolean).reduce((r,o)=>r!=null?r[o]:r,e),s=i(/[,[\]]+?/)||i(/[,[\].]+?/);return s===void 0||s===e?t:s},f=e=>`${a} ${e}`,m=e=>{const n=x(e.$options,["hubble"],{});return typeof n=="string"?n:n.namespace},$=(e,n)=>{if(!n)return"";const t=[n];let i=e.$hubble.enableDeepNamespacing,s=m(e);if(!i)t.push(s);else{let u=e;do{const r=m(u);r&&t.push(r),u=u.$parent}while(u)}return(e.$hubble.prefix?`${e.$hubble.prefix}--`:"")+t.filter(u=>!!u).reverse().join("--")},g=e=>`${e}`,y=(e,n,t)=>{const i=t.$hubble.enableGroupedSelectors?`[${d}]`:"";switch(n){case"class":return`${i}.${e}`;case"id":return`${i}#${e}`;case"attr":return`${i}[${e}]`;default:return`${i}[${e}]`}},T=({newQuerySelector:e,oldQuerySelector:n,element:t,value:i,parent:s})=>{const u=f(e),r=g(e),o=s.childNodes;if(C({nodes:o,element:t,parent:s,oldQuerySelector:n}),i&&i.length){const l=document.createComment(u),b=document.createComment(r);s.insertBefore(b,t),s.insertBefore(l,t.nextSibling)}},v=async(e,{arg:n,value:t,oldValue:i},{context:s})=>{if(!p(s)){e.hubbleMouseover&&(document.removeEventListener("mouseover",e.hubbleMouseover),e.hubbleMouseover=void 0);return}if(!e.hubbleMouseover){const h=Math.random().toString(36).substr(2,11);e.hubbleMouseover=w(s,e,h),document.addEventListener("mouseover",e.hubbleMouseover)}n=n||s.$hubble.defaultSelectorType;const u=e.parentElement,r=$(s,t),o=$(s,i),l=y(r,n,s),b=y(o,n,s);if(s.$hubble.enableComments&&u)T({newQuerySelector:l,oldQuerySelector:b,element:e,value:t,parent:u});else if(u){const h=u.childNodes;C({nodes:h,element:e,parent:u,oldQuerySelector:b})}O({element:e,oldSelector:o,newSelector:r,newQuerySelector:l}),N({arg:n,element:e,oldSelector:o,newSelector:r,newQuerySelector:l})},N=({arg:e,element:n,oldSelector:t,newSelector:i,newQuerySelector:s})=>{switch(e){case"class":t&&n.classList.remove(t),i&&(n.classList.add(i),n.setAttribute(`${d}-selector`,s));break;case"id":n.id=i;break;case"attr":t&&n.removeAttribute(t),i&&n.setAttributeNode(n.ownerDocument.createAttribute(i));break;default:console.warn(`${e} is not a valid selector type, using attr instead`),t&&n.removeAttribute(t),i&&n.setAttributeNode(n.ownerDocument.createAttribute(i));break}},O=({element:e,oldSelector:n,newSelector:t,newQuerySelector:i})=>{n&&e.removeAttribute(d),e.setAttributeNode(e.ownerDocument.createAttribute(d)),e.setAttribute(`${d}-selector`,t?i:"")},C=({nodes:e,element:n,parent:t,oldQuerySelector:i})=>{const s=f(i),u=g(i);for(let r=0;r<e.length;r++){const o=e[r+1],l=e[r-1];e[r]===n&&o&&o.nodeType===8&&o.textContent===s&&t.removeChild(o),e[r]===n&&l&&l.nodeType===8&&l.textContent===u&&t.removeChild(l)}},_=e=>`'${e}'`,D=(e,n)=>{const{top:t,left:i,width:s}=e.getBoundingClientRect(),u=e.getAttribute(`${d}-selector`),r=_(u),o=document.createElement("span");o.style.position="fixed",o.style.padding="6px",o.style.background="#374151",o.style.borderRadius="2px",o.style.boxShadow="0 10px 15px -3px rgba(0,0,0,0.1),0 4px 6px -2px rgba(0,0,0,0.05)",o.style.color="#A5B4FC",o.style.fontWeight="400",o.style.userSelect="all",o.style.zIndex="99999999",o.style.cursor="pointer",o.style.fontSize="16px",o.style.fontFamily="monospace",o.style.whiteSpace="nowrap",o.style.textAlign="center",o.innerText=r,o.setAttribute(`${d}-tooltip-id`,n),o.setAttributeNode(o.ownerDocument.createAttribute(`${d}-tooltip`)),document.body.appendChild(o),o.style.width=`${o.offsetWidth}px`,o.style.left=`${Math.min(window.innerWidth-o.offsetWidth,Math.max(0,i+s/2-o.offsetWidth/2))}px`,o.style.top=`${Math.min(window.outerHeight-o.offsetHeight,Math.max(0,t-o.offsetHeight))}px`,o.addEventListener("click",()=>{document.execCommand("copy"),o.innerText="Copied!",setTimeout(()=>{o.innerText=r},1e3)})},k=(e,n)=>{const t=document.createElement("div"),{top:i,left:s,height:u,width:r}=e.getBoundingClientRect();t.style.position="fixed",t.style.width=`${r}px`,t.style.height=`${u}px`,t.style.left=`${s}px`,t.style.top=`${i}px`,t.style.pointerEvents="none",t.style.zIndex="99999998",t.style.background="rgba(99, 102, 241, .1)",t.style.border="2px solid #6366F1",t.setAttribute(`${d}-highlight-id`,n),document.body.appendChild(t)},w=(e,n,t)=>i=>{const{target:s}=i,u=document.querySelector(`[${d}-tooltip-id="${t}"]`),r=document.querySelector(`[${d}-highlight-id="${t}"]`);if(!(s===n||s===u||n.contains(s))||!S(e))return u&&u.remove(),r&&r.remove();u||(D(n,t),k(n,t))},U={bind:async(e,n,{context:t})=>{if(!t.hubbleUnwatch&&(t.hubbleUnwatch=t.$watch("$hubble",function(){t.$forceUpdate()},{deep:!0})),!p(t))return;const i=Math.random().toString(36).substr(2,11);e.hubbleMouseover=w(t,e,i),document.addEventListener("mouseover",e.hubbleMouseover)},inserted:v,update:v,unbind:async(e,n,{context:t})=>{e.hubbleMouseover&&document.removeEventListener("mouseover",e.hubbleMouseover),t.hubbleUnwatch&&t.hubbleUnwatch()}},B=e=>({all(){return[...document.querySelectorAll(`[${d}]`)]},allMapped(){return E(this.all())},find(n){return[...document.querySelectorAll(`[${d}][${n}]`),...document.querySelectorAll(`[${d}][class*="${n}"]`),...document.querySelectorAll(`[${d}][id*="${n}"]`)]},findMapped(n){return E(this.find(n))},first(n){return this.find(n).shift()},resetOptions(){window.$hubble.options={...e}}});function E(e){return[...e].reduce((n,t)=>({...n,[t.getAttribute(`${d}-selector`)]:t}),{})}const A={defaultSelectorType:"attr",enableComments:!1,enableDeepNamespacing:!0,enableSelectorPicker:!1,environment:"test",enableGroupedSelectors:!0,prefix:""};function M(e,n={}){const t=Object.assign(A,n);t.environment=[].concat(t.environment),Object.defineProperty(t,"NODE_ENV",{value:process.env.NODE_ENV,writable:!1});let i=new e({data:{$hubble:t}});e.mixin({computed:{$hubble:{get(){return{...i.$data.$hubble}},set(s){i.$data.$hubble={...s,environment:[].concat(s.environment)}}}}}),window.$hubble={...B({...t}),options:i.$data.$hubble},e.directive("hubble",U)}typeof window<"u"&&window.Vue&&window.Vue.use(M),c.default=M,c.defaultConfig=A,Object.defineProperties(c,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
//# sourceMappingURL=vue-hubble.umd.js.map
{
"name": "@crishellco/vue-hubble",
"version": "3.6.5",
"version": "3.6.6",
"author": "Chris Mitchell (@crishellco)",

@@ -5,0 +5,0 @@ "description": "Vue test selectors made easy",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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