@formique/semantq 1.0.10 → 1.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/astToFormique.js +16 -5
  2. package/package.json +1 -1
package/astToFormique.js CHANGED
@@ -771,14 +771,25 @@ buildDynamicSingleSelect(node, rawFieldName) {
771
771
 
772
772
  // Handle special case for 'sendTo' which might use a structure like OptionList
773
773
  if (key === 'sendTo') {
774
- // Assuming 'sendTo' value is parsed as an OptionList (Array of Options)
774
+ let result;
775
+
776
+ // 1. Handle Array/OptionList (Preferred path)
775
777
  if (node.value && Array.isArray(node.value.values)) {
776
- const sendToEmails = node.value.values.map(option => option.value);
777
- this.formSettings[key] = sendToEmails;
778
+ // Map the array of option objects to an array of email strings
779
+ result = node.value.values.map(option => option.value);
778
780
  } else {
779
- // Fallback for single email string
780
- this.formSettings[key] = val;
781
+ // 2. Handle Fallback (Single string or null)
782
+ // Ensure 'val' is treated as a single-element array if it exists.
783
+ if (val) {
784
+ // SUEGICAL FIX: Wrap the single email string in an array.
785
+ result = [val];
786
+ } else {
787
+ result = []; // Use an empty array if no value is present
788
+ }
781
789
  }
790
+
791
+ // 3. Assign the final array result
792
+ this.formSettings[key] = result;
782
793
  } else
783
794
  {
784
795
  // All other custom form settings
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formique/semantq",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "Formique is a native form builder for the Semantq JS Framework",
5
5
  "main": "formique-semantq.js",
6
6
  "type": "module",