Fixed Logic Builder node bugs, expression field bugs, code editor bugs, property panel bugs

This commit is contained in:
Richard Osborne
2026-01-16 17:23:31 +01:00
parent 32a0a0885f
commit addd4d9c4a
28 changed files with 1969 additions and 29 deletions

View File

@@ -6,7 +6,8 @@ $_sidebar-hover-enter-offset: 250ms;
display: flex;
position: relative;
overflow: hidden;
width: 380px;
min-width: 380px;
max-width: 55vw;
transition: width 0.3s ease-in-out;
&--expanded {

View File

@@ -90,6 +90,27 @@
}
}
.CloseButton {
padding: 6px 12px;
font-size: 12px;
font-weight: 500;
border: 1px solid var(--theme-color-border-default);
background-color: var(--theme-color-bg-4);
color: var(--theme-color-fg-default);
border-radius: 4px;
cursor: pointer;
transition: all 0.15s ease;
&:hover {
background-color: var(--theme-color-bg-5);
border-color: var(--theme-color-fg-default-shy);
}
&:active {
transform: translateY(1px);
}
}
/* Editor Container with CodeMirror */
.EditorContainer {
flex: 1;

View File

@@ -27,6 +27,7 @@ export function JavaScriptEditor({
value,
onChange,
onSave,
onClose,
validationType = 'expression',
disabled = false,
height,
@@ -294,6 +295,23 @@ export function JavaScriptEditor({
Save
</button>
)}
{onClose && (
<button
onClick={() => {
// Save before closing if onSave is available
if (onSave) {
const currentCode = editorViewRef.current?.state.doc.toString() || '';
onSave(currentCode);
}
onClose();
}}
className={css['CloseButton']}
title="Save and Close (Escape)"
type="button"
>
Close
</button>
)}
</div>
</div>

View File

@@ -24,6 +24,9 @@ export interface JavaScriptEditorProps {
/** Callback when user saves (Ctrl+S or Save button) */
onSave?: (value: string) => void;
/** Callback when user closes the editor (Close button or Escape) */
onClose?: () => void;
/** Validation type */
validationType?: ValidationType;