Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
195 changes: 195 additions & 0 deletions .pnp.cjs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodejs 20.6.1
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3 changes: 3 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ packageExtensions:
'@modelcontextprotocol/sdk@*':
dependencies:
'eventsource-parser': '*'
'@rjsf/core@*':
dependencies:
'@rjsf/validator-ajv8': '*'

pnpEnableEsmLoader: true

Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"@types/yargs": "^17.0.29",
"@typescript-eslint/eslint-plugin": "^8.24.0",
"@typescript-eslint/parser": "^8.24.0",
"ajv": "^8.18.0",
"chalk": "^5.3.0",
"esbuild": "^0.19.5",
"eslint": "^9.20.1",
Expand All @@ -35,6 +36,7 @@
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react-hooks": "^5.1.0",
"globals": "^15.14.0",
"js-yaml": "^4.1.1",
"prettier": "^3.2.5",
"rollup": "^4.34.6",
"ts-node": "^10.9.1",
Expand Down
3 changes: 3 additions & 0 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@
"@ironclad/rivet-core": "workspace:^",
"@ironclad/trivet": "workspace:^",
"@recoiljs/refine": "^0.1.1",
"@rjsf/core": "^6.4.1",
"@rjsf/utils": "^6.4.1",
"@rjsf/validator-ajv8": "^6.4.1",
"@swc/core": "^1.3.94",
"@tanstack/react-query": "^5.4.3",
"@tauri-apps/api": "^1.5.1",
Expand Down
3 changes: 0 additions & 3 deletions packages/app/src/components/CodeEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,7 @@ export const CodeEditor: FC<{
editorRef.current = editor;
}

const latestBeforeDispose = onChangeLatest.current;

return () => {
latestBeforeDispose?.(editor.getValue());
editor.dispose();
window.removeEventListener('resize', onResize);
};
Expand Down
12 changes: 12 additions & 0 deletions packages/app/src/components/editors/CodeEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ export const DefaultCodeEditor: FC<

const debouncedOnChange = useDebounceFn<(node: ChartNode) => void>(onChange, { wait: 100 });

useEffect(() => {
return () => {
debouncedOnChange.flush();
};
}, [debouncedOnChange]);

const onEditorChange = (newText: string) => {
debouncedOnChange.run({
...nodeLatest.current,
Expand All @@ -38,6 +44,9 @@ export const DefaultCodeEditor: FC<
name={editorDef.dataKey}
helperMessage={helperMessage}
onClose={onClose}
onBlur={() => {
debouncedOnChange.flush();
}}
language={editorDef.language}
theme={editorDef.theme}
id={node.id}
Expand All @@ -55,6 +64,7 @@ export const CodeEditor: FC<{
name?: string;
helperMessage?: string;
onClose?: () => void;
onBlur?: () => void;
theme?: string;
language?: string;
id?: string;
Expand All @@ -68,6 +78,7 @@ export const CodeEditor: FC<{
name,
helperMessage,
onClose,
onBlur,
theme,
language,
id,
Expand Down Expand Up @@ -118,6 +129,7 @@ export const CodeEditor: FC<{
onChange={(newValue) => {
onChangeLatest.current?.(newValue);
}}
onBlur={onBlur}
theme={theme}
language={language}
isReadonly={isReadonly || isDisabled}
Expand Down
10 changes: 9 additions & 1 deletion packages/app/src/components/editors/CustomEditor.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { type CustomEditorDefinition, type ChartNode } from '@ironclad/rivet-core';
import {
type CustomEditorDefinition,
type ChartNode,
type JsonSchemaFormCustomEditorDefinition,
} from '@ironclad/rivet-core';
import { type FC } from 'react';
import { type SharedEditorProps } from './SharedEditorProps';
import { match } from 'ts-pattern';
Expand All @@ -9,6 +13,7 @@ import { ObjectNodeAiAssistEditor } from './custom/ObjectNodeAiAssistEditor';
import { GptFunctionNodeJsonSchemaAiAssistEditor } from './custom/GptFunctionJsonSchemaAiAssistEditor';
import { PromptNodeAiAssistEditor } from './custom/PromptNodeAiAssistEditor';
import { TextNodeAiAssistEditor } from './custom/TextNodeAiAssistEditor';
import { JsonSchemaFormEditor } from './custom/JsonSchemaFormEditor';

export const CustomEditor: FC<
SharedEditorProps & {
Expand All @@ -25,5 +30,8 @@ export const CustomEditor: FC<
))
.with('PromptNodeAiAssist', () => <PromptNodeAiAssistEditor {...props} editor={editor} />)
.with('TextNodeAiAssist', () => <TextNodeAiAssistEditor {...props} editor={editor} />)
.with('JsonSchemaForm', () => (
<JsonSchemaFormEditor {...props} editor={editor as JsonSchemaFormCustomEditorDefinition<ChartNode>} />
))
.otherwise(() => null);
};
Loading