synapse-react-client 4.0.45 → 4.0.46

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 (319) hide show
  1. package/dist/SWC.index.js +1 -1
  2. package/dist/aridhia-queries/AridhiaKeyFactory.d.ts +1 -0
  3. package/dist/aridhia-queries/AridhiaKeyFactory.d.ts.map +1 -1
  4. package/dist/aridhia-queries/AridhiaKeyFactory.js +3 -0
  5. package/dist/aridhia-queries/AridhiaKeyFactory.js.map +1 -1
  6. package/dist/aridhia-queries/aridhiaTokenExchange.js +6 -6
  7. package/dist/aridhia-queries/index.d.ts +1 -0
  8. package/dist/aridhia-queries/index.d.ts.map +1 -1
  9. package/dist/aridhia-queries/index.js +11 -10
  10. package/dist/aridhia-queries/useGetAridhiaVocabularyTerm.d.ts +19 -0
  11. package/dist/aridhia-queries/useGetAridhiaVocabularyTerm.d.ts.map +1 -0
  12. package/dist/aridhia-queries/useGetAridhiaVocabularyTerm.js +14 -0
  13. package/dist/aridhia-queries/useGetAridhiaVocabularyTerm.js.map +1 -0
  14. package/dist/components/AccessRequirementList/AccessApprovalCheckMark.d.ts.map +1 -1
  15. package/dist/components/AccessRequirementList/AccessApprovalCheckMark.js +6 -4
  16. package/dist/components/AccessRequirementList/AccessApprovalCheckMark.js.map +1 -1
  17. package/dist/components/AccessRequirementList/AccessRequirementList.js.map +1 -1
  18. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/AccessorRequirementHelpText.js +1 -1
  19. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/AccessorRequirementHelpText.js.map +1 -1
  20. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.js +1 -1
  21. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.js.map +1 -1
  22. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewCollaboratorsAndSigningOfficialAccordion.js +1 -1
  23. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewCollaboratorsAndSigningOfficialAccordion.js.map +1 -1
  24. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.d.ts.map +1 -1
  25. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.js +11 -8
  26. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.js.map +1 -1
  27. package/dist/components/AccessTokenPage/AccessTokenPage.js +1 -1
  28. package/dist/components/AccessTokenPage/AccessTokenPage.js.map +1 -1
  29. package/dist/components/AcknowledgementsPage/AcknowledgementsPage.js +1 -1
  30. package/dist/components/AcknowledgementsPage/AcknowledgementsPage.js.map +1 -1
  31. package/dist/components/Aridhia/DarWizard/DarSectionForm.d.ts.map +1 -1
  32. package/dist/components/Aridhia/DarWizard/DarSectionForm.js +17 -13
  33. package/dist/components/Aridhia/DarWizard/DarSectionForm.js.map +1 -1
  34. package/dist/components/Aridhia/DarWizard/DarSubmittedPanel.d.ts +3 -3
  35. package/dist/components/Aridhia/DarWizard/DarSubmittedPanel.d.ts.map +1 -1
  36. package/dist/components/Aridhia/DarWizard/DarSubmittedPanel.js +33 -34
  37. package/dist/components/Aridhia/DarWizard/DarSubmittedPanel.js.map +1 -1
  38. package/dist/components/Aridhia/fairFormToRjsf.js +1 -1
  39. package/dist/components/Aridhia/fairFormToRjsf.js.map +1 -1
  40. package/dist/components/Authentication/LastLoginInfo.js +1 -1
  41. package/dist/components/Authentication/LastLoginInfo.js.map +1 -1
  42. package/dist/components/CertificationQuiz/CertificationQuiz.js +1 -1
  43. package/dist/components/CertificationQuiz/CertificationQuiz.js.map +1 -1
  44. package/dist/components/ChallengeSubmission/AvailableEvaluationQueueList.js +1 -1
  45. package/dist/components/ChallengeSubmission/AvailableEvaluationQueueList.js.map +1 -1
  46. package/dist/components/ChallengeSubmission/EvaluationQueueCurrentRoundInfo.js +1 -1
  47. package/dist/components/ChallengeSubmission/EvaluationQueueCurrentRoundInfo.js.map +1 -1
  48. package/dist/components/ChallengeSubmission/SubmissionDirectoryList.js +6 -6
  49. package/dist/components/ChallengeSubmission/SubmissionDirectoryList.js.map +1 -1
  50. package/dist/components/ChallengeTeamWizard/ChallengeTeamTable.d.ts.map +1 -1
  51. package/dist/components/ChallengeTeamWizard/ChallengeTeamTable.js +4 -4
  52. package/dist/components/ChallengeTeamWizard/ChallengeTeamTable.js.map +1 -1
  53. package/dist/components/ChallengeTeamWizard/SelectChallengeTeam.js +4 -4
  54. package/dist/components/CitationPopover/CitationPopoverContent.js +4 -4
  55. package/dist/components/CitationPopover/CitationPopoverContent.js.map +1 -1
  56. package/dist/components/ComponentCollapse.d.ts.map +1 -1
  57. package/dist/components/ComponentCollapse.js +2 -1
  58. package/dist/components/ComponentCollapse.js.map +1 -1
  59. package/dist/components/DataGrid/SynapseGrid.d.ts.map +1 -1
  60. package/dist/components/DataGrid/SynapseGrid.js +231 -219
  61. package/dist/components/DataGrid/SynapseGrid.js.map +1 -1
  62. package/dist/components/DataGrid/SyncGridWithSourceButton.d.ts.map +1 -1
  63. package/dist/components/DataGrid/SyncGridWithSourceButton.js +5 -4
  64. package/dist/components/DataGrid/SyncGridWithSourceButton.js.map +1 -1
  65. package/dist/components/DataGrid/components/ColumnHeaderWithTooltip.d.ts.map +1 -1
  66. package/dist/components/DataGrid/components/ColumnHeaderWithTooltip.js +7 -5
  67. package/dist/components/DataGrid/components/ColumnHeaderWithTooltip.js.map +1 -1
  68. package/dist/components/DataGrid/components/ExportCsvFromGridButton.js +4 -4
  69. package/dist/components/DataGrid/components/ExportCsvFromGridButton.js.map +1 -1
  70. package/dist/components/DataGrid/components/ReorderColumnsButton.js +4 -4
  71. package/dist/components/DataGrid/components/ReorderColumnsButton.js.map +1 -1
  72. package/dist/components/DataGrid/components/ReorderColumnsDialog.d.ts.map +1 -1
  73. package/dist/components/DataGrid/components/ReorderColumnsDialog.js +12 -8
  74. package/dist/components/DataGrid/components/ReorderColumnsDialog.js.map +1 -1
  75. package/dist/components/DataGrid/components/UploadCsvToGridButton.js +1 -1
  76. package/dist/components/DataGrid/components/UploadCsvToGridButton.js.map +1 -1
  77. package/dist/components/DataGrid/hooks/useGridUndoRedo.js +5 -5
  78. package/dist/components/DataGrid/utils/applyModelChange.d.ts.map +1 -1
  79. package/dist/components/DataGrid/utils/applyModelChange.js +14 -14
  80. package/dist/components/DataGrid/utils/applyModelChange.js.map +1 -1
  81. package/dist/components/DataGrid/utils/columnFactory.js +1 -1
  82. package/dist/components/DataGrid/utils/columnFactory.js.map +1 -1
  83. package/dist/components/DataGrid/utils/splitPatch.d.ts.map +1 -1
  84. package/dist/components/DataGrid/utils/splitPatch.js +22 -13
  85. package/dist/components/DataGrid/utils/splitPatch.js.map +1 -1
  86. package/dist/components/DownloadCart/DownloadCartPage.js +1 -1
  87. package/dist/components/DownloadCart/DownloadCartPage.js.map +1 -1
  88. package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.d.ts.map +1 -1
  89. package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.js +2 -1
  90. package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.js.map +1 -1
  91. package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.module.js.map +1 -1
  92. package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.module.scss +1 -3
  93. package/dist/components/EntityBadgeIcons/EntityBadgeIcons.d.ts.map +1 -1
  94. package/dist/components/EntityBadgeIcons/EntityBadgeIcons.js +16 -10
  95. package/dist/components/EntityBadgeIcons/EntityBadgeIcons.js.map +1 -1
  96. package/dist/components/EntityDownloadButton/EntityDownloadButton.js +1 -1
  97. package/dist/components/EntityDownloadButton/EntityDownloadButton.js.map +1 -1
  98. package/dist/components/EntityFinder/EntityFinder.js +4 -4
  99. package/dist/components/EntityFinder/EntityIdTextField.js +1 -1
  100. package/dist/components/EntityFinder/EntityIdTextField.js.map +1 -1
  101. package/dist/components/EntityFinder/tree/VirtualizedTree.d.ts.map +1 -1
  102. package/dist/components/EntityFinder/tree/VirtualizedTree.js +5 -4
  103. package/dist/components/EntityFinder/tree/VirtualizedTree.js.map +1 -1
  104. package/dist/components/EntityHeaderTable/EntityHeaderTable.js +1 -1
  105. package/dist/components/EntityHeaderTable/EntityHeaderTable.js.map +1 -1
  106. package/dist/components/EntityTreeTable/components/EntityNameCell.d.ts.map +1 -1
  107. package/dist/components/EntityTreeTable/components/EntityNameCell.js +2 -1
  108. package/dist/components/EntityTreeTable/components/EntityNameCell.js.map +1 -1
  109. package/dist/components/EntityUpload/FileUploadProgress.d.ts.map +1 -1
  110. package/dist/components/EntityUpload/FileUploadProgress.js +11 -7
  111. package/dist/components/EntityUpload/FileUploadProgress.js.map +1 -1
  112. package/dist/components/Evaluation/round_limits/EvaluationRoundLimitOptionsList.d.ts.map +1 -1
  113. package/dist/components/Evaluation/round_limits/EvaluationRoundLimitOptionsList.js +4 -3
  114. package/dist/components/Evaluation/round_limits/EvaluationRoundLimitOptionsList.js.map +1 -1
  115. package/dist/components/ExperimentalMode/ExperimentalMode.js +1 -1
  116. package/dist/components/ExperimentalMode/ExperimentalMode.js.map +1 -1
  117. package/dist/components/ExternalFileHandleLink/ExternalFileHandleLink.js +1 -1
  118. package/dist/components/ExternalFileHandleLink/ExternalFileHandleLink.js.map +1 -1
  119. package/dist/components/FormTemplateEditor/ChoiceOptionsEditor.d.ts.map +1 -1
  120. package/dist/components/FormTemplateEditor/ChoiceOptionsEditor.js +2 -1
  121. package/dist/components/FormTemplateEditor/ChoiceOptionsEditor.js.map +1 -1
  122. package/dist/components/FormTemplateEditor/FieldDefinitionDrawer.d.ts.map +1 -1
  123. package/dist/components/FormTemplateEditor/FieldDefinitionDrawer.js +2 -1
  124. package/dist/components/FormTemplateEditor/FieldDefinitionDrawer.js.map +1 -1
  125. package/dist/components/FormTemplateEditor/FieldLibrary.d.ts.map +1 -1
  126. package/dist/components/FormTemplateEditor/FieldLibrary.js +2 -1
  127. package/dist/components/FormTemplateEditor/FieldLibrary.js.map +1 -1
  128. package/dist/components/FormTemplateEditor/FieldLibraryRow.js +4 -4
  129. package/dist/components/FormTemplateEditor/FieldLibraryRow.js.map +1 -1
  130. package/dist/components/FormTemplateEditor/FormStructurePanel.js +1 -1
  131. package/dist/components/FormTemplateEditor/FormStructurePanel.js.map +1 -1
  132. package/dist/components/FormTemplateEditor/FormTemplateEditorForm.js +1 -1
  133. package/dist/components/FormTemplateEditor/FormTemplateEditorForm.js.map +1 -1
  134. package/dist/components/FormTemplateEditor/StepCard.d.ts.map +1 -1
  135. package/dist/components/FormTemplateEditor/StepCard.js +15 -10
  136. package/dist/components/FormTemplateEditor/StepCard.js.map +1 -1
  137. package/dist/components/FormTemplateEditor/StepFieldRow.d.ts.map +1 -1
  138. package/dist/components/FormTemplateEditor/StepFieldRow.js +11 -6
  139. package/dist/components/FormTemplateEditor/StepFieldRow.js.map +1 -1
  140. package/dist/components/FormTemplateEditor/TemplateFileHandleField.d.ts.map +1 -1
  141. package/dist/components/FormTemplateEditor/TemplateFileHandleField.js +2 -1
  142. package/dist/components/FormTemplateEditor/TemplateFileHandleField.js.map +1 -1
  143. package/dist/components/GenericCard/DuoTermTags/DuoTermTags.js +45 -45
  144. package/dist/components/GenericCard/PortalDOI/PortalDOI.js +5 -5
  145. package/dist/components/GenericCard/PortalDOI/PortalDOI.js.map +1 -1
  146. package/dist/components/GenericCard/TableRowGenericCard.js +1 -1
  147. package/dist/components/GenericCard/TableRowGenericCard.js.map +1 -1
  148. package/dist/components/HelpPopover/HelpPopover.js +1 -1
  149. package/dist/components/HelpPopover/HelpPopover.js.map +1 -1
  150. package/dist/components/IconSvg/IconSvg.d.ts.map +1 -1
  151. package/dist/components/IconSvg/IconSvg.js +154 -47
  152. package/dist/components/IconSvg/IconSvg.js.map +1 -1
  153. package/dist/components/JsonSchemaForm/templates/ButtonTemplate.d.ts.map +1 -1
  154. package/dist/components/JsonSchemaForm/templates/ButtonTemplate.js +19 -16
  155. package/dist/components/JsonSchemaForm/templates/ButtonTemplate.js.map +1 -1
  156. package/dist/components/JsonSchemaForm/templates/RJSFInputLabel.d.ts.map +1 -1
  157. package/dist/components/JsonSchemaForm/templates/RJSFInputLabel.js +2 -1
  158. package/dist/components/JsonSchemaForm/templates/RJSFInputLabel.js.map +1 -1
  159. package/dist/components/JsonSchemaForm/widgets/PhoneWidget.d.ts +9 -0
  160. package/dist/components/JsonSchemaForm/widgets/PhoneWidget.d.ts.map +1 -0
  161. package/dist/components/JsonSchemaForm/widgets/PhoneWidget.js +21 -0
  162. package/dist/components/JsonSchemaForm/widgets/PhoneWidget.js.map +1 -0
  163. package/dist/components/Markdown/MarkdownCollapse.d.ts.map +1 -1
  164. package/dist/components/Markdown/MarkdownCollapse.js +3 -1
  165. package/dist/components/Markdown/MarkdownCollapse.js.map +1 -1
  166. package/dist/components/MissingQueryResultsWarning/MissingQueryResultsWarning.js +1 -1
  167. package/dist/components/MissingQueryResultsWarning/MissingQueryResultsWarning.js.map +1 -1
  168. package/dist/components/OAuthClientManagement/OAuthManagement.js +14 -13
  169. package/dist/components/OAuthClientManagement/OAuthManagement.js.map +1 -1
  170. package/dist/components/PortalList/PortalCard.d.ts.map +1 -1
  171. package/dist/components/PortalList/PortalCard.js +6 -5
  172. package/dist/components/PortalList/PortalCard.js.map +1 -1
  173. package/dist/components/PortalList/PortalList.js +4 -4
  174. package/dist/components/PortalList/PortalList.js.map +1 -1
  175. package/dist/components/ProjectVisibilityChip/ProjectVisibilityChip.js +6 -6
  176. package/dist/components/QueryBuilder/FilterConditionRow.js +4 -4
  177. package/dist/components/QueryCountButton/QueryCountButton.js +5 -5
  178. package/dist/components/QueryCountButton/QueryCountButton.js.map +1 -1
  179. package/dist/components/ReleaseCard/ReleaseCardLarge.js +5 -5
  180. package/dist/components/ReleaseCard/ReleaseCardLarge.js.map +1 -1
  181. package/dist/components/SetAccessRequirementCommonFields/SetAccessRequirementCommonFields.js +1 -1
  182. package/dist/components/SetAccessRequirementCommonFields/SetAccessRequirementCommonFields.js.map +1 -1
  183. package/dist/components/ShareThisPage/ShareThisPage.js +4 -4
  184. package/dist/components/ShareThisPage/ShareThisPage.js.map +1 -1
  185. package/dist/components/SustainabilityScorecard/DialLayout.js +1 -1
  186. package/dist/components/SustainabilityScorecard/DialLayout.js.map +1 -1
  187. package/dist/components/SustainabilityScorecard/SustainabilityScorecard.js +1 -1
  188. package/dist/components/SustainabilityScorecard/SustainabilityScorecard.js.map +1 -1
  189. package/dist/components/SynapseChat/SynapseChat.js +1 -1
  190. package/dist/components/SynapseChat/SynapseChat.js.map +1 -1
  191. package/dist/components/SynapseChat/SynapseChatInteraction.d.ts.map +1 -1
  192. package/dist/components/SynapseChat/SynapseChatInteraction.js +2 -1
  193. package/dist/components/SynapseChat/SynapseChatInteraction.js.map +1 -1
  194. package/dist/components/SynapseChat/components/ChatInputArea/ChatInputArea.js +1 -1
  195. package/dist/components/SynapseChat/components/ChatInputArea/ChatInputArea.js.map +1 -1
  196. package/dist/components/SynapseFooter/SynapseFooter.js +1 -1
  197. package/dist/components/SynapseFooter/SynapseFooter.js.map +1 -1
  198. package/dist/components/SynapseHomepageV2/SynapseFeaturedDatasetItem.js +1 -1
  199. package/dist/components/SynapseHomepageV2/SynapseFeaturedDatasetItem.js.map +1 -1
  200. package/dist/components/SynapseHomepageV2/SynapseHomepageNavBar.d.ts.map +1 -1
  201. package/dist/components/SynapseHomepageV2/SynapseHomepageNavBar.js +2 -1
  202. package/dist/components/SynapseHomepageV2/SynapseHomepageNavBar.js.map +1 -1
  203. package/dist/components/SynapseHomepageV2/SynapseInActionItem.js +4 -4
  204. package/dist/components/SynapseHomepageV2/SynapseInActionItem.js.map +1 -1
  205. package/dist/components/SynapseHomepageV2/SynapseTrendingProjectsItem.js +1 -1
  206. package/dist/components/SynapseHomepageV2/SynapseTrendingProjectsItem.js.map +1 -1
  207. package/dist/components/SynapseNavDrawer/SynapseNavDrawer.d.ts.map +1 -1
  208. package/dist/components/SynapseNavDrawer/SynapseNavDrawer.js +4 -1
  209. package/dist/components/SynapseNavDrawer/SynapseNavDrawer.js.map +1 -1
  210. package/dist/components/SynapsePortalBanners/SynapsePortalBanners.js +1 -1
  211. package/dist/components/SynapsePortalBanners/SynapsePortalBanners.js.map +1 -1
  212. package/dist/components/SynapseSearchPageResults/SynapseSearchPageResults.js +1 -1
  213. package/dist/components/SynapseSearchPageResults/SynapseSearchPageResults.js.map +1 -1
  214. package/dist/components/SynapseSearchPageResults/SynapseSearchResultsCard.d.ts.map +1 -1
  215. package/dist/components/SynapseSearchPageResults/SynapseSearchResultsCard.js +12 -9
  216. package/dist/components/SynapseSearchPageResults/SynapseSearchResultsCard.js.map +1 -1
  217. package/dist/components/SynapseTable/RowSelection/RowSelectionControls.js +4 -4
  218. package/dist/components/SynapseTable/RowSelection/RowSelectionControls.js.map +1 -1
  219. package/dist/components/SynapseTable/datasets/DatasetItemsEditor.js +140 -140
  220. package/dist/components/SynapseTable/datasets/DatasetItemsEditor.js.map +1 -1
  221. package/dist/components/TableColumnSchemaEditor/ColumnModelForm.js +1 -1
  222. package/dist/components/TableColumnSchemaEditor/ColumnModelForm.js.map +1 -1
  223. package/dist/components/TableColumnSchemaEditor/ImportTableColumnsButton.js +1 -1
  224. package/dist/components/TableColumnSchemaEditor/ImportTableColumnsButton.js.map +1 -1
  225. package/dist/components/TableColumnSchemaEditor/TableColumnSchemaEditorUtils.d.ts.map +1 -1
  226. package/dist/components/TableColumnSchemaEditor/TableColumnSchemaEditorUtils.js.map +1 -1
  227. package/dist/components/TableColumnSchemaEditor/TableColumnSchemaForm.js +9 -9
  228. package/dist/components/TableColumnSchemaEditor/TableColumnSchemaForm.js.map +1 -1
  229. package/dist/components/TableColumnSchemaEditor/TableColumnSchemaFormActions.d.ts.map +1 -1
  230. package/dist/components/TableColumnSchemaEditor/TableColumnSchemaFormActions.js +6 -4
  231. package/dist/components/TableColumnSchemaEditor/TableColumnSchemaFormActions.js.map +1 -1
  232. package/dist/components/TanStackTable/ColumnHeader.js +1 -1
  233. package/dist/components/TanStackTable/ColumnHeader.js.map +1 -1
  234. package/dist/components/TeamSubjectsSelector/TeamBadgeOrError.js +1 -1
  235. package/dist/components/TeamSubjectsSelector/TeamBadgeOrError.js.map +1 -1
  236. package/dist/components/TeamSubjectsSelector/TeamSubjectsSelector.d.ts.map +1 -1
  237. package/dist/components/TeamSubjectsSelector/TeamSubjectsSelector.js +4 -3
  238. package/dist/components/TeamSubjectsSelector/TeamSubjectsSelector.js.map +1 -1
  239. package/dist/components/Webhook/WebhookDashboard.js +1 -1
  240. package/dist/components/Webhook/WebhookDashboard.js.map +1 -1
  241. package/dist/components/dataaccess/AccessRequirementDashboard.js +4 -4
  242. package/dist/components/dataaccess/AccessRequirementDashboard.js.map +1 -1
  243. package/dist/components/dataaccess/AccessRequirementTable.js +1 -1
  244. package/dist/components/dataaccess/AccessRequirementTable.js.map +1 -1
  245. package/dist/components/dataaccess/EDucTemplateTable.d.ts.map +1 -1
  246. package/dist/components/dataaccess/EDucTemplateTable.js +13 -11
  247. package/dist/components/dataaccess/EDucTemplateTable.js.map +1 -1
  248. package/dist/components/dataaccess/FormTemplateTable.js +6 -6
  249. package/dist/components/dataaccess/FormTemplateTable.js.map +1 -1
  250. package/dist/components/dataaccess/ReviewerDashboard.js +17 -17
  251. package/dist/components/dataaccess/ReviewerDashboard.js.map +1 -1
  252. package/dist/components/dataaccess/SubmissionPage/SubmissionPage.js +4 -4
  253. package/dist/components/doi/CreateOrUpdateDoiModal.js +1 -1
  254. package/dist/components/doi/CreateOrUpdateDoiModal.js.map +1 -1
  255. package/dist/components/download_list/DownloadDetails.d.ts.map +1 -1
  256. package/dist/components/download_list/DownloadDetails.js +12 -10
  257. package/dist/components/download_list/DownloadDetails.js.map +1 -1
  258. package/dist/components/entity/metadata/AnnotationsTable.js +1 -1
  259. package/dist/components/entity/metadata/AnnotationsTable.js.map +1 -1
  260. package/dist/components/entity/page/CreatedByModifiedBy.js +1 -1
  261. package/dist/components/entity/page/CreatedByModifiedBy.js.map +1 -1
  262. package/dist/components/entity/page/action_menu/EntityActionMenu.d.ts.map +1 -1
  263. package/dist/components/entity/page/action_menu/EntityActionMenu.js.map +1 -1
  264. package/dist/components/entity/page/title_bar/useGetEntityTitleBarProperties.js +1 -1
  265. package/dist/components/entity/page/title_bar/useGetEntityTitleBarProperties.js.map +1 -1
  266. package/dist/components/error/ErrorChip.d.ts.map +1 -1
  267. package/dist/components/error/ErrorChip.js +2 -1
  268. package/dist/components/error/ErrorChip.js.map +1 -1
  269. package/dist/components/table/CsvPreview/CreateTableFromCsvDialog.js +14 -14
  270. package/dist/components/table/CsvPreview/CsvPreviewWithOptions.js +4 -4
  271. package/dist/components/table/CsvPreview/CsvPreviewWithOptions.js.map +1 -1
  272. package/dist/components/widgets/facet-nav/FacetNavPanel.js +1 -1
  273. package/dist/components/widgets/facet-nav/FacetNavPanel.js.map +1 -1
  274. package/dist/features/curator/dashboard/components/NextStepButton.d.ts.map +1 -1
  275. package/dist/features/curator/dashboard/components/NextStepButton.js +7 -6
  276. package/dist/features/curator/dashboard/components/NextStepButton.js.map +1 -1
  277. package/dist/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.js +8 -8
  278. package/dist/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.js.map +1 -1
  279. package/dist/features/entity/metadata-task/components/MetadataTaskTableActionCell.js +4 -4
  280. package/dist/features/entity/metadata-task/components/MetadataTaskTableActionCell.js.map +1 -1
  281. package/dist/features/entity/metadata-task/components/MetadataTasksPage.js +4 -4
  282. package/dist/features/entity/metadata-task/components/MetadataTasksPage.js.map +1 -1
  283. package/dist/features/entity/metadata-task/components/MetadataTasksTableAssigneeCell.js +1 -1
  284. package/dist/features/entity/metadata-task/components/MetadataTasksTableAssigneeCell.js.map +1 -1
  285. package/dist/features/entity/metadata-task/create-task/CurateTaskForm.js +4 -4
  286. package/dist/features/entity/metadata-task/create-task/CurateTaskForm.js.map +1 -1
  287. package/dist/features/entity/metadata-task/create-task/TaskCategoryCard.js +1 -1
  288. package/dist/features/entity/metadata-task/create-task/TaskCategoryCard.js.map +1 -1
  289. package/dist/features/entity/metadata-task/create-task/TaskFormHeader.js +1 -1
  290. package/dist/features/entity/metadata-task/create-task/TaskFormHeader.js.map +1 -1
  291. package/dist/features/entity/metadata-task/create-task/curationTaskFlowRoutes.js +10 -10
  292. package/dist/features/entity/metadata-task/create-task/curationTaskFlowRoutes.js.map +1 -1
  293. package/dist/features/team/invitation/components/OpenInvitationsToUserCard.js +1 -1
  294. package/dist/features/team/invitation/components/OpenInvitationsToUserCard.js.map +1 -1
  295. package/dist/mocks/msw/handlers/aridhiaHandlers.d.ts +8 -0
  296. package/dist/mocks/msw/handlers/aridhiaHandlers.d.ts.map +1 -1
  297. package/dist/mocks/msw/handlers/aridhiaHandlers.js +52 -41
  298. package/dist/mocks/msw/handlers/aridhiaHandlers.js.map +1 -1
  299. package/dist/mocks/msw/handlers/entityHandlers.d.ts.map +1 -1
  300. package/dist/mocks/msw/handlers/entityHandlers.js +70 -67
  301. package/dist/mocks/msw/handlers/entityHandlers.js.map +1 -1
  302. package/dist/mocks/msw/handlers/gridHandlers.js +2 -2
  303. package/dist/mocks/msw/handlers/gridHandlers.js.map +1 -1
  304. package/dist/mocks/msw/server.d.ts.map +1 -1
  305. package/dist/mocks/msw/server.js +4 -2
  306. package/dist/mocks/msw/server.js.map +1 -1
  307. package/dist/synapse-queries/user/useGetUserChallenges.d.ts.map +1 -1
  308. package/dist/synapse-queries/user/useGetUserChallenges.js.map +1 -1
  309. package/dist/theme/DefaultTheme.d.ts.map +1 -1
  310. package/dist/theme/DefaultTheme.js +4 -1
  311. package/dist/theme/DefaultTheme.js.map +1 -1
  312. package/dist/tsconfig.build.tsbuildinfo +1 -1
  313. package/dist/utils/APIConstants.d.ts.map +1 -1
  314. package/dist/utils/APIConstants.js.map +1 -1
  315. package/dist/utils/AppUtils/AppUtils.js +1 -1
  316. package/dist/utils/AppUtils/AppUtils.js.map +1 -1
  317. package/dist/utils/functions/EntityTypeUtils.d.ts.map +1 -1
  318. package/dist/utils/functions/EntityTypeUtils.js.map +1 -1
  319. package/package.json +7 -6
@@ -4,7 +4,7 @@ import { useSynapseContext as r } from "../../utils/context/SynapseContext.js";
4
4
  import { useEffect as i, useState as a } from "react";
5
5
  import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
6
6
  import { FileHandleAssociateType as l } from "@sage-bionetworks/synapse-types";
7
- import { OpenInNewTwoTone as u } from "@mui/icons-material";
7
+ import u from "@mui/icons-material/OpenInNewTwoTone";
8
8
  //#region src/components/ExternalFileHandleLink/ExternalFileHandleLink.tsx
9
9
  var d = (d) => {
10
10
  let { accessToken: f } = r(), { synId: p, className: m } = d, [h, g] = a(void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"ExternalFileHandleLink.js","names":[],"sources":["../../../src/components/ExternalFileHandleLink/ExternalFileHandleLink.tsx"],"sourcesContent":["import React from 'react'\nimport SynapseClient from '@/synapse-client'\nimport { useSynapseContext } from '@/utils/context/SynapseContext'\nimport { isExternalFileHandle, isFileEntity } from '@/utils/types/IsType'\nimport { OpenInNewTwoTone } from '@mui/icons-material'\nimport {\n BatchFileRequest,\n ExternalFileHandle,\n FileEntity,\n FileHandleAssociateType,\n} from '@sage-bionetworks/synapse-types'\nimport { useEffect, useState } from 'react'\n\nexport type ExternalFileHandleLinkProps = {\n synId: string\n className?: string\n}\n\nexport const ExternalFileHandleLink = (\n props: ExternalFileHandleLinkProps,\n): React.ReactNode => {\n const { accessToken } = useSynapseContext()\n const { synId, className } = props\n const [data, setData] = useState<\n | { fileEntity: FileEntity; externalFileHandle: ExternalFileHandle }\n | undefined\n >(undefined)\n useEffect(() => {\n const getEntity = async () => {\n try {\n const fileEntity = await SynapseClient.getEntity<FileEntity>(\n accessToken,\n synId,\n )\n if (!isFileEntity(fileEntity)) {\n throw new Error(`File Entity expected but found ${fileEntity}`)\n }\n const batchFileRequest: BatchFileRequest = {\n requestedFiles: [\n {\n associateObjectId: synId,\n associateObjectType: FileHandleAssociateType.FileEntity,\n fileHandleId: fileEntity.dataFileHandleId,\n },\n ],\n includeFileHandles: true,\n includePreSignedURLs: false,\n includePreviewPreSignedURLs: false,\n }\n const file = await SynapseClient.getFiles(batchFileRequest, accessToken)\n const externalFileHandle = file.requestedFiles[0].fileHandle\n if (externalFileHandle && isExternalFileHandle(externalFileHandle)) {\n setData({\n externalFileHandle,\n fileEntity,\n })\n } else {\n throw new Error(\n `Not an external file handle: ${externalFileHandle?.id}`,\n )\n }\n } catch (e) {\n console.error('Error on getting external file handle = ', e)\n }\n }\n getEntity()\n }, [synId, accessToken])\n\n const externalFileHandle = data?.externalFileHandle\n const fileEntity = data?.fileEntity\n\n return externalFileHandle ? (\n <a\n href={externalFileHandle.externalURL}\n className={className}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <span>\n {fileEntity?.name}\n <OpenInNewTwoTone style={{ marginLeft: 5 }} />\n </span>\n </a>\n ) : (\n <></>\n )\n}\n"],"mappings":";;;;;;;;AAkBA,IAAa,KACX,MACoB;CACpB,IAAM,EAAE,mBAAgB,EAAkB,GACpC,EAAE,UAAO,iBAAc,GACvB,CAAC,GAAM,KAAW,EAGtB,KAAA,CAAS;CACX,QAAgB;EAsCd,aArC8B;GAC5B,IAAI;IACF,IAAM,IAAa,MAAM,EAAc,UACrC,GACA,CACF;IACA,IAAI,CAAC,EAAa,CAAU,GAC1B,MAAU,MAAM,kCAAkC,GAAY;IAEhE,IAAM,IAAqC;KACzC,gBAAgB,CACd;MACE,mBAAmB;MACnB,qBAAqB,EAAwB;MAC7C,cAAc,EAAW;KAC3B,CACF;KACA,oBAAoB;KACpB,sBAAsB;KACtB,6BAA6B;IAC/B,GAEM,KAAqB,MADR,EAAc,SAAS,GAAkB,CAAW,GACvC,eAAe,GAAG;IAClD,IAAI,KAAsB,EAAqB,CAAkB,GAC/D,EAAQ;KACN;KACA;IACF,CAAC;SAED,MAAU,MACR,gCAAgC,GAAoB,IACtD;GAEJ,SAAS,GAAG;IACV,QAAQ,MAAM,4CAA4C,CAAC;GAC7D;EACF,GACU;CACZ,GAAG,CAAC,GAAO,CAAW,CAAC;CAEvB,IAAM,IAAqB,GAAM,oBAC3B,IAAa,GAAM;CAEzB,OAAO,IACL,kBAAC,KAAD;EACE,MAAM,EAAmB;EACd;EACX,QAAO;EACP,KAAI;YAEJ,kBAAC,QAAD,EAAA,UAAA,CACG,GAAY,MACb,kBAAC,GAAD,EAAkB,OAAO,EAAE,YAAY,EAAE,EAAI,CAAA,CACzC,EAAA,CAAA;CACL,CAAA,IAEH,kBAAA,GAAA,CAAI,CAAA;AAER"}
1
+ {"version":3,"file":"ExternalFileHandleLink.js","names":[],"sources":["../../../src/components/ExternalFileHandleLink/ExternalFileHandleLink.tsx"],"sourcesContent":["import React from 'react'\nimport SynapseClient from '@/synapse-client'\nimport { useSynapseContext } from '@/utils/context/SynapseContext'\nimport { isExternalFileHandle, isFileEntity } from '@/utils/types/IsType'\nimport OpenInNewTwoTone from '@mui/icons-material/OpenInNewTwoTone'\nimport {\n BatchFileRequest,\n ExternalFileHandle,\n FileEntity,\n FileHandleAssociateType,\n} from '@sage-bionetworks/synapse-types'\nimport { useEffect, useState } from 'react'\n\nexport type ExternalFileHandleLinkProps = {\n synId: string\n className?: string\n}\n\nexport const ExternalFileHandleLink = (\n props: ExternalFileHandleLinkProps,\n): React.ReactNode => {\n const { accessToken } = useSynapseContext()\n const { synId, className } = props\n const [data, setData] = useState<\n | { fileEntity: FileEntity; externalFileHandle: ExternalFileHandle }\n | undefined\n >(undefined)\n useEffect(() => {\n const getEntity = async () => {\n try {\n const fileEntity = await SynapseClient.getEntity<FileEntity>(\n accessToken,\n synId,\n )\n if (!isFileEntity(fileEntity)) {\n throw new Error(`File Entity expected but found ${fileEntity}`)\n }\n const batchFileRequest: BatchFileRequest = {\n requestedFiles: [\n {\n associateObjectId: synId,\n associateObjectType: FileHandleAssociateType.FileEntity,\n fileHandleId: fileEntity.dataFileHandleId,\n },\n ],\n includeFileHandles: true,\n includePreSignedURLs: false,\n includePreviewPreSignedURLs: false,\n }\n const file = await SynapseClient.getFiles(batchFileRequest, accessToken)\n const externalFileHandle = file.requestedFiles[0].fileHandle\n if (externalFileHandle && isExternalFileHandle(externalFileHandle)) {\n setData({\n externalFileHandle,\n fileEntity,\n })\n } else {\n throw new Error(\n `Not an external file handle: ${externalFileHandle?.id}`,\n )\n }\n } catch (e) {\n console.error('Error on getting external file handle = ', e)\n }\n }\n getEntity()\n }, [synId, accessToken])\n\n const externalFileHandle = data?.externalFileHandle\n const fileEntity = data?.fileEntity\n\n return externalFileHandle ? (\n <a\n href={externalFileHandle.externalURL}\n className={className}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <span>\n {fileEntity?.name}\n <OpenInNewTwoTone style={{ marginLeft: 5 }} />\n </span>\n </a>\n ) : (\n <></>\n )\n}\n"],"mappings":";;;;;;;;AAkBA,IAAa,KACX,MACoB;CACpB,IAAM,EAAE,mBAAgB,EAAkB,GACpC,EAAE,UAAO,iBAAc,GACvB,CAAC,GAAM,KAAW,EAGtB,KAAA,CAAS;CACX,QAAgB;EAsCd,aArC8B;GAC5B,IAAI;IACF,IAAM,IAAa,MAAM,EAAc,UACrC,GACA,CACF;IACA,IAAI,CAAC,EAAa,CAAU,GAC1B,MAAU,MAAM,kCAAkC,GAAY;IAEhE,IAAM,IAAqC;KACzC,gBAAgB,CACd;MACE,mBAAmB;MACnB,qBAAqB,EAAwB;MAC7C,cAAc,EAAW;KAC3B,CACF;KACA,oBAAoB;KACpB,sBAAsB;KACtB,6BAA6B;IAC/B,GAEM,KAAqB,MADR,EAAc,SAAS,GAAkB,CAAW,GACvC,eAAe,GAAG;IAClD,IAAI,KAAsB,EAAqB,CAAkB,GAC/D,EAAQ;KACN;KACA;IACF,CAAC;SAED,MAAU,MACR,gCAAgC,GAAoB,IACtD;GAEJ,SAAS,GAAG;IACV,QAAQ,MAAM,4CAA4C,CAAC;GAC7D;EACF,GACU;CACZ,GAAG,CAAC,GAAO,CAAW,CAAC;CAEvB,IAAM,IAAqB,GAAM,oBAC3B,IAAa,GAAM;CAEzB,OAAO,IACL,kBAAC,KAAD;EACE,MAAM,EAAmB;EACd;EACX,QAAO;EACP,KAAI;YAEJ,kBAAC,QAAD,EAAA,UAAA,CACG,GAAY,MACb,kBAAC,GAAD,EAAkB,OAAO,EAAE,YAAY,EAAE,EAAI,CAAA,CACzC,EAAA,CAAA;CACL,CAAA,IAEH,kBAAA,GAAA,CAAI,CAAA;AAER"}
@@ -1 +1 @@
1
- {"version":3,"file":"ChoiceOptionsEditor.d.ts","sourceRoot":"","sources":["../../../src/components/FormTemplateEditor/ChoiceOptionsEditor.tsx"],"names":[],"mappings":"AAUA,KAAK,wBAAwB,GAAG;IAC9B,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;CACnC,CAAA;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,OAAO,EACP,QAAQ,GACT,EAAE,wBAAwB,2CAkD1B"}
1
+ {"version":3,"file":"ChoiceOptionsEditor.d.ts","sourceRoot":"","sources":["../../../src/components/FormTemplateEditor/ChoiceOptionsEditor.tsx"],"names":[],"mappings":"AAWA,KAAK,wBAAwB,GAAG;IAC9B,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;CACnC,CAAA;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,OAAO,EACP,QAAQ,GACT,EAAE,wBAAwB,2CAkD1B"}
@@ -1,6 +1,7 @@
1
1
  import { Box as e, Button as t, IconButton as n, Stack as r, TextField as i, Typography as a } from "@mui/material";
2
2
  import { jsx as o, jsxs as s } from "react/jsx-runtime";
3
- import { Add as c, Delete as l } from "@mui/icons-material";
3
+ import c from "@mui/icons-material/Add";
4
+ import l from "@mui/icons-material/Delete";
4
5
  //#region src/components/FormTemplateEditor/ChoiceOptionsEditor.tsx
5
6
  function u({ options: u, onChange: d }) {
6
7
  let f = (e, t) => {
@@ -1 +1 @@
1
- {"version":3,"file":"ChoiceOptionsEditor.js","names":[],"sources":["../../../src/components/FormTemplateEditor/ChoiceOptionsEditor.tsx"],"sourcesContent":["import {\n Box,\n Button,\n IconButton,\n Stack,\n TextField,\n Typography,\n} from '@mui/material'\nimport { Add as AddIcon, Delete as DeleteIcon } from '@mui/icons-material'\n\ntype ChoiceOptionsEditorProps = {\n options: string[]\n onChange: (next: string[]) => void\n}\n\n/**\n * Edits a choice field's options. At least one option is always kept, and added options get a\n * unique `Option N` label.\n */\nexport function ChoiceOptionsEditor({\n options,\n onChange,\n}: ChoiceOptionsEditorProps) {\n const update = (idx: number, next: string) => {\n onChange(options.map((o, i) => (i === idx ? next : o)))\n }\n const remove = (idx: number) => {\n onChange(options.filter((_, i) => i !== idx))\n }\n const add = () => {\n let n = options.length + 1\n while (options.includes(`Option ${n}`)) n++\n onChange([...options, `Option ${n}`])\n }\n\n return (\n <Box sx={{ pl: 1, borderLeft: 2, borderColor: 'divider' }}>\n <Typography\n variant=\"caption\"\n color=\"text.secondary\"\n sx={{ display: 'block', mb: 0.5 }}\n >\n Choices\n </Typography>\n <Stack spacing={1}>\n {/* Index keys are safe: rows are fully controlled and hold no local state. */}\n {options.map((opt, idx) => (\n <Box key={idx} sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>\n <TextField\n value={opt}\n onChange={e => update(idx, e.target.value)}\n size=\"small\"\n fullWidth\n />\n <IconButton\n size=\"small\"\n aria-label=\"Delete choice\"\n onClick={() => remove(idx)}\n disabled={options.length <= 1}\n >\n <DeleteIcon fontSize=\"small\" />\n </IconButton>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;;AAET"}
1
+ {"version":3,"file":"ChoiceOptionsEditor.js","names":[],"sources":["../../../src/components/FormTemplateEditor/ChoiceOptionsEditor.tsx"],"sourcesContent":["import {\n Box,\n Button,\n IconButton,\n Stack,\n TextField,\n Typography,\n} from '@mui/material'\nimport AddIcon from '@mui/icons-material/Add'\nimport DeleteIcon from '@mui/icons-material/Delete'\n\ntype ChoiceOptionsEditorProps = {\n options: string[]\n onChange: (next: string[]) => void\n}\n\n/**\n * Edits a choice field's options. At least one option is always kept, and added options get a\n * unique `Option N` label.\n */\nexport function ChoiceOptionsEditor({\n options,\n onChange,\n}: ChoiceOptionsEditorProps) {\n const update = (idx: number, next: string) => {\n onChange(options.map((o, i) => (i === idx ? next : o)))\n }\n const remove = (idx: number) => {\n onChange(options.filter((_, i) => i !== idx))\n }\n const add = () => {\n let n = options.length + 1\n while (options.includes(`Option ${n}`)) n++\n onChange([...options, `Option ${n}`])\n }\n\n return (\n <Box sx={{ pl: 1, borderLeft: 2, borderColor: 'divider' }}>\n <Typography\n variant=\"caption\"\n color=\"text.secondary\"\n sx={{ display: 'block', mb: 0.5 }}\n >\n Choices\n </Typography>\n <Stack spacing={1}>\n {/* Index keys are safe: rows are fully controlled and hold no local state. */}\n {options.map((opt, idx) => (\n <Box key={idx} sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>\n <TextField\n value={opt}\n onChange={e => update(idx, e.target.value)}\n size=\"small\"\n fullWidth\n />\n <IconButton\n size=\"small\"\n aria-label=\"Delete choice\"\n onClick={() => remove(idx)}\n disabled={options.length <= 1}\n >\n <DeleteIcon fontSize=\"small\" />\n </IconButton>\n </Box>\n ))}\n <Box>\n <Button size=\"small\" startIcon={<AddIcon />} onClick={add}>\n Add choice\n </Button>\n </Box>\n </Stack>\n </Box>\n )\n}\n"],"mappings":";;;;;AAoBA,SAAgB,EAAoB,EAClC,YACA,eAC2B;CAC3B,IAAM,KAAU,GAAa,MAAiB;EAC5C,EAAS,EAAQ,KAAK,GAAG,MAAO,MAAM,IAAM,IAAO,CAAE,CAAC;CACxD,GACM,KAAU,MAAgB;EAC9B,EAAS,EAAQ,QAAQ,GAAG,MAAM,MAAM,CAAG,CAAC;CAC9C;CAOA,OACE,kBAAC,GAAD;EAAK,IAAI;GAAE,IAAI;GAAG,YAAY;GAAG,aAAa;EAAU;YAAxD,CACE,kBAAC,GAAD;GACE,SAAQ;GACR,OAAM;GACN,IAAI;IAAE,SAAS;IAAS,IAAI;GAAI;aACjC;EAEW,CAAA,GACZ,kBAAC,GAAD;GAAO,SAAS;aAAhB,CAEG,EAAQ,KAAK,GAAK,MACjB,kBAAC,GAAD;IAAe,IAAI;KAAE,SAAS;KAAQ,YAAY;KAAU,KAAK;IAAE;cAAnE,CACE,kBAAC,GAAD;KACE,OAAO;KACP,WAAU,MAAK,EAAO,GAAK,EAAE,OAAO,KAAK;KACzC,MAAK;KACL,WAAA;IACD,CAAA,GACD,kBAAC,GAAD;KACE,MAAK;KACL,cAAW;KACX,eAAe,EAAO,CAAG;KACzB,UAAU,EAAQ,UAAU;eAE5B,kBAAC,GAAD,EAAY,UAAS,QAAS,CAAA;IACpB,CAAA,CACT;MAfK,CAeL,CACN,GACD,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;IAAQ,MAAK;IAAQ,WAAW,kBAAC,GAAD,CAAU,CAAA;IAAG,eApCnC;KAChB,IAAI,IAAI,EAAQ,SAAS;KACzB,OAAO,EAAQ,SAAS,UAAU,GAAG,IAAG;KACxC,EAAS,CAAC,GAAG,GAAS,UAAU,GAAG,CAAC;IACtC;cAgCmE;GAEnD,CAAA,EACL,CAAA,CACA;IACJ;;AAET"}
@@ -1 +1 @@
1
- {"version":3,"file":"FieldDefinitionDrawer.d.ts","sourceRoot":"","sources":["../../../src/components/FormTemplateEditor/FieldDefinitionDrawer.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExC,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAA;AAoB5E,MAAM,MAAM,0BAA0B,GAAG;IACvC,IAAI,EAAE,OAAO,CAAA;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,6EAA6E;IAC7E,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACzB,QAAQ,EAAE,UAAU,GAAG,IAAI,CAAA;IAC3B,UAAU,EAAE,OAAO,CAAA;IACnB;;;;;;OAMG;IACH,OAAO,EAAE,qBAAqB,CAAA;IAC9B,qFAAqF;IACrF,aAAa,EAAE,OAAO,CAAA;IACtB,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK,IAAI,CAAA;IAC9C,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IACrC,SAAS,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAA;IACrC,gBAAgB,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAA;IAC/C,eAAe,EAAE,CAAC,OAAO,EAAE,qBAAqB,KAAK,IAAI,CAAA;IACzD,QAAQ,EAAE,MAAM,IAAI,CAAA;CACrB,CAAA;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,IAAI,EACJ,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,OAAO,EACP,aAAa,EACb,OAAO,EACP,QAAQ,EACR,WAAW,EACX,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,QAAQ,GACT,EAAE,0BAA0B,2CA8M5B"}
1
+ {"version":3,"file":"FieldDefinitionDrawer.d.ts","sourceRoot":"","sources":["../../../src/components/FormTemplateEditor/FieldDefinitionDrawer.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExC,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAA;AAoB5E,MAAM,MAAM,0BAA0B,GAAG;IACvC,IAAI,EAAE,OAAO,CAAA;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,6EAA6E;IAC7E,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACzB,QAAQ,EAAE,UAAU,GAAG,IAAI,CAAA;IAC3B,UAAU,EAAE,OAAO,CAAA;IACnB;;;;;;OAMG;IACH,OAAO,EAAE,qBAAqB,CAAA;IAC9B,qFAAqF;IACrF,aAAa,EAAE,OAAO,CAAA;IACtB,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK,IAAI,CAAA;IAC9C,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IACrC,SAAS,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAA;IACrC,gBAAgB,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAA;IAC/C,eAAe,EAAE,CAAC,OAAO,EAAE,qBAAqB,KAAK,IAAI,CAAA;IACzD,QAAQ,EAAE,MAAM,IAAI,CAAA;CACrB,CAAA;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,IAAI,EACJ,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,OAAO,EACP,aAAa,EACb,OAAO,EACP,QAAQ,EACR,WAAW,EACX,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,QAAQ,GACT,EAAE,0BAA0B,2CA8M5B"}
@@ -3,7 +3,8 @@ import { FIELD_TYPE_OPTIONS as t, applyFieldType as n, choiceOptions as r, detec
3
3
  import { useState as o } from "react";
4
4
  import { Alert as s, Box as c, Button as l, Drawer as u, FormControlLabel as d, IconButton as f, MenuItem as p, Stack as m, Switch as h, TextField as g, Typography as _ } from "@mui/material";
5
5
  import { jsx as v, jsxs as y } from "react/jsx-runtime";
6
- import { Close as b, Delete as x } from "@mui/icons-material";
6
+ import b from "@mui/icons-material/Close";
7
+ import x from "@mui/icons-material/Delete";
7
8
  //#region src/components/FormTemplateEditor/FieldDefinitionDrawer.tsx
8
9
  var S = [
9
10
  {
@@ -1 +1 @@
1
- {"version":3,"file":"FieldDefinitionDrawer.js","names":[],"sources":["../../../src/components/FormTemplateEditor/FieldDefinitionDrawer.tsx"],"sourcesContent":["import {\n Alert,\n Box,\n Button,\n Drawer,\n FormControlLabel,\n IconButton,\n MenuItem,\n Stack,\n Switch,\n TextField,\n Typography,\n} from '@mui/material'\nimport { Close as CloseIcon, Delete as DeleteIcon } from '@mui/icons-material'\nimport { RJSFSchema } from '@rjsf/utils'\nimport { useState } from 'react'\nimport { SchemaPropertyContext } from '@/utils/jsonschema/submissionContext'\nimport { ChoiceOptionsEditor } from './ChoiceOptionsEditor'\nimport {\n applyFieldType,\n choiceOptions,\n detectFieldType,\n FIELD_TYPE_OPTIONS,\n sanitizePropertyKey,\n SimpleFieldType,\n} from './schemaFieldUtils'\n\nconst SUBMISSION_CONTEXT_OPTIONS: {\n value: SchemaPropertyContext\n label: string\n}[] = [\n { value: 'ALWAYS', label: 'Always' },\n { value: 'REQUEST_ONLY', label: 'Initial request only' },\n { value: 'RENEWAL_ONLY', label: 'Renewal only' },\n]\n\nexport type FieldDefinitionDrawerProps = {\n open: boolean\n propertyKey: string | null\n /** All property keys currently defined in the schema, including this one. */\n existingKeys: Set<string>\n property: RJSFSchema | null\n isRequired: boolean\n /**\n * Which submission context this property applies to (per the schema's\n * `x-synapse-submissionContext` `allOf` convention). Editable here via a guided select box.\n * This component only calls `onChangeContext`; a container elsewhere in the authoring flow is\n * responsible for moving the property's definition between the schema's top-level `properties`\n * and the matching `allOf` branch so ACT never has to hand-edit `allOf` for the common case.\n */\n context: SchemaPropertyContext\n /** True when this field is bound to one or more steps. Affects delete affordance. */\n isUsedInSteps: boolean\n onClose: () => void\n onUpdate: (patch: Partial<RJSFSchema>) => void\n onRenameKey: (newKey: string) => void\n onReplace: (next: RJSFSchema) => void\n onChangeRequired: (isRequired: boolean) => void\n onChangeContext: (context: SchemaPropertyContext) => void\n onRemove: () => void\n}\n\n/**\n * Slide-in drawer for editing a single field's JSON Schema definition (label, help text, type,\n * required, submission context, choice options, file format).\n */\nexport function FieldDefinitionDrawer({\n open,\n propertyKey,\n existingKeys,\n property,\n isRequired,\n context,\n isUsedInSteps,\n onClose,\n onUpdate,\n onRenameKey,\n onReplace,\n onChangeRequired,\n onChangeContext,\n onRemove,\n}: FieldDefinitionDrawerProps) {\n const type = property ? detectFieldType(property) : null\n const isAdvanced = property !== null && type === null\n\n // The draft exists only while the key is being edited, and is tagged with the key it was started\n // from. When `propertyKey` changes underneath it (switching fields, or the container re-slugging\n // the key from the label) the draft no longer applies and the prop is shown again.\n const [keyDraft, setKeyDraft] = useState<{\n forKey: string | null\n value: string\n } | null>(null)\n const displayedKey =\n keyDraft?.forKey === propertyKey ? keyDraft.value : (propertyKey ?? '')\n\n let keyError: string | null = null\n if (displayedKey.length === 0) {\n keyError = 'Required'\n } else if (displayedKey !== propertyKey && existingKeys.has(displayedKey)) {\n keyError = 'Already used by another field'\n }\n\n const commitKeyDraft = () => {\n if (propertyKey && !keyError && displayedKey !== propertyKey) {\n onRenameKey(displayedKey)\n }\n setKeyDraft(null)\n }\n\n const handleChangeType = (next: SimpleFieldType) => {\n if (!property) return\n onReplace(applyFieldType(property, next))\n }\n\n return (\n <Drawer\n open={open}\n onClose={onClose}\n anchor=\"right\"\n slotProps={{ paper: { sx: { width: { xs: '100%', sm: 480 } } } }}\n >\n <Box\n sx={{ p: 3, display: 'flex', flexDirection: 'column', height: '100%' }}\n >\n <Box sx={{ display: 'flex', alignItems: 'center', mb: 2 }}>\n <Typography variant=\"h6\" sx={{ flexGrow: 1 }}>\n Edit field\n </Typography>\n <IconButton onClick={onClose} aria-label=\"Close field editor\">\n <CloseIcon />\n </IconButton>\n </Box>\n\n {propertyKey && (\n <TextField\n label=\"Property key\"\n value={displayedKey}\n onChange={e =>\n setKeyDraft({\n forKey: propertyKey,\n value: sanitizePropertyKey(e.target.value),\n })\n }\n onBlur={commitKeyDraft}\n onKeyDown={e => {\n if (e.key === 'Enter') {\n e.preventDefault()\n commitKeyDraft()\n }\n }}\n error={keyError !== null}\n helperText={\n keyError ??\n 'Identifies this field in the JSON Schema and submitted requests.'\n }\n size=\"small\"\n fullWidth\n sx={{ mb: 2 }}\n slotProps={{ input: { sx: { fontFamily: 'monospace' } } }}\n />\n )}\n\n {property && (\n <TextField\n select\n label=\"Submission context\"\n value={context}\n onChange={e =>\n onChangeContext(e.target.value as SchemaPropertyContext)\n }\n size=\"small\"\n fullWidth\n sx={{ mb: 2 }}\n helperText=\"Controls whether requesters are asked this question on an initial request, a renewal, or both.\"\n >\n {SUBMISSION_CONTEXT_OPTIONS.map(opt => (\n <MenuItem key={opt.value} value={opt.value}>\n {opt.label}\n </MenuItem>\n ))}\n </TextField>\n )}\n\n <Box sx={{ flexGrow: 1, overflow: 'auto' }}>\n {!property ? (\n <Alert severity=\"info\">No field selected.</Alert>\n ) : isAdvanced ? (\n <Alert severity=\"warning\" variant=\"outlined\">\n This field uses settings not supported by the simple editor. Edit\n it via the advanced raw JSON Schema view.\n </Alert>\n ) : (\n <Stack spacing={2}>\n <TextField\n label=\"Question label\"\n value={property.title ?? ''}\n onChange={e => onUpdate({ title: e.target.value })}\n size=\"small\"\n fullWidth\n />\n <TextField\n label=\"Help text\"\n value={property.description ?? ''}\n onChange={e => onUpdate({ description: e.target.value })}\n size=\"small\"\n multiline\n rows={3}\n fullWidth\n helperText=\"Shown to the requester below the question.\"\n />\n <Stack direction=\"row\" spacing={1} alignItems=\"center\">\n <TextField\n select\n label=\"Field type\"\n value={type}\n onChange={e =>\n handleChangeType(e.target.value as SimpleFieldType)\n }\n size=\"small\"\n sx={{ flexGrow: 1 }}\n >\n {FIELD_TYPE_OPTIONS.map(opt => (\n <MenuItem key={opt.value} value={opt.value}>\n {opt.label}\n </MenuItem>\n ))}\n </TextField>\n <FormControlLabel\n control={\n <Switch\n checked={isRequired}\n onChange={e => onChangeRequired(e.target.checked)}\n />\n }\n label=\"Required\"\n />\n </Stack>\n\n {(type === 'choice' || type === 'multiChoice') && (\n <ChoiceOptionsEditor\n options={choiceOptions(property)}\n onChange={next =>\n type === 'choice'\n ? onUpdate({ enum: next })\n : onUpdate({\n items: {\n ...(property.items as RJSFSchema),\n enum: next,\n },\n })\n }\n />\n )}\n\n {type === 'file' && (\n <Alert severity=\"info\" variant=\"outlined\">\n Requesters will be prompted to upload a file. You can attach a\n downloadable template to this field on each step that uses it.\n </Alert>\n )}\n </Stack>\n )}\n </Box>\n\n <Box\n sx={{\n pt: 2,\n display: 'flex',\n justifyContent: 'space-between',\n gap: 1,\n }}\n >\n <Button\n color=\"error\"\n startIcon={<DeleteIcon />}\n onClick={onRemove}\n disabled={!property}\n >\n {isUsedInSteps ? 'Delete (will remove from form)' : 'Delete field'}\n </Button>\n <Button variant=\"contained\" onClick={onClose}>\n Done\n </Button>\n </Box>\n </Box>\n </Drawer>\n )\n}\n"],"mappings":";;;;;;;AA2BA,IAAM,IAGA;CACJ;EAAE,OAAO;EAAU,OAAO;CAAS;CACnC;EAAE,OAAO;EAAgB,OAAO;CAAuB;CACvD;EAAE,OAAO;EAAgB,OAAO;CAAe;AACjD;AAgCA,SAAgB,EAAsB,EACpC,SACA,gBACA,iBACA,aACA,eACA,YACA,kBACA,YACA,aACA,gBACA,cACA,qBACA,oBACA,eAC6B;CAC7B,IAAM,IAAO,IAAW,EAAgB,CAAQ,IAAI,MAC9C,IAAa,MAAa,QAAQ,MAAS,MAK3C,CAAC,GAAU,KAAe,EAGtB,IAAI,GACR,IACJ,GAAU,WAAW,IAAc,EAAS,QAAS,KAAe,IAElE,IAA0B;CAC9B,AAAI,EAAa,WAAW,IAC1B,IAAW,aACF,MAAiB,KAAe,EAAa,IAAI,CAAY,MACtE,IAAW;CAGb,IAAM,UAAuB;EAI3B,AAHI,KAAe,CAAC,KAAY,MAAiB,KAC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OAGnC,CAAA;MAEJ;UA3EP,kBAAC,GAAD;MAAO,UAAS;gBAAO;KAAyB,CAAA;IA6E/C,CAAA;IAEL,kBAAC,GAAD;KACE,IAAI;MACF,IAAI;MACJ,SAAS;MACT,gBAAgB;MAChB,KAAK;KACP;eANF,CAQE,kBAAC,GAAD;MACE,OAAM;MACN,WAAW,kBAAC,GAAD,CAAa,CAAA;MACxB,SAAS;MACT,UAAU,CAAC;gBAEV,IAAgB,mCAAmC;KAC9C,CAAA,GACR,kBAAC,GAAD;MAAQ,SAAQ;MAAY,SAAS;gBAAS;KAEtC,CAAA,CACL;;GACF;;CACC,CAAA;AAEZ"}
1
+ {"version":3,"file":"FieldDefinitionDrawer.js","names":[],"sources":["../../../src/components/FormTemplateEditor/FieldDefinitionDrawer.tsx"],"sourcesContent":["import {\n Alert,\n Box,\n Button,\n Drawer,\n FormControlLabel,\n IconButton,\n MenuItem,\n Stack,\n Switch,\n TextField,\n Typography,\n} from '@mui/material'\nimport CloseIcon from '@mui/icons-material/Close'\nimport DeleteIcon from '@mui/icons-material/Delete'\nimport { RJSFSchema } from '@rjsf/utils'\nimport { useState } from 'react'\nimport { SchemaPropertyContext } from '@/utils/jsonschema/submissionContext'\nimport { ChoiceOptionsEditor } from './ChoiceOptionsEditor'\nimport {\n applyFieldType,\n choiceOptions,\n detectFieldType,\n FIELD_TYPE_OPTIONS,\n sanitizePropertyKey,\n SimpleFieldType,\n} from './schemaFieldUtils'\n\nconst SUBMISSION_CONTEXT_OPTIONS: {\n value: SchemaPropertyContext\n label: string\n}[] = [\n { value: 'ALWAYS', label: 'Always' },\n { value: 'REQUEST_ONLY', label: 'Initial request only' },\n { value: 'RENEWAL_ONLY', label: 'Renewal only' },\n]\n\nexport type FieldDefinitionDrawerProps = {\n open: boolean\n propertyKey: string | null\n /** All property keys currently defined in the schema, including this one. */\n existingKeys: Set<string>\n property: RJSFSchema | null\n isRequired: boolean\n /**\n * Which submission context this property applies to (per the schema's\n * `x-synapse-submissionContext` `allOf` convention). Editable here via a guided select box.\n * This component only calls `onChangeContext`; a container elsewhere in the authoring flow is\n * responsible for moving the property's definition between the schema's top-level `properties`\n * and the matching `allOf` branch so ACT never has to hand-edit `allOf` for the common case.\n */\n context: SchemaPropertyContext\n /** True when this field is bound to one or more steps. Affects delete affordance. */\n isUsedInSteps: boolean\n onClose: () => void\n onUpdate: (patch: Partial<RJSFSchema>) => void\n onRenameKey: (newKey: string) => void\n onReplace: (next: RJSFSchema) => void\n onChangeRequired: (isRequired: boolean) => void\n onChangeContext: (context: SchemaPropertyContext) => void\n onRemove: () => void\n}\n\n/**\n * Slide-in drawer for editing a single field's JSON Schema definition (label, help text, type,\n * required, submission context, choice options, file format).\n */\nexport function FieldDefinitionDrawer({\n open,\n propertyKey,\n existingKeys,\n property,\n isRequired,\n context,\n isUsedInSteps,\n onClose,\n onUpdate,\n onRenameKey,\n onReplace,\n onChangeRequired,\n onChangeContext,\n onRemove,\n}: FieldDefinitionDrawerProps) {\n const type = property ? detectFieldType(property) : null\n const isAdvanced = property !== null && type === null\n\n // The draft exists only while the key is being edited, and is tagged with the key it was started\n // from. When `propertyKey` changes underneath it (switching fields, or the container re-slugging\n // the key from the label) the draft no longer applies and the prop is shown again.\n const [keyDraft, setKeyDraft] = useState<{\n forKey: string | null\n value: string\n } | null>(null)\n const displayedKey =\n keyDraft?.forKey === propertyKey ? keyDraft.value : (propertyKey ?? '')\n\n let keyError: string | null = null\n if (displayedKey.length === 0) {\n keyError = 'Required'\n } else if (displayedKey !== propertyKey && existingKeys.has(displayedKey)) {\n keyError = 'Already used by another field'\n }\n\n const commitKeyDraft = () => {\n if (propertyKey && !keyError && displayedKey !== propertyKey) {\n onRenameKey(displayedKey)\n }\n setKeyDraft(null)\n }\n\n const handleChangeType = (next: SimpleFieldType) => {\n if (!property) return\n onReplace(applyFieldType(property, next))\n }\n\n return (\n <Drawer\n open={open}\n onClose={onClose}\n anchor=\"right\"\n slotProps={{ paper: { sx: { width: { xs: '100%', sm: 480 } } } }}\n >\n <Box\n sx={{ p: 3, display: 'flex', flexDirection: 'column', height: '100%' }}\n >\n <Box sx={{ display: 'flex', alignItems: 'center', mb: 2 }}>\n <Typography variant=\"h6\" sx={{ flexGrow: 1 }}>\n Edit field\n </Typography>\n <IconButton onClick={onClose} aria-label=\"Close field editor\">\n <CloseIcon />\n </IconButton>\n </Box>\n\n {propertyKey && (\n <TextField\n label=\"Property key\"\n value={displayedKey}\n onChange={e =>\n setKeyDraft({\n forKey: propertyKey,\n value: sanitizePropertyKey(e.target.value),\n })\n }\n onBlur={commitKeyDraft}\n onKeyDown={e => {\n if (e.key === 'Enter') {\n e.preventDefault()\n commitKeyDraft()\n }\n }}\n error={keyError !== null}\n helperText={\n keyError ??\n 'Identifies this field in the JSON Schema and submitted requests.'\n }\n size=\"small\"\n fullWidth\n sx={{ mb: 2 }}\n slotProps={{ input: { sx: { fontFamily: 'monospace' } } }}\n />\n )}\n\n {property && (\n <TextField\n select\n label=\"Submission context\"\n value={context}\n onChange={e =>\n onChangeContext(e.target.value as SchemaPropertyContext)\n }\n size=\"small\"\n fullWidth\n sx={{ mb: 2 }}\n helperText=\"Controls whether requesters are asked this question on an initial request, a renewal, or both.\"\n >\n {SUBMISSION_CONTEXT_OPTIONS.map(opt => (\n <MenuItem key={opt.value} value={opt.value}>\n {opt.label}\n </MenuItem>\n ))}\n </TextField>\n )}\n\n <Box sx={{ flexGrow: 1, overflow: 'auto' }}>\n {!property ? (\n <Alert severity=\"info\">No field selected.</Alert>\n ) : isAdvanced ? (\n <Alert severity=\"warning\" variant=\"outlined\">\n This field uses settings not supported by the simple editor. Edit\n it via the advanced raw JSON Schema view.\n </Alert>\n ) : (\n <Stack spacing={2}>\n <TextField\n label=\"Question label\"\n value={property.title ?? ''}\n onChange={e => onUpdate({ title: e.target.value })}\n size=\"small\"\n fullWidth\n />\n <TextField\n label=\"Help text\"\n value={property.description ?? ''}\n onChange={e => onUpdate({ description: e.target.value })}\n size=\"small\"\n multiline\n rows={3}\n fullWidth\n helperText=\"Shown to the requester below the question.\"\n />\n <Stack direction=\"row\" spacing={1} alignItems=\"center\">\n <TextField\n select\n label=\"Field type\"\n value={type}\n onChange={e =>\n handleChangeType(e.target.value as SimpleFieldType)\n }\n size=\"small\"\n sx={{ flexGrow: 1 }}\n >\n {FIELD_TYPE_OPTIONS.map(opt => (\n <MenuItem key={opt.value} value={opt.value}>\n {opt.label}\n </MenuItem>\n ))}\n </TextField>\n <FormControlLabel\n control={\n <Switch\n checked={isRequired}\n onChange={e => onChangeRequired(e.target.checked)}\n />\n }\n label=\"Required\"\n />\n </Stack>\n\n {(type === 'choice' || type === 'multiChoice') && (\n <ChoiceOptionsEditor\n options={choiceOptions(property)}\n onChange={next =>\n type === 'choice'\n ? onUpdate({ enum: next })\n : onUpdate({\n items: {\n ...(property.items as RJSFSchema),\n enum: next,\n },\n })\n }\n />\n )}\n\n {type === 'file' && (\n <Alert severity=\"info\" variant=\"outlined\">\n Requesters will be prompted to upload a file. You can attach a\n downloadable template to this field on each step that uses it.\n </Alert>\n )}\n </Stack>\n )}\n </Box>\n\n <Box\n sx={{\n pt: 2,\n display: 'flex',\n justifyContent: 'space-between',\n gap: 1,\n }}\n >\n <Button\n color=\"error\"\n startIcon={<DeleteIcon />}\n onClick={onRemove}\n disabled={!property}\n >\n {isUsedInSteps ? 'Delete (will remove from form)' : 'Delete field'}\n </Button>\n <Button variant=\"contained\" onClick={onClose}>\n Done\n </Button>\n </Box>\n </Box>\n </Drawer>\n )\n}\n"],"mappings":";;;;;;;;AA4BA,IAAM,IAGA;CACJ;EAAE,OAAO;EAAU,OAAO;CAAS;CACnC;EAAE,OAAO;EAAgB,OAAO;CAAuB;CACvD;EAAE,OAAO;EAAgB,OAAO;CAAe;AACjD;AAgCA,SAAgB,EAAsB,EACpC,SACA,gBACA,iBACA,aACA,eACA,YACA,kBACA,YACA,aACA,gBACA,cACA,qBACA,oBACA,eAC6B;CAC7B,IAAM,IAAO,IAAW,EAAgB,CAA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A;SAEH,OAAM;QACP,CAAA,CACI;;QAEL,MAAS,YAAY,MAAS,kBAC9B,kBAAC,GAAD;QACE,SAAS,EAAc,CAAQ;QAC/B,WAAU,MAEJ,EADJ,MAAS,WACI,EAAE,MAAM,EAAK,IACb,EACP,OAAO;SACL,GAAI,EAAS;SACb,MAAM;QACR,EACF,CAAC;OAER,CAAA;OAGF,MAAS,UACR,kBAAC,GAAD;QAAO,UAAS;QAAO,SAAQ;kBAAW;OAGnC,CAAA;MAEJ;UA3EP,kBAAC,GAAD;MAAO,UAAS;gBAAO;KAAyB,CAAA;IA6E/C,CAAA;IAEL,kBAAC,GAAD;KACE,IAAI;MACF,IAAI;MACJ,SAAS;MACT,gBAAgB;MAChB,KAAK;KACP;eANF,CAQE,kBAAC,GAAD;MACE,OAAM;MACN,WAAW,kBAAC,GAAD,CAAa,CAAA;MACxB,SAAS;MACT,UAAU,CAAC;gBAEV,IAAgB,mCAAmC;KAC9C,CAAA,GACR,kBAAC,GAAD;MAAQ,SAAQ;MAAY,SAAS;gBAAS;KAEtC,CAAA,CACL;;GACF;;CACC,CAAA;AAEZ"}
@@ -1 +1 @@
1
- {"version":3,"file":"FieldLibrary.d.ts","sourceRoot":"","sources":["../../../src/components/FormTemplateEditor/FieldLibrary.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AASxC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,UAAU,EAAE,UAAU,CAAA;IACtB,4EAA4E;IAC5E,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACtB,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAA;IAClC,aAAa,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAA;IAC5C,aAAa,EAAE,MAAM,IAAI,CAAA;CAC1B,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,EAC3B,UAAU,EACV,SAAS,EACT,mBAAmB,EACnB,aAAa,EACb,aAAa,GACd,EAAE,iBAAiB,2CA4FnB"}
1
+ {"version":3,"file":"FieldLibrary.d.ts","sourceRoot":"","sources":["../../../src/components/FormTemplateEditor/FieldLibrary.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AASxC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,UAAU,EAAE,UAAU,CAAA;IACtB,4EAA4E;IAC5E,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACtB,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAA;IAClC,aAAa,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAA;IAC5C,aAAa,EAAE,MAAM,IAAI,CAAA;CAC1B,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,EAC3B,UAAU,EACV,SAAS,EACT,mBAAmB,EACnB,aAAa,EACb,aAAa,GACd,EAAE,iBAAiB,2CA4FnB"}
@@ -4,7 +4,8 @@ import r from "./FieldLibrary.module.js";
4
4
  import { useMemo as i, useState as a } from "react";
5
5
  import { Alert as o, Box as s, Button as c, InputAdornment as l, Paper as u, Stack as d, TextField as f, Typography as p } from "@mui/material";
6
6
  import { jsx as m, jsxs as h } from "react/jsx-runtime";
7
- import { Add as g, Search as _ } from "@mui/icons-material";
7
+ import g from "@mui/icons-material/Add";
8
+ import _ from "@mui/icons-material/Search";
8
9
  //#region src/components/FormTemplateEditor/FieldLibrary.tsx
9
10
  function v({ jsonSchema: v, usedPaths: y, selectedPropertyKey: b, onSelectField: x, onCreateField: S }) {
10
11
  let [C, w] = a(""), T = i(() => e(v), [v]), E = i(() => {
@@ -1 +1 @@
1
- {"version":3,"file":"FieldLibrary.js","names":[],"sources":["../../../src/components/FormTemplateEditor/FieldLibrary.tsx"],"sourcesContent":["import {\n Alert,\n Box,\n Button,\n InputAdornment,\n Paper,\n Stack,\n TextField,\n Typography,\n} from '@mui/material'\nimport { Add as AddIcon, Search as SearchIcon } from '@mui/icons-material'\nimport { RJSFSchema } from '@rjsf/utils'\nimport { ReactNode, useMemo, useState } from 'react'\nimport {\n listResolvedSchemaProperties,\n propertyKeyToPointer,\n} from '@/utils/jsonschema/submissionContext'\nimport { FieldLibraryRow } from './FieldLibraryRow'\nimport fieldLibraryStyles from './FieldLibrary.module.scss'\n\nexport type FieldLibraryProps = {\n jsonSchema: RJSFSchema\n /** Set of JSON pointers (e.g. `/institution`) currently bound to a step. */\n usedPaths: Set<string>\n selectedPropertyKey: string | null\n onSelectField: (propertyKey: string) => void\n onCreateField: () => void\n}\n\n/**\n * Left pane: a compact list of all schema properties (the \"fields\" the form\n * collects) -- both unconditional and any gated behind an\n * `x-synapse-submissionContext` conditional. Each row is clickable and opens\n * the field definition drawer.\n */\nexport function FieldLibrary({\n jsonSchema,\n usedPaths,\n selectedPropertyKey,\n onSelectField,\n onCreateField,\n}: FieldLibraryProps) {\n const [search, setSearch] = useState('')\n\n const resolvedProperties = useMemo(\n () => listResolvedSchemaProperties(jsonSchema),\n [jsonSchema],\n )\n\n const filtered = useMemo(() => {\n if (!search) return resolvedProperties\n const searchTerm = search.toLowerCase()\n return resolvedProperties.filter(p => {\n const entryAsString =\n `${p.propertyKey} ${p.subSchema.title ?? ''}`.toLowerCase()\n return entryAsString.includes(searchTerm)\n })\n }, [resolvedProperties, search])\n\n let fieldList: ReactNode\n if (resolvedProperties.length === 0) {\n fieldList = (\n <Alert severity=\"info\">\n No fields yet. Click \"New\" to start collecting information.\n </Alert>\n )\n } else if (filtered.length === 0) {\n fieldList = <Alert severity=\"info\">No fields match \"{search}\".</Alert>\n } else {\n fieldList = (\n <Stack spacing={0.75}>\n {filtered.map(p => (\n <Box\n key={p.propertyKey}\n className={fieldLibraryStyles.selectedRow}\n data-selected={selectedPropertyKey === p.propertyKey}\n >\n <FieldLibraryRow\n propertyKey={p.propertyKey}\n property={p.subSchema}\n isRequired={p.isRequired}\n context={p.context}\n isUsedInSteps={usedPaths.has(propertyKeyToPointer(p.propertyKey))}\n onClick={() => onSelectField(p.propertyKey)}\n />\n </Box>\n ))}\n </Stack>\n )\n }\n\n return (\n <Paper variant=\"outlined\" sx={{ p: 2, height: '100%' }}>\n <Box sx={{ mb: 1 }}>\n <Typography variant=\"subtitle2\">Fields</Typography>\n <Typography variant=\"caption\" color=\"text.secondary\">\n Define the data you want to collect. Click a field to edit it.\n </Typography>\n </Box>\n\n <Stack spacing={1.5}>\n <Stack direction=\"row\" spacing={1} alignItems=\"center\">\n <TextField\n placeholder=\"Search fields…\"\n value={search}\n onChange={e => setSearch(e.target.value)}\n size=\"small\"\n fullWidth\n slotProps={{\n input: {\n startAdornment: (\n <InputAdornment position=\"start\">\n <SearchIcon fontSize=\"small\" />\n </InputAdornment>\n ),\n },\n htmlInput: { 'aria-label': 'Search fields' },\n }}\n />\n <Button\n size=\"small\"\n variant=\"outlined\"\n startIcon={<AddIcon />}\n onClick={onCreateField}\n >\n New\n </Button>\n </Stack>\n\n {fieldList}\n </Stack>\n </Paper>\n )\n}\n"],"mappings":";;;;;;;;AAmCA,SAAgB,EAAa,EAC3B,eACA,cACA,wBACA,kBACA,oBACoB;CACpB,IAAM,CAAC,GAAQ,KAAa,EAAS,EAAE,GAEjC,IAAqB,QACnB,EAA6B,CAAU,GAC7C,CAAC,CAAU,CACb,GAEM,IAAW,QAAc;EAC7B,IAAI,CAAC,GAAQ,OAAO;EACpB,IAAM,IAAa,EAAO,YAAY;EACtC,OAAO,EAAmB,QAAO,MAE7B,GAAG,EAAE,YAAY,GAAG,EAAE,UAAU,SAAS,KAAK,YACzC,EAAc,SAAS,CAAU,CACzC;CACH,GAAG,CAAC,GAAoB,CAAM,CAAC,GAE3B;CAgCJ,OA/BA,AASE,IATE,EAAmB,WAAW,IAE9B,kBAAC,GAAD;EAAO,UAAS;YAAO;CAEhB,CAAA,IAEA,EAAS,WAAW,IACjB,kBAAC,GAAD;EAAO,UAAS;YAAhB;GAAuB;GAAkB;GAAO;EAAS;MAGnE,kBAAC,GAAD;EAAO,SAAS;YACb,EAAS,KAAI,MACZ,kBAAC,GAAD;GAEE,WAAW,EAAmB;GAC9B,iBAAe,MAAwB,EAAE;aAEzC,kBAAC,GAAD;IACE,aAAa,EAAE;IACf,UAAU,EAAE;IACZ,YAAY,EAAE;IACd,SAAS,EAAE;IACX,eAAe,EAAU,IAAI,EAAqB,EAAE,WAAW,CAAC;IAChE,eAAe,EAAc,EAAE,WAAW;GAC3C,CAAA;EACE,GAZE,EAAE,WAYJ,CACN;CACI,CAAA,GAKT,kBAAC,GAAD;EAAO,SAAQ;EAAW,IAAI;GAAE,GAAG;GAAG,QAAQ;EAAO;YAArD,CACE,kBAAC,GAAD;GAAK,IAAI,EAAE,IAAI,EAAE;aAAjB,CACE,kBAAC,GAAD;IAAY,SAAQ;cAAY;GAAkB,CAAA,GAClD,kBAAC,GAAD;IAAY,SAAQ;IAAU,OAAM;cAAiB;GAEzC,CAAA,CACT;MAEL,kBAAC,GAAD;GAAO,SAAS;aAAhB,CACE,kBAAC,GAAD;IAAO,WAAU;IAAM,SAAS;IAAG,YAAW;cAA9C,CACE,kBAAC,GAAD;KACE,aAAY;KACZ,OAAO;KACP,WAAU,MAAK,EAAU,EAAE,OAAO,KAAK;KACvC,MAAK;KACL,WAAA;KACA,WAAW;MACT,OAAO,EACL,gBACE,kBAAC,GAAD;OAAgB,UAAS;iBACvB,kBAAC,GAAD,EAAY,UAAS,QAAS,CAAA;MAChB,CAAA,EAEpB;MACA,WAAW,EAAE,cAAc,gBAAgB;KAC7C;IACD,CAAA,GACD,kBAAC,GAAD;KACE,MAAK;KACL,SAAQ;KACR,WAAW,kBAAC,GAAD,CAAU,CAAA;KACrB,SAAS;eACV;IAEO,CAAA,CACH;OAEN,CACI;IACF;;AAEX"}
1
+ {"version":3,"file":"FieldLibrary.js","names":[],"sources":["../../../src/components/FormTemplateEditor/FieldLibrary.tsx"],"sourcesContent":["import {\n Alert,\n Box,\n Button,\n InputAdornment,\n Paper,\n Stack,\n TextField,\n Typography,\n} from '@mui/material'\nimport AddIcon from '@mui/icons-material/Add'\nimport SearchIcon from '@mui/icons-material/Search'\nimport { RJSFSchema } from '@rjsf/utils'\nimport { ReactNode, useMemo, useState } from 'react'\nimport {\n listResolvedSchemaProperties,\n propertyKeyToPointer,\n} from '@/utils/jsonschema/submissionContext'\nimport { FieldLibraryRow } from './FieldLibraryRow'\nimport fieldLibraryStyles from './FieldLibrary.module.scss'\n\nexport type FieldLibraryProps = {\n jsonSchema: RJSFSchema\n /** Set of JSON pointers (e.g. `/institution`) currently bound to a step. */\n usedPaths: Set<string>\n selectedPropertyKey: string | null\n onSelectField: (propertyKey: string) => void\n onCreateField: () => void\n}\n\n/**\n * Left pane: a compact list of all schema properties (the \"fields\" the form\n * collects) -- both unconditional and any gated behind an\n * `x-synapse-submissionContext` conditional. Each row is clickable and opens\n * the field definition drawer.\n */\nexport function FieldLibrary({\n jsonSchema,\n usedPaths,\n selectedPropertyKey,\n onSelectField,\n onCreateField,\n}: FieldLibraryProps) {\n const [search, setSearch] = useState('')\n\n const resolvedProperties = useMemo(\n () => listResolvedSchemaProperties(jsonSchema),\n [jsonSchema],\n )\n\n const filtered = useMemo(() => {\n if (!search) return resolvedProperties\n const searchTerm = search.toLowerCase()\n return resolvedProperties.filter(p => {\n const entryAsString =\n `${p.propertyKey} ${p.subSchema.title ?? ''}`.toLowerCase()\n return entryAsString.includes(searchTerm)\n })\n }, [resolvedProperties, search])\n\n let fieldList: ReactNode\n if (resolvedProperties.length === 0) {\n fieldList = (\n <Alert severity=\"info\">\n No fields yet. Click \"New\" to start collecting information.\n </Alert>\n )\n } else if (filtered.length === 0) {\n fieldList = <Alert severity=\"info\">No fields match \"{search}\".</Alert>\n } else {\n fieldList = (\n <Stack spacing={0.75}>\n {filtered.map(p => (\n <Box\n key={p.propertyKey}\n className={fieldLibraryStyles.selectedRow}\n data-selected={selectedPropertyKey === p.propertyKey}\n >\n <FieldLibraryRow\n propertyKey={p.propertyKey}\n property={p.subSchema}\n isRequired={p.isRequired}\n context={p.context}\n isUsedInSteps={usedPaths.has(propertyKeyToPointer(p.propertyKey))}\n onClick={() => onSelectField(p.propertyKey)}\n />\n </Box>\n ))}\n </Stack>\n )\n }\n\n return (\n <Paper variant=\"outlined\" sx={{ p: 2, height: '100%' }}>\n <Box sx={{ mb: 1 }}>\n <Typography variant=\"subtitle2\">Fields</Typography>\n <Typography variant=\"caption\" color=\"text.secondary\">\n Define the data you want to collect. Click a field to edit it.\n </Typography>\n </Box>\n\n <Stack spacing={1.5}>\n <Stack direction=\"row\" spacing={1} alignItems=\"center\">\n <TextField\n placeholder=\"Search fields…\"\n value={search}\n onChange={e => setSearch(e.target.value)}\n size=\"small\"\n fullWidth\n slotProps={{\n input: {\n startAdornment: (\n <InputAdornment position=\"start\">\n <SearchIcon fontSize=\"small\" />\n </InputAdornment>\n ),\n },\n htmlInput: { 'aria-label': 'Search fields' },\n }}\n />\n <Button\n size=\"small\"\n variant=\"outlined\"\n startIcon={<AddIcon />}\n onClick={onCreateField}\n >\n New\n </Button>\n </Stack>\n\n {fieldList}\n </Stack>\n </Paper>\n )\n}\n"],"mappings":";;;;;;;;;AAoCA,SAAgB,EAAa,EAC3B,eACA,cACA,wBACA,kBACA,oBACoB;CACpB,IAAM,CAAC,GAAQ,KAAa,EAAS,EAAE,GAEjC,IAAqB,QACnB,EAA6B,CAAU,GAC7C,CAAC,CAAU,CACb,GAEM,IAAW,QAAc;EAC7B,IAAI,CAAC,GAAQ,OAAO;EACpB,IAAM,IAAa,EAAO,YAAY;EACtC,OAAO,EAAmB,QAAO,MAE7B,GAAG,EAAE,YAAY,GAAG,EAAE,UAAU,SAAS,KAAK,YACzC,EAAc,SAAS,CAAU,CACzC;CACH,GAAG,CAAC,GAAoB,CAAM,CAAC,GAE3B;CAgCJ,OA/BA,AASE,IATE,EAAmB,WAAW,IAE9B,kBAAC,GAAD;EAAO,UAAS;YAAO;CAEhB,CAAA,IAEA,EAAS,WAAW,IACjB,kBAAC,GAAD;EA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ortableIds.js";
5
5
  import { Box as o, Chip as s, Paper as c, Stack as l, Typography as u } from "@mui/material";
6
6
  import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
7
- import { DragIndicator as m } from "@mui/icons-material";
8
- import { useDraggable as h } from "@dnd-kit/react";
7
+ import { useDraggable as m } from "@dnd-kit/react";
8
+ import h from "@mui/icons-material/DragIndicator";
9
9
  //#region src/components/FormTemplateEditor/FieldLibraryRow.tsx
10
10
  function g({ propertyKey: g, property: _, isRequired: v, context: y, isUsedInSteps: b, onClick: x }) {
11
- let S = t(_), C = _.title || g, { ref: w, handleRef: T, isDragging: E } = h({
11
+ let S = t(_), C = _.title || g, { ref: w, handleRef: T, isDragging: E } = m({
12
12
  id: `field:${g}`,
13
13
  type: i,
14
14
  data: a(g),
@@ -36,7 +36,7 @@ function g({ propertyKey: g, property: _, isRequired: v, context: y, isUsedInSte
36
36
  color: b ? "text.disabled" : "text.secondary",
37
37
  cursor: b ? "not-allowed" : void 0
38
38
  },
39
- children: /* @__PURE__ */ f(m, { fontSize: "small" })
39
+ children: /* @__PURE__ */ f(h, { fontSize: "small" })
40
40
  }), /* @__PURE__ */ p(o, {
41
41
  role: "button",
42
42
  tabIndex: 0,
@@ -1 +1 @@
1
- {"version":3,"file":"FieldLibraryRow.js","names":[],"sources":["../../../src/components/FormTemplateEditor/FieldLibraryRow.tsx"],"sourcesContent":["import { useDraggable } from '@dnd-kit/react'\nimport { Box, Chip, Paper, Stack, Typography } from '@mui/material'\nimport { DragIndicator as DragHandleIcon } from '@mui/icons-material'\nimport { RJSFSchema } from '@rjsf/utils'\nimport {\n SchemaPropertyContext,\n submissionContextLabel,\n} from '@/utils/jsonschema/submissionContext'\nimport styles from './dragHandle.module.scss'\nimport { detectFieldType, fieldTypeLabel } from './schemaFieldUtils'\nimport { FIELD_DRAG_TYPE, fieldDragData } from './sortableIds'\n\nexport type FieldLibraryRowProps = {\n propertyKey: string\n property: RJSFSchema\n isRequired: boolean\n /** Which submission context (per the schema's `x-synapse-submissionContext` convention)\n * gates this property. `ALWAYS` properties show no badge. */\n context: SchemaPropertyContext\n isUsedInSteps: boolean\n onClick: () => void\n}\n\n/**\n * A compact row in the field library. Click anywhere to edit the field's\n * definition; grab the drag indicator on the left to bind it to a step.\n * Rows already bound to a step are non-draggable.\n */\nexport function FieldLibraryRow({\n propertyKey,\n property,\n isRequired,\n context,\n isUsedInSteps,\n onClick,\n}: FieldLibraryRowProps) {\n const type = detectFieldType(property)\n const displayLabel = property.title || propertyKey\n\n const { ref, handleRef, isDragging } = useDraggable({\n id: `field:${propertyKey}`,\n type: FIELD_DRAG_TYPE,\n data: fieldDragData(propertyKey),\n disabled: isUsedInSteps,\n })\n\n return (\n <Paper\n ref={ref}\n variant=\"outlined\"\n className={styles.dragSource}\n data-dragging={isDragging}\n sx={{ p: 1.25 }}\n >\n <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5 }}>\n <Box\n ref={handleRef}\n role=\"button\"\n tabIndex={isUsedInSteps ? -1 : 0}\n aria-label={\n isUsedInSteps ? 'Already in a form step' : 'Drag to add to a step'\n }\n className={styles.dragHandle}\n sx={{\n color: isUsedInSteps ? 'text.disabled' : 'text.secondary',\n cursor: isUsedInSteps ? 'not-allowed' : undefined,\n }}\n >\n <DragHandleIcon fontSize=\"small\" />\n </Box>\n <Box\n role=\"button\"\n tabIndex={0}\n aria-label={`Edit ${displayLabel}`}\n onClick={onClick}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n onClick()\n }\n }}\n sx={{\n flexGrow: 1,\n minWidth: 0,\n display: 'flex',\n alignItems: 'center',\n gap: 0.5,\n cursor: 'pointer',\n borderRadius: 1,\n p: 0.5,\n m: -0.5,\n '&:hover': { backgroundColor: 'action.hover' },\n }}\n >\n <Box sx={{ flexGrow: 1, minWidth: 0 }}>\n <Typography\n variant=\"body2\"\n fontWeight={500}\n noWrap\n title={displayLabel}\n >\n {displayLabel}\n </Typography>\n <Stack\n direction=\"row\"\n spacing={0.5}\n alignItems=\"center\"\n sx={{ mt: 0.25 }}\n >\n <Typography variant=\"caption\" color=\"text.secondary\">\n {fieldTypeLabel(type)}\n </Typography>\n {isRequired && (\n <>\n <Typography variant=\"caption\" color=\"text.secondary\">\n ·\n </Typography>\n <Typography variant=\"caption\" color=\"text.secondary\">\n Required\n </Typography>\n </>\n )}\n {context !== 'ALWAYS' && (\n <>\n <Typography variant=\"caption\" color=\"text.secondary\">\n ·\n </Typography>\n <Typography variant=\"caption\" color=\"text.secondary\">\n {submissionContextLabel(context)}\n </Typography>\n </>\n )}\n </Stack>\n </Box>\n <Chip\n label={isUsedInSteps ? 'In form' : 'Not in form'}\n size=\"small\"\n color={isUsedInSteps ? 'success' : 'warning'}\n variant=\"outlined\"\n />\n </Box>\n </Box>\n </Paper>\n )\n}\n"],"mappings":";;;;;;;;;AA4BA,SAAgB,EAAgB,EAC9B,gBACA,aACA,eACA,YACA,kBACA,cACuB;CACvB,IAAM,IAAO,EAAgB,CAAQ,GAC/B,IAAe,EAAS,SAAS,GAEjC,EAAE,QAAK,cAAW,kBAAe,EAAa;EAClD,IAAI,SAAS;EACb,MAAM;EACN,MAAM,EAAc,CAAW;EAC/B,UAAU;CACZ,CAAC;CAED,OACE,kBAAC,GAAD;EACO;EACL,SAAQ;EACR,WAAW,EAAO;EAClB,iBAAe;EACf,IAAI,EAAE,GAAG,KAAK;YAEd,kBAAC,GAAD;GAAK,IAAI;IAAE,SAAS;IAAQ,YAAY;IAAU,KAAK;GAAI;aAA3D,CACE,kBAAC,GAAD;IACE,KAAK;IACL,MAAK;IACL,UAAU,IAAgB,KAAK;IAC/B,cACE,IAAgB,2BAA2B;IAE7C,WAAW,EAAO;IAClB,IAAI;KACF,OAAO,IAAgB,kBAAkB;KACzC,QAAQ,IAAgB,gBAAgB,KAAA;IAC1C;cAEA,kBAAC,GAAD,EAAgB,UAAS,QAAS,CAAA;GAC/B,CAAA,GACL,kBAAC,GAAD;IACE,MAAK;IACL,UAAU;IACV,cAAY,QAAQ;IACX;IACT,YAAW,MAAK;KACd,CAAI,EAAE,QAAQ,WAAW,EAAE,QAAQ,SACjC,EAAE,eAAe,GACjB,EAAQ;IAEZ;IACA,IAAI;KACF,UAAU;KACV,UAAU;KACV,SAAS;KACT,YAAY;KACZ,KAAK;KACL,QAAQ;KACR,cAAc;KACd,GAAG;KACH,GAAG;KACH,WAAW,EAAE,iBAAiB,eAAe;IAC/C;cAtBF,CAwBE,kBAAC,GAAD;KAAK,IAAI;MAAE,UAAU;MAAG,UAAU;KAAE;eAApC,CACE,kBAAC,GAAD;MACE,SAAQ;MACR,YAAY;MACZ,QAAA;MACA,OAAO;gBAEN;KACS,CAAA,GACZ,kBAAC,GAAD;MACE,WAAU;MACV,SAAS;MACT,YAAW;MACX,IAAI,EAAE,IAAI,IAAK;gBAJjB;OAME,kBAAC,GAAD;QAAY,SAAQ;QAAU,OAAM;kBACjC,EAAe,CAAI;OACV,CAAA;OACX,KACC,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,GAAD;QAAY,SAAQ;QAAU,OAAM;kBAAiB;OAEzC,CAAA,GACZ,kBAAC,GAAD;QAAY,SAAQ;QAAU,OAAM;kBAAiB;OAEzC,CAAA,CACZ,EAAA,CAAA;OAEH,MAAY,YACX,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,GAAD;QAAY,SAAQ;QAAU,OAAM;kBAAiB;OAEzC,CAAA,GACZ,kBAAC,GAAD;QAAY,SAAQ;QAAU,OAAM;kBACjC,EAAuB,CAAO;OACrB,CAAA,CACZ,EAAA,CAAA;MAEC;OACJ;QACL,kBAAC,GAAD;KACE,OAAO,IAAgB,YAAY;KACnC,MAAK;KACL,OAAO,IAAgB,YAAY;KACnC,SAAQ;IACT,CAAA,CACE;KACF;;CACA,CAAA;AAEX"}
1
+ {"version":3,"file":"FieldLibraryRow.js","names":[],"sources":["../../../src/components/FormTemplateEditor/FieldLibraryRow.tsx"],"sourcesContent":["import { useDraggable } from '@dnd-kit/react'\nimport { Box, Chip, Paper, Stack, Typography } from '@mui/material'\nimport DragHandleIcon from '@mui/icons-material/DragIndicator'\nimport { RJSFSchema } from '@rjsf/utils'\nimport {\n SchemaPropertyContext,\n submissionContextLabel,\n} from '@/utils/jsonschema/submissionContext'\nimport styles from './dragHandle.module.scss'\nimport { detectFieldType, fieldTypeLabel } from './schemaFieldUtils'\nimport { FIELD_DRAG_TYPE, fieldDragData } from './sortableIds'\n\nexport type FieldLibraryRowProps = {\n propertyKey: string\n property: RJSFSchema\n isRequired: boolean\n /** Which submission context (per the schema's `x-synapse-submissionContext` convention)\n * gates this property. `ALWAYS` properties show no badge. */\n context: SchemaPropertyContext\n isUsedInSteps: boolean\n onClick: () => void\n}\n\n/**\n * A compact row in the field library. Click anywhere to edit the field's\n * definition; grab the drag indicator on the left to bind it to a step.\n * Rows already bound to a step are non-draggable.\n */\nexport function FieldLibraryRow({\n propertyKey,\n property,\n isRequired,\n context,\n isUsedInSteps,\n onClick,\n}: FieldLibraryRowProps) {\n const type = detectFieldType(property)\n const displayLabel = property.title || propertyKey\n\n const { ref, handleRef, isDragging } = useDraggable({\n id: `field:${propertyKey}`,\n type: FIELD_DRAG_TYPE,\n data: fieldDragData(propertyKey),\n disabled: isUsedInSteps,\n })\n\n return (\n <Paper\n ref={ref}\n variant=\"outlined\"\n className={styles.dragSource}\n data-dragging={isDragging}\n sx={{ p: 1.25 }}\n >\n <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5 }}>\n <Box\n ref={handleRef}\n role=\"button\"\n tabIndex={isUsedInSteps ? -1 : 0}\n aria-label={\n isUsedInSteps ? 'Already in a form step' : 'Drag to add to a step'\n }\n className={styles.dragHandle}\n sx={{\n color: isUsedInSteps ? 'text.disabled' : 'text.secondary',\n cursor: isUsedInSteps ? 'not-allowed' : undefined,\n }}\n >\n <DragHandleIcon fontSize=\"small\" />\n </Box>\n <Box\n role=\"button\"\n tabIndex={0}\n aria-label={`Edit ${displayLabel}`}\n onClick={onClick}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n onClick()\n }\n }}\n sx={{\n flexGrow: 1,\n minWidth: 0,\n display: 'flex',\n alignItems: 'center',\n gap: 0.5,\n cursor: 'pointer',\n borderRadius: 1,\n p: 0.5,\n m: -0.5,\n '&:hover': { backgroundColor: 'action.hover' },\n }}\n >\n <Box sx={{ flexGrow: 1, minWidth: 0 }}>\n <Typography\n variant=\"body2\"\n fontWeight={500}\n noWrap\n title={displayLabel}\n >\n {displayLabel}\n </Typography>\n <Stack\n direction=\"row\"\n spacing={0.5}\n alignItems=\"center\"\n sx={{ mt: 0.25 }}\n >\n <Typography variant=\"caption\" color=\"text.secondary\">\n {fieldTypeLabel(type)}\n </Typography>\n {isRequired && (\n <>\n <Typography variant=\"caption\" color=\"text.secondary\">\n ·\n </Typography>\n <Typography variant=\"caption\" color=\"text.secondary\">\n Required\n </Typography>\n </>\n )}\n {context !== 'ALWAYS' && (\n <>\n <Typography variant=\"caption\" color=\"text.secondary\">\n ·\n </Typography>\n <Typography variant=\"caption\" color=\"text.secondary\">\n {submissionContextLabel(context)}\n </Typography>\n </>\n )}\n </Stack>\n </Box>\n <Chip\n label={isUsedInSteps ? 'In form' : 'Not in form'}\n size=\"small\"\n color={isUsedInSteps ? 'success' : 'warning'}\n variant=\"outlined\"\n />\n </Box>\n </Box>\n </Paper>\n )\n}\n"],"mappings":";;;;;;;;;AA4BA,SAAgB,EAAgB,EAC9B,gBACA,aACA,eACA,YACA,kBACA,cACuB;CACvB,IAAM,IAAO,EAAgB,CAAQ,GAC/B,IAAe,EAAS,SAAS,GAEjC,EAAE,QAAK,cAAW,kBAAe,EAAa;EAClD,IAAI,SAAS;EACb,MAAM;EACN,MAAM,EAAc,CAAW;EAC/B,UAAU;CACZ,CAAC;CAED,OACE,kBAAC,GAAD;EACO;EACL,SAAQ;EACR,WAAW,EAAO;EAClB,iBAAe;EACf,IAAI,EAAE,GAAG,KAAK;YAEd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B;OAEzC,CAAA,GACZ,kBAAC,GAAD;QAAY,SAAQ;QAAU,OAAM;kBACjC,EAAuB,CAAO;OACrB,CAAA,CACZ,EAAA,CAAA;MAEC;OACJ;QACL,kBAAC,GAAD;KACE,OAAO,IAAgB,YAAY;KACnC,MAAK;KACL,OAAO,IAAgB,YAAY;KACnC,SAAQ;IACT,CAAA,CACE;KACF;;CACA,CAAA;AAEX"}
@@ -4,7 +4,7 @@ import { createEditableStep as n } from "./utils.js";
4
4
  import { StepCard as r } from "./StepCard.js";
5
5
  import { Alert as i, Box as a, Button as o, Paper as s, Stack as c, Typography as l } from "@mui/material";
6
6
  import { jsx as u, jsxs as d } from "react/jsx-runtime";
7
- import { Add as f } from "@mui/icons-material";
7
+ import f from "@mui/icons-material/Add";
8
8
  import p from "pluralize";
9
9
  //#region src/components/FormTemplateEditor/FormStructurePanel.tsx
10
10
  function m({ steps: m, jsonSchema: h, unboundProperties: g, formTemplateId: _, onStepsChange: v, onBindField: y }) {
@@ -1 +1 @@
1
- {"version":3,"file":"FormStructurePanel.js","names":[],"sources":["../../../src/components/FormTemplateEditor/FormStructurePanel.tsx"],"sourcesContent":["import { FormTemplateStep } from '@sage-bionetworks/synapse-client'\nimport { Alert, Box, Button, Paper, Stack, Typography } from '@mui/material'\nimport { Add as AddIcon } from '@mui/icons-material'\nimport pluralize from 'pluralize'\nimport { RJSFSchema } from '@rjsf/utils'\nimport {\n propertyKeyToPointer,\n ResolvedSchemaProperty,\n} from '@/utils/jsonschema/submissionContext'\nimport { StepCard } from './StepCard'\nimport {\n BIND_FIELD_LABEL,\n createEditableStep,\n EditableFormTemplateStep,\n moveItem,\n} from './utils'\n\nexport type FormStructurePanelProps = {\n steps: EditableFormTemplateStep[]\n jsonSchema: RJSFSchema\n /** Properties not yet bound to any step in the template. */\n unboundProperties: ResolvedSchemaProperty[]\n /** The FormTemplate's id, if it has been saved. Threaded down to file-field template uploads. */\n formTemplateId: string | undefined\n onStepsChange: (next: EditableFormTemplateStep[]) => void\n onBindField: (propertyKey: string, stepKey: string) => void\n}\n\n/**\n * Right pane: the multi-step form structure. Steps are collapsible cards;\n * each step contains a list of field slots (with inline-expand for slot config)\n * and a \"Bind field\" dropdown listing any library fields not yet bound to a\n * step.\n */\nexport function FormStructurePanel({\n steps,\n jsonSchema,\n unboundProperties,\n formTemplateId,\n onStepsChange,\n onBindField,\n}: FormStructurePanelProps) {\n const handleStepChange = (idx: number, patch: Partial<FormTemplateStep>) => {\n onStepsChange(steps.map((s, i) => (i === idx ? { ...s, ...patch } : s)))\n }\n\n const handleAddStep = () => {\n onStepsChange([...steps, createEditableStep()])\n }\n\n const handleRemoveStep = (idx: number) => {\n onStepsChange(steps.filter((_, i) => i !== idx))\n }\n\n const handleMoveStep = (idx: number, direction: -1 | 1) => {\n onStepsChange(moveItem(steps, idx, direction))\n }\n\n const requiredUnbound = unboundProperties.filter(p => p.isRequired)\n const optionalUnbound = unboundProperties.filter(p => !p.isRequired)\n\n return (\n <Paper variant=\"outlined\" sx={{ p: 2, height: '100%' }}>\n <Box\n sx={{\n mb: 1.5,\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'flex-start',\n gap: 1,\n }}\n >\n <Box>\n <Typography variant=\"subtitle2\">Steps</Typography>\n <Typography variant=\"caption\" color=\"text.secondary\">\n Arrange fields into pages requesters will fill out in order.\n </Typography>\n </Box>\n <Button\n size=\"small\"\n variant=\"outlined\"\n startIcon={<AddIcon />}\n onClick={handleAddStep}\n >\n Add step\n </Button>\n </Box>\n\n {requiredUnbound.length > 0 && (\n <Alert severity=\"error\" sx={{ mb: 1.5 }}>\n {pluralize('required field', requiredUnbound.length, true)}{' '}\n {pluralize('is', requiredUnbound.length)} not bound to a step and must\n be bound before saving:{' '}\n {requiredUnbound\n .map(p => p.subSchema.title ?? propertyKeyToPointer(p.propertyKey))\n .join(', ')}\n .\n </Alert>\n )}\n\n {optionalUnbound.length > 0 && (\n <Alert severity=\"warning\" sx={{ mb: 1.5 }}>\n {pluralize('field', optionalUnbound.length, true)}{' '}\n {pluralize('is', optionalUnbound.length)} not yet bound to a step. Use\n a step's \"{BIND_FIELD_LABEL}\" dropdown to add{' '}\n {optionalUnbound.length === 1 ? 'it' : 'them'}.\n </Alert>\n )}\n\n <Stack spacing={1.5}>\n {steps.length === 0 ? (\n <Alert severity=\"info\">\n No steps yet. Click \"Add step\" to create the first one.\n </Alert>\n ) : (\n steps.map((step, stepIdx) => (\n <StepCard\n key={step.uiKey}\n step={step}\n stepIndex={stepIdx}\n isFirst={stepIdx === 0}\n isLast={stepIdx === steps.length - 1}\n unboundProperties={unboundProperties}\n jsonSchema={jsonSchema}\n formTemplateId={formTemplateId}\n defaultExpanded={stepIdx === 0}\n onChange={patch => handleStepChange(stepIdx, patch)}\n onBindField={propertyKey => onBindField(propertyKey, step.uiKey)}\n onMoveUp={() => handleMoveStep(stepIdx, -1)}\n onMoveDown={() => handleMoveStep(stepIdx, 1)}\n onRemove={() => handleRemoveStep(stepIdx)}\n />\n ))\n )}\n </Stack>\n </Paper>\n )\n}\n"],"mappings":";;;;;;;;;AAkCA,SAAgB,EAAmB,EACjC,UACA,eACA,sBACA,mBACA,kBACA,kBAC0B;CAC1B,IAAM,KAAoB,GAAa,MAAqC;EAC1E,EAAc,EAAM,KAAK,GAAG,MAAO,MAAM,IAAM;GAAE,GAAG;GAAG,GAAG;EAAM,IAAI,CAAE,CAAC;CACzE,GAEM,UAAsB;EAC1B,EAAc,CAAC,GAAG,GAAO,EAAmB,CAAC,CAAC;CAChD,GAEM,KAAoB,MAAgB;EACxC,EAAc,EAAM,QAAQ,GAAG,MAAM,MAAM,CAAG,CAAC;CACjD,GAEM,KAAkB,GAAa,MAAsB;EACzD,EAAc,EAAS,GAAO,GAAK,CAAS,CAAC;CAC/C,GAEM,IAAkB,EAAkB,QAAO,MAAK,EAAE,UAAU,GAC5D,IAAkB,EAAkB,QAAO,MAAK,CAAC,EAAE,UAAU;CAEnE,OACE,kBAAC,GAAD;EAAO,SAAQ;EA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AAa,EAAK,KAAK;KAC/D,gBAAgB,EAAe,GAAS,EAAE;KAC1C,kBAAkB,EAAe,GAAS,CAAC;KAC3C,gBAAgB,EAAiB,CAAO;IACzC,GAdM,EAAK,KAcX,CACF;GAEE,CAAA;EACF;;AAEX"}
1
+ {"version":3,"file":"FormStructurePanel.js","names":[],"sources":["../../../src/components/FormTemplateEditor/FormStructurePanel.tsx"],"sourcesContent":["import { FormTemplateStep } from '@sage-bionetworks/synapse-client'\nimport { Alert, Box, Button, Paper, Stack, Typography } from '@mui/material'\nimport AddIcon from '@mui/icons-material/Add'\nimport pluralize from 'pluralize'\nimport { RJSFSchema } from '@rjsf/utils'\nimport {\n propertyKeyToPointer,\n ResolvedSchemaProperty,\n} from '@/utils/jsonschema/submissionContext'\nimport { StepCard } from './StepCard'\nimport {\n BIND_FIELD_LABEL,\n createEditableStep,\n EditableFormTemplateStep,\n moveItem,\n} from './utils'\n\nexport type FormStructurePanelProps = {\n steps: EditableFormTemplateStep[]\n jsonSchema: RJSFSchema\n /** Properties not yet bound to any step in the template. */\n unboundProperties: ResolvedSchemaProperty[]\n /** The FormTemplate's id, if it has been saved. Threaded down to file-field template uploads. */\n formTemplateId: string | undefined\n onStepsChange: (next: EditableFormTemplateStep[]) => void\n onBindField: (propertyKey: string, stepKey: string) => void\n}\n\n/**\n * Right pane: the multi-step form structure. Steps are collapsible cards;\n * each step contains a list of field slots (with inline-expand for slot config)\n * and a \"Bind field\" dropdown listing any library fields not yet bound to a\n * step.\n */\nexport function FormStructurePanel({\n steps,\n jsonSchema,\n unboundProperties,\n formTemplateId,\n onStepsChange,\n onBindField,\n}: FormStructurePanelProps) {\n const handleStepChange = (idx: number, patch: Partial<FormTemplateStep>) => {\n onStepsChange(steps.map((s, i) => (i === idx ? { ...s, ...patch } : s)))\n }\n\n const handleAddStep = () => {\n onStepsChange([...steps, createEditableStep()])\n }\n\n const handleRemoveStep = (idx: number) => {\n onStepsChange(steps.filter((_, i) => i !== idx))\n }\n\n const handleMoveStep = (idx: number, direction: -1 | 1) => {\n onStepsChange(moveItem(steps, idx, direction))\n }\n\n const requiredUnbound = unboundProperties.filter(p => p.isRequired)\n const optionalUnbound = unboundProperties.filter(p => !p.isRequired)\n\n return (\n <Paper variant=\"outlined\" sx={{ p: 2, height: '100%' }}>\n <Box\n sx={{\n mb: 1.5,\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'flex-start',\n gap: 1,\n }}\n >\n <Box>\n <Typography variant=\"subtitle2\">Steps</Typography>\n <Typography variant=\"caption\" color=\"text.secondary\">\n Arrange fields into pages requesters will fill out in order.\n </Typography>\n </Box>\n <Button\n size=\"small\"\n variant=\"outlined\"\n startIcon={<AddIcon />}\n onClick={handleAddStep}\n >\n Add step\n </Button>\n </Box>\n\n {requiredUnbound.length > 0 && (\n <Alert severity=\"error\" sx={{ mb: 1.5 }}>\n {pluralize('required field', requiredUnbound.length, true)}{' '}\n {pluralize('is', requiredUnbound.length)} not bound to a step and must\n be bound before saving:{' '}\n {requiredUnbound\n .map(p => p.subSchema.title ?? propertyKeyToPointer(p.propertyKey))\n .join(', ')}\n .\n </Alert>\n )}\n\n {optionalUnbound.length > 0 && (\n <Alert severity=\"warning\" sx={{ mb: 1.5 }}>\n {pluralize('field', optionalUnbound.length, true)}{' '}\n {pluralize('is', optionalUnbound.length)} not yet bound to a step. Use\n a step's \"{BIND_FIELD_LABEL}\" dropdown to add{' '}\n {optionalUnbound.length === 1 ? 'it' : 'them'}.\n </Alert>\n )}\n\n <Stack spacing={1.5}>\n {steps.length === 0 ? (\n <Alert severity=\"info\">\n No steps yet. Click \"Add step\" to create the first one.\n </Alert>\n ) : (\n steps.map((step, stepIdx) => (\n <StepCard\n key={step.uiKey}\n step={step}\n stepIndex={stepIdx}\n isFirst={stepIdx === 0}\n isLast={stepIdx === steps.length - 1}\n unboundProperties={unboundProperties}\n jsonSchema={jsonSchema}\n formTemplateId={formTemplateId}\n defaultExpanded={stepIdx === 0}\n onChange={patch => handleStepChange(stepIdx, patch)}\n onBindField={propertyKey => onBindField(propertyKey, step.uiKey)}\n onMoveUp={() => handleMoveStep(stepIdx, -1)}\n onMoveDown={() => handleMoveStep(stepIdx, 1)}\n onRemove={() => handleRemoveStep(stepIdx)}\n />\n ))\n )}\n </Stack>\n </Paper>\n )\n}\n"],"mappings":";;;;;;;;;AAkCA,SAAgB,EAAmB,EACjC,UACA,eACA,sBACA,mBACA,kBACA,kBAC0B;CAC1B,IAAM,KAAoB,GAAa,MAAqC;EAC1E,EAAc,EAAM,KAAK,GAAG,MAAO,MAAM,IAAM;GAAE,GAAG;GAAG,GAAG;EAAM,IAAI,CAAE,CAAC;CACzE,GAEM,UAAsB;EAC1B,EAAc,CAAC,GAAG,GAAO,EAAmB,CAAC,CAAC;CAChD,GAEM,KAAoB,MAAgB;EACxC,EAAc,EAAM,QAAQ,GAAG,MAAM,MAAM,CAAG,CAAC;CACjD,GAEM,KAAkB,GAAa,MAAsB;EACzD,EAAc,EAAS,GAAO,GAAK,CAAS,CAAC;CAC/C,GAEM,IAAkB,EAAkB,QAAO,MAAK,EAAE,UAAU,GAC5D,IAAkB,EAAkB,QAAO,MAAK,CAAC,EAAE,UAAU;CAEnE,OACE,kBAAC,GAAD;EAAO,SAAQ;EAAW,IAAI;GAAE,GAAG;GAAG,QAAQ;EAAO;YAArD;GACE,kBAAC,GAAD;IACE,IAAI;KACF,IAAI;KACJ,SAAS;KACT,gBAAgB;KAChB,YAAY;KACZ,KAAK;IACP;cAPF,CASE,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD;KAAY,SAAQ;eAAY;IAAiB,CAAA,GACjD,kBAAC,GAAD;KAAY,SAAQ;KAAU,OAAM;eAAiB;IAEzC,CAAA,CACT,EAAA,CAAA,GACL,kBAAC,GAAD;KACE,MAAK;KACL,SAAQ;KACR,WAAW,kBAAC,GAAD,CAAU,CAAA;KACrB,SAAS;eACV;IAEO,CAAA,CACL;;GAEJ,EAAgB,SAAS,KACxB,kBAAC,GAAD;IAAO,UAAS;IAAQ,IAAI,EAAE,IAAI,IAAI;cAAtC;KACG,EAAU,kBAAkB,EAAgB,QAAQ,EAAI;KAAG;KAC3D,EAAU,MAAM,EAAgB,MAAM;KAAE;KACjB;KACvB,EACE,KAAI,MAAK,EAAE,UAAU,SAAS,EAAqB,EAAE,WAAW,CAAC,EACjE,KAAK,IAAI;KAAE;IAET;;GAGR,EAAgB,SAAS,KACxB,kBAAC,GAAD;IAAO,UAAS;IAAU,IAAI,EAAE,IAAI,IAAI;cAAxC;KACG,EAAU,SAAS,EAAgB,QAAQ,EAAI;KAAG;KAClD,EAAU,MAAM,EAAgB,MAAM;KAAE;;KACb;KAAkB;KAC7C,EAAgB,WAAW,IAAI,OAAO;KAAO;IACzC;;GAGT,kBAAC,GAAD;IAAO,SAAS;cACb,EAAM,WAAW,IAChB,kBAAC,GAAD;KAAO,UAAS;eAAO;IAEhB,CAAA,IAEP,EAAM,KAAK,GAAM,MACf,kBAAC,GAAD;KAEQ;KACN,WAAW;KACX,SAAS,MAAY;KACrB,QAAQ,MAAY,EAAM,SAAS;KAChB;KACP;KACI;KAChB,iBAAiB,MAAY;KAC7B,WAAU,MAAS,EAAiB,GAAS,CAAK;KAClD,cAAa,MAAe,EAAY,GAAa,EAAK,KAAK;KAC/D,gBAAgB,EAAe,GAAS,EAAE;KAC1C,kBAAkB,EAAe,GAAS,CAAC;KAC3C,gBAAgB,EAAiB,CAAO;IACzC,GAdM,EAAK,KAcX,CACF;GAEE,CAAA;EACF;;AAEX"}
@@ -18,7 +18,7 @@ import { useSaveFormTemplate as p } from "./useSaveFormTemplate.js";
18
18
  import { useMemo as m, useState as h } from "react";
19
19
  import { Accordion as g, AccordionDetails as _, AccordionSummary as ae, Alert as oe, Box as v, Button as y, Divider as b, Grid as x, Paper as S, TextField as C, Typography as w } from "@mui/material";
20
20
  import { jsx as T, jsxs as E } from "react/jsx-runtime";
21
- import { ExpandMore as D } from "@mui/icons-material";
21
+ import D from "@mui/icons-material/ExpandMore";
22
22
  import { DragDropProvider as O, DragOverlay as k } from "@dnd-kit/react";
23
23
  //#region src/components/FormTemplateEditor/FormTemplateEditorForm.tsx
24
24
  function A({ initialTemplate: A, initialJsonSchema: j, onSaved: M, onCancel: N }) {
@@ -1 +1 @@
1
- {"version":3,"file":"FormTemplateEditorForm.js","names":[],"sources":["../../../src/components/FormTemplateEditor/FormTemplateEditorForm.tsx"],"sourcesContent":["/*\n * Editing UI for a FormTemplate draft: composes the pure `useFormTemplateDraft` state with save\n * orchestration (`useSaveFormTemplate`) and client-side validation. Receives already-resolved\n * initial data — the caller (`FormTemplateEditor`)\n * owns fetching, so this component never renders a loading state.\n */\nimport { DragDropProvider, DragOverlay } from '@dnd-kit/react'\nimport { FormTemplate } from '@sage-bionetworks/synapse-client'\nimport { SynapseClientError } from '@sage-bionetworks/synapse-client/util/SynapseClientError'\nimport {\n Accordion,\n AccordionDetails,\n AccordionSummary,\n Alert,\n Box,\n Button,\n Divider,\n Grid,\n Paper,\n TextField,\n Typography,\n} from '@mui/material'\nimport { ExpandMore as ExpandMoreIcon } from '@mui/icons-material'\nimport { RJSFSchema } from '@rjsf/utils'\nimport { useMemo, useState } from 'react'\nimport { displayToast } from '@/components/ToastMessage'\nimport {\n propertyKeyToPointer,\n resolveSchemaPropertyAtPointer,\n} from '@/utils/jsonschema/submissionContext'\nimport { FieldDefinitionDrawer } from './FieldDefinitionDrawer'\nimport { FieldValidationErrorAlert } from './FieldValidationErrorAlert'\nimport { FieldLibrary } from './FieldLibrary'\nimport { FIELD_DRAG_TYPE, readFieldDragData } from './sortableIds'\nimport { FormStructurePanel } from './FormStructurePanel'\nimport { FormTemplatePreview } from './FormTemplatePreview'\nimport { JsonSchemaBodyEditor } from './JsonSchemaBodyEditor'\nimport { detectFieldType, fieldTypeLabel } from './schemaFieldUtils'\nimport {\n formatSchema$id,\n resolveFormTemplateSchemaName,\n} from './formTemplateSchema'\nimport { toFormTemplateSteps } from './utils'\nimport {\n FormTemplateFieldValidationError,\n validateFormTemplateFields,\n} from './formTemplateValidation'\nimport { useFormTemplateDraft } from './useFormTemplateDraft'\nimport { useFormTemplateDrag } from './useFormTemplateDrag'\nimport { useSaveFormTemplate } from './useSaveFormTemplate'\n\nexport type FormTemplateEditorFormProps = {\n /** Existing template to edit, or undefined for creating a new one. */\n initialTemplate?: FormTemplate\n /**\n * The JSON Schema body the template's `schema$id` resolves to. Required when editing an\n * existing template.\n */\n initialJsonSchema?: RJSFSchema\n onSaved?: (template: FormTemplate) => void\n onCancel?: () => void\n}\n\nexport function FormTemplateEditorForm({\n initialTemplate,\n initialJsonSchema,\n onSaved,\n onCancel,\n}: FormTemplateEditorFormProps) {\n const draft = useFormTemplateDraft(initialTemplate, initialJsonSchema)\n const {\n name,\n setName,\n jsonSchema,\n setJsonSchema,\n steps,\n setSteps,\n editingPropertyKey,\n setEditingPropertyKey,\n usedPaths,\n existingPropertyKeys,\n unboundProperties,\n handleCreateField,\n renamePropertyKey,\n handleUpdateProperty,\n handleReplaceProperty,\n handleChangeRequired,\n handleChangeContext,\n handleRemoveProperty,\n bindField,\n previewTemplate,\n } = draft\n const dragHandlers = useFormTemplateDrag(draft)\n\n const { mutateAsync: save, isPending: isSaving } = useSaveFormTemplate()\n const [saveError, setSaveError] = useState<\n FormTemplateFieldValidationError[] | null\n >(null)\n\n const validationErrors = useMemo(\n () => validateFormTemplateFields(toFormTemplateSteps(steps), jsonSchema),\n [steps, jsonSchema],\n )\n\n const handleSave = async () => {\n setSaveError(null)\n try {\n const result = await save({\n initialTemplate,\n initialJsonSchema,\n name,\n jsonSchema,\n steps,\n })\n if (!result.ok) {\n setSaveError(result.validationErrors)\n return\n }\n displayToast(\n initialTemplate\n ? 'Your changes were saved as a new version.'\n : 'The form template was created.',\n 'success',\n { title: 'Template saved' },\n )\n onSaved?.(result.template)\n } catch (error) {\n const clientError = error as SynapseClientError\n if (clientError.status === 412) {\n displayToast(\n 'This template was changed by someone else since you opened it. Reload it to see the latest version, then reapply your changes.',\n 'warning',\n { title: 'Template updated since you started editing' },\n )\n } else {\n displayToast(\n clientError.reason ?? 'An error occurred while saving.',\n 'danger',\n { title: 'Could not save template' },\n )\n }\n }\n }\n\n const editingResolved =\n editingPropertyKey !== null\n ? resolveSchemaPropertyAtPointer(\n jsonSchema,\n propertyKeyToPointer(editingPropertyKey),\n )\n : undefined\n const editingProperty: RJSFSchema | null = editingResolved?.subSchema ?? null\n const editingIsRequired = editingResolved?.isRequired ?? false\n const editingContext = editingResolved?.context ?? 'ALWAYS'\n const editingIsUsedInSteps =\n editingPropertyKey !== null &&\n usedPaths.has(propertyKeyToPointer(editingPropertyKey))\n\n const templateSchemaName = resolveFormTemplateSchemaName(\n name,\n initialTemplate?.schema$id,\n )\n\n return (\n <DragDropProvider {...dragHandlers}>\n <Paper sx={{ p: 3 }}>\n <Typography variant=\"h6\" gutterBottom>\n {initialTemplate ? 'Edit Form Template' : 'Create Form Template'}\n </Typography>\n\n <Divider sx={{ mb: 2 }} />\n\n <TextField\n label=\"Internal Name\"\n value={name}\n onChange={e => setName(e.target.value)}\n size=\"small\"\n fullWidth\n helperText=\"Used by ACT to identify and find this template. Not shown to requesters.\"\n sx={{ mb: 1 }}\n />\n <Typography\n variant=\"caption\"\n color=\"text.secondary\"\n component=\"p\"\n sx={{ mb: 3 }}\n >\n JSON Schema:{' '}\n {initialTemplate?.schema$id ?? formatSchema$id(templateSchemaName)}\n {!initialTemplate && ' (a new version is registered when saved)'}\n </Typography>\n\n <Grid container spacing={2} alignItems=\"stretch\">\n <Grid size={{ xs: 12, md: 4 }}>\n <FieldLibrary\n jsonSchema={jsonSchema}\n usedPaths={usedPaths}\n selectedPropertyKey={editingPropertyKey}\n onSelectField={setEditingPropertyKey}\n onCreateField={handleCreateField}\n />\n </Grid>\n <Grid size={{ xs: 12, md: 4 }}>\n <FormStructurePanel\n steps={steps}\n jsonSchema={jsonSchema}\n unboundProperties={unboundProperties}\n formTemplateId={initialTemplate?.id}\n onStepsChange={setSteps}\n onBindField={bindField}\n />\n </Grid>\n <Grid size={{ xs: 12, md: 4 }}>\n <Box sx={{ position: 'sticky', top: 16 }}>\n <Typography\n variant=\"subtitle2\"\n color=\"text.secondary\"\n gutterBottom\n >\n Live Preview\n </Typography>\n <FormTemplatePreview\n template={previewTemplate}\n jsonSchema={jsonSchema}\n />\n </Box>\n </Grid>\n </Grid>\n\n <Accordion\n sx={{ mt: 3 }}\n disableGutters\n elevation={0}\n variant=\"outlined\"\n >\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography variant=\"subtitle2\">\n Advanced: Edit raw JSON Schema\n </Typography>\n </AccordionSummary>\n <AccordionDetails>\n <Alert severity=\"info\" variant=\"outlined\" sx={{ mb: 2 }}>\n Direct access to the JSON Schema body. Most editing happens in the\n Fields panel above — use this view for features the simple editor\n doesn't support (nested objects, advanced validation, etc.).\n </Alert>\n <JsonSchemaBodyEditor value={jsonSchema} onChange={setJsonSchema} />\n </AccordionDetails>\n </Accordion>\n\n {validationErrors.length > 0 && (\n <FieldValidationErrorAlert errors={validationErrors}>\n Fix the following before saving:\n </FieldValidationErrorAlert>\n )}\n\n {saveError && <FieldValidationErrorAlert errors={saveError} />}\n\n <Divider sx={{ my: 2 }} />\n\n <Box sx={{ display: 'flex', justifyContent: 'flex-end', gap: 1 }}>\n {onCancel && (\n <Button variant=\"outlined\" onClick={onCancel} disabled={isSaving}>\n Cancel\n </Button>\n )}\n <Button\n variant=\"contained\"\n onClick={() => void handleSave()}\n disabled={!name || isSaving || validationErrors.length > 0}\n >\n {isSaving\n ? 'Saving…'\n : initialTemplate\n ? 'Save Changes'\n : 'Create Template'}\n </Button>\n </Box>\n\n <FieldDefinitionDrawer\n open={editingPropertyKey !== null}\n propertyKey={editingPropertyKey}\n existingKeys={existingPropertyKeys}\n property={editingProperty}\n isRequired={editingIsRequired}\n context={editingContext}\n isUsedInSteps={editingIsUsedInSteps}\n onClose={() => setEditingPropertyKey(null)}\n onUpdate={patch => {\n if (editingPropertyKey)\n handleUpdateProperty(editingPropertyKey, patch)\n }}\n onRenameKey={newKey => {\n if (editingPropertyKey)\n renamePropertyKey(editingPropertyKey, newKey)\n }}\n onReplace={next => {\n if (editingPropertyKey)\n handleReplaceProperty(editingPropertyKey, next)\n }}\n onChangeRequired={isReq => {\n if (editingPropertyKey)\n handleChangeRequired(editingPropertyKey, isReq)\n }}\n onChangeContext={context => {\n if (editingPropertyKey)\n handleChangeContext(editingPropertyKey, context)\n }}\n onRemove={() => {\n if (editingPropertyKey) handleRemoveProperty(editingPropertyKey)\n }}\n />\n </Paper>\n\n <DragOverlay>\n {source => {\n if (source.type !== FIELD_DRAG_TYPE) return null\n const propertyKey = readFieldDragData(source.data)\n if (!propertyKey) return null\n const property = resolveSchemaPropertyAtPointer(\n jsonSchema,\n propertyKeyToPointer(propertyKey),\n )?.subSchema\n if (!property) return null\n return (\n <Paper\n elevation={6}\n sx={{ p: 1.25, cursor: 'grabbing', opacity: 0.95 }}\n >\n <Typography variant=\"body2\" fontWeight={500}>\n {property.title || propertyKey}\n </Typography>\n <Typography variant=\"caption\" color=\"text.secondary\">\n {fieldTypeLabel(detectFieldType(property))}\n </Typography>\n </Paper>\n )\n }}\n </DragOverlay>\n </DragDropProvider>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA+DA,SAAgB,EAAuB,EACrC,oBACA,sBACA,YACA,eAC8B;CAC9B,IAAM,IAAQ,EAAqB,GAAiB,CAAiB,GAC/D,EACJ,SACA,YACA,eACA,kBACA,UACA,aACA,uBACA,0BACA,cACA,yBACA,sBACA,sBACA,sBACA,0BACA,2BACA,0BACA,yBACA,0BACA,eACA,wBACE,GACE,KAAe,EAAoB,CAAK,GAExC,EAAE,aAAa,IAAM,WAAW,MAAa,EAAoB,GACjE,CAAC,GAAW,KAAgB,EAEhC,IAAI,GAEA,IAAmB,QACjB,EAA2B,EAAoB,CAAK,GAAG,CAAU,GACvE,CAAC,GAAO,CAAU,CACpB,GAEM,KAAa,YAAY;E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AAY,SAAQ;KAAU,OAAM;eACjC,GAAe,GAAgB,CAAQ,CAAC;IAC/B,CAAA,CACP;QAZa;EAcxB,EACW,CAAA,CACG;;AAEtB"}
1
+ {"version":3,"file":"FormTemplateEditorForm.js","names":[],"sources":["../../../src/components/FormTemplateEditor/FormTemplateEditorForm.tsx"],"sourcesContent":["/*\n * Editing UI for a FormTemplate draft: composes the pure `useFormTemplateDraft` state with save\n * orchestration (`useSaveFormTemplate`) and client-side validation. Receives already-resolved\n * initial data — the caller (`FormTemplateEditor`)\n * owns fetching, so this component never renders a loading state.\n */\nimport { DragDropProvider, DragOverlay } from '@dnd-kit/react'\nimport { FormTemplate } from '@sage-bionetworks/synapse-client'\nimport { SynapseClientError } from '@sage-bionetworks/synapse-client/util/SynapseClientError'\nimport {\n Accordion,\n AccordionDetails,\n AccordionSummary,\n Alert,\n Box,\n Button,\n Divider,\n Grid,\n Paper,\n TextField,\n Typography,\n} from '@mui/material'\nimport ExpandMoreIcon from '@mui/icons-material/ExpandMore'\nimport { RJSFSchema } from '@rjsf/utils'\nimport { useMemo, useState } from 'react'\nimport { displayToast } from '@/components/ToastMessage'\nimport {\n propertyKeyToPointer,\n resolveSchemaPropertyAtPointer,\n} from '@/utils/jsonschema/submissionContext'\nimport { FieldDefinitionDrawer } from './FieldDefinitionDrawer'\nimport { FieldValidationErrorAlert } from './FieldValidationErrorAlert'\nimport { FieldLibrary } from './FieldLibrary'\nimport { FIELD_DRAG_TYPE, readFieldDragData } from './sortableIds'\nimport { FormStructurePanel } from './FormStructurePanel'\nimport { FormTemplatePreview } from './FormTemplatePreview'\nimport { JsonSchemaBodyEditor } from './JsonSchemaBodyEditor'\nimport { detectFieldType, fieldTypeLabel } from './schemaFieldUtils'\nimport {\n formatSchema$id,\n resolveFormTemplateSchemaName,\n} from './formTemplateSchema'\nimport { toFormTemplateSteps } from './utils'\nimport {\n FormTemplateFieldValidationError,\n validateFormTemplateFields,\n} from './formTemplateValidation'\nimport { useFormTemplateDraft } from './useFormTemplateDraft'\nimport { useFormTemplateDrag } from './useFormTemplateDrag'\nimport { useSaveFormTemplate } from './useSaveFormTemplate'\n\nexport type FormTemplateEditorFormProps = {\n /** Existing template to edit, or undefined for creating a new one. */\n initialTemplate?: FormTemplate\n /**\n * The JSON Schema body the template's `schema$id` resolves to. Required when editing an\n * existing template.\n */\n initialJsonSchema?: RJSFSchema\n onSaved?: (template: FormTemplate) => void\n onCancel?: () => void\n}\n\nexport function FormTemplateEditorForm({\n initialTemplate,\n initialJsonSchema,\n onSaved,\n onCancel,\n}: FormTemplateEditorFormProps) {\n const draft = useFormTemplateDraft(initialTemplate, initialJsonSchema)\n const {\n name,\n setName,\n jsonSchema,\n setJsonSchema,\n steps,\n setSteps,\n editingPropertyKey,\n setEditingPropertyKey,\n usedPaths,\n existingPropertyKeys,\n unboundProperties,\n handleCreateField,\n renamePropertyKey,\n handleUpdateProperty,\n handleReplaceProperty,\n handleChangeRequired,\n handleChangeContext,\n handleRemoveProperty,\n bindField,\n previewTemplate,\n } = draft\n const dragHandlers = useFormTemplateDrag(draft)\n\n const { mutateAsync: save, isPending: isSaving } = useSaveFormTemplate()\n const [saveError, setSaveError] = useState<\n FormTemplateFieldValidationError[] | null\n >(null)\n\n const validationErrors = useMemo(\n () => validateFormTemplateFields(toFormTemplateSteps(steps), jsonSchema),\n [steps, jsonSchema],\n )\n\n const handleSave = async () => {\n setSaveError(null)\n try {\n const result = await save({\n initialTemplate,\n initialJsonSchema,\n name,\n jsonSchema,\n steps,\n })\n if (!result.ok) {\n setSaveError(result.validationErrors)\n return\n }\n displayToast(\n initialTemplate\n ? 'Your changes were saved as a new version.'\n : 'The form template was created.',\n 'success',\n { title: 'Template saved' },\n )\n onSaved?.(result.template)\n } catch (error) {\n const clientError = error as SynapseClientError\n if (clientError.status === 412) {\n displayToast(\n 'This template was changed by someone else since you opened it. Reload it to see the latest version, then reapply your changes.',\n 'warning',\n { title: 'Template updated since you started editing' },\n )\n } else {\n displayToast(\n clientError.reason ?? 'An error occurred while saving.',\n 'danger',\n { title: 'Could not save template' },\n )\n }\n }\n }\n\n const editingResolved =\n editingPropertyKey !== null\n ? resolveSchemaPropertyAtPointer(\n jsonSchema,\n propertyKeyToPointer(editingPropertyKey),\n )\n : undefined\n const editingProperty: RJSFSchema | null = editingResolved?.subSchema ?? null\n const editingIsRequired = editingResolved?.isRequired ?? false\n const editingContext = editingResolved?.context ?? 'ALWAYS'\n const editingIsUsedInSteps =\n editingPropertyKey !== null &&\n usedPaths.has(propertyKeyToPointer(editingPropertyKey))\n\n const templateSchemaName = resolveFormTemplateSchemaName(\n name,\n initialTemplate?.schema$id,\n )\n\n return (\n <DragDropProvider {...dragHandlers}>\n <Paper sx={{ p: 3 }}>\n <Typography variant=\"h6\" gutterBottom>\n {initialTemplate ? 'Edit Form Template' : 'Create Form Template'}\n </Typography>\n\n <Divider sx={{ mb: 2 }} />\n\n <TextField\n label=\"Internal Name\"\n value={name}\n onChange={e => setName(e.target.value)}\n size=\"small\"\n fullWidth\n helperText=\"Used by ACT to identify and find this template. Not shown to requesters.\"\n sx={{ mb: 1 }}\n />\n <Typography\n variant=\"caption\"\n color=\"text.secondary\"\n component=\"p\"\n sx={{ mb: 3 }}\n >\n JSON Schema:{' '}\n {initialTemplate?.schema$id ?? formatSchema$id(templateSchemaName)}\n {!initialTemplate && ' (a new version is registered when saved)'}\n </Typography>\n\n <Grid container spacing={2} alignItems=\"stretch\">\n <Grid size={{ xs: 12, md: 4 }}>\n <FieldLibrary\n jsonSchema={jsonSchema}\n usedPaths={usedPaths}\n selectedPropertyKey={editingPropertyKey}\n onSelectField={setEditingPropertyKey}\n onCreateField={handleCreateField}\n />\n </Grid>\n <Grid size={{ xs: 12, md: 4 }}>\n <FormStructurePanel\n steps={steps}\n jsonSchema={jsonSchema}\n unboundProperties={unboundProperties}\n formTemplateId={initialTemplate?.id}\n onStepsChange={setSteps}\n onBindField={bindField}\n />\n </Grid>\n <Grid size={{ xs: 12, md: 4 }}>\n <Box sx={{ position: 'sticky', top: 16 }}>\n <Typography\n variant=\"subtitle2\"\n color=\"text.secondary\"\n gutterBottom\n >\n Live Preview\n </Typography>\n <FormTemplatePreview\n template={previewTemplate}\n jsonSchema={jsonSchema}\n />\n </Box>\n </Grid>\n </Grid>\n\n <Accordion\n sx={{ mt: 3 }}\n disableGutters\n elevation={0}\n variant=\"outlined\"\n >\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography variant=\"subtitle2\">\n Advanced: Edit raw JSON Schema\n </Typography>\n </AccordionSummary>\n <AccordionDetails>\n <Alert severity=\"info\" variant=\"outlined\" sx={{ mb: 2 }}>\n Direct access to the JSON Schema body. Most editing happens in the\n Fields panel above — use this view for features the simple editor\n doesn't support (nested objects, advanced validation, etc.).\n </Alert>\n <JsonSchemaBodyEditor value={jsonSchema} onChange={setJsonSchema} />\n </AccordionDetails>\n </Accordion>\n\n {validationErrors.length > 0 && (\n <FieldValidationErrorAlert errors={validationErrors}>\n Fix the following before saving:\n </FieldValidationErrorAlert>\n )}\n\n {saveError && <FieldValidationErrorAlert errors={saveError} />}\n\n <Divider sx={{ my: 2 }} />\n\n <Box sx={{ display: 'flex', justifyContent: 'flex-end', gap: 1 }}>\n {onCancel && (\n <Button variant=\"outlined\" onClick={onCancel} disabled={isSaving}>\n Cancel\n </Button>\n )}\n <Button\n variant=\"contained\"\n onClick={() => void handleSave()}\n disabled={!name || isSaving || validationErrors.length > 0}\n >\n {isSaving\n ? 'Saving…'\n : initialTemplate\n ? 'Save Changes'\n : 'Create Template'}\n </Button>\n </Box>\n\n <FieldDefinitionDrawer\n open={editingPropertyKey !== null}\n propertyKey={editingPropertyKey}\n existingKeys={existingPropertyKeys}\n property={editingProperty}\n isRequired={editingIsRequired}\n context={editingContext}\n isUsedInSteps={editingIsUsedInSteps}\n onClose={() => setEditingPropertyKey(null)}\n onUpdate={patch => {\n if (editingPropertyKey)\n handleUpdateProperty(editingPropertyKey, patch)\n }}\n onRenameKey={newKey => {\n if (editingPropertyKey)\n renamePropertyKey(editingPropertyKey, newKey)\n }}\n onReplace={next => {\n if (editingPropertyKey)\n handleReplaceProperty(editingPropertyKey, next)\n }}\n onChangeRequired={isReq => {\n if (editingPropertyKey)\n handleChangeRequired(editingPropertyKey, isReq)\n }}\n onChangeContext={context => {\n if (editingPropertyKey)\n handleChangeContext(editingPropertyKey, context)\n }}\n onRemove={() => {\n if (editingPropertyKey) handleRemoveProperty(editingPropertyKey)\n }}\n />\n </Paper>\n\n <DragOverlay>\n {source => {\n if (source.type !== FIELD_DRAG_TYPE) return null\n const propertyKey = readFieldDragData(source.data)\n if (!propertyKey) return null\n const property = resolveSchemaPropertyAtPointer(\n jsonSchema,\n propertyKeyToPointer(propertyKey),\n )?.subSchema\n if (!property) return null\n return (\n <Paper\n elevation={6}\n sx={{ p: 1.25, cursor: 'grabbing', opacity: 0.95 }}\n >\n <Typography variant=\"body2\" fontWeight={500}>\n {property.title || propertyKey}\n </Typography>\n <Typography variant=\"caption\" color=\"text.secondary\">\n {fieldTypeLabel(detectFieldType(property))}\n </Typography>\n </Paper>\n )\n }}\n </DragOverlay>\n </DragDropProvider>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA+DA,SAAgB,EAAuB,EACrC,oBACA,sBACA,YACA,eAC8B;CAC9B,IAAM,IAAQ,EAAqB,GAAiB,CAAiB,GAC/D,EACJ,SACA,YACA,eACA,kBACA,UACA,aACA,uBACA,0BACA,cACA,yBACA,sBACA,sBACA,sBACA,0BACA,2BACA,0BACA,yBACA,0BACA,eACA,wBACE,GACE,KAAe,EAAoB,CAAK,GAExC,EAAE,aAAa,IAAM,WAAW,MAAa,EAAoB,GACjE,CAAC,GAAW,KAAgB,EAEhC,IAAI,GAEA,IAAmB,QACjB,EAA2B,EAAoB,CAAK,GAAG,CAAU,GACvE,CAAC,GAAO,CAAU,CACpB,GAEM,KAAa,YAAY;EAC7B,EAAa,IAAI;EACjB,IAAI;GACF,IAAM,IAAS,MAAM,GA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;IAC/B,CAAA,CACP;QAZa;EAcxB,EACW,CAAA,CACG;;AAEtB"}
@@ -1 +1 @@
1
- {"version":3,"file":"StepCard.d.ts","sourceRoot":"","sources":["../../../src/components/FormTemplateEditor/StepCard.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,gBAAgB,EACjB,MAAM,kCAAkC,CAAA;AAmBzC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAGxC,OAAO,EAGL,sBAAsB,EAEvB,MAAM,sCAAsC,CAAA;AAa7C,OAAO,EAAoB,wBAAwB,EAAY,MAAM,SAAS,CAAA;AAS9E,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,wBAAwB,CAAA;IAC9B,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,OAAO,CAAA;IACf,4DAA4D;IAC5D,iBAAiB,EAAE,sBAAsB,EAAE,CAAA;IAC3C,0EAA0E;IAC1E,UAAU,EAAE,UAAU,CAAA;IACtB,iGAAiG;IACjG,cAAc,EAAE,MAAM,GAAG,SAAS,CAAA;IAClC,wDAAwD;IACxD,eAAe,EAAE,OAAO,CAAA;IACxB,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAA;IACpD,WAAW,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAA;IAC1C,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,UAAU,EAAE,MAAM,IAAI,CAAA;IACtB,QAAQ,EAAE,MAAM,IAAI,CAAA;CACrB,CAAA;AAED,wBAAgB,QAAQ,CAAC,EACvB,IAAI,EACJ,SAAS,EACT,OAAO,EACP,MAAM,EACN,iBAAiB,EACjB,UAAU,EACV,cAAc,EACd,eAAe,EACf,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,UAAU,EACV,QAAQ,GACT,EAAE,aAAa,2CAoNf"}
1
+ {"version":3,"file":"StepCard.d.ts","sourceRoot":"","sources":["../../../src/components/FormTemplateEditor/StepCard.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,gBAAgB,EACjB,MAAM,kCAAkC,CAAA;AAiBzC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAGxC,OAAO,EAGL,sBAAsB,EAEvB,MAAM,sCAAsC,CAAA;AAa7C,OAAO,EAAoB,wBAAwB,EAAY,MAAM,SAAS,CAAA;AAS9E,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,wBAAwB,CAAA;IAC9B,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,OAAO,CAAA;IACf,4DAA4D;IAC5D,iBAAiB,EAAE,sBAAsB,EAAE,CAAA;IAC3C,0EAA0E;IAC1E,UAAU,EAAE,UAAU,CAAA;IACtB,iGAAiG;IACjG,cAAc,EAAE,MAAM,GAAG,SAAS,CAAA;IAClC,wDAAwD;IACxD,eAAe,EAAE,OAAO,CAAA;IACxB,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAA;IACpD,WAAW,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAA;IAC1C,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,UAAU,EAAE,MAAM,IAAI,CAAA;IACtB,QAAQ,EAAE,MAAM,IAAI,CAAA;CACrB,CAAA;AAED,wBAAgB,QAAQ,CAAC,EACvB,IAAI,EACJ,SAAS,EACT,OAAO,EACP,MAAM,EACN,iBAAiB,EACjB,UAAU,EACV,cAAc,EACd,eAAe,EACf,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,UAAU,EACV,QAAQ,GACT,EAAE,aAAa,2CAoNf"}
@@ -8,9 +8,14 @@ import { BIND_FIELD_LABEL as m } from "./utils.js";
8
8
  import { useState as h } from "react";
9
9
  import { Box as g, Collapse as _, IconButton as v, MenuItem as y, Paper as b, Stack as ee, TextField as x, Typography as S } from "@mui/material";
10
10
  import { jsx as C, jsxs as w } from "react/jsx-runtime";
11
- import { ArrowDownward as T, ArrowUpward as E, Delete as D, DragIndicator as O, ExpandLess as k, ExpandMore as A } from "@mui/icons-material";
12
- import j from "pluralize";
13
- import { useDroppable as M } from "@dnd-kit/react";
11
+ import T from "@mui/icons-material/ExpandLess";
12
+ import E from "@mui/icons-material/ExpandMore";
13
+ import D from "@mui/icons-material/ArrowDownward";
14
+ import O from "@mui/icons-material/ArrowUpward";
15
+ import k from "pluralize";
16
+ import A from "@mui/icons-material/Delete";
17
+ import { useDroppable as j } from "@dnd-kit/react";
18
+ import M from "@mui/icons-material/DragIndicator";
14
19
  import { useSortable as N } from "@dnd-kit/react/sortable";
15
20
  //#region src/components/FormTemplateEditor/StepCard.tsx
16
21
  var P = 1;
@@ -21,7 +26,7 @@ function F({ step: F, stepIndex: I, isFirst: te, isLast: L, unboundProperties: R
21
26
  group: s,
22
27
  type: c,
23
28
  accept: [c, a]
24
- }), { ref: ne, isDropTarget: re } = M({
29
+ }), { ref: ne, isDropTarget: re } = j({
25
30
  id: l(F),
26
31
  accept: o,
27
32
  collisionPriority: P
@@ -34,7 +39,7 @@ function F({ step: F, stepIndex: I, isFirst: te, isLast: L, unboundProperties: R
34
39
  H({ fields: e(F.fields, t, n) });
35
40
  }, ae = (e) => {
36
41
  H({ fields: F.fields.filter((t, n) => n !== e) });
37
- }, oe = j("field", F.fields.length, !0);
42
+ }, oe = k("field", F.fields.length, !0);
38
43
  return /* @__PURE__ */ w(b, {
39
44
  ref: Y,
40
45
  variant: "outlined",
@@ -56,13 +61,13 @@ function F({ step: F, stepIndex: I, isFirst: te, isLast: L, unboundProperties: R
56
61
  "aria-label": "Drag to reorder step",
57
62
  className: i.dragHandle,
58
63
  sx: { color: "text.secondary" },
59
- children: /* @__PURE__ */ C(O, { fontSize: "small" })
64
+ children: /* @__PURE__ */ C(M, { fontSize: "small" })
60
65
  }),
61
66
  /* @__PURE__ */ C(v, {
62
67
  size: "small",
63
68
  onClick: () => J((e) => !e),
64
69
  "aria-label": q ? "Collapse step" : "Expand step",
65
- children: C(q ? k : A, { fontSize: "small" })
70
+ children: C(q ? T : E, { fontSize: "small" })
66
71
  }),
67
72
  /* @__PURE__ */ w(g, {
68
73
  sx: {
@@ -90,20 +95,20 @@ function F({ step: F, stepIndex: I, isFirst: te, isLast: L, unboundProperties: R
90
95
  disabled: te,
91
96
  onClick: W,
92
97
  "aria-label": "Move step up",
93
- children: /* @__PURE__ */ C(E, { fontSize: "small" })
98
+ children: /* @__PURE__ */ C(O, { fontSize: "small" })
94
99
  }),
95
100
  /* @__PURE__ */ C(v, {
96
101
  size: "small",
97
102
  disabled: L,
98
103
  onClick: G,
99
104
  "aria-label": "Move step down",
100
- children: /* @__PURE__ */ C(T, { fontSize: "small" })
105
+ children: /* @__PURE__ */ C(D, { fontSize: "small" })
101
106
  }),
102
107
  /* @__PURE__ */ C(v, {
103
108
  size: "small",
104
109
  onClick: K,
105
110
  "aria-label": "Remove step",
106
- children: /* @__PURE__ */ C(D, { fontSize: "small" })
111
+ children: /* @__PURE__ */ C(A, { fontSize: "small" })
107
112
  })
108
113
  ]
109
114
  }), /* @__PURE__ */ C(_, {
@@ -1 +1 @@
1
- {"version":3,"file":"StepCard.js","names":[],"sources":["../../../src/components/FormTemplateEditor/StepCard.tsx"],"sourcesContent":["import { useDroppable } from '@dnd-kit/react'\nimport { useSortable } from '@dnd-kit/react/sortable'\nimport {\n FormTemplateField,\n FormTemplateStep,\n} from '@sage-bionetworks/synapse-client'\nimport {\n Box,\n Collapse,\n IconButton,\n MenuItem,\n Paper,\n Stack,\n TextField,\n Typography,\n} from '@mui/material'\nimport {\n ArrowDownward as DownIcon,\n Delete as DeleteIcon,\n DragIndicator as DragHandleIcon,\n ExpandLess as ExpandLessIcon,\n ExpandMore as ExpandMoreIcon,\n ArrowUpward as UpIcon,\n} from '@mui/icons-material'\nimport { RJSFSchema } from '@rjsf/utils'\nimport pluralize from 'pluralize'\nimport { useState } from 'react'\nimport {\n pointerToPropertyKey,\n propertyKeyToPointer,\n ResolvedSchemaProperty,\n resolveSchemaPropertyAtPointer,\n} from '@/utils/jsonschema/submissionContext'\nimport dragHandleStyles from './dragHandle.module.scss'\nimport dropTargetStyles from './dropTarget.module.scss'\nimport { StepFieldRow } from './StepFieldRow'\nimport {\n FIELD_DRAG_TYPE,\n slotGroupId,\n SLOT_SORTABLE_TYPE,\n slotSortableId,\n stepSortableId,\n STEP_SORTABLE_GROUP,\n STEP_SORTABLE_TYPE,\n} from './sortableIds'\nimport { BIND_FIELD_LABEL, EditableFormTemplateStep, moveItem } from './utils'\n\n/**\n * The slot list must lose to the slot rows inside it so that dragging over a populated step\n * targets a row (which resolves to a precise insertion index) and only an empty or below-the-last-\n * row region falls through to the list itself.\n */\nconst SLOT_LIST_COLLISION_PRIORITY = 1\n\nexport type StepCardProps = {\n step: EditableFormTemplateStep\n stepIndex: number\n isFirst: boolean\n isLast: boolean\n /** Properties not yet bound to any step in the template. */\n unboundProperties: ResolvedSchemaProperty[]\n /** The full JSON Schema, used to resolve display labels for slot rows. */\n jsonSchema: RJSFSchema\n /** The FormTemplate's id, if it has been saved. Threaded down to file-field template uploads. */\n formTemplateId: string | undefined\n /** If true, render expanded by default (first step). */\n defaultExpanded: boolean\n onChange: (patch: Partial<FormTemplateStep>) => void\n onBindField: (propertyKey: string) => void\n onMoveUp: () => void\n onMoveDown: () => void\n onRemove: () => void\n}\n\nexport function StepCard({\n step,\n stepIndex,\n isFirst,\n isLast,\n unboundProperties,\n jsonSchema,\n formTemplateId,\n defaultExpanded,\n onChange,\n onBindField,\n onMoveUp,\n onMoveDown,\n onRemove,\n}: StepCardProps) {\n const [expanded, setExpanded] = useState(defaultExpanded)\n\n // Step is sortable within its group, and also accepts field drops to bind.\n const { ref, handleRef, isDragging, isDropTarget } = useSortable({\n id: stepSortableId(step),\n index: stepIndex,\n group: STEP_SORTABLE_GROUP,\n type: STEP_SORTABLE_TYPE,\n accept: [STEP_SORTABLE_TYPE, FIELD_DRAG_TYPE],\n })\n\n // The slot list is the drop target for slots dragged in from another step, which is the only\n // way to reach a step whose list is empty and therefore has no slot rows to target.\n const { ref: slotListRef, isDropTarget: isSlotDropTarget } = useDroppable({\n id: slotGroupId(step),\n accept: SLOT_SORTABLE_TYPE,\n collisionPriority: SLOT_LIST_COLLISION_PRIORITY,\n })\n\n const handleFieldChange = (\n fieldIdx: number,\n patch: Partial<FormTemplateField>,\n ) => {\n onChange({\n fields: step.fields.map((f, i) =>\n i === fieldIdx ? { ...f, ...patch } : f,\n ),\n })\n }\n\n const handleFieldMove = (fieldIdx: number, direction: -1 | 1) => {\n onChange({ fields: moveItem(step.fields, fieldIdx, direction) })\n }\n\n const handleFieldRemove = (fieldIdx: number) => {\n onChange({ fields: step.fields.filter((_, i) => i !== fieldIdx) })\n }\n\n const fieldCountLabel = pluralize('field', step.fields.length, true)\n\n return (\n <Paper\n ref={ref}\n variant=\"outlined\"\n className={`${dropTargetStyles.dropTarget} ${dragHandleStyles.dragSource}`}\n data-drop-target={isDropTarget}\n data-dragging={isDragging}\n sx={{ p: 1.5 }}\n >\n <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5 }}>\n <Box\n ref={handleRef}\n role=\"button\"\n tabIndex={0}\n aria-label=\"Drag to reorder step\"\n className={dragHandleStyles.dragHandle}\n sx={{ color: 'text.secondary' }}\n >\n <DragHandleIcon fontSize=\"small\" />\n </Box>\n <IconButton\n size=\"small\"\n onClick={() => setExpanded(prev => !prev)}\n aria-label={expanded ? 'Collapse step' : 'Expand step'}\n >\n {expanded ? (\n <ExpandLessIcon fontSize=\"small\" />\n ) : (\n <ExpandMoreIcon fontSize=\"small\" />\n )}\n </IconButton>\n <Box sx={{ flexGrow: 1, minWidth: 0 }}>\n <Typography variant=\"body2\" fontWeight={500} noWrap>\n Step {stepIndex + 1}: {step.title || '(untitled)'}\n </Typography>\n <Typography variant=\"caption\" color=\"text.secondary\">\n {fieldCountLabel}\n </Typography>\n </Box>\n <IconButton\n size=\"small\"\n disabled={isFirst}\n onClick={onMoveUp}\n aria-label=\"Move step up\"\n >\n <UpIcon fontSize=\"small\" />\n </IconButton>\n <IconButton\n size=\"small\"\n disabled={isLast}\n onClick={onMoveDown}\n aria-label=\"Move step down\"\n >\n <DownIcon fontSize=\"small\" />\n </IconButton>\n <IconButton size=\"small\" onClick={onRemove} aria-label=\"Remove step\">\n <DeleteIcon fontSize=\"small\" />\n </IconButton>\n </Box>\n\n <Collapse in={expanded} unmountOnExit>\n <Box sx={{ pt: 1.5 }}>\n <TextField\n label=\"Title\"\n value={step.title}\n onChange={e => onChange({ title: e.target.value })}\n size=\"small\"\n fullWidth\n sx={{ mb: 1 }}\n />\n <TextField\n label=\"Description\"\n value={step.description ?? ''}\n onChange={e => onChange({ description: e.target.value })}\n size=\"small\"\n multiline\n rows={2}\n fullWidth\n sx={{ mb: 1.5 }}\n />\n\n <Box\n ref={slotListRef}\n className={dropTargetStyles.dropTarget}\n data-drop-target={isSlotDropTarget}\n sx={{\n display: 'flex',\n flexDirection: 'column',\n gap: 1,\n mb: 1,\n p: 0.5,\n borderRadius: 1,\n }}\n >\n {step.fields.length === 0 ? (\n <Typography\n variant=\"caption\"\n color=\"text.secondary\"\n sx={{ p: 1 }}\n >\n Drag a field here, or bind one below.\n </Typography>\n ) : (\n step.fields.map((field, fieldIdx) => {\n const resolved = resolveSchemaPropertyAtPointer(\n jsonSchema,\n field.schemaPath,\n )\n return (\n <StepFieldRow\n key={field.schemaPath}\n sortableId={slotSortableId(field)}\n sortableIndex={fieldIdx}\n sortableGroup={slotGroupId(step)}\n field={field}\n resolvedProperty={resolved?.subSchema}\n context={resolved?.context ?? 'ALWAYS'}\n propertyKey={\n pointerToPropertyKey(field.schemaPath) ?? field.schemaPath\n }\n isFirst={fieldIdx === 0}\n isLast={fieldIdx === step.fields.length - 1}\n formTemplateId={formTemplateId}\n onChange={patch => handleFieldChange(fieldIdx, patch)}\n onMoveUp={() => handleFieldMove(fieldIdx, -1)}\n onMoveDown={() => handleFieldMove(fieldIdx, 1)}\n onRemove={() => handleFieldRemove(fieldIdx)}\n />\n )\n })\n )}\n </Box>\n\n <Stack spacing={1}>\n <TextField\n select\n size=\"small\"\n label={BIND_FIELD_LABEL}\n value=\"\"\n onChange={e => {\n if (e.target.value) onBindField(e.target.value)\n }}\n disabled={unboundProperties.length === 0}\n helperText={\n unboundProperties.length === 0\n ? 'All fields are bound to a step.'\n : 'Add a field from the library to this step.'\n }\n >\n {unboundProperties.length === 0 ? (\n <MenuItem value=\"\" disabled>\n All fields bound\n </MenuItem>\n ) : (\n unboundProperties.map(p => {\n const pointer = propertyKeyToPointer(p.propertyKey)\n return (\n <MenuItem key={p.propertyKey} value={p.propertyKey}>\n {p.subSchema.title\n ? `${p.subSchema.title} (${pointer})`\n : pointer}\n </MenuItem>\n )\n })\n )}\n </TextField>\n </Stack>\n </Box>\n </Collapse>\n </Paper>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;AAoDA,IAAM,IAA+B;AAsBrC,SAAgB,EAAS,EACvB,SACA,cACA,aACA,WACA,sBACA,eACA,mBACA,oBACA,aACA,gBACA,aACA,eACA,eACgB;CAChB,IAAM,CAAC,GAAU,KAAe,EAAS,CAAe,GAGlD,EAAE,QAAK,cAAW,eAAY,oBAAiB,EAAY;EAC/D,IAAI,EAAe,CAAI;EACvB,OAAO;EACP,OAAO;EACP,MAAM;EACN,QAAQ,CAAC,GAAoB,CAAe;CAC9C,CAAC,GAIK,EAAE,KAAK,IAAa,cAAc,OAAqB,EAAa;EACxE,IAAI,EAAY,CAAI;EACpB,QAAQ;EACR,mBAAmB;CACrB,CAAC,GAEK,MACJ,GACA,MACG;EACH,EAAS,EACP,QAAQ,EAAK,OAAO,KAAK,GAAG,MAC1B,MAAM,IAAW;GAAE,GAAG;GAAG,GAAG;EAAM,IAAI,CACxC,EACF,CAAC;CACH,GAEM,KAAmB,GAAkB,MAAsB;EAC/D,EAAS,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AK;QACpD,gBAAgB,EAAgB,GAAU,EAAE;QAC5C,kBAAkB,EAAgB,GAAU,CAAC;QAC7C,gBAAgB,GAAkB,CAAQ;OAC3C,GAjBM,EAAM,UAiBZ;MAEL,CAAC;KAEA,CAAA;KAEL,kBAAC,IAAD;MAAO,SAAS;gBACd,kBAAC,GAAD;OACE,QAAA;OACA,MAAK;OACL,OAAO;OACP,OAAM;OACN,WAAU,MAAK;QACb,AAAI,EAAE,OAAO,SAAO,EAAY,EAAE,OAAO,KAAK;OAChD;OACA,UAAU,EAAkB,WAAW;OACvC,YACE,EAAkB,WAAW,IACzB,oCACA;iBAGL,EAAkB,WAAW,IAC5B,kBAAC,GAAD;QAAU,OAAM;QAAG,UAAA;kBAAS;OAElB,CAAA,IAEV,EAAkB,KAAI,MAAK;QACzB,IAAM,IAAU,EAAqB,EAAE,WAAW;QAClD,OACE,kBAAC,GAAD;SAA8B,OAAO,EAAE;mBACpC,EAAE,UAAU,QACT,GAAG,EAAE,UAAU,MAAM,IAAI,EAAQ,KACjC;QACI,GAJK,EAAE,WAIP;OAEd,CAAC;MAEM,CAAA;KACN,CAAA;IACJ;;EACG,CAAA,CACL;;AAEX"}
1
+ {"version":3,"file":"StepCard.js","names":[],"sources":["../../../src/components/FormTemplateEditor/StepCard.tsx"],"sourcesContent":["import { useDroppable } from '@dnd-kit/react'\nimport { useSortable } from '@dnd-kit/react/sortable'\nimport {\n FormTemplateField,\n FormTemplateStep,\n} from '@sage-bionetworks/synapse-client'\nimport {\n Box,\n Collapse,\n IconButton,\n MenuItem,\n Paper,\n Stack,\n TextField,\n Typography,\n} from '@mui/material'\nimport DownIcon from '@mui/icons-material/ArrowDownward'\nimport DeleteIcon from '@mui/icons-material/Delete'\nimport DragHandleIcon from '@mui/icons-material/DragIndicator'\nimport ExpandLessIcon from '@mui/icons-material/ExpandLess'\nimport ExpandMoreIcon from '@mui/icons-material/ExpandMore'\nimport UpIcon from '@mui/icons-material/ArrowUpward'\nimport { RJSFSchema } from '@rjsf/utils'\nimport pluralize from 'pluralize'\nimport { useState } from 'react'\nimport {\n pointerToPropertyKey,\n propertyKeyToPointer,\n ResolvedSchemaProperty,\n resolveSchemaPropertyAtPointer,\n} from '@/utils/jsonschema/submissionContext'\nimport dragHandleStyles from './dragHandle.module.scss'\nimport dropTargetStyles from './dropTarget.module.scss'\nimport { StepFieldRow } from './StepFieldRow'\nimport {\n FIELD_DRAG_TYPE,\n slotGroupId,\n SLOT_SORTABLE_TYPE,\n slotSortableId,\n stepSortableId,\n STEP_SORTABLE_GROUP,\n STEP_SORTABLE_TYPE,\n} from './sortableIds'\nimport { BIND_FIELD_LABEL, EditableFormTemplateStep, moveItem } from './utils'\n\n/**\n * The slot list must lose to the slot rows inside it so that dragging over a populated step\n * targets a row (which resolves to a precise insertion index) and only an empty or below-the-last-\n * row region falls through to the list itself.\n */\nconst SLOT_LIST_COLLISION_PRIORITY = 1\n\nexport type StepCardProps = {\n step: EditableFormTemplateStep\n stepIndex: number\n isFirst: boolean\n isLast: boolean\n /** Properties not yet bound to any step in the template. */\n unboundProperties: ResolvedSchemaProperty[]\n /** The full JSON Schema, used to resolve display labels for slot rows. */\n jsonSchema: RJSFSchema\n /** The FormTemplate's id, if it has been saved. Threaded down to file-field template uploads. */\n formTemplateId: string | undefined\n /** If true, render expanded by default (first step). */\n defaultExpanded: boolean\n onChange: (patch: Partial<FormTemplateStep>) => void\n onBindField: (propertyKey: string) => void\n onMoveUp: () => void\n onMoveDown: () => void\n onRemove: () => void\n}\n\nexport function StepCard({\n step,\n stepIndex,\n isFirst,\n isLast,\n unboundProperties,\n jsonSchema,\n formTemplateId,\n defaultExpanded,\n onChange,\n onBindField,\n onMoveUp,\n onMoveDown,\n onRemove,\n}: StepCardProps) {\n const [expanded, setExpanded] = useState(defaultExpanded)\n\n // Step is sortable within its group, and also accepts field drops to bind.\n const { ref, handleRef, isDragging, isDropTarget } = useSortable({\n id: stepSortableId(step),\n index: stepIndex,\n group: STEP_SORTABLE_GROUP,\n type: STEP_SORTABLE_TYPE,\n accept: [STEP_SORTABLE_TYPE, FIELD_DRAG_TYPE],\n })\n\n // The slot list is the drop target for slots dragged in from another step, which is the only\n // way to reach a step whose list is empty and therefore has no slot rows to target.\n const { ref: slotListRef, isDropTarget: isSlotDropTarget } = useDroppable({\n id: slotGroupId(step),\n accept: SLOT_SORTABLE_TYPE,\n collisionPriority: SLOT_LIST_COLLISION_PRIORITY,\n })\n\n const handleFieldChange = (\n fieldIdx: number,\n patch: Partial<FormTemplateField>,\n ) => {\n onChange({\n fields: step.fields.map((f, i) =>\n i === fieldIdx ? { ...f, ...patch } : f,\n ),\n })\n }\n\n const handleFieldMove = (fieldIdx: number, direction: -1 | 1) => {\n onChange({ fields: moveItem(step.fields, fieldIdx, direction) })\n }\n\n const handleFieldRemove = (fieldIdx: number) => {\n onChange({ fields: step.fields.filter((_, i) => i !== fieldIdx) })\n }\n\n const fieldCountLabel = pluralize('field', step.fields.length, true)\n\n return (\n <Paper\n ref={ref}\n variant=\"outlined\"\n className={`${dropTargetStyles.dropTarget} ${dragHandleStyles.dragSource}`}\n data-drop-target={isDropTarget}\n data-dragging={isDragging}\n sx={{ p: 1.5 }}\n >\n <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5 }}>\n <Box\n ref={handleRef}\n role=\"button\"\n tabIndex={0}\n aria-label=\"Drag to reorder step\"\n className={dragHandleStyles.dragHandle}\n sx={{ color: 'text.secondary' }}\n >\n <DragHandleIcon fontSize=\"small\" />\n </Box>\n <IconButton\n size=\"small\"\n onClick={() => setExpanded(prev => !prev)}\n aria-label={expanded ? 'Collapse step' : 'Expand step'}\n >\n {expanded ? (\n <ExpandLessIcon fontSize=\"small\" />\n ) : (\n <ExpandMoreIcon fontSize=\"small\" />\n )}\n </IconButton>\n <Box sx={{ flexGrow: 1, minWidth: 0 }}>\n <Typography variant=\"body2\" fontWeight={500} noWrap>\n Step {stepIndex + 1}: {step.title || '(untitled)'}\n </Typography>\n <Typography variant=\"caption\" color=\"text.secondary\">\n {fieldCountLabel}\n </Typography>\n </Box>\n <IconButton\n size=\"small\"\n disabled={isFirst}\n onClick={onMoveUp}\n aria-label=\"Move step up\"\n >\n <UpIcon fontSize=\"small\" />\n </IconButton>\n <IconButton\n size=\"small\"\n disabled={isLast}\n onClick={onMoveDown}\n aria-label=\"Move step down\"\n >\n <DownIcon fontSize=\"small\" />\n </IconButton>\n <IconButton size=\"small\" onClick={onRemove} aria-label=\"Remove step\">\n <DeleteIcon fontSize=\"small\" />\n </IconButton>\n </Box>\n\n <Collapse in={expanded} unmountOnExit>\n <Box sx={{ pt: 1.5 }}>\n <TextField\n label=\"Title\"\n value={step.title}\n onChange={e => onChange({ title: e.target.value })}\n size=\"small\"\n fullWidth\n sx={{ mb: 1 }}\n />\n <TextField\n label=\"Description\"\n value={step.description ?? ''}\n onChange={e => onChange({ description: e.target.value })}\n size=\"small\"\n multiline\n rows={2}\n fullWidth\n sx={{ mb: 1.5 }}\n />\n\n <Box\n ref={slotListRef}\n className={dropTargetStyles.dropTarget}\n data-drop-target={isSlotDropTarget}\n sx={{\n display: 'flex',\n flexDirection: 'column',\n gap: 1,\n mb: 1,\n p: 0.5,\n borderRadius: 1,\n }}\n >\n {step.fields.length === 0 ? (\n <Typography\n variant=\"caption\"\n color=\"text.secondary\"\n sx={{ p: 1 }}\n >\n Drag a field here, or bind one below.\n </Typography>\n ) : (\n step.fields.map((field, fieldIdx) => {\n const resolved = resolveSchemaPropertyAtPointer(\n jsonSchema,\n field.schemaPath,\n )\n return (\n <StepFieldRow\n key={field.schemaPath}\n sortableId={slotSortableId(field)}\n sortableIndex={fieldIdx}\n sortableGroup={slotGroupId(step)}\n field={field}\n resolvedProperty={resolved?.subSchema}\n context={resolved?.context ?? 'ALWAYS'}\n propertyKey={\n pointerToPropertyKey(field.schemaPath) ?? field.schemaPath\n }\n isFirst={fieldIdx === 0}\n isLast={fieldIdx === step.fields.length - 1}\n formTemplateId={formTemplateId}\n onChange={patch => handleFieldChange(fieldIdx, patch)}\n onMoveUp={() => handleFieldMove(fieldIdx, -1)}\n onMoveDown={() => handleFieldMove(fieldIdx, 1)}\n onRemove={() => handleFieldRemove(fieldIdx)}\n />\n )\n })\n )}\n </Box>\n\n <Stack spacing={1}>\n <TextField\n select\n size=\"small\"\n label={BIND_FIELD_LABEL}\n value=\"\"\n onChange={e => {\n if (e.target.value) onBindField(e.target.value)\n }}\n disabled={unboundProperties.length === 0}\n helperText={\n unboundProperties.length === 0\n ? 'All fields are bound to a step.'\n : 'Add a field from the library to this step.'\n }\n >\n {unboundProperties.length === 0 ? (\n <MenuItem value=\"\" disabled>\n All fields bound\n </MenuItem>\n ) : (\n unboundProperties.map(p => {\n const pointer = propertyKeyToPointer(p.propertyKey)\n return (\n <MenuItem key={p.propertyKey} value={p.propertyKey}>\n {p.subSchema.title\n ? `${p.subSchema.title} (${pointer})`\n : pointer}\n </MenuItem>\n )\n })\n )}\n </TextField>\n </Stack>\n </Box>\n </Collapse>\n </Paper>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAkDA,IAAM,IAA+B;AAsBrC,SAAgB,EAAS,EACvB,SACA,cACA,aACA,WACA,sBACA,eACA,mBACA,oBACA,aACA,gBACA,aACA,eACA,eACgB;CAChB,IAAM,CAAC,GAAU,KAAe,EAAS,CAAe,GAGlD,EAAE,QAAK,cAAW,eAAY,oBAAiB,EAAY;EAC/D,IAAI,EAAe,CAAI;EACvB,OAAO;EACP,OAAO;EACP,MAAM;EACN,QAAQ,CAAC,GAAoB,CAAe;CAC9C,CAAC,GAIK,EAAE,KAAK,IAAa,cAAc,OAAqB,EAAa;EACxE,IAAI,EAAY,CAAI;EACpB,QAAQ;EACR,mBAAmB;CACrB,CAAC,GAEK,MACJ,GACA,MACG;EACH,EAAS,EACP,QAAQ,EAAK,OAAO,KAAK,GAAG,MAC1B,MAAM,IAAW;GAAE,GAAG;GAAG,GAAG;EAAM,IAAI,CACxC,EACF,CAAC;CACH,GAEM,KAAmB,GA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AU,MAAS,GAAkB,GAAU,CAAK;QACpD,gBAAgB,EAAgB,GAAU,EAAE;QAC5C,kBAAkB,EAAgB,GAAU,CAAC;QAC7C,gBAAgB,GAAkB,CAAQ;OAC3C,GAjBM,EAAM,UAiBZ;MAEL,CAAC;KAEA,CAAA;KAEL,kBAAC,IAAD;MAAO,SAAS;gBACd,kBAAC,GAAD;OACE,QAAA;OACA,MAAK;OACL,OAAO;OACP,OAAM;OACN,WAAU,MAAK;QACb,AAAI,EAAE,OAAO,SAAO,EAAY,EAAE,OAAO,KAAK;OAChD;OACA,UAAU,EAAkB,WAAW;OACvC,YACE,EAAkB,WAAW,IACzB,oCACA;iBAGL,EAAkB,WAAW,IAC5B,kBAAC,GAAD;QAAU,OAAM;QAAG,UAAA;kBAAS;OAElB,CAAA,IAEV,EAAkB,KAAI,MAAK;QACzB,IAAM,IAAU,EAAqB,EAAE,WAAW;QAClD,OACE,kBAAC,GAAD;SAA8B,OAAO,EAAE;mBACpC,EAAE,UAAU,QACT,GAAG,EAAE,UAAU,MAAM,IAAI,EAAQ,KACjC;QACI,GAJK,EAAE,WAIP;OAEd,CAAC;MAEM,CAAA;KACN,CAAA;IACJ;;EACG,CAAA,CACL;;AAEX"}
@@ -1 +1 @@
1
- {"version":3,"file":"StepFieldRow.d.ts","sourceRoot":"","sources":["../../../src/components/FormTemplateEditor/StepFieldRow.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AAmBpE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExC,OAAO,EACL,qBAAqB,EAEtB,MAAM,sCAAsC,CAAA;AAM7C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,uEAAuE;IACvE,UAAU,EAAE,MAAM,CAAA;IAClB,+CAA+C;IAC/C,aAAa,EAAE,MAAM,CAAA;IACrB,+DAA+D;IAC/D,aAAa,EAAE,MAAM,CAAA;IACrB,KAAK,EAAE,iBAAiB,CAAA;IACxB,qEAAqE;IACrE,gBAAgB,EAAE,UAAU,GAAG,SAAS,CAAA;IACxC;4DACwD;IACxD,OAAO,EAAE,qBAAqB,CAAA;IAC9B,uEAAuE;IACvE,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,OAAO,CAAA;IACf,6FAA6F;IAC7F,cAAc,EAAE,MAAM,GAAG,SAAS,CAAA;IAClC,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAA;IACrD,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,UAAU,EAAE,MAAM,IAAI,CAAA;IACtB,QAAQ,EAAE,MAAM,IAAI,CAAA;CACrB,CAAA;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,EAC3B,UAAU,EACV,aAAa,EACb,aAAa,EACb,KAAK,EACL,gBAAgB,EAChB,OAAO,EACP,WAAW,EACX,OAAO,EACP,MAAM,EACN,cAAc,EACd,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,QAAQ,GACT,EAAE,iBAAiB,2CA4HnB"}
1
+ {"version":3,"file":"StepFieldRow.d.ts","sourceRoot":"","sources":["../../../src/components/FormTemplateEditor/StepFieldRow.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AAiBpE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExC,OAAO,EACL,qBAAqB,EAEtB,MAAM,sCAAsC,CAAA;AAM7C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,uEAAuE;IACvE,UAAU,EAAE,MAAM,CAAA;IAClB,+CAA+C;IAC/C,aAAa,EAAE,MAAM,CAAA;IACrB,+DAA+D;IAC/D,aAAa,EAAE,MAAM,CAAA;IACrB,KAAK,EAAE,iBAAiB,CAAA;IACxB,qEAAqE;IACrE,gBAAgB,EAAE,UAAU,GAAG,SAAS,CAAA;IACxC;4DACwD;IACxD,OAAO,EAAE,qBAAqB,CAAA;IAC9B,uEAAuE;IACvE,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,OAAO,CAAA;IACf,6FAA6F;IAC7F,cAAc,EAAE,MAAM,GAAG,SAAS,CAAA;IAClC,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAA;IACrD,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,UAAU,EAAE,MAAM,IAAI,CAAA;IACtB,QAAQ,EAAE,MAAM,IAAI,CAAA;CACrB,CAAA;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,EAC3B,UAAU,EACV,aAAa,EACb,aAAa,EACb,KAAK,EACL,gBAAgB,EAChB,OAAO,EACP,WAAW,EACX,OAAO,EACP,MAAM,EACN,cAAc,EACd,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,QAAQ,GACT,EAAE,iBAAiB,2CA4HnB"}