jsxstyle-utils
Advanced tools
Comparing version 2.2.0 to 2.2.1-canary.5
export declare function addStyleToHead(rule: string): void; | ||
//# sourceMappingURL=addStyleToHead.d.ts.map |
@@ -0,0 +0,0 @@ declare type CSSProperties = import('./types').CSSProperties; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ declare type InsertRuleCallback = ( |
@@ -0,0 +0,0 @@ export declare const pseudoelements: { |
export declare function hyphenateStyleName(styleName: string): string; | ||
//# sourceMappingURL=hyphenateStyleName.d.ts.map |
@@ -21,3 +21,3 @@ 'use strict'; | ||
} | ||
hot.addDisposeHandler(function(data) { | ||
hot.addDisposeHandler(function (data) { | ||
data.styleElement = styleElement; | ||
@@ -131,4 +131,4 @@ }); | ||
var prefixes = ['Webkit', 'ms', 'Moz', 'O']; | ||
Object.keys(isUnitlessNumber).forEach(function(prop) { | ||
prefixes.forEach(function(prefix) { | ||
Object.keys(isUnitlessNumber).forEach(function (prop) { | ||
prefixes.forEach(function (prefix) { | ||
isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop]; | ||
@@ -220,2 +220,26 @@ }); | ||
} | ||
var marginH = props.marginH; | ||
if (marginH != null) { | ||
props.marginLeft == null && (props.marginLeft = marginH); | ||
props.marginRight == null && (props.marginRight = marginH); | ||
delete props.marginH; | ||
} | ||
var marginV = props.marginV; | ||
if (marginV != null) { | ||
props.marginTop == null && (props.marginTop = marginV); | ||
props.marginBottom == null && (props.marginBottom = marginV); | ||
delete props.marginV; | ||
} | ||
var paddingH = props.paddingH; | ||
if (paddingH != null) { | ||
props.paddingLeft == null && (props.paddingLeft = paddingH); | ||
props.paddingRight == null && (props.paddingRight = paddingH); | ||
delete props.paddingH; | ||
} | ||
var paddingV = props.paddingV; | ||
if (paddingV != null) { | ||
props.paddingTop == null && (props.paddingTop = paddingV); | ||
props.paddingBottom == null && (props.paddingBottom = paddingV); | ||
delete props.paddingV; | ||
} | ||
var propKeys = Object.keys(props).sort(); | ||
@@ -373,6 +397,6 @@ var keyCount = propKeys.length; | ||
var styleCache = { | ||
reset: function() { | ||
reset: function () { | ||
_classNameCache = {}; | ||
}, | ||
injectOptions: function(options) { | ||
injectOptions: function (options) { | ||
if (options) { | ||
@@ -391,3 +415,3 @@ if (options.getClassName) { | ||
}, | ||
getClassName: function(props, classNameProp) { | ||
getClassName: function (props, classNameProp) { | ||
styleCache.injectOptions = cannotInject; | ||
@@ -404,3 +428,3 @@ var styleObj = getStyleKeysForProps(props, pretty); | ||
.sort() | ||
.forEach(function(k) { | ||
.forEach(function (k) { | ||
var selector = '.' + _classNameCache[key]; | ||
@@ -407,0 +431,0 @@ // prettier-ignore |
@@ -0,0 +0,0 @@ export { addStyleToHead } from './addStyleToHead'; |
@@ -17,3 +17,3 @@ var canUseDOM = !!( | ||
} | ||
hot.addDisposeHandler(function(data) { | ||
hot.addDisposeHandler(function (data) { | ||
data.styleElement = styleElement; | ||
@@ -127,4 +127,4 @@ }); | ||
var prefixes = ['Webkit', 'ms', 'Moz', 'O']; | ||
Object.keys(isUnitlessNumber).forEach(function(prop) { | ||
prefixes.forEach(function(prefix) { | ||
Object.keys(isUnitlessNumber).forEach(function (prop) { | ||
prefixes.forEach(function (prefix) { | ||
isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop]; | ||
@@ -216,2 +216,26 @@ }); | ||
} | ||
var marginH = props.marginH; | ||
if (marginH != null) { | ||
props.marginLeft == null && (props.marginLeft = marginH); | ||
props.marginRight == null && (props.marginRight = marginH); | ||
delete props.marginH; | ||
} | ||
var marginV = props.marginV; | ||
if (marginV != null) { | ||
props.marginTop == null && (props.marginTop = marginV); | ||
props.marginBottom == null && (props.marginBottom = marginV); | ||
delete props.marginV; | ||
} | ||
var paddingH = props.paddingH; | ||
if (paddingH != null) { | ||
props.paddingLeft == null && (props.paddingLeft = paddingH); | ||
props.paddingRight == null && (props.paddingRight = paddingH); | ||
delete props.paddingH; | ||
} | ||
var paddingV = props.paddingV; | ||
if (paddingV != null) { | ||
props.paddingTop == null && (props.paddingTop = paddingV); | ||
props.paddingBottom == null && (props.paddingBottom = paddingV); | ||
delete props.paddingV; | ||
} | ||
var propKeys = Object.keys(props).sort(); | ||
@@ -369,6 +393,6 @@ var keyCount = propKeys.length; | ||
var styleCache = { | ||
reset: function() { | ||
reset: function () { | ||
_classNameCache = {}; | ||
}, | ||
injectOptions: function(options) { | ||
injectOptions: function (options) { | ||
if (options) { | ||
@@ -387,3 +411,3 @@ if (options.getClassName) { | ||
}, | ||
getClassName: function(props, classNameProp) { | ||
getClassName: function (props, classNameProp) { | ||
styleCache.injectOptions = cannotInject; | ||
@@ -400,3 +424,3 @@ var styleObj = getStyleKeysForProps(props, pretty); | ||
.sort() | ||
.forEach(function(k) { | ||
.forEach(function (k) { | ||
var selector = '.' + _classNameCache[key]; | ||
@@ -403,0 +427,0 @@ // prettier-ignore |
@@ -1,2 +0,2 @@ | ||
define('jsxstyle-utils', ['exports'], function(exports) { | ||
define('jsxstyle-utils', ['exports'], function (exports) { | ||
'use strict'; | ||
@@ -20,3 +20,3 @@ | ||
} | ||
hot.addDisposeHandler(function(data) { | ||
hot.addDisposeHandler(function (data) { | ||
data.styleElement = styleElement; | ||
@@ -130,4 +130,4 @@ }); | ||
var prefixes = ['Webkit', 'ms', 'Moz', 'O']; | ||
Object.keys(isUnitlessNumber).forEach(function(prop) { | ||
prefixes.forEach(function(prefix) { | ||
Object.keys(isUnitlessNumber).forEach(function (prop) { | ||
prefixes.forEach(function (prefix) { | ||
isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop]; | ||
@@ -219,2 +219,26 @@ }); | ||
} | ||
var marginH = props.marginH; | ||
if (marginH != null) { | ||
props.marginLeft == null && (props.marginLeft = marginH); | ||
props.marginRight == null && (props.marginRight = marginH); | ||
delete props.marginH; | ||
} | ||
var marginV = props.marginV; | ||
if (marginV != null) { | ||
props.marginTop == null && (props.marginTop = marginV); | ||
props.marginBottom == null && (props.marginBottom = marginV); | ||
delete props.marginV; | ||
} | ||
var paddingH = props.paddingH; | ||
if (paddingH != null) { | ||
props.paddingLeft == null && (props.paddingLeft = paddingH); | ||
props.paddingRight == null && (props.paddingRight = paddingH); | ||
delete props.paddingH; | ||
} | ||
var paddingV = props.paddingV; | ||
if (paddingV != null) { | ||
props.paddingTop == null && (props.paddingTop = paddingV); | ||
props.paddingBottom == null && (props.paddingBottom = paddingV); | ||
delete props.paddingV; | ||
} | ||
var propKeys = Object.keys(props).sort(); | ||
@@ -376,6 +400,6 @@ var keyCount = propKeys.length; | ||
var styleCache = { | ||
reset: function() { | ||
reset: function () { | ||
_classNameCache = {}; | ||
}, | ||
injectOptions: function(options) { | ||
injectOptions: function (options) { | ||
if (options) { | ||
@@ -394,3 +418,3 @@ if (options.getClassName) { | ||
}, | ||
getClassName: function(props, classNameProp) { | ||
getClassName: function (props, classNameProp) { | ||
styleCache.injectOptions = cannotInject; | ||
@@ -407,3 +431,3 @@ var styleObj = getStyleKeysForProps(props, pretty); | ||
.sort() | ||
.forEach(function(k) { | ||
.forEach(function (k) { | ||
var selector = '.' + _classNameCache[key]; | ||
@@ -410,0 +434,0 @@ // prettier-ignore |
export declare function stringHash(str: string): number; | ||
//# sourceMappingURL=stringHash.d.ts.map |
@@ -5,3 +5,3 @@ import { Properties } from 'csstype'; | ||
* | ||
* Note: `Falsey` is not the best name, as jsxstyle considers zero values are considered valid. | ||
* Note: `Falsey` is not the best name, as jsxstyle considers zero to be truthy. | ||
*/ | ||
@@ -11,2 +11,28 @@ export declare type Falsey<T> = { | ||
}; | ||
declare type BaseCSSProperties = Properties<string | number>; | ||
interface CSSPropsInternal extends BaseCSSProperties { | ||
marginH?: BaseCSSProperties['margin']; | ||
marginV?: BaseCSSProperties['margin']; | ||
paddingH?: BaseCSSProperties['padding']; | ||
paddingV?: BaseCSSProperties['padding']; | ||
activeOpacity?: BaseCSSProperties['opacity']; | ||
disabledOpacity?: BaseCSSProperties['opacity']; | ||
focusOpacity?: BaseCSSProperties['opacity']; | ||
hoverOpacity?: BaseCSSProperties['opacity']; | ||
activeColor?: BaseCSSProperties['color']; | ||
hoverColor?: BaseCSSProperties['color']; | ||
activeBackgroundColor?: BaseCSSProperties['backgroundColor']; | ||
focusBackgroundColor?: BaseCSSProperties['backgroundColor']; | ||
hoverBackgroundColor?: BaseCSSProperties['backgroundColor']; | ||
hoverTextDecoration?: BaseCSSProperties['textDecoration']; | ||
hoverTextDecorationColor?: BaseCSSProperties['textDecorationColor']; | ||
activeBoxShadow?: BaseCSSProperties['boxShadow']; | ||
focusBoxShadow?: BaseCSSProperties['boxShadow']; | ||
hoverBoxShadow?: BaseCSSProperties['boxShadow']; | ||
placeholderColor?: BaseCSSProperties['color']; | ||
disabledPlaceholderColor?: BaseCSSProperties['color']; | ||
focusPlaceholderColor?: BaseCSSProperties['color']; | ||
selectionColor?: BaseCSSProperties['color']; | ||
selectionBackgroundColor?: BaseCSSProperties['backgroundColor']; | ||
} | ||
/** | ||
@@ -41,3 +67,4 @@ * jsxstyle-compatible CSS properties interface provided by `csstype`. | ||
*/ | ||
export interface CSSProperties extends Falsey<Properties<string | number>> {} | ||
export interface CSSProperties extends Falsey<CSSPropsInternal> {} | ||
export {}; | ||
//# sourceMappingURL=types.d.ts.map |
{ | ||
"name": "jsxstyle-utils", | ||
"version": "2.2.0", | ||
"version": "2.2.1-canary.5+87801b2", | ||
"description": "Utilities used by jsxstyle and tooling built for jsxstyle", | ||
@@ -17,3 +17,3 @@ "author": "Pete Hunt", | ||
}, | ||
"gitHead": "37147319e3de53f249eb9bfee62c2fbeb66e2d83" | ||
"gitHead": "87801b2e1a09d23171bff5a4cb6185a9c93a1326" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
58315
1541
2
1