From ae52ee60297be851031dea169de81aedbc568873 Mon Sep 17 00:00:00 2001 From: nicosammito Date: Mon, 11 May 2026 19:51:49 +0200 Subject: [PATCH 01/15] feat: update @code0-tech/triangulum dependency to version 0.14.5 --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 85419a4..dd9dcec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "dependencies": { "@apollo/client": "^4.0.9", "@code0-tech/pictor": "^0.7.2", - "@code0-tech/triangulum": "^0.14.3", + "@code0-tech/triangulum": "^0.14.5", "@codemirror/lang-javascript": "^6.2.5", "@codemirror/lint": "^6.9.5", "@opentelemetry/api": "^1.9.1", @@ -379,9 +379,9 @@ "peer": true }, "node_modules/@code0-tech/triangulum": { - "version": "0.14.3", - "resolved": "https://registry.npmjs.org/@code0-tech/triangulum/-/triangulum-0.14.3.tgz", - "integrity": "sha512-BpYH2qHv9s8vQHQvC0P2SAlRXit4e5Krf1ICGwlFxL8nEw+ul9iO6bCqC5pEpS18Az/PI2Bvmw4Xufj4EhEsig==", + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/@code0-tech/triangulum/-/triangulum-0.14.5.tgz", + "integrity": "sha512-cb/QAhYvjkujhJqZvWZL4JQSv7o+tOumAoODmbXb0/Stwb6mTwTUJvqcKLD4JPP5VbXjEa9bjSaPyC7RQ0ea6w==", "peerDependencies": { "@code0-tech/sagittarius-graphql-types": "0.0.0-experimental-2462825049-b5d5dce99ef9bf2f81df41d896ec36fa5e28559c", "@typescript/vfs": "^1.6.4", diff --git a/package.json b/package.json index 40a1d40..bfc3ebc 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "dependencies": { "@apollo/client": "^4.0.9", "@code0-tech/pictor": "^0.7.2", - "@code0-tech/triangulum": "^0.14.3", + "@code0-tech/triangulum": "^0.14.5", "@codemirror/lang-javascript": "^6.2.5", "@codemirror/lint": "^6.9.5", "@opentelemetry/api": "^1.9.1", From efeab297536a121164866c8b9fdbc804ee71c42c Mon Sep 17 00:00:00 2001 From: nicosammito Date: Mon, 11 May 2026 19:51:57 +0200 Subject: [PATCH 02/15] feat: add height property to FileTabsContent for consistent layout --- .../ce/src/function/components/files/FunctionFilesComponent.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/packages/ce/src/function/components/files/FunctionFilesComponent.tsx b/src/packages/ce/src/function/components/files/FunctionFilesComponent.tsx index 6193d98..faad1e4 100644 --- a/src/packages/ce/src/function/components/files/FunctionFilesComponent.tsx +++ b/src/packages/ce/src/function/components/files/FunctionFilesComponent.tsx @@ -170,12 +170,14 @@ export const FunctionFilesComponent: React.FC = (pr <> { nodes?.map(node => { return From 690aa97e31d6930c5137ce7570b1903a54306935 Mon Sep 17 00:00:00 2001 From: nicosammito Date: Mon, 11 May 2026 19:52:03 +0200 Subject: [PATCH 03/15] feat: update border colors in DataTypeTypeInputComponent for improved visibility --- .../inputs/type/DataTypeTypeInputComponent.style.scss | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/packages/ce/src/datatype/components/inputs/type/DataTypeTypeInputComponent.style.scss b/src/packages/ce/src/datatype/components/inputs/type/DataTypeTypeInputComponent.style.scss index 358ee6a..3cddad1 100644 --- a/src/packages/ce/src/datatype/components/inputs/type/DataTypeTypeInputComponent.style.scss +++ b/src/packages/ce/src/datatype/components/inputs/type/DataTypeTypeInputComponent.style.scss @@ -29,8 +29,8 @@ li { height: 20px; top: 5px; transform: translateY(-50%); - border-left: 2px solid helpers.backgroundColor(variables.$tertiary); - border-bottom: 2px solid helpers.backgroundColor(variables.$tertiary); + border-left: 2px solid helpers.backgroundColor(variables.$white); + border-bottom: 2px solid helpers.backgroundColor(variables.$white); border-bottom-left-radius: 0.5rem; } @@ -39,7 +39,7 @@ li { position: absolute; width: 2px; height: 100%; - background: helpers.backgroundColor(variables.$tertiary); + background: helpers.backgroundColor(variables.$white); top: 0; left: -0.35rem; } @@ -53,12 +53,11 @@ li { & { @include helpers.borderRadius(); - @include box.box(variables.$primary); @include box.boxHover(variables.$secondary); @include box.boxActive(variables.$secondary); @include helpers.fontStyle(); box-shadow: none; - //border-top: 1px solid helpers.borderColor(); + background: transparent; cursor: pointer; } } \ No newline at end of file From 7469c794cf2c5aca7aed62958604ef1d502dd9bf Mon Sep 17 00:00:00 2001 From: nicosammito Date: Mon, 11 May 2026 19:52:09 +0200 Subject: [PATCH 04/15] feat: update badge border color in DataTypeJSONInputTreeComponent for improved clarity --- .../components/inputs/json/DataTypeJSONInputTreeComponent.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/packages/ce/src/datatype/components/inputs/json/DataTypeJSONInputTreeComponent.tsx b/src/packages/ce/src/datatype/components/inputs/json/DataTypeJSONInputTreeComponent.tsx index 1367f2a..531c2d8 100644 --- a/src/packages/ce/src/datatype/components/inputs/json/DataTypeJSONInputTreeComponent.tsx +++ b/src/packages/ce/src/datatype/components/inputs/json/DataTypeJSONInputTreeComponent.tsx @@ -120,7 +120,7 @@ export const DataTypeJSONInputTreeComponent: React.FC{key} has value - + {String((val as any))} From ee04e381865544ba81a58d23bfd77bde869f3467 Mon Sep 17 00:00:00 2001 From: nicosammito Date: Mon, 11 May 2026 19:52:14 +0200 Subject: [PATCH 05/15] feat: update DataTypeJSONInputEditDialogComponent to use undefined instead of null for better type safety --- .../DataTypeJSONInputEditDialogComponent.tsx | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/src/packages/ce/src/datatype/components/inputs/json/DataTypeJSONInputEditDialogComponent.tsx b/src/packages/ce/src/datatype/components/inputs/json/DataTypeJSONInputEditDialogComponent.tsx index 441040e..a2527c8 100644 --- a/src/packages/ce/src/datatype/components/inputs/json/DataTypeJSONInputEditDialogComponent.tsx +++ b/src/packages/ce/src/datatype/components/inputs/json/DataTypeJSONInputEditDialogComponent.tsx @@ -22,13 +22,13 @@ import { export interface DataTypeJSONInputEditDialogComponentProps { open: boolean - entry: EditableJSONEntry | null - value: LiteralValue | null + entry: EditableJSONEntry | undefined + value: LiteralValue | undefined onOpenChange?: (open: boolean) => void - onObjectChange?: (object: LiteralValue | null) => void + onObjectChange?: (object: LiteralValue | undefined) => void } -function getValueAtPath(obj: LiteralValue | null, path: string[]): unknown { +function getValueAtPath(obj: LiteralValue | undefined, path: string[]): unknown { if (!obj || !Array.isArray(path) || path.length === 0) return obj?.value // Traverse .value recursively if nested let current: any = obj.value @@ -42,8 +42,8 @@ function getValueAtPath(obj: LiteralValue | null, path: string[]): unknown { return current } -function setValueAtPath(obj: LiteralValue | null, path: string[], value: unknown): LiteralValue | null { - if (!obj) return null +function setValueAtPath(obj: LiteralValue | undefined, path: string[], value: unknown): LiteralValue | undefined { + if (!obj) return undefined if (path.length === 0) return { ...obj, value } const [key, ...rest] = path if (Array.isArray(obj.value)) { @@ -81,22 +81,24 @@ export const DataTypeJSONInputEditDialogComponent: React.FC>({}) const [activePath, setActivePath] = React.useState(entry?.path ?? []) - const [editedObject, setEditedObject] = React.useState(value) + const [editedObject, setEditedObject] = React.useState(value) const [editorValue, setEditorValue] = React.useState(getValueAtPath(value, entry?.path ?? [])) const clickTimeout = React.useRef(null) - React.useEffect(() => { - setEditorValue(getValueAtPath(editedObject, activePath)) - }, [activePath]) + React.useEffect( + () => setEditorValue(getValueAtPath(editedObject, activePath)), + [activePath] + ) React.useEffect(() => { setActivePath(entry?.path ?? []) setEditedObject(value) }, [entry]) - React.useEffect(() => { - setEditOpen(open) - }, [open]) + React.useEffect( + () => setEditOpen(open), + [open] + ) const setCollapsedState = (path: string[], collapsed: boolean) => { setCollapsedStateRaw(prev => ({...prev, [path.join(".")]: collapsed})) @@ -120,9 +122,6 @@ export const DataTypeJSONInputEditDialogComponent: React.FC null - const tokenHighlights = {} - return ( onOpenChange?.(open)}> @@ -170,9 +169,9 @@ export const DataTypeJSONInputEditDialogComponent: React.FC From cd5ee41dabf19e2cacb6e2465e0682a5389b7d3c Mon Sep 17 00:00:00 2001 From: nicosammito Date: Mon, 11 May 2026 19:52:20 +0200 Subject: [PATCH 06/15] feat: refactor DataTypeJSONInputComponent to improve state management and integrate DataTypeInputValueComponent --- .../json/DataTypeJSONInputComponent.tsx | 108 +++++------------- 1 file changed, 26 insertions(+), 82 deletions(-) diff --git a/src/packages/ce/src/datatype/components/inputs/json/DataTypeJSONInputComponent.tsx b/src/packages/ce/src/datatype/components/inputs/json/DataTypeJSONInputComponent.tsx index 17e4923..bc39c07 100644 --- a/src/packages/ce/src/datatype/components/inputs/json/DataTypeJSONInputComponent.tsx +++ b/src/packages/ce/src/datatype/components/inputs/json/DataTypeJSONInputComponent.tsx @@ -1,29 +1,14 @@ import React from "react" -import {IconAlignLeft, IconEdit, IconX} from "@tabler/icons-react" import "../type/DataTypeTypeInputComponent.style.scss" import {DataTypeJSONInputTreeComponent} from "./DataTypeJSONInputTreeComponent"; import {DataTypeInputComponentProps} from "../DataTypeInputComponent"; -import {LiteralValue, NodeFunction, NodeParameterValue} from "@code0-tech/sagittarius-graphql-types"; -import {NodeBadgeComponent} from "../../badges/NodeBadgeComponent"; -import {ReferenceBadgeComponent} from "../../badges/ReferenceBadgeComponent"; -import { - Button, - Card, - Flex, - InputDescription, - InputLabel, - InputMessage, - Text, - useService, - useStore -} from "@code0-tech/pictor"; -import {ButtonGroup} from "@code0-tech/pictor/dist/components/button-group/ButtonGroup"; -import {FunctionSuggestionMenuComponent} from "@edition/function/components/suggestion/FunctionSuggestionMenuComponent"; +import {LiteralValue, NodeFunction, ReferenceValue} from "@code0-tech/sagittarius-graphql-types"; +import {InputDescription, InputLabel} from "@code0-tech/pictor"; import { DataTypeJSONInputEditDialogComponent } from "@edition/datatype/components/inputs/json/DataTypeJSONInputEditDialogComponent"; -import {FlowService} from "@edition/flow/services/Flow.service"; -import {useValue} from "@edition/datatype/hooks/DataType.value.hook"; +import {DataTypeInputValueComponent} from "@edition/datatype/components/inputs/DataTypeInputValueComponent"; +import {useDebouncedCallback} from "use-debounce"; export interface EditableJSONEntry { key: string @@ -33,21 +18,20 @@ export interface EditableJSONEntry { export type DataTypeJSONInputComponentProps = DataTypeInputComponentProps +//TODO render fallback value if undefined based on schema export const DataTypeJSONInputComponent: React.FC = (props) => { - const {schema, title, description, formValidation, onChange} = props - - const flowService = useService(FlowService) - const flowStore = useStore(FlowService) + const {schema, title, description, suggestions, formValidation, initialValue, onChange} = props - const suggestions = [] const [editDialogOpen, setEditDialogOpen] = React.useState(false) - const [editEntry, setEditEntry] = React.useState(null) + const [editEntry, setEditEntry] = React.useState(undefined) const [collapsedState, setCollapsedStateRaw] = React.useState>({}) - - const [value, setValue] = React.useState(null) + const onChangeDebounced = useDebouncedCallback((value: LiteralValue | NodeFunction | ReferenceValue | undefined) => { + formValidation?.setValue?.(value) + onChange?.(value) + }, 200) const setCollapsedState = (path: string[], collapsed: boolean) => { setCollapsedStateRaw(prev => ({...prev, [path.join(".")]: collapsed})) @@ -60,70 +44,30 @@ export const DataTypeJSONInputComponent: React.FC - {value?.__typename === "LiteralValue" && ( + {initialValue?.__typename === "LiteralValue" && ( setEditDialogOpen(open)} - onObjectChange={v => { - formValidation?.setValue?.(v) - setValue(v ?? null) - // @ts-ignore - onChange?.() - }} + onObjectChange={onChangeDebounced} /> )} {title} {description} - - - - {"Object"} - - - { - formValidation?.setValue?.(suggestion.value) - setValue(suggestion.value) - // @ts-ignore - onChange?.() - }} - triggerContent={}/> - - - - - - {value?.__typename === "NodeFunction" || value?.__typename === "NodeFunctionIdWrapper" ? ( - - ) : value?.__typename === "ReferenceValue" ? ( - - ) : ( - - )} - - - {!formValidation?.valid && formValidation?.notValidMessage && ( - {formValidation.notValidMessage} - )} + + + ) } From 0ecb0f0ae2bf3bd6c1eea49fa5fb96bb63df7650 Mon Sep 17 00:00:00 2001 From: nicosammito Date: Mon, 11 May 2026 19:52:25 +0200 Subject: [PATCH 07/15] feat: enhance DataTypeInputComponent to support JSON and generic input types --- .../components/inputs/DataTypeInputComponent.tsx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/packages/ce/src/datatype/components/inputs/DataTypeInputComponent.tsx b/src/packages/ce/src/datatype/components/inputs/DataTypeInputComponent.tsx index e37dd63..01c1062 100644 --- a/src/packages/ce/src/datatype/components/inputs/DataTypeInputComponent.tsx +++ b/src/packages/ce/src/datatype/components/inputs/DataTypeInputComponent.tsx @@ -6,6 +6,8 @@ import {DataTypeBooleanInputComponent} from "@edition/datatype/components/inputs import {DataTypeSelectInputComponent} from "@edition/datatype/components/inputs/select/DataTypeSelectInputComponent"; import {InputWrapperProps} from "@code0-tech/pictor/dist/components/form/InputWrapper"; import {DataTypeNumberInputComponent} from "@edition/datatype/components/inputs/number/DataTypeNumberInputComponent"; +import {DataTypeJSONInputComponent} from "@edition/datatype/components/inputs/json/DataTypeJSONInputComponent"; +import {DataTypeGenericInputComponent} from "@edition/datatype/components/inputs/generic/DataTypeGenericInputComponent"; export interface DataTypeInputComponentProps extends Omit, "wrapperComponent" | "onChange"> { schema: NodeSchema @@ -20,8 +22,9 @@ export const DataTypeInputComponent: React.FC = (pr const {schema, ...rest} = props const suggestions = schema?.schema?.suggestions as (NodeFunction | ReferenceValue | LiteralValue)[] + const inputName = schema?.schema?.input === "generic" ? schema.functionSchema.input : schema?.schema?.input - switch (schema?.schema?.input) { + switch (inputName) { case "boolean": return = (pr schema={schema} suggestions={suggestions} {...rest}/> + case "list": + case "data": + return + case "generic": + return default: return Date: Mon, 11 May 2026 19:52:34 +0200 Subject: [PATCH 08/15] feat: add DataTypeGenericInputComponent for handling various input types --- .../generic/DataTypeGenericInputComponent.tsx | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 src/packages/ce/src/datatype/components/inputs/generic/DataTypeGenericInputComponent.tsx diff --git a/src/packages/ce/src/datatype/components/inputs/generic/DataTypeGenericInputComponent.tsx b/src/packages/ce/src/datatype/components/inputs/generic/DataTypeGenericInputComponent.tsx new file mode 100644 index 0000000..d89e5c0 --- /dev/null +++ b/src/packages/ce/src/datatype/components/inputs/generic/DataTypeGenericInputComponent.tsx @@ -0,0 +1,41 @@ +import {DataTypeInputComponentProps} from "@edition/datatype/components/inputs/DataTypeInputComponent"; +import React from "react"; +import {ButtonGroup} from "@code0-tech/pictor/dist/components/button-group/ButtonGroup"; +import {Button, InputDescription, InputLabel} from "@code0-tech/pictor"; +import {useDebouncedCallback} from "use-debounce"; +import {LiteralValue, NodeFunction, ReferenceValue} from "@code0-tech/sagittarius-graphql-types"; + +export type DataTypeGenericInputComponentProps = DataTypeInputComponentProps + +export const DataTypeGenericInputComponent: React.FC = (props) => { + + const {title, description, onChange, formValidation} = props + + const onChangeDebounced = useDebouncedCallback((value: LiteralValue | NodeFunction | ReferenceValue | undefined) => { + formValidation?.setValue?.(value) + onChange?.(value) + }, 200) + + return <> + {title} + {description} + + + + + + + + + +} \ No newline at end of file From 92a05067d70423ad580d0bc3e867f88c993eb417 Mon Sep 17 00:00:00 2001 From: nicosammito Date: Mon, 11 May 2026 19:52:49 +0200 Subject: [PATCH 09/15] feat: update PICTOR version to 0.7.2 in environment configuration --- .env.local | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.local b/.env.local index 704fff2..d9948fc 100644 --- a/.env.local +++ b/.env.local @@ -4,7 +4,7 @@ NEXT_PUBLIC_EDITION=ce SAGITTARIUS_GRAPHQL_URL=http://localhost:3010/graphql NEXT_PUBLIC_SCULPTOR_VERSION=0.0.0 -NEXT_PUBLIC_PICTOR_VERSION=0.7.0 +NEXT_PUBLIC_PICTOR_VERSION=0.7.2 NEXT_PUBLIC_ALLOWED_REDIRECT_DOMAINS=*.code0.tech,*.codezero.build NEXT_PUBLIC_OTEL_SERVICE_NAME=#"sculptor-client" From 7d3b7bb83776435b9a43453eba247d86fdae1a1d Mon Sep 17 00:00:00 2001 From: nicosammito Date: Mon, 11 May 2026 22:57:39 +0200 Subject: [PATCH 10/15] feat: enhance DataTypeJSONInputComponent to use memoized value and generate default data value --- .../json/DataTypeJSONInputComponent.tsx | 38 ++++++++++++++++--- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/src/packages/ce/src/datatype/components/inputs/json/DataTypeJSONInputComponent.tsx b/src/packages/ce/src/datatype/components/inputs/json/DataTypeJSONInputComponent.tsx index bc39c07..b82e33a 100644 --- a/src/packages/ce/src/datatype/components/inputs/json/DataTypeJSONInputComponent.tsx +++ b/src/packages/ce/src/datatype/components/inputs/json/DataTypeJSONInputComponent.tsx @@ -9,6 +9,7 @@ import { } from "@edition/datatype/components/inputs/json/DataTypeJSONInputEditDialogComponent"; import {DataTypeInputValueComponent} from "@edition/datatype/components/inputs/DataTypeInputValueComponent"; import {useDebouncedCallback} from "use-debounce"; +import {DataInput} from "@code0-tech/triangulum/dist/util/schema.util"; export interface EditableJSONEntry { key: string @@ -21,7 +22,6 @@ export type DataTypeJSONInputComponentProps = DataTypeInputComponentProps //TODO render fallback value if undefined based on schema export const DataTypeJSONInputComponent: React.FC = (props) => { - const {schema, title, description, suggestions, formValidation, initialValue, onChange} = props const [editDialogOpen, setEditDialogOpen] = React.useState(false) @@ -33,6 +33,14 @@ export const DataTypeJSONInputComponent: React.FC initialValue ?? (schema.functionSchema.input === "list" ? { + __typename: "LiteralValue", + value: [] + } as LiteralValue : generateDefaultDataValue(schema.functionSchema as DataInput)), + [initialValue, schema] + ) + const setCollapsedState = (path: string[], collapsed: boolean) => { setCollapsedStateRaw(prev => ({...prev, [path.join(".")]: collapsed})) } @@ -44,12 +52,12 @@ export const DataTypeJSONInputComponent: React.FC - {initialValue?.__typename === "LiteralValue" && ( + {value?.__typename === "LiteralValue" && ( setEditDialogOpen(open)} onObjectChange={onChangeDebounced} /> @@ -57,12 +65,12 @@ export const DataTypeJSONInputComponent: React.FC{title} {description} ) } + + +const generateDefaultDataValue = (schema: DataInput): LiteralValue => { + return { + __typename: "LiteralValue", + value: { + ...(Object.entries(schema.properties ?? {})?.map(([key, propSchema]) => { + if (!Array.isArray(propSchema)) { + if (propSchema.input === "data") { + return {[key]: generateDefaultDataValue(propSchema).value} + } + if (propSchema.input === "list") { + return {[key]: []} + } + return {[key]: null} + } + })) + } + } +} From 50bd27aab5f420cffb695273043a70b8b3af7445 Mon Sep 17 00:00:00 2001 From: nicosammito Date: Tue, 12 May 2026 13:13:33 +0200 Subject: [PATCH 11/15] feat: update DataTypeTypeInputComponent styles for improved border and background colors --- .../inputs/type/DataTypeTypeInputComponent.style.scss | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/packages/ce/src/datatype/components/inputs/type/DataTypeTypeInputComponent.style.scss b/src/packages/ce/src/datatype/components/inputs/type/DataTypeTypeInputComponent.style.scss index 3cddad1..65f252f 100644 --- a/src/packages/ce/src/datatype/components/inputs/type/DataTypeTypeInputComponent.style.scss +++ b/src/packages/ce/src/datatype/components/inputs/type/DataTypeTypeInputComponent.style.scss @@ -29,8 +29,8 @@ li { height: 20px; top: 5px; transform: translateY(-50%); - border-left: 2px solid helpers.backgroundColor(variables.$white); - border-bottom: 2px solid helpers.backgroundColor(variables.$white); + border-left: 2px solid helpers.backgroundColor(variables.$white, 2); + border-bottom: 2px solid helpers.backgroundColor(variables.$white, 2); border-bottom-left-radius: 0.5rem; } @@ -39,7 +39,7 @@ li { position: absolute; width: 2px; height: 100%; - background: helpers.backgroundColor(variables.$white); + background: helpers.backgroundColor(variables.$white, 2); top: 0; left: -0.35rem; } @@ -53,7 +53,7 @@ li { & { @include helpers.borderRadius(); - @include box.boxHover(variables.$secondary); + @include box.boxHover(variables.$tertiary); @include box.boxActive(variables.$secondary); @include helpers.fontStyle(); box-shadow: none; From 128bde4f3c73728c863de6b3833262a72399f402 Mon Sep 17 00:00:00 2001 From: nicosammito Date: Tue, 12 May 2026 13:13:38 +0200 Subject: [PATCH 12/15] feat: add Spacing component to DataTypeJSONInputComponent for improved layout --- .../components/inputs/json/DataTypeJSONInputComponent.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/packages/ce/src/datatype/components/inputs/json/DataTypeJSONInputComponent.tsx b/src/packages/ce/src/datatype/components/inputs/json/DataTypeJSONInputComponent.tsx index b82e33a..f325705 100644 --- a/src/packages/ce/src/datatype/components/inputs/json/DataTypeJSONInputComponent.tsx +++ b/src/packages/ce/src/datatype/components/inputs/json/DataTypeJSONInputComponent.tsx @@ -3,7 +3,7 @@ import "../type/DataTypeTypeInputComponent.style.scss" import {DataTypeJSONInputTreeComponent} from "./DataTypeJSONInputTreeComponent"; import {DataTypeInputComponentProps} from "../DataTypeInputComponent"; import {LiteralValue, NodeFunction, ReferenceValue} from "@code0-tech/sagittarius-graphql-types"; -import {InputDescription, InputLabel} from "@code0-tech/pictor"; +import {InputDescription, InputLabel, Spacing} from "@code0-tech/pictor"; import { DataTypeJSONInputEditDialogComponent } from "@edition/datatype/components/inputs/json/DataTypeJSONInputEditDialogComponent"; @@ -75,12 +75,14 @@ export const DataTypeJSONInputComponent: React.FC + ) } +//TODO: only if required const generateDefaultDataValue = (schema: DataInput): LiteralValue => { return { __typename: "LiteralValue", From 6cd165e1f60bbf3cb3321890b4f96639e77f50e9 Mon Sep 17 00:00:00 2001 From: nicosammito Date: Tue, 12 May 2026 15:49:08 +0200 Subject: [PATCH 13/15] feat: improve rendering logic in DataTypeJSONInputTreeComponent for better node visibility --- .../components/inputs/json/DataTypeJSONInputTreeComponent.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/packages/ce/src/datatype/components/inputs/json/DataTypeJSONInputTreeComponent.tsx b/src/packages/ce/src/datatype/components/inputs/json/DataTypeJSONInputTreeComponent.tsx index 531c2d8..fcef4ed 100644 --- a/src/packages/ce/src/datatype/components/inputs/json/DataTypeJSONInputTreeComponent.tsx +++ b/src/packages/ce/src/datatype/components/inputs/json/DataTypeJSONInputTreeComponent.tsx @@ -89,7 +89,7 @@ export const DataTypeJSONInputTreeComponent: React.FC{Array.isArray(value) ? "is a list of" : "is a nested object"} - {!isCollapsed &&
    {renderNodes}
} + {!isCollapsed && (renderNodes?.length ?? 0) > 0 &&
    {renderNodes}
} ) } @@ -161,6 +161,6 @@ export const DataTypeJSONInputTreeComponent: React.FC{validNodes} } \ No newline at end of file From d7d639da64709c778db77975968d460c10ef57e8 Mon Sep 17 00:00:00 2001 From: nicosammito Date: Tue, 12 May 2026 16:23:12 +0200 Subject: [PATCH 14/15] feat: add DataTypeSubFlowInputComponent and enhance existing components for improved functionality --- .../inputs/DataTypeInputComponent.tsx | 10 +++- .../inputs/DataTypeInputControlsComponent.tsx | 4 +- .../inputs/DataTypeInputValueComponent.tsx | 4 +- .../DataTypeSubFlowInputComponent.tsx | 53 +++++++++++++++++++ 4 files changed, 67 insertions(+), 4 deletions(-) create mode 100644 src/packages/ce/src/datatype/components/inputs/sub-flow/DataTypeSubFlowInputComponent.tsx diff --git a/src/packages/ce/src/datatype/components/inputs/DataTypeInputComponent.tsx b/src/packages/ce/src/datatype/components/inputs/DataTypeInputComponent.tsx index 01c1062..6b07563 100644 --- a/src/packages/ce/src/datatype/components/inputs/DataTypeInputComponent.tsx +++ b/src/packages/ce/src/datatype/components/inputs/DataTypeInputComponent.tsx @@ -8,8 +8,11 @@ import {InputWrapperProps} from "@code0-tech/pictor/dist/components/form/InputWr import {DataTypeNumberInputComponent} from "@edition/datatype/components/inputs/number/DataTypeNumberInputComponent"; import {DataTypeJSONInputComponent} from "@edition/datatype/components/inputs/json/DataTypeJSONInputComponent"; import {DataTypeGenericInputComponent} from "@edition/datatype/components/inputs/generic/DataTypeGenericInputComponent"; +import { + DataTypeSubFlowInputComponent +} from "@edition/datatype/components/inputs/sub-flow/DataTypeSubFlowInputComponent"; -export interface DataTypeInputComponentProps extends Omit, "wrapperComponent" | "onChange"> { +export interface DataTypeInputComponentProps extends Omit, "onChange"> { schema: NodeSchema clearable?: boolean onChange?: (value: ReferenceValue | LiteralValue | NodeFunction | undefined) => void @@ -52,6 +55,11 @@ export const DataTypeInputComponent: React.FC = (pr schema={schema} suggestions={suggestions} {...rest}/> + case "sub-flow": + return default: return - diff --git a/src/packages/ce/src/datatype/components/inputs/DataTypeInputValueComponent.tsx b/src/packages/ce/src/datatype/components/inputs/DataTypeInputValueComponent.tsx index aee7618..8e304c0 100644 --- a/src/packages/ce/src/datatype/components/inputs/DataTypeInputValueComponent.tsx +++ b/src/packages/ce/src/datatype/components/inputs/DataTypeInputValueComponent.tsx @@ -12,12 +12,12 @@ export interface DataTypeInputValueComponentProps extends Omit = (props) => { - const {children, inside = false, initialValue, suggestions, onChange, formValidation} = props + const {children, inside = false, initialValue, suggestions, onChange, formValidation, ...rest} = props return inside || initialValue?.__typename === "NodeFunction" || initialValue?.__typename === "NodeFunctionIdWrapper" || initialValue?.__typename === "ReferenceValue" ? - } rightType={"action"}> + } rightType={"action"} {...rest}>
{ initialValue?.__typename === "NodeFunction" || initialValue?.__typename === "NodeFunctionIdWrapper" ? ( diff --git a/src/packages/ce/src/datatype/components/inputs/sub-flow/DataTypeSubFlowInputComponent.tsx b/src/packages/ce/src/datatype/components/inputs/sub-flow/DataTypeSubFlowInputComponent.tsx new file mode 100644 index 0000000..a9320bd --- /dev/null +++ b/src/packages/ce/src/datatype/components/inputs/sub-flow/DataTypeSubFlowInputComponent.tsx @@ -0,0 +1,53 @@ +import {DataTypeInputComponentProps} from "@edition/datatype/components/inputs/DataTypeInputComponent"; +import React from "react"; +import {useDebouncedCallback} from "use-debounce"; +import {InputDescription, InputLabel, Text} from "@code0-tech/pictor"; +import lodash from "lodash" +import {useFunctionSuggestions} from "@edition/function/hooks/Function.suggestion.hook"; +import {DataTypeInputValueComponent} from "@edition/datatype/components/inputs/DataTypeInputValueComponent"; +import {SuggestionDialogComponent} from "@edition/function/components/suggestion/SuggestionDialogComponent"; +import {LiteralValue, NodeFunction, ReferenceValue} from "@code0-tech/sagittarius-graphql-types"; + + +export type DataTypeSubFlowInputComponentProps = DataTypeInputComponentProps + + +export const DataTypeSubFlowInputComponent: React.FC = (props) => { + + const {formValidation, title, initialValue, description, suggestions, onChange} = props + + const defaultValue: number = React.useMemo(() => suggestions?.findIndex(suggest => { + return initialValue && lodash.isMatch(initialValue, suggest) + }), [suggestions])! + + const [suggestionDialogOpen, setSuggestionDialogOpen] = React.useState(false) + const result = useFunctionSuggestions() + + const onChangeDebounced = useDebouncedCallback((value: LiteralValue | ReferenceValue | NodeFunction | undefined) => { + formValidation?.setValue?.(value ?? undefined) + onChange?.(value ?? undefined) + }, 200) + + return React.useMemo(() => <> + { + onChangeDebounced(suggestion.value as NodeFunction) + }} + onOpenChange={setSuggestionDialogOpen}/> + {title} + {description} + { + setSuggestionDialogOpen(true) + } + }} + initialValue={initialValue} + onChange={onChangeDebounced} + suggestions={suggestions} + formValidation={formValidation}> + Select next node + + , [formValidation, defaultValue, suggestionDialogOpen]) +} \ No newline at end of file From 01e171b4dc79592892a25cfe1129ecf0cc109cb2 Mon Sep 17 00:00:00 2001 From: nicosammito Date: Tue, 12 May 2026 16:26:11 +0200 Subject: [PATCH 15/15] feat: update @code0-tech/triangulum dependency to version 0.14.6 --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index dd9dcec..9cce8b5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "dependencies": { "@apollo/client": "^4.0.9", "@code0-tech/pictor": "^0.7.2", - "@code0-tech/triangulum": "^0.14.5", + "@code0-tech/triangulum": "^0.14.6", "@codemirror/lang-javascript": "^6.2.5", "@codemirror/lint": "^6.9.5", "@opentelemetry/api": "^1.9.1", @@ -379,9 +379,9 @@ "peer": true }, "node_modules/@code0-tech/triangulum": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/@code0-tech/triangulum/-/triangulum-0.14.5.tgz", - "integrity": "sha512-cb/QAhYvjkujhJqZvWZL4JQSv7o+tOumAoODmbXb0/Stwb6mTwTUJvqcKLD4JPP5VbXjEa9bjSaPyC7RQ0ea6w==", + "version": "0.14.6", + "resolved": "https://registry.npmjs.org/@code0-tech/triangulum/-/triangulum-0.14.6.tgz", + "integrity": "sha512-1SUZjIJd3SWWAU9Z/YkaEWMLvb3J2VY+NmECeoAwUzPfQfPUzhfYzsb+uc7xc/H2YVl9rOMK7foyHJCoYNbOVQ==", "peerDependencies": { "@code0-tech/sagittarius-graphql-types": "0.0.0-experimental-2462825049-b5d5dce99ef9bf2f81df41d896ec36fa5e28559c", "@typescript/vfs": "^1.6.4", diff --git a/package.json b/package.json index bfc3ebc..9558a30 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "dependencies": { "@apollo/client": "^4.0.9", "@code0-tech/pictor": "^0.7.2", - "@code0-tech/triangulum": "^0.14.5", + "@code0-tech/triangulum": "^0.14.6", "@codemirror/lang-javascript": "^6.2.5", "@codemirror/lint": "^6.9.5", "@opentelemetry/api": "^1.9.1",