@semcore/portal
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -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 |
'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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8417
9
106
5
+ Added@babel/runtime@^7.1.5
+ Added@semcore/utils@^2.0.1
+ Added@types/react@^16.7.6
+ Added@babel/runtime@7.26.0(transitive)
+ Added@jridgewell/sourcemap-codec@1.5.0(transitive)
+ Added@semcore/utils@2.6.0(transitive)
+ Added@types/prop-types@15.7.13(transitive)
+ Added@types/react@16.14.62(transitive)
+ Added@types/scheduler@0.16.8(transitive)
+ Addedclassnames@2.5.1(transitive)
+ Addedcss-in-js-utils@3.1.0(transitive)
+ Addedcss-tree@1.1.3(transitive)
+ Addedcsstype@3.1.3(transitive)
+ Addederror-stack-parser@2.1.4(transitive)
+ Addedfastest-stable-stringify@2.0.2(transitive)
+ Addedhoist-non-react-statics@3.3.2(transitive)
+ Addedhyphenate-style-name@1.1.0(transitive)
+ Addedinline-style-prefixer@7.0.1(transitive)
+ Addedmdn-data@2.0.14(transitive)
+ Addednano-css@5.6.2(transitive)
+ Addedregenerator-runtime@0.14.1(transitive)
+ Addedrtl-css-js@1.16.1(transitive)
+ Addedsource-map@0.5.60.6.1(transitive)
+ Addedstack-generator@2.0.10(transitive)
+ Addedstackframe@1.3.4(transitive)
+ Addedstacktrace-gps@3.1.2(transitive)
+ Addedstacktrace-js@2.0.2(transitive)
+ Addedstylis@4.3.4(transitive)