@kbach/core-engine 1.0.0-beta.17 → 1.0.0-beta.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/kbach_core_engine.d.ts +10 -0
- package/dist/kbach_core_engine.js +27 -0
- package/dist/kbach_core_engine_bg.wasm +0 -0
- package/dist/kbach_core_engine_bg.wasm.d.ts +1 -0
- package/dist-node/kbach_core_engine.d.ts +9 -0
- package/dist-node/kbach_core_engine.js +28 -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
|
@@ -31,6 +31,15 @@ export function generate_css_attr(class_string: string, theme_json: string): str
|
|
|
31
31
|
*/
|
|
32
32
|
export function resolve_style_json(class_string: string, theme_json: string, color_scheme: string, pressed: boolean, width: number): string;
|
|
33
33
|
|
|
34
|
+
/**
|
|
35
|
+
* "Did you mean …?" for a class that resolves to nothing: a Tailwind CSS
|
|
36
|
+
* shade mapped to Kbach's (`bg-blue-500` → `bg-blue-6`), else a one-edit
|
|
37
|
+
* typo fix. Empty string when there's no suggestion, or the class already
|
|
38
|
+
* resolves. See suggest.rs. Used by the Vite/PostCSS plugin's
|
|
39
|
+
* unknown-class warning and kbach-vscode's quick fix.
|
|
40
|
+
*/
|
|
41
|
+
export function suggest_class(token: string, theme_json: string): string;
|
|
42
|
+
|
|
34
43
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
35
44
|
|
|
36
45
|
export interface InitOutput {
|
|
@@ -39,6 +48,7 @@ export interface InitOutput {
|
|
|
39
48
|
readonly generate_css: (a: number, b: number, c: number, d: number) => [number, number];
|
|
40
49
|
readonly generate_css_attr: (a: number, b: number, c: number, d: number) => [number, number];
|
|
41
50
|
readonly resolve_style_json: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number];
|
|
51
|
+
readonly suggest_class: (a: number, b: number, c: number, d: number) => [number, number];
|
|
42
52
|
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
43
53
|
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
44
54
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
@@ -104,6 +104,33 @@ export function resolve_style_json(class_string, theme_json, color_scheme, press
|
|
|
104
104
|
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* "Did you mean …?" for a class that resolves to nothing: a Tailwind CSS
|
|
110
|
+
* shade mapped to Kbach's (`bg-blue-500` → `bg-blue-6`), else a one-edit
|
|
111
|
+
* typo fix. Empty string when there's no suggestion, or the class already
|
|
112
|
+
* resolves. See suggest.rs. Used by the Vite/PostCSS plugin's
|
|
113
|
+
* unknown-class warning and kbach-vscode's quick fix.
|
|
114
|
+
* @param {string} token
|
|
115
|
+
* @param {string} theme_json
|
|
116
|
+
* @returns {string}
|
|
117
|
+
*/
|
|
118
|
+
export function suggest_class(token, theme_json) {
|
|
119
|
+
let deferred3_0;
|
|
120
|
+
let deferred3_1;
|
|
121
|
+
try {
|
|
122
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
123
|
+
const len0 = WASM_VECTOR_LEN;
|
|
124
|
+
const ptr1 = passStringToWasm0(theme_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
125
|
+
const len1 = WASM_VECTOR_LEN;
|
|
126
|
+
const ret = wasm.suggest_class(ptr0, len0, ptr1, len1);
|
|
127
|
+
deferred3_0 = ret[0];
|
|
128
|
+
deferred3_1 = ret[1];
|
|
129
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
130
|
+
} finally {
|
|
131
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
107
134
|
function __wbg_get_imports() {
|
|
108
135
|
const import0 = {
|
|
109
136
|
__proto__: null,
|
|
Binary file
|
|
@@ -5,6 +5,7 @@ export const default_colors_json: () => [number, number];
|
|
|
5
5
|
export const generate_css: (a: number, b: number, c: number, d: number) => [number, number];
|
|
6
6
|
export const generate_css_attr: (a: number, b: number, c: number, d: number) => [number, number];
|
|
7
7
|
export const resolve_style_json: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number];
|
|
8
|
+
export const suggest_class: (a: number, b: number, c: number, d: number) => [number, number];
|
|
8
9
|
export const __wbindgen_externrefs: WebAssembly.Table;
|
|
9
10
|
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
10
11
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
@@ -30,3 +30,12 @@ export function generate_css_attr(class_string: string, theme_json: string): str
|
|
|
30
30
|
* style-object FFI entry points, only the argument marshaling differs.
|
|
31
31
|
*/
|
|
32
32
|
export function resolve_style_json(class_string: string, theme_json: string, color_scheme: string, pressed: boolean, width: number): string;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* "Did you mean …?" for a class that resolves to nothing: a Tailwind CSS
|
|
36
|
+
* shade mapped to Kbach's (`bg-blue-500` → `bg-blue-6`), else a one-edit
|
|
37
|
+
* typo fix. Empty string when there's no suggestion, or the class already
|
|
38
|
+
* resolves. See suggest.rs. Used by the Vite/PostCSS plugin's
|
|
39
|
+
* unknown-class warning and kbach-vscode's quick fix.
|
|
40
|
+
*/
|
|
41
|
+
export function suggest_class(token: string, theme_json: string): string;
|
|
@@ -108,6 +108,34 @@ function resolve_style_json(class_string, theme_json, color_scheme, pressed, wid
|
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
exports.resolve_style_json = resolve_style_json;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* "Did you mean …?" for a class that resolves to nothing: a Tailwind CSS
|
|
114
|
+
* shade mapped to Kbach's (`bg-blue-500` → `bg-blue-6`), else a one-edit
|
|
115
|
+
* typo fix. Empty string when there's no suggestion, or the class already
|
|
116
|
+
* resolves. See suggest.rs. Used by the Vite/PostCSS plugin's
|
|
117
|
+
* unknown-class warning and kbach-vscode's quick fix.
|
|
118
|
+
* @param {string} token
|
|
119
|
+
* @param {string} theme_json
|
|
120
|
+
* @returns {string}
|
|
121
|
+
*/
|
|
122
|
+
function suggest_class(token, theme_json) {
|
|
123
|
+
let deferred3_0;
|
|
124
|
+
let deferred3_1;
|
|
125
|
+
try {
|
|
126
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
127
|
+
const len0 = WASM_VECTOR_LEN;
|
|
128
|
+
const ptr1 = passStringToWasm0(theme_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
129
|
+
const len1 = WASM_VECTOR_LEN;
|
|
130
|
+
const ret = wasm.suggest_class(ptr0, len0, ptr1, len1);
|
|
131
|
+
deferred3_0 = ret[0];
|
|
132
|
+
deferred3_1 = ret[1];
|
|
133
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
134
|
+
} finally {
|
|
135
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
exports.suggest_class = suggest_class;
|
|
111
139
|
function __wbg_get_imports() {
|
|
112
140
|
const import0 = {
|
|
113
141
|
__proto__: null,
|
|
Binary file
|
|
@@ -5,6 +5,7 @@ export const default_colors_json: () => [number, number];
|
|
|
5
5
|
export const generate_css: (a: number, b: number, c: number, d: number) => [number, number];
|
|
6
6
|
export const generate_css_attr: (a: number, b: number, c: number, d: number) => [number, number];
|
|
7
7
|
export const resolve_style_json: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number];
|
|
8
|
+
export const suggest_class: (a: number, b: number, c: number, d: number) => [number, number];
|
|
8
9
|
export const __wbindgen_externrefs: WebAssembly.Table;
|
|
9
10
|
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
10
11
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|