New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@ampify/aquery

Package Overview
Dependencies
Maintainers
2
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ampify/aquery - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

2

dist/aquery.js

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

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.aQuery=e():t.aQuery=e()}(window,(function(){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var s=e[o]={i:o,l:!1,exports:{}};return t[o].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)n.d(o,s,function(e){return t[e]}.bind(null,s));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=5)}([function(t,e,n){const o=n(2);t.exports=(t=6)=>"__ampify__"+o("1234567890QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopaasdfghjklzxcvbnm_",t)},function(t,e){t.exports=t=>{const e=document.createElement("style");e.appendChild(document.createTextNode(t)),document.head.appendChild(e)}},function(t,e,n){var o=n(3),s=n(4);t.exports=s.bind(null,o)},function(t,e){var n=self.crypto||self.msCrypto;t.exports=function(t){return n.getRandomValues(new Uint8Array(t))}},function(t,e){t.exports=function(t,e,n){for(var o=(2<<Math.log(e.length-1)/Math.LN2)-1,s=Math.ceil(1.6*o*n/e.length),r="";;)for(var i=s,a=t(i);i--;)if((r+=e[a[i]&o]||"").length===+n)return r}},function(t,e,n){"use strict";n.r(e);var o=n(1),s=n.n(o),r=n(0),i=n.n(r);var a=(t,{input:e,source:n,minLength:o=1,appendTo:s,classes:r={},template:a,itemsKey:d="items",query:c="term"})=>{const u=i()(),p=`input-debounced:AMP.setState(${(({id:t,minCharacters:e})=>`{\n ${t}_ac: {\n query: event.value,\n showDropdown: true\n }, \n ${t}_ac_xhr: {\n status: event.value.length >= ${e} ? 'LOADING' : ''\n }\n }`)({id:u,minLength:o})})`,f=`tap:AMP.setState(${(({id:t})=>`{\n ${t}_ac: {\n showDropdown: true\n }\n }`)({id:u})})`;t(e).appendActions([p,f]),(({id:t})=>{const e=document.createElement("amp-state");e.id=`${t}_ac`,e.innerHTML='<script type="application/json">\n {\n "query": "",\n "showDropdown": false,\n "height": 0\n }\n <\/script>',document.body.prepend(e)})({id:u}),(({id:t,source:e,query:n,minLength:o})=>{const s=document.createElement("amp-state");s.id=`${t}_ac_xhr`,s.setAttribute("src",e),s.setAttribute("data-amp-bind-src",`${t}_ac.query.length >= ${o} ? '${e}?${n}=' + encodeURIComponent(${t}_ac.query) : '${e}'`),document.body.prepend(s)})({id:u,source:n,query:c,minLength:o}),(({id:t,appendTo:e,classes:n,template:o,minLength:s,itemsKey:r})=>{const i=document.createElement("div");i.classList.add("aq-ac-dialog",n.dialog||""),i.setAttribute("hidden",""),i.setAttribute("ampify-keep",""),i.setAttribute("data-amp-bind-hidden",`!(${t}_ac.query.length >= ${s} && ${t}_ac_xhr.items && ${t}_ac_xhr.items.length)`),e.appendChild(i);const a=document.createElement("amp-list");a.setAttribute("layout","fixed-height"),a.setAttribute("height","0"),a.setAttribute("data-amp-bind-is-layout-container",`${t}_ac_xhr.${r}.length > 0`),a.setAttribute("data-amp-bind-src",`${t}_ac_xhr.${r}`),a.setAttribute("items","."),i.appendChild(a);const d=document.createElement("template");d.setAttribute("type","amp-mustache"),d.innerHTML=o,a.appendChild(d)})({id:u,appendTo:s,classes:r,template:a,minLength:o,itemsKey:d})};const d=(()=>{let t=1e3,e="events",n=[],o=new Set;const r={start:"ampify-sd",end:"ampify-sds"},d={appendActions:(t,e)=>{const n=t.getAttribute("on")?t.getAttribute("on").split(";"):[];e.forEach(t=>n.push(t)),t.setAttribute("on",e.join(";"))}};class c{constructor(t){this.nodes=t;for(const t of this.nodes)t.setAttribute("ampify-keep","");return this}on(o,s){e="actions",n=[];for(const e of this.nodes)n=[],s({target:e}),"click"===o&&(e.removeAttribute("href"),e.setAttribute("role","button"),e.setAttribute("tabindex",++t),d.appendActions(e,[`tap:${n.join(",")}`]));e="events"}autoComplete(t={}){for(const e of this.nodes)a(p,Object.assign({},t,{input:e}))}appendActions(t){for(const e of this.nodes)d.appendActions(e,t)}}class u{constructor(t){this.nodes=t;for(const t of this.nodes)t.setAttribute("ampify-keep","");return this}genId(t){return t.id?o.add(`#${t.id}`):t.id=i()(),t.id}toggleVisibility(){for(const t of this.nodes)n.push(`${this.genId(t)}.toggleVisibility()`);return this}show(){for(const t of this.nodes)n.push(`${this.genId(t)}.show()`);return this}hide(){for(const t of this.nodes)n.push(`${this.genId(t)}.hide()`);return this}toggleClass(...t){for(const e of this.nodes)t.forEach(t=>{o.add(`.${t}`),n.push(`${this.genId(e)}.toggleClass(class='${t}')`)});return this}focus(){for(const t of this.nodes)n.push(`${this.genId(t)}.focus()`),null===t.offsetParent&&t.setAttribute("autofocus","");return this}slideDown(){return this.addEffect("slide-down")}addEffect(t){const{start:e,end:i}=r;(t=>{window[`aQuery_css_${t}`]||(s()("\n :root:not(#_) .ampify-sd {\n transition: transform 250ms ease-in-out;\n transform-origin: top;\n transform: scaleY(0);\n display: block;\n }\n \n :root:not(#_) .ampify-sds {\n transform: scaleY(1);\n }\n "),window[`aQuery_css_${t}`]=!0)})(t);for(const t of this.nodes)t.classList.add(e),console.log("addEffect",t,e),o.add(`.${i}`),n.push(`${this.genId(t)}.toggleClass(class='${i}')`);return this}}const p=window.aQuery=t=>{var n;return n=t,t=NodeList.prototype.isPrototypeOf(n)?Array.from(n):[n],"events"==e?new c(t):new u(t)};return p.cssIgnore=()=>Array.from(o).filter(t=>!/#__ampify__/.test(t)),p.injectCss=s.a,p.AMP=d,p})();e.default=d}])}));
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.aQuery=e():t.aQuery=e()}(window,(function(){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var s=e[o]={i:o,l:!1,exports:{}};return t[o].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)n.d(o,s,function(e){return t[e]}.bind(null,s));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=5)}([function(t,e,n){const o=n(2);t.exports=(t=6)=>"__ampify__"+o("1234567890QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopaasdfghjklzxcvbnm_",t)},function(t,e){t.exports=t=>{const e=document.createElement("style");e.appendChild(document.createTextNode(t)),document.head.appendChild(e)}},function(t,e,n){var o=n(3),s=n(4);t.exports=s.bind(null,o)},function(t,e){var n=self.crypto||self.msCrypto;t.exports=function(t){return n.getRandomValues(new Uint8Array(t))}},function(t,e){t.exports=function(t,e,n){for(var o=(2<<Math.log(e.length-1)/Math.LN2)-1,s=Math.ceil(1.6*o*n/e.length),r="";;)for(var i=s,a=t(i);i--;)if((r+=e[a[i]&o]||"").length===+n)return r}},function(t,e,n){"use strict";n.r(e);var o=n(1),s=n.n(o),r=n(0),i=n.n(r);var a=(t,{input:e,source:n,minLength:o=1,appendTo:s,classes:r={},template:a,itemsKey:d="items",query:c="term"})=>{const u=i()(),p=`input-debounced:AMP.setState(${(({id:t,minCharacters:e})=>`{\n ${t}_ac: {\n query: event.value,\n showDropdown: true\n }, \n ${t}_ac_xhr: {\n status: event.value.length >= ${e} ? 'LOADING' : ''\n }\n }`)({id:u,minLength:o})})`,f=`tap:AMP.setState(${(({id:t})=>`{\n ${t}_ac: {\n showDropdown: true\n }\n }`)({id:u})})`;t(e).appendActions([p,f]),(({id:t})=>{const e=document.createElement("amp-state");e.id=`${t}_ac`,e.innerHTML='<script type="application/json">\n {\n "query": "",\n "showDropdown": false,\n "height": 0\n }\n <\/script>',document.body.prepend(e)})({id:u}),(({id:t,source:e,query:n,minLength:o})=>{const s=document.createElement("amp-state");s.id=`${t}_ac_xhr`,s.setAttribute("src",e),s.setAttribute("data-amp-bind-src",`${t}_ac.query.length >= ${o} ? '${e}?${n}=' + encodeURIComponent(${t}_ac.query) : '${e}'`),document.body.prepend(s)})({id:u,source:n,query:c,minLength:o}),(({id:t,appendTo:e,classes:n,template:o,minLength:s,itemsKey:r})=>{const i=document.createElement("div");i.classList.add("aq-ac-dialog",n.dialog||""),i.setAttribute("hidden",""),i.setAttribute("ampify-keep",""),i.setAttribute("data-amp-bind-hidden",`!(${t}_ac.query.length >= ${s} && ${t}_ac_xhr.items && ${t}_ac_xhr.items.length)`),e.appendChild(i);const a=document.createElement("amp-list");a.setAttribute("layout","fixed-height"),a.setAttribute("height","0"),a.setAttribute("data-amp-bind-is-layout-container",`${t}_ac_xhr.${r}.length > 0`),a.setAttribute("data-amp-bind-src",`${t}_ac_xhr.${r}`),a.setAttribute("items","."),i.appendChild(a);const d=document.createElement("template");d.setAttribute("type","amp-mustache"),d.innerHTML=o,a.appendChild(d)})({id:u,appendTo:s,classes:r,template:a,minLength:o,itemsKey:d})};const d=(()=>{let t=1e3,e="events",n=[],o=new Set;const r={start:"ampify-sd",end:"ampify-sds"},d={appendActions:(t,e)=>{const n=t.getAttribute("on")?t.getAttribute("on").split(";"):[];e.forEach(t=>n.push(t)),t.setAttribute("on",e.join(";"))}};class c{constructor(t){this.nodes=t;for(const t of this.nodes)t.setAttribute("ampify-keep","");return this}on(o,s){e="actions",n=[];for(const e of this.nodes)n=[],s({target:e}),"click"===o&&(e.removeAttribute("href"),e.setAttribute("role","button"),e.setAttribute("tabindex",++t),d.appendActions(e,[`tap:${n.join(",")}`]));e="events"}autoComplete(t={}){for(const e of this.nodes)a(p,Object.assign({},t,{input:e}))}appendActions(t){for(const e of this.nodes)d.appendActions(e,t)}}class u{constructor(t){this.nodes=t;for(const t of this.nodes)t.setAttribute("ampify-keep","");return this}genId(t){return t.id?o.add(`#${t.id}`):t.id=i()(),t.id}toggleVisibility(){for(const t of this.nodes)n.push(`${this.genId(t)}.toggleVisibility()`);return this}show(){for(const t of this.nodes)n.push(`${this.genId(t)}.show()`);return this}hide(){for(const t of this.nodes)n.push(`${this.genId(t)}.hide()`);return this}toggleClass(...t){for(const e of this.nodes)t.forEach(t=>{o.add(`.${t}`),n.push(`${this.genId(e)}.toggleClass(class='${t}')`)});return this}focus(){for(const t of this.nodes)n.push(`${this.genId(t)}.focus()`),null===t.offsetParent&&t.setAttribute("autofocus","");return this}slideDown(){return this.addEffect("slide-down")}addEffect(t){const{start:e,end:i}=r;(t=>{window[`aQuery_css_${t}`]||(s()("\n :root:not(#_) .ampify-sd {\n transition: transform 250ms ease-in-out;\n transform-origin: top;\n transform: scaleY(0);\n display: block;\n }\n \n :root:not(#_) .ampify-sds {\n transform: scaleY(1);\n }\n "),window[`aQuery_css_${t}`]=!0)})(t);for(const t of this.nodes)t.classList.add(e),console.log("addEffect",t,e),o.add(`.${i}`),n.push(`${this.genId(t)}.toggleClass(class='${i}')`);return this}}const p=t=>{var n;return n=t,t=NodeList.prototype.isPrototypeOf(n)?Array.from(n):[n],"events"==e?new c(t):new u(t)};return p.cssIgnore=()=>Array.from(o).filter(t=>!/#__ampify__/.test(t)),p.injectCss=s.a,p.AMP=d,p})();e.default=d}]).default}));
{
"name": "@ampify/aquery",
"version": "0.0.1",
"version": "0.0.2",
"main": "./dist/aquery.js",

@@ -11,3 +11,5 @@ "module": "./src",

"build": "webpack -p",
"test": "jest"
"test": "jest",
"prepublish": "yarn build",
"npm-publish": "yarn publish --access public"
},

@@ -14,0 +16,0 @@ "devDependencies": {

@@ -190,3 +190,3 @@ import injectCss from '@ampify/utils/addCss';

const aQuery = window.aQuery = (nodes) => {
const aQuery = (nodes) => {
nodes = nodesToArray(nodes);

@@ -193,0 +193,0 @@

@@ -13,4 +13,5 @@ const { name } = require('./package');

libraryTarget: 'umd',
libraryExport: 'default',
filename: 'aquery.js'
}
};
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc