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

@smartface/contx

Package Overview
Dependencies
Maintainers
7
Versions
121
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@smartface/contx - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

32

lib/styling/Stylable.js
(function (global, factory) {
if (typeof define === "function" && define.amd) {
define(["module", "exports", "../core/Actor", "@smartface/styler/lib/utils/merge"], factory);
define(["module", "exports", "../core/Actor", "@smartface/styler/lib/utils/merge", "@smartface/styler/lib/utils/findClassNames"], factory);
} else if (typeof exports !== "undefined") {
factory(module, exports, require("../core/Actor"), require("@smartface/styler/lib/utils/merge"));
factory(module, exports, require("../core/Actor"), require("@smartface/styler/lib/utils/merge"), require("@smartface/styler/lib/utils/findClassNames"));
} else {

@@ -10,6 +10,6 @@ var mod = {

};
factory(mod, mod.exports, global.Actor, global.merge);
factory(mod, mod.exports, global.Actor, global.merge, global.findClassNames);
global.Stylable = mod.exports;
}
})(this, function (module, exports, _Actor2, _merge) {
})(this, function (module, exports, _Actor2, _merge, _findClassNames) {
"use strict";

@@ -26,2 +26,4 @@

var _findClassNames2 = _interopRequireDefault(_findClassNames);
function _interopRequireDefault(obj) {

@@ -81,3 +83,3 @@ return obj && obj.__esModule ? obj : {

var initialClassNames = classNames && classNames.split(" ") || [];
var initialClassNames = (0, _findClassNames2.default)(classNames) || [];
userStyle = (0, _merge2.default)(userStyle);

@@ -225,2 +227,16 @@

_this.removeClassNames = function (classNames) {
var classNamesArr = Array.isArray(classNames) ? classNames : (0, _findClassNames2.default)(classNames).map(function (item) {
return item.join("");
});
_this.classNames = _this.classNames.filter(function (cname) {
return !classNamesArr.some(function (rname) {
return cname === rname;
});
});
classNamesArr.length || (_this.isDirty = true);
return _this.getClassName();
};
_this.resetClassNames = function () {

@@ -241,5 +257,7 @@ var classNames = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];

_this.pushClassNames = function (classNames) {
var classNamesArr = Array.isArray(classNames) ? classNames : [classNames];
var classNamesArr = Array.isArray(classNames) ? classNames : (0, _findClassNames2.default)(classNames).map(function (item) {
return item.join("");
});
if (classNamesArr.some(_this.hasClassName)) {
if (!classNamesArr.some(_this.hasClassName)) {
_this.classNames = [].concat(_this.classNames, classNamesArr);

@@ -246,0 +264,0 @@ _this.isDirty = true;

{
"name": "@smartface/contx",
"version": "1.0.5",
"version": "1.0.6",
"description": "Context Manager",

@@ -5,0 +5,0 @@ "scripts": {

@@ -200,21 +200,22 @@ [![License: MIT](https://img.shields.io/badge/License-MIT-orange.svg)](https://opensource.org/licenses/MIT)

- **Action::type = changeUserStyle** :
- **Action.type => changeUserStyle** :
Sets component userStyle.
- *Action::userStyle:object*
- **Action::type = updateUserStyle** :
- **Action.type => updateUserStyle** :
- *Action::userStyle:object*
Update component userStyle.
- **Action::type = removeChild** :
- **Action.type => removeChild** :
Removes target component and it's children from context.
- **Action::type = removeChildren** :
- **Action.type => removeChildren** :
Removes target component's children from context.
- **Action::type = pushClassNames** :
- **Action.type => pushClassNames** :
Pushes new className selectors to the target component in order to manipulate component properties.
- *Action::classNames:string*
- **Action::type = removeClassName** :
- *Action::classNames:string* for one classname
- *Action::classNames:Array* for multiple classnames
- **Action.type => removeClassName** :
Removes className selector from specified component.
- *Action::className:string*
- **Action::type = invalidate** :
- **Action.type => invalidate** :
Forces to update Context's actors and applies styles if they are changed.
- **Action::type = updateContext** :
- **Action.type => updateContext** :
Adds new components to Context or removes ones that doesn't exist in the updated FlexLayout::children.

@@ -221,0 +222,0 @@

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