@vsreact/core 0.0.17 → 0.0.18
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/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/tw.js +9 -0
- package/package.json +1 -1
- package/src/index.ts +1 -1
- package/src/tw.test.ts +12 -0
- package/src/tw.ts +8 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./runtime";
|
|
2
2
|
import "./bridge";
|
|
3
3
|
/** The SDK version — stamp it on support dumps and analytics. */
|
|
4
|
-
export declare const VERSION = "0.0.
|
|
4
|
+
export declare const VERSION = "0.0.18";
|
|
5
5
|
export { View, Text, Image, TextInput, NativeView } from "./primitives";
|
|
6
6
|
export type { CommonProps, TextProps, ImageProps, TextInputProps, NativeViewProps, } from "./primitives";
|
|
7
7
|
export { render, unmount } from "./render";
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import "./runtime";
|
|
4
4
|
import "./bridge";
|
|
5
5
|
/** The SDK version — stamp it on support dumps and analytics. */
|
|
6
|
-
export const VERSION = "0.0.
|
|
6
|
+
export const VERSION = "0.0.18";
|
|
7
7
|
export { View, Text, Image, TextInput, NativeView } from "./primitives";
|
|
8
8
|
export { render, unmount } from "./render";
|
|
9
9
|
export { native } from "./native";
|
package/dist/tw.js
CHANGED
|
@@ -240,6 +240,15 @@ function resolveClass(cls) {
|
|
|
240
240
|
const n = Number(rest);
|
|
241
241
|
return Number.isFinite(n) ? { lineHeight: n * 4 } : undefined;
|
|
242
242
|
}
|
|
243
|
+
case "tracking": {
|
|
244
|
+
// Named scale lives in staticClasses; arbitrary is px: tracking-[3].
|
|
245
|
+
if (rest.startsWith("[")) {
|
|
246
|
+
const spacing = parseLength(rest);
|
|
247
|
+
if (typeof spacing === "number")
|
|
248
|
+
return { letterSpacing: negate(spacing) };
|
|
249
|
+
}
|
|
250
|
+
return undefined;
|
|
251
|
+
}
|
|
243
252
|
case "flex": {
|
|
244
253
|
const n = Number(rest);
|
|
245
254
|
return Number.isFinite(n) ? { flex: n } : undefined;
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -4,7 +4,7 @@ import "./runtime";
|
|
|
4
4
|
import "./bridge";
|
|
5
5
|
|
|
6
6
|
/** The SDK version — stamp it on support dumps and analytics. */
|
|
7
|
-
export const VERSION = "0.0.
|
|
7
|
+
export const VERSION = "0.0.18";
|
|
8
8
|
|
|
9
9
|
export { View, Text, Image, TextInput, NativeView } from "./primitives";
|
|
10
10
|
export type {
|
package/src/tw.test.ts
CHANGED
|
@@ -155,3 +155,15 @@ describe("negative spacing", () => {
|
|
|
155
155
|
expect(tw("-left-1/2").style).toEqual({ left: "-50%" });
|
|
156
156
|
});
|
|
157
157
|
});
|
|
158
|
+
|
|
159
|
+
describe("arbitrary letter spacing", () => {
|
|
160
|
+
test("tracking-[n] is px", () => {
|
|
161
|
+
expect(tw("tracking-[3]").style).toEqual({ letterSpacing: 3 });
|
|
162
|
+
expect(tw("tracking-[1.5]").style).toEqual({ letterSpacing: 1.5 });
|
|
163
|
+
expect(tw("-tracking-[2]").style).toEqual({ letterSpacing: -2 });
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
test("named scale still wins", () => {
|
|
167
|
+
expect(tw("tracking-widest").style).toEqual({ letterSpacing: 1.6 });
|
|
168
|
+
});
|
|
169
|
+
});
|
package/src/tw.ts
CHANGED
|
@@ -246,6 +246,14 @@ function resolveClass(cls: string): Style | undefined {
|
|
|
246
246
|
const n = Number(rest);
|
|
247
247
|
return Number.isFinite(n) ? { lineHeight: n * 4 } : undefined;
|
|
248
248
|
}
|
|
249
|
+
case "tracking": {
|
|
250
|
+
// Named scale lives in staticClasses; arbitrary is px: tracking-[3].
|
|
251
|
+
if (rest.startsWith("[")) {
|
|
252
|
+
const spacing = parseLength(rest);
|
|
253
|
+
if (typeof spacing === "number") return { letterSpacing: negate(spacing) };
|
|
254
|
+
}
|
|
255
|
+
return undefined;
|
|
256
|
+
}
|
|
249
257
|
case "flex": {
|
|
250
258
|
const n = Number(rest);
|
|
251
259
|
return Number.isFinite(n) ? { flex: n } : undefined;
|