synapse-react-client 4.0.46 → 4.0.48

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 (559) hide show
  1. package/dist/SWC.index.js +1 -1
  2. package/dist/aridhia-queries/useSubmitAridhiaDar.js +2 -2
  3. package/dist/aridhia-queries/useSubmitAridhiaDar.js.map +1 -1
  4. package/dist/components/AccessTokenPage/CreateAccessTokenModal.js +1 -1
  5. package/dist/components/AccessTokenPage/CreateAccessTokenModal.js.map +1 -1
  6. package/dist/components/AccountLevelBadges/AccountLevelBadges.js +1 -1
  7. package/dist/components/AccountLevelBadges/AccountLevelBadges.js.map +1 -1
  8. package/dist/components/AclEditor/AclEditor.test-utils.js +3 -5
  9. package/dist/components/AclEditor/AclEditor.test-utils.js.map +1 -1
  10. package/dist/components/Aridhia/AridhiaAccessStatus.d.ts.map +1 -1
  11. package/dist/components/Aridhia/AridhiaAccessStatus.js +43 -30
  12. package/dist/components/Aridhia/AridhiaAccessStatus.js.map +1 -1
  13. package/dist/components/Aridhia/AridhiaDarStatusPopover.d.ts +6 -2
  14. package/dist/components/Aridhia/AridhiaDarStatusPopover.d.ts.map +1 -1
  15. package/dist/components/Aridhia/AridhiaDarStatusPopover.js +101 -31
  16. package/dist/components/Aridhia/AridhiaDarStatusPopover.js.map +1 -1
  17. package/dist/components/Aridhia/aridhiaAccessStatusUtils.d.ts +11 -9
  18. package/dist/components/Aridhia/aridhiaAccessStatusUtils.d.ts.map +1 -1
  19. package/dist/components/Aridhia/aridhiaAccessStatusUtils.js +24 -13
  20. package/dist/components/Aridhia/aridhiaAccessStatusUtils.js.map +1 -1
  21. package/dist/components/Authentication/LastLoginInfo.js +2 -2
  22. package/dist/components/Authentication/LastLoginInfo.js.map +1 -1
  23. package/dist/components/Authentication/RecoveryCodeForm.js +1 -1
  24. package/dist/components/Authentication/RecoveryCodeForm.js.map +1 -1
  25. package/dist/components/Authentication/RecoveryCodeGrid.js.map +1 -1
  26. package/dist/components/Authentication/TOTPForm.d.ts.map +1 -1
  27. package/dist/components/Authentication/TOTPForm.js +3 -3
  28. package/dist/components/Authentication/TOTPForm.js.map +1 -1
  29. package/dist/components/Authentication/index.d.ts +6 -6
  30. package/dist/components/Authentication/index.d.ts.map +1 -1
  31. package/dist/components/CannedRejectionDialog/CannedRejectionDialog.js +1 -1
  32. package/dist/components/CannedRejectionDialog/CannedRejectionDialog.js.map +1 -1
  33. package/dist/components/CardContainer/CardContainer.js +7 -7
  34. package/dist/components/CardContainer/CardContainer.js.map +1 -1
  35. package/dist/components/ChallengeRequirementsModal/ChallengeRequirementsModal.js +1 -1
  36. package/dist/components/ChallengeRequirementsModal/ChallengeRequirementsModal.js.map +1 -1
  37. package/dist/components/ChallengeSubmission/ChallengeSubmission.d.ts.map +1 -1
  38. package/dist/components/ChallengeSubmission/ChallengeSubmission.js +1 -1
  39. package/dist/components/ChallengeSubmission/ChallengeSubmission.js.map +1 -1
  40. package/dist/components/ChallengeTeamWizard/SelectChallengeTeam.js +1 -1
  41. package/dist/components/ChallengeTeamWizard/SelectChallengeTeam.js.map +1 -1
  42. package/dist/components/CitationPopover/CitationPopoverUtils.js +2 -2
  43. package/dist/components/CitationPopover/CitationPopoverUtils.js.map +1 -1
  44. package/dist/components/CohortBuilder/CohortBuilder.css +1 -0
  45. package/dist/components/CohortBuilder/CohortBuilder.d.ts +35 -0
  46. package/dist/components/CohortBuilder/CohortBuilder.d.ts.map +1 -0
  47. package/dist/components/CohortBuilder/CohortBuilder.js +108 -0
  48. package/dist/components/CohortBuilder/CohortBuilder.js.map +1 -0
  49. package/dist/components/CohortBuilder/CohortBuilder.module.js +10 -0
  50. package/dist/components/CohortBuilder/CohortBuilder.module.js.map +1 -0
  51. package/dist/components/CohortBuilder/CohortBuilder.module.scss +20 -0
  52. package/dist/components/CohortBuilder/CohortFilesPanel.d.ts +16 -0
  53. package/dist/components/CohortBuilder/CohortFilesPanel.d.ts.map +1 -0
  54. package/dist/components/CohortBuilder/CohortFilesPanel.js +124 -0
  55. package/dist/components/CohortBuilder/CohortFilesPanel.js.map +1 -0
  56. package/dist/components/CohortBuilder/cohortHandOff.d.ts +25 -0
  57. package/dist/components/CohortBuilder/cohortHandOff.d.ts.map +1 -0
  58. package/dist/components/CohortBuilder/cohortHandOff.js +26 -0
  59. package/dist/components/CohortBuilder/cohortHandOff.js.map +1 -0
  60. package/dist/components/ColumnFilter/ColumnFilter.d.ts.map +1 -1
  61. package/dist/components/ColumnFilter/ColumnFilter.js +14 -13
  62. package/dist/components/ColumnFilter/ColumnFilter.js.map +1 -1
  63. package/dist/components/DataExplorer/DataExplorer.d.ts.map +1 -1
  64. package/dist/components/DataExplorer/DataExplorer.js.map +1 -1
  65. package/dist/components/DataGrid/columns/AutocompleteColumn.d.ts +11 -2
  66. package/dist/components/DataGrid/columns/AutocompleteColumn.d.ts.map +1 -1
  67. package/dist/components/DataGrid/columns/AutocompleteColumn.js +115 -109
  68. package/dist/components/DataGrid/columns/AutocompleteColumn.js.map +1 -1
  69. package/dist/components/DataGrid/columns/NumberColumn.js +1 -1
  70. package/dist/components/DataGrid/columns/NumberColumn.js.map +1 -1
  71. package/dist/components/DataGrid/columns/NumberOrEnumColumn.d.ts +20 -0
  72. package/dist/components/DataGrid/columns/NumberOrEnumColumn.d.ts.map +1 -0
  73. package/dist/components/DataGrid/columns/NumberOrEnumColumn.js +18 -0
  74. package/dist/components/DataGrid/columns/NumberOrEnumColumn.js.map +1 -0
  75. package/dist/components/DataGrid/components/contextMenu.js +3 -3
  76. package/dist/components/DataGrid/components/contextMenu.js.map +1 -1
  77. package/dist/components/DataGrid/hooks/useGridUndoRedo.d.ts.map +1 -1
  78. package/dist/components/DataGrid/hooks/useGridUndoRedo.js +9 -7
  79. package/dist/components/DataGrid/hooks/useGridUndoRedo.js.map +1 -1
  80. package/dist/components/DataGrid/hooks/useStack.d.ts +1 -1
  81. package/dist/components/DataGrid/hooks/useStack.js +2 -2
  82. package/dist/components/DataGrid/hooks/useStack.js.map +1 -1
  83. package/dist/components/DataGrid/utils/columnFactory.d.ts.map +1 -1
  84. package/dist/components/DataGrid/utils/columnFactory.js +47 -42
  85. package/dist/components/DataGrid/utils/columnFactory.js.map +1 -1
  86. package/dist/components/DataGrid/utils/extractColumnValidationMessages.js +7 -7
  87. package/dist/components/DataGrid/utils/extractColumnValidationMessages.js.map +1 -1
  88. package/dist/components/DataGrid/utils/json-rx/JsonRx.js +2 -2
  89. package/dist/components/DataGrid/utils/json-rx/JsonRx.js.map +1 -1
  90. package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.js +1 -1
  91. package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.js.map +1 -1
  92. package/dist/components/DownloadCart/MeetAccessRequirementCard.js +1 -1
  93. package/dist/components/DownloadCart/MeetAccessRequirementCard.js.map +1 -1
  94. package/dist/components/EntityDownloadConfirmation/EntityDownloadConfirmation.js +5 -5
  95. package/dist/components/EntityDownloadConfirmation/EntityDownloadConfirmation.js.map +1 -1
  96. package/dist/components/EntityFinder/details/view/DetailsView.d.ts.map +1 -1
  97. package/dist/components/EntityFinder/details/view/DetailsView.js +4 -4
  98. package/dist/components/EntityFinder/details/view/DetailsView.js.map +1 -1
  99. package/dist/components/EntityHeaderTable/EntityHeaderTable.js +4 -4
  100. package/dist/components/EntityHeaderTable/Filter.d.ts.map +1 -1
  101. package/dist/components/EntityHeaderTable/Filter.js +1 -1
  102. package/dist/components/EntityHeaderTable/Filter.js.map +1 -1
  103. package/dist/components/Evaluation/EvaluationRoundEditor.js.map +1 -1
  104. package/dist/components/FeaturedDataTabs/FacetPlotsCard.d.ts.map +1 -1
  105. package/dist/components/FeaturedDataTabs/FacetPlotsCard.js +80 -84
  106. package/dist/components/FeaturedDataTabs/FacetPlotsCard.js.map +1 -1
  107. package/dist/components/FormTemplateEditor/FormStructurePanel.js +7 -7
  108. package/dist/components/FormTemplateEditor/StepCard.js +9 -9
  109. package/dist/components/FormTemplateEditor/schemaFieldUtils.js +2 -2
  110. package/dist/components/FormTemplateEditor/schemaFieldUtils.js.map +1 -1
  111. package/dist/components/FullTextSearch/FullTextSearch.js +8 -8
  112. package/dist/components/GenericCard/CardUtils.js.map +1 -1
  113. package/dist/components/GenericCard/DuoTermTags/DuoTermTags.js +1 -1
  114. package/dist/components/GenericCard/DuoTermTags/DuoTermTags.js.map +1 -1
  115. package/dist/components/GenericCard/DuoTermTags/duoTerms.js +1 -1
  116. package/dist/components/GenericCard/DuoTermTags/duoTerms.js.map +1 -1
  117. package/dist/components/GenericCard/TableRowGenericCard.js +37 -37
  118. package/dist/components/GoalsV3/GoalsV3.js +1 -1
  119. package/dist/components/GoalsV3/GoalsV3.js.map +1 -1
  120. package/dist/components/HexGrid/HexGrid.d.ts +3 -1
  121. package/dist/components/HexGrid/HexGrid.d.ts.map +1 -1
  122. package/dist/components/HexGrid/HexGrid.js +14 -13
  123. package/dist/components/HexGrid/HexGrid.js.map +1 -1
  124. package/dist/components/IconSvg/index.d.ts +1 -1
  125. package/dist/components/IconSvg/index.d.ts.map +1 -1
  126. package/dist/components/IconSvg/index.js.map +1 -1
  127. package/dist/components/JsonSchemaForm/templates/BaseInputTemplate.d.ts.map +1 -1
  128. package/dist/components/JsonSchemaForm/templates/BaseInputTemplate.js +3 -3
  129. package/dist/components/JsonSchemaForm/templates/BaseInputTemplate.js.map +1 -1
  130. package/dist/components/Markdown/MarkdownEditor.js +1 -1
  131. package/dist/components/Markdown/MarkdownEditor.js.map +1 -1
  132. package/dist/components/Markdown/widget/index.d.ts +1 -1
  133. package/dist/components/Markdown/widget/index.d.ts.map +1 -1
  134. package/dist/components/ModalDownload/ModalDownload.d.ts.map +1 -1
  135. package/dist/components/ModalDownload/ModalDownload.js +2 -1
  136. package/dist/components/ModalDownload/ModalDownload.js.map +1 -1
  137. package/dist/components/Plot/BarPlot.js +1 -1
  138. package/dist/components/Plot/BarPlot.js.map +1 -1
  139. package/dist/components/Plot/PlotPanelHeader.d.ts +3 -2
  140. package/dist/components/Plot/PlotPanelHeader.d.ts.map +1 -1
  141. package/dist/components/Plot/PlotPanelHeader.js.map +1 -1
  142. package/dist/components/ProgrammaticTableDownload/ProgrammaticTableDownload.js +1 -1
  143. package/dist/components/ProgrammaticTableDownload/ProgrammaticTableDownload.js.map +1 -1
  144. package/dist/components/ProvenanceGraph/ProvenanceExternalIcon.js +1 -1
  145. package/dist/components/ProvenanceGraph/ProvenanceExternalIcon.js.map +1 -1
  146. package/dist/components/ProvenanceGraph/ProvenanceGraph.d.ts.map +1 -1
  147. package/dist/components/ProvenanceGraph/ProvenanceGraph.js +3 -3
  148. package/dist/components/ProvenanceGraph/ProvenanceGraph.js.map +1 -1
  149. package/dist/components/QueryBuilder/FilterConditionRow.d.ts.map +1 -1
  150. package/dist/components/QueryBuilder/FilterConditionRow.js +28 -27
  151. package/dist/components/QueryBuilder/FilterConditionRow.js.map +1 -1
  152. package/dist/components/QueryBuilder/FilterGroupNode.d.ts.map +1 -1
  153. package/dist/components/QueryBuilder/FilterGroupNode.js +91 -75
  154. package/dist/components/QueryBuilder/FilterGroupNode.js.map +1 -1
  155. package/dist/components/QueryBuilder/QueryBuilderControls.css +1 -1
  156. package/dist/components/QueryBuilder/QueryBuilderControls.d.ts.map +1 -1
  157. package/dist/components/QueryBuilder/QueryBuilderControls.js +91 -79
  158. package/dist/components/QueryBuilder/QueryBuilderControls.js.map +1 -1
  159. package/dist/components/QueryBuilder/QueryBuilderControls.module.js +11 -11
  160. package/dist/components/QueryBuilder/QueryBuilderControls.module.js.map +1 -1
  161. package/dist/components/QueryBuilder/QueryBuilderControls.module.scss +2 -0
  162. package/dist/components/QueryBuilder/QueryBuilderInternalContext.d.ts +2 -0
  163. package/dist/components/QueryBuilder/QueryBuilderInternalContext.d.ts.map +1 -1
  164. package/dist/components/QueryBuilder/QueryBuilderInternalContext.js.map +1 -1
  165. package/dist/components/QueryBuilder/queryBuilderLimits.d.ts +18 -0
  166. package/dist/components/QueryBuilder/queryBuilderLimits.d.ts.map +1 -0
  167. package/dist/components/QueryBuilder/queryBuilderLimits.js +38 -0
  168. package/dist/components/QueryBuilder/queryBuilderLimits.js.map +1 -0
  169. package/dist/components/QueryBuilder/queryBuilderMetadata.d.ts +0 -8
  170. package/dist/components/QueryBuilder/queryBuilderMetadata.d.ts.map +1 -1
  171. package/dist/components/QueryBuilder/queryBuilderMetadata.js +6 -9
  172. package/dist/components/QueryBuilder/queryBuilderMetadata.js.map +1 -1
  173. package/dist/components/QueryBuilder/queryBuilderTranslation.d.ts +5 -4
  174. package/dist/components/QueryBuilder/queryBuilderTranslation.d.ts.map +1 -1
  175. package/dist/components/QueryBuilder/queryBuilderTranslation.js +58 -33
  176. package/dist/components/QueryBuilder/queryBuilderTranslation.js.map +1 -1
  177. package/dist/components/QueryBuilder/useQBCombinedSql.d.ts.map +1 -1
  178. package/dist/components/QueryBuilder/useQBCombinedSql.js +4 -4
  179. package/dist/components/QueryBuilder/useQBCombinedSql.js.map +1 -1
  180. package/dist/components/QueryBuilder/useQBValueDisplayName.d.ts.map +1 -1
  181. package/dist/components/QueryBuilder/useQBValueDisplayName.js +5 -5
  182. package/dist/components/QueryBuilder/useQBValueDisplayName.js.map +1 -1
  183. package/dist/components/QuerySortSelector.js +5 -5
  184. package/dist/components/QueryVisualizationWrapper/QueryVisualizationWrapper.js +21 -21
  185. package/dist/components/QueryVisualizationWrapper/QueryVisualizationWrapper.js.map +1 -1
  186. package/dist/components/QueryWrapper/AggregateQueryErrorNotice.d.ts +20 -0
  187. package/dist/components/QueryWrapper/AggregateQueryErrorNotice.d.ts.map +1 -0
  188. package/dist/components/QueryWrapper/AggregateQueryErrorNotice.js +50 -0
  189. package/dist/components/QueryWrapper/AggregateQueryErrorNotice.js.map +1 -0
  190. package/dist/components/QueryWrapper/TableQueryUseQueryOptions.d.ts +5 -3
  191. package/dist/components/QueryWrapper/TableQueryUseQueryOptions.d.ts.map +1 -1
  192. package/dist/components/QueryWrapper/TableQueryUseQueryOptions.js +7 -3
  193. package/dist/components/QueryWrapper/TableQueryUseQueryOptions.js.map +1 -1
  194. package/dist/components/QueryWrapper/downloadListFiles.d.ts +25 -0
  195. package/dist/components/QueryWrapper/downloadListFiles.d.ts.map +1 -0
  196. package/dist/components/QueryWrapper/downloadListFiles.js +39 -0
  197. package/dist/components/QueryWrapper/downloadListFiles.js.map +1 -0
  198. package/dist/components/QueryWrapper/useAddSelectedRowsToDownloadList.d.ts +16 -0
  199. package/dist/components/QueryWrapper/useAddSelectedRowsToDownloadList.d.ts.map +1 -0
  200. package/dist/components/QueryWrapper/useAddSelectedRowsToDownloadList.js +50 -0
  201. package/dist/components/QueryWrapper/useAddSelectedRowsToDownloadList.js.map +1 -0
  202. package/dist/components/QueryWrapper/useGetAddToDownloadListRequestForCurrentQuery.d.ts +4 -1
  203. package/dist/components/QueryWrapper/useGetAddToDownloadListRequestForCurrentQuery.d.ts.map +1 -1
  204. package/dist/components/QueryWrapper/useGetAddToDownloadListRequestForCurrentQuery.js +15 -28
  205. package/dist/components/QueryWrapper/useGetAddToDownloadListRequestForCurrentQuery.js.map +1 -1
  206. package/dist/components/QueryWrapper/useOnQueryDataChange.d.ts.map +1 -1
  207. package/dist/components/QueryWrapper/useOnQueryDataChange.js +7 -6
  208. package/dist/components/QueryWrapper/useOnQueryDataChange.js.map +1 -1
  209. package/dist/components/QueryWrapperErrorBoundary.d.ts +3 -1
  210. package/dist/components/QueryWrapperErrorBoundary.d.ts.map +1 -1
  211. package/dist/components/QueryWrapperErrorBoundary.js +26 -21
  212. package/dist/components/QueryWrapperErrorBoundary.js.map +1 -1
  213. package/dist/components/QueryWrapperPlotNav/LastUpdatedOn.js +7 -7
  214. package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.d.ts +2 -2
  215. package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.d.ts.map +1 -1
  216. package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.js +34 -32
  217. package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.js.map +1 -1
  218. package/dist/components/QueryWrapperPlotNav/QueryWrapperSynapsePlot.js +7 -7
  219. package/dist/components/QueryWrapperPlotNav/UseRowSet.d.ts.map +1 -1
  220. package/dist/components/QueryWrapperPlotNav/UseRowSet.js +12 -12
  221. package/dist/components/QueryWrapperPlotNav/UseRowSet.js.map +1 -1
  222. package/dist/components/RowDataTable/CategorizedRowDataTable.css +1 -0
  223. package/dist/components/RowDataTable/CategorizedRowDataTable.d.ts +33 -0
  224. package/dist/components/RowDataTable/CategorizedRowDataTable.d.ts.map +1 -0
  225. package/dist/components/RowDataTable/CategorizedRowDataTable.js +64 -0
  226. package/dist/components/RowDataTable/CategorizedRowDataTable.js.map +1 -0
  227. package/dist/components/RowDataTable/CategorizedRowDataTable.module.js +8 -0
  228. package/dist/components/RowDataTable/CategorizedRowDataTable.module.js.map +1 -0
  229. package/dist/components/RowDataTable/CategorizedRowDataTable.module.scss +18 -0
  230. package/dist/components/RowDataTable/RowDataTable.d.ts +13 -0
  231. package/dist/components/RowDataTable/RowDataTable.d.ts.map +1 -1
  232. package/dist/components/RowDataTable/RowDataTable.js +25 -8
  233. package/dist/components/RowDataTable/RowDataTable.js.map +1 -1
  234. package/dist/components/RssFeedCards/RssFeedCards.js +1 -1
  235. package/dist/components/RssFeedCards/RssFeedCards.js.map +1 -1
  236. package/dist/components/SchemaDrivenAnnotationEditor/field/AdditionalPropertiesSchemaField.d.ts.map +1 -1
  237. package/dist/components/SchemaDrivenAnnotationEditor/field/AdditionalPropertiesSchemaField.js +2 -2
  238. package/dist/components/SchemaDrivenAnnotationEditor/field/AdditionalPropertiesSchemaField.js.map +1 -1
  239. package/dist/components/SchemaDrivenAnnotationEditor/template/ObjectFieldTemplate.js +1 -1
  240. package/dist/components/SchemaDrivenAnnotationEditor/template/ObjectFieldTemplate.js.map +1 -1
  241. package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.d.ts +17 -9
  242. package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.d.ts.map +1 -1
  243. package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.js +39 -30
  244. package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.js.map +1 -1
  245. package/dist/components/SetAccessRequirementCommonFields/SetAccessRequirementCommonFields.js +24 -24
  246. package/dist/components/SetAccessRequirementCommonFields/SetAccessRequirementCommonFields.js.map +1 -1
  247. package/dist/components/StandaloneQueryWrapper/StandaloneQueryWrapper.js +8 -8
  248. package/dist/components/SynapseChat/SynapseChatMessage.js +1 -1
  249. package/dist/components/SynapseChat/SynapseChatMessage.js.map +1 -1
  250. package/dist/components/SynapseForm/NavButtons.js.map +1 -1
  251. package/dist/components/SynapseForm/StepsSideNav.js.map +1 -1
  252. package/dist/components/SynapseSearchPageResults/HighlightedTypography.js +1 -1
  253. package/dist/components/SynapseSearchPageResults/HighlightedTypography.js.map +1 -1
  254. package/dist/components/SynapseSearchPageResults/SearchFacetPanel/SearchFacetPanelUtils.d.ts.map +1 -1
  255. package/dist/components/SynapseSearchPageResults/SearchFacetPanel/SearchFacetPanelUtils.js +3 -3
  256. package/dist/components/SynapseSearchPageResults/SearchFacetPanel/SearchFacetPanelUtils.js.map +1 -1
  257. package/dist/components/SynapseTable/RowSelection/RowSelectionControls.d.ts.map +1 -1
  258. package/dist/components/SynapseTable/RowSelection/RowSelectionControls.js +38 -44
  259. package/dist/components/SynapseTable/RowSelection/RowSelectionControls.js.map +1 -1
  260. package/dist/components/SynapseTable/RowSelection/RowSelectionUI.js +4 -4
  261. package/dist/components/SynapseTable/SqlEditor.js +7 -7
  262. package/dist/components/SynapseTable/SynapseTable.js +8 -8
  263. package/dist/components/SynapseTable/SynapseTable.js.map +1 -1
  264. package/dist/components/SynapseTable/SynapseTableRenderers.d.ts.map +1 -1
  265. package/dist/components/SynapseTable/SynapseTableRenderers.js +73 -72
  266. package/dist/components/SynapseTable/SynapseTableRenderers.js.map +1 -1
  267. package/dist/components/SynapseTable/SynapseTableUtils.js +1 -1
  268. package/dist/components/SynapseTable/SynapseTableUtils.js.map +1 -1
  269. package/dist/components/SynapseTable/TopLevelControls/TopLevelControls.d.ts.map +1 -1
  270. package/dist/components/SynapseTable/TopLevelControls/TopLevelControls.js +44 -45
  271. package/dist/components/SynapseTable/TopLevelControls/TopLevelControls.js.map +1 -1
  272. package/dist/components/SynapseTable/datasets/DatasetEditorVersionCell.js +1 -1
  273. package/dist/components/SynapseTable/datasets/DatasetEditorVersionCell.js.map +1 -1
  274. package/dist/components/SynapseTable/datasets/DatasetItemsEditor.d.ts.map +1 -1
  275. package/dist/components/SynapseTable/datasets/DatasetItemsEditor.js +142 -142
  276. package/dist/components/SynapseTable/datasets/DatasetItemsEditor.js.map +1 -1
  277. package/dist/components/SynapseTable/export/ExportToAnalysisPlatformDialog.js +4 -4
  278. package/dist/components/SynapseTable/export/ExternalPlatformActionsRequiredPrecheck.js +12 -12
  279. package/dist/components/SynapseTable/export/ExternalPlatformActionsRequiredPrecheck.js.map +1 -1
  280. package/dist/components/SynapseTable/table-top/ColumnSelection.js +6 -6
  281. package/dist/components/SynapseTable/table-top/DownloadOptions.d.ts +0 -1
  282. package/dist/components/SynapseTable/table-top/DownloadOptions.d.ts.map +1 -1
  283. package/dist/components/SynapseTable/table-top/DownloadOptions.js +64 -57
  284. package/dist/components/SynapseTable/table-top/DownloadOptions.js.map +1 -1
  285. package/dist/components/SynapseTable/usePrefetchTableData.d.ts.map +1 -1
  286. package/dist/components/SynapseTable/usePrefetchTableData.js +3 -3
  287. package/dist/components/SynapseTable/usePrefetchTableData.js.map +1 -1
  288. package/dist/components/TableColumnSchemaEditor/ColumnModelForm.js +1 -1
  289. package/dist/components/TableColumnSchemaEditor/ColumnModelForm.js.map +1 -1
  290. package/dist/components/TableColumnSchemaEditor/TableColumnSchemaEditorTestUtils.js +1 -1
  291. package/dist/components/TableColumnSchemaEditor/TableColumnSchemaEditorTestUtils.js.map +1 -1
  292. package/dist/components/TableColumnSchemaEditor/TableColumnSchemaEditorUtils.js +2 -2
  293. package/dist/components/TableColumnSchemaEditor/TableColumnSchemaEditorUtils.js.map +1 -1
  294. package/dist/components/TableColumnSchemaEditor/TableColumnSchemaForm.js +60 -60
  295. package/dist/components/TableColumnSchemaEditor/TableColumnSchemaForm.js.map +1 -1
  296. package/dist/components/TableColumnSchemaEditor/Validators/DatetimeSchema.js +1 -1
  297. package/dist/components/TableColumnSchemaEditor/Validators/DatetimeSchema.js.map +1 -1
  298. package/dist/components/TanStackTable/ColumnHeaderEnumFilter.js +1 -1
  299. package/dist/components/TanStackTable/ColumnHeaderEnumFilter.js.map +1 -1
  300. package/dist/components/TanStackTable/StyledTanStackTable.d.ts.map +1 -1
  301. package/dist/components/TanStackTable/StyledTanStackTable.js +1 -4
  302. package/dist/components/TanStackTable/StyledTanStackTable.js.map +1 -1
  303. package/dist/components/TermsAndConditions/TermsAndConditions.js.map +1 -1
  304. package/dist/components/TotalQueryResults.js +14 -14
  305. package/dist/components/Webhook/WebhookDashboard.d.ts.map +1 -1
  306. package/dist/components/Webhook/WebhookDashboard.js +2 -2
  307. package/dist/components/Webhook/WebhookDashboard.js.map +1 -1
  308. package/dist/components/download_list/DownloadConfirmationUtils.d.ts +5 -1
  309. package/dist/components/download_list/DownloadConfirmationUtils.d.ts.map +1 -1
  310. package/dist/components/download_list/DownloadConfirmationUtils.js +2 -2
  311. package/dist/components/download_list/DownloadConfirmationUtils.js.map +1 -1
  312. package/dist/components/error/ErrorBanner.d.ts.map +1 -1
  313. package/dist/components/error/ErrorBanner.js +49 -46
  314. package/dist/components/error/ErrorBanner.js.map +1 -1
  315. package/dist/components/file/upload/MultiFileUploadProgress.js +5 -5
  316. package/dist/components/row_renderers/Dataset.d.ts.map +1 -1
  317. package/dist/components/row_renderers/Dataset.js +6 -6
  318. package/dist/components/row_renderers/Dataset.js.map +1 -1
  319. package/dist/components/row_renderers/Funder.js +1 -1
  320. package/dist/components/row_renderers/Funder.js.map +1 -1
  321. package/dist/components/widgets/ElementWithTooltip.d.ts +6 -1
  322. package/dist/components/widgets/ElementWithTooltip.d.ts.map +1 -1
  323. package/dist/components/widgets/ElementWithTooltip.js +22 -14
  324. package/dist/components/widgets/ElementWithTooltip.js.map +1 -1
  325. package/dist/components/widgets/RangeSlider/RangeSlider.d.ts.map +1 -1
  326. package/dist/components/widgets/RangeSlider/RangeSlider.js +1 -1
  327. package/dist/components/widgets/RangeSlider/RangeSlider.js.map +1 -1
  328. package/dist/components/widgets/SynapseImage.js +1 -1
  329. package/dist/components/widgets/SynapseImage.js.map +1 -1
  330. package/dist/components/widgets/facet-nav/FacetNavPanel.d.ts +16 -5
  331. package/dist/components/widgets/facet-nav/FacetNavPanel.d.ts.map +1 -1
  332. package/dist/components/widgets/facet-nav/FacetNavPanel.js +115 -102
  333. package/dist/components/widgets/facet-nav/FacetNavPanel.js.map +1 -1
  334. package/dist/components/widgets/facet-nav/FacetPlotLegendList.d.ts.map +1 -1
  335. package/dist/components/widgets/facet-nav/FacetPlotLegendList.js +4 -2
  336. package/dist/components/widgets/facet-nav/FacetPlotLegendList.js.map +1 -1
  337. package/dist/components/widgets/facet-nav/FacetPlotLegendTable.js +1 -1
  338. package/dist/components/widgets/facet-nav/FacetPlotLegendTable.js.map +1 -1
  339. package/dist/components/widgets/facet-nav/FacetPlotLegendUtils.d.ts +2 -0
  340. package/dist/components/widgets/facet-nav/FacetPlotLegendUtils.d.ts.map +1 -1
  341. package/dist/components/widgets/facet-nav/FacetPlotLegendUtils.js.map +1 -1
  342. package/dist/components/widgets/facet-nav/PlotsContainer.d.ts +7 -0
  343. package/dist/components/widgets/facet-nav/PlotsContainer.d.ts.map +1 -1
  344. package/dist/components/widgets/facet-nav/PlotsContainer.js +47 -45
  345. package/dist/components/widgets/facet-nav/PlotsContainer.js.map +1 -1
  346. package/dist/components/widgets/facet-nav/SelectionCriteriaPills.js +4 -4
  347. package/dist/components/widgets/facet-nav/useFacetPlots.d.ts +3 -2
  348. package/dist/components/widgets/facet-nav/useFacetPlots.d.ts.map +1 -1
  349. package/dist/components/widgets/facet-nav/useFacetPlots.js +16 -15
  350. package/dist/components/widgets/facet-nav/useFacetPlots.js.map +1 -1
  351. package/dist/components/widgets/query-filter/CombinedRangeFacetFilter.js +4 -4
  352. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilter.d.ts +2 -2
  353. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilter.d.ts.map +1 -1
  354. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilter.js +62 -60
  355. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilter.js.map +1 -1
  356. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterOption.d.ts +2 -0
  357. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterOption.d.ts.map +1 -1
  358. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterOption.js +10 -10
  359. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterOption.js.map +1 -1
  360. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterUI.d.ts +1 -0
  361. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterUI.d.ts.map +1 -1
  362. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterUI.js +2 -1
  363. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterUI.js.map +1 -1
  364. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterUtils.d.ts +3 -2
  365. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterUtils.d.ts.map +1 -1
  366. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterUtils.js.map +1 -1
  367. package/dist/components/widgets/query-filter/FacetFilterControls.d.ts +3 -2
  368. package/dist/components/widgets/query-filter/FacetFilterControls.d.ts.map +1 -1
  369. package/dist/components/widgets/query-filter/FacetFilterControls.js +63 -62
  370. package/dist/components/widgets/query-filter/FacetFilterControls.js.map +1 -1
  371. package/dist/components/widgets/query-filter/JsonColumnFacetFilters.d.ts.map +1 -1
  372. package/dist/components/widgets/query-filter/JsonColumnFacetFilters.js +30 -29
  373. package/dist/components/widgets/query-filter/JsonColumnFacetFilters.js.map +1 -1
  374. package/dist/components/widgets/query-filter/RangeFacetFilter.js +5 -5
  375. package/dist/mocks/cohortBuilder/cohortBuilderMockProfiles.d.ts +53 -0
  376. package/dist/mocks/cohortBuilder/cohortBuilderMockProfiles.d.ts.map +1 -0
  377. package/dist/mocks/cohortBuilder/cohortBuilderMockProfiles.js +391 -0
  378. package/dist/mocks/cohortBuilder/cohortBuilderMockProfiles.js.map +1 -0
  379. package/dist/mocks/cohortBuilder/cohortBuilderMockQueryEngine.d.ts +41 -0
  380. package/dist/mocks/cohortBuilder/cohortBuilderMockQueryEngine.d.ts.map +1 -0
  381. package/dist/mocks/cohortBuilder/cohortBuilderMockQueryEngine.js +379 -0
  382. package/dist/mocks/cohortBuilder/cohortBuilderMockQueryEngine.js.map +1 -0
  383. package/dist/mocks/cohortBuilder/cohortBuilderSyntheticData.d.ts +26 -0
  384. package/dist/mocks/cohortBuilder/cohortBuilderSyntheticData.d.ts.map +1 -0
  385. package/dist/mocks/cohortBuilder/cohortBuilderSyntheticData.js +112 -0
  386. package/dist/mocks/cohortBuilder/cohortBuilderSyntheticData.js.map +1 -0
  387. package/dist/mocks/mockAnnotationColumns.d.ts.map +1 -1
  388. package/dist/mocks/mockAnnotationColumns.js +1 -1
  389. package/dist/mocks/mockAnnotationColumns.js.map +1 -1
  390. package/dist/mocks/msw/handlers/aridhiaHandlers.d.ts +9 -0
  391. package/dist/mocks/msw/handlers/aridhiaHandlers.d.ts.map +1 -1
  392. package/dist/mocks/msw/handlers/aridhiaHandlers.js +24 -15
  393. package/dist/mocks/msw/handlers/aridhiaHandlers.js.map +1 -1
  394. package/dist/mocks/msw/handlers/asyncJobHandlers.d.ts +21 -2
  395. package/dist/mocks/msw/handlers/asyncJobHandlers.d.ts.map +1 -1
  396. package/dist/mocks/msw/handlers/asyncJobHandlers.js +30 -22
  397. package/dist/mocks/msw/handlers/asyncJobHandlers.js.map +1 -1
  398. package/dist/mocks/msw/handlers/cohortBuilderHandlers.d.ts +27 -0
  399. package/dist/mocks/msw/handlers/cohortBuilderHandlers.d.ts.map +1 -0
  400. package/dist/mocks/msw/handlers/cohortBuilderHandlers.js +158 -0
  401. package/dist/mocks/msw/handlers/cohortBuilderHandlers.js.map +1 -0
  402. package/dist/mocks/msw/handlers/subscriptionHandlers.js +1 -1
  403. package/dist/mocks/msw/handlers/subscriptionHandlers.js.map +1 -1
  404. package/dist/mocks/msw/handlers/userProfileHandlers.d.ts.map +1 -1
  405. package/dist/mocks/msw/handlers/userProfileHandlers.js +2 -2
  406. package/dist/mocks/msw/handlers/userProfileHandlers.js.map +1 -1
  407. package/dist/mocks/query/mockColumnCategoryTable.d.ts +19 -0
  408. package/dist/mocks/query/mockColumnCategoryTable.d.ts.map +1 -0
  409. package/dist/mocks/query/mockColumnCategoryTable.js +188 -0
  410. package/dist/mocks/query/mockColumnCategoryTable.js.map +1 -0
  411. package/dist/stories/ColorPaletteInspector.d.ts.map +1 -1
  412. package/dist/stories/ColorPaletteInspector.js +2 -2
  413. package/dist/stories/ColorPaletteInspector.js.map +1 -1
  414. package/dist/style/components/facet_nav/_facet-nav-panel.scss +8 -0
  415. package/dist/style/main.css +1 -1
  416. package/dist/synapse-queries/auth/useOIDC.js +2 -2
  417. package/dist/synapse-queries/auth/useOIDC.js.map +1 -1
  418. package/dist/synapse-queries/auth/useUnbindOAuthProviderIdentity.js +2 -2
  419. package/dist/synapse-queries/auth/useUnbindOAuthProviderIdentity.js.map +1 -1
  420. package/dist/synapse-queries/challenge/useChallenge.js +2 -2
  421. package/dist/synapse-queries/challenge/useChallenge.js.map +1 -1
  422. package/dist/synapse-queries/chat/useChat.js +8 -8
  423. package/dist/synapse-queries/chat/useChat.js.map +1 -1
  424. package/dist/synapse-queries/curation/task/useCurationTask.js +10 -10
  425. package/dist/synapse-queries/curation/task/useCurationTask.js.map +1 -1
  426. package/dist/synapse-queries/dataaccess/useAccessRequirements.js +24 -24
  427. package/dist/synapse-queries/dataaccess/useAccessRequirements.js.map +1 -1
  428. package/dist/synapse-queries/dataaccess/useDataAccessSubmission.js +4 -4
  429. package/dist/synapse-queries/dataaccess/useDataAccessSubmission.js.map +1 -1
  430. package/dist/synapse-queries/dataaccess/useEDuc.js +6 -6
  431. package/dist/synapse-queries/dataaccess/useEDuc.js.map +1 -1
  432. package/dist/synapse-queries/dataaccess/useFormTemplate.js +4 -4
  433. package/dist/synapse-queries/dataaccess/useFormTemplate.js.map +1 -1
  434. package/dist/synapse-queries/download/index.js +2 -2
  435. package/dist/synapse-queries/download/useDownloadList.d.ts +5 -0
  436. package/dist/synapse-queries/download/useDownloadList.d.ts.map +1 -1
  437. package/dist/synapse-queries/download/useDownloadList.js +14 -13
  438. package/dist/synapse-queries/download/useDownloadList.js.map +1 -1
  439. package/dist/synapse-queries/entity/useEntity.d.ts.map +1 -1
  440. package/dist/synapse-queries/entity/useEntity.js +20 -20
  441. package/dist/synapse-queries/entity/useEntity.js.map +1 -1
  442. package/dist/synapse-queries/entity/useExportToADWorkbench.d.ts.map +1 -1
  443. package/dist/synapse-queries/entity/useExportToADWorkbench.js +2 -1
  444. package/dist/synapse-queries/entity/useExportToADWorkbench.js.map +1 -1
  445. package/dist/synapse-queries/entity/useExportToCavatica.d.ts.map +1 -1
  446. package/dist/synapse-queries/entity/useExportToCavatica.js +3 -2
  447. package/dist/synapse-queries/entity/useExportToCavatica.js.map +1 -1
  448. package/dist/synapse-queries/entity/useExportToPluto.d.ts.map +1 -1
  449. package/dist/synapse-queries/entity/useExportToPluto.js +2 -1
  450. package/dist/synapse-queries/entity/useExportToPluto.js.map +1 -1
  451. package/dist/synapse-queries/entity/useGetQueryResultBundle.d.ts.map +1 -1
  452. package/dist/synapse-queries/entity/useGetQueryResultBundle.js +4 -7
  453. package/dist/synapse-queries/entity/useGetQueryResultBundle.js.map +1 -1
  454. package/dist/synapse-queries/forum/useReply.js +6 -6
  455. package/dist/synapse-queries/forum/useReply.js.map +1 -1
  456. package/dist/synapse-queries/forum/useThread.js +14 -14
  457. package/dist/synapse-queries/forum/useThread.js.map +1 -1
  458. package/dist/synapse-queries/grid/useEstablishWebsocketConnection.js +1 -1
  459. package/dist/synapse-queries/grid/useEstablishWebsocketConnection.js.map +1 -1
  460. package/dist/synapse-queries/grid/useGridSession.js +4 -4
  461. package/dist/synapse-queries/grid/useGridSession.js.map +1 -1
  462. package/dist/synapse-queries/index.js +177 -176
  463. package/dist/synapse-queries/oauth/useOAuthClient.js +9 -9
  464. package/dist/synapse-queries/oauth/useOAuthClient.js.map +1 -1
  465. package/dist/synapse-queries/portal/usePortal.js +7 -7
  466. package/dist/synapse-queries/portal/usePortal.js.map +1 -1
  467. package/dist/synapse-queries/subscription/useSubscription.js +4 -4
  468. package/dist/synapse-queries/subscription/useSubscription.js.map +1 -1
  469. package/dist/synapse-queries/table/useTableUpdateTransaction.js +2 -2
  470. package/dist/synapse-queries/table/useTableUpdateTransaction.js.map +1 -1
  471. package/dist/synapse-queries/team/useTeam.js +2 -2
  472. package/dist/synapse-queries/team/useTeam.js.map +1 -1
  473. package/dist/synapse-queries/team/useTeamList.d.ts.map +1 -1
  474. package/dist/synapse-queries/team/useTeamList.js +3 -3
  475. package/dist/synapse-queries/team/useTeamList.js.map +1 -1
  476. package/dist/synapse-queries/team/useTeamMembers.js +8 -8
  477. package/dist/synapse-queries/team/useTeamMembers.js.map +1 -1
  478. package/dist/synapse-queries/termsOfService/useTermsOfService.js +2 -2
  479. package/dist/synapse-queries/termsOfService/useTermsOfService.js.map +1 -1
  480. package/dist/synapse-queries/trash/useTrashCan.js +4 -4
  481. package/dist/synapse-queries/trash/useTrashCan.js.map +1 -1
  482. package/dist/synapse-queries/user/useCertificationQuiz.js +2 -2
  483. package/dist/synapse-queries/user/useCertificationQuiz.js.map +1 -1
  484. package/dist/synapse-queries/user/useFavorites.js +4 -4
  485. package/dist/synapse-queries/user/useFavorites.js.map +1 -1
  486. package/dist/synapse-queries/user/useRevokeCertification.js +2 -2
  487. package/dist/synapse-queries/user/useRevokeCertification.js.map +1 -1
  488. package/dist/synapse-queries/wiki/useWiki.js +10 -10
  489. package/dist/synapse-queries/wiki/useWiki.js.map +1 -1
  490. package/dist/tsconfig.build.tsbuildinfo +1 -1
  491. package/dist/utils/ContentTypeUtils.js +4 -4
  492. package/dist/utils/ContentTypeUtils.js.map +1 -1
  493. package/dist/utils/PermissionLevelToAccessType.js +1 -1
  494. package/dist/utils/PermissionLevelToAccessType.js.map +1 -1
  495. package/dist/utils/analytics/useGoogleAnalytics.js +1 -1
  496. package/dist/utils/analytics/useGoogleAnalytics.js.map +1 -1
  497. package/dist/utils/context/DocumentMetadataContext.js +1 -1
  498. package/dist/utils/context/DocumentMetadataContext.js.map +1 -1
  499. package/dist/utils/functions/AccessControlListUtils.d.ts.map +1 -1
  500. package/dist/utils/functions/AccessControlListUtils.js +3 -3
  501. package/dist/utils/functions/AccessControlListUtils.js.map +1 -1
  502. package/dist/utils/functions/ArrayUtils.js +2 -2
  503. package/dist/utils/functions/ArrayUtils.js.map +1 -1
  504. package/dist/utils/functions/FileHandleUtils.js +1 -1
  505. package/dist/utils/functions/FileHandleUtils.js.map +1 -1
  506. package/dist/utils/functions/RegularExpressions.js +1 -1
  507. package/dist/utils/functions/RegularExpressions.js.map +1 -1
  508. package/dist/utils/functions/StringUtils.d.ts.map +1 -1
  509. package/dist/utils/functions/StringUtils.js +1 -2
  510. package/dist/utils/functions/StringUtils.js.map +1 -1
  511. package/dist/utils/functions/deepLinkingUtils.js +2 -2
  512. package/dist/utils/functions/deepLinkingUtils.js.map +1 -1
  513. package/dist/utils/functions/enumerationFacet.d.ts +26 -0
  514. package/dist/utils/functions/enumerationFacet.d.ts.map +1 -0
  515. package/dist/utils/functions/enumerationFacet.js +27 -0
  516. package/dist/utils/functions/enumerationFacet.js.map +1 -0
  517. package/dist/utils/functions/facetCountUtils.d.ts +12 -0
  518. package/dist/utils/functions/facetCountUtils.d.ts.map +1 -0
  519. package/dist/utils/functions/facetCountUtils.js +9 -0
  520. package/dist/utils/functions/facetCountUtils.js.map +1 -0
  521. package/dist/utils/functions/getEndpoint.js.map +1 -1
  522. package/dist/utils/functions/getUserData.js +1 -1
  523. package/dist/utils/functions/getUserData.js.map +1 -1
  524. package/dist/utils/functions/queryUtils.d.ts +1 -1
  525. package/dist/utils/functions/queryUtils.d.ts.map +1 -1
  526. package/dist/utils/functions/queryUtils.js +26 -22
  527. package/dist/utils/functions/queryUtils.js.map +1 -1
  528. package/dist/utils/functions/testDownloadSpeed.d.ts.map +1 -1
  529. package/dist/utils/functions/testDownloadSpeed.js +17 -26
  530. package/dist/utils/functions/testDownloadSpeed.js.map +1 -1
  531. package/dist/utils/functions/unCamelCase.js +1 -1
  532. package/dist/utils/functions/unCamelCase.js.map +1 -1
  533. package/dist/utils/hooks/useGetInfoFromIds.js +5 -5
  534. package/dist/utils/hooks/useGetInfoFromIds.js.map +1 -1
  535. package/dist/utils/hooks/useImmutableTableQuery/TableQueryReducerActions.js +1 -1
  536. package/dist/utils/hooks/useImmutableTableQuery/TableQueryReducerActions.js.map +1 -1
  537. package/dist/utils/hooks/useLogin.d.ts.map +1 -1
  538. package/dist/utils/hooks/useLogin.js +5 -5
  539. package/dist/utils/hooks/useLogin.js.map +1 -1
  540. package/dist/utils/hooks/useUploadFileEntity/useCreateFolderPath.js.map +1 -1
  541. package/dist/utils/jsonschema/collectTopLevelProperties.d.ts +6 -0
  542. package/dist/utils/jsonschema/collectTopLevelProperties.d.ts.map +1 -1
  543. package/dist/utils/jsonschema/collectTopLevelProperties.js +1 -1
  544. package/dist/utils/jsonschema/collectTopLevelProperties.js.map +1 -1
  545. package/dist/utils/jsonschema/getNumberOrEnumInfo.d.ts +22 -0
  546. package/dist/utils/jsonschema/getNumberOrEnumInfo.d.ts.map +1 -0
  547. package/dist/utils/jsonschema/getNumberOrEnumInfo.js +39 -0
  548. package/dist/utils/jsonschema/getNumberOrEnumInfo.js.map +1 -0
  549. package/dist/utils/jsonschema/getOnlyNonNullOneOfOption.d.ts +1 -0
  550. package/dist/utils/jsonschema/getOnlyNonNullOneOfOption.d.ts.map +1 -1
  551. package/dist/utils/jsonschema/getOnlyNonNullOneOfOption.js +1 -1
  552. package/dist/utils/jsonschema/getOnlyNonNullOneOfOption.js.map +1 -1
  553. package/dist/utils/jsonschema/getSchemaPropertyInfo.d.ts +5 -0
  554. package/dist/utils/jsonschema/getSchemaPropertyInfo.d.ts.map +1 -1
  555. package/dist/utils/jsonschema/getSchemaPropertyInfo.js +30 -15
  556. package/dist/utils/jsonschema/getSchemaPropertyInfo.js.map +1 -1
  557. package/dist/utils/jsonschema/submissionContext.js +2 -2
  558. package/dist/utils/jsonschema/submissionContext.js.map +1 -1
  559. package/package.json +4 -4
@@ -13,6 +13,19 @@ export type RowDataTableProps = {
13
13
  /** Optional display value overrides for column names */
14
14
  columnAliases?: Record<string, string>;
15
15
  };
16
+ export type RowDataEntriesTableProps = Pick<RowDataTableProps, 'rowData' | 'headers' | 'columnLinks' | 'columnAliases'> & {
17
+ /** The [columnName, value] pairs to display, in display order */
18
+ entries: [string, string][];
19
+ };
20
+ /**
21
+ * Returns the [columnName, value] pairs for the given columns, in the order of `columns`.
22
+ * Columns that are not in `headers` or that have no value in `rowData` are omitted.
23
+ */
24
+ export declare function getDisplayedRowDataEntries(columns: string[], headers: SelectColumn[], rowData: Array<string | null>): [string, string][];
25
+ /**
26
+ * Displays the given column name/value pairs of a Synapse Table row as a key/value table
27
+ */
28
+ export declare function RowDataEntriesTable(props: RowDataEntriesTableProps): React.ReactNode;
16
29
  /**
17
30
  * Displays a table of column names and Synapse Table row data represented as key/value pairs
18
31
  */
@@ -1 +1 @@
1
- {"version":3,"file":"RowDataTable.d.ts","sourceRoot":"","sources":["../../../src/components/RowDataTable/RowDataTable.tsx"],"names":[],"mappings":"AAAA,OAAO,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AAG,IAAI,CACzC,iBAAiB,EACjB,SAAS,GAAG,SAAS,GAAG,aAAa,GAAG,eAAe,CACxD,GAAG;IACF,iEAAiE;IACjE,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAA;CAC5B,CAAA;AAeD;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,MAAM,EAAE,EACjB,OAAO,EAAE,YAAY,EAAE,EACvB,OAAO,EAAE,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,GAC5B,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAWpB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,wBAAwB,GAC9B,KAAK,CAAC,SAAS,CAsCjB;AAED;;GAEG;AACH,QAAA,MAAM,YAAY,GAAI,OAAO,iBAAiB,KAAG,KAAK,CAAC,SAmBtD,CAAA;AAED,eAAe,YAAY,CAAA"}
@@ -4,17 +4,24 @@ import "../GenericCard/index.js";
4
4
  import "react";
5
5
  import { jsx as n, jsxs as r } from "react/jsx-runtime";
6
6
  //#region src/components/RowDataTable/RowDataTable.tsx
7
- var i = (i) => {
8
- let { columnAliases: a, columnLinks: o, headers: s, rowData: c, displayedColumns: l } = i, u = l ? s.filter((e) => l.includes(e.name)).map((e) => e.name) : s.map((e) => e.name), d = [];
9
- for (let e = 0; e < u.length; e += 1) {
10
- let t = u[e], n = s.findIndex((e) => e.name === t), r = n === -1 ? void 0 : c[n], i = s[n], a = r === "null", o = i.columnType.endsWith("_LIST");
11
- typeof r == "string" && !(a || o && (r === "[]" || r === "[null]")) && d.push([t, r]);
12
- }
7
+ function i(e, t) {
8
+ return typeof e != "string" || e === "null" ? !1 : !(t.columnType.endsWith("_LIST") && (e === "[]" || e === "[null]"));
9
+ }
10
+ function a(e, t, n) {
11
+ return e.flatMap((e) => {
12
+ let r = t.findIndex((t) => t.name === e);
13
+ if (r === -1) return [];
14
+ let a = n[r];
15
+ return i(a, t[r]) ? [[e, a]] : [];
16
+ });
17
+ }
18
+ function o(i) {
19
+ let { columnAliases: a, columnLinks: o, headers: s, rowData: c, entries: l } = i;
13
20
  return /* @__PURE__ */ n(t, {
14
21
  sx: { width: "100%" },
15
22
  children: /* @__PURE__ */ n("table", {
16
23
  style: { width: "100%" },
17
- children: /* @__PURE__ */ n("tbody", { children: d?.map(([t, i]) => /* @__PURE__ */ r("tr", { children: [/* @__PURE__ */ n("td", {
24
+ children: /* @__PURE__ */ n("tbody", { children: l.map(([t, i]) => /* @__PURE__ */ r("tr", { children: [/* @__PURE__ */ n("td", {
18
25
  style: { width: "256px" },
19
26
  children: /* @__PURE__ */ n("span", {
20
27
  style: {
@@ -35,8 +42,18 @@ var i = (i) => {
35
42
  }) })] }, t)) })
36
43
  })
37
44
  });
45
+ }
46
+ var s = (e) => {
47
+ let { columnAliases: t, columnLinks: r, headers: i, rowData: s, displayedColumns: c } = e;
48
+ return /* @__PURE__ */ n(o, {
49
+ entries: a(c ? i.filter((e) => c.includes(e.name)).map((e) => e.name) : i.map((e) => e.name), i, s),
50
+ headers: i,
51
+ rowData: s,
52
+ columnLinks: r,
53
+ columnAliases: t
54
+ });
38
55
  };
39
56
  //#endregion
40
- export { i as default };
57
+ export { o as RowDataEntriesTable, s as default, a as getDisplayedRowDataEntries };
41
58
 
42
59
  //# sourceMappingURL=RowDataTable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RowDataTable.js","names":[],"sources":["../../../src/components/RowDataTable/RowDataTable.tsx"],"sourcesContent":["import React from 'react'\nimport { StyledTableContainer } from '@/components/styled/StyledTableContainer'\nimport { SelectColumn } from '@sage-bionetworks/synapse-types'\nimport { LabelLinkConfig } from '../CardContainerLogic'\nimport { SynapseCardLabel } from '../GenericCard'\n\nexport type RowDataTableProps = {\n /** Array of string values corresponding to the data for a row */\n rowData: Array<string | null>\n /** The headers for the columns in the table */\n headers: SelectColumn[]\n /** Optional list of column names whose data should be displayed in the table. If not provided, all columns with data will be shown. */\n displayedColumns?: string[]\n /** Optional configuration for linking columns */\n columnLinks?: LabelLinkConfig\n /** Optional display value overrides for column names */\n columnAliases?: Record<string, string>\n}\n\n/**\n * Displays a table of column names and Synapse Table row data represented as key/value pairs\n */\nconst RowDataTable = (props: RowDataTableProps): React.ReactNode => {\n const { columnAliases, columnLinks, headers, rowData, displayedColumns } =\n props\n\n const columns = displayedColumns\n ? headers\n .filter(header => displayedColumns.includes(header.name))\n .map(header => header.name)\n : headers.map(header => header.name)\n\n const labelValueArray: [string, string][] = []\n\n for (let i = 0; i < columns.length; i += 1) {\n const columnName = columns[i]\n const columnIndex = headers.findIndex(header => header.name === columnName)\n const value = columnIndex !== -1 ? rowData[columnIndex] : undefined\n\n // value can be 'null' if column type is of type STRING or '[null]' if column type is of STRING_LIST\n const column = headers[columnIndex]\n const isNullValue = value === 'null'\n const isListType = column.columnType.endsWith('_LIST')\n\n const isEmptyListOrListOfNull = value === '[]' || value === '[null]'\n if (\n typeof value === 'string' &&\n !(isNullValue || (isListType && isEmptyListOrListOfNull))\n ) {\n labelValueArray.push([columnName, value])\n }\n }\n\n return (\n <StyledTableContainer sx={{ width: '100%' }}>\n <table style={{ width: '100%' }}>\n <tbody>\n {labelValueArray?.map(([columnName, value]) => (\n <tr key={columnName}>\n <td style={{ width: '256px' }}>\n <span\n style={{\n fontSize: '14px',\n lineHeight: '20px',\n color: '#333',\n }}\n >\n {columnAliases?.[columnName] ?? columnName}\n </span>\n </td>\n <td>\n <SynapseCardLabel\n value={value}\n columnName={columnName}\n labelLink={columnLinks?.find(\n link => link.matchColumnName === columnName,\n )}\n selectColumns={headers}\n columnModels={undefined}\n isHeader={false}\n rowData={rowData}\n />\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </StyledTableContainer>\n )\n}\n\nexport default RowDataTable\n"],"mappings":";;;;;;AAsBA,IAAM,KAAgB,MAA8C;CAClE,IAAM,EAAE,kBAAe,gBAAa,YAAS,YAAS,wBACpD,GAEI,IAAU,IACZ,EACG,QAAO,MAAU,EAAiB,SAAS,EAAO,IAAI,CAAC,EACvD,KAAI,MAAU,EAAO,IAAI,IAC5B,EAAQ,KAAI,MAAU,EAAO,IAAI,GAE/B,IAAsC,CAAC;CAE7C,KAAK,IAAI,IAAI,GAAG,IAAI,EAAQ,QAAQ,KAAK,GAAG;EAC1C,IAAM,IAAa,EAAQ,IACrB,IAAc,EAAQ,WAAU,MAAU,EAAO,SAAS,CAAU,GACpE,IAAQ,MAAgB,KAA4B,KAAA,IAAvB,EAAQ,IAGrC,IAAS,EAAQ,IACjB,IAAc,MAAU,QACxB,IAAa,EAAO,WAAW,SAAS,OAAO;EAGrD,AACE,OAAO,KAAU,YACjB,EAAE,KAAgB,MAHY,MAAU,QAAQ,MAAU,cAK1D,EAAgB,KAAK,CAAC,GAAY,CAAK,CAAC;CAE5C;CAEA,OACE,kBAAC,GAAD;EAAsB,IAAI,EAAE,OAAO,OAAO;YACxC,kBAAC,SAAD;GAAO,OAAO,EAAE,OAAO,OAAO;aAC5B,kBAAC,SAAD,EAAA,UACG,GAAiB,KAAK,CAAC,GAAY,OAClC,kBAAC,MAAD,EAAA,UAAA,CACE,kBAAC,MAAD;IAAI,OAAO,EAAE,OAAO,QAAQ;cAC1B,kBAAC,QAAD;KACE,OAAO;MACL,UAAU;MACV,YAAY;MACZ,OAAO;KACT;eAEC,IAAgB,MAAe;IAC5B,CAAA;GACJ,CAAA,GACJ,kBAAC,MAAD,EAAA,UACE,kBAAC,GAAD;IACS;IACK;IACZ,WAAW,GAAa,MACtB,MAAQ,EAAK,oBAAoB,CACnC;IACA,eAAe;IACf,cAAc,KAAA;IACd,UAAU;IACD;GACV,CAAA,EACC,CAAA,CACF,EAAA,GAzBK,CAyBL,CACL,EACI,CAAA;EACF,CAAA;CACa,CAAA;AAE1B"}
1
+ {"version":3,"file":"RowDataTable.js","names":[],"sources":["../../../src/components/RowDataTable/RowDataTable.tsx"],"sourcesContent":["import React from 'react'\nimport { StyledTableContainer } from '@/components/styled/StyledTableContainer'\nimport { SelectColumn } from '@sage-bionetworks/synapse-types'\nimport { LabelLinkConfig } from '../CardContainerLogic'\nimport { SynapseCardLabel } from '../GenericCard'\n\nexport type RowDataTableProps = {\n /** Array of string values corresponding to the data for a row */\n rowData: Array<string | null>\n /** The headers for the columns in the table */\n headers: SelectColumn[]\n /** Optional list of column names whose data should be displayed in the table. If not provided, all columns with data will be shown. */\n displayedColumns?: string[]\n /** Optional configuration for linking columns */\n columnLinks?: LabelLinkConfig\n /** Optional display value overrides for column names */\n columnAliases?: Record<string, string>\n}\n\nexport type RowDataEntriesTableProps = Pick<\n RowDataTableProps,\n 'rowData' | 'headers' | 'columnLinks' | 'columnAliases'\n> & {\n /** The [columnName, value] pairs to display, in display order */\n entries: [string, string][]\n}\n\nfunction hasDisplayableValue(\n value: string | null | undefined,\n column: SelectColumn,\n): value is string {\n // value can be 'null' if column type is of type STRING or '[null]' if column type is of STRING_LIST\n if (typeof value !== 'string' || value === 'null') {\n return false\n }\n const isListType = column.columnType.endsWith('_LIST')\n const isEmptyListOrListOfNull = value === '[]' || value === '[null]'\n return !(isListType && isEmptyListOrListOfNull)\n}\n\n/**\n * Returns the [columnName, value] pairs for the given columns, in the order of `columns`.\n * Columns that are not in `headers` or that have no value in `rowData` are omitted.\n */\nexport function getDisplayedRowDataEntries(\n columns: string[],\n headers: SelectColumn[],\n rowData: Array<string | null>,\n): [string, string][] {\n return columns.flatMap((columnName): [string, string][] => {\n const columnIndex = headers.findIndex(header => header.name === columnName)\n if (columnIndex === -1) {\n return []\n }\n const value = rowData[columnIndex]\n return hasDisplayableValue(value, headers[columnIndex])\n ? [[columnName, value]]\n : []\n })\n}\n\n/**\n * Displays the given column name/value pairs of a Synapse Table row as a key/value table\n */\nexport function RowDataEntriesTable(\n props: RowDataEntriesTableProps,\n): React.ReactNode {\n const { columnAliases, columnLinks, headers, rowData, entries } = props\n return (\n <StyledTableContainer sx={{ width: '100%' }}>\n <table style={{ width: '100%' }}>\n <tbody>\n {entries.map(([columnName, value]) => (\n <tr key={columnName}>\n <td style={{ width: '256px' }}>\n <span\n style={{\n fontSize: '14px',\n lineHeight: '20px',\n color: '#333',\n }}\n >\n {columnAliases?.[columnName] ?? columnName}\n </span>\n </td>\n <td>\n <SynapseCardLabel\n value={value}\n columnName={columnName}\n labelLink={columnLinks?.find(\n link => link.matchColumnName === columnName,\n )}\n selectColumns={headers}\n columnModels={undefined}\n isHeader={false}\n rowData={rowData}\n />\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </StyledTableContainer>\n )\n}\n\n/**\n * Displays a table of column names and Synapse Table row data represented as key/value pairs\n */\nconst RowDataTable = (props: RowDataTableProps): React.ReactNode => {\n const { columnAliases, columnLinks, headers, rowData, displayedColumns } =\n props\n\n const columns = displayedColumns\n ? headers\n .filter(header => displayedColumns.includes(header.name))\n .map(header => header.name)\n : headers.map(header => header.name)\n\n return (\n <RowDataEntriesTable\n entries={getDisplayedRowDataEntries(columns, headers, rowData)}\n headers={headers}\n rowData={rowData}\n columnLinks={columnLinks}\n columnAliases={columnAliases}\n />\n )\n}\n\nexport default RowDataTable\n"],"mappings":";;;;;;AA2BA,SAAS,EACP,GACA,GACiB;CAOjB,OALI,OAAO,KAAU,YAAY,MAAU,SAClC,KAIF,EAFY,EAAO,WAAW,SAAS,OAErC,MADuB,MAAU,QAAQ,MAAU;AAE9D;AAMA,SAAgB,EACd,GACA,GACA,GACoB;CACpB,OAAO,EAAQ,SAAS,MAAmC;EACzD,IAAM,IAAc,EAAQ,WAAU,MAAU,EAAO,SAAS,CAAU;EAC1E,IAAI,MAAgB,IAClB,OAAO,CAAC;EAEV,IAAM,IAAQ,EAAQ;EACtB,OAAO,EAAoB,GAAO,EAAQ,EAAY,IAClD,CAAC,CAAC,GAAY,CAAK,CAAC,IACpB,CAAC;CACP,CAAC;AACH;AAKA,SAAgB,EACd,GACiB;CACjB,IAAM,EAAE,kBAAe,gBAAa,YAAS,YAAS,eAAY;CAClE,OACE,kBAAC,GAAD;EAAsB,IAAI,EAAE,OAAO,OAAO;YACxC,kBAAC,SAAD;GAAO,OAAO,EAAE,OAAO,OAAO;aAC5B,kBAAC,SAAD,EAAA,UACG,EAAQ,KAAK,CAAC,GAAY,OACzB,kBAAC,MAAD,EAAA,UAAA,CACE,kBAAC,MAAD;IAAI,OAAO,EAAE,OAAO,QAAQ;cAC1B,kBAAC,QAAD;KACE,OAAO;MACL,UAAU;MACV,YAAY;MACZ,OAAO;KACT;eAEC,IAAgB,MAAe;IAC5B,CAAA;GACJ,CAAA,GACJ,kBAAC,MAAD,EAAA,UACE,kBAAC,GAAD;IACS;IACK;IACZ,WAAW,GAAa,MACtB,MAAQ,EAAK,oBAAoB,CACnC;IACA,eAAe;IACf,cAAc,KAAA;IACd,UAAU;IACD;GACV,CAAA,EACC,CAAA,CACF,EAAA,GAzBK,CAyBL,CACL,EACI,CAAA;EACF,CAAA;CACa,CAAA;AAE1B;AAKA,IAAM,KAAgB,MAA8C;CAClE,IAAM,EAAE,kBAAe,gBAAa,YAAS,YAAS,wBACpD;CAQF,OACE,kBAAC,GAAD;EACE,SAAS,EARG,IACZ,EACG,QAAO,MAAU,EAAiB,SAAS,EAAO,IAAI,CAAC,EACvD,KAAI,MAAU,EAAO,IAAI,IAC5B,EAAQ,KAAI,MAAU,EAAO,IAAI,GAIY,GAAS,CAAO;EACpD;EACA;EACI;EACE;CAChB,CAAA;AAEL"}
@@ -89,7 +89,7 @@ function h(s) {
89
89
  }),
90
90
  /* @__PURE__ */ a("div", {
91
91
  className: "FeedItemDescription",
92
- children: e.contentSnippet?.replace(/\[...\]|\[…\]/gm, "…")
92
+ children: e.contentSnippet?.replaceAll(/\[...\]|\[…\]/gm, "…")
93
93
  }),
94
94
  /* @__PURE__ */ a("a", {
95
95
  className: "FeedItemLink",
@@ -1 +1 @@
1
- {"version":3,"file":"RssFeedCards.js","names":[],"sources":["../../../src/components/RssFeedCards/RssFeedCards.tsx"],"sourcesContent":["import NoData from '@/assets/icons/NoData'\nimport { ReactComponent as SubscribePlus } from '@/assets/icons/subscribe_plus.svg'\nimport LargeButton from '@/components/styled/LargeButton'\nimport dayjs from 'dayjs'\nimport MailchimpSubscribe from 'react-mailchimp-subscribe'\nimport Parser from 'rss-parser'\nimport { QueryClient, queryOptions, useQuery } from '@tanstack/react-query'\nimport { useState } from 'react'\n\nconst rssParser = new Parser()\n\nexport type RssFilter = {\n type?: 'tag' | 'category'\n value: string\n}\n\nexport type RssFeedCardsProps = {\n url: string\n filter?: RssFilter // optional tag or category to use as a filter\n itemsToShow: number\n allowCategories?: string[]\n mailChimpListName?: string\n mailChimpUrl?: string\n viewAllNewsButtonText?: string\n hideDate?: boolean\n}\n\nfunction buildRssFeedUrl(url: string, filter?: RssFilter) {\n const filterValue = filter?.value\n const filterType = filter?.type\n const tagPath = filterValue\n ? `/${filterType ?? 'tag'}/${filterValue.replace(' ', '-')}`\n : ''\n const allItemsUrl = `${url}${tagPath}`\n const feedUrl = `${allItemsUrl}/?feed=rss2`\n return { allItemsUrl, feedUrl }\n}\n\nfunction getRssFeedQueryOptions(feedUrl: string) {\n return queryOptions({\n queryKey: ['rssFeed', feedUrl],\n queryFn: () =>\n fetch(feedUrl)\n .then(response => response.text())\n .then(responseData => rssParser.parseString(responseData)),\n })\n}\n\nexport function RssFeedCards(props: RssFeedCardsProps) {\n const {\n url,\n filter,\n itemsToShow,\n allowCategories,\n mailChimpListName,\n mailChimpUrl,\n viewAllNewsButtonText,\n hideDate,\n } = props\n\n const { allItemsUrl, feedUrl } = buildRssFeedUrl(url, filter)\n\n const { data: rssFeed, isError } = useQuery(getRssFeedQueryOptions(feedUrl))\n\n const [isShowingSubscribeUI, setIsShowingSubscribeUI] = useState(false)\n\n if (rssFeed?.items?.length === 0) {\n return (\n <div className=\"text-center SRCBorderedPanel SRCBorderedPanel--padded2x\">\n {NoData}\n <div style={{ marginTop: '20px', fontStyle: 'italic' }}>\n There are no items currently available\n </div>\n </div>\n )\n }\n return (\n <>\n {mailChimpUrl && (\n <div className=\"FeedSubscribe\">\n {!isShowingSubscribeUI && (\n <a\n className=\"FeedSubscribeToNewsLink SRC-no-border-bottom-imp\"\n onClick={() => setIsShowingSubscribeUI(true)}\n >\n <SubscribePlus title=\"Subscribe to News\" />\n Subscribe to News\n </a>\n )}\n {isShowingSubscribeUI && (\n <div className=\"MailchimpSubscribeContainer\">\n <SubscribePlus title=\"Subscribe to News\" />\n <p>\n Subscribe to receive the {mailChimpListName} by e-mail, which\n provides information and updates related to the Portal. You can\n opt out at any time by using the unsubscribe link within the\n e-mail. We will not share your information with any third\n parties or use it for any other purposes.\n </p>\n <div className=\"SRC-marginBottomTop\">\n <MailchimpSubscribe url={mailChimpUrl} />\n </div>\n </div>\n )}\n </div>\n )}\n <div className=\"Feed\">\n <div className=\"FeedItems\">\n {rssFeed?.items &&\n rssFeed.items.map((item, index) => {\n // The other is to hide the large number of items in a particular feed (usually a max of 10 are returned). See state.isShowingMoreItems\n if (index >= itemsToShow) {\n return\n }\n\n return (\n <div key={item.guid} className={`FeedItem`}>\n <div>\n {allowCategories && allowCategories.length > 0 && (\n <div className=\"FeedItemCategories\">\n {item.categories?.map((categoryName: string) => {\n // are we allowed to show this category/tag?\n const categoryNameLowerCase =\n categoryName.toLowerCase()\n if (\n allowCategories?.findIndex(\n item =>\n categoryNameLowerCase === item.toLowerCase(),\n ) === -1\n )\n return null\n // else\n return (\n <a\n href={`${rssFeed.link}/tag/${categoryName.replace(\n ' ',\n '-',\n )}`}\n className=\"SRC-no-border-bottom-imp\"\n key={`${item.guid}_${categoryName}`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <div className=\"FeedItemCategory\">\n {categoryName}\n </div>\n </a>\n )\n })}\n </div>\n )}\n {!hideDate && (\n <p className=\"FeedItemDate\">\n {dayjs(item.isoDate).format('MMMM YYYY')}\n </p>\n )}\n <p className=\"FeedItemTitle\">{item.title}</p>\n <div className=\"FeedItemDescription\">\n {item.contentSnippet?.replace(/\\[...\\]|\\[…\\]/gm, '…')}\n </div>\n <a\n className=\"FeedItemLink\"\n href={item.link}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Continue reading\n </a>\n </div>\n </div>\n )\n })}\n </div>\n {rssFeed?.items &&\n rssFeed.items.length > itemsToShow &&\n allItemsUrl && (\n <div className=\"FeedViewAllNewsButtonContainer\">\n <LargeButton\n color=\"secondary\"\n variant=\"contained\"\n onClick={() => window.open(allItemsUrl, '_blank', 'noopener')}\n // @ts-expect-error - target prop exists, but TS doesn't recognize on styled component\n target=\"_blank\"\n >\n {viewAllNewsButtonText ?? 'View All News'}\n </LargeButton>\n </div>\n )}\n {isError && <div>Unable to load feed: {url}</div>}\n </div>\n </>\n )\n}\n\nexport default RssFeedCards\n\n/**\n * Prefetches the RSS feed into a QueryClient for use with HydrationBoundary.\n * Uses the same query key as the RssFeedCards component.\n */\nexport async function prefetchRssFeed(\n queryClient: QueryClient,\n url: string,\n filter?: RssFilter,\n): Promise<void> {\n const { feedUrl } = buildRssFeedUrl(url, filter)\n await queryClient.prefetchQuery(getRssFeedQueryOptions(feedUrl))\n}\n"],"mappings":";;;;;;;;;;AASA,IAAM,IAAY,IAAI,EAAO;AAkB7B,SAAS,EAAgB,GAAa,GAAoB;CACxD,IAAM,IAAc,GAAQ,OACtB,IAAa,GAAQ,MAIrB,IAAc,GAAG,IAHP,IACZ,IAAI,KAAc,MAAM,GAAG,EAAY,QAAQ,KAAK,GAAG,MACvD;CAGJ,OAAO;EAAE;EAAa,SAAA,GADH,EAAY;CACD;AAChC;AAEA,SAAS,EAAuB,GAAiB;CAC/C,OAAO,EAAa;EAClB,UAAU,CAAC,WAAW,CAAO;EAC7B,eACE,MAAM,CAAO,EACV,MAAK,MAAY,EAAS,KAAK,CAAC,EAChC,MAAK,MAAgB,EAAU,YAAY,CAAY,CAAC;CAC/D,CAAC;AACH;AAEA,SAAgB,EAAa,GAA0B;CACrD,IAAM,EACJ,QACA,WACA,gBACA,oBACA,sBACA,iBACA,0BACA,gBACE,GAEE,EA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V,QAAO;UACP,KAAI;oBAEJ,kBAAC,OAAD;WAAK,WAAU;qBACZ;UACE,CAAA;SACJ,GAPI,GAAG,EAAK,KAAK,GAAG,GAOpB;QAEP,CAAC;OACE,CAAA;OAEN,CAAC,KACA,kBAAC,KAAD;QAAG,WAAU;kBACV,EAAM,EAAK,OAAO,EAAE,OAAO,WAAW;OACtC,CAAA;OAEL,kBAAC,KAAD;QAAG,WAAU;kBAAiB,EAAK;OAAS,CAAA;OAC5C,kBAAC,OAAD;QAAK,WAAU;kBACZ,EAAK,gBAAgB,QAAQ,mBAAmB,GAAG;OACjD,CAAA;OACL,kBAAC,KAAD;QACE,WAAU;QACV,MAAM,EAAK;QACX,QAAO;QACP,KAAI;kBACL;OAEE,CAAA;MACA,EAAA,CAAA;KACF,GArDK,EAAK,IAqDV;IAET,CAAC;GACA,CAAA;GACJ,GAAS,SACR,EAAQ,MAAM,SAAS,KACvB,KACE,kBAAC,OAAD;IAAK,WAAU;cACb,kBAAC,GAAD;KACE,OAAM;KACN,SAAQ;KACR,eAAe,OAAO,KAAK,GAAa,UAAU,UAAU;KAE5D,QAAO;eAEN,KAAyB;IACf,CAAA;GACV,CAAA;GAER,KAAW,kBAAC,OAAD,EAAA,UAAA,CAAK,yBAAsB,CAAS,EAAA,CAAA;EAC7C;GACL,EAAA,CAAA;AAEN;AAQA,eAAsB,EACpB,GACA,GACA,GACe;CACf,IAAM,EAAE,eAAY,EAAgB,GAAK,CAAM;CAC/C,MAAM,EAAY,cAAc,EAAuB,CAAO,CAAC;AACjE"}
1
+ {"version":3,"file":"RssFeedCards.js","names":[],"sources":["../../../src/components/RssFeedCards/RssFeedCards.tsx"],"sourcesContent":["import NoData from '@/assets/icons/NoData'\nimport { ReactComponent as SubscribePlus } from '@/assets/icons/subscribe_plus.svg'\nimport LargeButton from '@/components/styled/LargeButton'\nimport dayjs from 'dayjs'\nimport MailchimpSubscribe from 'react-mailchimp-subscribe'\nimport Parser from 'rss-parser'\nimport { QueryClient, queryOptions, useQuery } from '@tanstack/react-query'\nimport { useState } from 'react'\n\nconst rssParser = new Parser()\n\nexport type RssFilter = {\n type?: 'tag' | 'category'\n value: string\n}\n\nexport type RssFeedCardsProps = {\n url: string\n filter?: RssFilter // optional tag or category to use as a filter\n itemsToShow: number\n allowCategories?: string[]\n mailChimpListName?: string\n mailChimpUrl?: string\n viewAllNewsButtonText?: string\n hideDate?: boolean\n}\n\nfunction buildRssFeedUrl(url: string, filter?: RssFilter) {\n const filterValue = filter?.value\n const filterType = filter?.type\n const tagPath = filterValue\n ? `/${filterType ?? 'tag'}/${filterValue.replace(' ', '-')}`\n : ''\n const allItemsUrl = `${url}${tagPath}`\n const feedUrl = `${allItemsUrl}/?feed=rss2`\n return { allItemsUrl, feedUrl }\n}\n\nfunction getRssFeedQueryOptions(feedUrl: string) {\n return queryOptions({\n queryKey: ['rssFeed', feedUrl],\n queryFn: () =>\n fetch(feedUrl)\n .then(response => response.text())\n .then(responseData => rssParser.parseString(responseData)),\n })\n}\n\nexport function RssFeedCards(props: RssFeedCardsProps) {\n const {\n url,\n filter,\n itemsToShow,\n allowCategories,\n mailChimpListName,\n mailChimpUrl,\n viewAllNewsButtonText,\n hideDate,\n } = props\n\n const { allItemsUrl, feedUrl } = buildRssFeedUrl(url, filter)\n\n const { data: rssFeed, isError } = useQuery(getRssFeedQueryOptions(feedUrl))\n\n const [isShowingSubscribeUI, setIsShowingSubscribeUI] = useState(false)\n\n if (rssFeed?.items?.length === 0) {\n return (\n <div className=\"text-center SRCBorderedPanel SRCBorderedPanel--padded2x\">\n {NoData}\n <div style={{ marginTop: '20px', fontStyle: 'italic' }}>\n There are no items currently available\n </div>\n </div>\n )\n }\n return (\n <>\n {mailChimpUrl && (\n <div className=\"FeedSubscribe\">\n {!isShowingSubscribeUI && (\n <a\n className=\"FeedSubscribeToNewsLink SRC-no-border-bottom-imp\"\n onClick={() => setIsShowingSubscribeUI(true)}\n >\n <SubscribePlus title=\"Subscribe to News\" />\n Subscribe to News\n </a>\n )}\n {isShowingSubscribeUI && (\n <div className=\"MailchimpSubscribeContainer\">\n <SubscribePlus title=\"Subscribe to News\" />\n <p>\n Subscribe to receive the {mailChimpListName} by e-mail, which\n provides information and updates related to the Portal. You can\n opt out at any time by using the unsubscribe link within the\n e-mail. We will not share your information with any third\n parties or use it for any other purposes.\n </p>\n <div className=\"SRC-marginBottomTop\">\n <MailchimpSubscribe url={mailChimpUrl} />\n </div>\n </div>\n )}\n </div>\n )}\n <div className=\"Feed\">\n <div className=\"FeedItems\">\n {rssFeed?.items &&\n rssFeed.items.map((item, index) => {\n // The other is to hide the large number of items in a particular feed (usually a max of 10 are returned). See state.isShowingMoreItems\n if (index >= itemsToShow) {\n return\n }\n\n return (\n <div key={item.guid} className={`FeedItem`}>\n <div>\n {allowCategories && allowCategories.length > 0 && (\n <div className=\"FeedItemCategories\">\n {item.categories?.map((categoryName: string) => {\n // are we allowed to show this category/tag?\n const categoryNameLowerCase =\n categoryName.toLowerCase()\n if (\n allowCategories?.findIndex(\n item =>\n categoryNameLowerCase === item.toLowerCase(),\n ) === -1\n )\n return null\n // else\n return (\n <a\n href={`${rssFeed.link}/tag/${categoryName.replace(\n ' ',\n '-',\n )}`}\n className=\"SRC-no-border-bottom-imp\"\n key={`${item.guid}_${categoryName}`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <div className=\"FeedItemCategory\">\n {categoryName}\n </div>\n </a>\n )\n })}\n </div>\n )}\n {!hideDate && (\n <p className=\"FeedItemDate\">\n {dayjs(item.isoDate).format('MMMM YYYY')}\n </p>\n )}\n <p className=\"FeedItemTitle\">{item.title}</p>\n <div className=\"FeedItemDescription\">\n {item.contentSnippet?.replaceAll(/\\[...\\]|\\[…\\]/gm, '…')}\n </div>\n <a\n className=\"FeedItemLink\"\n href={item.link}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Continue reading\n </a>\n </div>\n </div>\n )\n })}\n </div>\n {rssFeed?.items &&\n rssFeed.items.length > itemsToShow &&\n allItemsUrl && (\n <div className=\"FeedViewAllNewsButtonContainer\">\n <LargeButton\n color=\"secondary\"\n variant=\"contained\"\n onClick={() => window.open(allItemsUrl, '_blank', 'noopener')}\n // @ts-expect-error - target prop exists, but TS doesn't recognize on styled component\n target=\"_blank\"\n >\n {viewAllNewsButtonText ?? 'View All News'}\n </LargeButton>\n </div>\n )}\n {isError && <div>Unable to load feed: {url}</div>}\n </div>\n </>\n )\n}\n\nexport default RssFeedCards\n\n/**\n * Prefetches the RSS feed into a QueryClient for use with HydrationBoundary.\n * Uses the same query key as the RssFeedCards component.\n */\nexport async function prefetchRssFeed(\n queryClient: QueryClient,\n url: string,\n filter?: RssFilter,\n): Promise<void> {\n const { feedUrl } = buildRssFeedUrl(url, filter)\n await queryClient.prefetchQuery(getRssFeedQueryOptions(feedUrl))\n}\n"],"mappings":";;;;;;;;;;AASA,IAAM,IAAY,IAAI,EAAO;AAkB7B,SAAS,EAAgB,GAAa,GAAoB;CACxD,IAAM,IAAc,GAAQ,OACtB,IAAa,GAAQ,MAIrB,IAAc,GAAG,IAHP,IACZ,IAAI,KAAc,MAAM,GAAG,EAAY,QAAQ,KAAK,GAAG,MACvD;CAGJ,OAAO;EAAE;EAAa,SAAA,GADH,EAAY;CACD;AAChC;AAEA,SAAS,EAAuB,GAAiB;CAC/C,OAAO,EAAa;EAClB,UAAU,CAAC,WAAW,CAAO;EAC7B,eACE,MAAM,CAAO,EACV,MAAK,MAAY,EAAS,KAAK,CAAC,EAChC,MAAK,MAAgB,EAAU,YAAY,CAAY,CAAC;CAC/D,CAAC;AACH;AAEA,SAAgB,EAAa,GAA0B;CACrD,IAAM,EACJ,QACA,WACA,gBACA,oBACA,sBACA,iBACA,0BACA,gBACE,GAEE,EAAE,gBAAa,eAAY,EAAgB,GAAK,CAAM,GAEtD,EAAE,MAAM,GAAS,eAAY,EAAS,EAAuB,CAAO,CAAC,GAErE,CAAC,GAAsB,KAA2B,EAAS,EAAK;CAYtE,OAVI,GAAS,OA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,kBAAC,KAAD;QAAG,WAAU;kBACV,EAAM,EAAK,OAAO,EAAE,OAAO,WAAW;OACtC,CAAA;OAEL,kBAAC,KAAD;QAAG,WAAU;kBAAiB,EAAK;OAAS,CAAA;OAC5C,kBAAC,OAAD;QAAK,WAAU;kBACZ,EAAK,gBAAgB,WAAW,mBAAmB,GAAG;OACpD,CAAA;OACL,kBAAC,KAAD;QACE,WAAU;QACV,MAAM,EAAK;QACX,QAAO;QACP,KAAI;kBACL;OAEE,CAAA;MACA,EAAA,CAAA;KACF,GArDK,EAAK,IAqDV;IAET,CAAC;GACA,CAAA;GACJ,GAAS,SACR,EAAQ,MAAM,SAAS,KACvB,KACE,kBAAC,OAAD;IAAK,WAAU;cACb,kBAAC,GAAD;KACE,OAAM;KACN,SAAQ;KACR,eAAe,OAAO,KAAK,GAAa,UAAU,UAAU;KAE5D,QAAO;eAEN,KAAyB;IACf,CAAA;GACV,CAAA;GAER,KAAW,kBAAC,OAAD,EAAA,UAAA,CAAK,yBAAsB,CAAS,EAAA,CAAA;EAC7C;GACL,EAAA,CAAA;AAEN;AAQA,eAAsB,EACpB,GACA,GACA,GACe;CACf,IAAM,EAAE,eAAY,EAAgB,GAAK,CAAM;CAC/C,MAAM,EAAY,cAAc,EAAuB,CAAO,CAAC;AACjE"}
@@ -1 +1 @@
1
- {"version":3,"file":"AdditionalPropertiesSchemaField.d.ts","sourceRoot":"","sources":["../../../../src/components/SchemaDrivenAnnotationEditor/field/AdditionalPropertiesSchemaField.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,eAAe,EACf,UAAU,EACV,gBAAgB,EACjB,MAAM,aAAa,CAAA;AAYpB,QAAA,MAAM,iBAAiB,gEAMb,CAAA;AAEV,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAA;AAE7D,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,YAAY,CAwBpE;AAED,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,EAChB,YAAY,EAAE,YAAY,mCAiC3B;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,YAAY,EAAE,YAAY;;;;;;EAclE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,+BAA+B,CAC7C,CAAC,SAAS,KAAK,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,EACzC,CAAC,SAAS,gBAAgB,GAAG,UAAU,EACvC,CAAC,SAAS,eAAe,GAAG,GAAG,EAE/B,KAAK,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG;IAC3B,mBAAmB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAA;CAC3D,2CAuKF"}
1
+ {"version":3,"file":"AdditionalPropertiesSchemaField.d.ts","sourceRoot":"","sources":["../../../../src/components/SchemaDrivenAnnotationEditor/field/AdditionalPropertiesSchemaField.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,eAAe,EACf,UAAU,EACV,gBAAgB,EACjB,MAAM,aAAa,CAAA;AAYpB,QAAA,MAAM,iBAAiB,gEAMb,CAAA;AAEV,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAA;AAE7D,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,YAAY,CAwBpE;AAED,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,EAChB,YAAY,EAAE,YAAY,mCAiC3B;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,YAAY,EAAE,YAAY;;;;;;EAclE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,+BAA+B,CAC7C,CAAC,SAAS,KAAK,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,EACzC,CAAC,SAAS,gBAAgB,GAAG,UAAU,EACvC,CAAC,SAAS,eAAe,GAAG,GAAG,EAE/B,KAAK,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG;IAC3B,mBAAmB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAA;CAC3D,2CAqKF"}
@@ -25,7 +25,7 @@ function m(e, t) {
25
25
  });
26
26
  case "Datetime": return e.map((e) => typeof e == "string" && d.exec(e) ? e : (/* @__PURE__ */ new Date()).toISOString());
27
27
  case "Boolean": return e.map((e) => !!e);
28
- default: return e.map((e) => String(e));
28
+ default: return e.map(String);
29
29
  }
30
30
  }
31
31
  function h(e) {
@@ -45,7 +45,7 @@ function g(d) {
45
45
  r(() => {
46
46
  function e() {
47
47
  if (Array.isArray(g)) {
48
- let e = g.length === 0 || g.every((e) => e == null || e == ""), t = m(g, O);
48
+ let e = g.every((e) => e == null || e == ""), t = m(g, O);
49
49
  (e || O !== E) && a(g, t) && D(O);
50
50
  }
51
51
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AdditionalPropertiesSchemaField.js","names":[],"sources":["../../../../src/components/SchemaDrivenAnnotationEditor/field/AdditionalPropertiesSchemaField.tsx"],"sourcesContent":["import {\n FieldProps,\n FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n} from '@rjsf/utils'\nimport { isEqual } from 'lodash-es'\nimport { useEffect, useState } from 'react'\nimport FullWidthAlert from '../../FullWidthAlert/FullWidthAlert'\nimport { convertToArray } from '../AnnotationEditorUtils'\nimport { GridLegacy as Grid, InputLabel } from '@mui/material'\nimport { AdditionalPropertyContextProvider } from '../template/AdditionalPropertyContext'\n\n// Matches ####-##-##T##:##:##.###Z, e.g. 1970-01-01T12:00:000Z\nconst ISO_TIMESTAMP_REGEX = /\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z/\n\n// Types that correspond to the different input fields that the annotation editor supports\nconst propertyTypeArray = [\n 'String',\n 'Integer',\n 'Float',\n 'Boolean',\n 'Datetime',\n] as const\n\nexport type PropertyType = (typeof propertyTypeArray)[number]\n\nexport function guessPropertyType(list: Array<unknown>): PropertyType {\n if (list.length === 0) {\n // The field was just added, so default to string\n return 'String'\n } else if (\n list.every(\n item => typeof item === 'number' || item === 'NaN', // \"NaN\" is technically a float value\n )\n ) {\n if (list.every(item => Number.isInteger(item))) {\n return 'Integer'\n } else {\n return 'Float'\n }\n } else if (list.every(item => typeof item === 'boolean')) {\n return 'Boolean'\n } else if (\n list.every(item => typeof item === 'string') &&\n list.every((item: string) => !!ISO_TIMESTAMP_REGEX.exec(item))\n ) {\n return 'Datetime'\n }\n // otherwise, default type is 'string'\n return 'String'\n}\n\nexport function transformDataFromPropertyType(\n list: Array<any>,\n propertyType: PropertyType,\n) {\n switch (propertyType) {\n case 'Integer':\n return list.map(item =>\n Number.isNaN(Number(item)) ? 0 : Math.floor(Number(item)),\n )\n\n case 'Float':\n return list.map(item => {\n const asFloat = parseFloat(item as string)\n if (Number.isNaN(asFloat)) {\n return 'NaN'\n } else if (Number.isInteger(asFloat)) {\n return asFloat.toFixed(1)\n } else {\n return asFloat\n }\n })\n case 'Datetime':\n return list.map(item => {\n if (typeof item === 'string' && ISO_TIMESTAMP_REGEX.exec(item)) {\n return item\n } else {\n return new Date().toISOString()\n }\n })\n case 'Boolean':\n return list.map(item => !!item)\n case 'String':\n default:\n return list.map(item => String(item))\n }\n}\n\n/**\n * Maps a Synapse Annotation PropertyType to a JSON Schema that captures the type and format.\n * @param propertyType\n */\nexport function getSchemaForPropertyType(propertyType: PropertyType) {\n switch (propertyType) {\n case 'Datetime':\n return { type: 'string', format: 'datetime' }\n case 'Boolean':\n return { type: 'boolean' }\n case 'Float':\n return { type: 'number' }\n case 'Integer':\n return { type: 'integer' }\n case 'String':\n default:\n return { type: 'string' }\n }\n}\n\n/**\n * react-jsonschema-form SchemaField override for \"additionalProperties\" only. In Synapse these are \"custom annotations\".\n * Modifies the data to provide full compatibility with Synapse annotations features.\n *\n * This component provides these enhancements to the SchemaField:\n * - Supports selecting a type, and changing the input widget appropriately\n * - Identifying the type on mount\n * - Treat all field values as arrays\n * - When the last array value is removed, remove the entire key from the form.\n * @param props\n * @returns\n */\nexport function AdditionalPropertiesSchemaField<\n T extends Array<unknown> = Array<unknown>,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n props: FieldProps<T, S, F> & {\n onDropPropertyClick: (key: string) => (event: any) => void\n },\n) {\n const {\n formData,\n onChange,\n registry,\n schema,\n name,\n onDropPropertyClick,\n idSchema,\n } = props\n const id = idSchema.$id\n const { ArrayField } = registry.fields\n const { SelectWidget } = registry.widgets\n\n // The type determines which widget we show.\n const [propertyType, setPropertyType] = useState(\n guessPropertyType(convertToArray(formData)),\n )\n\n // If the property type is updated, store it in a new variable where we'll show a warning if data may be lost on coersion\n const [nextPropertyType, setNextPropertyType] = useState(propertyType)\n\n /**\n * This effect is invoked whenever the user attempts to change the datatype of a custom annotation.\n */\n useEffect(() => {\n function onNextPropertyTypeUpdate() {\n if (Array.isArray(formData)) {\n const dataIsEmpty =\n formData.length === 0 ||\n formData.every(item => item == null || item == '')\n const coercedList = transformDataFromPropertyType(\n formData,\n nextPropertyType,\n )\n // if the data is empty or identical after conversion, then just update the property type\n if (dataIsEmpty || nextPropertyType !== propertyType) {\n if (isEqual(formData, coercedList)) {\n setPropertyType(nextPropertyType)\n }\n }\n }\n }\n\n onNextPropertyTypeUpdate()\n // oxlint-disable-next-line react-hooks/exhaustive-deps\n }, [nextPropertyType])\n\n /**\n * This effect is invoked whenever the propertyType changes.\n */\n useEffect(() => {\n function coerceDataAndUpdateWidget() {\n if (Array.isArray(formData)) {\n if (formData.every(item => item == null)) {\n onDropPropertyClick(name)(new CustomEvent('dropEmptyProperty'))\n } else {\n const coercedList = transformDataFromPropertyType(\n formData,\n nextPropertyType,\n ) as unknown as T\n\n // Data conversion is non-destructive or has been confirmed by the user\n setPropertyType(nextPropertyType)\n // Coerce the data to match the new type\n onChange(coercedList)\n }\n }\n }\n\n coerceDataAndUpdateWidget()\n // Don't add other properties to dependency array because we don't want to automatically coerce input\n // i.e. Only coerce data when the type changes, which should only be on mount or when the user explicitly chooses a new type.\n // oxlint-disable-next-line react-hooks/exhaustive-deps\n }, [propertyType])\n\n const itemsSchema = getSchemaForPropertyType(propertyType)\n\n useEffect(() => {\n // If the additional property has not yet been coerced to an array, trigger an update to coerce and render nothing.\n // We must do this because RJSF does not currently batch these kinds of updates\n // See https://github.com/rjsf-team/react-jsonschema-form/issues/3367\n if (!Array.isArray(formData)) {\n onChange(convertToArray(formData) as unknown as T)\n }\n }, [formData, onChange])\n\n if (!Array.isArray(formData)) {\n return <></>\n }\n\n return (\n <AdditionalPropertyContextProvider\n value={{\n dropProperty: e => {\n onDropPropertyClick(name)(e)\n },\n }}\n >\n <Grid item xs={2}>\n <InputLabel htmlFor={`${id}-type`}>Type</InputLabel>\n <SelectWidget\n name={'Type'}\n id={`${id}-type`}\n schema={{} as S}\n options={{\n enumOptions: propertyTypeArray.map(type => ({\n label: type,\n value: type,\n })),\n }}\n value={propertyType}\n onChange={value => {\n setNextPropertyType(value as PropertyType)\n }}\n disabled={props.disabled}\n readOnly={props.readonly}\n required={true}\n isClearable={false}\n onBlur={() => {}}\n onFocus={() => {}}\n registry={registry}\n label={'Type'}\n />\n </Grid>\n <Grid item xs={7}>\n <ArrayField\n {...props}\n uiSchema={{\n ...props.uiSchema,\n 'ui:title': 'Value(s)',\n items: {\n ...props.uiSchema?.items,\n 'ui:placeholder': 'New Value',\n },\n }}\n schema={{\n ...schema,\n items: {\n ...itemsSchema,\n },\n }}\n />\n </Grid>\n {propertyType !== nextPropertyType && (\n <FullWidthAlert\n variant=\"warning\"\n title=\"Data may be lost when converting types\"\n description={`Are you sure you want to convert ${name} from ${propertyType} to ${nextPropertyType}? Current values may be lost on conversion.`}\n primaryButtonConfig={{\n text: 'Convert',\n onClick: () => {\n setPropertyType(nextPropertyType)\n },\n }}\n secondaryButtonConfig={{\n text: 'Cancel',\n onClick: () => {\n setNextPropertyType(propertyType)\n },\n }}\n isGlobal={false}\n />\n )}\n </AdditionalPropertyContextProvider>\n )\n}\n"],"mappings":";;;;;;;;AAcA,IAAM,IAAsB,+CAGtB,IAAoB;CACxB;CACA;CACA;CACA;CACA;AACF;AAIA,SAAgB,EAAkB,GAAoC;CAuBpE,OAtBI,EAAK,WAAW,IAEX,WAEP,EAAK,OACH,MAAQ,OAAO,KAAS,YAAY,MAAS,KAC/C,IAEI,EAAK,OAAM,MAAQ,OAAO,UAAU,CAAI,CAAC,IACpC,YAEA,UAEA,EAAK,OAAM,MAAQ,OAAO,KAAS,SAAS,IAC9C,YAEP,EAAK,OAAM,MAAQ,OAAO,KAAS,QAAQ,KAC3C,EAAK,OAAO,MAAiB,CAAC,CAAC,EAAoB,KAAK,CAAI,CAAC,IAEtD,aAGF;AACT;AAEA,SAAgB,EACd,GACA,GACA;CACA,QAAQ,GAAR;EACE,KAAK,WACH,OAAO,EAAK,KAAI,MACd,OAAO,MAAM,OAAO,CAAI,CAAC,IAAI,IAAI,KAAK,MAAM,OAAO,CAAI,CAAC,CAC1D;EAEF,KAAK,SACH,OAAO,EAAK,KAAI,MAAQ;GACtB,IAAM,IAAU,WAAW,CAAc;GAMvC,OALE,OAAO,MAAM,CAAO,IACf,QACE,OAAO,UAAU,CAAO,IAC1B,EAAQ,QAAQ,CAAC,IAEjB;EAEX,CAAC;EACH,KAAK,YACH,OAAO,EAAK,KAAI,MACV,OAAO,KAAS,YAAY,EAAoB,KAAK,CAAI,IACpD,qBAEA,IAAI,KAAK,GAAE,YAAY,CAEjC;EACH,KAAK,WACH,OAAO,EAAK,KAAI,MAAQ,CAAC,CAAC,CAAI;EAEhC,SACE,OAAO,EAAK,KAAI,MAAQ,OAAO,CAAI,CAAC;CACxC;AACF;AAMA,SA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"sources":["../../../../src/components/SchemaDrivenAnnotationEditor/field/AdditionalPropertiesSchemaField.tsx"],"sourcesContent":["import {\n FieldProps,\n FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n} from '@rjsf/utils'\nimport { isEqual } from 'lodash-es'\nimport { useEffect, useState } from 'react'\nimport FullWidthAlert from '../../FullWidthAlert/FullWidthAlert'\nimport { convertToArray } from '../AnnotationEditorUtils'\nimport { GridLegacy as Grid, InputLabel } from '@mui/material'\nimport { AdditionalPropertyContextProvider } from '../template/AdditionalPropertyContext'\n\n// Matches ####-##-##T##:##:##.###Z, e.g. 1970-01-01T12:00:000Z\nconst ISO_TIMESTAMP_REGEX = /\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z/\n\n// Types that correspond to the different input fields that the annotation editor supports\nconst propertyTypeArray = [\n 'String',\n 'Integer',\n 'Float',\n 'Boolean',\n 'Datetime',\n] as const\n\nexport type PropertyType = (typeof propertyTypeArray)[number]\n\nexport function guessPropertyType(list: Array<unknown>): PropertyType {\n if (list.length === 0) {\n // The field was just added, so default to string\n return 'String'\n } else if (\n list.every(\n item => typeof item === 'number' || item === 'NaN', // \"NaN\" is technically a float value\n )\n ) {\n if (list.every(item => Number.isInteger(item))) {\n return 'Integer'\n } else {\n return 'Float'\n }\n } else if (list.every(item => typeof item === 'boolean')) {\n return 'Boolean'\n } else if (\n list.every(item => typeof item === 'string') &&\n list.every((item: string) => !!ISO_TIMESTAMP_REGEX.exec(item))\n ) {\n return 'Datetime'\n }\n // otherwise, default type is 'string'\n return 'String'\n}\n\nexport function transformDataFromPropertyType(\n list: Array<any>,\n propertyType: PropertyType,\n) {\n switch (propertyType) {\n case 'Integer':\n return list.map(item =>\n Number.isNaN(Number(item)) ? 0 : Math.floor(Number(item)),\n )\n\n case 'Float':\n return list.map(item => {\n const asFloat = parseFloat(item as string)\n if (Number.isNaN(asFloat)) {\n return 'NaN'\n } else if (Number.isInteger(asFloat)) {\n return asFloat.toFixed(1)\n } else {\n return asFloat\n }\n })\n case 'Datetime':\n return list.map(item => {\n if (typeof item === 'string' && ISO_TIMESTAMP_REGEX.exec(item)) {\n return item\n } else {\n return new Date().toISOString()\n }\n })\n case 'Boolean':\n return list.map(item => !!item)\n case 'String':\n default:\n return list.map(String)\n }\n}\n\n/**\n * Maps a Synapse Annotation PropertyType to a JSON Schema that captures the type and format.\n * @param propertyType\n */\nexport function getSchemaForPropertyType(propertyType: PropertyType) {\n switch (propertyType) {\n case 'Datetime':\n return { type: 'string', format: 'datetime' }\n case 'Boolean':\n return { type: 'boolean' }\n case 'Float':\n return { type: 'number' }\n case 'Integer':\n return { type: 'integer' }\n case 'String':\n default:\n return { type: 'string' }\n }\n}\n\n/**\n * react-jsonschema-form SchemaField override for \"additionalProperties\" only. In Synapse these are \"custom annotations\".\n * Modifies the data to provide full compatibility with Synapse annotations features.\n *\n * This component provides these enhancements to the SchemaField:\n * - Supports selecting a type, and changing the input widget appropriately\n * - Identifying the type on mount\n * - Treat all field values as arrays\n * - When the last array value is removed, remove the entire key from the form.\n * @param props\n * @returns\n */\nexport function AdditionalPropertiesSchemaField<\n T extends Array<unknown> = Array<unknown>,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n props: FieldProps<T, S, F> & {\n onDropPropertyClick: (key: string) => (event: any) => void\n },\n) {\n const {\n formData,\n onChange,\n registry,\n schema,\n name,\n onDropPropertyClick,\n idSchema,\n } = props\n const id = idSchema.$id\n const { ArrayField } = registry.fields\n const { SelectWidget } = registry.widgets\n\n // The type determines which widget we show.\n const [propertyType, setPropertyType] = useState(\n guessPropertyType(convertToArray(formData)),\n )\n\n // If the property type is updated, store it in a new variable where we'll show a warning if data may be lost on coersion\n const [nextPropertyType, setNextPropertyType] = useState(propertyType)\n\n /**\n * This effect is invoked whenever the user attempts to change the datatype of a custom annotation.\n */\n useEffect(() => {\n function onNextPropertyTypeUpdate() {\n if (Array.isArray(formData)) {\n const dataIsEmpty = formData.every(item => item == null || item == '')\n const coercedList = transformDataFromPropertyType(\n formData,\n nextPropertyType,\n )\n // if the data is empty or identical after conversion, then just update the property type\n if (dataIsEmpty || nextPropertyType !== propertyType) {\n if (isEqual(formData, coercedList)) {\n setPropertyType(nextPropertyType)\n }\n }\n }\n }\n\n onNextPropertyTypeUpdate()\n // oxlint-disable-next-line react-hooks/exhaustive-deps\n }, [nextPropertyType])\n\n /**\n * This effect is invoked whenever the propertyType changes.\n */\n useEffect(() => {\n function coerceDataAndUpdateWidget() {\n if (Array.isArray(formData)) {\n if (formData.every(item => item == null)) {\n onDropPropertyClick(name)(new CustomEvent('dropEmptyProperty'))\n } else {\n const coercedList = transformDataFromPropertyType(\n formData,\n nextPropertyType,\n ) as unknown as T\n\n // Data conversion is non-destructive or has been confirmed by the user\n setPropertyType(nextPropertyType)\n // Coerce the data to match the new type\n onChange(coercedList)\n }\n }\n }\n\n coerceDataAndUpdateWidget()\n // Don't add other properties to dependency array because we don't want to automatically coerce input\n // i.e. Only coerce data when the type changes, which should only be on mount or when the user explicitly chooses a new type.\n // oxlint-disable-next-line react-hooks/exhaustive-deps\n }, [propertyType])\n\n const itemsSchema = getSchemaForPropertyType(propertyType)\n\n useEffect(() => {\n // If the additional property has not yet been coerced to an array, trigger an update to coerce and render nothing.\n // We must do this because RJSF does not currently batch these kinds of updates\n // See https://github.com/rjsf-team/react-jsonschema-form/issues/3367\n if (!Array.isArray(formData)) {\n onChange(convertToArray(formData) as unknown as T)\n }\n }, [formData, onChange])\n\n if (!Array.isArray(formData)) {\n return <></>\n }\n\n return (\n <AdditionalPropertyContextProvider\n value={{\n dropProperty: e => {\n onDropPropertyClick(name)(e)\n },\n }}\n >\n <Grid item xs={2}>\n <InputLabel htmlFor={`${id}-type`}>Type</InputLabel>\n <SelectWidget\n name={'Type'}\n id={`${id}-type`}\n schema={{} as S}\n options={{\n enumOptions: propertyTypeArray.map(type => ({\n label: type,\n value: type,\n })),\n }}\n value={propertyType}\n onChange={value => {\n setNextPropertyType(value as PropertyType)\n }}\n disabled={props.disabled}\n readOnly={props.readonly}\n required={true}\n isClearable={false}\n onBlur={() => {}}\n onFocus={() => {}}\n registry={registry}\n label={'Type'}\n />\n </Grid>\n <Grid item xs={7}>\n <ArrayField\n {...props}\n uiSchema={{\n ...props.uiSchema,\n 'ui:title': 'Value(s)',\n items: {\n ...props.uiSchema?.items,\n 'ui:placeholder': 'New Value',\n },\n }}\n schema={{\n ...schema,\n items: {\n ...itemsSchema,\n },\n }}\n />\n </Grid>\n {propertyType !== nextPropertyType && (\n <FullWidthAlert\n variant=\"warning\"\n title=\"Data may be lost when converting types\"\n description={`Are you sure you want to convert ${name} from ${propertyType} to ${nextPropertyType}? Current values may be lost on conversion.`}\n primaryButtonConfig={{\n text: 'Convert',\n onClick: () => {\n setPropertyType(nextPropertyType)\n },\n }}\n secondaryButtonConfig={{\n text: 'Cancel',\n onClick: () => {\n setNextPropertyType(propertyType)\n },\n }}\n isGlobal={false}\n />\n )}\n </AdditionalPropertyContextProvider>\n )\n}\n"],"mappings":";;;;;;;;AAcA,IAAM,IAAsB,+CAGtB,IAAoB;CACxB;CACA;CACA;CACA;CACA;AACF;AAIA,SAAgB,EAAkB,GAAoC;CAuBpE,OAtBI,EAAK,WAAW,IAEX,WAEP,EAAK,OACH,MAAQ,OAAO,KAAS,YAAY,MAAS,KAC/C,IAEI,EAAK,OAAM,MAAQ,OAAO,UAAU,CAAI,CAAC,IACpC,YAEA,UAEA,EAAK,OAAM,MAAQ,OAAO,KAAS,SAAS,IAC9C,YAEP,EAAK,OAAM,MAAQ,OAAO,KAAS,QAAQ,KAC3C,EAAK,OAAO,MAAiB,CAAC,CAAC,EAAoB,KAAK,CAAI,CAAC,IAEtD,aAGF;AACT;AAEA,SAAgB,EACd,GACA,GACA;CACA,QAAQ,GAAR;EACE,KAAK,WACH,OAAO,EAAK,KAAI,MACd,OAAO,MAAM,OAAO,CAAI,CAAC,IAAI,IAAI,KAAK,MAAM,OAAO,CAA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G;MACH,OAAO,EACL,GAAG,EACL;KACF;IACD,CAAA;GACG,CAAA;GACL,MAAiB,KAChB,kBAAC,GAAD;IACE,SAAQ;IACR,OAAM;IACN,aAAa,oCAAoC,EAAK,QAAQ,EAAa,MAAM,EAAiB;IAClG,qBAAqB;KACnB,MAAM;KACN,eAAe;MACb,EAAgB,CAAgB;KAClC;IACF;IACA,uBAAuB;KACrB,MAAM;KACN,eAAe;MACb,EAAoB,CAAY;KAClC;IACF;IACA,UAAU;GACX,CAAA;EAE8B;MA5E5B,kBAAA,GAAA,CAAI,CAAA;AA8Ef"}
@@ -13,7 +13,7 @@ function f(f) {
13
13
  if ("properties" in S && S.properties) {
14
14
  let t = Object.keys(S.properties), n = new Set(t.filter((e) => !S.properties[e][c]));
15
15
  if (O.current != null) {
16
- let t = Array.from(O.current).filter((e) => !n.has(e) && !!h && h[e] != null && Array.isArray(h[e]) && h[e].filter((e) => e != null).length > 0);
16
+ let t = Array.from(O.current).filter((e) => !n.has(e) && !!h && h[e] != null && Array.isArray(h[e]) && h[e].some((e) => e != null));
17
17
  t.length > 0 && e(`The following annotations are no longer specified by the schema and have been converted to custom fields: ${t.join(", ")}.`, "warning", { title: "Fields No Longer Specified By Schema" });
18
18
  }
19
19
  O.current = n;
@@ -1 +1 @@
1
- {"version":3,"file":"ObjectFieldTemplate.js","names":[],"sources":["../../../../src/components/SchemaDrivenAnnotationEditor/template/ObjectFieldTemplate.tsx"],"sourcesContent":["import AddToList from '@/assets/icons/AddToList'\nimport { Button, Tooltip } from '@mui/material'\nimport {\n ADDITIONAL_PROPERTY_FLAG,\n canExpand,\n FormContextType,\n getTemplate,\n getUiOptions,\n ObjectFieldTemplatePropertyType,\n ObjectFieldTemplateProps,\n RJSFSchema,\n StrictRJSFSchema,\n} from '@rjsf/utils'\nimport { JSONSchema7Definition } from 'json-schema'\nimport { useRef } from 'react'\nimport { useDeepCompareEffectNoCheck } from 'use-deep-compare-effect'\nimport { displayToast } from '../../ToastMessage'\n\n/**\n * Derived from the base ObjectFieldTemplate with annotations-editor-specific changes\n * - Custom button for adding additional properties\n * - Tracks properties to show a toast message if a property is converted to an additionalProperty because it was\n * dropped from the schema (e.g. in a conditional schema)\n *\n * See https://github.com/rjsf-team/react-jsonschema-form/blob/main/packages/mui/src/ObjectFieldTemplate/ObjectFieldTemplate.tsx\n * @param props\n * @returns\n */\nexport function ObjectFieldTemplate<\n T extends Record<string, any> | null | undefined = Record<string, any>,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: ObjectFieldTemplateProps<T, S, F>) {\n const {\n description,\n disabled,\n formData,\n idSchema,\n onAddClick,\n properties,\n readonly,\n registry,\n required,\n schema,\n title,\n uiSchema,\n } = props\n\n const options = getUiOptions<T, S, F>(uiSchema)\n const TitleFieldTemplate = getTemplate<'TitleFieldTemplate', T, S, F>(\n 'TitleFieldTemplate',\n registry,\n options,\n )\n const DescriptionFieldTemplate = getTemplate<\n 'DescriptionFieldTemplate',\n T,\n S,\n F\n >('DescriptionFieldTemplate', registry, options)\n\n /*\n Tracks the property keys that were last known to exist in the object.\n */\n const previousSchemaDefinedProperties = useRef<Set<string>>(new Set())\n\n /**\n * We track how the schema changes as the user enters data, causing conditional subschemas to be evaluated.\n *\n * If a property exists in the previous version of the schema and has user data, and then is dropped from the schema due to a data update, then\n * we need to prompt the user whether they want to undo the change, or continue and keep/remove those fields\n *\n * In this component, we can identify when one or more fields with user data are dropped (the field gains the additional property flag in the schema prop).\n * We then use a function provided by the context to report which fields were lost.\n */\n useDeepCompareEffectNoCheck(() => {\n if ('properties' in schema && schema.properties) {\n const propertyKeys = Object.keys(schema.properties)\n // Schema-defined properties are those properties in the schema without the additional property flag.\n const schemaDefinedProperties = new Set<string>(\n propertyKeys.filter(key => {\n const propertyObject = schema.properties![\n key\n ] as JSONSchema7Definition &\n Record<typeof ADDITIONAL_PROPERTY_FLAG, any>\n return !propertyObject[ADDITIONAL_PROPERTY_FLAG]\n }),\n )\n\n if (previousSchemaDefinedProperties.current != null) {\n // Compare the schema defined properties with the previous version to see if any were lost.\n const lostProperties = Array.from(\n previousSchemaDefinedProperties.current,\n ).filter(schemaDefinedProperty => {\n return (\n // Property is no longer in schema\n !schemaDefinedProperties.has(schemaDefinedProperty) &&\n // Form data exists\n !!formData &&\n // Property still exists in form data and is not null\n // if the data is null, then we don't need to worry about it; user data wasn't lost\n formData[schemaDefinedProperty] != null &&\n // Property matches `additionalProperties` requirements: is an array and contains non-null values\n Array.isArray(formData[schemaDefinedProperty]) &&\n (formData[schemaDefinedProperty] as Array<never>).filter(\n item => item != null,\n ).length > 0\n )\n })\n if (lostProperties.length > 0) {\n // Report the converted fields in a toast message\n displayToast(\n `The following annotations are no longer specified by the schema and have been converted to custom fields: ${lostProperties.join(\n ', ',\n )}.`,\n 'warning',\n {\n title: 'Fields No Longer Specified By Schema',\n },\n )\n }\n }\n // Update the last known properties to match the current properties\n previousSchemaDefinedProperties.current = schemaDefinedProperties\n }\n }, [schema.properties])\n\n return (\n <fieldset id={idSchema.$id}>\n {(options.title || title) && (\n <TitleFieldTemplate\n id={`${idSchema.$id}__title`}\n schema={schema}\n title={options.title || title}\n required={required}\n uiSchema={uiSchema}\n registry={registry}\n />\n )}\n {(options.description || description) && (\n <DescriptionFieldTemplate\n id={`${idSchema.$id}__description`}\n description={options.description || description!}\n registry={registry}\n schema={schema}\n />\n )}\n {properties.map((prop: ObjectFieldTemplatePropertyType) => prop.content)}\n\n {canExpand(schema, uiSchema, formData) && (\n <Tooltip title=\"Add a new custom field\" placement=\"top\">\n <Button\n sx={{ my: 2 }}\n variant=\"contained\"\n className=\"rjsf-object-property-expand\"\n onClick={onAddClick(schema)}\n disabled={disabled || readonly}\n aria-label={'Add Custom Field'}\n >\n <AddToList />\n </Button>\n </Tooltip>\n )}\n </fieldset>\n )\n}\n"],"mappings":";;;;;;;;;AA4BA,SAAgB,EAId,GAA0C;CAC1C,IAAM,EACJ,gBACA,aACA,aACA,aACA,eACA,eACA,aACA,aAC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Q;KACR,WAAU;KACV,SAAS,EAAW,CAAM;KAC1B,UAAU,KAAY;KACtB,cAAY;eAEZ,kBAAC,GAAD,CAAY,CAAA;IACN,CAAA;GACD,CAAA;EAEH;;AAEd"}
1
+ {"version":3,"file":"ObjectFieldTemplate.js","names":[],"sources":["../../../../src/components/SchemaDrivenAnnotationEditor/template/ObjectFieldTemplate.tsx"],"sourcesContent":["import AddToList from '@/assets/icons/AddToList'\nimport { Button, Tooltip } from '@mui/material'\nimport {\n ADDITIONAL_PROPERTY_FLAG,\n canExpand,\n FormContextType,\n getTemplate,\n getUiOptions,\n ObjectFieldTemplatePropertyType,\n ObjectFieldTemplateProps,\n RJSFSchema,\n StrictRJSFSchema,\n} from '@rjsf/utils'\nimport { JSONSchema7Definition } from 'json-schema'\nimport { useRef } from 'react'\nimport { useDeepCompareEffectNoCheck } from 'use-deep-compare-effect'\nimport { displayToast } from '../../ToastMessage'\n\n/**\n * Derived from the base ObjectFieldTemplate with annotations-editor-specific changes\n * - Custom button for adding additional properties\n * - Tracks properties to show a toast message if a property is converted to an additionalProperty because it was\n * dropped from the schema (e.g. in a conditional schema)\n *\n * See https://github.com/rjsf-team/react-jsonschema-form/blob/main/packages/mui/src/ObjectFieldTemplate/ObjectFieldTemplate.tsx\n * @param props\n * @returns\n */\nexport function ObjectFieldTemplate<\n T extends Record<string, any> | null | undefined = Record<string, any>,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: ObjectFieldTemplateProps<T, S, F>) {\n const {\n description,\n disabled,\n formData,\n idSchema,\n onAddClick,\n properties,\n readonly,\n registry,\n required,\n schema,\n title,\n uiSchema,\n } = props\n\n const options = getUiOptions<T, S, F>(uiSchema)\n const TitleFieldTemplate = getTemplate<'TitleFieldTemplate', T, S, F>(\n 'TitleFieldTemplate',\n registry,\n options,\n )\n const DescriptionFieldTemplate = getTemplate<\n 'DescriptionFieldTemplate',\n T,\n S,\n F\n >('DescriptionFieldTemplate', registry, options)\n\n /*\n Tracks the property keys that were last known to exist in the object.\n */\n const previousSchemaDefinedProperties = useRef<Set<string>>(new Set())\n\n /**\n * We track how the schema changes as the user enters data, causing conditional subschemas to be evaluated.\n *\n * If a property exists in the previous version of the schema and has user data, and then is dropped from the schema due to a data update, then\n * we need to prompt the user whether they want to undo the change, or continue and keep/remove those fields\n *\n * In this component, we can identify when one or more fields with user data are dropped (the field gains the additional property flag in the schema prop).\n * We then use a function provided by the context to report which fields were lost.\n */\n useDeepCompareEffectNoCheck(() => {\n if ('properties' in schema && schema.properties) {\n const propertyKeys = Object.keys(schema.properties)\n // Schema-defined properties are those properties in the schema without the additional property flag.\n const schemaDefinedProperties = new Set<string>(\n propertyKeys.filter(key => {\n const propertyObject = schema.properties![\n key\n ] as JSONSchema7Definition &\n Record<typeof ADDITIONAL_PROPERTY_FLAG, any>\n return !propertyObject[ADDITIONAL_PROPERTY_FLAG]\n }),\n )\n\n if (previousSchemaDefinedProperties.current != null) {\n // Compare the schema defined properties with the previous version to see if any were lost.\n const lostProperties = Array.from(\n previousSchemaDefinedProperties.current,\n ).filter(schemaDefinedProperty => {\n return (\n // Property is no longer in schema\n !schemaDefinedProperties.has(schemaDefinedProperty) &&\n // Form data exists\n !!formData &&\n // Property still exists in form data and is not null\n // if the data is null, then we don't need to worry about it; user data wasn't lost\n formData[schemaDefinedProperty] != null &&\n // Property matches `additionalProperties` requirements: is an array and contains non-null values\n Array.isArray(formData[schemaDefinedProperty]) &&\n (formData[schemaDefinedProperty] as Array<never>).some(\n item => item != null,\n )\n )\n })\n if (lostProperties.length > 0) {\n // Report the converted fields in a toast message\n displayToast(\n `The following annotations are no longer specified by the schema and have been converted to custom fields: ${lostProperties.join(\n ', ',\n )}.`,\n 'warning',\n {\n title: 'Fields No Longer Specified By Schema',\n },\n )\n }\n }\n // Update the last known properties to match the current properties\n previousSchemaDefinedProperties.current = schemaDefinedProperties\n }\n }, [schema.properties])\n\n return (\n <fieldset id={idSchema.$id}>\n {(options.title || title) && (\n <TitleFieldTemplate\n id={`${idSchema.$id}__title`}\n schema={schema}\n title={options.title || title}\n required={required}\n uiSchema={uiSchema}\n registry={registry}\n />\n )}\n {(options.description || description) && (\n <DescriptionFieldTemplate\n id={`${idSchema.$id}__description`}\n description={options.description || description!}\n registry={registry}\n schema={schema}\n />\n )}\n {properties.map((prop: ObjectFieldTemplatePropertyType) => prop.content)}\n\n {canExpand(schema, uiSchema, formData) && (\n <Tooltip title=\"Add a new custom field\" placement=\"top\">\n <Button\n sx={{ my: 2 }}\n variant=\"contained\"\n className=\"rjsf-object-property-expand\"\n onClick={onAddClick(schema)}\n disabled={disabled || readonly}\n aria-label={'Add Custom Field'}\n >\n <AddToList />\n </Button>\n </Tooltip>\n )}\n </fieldset>\n )\n}\n"],"mappings":";;;;;;;;;AA4BA,SAAgB,EAId,GAA0C;CAC1C,IAAM,EACJ,gBACA,aACA,aACA,aACA,eACA,eACA,aACA,aACA,aACA,WACA,UACA,gBACE,GAEE,IAAU,EAAsB,CAAQ,GACxC,IAAqB,EACzB,sBACA,GACA,CACF,GACM,IAA2B,EAK/B,4BAA4B,GAAU,CAAO,GAKzC,IAAkC,kBAAoB,IAAI,IAAI,CAAC;CA+DrE,OApDA,QAAkC;EAChC,IAAI,gBAAgB,KAAU,EAAO,YAAY;GAC/C,IAAM,IAAe,OAAO,KAAK,EAAO,UAAU,GAE5C,IAA0B,IAAI,IAClC,EAAa,QAAO,MAKX,CAJgB,EAAO,WAC5B,GAGqB,EACxB,CACH;GAEA,IAAI,EAAgC,WAAW,MAAM;IAEnD,IAAM,IAAiB,MAAM,KAC3B,EAAgC,OAClC,EAAE,QAAO,MAGL,CAAC,EAAwB,IAAI,CAAqB,KAElD,CAAC,CAAC,KAGF,EAAS,MAA0B,QAEnC,MAAM,QAAQ,EAAS,EAAsB,KAC5C,EAAS,GAAwC,MAChD,MAAQ,KAAQ,IAClB,CAEH;IACD,AAAI,EAAe,SAAS,KAE1B,EACE,6GAA6G,EAAe,KAC1H,IACF,EAAE,IACF,WACA,EACE,OAAO,uCACT,CACF;GAEJ;GAEA,EAAgC,UAAU;EAC5C;CACF,GAAG,CAAC,EAAO,UAAU,CAAC,GAGpB,kBAAC,YAAD;EAAU,IAAI,EAAS;YAAvB;IACI,EAAQ,SAAS,MACjB,kBAAC,GAAD;IACE,IAAI,GAAG,EAAS,IAAI;IACZ;IACR,OAAO,EAAQ,SAAS;IACd;IACA;IACA;GACX,CAAA;IAED,EAAQ,eAAe,MACvB,kBAAC,GAAD;IACE,IAAI,GAAG,EAAS,IAAI;IACpB,aAAa,EAAQ,eAAe;IAC1B;IACF;GACT,CAAA;GAEF,EAAW,KAAK,MAA0C,EAAK,OAAO;GAEtE,EAAU,GAAQ,GAAU,CAAQ,KACnC,kBAAC,GAAD;IAAS,OAAM;IAAyB,WAAU;cAChD,kBAAC,GAAD;KACE,IAAI,EAAE,IAAI,EAAE;KACZ,SAAQ;KACR,WAAU;KACV,SAAS,EAAW,CAAM;KAC1B,UAAU,KAAY;KACtB,cAAY;eAEZ,kBAAC,GAAD,CAAY,CAAA;IACN,CAAA;GACD,CAAA;EAEH;;AAEd"}
@@ -5,25 +5,33 @@ import { KeyFactory } from '@/synapse-queries/KeyFactory';
5
5
  export type SearchQueryStrategy = 'MULTI_MATCH' | 'MULTI_MATCH_BEST_FIELDS' | 'MULTI_MATCH_CROSS_FIELDS' | 'SIMPLE_QUERY_STRING' | 'PHRASE_PREFIX' | 'BOOSTED_FUZZY';
6
6
  export type SearchQueryConfig = {
7
7
  /**
8
- * Which OpenSearch query clause to emit when the user has typed a search term.
9
- * Defaults to 'MULTI_MATCH' (all fields, fuzziness AUTO — today's behavior).
8
+ * Shapes the `multi_match` clause of the hybrid text-search query. When omitted,
9
+ * `multi_match` uses `best_fields` with `operator: and`. 'SIMPLE_QUERY_STRING'
10
+ * omits `multi_match`, because the hybrid query always includes a
11
+ * `simple_query_string` clause.
10
12
  */
11
13
  queryStrategy?: SearchQueryStrategy;
12
14
  /**
13
- * Per-field relevance multipliers. Serialized to the OpenSearch `fields` array
14
- * as e.g. `["resourceName^5", "synonyms^4"]`. When omitted, all fields are
15
- * queried at equal weight.
15
+ * Per-field relevance multipliers for the lexical (`simple_query_string` and
16
+ * `multi_match`) clauses. Serialized to the OpenSearch `fields` array as e.g.
17
+ * `["resourceName^5", "synonyms^4"]`. When omitted, all fields are queried at
18
+ * equal weight.
16
19
  */
17
20
  fieldBoosts?: Record<string, number>;
18
21
  /** Whether to append `*` to fieldBoosts at neutral weight. Defaults to true. */
19
22
  includeUnlistedFields?: boolean;
20
23
  /**
21
- * Fuzziness override. Overrides the per-strategy default. Leave undefined to
22
- * use each strategy's natural default (AUTO for MULTI_MATCH/BOOSTED_FUZZY,
23
- * none for the rest).
24
+ * Fuzziness override for the `multi_match` clause. Overrides the per-strategy
25
+ * default. Leave undefined to use each strategy's natural default (AUTO for
26
+ * MULTI_MATCH/BOOSTED_FUZZY, none for the rest).
24
27
  */
25
28
  fuzziness?: string;
26
29
  };
30
+ /**
31
+ * Vector field the backend adds to each indexed document when a column is flagged
32
+ * semantic; the only key a `neural` clause accepts.
33
+ */
34
+ export declare const SEMANTIC_SEARCH_FIELD = "semantic_search";
27
35
  /**
28
36
  * TanStack Query options for the SearchQueryServicesApi, mirroring TableQueryUseQueryOptions
29
37
  * but parameterised over SearchIndexQuery rather than QueryBundleRequest. This eliminates
@@ -44,7 +52,7 @@ export declare function getNextPageParamForSearchQueryResults(lastPage: Asynchro
44
52
  * - columnModels (facetType 'enumeration') → aggregations (OpenSearch terms or filter-wrapped aggregations)
45
53
  * - query.selectedFacets (enumeration) → post_filter (terms clauses) + per-facet filter aggregations
46
54
  * - query.selectedFacets (range) → post_filter (range clauses) + included in all per-facet aggregation filters
47
- * - query.additionalFilters (TextMatchesQueryFilter) → multi_match query clause
55
+ * - query.additionalFilters (TextMatchesQueryFilter) → hybrid query (simple_query_string alone for Synapse IDs)
48
56
  * - query.sort → sort (SortItem { column, direction } → [{ column: 'asc'|'desc' }])
49
57
  * - query.limit → size
50
58
  * - query.offset → from
@@ -1 +1 @@
1
- {"version":3,"file":"SearchQueryUseQueryOptions.d.ts","sourceRoot":"","sources":["../../../src/components/SearchQueryWrapper/SearchQueryUseQueryOptions.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,qBAAqB,EACrB,WAAW,EAEX,uBAAuB,EAIvB,wBAAwB,EACxB,kBAAkB,EAClB,iBAAiB,EACjB,MAAM,EAIP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAGV,gBAAgB,EAChB,kBAAkB,EAElB,kBAAkB,EAEnB,MAAM,kCAAkC,CAAA;AACzC,OAAO,EACL,YAAY,EACZ,QAAQ,EACR,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,uBAAuB,CAAA;AAI9B,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;AAUzD,MAAM,MAAM,mBAAmB,GAC3B,aAAa,GACb,yBAAyB,GACzB,0BAA0B,GAC1B,qBAAqB,GACrB,eAAe,GACf,eAAe,CAAA;AAEnB,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;OAGG;IACH,aAAa,CAAC,EAAE,mBAAmB,CAAA;IACnC;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACpC,gFAAgF;IAChF,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AA4JD;;;;;GAKG;AACH,MAAM,MAAM,+BAA+B,GAAG;IAC5C,mBAAmB,EAAE,uBAAuB,CAC1C,qBAAqB,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,EAC1D,kBAAkB,EAClB,MAAM,GAAG,SAAS,CACnB,CAAA;IACD,2BAA2B,EAAE,uBAAuB,CAClD,qBAAqB,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,EAC1D,kBAAkB,EAClB,YAAY,CAAC,qBAAqB,CAAC,gBAAg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UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAoC3C;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CAC3C,kBAAkB,EAAE,kBAAkB,EACtC,aAAa,EAAE,MAAM,EACrB,SAAS,CAAC,EAAE,MAAM,EAClB,iBAAiB,CAAC,EAAE,iBAAiB,GACpC,+BAA+B,CA2BjC"}
1
+ {"version":3,"file":"SearchQueryUseQueryOptions.d.ts","sourceRoot":"","sources":["../../../src/components/SearchQueryWrapper/SearchQueryUseQueryOptions.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,qBAAqB,EACrB,WAAW,EAEX,uBAAuB,EAIvB,wBAAwB,EACxB,kBAAkB,EAClB,iBAAiB,EACjB,MAAM,EAIP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAIV,gBAAgB,EAChB,kBAAkB,EAElB,kBAAkB,EAEnB,MAAM,kCAAkC,CAAA;AACzC,OAAO,EACL,YAAY,EACZ,QAAQ,EACR,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,uBAAuB,CAAA;AAI9B,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;AAUzD,MAAM,MAAM,mBAAmB,GAC3B,aAAa,GACb,yBAAyB,GACzB,0BAA0B,GAC1B,qBAAqB,GACrB,eAAe,GACf,eAAe,CAAA;AAEnB,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;;;OAKG;IACH,aAAa,CAAC,EAAE,mBAAmB,CAAA;IACnC;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACpC,gFAAgF;IAChF,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AA4BD;;;GAGG;AACH,eAAO,MAAM,qBAAqB,oBAAoB,CAAA;AAoItD;;;;;GAKG;AACH,MAAM,MAAM,+BAA+B,GAAG;IAC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AAE,MAAM,GAAG,SAAS,EAC/B,aAAa,EAAE,MAAM,EACrB,YAAY,CAAC,EAAE,WAAW,EAAE,EAC5B,iBAAiB,CAAC,EAAE,iBAAiB,GACpC,+BAA+B,CAgJjC;AAED;;;;;;;;;GASG;AACH,wBAAgB,+BAA+B,CAC7C,aAAa,EAAE,MAAM,EACrB,qBAAqB,EAAE,MAAM,GAAG,SAAS,GACxC,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAoC3C;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CAC3C,kBAAkB,EAAE,kBAAkB,EACtC,aAAa,EAAE,MAAM,EACrB,SAAS,CAAC,EAAE,MAAM,EAClB,iBAAiB,CAAC,EAAE,iBAAiB,GACpC,+BAA+B,CA2BjC"}
@@ -10,7 +10,8 @@ import { omit as s } from "lodash-es";
10
10
  import { FACET_COLUMN_RANGE_REQUEST_CONCRETE_TYPE_VALUE as c, FACET_COLUMN_VALUES_REQUEST_CONCRETE_TYPE_VALUE as l, TEXT_MATCHES_QUERY_FILTER_CONCRETE_TYPE_VALUE as u } from "@sage-bionetworks/synapse-types";
11
11
  import d from "dayjs";
12
12
  //#region src/components/SearchQueryWrapper/SearchQueryUseQueryOptions.ts
13
- function f(e, t) {
13
+ var f = "semantic_search";
14
+ function p(e, t) {
14
15
  if (!e) return;
15
16
  let n = t && !("*" in e) ? {
16
17
  ...e,
@@ -18,51 +19,61 @@ function f(e, t) {
18
19
  } : e;
19
20
  return Object.entries(n).map(([e, t]) => t === 1 ? e : `${e}^${t}`);
20
21
  }
21
- function p(e) {
22
- return /"[^"]+"/u.test(e);
23
- }
24
- function m(e) {
25
- return t.test(e);
26
- }
27
- function h(e, t = {}) {
28
- let { queryStrategy: n = "MULTI_MATCH", fieldBoosts: r, includeUnlistedFields: i = !0, fuzziness: a } = t, o = f(r, i);
29
- if (p(e) || m(e)) return { simple_query_string: {
30
- query: e,
31
- ...o ? { fields: o } : {}
32
- } };
33
- switch (n) {
34
- case "SIMPLE_QUERY_STRING": return { simple_query_string: {
22
+ function m(e, t, n) {
23
+ let { queryStrategy: r, fuzziness: i } = t;
24
+ switch (r) {
25
+ case void 0: return { multi_match: {
35
26
  query: e,
36
- ...o ? { fields: o } : {}
27
+ type: "best_fields",
28
+ operator: "and",
29
+ ...n ? { fields: n } : {},
30
+ ...i ? { fuzziness: i } : {}
37
31
  } };
32
+ case "SIMPLE_QUERY_STRING": return;
38
33
  case "MULTI_MATCH_BEST_FIELDS": return { multi_match: {
39
34
  query: e,
40
35
  type: "best_fields",
41
- ...o ? { fields: o } : {},
42
- ...a ? { fuzziness: a } : {}
36
+ ...n ? { fields: n } : {},
37
+ ...i ? { fuzziness: i } : {}
43
38
  } };
44
39
  case "MULTI_MATCH_CROSS_FIELDS": return { multi_match: {
45
40
  query: e,
46
41
  type: "cross_fields",
47
- ...o ? { fields: o } : {},
48
- ...a ? { fuzziness: a } : {}
42
+ ...n ? { fields: n } : {},
43
+ ...i ? { fuzziness: i } : {}
49
44
  } };
50
45
  case "PHRASE_PREFIX": return { multi_match: {
51
46
  query: e,
52
47
  type: "phrase_prefix",
53
- ...o ? { fields: o } : {}
48
+ ...n ? { fields: n } : {}
54
49
  } };
55
50
  case "BOOSTED_FUZZY": return { multi_match: {
56
51
  query: e,
57
- ...o ? { fields: o } : {},
58
- fuzziness: a ?? "AUTO"
52
+ ...n ? { fields: n } : {},
53
+ fuzziness: i ?? "AUTO"
59
54
  } };
60
- default: return { multi_match: {
55
+ case "MULTI_MATCH": return { multi_match: {
61
56
  query: e,
62
- fuzziness: a ?? "AUTO"
57
+ fuzziness: i ?? "AUTO"
63
58
  } };
64
59
  }
65
60
  }
61
+ function h(e, n, r = {}) {
62
+ let i = p(r.fieldBoosts, r.includeUnlistedFields ?? !0), a = { simple_query_string: {
63
+ query: e,
64
+ ...i ? { fields: i } : {}
65
+ } };
66
+ if (t.test(e)) return { query: a };
67
+ let o = m(e, r, i), s = { neural: { [f]: {
68
+ query_text: e,
69
+ ...n == null ? {} : { k: n }
70
+ } } };
71
+ return { hybrid: { queries: o ? [
72
+ a,
73
+ o,
74
+ s
75
+ ] : [a, s] } };
76
+ }
66
77
  function g(e, t) {
67
78
  let n = e.responseBody?.queryResult?.queryResults.rows?.length ?? 0, r = e.requestBody?.searchQuery?.size, i = e.responseBody?.queryCount, a = t.reduce((e, t) => e + (t.responseBody?.queryResult?.queryResults.rows?.length ?? 0), 0);
68
79
  if (n !== 0 && !(r != null && n < r) && !(i != null && a >= i)) return a;
@@ -79,9 +90,7 @@ function _(e, t, n, r) {
79
90
  let t = n?.find((t) => t.name === e.columnName)?.columnType, r = (e) => !e || t !== "DATE" ? e : /^\d{4}-\d{2}-\d{2}$/.test(e) ? String(d(e).valueOf()) : e, a = {}, o = r(e.min), s = r(e.max);
80
91
  o !== void 0 && (a.gte = o), s !== void 0 && (a.lte = s), i.push({ range: { [e.columnName]: a } });
81
92
  });
82
- let a = e.query.additionalFilters?.filter((e) => e.concreteType === u).map((e) => e.searchExpression).filter((e) => e != null && e.length > 0), o = a && a.length > 0 ? a.join(" ") : void 0, s;
83
- s = o ? h(o, r) : { match_all: {} };
84
- let f;
93
+ let a = e.query.additionalFilters?.filter((e) => e.concreteType === u).map((e) => e.searchExpression).filter((e) => e != null && e.length > 0), o = a && a.length > 0 ? a.join(" ") : void 0, s = o ? h(o, e.query.limit, r) : { query: { match_all: {} } }, f;
85
94
  i.length === 1 ? f = i[0] : i.length > 1 && (f = { bool: { must: i } });
86
95
  let p = n?.filter((e) => e.facetType === "enumeration").map((e) => {
87
96
  let t = {
@@ -103,7 +112,7 @@ function _(e, t, n, r) {
103
112
  concreteType: "org.sagebionetworks.repo.model.search.table.SearchIndexQuery",
104
113
  searchIndexId: t,
105
114
  searchQuery: {
106
- query: s,
115
+ ...s,
107
116
  post_filter: f || void 0,
108
117
  aggregations: m,
109
118
  sort: g?.length ? g : void 0,
@@ -263,6 +272,6 @@ function x(e, t, i, a) {
263
272
  ]);
264
273
  }
265
274
  //#endregion
266
- export { g as getNextPageParamForSearchQueryResults, y as getSearchQueryUseQueryOptions, v as searchQueryResultsToQueryResultBundle, _ as toSearchIndexQuery, b as useGetSuggestionsForSearchIndex, x as useSearchQueryUseQueryOptions };
275
+ export { f as SEMANTIC_SEARCH_FIELD, g as getNextPageParamForSearchQueryResults, y as getSearchQueryUseQueryOptions, v as searchQueryResultsToQueryResultBundle, _ as toSearchIndexQuery, b as useGetSuggestionsForSearchIndex, x as useSearchQueryUseQueryOptions };
267
276
 
268
277
  //# sourceMappingURL=SearchQueryUseQueryOptions.js.map