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

@hixme/modal

Package Overview
Dependencies
Maintainers
3
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hixme/modal - npm Package Compare versions

Comparing version 2.3.0 to 2.4.0

lib/MrModalContainer.js

10

lib/index.js

@@ -6,3 +6,3 @@ 'use strict';

});
exports.MrModalManager = exports.setView = exports.setData = exports.removeFromViewList = exports.hasActiveModal = exports.getViewList = exports.getModalData = exports.getModal = exports.getCurrentView = exports.clearModal = exports.addToViewList = exports.NAME = exports.MrModal = undefined;
exports.MrModalManager = exports.setModal = exports.setView = exports.setData = exports.removeFromViewList = exports.hasActiveModal = exports.getViewList = exports.getModalData = exports.getModal = exports.getCurrentView = exports.clearModal = exports.addToViewList = exports.NAME = exports.MrModal = undefined;

@@ -77,4 +77,10 @@ var _modules = require('./modules');

});
Object.defineProperty(exports, 'setModal', {
enumerable: true,
get: function get() {
return _modules.setModal;
}
});
var _MrModalContainer = require('./components/MrModalContainer');
var _MrModalContainer = require('./MrModalContainer');

@@ -81,0 +87,0 @@ var _MrModalContainer2 = _interopRequireDefault(_MrModalContainer);

51

lib/modules/index.js

@@ -6,3 +6,3 @@ 'use strict';

});
exports.getModalData = exports.hasActiveModal = exports.getViewList = exports.getCurrentView = exports.getModal = exports.removeFromViewList = exports.addToViewList = exports.setData = exports.clearModal = exports.setView = exports.NAME = undefined;
exports.getModalData = exports.hasActiveModal = exports.getViewList = exports.getCurrentView = exports.getModal = exports.removeFromViewList = exports.addToViewList = exports.setView = exports.setModal = exports.setData = exports.clearModal = exports.NAME = undefined;

@@ -26,17 +26,8 @@ var _createReducer;

var SET_VIEW = 'SET_VIEW';
var SET_MODAL = 'SET_MODAL';
var ADD_TO_VIEW_LIST = 'ADD_TO_VIEW_LIST';
var REMOVE_FROM_VIEW_LIST = 'REMOVE_FROM_VIEW_LIST';
(0, _reduxUtils.namespaceActions)(NAME)([CLEAR_MODAL, SET_DATA, SET_VIEW, ADD_TO_VIEW_LIST, REMOVE_FROM_VIEW_LIST]);
(0, _reduxUtils.namespaceActions)(NAME)([CLEAR_MODAL, SET_DATA, SET_MODAL, SET_VIEW, ADD_TO_VIEW_LIST, REMOVE_FROM_VIEW_LIST]);
var setView = exports.setView = function setView(view) {
return function (dispatch) {
document.body.style.overflow = 'hidden';
return dispatch({
type: SET_VIEW,
payload: view
});
};
};
var clearModal = exports.clearModal = function clearModal() {

@@ -58,2 +49,24 @@ return function (dispatch) {

var setModal = exports.setModal = function setModal(view) {
var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
return function (dispatch) {
document.body.style.overflow = 'hidden';
return dispatch({
type: SET_MODAL,
payload: {
view: view,
data: data
}
});
};
};
var setView = exports.setView = function setView(view) {
var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
return function (dispatch) {
console.warn('setView is deprecated, please use setModal action instead');
return dispatch(setModal(view, data));
};
};
var addToViewList = exports.addToViewList = function addToViewList(payload) {

@@ -111,6 +124,16 @@ return {

exports.default = (0, _reduxUtils.createReducer)(initialState, (_createReducer = {}, _defineProperty(_createReducer, SET_VIEW, function (state, payload) {
exports.default = (0, _reduxUtils.createReducer)(initialState, (_createReducer = {}, _defineProperty(_createReducer, SET_MODAL, function (state, _ref) {
var view = _ref.view,
data = _ref.data;
return Object.assign({}, state, {
view: payload
view: view,
data: data
});
}), _defineProperty(_createReducer, SET_VIEW, function (state, _ref2) {
var view = _ref2.view,
data = _ref2.data;
return Object.assign({}, state, {
view: view,
data: data
});
}), _defineProperty(_createReducer, SET_DATA, function (state, payload) {

@@ -117,0 +140,0 @@ return Object.assign({}, state, {

{
"name": "@hixme/modal",
"version": "2.3.0",
"version": "2.4.0",
"description": "Hixme Modal",

@@ -52,2 +52,3 @@ "main": "lib/index.js",

"@hixme-ui/container": "^1.8.0",
"@hixme-ui/modal": "^1.16.2",
"@hixme-ui/title": "^1.8.0",

@@ -54,0 +55,0 @@ "@hixme/redux-utils": "^2.1.8",

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

import MrModalContainer from './components/MrModalContainer'
import MrModalContainer from './MrModalContainer'
import MrModalReducer from './modules'

@@ -17,2 +17,3 @@

setView,
setModal,
} from './modules'

@@ -19,0 +20,0 @@ export MrModalManager from './MrModalManager'

@@ -11,2 +11,3 @@ import { createReducer, namespaceActions } from '@hixme/redux-utils'

const SET_VIEW = 'SET_VIEW'
const SET_MODAL = 'SET_MODAL'
const ADD_TO_VIEW_LIST = 'ADD_TO_VIEW_LIST'

@@ -18,2 +19,3 @@ const REMOVE_FROM_VIEW_LIST = 'REMOVE_FROM_VIEW_LIST'

SET_DATA,
SET_MODAL,
SET_VIEW,

@@ -24,10 +26,2 @@ ADD_TO_VIEW_LIST,

export const setView = view => (dispatch) => {
document.body.style.overflow = 'hidden'
return dispatch({
type: SET_VIEW,
payload: view,
})
}
export const clearModal = () => (dispatch) => {

@@ -45,2 +39,18 @@ document.body.style.overflow = 'unset'

export const setModal = (view, data = {}) => (dispatch) => {
document.body.style.overflow = 'hidden'
return dispatch({
type: SET_MODAL,
payload: {
view,
data,
},
})
}
export const setView = (view, data = {}) => (dispatch) => {
console.warn('setView is deprecated, please use setModal action instead')
return dispatch(setModal(view, data))
}
export const addToViewList = payload => ({

@@ -90,5 +100,10 @@ type: ADD_TO_VIEW_LIST,

export default createReducer(initialState, {
[SET_VIEW]: (state, payload) => Object.assign({}, state, {
view: payload,
[SET_MODAL]: (state, { view, data }) => Object.assign({}, state, {
view,
data,
}),
[SET_VIEW]: (state, { view, data }) => Object.assign({}, state, {
view,
data,
}),
[SET_DATA]: (state, payload) => Object.assign({}, state, {

@@ -95,0 +110,0 @@ data: payload,

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