@kbach/core-engine 1.0.0-beta.1 → 1.0.0-beta.2
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/README.md +13 -6
- package/dist/README.md +13 -6
- package/dist/kbach_core_engine.d.ts +3 -0
- package/dist/kbach_core_engine.js +22 -0
- package/dist/kbach_core_engine_bg.wasm +0 -0
- package/dist/kbach_core_engine_bg.wasm.d.ts +1 -0
- package/dist-node/README.md +13 -6
- package/dist-node/kbach_core_engine.d.ts +2 -0
- package/dist-node/kbach_core_engine.js +23 -0
- package/dist-node/kbach_core_engine_bg.wasm +0 -0
- package/dist-node/kbach_core_engine_bg.wasm.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,12 +7,19 @@ The Rust/WASM utility-resolution engine that powers
|
|
|
7
7
|
> web package — this build is the browser/Node WASM target). If you're
|
|
8
8
|
> building a React web app, install `@kbach/react` instead — it re-exports
|
|
9
9
|
> everything you need and pulls this package in automatically.
|
|
10
|
-
> `@kbach/react-native` does NOT depend on this package directly
|
|
11
|
-
> Android the same Rust source
|
|
12
|
-
> cross-compiled ahead of time to a native
|
|
13
|
-
> prebuilt inside `@kbach/react-native`'s
|
|
14
|
-
> `scripts/build-android.mjs` in this package
|
|
15
|
-
> (re)generated.
|
|
10
|
+
> `@kbach/react-native` does NOT depend on this package directly, on
|
|
11
|
+
> either of the two platforms it supports: on Android the same Rust source
|
|
12
|
+
> (`src/jni_bridge.rs`) is instead cross-compiled ahead of time to a native
|
|
13
|
+
> `.so` (JNI, not WASM) and shipped prebuilt inside `@kbach/react-native`'s
|
|
14
|
+
> own `android/` folder — see `scripts/build-android.mjs` in this package
|
|
15
|
+
> for how that binary gets (re)generated. On Expo Web / react-native-web,
|
|
16
|
+
> `@kbach/react-native` vendors a trimmed copy of this package's own
|
|
17
|
+
> web-target WASM glue directly into its own source (generated via
|
|
18
|
+
> `scripts/generate-web-glue.mjs` and `scripts/generate-wasm-base64.mjs`)
|
|
19
|
+
> rather than importing this package at runtime — see that script's own
|
|
20
|
+
> doc comment for why (short version: this package's unused async `init()`
|
|
21
|
+
> export references `import.meta.url`, which breaks under some bundler
|
|
22
|
+
> targets even when never called).
|
|
16
23
|
|
|
17
24
|
## What this is
|
|
18
25
|
|
package/dist/README.md
CHANGED
|
@@ -7,12 +7,19 @@ The Rust/WASM utility-resolution engine that powers
|
|
|
7
7
|
> web package — this build is the browser/Node WASM target). If you're
|
|
8
8
|
> building a React web app, install `@kbach/react` instead — it re-exports
|
|
9
9
|
> everything you need and pulls this package in automatically.
|
|
10
|
-
> `@kbach/react-native` does NOT depend on this package directly
|
|
11
|
-
> Android the same Rust source
|
|
12
|
-
> cross-compiled ahead of time to a native
|
|
13
|
-
> prebuilt inside `@kbach/react-native`'s
|
|
14
|
-
> `scripts/build-android.mjs` in this package
|
|
15
|
-
> (re)generated.
|
|
10
|
+
> `@kbach/react-native` does NOT depend on this package directly, on
|
|
11
|
+
> either of the two platforms it supports: on Android the same Rust source
|
|
12
|
+
> (`src/jni_bridge.rs`) is instead cross-compiled ahead of time to a native
|
|
13
|
+
> `.so` (JNI, not WASM) and shipped prebuilt inside `@kbach/react-native`'s
|
|
14
|
+
> own `android/` folder — see `scripts/build-android.mjs` in this package
|
|
15
|
+
> for how that binary gets (re)generated. On Expo Web / react-native-web,
|
|
16
|
+
> `@kbach/react-native` vendors a trimmed copy of this package's own
|
|
17
|
+
> web-target WASM glue directly into its own source (generated via
|
|
18
|
+
> `scripts/generate-web-glue.mjs` and `scripts/generate-wasm-base64.mjs`)
|
|
19
|
+
> rather than importing this package at runtime — see that script's own
|
|
20
|
+
> doc comment for why (short version: this package's unused async `init()`
|
|
21
|
+
> export references `import.meta.url`, which breaks under some bundler
|
|
22
|
+
> targets even when never called).
|
|
16
23
|
|
|
17
24
|
## What this is
|
|
18
25
|
|
|
@@ -14,6 +14,8 @@ export function default_colors_json(): string;
|
|
|
14
14
|
|
|
15
15
|
export function generate_css(class_string: string, theme_json: string): string;
|
|
16
16
|
|
|
17
|
+
export function generate_css_attr(class_string: string, theme_json: string): string;
|
|
18
|
+
|
|
17
19
|
/**
|
|
18
20
|
* WASM counterpart to the Android JNI bridge's `resolveStyle` — resolves
|
|
19
21
|
* `class_string` to a flat, RN-`StyleSheet`-shaped JSON style object
|
|
@@ -35,6 +37,7 @@ export interface InitOutput {
|
|
|
35
37
|
readonly memory: WebAssembly.Memory;
|
|
36
38
|
readonly default_colors_json: () => [number, number];
|
|
37
39
|
readonly generate_css: (a: number, b: number, c: number, d: number) => [number, number];
|
|
40
|
+
readonly generate_css_attr: (a: number, b: number, c: number, d: number) => [number, number];
|
|
38
41
|
readonly resolve_style_json: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number];
|
|
39
42
|
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
40
43
|
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
@@ -45,6 +45,28 @@ export function generate_css(class_string, theme_json) {
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
/**
|
|
49
|
+
* @param {string} class_string
|
|
50
|
+
* @param {string} theme_json
|
|
51
|
+
* @returns {string}
|
|
52
|
+
*/
|
|
53
|
+
export function generate_css_attr(class_string, theme_json) {
|
|
54
|
+
let deferred3_0;
|
|
55
|
+
let deferred3_1;
|
|
56
|
+
try {
|
|
57
|
+
const ptr0 = passStringToWasm0(class_string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
58
|
+
const len0 = WASM_VECTOR_LEN;
|
|
59
|
+
const ptr1 = passStringToWasm0(theme_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
60
|
+
const len1 = WASM_VECTOR_LEN;
|
|
61
|
+
const ret = wasm.generate_css_attr(ptr0, len0, ptr1, len1);
|
|
62
|
+
deferred3_0 = ret[0];
|
|
63
|
+
deferred3_1 = ret[1];
|
|
64
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
65
|
+
} finally {
|
|
66
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
48
70
|
/**
|
|
49
71
|
* WASM counterpart to the Android JNI bridge's `resolveStyle` — resolves
|
|
50
72
|
* `class_string` to a flat, RN-`StyleSheet`-shaped JSON style object
|
|
Binary file
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
4
|
export const default_colors_json: () => [number, number];
|
|
5
5
|
export const generate_css: (a: number, b: number, c: number, d: number) => [number, number];
|
|
6
|
+
export const generate_css_attr: (a: number, b: number, c: number, d: number) => [number, number];
|
|
6
7
|
export const resolve_style_json: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number];
|
|
7
8
|
export const __wbindgen_externrefs: WebAssembly.Table;
|
|
8
9
|
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
package/dist-node/README.md
CHANGED
|
@@ -7,12 +7,19 @@ The Rust/WASM utility-resolution engine that powers
|
|
|
7
7
|
> web package — this build is the browser/Node WASM target). If you're
|
|
8
8
|
> building a React web app, install `@kbach/react` instead — it re-exports
|
|
9
9
|
> everything you need and pulls this package in automatically.
|
|
10
|
-
> `@kbach/react-native` does NOT depend on this package directly
|
|
11
|
-
> Android the same Rust source
|
|
12
|
-
> cross-compiled ahead of time to a native
|
|
13
|
-
> prebuilt inside `@kbach/react-native`'s
|
|
14
|
-
> `scripts/build-android.mjs` in this package
|
|
15
|
-
> (re)generated.
|
|
10
|
+
> `@kbach/react-native` does NOT depend on this package directly, on
|
|
11
|
+
> either of the two platforms it supports: on Android the same Rust source
|
|
12
|
+
> (`src/jni_bridge.rs`) is instead cross-compiled ahead of time to a native
|
|
13
|
+
> `.so` (JNI, not WASM) and shipped prebuilt inside `@kbach/react-native`'s
|
|
14
|
+
> own `android/` folder — see `scripts/build-android.mjs` in this package
|
|
15
|
+
> for how that binary gets (re)generated. On Expo Web / react-native-web,
|
|
16
|
+
> `@kbach/react-native` vendors a trimmed copy of this package's own
|
|
17
|
+
> web-target WASM glue directly into its own source (generated via
|
|
18
|
+
> `scripts/generate-web-glue.mjs` and `scripts/generate-wasm-base64.mjs`)
|
|
19
|
+
> rather than importing this package at runtime — see that script's own
|
|
20
|
+
> doc comment for why (short version: this package's unused async `init()`
|
|
21
|
+
> export references `import.meta.url`, which breaks under some bundler
|
|
22
|
+
> targets even when never called).
|
|
16
23
|
|
|
17
24
|
## What this is
|
|
18
25
|
|
|
@@ -14,6 +14,8 @@ export function default_colors_json(): string;
|
|
|
14
14
|
|
|
15
15
|
export function generate_css(class_string: string, theme_json: string): string;
|
|
16
16
|
|
|
17
|
+
export function generate_css_attr(class_string: string, theme_json: string): string;
|
|
18
|
+
|
|
17
19
|
/**
|
|
18
20
|
* WASM counterpart to the Android JNI bridge's `resolveStyle` — resolves
|
|
19
21
|
* `class_string` to a flat, RN-`StyleSheet`-shaped JSON style object
|
|
@@ -47,6 +47,29 @@ function generate_css(class_string, theme_json) {
|
|
|
47
47
|
}
|
|
48
48
|
exports.generate_css = generate_css;
|
|
49
49
|
|
|
50
|
+
/**
|
|
51
|
+
* @param {string} class_string
|
|
52
|
+
* @param {string} theme_json
|
|
53
|
+
* @returns {string}
|
|
54
|
+
*/
|
|
55
|
+
function generate_css_attr(class_string, theme_json) {
|
|
56
|
+
let deferred3_0;
|
|
57
|
+
let deferred3_1;
|
|
58
|
+
try {
|
|
59
|
+
const ptr0 = passStringToWasm0(class_string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
60
|
+
const len0 = WASM_VECTOR_LEN;
|
|
61
|
+
const ptr1 = passStringToWasm0(theme_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
62
|
+
const len1 = WASM_VECTOR_LEN;
|
|
63
|
+
const ret = wasm.generate_css_attr(ptr0, len0, ptr1, len1);
|
|
64
|
+
deferred3_0 = ret[0];
|
|
65
|
+
deferred3_1 = ret[1];
|
|
66
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
67
|
+
} finally {
|
|
68
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
exports.generate_css_attr = generate_css_attr;
|
|
72
|
+
|
|
50
73
|
/**
|
|
51
74
|
* WASM counterpart to the Android JNI bridge's `resolveStyle` — resolves
|
|
52
75
|
* `class_string` to a flat, RN-`StyleSheet`-shaped JSON style object
|
|
Binary file
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
4
|
export const default_colors_json: () => [number, number];
|
|
5
5
|
export const generate_css: (a: number, b: number, c: number, d: number) => [number, number];
|
|
6
|
+
export const generate_css_attr: (a: number, b: number, c: number, d: number) => [number, number];
|
|
6
7
|
export const resolve_style_json: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number];
|
|
7
8
|
export const __wbindgen_externrefs: WebAssembly.Table;
|
|
8
9
|
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kbach/core-engine",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.2",
|
|
4
4
|
"description": "Rust/WASM utility-class resolution engine powering @kbach/react and @kbach/react-native.",
|
|
5
5
|
"keywords": ["css", "wasm", "rust", "tailwind", "utility-first", "styling"],
|
|
6
6
|
"license": "MIT",
|