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

@semcore/portal

Package Overview
Dependencies
Maintainers
1
Versions
224
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@semcore/portal - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

lib/index.d.ts

12

CHANGELOG.md

@@ -5,4 +5,16 @@ # Changelog

## [1.1.0] - 2018-02-01
### Added
- Добавлен autocomplete для IDE
### Changed
- Функция `canUseDom` перенесена в пакет `@semcore/utils`
## [1.0.0] - 2018-06-28
### Added
- Initial release

65

lib/index.js
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PortalProvider = exports.default = undefined;
Object.defineProperty(exports, '__esModule', { value: true });
var _Portal = require('./Portal');
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
Object.defineProperty(exports, 'PortalProvider', {
enumerable: true,
get: function get() {
return _Portal.PortalProvider;
var _classCallCheck = _interopDefault(require('@babel/runtime/helpers/classCallCheck'));
var _createClass = _interopDefault(require('@babel/runtime/helpers/createClass'));
var _possibleConstructorReturn = _interopDefault(require('@babel/runtime/helpers/possibleConstructorReturn'));
var _getPrototypeOf = _interopDefault(require('@babel/runtime/helpers/getPrototypeOf'));
var _inherits = _interopDefault(require('@babel/runtime/helpers/inherits'));
var React = require('react');
var React__default = _interopDefault(React);
var reactDom = require('react-dom');
var canUseDOM = _interopDefault(require('@semcore/utils/lib/canUseDOM'));
var _React$createContext = React__default.createContext(canUseDOM() ? document.body : null),
Provider = _React$createContext.Provider,
Consumer = _React$createContext.Consumer;
var Portal =
/*#__PURE__*/
function (_PureComponent) {
_inherits(Portal, _PureComponent);
function Portal() {
_classCallCheck(this, Portal);
return _possibleConstructorReturn(this, _getPrototypeOf(Portal).apply(this, arguments));
}
});
var _Portal2 = _interopRequireDefault(_Portal);
_createClass(Portal, [{
key: "render",
value: function render() {
var _this$props = this.props,
children = _this$props.children,
disablePortal = _this$props.disablePortal;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
if (disablePortal) {
return children;
}
exports.default = _Portal2.default;
//# sourceMappingURL=index.js.map
return React__default.createElement(Consumer, null, function (contextNode) {
return contextNode ? reactDom.createPortal(children, contextNode) : null;
});
}
}]);
return Portal;
}(React.PureComponent);
Portal.displayName = 'Portal';
Portal.defaultProps = {
disablePortal: !canUseDOM()
};
exports.default = Portal;
exports.PortalProvider = Provider;
//# sourceMappingURL=index.js.map
{
"name": "@semcore/portal",
"description": "SEMRush Portal Component",
"version": "1.0.0",
"version": "1.1.0",
"main": "lib/index.js",
"module": "lib/index.es.js",
"typings": "lib/index.d.ts",
"author": "Roman Lysov <r.lysov@semrush.com>",
"license": "MIT",
"scripts": {
"build": "babel src/ --out-dir lib/ --source-maps",
"build": "rollup --config=node:rollup-config-ts",
"test": "jest"
},
"dependencies": {},
"dependencies": {
"@types/react": "^16.7.6",
"@babel/runtime": "^7.1.5",
"@semcore/utils": "^2.0.1"
},
"peerDependencies": {

@@ -18,16 +24,11 @@ "react": "^16.0.0",

"devDependencies": {
"jest": "*",
"jest-preset-ui": "*",
"rollup-config-react": "*",
"react": "^16.4.0",
"react-dom": "^16.4.0",
"babel-preset-ui": "*",
"jest-preset-ui": "*",
"jest": "*"
"react-dom": "^16.4.0"
},
"jest": {
"preset": "jest-preset-ui"
},
"babel": {
"presets": [
"babel-preset-ui"
]
}
}

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