mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-19 05:46:04 +00:00
optimized module manager seeding, added type support for new api hooks and reduced amount of dist chunks
This commit is contained in:
@@ -1,14 +1,8 @@
|
||||
import type { FieldApi } from "@tanstack/react-form";
|
||||
import type { EntityData, JsonSchemaField } from "data";
|
||||
import { Suspense, lazy } from "react";
|
||||
import * as Formy from "ui/components/form/Formy";
|
||||
import { FieldLabel } from "ui/components/form/Formy";
|
||||
|
||||
const JsonSchemaForm = lazy(() =>
|
||||
import("ui/components/form/json-schema/JsonSchemaForm").then((m) => ({
|
||||
default: m.JsonSchemaForm
|
||||
}))
|
||||
);
|
||||
import { JsonSchemaForm } from "ui/components/form/json-schema";
|
||||
|
||||
export function EntityJsonSchemaFormField({
|
||||
fieldApi,
|
||||
@@ -34,23 +28,21 @@ export function EntityJsonSchemaFormField({
|
||||
return (
|
||||
<Formy.Group>
|
||||
<FieldLabel htmlFor={fieldApi.name} field={field} />
|
||||
<Suspense fallback={<div>Loading...</div>}>
|
||||
<div
|
||||
data-disabled={disabled ? 1 : undefined}
|
||||
className="data-[disabled]:opacity-70 data-[disabled]:pointer-events-none"
|
||||
>
|
||||
<JsonSchemaForm
|
||||
schema={field.getJsonSchema()}
|
||||
onChange={handleChange}
|
||||
direction="horizontal"
|
||||
formData={formData}
|
||||
uiSchema={{
|
||||
"ui:globalOptions": { flexDirection: "row" },
|
||||
...field.getJsonUiSchema()
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</Suspense>
|
||||
<div
|
||||
data-disabled={disabled ? 1 : undefined}
|
||||
className="data-[disabled]:opacity-70 data-[disabled]:pointer-events-none"
|
||||
>
|
||||
<JsonSchemaForm
|
||||
schema={field.getJsonSchema()}
|
||||
onChange={handleChange}
|
||||
direction="horizontal"
|
||||
formData={formData}
|
||||
uiSchema={{
|
||||
"ui:globalOptions": { flexDirection: "row" },
|
||||
...field.getJsonUiSchema()
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</Formy.Group>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
import { Handle, type Node, type NodeProps, Position } from "@xyflow/react";
|
||||
import { Const, Type, transformObject } from "core/utils";
|
||||
import { type TaskRenderProps, type Trigger, TriggerMap } from "flows";
|
||||
import { Suspense, lazy } from "react";
|
||||
import { type Trigger, TriggerMap } from "flows";
|
||||
import type { IconType } from "react-icons";
|
||||
import { TbCircleLetterT } from "react-icons/tb";
|
||||
const JsonSchemaForm = lazy(() =>
|
||||
import("ui/components/form/json-schema/JsonSchemaForm").then((m) => ({
|
||||
default: m.JsonSchemaForm
|
||||
}))
|
||||
);
|
||||
import { JsonSchemaForm } from "ui/components/form/json-schema";
|
||||
|
||||
export type TaskComponentProps = NodeProps<Node<{ trigger: Trigger }>> & {
|
||||
Icon?: IconType;
|
||||
@@ -48,17 +43,15 @@ export function TriggerComponent({
|
||||
</div>
|
||||
<div className="w-full h-px bg-primary/10" />
|
||||
<div className="flex flex-col gap-2 px-3 py-2">
|
||||
<Suspense fallback={<div>Loading...</div>}>
|
||||
<JsonSchemaForm
|
||||
className="legacy"
|
||||
schema={Type.Union(triggerSchemas)}
|
||||
onChange={console.log}
|
||||
formData={trigger}
|
||||
{...props}
|
||||
/*uiSchema={uiSchema}*/
|
||||
/*fields={{ template: TemplateField }}*/
|
||||
/>
|
||||
</Suspense>
|
||||
<JsonSchemaForm
|
||||
className="legacy"
|
||||
schema={Type.Union(triggerSchemas)}
|
||||
onChange={console.log}
|
||||
formData={trigger}
|
||||
{...props}
|
||||
/*uiSchema={uiSchema}*/
|
||||
/*fields={{ template: TemplateField }}*/
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<Handle
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
import type { Task } from "flows";
|
||||
import { Suspense, lazy } from "react";
|
||||
import { TemplateField } from "./TemplateField";
|
||||
|
||||
const JsonSchemaForm = lazy(() =>
|
||||
import("ui/components/form/json-schema/JsonSchemaForm").then((m) => ({
|
||||
default: m.JsonSchemaForm
|
||||
}))
|
||||
);
|
||||
import { JsonSchemaForm } from "ui/components/form/json-schema";
|
||||
|
||||
export type TaskFormProps = {
|
||||
task: Task;
|
||||
@@ -26,16 +19,14 @@ export function TaskForm({ task, onChange, ...props }: TaskFormProps) {
|
||||
//console.log("uiSchema", uiSchema);
|
||||
|
||||
return (
|
||||
<Suspense fallback={<div>Loading...</div>}>
|
||||
<JsonSchemaForm
|
||||
className="legacy"
|
||||
schema={schema}
|
||||
onChange={onChange}
|
||||
formData={params}
|
||||
{...props}
|
||||
/*uiSchema={uiSchema}*/
|
||||
/*fields={{ template: TemplateField }}*/
|
||||
/>
|
||||
</Suspense>
|
||||
<JsonSchemaForm
|
||||
className="legacy"
|
||||
schema={schema}
|
||||
onChange={onChange}
|
||||
formData={params}
|
||||
{...props}
|
||||
/*uiSchema={uiSchema}*/
|
||||
/*fields={{ template: TemplateField }}*/
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user