Socket
Socket
Sign inDemoInstall

@aplazame/browser

Package Overview
Dependencies
Maintainers
5
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aplazame/browser - npm Package Compare versions

Comparing version 0.1.7 to 0.1.8

7

dist/AplazameIFrame.d.ts

@@ -13,2 +13,5 @@ import { EventEmitter, DetailsEvent } from './EventEmitter.js';

iframe?: HTMLIFrameElement;
currentStyles: {
[key: string]: string;
};
constructor({ url, searchParams, requestTimeout, allowFilter, sendData }?: {

@@ -31,3 +34,7 @@ url?: string | null;

mount(el: HTMLElement): this;
setStyles(styles: string | {
[key: string]: string;
}): this;
resetStyles(): this;
unmount(): void;
}

@@ -18,2 +18,21 @@ "use strict";

exports.AplazameEvent = AplazameEvent;
const iframeStylesPresets = {
fullscreen: {
position: 'fixed',
top: '0',
left: '0',
width: '100%',
height: '100%',
border: 'none',
zIndex: '9999'
},
fill_absolute: {
position: 'absolute',
top: '0',
left: '0',
width: '100%',
height: '100%',
border: 'none',
},
};
class AplazameIFrame extends EventEmitter_js_1.EventEmitter {

@@ -25,2 +44,3 @@ constructor({ url = null, searchParams = null, requestTimeout = null, allowFilter = null, sendData = null } = {}) {

this.requestTimeout = 60000;
this.currentStyles = {};
if (!url)

@@ -75,2 +95,3 @@ throw new Error('url is required');

this.iframe.src = this.url.toString();
Object.assign(this.iframe.style, this.currentStyles);
el.appendChild(this.iframe);

@@ -83,2 +104,22 @@ // listening messages

}
setStyles(styles) {
var _a;
const newSytles = typeof styles === 'string'
? ((_a = iframeStylesPresets[styles]) !== null && _a !== void 0 ? _a : {})
: styles;
this.currentStyles = Object.assign(Object.assign({}, this.currentStyles), newSytles);
if (this.iframe) {
Object.assign(this.iframe.style, this.currentStyles);
}
return this;
}
resetStyles() {
var _a;
this.currentStyles = {};
const style = (_a = this.iframe) === null || _a === void 0 ? void 0 : _a.style;
if (style === null || style === void 0 ? void 0 : style.length) {
Array.from(style).forEach(key => style.removeProperty(key));
}
return this;
}
unmount() {

@@ -85,0 +126,0 @@ var _a;

2

package.json
{
"name": "@aplazame/browser",
"version": "0.1.7",
"version": "0.1.8",
"description": "Aplazame SDK for browser",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

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