@rnacanvas/utilities 2.3.0 → 2.3.1
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.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,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[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 n(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:()=>l,EventfulSet:()=>d,KeyBinding:()=>a,detectMac:()=>c,isBeingInteractedWith:()=>i,shuffled:()=>n,userIsTyping:()=>r});let o=null;function i(e){return e===document.body
|
|
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,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[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 n(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:()=>l,EventfulSet:()=>d,KeyBinding:()=>a,detectMac:()=>c,isBeingInteractedWith:()=>i,shuffled:()=>n,userIsTyping:()=>r});let o=null;function i(e){return e===document.body||!!o&&o.target instanceof Node&&e.contains(o.target)}window.addEventListener("mousedown",(e=>o=e));var s;class a{constructor(e,t){this.key=e,s.set(this,void 0),window.addEventListener("keydown",(n=>{n.key.toUpperCase()!==e.toUpperCase()||r()||!i(this.scope)||t()}))}get scope(){var e;return null!==(e=function(e,t,n,r){if("a"===n&&!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"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}(this,s,"f"))&&void 0!==e?e:document.body}set scope(e){!function(e,t,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===r?o.call(e,n):o?o.value=n:t.set(e,n)}(this,s,e,"f")}}function c(){try{return window.navigator.platform.toLowerCase().includes("mac")}catch(e){return!1}}s=new WeakMap;class l{constructor(e){this.textContent=e}downloadAs(e,t){let n=new File([this.textContent],e,{type:t.type}),r=URL.createObjectURL(n),o=document.createElement("a");o.href=r,o.download=n.name,document.body.appendChild(o),o.click(),o.remove(),URL.revokeObjectURL(r)}}class d{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))}}return t})()));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isBeingInteractedWith.d.ts","sourceRoot":"","sources":["../src/isBeingInteractedWith.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"isBeingInteractedWith.d.ts","sourceRoot":"","sources":["../src/isBeingInteractedWith.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAQ3D"}
|