@stylexjs/shared
Advanced tools
Comparing version 0.2.0-beta.19 to 0.2.0-beta.20
@@ -28,2 +28,3 @@ /** | ||
import * as m from './messages'; | ||
export * as types from './types'; | ||
import type { | ||
@@ -30,0 +31,0 @@ InjectableStyle as _InjectableStyle, |
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.utils = exports.overrideVars = exports.messages = exports.keyframes = exports.include = exports.firstThatWorks = exports.createVars = exports.create = exports.IncludedStyles = void 0; | ||
exports.utils = exports.types = exports.overrideVars = exports.messages = exports.keyframes = exports.include = exports.firstThatWorks = exports.createVars = exports.create = exports.IncludedStyles = void 0; | ||
var _stylexCreate = _interopRequireDefault(require("./stylex-create")); | ||
@@ -17,2 +17,4 @@ var _stylexCreateVars = _interopRequireDefault(require("./stylex-create-vars")); | ||
var m = _interopRequireWildcard(require("./messages")); | ||
var _types = _interopRequireWildcard(require("./types")); | ||
exports.types = _types; | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
@@ -19,0 +21,0 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } |
@@ -212,2 +212,8 @@ /** | ||
borderStart: any; | ||
blockSize: (val: TStyleValue) => TReturn; | ||
inlineSize: (val: TStyleValue) => TReturn; | ||
minBlockSize: (val: TStyleValue) => TReturn; | ||
minInlineSize: (val: TStyleValue) => TReturn; | ||
maxBlockSize: (val: TStyleValue) => TReturn; | ||
maxInlineSize: (val: TStyleValue) => TReturn; | ||
borderHorizontalWidth: any; | ||
@@ -253,3 +259,3 @@ borderHorizontalStyle: any; | ||
declare const $$EXPORT_DEFAULT_DECLARATION$$: Readonly</** | ||
* > 205 | ...typeof shorthands, | ||
* > 211 | ...typeof shorthands, | ||
* | ^^^^^^^^^^^^^^^^^^^^ Unsupported feature: Translating "object types with complex spreads" is currently not supported. | ||
@@ -256,0 +262,0 @@ **/ |
@@ -176,2 +176,8 @@ "use strict"; | ||
borderStart: shorthands.borderInlineStart, | ||
blockSize: val => [["height", val]], | ||
inlineSize: val => [["width", val]], | ||
minBlockSize: val => [["minHeight", val]], | ||
minInlineSize: val => [["minWidth", val]], | ||
maxBlockSize: val => [["maxHeight", val]], | ||
maxInlineSize: val => [["maxWidth", val]], | ||
borderHorizontalWidth: shorthands.borderInlineWidth, | ||
@@ -178,0 +184,0 @@ borderHorizontalStyle: shorthands.borderInlineStyle, |
@@ -106,3 +106,3 @@ /** | ||
type TReturn = ReadonlyArray<[string, TStyleValue]>; | ||
declare const expansions: { | ||
declare const shorthands: { | ||
border: (rawValue: TStyleValue) => TReturn; | ||
@@ -114,3 +114,12 @@ borderColor: (rawValue: TStyleValue) => TReturn; | ||
borderWidth: (rawValue: TStyleValue) => TReturn; | ||
borderHorizontalColor: (rawValue: TStyleValue) => TReturn; | ||
borderHorizontalStyle: (rawValue: TStyleValue) => TReturn; | ||
borderHorizontalWidth: (rawValue: TStyleValue) => TReturn; | ||
borderVerticalColor: (rawValue: TStyleValue) => TReturn; | ||
borderVerticalStyle: (rawValue: TStyleValue) => TReturn; | ||
borderVerticalWidth: (rawValue: TStyleValue) => TReturn; | ||
borderRadius: (rawValue: TStyleValue) => TReturn; | ||
inset: (rawValue: TStyleValue) => TReturn; | ||
insetInline: (rawValue: TStyleValue) => TReturn; | ||
insetBlock: (rawValue: TStyleValue) => TReturn; | ||
margin: (rawValue: TStyleValue) => TReturn; | ||
@@ -121,6 +130,54 @@ marginHorizontal: (rawValue: TStyleValue) => TReturn; | ||
padding: (rawValue: TStyleValue) => TReturn; | ||
paddingHorizontal: (rawValue: TStyleValue) => TReturn; | ||
paddingVertical: (rawValue: TStyleValue) => TReturn; | ||
paddingHorizontal: (val: TStyleValue) => TReturn; | ||
paddingVertical: (val: TStyleValue) => TReturn; | ||
}; | ||
declare const aliases: { | ||
insetBlockStart: (val: TStyleValue) => TReturn; | ||
insetBlockEnd: (val: TStyleValue) => TReturn; | ||
insetInlineStart: (val: TStyleValue) => TReturn; | ||
insetInlineEnd: (val: TStyleValue) => TReturn; | ||
blockSize: (val: TStyleValue) => TReturn; | ||
inlineSize: (val: TStyleValue) => TReturn; | ||
minBlockSize: (val: TStyleValue) => TReturn; | ||
minInlineSize: (val: TStyleValue) => TReturn; | ||
maxBlockSize: (val: TStyleValue) => TReturn; | ||
maxInlineSize: (val: TStyleValue) => TReturn; | ||
borderBlockWidth: any; | ||
borderBlockStyle: any; | ||
borderBlockColor: any; | ||
borderBlockStartWidth: (val: TStyleValue) => TReturn; | ||
borderBlockStartStyle: (val: TStyleValue) => TReturn; | ||
borderBlockStartColor: (val: TStyleValue) => TReturn; | ||
borderBlockEndWidth: (val: TStyleValue) => TReturn; | ||
borderBlockEndStyle: (val: TStyleValue) => TReturn; | ||
borderBlockEndColor: (val: TStyleValue) => TReturn; | ||
borderInlineWidth: any; | ||
borderInlineStyle: any; | ||
borderInlineColor: any; | ||
borderInlineStartWidth: (val: TStyleValue) => TReturn; | ||
borderInlineStartStyle: (val: TStyleValue) => TReturn; | ||
borderInlineStartColor: (val: TStyleValue) => TReturn; | ||
borderInlineEndWidth: (val: TStyleValue) => TReturn; | ||
borderInlineEndStyle: (val: TStyleValue) => TReturn; | ||
borderInlineEndColor: (val: TStyleValue) => TReturn; | ||
borderStartStartRadius: (val: TStyleValue) => TReturn; | ||
borderStartEndRadius: (val: TStyleValue) => TReturn; | ||
borderEndStartRadius: (val: TStyleValue) => TReturn; | ||
borderEndEndRadius: (val: TStyleValue) => TReturn; | ||
marginBlock: any; | ||
marginBlockStart: (val: TStyleValue) => TReturn; | ||
marginBlockEnd: (val: TStyleValue) => TReturn; | ||
marginInline: any; | ||
marginInlineStart: (val: TStyleValue) => TReturn; | ||
marginInlineEnd: (val: TStyleValue) => TReturn; | ||
paddingBlock: any; | ||
paddingBlockStart: (val: TStyleValue) => TReturn; | ||
paddingBlockEnd: (val: TStyleValue) => TReturn; | ||
paddingInline: any; | ||
paddingInlineStart: (val: TStyleValue) => TReturn; | ||
paddingInlineEnd: (val: TStyleValue) => TReturn; | ||
}; | ||
declare const expansions: Omit<shorthands, keyof (aliases | {})> & | ||
Omit<aliases, keyof ({})> & {}; | ||
declare const $$EXPORT_DEFAULT_DECLARATION$$: typeof expansions; | ||
export default $$EXPORT_DEFAULT_DECLARATION$$; |
@@ -9,3 +9,3 @@ "use strict"; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
const expansions = { | ||
const shorthands = { | ||
border: rawValue => { | ||
@@ -32,2 +32,8 @@ return [["borderTop", rawValue], ["borderEnd", rawValue], ["borderBottom", rawValue], ["borderStart", rawValue]]; | ||
}, | ||
borderHorizontalColor: rawValue => [["borderStartColor", rawValue], ["borderEndColor", rawValue]], | ||
borderHorizontalStyle: rawValue => [["borderStartStyle", rawValue], ["borderEndStyle", rawValue]], | ||
borderHorizontalWidth: rawValue => [["borderStartWidth", rawValue], ["borderEndWidth", rawValue]], | ||
borderVerticalColor: rawValue => [["borderTopColor", rawValue], ["borderBottomColor", rawValue]], | ||
borderVerticalStyle: rawValue => [["borderTopStyle", rawValue], ["borderBottomStyle", rawValue]], | ||
borderVerticalWidth: rawValue => [["borderTopWidth", rawValue], ["borderBottomWidth", rawValue]], | ||
borderRadius: rawValue => { | ||
@@ -37,2 +43,5 @@ const [top, right = top, bottom = top, left = right] = (0, _splitCssValue.default)(rawValue); | ||
}, | ||
inset: rawValue => [["top", rawValue], ["end", rawValue], ["bottom", rawValue], ["start", rawValue]], | ||
insetInline: rawValue => [["start", rawValue], ["end", rawValue]], | ||
insetBlock: rawValue => [["top", rawValue], ["bottom", rawValue]], | ||
margin: rawValue => { | ||
@@ -56,10 +65,60 @@ const [top, right = top, bottom = top, left = right] = (0, _splitCssValue.default)(rawValue); | ||
}, | ||
paddingHorizontal: rawValue => { | ||
return [["paddingStart", rawValue], ["paddingEnd", rawValue]]; | ||
paddingHorizontal: val => { | ||
return [["paddingStart", val], ["paddingEnd", val]]; | ||
}, | ||
paddingVertical: rawValue => { | ||
return [["paddingTop", rawValue], ["paddingBottom", rawValue]]; | ||
paddingVertical: val => { | ||
return [["paddingTop", val], ["paddingBottom", val]]; | ||
} | ||
}; | ||
const aliases = { | ||
insetBlockStart: val => [["top", val]], | ||
insetBlockEnd: val => [["bottom", val]], | ||
insetInlineStart: val => [["start", val]], | ||
insetInlineEnd: val => [["end", val]], | ||
blockSize: val => [["height", val]], | ||
inlineSize: val => [["width", val]], | ||
minBlockSize: val => [["minHeight", val]], | ||
minInlineSize: val => [["minWidth", val]], | ||
maxBlockSize: val => [["maxHeight", val]], | ||
maxInlineSize: val => [["maxWidth", val]], | ||
borderBlockWidth: shorthands.borderVerticalWidth, | ||
borderBlockStyle: shorthands.borderVerticalStyle, | ||
borderBlockColor: shorthands.borderVerticalColor, | ||
borderBlockStartWidth: val => [["borderTopWidth", val]], | ||
borderBlockStartStyle: val => [["borderTopStyle", val]], | ||
borderBlockStartColor: val => [["borderTopColor", val]], | ||
borderBlockEndWidth: val => [["borderBottomWidth", val]], | ||
borderBlockEndStyle: val => [["borderBottomStyle", val]], | ||
borderBlockEndColor: val => [["borderBottomColor", val]], | ||
borderInlineWidth: shorthands.borderHorizontalWidth, | ||
borderInlineStyle: shorthands.borderHorizontalStyle, | ||
borderInlineColor: shorthands.borderHorizontalColor, | ||
borderInlineStartWidth: val => [["borderStartWidth", val]], | ||
borderInlineStartStyle: val => [["borderStartStyle", val]], | ||
borderInlineStartColor: val => [["borderStartColor", val]], | ||
borderInlineEndWidth: val => [["borderEndWidth", val]], | ||
borderInlineEndStyle: val => [["borderEndStyle", val]], | ||
borderInlineEndColor: val => [["borderEndColor", val]], | ||
borderStartStartRadius: val => [["borderTopStartRadius", val]], | ||
borderStartEndRadius: val => [["borderTopEndRadius", val]], | ||
borderEndStartRadius: val => [["borderBottomStartRadius", val]], | ||
borderEndEndRadius: val => [["borderBottomEndRadius", val]], | ||
marginBlock: shorthands.marginVertical, | ||
marginBlockStart: val => [["marginTop", val]], | ||
marginBlockEnd: val => [["marginBottom", val]], | ||
marginInline: shorthands.marginHorizontal, | ||
marginInlineStart: val => [["marginStart", val]], | ||
marginInlineEnd: val => [["marginEnd", val]], | ||
paddingBlock: shorthands.paddingVertical, | ||
paddingBlockStart: val => [["paddingTop", val]], | ||
paddingBlockEnd: val => [["paddingBottom", val]], | ||
paddingInline: shorthands.paddingHorizontal, | ||
paddingInlineStart: val => [["paddingStart", val]], | ||
paddingInlineEnd: val => [["paddingEnd", val]] | ||
}; | ||
const expansions = { | ||
...shorthands, | ||
...aliases | ||
}; | ||
var _default = expansions; | ||
exports.default = _default; |
@@ -35,2 +35,8 @@ /** | ||
borderStart: any; | ||
blockSize: (val: TStyleValue) => TReturn; | ||
inlineSize: (val: TStyleValue) => TReturn; | ||
minBlockSize: (val: TStyleValue) => TReturn; | ||
minInlineSize: (val: TStyleValue) => TReturn; | ||
maxBlockSize: (val: TStyleValue) => TReturn; | ||
maxInlineSize: (val: TStyleValue) => TReturn; | ||
borderHorizontalWidth: (value: TStyleValue) => TReturn; | ||
@@ -76,3 +82,3 @@ borderHorizontalStyle: (value: TStyleValue) => TReturn; | ||
declare const $$EXPORT_DEFAULT_DECLARATION$$: Readonly</** | ||
* > 86 | ...typeof shorthands, | ||
* > 92 | ...typeof shorthands, | ||
* | ^^^^^^^^^^^^^^^^^^^^ Unsupported feature: Translating "object types with complex spreads" is currently not supported. | ||
@@ -79,0 +85,0 @@ **/ |
@@ -69,2 +69,8 @@ "use strict"; | ||
borderStart: shorthands.borderInlineStart, | ||
blockSize: val => [["height", val]], | ||
inlineSize: val => [["width", val]], | ||
minBlockSize: val => [["minHeight", val]], | ||
minInlineSize: val => [["minWidth", val]], | ||
maxBlockSize: val => [["maxHeight", val]], | ||
maxInlineSize: val => [["maxWidth", val]], | ||
borderHorizontalWidth: value => [["borderInlineWidth", value]], | ||
@@ -71,0 +77,0 @@ borderHorizontalStyle: value => [["borderInlineStyle", value]], |
@@ -57,3 +57,3 @@ "use strict"; | ||
[overrideClassName]: { | ||
ltr: `.${overrideClassName}{${cssVariablesOverrideString}${atRulesCss}}`, | ||
ltr: `.${overrideClassName}{${cssVariablesOverrideString}}${atRulesCss}`, | ||
priority: 0.99, | ||
@@ -60,0 +60,0 @@ rtl: undefined |
@@ -14,1 +14,4 @@ /** | ||
export default transformValue; | ||
export declare function getNumberSuffix(key: string): string; | ||
export declare const timeUnits: Set<string>; | ||
export declare const lengthUnits: Set<string>; |
@@ -7,2 +7,4 @@ "use strict"; | ||
exports.default = transformValue; | ||
exports.getNumberSuffix = getNumberSuffix; | ||
exports.timeUnits = exports.lengthUnits = void 0; | ||
var _normalizeValue = _interopRequireDefault(require("./utils/normalize-value")); | ||
@@ -34,3 +36,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
} | ||
const unitlessNumberProperties = new Set(["animationIterationCount", "borderImageOutset", "borderImageSlice", "borderImageWidth", "columnCount", "flex", "flexGrow", "flexPositive", "flexShrink", "flexOrder", "gridRow", "gridColumn", "fontWeight", "lineClamp", "lineHeight", "opacity", "order", "orphans", "tabSize", "widows", "zIndex", "fillOpacity", "floodOpacity", "stopOpacity", "strokeDasharray", "strokeDashoffset", "strokeMiterlimit", "strokeOpacity", "strokeWidth"]); | ||
const unitlessNumberProperties = new Set(["animationIterationCount", "aspectRatio", "borderImageOutset", "borderImageSlice", "borderImageWidth", "columnCount", "flex", "flexGrow", "flexPositive", "flexShrink", "flexOrder", "gridRow", "gridColumn", "fontWeight", "lineClamp", "lineHeight", "opacity", "order", "orphans", "tabSize", "widows", "zIndex", "fillOpacity", "floodOpacity", "stopOpacity", "strokeDasharray", "strokeDashoffset", "strokeMiterlimit", "strokeOpacity", "strokeWidth"]); | ||
const numberPropertySuffixes = { | ||
@@ -42,2 +44,6 @@ animationDelay: "ms", | ||
voiceDuration: "ms" | ||
}; | ||
}; | ||
const timeUnits = new Set(Object.keys(numberPropertySuffixes)); | ||
exports.timeUnits = timeUnits; | ||
const lengthUnits = new Set(["backgroundPositionX", "backgroundPositionY", "blockSize", "borderBlockEndWidth", "borderBlockStartWidth", "borderBlockWidth", "borderVerticalWidth", "borderVerticalWidth", "borderBottomLeftRadius", "borderBottomRightRadius", "borderBottomWidth", "borderEndEndRadius", "borderEndStartRadius", "borderImageWidth", "borderInlineEndWidth", "borderEndWidth", "borderInlineStartWidth", "borderStartWidth", "borderInlineWidth", "borderHorizontalWidth", "borderLeftWidth", "borderRightWidth", "borderSpacing", "borderStartEndRadius", "borderStartStartRadius", "borderTopLeftRadius", "borderTopRightRadius", "borderTopWidth", "bottom", "columnGap", "columnRuleWidth", "columnWidth", "containIntrinsicBlockSize", "containIntrinsicHeight", "containIntrinsicInlineSize", "containIntrinsicWidth", "flexBasis", "fontSize", "fontSmooth", "height", "inlineSize", "insetBlockEnd", "insetBlockStart", "insetInlineEnd", "insetInlineStart", "left", "letterSpacing", "marginBlockEnd", "marginBlockStart", "marginBottom", "marginInlineEnd", "marginEnd", "marginInlineStart", "marginStart", "marginLeft", "marginRight", "marginTop", "maskBorderOutset", "maskBorderWidth", "maxBlockSize", "maxHeight", "maxInlineSize", "maxWidth", "minBlockSize", "minHeight", "minInlineSize", "minWidth", "offsetDistance", "outlineOffset", "outlineWidth", "overflowClipMargin", "paddingBlockEnd", "paddingBlockStart", "paddingBottom", "paddingInlineEnd", "paddingEnd", "paddingInlineStart", "paddingStart", "paddingLeft", "paddingRight", "paddingTop", "perspective", "right", "rowGap", "scrollMarginBlockEnd", "scrollMarginBlockStart", "scrollMarginBottom", "scrollMarginInlineEnd", "scrollMarginInlineStart", "scrollMarginLeft", "scrollMarginRight", "scrollMarginTop", "scrollPaddingBlockEnd", "scrollPaddingBlockStart", "scrollPaddingBottom", "scrollPaddingInlineEnd", "scrollPaddingInlineStart", "scrollPaddingLeft", "scrollPaddingRight", "scrollPaddingTop", "scrollSnapMarginBottom", "scrollSnapMarginLeft", "scrollSnapMarginRight", "scrollSnapMarginTop", "shapeMargin", "tabSize", "textDecorationThickness", "textIndent", "textUnderlineOffset", "top", "transformOrigin", "translate", "verticalAlign", "width", "wordSpacing", "border", "borderBlock", "borderBlockEnd", "borderBlockStart", "borderBottom", "borderLeft", "borderRadius", "borderRight", "borderTop", "borderWidth", "columnRule", "containIntrinsicSize", "gap", "inset", "insetBlock", "insetInline", "margin", "marginBlock", "marginVertical", "marginInline", "marginHorizontal", "offset", "outline", "padding", "paddingBlock", "paddingVertical", "paddingInline", "paddingHorizontal", "scrollMargin", "scrollMarginBlock", "scrollMarginInline", "scrollPadding", "scrollPaddingBlock", "scrollPaddingInline", "scrollSnapMargin"]); | ||
exports.lengthUnits = lengthUnits; |
{ | ||
"name": "@stylexjs/shared", | ||
"version": "0.2.0-beta.19", | ||
"version": "0.2.0-beta.20", | ||
"main": "lib/index.js", | ||
@@ -16,3 +16,3 @@ "repository": "https://www.github.com/facebook/stylex", | ||
"devDependencies": { | ||
"@stylexjs/scripts": "0.2.0-beta.19" | ||
"@stylexjs/scripts": "0.2.0-beta.20" | ||
}, | ||
@@ -22,3 +22,4 @@ "jest": { | ||
"printBasicPrototype": false | ||
} | ||
}, | ||
"prettierPath": null | ||
}, | ||
@@ -25,0 +26,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
205234
122
3818