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

@react-wm/core

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-wm/core - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

128

es/index.js

@@ -1,33 +0,117 @@

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
export var createGlobaleactWM = function createGlobaleactWM() {
if (!window.ReactWM) {
window.ReactWM = {
constants: {},
portals: {}
};
}
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
return window.ReactWM;
};
import React, { Component } from 'react';
export var ReactWM = createGlobaleactWM();
var _default = function (_Component) {
_inherits(_default, _Component);
export var findHighestZIndex = function findHighestZIndex() {
var selector = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '*';
function _default() {
_classCallCheck(this, _default);
var nodes = document.querySelectorAll(selector);
var highest = 0;
return _possibleConstructorReturn(this, _Component.apply(this, arguments));
for (var i = 0; i < nodes.length; i++) {
var zindex = document.defaultView.getComputedStyle(nodes[i], null).getPropertyValue('z-index');
if (zindex !== 'auto' && +zindex > highest) {
highest = +zindex;
}
}
_default.prototype.render = function render() {
return React.createElement(
'div',
null,
React.createElement(
'h2',
null,
'Welcome to React components'
)
);
return highest;
};
export var syntaxHighlight = function syntaxHighlight(json) {
if (typeof json !== 'string') {
json = JSON.stringify(json, undefined, 2);
}
json = json.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
return json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+-]?\d+)?|,\n)/g, function (match) {
var cls = 'number';
if (/^"/.test(match)) {
if (/:$/.test(match)) {
cls = 'key';
match = match.slice(1, -2) + ':';
} else {
cls = 'string';
}
} else if (/true|false/.test(match)) {
cls = 'boolean';
} else if (/null/.test(match)) {
cls = 'null';
} else if (/\d+(\.\d+)?/.test(match)) {
cls = 'number';
} else if (/,\n/.test(match)) {
cls = 'comma';
}
return '<span class="' + cls + '">' + match + '</span>';
});
};
var _clamp = function _clamp(_ref) {
var value = _ref.value,
min = _ref.min,
max = _ref.max;
if (min !== undefined && value <= min) return min;
if (max !== undefined && value >= max) return max;
return value;
};
export var clamp = function clamp(value) {
var min = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : -Infinity;
var max = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Infinity;
if (value === undefined) return parseFloat(min);
if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object') {
return _clamp(value);
} else {
return _clamp({ value: value, min: min, max: max });
}
};
export var align = function align(value, snap) {
if (snap <= 0) return Math.round(value);
return Math.round(value - value % snap);
};
export var clearEvent = function clearEvent(e) {
e.stopPropagation();
e.preventDefault();
};
export var getScreenSize = function getScreenSize() {
return {
width: window.innerWidth,
height: window.innerHeight
};
};
return _default;
}(Component);
export var constants = {};
ReactWM.constants = constants;
export { _default as default };
export function nextConst() {
var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
var namespace = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
if (!constants.hasOwnProperty(namespace)) constants[namespace] = {};
var n = Object.keys(constants[namespace]).length;
if (n === 53) throw new Error('Maximum id excided in namespace: ' + namespace);
return constants[namespace][name] = Math.pow(2, n);
}
'use strict';
exports.__esModule = true;
exports.default = undefined;
var _react = require('react');
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _react2 = _interopRequireDefault(_react);
exports.nextConst = nextConst;
var createGlobaleactWM = exports.createGlobaleactWM = function createGlobaleactWM() {
if (!window.ReactWM) {
window.ReactWM = {
constants: {},
portals: {}
};
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
return window.ReactWM;
};
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var ReactWM = exports.ReactWM = createGlobaleactWM();
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
var findHighestZIndex = exports.findHighestZIndex = function findHighestZIndex() {
var selector = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '*';
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var nodes = document.querySelectorAll(selector);
var highest = 0;
var _default = function (_Component) {
_inherits(_default, _Component);
for (var i = 0; i < nodes.length; i++) {
var zindex = document.defaultView.getComputedStyle(nodes[i], null).getPropertyValue('z-index');
if (zindex !== 'auto' && +zindex > highest) {
highest = +zindex;
}
}
function _default() {
_classCallCheck(this, _default);
return highest;
};
return _possibleConstructorReturn(this, _Component.apply(this, arguments));
var syntaxHighlight = exports.syntaxHighlight = function syntaxHighlight(json) {
if (typeof json !== 'string') {
json = JSON.stringify(json, undefined, 2);
}
_default.prototype.render = function render() {
return _react2.default.createElement(
'div',
null,
_react2.default.createElement(
'h2',
null,
'Welcome to React components'
)
);
json = json.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
return json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+-]?\d+)?|,\n)/g, function (match) {
var cls = 'number';
if (/^"/.test(match)) {
if (/:$/.test(match)) {
cls = 'key';
match = match.slice(1, -2) + ':';
} else {
cls = 'string';
}
} else if (/true|false/.test(match)) {
cls = 'boolean';
} else if (/null/.test(match)) {
cls = 'null';
} else if (/\d+(\.\d+)?/.test(match)) {
cls = 'number';
} else if (/,\n/.test(match)) {
cls = 'comma';
}
return '<span class="' + cls + '">' + match + '</span>';
});
};
var _clamp = function _clamp(_ref) {
var value = _ref.value,
min = _ref.min,
max = _ref.max;
if (min !== undefined && value <= min) return min;
if (max !== undefined && value >= max) return max;
return value;
};
var clamp = exports.clamp = function clamp(value) {
var min = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : -Infinity;
var max = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Infinity;
if (value === undefined) return parseFloat(min);
if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object') {
return _clamp(value);
} else {
return _clamp({ value: value, min: min, max: max });
}
};
var align = exports.align = function align(value, snap) {
if (snap <= 0) return Math.round(value);
return Math.round(value - value % snap);
};
var clearEvent = exports.clearEvent = function clearEvent(e) {
e.stopPropagation();
e.preventDefault();
};
var getScreenSize = exports.getScreenSize = function getScreenSize() {
return {
width: window.innerWidth,
height: window.innerHeight
};
};
return _default;
}(_react.Component);
var constants = exports.constants = {};
ReactWM.constants = constants;
exports.default = _default;
module.exports = exports['default'];
function nextConst() {
var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
var namespace = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
if (!constants.hasOwnProperty(namespace)) constants[namespace] = {};
var n = Object.keys(constants[namespace]).length;
if (n === 53) throw new Error('Maximum id excided in namespace: ' + namespace);
return constants[namespace][name] = Math.pow(2, n);
}

6

package.json
{
"name": "@react-wm/core",
"version": "1.0.0",
"version": "1.0.1",
"description": "react-wm core",

@@ -32,5 +32,3 @@ "main": "lib/index.js",

"flow-bin": "^0.83.0",
"nwb": "0.23.x",
"react": "^16.5.2",
"react-dom": "^16.5.2"
"nwb": "0.23.x"
},

@@ -37,0 +35,0 @@ "author": "",

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