onejs-react 0.1.14 → 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -271,9 +271,9 @@ describe("style-parser", () => {
|
|
|
271
271
|
expect(result.value).toBe(8)
|
|
272
272
|
})
|
|
273
273
|
|
|
274
|
-
it("parses borderWidth", () => {
|
|
275
|
-
const result = parseStyleValue("borderWidth", 1)
|
|
276
|
-
expect(result
|
|
274
|
+
it("parses borderWidth as plain number (StyleFloat)", () => {
|
|
275
|
+
const result = parseStyleValue("borderWidth", 1)
|
|
276
|
+
expect(result).toBe(1)
|
|
277
277
|
})
|
|
278
278
|
|
|
279
279
|
it("parses fontSize", () => {
|
package/src/style-parser.ts
CHANGED
|
@@ -89,10 +89,9 @@ const LENGTH_PROPERTIES = new Set([
|
|
|
89
89
|
"margin", "marginTop", "marginRight", "marginBottom", "marginLeft",
|
|
90
90
|
"padding", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft",
|
|
91
91
|
"flexBasis",
|
|
92
|
-
"borderWidth", "borderTopWidth", "borderRightWidth", "borderBottomWidth", "borderLeftWidth",
|
|
93
92
|
"borderRadius", "borderTopLeftRadius", "borderTopRightRadius", "borderBottomLeftRadius", "borderBottomRightRadius",
|
|
94
93
|
"fontSize",
|
|
95
|
-
"letterSpacing", "wordSpacing", "
|
|
94
|
+
"letterSpacing", "wordSpacing", "unityParagraphSpacing",
|
|
96
95
|
])
|
|
97
96
|
|
|
98
97
|
// Style properties that expect color values
|
|
@@ -106,6 +105,8 @@ const COLOR_PROPERTIES = new Set([
|
|
|
106
105
|
const NUMBER_PROPERTIES = new Set([
|
|
107
106
|
"flexGrow", "flexShrink", "opacity",
|
|
108
107
|
"unitySliceTop", "unitySliceRight", "unitySliceBottom", "unitySliceLeft", "unitySliceScale",
|
|
108
|
+
"borderWidth", "borderTopWidth", "borderRightWidth", "borderBottomWidth", "borderLeftWidth",
|
|
109
|
+
"unityTextOutlineWidth",
|
|
109
110
|
])
|
|
110
111
|
|
|
111
112
|
// Enum property mappings: React style value -> Unity enum value
|
package/src/types.ts
CHANGED
|
@@ -108,12 +108,12 @@ export interface ViewStyle {
|
|
|
108
108
|
borderBottomColor?: StyleColor;
|
|
109
109
|
borderLeftColor?: StyleColor;
|
|
110
110
|
|
|
111
|
-
/** Border width for all sides. Examples: 1,
|
|
112
|
-
borderWidth?:
|
|
113
|
-
borderTopWidth?:
|
|
114
|
-
borderRightWidth?:
|
|
115
|
-
borderBottomWidth?:
|
|
116
|
-
borderLeftWidth?:
|
|
111
|
+
/** Border width for all sides (StyleFloat). Examples: 1, 2 */
|
|
112
|
+
borderWidth?: number;
|
|
113
|
+
borderTopWidth?: number;
|
|
114
|
+
borderRightWidth?: number;
|
|
115
|
+
borderBottomWidth?: number;
|
|
116
|
+
borderLeftWidth?: number;
|
|
117
117
|
|
|
118
118
|
/** Border radius for all corners. Examples: 8, "8px", "50%" */
|
|
119
119
|
borderRadius?: StyleLength;
|
|
@@ -152,8 +152,8 @@ export interface ViewStyle {
|
|
|
152
152
|
unityParagraphSpacing?: StyleLength;
|
|
153
153
|
/** Text outline color */
|
|
154
154
|
unityTextOutlineColor?: StyleColor;
|
|
155
|
-
/** Text outline width */
|
|
156
|
-
unityTextOutlineWidth?:
|
|
155
|
+
/** Text outline width (StyleFloat) */
|
|
156
|
+
unityTextOutlineWidth?: number;
|
|
157
157
|
/** How overflowing text is handled */
|
|
158
158
|
textOverflow?: 'clip' | 'ellipsis';
|
|
159
159
|
/** Position of text overflow indicator */
|