@bouko/react 2.2.3 → 2.2.4

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.
@@ -1,3 +1,4 @@
1
+ "use server";
1
2
  import { promises as fs } from "fs";
2
3
  export async function loadJson(name) {
3
4
  const file = await fs.readFile(process.cwd() + "/assets/" + name + ".json", "utf-8");
@@ -5,6 +6,6 @@ export async function loadJson(name) {
5
6
  }
6
7
  export async function loadForm(name) {
7
8
  if (!name)
8
- throw new Error("Form not foud");
9
+ throw new Error("Form not found");
9
10
  return loadJson(`forms/${name}`);
10
11
  }
@@ -6,6 +6,13 @@ export type FormSection<T> = {
6
6
  setField: (x: string, value: unknown) => void;
7
7
  clear: () => void;
8
8
  };
9
+ export type FormBuilderField<T = unknown> = (Omit<Field<T>, "value" | "update"> & {
10
+ id: string;
11
+ element: string;
12
+ rows?: number;
13
+ placeholder?: string;
14
+ options?: Option[];
15
+ })[][];
9
16
  export type Field<T, K = string> = {
10
17
  id?: string;
11
18
  label?: string;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  "name": "@bouko/react",
4
4
 
5
- "version": "2.2.3",
5
+ "version": "2.2.4",
6
6
 
7
7
  "main": "./dist/index.js",
8
8