@rnacanvas/utilities 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,CAAC;AAEpB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,CAAC;AAExB,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,CAAC;AAEjC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,CAAC;AAErB,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE5B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,CAAC;AAEvB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,CAAC;AAEpB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,CAAC;AAExB,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,CAAC;AAEjC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,CAAC;AAErB,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE5B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,CAAC;AAEvB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,CAAC;AAEvB,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.utilities=t():e.utilities=t()}(this,(()=>(()=>{"use strict";var e={d:(t,i)=>{for(var r in i)e.o(i,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:i[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function i(e){return e.map((e=>({v:e,priority:Math.random()}))).sort(((e,t)=>e.priority-t.priority)).map((({v:e})=>e))}function r(){return!(!document.activeElement||"textarea"!==document.activeElement.tagName.toLowerCase()&&(e=document.activeElement,"input"!==e.tagName.toLowerCase()||"text"!==(null===(t=e.getAttribute("type"))||void 0===t?void 0:t.toLowerCase())));var e,t}e.r(t),e.d(t,{DownloadableFile:()=>
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.utilities=t():e.utilities=t()}(this,(()=>(()=>{"use strict";var e={d:(t,i)=>{for(var r in i)e.o(i,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:i[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function i(e){return e.map((e=>({v:e,priority:Math.random()}))).sort(((e,t)=>e.priority-t.priority)).map((({v:e})=>e))}function r(){return!(!document.activeElement||"textarea"!==document.activeElement.tagName.toLowerCase()&&(e=document.activeElement,"input"!==e.tagName.toLowerCase()||"text"!==(null===(t=e.getAttribute("type"))||void 0===t?void 0:t.toLowerCase())));var e,t}e.r(t),e.d(t,{DownloadableFile:()=>d,EventfulSet:()=>l,FiniteStack:()=>y,KeyBinding:()=>h,detectMac:()=>c,isBeingInteractedWith:()=>s,isURL:()=>m,shuffled:()=>i,userIsTyping:()=>r});let n=new Set;function s(e){return e===document.body||n.has(e)}window.addEventListener("mousedown",(e=>{if(!(e.target instanceof Node))return void(n=new Set);n=new Set;let t=e.target;for(n.add(t);t.parentNode&&!n.has(t.parentNode);)n.add(t.parentNode),t=t.parentNode}));var o,a=function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)};class h{constructor(e,t,i){this.key=e,this.scope=void 0,o.set(this,void 0),function(e,t,i,r,n){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===r?n.call(e,i):n?n.value=i:t.set(e,i)}(this,o,i,"f"),window.addEventListener("keydown",(i=>{var n,h,c;i.key.toUpperCase()===e.toUpperCase()&&(void 0===(null===(n=a(this,o,"f"))||void 0===n?void 0:n.shiftKey)||a(this,o,"f").shiftKey==i.shiftKey)&&(void 0===(null===(h=a(this,o,"f"))||void 0===h?void 0:h.ctrlKey)||a(this,o,"f").ctrlKey==i.ctrlKey)&&(void 0===(null===(c=a(this,o,"f"))||void 0===c?void 0:c.metaKey)||a(this,o,"f").metaKey==i.metaKey)&&!r()&&this.scope&&s(this.scope)&&(i.preventDefault(),t())}),{passive:!1})}}function c(){try{return window.navigator.platform.toLowerCase().includes("mac")}catch(e){return!1}}o=new WeakMap;class d{constructor(e){this.textContent=e}downloadAs(e,t){let i=new File([this.textContent],e,{type:t.type}),r=URL.createObjectURL(i),n=document.createElement("a");n.href=r,n.download=i.name,document.body.appendChild(n),n.click(),n.remove(),URL.revokeObjectURL(r)}}class l{constructor(){this.eventListeners={change:[]},this.underlyingSet=new Set}[Symbol.iterator](){return this.underlyingSet.values()}includes(e){return this.underlyingSet.has(e)}include(e){return this.includes(e)}addAll(e){let t=[...e];0!=t.length&&(t.every((e=>this.includes(e)))||(t.forEach((e=>this.underlyingSet.add(e))),this.callEventListeners("change")))}removeAll(e){let t=[...e];0!=t.length&&(t.every((e=>!this.includes(e)))||(t.forEach((e=>this.underlyingSet.delete(e))),this.callEventListeners("change")))}clear(){0!=this.underlyingSet.size&&(this.underlyingSet.clear(),this.callEventListeners("change"))}addEventListener(e,t){this.eventListeners[e].push(t)}callEventListeners(e){this.eventListeners[e].forEach((e=>e()))}removeEventListener(e,t){this.eventListeners[e]=this.eventListeners[e].filter((e=>e!==t))}}var u,f,p,v,w=function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)};class y{constructor(e){u.add(this),this.maxSize=e,f.set(this,[]),p.set(this,{change:[]})}get size(){return w(this,f,"f").length}isEmpty(){return 0==this.size}empty(){0!=this.size&&(function(e,t,i,r,n){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===r?n.call(e,i):n?n.value=i:t.set(e,i)}(this,f,[],"f"),w(this,u,"m",v).call(this,"change"))}peek(){if(0==this.size)throw new Error("The stack is empty.");return w(this,f,"f")[w(this,f,"f").length-1]}push(e){w(this,f,"f").push(e),this.size>this.maxSize&&w(this,f,"f").shift(),w(this,u,"m",v).call(this,"change")}pop(){if(0==this.size)throw new Error("The stack is empty.");let e=w(this,f,"f").pop();return w(this,u,"m",v).call(this,"change"),e}addEventListener(e,t){w(this,p,"f")[e].push(t)}removeEventListener(e,t){w(this,p,"f")[e]=w(this,p,"f")[e].filter((e=>e!==t))}}function m(e){try{return new URL(e),!0}catch(e){return!1}}return f=new WeakMap,p=new WeakMap,u=new WeakSet,v=function(e){w(this,p,"f")[e].forEach((e=>e()))},t})()));
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* are currently being interacted with by the user.
|
|
4
4
|
*
|
|
5
5
|
* Note that this function may not work properly with lazy loading or dynamic imports
|
|
6
|
-
* (since it only begins tracking which
|
|
6
|
+
* (since it only begins tracking which elements are being interacted with after being imported).
|
|
7
7
|
*/
|
|
8
8
|
export declare function isBeingInteractedWith(ele: Element): boolean;
|
|
9
9
|
//# sourceMappingURL=isBeingInteractedWith.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isBeingInteractedWith.d.ts","sourceRoot":"","sources":["../src/isBeingInteractedWith.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"isBeingInteractedWith.d.ts","sourceRoot":"","sources":["../src/isBeingInteractedWith.ts"],"names":[],"mappings":"AAsBA;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAK3D"}
|
package/dist/isURL.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isURL.d.ts","sourceRoot":"","sources":["../src/isURL.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAOxC"}
|