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

@rmwc/base

Package Overview
Dependencies
Maintainers
1
Versions
170
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rmwc/base - npm Package Compare versions

Comparing version 4.0.6 to 5.0.0-alpha.0

base.story.js

17

package.json
{
"name": "@rmwc/base",
"version": "4.0.6",
"version": "5.0.0-alpha.0",
"description": "RMWC base module",
"main": "index.js",
"main": "dist/index.js",
"types": "dist/index.js",
"module": "next/index.js",
"publishConfig": {
"access": "public"
},
"scripts": {

@@ -29,7 +34,9 @@ "publish:dist": "npm publish dist --access=public",

"dependencies": {
"@rmwc/types": "^5.0.0-alpha.0",
"classnames": "^2.2.5",
"focus-trap": "^2.3.0",
"hyperform": "^0.9.9",
"mutation-observer": "^1.0.3",
"prop-types": "^15.6.1"
}
"mutation-observer": "^1.0.3"
},
"gitHead": "df9f0ba2ce5984834077b6d7c28b7d2608b1238c"
}

@@ -1,10 +0,4 @@

'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = function () {
export default () => {
if (global['window']) {
var hyperform = require('hyperform');
const hyperform = require('hyperform');
hyperform(window);

@@ -18,17 +12,18 @@

if (!window['HTMLCanvasElement']) {
Object.defineProperty(window['HTMLCanvasElement'].prototype, 'getContext', {
writable: true,
value: function value() {
return {
Object.defineProperty(
window['HTMLCanvasElement'].prototype,
'getContext',
{
writable: true,
value: () => ({
font: '',
measureText: function measureText() {
return { width: 0 };
}
};
measureText: () => ({ width: 0 })
})
}
});
);
}
window['MutationObserver'] = window['MutationObserver'] || require('mutation-observer');
window['MutationObserver'] =
window['MutationObserver'] || require('mutation-observer');
}
};

@@ -1,57 +0,25 @@

'use strict';
import * as React from 'react';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.storyWithState = undefined;
export const storyWithState = (getState, Component) =>
class extends React.Component {
constructor(props) {
super(props);
this.state = getState({});
}
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
componentWillUpdate(nextProps, nextState) {
const knobState = getState(nextState);
const stateToUpdate = Object.keys(knobState).reduce((acc, key) => {
if (nextState[key] !== knobState[key]) {
acc[key] = knobState[key];
}
return acc;
}, {});
var _react = require('react');
Object.keys(stateToUpdate).length && this.setState(stateToUpdate);
}
var React = _interopRequireWildcard(_react);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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; }
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 storyWithState = exports.storyWithState = function storyWithState(getState, Component) {
return function (_React$Component) {
_inherits(_class, _React$Component);
function _class(props) {
_classCallCheck(this, _class);
var _this = _possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).call(this, props));
_this.state = getState({});
return _this;
render() {
return Component.call(this);
}
_createClass(_class, [{
key: 'componentWillUpdate',
value: function componentWillUpdate(nextProps, nextState) {
var knobState = getState(nextState);
var stateToUpdate = Object.keys(knobState).reduce(function (acc, key) {
if (nextState[key] !== knobState[key]) {
acc[key] = knobState[key];
}
return acc;
}, {});
Object.keys(stateToUpdate).length && this.setState(stateToUpdate);
}
}, {
key: 'render',
value: function render() {
return Component.call(this);
}
}]);
return _class;
}(React.Component);
};
};
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