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

gl-w-frontend

Package Overview
Dependencies
Maintainers
1
Versions
130
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gl-w-frontend - npm Package Compare versions

Comparing version 1.1.17-alpha to 1.2.0

lib/esm/index.d.ts

25

lib/index.js

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

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var core_services_attachment_service_1 = require("./scripts/core/services/attachment/core-services-attachment.service");
var core_services_array_service_1 = require("./scripts/core/services/array/core-services-array.service");
var core_services_browser_service_1 = require("./scripts/core/services/browser/core-services-browser.service");
var Array = { removeArrayDuplicateLegacy: core_services_array_service_1.removeArrayDuplicateLegacy, sortByKey: core_services_array_service_1.sortByKey };
exports.Array = Array;
var ArraySort = { sortByKey: core_services_array_service_1.sortByKey };
exports.ArraySort = ArraySort;
var ArrayRemove = { removeArrayDuplicateLegacy: core_services_array_service_1.removeArrayDuplicateLegacy };
exports.ArrayRemove = ArrayRemove;
var Attachment = { validateFile: core_services_attachment_service_1.validateFile, validateFileSize: core_services_attachment_service_1.validateFileSize, textFileToUrlImage: core_services_attachment_service_1.textFileToUrlImage, parseAcceptFiles: core_services_attachment_service_1.parseAcceptFiles };
exports.Attachment = Attachment;
var AttachmentConvert = { textFileToUrlImage: core_services_attachment_service_1.textFileToUrlImage };
exports.AttachmentConvert = AttachmentConvert;
var AttachmentParse = { parseAcceptFiles: core_services_attachment_service_1.parseAcceptFiles };
exports.AttachmentParse = AttachmentParse;
var Browser = { isIE: core_services_browser_service_1.isIE, isBeforeIE11: core_services_browser_service_1.isBeforeIE11, disableFullscreenListener: core_services_browser_service_1.disableFullscreenListener, fullscreenListener: core_services_browser_service_1.fullscreenListener, toggleFullScreen: core_services_browser_service_1.toggleFullScreen, hasFullscreen: core_services_browser_service_1.hasFullscreen };
exports.Browser = Browser;
var BrowserVersion = { isIE: core_services_browser_service_1.isIE, isBeforeIE11: core_services_browser_service_1.isBeforeIE11 };
exports.BrowserVersion = BrowserVersion;
var BrowserFullscreen = { disableFullscreenListener: core_services_browser_service_1.disableFullscreenListener, fullscreenListener: core_services_browser_service_1.fullscreenListener, toggleFullScreen: core_services_browser_service_1.toggleFullScreen, hasFullscreen: core_services_browser_service_1.hasFullscreen };
exports.BrowserFullscreen = BrowserFullscreen;
//# sourceMappingURL=index.js.map
"use strict";Object.defineProperty(exports,"__esModule",{value:true});var core_services_attachment_service_1=require("./scripts/core/services/attachment/core-services-attachment.service");var core_services_array_service_1=require("./scripts/core/services/array/core-services-array.service");var core_services_browser_service_1=require("./scripts/core/services/browser/core-services-browser.service");var Array={removeArrayDuplicateLegacy:core_services_array_service_1.removeArrayDuplicateLegacy,sortByKey:core_services_array_service_1.sortByKey};exports.Array=Array;var ArraySort={sortByKey:core_services_array_service_1.sortByKey};exports.ArraySort=ArraySort;var ArrayRemove={removeArrayDuplicateLegacy:core_services_array_service_1.removeArrayDuplicateLegacy};exports.ArrayRemove=ArrayRemove;var Attachment={validateFile:core_services_attachment_service_1.validateFile,validateFileSize:core_services_attachment_service_1.validateFileSize,textFileToUrlImage:core_services_attachment_service_1.textFileToUrlImage,parseAcceptFiles:core_services_attachment_service_1.parseAcceptFiles};exports.Attachment=Attachment;var AttachmentConvert={textFileToUrlImage:core_services_attachment_service_1.textFileToUrlImage};exports.AttachmentConvert=AttachmentConvert;var AttachmentParse={parseAcceptFiles:core_services_attachment_service_1.parseAcceptFiles};exports.AttachmentParse=AttachmentParse;var Browser={isIE:core_services_browser_service_1.isIE,isBeforeIE11:core_services_browser_service_1.isBeforeIE11,disableFullscreenListener:core_services_browser_service_1.disableFullscreenListener,fullscreenListener:core_services_browser_service_1.fullscreenListener,toggleFullScreen:core_services_browser_service_1.toggleFullScreen,hasFullscreen:core_services_browser_service_1.hasFullscreen};exports.Browser=Browser;var BrowserVersion={isIE:core_services_browser_service_1.isIE,isBeforeIE11:core_services_browser_service_1.isBeforeIE11};exports.BrowserVersion=BrowserVersion;var BrowserFullscreen={disableFullscreenListener:core_services_browser_service_1.disableFullscreenListener,fullscreenListener:core_services_browser_service_1.fullscreenListener,toggleFullScreen:core_services_browser_service_1.toggleFullScreen,hasFullscreen:core_services_browser_service_1.hasFullscreen};exports.BrowserFullscreen=BrowserFullscreen;

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

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Remove items
*/
exports.removeArrayDuplicateLegacy = function (array) {
var unique = array.filter(function (item, index) {
return array.indexOf(item) === index;
});
return unique.sort();
};
/**
* Sort Arrays
*/
exports.sortByKey = function (array, key, asc) {
return new Promise(function (resolve) {
var _asc = asc ? 1 : -1;
var sorted = array.sort(function (a, b) {
var x = a[key];
var y = b[key];
return (x === y) ? 0 : ((x > y) ? _asc : -1 * _asc);
});
resolve(sorted);
});
};
//# sourceMappingURL=core-services-array.service.js.map
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.removeArrayDuplicateLegacy=function(array){var unique=array.filter(function(item,index){return array.indexOf(item)===index});return unique.sort()};exports.sortByKey=function(array,key,asc){return new Promise(function(resolve){var _asc=asc?1:-1;var sorted=array.sort(function(a,b){var x=a[key];var y=b[key];return x===y?0:x>y?_asc:-1*_asc});resolve(sorted)})};

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

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Convert
**/
exports.textFileToUrlImage = function (file) {
return new Promise(function (resolve) {
var fileReader = new FileReader();
fileReader.addEventListener('load', function (e) {
resolve(e.target.result);
});
fileReader.readAsDataURL(file);
});
};
/**
* Parser
**/
exports.parseAcceptFiles = function (accepts) {
return accepts
.replace(/image\//g, '')
.replace(/x-/g, '')
.replace(/\+xml/g, '')
.replace(/ /g, '')
.split(',');
};
/**
* Validate
**/
exports.validateFile = function (input, accepts) {
var fileName = input.value;
var idxDot = fileName.lastIndexOf('.') + 1;
var extFile = fileName.substr(idxDot, fileName.length).toLowerCase();
if (accepts.length === 1 && accepts[0] === '*') {
return true;
}
for (var _i = 0, accepts_1 = accepts; _i < accepts_1.length; _i++) {
var extension = accepts_1[_i];
if (extFile === extension) {
return true;
}
}
return false;
};
exports.validateFileSize = function (input) {
if (input != null && input.files != null) {
var fileSize = input.files[0].size / 1024;
var maxSize = fileMaxSize(input);
return fileSize <= maxSize;
}
else {
console.error('Input is null.');
return false;
}
};
/**
* The user must include the attribute 'data-maxsize' in mb(megabyte);
* @param input
*/
var fileMaxSize = function (input) {
var fileName = input.attributes['data-maxsize'].nodeValue;
if (fileName) {
return parseInt(fileName, 10);
}
else {
return 1024 * 45;
}
};
//# sourceMappingURL=core-services-attachment.service.js.map
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.textFileToUrlImage=function(file){return new Promise(function(resolve){var fileReader=new FileReader;fileReader.addEventListener("load",function(e){resolve(e.target.result)});fileReader.readAsDataURL(file)})};exports.parseAcceptFiles=function(accepts){return accepts.replace(/image\//g,"").replace(/x-/g,"").replace(/\+xml/g,"").replace(/ /g,"").split(",")};exports.validateFile=function(input,accepts){var fileName=input.value;var idxDot=fileName.lastIndexOf(".")+1;var extFile=fileName.substr(idxDot,fileName.length).toLowerCase();if(accepts.length===1&&accepts[0]==="*"){return true}for(var _i=0,accepts_1=accepts;_i<accepts_1.length;_i++){var extension=accepts_1[_i];if(extFile===extension){return true}}return false};exports.validateFileSize=function(input){if(input!=null&&input.files!=null){var fileSize=input.files[0].size/1024;var maxSize=fileMaxSize(input);return fileSize<=maxSize}else{console.error("Input is null.");return false}};var fileMaxSize=function(input){var fileName=input.attributes["data-maxsize"].nodeValue;if(fileName){return parseInt(fileName,10)}else{return 1024*45}};

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

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=core-services-browser.interfaces.js.map
"use strict";Object.defineProperty(exports,"__esModule",{value:true});

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

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var screenfull = require("screenfull");
/**
* Ffullscreen
*/
exports.fullscreenListener = function (menuButton, alt, src, showLog) {
if (showLog === void 0) { showLog = false; }
if (screenfull.isEnabled) {
// @ts-ignore
screenfull.on('change', function () {
// @ts-ignore
if (screenfull.isFullscreen) {
menuButton.src = src.exit;
menuButton.alt = alt.exit;
}
else {
menuButton.src = src.exit;
menuButton.alt = alt.exit;
}
if (showLog) {
// @ts-ignore
var label = screenfull.isFullscreen ? 'enabled' : 'disabled';
console.log("Fullscreen " + label);
}
});
}
else {
console.log('This browser does not support fullscreen api');
}
};
exports.disableFullscreenListener = function () {
// @ts-ignore
screenfull.off('change', function () {
console.log('Fullscreen listener has been disabled');
});
};
exports.toggleFullScreen = function (menuButton, alt, src, showLog) {
if (showLog === void 0) { showLog = false; }
return new Promise(function (resolve) {
if (screenfull.isEnabled) {
if (!screenfull.isFullscreen) {
screenfull.request().then(function () {
menuButton.src = src.exit;
menuButton.alt = alt.exit;
}).catch(function (error) {
console.log(error);
});
}
else {
screenfull.exit().then(function () {
menuButton.src = src.enter;
menuButton.alt = alt.enter;
}).catch(function (error) {
console.log(error);
});
}
if (showLog) {
// @ts-ignore
var label = screenfull.isFullscreen ? 'enabled' : 'disabled';
console.log("Fullscreen " + label);
}
resolve({ src: menuButton.src, alt: menuButton.alt });
}
else {
resolve({ src: null, alt: null });
}
});
};
exports.hasFullscreen = function () {
return screenfull.isEnabled;
};
/**
* Version
*/
exports.isIE = function () {
var ua = window.navigator.userAgent;
var msie = ua.indexOf('MSIE ');
return msie > 0 || !!navigator.userAgent.match(/Trident.*rv:11\./);
};
exports.isBeforeIE11 = function () {
return navigator.appVersion.indexOf('MSIE 10') !== -1;
};
//# sourceMappingURL=core-services-browser.service.js.map
"use strict";Object.defineProperty(exports,"__esModule",{value:true});var screenfull=require("screenfull");exports.fullscreenListener=function(menuButton,alt,src,showLog){if(showLog===void 0){showLog=false}if(screenfull.isEnabled){screenfull.on("change",function(){if(screenfull.isFullscreen){menuButton.src=src.exit;menuButton.alt=alt.exit}else{menuButton.src=src.enter;menuButton.alt=alt.enter}if(showLog){var label=screenfull.isFullscreen?"enabled":"disabled";console.log("Fullscreen "+label)}})}else{console.log("This browser does not support fullscreen api")}};exports.disableFullscreenListener=function(){screenfull.off("change",function(){console.log("Fullscreen listener has been disabled")})};exports.toggleFullScreen=function(menuButton,alt,src,showLog){if(showLog===void 0){showLog=false}return new Promise(function(resolve,reject){if(screenfull.isEnabled){if(screenfull.isFullscreen){screenfull.exit().then(function(){menuButton.src=src.enter;menuButton.alt=alt.enter}).catch(function(error){console.log(error);reject(error)})}else{screenfull.request().then(function(){menuButton.src=src.exit;menuButton.alt=alt.exit}).catch(function(error){console.log(error);reject(error)})}if(showLog){var label=screenfull.isFullscreen?"enabled":"disabled";console.log("Fullscreen "+label)}resolve({src:menuButton.src,alt:menuButton.alt})}else{resolve({src:null,alt:null})}})};exports.hasFullscreen=function(){return screenfull.isEnabled};exports.isIE=function(){var ua=window.navigator.userAgent;var msie=ua.indexOf("MSIE ");return msie>0||!!navigator.userAgent.match(/Trident.*rv:11\./)};exports.isBeforeIE11=function(){return navigator.appVersion.indexOf("MSIE 10")!==-1};

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

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=core-services-menu.interfaces.js.map
"use strict";Object.defineProperty(exports,"__esModule",{value:true});
{
"name": "gl-w-frontend",
"version": "1.1.17-alpha",
"version": "1.2.0",
"description": "Common code for using among web frameworks using pure JavaScript, ES6+ and TypeScript",

@@ -8,5 +8,6 @@ "main": "lib/",

"scripts": {
"clean": "shx rm -rf dist lib lib-esm",
"clean": "shx rm -rf dist lib",
"test": "echo \"Error: no test specified\" && exit 1",
"build": "npm run clean && tsc && tsc -m es6 --outDir lib-esm",
"build": "npm run clean && tsc && tsc -m es6 --outDir lib/esm",
"fast-build": "tsc",
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"",

@@ -13,0 +14,0 @@ "lint": "tslint -p tsconfig.json"

Sorry, the diff of this file is not supported yet

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