Skip to content

Commit 2d7193a

Browse files
authored
Merge pull request #282 from code0-tech/feat/pictor-triangulum-update
Pictor and triangulum update
2 parents 8462afb + 6710b54 commit 2d7193a

7 files changed

Lines changed: 180 additions & 85 deletions

File tree

.env.local

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ SAGITTARIUS_GRAPHQL_URL=http://localhost:80/graphql
55
SAGITTARIUS_CABLE_URL=http://localhost:80/cable
66

77
NEXT_PUBLIC_SCULPTOR_VERSION=0.0.0
8-
NEXT_PUBLIC_PICTOR_VERSION=0.10.9
8+
NEXT_PUBLIC_PICTOR_VERSION=0.11.0
99
NEXT_PUBLIC_ALLOWED_REDIRECT_DOMAINS=*.code0.tech,*.codezero.build
1010

1111
NEXT_PUBLIC_OTEL_SERVICE_NAME=#"sculptor-client"

package-lock.json

Lines changed: 126 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
},
1616
"dependencies": {
1717
"@apollo/client": "^4.0.9",
18-
"@code0-tech/pictor": "^0.10.9",
19-
"@code0-tech/triangulum": "^0.25.5",
18+
"@code0-tech/pictor": "^0.11.0",
19+
"@code0-tech/triangulum": "^0.25.6",
2020
"@codemirror/lang-javascript": "^6.2.5",
2121
"@codemirror/lint": "^6.9.5",
2222
"@icons-pack/react-simple-icons": "^13.13.0",

src/packages/ce/src/ai/components/AIChatComponent.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,7 @@ export const AIChatComponent: React.FC<AIChatComponentProps> = (props) => {
178178
boxShadow: "none"
179179
}
180180
}}
181-
placeholder={"Describe what you want to edit..."}
182-
language={StreamLanguage.define({
183-
token(stream) {
184-
stream.next()
185-
return null;
186-
}
187-
})}/>
181+
placeholder={"Describe what you want to edit..."}/>
188182
)
189183
}
190184
<Spacing spacing={"xxs"}/>

src/packages/ce/src/datatype/components/inputs/DataTypeInputComponent.tsx

Lines changed: 48 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -34,48 +34,53 @@ export const DataTypeInputComponent: React.FC<DataTypeInputComponentProps> = (pr
3434
const suggestions = "schema" in (schema ?? {}) ? (schema as NodeSchema)?.schema?.suggestions as (NodeFunction | ReferenceValue | LiteralValue)[] : []
3535
const inputName = "schema" in (schema ?? {}) ? (schema as NodeSchema)?.schema?.input : (schema as Schema)?.input
3636

37-
if ("schema" in (schema ?? {}) && (((schema as NodeSchema).blockedBy?.length ?? 0) > 0) && (rest.formValidation?.valid ?? false)) {
38-
return null
39-
}
37+
return React.useMemo(
38+
() => {
39+
if ("schema" in (schema ?? {}) && (((schema as NodeSchema).blockedBy?.length ?? 0) > 0) && (rest.formValidation?.valid ?? false)) {
40+
return null
41+
}
4042

41-
switch (inputName) {
42-
case "boolean":
43-
return <DataTypeBooleanInputComponent
44-
schema={schema}
45-
suggestions={suggestions}
46-
{...rest}
47-
/>
48-
case "select":
49-
return <DataTypeSelectInputComponent
50-
schema={schema}
51-
suggestions={suggestions}
52-
{...rest}/>
53-
case "number":
54-
return <DataTypeNumberInputComponent
55-
schema={schema}
56-
suggestions={suggestions}
57-
{...rest}/>
58-
case "list":
59-
case "data":
60-
return <DataTypeJSONInputComponent
61-
schema={schema}
62-
suggestions={suggestions}
63-
{...rest}/>
64-
case "generic":
65-
return <DataTypeGenericInputComponent
66-
schema={schema}
67-
suggestions={suggestions}
68-
{...rest}/>
69-
case "sub-flow":
70-
return <DataTypeSubFlowInputComponent
71-
schema={schema}
72-
suggestions={suggestions}
73-
{...rest}/>
74-
default:
75-
return <DataTypeTextInputComponent
76-
suggestions={suggestions}
77-
schema={schema}
78-
{...rest}
79-
/>
80-
}
43+
switch (inputName) {
44+
case "boolean":
45+
return <DataTypeBooleanInputComponent
46+
schema={schema}
47+
suggestions={suggestions}
48+
{...rest}
49+
/>
50+
case "select":
51+
return <DataTypeSelectInputComponent
52+
schema={schema}
53+
suggestions={suggestions}
54+
{...rest}/>
55+
case "number":
56+
return <DataTypeNumberInputComponent
57+
schema={schema}
58+
suggestions={suggestions}
59+
{...rest}/>
60+
case "list":
61+
case "data":
62+
return <DataTypeJSONInputComponent
63+
schema={schema}
64+
suggestions={suggestions}
65+
{...rest}/>
66+
case "generic":
67+
return <DataTypeGenericInputComponent
68+
schema={schema}
69+
suggestions={suggestions}
70+
{...rest}/>
71+
case "sub-flow":
72+
return <DataTypeSubFlowInputComponent
73+
schema={schema}
74+
suggestions={suggestions}
75+
{...rest}/>
76+
default:
77+
return <DataTypeTextInputComponent
78+
suggestions={suggestions}
79+
schema={schema}
80+
{...rest}
81+
/>
82+
}
83+
},
84+
[rest.initialValue, inputName, suggestions?.length ?? 0, rest.formValidation?.valid ?? true, rest.formValidation?.notValidMessage ?? ""]
85+
)
8186
}

src/packages/ce/src/datatype/components/inputs/number/DataTypeNumberInputComponent.tsx

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import React from "react";
22
import {DataTypeInputComponentProps} from "../DataTypeInputComponent";
3-
import {EditorInput, hashToColor, InputDescription, InputLabel} from "@code0-tech/pictor";
4-
import {StreamLanguage} from "@codemirror/language";
5-
import {tags} from "@lezer/highlight";
3+
import {EditorInput, InputDescription, InputLabel} from "@code0-tech/pictor";
64
import {useDebouncedCallback} from "use-debounce";
75
import {
86
LiteralValue,
@@ -55,15 +53,6 @@ export const DataTypeNumberInputComponent: React.FC<DataTypeNumberInputComponent
5553
formValidation={{...formValidation, setValue: undefined}}
5654
maw={"100%"}
5755
placeholder={String(title) ?? ""}
58-
language={StreamLanguage.define({
59-
token(stream) {
60-
stream.next()
61-
return null;
62-
}
63-
})}
64-
tokenStyles={[
65-
{tag: tags.keyword, color: hashToColor("bracket")},
66-
]}
6756
right={
6857
<DataTypeInputControlsComponent suggestions={suggestions} onSelect={value => {
6958
formValidation?.setValue?.(value)

0 commit comments

Comments
 (0)