mirror of
https://github.com/The-Low-Code-Foundation/OpenNoodl.git
synced 2026-03-08 01:53:30 +01:00
Fixed Logic Builder node bugs, expression field bugs, code editor bugs, property panel bugs
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user