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

gutenblock-controls

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gutenblock-controls - npm Package Compare versions

Comparing version 0.3.4 to 0.3.5

48

dist/repeat/index.js

@@ -54,37 +54,26 @@ 'use strict';

key: 'update',
value: function update(name, value, tabId, parentChange, customUpdate) {
value: function update(name, value, tabId, onChange) {
var _props = this.props,
attribute = _props.attribute,
attributes = _props.attributes,
setAttributes = _props.setAttributes;
attributes = _props.attributes;
//if nested repeats, pass state up to top most one
if (parentChange) {
var currentAttributes = attributes[attribute] || [];
var currentAttributes = attributes[attribute] || [];
var foundAttribute = currentAttributes.find(function (attr, index) {
return index === tabId;
});
var newAttributes = void 0;
if (!foundAttribute) newAttributes = [].concat(_toConsumableArray(currentAttributes), [_defineProperty({}, name, value)]);else newAttributes = currentAttributes.map(function (attr, index) {
return index === tabId ? Object.assign({}, attr, _defineProperty({}, name, value)) : attr;
});
var foundAttribute = currentAttributes.find(function (attr, index) {
return index === tabId;
});
var newAttributes = void 0;
if (!foundAttribute) newAttributes = [].concat(_toConsumableArray(currentAttributes), [_defineProperty({}, name, value)]);else newAttributes = currentAttributes.map(function (attr, index) {
return index === tabId ? Object.assign({}, attr, _defineProperty({}, name, value)) : attr;
});
return parentChange(attribute, newAttributes);
}
var topLevel = [].concat(_toConsumableArray(attributes[attribute]));
topLevel[tabId] = Object.assign({}, topLevel[tabId], _defineProperty({}, name, value));
setAttributes(_defineProperty({}, attribute, topLevel));
return onChange(attribute, newAttributes);
}
}, {
key: 'delete',
value: function _delete(childAttributes, childAttribute, tabId, onDelete, customDelete) {
value: function _delete(childAttributes, childAttribute, tabId, onChange) {
var _props2 = this.props,
attribute = _props2.attribute,
attributes = _props2.attributes,
setAttributes = _props2.setAttributes;
attributes = _props2.attributes;

@@ -104,5 +93,3 @@

if (onDelete) return onDelete(newAttributes, attribute);
setAttributes(_defineProperty({}, attribute, newAttributes));
return onChange(attribute, newAttributes);
}

@@ -119,4 +106,3 @@ }, {

attributes = _props3.attributes,
_onChange = _props3.onChange,
_onDelete = _props3.onDelete;
_onChange = _props3.onChange;

@@ -131,6 +117,6 @@

onChange: function onChange(name, value) {
return _this2.update(name, value, index, _onChange, child.onUpdate);
return _this2.update(name, value, index, _onChange);
},
onDelete: function onDelete(childAttributes, childAttribute) {
return _this2.delete(childAttributes, childAttribute, index, _onDelete, child.onDelete);
return _this2.delete(childAttributes, childAttribute, index, _onChange);
},

@@ -137,0 +123,0 @@ style: {

{
"name": "gutenblock-controls",
"version": "0.3.4",
"version": "0.3.5",
"description": "Useful inspector controls for gutenberg",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

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