diff --git a/pyproject.toml b/pyproject.toml index d863546..aa9a6b1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "Dragos-SceneBuilder" description = "This node pack offers various ways to build json strings that is ment to be used with a LLM to generate Prompts. It also have a node that can load different prompts so that a LLM can use the json string to make the Image Prompt." -version = "1.0.1" +version = "1.0.2" license = { file = "LICENSE" } [project.urls] diff --git a/web/dragos_structured_builder.js b/web/dragos_structured_builder.js index 3777ada..7e54c6d 100644 --- a/web/dragos_structured_builder.js +++ b/web/dragos_structured_builder.js @@ -219,23 +219,30 @@ async function rebuild(node) { // // ADD THIS BLOCK // - let jsonWidget = node.widgets.find(w => w.name === "json_data"); - - if (!jsonWidget) - { - jsonWidget = node.addWidget( - "text", - "json_data", - "", - () => {}, - { multiline: true } - ); - - jsonWidget.hidden = true; - } - - const data = buildNestedObjectFromWidgets(node); - jsonWidget.value = JSON.stringify(data); + const data = buildNestedObjectFromWidgets(node); + + let jsonWidget = node.widgets.find(w => w.name === "json_data"); + + if (!jsonWidget) + { + jsonWidget = node.addWidget( + "text", + "json_data", + "", + () => {} + ); + + // Fully hide visually and from layout + jsonWidget.hidden = true; + jsonWidget.computeSize = () => [0, -8]; + jsonWidget.draw = () => {}; + } + + jsonWidget.value = JSON.stringify(data); + + // Also store in properties for persistence safety + node.properties = node.properties || {}; + node.properties.json_data = jsonWidget.value; // // END BLOCK //