Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

keep-out-polyfill

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

keep-out-polyfill - npm Package Compare versions

Comparing version 1.2.11 to 1.2.12

2

build/rollup.config.js

@@ -13,4 +13,4 @@ import buble from 'rollup-plugin-buble';

}), // Transpile to ES5
uglify()
// uglify()
],
};

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

!function(){var i=function(){this.winHeight=window.innerHeight,this.navHeight=screen.availHeight-this.winHeight,this.isKeepOut=null,this.isbodyHide=null,this.dispatchResize=!1,this.keyHeight=0,this.clientY=0,this.fnQuery=[],this.init()};i.prototype.init=function(){this.initOrientation(),this.initFocus(),this.initBlur()},i.prototype.initOrientation=function(){var i=this;window.addEventListener("orientationchange",function(){i.winHeight=window.innerHeight,i.navHeight=screen.availHeight-i.winHeight,i.dispatchResize=!1})},i.prototype.isResize=function(){var i=window.innerHeight;return Math.abs(i-this.winHeight)>this.navHeight},i.prototype.getKeiHeight=function(){this.isKeepOut?this.keyHeight=screen.availHeight-window.innerHeight-50:this.keyHeight=window.innerHeight/2},i.prototype.onceComput=function(){this.dispatchResize||(this.dispatchResize=!0,null===this.isKeepOut&&(this.isKeepOut=this.isResize(),this.getKeiHeight()))},i.prototype.focusFn=function(){if(this.clientY>this.keyHeight&&(!1===this.isKeepOut||this.isbodyHide)){var i=this.clientY-this.keyHeight;document.body.style.transition="0.2s",document.body.style.transform="translateY(-"+i+"px)"}},i.prototype.blurFn=function(){document.body.style.transform="translateY(0px)"},i.prototype.initFocus=function(){var n=this;window.addEventListener("click",function(i){var t=i||window.event;n.clientY=t.clientY;var e=n;n.fnQuery.length&&(n.fnQuery.forEach(function(i){i.call(e)}),n.fnQuery.length=0)}),window.addEventListener("keyboardFocus",function(){n.isbodyHide="hidden"===window.getComputedStyle(document.body,null).getPropertyValue("overflow"),n.onceComput(),n.fnQuery.push(n.focusFn)})},i.prototype.initBlur=function(){var i=this;window.addEventListener("keyboardBlur",function(){i.blurFn()})},new i}();
import 'key-board-hook';
(function(){
var KeepOut = function KeepOut() {
this.winHeight = window.innerHeight;
this.navHeight = screen.availHeight - this.winHeight;
this.isKeepOut = null;
this.isbodyHide = null;
this.dispatchResize = false;
this.keyHeight = 0;
this.clientY = 0;
this.fnQuery = [];
this.init();
};
KeepOut.prototype.init = function init () {
this.initOrientation();
this.initFocus();
this.initBlur();
};
KeepOut.prototype.initOrientation = function initOrientation () {
var this$1 = this;
window.addEventListener("orientationchange", function () {
this$1.winHeight = window.innerHeight;
this$1.navHeight = screen.availHeight - this$1.winHeight;
this$1.dispatchResize = false;
});
};
KeepOut.prototype.isResize = function isResize () {
// 配合keyboard事件使用
var curHeight = window.innerHeight;
if (Math.abs(curHeight - this.winHeight) > this.navHeight) {
return true
}
return false
};
KeepOut.prototype.getKeiHeight = function getKeiHeight () {
if(this.isKeepOut){
this.keyHeight = screen.availHeight - window.innerHeight - 50;
}
else{
this.keyHeight = window.innerHeight / 2;
}
};
KeepOut.prototype.onceComput = function onceComput () {
if(this.dispatchResize) { return; }
this.dispatchResize = true;
if(this.isKeepOut === null){
this.isKeepOut = this.isResize();
this.getKeiHeight();
}
};
KeepOut.prototype.focusFn = function focusFn () {
if(this.clientY > this.keyHeight) {
if(this.isKeepOut === false || this.isbodyHide){
var polyfill = this.clientY - this.keyHeight;
document.body.style.transition = '0.2s';
document.body.style.transform = "translateY(-" + polyfill + "px)";
}
}
};
KeepOut.prototype.blurFn = function blurFn () {
document.body.style.transform = "translateY(0px)";
};
KeepOut.prototype.initFocus = function initFocus () {
var this$1 = this;
window.addEventListener('click', function (e) {
var event = e || window.event;
this$1.clientY = event.clientY;
var _this = this$1;
if(this$1.fnQuery.length){
this$1.fnQuery.forEach(function (fn){
fn.call(_this);
});
this$1.fnQuery.length = 0;
}
});
window.addEventListener('keyboardFocus', function () {
this$1.isbodyHide = window.getComputedStyle(document.body, null).getPropertyValue("overflow") === 'hidden';
this$1.onceComput();
this$1.fnQuery.push(this$1.focusFn);
});
};
KeepOut.prototype.initBlur = function initBlur () {
var this$1 = this;
window.addEventListener('keyboardBlur', function () {
this$1.blurFn();
});
};
new KeepOut();
})();

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

!function(){"use strict";var i;(i=function(){this.winHeight=window.innerHeight,this.navHeight=screen.availHeight-this.winHeight,this.isKeepOut=null,this.isbodyHide=null,this.dispatchResize=!1,this.keyHeight=0,this.clientY=0,this.fnQuery=[],this.init()}).prototype.init=function(){this.initOrientation(),this.initFocus(),this.initBlur()},i.prototype.initOrientation=function(){var i=this;window.addEventListener("orientationchange",function(){i.winHeight=window.innerHeight,i.navHeight=screen.availHeight-i.winHeight,i.dispatchResize=!1})},i.prototype.isResize=function(){var i=window.innerHeight;return Math.abs(i-this.winHeight)>this.navHeight},i.prototype.getKeiHeight=function(){this.isKeepOut?this.keyHeight=screen.availHeight-window.innerHeight-50:this.keyHeight=window.innerHeight/2},i.prototype.onceComput=function(){this.dispatchResize||(this.dispatchResize=!0,null===this.isKeepOut&&(this.isKeepOut=this.isResize(),this.getKeiHeight()))},i.prototype.focusFn=function(){if(this.clientY>this.keyHeight&&(!1===this.isKeepOut||this.isbodyHide)){var i=this.clientY-this.keyHeight;document.body.style.transition="0.2s",document.body.style.transform="translateY(-"+i+"px)"}},i.prototype.blurFn=function(){document.body.style.transform="translateY(0px)"},i.prototype.initFocus=function(){var n=this;window.addEventListener("click",function(i){var t=i||window.event;n.clientY=t.clientY;var e=n;n.fnQuery.length&&(n.fnQuery.forEach(function(i){i.call(e)}),n.fnQuery.length=0)}),window.addEventListener("keyboardFocus",function(){n.isbodyHide="hidden"===window.getComputedStyle(document.body,null).getPropertyValue("overflow"),n.onceComput(),n.fnQuery.push(n.focusFn)})},i.prototype.initBlur=function(){var i=this;window.addEventListener("keyboardBlur",function(){i.blurFn()})},new i}();
(function () {
'use strict';
(function(){
var KeepOut = function KeepOut() {
this.winHeight = window.innerHeight;
this.navHeight = screen.availHeight - this.winHeight;
this.isKeepOut = null;
this.isbodyHide = null;
this.dispatchResize = false;
this.keyHeight = 0;
this.clientY = 0;
this.fnQuery = [];
this.init();
};
KeepOut.prototype.init = function init () {
this.initOrientation();
this.initFocus();
this.initBlur();
};
KeepOut.prototype.initOrientation = function initOrientation () {
var this$1 = this;
window.addEventListener("orientationchange", function () {
this$1.winHeight = window.innerHeight;
this$1.navHeight = screen.availHeight - this$1.winHeight;
this$1.dispatchResize = false;
});
};
KeepOut.prototype.isResize = function isResize () {
// 配合keyboard事件使用
var curHeight = window.innerHeight;
if (Math.abs(curHeight - this.winHeight) > this.navHeight) {
return true
}
return false
};
KeepOut.prototype.getKeiHeight = function getKeiHeight () {
if(this.isKeepOut){
this.keyHeight = screen.availHeight - window.innerHeight - 50;
}
else{
this.keyHeight = window.innerHeight / 2;
}
};
KeepOut.prototype.onceComput = function onceComput () {
if(this.dispatchResize) { return; }
this.dispatchResize = true;
if(this.isKeepOut === null){
this.isKeepOut = this.isResize();
this.getKeiHeight();
}
};
KeepOut.prototype.focusFn = function focusFn () {
if(this.clientY > this.keyHeight) {
if(this.isKeepOut === false || this.isbodyHide){
var polyfill = this.clientY - this.keyHeight;
document.body.style.transition = '0.2s';
document.body.style.transform = "translateY(-" + polyfill + "px)";
}
}
};
KeepOut.prototype.blurFn = function blurFn () {
document.body.style.transform = "translateY(0px)";
};
KeepOut.prototype.initFocus = function initFocus () {
var this$1 = this;
window.addEventListener('click', function (e) {
var event = e || window.event;
this$1.clientY = event.clientY;
var _this = this$1;
if(this$1.fnQuery.length){
this$1.fnQuery.forEach(function (fn){
fn.call(_this);
});
this$1.fnQuery.length = 0;
}
});
window.addEventListener('keyboardFocus', function () {
this$1.isbodyHide = window.getComputedStyle(document.body, null).getPropertyValue("overflow") === 'hidden';
this$1.onceComput();
this$1.fnQuery.push(this$1.focusFn);
});
};
KeepOut.prototype.initBlur = function initBlur () {
var this$1 = this;
window.addEventListener('keyboardBlur', function () {
this$1.blurFn();
});
};
new KeepOut();
})();
}());

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

!function(i){"function"==typeof define&&define.amd?define(i):i()}(function(){"use strict";var i;(i=function(){this.winHeight=window.innerHeight,this.navHeight=screen.availHeight-this.winHeight,this.isKeepOut=null,this.isbodyHide=null,this.dispatchResize=!1,this.keyHeight=0,this.clientY=0,this.fnQuery=[],this.init()}).prototype.init=function(){this.initOrientation(),this.initFocus(),this.initBlur()},i.prototype.initOrientation=function(){var i=this;window.addEventListener("orientationchange",function(){i.winHeight=window.innerHeight,i.navHeight=screen.availHeight-i.winHeight,i.dispatchResize=!1})},i.prototype.isResize=function(){var i=window.innerHeight;return Math.abs(i-this.winHeight)>this.navHeight},i.prototype.getKeiHeight=function(){this.isKeepOut?this.keyHeight=screen.availHeight-window.innerHeight-50:this.keyHeight=window.innerHeight/2},i.prototype.onceComput=function(){this.dispatchResize||(this.dispatchResize=!0,null===this.isKeepOut&&(this.isKeepOut=this.isResize(),this.getKeiHeight()))},i.prototype.focusFn=function(){if(this.clientY>this.keyHeight&&(!1===this.isKeepOut||this.isbodyHide)){var i=this.clientY-this.keyHeight;document.body.style.transition="0.2s",document.body.style.transform="translateY(-"+i+"px)"}},i.prototype.blurFn=function(){document.body.style.transform="translateY(0px)"},i.prototype.initFocus=function(){var n=this;window.addEventListener("click",function(i){var t=i||window.event;n.clientY=t.clientY;var e=n;n.fnQuery.length&&(n.fnQuery.forEach(function(i){i.call(e)}),n.fnQuery.length=0)}),window.addEventListener("keyboardFocus",function(){n.isbodyHide="hidden"===window.getComputedStyle(document.body,null).getPropertyValue("overflow"),n.onceComput(),n.fnQuery.push(n.focusFn)})},i.prototype.initBlur=function(){var i=this;window.addEventListener("keyboardBlur",function(){i.blurFn()})},new i});
(function (factory) {
typeof define === 'function' && define.amd ? define(['key-board-hook'], factory) :
factory();
}(function () { 'use strict';
(function(){
var KeepOut = function KeepOut() {
this.winHeight = window.innerHeight;
this.navHeight = screen.availHeight - this.winHeight;
this.isKeepOut = null;
this.isbodyHide = null;
this.dispatchResize = false;
this.keyHeight = 0;
this.clientY = 0;
this.fnQuery = [];
this.init();
};
KeepOut.prototype.init = function init () {
this.initOrientation();
this.initFocus();
this.initBlur();
};
KeepOut.prototype.initOrientation = function initOrientation () {
var this$1 = this;
window.addEventListener("orientationchange", function () {
this$1.winHeight = window.innerHeight;
this$1.navHeight = screen.availHeight - this$1.winHeight;
this$1.dispatchResize = false;
});
};
KeepOut.prototype.isResize = function isResize () {
// 配合keyboard事件使用
var curHeight = window.innerHeight;
if (Math.abs(curHeight - this.winHeight) > this.navHeight) {
return true
}
return false
};
KeepOut.prototype.getKeiHeight = function getKeiHeight () {
if(this.isKeepOut){
this.keyHeight = screen.availHeight - window.innerHeight - 50;
}
else{
this.keyHeight = window.innerHeight / 2;
}
};
KeepOut.prototype.onceComput = function onceComput () {
if(this.dispatchResize) { return; }
this.dispatchResize = true;
if(this.isKeepOut === null){
this.isKeepOut = this.isResize();
this.getKeiHeight();
}
};
KeepOut.prototype.focusFn = function focusFn () {
if(this.clientY > this.keyHeight) {
if(this.isKeepOut === false || this.isbodyHide){
var polyfill = this.clientY - this.keyHeight;
document.body.style.transition = '0.2s';
document.body.style.transform = "translateY(-" + polyfill + "px)";
}
}
};
KeepOut.prototype.blurFn = function blurFn () {
document.body.style.transform = "translateY(0px)";
};
KeepOut.prototype.initFocus = function initFocus () {
var this$1 = this;
window.addEventListener('click', function (e) {
var event = e || window.event;
this$1.clientY = event.clientY;
var _this = this$1;
if(this$1.fnQuery.length){
this$1.fnQuery.forEach(function (fn){
fn.call(_this);
});
this$1.fnQuery.length = 0;
}
});
window.addEventListener('keyboardFocus', function () {
this$1.isbodyHide = window.getComputedStyle(document.body, null).getPropertyValue("overflow") === 'hidden';
this$1.onceComput();
this$1.fnQuery.push(this$1.focusFn);
});
};
KeepOut.prototype.initBlur = function initBlur () {
var this$1 = this;
window.addEventListener('keyboardBlur', function () {
this$1.blurFn();
});
};
new KeepOut();
})();
}));
{
"name": "keep-out-polyfill",
"version": "1.2.11",
"version": "1.2.12",
"main": "dist/keep-out-polyfill.umd.js",

@@ -5,0 +5,0 @@ "module": "dist/keep-out-polyfill.esm.js",

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

import 'key-board-hook'
(function(){

@@ -2,0 +4,0 @@ class KeepOut {

import Vue from 'vue'
import App from './App.vue'
import 'key-board-hook'
import './keep-out-polyfill'

@@ -5,0 +5,0 @@

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