synapse-react-client 4.0.41 → 4.0.43

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 (396) hide show
  1. package/dist/SWC.index.js +1 -1
  2. package/dist/components/AccessRequirementList/AccessRequirementList.d.ts +6 -20
  3. package/dist/components/AccessRequirementList/AccessRequirementList.d.ts.map +1 -1
  4. package/dist/components/AccessRequirementList/AccessRequirementList.js +165 -159
  5. package/dist/components/AccessRequirementList/AccessRequirementList.js.map +1 -1
  6. package/dist/components/AccessRequirementList/AccessRequirementListItem.d.ts +3 -2
  7. package/dist/components/AccessRequirementList/AccessRequirementListItem.d.ts.map +1 -1
  8. package/dist/components/AccessRequirementList/AccessRequirementListItem.js +23 -22
  9. package/dist/components/AccessRequirementList/AccessRequirementListItem.js.map +1 -1
  10. package/dist/components/AccessRequirementList/AccessRequirementListUtils.d.ts +4 -3
  11. package/dist/components/AccessRequirementList/AccessRequirementListUtils.d.ts.map +1 -1
  12. package/dist/components/AccessRequirementList/AccessRequirementListUtils.js +6 -4
  13. package/dist/components/AccessRequirementList/AccessRequirementListUtils.js.map +1 -1
  14. package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/JsonSchemaRequestWizard.d.ts +22 -0
  15. package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/JsonSchemaRequestWizard.d.ts.map +1 -0
  16. package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/JsonSchemaRequestWizard.js +166 -0
  17. package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/JsonSchemaRequestWizard.js.map +1 -0
  18. package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/RequesterInformationFields.d.ts +18 -0
  19. package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/RequesterInformationFields.d.ts.map +1 -0
  20. package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/RequesterInformationFields.js +91 -0
  21. package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/RequesterInformationFields.js.map +1 -0
  22. package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/requesterInformation.d.ts +33 -0
  23. package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/requesterInformation.d.ts.map +1 -0
  24. package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/requesterInformation.js +49 -0
  25. package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/requesterInformation.js.map +1 -0
  26. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/AccessorRequirementHelpText.d.ts +7 -0
  27. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/AccessorRequirementHelpText.d.ts.map +1 -0
  28. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/AccessorRequirementHelpText.js +30 -0
  29. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/AccessorRequirementHelpText.js.map +1 -0
  30. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/CancelRequestDataAccess.d.ts.map +1 -1
  31. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/CancelRequestDataAccess.js +26 -42
  32. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/CancelRequestDataAccess.js.map +1 -1
  33. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsFilesForm/DataAccessRequestAccessorsFilesForm.d.ts.map +1 -1
  34. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsFilesForm/DataAccessRequestAccessorsFilesForm.js +97 -218
  35. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsFilesForm/DataAccessRequestAccessorsFilesForm.js.map +1 -1
  36. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DucUploadSection.d.ts +13 -0
  37. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DucUploadSection.d.ts.map +1 -0
  38. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DucUploadSection.js +60 -0
  39. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DucUploadSection.js.map +1 -0
  40. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.d.ts +8 -2
  41. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.d.ts.map +1 -1
  42. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.js +177 -78
  43. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.js.map +1 -1
  44. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementFormWikiWrapper.d.ts +4 -3
  45. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementFormWikiWrapper.d.ts.map +1 -1
  46. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementFormWikiWrapper.js +15 -15
  47. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementFormWikiWrapper.js.map +1 -1
  48. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.d.ts +3 -2
  49. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.d.ts.map +1 -1
  50. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.js +88 -103
  51. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.js.map +1 -1
  52. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/PrincipalInvestigatorFields.d.ts +12 -0
  53. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/PrincipalInvestigatorFields.d.ts.map +1 -0
  54. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/PrincipalInvestigatorFields.js +50 -0
  55. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/PrincipalInvestigatorFields.js.map +1 -0
  56. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/RequestDataAccessSuccess.d.ts.map +1 -1
  57. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/RequestDataAccessSuccess.js +14 -30
  58. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/RequestDataAccessSuccess.js.map +1 -1
  59. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/{ManagedACTAccessRequirementItem.d.ts → RequestableAccessRequirementItem.d.ts} +9 -8
  60. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/RequestableAccessRequirementItem.d.ts.map +1 -0
  61. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/{ManagedACTAccessRequirementItem.js → RequestableAccessRequirementItem.js} +16 -16
  62. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/RequestableAccessRequirementItem.js.map +1 -0
  63. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/{ManagedACTAccessRequirementItemView.d.ts → RequestableAccessRequirementItemView.d.ts} +8 -7
  64. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/RequestableAccessRequirementItemView.d.ts.map +1 -0
  65. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/{ManagedACTAccessRequirementItemView.js → RequestableAccessRequirementItemView.js} +3 -4
  66. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/RequestableAccessRequirementItemView.js.map +1 -0
  67. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.d.ts.map +1 -1
  68. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.js +123 -170
  69. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.js.map +1 -1
  70. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewDucStep/ReviewDucStep.d.ts +2 -2
  71. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewDucStep/ReviewDucStep.d.ts.map +1 -1
  72. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewDucStep/ReviewDucStep.js +35 -51
  73. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewDucStep/ReviewDucStep.js.map +1 -1
  74. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.d.ts +3 -2
  75. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.d.ts.map +1 -1
  76. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.js +107 -91
  77. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.js.map +1 -1
  78. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SigningOfficialFields.d.ts +12 -0
  79. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SigningOfficialFields.d.ts.map +1 -0
  80. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SigningOfficialFields.js +51 -0
  81. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SigningOfficialFields.js.map +1 -0
  82. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/eDucSignatureUtils.d.ts +12 -0
  83. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/eDucSignatureUtils.d.ts.map +1 -0
  84. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/eDucSignatureUtils.js +24 -0
  85. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/eDucSignatureUtils.js.map +1 -0
  86. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/requestFlowTypes.d.ts +12 -0
  87. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/requestFlowTypes.d.ts.map +1 -0
  88. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/requestFlowTypes.js +0 -0
  89. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/useInitializeRequestAccessors.d.ts +22 -0
  90. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/useInitializeRequestAccessors.d.ts.map +1 -0
  91. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/useInitializeRequestAccessors.js +32 -0
  92. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/useInitializeRequestAccessors.js.map +1 -0
  93. package/dist/components/AccessRequirementList/RequestDataStep.d.ts +34 -0
  94. package/dist/components/AccessRequirementList/RequestDataStep.d.ts.map +1 -0
  95. package/dist/components/AccessRequirementList/RequestDataStep.js +37 -0
  96. package/dist/components/AccessRequirementList/RequestDataStep.js.map +1 -0
  97. package/dist/components/AccessRequirementList/RequirementItem/UnmanagedACTAccessRequirementItem.d.ts +1 -1
  98. package/dist/components/AccessRequirementList/RequirementItem/UnmanagedACTAccessRequirementItem.js.map +1 -1
  99. package/dist/components/AclEditor/AclEditor.js +20 -20
  100. package/dist/components/Authentication/TwoFactorBackupCodes.js +1 -1
  101. package/dist/components/Authentication/TwoFactorBackupCodes.js.map +1 -1
  102. package/dist/components/Authentication/TwoFactorEnrollmentForm.d.ts.map +1 -1
  103. package/dist/components/Authentication/TwoFactorEnrollmentForm.js +79 -69
  104. package/dist/components/Authentication/TwoFactorEnrollmentForm.js.map +1 -1
  105. package/dist/components/DataGrid/SynapseGrid.d.ts.map +1 -1
  106. package/dist/components/DataGrid/SynapseGrid.js +244 -246
  107. package/dist/components/DataGrid/SynapseGrid.js.map +1 -1
  108. package/dist/components/DataGrid/components/GridLoadingState.d.ts +23 -0
  109. package/dist/components/DataGrid/components/GridLoadingState.d.ts.map +1 -0
  110. package/dist/components/DataGrid/components/GridLoadingState.js +64 -0
  111. package/dist/components/DataGrid/components/GridLoadingState.js.map +1 -0
  112. package/dist/components/DataGrid/components/ReorderColumnsDialog.d.ts.map +1 -1
  113. package/dist/components/DataGrid/components/ReorderColumnsDialog.js +30 -29
  114. package/dist/components/DataGrid/components/ReorderColumnsDialog.js.map +1 -1
  115. package/dist/components/DataGrid/useDataGridWebsocket.d.ts +60 -6
  116. package/dist/components/DataGrid/useDataGridWebsocket.d.ts.map +1 -1
  117. package/dist/components/DataGrid/useDataGridWebsocket.js +71 -60
  118. package/dist/components/DataGrid/useDataGridWebsocket.js.map +1 -1
  119. package/dist/components/DataGrid/utils/getNamedColumnIndices.d.ts +11 -0
  120. package/dist/components/DataGrid/utils/getNamedColumnIndices.d.ts.map +1 -0
  121. package/dist/components/DataGrid/utils/getNamedColumnIndices.js +8 -0
  122. package/dist/components/DataGrid/utils/getNamedColumnIndices.js.map +1 -0
  123. package/dist/components/FilePreview/FileHandleContentRenderer.d.ts +6 -2
  124. package/dist/components/FilePreview/FileHandleContentRenderer.d.ts.map +1 -1
  125. package/dist/components/FilePreview/FileHandleContentRenderer.js +27 -14
  126. package/dist/components/FilePreview/FileHandleContentRenderer.js.map +1 -1
  127. package/dist/components/FilePreview/PdfPreview.d.ts +1 -1
  128. package/dist/components/FilePreview/PdfPreview.d.ts.map +1 -1
  129. package/dist/components/FilePreview/PdfPreview.js +15 -16
  130. package/dist/components/FilePreview/PdfPreview.js.map +1 -1
  131. package/dist/components/FormTemplateEditor/FieldDefinitionDrawer.d.ts.map +1 -1
  132. package/dist/components/FormTemplateEditor/FieldDefinitionDrawer.js +71 -68
  133. package/dist/components/FormTemplateEditor/FieldDefinitionDrawer.js.map +1 -1
  134. package/dist/components/FormTemplateEditor/FieldLibrary.css +1 -0
  135. package/dist/components/FormTemplateEditor/FieldLibrary.d.ts +17 -0
  136. package/dist/components/FormTemplateEditor/FieldLibrary.d.ts.map +1 -0
  137. package/dist/components/FormTemplateEditor/FieldLibrary.js +88 -0
  138. package/dist/components/FormTemplateEditor/FieldLibrary.js.map +1 -0
  139. package/dist/components/FormTemplateEditor/FieldLibrary.module.js +5 -0
  140. package/dist/components/FormTemplateEditor/FieldLibrary.module.js.map +1 -0
  141. package/dist/components/FormTemplateEditor/FieldLibrary.module.scss +12 -0
  142. package/dist/components/FormTemplateEditor/FieldLibraryRow.d.ts +19 -0
  143. package/dist/components/FormTemplateEditor/FieldLibraryRow.d.ts.map +1 -0
  144. package/dist/components/FormTemplateEditor/FieldLibraryRow.js +115 -0
  145. package/dist/components/FormTemplateEditor/FieldLibraryRow.js.map +1 -0
  146. package/dist/components/FormTemplateEditor/FieldValidationErrorAlert.css +1 -0
  147. package/dist/components/FormTemplateEditor/FieldValidationErrorAlert.d.ts +9 -0
  148. package/dist/components/FormTemplateEditor/FieldValidationErrorAlert.d.ts.map +1 -0
  149. package/dist/components/FormTemplateEditor/FieldValidationErrorAlert.js +18 -0
  150. package/dist/components/FormTemplateEditor/FieldValidationErrorAlert.js.map +1 -0
  151. package/dist/components/FormTemplateEditor/FieldValidationErrorAlert.module.js +5 -0
  152. package/dist/components/FormTemplateEditor/FieldValidationErrorAlert.module.js.map +1 -0
  153. package/dist/components/FormTemplateEditor/FieldValidationErrorAlert.module.scss +4 -0
  154. package/dist/components/FormTemplateEditor/FormStructurePanel.d.ts +21 -0
  155. package/dist/components/FormTemplateEditor/FormStructurePanel.d.ts.map +1 -0
  156. package/dist/components/FormTemplateEditor/FormStructurePanel.js +108 -0
  157. package/dist/components/FormTemplateEditor/FormStructurePanel.js.map +1 -0
  158. package/dist/components/FormTemplateEditor/FormTemplateEditor.d.ts +10 -0
  159. package/dist/components/FormTemplateEditor/FormTemplateEditor.d.ts.map +1 -0
  160. package/dist/components/FormTemplateEditor/FormTemplateEditor.js +31 -0
  161. package/dist/components/FormTemplateEditor/FormTemplateEditor.js.map +1 -0
  162. package/dist/components/FormTemplateEditor/FormTemplateEditorForm.d.ts +15 -0
  163. package/dist/components/FormTemplateEditor/FormTemplateEditorForm.d.ts.map +1 -0
  164. package/dist/components/FormTemplateEditor/FormTemplateEditorForm.js +234 -0
  165. package/dist/components/FormTemplateEditor/FormTemplateEditorForm.js.map +1 -0
  166. package/dist/components/FormTemplateEditor/FormTemplatePreview.d.ts.map +1 -1
  167. package/dist/components/FormTemplateEditor/FormTemplatePreview.js +29 -41
  168. package/dist/components/FormTemplateEditor/FormTemplatePreview.js.map +1 -1
  169. package/dist/components/FormTemplateEditor/StepCard.d.ts +25 -0
  170. package/dist/components/FormTemplateEditor/StepCard.d.ts.map +1 -0
  171. package/dist/components/FormTemplateEditor/StepCard.js +203 -0
  172. package/dist/components/FormTemplateEditor/StepCard.js.map +1 -0
  173. package/dist/components/FormTemplateEditor/StepFieldRow.d.ts +34 -0
  174. package/dist/components/FormTemplateEditor/StepFieldRow.d.ts.map +1 -0
  175. package/dist/components/FormTemplateEditor/StepFieldRow.js +128 -0
  176. package/dist/components/FormTemplateEditor/StepFieldRow.js.map +1 -0
  177. package/dist/components/FormTemplateEditor/TemplateFileHandleField.d.ts +19 -0
  178. package/dist/components/FormTemplateEditor/TemplateFileHandleField.d.ts.map +1 -0
  179. package/dist/components/FormTemplateEditor/TemplateFileHandleField.js +78 -0
  180. package/dist/components/FormTemplateEditor/TemplateFileHandleField.js.map +1 -0
  181. package/dist/components/FormTemplateEditor/dragHandle.css +1 -0
  182. package/dist/components/FormTemplateEditor/dragHandle.module.js +8 -0
  183. package/dist/components/FormTemplateEditor/dragHandle.module.js.map +1 -0
  184. package/dist/components/FormTemplateEditor/dragHandle.module.scss +22 -0
  185. package/dist/components/FormTemplateEditor/dropTarget.css +1 -0
  186. package/dist/components/FormTemplateEditor/dropTarget.module.js +5 -0
  187. package/dist/components/FormTemplateEditor/dropTarget.module.js.map +1 -0
  188. package/dist/components/FormTemplateEditor/dropTarget.module.scss +14 -0
  189. package/dist/components/FormTemplateEditor/formTemplateDraftState.d.ts +48 -0
  190. package/dist/components/FormTemplateEditor/formTemplateDraftState.d.ts.map +1 -0
  191. package/dist/components/FormTemplateEditor/formTemplateDraftState.js +126 -0
  192. package/dist/components/FormTemplateEditor/formTemplateDraftState.js.map +1 -0
  193. package/dist/components/FormTemplateEditor/formTemplateSchema.d.ts +35 -0
  194. package/dist/components/FormTemplateEditor/formTemplateSchema.d.ts.map +1 -0
  195. package/dist/components/FormTemplateEditor/formTemplateSchema.js +35 -0
  196. package/dist/components/FormTemplateEditor/formTemplateSchema.js.map +1 -0
  197. package/dist/components/FormTemplateEditor/schemaFieldUtils.d.ts +3 -1
  198. package/dist/components/FormTemplateEditor/schemaFieldUtils.d.ts.map +1 -1
  199. package/dist/components/FormTemplateEditor/schemaFieldUtils.js +26 -8
  200. package/dist/components/FormTemplateEditor/schemaFieldUtils.js.map +1 -1
  201. package/dist/components/FormTemplateEditor/sortableIds.d.ts +23 -0
  202. package/dist/components/FormTemplateEditor/sortableIds.d.ts.map +1 -0
  203. package/dist/components/FormTemplateEditor/sortableIds.js +24 -0
  204. package/dist/components/FormTemplateEditor/sortableIds.js.map +1 -0
  205. package/dist/components/FormTemplateEditor/useFormTemplateDraft.d.ts +33 -0
  206. package/dist/components/FormTemplateEditor/useFormTemplateDraft.d.ts.map +1 -0
  207. package/dist/components/FormTemplateEditor/useFormTemplateDraft.js +59 -0
  208. package/dist/components/FormTemplateEditor/useFormTemplateDraft.js.map +1 -0
  209. package/dist/components/FormTemplateEditor/useFormTemplateDrag.d.ts +9 -0
  210. package/dist/components/FormTemplateEditor/useFormTemplateDrag.d.ts.map +1 -0
  211. package/dist/components/FormTemplateEditor/useFormTemplateDrag.js +66 -0
  212. package/dist/components/FormTemplateEditor/useFormTemplateDrag.js.map +1 -0
  213. package/dist/components/FormTemplateEditor/useSaveFormTemplate.d.ts.map +1 -1
  214. package/dist/components/FormTemplateEditor/useSaveFormTemplate.js +34 -19
  215. package/dist/components/FormTemplateEditor/useSaveFormTemplate.js.map +1 -1
  216. package/dist/components/FormTemplateEditor/utils.d.ts +2 -2
  217. package/dist/components/FormTemplateEditor/utils.d.ts.map +1 -1
  218. package/dist/components/FormTemplateEditor/utils.js +7 -10
  219. package/dist/components/FormTemplateEditor/utils.js.map +1 -1
  220. package/dist/components/JsonSchemaForm/SchemaStepForm.d.ts +21 -0
  221. package/dist/components/JsonSchemaForm/SchemaStepForm.d.ts.map +1 -0
  222. package/dist/components/JsonSchemaForm/SchemaStepForm.js +29 -0
  223. package/dist/components/JsonSchemaForm/SchemaStepForm.js.map +1 -0
  224. package/dist/components/JsonSchemaForm/widgets/SelectWidget.d.ts +11 -0
  225. package/dist/components/JsonSchemaForm/widgets/SelectWidget.d.ts.map +1 -1
  226. package/dist/components/JsonSchemaForm/widgets/SelectWidget.js +28 -19
  227. package/dist/components/JsonSchemaForm/widgets/SelectWidget.js.map +1 -1
  228. package/dist/components/QueryBuilder/FilterConditionRow.d.ts +1 -0
  229. package/dist/components/QueryBuilder/FilterConditionRow.d.ts.map +1 -1
  230. package/dist/components/QueryBuilder/FilterConditionRow.js +102 -105
  231. package/dist/components/QueryBuilder/FilterConditionRow.js.map +1 -1
  232. package/dist/components/QueryBuilder/FilterGroupNode.js +6 -6
  233. package/dist/components/QueryBuilder/QueryBuilderControls.d.ts.map +1 -1
  234. package/dist/components/QueryBuilder/QueryBuilderControls.js +88 -81
  235. package/dist/components/QueryBuilder/QueryBuilderControls.js.map +1 -1
  236. package/dist/components/QueryBuilder/QueryBuilderInternalContext.d.ts +7 -0
  237. package/dist/components/QueryBuilder/QueryBuilderInternalContext.d.ts.map +1 -1
  238. package/dist/components/QueryBuilder/QueryBuilderInternalContext.js.map +1 -1
  239. package/dist/components/QueryBuilder/qbTreeToReadable.d.ts +2 -1
  240. package/dist/components/QueryBuilder/qbTreeToReadable.d.ts.map +1 -1
  241. package/dist/components/QueryBuilder/qbTreeToReadable.js +24 -20
  242. package/dist/components/QueryBuilder/qbTreeToReadable.js.map +1 -1
  243. package/dist/components/QueryBuilder/queryBuilderDrag.css +1 -1
  244. package/dist/components/QueryBuilder/queryBuilderDrag.module.js +2 -2
  245. package/dist/components/QueryBuilder/queryBuilderDrag.module.js.map +1 -1
  246. package/dist/components/QueryBuilder/queryBuilderDrag.module.scss +1 -1
  247. package/dist/components/QueryBuilder/queryBuilderMetadata.d.ts +16 -0
  248. package/dist/components/QueryBuilder/queryBuilderMetadata.d.ts.map +1 -1
  249. package/dist/components/QueryBuilder/queryBuilderMetadata.js +13 -5
  250. package/dist/components/QueryBuilder/queryBuilderMetadata.js.map +1 -1
  251. package/dist/components/QueryBuilder/useQBValueDisplayName.d.ts +18 -0
  252. package/dist/components/QueryBuilder/useQBValueDisplayName.d.ts.map +1 -0
  253. package/dist/components/QueryBuilder/useQBValueDisplayName.js +64 -0
  254. package/dist/components/QueryBuilder/useQBValueDisplayName.js.map +1 -0
  255. package/dist/components/SetBasicAccessRequirementFields/GovernanceUtils.d.ts +2 -2
  256. package/dist/components/SetBasicAccessRequirementFields/GovernanceUtils.d.ts.map +1 -1
  257. package/dist/components/SetBasicAccessRequirementFields/GovernanceUtils.js +11 -10
  258. package/dist/components/SetBasicAccessRequirementFields/GovernanceUtils.js.map +1 -1
  259. package/dist/components/SynapseForm/SynapseForm.js +28 -28
  260. package/dist/components/SynapseTable/RowSelection/RowSelectionControls.js +6 -6
  261. package/dist/components/SynapseTable/RowSelection/RowSelectionUI.d.ts +1 -0
  262. package/dist/components/SynapseTable/RowSelection/RowSelectionUI.d.ts.map +1 -1
  263. package/dist/components/SynapseTable/RowSelection/RowSelectionUI.js +13 -11
  264. package/dist/components/SynapseTable/RowSelection/RowSelectionUI.js.map +1 -1
  265. package/dist/components/SynapseTable/SearchV2.js +4 -4
  266. package/dist/components/ToastMessage/ToastMessage.d.ts.map +1 -1
  267. package/dist/components/ToastMessage/ToastMessage.js +25 -22
  268. package/dist/components/ToastMessage/ToastMessage.js.map +1 -1
  269. package/dist/components/dataaccess/FormTemplateEditorRoute.d.ts +7 -0
  270. package/dist/components/dataaccess/FormTemplateEditorRoute.d.ts.map +1 -0
  271. package/dist/components/dataaccess/FormTemplateEditorRoute.js +26 -0
  272. package/dist/components/dataaccess/FormTemplateEditorRoute.js.map +1 -0
  273. package/dist/components/dataaccess/FormTemplateTable.d.ts +10 -0
  274. package/dist/components/dataaccess/FormTemplateTable.d.ts.map +1 -0
  275. package/dist/components/dataaccess/FormTemplateTable.js +124 -0
  276. package/dist/components/dataaccess/FormTemplateTable.js.map +1 -0
  277. package/dist/components/dataaccess/ReviewerDashboard.d.ts.map +1 -1
  278. package/dist/components/dataaccess/ReviewerDashboard.js +80 -50
  279. package/dist/components/dataaccess/ReviewerDashboard.js.map +1 -1
  280. package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.d.ts.map +1 -1
  281. package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.js +7 -4
  282. package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.js.map +1 -1
  283. package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPlace.d.ts.map +1 -1
  284. package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPlace.js +5 -4
  285. package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPlace.js.map +1 -1
  286. package/dist/components/widgets/FileHandleLink.d.ts +12 -2
  287. package/dist/components/widgets/FileHandleLink.d.ts.map +1 -1
  288. package/dist/components/widgets/FileHandleLink.js +25 -29
  289. package/dist/components/widgets/FileHandleLink.js.map +1 -1
  290. package/dist/features/curator/dashboard/CuratorDashboardRouter.d.ts.map +1 -1
  291. package/dist/features/curator/dashboard/CuratorDashboardRouter.js +15 -15
  292. package/dist/features/curator/dashboard/CuratorDashboardRouter.js.map +1 -1
  293. package/dist/features/entity/metadata-task/components/MetadataTasksPageRouter.d.ts.map +1 -1
  294. package/dist/features/entity/metadata-task/components/MetadataTasksPageRouter.js +15 -14
  295. package/dist/features/entity/metadata-task/components/MetadataTasksPageRouter.js.map +1 -1
  296. package/dist/mocks/accessRequirement/mockFormTemplates.d.ts +2 -0
  297. package/dist/mocks/accessRequirement/mockFormTemplates.d.ts.map +1 -1
  298. package/dist/mocks/accessRequirement/mockFormTemplates.js +8 -2
  299. package/dist/mocks/accessRequirement/mockFormTemplates.js.map +1 -1
  300. package/dist/mocks/accessRequirement/mockJsonSchemaAccessRequirements.d.ts +7 -0
  301. package/dist/mocks/accessRequirement/mockJsonSchemaAccessRequirements.d.ts.map +1 -1
  302. package/dist/mocks/accessRequirement/mockJsonSchemaAccessRequirements.js +30 -15
  303. package/dist/mocks/accessRequirement/mockJsonSchemaAccessRequirements.js.map +1 -1
  304. package/dist/mocks/accessRequirement/mockJsonSchemas.d.ts.map +1 -1
  305. package/dist/mocks/accessRequirement/mockJsonSchemas.js +17 -31
  306. package/dist/mocks/accessRequirement/mockJsonSchemas.js.map +1 -1
  307. package/dist/mocks/dataaccess/MockDataAccessRequest.d.ts +3 -0
  308. package/dist/mocks/dataaccess/MockDataAccessRequest.d.ts.map +1 -1
  309. package/dist/mocks/dataaccess/MockDataAccessRequest.js +24 -12
  310. package/dist/mocks/dataaccess/MockDataAccessRequest.js.map +1 -1
  311. package/dist/mocks/msw/handlers/authHandlers.d.ts +1 -0
  312. package/dist/mocks/msw/handlers/authHandlers.d.ts.map +1 -1
  313. package/dist/mocks/msw/handlers/authHandlers.js +6 -2
  314. package/dist/mocks/msw/handlers/authHandlers.js.map +1 -1
  315. package/dist/mocks/msw/handlers/dataAccessRequestHandlers.d.ts +2 -0
  316. package/dist/mocks/msw/handlers/dataAccessRequestHandlers.d.ts.map +1 -1
  317. package/dist/mocks/msw/handlers/dataAccessRequestHandlers.js +65 -47
  318. package/dist/mocks/msw/handlers/dataAccessRequestHandlers.js.map +1 -1
  319. package/dist/mocks/msw/handlers/fileHandlers.d.ts.map +1 -1
  320. package/dist/mocks/msw/handlers/fileHandlers.js +25 -21
  321. package/dist/mocks/msw/handlers/fileHandlers.js.map +1 -1
  322. package/dist/mocks/msw/handlers/formTemplateHandlers.d.ts +2 -1
  323. package/dist/mocks/msw/handlers/formTemplateHandlers.d.ts.map +1 -1
  324. package/dist/mocks/msw/handlers/formTemplateHandlers.js +18 -18
  325. package/dist/mocks/msw/handlers/formTemplateHandlers.js.map +1 -1
  326. package/dist/mocks/msw/handlers/schemaHandlers.d.ts +8 -0
  327. package/dist/mocks/msw/handlers/schemaHandlers.d.ts.map +1 -1
  328. package/dist/mocks/msw/handlers/schemaHandlers.js +20 -3
  329. package/dist/mocks/msw/handlers/schemaHandlers.js.map +1 -1
  330. package/dist/mocks/msw/handlers/twoFactorEnrollmentHandlers.d.ts +8 -0
  331. package/dist/mocks/msw/handlers/twoFactorEnrollmentHandlers.d.ts.map +1 -0
  332. package/dist/mocks/msw/handlers/twoFactorEnrollmentHandlers.js +19 -0
  333. package/dist/mocks/msw/handlers/twoFactorEnrollmentHandlers.js.map +1 -0
  334. package/dist/style/abstracts/_cssVariables.scss +13 -0
  335. package/dist/style/components/_toasts.scss +10 -1
  336. package/dist/style/main.css +1 -1
  337. package/dist/synapse-queries/KeyFactory.d.ts +8 -1
  338. package/dist/synapse-queries/KeyFactory.d.ts.map +1 -1
  339. package/dist/synapse-queries/KeyFactory.js +17 -4
  340. package/dist/synapse-queries/KeyFactory.js.map +1 -1
  341. package/dist/synapse-queries/auth/index.d.ts +1 -0
  342. package/dist/synapse-queries/auth/index.d.ts.map +1 -1
  343. package/dist/synapse-queries/auth/index.js +2 -1
  344. package/dist/synapse-queries/auth/useUnbindOAuthProviderIdentity.d.ts +11 -0
  345. package/dist/synapse-queries/auth/useUnbindOAuthProviderIdentity.d.ts.map +1 -0
  346. package/dist/synapse-queries/auth/useUnbindOAuthProviderIdentity.js +19 -0
  347. package/dist/synapse-queries/auth/useUnbindOAuthProviderIdentity.js.map +1 -0
  348. package/dist/synapse-queries/dataaccess/index.js +5 -5
  349. package/dist/synapse-queries/dataaccess/useEDuc.d.ts +18 -0
  350. package/dist/synapse-queries/dataaccess/useEDuc.d.ts.map +1 -1
  351. package/dist/synapse-queries/dataaccess/useEDuc.js +33 -1
  352. package/dist/synapse-queries/dataaccess/useEDuc.js.map +1 -1
  353. package/dist/synapse-queries/dataaccess/useGeneratedRequestForm.d.ts +19 -0
  354. package/dist/synapse-queries/dataaccess/useGeneratedRequestForm.d.ts.map +1 -0
  355. package/dist/synapse-queries/dataaccess/useGeneratedRequestForm.js +26 -0
  356. package/dist/synapse-queries/dataaccess/useGeneratedRequestForm.js.map +1 -0
  357. package/dist/synapse-queries/file/useDirectUploadToS3.js +6 -6
  358. package/dist/synapse-queries/file/useFileHandle.d.ts +8 -0
  359. package/dist/synapse-queries/file/useFileHandle.d.ts.map +1 -1
  360. package/dist/synapse-queries/file/useFileHandle.js +15 -6
  361. package/dist/synapse-queries/file/useFileHandle.js.map +1 -1
  362. package/dist/synapse-queries/index.js +260 -253
  363. package/dist/synapse-queries/jsonschema/index.js +2 -2
  364. package/dist/synapse-queries/jsonschema/useSchema.d.ts +5 -0
  365. package/dist/synapse-queries/jsonschema/useSchema.d.ts.map +1 -1
  366. package/dist/synapse-queries/jsonschema/useSchema.js +9 -1
  367. package/dist/synapse-queries/jsonschema/useSchema.js.map +1 -1
  368. package/dist/tsconfig.build.tsbuildinfo +1 -1
  369. package/dist/utils/APIConstants.d.ts +1 -0
  370. package/dist/utils/APIConstants.d.ts.map +1 -1
  371. package/dist/utils/APIConstants.js +2 -2
  372. package/dist/utils/APIConstants.js.map +1 -1
  373. package/dist/utils/featureflag/FeatureFlags.d.ts +1 -0
  374. package/dist/utils/featureflag/FeatureFlags.d.ts.map +1 -1
  375. package/dist/utils/featureflag/FeatureFlags.js +1 -1
  376. package/dist/utils/featureflag/FeatureFlags.js.map +1 -1
  377. package/dist/utils/functions/toPascalCase.d.ts +6 -0
  378. package/dist/utils/functions/toPascalCase.d.ts.map +1 -0
  379. package/dist/utils/functions/toPascalCase.js +8 -0
  380. package/dist/utils/functions/toPascalCase.js.map +1 -0
  381. package/dist/utils/hooks/useDetectSSOCode.d.ts.map +1 -1
  382. package/dist/utils/hooks/useDetectSSOCode.js +31 -26
  383. package/dist/utils/hooks/useDetectSSOCode.js.map +1 -1
  384. package/dist/utils/jsonschema/schemaData.d.ts +18 -0
  385. package/dist/utils/jsonschema/schemaData.d.ts.map +1 -0
  386. package/dist/utils/jsonschema/schemaData.js +26 -0
  387. package/dist/utils/jsonschema/schemaData.js.map +1 -0
  388. package/dist/utils/jsonschema/submissionContext.d.ts +5 -0
  389. package/dist/utils/jsonschema/submissionContext.d.ts.map +1 -1
  390. package/dist/utils/jsonschema/submissionContext.js +22 -30
  391. package/dist/utils/jsonschema/submissionContext.js.map +1 -1
  392. package/package.json +10 -9
  393. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementItem.d.ts.map +0 -1
  394. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementItem.js.map +0 -1
  395. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementItemView.d.ts.map +0 -1
  396. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementItemView.js.map +0 -1
@@ -0,0 +1,78 @@
1
+ import { DialogBase as e } from "../DialogBase.js";
2
+ import { FileHandleLink as t } from "../widgets/FileHandleLink.js";
3
+ import { BasicFileHandleUpload as n } from "../file/upload/BasicFileHandleUpload.js";
4
+ import { useMemo as r, useRef as i, useState as a } from "react";
5
+ import { Alert as o, Box as s, Button as c, IconButton as l, Stack as u, Typography as d } from "@mui/material";
6
+ import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
7
+ import { FileHandleAssociateType as h } from "@sage-bionetworks/synapse-types";
8
+ import { Close as g, UploadFile as _ } from "@mui/icons-material";
9
+ //#region src/components/FormTemplateEditor/TemplateFileHandleField.tsx
10
+ function v({ fileHandleId: v, formTemplateId: y, onChange: b }) {
11
+ let [x, S] = a(!1), [C, w] = a(null), T = i(null), E = r(() => v && y ? {
12
+ fileHandleId: v,
13
+ associateObjectType: h.AccessRequirementAttachment,
14
+ associateObjectId: y
15
+ } : void 0, [v, y]);
16
+ return /* @__PURE__ */ m(s, { children: [
17
+ /* @__PURE__ */ p(d, {
18
+ variant: "caption",
19
+ color: "text.secondary",
20
+ component: "div",
21
+ children: "Template file"
22
+ }),
23
+ /* @__PURE__ */ m(u, {
24
+ direction: "row",
25
+ spacing: 1,
26
+ alignItems: "center",
27
+ children: [v ? /* @__PURE__ */ m(f, { children: [E ? /* @__PURE__ */ p(t, {
28
+ fileHandleAssociation: E,
29
+ showDownloadIcon: !0
30
+ }) : /* @__PURE__ */ p(t, {
31
+ creatorFileHandleId: v,
32
+ showDownloadIcon: !0
33
+ }), /* @__PURE__ */ p(l, {
34
+ size: "small",
35
+ onClick: () => b(void 0),
36
+ "aria-label": "Remove template file",
37
+ children: /* @__PURE__ */ p(g, { fontSize: "small" })
38
+ })] }) : /* @__PURE__ */ p(d, {
39
+ variant: "body2",
40
+ color: "text.secondary",
41
+ children: "None"
42
+ }), /* @__PURE__ */ p(c, {
43
+ size: "small",
44
+ startIcon: /* @__PURE__ */ p(_, { fontSize: "small" }),
45
+ onClick: () => S(!0),
46
+ children: v ? "Replace" : "Upload"
47
+ })]
48
+ }),
49
+ /* @__PURE__ */ p(e, {
50
+ open: x,
51
+ onCancel: () => S(!1),
52
+ title: "Upload template file",
53
+ maxWidth: "sm",
54
+ content: /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(n, {
55
+ ref: T,
56
+ allowMultipleUpload: !1,
57
+ disableDragAndDrop: !0,
58
+ onValidationError: w,
59
+ onFileUploadComplete: (e) => {
60
+ b(e), S(!1);
61
+ }
62
+ }), C && /* @__PURE__ */ p(o, {
63
+ severity: "error",
64
+ sx: { mt: 2 },
65
+ children: C
66
+ })] }),
67
+ actions: /* @__PURE__ */ p(c, {
68
+ variant: "outlined",
69
+ onClick: () => S(!1),
70
+ children: "Cancel"
71
+ })
72
+ })
73
+ ] });
74
+ }
75
+ //#endregion
76
+ export { v as TemplateFileHandleField };
77
+
78
+ //# sourceMappingURL=TemplateFileHandleField.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TemplateFileHandleField.js","names":[],"sources":["../../../src/components/FormTemplateEditor/TemplateFileHandleField.tsx"],"sourcesContent":["import { DialogBase } from '@/components/DialogBase'\nimport {\n BasicFileHandleUpload,\n FileUploadHandle,\n} from '@/components/file/upload/BasicFileHandleUpload'\nimport { FileHandleLink } from '@/components/widgets/FileHandleLink'\nimport {\n Close as RemoveIcon,\n UploadFile as UploadIcon,\n} from '@mui/icons-material'\nimport {\n Alert,\n Box,\n Button,\n IconButton,\n Stack,\n Typography,\n} from '@mui/material'\nimport {\n FileHandleAssociateType,\n FileHandleAssociation,\n} from '@sage-bionetworks/synapse-types'\nimport { useMemo, useRef, useState } from 'react'\n\nexport type TemplateFileHandleFieldProps = {\n /** The slot's `templateFileHandleId`, if one is attached. */\n fileHandleId: string | undefined\n /**\n * The FormTemplate's id, used to build the download association. Undefined for a template\n * that has not been saved yet (a brand-new draft), in which case the file is downloaded\n * directly as a file handle the current user uploaded.\n */\n formTemplateId: string | undefined\n onChange: (fileHandleId: string | undefined) => void\n}\n\n/**\n * Upload/download control for a file field's optional template attachment\n * (`FormTemplateField.templateFileHandleId`) — e.g. a fillable document requesters must\n * download, complete, and re-upload to answer this slot. Uploads immediately via\n * `BasicFileHandleUpload` in a dialog; download reuses `FileHandleLink`.\n */\nexport function TemplateFileHandleField({\n fileHandleId,\n formTemplateId,\n onChange,\n}: TemplateFileHandleFieldProps) {\n const [dialogOpen, setDialogOpen] = useState(false)\n const [validationError, setValidationError] = useState<string | null>(null)\n const uploadRef = useRef<FileUploadHandle | null>(null)\n // FileHandleLink refetches whenever the association's identity changes.\n const fileHandleAssociation = useMemo<FileHandleAssociation | undefined>(\n () =>\n fileHandleId && formTemplateId\n ? {\n fileHandleId,\n // AccessRequirementAttachment is a stand-in: a FormTemplate is not an\n // AccessRequirement, so the server may not authorize this download.\n // Supported FormTemplate template-file downloads are tracked in PLFM-10013.\n associateObjectType:\n FileHandleAssociateType.AccessRequirementAttachment,\n associateObjectId: formTemplateId,\n }\n : undefined,\n [fileHandleId, formTemplateId],\n )\n\n return (\n <Box>\n <Typography variant=\"caption\" color=\"text.secondary\" component=\"div\">\n Template file\n </Typography>\n <Stack direction=\"row\" spacing={1} alignItems=\"center\">\n {fileHandleId ? (\n <>\n {/* A template that has not been saved yet can only reference a file handle that the current user uploaded, so it is downloaded directly. */}\n {fileHandleAssociation ? (\n <FileHandleLink\n fileHandleAssociation={fileHandleAssociation}\n showDownloadIcon\n />\n ) : (\n <FileHandleLink\n creatorFileHandleId={fileHandleId}\n showDownloadIcon\n />\n )}\n <IconButton\n size=\"small\"\n onClick={() => onChange(undefined)}\n aria-label=\"Remove template file\"\n >\n <RemoveIcon fontSize=\"small\" />\n </IconButton>\n </>\n ) : (\n <Typography variant=\"body2\" color=\"text.secondary\">\n None\n </Typography>\n )}\n <Button\n size=\"small\"\n startIcon={<UploadIcon fontSize=\"small\" />}\n onClick={() => setDialogOpen(true)}\n >\n {fileHandleId ? 'Replace' : 'Upload'}\n </Button>\n </Stack>\n\n <DialogBase\n open={dialogOpen}\n onCancel={() => setDialogOpen(false)}\n title=\"Upload template file\"\n maxWidth=\"sm\"\n content={\n <>\n <BasicFileHandleUpload\n ref={uploadRef}\n allowMultipleUpload={false}\n disableDragAndDrop={true}\n onValidationError={setValidationError}\n onFileUploadComplete={newFileHandleId => {\n onChange(newFileHandleId)\n setDialogOpen(false)\n }}\n />\n {validationError && (\n <Alert severity=\"error\" sx={{ mt: 2 }}>\n {validationError}\n </Alert>\n )}\n </>\n }\n actions={\n <Button variant=\"outlined\" onClick={() => setDialogOpen(false)}>\n Cancel\n </Button>\n }\n />\n </Box>\n )\n}\n"],"mappings":";;;;;;;;;AA0CA,SAAgB,EAAwB,EACtC,iBACA,mBACA,eAC+B;CAC/B,IAAM,CAAC,GAAY,KAAiB,EAAS,EAAK,GAC5C,CAAC,GAAiB,KAAsB,EAAwB,IAAI,GACpE,IAAY,EAAgC,IAAI,GAEhD,IAAwB,QAE1B,KAAgB,IACZ;EACE;EAIA,qBACE,EAAwB;EAC1B,mBAAmB;CACrB,IACA,KAAA,GACN,CAAC,GAAc,CAAc,CAC/B;CAEA,OACE,kBAAC,GAAD,EAAA,UAAA;EACE,kBAAC,GAAD;GAAY,SAAQ;GAAU,OAAM;GAAiB,WAAU;aAAM;EAEzD,CAAA;EACZ,kBAAC,GAAD;GAAO,WAAU;GAAM,SAAS;GAAG,YAAW;aAA9C,CACG,IACC,kBAAA,GAAA,EAAA,UAAA,CAEG,IACC,kBAAC,GAAD;IACyB;IACvB,kBAAA;GACD,CAAA,IAED,kBAAC,GAAD;IACE,qBAAqB;IACrB,kBAAA;GACD,CAAA,GAEH,kBAAC,GAAD;IACE,MAAK;IACL,eAAe,EAAS,KAAA,CAAS;IACjC,cAAW;cAEX,kBAAC,GAAD,EAAY,UAAS,QAAS,CAAA;GACpB,CAAA,CACZ,EAAA,CAAA,IAEF,kBAAC,GAAD;IAAY,SAAQ;IAAQ,OAAM;cAAiB;GAEvC,CAAA,GAEd,kBAAC,GAAD;IACE,MAAK;IACL,WAAW,kBAAC,GAAD,EAAY,UAAS,QAAS,CAAA;IACzC,eAAe,EAAc,EAAI;cAEhC,IAAe,YAAY;GACtB,CAAA,CACH;;EAEP,kBAAC,GAAD;GACE,MAAM;GACN,gBAAgB,EAAc,EAAK;GACnC,OAAM;GACN,UAAS;GACT,SACE,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,GAAD;IACE,KAAK;IACL,qBAAqB;IACrB,oBAAoB;IACpB,mBAAmB;IACnB,uBAAsB,MAAmB;KAEvC,AADA,EAAS,CAAe,GACxB,EAAc,EAAK;IACrB;GACD,CAAA,GACA,KACC,kBAAC,GAAD;IAAO,UAAS;IAAQ,IAAI,EAAE,IAAI,EAAE;cACjC;GACI,CAAA,CAET,EAAA,CAAA;GAEJ,SACE,kBAAC,GAAD;IAAQ,SAAQ;IAAW,eAAe,EAAc,EAAK;cAAG;GAExD,CAAA;EAEX,CAAA;CACE,EAAA,CAAA;AAET"}
@@ -0,0 +1 @@
1
+ ._dragHandle_9lwpq_1{touch-action:none;cursor:grab;align-items:center;display:flex}._dragHandle_9lwpq_1:active{cursor:grabbing}._dragSource_9lwpq_11{transition:opacity .12s}._dragSource_9lwpq_11[data-dragging=true]{opacity:var(--synapse-drag-source-opacity)}
@@ -0,0 +1,8 @@
1
+ import './dragHandle.css';var e = {
2
+ dragHandle: "_dragHandle_9lwpq_1",
3
+ dragSource: "_dragSource_9lwpq_11"
4
+ };
5
+ //#endregion
6
+ export { e as default };
7
+
8
+ //# sourceMappingURL=dragHandle.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dragHandle.module.js","names":[],"sources":["../../../src/components/FormTemplateEditor/dragHandle.module.scss"],"sourcesContent":["// Shared layout for the drag-indicator handles in FieldLibraryRow and StepFieldRow. Per-instance\n// color/cursor variations (e.g. disabled state) are layered on top via `sx`.\n.dragHandle {\n display: flex;\n align-items: center;\n touch-action: none;\n cursor: grab;\n\n &:active {\n cursor: grabbing;\n }\n}\n\n// Shared fade for the draggable item itself while it is the active drag source. Toggled with\n// `data-dragging` so each usage only reports state and the transition lives here once.\n.dragSource {\n transition: opacity 120ms;\n\n &[data-dragging='true'] {\n opacity: var(--synapse-drag-source-opacity);\n }\n}\n"],"mappings":""}
@@ -0,0 +1,22 @@
1
+ // Shared layout for the drag-indicator handles in FieldLibraryRow and StepFieldRow. Per-instance
2
+ // color/cursor variations (e.g. disabled state) are layered on top via `sx`.
3
+ .dragHandle {
4
+ display: flex;
5
+ align-items: center;
6
+ touch-action: none;
7
+ cursor: grab;
8
+
9
+ &:active {
10
+ cursor: grabbing;
11
+ }
12
+ }
13
+
14
+ // Shared fade for the draggable item itself while it is the active drag source. Toggled with
15
+ // `data-dragging` so each usage only reports state and the transition lives here once.
16
+ .dragSource {
17
+ transition: opacity 120ms;
18
+
19
+ &[data-dragging='true'] {
20
+ opacity: var(--synapse-drag-source-opacity);
21
+ }
22
+ }
@@ -0,0 +1 @@
1
+ ._dropTarget_f4wz1_1{outline-offset:-2px;outline:2px dashed #0000;transition:outline-color .12s,background-color .12s}._dropTarget_f4wz1_1[data-drop-target=true]{outline-color:var(--synapse-primary-action-color);background-color:var(--synapse-primary-action-color-alpha-4)}
@@ -0,0 +1,5 @@
1
+ import './dropTarget.css';var e = { dropTarget: "_dropTarget_f4wz1_1" };
2
+ //#endregion
3
+ export { e as default };
4
+
5
+ //# sourceMappingURL=dropTarget.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dropTarget.module.js","names":[],"sources":["../../../src/components/FormTemplateEditor/dropTarget.module.scss"],"sourcesContent":["// Shared highlight for the step card and its slot list while a compatible drag hovers over them.\n// Toggled with `data-drop-target` so the component only reports state and the look lives here.\n.dropTarget {\n outline: 2px dashed transparent;\n outline-offset: -2px;\n transition:\n outline-color 120ms,\n background-color 120ms;\n\n &[data-drop-target='true'] {\n outline-color: var(--synapse-primary-action-color);\n background-color: var(--synapse-primary-action-color-alpha-4);\n }\n}\n"],"mappings":""}
@@ -0,0 +1,14 @@
1
+ // Shared highlight for the step card and its slot list while a compatible drag hovers over them.
2
+ // Toggled with `data-drop-target` so the component only reports state and the look lives here.
3
+ .dropTarget {
4
+ outline: 2px dashed transparent;
5
+ outline-offset: -2px;
6
+ transition:
7
+ outline-color 120ms,
8
+ background-color 120ms;
9
+
10
+ &[data-drop-target='true'] {
11
+ outline-color: var(--synapse-primary-action-color);
12
+ background-color: var(--synapse-primary-action-color-alpha-4);
13
+ }
14
+ }
@@ -0,0 +1,48 @@
1
+ import { RJSFSchema } from '@rjsf/utils';
2
+ import { ResolvedSchemaProperty, SchemaPropertyContext } from '@/utils/jsonschema/submissionContext';
3
+ import { EditableFormTemplateStep } from './utils';
4
+ export type FormTemplateDraftState = {
5
+ jsonSchema: RJSFSchema;
6
+ steps: EditableFormTemplateStep[];
7
+ /** The property open in the field definition drawer, if any. */
8
+ editingPropertyKey: string | null;
9
+ };
10
+ export declare const NEW_FIELD_TITLE = "New field";
11
+ export declare function schemaPropertyKeys(jsonSchema: RJSFSchema): Set<string>;
12
+ /** The `schemaPath` of every field bound to a step. */
13
+ export declare function boundSchemaPaths(steps: EditableFormTemplateStep[]): Set<string>;
14
+ /** Schema properties that no step binds yet, in schema order. */
15
+ export declare function listUnboundProperties(jsonSchema: RJSFSchema, steps: EditableFormTemplateStep[]): ResolvedSchemaProperty[];
16
+ /** Add an unbound text property with a generated key and open it for editing. */
17
+ export declare function createField(state: FormTemplateDraftState): FormTemplateDraftState;
18
+ /**
19
+ * Rename a property's key everywhere it's referenced: the schema, every step field bound to it, and
20
+ * the drawer editing it. A no-op if `oldKey` doesn't exist or `newKey` is already taken.
21
+ */
22
+ export declare function renamePropertyKey(state: FormTemplateDraftState, oldKey: string, newKey: string): FormTemplateDraftState;
23
+ /**
24
+ * Merge `patch` into a property's definition. While the key still matches what the old title
25
+ * generates, a title change renames the key to follow it, like a slug; once the key has been
26
+ * edited by hand it stays put.
27
+ */
28
+ export declare function updateProperty(state: FormTemplateDraftState, key: string, patch: Partial<RJSFSchema>): FormTemplateDraftState;
29
+ /** Replace a property's whole definition, keeping its context and required-ness. */
30
+ export declare function replaceProperty(state: FormTemplateDraftState, key: string, next: RJSFSchema): FormTemplateDraftState;
31
+ export declare function changeRequired(state: FormTemplateDraftState, key: string, isRequired: boolean): FormTemplateDraftState;
32
+ export declare function changeContext(state: FormTemplateDraftState, key: string, context: SchemaPropertyContext): FormTemplateDraftState;
33
+ /** Remove a property from the schema, unbind it from every step, and close its drawer. */
34
+ export declare function removeProperty(state: FormTemplateDraftState, key: string): FormTemplateDraftState;
35
+ /** Move the step at `fromIndex` so it ends up at `toIndex`. A no-op for out-of-range indices. */
36
+ export declare function moveStep(state: FormTemplateDraftState, fromIndex: number, toIndex: number): FormTemplateDraftState;
37
+ /**
38
+ * Move the field bound to `schemaPath` into the step identified by `toStepKey` so it ends up at
39
+ * `toIndex` there (clamped to the end), whether or not that is the step it came from. A no-op if
40
+ * no step binds `schemaPath` or no step has `toStepKey`.
41
+ */
42
+ export declare function moveSlot(state: FormTemplateDraftState, schemaPath: string, toStepKey: string, toIndex: number): FormTemplateDraftState;
43
+ /**
44
+ * Append a field bound to `propertyKey` to the step identified by `stepKey`. A no-op if that
45
+ * property is already bound to any step (a property binds at most once) or no step has `stepKey`.
46
+ */
47
+ export declare function bindField(state: FormTemplateDraftState, propertyKey: string, stepKey: string): FormTemplateDraftState;
48
+ //# sourceMappingURL=formTemplateDraftState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formTemplateDraftState.d.ts","sourceRoot":"","sources":["../../../src/components/FormTemplateEditor/formTemplateDraftState.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAML,sBAAsB,EAEtB,qBAAqB,EAItB,MAAM,sCAAsC,CAAA;AAE7C,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAA;AAElD,MAAM,MAAM,sBAAsB,GAAG;IACnC,UAAU,EAAE,UAAU,CAAA;IACtB,KAAK,EAAE,wBAAwB,EAAE,CAAA;IACjC,gEAAgE;IAChE,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAA;CAClC,CAAA;AAED,eAAO,MAAM,eAAe,cAAc,CAAA;AAE1C,wBAAgB,kBA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AE,MAAM,GACd,sBAAsB,CASxB;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CACtB,KAAK,EAAE,sBAAsB,EAC7B,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GACd,sBAAsB,CAiBxB;AAED;;;GAGG;AACH,wBAAgB,SAAS,CACvB,KAAK,EAAE,sBAAsB,EAC7B,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,GACd,sBAAsB,CAsBxB"}
@@ -0,0 +1,126 @@
1
+ import { listResolvedSchemaProperties as e, propertyKeyToPointer as t, removeSchemaProperty as n, renameSchemaProperty as r, replaceSchemaPropertyDefinition as i, resolveSchemaPropertyAtPointer as a, setSchemaProperty as o, setSchemaPropertyContext as s, setSchemaPropertyRequired as c } from "../../utils/jsonschema/submissionContext.js";
2
+ import { generatePropertyKey as l } from "./schemaFieldUtils.js";
3
+ //#region src/components/FormTemplateEditor/formTemplateDraftState.ts
4
+ var u = "New field";
5
+ function d(t) {
6
+ return new Set(e(t).map((e) => e.propertyKey));
7
+ }
8
+ function f(e) {
9
+ return new Set(e.flatMap((e) => e.fields.map((e) => e.schemaPath)));
10
+ }
11
+ function p(n, r) {
12
+ let i = f(r);
13
+ return e(n).filter((e) => !i.has(t(e.propertyKey)));
14
+ }
15
+ function m(e) {
16
+ let t = l(u, d(e.jsonSchema));
17
+ return {
18
+ ...e,
19
+ jsonSchema: o(e.jsonSchema, t, {
20
+ type: "string",
21
+ title: u,
22
+ description: ""
23
+ }, "ALWAYS"),
24
+ editingPropertyKey: t
25
+ };
26
+ }
27
+ function h(e, n, i) {
28
+ let a = d(e.jsonSchema);
29
+ if (i === n || !a.has(n) || a.has(i)) return e;
30
+ let o = t(n), s = t(i);
31
+ return {
32
+ jsonSchema: r(e.jsonSchema, n, i),
33
+ steps: e.steps.map((e) => ({
34
+ ...e,
35
+ fields: e.fields.map((e) => e.schemaPath === o ? {
36
+ ...e,
37
+ schemaPath: s
38
+ } : e)
39
+ })),
40
+ editingPropertyKey: e.editingPropertyKey === n ? i : e.editingPropertyKey
41
+ };
42
+ }
43
+ function g(e, n, r) {
44
+ let o = a(e.jsonSchema, t(n));
45
+ if (!o) return e;
46
+ let s = {
47
+ ...e,
48
+ jsonSchema: i(e.jsonSchema, n, {
49
+ ...o.subSchema,
50
+ ...r
51
+ })
52
+ };
53
+ if (typeof r.title != "string") return s;
54
+ let c = d(e.jsonSchema);
55
+ return c.delete(n), l(o.subSchema.title ?? "", c) === n ? h(s, n, l(r.title, c)) : s;
56
+ }
57
+ function _(e, t, n) {
58
+ return {
59
+ ...e,
60
+ jsonSchema: i(e.jsonSchema, t, n)
61
+ };
62
+ }
63
+ function v(e, n, r) {
64
+ let i = a(e.jsonSchema, t(n))?.context ?? "ALWAYS";
65
+ return {
66
+ ...e,
67
+ jsonSchema: c(e.jsonSchema, n, i, r)
68
+ };
69
+ }
70
+ function y(e, t, n) {
71
+ return {
72
+ ...e,
73
+ jsonSchema: s(e.jsonSchema, t, n)
74
+ };
75
+ }
76
+ function b(e, r) {
77
+ let i = t(r);
78
+ return {
79
+ jsonSchema: n(e.jsonSchema, r),
80
+ steps: e.steps.map((e) => ({
81
+ ...e,
82
+ fields: e.fields.filter((e) => e.schemaPath !== i)
83
+ })),
84
+ editingPropertyKey: e.editingPropertyKey === r ? null : e.editingPropertyKey
85
+ };
86
+ }
87
+ function x(e, t, n) {
88
+ let { steps: r } = e, i = (e) => e >= 0 && e < r.length;
89
+ if (t === n || !i(t) || !i(n)) return e;
90
+ let a = r.slice();
91
+ return a.splice(n, 0, ...a.splice(t, 1)), {
92
+ ...e,
93
+ steps: a
94
+ };
95
+ }
96
+ function S(e, t, n, r) {
97
+ let i = e.steps.flatMap((e) => e.fields).find((e) => e.schemaPath === t);
98
+ return !i || !e.steps.some((e) => e.uiKey === n) ? e : {
99
+ ...e,
100
+ steps: e.steps.map((e) => {
101
+ let a = e.fields.filter((e) => e.schemaPath !== t);
102
+ return e.uiKey === n && a.splice(Math.max(0, r), 0, i), {
103
+ ...e,
104
+ fields: a
105
+ };
106
+ })
107
+ };
108
+ }
109
+ function C(e, n, r) {
110
+ let i = t(n);
111
+ return f(e.steps).has(i) || !e.steps.some((e) => e.uiKey === r) ? e : {
112
+ ...e,
113
+ steps: e.steps.map((e) => e.uiKey === r ? {
114
+ ...e,
115
+ fields: [...e.fields, {
116
+ schemaPath: i,
117
+ uiDefinition: {},
118
+ isPublic: !1
119
+ }]
120
+ } : e)
121
+ };
122
+ }
123
+ //#endregion
124
+ export { u as NEW_FIELD_TITLE, C as bindField, f as boundSchemaPaths, y as changeContext, v as changeRequired, m as createField, p as listUnboundProperties, S as moveSlot, x as moveStep, b as removeProperty, h as renamePropertyKey, _ as replaceProperty, d as schemaPropertyKeys, g as updateProperty };
125
+
126
+ //# sourceMappingURL=formTemplateDraftState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formTemplateDraftState.js","names":[],"sources":["../../../src/components/FormTemplateEditor/formTemplateDraftState.ts"],"sourcesContent":["/*\n * Pure transitions over a FormTemplate draft: the in-progress JSON Schema body, the step structure,\n * and the property open for editing. Every transition keeps the three in sync (renaming a property\n * key rewrites every step field bound to it, removing a property unbinds it from every step, etc).\n */\nimport { RJSFSchema } from '@rjsf/utils'\nimport {\n listResolvedSchemaProperties,\n propertyKeyToPointer,\n removeSchemaProperty,\n renameSchemaProperty,\n replaceSchemaPropertyDefinition,\n ResolvedSchemaProperty,\n resolveSchemaPropertyAtPointer,\n SchemaPropertyContext,\n setSchemaProperty,\n setSchemaPropertyContext,\n setSchemaPropertyRequired,\n} from '@/utils/jsonschema/submissionContext'\nimport { generatePropertyKey } from './schemaFieldUtils'\nimport { EditableFormTemplateStep } from './utils'\n\nexport type FormTemplateDraftState = {\n jsonSchema: RJSFSchema\n steps: EditableFormTemplateStep[]\n /** The property open in the field definition drawer, if any. */\n editingPropertyKey: string | null\n}\n\nexport const NEW_FIELD_TITLE = 'New field'\n\nexport function schemaPropertyKeys(jsonSchema: RJSFSchema): Set<string> {\n return new Set(\n listResolvedSchemaProperties(jsonSchema).map(p => p.propertyKey),\n )\n}\n\n/** The `schemaPath` of every field bound to a step. */\nexport function boundSchemaPaths(\n steps: EditableFormTemplateStep[],\n): Set<string> {\n return new Set(steps.flatMap(step => step.fields.map(f => f.schemaPath)))\n}\n\n/** Schema properties that no step binds yet, in schema order. */\nexport function listUnboundProperties(\n jsonSchema: RJSFSchema,\n steps: EditableFormTemplateStep[],\n): ResolvedSchemaProperty[] {\n const bound = boundSchemaPaths(steps)\n return listResolvedSchemaProperties(jsonSchema).filter(\n p => !bound.has(propertyKeyToPointer(p.propertyKey)),\n )\n}\n\n/** Add an unbound text property with a generated key and open it for editing. */\nexport function createField(\n state: FormTemplateDraftState,\n): FormTemplateDraftState {\n const key = generatePropertyKey(\n NEW_FIELD_TITLE,\n schemaPropertyKeys(state.jsonSchema),\n )\n return {\n ...state,\n jsonSchema: setSchemaProperty(\n state.jsonSchema,\n key,\n { type: 'string', title: NEW_FIELD_TITLE, description: '' },\n 'ALWAYS',\n ),\n editingPropertyKey: key,\n }\n}\n\n/**\n * Rename a property's key everywhere it's referenced: the schema, every step field bound to it, and\n * the drawer editing it. A no-op if `oldKey` doesn't exist or `newKey` is already taken.\n */\nexport function renamePropertyKey(\n state: FormTemplateDraftState,\n oldKey: string,\n newKey: string,\n): FormTemplateDraftState {\n const keys = schemaPropertyKeys(state.jsonSchema)\n if (newKey === oldKey || !keys.has(oldKey) || keys.has(newKey)) return state\n const oldPath = propertyKeyToPointer(oldKey)\n const newPath = propertyKeyToPointer(newKey)\n return {\n jsonSchema: renameSchemaProperty(state.jsonSchema, oldKey, newKey),\n steps: state.steps.map(step => ({\n ...step,\n fields: step.fields.map(f =>\n f.schemaPath === oldPath ? { ...f, schemaPath: newPath } : f,\n ),\n })),\n editingPropertyKey:\n state.editingPropertyKey === oldKey ? newKey : state.editingPropertyKey,\n }\n}\n\n/**\n * Merge `patch` into a property's definition. While the key still matches what the old title\n * generates, a title change renames the key to follow it, like a slug; once the key has been\n * edited by hand it stays put.\n */\nexport function updateProperty(\n state: FormTemplateDraftState,\n key: string,\n patch: Partial<RJSFSchema>,\n): FormTemplateDraftState {\n const resolved = resolveSchemaPropertyAtPointer(\n state.jsonSchema,\n propertyKeyToPointer(key),\n )\n if (!resolved) return state\n const updated: FormTemplateDraftState = {\n ...state,\n jsonSchema: replaceSchemaPropertyDefinition(state.jsonSchema, key, {\n ...resolved.subSchema,\n ...patch,\n }),\n }\n if (typeof patch.title !== 'string') return updated\n\n const otherKeys = schemaPropertyKeys(state.jsonSchema)\n otherKeys.delete(key)\n const keyFollowsTitle =\n generatePropertyKey(resolved.subSchema.title ?? '', otherKeys) === key\n return keyFollowsTitle\n ? renamePropertyKey(\n updated,\n key,\n generatePropertyKey(patch.title, otherKeys),\n )\n : updated\n}\n\n/** Replace a property's whole definition, keeping its context and required-ness. */\nexport function replaceProperty(\n state: FormTemplateDraftState,\n key: string,\n next: RJSFSchema,\n): FormTemplateDraftState {\n return {\n ...state,\n jsonSchema: replaceSchemaPropertyDefinition(state.jsonSchema, key, next),\n }\n}\n\nexport function changeRequired(\n state: FormTemplateDraftState,\n key: string,\n isRequired: boolean,\n): FormTemplateDraftState {\n const context =\n resolveSchemaPropertyAtPointer(state.jsonSchema, propertyKeyToPointer(key))\n ?.context ?? 'ALWAYS'\n return {\n ...state,\n jsonSchema: setSchemaPropertyRequired(\n state.jsonSchema,\n key,\n context,\n isRequired,\n ),\n }\n}\n\nexport function changeContext(\n state: FormTemplateDraftState,\n key: string,\n context: SchemaPropertyContext,\n): FormTemplateDraftState {\n return {\n ...state,\n jsonSchema: setSchemaPropertyContext(state.jsonSchema, key, context),\n }\n}\n\n/** Remove a property from the schema, unbind it from every step, and close its drawer. */\nexport function removeProperty(\n state: FormTemplateDraftState,\n key: string,\n): FormTemplateDraftState {\n const path = propertyKeyToPointer(key)\n return {\n jsonSchema: removeSchemaProperty(state.jsonSchema, key),\n steps: state.steps.map(step => ({\n ...step,\n fields: step.fields.filter(f => f.schemaPath !== path),\n })),\n editingPropertyKey:\n state.editingPropertyKey === key ? null : state.editingPropertyKey,\n }\n}\n\n/** Move the step at `fromIndex` so it ends up at `toIndex`. A no-op for out-of-range indices. */\nexport function moveStep(\n state: FormTemplateDraftState,\n fromIndex: number,\n toIndex: number,\n): FormTemplateDraftState {\n const { steps } = state\n const inRange = (i: number) => i >= 0 && i < steps.length\n if (fromIndex === toIndex || !inRange(fromIndex) || !inRange(toIndex)) {\n return state\n }\n const next = steps.slice()\n next.splice(toIndex, 0, ...next.splice(fromIndex, 1))\n return { ...state, steps: next }\n}\n\n/**\n * Move the field bound to `schemaPath` into the step identified by `toStepKey` so it ends up at\n * `toIndex` there (clamped to the end), whether or not that is the step it came from. A no-op if\n * no step binds `schemaPath` or no step has `toStepKey`.\n */\nexport function moveSlot(\n state: FormTemplateDraftState,\n schemaPath: string,\n toStepKey: string,\n toIndex: number,\n): FormTemplateDraftState {\n const field = state.steps\n .flatMap(step => step.fields)\n .find(f => f.schemaPath === schemaPath)\n if (!field || !state.steps.some(step => step.uiKey === toStepKey)) {\n return state\n }\n return {\n ...state,\n steps: state.steps.map(step => {\n const fields = step.fields.filter(f => f.schemaPath !== schemaPath)\n if (step.uiKey === toStepKey) {\n fields.splice(Math.max(0, toIndex), 0, field)\n }\n return { ...step, fields }\n }),\n }\n}\n\n/**\n * Append a field bound to `propertyKey` to the step identified by `stepKey`. A no-op if that\n * property is already bound to any step (a property binds at most once) or no step has `stepKey`.\n */\nexport function bindField(\n state: FormTemplateDraftState,\n propertyKey: string,\n stepKey: string,\n): FormTemplateDraftState {\n const path = propertyKeyToPointer(propertyKey)\n if (\n boundSchemaPaths(state.steps).has(path) ||\n !state.steps.some(step => step.uiKey === stepKey)\n ) {\n return state\n }\n return {\n ...state,\n steps: state.steps.map(step =>\n step.uiKey === stepKey\n ? {\n ...step,\n fields: [\n ...step.fields,\n { schemaPath: path, uiDefinition: {}, isPublic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AAO,EAAM,MAAM;CAEzB,OADA,EAAK,OAAO,GAAS,GAAG,GAAG,EAAK,OAAO,GAAW,CAAC,CAAC,GAC7C;EAAE,GAAG;EAAO,OAAO;CAAK;AACjC;AAOA,SAAgB,EACd,GACA,GACA,GACA,GACwB;CACxB,IAAM,IAAQ,EAAM,MACjB,SAAQ,MAAQ,EAAK,MAAM,EAC3B,MAAK,MAAK,EAAE,eAAe,CAAU;CAIxC,OAHI,CAAC,KAAS,CAAC,EAAM,MAAM,MAAK,MAAQ,EAAK,UAAU,CAAS,IACvD,IAEF;EACL,GAAG;EACH,OAAO,EAAM,MAAM,KAAI,MAAQ;GAC7B,IAAM,IAAS,EAAK,OAAO,QAAO,MAAK,EAAE,eAAe,CAAU;GAIlE,OAHI,EAAK,UAAU,KACjB,EAAO,OAAO,KAAK,IAAI,GAAG,CAAO,GAAG,GAAG,CAAK,GAEvC;IAAE,GAAG;IAAM;GAAO;EAC3B,CAAC;CACH;AACF;AAMA,SAAgB,EACd,GACA,GACA,GACwB;CACxB,IAAM,IAAO,EAAqB,CAAW;CAO7C,OALE,EAAiB,EAAM,KAAK,EAAE,IAAI,CAAI,KACtC,CAAC,EAAM,MAAM,MAAK,MAAQ,EAAK,UAAU,CAAO,IAEzC,IAEF;EACL,GAAG;EACH,OAAO,EAAM,MAAM,KAAI,MACrB,EAAK,UAAU,IACX;GACE,GAAG;GACH,QAAQ,CACN,GAAG,EAAK,QACR;IAAE,YAAY;IAAM,cAAc,CAAC;IAAG,UAAU;GAAM,CACxD;EACF,IACA,CACN;CACF;AACF"}
@@ -0,0 +1,35 @@
1
+ import { RJSFSchema } from '@rjsf/utils';
2
+ import { JsonSchemaVersionInfo } from '@sage-bionetworks/synapse-client';
3
+ /**
4
+ * The registered schema every FormTemplate schema extends. It declares the reserved
5
+ * `x-synapse-submissionContext` property. The version is pinned: moving to a newer base schema
6
+ * requires deciding how templates that reference this version are migrated.
7
+ */
8
+ export declare const ACCESS_REQUIREMENT_BASE_SCHEMA_ID = "org.sagebionetworks-AccessRequirementBaseSchema-1.0.0";
9
+ /** The JSON Schema organization that FormTemplate schemas are registered under. */
10
+ export declare const FORM_TEMPLATE_SCHEMA_ORGANIZATION = "org.sagebionetworks.act";
11
+ /** A registered schema's name, qualified by its organization; every version shares it. */
12
+ export type SchemaName = {
13
+ organizationName: string;
14
+ schemaName: string;
15
+ };
16
+ /**
17
+ * The organization and schema name that a template's schema versions are registered under.
18
+ * An existing template keeps those of the schema it already references, so renaming the
19
+ * template does not start registering under a new schema name. A new template derives the
20
+ * schema name from its name.
21
+ */
22
+ export declare function resolveFormTemplateSchemaName(templateName: string, existingSchema$id?: string): SchemaName;
23
+ /**
24
+ * The `$id` of a schema version: `<organization>-<schemaName>-<version>`. Without a version,
25
+ * the unversioned `<organization>-<schemaName>` prefix shared by every version.
26
+ */
27
+ export declare function formatSchema$id(name: SchemaName, version?: string): string;
28
+ /**
29
+ * The version to register next under a schema name: one major version above the highest
30
+ * registered version, or `1.0.0` when none is registered yet.
31
+ */
32
+ export declare function getNextSchemaVersion(registeredVersions: JsonSchemaVersionInfo[]): string;
33
+ /** The schema a new FormTemplate starts from: no fields beyond those of the base schema. */
34
+ export declare function createNewFormTemplateSchema(): RJSFSchema;
35
+ //# sourceMappingURL=formTemplateSchema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formTemplateSchema.d.ts","sourceRoot":"","sources":["../../../src/components/FormTemplateEditor/formTemplateSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExC,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAA;AAExE;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,0DACW,CAAA;AAEzD,mFAAmF;AACnF,eAAO,MAAM,iCAAiC,4BAA4B,CAAA;AAI1E,0FAA0F;AAC1F,MAAM,MAAM,UAAU,GAAG;IAAE,gBAAgB,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAA;AAEzE;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAC3C,YAAY,EAAE,MAAM,EACpB,iBAAiB,CAAC,EAAE,MAAM,GACzB,UAAU,CAeZ;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,MAAM,UAGjE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,kBAAkB,EAAE,qBAAqB,EAAE,GAC1C,MAAM,CAQR;AAED,4FAA4F;AAC5F,wBAAgB,2BAA2B,IAAI,UAAU,CAMxD"}
@@ -0,0 +1,35 @@
1
+ import { toPascalCase as e } from "../../utils/functions/toPascalCase.js";
2
+ //#region src/components/FormTemplateEditor/formTemplateSchema.ts
3
+ var t = "org.sagebionetworks-AccessRequirementBaseSchema-1.0.0", n = "org.sagebionetworks.act", r = "FormTemplate";
4
+ function i(t, i) {
5
+ if (i) {
6
+ let [e, t] = i.split("-");
7
+ return {
8
+ organizationName: e,
9
+ schemaName: t
10
+ };
11
+ }
12
+ let a = e(t);
13
+ return {
14
+ organizationName: n,
15
+ schemaName: /^[A-Za-z]/.test(a) ? a : `${r}${a}`
16
+ };
17
+ }
18
+ function a(e, t) {
19
+ let n = `${e.organizationName}-${e.schemaName}`;
20
+ return t ? `${n}-${t}` : n;
21
+ }
22
+ function o(e) {
23
+ return `${Math.max(0, ...e.map((e) => Number.parseInt(e.semanticVersion?.split(".")[0] ?? "0", 10))) + 1}.0.0`;
24
+ }
25
+ function s() {
26
+ return {
27
+ $schema: "http://json-schema.org/draft-07/schema#",
28
+ type: "object",
29
+ allOf: [{ $ref: t }]
30
+ };
31
+ }
32
+ //#endregion
33
+ export { t as ACCESS_REQUIREMENT_BASE_SCHEMA_ID, n as FORM_TEMPLATE_SCHEMA_ORGANIZATION, s as createNewFormTemplateSchema, a as formatSchema$id, o as getNextSchemaVersion, i as resolveFormTemplateSchemaName };
34
+
35
+ //# sourceMappingURL=formTemplateSchema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formTemplateSchema.js","names":[],"sources":["../../../src/components/FormTemplateEditor/formTemplateSchema.ts"],"sourcesContent":["import { RJSFSchema } from '@rjsf/utils'\nimport { toPascalCase } from '@/utils/functions/toPascalCase'\nimport { JsonSchemaVersionInfo } from '@sage-bionetworks/synapse-client'\n\n/**\n * The registered schema every FormTemplate schema extends. It declares the reserved\n * `x-synapse-submissionContext` property. The version is pinned: moving to a newer base schema\n * requires deciding how templates that reference this version are migrated.\n */\nexport const ACCESS_REQUIREMENT_BASE_SCHEMA_ID =\n 'org.sagebionetworks-AccessRequirementBaseSchema-1.0.0'\n\n/** The JSON Schema organization that FormTemplate schemas are registered under. */\nexport const FORM_TEMPLATE_SCHEMA_ORGANIZATION = 'org.sagebionetworks.act'\n\nconst FALLBACK_SCHEMA_NAME = 'FormTemplate'\n\n/** A registered schema's name, qualified by its organization; every version shares it. */\nexport type SchemaName = { organizationName: string; schemaName: string }\n\n/**\n * The organization and schema name that a template's schema versions are registered under.\n * An existing template keeps those of the schema it already references, so renaming the\n * template does not start registering under a new schema name. A new template derives the\n * schema name from its name.\n */\nexport function resolveFormTemplateSchemaName(\n templateName: string,\n existingSchema$id?: string,\n): SchemaName {\n if (existingSchema$id) {\n // A schema $id is `<organization>-<schemaName>-<version>`; neither of the first two may\n // contain a dash.\n const [organizationName, schemaName] = existingSchema$id.split('-')\n return { organizationName, schemaName }\n }\n // Schema names only allow letters and digits and must start with a letter.\n const pascalCase = toPascalCase(templateName)\n return {\n organizationName: FORM_TEMPLATE_SCHEMA_ORGANIZATION,\n schemaName: /^[A-Za-z]/.test(pascalCase)\n ? pascalCase\n : `${FALLBACK_SCHEMA_NAME}${pascalCase}`,\n }\n}\n\n/**\n * The `$id` of a schema version: `<organization>-<schemaName>-<version>`. Without a version,\n * the unversioned `<organization>-<schemaName>` prefix shared by every version.\n */\nexport function formatSchema$id(name: SchemaName, version?: string) {\n const unversioned$id = `${name.organizationName}-${name.schemaName}`\n return version ? `${unversioned$id}-${version}` : unversioned$id\n}\n\n/**\n * The version to register next under a schema name: one major version above the highest\n * registered version, or `1.0.0` when none is registered yet.\n */\nexport function getNextSchemaVersion(\n registeredVersions: JsonSchemaVersionInfo[],\n): string {\n const highestMajor = Math.max(\n 0,\n ...registeredVersions.map(v =>\n Number.parseInt(v.semanticVersion?.split('.')[0] ?? '0', 10),\n ),\n )\n return `${highestMajor + 1}.0.0`\n}\n\n/** The schema a new FormTemplate starts from: no fields beyond those of the base schema. */\nexport function createNewFormTemplateSchema(): RJSFSchema {\n return {\n $schema: 'http://json-schema.org/draft-07/schema#',\n type: 'object',\n allOf: [{ $ref: ACCESS_REQUIREMENT_BASE_SCHEMA_ID }],\n }\n}\n"],"mappings":";;AASA,IAAa,IACX,yDAGW,IAAoC,2BAE3C,IAAuB;AAW7B,SAAgB,EACd,GACA,GACY;CACZ,IAAI,GAAmB;EAGrB,IAAM,CAAC,GAAkB,KAAc,EAAkB,MAAM,GAAG;EAClE,OAAO;GAAE;GAAkB;EAAW;CACxC;CAEA,IAAM,IAAa,EAAa,CAAY;CAC5C,OAAO;EACL,kBAAkB;EAClB,YAAY,YAAY,KAAK,CAAU,IACnC,IACA,GAAG,IAAuB;CAChC;AACF;AAMA,SAAgB,EAAgB,GAAkB,GAAkB;CAClE,IAAM,IAAiB,GAAG,EAAK,iBAAiB,GAAG,EAAK;CACxD,OAAO,IAAU,GAAG,EAAe,GAAG,MAAY;AACpD;AAMA,SAAgB,EACd,GACQ;CAOR,OAAO,GANc,KAAK,IACxB,GACA,GAAG,EAAmB,KAAI,MACxB,OAAO,SAAS,EAAE,iBAAiB,MAAM,GAAG,EAAE,MAAM,KAAK,EAAE,CAC7D,CAEQ,IAAe,EAAE;AAC7B;AAGA,SAAgB,IAA0C;CACxD,OAAO;EACL,SAAS;EACT,MAAM;EACN,OAAO,CAAC,EAAE,MAAM,EAAkC,CAAC;CACrD;AACF"}
@@ -4,13 +4,15 @@ import { RJSFSchema } from '@rjsf/utils';
4
4
  * outside this set surfaces in the UI as "advanced" and must be edited via the
5
5
  * raw JSON Schema view.
6
6
  */
7
- export type SimpleFieldType = 'text' | 'number' | 'boolean' | 'choice' | 'file';
7
+ export type SimpleFieldType = 'text' | 'number' | 'boolean' | 'choice' | 'multiChoice' | 'file';
8
8
  export declare const FIELD_TYPE_OPTIONS: {
9
9
  value: SimpleFieldType;
10
10
  label: string;
11
11
  }[];
12
12
  export declare function detectFieldType(prop: RJSFSchema | undefined): SimpleFieldType | null;
13
13
  export declare function fieldTypeLabel(type: SimpleFieldType | null): string;
14
+ /** The options a 'choice' (`enum`) or 'multiChoice' (`items.enum`) property declares; empty if none. */
15
+ export declare function choiceOptions(prop: RJSFSchema): string[];
14
16
  /** Build a fresh schema body for the given simple type, preserving label and help text. */
15
17
  export declare function applyFieldType(prev: RJSFSchema, type: SimpleFieldType): RJSFSchema;
16
18
  /** Derive a unique camelCase JSON property key from a display title. */
@@ -1 +1 @@
1
- {"version":3,"file":"schemaFieldUtils.d.ts","sourceRoot":"","sources":["../../../src/components/FormTemplateEditor/schemaFieldUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExC;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAA;AAE/E,eAAO,MAAM,kBAAkB,EAAE;IAAE,KAAK,EAAE,eAAe,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAMzE,CAAA;AAED,wBAAgB,eAAe,CAC7B,IAAI,EAAE,UAAU,GAAG,SAAS,GAC3B,eAAe,GAAG,IAAI,CAQxB;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI,GAAG,MAAM,CAGnE;AAED,2FAA2F;AAC3F,wBAAgB,cAAc,CAC5B,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,eAAe,GACpB,UAAU,CA4BZ;AAED,wEAAwE;AACxE,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,EACb,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,GACxB,MAAM,CAiBR;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAGvD"}
1
+ {"version":3,"file":"schemaFieldUtils.d.ts","sourceRoot":"","sources":["../../../src/components/FormTemplateEditor/schemaFieldUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExC;;;;GAIG;AACH,MAAM,MAAM,eAAe,GACvB,MAAM,GACN,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,aAAa,GACb,MAAM,CAAA;AAEV,eAAO,MAAM,kBAAkB,EAAE;IAAE,KAAK,EAAE,eAAe,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAOzE,CAAA;AAED,wBAAgB,eAAe,CAC7B,IAAI,EAAE,UAAU,GAAG,SAAS,GAC3B,eAAe,GAAG,IAAI,CAmBxB;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI,GAAG,MAAM,CAGnE;AAED,wGAAwG;AACxG,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,EAAE,CAGxD;AAED,2FAA2F;AAC3F,wBAAgB,cAAc,CAC5B,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,eAAe,GACpB,UAAU,CAiCZ;AAED,wEAAwE;AACxE,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,EACb,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,GACxB,MAAM,CAiBR;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAGvD"}
@@ -14,7 +14,11 @@ var e = [
14
14
  },
15
15
  {
16
16
  value: "choice",
17
- label: "Multiple choice"
17
+ label: "Single choice"
18
+ },
19
+ {
20
+ value: "multiChoice",
21
+ label: "Multiple choice (select many)"
18
22
  },
19
23
  {
20
24
  value: "file",
@@ -22,16 +26,24 @@ var e = [
22
26
  }
23
27
  ];
24
28
  function t(e) {
25
- return !e || typeof e != "object" ? null : e.format === "synapse-filehandle-id" ? "file" : e.type === "string" && Array.isArray(e.enum) ? "choice" : e.type === "string" && !e.format ? "text" : e.type === "number" || e.type === "integer" ? "number" : e.type === "boolean" ? "boolean" : null;
29
+ if (!e || typeof e != "object") return null;
30
+ if (e.format === "synapse-filehandle-id") return "file";
31
+ if (e.type === "string" && Array.isArray(e.enum)) return "choice";
32
+ let t = e.items;
33
+ return e.type === "array" && e.uniqueItems === !0 && t?.type === "string" && Array.isArray(t.enum) ? "multiChoice" : e.type === "string" && !e.format ? "text" : e.type === "number" || e.type === "integer" ? "number" : e.type === "boolean" ? "boolean" : null;
26
34
  }
27
35
  function n(t) {
28
36
  return t === null ? "Advanced" : e.find((e) => e.value === t)?.label ?? "Advanced";
29
37
  }
30
- function r(e, t) {
38
+ function r(e) {
39
+ let t = e.enum ?? e.items?.enum;
40
+ return Array.isArray(t) ? t : [];
41
+ }
42
+ function i(e, t) {
31
43
  let n = {
32
44
  title: e.title,
33
45
  description: e.description
34
- };
46
+ }, i = r(e), a = i.length > 0 ? i : ["Option 1"];
35
47
  switch (t) {
36
48
  case "text":
37
49
  n.type = "string";
@@ -43,7 +55,13 @@ function r(e, t) {
43
55
  n.type = "boolean";
44
56
  break;
45
57
  case "choice":
46
- n.type = "string", n.enum = Array.isArray(e.enum) && e.enum.length > 0 ? e.enum : ["Option 1"];
58
+ n.type = "string", n.enum = a;
59
+ break;
60
+ case "multiChoice":
61
+ n.type = "array", n.items = {
62
+ type: "string",
63
+ enum: a
64
+ }, n.uniqueItems = !0;
47
65
  break;
48
66
  case "file":
49
67
  n.type = "number", n.format = "synapse-filehandle-id";
@@ -51,16 +69,16 @@ function r(e, t) {
51
69
  }
52
70
  return n;
53
71
  }
54
- function i(e, t) {
72
+ function a(e, t) {
55
73
  let n = e.toLowerCase().replace(/[^a-z0-9\s]/g, "").trim().split(/\s+/).filter(Boolean).map((e, t) => t === 0 ? e : e.charAt(0).toUpperCase() + e.slice(1)).join("") || "field", r = n, i = 1;
56
74
  for (; t.has(r);) i += 1, r = `${n}${i}`;
57
75
  return r;
58
76
  }
59
- function a(e) {
77
+ function o(e) {
60
78
  let t = e.replace(/[^A-Za-z0-9_]/g, "");
61
79
  return /^[0-9]/.test(t) ? `_${t}` : t;
62
80
  }
63
81
  //#endregion
64
- export { e as FIELD_TYPE_OPTIONS, r as applyFieldType, t as detectFieldType, n as fieldTypeLabel, i as generatePropertyKey, a as sanitizePropertyKey };
82
+ export { e as FIELD_TYPE_OPTIONS, i as applyFieldType, r as choiceOptions, t as detectFieldType, n as fieldTypeLabel, a as generatePropertyKey, o as sanitizePropertyKey };
65
83
 
66
84
  //# sourceMappingURL=schemaFieldUtils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"schemaFieldUtils.js","names":[],"sources":["../../../src/components/FormTemplateEditor/schemaFieldUtils.ts"],"sourcesContent":["import { RJSFSchema } from '@rjsf/utils'\n\n/**\n * The set of property shapes the simple editor knows how to author. Anything\n * outside this set surfaces in the UI as \"advanced\" and must be edited via the\n * raw JSON Schema view.\n */\nexport type SimpleFieldType = 'text' | 'number' | 'boolean' | 'choice' | 'file'\n\nexport const FIELD_TYPE_OPTIONS: { value: SimpleFieldType; label: string }[] = [\n { value: 'text', label: 'Text' },\n { value: 'number', label: 'Number' },\n { value: 'boolean', label: 'Yes / No' },\n { value: 'choice', label: 'Multiple choice' },\n { value: 'file', label: 'File upload' },\n]\n\nexport function detectFieldType(\n prop: RJSFSchema | undefined,\n): SimpleFieldType | null {\n if (!prop || typeof prop !== 'object') return null\n if (prop.format === 'synapse-filehandle-id') return 'file'\n if (prop.type === 'string' && Array.isArray(prop.enum)) return 'choice'\n if (prop.type === 'string' && !prop.format) return 'text'\n if (prop.type === 'number' || prop.type === 'integer') return 'number'\n if (prop.type === 'boolean') return 'boolean'\n return null\n}\n\nexport function fieldTypeLabel(type: SimpleFieldType | null): string {\n if (type === null) return 'Advanced'\n return FIELD_TYPE_OPTIONS.find(opt => opt.value === type)?.label ?? 'Advanced'\n}\n\n/** Build a fresh schema body for the given simple type, preserving label and help text. */\nexport function applyFieldType(\n prev: RJSFSchema,\n type: SimpleFieldType,\n): RJSFSchema {\n const next: RJSFSchema = {\n title: prev.title,\n description: prev.description,\n }\n switch (type) {\n case 'text':\n next.type = 'string'\n break\n case 'number':\n next.type = 'number'\n break\n case 'boolean':\n next.type = 'boolean'\n break\n case 'choice':\n next.type = 'string'\n next.enum =\n Array.isArray(prev.enum) && prev.enum.length > 0\n ? prev.enum\n : ['Option 1']\n break\n case 'file':\n next.type = 'number'\n next.format = 'synapse-filehandle-id'\n break\n }\n return next\n}\n\n/** Derive a unique camelCase JSON property key from a display title. */\nexport function generatePropertyKey(\n title: string,\n existingKeys: Set<string>,\n): string {\n const base =\n title\n .toLowerCase()\n .replace(/[^a-z0-9\\s]/g, '')\n .trim()\n .split(/\\s+/)\n .filter(Boolean)\n .map((w, i) => (i === 0 ? w : w.charAt(0).toUpperCase() + w.slice(1)))\n .join('') || 'field'\n let key = base\n let i = 1\n while (existingKeys.has(key)) {\n i += 1\n key = `${base}${i}`\n }\n return key\n}\n\n/**\n * Sanitize a manually-typed property key: strip characters that aren't\n * valid in a JSON Schema property key used as a JS identifier, preserving\n * the editor's casing (unlike `generatePropertyKey`, which derives a\n * camelCase key from a display title).\n */\nexport function sanitizePropertyKey(raw: string): string {\n const stripped = raw.replace(/[^A-Za-z0-9_]/g, '')\n return /^[0-9]/.test(stripped) ? `_${stripped}` : stripped\n}\n"],"mappings":";AASA,IAAa,IAAkE;CAC7E;EAAE,OAAO;EAAQ,OAAO;CAAO;CAC/B;EAAE,OAAO;EAAU,OAAO;CAAS;CACnC;EAAE,OAAO;EAAW,OAAO;CAAW;CACtC;EAAE,OAAO;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AO;AACT;AAQA,SAAgB,EAAoB,GAAqB;CACvD,IAAM,IAAW,EAAI,QAAQ,kBAAkB,EAAE;CACjD,OAAO,SAAS,KAAK,CAAQ,IAAI,IAAI,MAAa;AACpD"}
1
+ {"version":3,"file":"schemaFieldUtils.js","names":[],"sources":["../../../src/components/FormTemplateEditor/schemaFieldUtils.ts"],"sourcesContent":["import { RJSFSchema } from '@rjsf/utils'\n\n/**\n * The set of property shapes the simple editor knows how to author. Anything\n * outside this set surfaces in the UI as \"advanced\" and must be edited via the\n * raw JSON Schema view.\n */\nexport type SimpleFieldType =\n | 'text'\n | 'number'\n | 'boolean'\n | 'choice'\n | 'multiChoice'\n | 'file'\n\nexport const FIELD_TYPE_OPTIONS: { value: SimpleFieldType; label: string }[] = [\n { value: 'text', label: 'Text' },\n { value: 'number', label: 'Number' },\n { value: 'boolean', label: 'Yes / No' },\n { value: 'choice', label: 'Single choice' },\n { value: 'multiChoice', label: 'Multiple choice (select many)' },\n { value: 'file', label: 'File upload' },\n]\n\nexport function detectFieldType(\n prop: RJSFSchema | undefined,\n): SimpleFieldType | null {\n if (!prop || typeof prop !== 'object') return null\n if (prop.format === 'synapse-filehandle-id') return 'file'\n if (prop.type === 'string' && Array.isArray(prop.enum)) return 'choice'\n // RJSF renders an array as a multi-select only when `uniqueItems` is set; without it the\n // property renders as a repeatable list, which the simple editor does not author.\n const items = prop.items as RJSFSchema | undefined\n if (\n prop.type === 'array' &&\n prop.uniqueItems === true &&\n items?.type === 'string' &&\n Array.isArray(items.enum)\n ) {\n return 'multiChoice'\n }\n if (prop.type === 'string' && !prop.format) return 'text'\n if (prop.type === 'number' || prop.type === 'integer') return 'number'\n if (prop.type === 'boolean') return 'boolean'\n return null\n}\n\nexport function fieldTypeLabel(type: SimpleFieldType | null): string {\n if (type === null) return 'Advanced'\n return FIELD_TYPE_OPTIONS.find(opt => opt.value === type)?.label ?? 'Advanced'\n}\n\n/** The options a 'choice' (`enum`) or 'multiChoice' (`items.enum`) property declares; empty if none. */\nexport function choiceOptions(prop: RJSFSchema): string[] {\n const options = prop.enum ?? (prop.items as RJSFSchema | undefined)?.enum\n return Array.isArray(options) ? (options as string[]) : []\n}\n\n/** Build a fresh schema body for the given simple type, preserving label and help text. */\nexport function applyFieldType(\n prev: RJSFSchema,\n type: SimpleFieldType,\n): RJSFSchema {\n const next: RJSFSchema = {\n title: prev.title,\n description: prev.description,\n }\n const existingChoices = choiceOptions(prev)\n // A choice field needs at least one option to be answerable.\n const choices = existingChoices.length > 0 ? existingChoices : ['Option 1']\n switch (type) {\n case 'text':\n next.type = 'string'\n break\n case 'number':\n next.type = 'number'\n break\n case 'boolean':\n next.type = 'boolean'\n break\n case 'choice':\n next.type = 'string'\n next.enum = choices\n break\n case 'multiChoice':\n next.type = 'array'\n next.items = { type: 'string', enum: choices }\n next.uniqueItems = true\n break\n case 'file':\n next.type = 'number'\n next.format = 'synapse-filehandle-id'\n break\n }\n return next\n}\n\n/** Derive a unique camelCase JSON property key from a display title. */\nexport function generatePropertyKey(\n title: string,\n existingKeys: Set<string>,\n): string {\n const base =\n title\n .toLowerCase()\n .replace(/[^a-z0-9\\s]/g, '')\n .trim()\n .split(/\\s+/)\n .filter(Boolean)\n .map((w, i) => (i === 0 ? w : w.charAt(0).toUpperCase() + w.slice(1)))\n .join('') || 'field'\n let key = base\n let i = 1\n while (existingKeys.has(key)) {\n i += 1\n key = `${base}${i}`\n }\n return key\n}\n\n/**\n * Sanitize a manually-typed property key: strip characters that aren't\n * valid in a JSON Schema property key used as a JS identifier, preserving\n * the editor's casing (unlike `generatePropertyKey`, which derives a\n * camelCase key from a display title).\n */\nexport function sanitizePropertyKey(raw: string): string {\n const stripped = raw.replace(/[^A-Za-z0-9_]/g, '')\n return /^[0-9]/.test(stripped) ? `_${stripped}` : stripped\n}\n"],"mappings":";AAeA,IAAa,IAAkE;CAC7E;EAAE,OAAO;EAAQ,OAAO;CAAO;CAC/B;EAAE,OAAO;EAAU,OAAO;CAAS;CACnC;EAAE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AU,MAAM;GAAQ,GAC7C,EAAK,cAAc;GACnB;EACF,KAAK;GAEH,AADA,EAAK,OAAO,UACZ,EAAK,SAAS;GACd;CACJ;CACA,OAAO;AACT;AAGA,SAAgB,EACd,GACA,GACQ;CACR,IAAM,IACJ,EACG,YAAY,EACZ,QAAQ,gBAAgB,EAAE,EAC1B,KAAK,EACL,MAAM,KAAK,EACX,OAAO,OAAO,EACd,KAAK,GAAG,MAAO,MAAM,IAAI,IAAI,EAAE,OAAO,CAAC,EAAE,YAAY,IAAI,EAAE,MAAM,CAAC,CAAE,EACpE,KAAK,EAAE,KAAK,SACb,IAAM,GACN,IAAI;CACR,OAAO,EAAa,IAAI,CAAG,IAEzB,AADA,KAAK,GACL,IAAM,GAAG,IAAO;CAElB,OAAO;AACT;AAQA,SAAgB,EAAoB,GAAqB;CACvD,IAAM,IAAW,EAAI,QAAQ,kBAAkB,EAAE;CACjD,OAAO,SAAS,KAAK,CAAQ,IAAI,IAAI,MAAa;AACpD"}
@@ -0,0 +1,23 @@
1
+ import { FormTemplateField } from '@sage-bionetworks/synapse-client';
2
+ import { EditableFormTemplateStep } from './utils';
3
+ /** Field library rows are plain draggables, not sortables: dropping one binds it to a step. */
4
+ export declare const FIELD_DRAG_TYPE = "field";
5
+ /** `data` a field library row carries so a drop can name the property to bind. */
6
+ export declare function fieldDragData(propertyKey: string): {
7
+ propertyKey: string;
8
+ };
9
+ /** The property a dropped field library row names, or null for any other drag's `data`. */
10
+ export declare function readFieldDragData(data: unknown): string | null;
11
+ export declare const STEP_SORTABLE_TYPE = "step";
12
+ /** Every step shares one sortable group, so steps only ever reorder among themselves. */
13
+ export declare const STEP_SORTABLE_GROUP = "steps";
14
+ export declare const SLOT_SORTABLE_TYPE = "slot";
15
+ export declare function stepSortableId(step: EditableFormTemplateStep): string;
16
+ /**
17
+ * The sortable group shared by one step's slot rows. Doubles as the id of that step's slot-list
18
+ * droppable, which is what lets `@dnd-kit/helpers`' `move` resolve a drop on an empty step's list
19
+ * to the group it should insert into.
20
+ */
21
+ export declare function slotGroupId(step: EditableFormTemplateStep): string;
22
+ export declare function slotSortableId(field: FormTemplateField): string;
23
+ //# sourceMappingURL=sortableIds.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sortableIds.d.ts","sourceRoot":"","sources":["../../../src/components/FormTemplateEditor/sortableIds.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAA;AAElD,+FAA+F;AAC/F,eAAO,MAAM,eAAe,UAAU,CAAA;AAEtC,kFAAkF;AAClF,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM;;EAEhD;AAED,2FAA2F;AAC3F,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAI9D;AAED,eAAO,MAAM,kBAAkB,SAAS,CAAA;AACxC,yFAAyF;AACzF,eAAO,MAAM,mBAAmB,UAAU,CAAA;AAE1C,eAAO,MAAM,kBAAkB,SAAS,CAAA;AAExC,wBAAgB,cAAc,CAAC,IAAI,EAAE,wBAAwB,GAAG,MAAM,CAErE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,wBAAwB,GAAG,MAAM,CAElE;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,CAE/D"}