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

@atlaskit/portal

Package Overview
Dependencies
Maintainers
1
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@atlaskit/portal - npm Package Compare versions

Comparing version 3.0.13 to 3.1.0

constants/package.json

8

CHANGELOG.md
# @atlaskit/portal
## 3.1.0
### Minor Changes
- [minor][bf8796cffa](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/bf8796cffa):
Add mount and unmount events to @atlaskit/portal
## 3.0.13

@@ -4,0 +12,0 @@

@@ -8,2 +8,4 @@ "use strict";

var exenv_1 = require("exenv");
var theme_1 = require("@atlaskit/theme");
var constants_1 = require("../constants");
var createContainer = function (zIndex) {

@@ -30,2 +32,20 @@ var container = document.createElement('div');

};
var zIndexToName = Object.keys(theme_1.layers).reduce(function (acc, name) {
var value = theme_1.layers[name]();
acc[value] = name;
return acc;
}, {});
var getLayerName = function (zIndex) {
return Object.prototype.hasOwnProperty.call(zIndexToName, zIndex)
? zIndexToName[zIndex]
: null;
};
var fireMountUnmountEvent = function (eventName, zIndex) {
var event = new Event(eventName);
event.detail = {
layer: getLayerName(Number(zIndex)),
zIndex: zIndex,
};
window.dispatchEvent(event);
};
// This is a generic component does two things:

@@ -75,5 +95,7 @@ // 1. Portals it's children using React.createPortal

});
fireMountUnmountEvent(constants_1.PORTAL_MOUNT_EVENT, Number(zIndex));
};
Portal.prototype.componentWillUnmount = function () {
var container = this.state.container;
var zIndex = this.props.zIndex;
if (container) {

@@ -87,2 +109,3 @@ portalParent().removeChild(container);

}
fireMountUnmountEvent(constants_1.PORTAL_UNMOUNT_EVENT, Number(zIndex));
};

@@ -89,0 +112,0 @@ Portal.prototype.render = function () {

3

dist/cjs/index.d.ts

@@ -1,1 +0,2 @@

export { default } from './components/Portal';
export { default, PortalEvent } from './components/Portal';
export * from './constants';
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var Portal_1 = require("./components/Portal");
exports.default = Portal_1.default;
tslib_1.__exportStar(require("./constants"), exports);
//# sourceMappingURL=index.js.map
{
"name": "@atlaskit/portal",
"version": "3.0.13",
"version": "3.1.0",
"sideEffects": false
}

@@ -6,2 +6,4 @@ import { __extends } from "tslib";

import { canUseDOM } from 'exenv';
import { layers } from '@atlaskit/theme';
import { PORTAL_MOUNT_EVENT, PORTAL_UNMOUNT_EVENT } from '../constants';
var createContainer = function (zIndex) {

@@ -28,2 +30,20 @@ var container = document.createElement('div');

};
var zIndexToName = Object.keys(layers).reduce(function (acc, name) {
var value = layers[name]();
acc[value] = name;
return acc;
}, {});
var getLayerName = function (zIndex) {
return Object.prototype.hasOwnProperty.call(zIndexToName, zIndex)
? zIndexToName[zIndex]
: null;
};
var fireMountUnmountEvent = function (eventName, zIndex) {
var event = new Event(eventName);
event.detail = {
layer: getLayerName(Number(zIndex)),
zIndex: zIndex,
};
window.dispatchEvent(event);
};
// This is a generic component does two things:

@@ -73,5 +93,7 @@ // 1. Portals it's children using React.createPortal

});
fireMountUnmountEvent(PORTAL_MOUNT_EVENT, Number(zIndex));
};
Portal.prototype.componentWillUnmount = function () {
var container = this.state.container;
var zIndex = this.props.zIndex;
if (container) {

@@ -85,2 +107,3 @@ portalParent().removeChild(container);

}
fireMountUnmountEvent(PORTAL_UNMOUNT_EVENT, Number(zIndex));
};

@@ -87,0 +110,0 @@ Portal.prototype.render = function () {

@@ -1,1 +0,2 @@

export { default } from './components/Portal';
export { default, PortalEvent } from './components/Portal';
export * from './constants';
export { default } from './components/Portal';
export * from './constants';
//# sourceMappingURL=index.js.map
{
"name": "@atlaskit/portal",
"version": "3.0.13",
"version": "3.1.0",
"sideEffects": false
}
{
"name": "@atlaskit/portal",
"version": "3.0.13",
"version": "3.1.0",
"description": "Atlaskit wrapper for rendering components in React portals",

@@ -24,2 +24,3 @@ "repository": "https://bitbucket.org/atlassian/atlaskit-mk-2",

"dependencies": {
"@atlaskit/theme": "^9.2.2",
"@babel/runtime": "^7.0.0",

@@ -26,0 +27,0 @@ "exenv": "^1.2.2",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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