New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-popups

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-popups - npm Package Compare versions

Comparing version 1.2.2 to 1.3.0

.babelrc

33

package.json
{
"name": "react-popups",
"version": "1.2.2",
"version": "1.3.0",
"description": "Reactjs component for spawning custom popups at mouse position.",
"author": "Reslav Hollos",
"author": "Reslav Hollos <reslav.hollos@gmail.com> (http://radivarig.github.io)",
"license": "MIT",
"main": "./exports.js",
"main": "./dist/main.js",
"scripts": {
"dev": "./node_modules/webpack-dev-server/bin/webpack-dev-server.js --config webpack.config.js --progress --colors"
"start": "webpack-dev-server --mode development --open",
"build": "webpack --mode production"
},

@@ -15,5 +16,2 @@ "repository": {

},
"devDependencies": {
"webpack-dev-server": "^1.9.0"
},
"keywords": [

@@ -28,10 +26,23 @@ "react",

],
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.4",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-preset-env": "^1.6.1",
"babel-preset-react": "^6.24.1",
"css-loader": "^0.28.10",
"html-loader": "^0.5.5",
"html-webpack-plugin": "^3.0.6",
"react-dom": "^16.2.0",
"style-loader": "^0.20.2",
"webpack": "^4.1.0",
"webpack-cli": "^2.0.10",
"webpack-dev-server": "^3.1.0"
},
"peerDependencies": {
"react": ">=0.14.1",
"react-dom": ">=0.14.1"
"react": "^16.2.0"
},
"dependencies": {
"jsx-loader": "^0.13.x",
"react-onclickoutside": "^4.0.1"
"react-onclickoutside": "^6.7.1"
}
}

@@ -9,6 +9,4 @@ # react-popups

`npm install react-popups` (peer dependencies: `react react-dom`)
`npm install --save react-popups`
for React **v0.13.3** `npm install react-popups@1.1.1`
### Demo

@@ -20,5 +18,5 @@

npm install
npm run dev
npm run build
npm run start
```
navigate to `localhost:8080`

@@ -25,0 +23,0 @@ ### Features

@@ -1,21 +0,22 @@

var React = require('react')
var OnClickOutside = require('react-onclickoutside')
import React from 'react'
import onClickOutside from 'react-onclickoutside'
var Popups = React.createClass({
mixins: [ OnClickOutside ]
, getInitialState: function () {
return { popups: [] }
}
, componentDidMount: function () {
class Popups extends React.Component {
state = { popups: [] }
componentDidMount = () => {
if (this.props.clickButtons) document.addEventListener('click', this.spawnLinkedDiv)
if (this.props.event) document.addEventListener(this.props.event, this.spawnLinkedDiv)
}
, componentWillUnmount: function () {
componentWillUnmount = () => {
if (this.props.clickButtons) document.removeEventListener('click', this.spawnLinkedDiv)
if (this.props.event) document.removeEventListener(this.props.event, this.spawnLinkedDiv)
}
, handleClickOutside: function(e) {
handleClickOutside = (e) => {
this.setState({ popups: [] })
}
, handleClickInside: function(e){
handleClickInside = (e) => {
var t = e.target

@@ -38,3 +39,4 @@ while (t) {

}
, spawnLinkedDiv: function (e) {
spawnLinkedDiv = (e) => {
this.handleClickInside(e)

@@ -78,9 +80,10 @@

)
this.setState({popups: popups})
this.setState({popups})
}
, render: function() {
render = () => {
return (<div>{this.state.popups}</div>)
}
})
}
module.exports = Popups
export default onClickOutside(Popups)

@@ -1,6 +0,6 @@

var React = require('react')
var Popups = require('./Popups.jsx')
import React from 'react'
import Popups from './Popups.jsx'
var Popup = React.createClass({
render: function() {
class Popup extends React.Component {
render = () => {
var popup_style = {

@@ -22,66 +22,53 @@ height: 'auto'

}
})
}
var PopupLink = React.createClass({
render: function(){
var link_style = {
cursor: 'pointer'
, color: '#00F'
}
return (
<span data={this.props.data} style={link_style}>
{this.props.children}
</span>
)
const PopupLink = (props) => {
var link_style = {
cursor: 'pointer'
, color: '#00F'
}
})
return (
<span data={props.data} style={link_style}>
{props.children}
</span>
)
}
var DefaultPopup = React.createClass({
render: function(){
return (
<div >
<div>info: {this.props.info}</div>
<div>other:</div>
<ul>
<li><PopupLink data='universe'>Universe</PopupLink></li>
<li><PopupLink data='planets'>planets</PopupLink></li>
<li><PopupLink data='stars'>stars</PopupLink></li>
<li><PopupLink data='galaxies'>galaxies</PopupLink></li>
<li><PopupLink data='intergalactic space'>intergalactic space</PopupLink></li>
<li><PopupLink data='dark matter'>dark matter</PopupLink></li>
<li><PopupLink data='dark energy'>dark energy</PopupLink></li>
</ul>
</div>
)
}
})
const DefaultPopup = (props) => {
return (
<div >
<div>info: {props.info}</div>
<div>other:</div>
<ul>
<li><PopupLink data='universe'>Universe</PopupLink></li>
<li><PopupLink data='planets'>planets</PopupLink></li>
<li><PopupLink data='stars'>stars</PopupLink></li>
<li><PopupLink data='galaxies'>galaxies</PopupLink></li>
<li><PopupLink data='intergalactic space'>intergalactic space</PopupLink></li>
<li><PopupLink data='dark matter'>dark matter</PopupLink></li>
<li><PopupLink data='dark energy'>dark energy</PopupLink></li>
</ul>
</div>
)
}
var Universe = React.createClass({
render: function() {
return (
<p>
The <PopupLink data={'universe'}>Universe</PopupLink> is all of time and space and its contents.
The Universe includes <PopupLink data={'planets'}>planets</PopupLink>
, <PopupLink data={'stars'}>stars</PopupLink>
, <PopupLink data={'galaxies'}>galaxies</PopupLink>
, the contents of <PopupLink data={'intergalactic space'}>intergalactic space</PopupLink>
, the smallest subatomic particles, and all matter and energy.
The majority of matter and energy is most likely in the form
of <PopupLink data={'dark matter'}>dark matter</PopupLink> and <PopupLink data={'dark energy'}>dark energy</PopupLink>.
</p>
)
}
})
const Universe = () => {
return (
<p>
The <PopupLink data={'universe'}>Universe</PopupLink> is all of time and space and its contents.
The Universe includes <PopupLink data={'planets'}>planets</PopupLink>
, <PopupLink data={'stars'}>stars</PopupLink>
, <PopupLink data={'galaxies'}>galaxies</PopupLink>
, the contents of <PopupLink data={'intergalactic space'}>intergalactic space</PopupLink>
, the smallest subatomic particles, and all matter and energy.
The majority of matter and energy is most likely in the form
of <PopupLink data={'dark matter'}>dark matter</PopupLink> and <PopupLink data={'dark energy'}>dark energy</PopupLink>.
</p>
)
}
var App = React.createClass({
render: function() {
return (
<div>
<Popups handler={Popup} clickButtons={[0]} />
<Universe/>
</div>
)
}
})
module.exports = App
export default () =>
<div>
<Popups handler={Popup} clickButtons={[0]} />
<Universe/>
</div>

@@ -0,13 +1,45 @@

const HtmlWebPackPlugin = require("html-webpack-plugin")
module.exports = {
entry: "./src/entry.jsx",
output: {
path: "./",
filename: "bundle.js"
},
devtool: "source-map",
module: {
loaders: [
{ test: /\.jsx?$/, loaders: ['jsx-loader'], exclude: /node_modules/ }
entry: {
main: __dirname + "/src/Popups.jsx",
viewer: __dirname + "/src/index.js",
},
output: {
filename: "[name].js",
path: __dirname + "/dist",
library: "react-popups",
libraryTarget: "umd",
},
devtool: "source-map",
module: {
rules: [
{
test: /\.jsx?$/,
exclude: [/node_modules/],
use: {
loader: "babel-loader",
}
},
{
test: /\.html$/,
use: [
{
loader: "html-loader",
options: { minimize: true },
}
]
}
},
],
},
plugins: [
new HtmlWebPackPlugin({
template: "./src/index.html",
filename: "./index.html",
})
],
}

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