@hierotech/frontend
Advanced tools
Comparing version 0.1.18 to 0.1.19
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-dom"),require("react")):"function"==typeof define&&define.amd?define(["react-dom","react"],t):"object"==typeof exports?exports.hierotechFrontend=t(require("react-dom"),require("react")):e.hierotechFrontend=t(e["react-dom"],e.react)}(self,(function(e,t){return(()=>{"use strict";var n={156:e=>{e.exports=t},111:t=>{t.exports=e}},r={};function o(e){var t=r[e];if(t!==undefined)return t.exports;var i=r[e]={exports:{}};return n[e](i,i.exports,o),i.exports}o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{o.r(i),o.d(i,{Frontend:()=>e,Hooks:()=>t});var e={};o.r(e),o.d(e,{copyTextToClipboard:()=>y,createAssetLogoPortalUrl:()=>m,createAssetLogoUrl:()=>s,createAssetPlaceholderUrl:()=>h,createUserAvatarUrl:()=>p,createWindow:()=>v,findElement:()=>g,formatDate:()=>w,formatTimerTime:()=>b,getDocumentClientSize:()=>E,getTextWidth:()=>S,getWindowSize:()=>x,init:()=>A,isExternalUrl:()=>T,measureElement:()=>j});var t={};o.r(t),o.d(t,{useCurrentDate:()=>M,useDocumentClientSize:()=>O,useElementSize:()=>P,useWindowSize:()=>_});var n=o(111),r=3600,u=null,a=null,c=null,l=null,f=null;function d(e,t,n,r){if(!u)throw new Error("bucketUrl is not initialized");return"".concat(u,"/").concat(e,"/").concat(t,"/").concat(n,"/").concat(r)}function s(e){var t=e.files.find((function(e){return"asset_logo"===e.type}));return d("assets",e.ticker,"logo",t.name)}function m(e){if(!a)throw new Error("defaultAssetLogo is not initialized");var t=e.files.find((function(e){return"asset_logo_portal"===e.type}));return t?d("assets",e.ticker,"logo-portal",t.name):a}function h(e){if(!c)throw new Error("defaultAssetPlaceholder is not initialized");var t=e.files.find((function(e){return"asset_placeholder"===e.type}));return t?d("assets",e.ticker,"placeholder",t.name):c}function p(e){if(!l)throw new Error("defaultAvatar is not initialized");var t=e.files.find((function(e){return"user_avatar"===e.type}));return t?d("users",e.user_id,"avatar",t.name):l}function v(e){var t=arguments.length>1&&arguments[1]!==undefined&&arguments[1],n=window.open(e);t&&n&&n.focus()}function y(e){var t=document.createElement("textarea");t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.opacity="0",t.innerText=e;var n=document.getElementsByTagName("body")[0];n.appendChild(t),t.select(),document.execCommand("copy"),n.removeChild(t)}function g(e,t){for(var n=e;n;){if(n===t)return!0;n=n.parentNode}return!1}function w(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},n=t.mode,r=void 0===n?"datetime":n,o=new Date(e),i=o.toLocaleDateString("en",{day:"2-digit",month:"long",year:"numeric"});if("date"===r)return i;var u=o.toLocaleTimeString("en",{hour:"numeric",minute:"2-digit"});return"".concat(i,", ").concat(u)}function b(e){var t=Math.floor(e/86400);e%=86400;var n=Math.floor(e/r);return e%=r,[t,n,Math.floor(e/60),e%=60].map((function(e){return e.toString().padStart(2,"0")})).join(":")}function E(){return{height:document.documentElement.clientHeight||document.body.clientHeight,width:document.documentElement.clientWidth||document.body.clientWidth}}function S(e,t){f||(f=document.createElement("canvas"));var n=f.getContext("2d");return n.font=t,n.measureText(e).width}function x(){return{height:window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,width:window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth}}function A(e){u=e.bucketUrl,a=e.defaultAssetLogo,c=e.defaultAssetPlaceholder,l=e.defaultAvatar}function T(e){return/^(https?:)?\/\//.test(e)}function j(e){var t=n.findDOMNode(e);return{width:t.offsetWidth,height:t.offsetHeight}}function z(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function W(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],u=!0,a=!1;try{for(n=n.call(e);!(u=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);u=!0);}catch(c){a=!0,o=c}finally{try{u||null==n["return"]||n["return"]()}finally{if(a)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return z(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?z(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var C=o(156),D=new Set,U=new Map,L=new Set;window.addEventListener("resize",(function(){var e=x(),t=E();L.forEach((function(t){t(e)})),D.forEach((function(e){e(t)})),U.forEach((function(e,t){t.current&&e(j(t.current))}))}));var M=function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1e3,t=(0,C.useState)(new Date),n=W(t,2),r=n[0],o=n[1];return(0,C.useEffect)((function(){var t=setInterval((function(){o(new Date)}),e);return function(){return clearInterval(t)}}),[e]),r},O=function(){var e=W((0,C.useState)(E()),2),t=e[0],n=e[1];return(0,C.useEffect)((function(){return D.add(n),function(){D["delete"](n)}}),[]),(0,C.useLayoutEffect)((function(){n(E())}),[]),[t]},P=function(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{width:0,height:0},n=(0,C.useState)(t),r=W(n,2),o=r[0],i=r[1];return(0,C.useEffect)((function(){U.set(e,i),e.current&&i(j(e.current));var t=setTimeout((function(){t=null,e.current&&i(j(e.current))}),100);return function(){t&&clearTimeout(t),U["delete"](e)}}),[e]),[o]},_=function(){var e=W((0,C.useState)(x()),2),t=e[0],n=e[1];return(0,C.useEffect)((function(){return L.add(n),function(){L["delete"](n)}}),[]),[t]}})(),i})()})); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.hierotechFrontend=t(require("react")):e.hierotechFrontend=t(e.react)}(self,(e=>(()=>{"use strict";var t={156:t=>{t.exports=e}},n={};function r(e){var o=n[e];if(o!==undefined)return o.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,r),i.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{r.r(o),r.d(o,{Frontend:()=>e,Hooks:()=>t});var e={};r.r(e),r.d(e,{copyTextToClipboard:()=>v,createAssetLogoPortalUrl:()=>s,createAssetLogoUrl:()=>d,createAssetPlaceholderUrl:()=>m,createUserAvatarUrl:()=>h,createWindow:()=>p,findElement:()=>y,formatDate:()=>g,formatTimerTime:()=>w,getDocumentClientSize:()=>b,getTextWidth:()=>E,getWindowSize:()=>S,init:()=>x,isExternalUrl:()=>A,measureElement:()=>T});var t={};r.r(t),r.d(t,{useCurrentDate:()=>L,useDocumentClientSize:()=>P,useElementSize:()=>_,useWindowSize:()=>H});var n=3600,i=null,u=null,a=null,c=null,l=null;function f(e,t,n,r){if(!i)throw new Error("bucketUrl is not initialized");return"".concat(i,"/").concat(e,"/").concat(t,"/").concat(n,"/").concat(r)}function d(e){var t=e.files.find((function(e){return"asset_logo"===e.type}));return f("assets",e.ticker,"logo",t.name)}function s(e){if(!u)throw new Error("defaultAssetLogo is not initialized");var t=e.files.find((function(e){return"asset_logo_portal"===e.type}));return t?f("assets",e.ticker,"logo-portal",t.name):u}function m(e){if(!a)throw new Error("defaultAssetPlaceholder is not initialized");var t=e.files.find((function(e){return"asset_placeholder"===e.type}));return t?f("assets",e.ticker,"placeholder",t.name):a}function h(e){if(!c)throw new Error("defaultAvatar is not initialized");var t=e.files.find((function(e){return"user_avatar"===e.type}));return t?f("users",e.user_id,"avatar",t.name):c}function p(e){var t=arguments.length>1&&arguments[1]!==undefined&&arguments[1],n=window.open(e);t&&n&&n.focus()}function v(e){var t=document.createElement("textarea");t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.opacity="0",t.innerText=e;var n=document.getElementsByTagName("body")[0];n.appendChild(t),t.select(),document.execCommand("copy"),n.removeChild(t)}function y(e,t){for(var n=e;n;){if(n===t)return!0;n=n.parentNode}return!1}function g(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},n=t.mode,r=void 0===n?"datetime":n,o=new Date(e),i=o.toLocaleDateString("en",{day:"2-digit",month:"long",year:"numeric"});if("date"===r)return i;var u=o.toLocaleTimeString("en",{hour:"numeric",minute:"2-digit"});return"".concat(i,", ").concat(u)}function w(e){var t=Math.floor(e/86400);e%=86400;var r=Math.floor(e/n);return e%=n,[t,r,Math.floor(e/60),e%=60].map((function(e){return e.toString().padStart(2,"0")})).join(":")}function b(){return{height:document.documentElement.clientHeight||document.body.clientHeight,width:document.documentElement.clientWidth||document.body.clientWidth}}function E(e,t){l||(l=document.createElement("canvas"));var n=l.getContext("2d");return n.font=t,n.measureText(e).width}function S(){return{height:window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,width:window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth}}function x(e){i=e.bucketUrl,u=e.defaultAssetLogo,a=e.defaultAssetPlaceholder,c=e.defaultAvatar}function A(e){return/^(https?:)?\/\//.test(e)}function T(e){return{width:e.offsetWidth,height:e.offsetHeight}}function j(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function z(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],u=!0,a=!1;try{for(n=n.call(e);!(u=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);u=!0);}catch(c){a=!0,o=c}finally{try{u||null==n["return"]||n["return"]()}finally{if(a)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return j(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?j(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var W=r(156),C=new Set,U=new Map,D=new Set;window.addEventListener("resize",(function(){var e=S(),t=b();D.forEach((function(t){t(e)})),C.forEach((function(e){e(t)})),U.forEach((function(e,t){t.current&&e(T(t.current))}))}));var L=function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1e3,t=(0,W.useState)(new Date),n=z(t,2),r=n[0],o=n[1];return(0,W.useEffect)((function(){var t=setInterval((function(){o(new Date)}),e);return function(){return clearInterval(t)}}),[e]),r},P=function(){var e=z((0,W.useState)(b()),2),t=e[0],n=e[1];return(0,W.useEffect)((function(){return C.add(n),function(){C["delete"](n)}}),[]),(0,W.useLayoutEffect)((function(){n(b())}),[]),[t]},_=function(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{width:0,height:0},n=(0,W.useState)(t),r=z(n,2),o=r[0],i=r[1];return(0,W.useEffect)((function(){U.set(e,i),e.current&&i(T(e.current));var t=setTimeout((function(){t=null,e.current&&i(T(e.current))}),100);return function(){t&&clearTimeout(t),U["delete"](e)}}),[e]),[o]},H=function(){var e=z((0,W.useState)(S()),2),t=e[0],n=e[1];return(0,W.useEffect)((function(){return D.add(n),function(){D["delete"](n)}}),[]),[t]}})(),o})())); | ||
//# sourceMappingURL=index.browser.js.map |
{ | ||
"name": "@hierotech/frontend", | ||
"version": "0.1.18", | ||
"version": "0.1.19", | ||
"description": "Common frontend methods and hooks", | ||
@@ -26,21 +26,21 @@ "main": "dist/index.browser.js", | ||
"dependencies": { | ||
"react": "^17.0.2", | ||
"react-dom": "^17.0.2" | ||
"react": "^18.0.0", | ||
"react-dom": "^18.0.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.16.12", | ||
"@babel/eslint-parser": "^7.16.5", | ||
"@babel/register": "^7.16.9", | ||
"@babel/runtime": "^7.16.7", | ||
"@ololoepepe/babel-preset-default": "^0.1.26", | ||
"babel-loader": "^8.2.3", | ||
"core-js": "^3.20.3", | ||
"eslint": "^8.7.0", | ||
"eslint-config-xo": "^0.39.0", | ||
"mocha": "^9.2.0", | ||
"@babel/core": "^7.17.8", | ||
"@babel/eslint-parser": "^7.17.0", | ||
"@babel/register": "^7.17.7", | ||
"@babel/runtime": "^7.17.8", | ||
"@ololoepepe/babel-preset-default": "^0.1.27", | ||
"babel-loader": "^8.2.4", | ||
"core-js": "^3.21.1", | ||
"eslint": "^8.12.0", | ||
"eslint-config-xo": "^0.40.0", | ||
"mocha": "^9.2.2", | ||
"regenerator-runtime": "^0.13.9", | ||
"terser-webpack-plugin": "^5.3.0", | ||
"webpack": "^5.67.0", | ||
"terser-webpack-plugin": "^5.3.1", | ||
"webpack": "^5.71.0", | ||
"webpack-cli": "^4.9.2" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27252
23
+ Addedreact@18.3.1(transitive)
+ Addedreact-dom@18.3.1(transitive)
+ Addedscheduler@0.23.2(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedreact@17.0.2(transitive)
- Removedreact-dom@17.0.2(transitive)
- Removedscheduler@0.20.2(transitive)
Updatedreact@^18.0.0
Updatedreact-dom@^18.0.0