[Refactor] useStringWidget composable (#2503)

This commit is contained in:
Chenlei Hu
2025-02-10 19:49:00 -05:00
committed by GitHub
parent 46428cbf7d
commit b4c59ffae1
4 changed files with 99 additions and 71 deletions

View File

@@ -10,8 +10,7 @@ useExtensionService().registerExtension({
if (node.widgets) {
// Locate dynamic prompt text widgets
// Include any widgets with dynamicPrompts set to true, and customtext
// @ts-expect-error dynamicPrompts is not typed
const widgets = node.widgets.filter((n) => n.dynamicPrompts)
const widgets = node.widgets.filter((w) => w.dynamicPrompts)
for (const widget of widgets) {
// Override the serialization of the value to resolve dynamic prompts for all widgets supporting it in this node
// @ts-expect-error hacky override