The issue was BuilderFieldsKeyValue didn't interpret the template syntax and try to JSON.parse it when navigating between "Static List" and "JSON".
I fixed it relying on useEvaluator().getEvaluatedFields which take care of getting the current data and parsing template. It simplify a lot the logic of the component!
It just required that I get and parse instancePath in the parent.
Now everything works as expected, if user modify a template value in "Static list" mode, the template is overwiten by the plain JSON value. We still handle the "undo/redo" as expected.
The issue was
BuilderFieldsKeyValue
didn't interpret the template syntax and try toJSON.parse
it when navigating between "Static List" and "JSON".I fixed it relying on
useEvaluator().getEvaluatedFields
which take care of getting the current data and parsing template. It simplify a lot the logic of the component!It just required that I get and parse
instancePath
in the parent.Now everything works as expected, if user modify a template value in "Static list" mode, the template is overwiten by the plain JSON value. We still handle the "undo/redo" as expected.
Screencast from 2024-07-01 23-45-17.webm