@keboola/design 11.0.0 → 11.0.1

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 (662) hide show
  1. package/dist/AIKit-Dre37SJr.js +1320 -0
  2. package/dist/AIKit-Dre37SJr.js.map +1 -0
  3. package/dist/Alert-DfZq9kGe.js +133 -0
  4. package/dist/Alert-DfZq9kGe.js.map +1 -0
  5. package/dist/AlertModal-BUC4Es8o.js +222 -0
  6. package/dist/AlertModal-BUC4Es8o.js.map +1 -0
  7. package/dist/AppShell-B5GQN6Zs.js +143 -0
  8. package/dist/AppShell-B5GQN6Zs.js.map +1 -0
  9. package/dist/AutoSaveTextarea-BeuWuszr.js +58 -0
  10. package/dist/{chunk-UGT6DKWM.js.map → AutoSaveTextarea-BeuWuszr.js.map} +1 -1
  11. package/dist/Badge-Ch26CXoP.js +195 -0
  12. package/dist/Badge-Ch26CXoP.js.map +1 -0
  13. package/dist/BrandEditor-B8o9zdZO.js +903 -0
  14. package/dist/BrandEditor-B8o9zdZO.js.map +1 -0
  15. package/dist/BrandLogo-CJkRd0F8.js +46 -0
  16. package/dist/BrandLogo-CJkRd0F8.js.map +1 -0
  17. package/dist/Breadcrumb-DJp7WwSv.js +330 -0
  18. package/dist/Breadcrumb-DJp7WwSv.js.map +1 -0
  19. package/dist/Button-nzmDNS2q.js +391 -0
  20. package/dist/Button-nzmDNS2q.js.map +1 -0
  21. package/dist/Calendar-cG5NIJ4O.js +6768 -0
  22. package/dist/Calendar-cG5NIJ4O.js.map +1 -0
  23. package/dist/Card-BAoZ35CV.js +105 -0
  24. package/dist/Card-BAoZ35CV.js.map +1 -0
  25. package/dist/Checkbox-GJ8-srt4.js +97 -0
  26. package/dist/Checkbox-GJ8-srt4.js.map +1 -0
  27. package/dist/Clipboard-CBJZiviP.js +58 -0
  28. package/dist/Clipboard-CBJZiviP.js.map +1 -0
  29. package/dist/ClipboardButton-ez5V3fkk.js +43 -0
  30. package/dist/ClipboardButton-ez5V3fkk.js.map +1 -0
  31. package/dist/CodeEditor-BfQJfbhL.js +952 -0
  32. package/dist/CodeEditor-BfQJfbhL.js.map +1 -0
  33. package/dist/Collapsible-BQXWEOBC.js +34 -0
  34. package/dist/Collapsible-BQXWEOBC.js.map +1 -0
  35. package/dist/ColorInput-Dx8Dsv7Y.js +180 -0
  36. package/dist/ColorInput-Dx8Dsv7Y.js.map +1 -0
  37. package/dist/ColorModeSwitch-CCqj7tjE.js +77 -0
  38. package/dist/ColorModeSwitch-CCqj7tjE.js.map +1 -0
  39. package/dist/Combobox-c_xBjf0P.js +439 -0
  40. package/dist/Combobox-c_xBjf0P.js.map +1 -0
  41. package/dist/Command-CQ_bQsJp.js +102 -0
  42. package/dist/Command-CQ_bQsJp.js.map +1 -0
  43. package/dist/CopyField-BJ96zvXs.js +322 -0
  44. package/dist/CopyField-BJ96zvXs.js.map +1 -0
  45. package/dist/DateInput-CMD3dY-T.js +141 -0
  46. package/dist/DateInput-CMD3dY-T.js.map +1 -0
  47. package/dist/DatePicker-BbFbmsGl.js +24 -0
  48. package/dist/DatePicker-BbFbmsGl.js.map +1 -0
  49. package/dist/DateRangeInput-D3BhiKyk.js +139 -0
  50. package/dist/DateRangeInput-D3BhiKyk.js.map +1 -0
  51. package/dist/DateRangePicker-BiUgtt_M.js +159 -0
  52. package/dist/DateRangePicker-BiUgtt_M.js.map +1 -0
  53. package/dist/DiagramSkeleton-lwBS2YBa.js +11 -0
  54. package/dist/DiagramSkeleton-lwBS2YBa.js.map +1 -0
  55. package/dist/DiffView-ppTIzh2h.js +429 -0
  56. package/dist/DiffView-ppTIzh2h.js.map +1 -0
  57. package/dist/DropdownMenu-B6ZbYvaM.js +327 -0
  58. package/dist/DropdownMenu-B6ZbYvaM.js.map +1 -0
  59. package/dist/FieldBox-D7DYtX_m.js +70 -0
  60. package/dist/FieldBox-D7DYtX_m.js.map +1 -0
  61. package/dist/FileUpload-sXRv7JiY.js +2527 -0
  62. package/dist/FileUpload-sXRv7JiY.js.map +1 -0
  63. package/dist/Form-BDCef6O9.js +371 -0
  64. package/dist/Form-BDCef6O9.js.map +1 -0
  65. package/dist/FormGroup-S9mPNHKH.js +124 -0
  66. package/dist/FormGroup-S9mPNHKH.js.map +1 -0
  67. package/dist/FullScreenModal-CJa2VkJ2.js +96 -0
  68. package/dist/FullScreenModal-CJa2VkJ2.js.map +1 -0
  69. package/dist/HoverCard-WfDkLK1s.js +31 -0
  70. package/dist/HoverCard-WfDkLK1s.js.map +1 -0
  71. package/dist/InputGroup-BJWsI35s.js +292 -0
  72. package/dist/InputGroup-BJWsI35s.js.map +1 -0
  73. package/dist/Kbd-CxHAo1oo.js +111 -0
  74. package/dist/Kbd-CxHAo1oo.js.map +1 -0
  75. package/dist/MarkedText-Ckbft5mw.js +44 -0
  76. package/dist/MarkedText-Ckbft5mw.js.map +1 -0
  77. package/dist/MermaidDiagram-BB06gymm.js +399 -0
  78. package/dist/MermaidDiagram-BB06gymm.js.map +1 -0
  79. package/dist/Modal-BA5Wc3sx.js +185 -0
  80. package/dist/Modal-BA5Wc3sx.js.map +1 -0
  81. package/dist/ModalTitle-C76ke2eo.js +28 -0
  82. package/dist/ModalTitle-C76ke2eo.js.map +1 -0
  83. package/dist/MultiActionButtonGroup-CiBHxsSk.js +33 -0
  84. package/dist/MultiActionButtonGroup-CiBHxsSk.js.map +1 -0
  85. package/dist/Navbar-t16usFZQ.js +322 -0
  86. package/dist/Navbar-t16usFZQ.js.map +1 -0
  87. package/dist/OtpInput-CbbymqYs.js +93 -0
  88. package/dist/OtpInput-CbbymqYs.js.map +1 -0
  89. package/dist/PageHeader-Q3IpCnQd.js +177 -0
  90. package/dist/PageHeader-Q3IpCnQd.js.map +1 -0
  91. package/dist/PageLayout-DSVM-ASz.js +176 -0
  92. package/dist/PageLayout-DSVM-ASz.js.map +1 -0
  93. package/dist/PageToolbar-0_1OBzaZ.js +153 -0
  94. package/dist/PageToolbar-0_1OBzaZ.js.map +1 -0
  95. package/dist/Pagination-CM_Rszz-.js +70 -0
  96. package/dist/Pagination-CM_Rszz-.js.map +1 -0
  97. package/dist/Popconfirm-BGe1jLov.js +170 -0
  98. package/dist/Popconfirm-BGe1jLov.js.map +1 -0
  99. package/dist/Popover-Ca0V6AD1.js +92 -0
  100. package/dist/Popover-Ca0V6AD1.js.map +1 -0
  101. package/dist/RadioGroup-sIveSsNa.js +233 -0
  102. package/dist/RadioGroup-sIveSsNa.js.map +1 -0
  103. package/dist/Resizable-D3vYToZH.js +52 -0
  104. package/dist/Resizable-D3vYToZH.js.map +1 -0
  105. package/dist/Search-3UiqNZRj.js +184 -0
  106. package/dist/Search-3UiqNZRj.js.map +1 -0
  107. package/dist/SearchInput-D2fcOv7E.js +102 -0
  108. package/dist/SearchInput-D2fcOv7E.js.map +1 -0
  109. package/dist/SectionNav--7bw2b6u.js +276 -0
  110. package/dist/SectionNav--7bw2b6u.js.map +1 -0
  111. package/dist/Select-4YX38G5h.js +181 -0
  112. package/dist/Select-4YX38G5h.js.map +1 -0
  113. package/dist/Sheet-BQrX8-h5.js +169 -0
  114. package/dist/Sheet-BQrX8-h5.js.map +1 -0
  115. package/dist/Sidebar-ROaR_AqC.js +799 -0
  116. package/dist/Sidebar-ROaR_AqC.js.map +1 -0
  117. package/dist/Slider-Da_3mS5v.js +127 -0
  118. package/dist/Slider-Da_3mS5v.js.map +1 -0
  119. package/dist/Stepper-C8sm9ZFM.js +325 -0
  120. package/dist/Stepper-C8sm9ZFM.js.map +1 -0
  121. package/dist/Switch-CX2A0v50.js +201 -0
  122. package/dist/Switch-CX2A0v50.js.map +1 -0
  123. package/dist/Table-CvYuTuNU.js +104 -0
  124. package/dist/Table-CvYuTuNU.js.map +1 -0
  125. package/dist/Tabs-EAihyqCt.js +74 -0
  126. package/dist/Tabs-EAihyqCt.js.map +1 -0
  127. package/dist/TextInput-BGed-V13.js +110 -0
  128. package/dist/TextInput-BGed-V13.js.map +1 -0
  129. package/dist/ThemeProvider-QncUrfJn.js +203 -0
  130. package/dist/ThemeProvider-QncUrfJn.js.map +1 -0
  131. package/dist/TimePicker-B_NegL-7.js +98 -0
  132. package/dist/TimePicker-B_NegL-7.js.map +1 -0
  133. package/dist/Timeline-6btyJl4D.js +154 -0
  134. package/dist/Timeline-6btyJl4D.js.map +1 -0
  135. package/dist/Toast-DQSbs3oA.js +49 -0
  136. package/dist/Toast-DQSbs3oA.js.map +1 -0
  137. package/dist/ToggleGroup-Cy_10Mvu.js +47 -0
  138. package/dist/ToggleGroup-Cy_10Mvu.js.map +1 -0
  139. package/dist/Workbench-BzE-Vvd9.js +293 -0
  140. package/dist/Workbench-BzE-Vvd9.js.map +1 -0
  141. package/dist/ZoomableSvg-DG9PnAm8.js +248 -0
  142. package/dist/ZoomableSvg-DG9PnAm8.js.map +1 -0
  143. package/dist/charts.d.ts +110 -103
  144. package/dist/charts.js +303 -254
  145. package/dist/charts.js.map +1 -1
  146. package/dist/classNames-BzrkDnOD.js +9 -0
  147. package/dist/classNames-BzrkDnOD.js.map +1 -0
  148. package/dist/constants-D6JcsD4_.d.ts +41 -0
  149. package/dist/context-KxxeMHbR.js +62 -0
  150. package/dist/context-KxxeMHbR.js.map +1 -0
  151. package/dist/editors.d.ts +180 -173
  152. package/dist/editors.js +747 -428
  153. package/dist/editors.js.map +1 -1
  154. package/dist/escapeStringRegexp-8MxP2knR.js +6 -0
  155. package/dist/escapeStringRegexp-8MxP2knR.js.map +1 -0
  156. package/dist/icons-Cek151jC.js +640 -0
  157. package/dist/icons-Cek151jC.js.map +1 -0
  158. package/dist/icons.d.ts +2 -41
  159. package/dist/icons.js +2 -9
  160. package/dist/index-m-kQEWiY.d.ts +54 -0
  161. package/dist/index.d.ts +6183 -9885
  162. package/dist/index.js +112 -124
  163. package/dist/internal/blocks/AIKit.js +2 -30
  164. package/dist/internal/blocks/AppShell.js +2 -11
  165. package/dist/internal/blocks/AutoSaveTextarea.js +2 -14
  166. package/dist/internal/blocks/BrandEditor.js +2 -23
  167. package/dist/internal/blocks/ChartPanel.js +45 -9
  168. package/dist/internal/blocks/ChartPanel.js.map +1 -1
  169. package/dist/internal/blocks/ClipboardButton.js +2 -12
  170. package/dist/internal/blocks/ColorInput.js +2 -13
  171. package/dist/internal/blocks/ColorModeSwitch.js +2 -13
  172. package/dist/internal/blocks/Command.js +2 -15
  173. package/dist/internal/blocks/CopyField.js +2 -11
  174. package/dist/internal/blocks/DashboardHero.js +58 -8
  175. package/dist/internal/blocks/DashboardHero.js.map +1 -1
  176. package/dist/internal/blocks/DateInput.js +2 -16
  177. package/dist/internal/blocks/DateRangeInput.js +2 -16
  178. package/dist/internal/blocks/EmptyConfigurationActionCard.js +15 -9
  179. package/dist/internal/blocks/EmptyConfigurationActionCard.js.map +1 -1
  180. package/dist/internal/blocks/EmptyState.js +141 -3
  181. package/dist/internal/blocks/EmptyState.js.map +1 -1
  182. package/dist/internal/blocks/ErrorState.js +178 -4
  183. package/dist/internal/blocks/ErrorState.js.map +1 -1
  184. package/dist/internal/blocks/ExportMenu.js +40 -12
  185. package/dist/internal/blocks/ExportMenu.js.map +1 -1
  186. package/dist/internal/blocks/Form.js +2 -29
  187. package/dist/internal/blocks/FormGroup.js +2 -18
  188. package/dist/internal/blocks/GoogleButton.js +94 -9
  189. package/dist/internal/blocks/GoogleButton.js.map +1 -1
  190. package/dist/internal/blocks/MicrosoftButton.js +63 -9
  191. package/dist/internal/blocks/MicrosoftButton.js.map +1 -1
  192. package/dist/internal/blocks/MultiActionButtonGroup.js +2 -12
  193. package/dist/internal/blocks/MultiCombobox.js +187 -13
  194. package/dist/internal/blocks/MultiCombobox.js.map +1 -1
  195. package/dist/internal/blocks/NumberInput.js +43 -11
  196. package/dist/internal/blocks/NumberInput.js.map +1 -1
  197. package/dist/internal/blocks/OtpInput.js +2 -10
  198. package/dist/internal/blocks/PageHeader.js +2 -9
  199. package/dist/internal/blocks/PageLayout.js +2 -9
  200. package/dist/internal/blocks/PageToolbar.js +2 -13
  201. package/dist/internal/blocks/PasswordInput.js +96 -12
  202. package/dist/internal/blocks/PasswordInput.js.map +1 -1
  203. package/dist/internal/blocks/SearchInput.js +2 -12
  204. package/dist/internal/blocks/SearchInputWithNavigation.js +64 -15
  205. package/dist/internal/blocks/SearchInputWithNavigation.js.map +1 -1
  206. package/dist/internal/blocks/SectionNav.js +2 -15
  207. package/dist/internal/blocks/SplitButton.js +45 -13
  208. package/dist/internal/blocks/SplitButton.js.map +1 -1
  209. package/dist/internal/blocks/StatCard.js +96 -9
  210. package/dist/internal/blocks/StatCard.js.map +1 -1
  211. package/dist/internal/blocks/TextInput.js +2 -13
  212. package/dist/internal/blocks/Textarea.js +31 -12
  213. package/dist/internal/blocks/Textarea.js.map +1 -1
  214. package/dist/internal/blocks/TimeInput.js +76 -16
  215. package/dist/internal/blocks/TimeInput.js.map +1 -1
  216. package/dist/internal/components/Alert.js +2 -11
  217. package/dist/internal/components/AlertModal.js +2 -11
  218. package/dist/internal/components/Avatar.js +52 -8
  219. package/dist/internal/components/Avatar.js.map +1 -1
  220. package/dist/internal/components/Badge.js +2 -9
  221. package/dist/internal/components/BrandLogo.js +2 -11
  222. package/dist/internal/components/Breadcrumb.js +2 -14
  223. package/dist/internal/components/Button.js +2 -10
  224. package/dist/internal/components/ButtonGroup.js +65 -8
  225. package/dist/internal/components/ButtonGroup.js.map +1 -1
  226. package/dist/internal/components/Calendar.js +2 -9
  227. package/dist/internal/components/Card.js +2 -9
  228. package/dist/internal/components/Checkbox.js +2 -11
  229. package/dist/internal/components/Clipboard.js +2 -9
  230. package/dist/internal/components/Collapsible.js +2 -9
  231. package/dist/internal/components/CollapsiblePanel.js +86 -10
  232. package/dist/internal/components/CollapsiblePanel.js.map +1 -1
  233. package/dist/internal/components/Combobox.js +2 -13
  234. package/dist/internal/components/DatePicker.js +2 -11
  235. package/dist/internal/components/DateRangePicker.js +2 -17
  236. package/dist/internal/components/DiffView.js +2 -9
  237. package/dist/internal/components/DotsLoader.js +17 -4
  238. package/dist/internal/components/DotsLoader.js.map +1 -1
  239. package/dist/internal/components/DropdownMenu.js +2 -11
  240. package/dist/internal/components/EmptySearchContent.js +11 -3
  241. package/dist/internal/components/EmptySearchContent.js.map +1 -1
  242. package/dist/internal/components/FileUpload.js +2 -11
  243. package/dist/internal/components/FullScreenModal.js +2 -12
  244. package/dist/internal/components/HelpBlock.js +24 -3
  245. package/dist/internal/components/HelpBlock.js.map +1 -1
  246. package/dist/internal/components/HoverCard.js +2 -9
  247. package/dist/internal/components/InputGroup.js +2 -11
  248. package/dist/internal/components/Kbd.js +2 -9
  249. package/dist/internal/components/Label.js +38 -8
  250. package/dist/internal/components/Label.js.map +1 -1
  251. package/dist/internal/components/Link.js +21 -8
  252. package/dist/internal/components/Link.js.map +1 -1
  253. package/dist/internal/components/MarkedText.js +2 -5
  254. package/dist/internal/components/MergeEditor/ConflictStatus/ConflictStatusIndicator.js +19 -9
  255. package/dist/internal/components/MergeEditor/ConflictStatus/ConflictStatusIndicator.js.map +1 -1
  256. package/dist/internal/components/MergeEditor/PaneHeader.js +12 -3
  257. package/dist/internal/components/MergeEditor/PaneHeader.js.map +1 -1
  258. package/dist/internal/components/MergeEditor/constants.js +17 -3
  259. package/dist/internal/components/MergeEditor/constants.js.map +1 -1
  260. package/dist/internal/components/MergeEditor/useMergeDiff.js +2 -5
  261. package/dist/internal/components/Modal.js +2 -13
  262. package/dist/internal/components/Navbar.js +2 -14
  263. package/dist/internal/components/Pagination.js +2 -11
  264. package/dist/internal/components/PanelWithDetails.js +30 -10
  265. package/dist/internal/components/PanelWithDetails.js.map +1 -1
  266. package/dist/internal/components/Popconfirm.js +2 -12
  267. package/dist/internal/components/Popover.js +2 -9
  268. package/dist/internal/components/Progress.js +46 -8
  269. package/dist/internal/components/Progress.js.map +1 -1
  270. package/dist/internal/components/RadioGroup.js +2 -12
  271. package/dist/internal/components/Resizable.js +2 -9
  272. package/dist/internal/components/ScrollArea.js +41 -8
  273. package/dist/internal/components/ScrollArea.js.map +1 -1
  274. package/dist/internal/components/Search.js +2 -10
  275. package/dist/internal/components/Select.js +2 -12
  276. package/dist/internal/components/Separator.js +83 -8
  277. package/dist/internal/components/Separator.js.map +1 -1
  278. package/dist/internal/components/Sheet.js +2 -12
  279. package/dist/internal/components/Sidebar.js +2 -20
  280. package/dist/internal/components/Skeleton/Skeleton.js +38 -8
  281. package/dist/internal/components/Skeleton/Skeleton.js.map +1 -1
  282. package/dist/internal/components/Skeleton/SkeletonList.js +40 -9
  283. package/dist/internal/components/Skeleton/SkeletonList.js.map +1 -1
  284. package/dist/internal/components/Slider.js +2 -11
  285. package/dist/internal/components/SpotlightBackdrop.js +131 -8
  286. package/dist/internal/components/SpotlightBackdrop.js.map +1 -1
  287. package/dist/internal/components/Stepper.js +2 -10
  288. package/dist/internal/components/Switch.js +2 -10
  289. package/dist/internal/components/Table.js +2 -10
  290. package/dist/internal/components/Tabs.js +2 -12
  291. package/dist/internal/components/ThemeProvider.js +3 -10
  292. package/dist/internal/components/TimePicker.js +2 -12
  293. package/dist/internal/components/Timeline.js +2 -10
  294. package/dist/internal/components/Toast.js +3 -11
  295. package/dist/internal/components/Toggle.js +168 -8
  296. package/dist/internal/components/Toggle.js.map +1 -1
  297. package/dist/internal/components/ToggleGroup.js +2 -9
  298. package/dist/internal/components/Tooltip.js +2 -8
  299. package/dist/internal/components/Truncated.js +44 -8
  300. package/dist/internal/components/Truncated.js.map +1 -1
  301. package/dist/internal/components/Workbench.js +2 -11
  302. package/dist/internal/components/ZoomableSvg.js +2 -13
  303. package/dist/internal/hooks/useAutosizeInput.js +76 -3
  304. package/dist/internal/hooks/useAutosizeInput.js.map +1 -1
  305. package/dist/internal/hooks/useScrollbarPosition.js +44 -4
  306. package/dist/internal/hooks/useScrollbarPosition.js.map +1 -1
  307. package/dist/internal/hooks/useStableCallback.js +28 -3
  308. package/dist/internal/hooks/useStableCallback.js.map +1 -1
  309. package/dist/internal/utils/mergeRefs.js +19 -3
  310. package/dist/internal/utils/mergeRefs.js.map +1 -1
  311. package/dist/internal/utils.js +5 -8
  312. package/dist/markdown-editor.d.ts +72 -72
  313. package/dist/markdown-editor.js +1122 -1207
  314. package/dist/markdown-editor.js.map +1 -1
  315. package/dist/mermaid.d.ts +12 -12
  316. package/dist/mermaid.js +2 -18
  317. package/dist/rjsf.d.ts +33 -34
  318. package/dist/rjsf.js +1541 -1671
  319. package/dist/rjsf.js.map +1 -1
  320. package/dist/rolldown-runtime-Bdc48AWt.js +33 -0
  321. package/dist/styles-DSUP_-9Z.js +158 -0
  322. package/dist/styles-DSUP_-9Z.js.map +1 -0
  323. package/dist/testing.d.ts +8 -7
  324. package/dist/testing.js +36 -21
  325. package/dist/testing.js.map +1 -1
  326. package/dist/themeTokens-BNg98Mu9.js +85 -0
  327. package/dist/themeTokens-BNg98Mu9.js.map +1 -0
  328. package/dist/toast-CjkURw0M.js +184 -0
  329. package/dist/toast-CjkURw0M.js.map +1 -0
  330. package/dist/useColorSchemeState-CYqcUfSH.js +61 -0
  331. package/dist/useColorSchemeState-CYqcUfSH.js.map +1 -0
  332. package/dist/useControllableState-M6494mCT.js +31 -0
  333. package/dist/useControllableState-M6494mCT.js.map +1 -0
  334. package/dist/useElement-DkF6esWL.js +15 -0
  335. package/dist/useElement-DkF6esWL.js.map +1 -0
  336. package/dist/useMergeDiff-CvowEXJ1.js +465 -0
  337. package/dist/useMergeDiff-CvowEXJ1.js.map +1 -0
  338. package/dist/utils-D0c5VAyF.js +308 -0
  339. package/dist/utils-D0c5VAyF.js.map +1 -0
  340. package/package.json +8 -8
  341. package/dist/MermaidDiagram-ZU5KAVRT.js +0 -18
  342. package/dist/MermaidDiagram-ZU5KAVRT.js.map +0 -1
  343. package/dist/chunk-2YYJDKSP.js +0 -51
  344. package/dist/chunk-2YYJDKSP.js.map +0 -1
  345. package/dist/chunk-3P5UUCFI.js +0 -385
  346. package/dist/chunk-3P5UUCFI.js.map +0 -1
  347. package/dist/chunk-3QDFDDWZ.js +0 -99
  348. package/dist/chunk-3QDFDDWZ.js.map +0 -1
  349. package/dist/chunk-3W27OLK5.js +0 -15
  350. package/dist/chunk-3W27OLK5.js.map +0 -1
  351. package/dist/chunk-4FIZZONW.js +0 -40
  352. package/dist/chunk-4FIZZONW.js.map +0 -1
  353. package/dist/chunk-4GIAXOJG.js +0 -133
  354. package/dist/chunk-4GIAXOJG.js.map +0 -1
  355. package/dist/chunk-52NDNMK7.js +0 -99
  356. package/dist/chunk-52NDNMK7.js.map +0 -1
  357. package/dist/chunk-576G5OES.js +0 -201
  358. package/dist/chunk-576G5OES.js.map +0 -1
  359. package/dist/chunk-5AIE6SET.js +0 -659
  360. package/dist/chunk-5AIE6SET.js.map +0 -1
  361. package/dist/chunk-5FTNAZRW.js +0 -327
  362. package/dist/chunk-5FTNAZRW.js.map +0 -1
  363. package/dist/chunk-5IG2S7ZY.js +0 -70
  364. package/dist/chunk-5IG2S7ZY.js.map +0 -1
  365. package/dist/chunk-5QCXHNCW.js +0 -404
  366. package/dist/chunk-5QCXHNCW.js.map +0 -1
  367. package/dist/chunk-6DUMGC7Y.js +0 -105
  368. package/dist/chunk-6DUMGC7Y.js.map +0 -1
  369. package/dist/chunk-6J25CVST.js +0 -174
  370. package/dist/chunk-6J25CVST.js.map +0 -1
  371. package/dist/chunk-6NN35XOP.js +0 -120
  372. package/dist/chunk-6NN35XOP.js.map +0 -1
  373. package/dist/chunk-6NZBVA4T.js +0 -24
  374. package/dist/chunk-6NZBVA4T.js.map +0 -1
  375. package/dist/chunk-6W5BHRCL.js +0 -295
  376. package/dist/chunk-6W5BHRCL.js.map +0 -1
  377. package/dist/chunk-72BKRCEG.js +0 -409
  378. package/dist/chunk-72BKRCEG.js.map +0 -1
  379. package/dist/chunk-7GTI3PPI.js +0 -95
  380. package/dist/chunk-7GTI3PPI.js.map +0 -1
  381. package/dist/chunk-7P6PLZ4B.js +0 -74
  382. package/dist/chunk-7P6PLZ4B.js.map +0 -1
  383. package/dist/chunk-7WZWY5IA.js +0 -46
  384. package/dist/chunk-7WZWY5IA.js.map +0 -1
  385. package/dist/chunk-AIYO2632.js +0 -489
  386. package/dist/chunk-AIYO2632.js.map +0 -1
  387. package/dist/chunk-ANFZWPNE.js +0 -112
  388. package/dist/chunk-ANFZWPNE.js.map +0 -1
  389. package/dist/chunk-ANZTVAJU.js +0 -73
  390. package/dist/chunk-ANZTVAJU.js.map +0 -1
  391. package/dist/chunk-BD5BTJKX.js +0 -166
  392. package/dist/chunk-BD5BTJKX.js.map +0 -1
  393. package/dist/chunk-BHGIDSRJ.js +0 -140
  394. package/dist/chunk-BHGIDSRJ.js.map +0 -1
  395. package/dist/chunk-BSQWZITZ.js +0 -507
  396. package/dist/chunk-BSQWZITZ.js.map +0 -1
  397. package/dist/chunk-D3LAIK62.js +0 -23
  398. package/dist/chunk-D3LAIK62.js.map +0 -1
  399. package/dist/chunk-DODCR43C.js +0 -155
  400. package/dist/chunk-DODCR43C.js.map +0 -1
  401. package/dist/chunk-EEK5NGZF.js +0 -40
  402. package/dist/chunk-EEK5NGZF.js.map +0 -1
  403. package/dist/chunk-ENRG7TXA.js +0 -11
  404. package/dist/chunk-ENRG7TXA.js.map +0 -1
  405. package/dist/chunk-EQRMGIGY.js +0 -239
  406. package/dist/chunk-EQRMGIGY.js.map +0 -1
  407. package/dist/chunk-ERAHK5YQ.js +0 -495
  408. package/dist/chunk-ERAHK5YQ.js.map +0 -1
  409. package/dist/chunk-F3FOFY2P.js +0 -124
  410. package/dist/chunk-F3FOFY2P.js.map +0 -1
  411. package/dist/chunk-F6BTWFOC.js +0 -507
  412. package/dist/chunk-F6BTWFOC.js.map +0 -1
  413. package/dist/chunk-F6J6NNAL.js +0 -34
  414. package/dist/chunk-F6J6NNAL.js.map +0 -1
  415. package/dist/chunk-FCHJ7D5O.js +0 -59
  416. package/dist/chunk-FCHJ7D5O.js.map +0 -1
  417. package/dist/chunk-FFJTEQCC.js +0 -80
  418. package/dist/chunk-FFJTEQCC.js.map +0 -1
  419. package/dist/chunk-FUFMVW7O.js +0 -64
  420. package/dist/chunk-FUFMVW7O.js.map +0 -1
  421. package/dist/chunk-FVPGQ6UE.js +0 -25
  422. package/dist/chunk-FVPGQ6UE.js.map +0 -1
  423. package/dist/chunk-G3PMV62Z.js +0 -33
  424. package/dist/chunk-G3PMV62Z.js.map +0 -1
  425. package/dist/chunk-GACFOW3E.js +0 -51
  426. package/dist/chunk-GACFOW3E.js.map +0 -1
  427. package/dist/chunk-GDT6HQMK.js +0 -42
  428. package/dist/chunk-GDT6HQMK.js.map +0 -1
  429. package/dist/chunk-HLGU22C6.js +0 -2589
  430. package/dist/chunk-HLGU22C6.js.map +0 -1
  431. package/dist/chunk-HPMYYGP7.js +0 -134
  432. package/dist/chunk-HPMYYGP7.js.map +0 -1
  433. package/dist/chunk-I2UCOD45.js +0 -197
  434. package/dist/chunk-I2UCOD45.js.map +0 -1
  435. package/dist/chunk-IEGDZUVM.js +0 -75
  436. package/dist/chunk-IEGDZUVM.js.map +0 -1
  437. package/dist/chunk-IIS7INHF.js +0 -47
  438. package/dist/chunk-IIS7INHF.js.map +0 -1
  439. package/dist/chunk-ITELSEFU.js +0 -256
  440. package/dist/chunk-ITELSEFU.js.map +0 -1
  441. package/dist/chunk-IXAYNBOY.js +0 -407
  442. package/dist/chunk-IXAYNBOY.js.map +0 -1
  443. package/dist/chunk-JUW2ETEI.js +0 -191
  444. package/dist/chunk-JUW2ETEI.js.map +0 -1
  445. package/dist/chunk-K65C7CVE.js +0 -127
  446. package/dist/chunk-K65C7CVE.js.map +0 -1
  447. package/dist/chunk-KDI64MCY.js +0 -189
  448. package/dist/chunk-KDI64MCY.js.map +0 -1
  449. package/dist/chunk-KN4ASMH5.js +0 -160
  450. package/dist/chunk-KN4ASMH5.js.map +0 -1
  451. package/dist/chunk-KQW7QNTU.js +0 -1549
  452. package/dist/chunk-KQW7QNTU.js.map +0 -1
  453. package/dist/chunk-KR7NXXHC.js +0 -66
  454. package/dist/chunk-KR7NXXHC.js.map +0 -1
  455. package/dist/chunk-KRZKIVMA.js +0 -142
  456. package/dist/chunk-KRZKIVMA.js.map +0 -1
  457. package/dist/chunk-KTTLLKGQ.js +0 -185
  458. package/dist/chunk-KTTLLKGQ.js.map +0 -1
  459. package/dist/chunk-KWKSHPDP.js +0 -234
  460. package/dist/chunk-KWKSHPDP.js.map +0 -1
  461. package/dist/chunk-KZVC7OYG.js +0 -57
  462. package/dist/chunk-KZVC7OYG.js.map +0 -1
  463. package/dist/chunk-L5DHUN2V.js +0 -204
  464. package/dist/chunk-L5DHUN2V.js.map +0 -1
  465. package/dist/chunk-LCTGEH57.js +0 -1376
  466. package/dist/chunk-LCTGEH57.js.map +0 -1
  467. package/dist/chunk-LXLIQ2D6.js +0 -12
  468. package/dist/chunk-LXLIQ2D6.js.map +0 -1
  469. package/dist/chunk-M4CTURKX.js +0 -84
  470. package/dist/chunk-M4CTURKX.js.map +0 -1
  471. package/dist/chunk-M6LTUPVP.js +0 -301
  472. package/dist/chunk-M6LTUPVP.js.map +0 -1
  473. package/dist/chunk-MA6RRHDT.js +0 -291
  474. package/dist/chunk-MA6RRHDT.js.map +0 -1
  475. package/dist/chunk-MODE4QIA.js +0 -6
  476. package/dist/chunk-MODE4QIA.js.map +0 -1
  477. package/dist/chunk-MVILMVGG.js +0 -118
  478. package/dist/chunk-MVILMVGG.js.map +0 -1
  479. package/dist/chunk-MWS4VCLV.js +0 -17
  480. package/dist/chunk-MWS4VCLV.js.map +0 -1
  481. package/dist/chunk-NEUX74SO.js +0 -315
  482. package/dist/chunk-NEUX74SO.js.map +0 -1
  483. package/dist/chunk-NFHKYBRD.js +0 -156
  484. package/dist/chunk-NFHKYBRD.js.map +0 -1
  485. package/dist/chunk-NHJNNXD3.js +0 -89
  486. package/dist/chunk-NHJNNXD3.js.map +0 -1
  487. package/dist/chunk-O2BF3HZL.js +0 -33
  488. package/dist/chunk-O2BF3HZL.js.map +0 -1
  489. package/dist/chunk-OANXCZYD.js +0 -212
  490. package/dist/chunk-OANXCZYD.js.map +0 -1
  491. package/dist/chunk-ODJF7YIP.js +0 -230
  492. package/dist/chunk-ODJF7YIP.js.map +0 -1
  493. package/dist/chunk-ON4BJTHI.js +0 -101
  494. package/dist/chunk-ON4BJTHI.js.map +0 -1
  495. package/dist/chunk-OTL5WXIJ.js +0 -16
  496. package/dist/chunk-OTL5WXIJ.js.map +0 -1
  497. package/dist/chunk-PACNBKJV.js +0 -47
  498. package/dist/chunk-PACNBKJV.js.map +0 -1
  499. package/dist/chunk-PROCA7K7.js +0 -23
  500. package/dist/chunk-PROCA7K7.js.map +0 -1
  501. package/dist/chunk-QGMIPA67.js +0 -85
  502. package/dist/chunk-QGMIPA67.js.map +0 -1
  503. package/dist/chunk-QQA37LFB.js +0 -190
  504. package/dist/chunk-QQA37LFB.js.map +0 -1
  505. package/dist/chunk-QZAWRSEB.js +0 -61
  506. package/dist/chunk-QZAWRSEB.js.map +0 -1
  507. package/dist/chunk-R74KGWNS.js +0 -699
  508. package/dist/chunk-R74KGWNS.js.map +0 -1
  509. package/dist/chunk-RFDLHMKL.js +0 -110
  510. package/dist/chunk-RFDLHMKL.js.map +0 -1
  511. package/dist/chunk-RL64HN7S.js +0 -40
  512. package/dist/chunk-RL64HN7S.js.map +0 -1
  513. package/dist/chunk-RMRQKPL7.js +0 -115
  514. package/dist/chunk-RMRQKPL7.js.map +0 -1
  515. package/dist/chunk-RQVK4IYC.js +0 -606
  516. package/dist/chunk-RQVK4IYC.js.map +0 -1
  517. package/dist/chunk-RTW56PWZ.js +0 -59
  518. package/dist/chunk-RTW56PWZ.js.map +0 -1
  519. package/dist/chunk-RUTPQNLR.js +0 -266
  520. package/dist/chunk-RUTPQNLR.js.map +0 -1
  521. package/dist/chunk-S6TAF63G.js +0 -25
  522. package/dist/chunk-S6TAF63G.js.map +0 -1
  523. package/dist/chunk-SBGAUGXY.js +0 -224
  524. package/dist/chunk-SBGAUGXY.js.map +0 -1
  525. package/dist/chunk-SC275NHZ.js +0 -407
  526. package/dist/chunk-SC275NHZ.js.map +0 -1
  527. package/dist/chunk-SCQPU4UE.js +0 -97
  528. package/dist/chunk-SCQPU4UE.js.map +0 -1
  529. package/dist/chunk-SFFF2WQP.js +0 -8
  530. package/dist/chunk-SFFF2WQP.js.map +0 -1
  531. package/dist/chunk-SJYMHZKA.js +0 -36
  532. package/dist/chunk-SJYMHZKA.js.map +0 -1
  533. package/dist/chunk-SLCCUJVN.js +0 -125
  534. package/dist/chunk-SLCCUJVN.js.map +0 -1
  535. package/dist/chunk-SVBSNSD4.js +0 -259
  536. package/dist/chunk-SVBSNSD4.js.map +0 -1
  537. package/dist/chunk-SVPLTL35.js +0 -62
  538. package/dist/chunk-SVPLTL35.js.map +0 -1
  539. package/dist/chunk-SWQFYNYG.js +0 -338
  540. package/dist/chunk-SWQFYNYG.js.map +0 -1
  541. package/dist/chunk-THHB4EWS.js +0 -72
  542. package/dist/chunk-THHB4EWS.js.map +0 -1
  543. package/dist/chunk-TUCDD33E.js +0 -246
  544. package/dist/chunk-TUCDD33E.js.map +0 -1
  545. package/dist/chunk-TV4WAP2R.js +0 -14
  546. package/dist/chunk-TV4WAP2R.js.map +0 -1
  547. package/dist/chunk-U3A6YBTZ.js +0 -134
  548. package/dist/chunk-U3A6YBTZ.js.map +0 -1
  549. package/dist/chunk-UGT6DKWM.js +0 -95
  550. package/dist/chunk-VSERHUWD.js +0 -212
  551. package/dist/chunk-VSERHUWD.js.map +0 -1
  552. package/dist/chunk-VYG7BDXC.js +0 -49
  553. package/dist/chunk-VYG7BDXC.js.map +0 -1
  554. package/dist/chunk-WETKNYZX.js +0 -52
  555. package/dist/chunk-WETKNYZX.js.map +0 -1
  556. package/dist/chunk-WGG4AML3.js +0 -216
  557. package/dist/chunk-WGG4AML3.js.map +0 -1
  558. package/dist/chunk-WKAUEL6I.js +0 -30
  559. package/dist/chunk-WKAUEL6I.js.map +0 -1
  560. package/dist/chunk-WPOLA5CG.js +0 -81
  561. package/dist/chunk-WPOLA5CG.js.map +0 -1
  562. package/dist/chunk-WPVETCGJ.js +0 -254
  563. package/dist/chunk-WPVETCGJ.js.map +0 -1
  564. package/dist/chunk-WTSM3A7E.js +0 -13
  565. package/dist/chunk-WTSM3A7E.js.map +0 -1
  566. package/dist/chunk-WU3F2K3T.js +0 -148
  567. package/dist/chunk-WU3F2K3T.js.map +0 -1
  568. package/dist/chunk-WZZK2DTZ.js +0 -39
  569. package/dist/chunk-WZZK2DTZ.js.map +0 -1
  570. package/dist/chunk-X4IHLKRD.js +0 -42
  571. package/dist/chunk-X4IHLKRD.js.map +0 -1
  572. package/dist/chunk-XAHEXZJC.js +0 -80
  573. package/dist/chunk-XAHEXZJC.js.map +0 -1
  574. package/dist/chunk-XCYGJDUX.js +0 -31
  575. package/dist/chunk-XCYGJDUX.js.map +0 -1
  576. package/dist/chunk-Y4W3JORC.js +0 -104
  577. package/dist/chunk-Y4W3JORC.js.map +0 -1
  578. package/dist/chunk-YFZJ3ZLG.js +0 -1297
  579. package/dist/chunk-YFZJ3ZLG.js.map +0 -1
  580. package/dist/chunk-YI3WLXEN.js +0 -4387
  581. package/dist/chunk-YI3WLXEN.js.map +0 -1
  582. package/dist/chunk-ZBKFSPD3.js +0 -29
  583. package/dist/chunk-ZBKFSPD3.js.map +0 -1
  584. package/dist/chunk-ZOERRQ6A.js +0 -79
  585. package/dist/chunk-ZOERRQ6A.js.map +0 -1
  586. package/dist/chunk-ZSTGUKHU.js +0 -10
  587. package/dist/chunk-ZSTGUKHU.js.map +0 -1
  588. package/dist/chunk-ZUEHDL27.js +0 -65
  589. package/dist/chunk-ZUEHDL27.js.map +0 -1
  590. package/dist/constants-D3gaMY-W.d.ts +0 -39
  591. package/dist/icons.js.map +0 -1
  592. package/dist/index.js.map +0 -1
  593. package/dist/internal/blocks/AIKit.js.map +0 -1
  594. package/dist/internal/blocks/AppShell.js.map +0 -1
  595. package/dist/internal/blocks/AutoSaveTextarea.js.map +0 -1
  596. package/dist/internal/blocks/BrandEditor.js.map +0 -1
  597. package/dist/internal/blocks/ClipboardButton.js.map +0 -1
  598. package/dist/internal/blocks/ColorInput.js.map +0 -1
  599. package/dist/internal/blocks/ColorModeSwitch.js.map +0 -1
  600. package/dist/internal/blocks/Command.js.map +0 -1
  601. package/dist/internal/blocks/CopyField.js.map +0 -1
  602. package/dist/internal/blocks/DateInput.js.map +0 -1
  603. package/dist/internal/blocks/DateRangeInput.js.map +0 -1
  604. package/dist/internal/blocks/Form.js.map +0 -1
  605. package/dist/internal/blocks/FormGroup.js.map +0 -1
  606. package/dist/internal/blocks/MultiActionButtonGroup.js.map +0 -1
  607. package/dist/internal/blocks/OtpInput.js.map +0 -1
  608. package/dist/internal/blocks/PageHeader.js.map +0 -1
  609. package/dist/internal/blocks/PageLayout.js.map +0 -1
  610. package/dist/internal/blocks/PageToolbar.js.map +0 -1
  611. package/dist/internal/blocks/SearchInput.js.map +0 -1
  612. package/dist/internal/blocks/SectionNav.js.map +0 -1
  613. package/dist/internal/blocks/TextInput.js.map +0 -1
  614. package/dist/internal/components/Alert.js.map +0 -1
  615. package/dist/internal/components/AlertModal.js.map +0 -1
  616. package/dist/internal/components/Badge.js.map +0 -1
  617. package/dist/internal/components/BrandLogo.js.map +0 -1
  618. package/dist/internal/components/Breadcrumb.js.map +0 -1
  619. package/dist/internal/components/Button.js.map +0 -1
  620. package/dist/internal/components/Calendar.js.map +0 -1
  621. package/dist/internal/components/Card.js.map +0 -1
  622. package/dist/internal/components/Checkbox.js.map +0 -1
  623. package/dist/internal/components/Clipboard.js.map +0 -1
  624. package/dist/internal/components/Collapsible.js.map +0 -1
  625. package/dist/internal/components/Combobox.js.map +0 -1
  626. package/dist/internal/components/DatePicker.js.map +0 -1
  627. package/dist/internal/components/DateRangePicker.js.map +0 -1
  628. package/dist/internal/components/DiffView.js.map +0 -1
  629. package/dist/internal/components/DropdownMenu.js.map +0 -1
  630. package/dist/internal/components/FileUpload.js.map +0 -1
  631. package/dist/internal/components/FullScreenModal.js.map +0 -1
  632. package/dist/internal/components/HoverCard.js.map +0 -1
  633. package/dist/internal/components/InputGroup.js.map +0 -1
  634. package/dist/internal/components/Kbd.js.map +0 -1
  635. package/dist/internal/components/MarkedText.js.map +0 -1
  636. package/dist/internal/components/MergeEditor/useMergeDiff.js.map +0 -1
  637. package/dist/internal/components/Modal.js.map +0 -1
  638. package/dist/internal/components/Navbar.js.map +0 -1
  639. package/dist/internal/components/Pagination.js.map +0 -1
  640. package/dist/internal/components/Popconfirm.js.map +0 -1
  641. package/dist/internal/components/Popover.js.map +0 -1
  642. package/dist/internal/components/RadioGroup.js.map +0 -1
  643. package/dist/internal/components/Resizable.js.map +0 -1
  644. package/dist/internal/components/Search.js.map +0 -1
  645. package/dist/internal/components/Select.js.map +0 -1
  646. package/dist/internal/components/Sheet.js.map +0 -1
  647. package/dist/internal/components/Sidebar.js.map +0 -1
  648. package/dist/internal/components/Slider.js.map +0 -1
  649. package/dist/internal/components/Stepper.js.map +0 -1
  650. package/dist/internal/components/Switch.js.map +0 -1
  651. package/dist/internal/components/Table.js.map +0 -1
  652. package/dist/internal/components/Tabs.js.map +0 -1
  653. package/dist/internal/components/ThemeProvider.js.map +0 -1
  654. package/dist/internal/components/TimePicker.js.map +0 -1
  655. package/dist/internal/components/Timeline.js.map +0 -1
  656. package/dist/internal/components/Toast.js.map +0 -1
  657. package/dist/internal/components/ToggleGroup.js.map +0 -1
  658. package/dist/internal/components/Tooltip.js.map +0 -1
  659. package/dist/internal/components/Workbench.js.map +0 -1
  660. package/dist/internal/components/ZoomableSvg.js.map +0 -1
  661. package/dist/internal/utils.js.map +0 -1
  662. package/dist/mermaid.js.map +0 -1
package/dist/rjsf.js CHANGED
@@ -1,1728 +1,1598 @@
1
- import { Tabs, TabsContent } from './chunk-QGMIPA67.js';
2
- import { CollapsiblePanel } from './chunk-MVILMVGG.js';
3
- import { Alert } from './chunk-KWKSHPDP.js';
4
- import './chunk-FVPGQ6UE.js';
5
- import { DateInput } from './chunk-KDI64MCY.js';
6
- import { PasswordInput } from './chunk-U3A6YBTZ.js';
7
- import { Checkbox } from './chunk-Y4W3JORC.js';
8
- import { Combobox } from './chunk-5AIE6SET.js';
9
- import './chunk-SBGAUGXY.js';
10
- import './chunk-XCYGJDUX.js';
11
- import { RadioGroup } from './chunk-ITELSEFU.js';
12
- import './chunk-SCQPU4UE.js';
13
- import './chunk-ON4BJTHI.js';
14
- import './chunk-YI3WLXEN.js';
15
- import { Link } from './chunk-WZZK2DTZ.js';
16
- import './chunk-6DUMGC7Y.js';
17
- import { FormGroup } from './chunk-RTW56PWZ.js';
18
- import { NumberInput } from './chunk-QZAWRSEB.js';
19
- import { Textarea } from './chunk-EEK5NGZF.js';
20
- import './chunk-VSERHUWD.js';
21
- import { TextInput } from './chunk-HPMYYGP7.js';
22
- import './chunk-WKAUEL6I.js';
23
- import './chunk-SC275NHZ.js';
24
- import { Label } from './chunk-S6TAF63G.js';
25
- import './chunk-THHB4EWS.js';
26
- import { isLanguageMode, CodeEditor } from './chunk-YFZJ3ZLG.js';
27
- import './chunk-TV4WAP2R.js';
28
- import './chunk-7GTI3PPI.js';
29
- import './chunk-IIS7INHF.js';
30
- import './chunk-FUFMVW7O.js';
31
- import './chunk-7P6PLZ4B.js';
32
- import './chunk-PROCA7K7.js';
33
- import { Button } from './chunk-IXAYNBOY.js';
34
- import { Trash2, Info, BookOpen } from './chunk-RQVK4IYC.js';
35
- import './chunk-KR7NXXHC.js';
36
- import { debounce, Tooltip } from './chunk-SWQFYNYG.js';
37
- import './chunk-3W27OLK5.js';
38
- import './chunk-MODE4QIA.js';
39
- import './chunk-WETKNYZX.js';
40
- import './chunk-LXLIQ2D6.js';
41
- import './chunk-G3PMV62Z.js';
42
- import { createContext, use, useMemo, useRef, useState, useEffect, useCallback, isValidElement } from 'react';
43
- import Form from '@rjsf/core';
44
- import validator from '@rjsf/validator-ajv8';
45
- import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
46
- import DOMPurify from 'dompurify';
47
-
48
- var RenderMarkdownContext = createContext((source) => source);
49
- var RenderMarkdownProvider = RenderMarkdownContext;
50
- var useRenderMarkdown = () => use(RenderMarkdownContext);
51
- var isValidJson = (raw) => {
52
- try {
53
- const parsed = JSON.parse(raw);
54
- return Boolean(parsed && typeof parsed === "object");
55
- } catch {
56
- return false;
57
- }
58
- };
59
- var sanitize = (val) => {
60
- if (typeof val === "object" && val !== null) return JSON.stringify(val, null, " ");
61
- return String(val ?? "");
1
+ import { Tooltip, debounce } from "./utils-D0c5VAyF.js";
2
+ import { BookOpen, Info, Trash2 } from "./icons-Cek151jC.js";
3
+ import { Button } from "./Button-nzmDNS2q.js";
4
+ import { Label } from "./internal/components/Label.js";
5
+ import { Link } from "./internal/components/Link.js";
6
+ import { TextInput } from "./TextInput-BGed-V13.js";
7
+ import { RadioGroup } from "./RadioGroup-sIveSsNa.js";
8
+ import { Checkbox } from "./Checkbox-GJ8-srt4.js";
9
+ import { Combobox } from "./Combobox-c_xBjf0P.js";
10
+ import { Textarea } from "./internal/blocks/Textarea.js";
11
+ import { DateInput } from "./DateInput-CMD3dY-T.js";
12
+ import { NumberInput } from "./internal/blocks/NumberInput.js";
13
+ import { PasswordInput } from "./internal/blocks/PasswordInput.js";
14
+ import { FormGroup } from "./FormGroup-S9mPNHKH.js";
15
+ import { Alert } from "./Alert-DfZq9kGe.js";
16
+ import { CollapsiblePanel } from "./internal/components/CollapsiblePanel.js";
17
+ import { Tabs, TabsContent } from "./Tabs-EAihyqCt.js";
18
+ import { CodeEditor, isLanguageMode } from "./CodeEditor-BfQJfbhL.js";
19
+ import { createContext, isValidElement, use, useCallback, useEffect, useMemo, useRef, useState } from "react";
20
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
21
+ import DOMPurify from "dompurify";
22
+ import Form from "@rjsf/core";
23
+ import validator from "@rjsf/validator-ajv8";
24
+ //#region src/blocks/RjsfSchemaEditor/markdownContext.ts
25
+ /** Falls back to plain text when the host app doesn't provide a markdown renderer. */
26
+ const RenderMarkdownContext = createContext((source) => source);
27
+ const RenderMarkdownProvider = RenderMarkdownContext;
28
+ const useRenderMarkdown = () => use(RenderMarkdownContext);
29
+ //#endregion
30
+ //#region src/blocks/RjsfSchemaEditor/widgets/CodeEditorWidget.tsx
31
+ const isValidJson = (raw) => {
32
+ try {
33
+ const parsed = JSON.parse(raw);
34
+ return Boolean(parsed && typeof parsed === "object");
35
+ } catch {
36
+ return false;
37
+ }
62
38
  };
63
- var CodeEditorWidget = ({
64
- id,
65
- value,
66
- onChange,
67
- disabled,
68
- readonly,
69
- options
70
- }) => {
71
- const editorOptions = options.editor ?? {};
72
- const rawMode = editorOptions.mode ?? "application/json";
73
- const mode = isLanguageMode(rawMode) ? rawMode : "application/json";
74
- const isJsonMode = mode === "application/json";
75
- const isReadOnly = disabled || readonly || !!editorOptions.readOnly;
76
- const [text, setText] = useState(() => sanitize(value));
77
- useEffect(() => {
78
- setText((currentText) => {
79
- const sanitized = sanitize(value);
80
- if (currentText === sanitized) return currentText;
81
- if (isJsonMode && isValidJson(currentText)) {
82
- try {
83
- if (JSON.stringify(JSON.parse(currentText)) === JSON.stringify(typeof value === "object" ? value : JSON.parse(sanitized))) {
84
- return currentText;
85
- }
86
- } catch {
87
- }
88
- }
89
- return sanitized;
90
- });
91
- }, [value, isJsonMode]);
92
- const handleChange = (raw) => {
93
- setText(raw);
94
- if (isJsonMode && isValidJson(raw)) {
95
- onChange(JSON.parse(raw));
96
- } else {
97
- onChange(raw);
98
- }
99
- };
100
- const help = isJsonMode && !isReadOnly && options.encryptionHint !== false ? /* @__PURE__ */ jsxs(Fragment, { children: [
101
- "Properties prefixed with ",
102
- /* @__PURE__ */ jsx("code", { children: "#" }),
103
- " sign will be encrypted on save. Already encrypted strings will persist."
104
- ] }) : null;
105
- return /* @__PURE__ */ jsx("div", { id, children: isReadOnly ? /* @__PURE__ */ jsx(
106
- CodeEditor,
107
- {
108
- variant: "field",
109
- value: text,
110
- mode,
111
- readOnly: true,
112
- withCopyButton: true,
113
- withLineNumbers: editorOptions.lineNumbers !== false
114
- }
115
- ) : /* @__PURE__ */ jsx(
116
- CodeEditor,
117
- {
118
- variant: "field",
119
- value: text,
120
- mode,
121
- onChange: handleChange,
122
- withCopyButton: true,
123
- withLineNumbers: editorOptions.lineNumbers !== false,
124
- help
125
- }
126
- ) });
39
+ const sanitize = (val) => {
40
+ if (typeof val === "object" && val !== null) return JSON.stringify(val, null, " ");
41
+ return String(val ?? "");
127
42
  };
128
- var CodeEditorField = ({
129
- fieldPathId,
130
- formData,
131
- onChange,
132
- disabled,
133
- readonly,
134
- uiSchema
135
- }) => {
136
- const uiOptions = uiSchema?.["ui:options"];
137
- return /* @__PURE__ */ jsx(
138
- CodeEditorWidget,
139
- {
140
- id: fieldPathId.$id,
141
- value: formData,
142
- onChange: (val) => onChange(val, fieldPathId.path),
143
- disabled: !!disabled,
144
- readonly: !!readonly,
145
- options: uiOptions ?? {}
146
- }
147
- );
43
+ const CodeEditorWidget = ({ id, value, onChange, disabled, readonly, options }) => {
44
+ const editorOptions = options.editor ?? {};
45
+ const rawMode = editorOptions.mode ?? "application/json";
46
+ const mode = isLanguageMode(rawMode) ? rawMode : "application/json";
47
+ const isJsonMode = mode === "application/json";
48
+ const isReadOnly = disabled || readonly || !!editorOptions.readOnly;
49
+ const [text, setText] = useState(() => sanitize(value));
50
+ useEffect(() => {
51
+ setText((currentText) => {
52
+ const sanitized = sanitize(value);
53
+ if (currentText === sanitized) return currentText;
54
+ if (isJsonMode && isValidJson(currentText)) try {
55
+ if (JSON.stringify(JSON.parse(currentText)) === JSON.stringify(typeof value === "object" ? value : JSON.parse(sanitized))) return currentText;
56
+ } catch {}
57
+ return sanitized;
58
+ });
59
+ }, [value, isJsonMode]);
60
+ const handleChange = (raw) => {
61
+ setText(raw);
62
+ if (isJsonMode && isValidJson(raw)) onChange(JSON.parse(raw));
63
+ else onChange(raw);
64
+ };
65
+ const help = isJsonMode && !isReadOnly && options.encryptionHint !== false ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
66
+ "Properties prefixed with ",
67
+ /* @__PURE__ */ jsx("code", { children: "#" }),
68
+ " sign will be encrypted on save. Already encrypted strings will persist."
69
+ ] }) : null;
70
+ return /* @__PURE__ */ jsx("div", {
71
+ id,
72
+ children: isReadOnly ? /* @__PURE__ */ jsx(CodeEditor, {
73
+ variant: "field",
74
+ value: text,
75
+ mode,
76
+ readOnly: true,
77
+ withCopyButton: true,
78
+ withLineNumbers: editorOptions.lineNumbers !== false
79
+ }) : /* @__PURE__ */ jsx(CodeEditor, {
80
+ variant: "field",
81
+ value: text,
82
+ mode,
83
+ onChange: handleChange,
84
+ withCopyButton: true,
85
+ withLineNumbers: editorOptions.lineNumbers !== false,
86
+ help
87
+ })
88
+ });
148
89
  };
149
-
150
- // src/blocks/RjsfSchemaEditor/fieldHelpers.ts
151
- var noop = () => {
90
+ //#endregion
91
+ //#region src/blocks/RjsfSchemaEditor/fields/CodeEditorField.tsx
92
+ /**
93
+ * Field wrapper for CodeEditorWidget when used with type: "object".
94
+ * RJSF only applies ui:widget to primitive types, so object-typed
95
+ * code editors need a custom field that delegates to the widget.
96
+ */
97
+ const CodeEditorField = ({ fieldPathId, formData, onChange, disabled, readonly, uiSchema }) => {
98
+ const uiOptions = uiSchema?.["ui:options"];
99
+ return /* @__PURE__ */ jsx(CodeEditorWidget, {
100
+ id: fieldPathId.$id,
101
+ value: formData,
102
+ onChange: (val) => onChange(val, fieldPathId.path),
103
+ disabled: !!disabled,
104
+ readonly: !!readonly,
105
+ options: uiOptions ?? {}
106
+ });
152
107
  };
153
- var NullField = () => null;
154
- var getSchemaField = (registry) => registry.fields.SchemaField ?? NullField;
155
- var SCHEMA_FIELD_STUBS = {
156
- onBlur: noop,
157
- onFocus: noop,
158
- errorSchema: {}
108
+ //#endregion
109
+ //#region src/blocks/RjsfSchemaEditor/fieldHelpers.ts
110
+ /** No-op function reused as onBlur/onFocus stub in custom fields. */
111
+ const noop = () => {};
112
+ const NullField = () => null;
113
+ /** RJSF always registers SchemaField; the fallback only satisfies the indexed-access type. */
114
+ const getSchemaField = (registry) => registry.fields.SchemaField ?? NullField;
115
+ /** Stub props shared by all custom SchemaField call-sites (onBlur, onFocus, errorSchema). */
116
+ const SCHEMA_FIELD_STUBS = {
117
+ onBlur: noop,
118
+ onFocus: noop,
119
+ errorSchema: {}
159
120
  };
160
- var resolveByPath = (path, data) => {
161
- const parts = path.split(".");
162
- const walk = (segments) => {
163
- let current = data;
164
- for (const part of segments) {
165
- if (current == null || typeof current !== "object") return void 0;
166
- current = current[part];
167
- }
168
- return current;
169
- };
170
- const result = walk(parts);
171
- const [first] = parts;
172
- if (result !== void 0 || first === void 0 || parts.length <= 1) return result;
173
- if (!(first in data)) return walk(parts.slice(1));
174
- return result;
121
+ /**
122
+ * Resolves a dot-path against an object (e.g. "_metadata_.table.columns").
123
+ *
124
+ * json-editor watch paths may be prefixed with the schema `id` (e.g.
125
+ * "rootschema.endpoints.contact"). The prefix is not a real data key — it
126
+ * identifies the schema root. When the first segment doesn't exist in `data`
127
+ * we retry without it so components using this convention still resolve.
128
+ */
129
+ const resolveByPath = (path, data) => {
130
+ const parts = path.split(".");
131
+ const walk = (segments) => {
132
+ let current = data;
133
+ for (const part of segments) {
134
+ if (current == null || typeof current !== "object") return void 0;
135
+ current = current[part];
136
+ }
137
+ return current;
138
+ };
139
+ const result = walk(parts);
140
+ const [first] = parts;
141
+ if (result !== void 0 || first === void 0 || parts.length <= 1) return result;
142
+ if (!(first in data)) return walk(parts.slice(1));
143
+ return result;
175
144
  };
176
- var isHiddenTemplateWatch = (uiSchema) => {
177
- if (uiSchema?.["ui:widget"] !== "template-watch") return false;
178
- return !!uiSchema["ui:options"]?.hidden;
145
+ /**
146
+ * Whether a `template-watch` field is the invisible computed-helper variant.
147
+ *
148
+ * - `template-watch` replaces `ui:widget: 'hidden'`, so `ui:options.hidden` carries the schema's
149
+ * `options.hidden` instead.
150
+ * - The field stays mounted either way; only its wrapper is hidden.
151
+ */
152
+ const isHiddenTemplateWatch = (uiSchema) => {
153
+ if (uiSchema?.["ui:widget"] !== "template-watch") return false;
154
+ return !!uiSchema["ui:options"]?.hidden;
179
155
  };
180
- var extractProperty = (template) => {
181
- const match = /\{\{item\.(\w+)\}\}/.exec(template);
182
- return match?.[1] ?? "";
156
+ /**
157
+ * Extracts a property name from a simple Mustache-like template.
158
+ * e.g. "{{item.field_name}}" → "field_name"
159
+ */
160
+ const extractProperty = (template) => {
161
+ return /\{\{item\.(\w+)\}\}/.exec(template)?.[1] ?? "";
183
162
  };
184
- var buildDynamicOptions = (watch, enumSource, rootFormData) => {
185
- if (typeof enumSource === "string") {
186
- const watchPath = watch[enumSource];
187
- if (!watchPath) return [];
188
- const sourceData = resolveByPath(watchPath, rootFormData);
189
- if (!Array.isArray(sourceData)) return [];
190
- return sourceData.map((item) => {
191
- const val = String(item ?? "");
192
- return { value: val, label: val };
193
- });
194
- }
195
- if (Array.isArray(enumSource) && enumSource.length > 0) {
196
- if (enumSource.length > 1) {
197
- console.warn("[RJSF] Multiple enumSource entries are not supported, only the first is used.");
198
- }
199
- const source = enumSource[0];
200
- const watchPath = watch[source.source];
201
- if (!watchPath) return [];
202
- const sourceData = resolveByPath(watchPath, rootFormData);
203
- if (!Array.isArray(sourceData)) return [];
204
- const valueProp = extractProperty(source.value);
205
- const titleProp = extractProperty(source.title);
206
- return sourceData.filter((item) => item != null && typeof item === "object").map((item) => ({
207
- value: String(item[valueProp] ?? ""),
208
- label: String(item[titleProp] ?? item[valueProp] ?? "")
209
- }));
210
- }
211
- return [];
163
+ /**
164
+ * Builds select options from watched form data and enumSource config.
165
+ *
166
+ * Supports two json-editor enumSource formats:
167
+ * 1. String: `enumSource: "varName"` — use the watched array directly as string values
168
+ * 2. Array: `enumSource: [{ source, value, title }]` — map items through templates
169
+ */
170
+ const buildDynamicOptions = (watch, enumSource, rootFormData) => {
171
+ if (typeof enumSource === "string") {
172
+ const watchPath = watch[enumSource];
173
+ if (!watchPath) return [];
174
+ const sourceData = resolveByPath(watchPath, rootFormData);
175
+ if (!Array.isArray(sourceData)) return [];
176
+ return sourceData.map((item) => {
177
+ const val = String(item ?? "");
178
+ return {
179
+ value: val,
180
+ label: val
181
+ };
182
+ });
183
+ }
184
+ if (Array.isArray(enumSource) && enumSource.length > 0) {
185
+ if (enumSource.length > 1) console.warn("[RJSF] Multiple enumSource entries are not supported, only the first is used.");
186
+ const source = enumSource[0];
187
+ const watchPath = watch[source.source];
188
+ if (!watchPath) return [];
189
+ const sourceData = resolveByPath(watchPath, rootFormData);
190
+ if (!Array.isArray(sourceData)) return [];
191
+ const valueProp = extractProperty(source.value);
192
+ const titleProp = extractProperty(source.title);
193
+ return sourceData.filter((item) => item != null && typeof item === "object").map((item) => ({
194
+ value: String(item[valueProp] ?? ""),
195
+ label: String(item[titleProp] ?? item[valueProp] ?? "")
196
+ }));
197
+ }
198
+ return [];
212
199
  };
213
- var childFieldPathId = (parentFieldPathId, ...segments) => ({
214
- $id: [parentFieldPathId?.$id ?? "root", ...segments].join("_"),
215
- path: [...parentFieldPathId?.path ?? [], ...segments]
200
+ /**
201
+ * Builds a child `fieldPathId` for a nested SchemaField.
202
+ * Joins segments with "_" for the $id and appends them to the path array.
203
+ */
204
+ const childFieldPathId = (parentFieldPathId, ...segments) => ({
205
+ $id: [parentFieldPathId?.$id ?? "root", ...segments].join("_"),
206
+ path: [...parentFieldPathId?.path ?? [], ...segments]
216
207
  });
217
- var sortByPropertyOrder = (properties) => Object.entries(properties).sort(
218
- ([, a], [, b]) => (a.propertyOrder ?? Number.MAX_SAFE_INTEGER) - (b.propertyOrder ?? Number.MAX_SAFE_INTEGER)
219
- ).map(([key]) => key);
220
- var SchemaDescription = ({ description }) => {
221
- if (!description) return null;
222
- return /* @__PURE__ */ jsx(
223
- "p",
224
- {
225
- className: "tw:text-xs tw:text-neutral-400",
226
- dangerouslySetInnerHTML: { __html: DOMPurify.sanitize(description) }
227
- }
228
- );
208
+ /**
209
+ * Sorts object entries by `propertyOrder`, falling back to MAX_SAFE_INTEGER
210
+ * for properties without an explicit order.
211
+ */
212
+ const sortByPropertyOrder = (properties) => Object.entries(properties).sort(([, a], [, b]) => (a.propertyOrder ?? Number.MAX_SAFE_INTEGER) - (b.propertyOrder ?? Number.MAX_SAFE_INTEGER)).map(([key]) => key);
213
+ //#endregion
214
+ //#region src/blocks/RjsfSchemaEditor/SchemaDescription.tsx
215
+ /** Renders a schema description with sanitized HTML support (links, formatting, etc.). */
216
+ const SchemaDescription = ({ description }) => {
217
+ if (!description) return null;
218
+ return /* @__PURE__ */ jsx("p", {
219
+ className: "tw:text-xs tw:text-neutral-400",
220
+ dangerouslySetInnerHTML: { __html: DOMPurify.sanitize(description) }
221
+ });
229
222
  };
230
- var GridObjectField = ({
231
- schema,
232
- uiSchema = {},
233
- formData,
234
- onChange,
235
- disabled,
236
- readonly,
237
- registry,
238
- fieldPathId
239
- }) => {
240
- const properties = schema.properties ?? {};
241
- const data = formData ?? {};
242
- const SchemaField = getSchemaField(registry);
243
- const dataRef = useRef(data);
244
- dataRef.current = data;
245
- const fieldPath = fieldPathId?.path;
246
- const onPropertyChange = useCallback(
247
- // oxlint-disable-next-line @typescript-eslint/no-explicit-any
248
- (key) => (value, _childPath, errorSchema, id) => {
249
- onChange({ ...dataRef.current, [key]: value }, fieldPath, errorSchema, id);
250
- },
251
- [onChange, fieldPath]
252
- );
253
- const uiOptions = uiSchema["ui:options"];
254
- const hasCollapsed = uiOptions?.collapsed !== void 0;
255
- const collapsed = !!uiOptions?.collapsed;
256
- const disableCollapse = !!uiOptions?.disableCollapse;
257
- const sortedKeys = sortByPropertyOrder(properties);
258
- if (sortedKeys.length === 0) return null;
259
- const gridContent = /* @__PURE__ */ jsx("div", { className: "tw:grid tw:grid-cols-12 tw:gap-4 tw:[&>div:empty]:hidden", children: sortedKeys.map((key) => {
260
- const gridCols = properties[key]?.options?.grid_columns ?? 12;
261
- const gridBreak = !!properties[key]?.options?.grid_break;
262
- return /* @__PURE__ */ jsx(
263
- "div",
264
- {
265
- style: {
266
- gridColumn: gridBreak ? "1 / -1" : `span ${Math.min(gridCols, 12)}`
267
- },
268
- children: /* @__PURE__ */ jsx(
269
- SchemaField,
270
- {
271
- name: key,
272
- schema: schema.properties[key],
273
- uiSchema: uiSchema[key] ?? {},
274
- formData: data[key],
275
- ...SCHEMA_FIELD_STUBS,
276
- fieldPathId: childFieldPathId(fieldPathId, key),
277
- registry,
278
- onChange: onPropertyChange(key),
279
- disabled: !!disabled,
280
- readonly: !!readonly
281
- }
282
- )
283
- },
284
- key
285
- );
286
- }) });
287
- if (hasCollapsed && !disableCollapse) {
288
- const hasValues = Object.values(data).some(
289
- (v) => v !== void 0 && v !== null && v !== "" && v !== false
290
- );
291
- const defaultExpanded = hasValues ? !collapsed : true;
292
- return /* @__PURE__ */ jsxs(
293
- CollapsiblePanel,
294
- {
295
- className: "tw:rounded-lg",
296
- header: schema.title || "Settings",
297
- defaultExpanded,
298
- headerClassName: "tw:rounded-lg",
299
- bodyClassName: "tw:flex tw:flex-col tw:gap-4",
300
- children: [
301
- /* @__PURE__ */ jsx(SchemaDescription, { description: schema.description }),
302
- gridContent
303
- ]
304
- }
305
- );
306
- }
307
- if (schema.title) {
308
- return /* @__PURE__ */ jsxs("div", { className: "tw:rounded-lg tw:border tw:border-solid tw:border-neutral-200 tw:p-4", children: [
309
- /* @__PURE__ */ jsx("h3", { className: "tw:mb-3 tw:text-base tw:font-medium tw:text-neutral-800", children: schema.title }),
310
- /* @__PURE__ */ jsx(SchemaDescription, { description: schema.description }),
311
- gridContent
312
- ] });
313
- }
314
- return /* @__PURE__ */ jsxs("div", { className: "tw:flex tw:flex-col tw:gap-4", children: [
315
- /* @__PURE__ */ jsx(SchemaDescription, { description: schema.description }),
316
- gridContent
317
- ] });
223
+ //#endregion
224
+ //#region src/blocks/RjsfSchemaEditor/fields/GridObjectField.tsx
225
+ /**
226
+ * Custom field that renders an object's properties in a responsive grid layout.
227
+ * Used for schema objects with `format: "grid"` or `"grid-strict"`.
228
+ * json-editor uses a 12-column grid; each property can specify `options.grid_columns`.
229
+ * Supports `options.collapsed` for collapsible sections.
230
+ */
231
+ const GridObjectField = ({ schema, uiSchema = {}, formData, onChange, disabled, readonly, registry, fieldPathId }) => {
232
+ const properties = schema.properties ?? {};
233
+ const data = formData ?? {};
234
+ const SchemaField = getSchemaField(registry);
235
+ const dataRef = useRef(data);
236
+ dataRef.current = data;
237
+ const fieldPath = fieldPathId?.path;
238
+ const onPropertyChange = useCallback((key) => (value, _childPath, errorSchema, id) => {
239
+ onChange({
240
+ ...dataRef.current,
241
+ [key]: value
242
+ }, fieldPath, errorSchema, id);
243
+ }, [onChange, fieldPath]);
244
+ const uiOptions = uiSchema["ui:options"];
245
+ const hasCollapsed = uiOptions?.collapsed !== void 0;
246
+ const collapsed = !!uiOptions?.collapsed;
247
+ const disableCollapse = !!uiOptions?.disableCollapse;
248
+ const sortedKeys = sortByPropertyOrder(properties);
249
+ if (sortedKeys.length === 0) return null;
250
+ const gridContent = /* @__PURE__ */ jsx("div", {
251
+ className: "tw:grid tw:grid-cols-12 tw:gap-4 tw:[&>div:empty]:hidden",
252
+ children: sortedKeys.map((key) => {
253
+ const gridCols = properties[key]?.options?.grid_columns ?? 12;
254
+ const gridBreak = !!properties[key]?.options?.grid_break;
255
+ return /* @__PURE__ */ jsx("div", {
256
+ style: { gridColumn: gridBreak ? "1 / -1" : `span ${Math.min(gridCols, 12)}` },
257
+ children: /* @__PURE__ */ jsx(SchemaField, {
258
+ name: key,
259
+ schema: schema.properties[key],
260
+ uiSchema: uiSchema[key] ?? {},
261
+ formData: data[key],
262
+ ...SCHEMA_FIELD_STUBS,
263
+ fieldPathId: childFieldPathId(fieldPathId, key),
264
+ registry,
265
+ onChange: onPropertyChange(key),
266
+ disabled: !!disabled,
267
+ readonly: !!readonly
268
+ })
269
+ }, key);
270
+ })
271
+ });
272
+ if (hasCollapsed && !disableCollapse) {
273
+ const defaultExpanded = Object.values(data).some((v) => v !== void 0 && v !== null && v !== "" && v !== false) ? !collapsed : true;
274
+ return /* @__PURE__ */ jsxs(CollapsiblePanel, {
275
+ className: "tw:rounded-lg",
276
+ header: schema.title || "Settings",
277
+ defaultExpanded,
278
+ headerClassName: "tw:rounded-lg",
279
+ bodyClassName: "tw:flex tw:flex-col tw:gap-4",
280
+ children: [/* @__PURE__ */ jsx(SchemaDescription, { description: schema.description }), gridContent]
281
+ });
282
+ }
283
+ if (schema.title) return /* @__PURE__ */ jsxs("div", {
284
+ className: "tw:rounded-lg tw:border tw:border-solid tw:border-neutral-200 tw:p-4",
285
+ children: [
286
+ /* @__PURE__ */ jsx("h3", {
287
+ className: "tw:mb-3 tw:text-base tw:font-medium tw:text-neutral-800",
288
+ children: schema.title
289
+ }),
290
+ /* @__PURE__ */ jsx(SchemaDescription, { description: schema.description }),
291
+ gridContent
292
+ ]
293
+ });
294
+ return /* @__PURE__ */ jsxs("div", {
295
+ className: "tw:flex tw:flex-col tw:gap-4",
296
+ children: [/* @__PURE__ */ jsx(SchemaDescription, { description: schema.description }), gridContent]
297
+ });
318
298
  };
319
- var VALID_ALERT_TYPES = /* @__PURE__ */ new Set(["info", "warning", "error", "success"]);
320
- var InfoField = ({ schema, uiSchema }) => {
321
- if (!schema.title && !schema.description) return null;
322
- const uiOptions = uiSchema?.["ui:options"];
323
- const alertType = String(uiOptions?.alertType ?? "info");
324
- const variant = VALID_ALERT_TYPES.has(alertType) ? alertType : "info";
325
- return /* @__PURE__ */ jsx("div", { className: "tw:my-3", children: /* @__PURE__ */ jsx(Alert, { variant, title: schema.title, children: schema.description }) });
299
+ //#endregion
300
+ //#region src/blocks/RjsfSchemaEditor/fields/InfoField.tsx
301
+ const VALID_ALERT_TYPES = /* @__PURE__ */ new Set([
302
+ "info",
303
+ "warning",
304
+ "error",
305
+ "success"
306
+ ]);
307
+ /**
308
+ * Custom field that renders static informational text.
309
+ * Used for schema properties with `format: "info"`.
310
+ * Displays title and description as a read-only alert.
311
+ * Supports `options.alert_type` to control the alert variant
312
+ * (`"info"` (default), `"warning"`, `"error"`, `"success"`).
313
+ */
314
+ const InfoField = ({ schema, uiSchema }) => {
315
+ if (!schema.title && !schema.description) return null;
316
+ const uiOptions = uiSchema?.["ui:options"];
317
+ const alertType = String(uiOptions?.alertType ?? "info");
318
+ const variant = VALID_ALERT_TYPES.has(alertType) ? alertType : "info";
319
+ return /* @__PURE__ */ jsx("div", {
320
+ className: "tw:my-3",
321
+ children: /* @__PURE__ */ jsx(Alert, {
322
+ variant,
323
+ title: schema.title,
324
+ children: schema.description
325
+ })
326
+ });
326
327
  };
327
- var TooltipIcon = ({ rawHelp }) => {
328
- const renderMarkdown = useRenderMarkdown();
329
- return /* @__PURE__ */ jsx(Tooltip, { placement: "top", variant: "explanatory", tooltip: renderMarkdown(rawHelp), triggerAsChild: true, children: /* @__PURE__ */ jsx("span", { className: "tw:cursor-help tw:text-neutral-400", children: /* @__PURE__ */ jsx(Info, { className: "tw:size-4" }) }) });
328
+ //#endregion
329
+ //#region src/blocks/RjsfSchemaEditor/TooltipIcon.tsx
330
+ const TooltipIcon = ({ rawHelp }) => {
331
+ const renderMarkdown = useRenderMarkdown();
332
+ return /* @__PURE__ */ jsx(Tooltip, {
333
+ placement: "top",
334
+ variant: "explanatory",
335
+ tooltip: renderMarkdown(rawHelp),
336
+ triggerAsChild: true,
337
+ children: /* @__PURE__ */ jsx("span", {
338
+ className: "tw:cursor-help tw:text-neutral-400",
339
+ children: /* @__PURE__ */ jsx(Info, { className: "tw:size-4" })
340
+ })
341
+ });
330
342
  };
331
- var defaultValueFor = (prop) => {
332
- if (prop.default !== void 0) return prop.default;
333
- if (prop.type === "boolean") return false;
334
- if (prop.type === "string") return "";
335
- return void 0;
343
+ //#endregion
344
+ //#region src/blocks/RjsfSchemaEditor/fields/TableArrayField.tsx
345
+ /** Default value for a freshly added cell/item, honouring the schema default. */
346
+ const defaultValueFor = (prop) => {
347
+ if (prop.default !== void 0) return prop.default;
348
+ if (prop.type === "boolean") return false;
349
+ if (prop.type === "string") return "";
336
350
  };
337
- var TableArrayField = ({
338
- schema,
339
- uiSchema = {},
340
- formData,
341
- onChange,
342
- disabled,
343
- readonly,
344
- registry,
345
- fieldPathId
346
- }) => {
347
- const items = formData ?? [];
348
- const itemSchema = schema.items;
349
- const properties = itemSchema?.properties ?? {};
350
- const itemUiSchema = uiSchema.items ?? {};
351
- const SchemaField = getSchemaField(registry);
352
- const sortedKeys = sortByPropertyOrder(properties);
353
- const isPrimitiveItems = sortedKeys.length === 0 && itemSchema != null;
354
- const isReadOnly = disabled || readonly;
355
- const fieldPath = fieldPathId?.path ?? [];
356
- const itemsRef = useRef(items);
357
- itemsRef.current = items;
358
- const handleCellChange = (rowIndex, key, value) => {
359
- const newItems = [...itemsRef.current];
360
- newItems[rowIndex] = { ...newItems[rowIndex], [key]: value };
361
- onChange(newItems, fieldPath);
362
- };
363
- const handleItemChange = (rowIndex, value) => {
364
- const newItems = [...itemsRef.current];
365
- newItems[rowIndex] = value;
366
- onChange(newItems, fieldPath);
367
- };
368
- const handleRemoveRow = (rowIndex) => {
369
- onChange(
370
- itemsRef.current.filter((_, i) => i !== rowIndex),
371
- fieldPath
372
- );
373
- };
374
- const handleAddRow = () => {
375
- if (isPrimitiveItems) {
376
- onChange(
377
- [
378
- ...itemsRef.current,
379
- defaultValueFor({
380
- type: itemSchema?.type,
381
- default: itemSchema?.default
382
- })
383
- ],
384
- fieldPath
385
- );
386
- return;
387
- }
388
- const newItem = {};
389
- for (const key of sortedKeys) {
390
- newItem[key] = defaultValueFor(properties[key] ?? {});
391
- }
392
- onChange([...itemsRef.current, newItem], fieldPath);
393
- };
394
- const withHiddenLabel = (base) => ({
395
- ...base,
396
- "ui:options": {
397
- ...base["ui:options"],
398
- label: false
399
- }
400
- });
401
- const getCellUiSchema = (key) => withHiddenLabel(itemUiSchema[key] ?? {});
402
- const table = items.length > 0 && /* @__PURE__ */ jsxs("table", { className: "tw:w-full tw:table-fixed tw:border-collapse tw:text-sm", children: [
403
- /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
404
- isPrimitiveItems ? /* @__PURE__ */ jsx("th", { className: "tw:border-b tw:border-neutral-200 tw:p-2 tw:text-left tw:text-xs tw:font-medium tw:text-neutral-600", children: itemSchema?.title ?? "" }) : sortedKeys.map((key) => /* @__PURE__ */ jsx(
405
- "th",
406
- {
407
- className: "tw:border-b tw:border-neutral-200 tw:p-2 tw:text-left tw:text-xs tw:font-medium tw:text-neutral-600",
408
- children: properties[key]?.title ?? key
409
- },
410
- key
411
- )),
412
- !isReadOnly && /* @__PURE__ */ jsx("th", { className: "tw:w-20" })
413
- ] }) }),
414
- /* @__PURE__ */ jsx("tbody", { children: items.map((item, rowIndex) => /* @__PURE__ */ jsxs("tr", { className: "tw:border-b tw:border-neutral-100", children: [
415
- isPrimitiveItems ? /* @__PURE__ */ jsx("td", { className: "tw:px-2 tw:py-1.5 tw:[&>div]:mb-0", children: /* @__PURE__ */ jsx(
416
- SchemaField,
417
- {
418
- name: String(rowIndex),
419
- schema: itemSchema,
420
- uiSchema: withHiddenLabel(itemUiSchema),
421
- formData: item,
422
- ...SCHEMA_FIELD_STUBS,
423
- fieldPathId: childFieldPathId(fieldPathId, rowIndex),
424
- registry,
425
- onChange: (val) => handleItemChange(rowIndex, val),
426
- disabled: !!disabled,
427
- readonly: !!readonly
428
- }
429
- ) }) : sortedKeys.map((key) => /* @__PURE__ */ jsx("td", { className: "tw:px-2 tw:py-1.5 tw:[&>div]:mb-0", children: /* @__PURE__ */ jsx(
430
- SchemaField,
431
- {
432
- name: key,
433
- schema: properties[key],
434
- uiSchema: getCellUiSchema(key),
435
- formData: item[key],
436
- ...SCHEMA_FIELD_STUBS,
437
- fieldPathId: childFieldPathId(fieldPathId, rowIndex, key),
438
- registry,
439
- onChange: (val) => handleCellChange(rowIndex, key, val),
440
- disabled: !!disabled,
441
- readonly: !!readonly
442
- }
443
- ) }, key)),
444
- !isReadOnly && /* @__PURE__ */ jsx("td", { className: "tw:px-2 tw:py-1.5 tw:text-right", children: /* @__PURE__ */ jsx(
445
- Button,
446
- {
447
- variant: "invisible",
448
- size: "icon",
449
- onClick: () => handleRemoveRow(rowIndex),
450
- "aria-label": "Remove row",
451
- children: /* @__PURE__ */ jsx(Trash2, { className: "tw:size-4" })
452
- }
453
- ) })
454
- ] }, rowIndex)) })
455
- ] });
456
- const addButton = !isReadOnly && /* @__PURE__ */ jsxs(Button, { variant: "outline", onClick: handleAddRow, children: [
457
- "Add ",
458
- itemSchema?.title || "Item"
459
- ] });
460
- if (schema.title) {
461
- const tooltip = uiSchema["ui:help"];
462
- return /* @__PURE__ */ jsxs(
463
- CollapsiblePanel,
464
- {
465
- className: "tw:rounded-lg",
466
- headerClassName: "tw:rounded-lg",
467
- header: /* @__PURE__ */ jsxs("span", { className: "tw:inline-flex tw:items-center tw:gap-1", children: [
468
- schema.title,
469
- tooltip && /* @__PURE__ */ jsx(TooltipIcon, { rawHelp: tooltip })
470
- ] }),
471
- defaultExpanded: true,
472
- bodyClassName: "tw:flex tw:flex-col tw:gap-4",
473
- children: [
474
- /* @__PURE__ */ jsx(SchemaDescription, { description: schema.description }),
475
- table,
476
- addButton
477
- ]
478
- }
479
- );
480
- }
481
- return /* @__PURE__ */ jsxs("div", { className: "tw:flex tw:flex-col tw:gap-4", children: [
482
- /* @__PURE__ */ jsx(SchemaDescription, { description: schema.description }),
483
- table,
484
- addButton
485
- ] });
351
+ /**
352
+ * Custom field that renders an array as a table.
353
+ * Used for schema arrays with `format: "table"`.
354
+ *
355
+ * - Array of objects: each item is a row, each property a column.
356
+ * - Array of primitives (e.g. `items: { type: 'string' }`): each item is a
357
+ * single-column row holding the value itself.
358
+ *
359
+ * Cells are rendered via RJSF's SchemaField so all registered widgets are used.
360
+ */
361
+ const TableArrayField = ({ schema, uiSchema = {}, formData, onChange, disabled, readonly, registry, fieldPathId }) => {
362
+ const items = formData ?? [];
363
+ const itemSchema = schema.items;
364
+ const properties = itemSchema?.properties ?? {};
365
+ const itemUiSchema = uiSchema.items ?? {};
366
+ const SchemaField = getSchemaField(registry);
367
+ const sortedKeys = sortByPropertyOrder(properties);
368
+ const isPrimitiveItems = sortedKeys.length === 0 && itemSchema != null;
369
+ const isReadOnly = disabled || readonly;
370
+ const fieldPath = fieldPathId?.path ?? [];
371
+ const itemsRef = useRef(items);
372
+ itemsRef.current = items;
373
+ const handleCellChange = (rowIndex, key, value) => {
374
+ const newItems = [...itemsRef.current];
375
+ newItems[rowIndex] = {
376
+ ...newItems[rowIndex],
377
+ [key]: value
378
+ };
379
+ onChange(newItems, fieldPath);
380
+ };
381
+ const handleItemChange = (rowIndex, value) => {
382
+ const newItems = [...itemsRef.current];
383
+ newItems[rowIndex] = value;
384
+ onChange(newItems, fieldPath);
385
+ };
386
+ const handleRemoveRow = (rowIndex) => {
387
+ onChange(itemsRef.current.filter((_, i) => i !== rowIndex), fieldPath);
388
+ };
389
+ const handleAddRow = () => {
390
+ if (isPrimitiveItems) {
391
+ onChange([...itemsRef.current, defaultValueFor({
392
+ type: itemSchema?.type,
393
+ default: itemSchema?.default
394
+ })], fieldPath);
395
+ return;
396
+ }
397
+ const newItem = {};
398
+ for (const key of sortedKeys) newItem[key] = defaultValueFor(properties[key] ?? {});
399
+ onChange([...itemsRef.current, newItem], fieldPath);
400
+ };
401
+ const withHiddenLabel = (base) => ({
402
+ ...base,
403
+ "ui:options": {
404
+ ...base["ui:options"],
405
+ label: false
406
+ }
407
+ });
408
+ const getCellUiSchema = (key) => withHiddenLabel(itemUiSchema[key] ?? {});
409
+ const table = items.length > 0 && /* @__PURE__ */ jsxs("table", {
410
+ className: "tw:w-full tw:table-fixed tw:border-collapse tw:text-sm",
411
+ children: [/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [isPrimitiveItems ? /* @__PURE__ */ jsx("th", {
412
+ className: "tw:border-b tw:border-neutral-200 tw:p-2 tw:text-left tw:text-xs tw:font-medium tw:text-neutral-600",
413
+ children: itemSchema?.title ?? ""
414
+ }) : sortedKeys.map((key) => /* @__PURE__ */ jsx("th", {
415
+ className: "tw:border-b tw:border-neutral-200 tw:p-2 tw:text-left tw:text-xs tw:font-medium tw:text-neutral-600",
416
+ children: properties[key]?.title ?? key
417
+ }, key)), !isReadOnly && /* @__PURE__ */ jsx("th", { className: "tw:w-20" })] }) }), /* @__PURE__ */ jsx("tbody", { children: items.map((item, rowIndex) => /* @__PURE__ */ jsxs("tr", {
418
+ className: "tw:border-b tw:border-neutral-100",
419
+ children: [isPrimitiveItems ? /* @__PURE__ */ jsx("td", {
420
+ className: "tw:px-2 tw:py-1.5 tw:[&>div]:mb-0",
421
+ children: /* @__PURE__ */ jsx(SchemaField, {
422
+ name: String(rowIndex),
423
+ schema: itemSchema,
424
+ uiSchema: withHiddenLabel(itemUiSchema),
425
+ formData: item,
426
+ ...SCHEMA_FIELD_STUBS,
427
+ fieldPathId: childFieldPathId(fieldPathId, rowIndex),
428
+ registry,
429
+ onChange: (val) => handleItemChange(rowIndex, val),
430
+ disabled: !!disabled,
431
+ readonly: !!readonly
432
+ })
433
+ }) : sortedKeys.map((key) => /* @__PURE__ */ jsx("td", {
434
+ className: "tw:px-2 tw:py-1.5 tw:[&>div]:mb-0",
435
+ children: /* @__PURE__ */ jsx(SchemaField, {
436
+ name: key,
437
+ schema: properties[key],
438
+ uiSchema: getCellUiSchema(key),
439
+ formData: item[key],
440
+ ...SCHEMA_FIELD_STUBS,
441
+ fieldPathId: childFieldPathId(fieldPathId, rowIndex, key),
442
+ registry,
443
+ onChange: (val) => handleCellChange(rowIndex, key, val),
444
+ disabled: !!disabled,
445
+ readonly: !!readonly
446
+ })
447
+ }, key)), !isReadOnly && /* @__PURE__ */ jsx("td", {
448
+ className: "tw:px-2 tw:py-1.5 tw:text-right",
449
+ children: /* @__PURE__ */ jsx(Button, {
450
+ variant: "invisible",
451
+ size: "icon",
452
+ onClick: () => handleRemoveRow(rowIndex),
453
+ "aria-label": "Remove row",
454
+ children: /* @__PURE__ */ jsx(Trash2, { className: "tw:size-4" })
455
+ })
456
+ })]
457
+ }, rowIndex)) })]
458
+ });
459
+ const addButton = !isReadOnly && /* @__PURE__ */ jsxs(Button, {
460
+ variant: "outline",
461
+ onClick: handleAddRow,
462
+ children: ["Add ", itemSchema?.title || "Item"]
463
+ });
464
+ if (schema.title) {
465
+ const tooltip = uiSchema["ui:help"];
466
+ return /* @__PURE__ */ jsxs(CollapsiblePanel, {
467
+ className: "tw:rounded-lg",
468
+ headerClassName: "tw:rounded-lg",
469
+ header: /* @__PURE__ */ jsxs("span", {
470
+ className: "tw:inline-flex tw:items-center tw:gap-1",
471
+ children: [schema.title, tooltip && /* @__PURE__ */ jsx(TooltipIcon, { rawHelp: tooltip })]
472
+ }),
473
+ defaultExpanded: true,
474
+ bodyClassName: "tw:flex tw:flex-col tw:gap-4",
475
+ children: [
476
+ /* @__PURE__ */ jsx(SchemaDescription, { description: schema.description }),
477
+ table,
478
+ addButton
479
+ ]
480
+ });
481
+ }
482
+ return /* @__PURE__ */ jsxs("div", {
483
+ className: "tw:flex tw:flex-col tw:gap-4",
484
+ children: [
485
+ /* @__PURE__ */ jsx(SchemaDescription, { description: schema.description }),
486
+ table,
487
+ addButton
488
+ ]
489
+ });
486
490
  };
487
- var TabsObjectField = ({
488
- schema,
489
- uiSchema = {},
490
- formData,
491
- onChange,
492
- disabled,
493
- readonly,
494
- registry,
495
- fieldPathId
496
- }) => {
497
- const properties = schema.properties ?? {};
498
- const data = formData ?? {};
499
- const SchemaField = getSchemaField(registry);
500
- const dataRef = useRef(data);
501
- dataRef.current = data;
502
- const onPropertyChange = useCallback(
503
- // oxlint-disable-next-line @typescript-eslint/no-explicit-any
504
- (key) => (value, path, errorSchema, id) => {
505
- onChange({ ...dataRef.current, [key]: value }, path, errorSchema, id);
506
- },
507
- [onChange]
508
- );
509
- const sortedKeys = sortByPropertyOrder(properties);
510
- const [activeTab, setActiveTab] = useState(sortedKeys[0] ?? "");
511
- if (sortedKeys.length === 0) return null;
512
- const triggers = sortedKeys.map((key) => ({
513
- value: key,
514
- title: properties[key]?.title ?? key
515
- }));
516
- return /* @__PURE__ */ jsxs("div", { className: "tw:flex tw:flex-col tw:gap-4", children: [
517
- schema.title && /* @__PURE__ */ jsx("h3", { className: "tw:text-base tw:font-medium tw:text-neutral-800", children: schema.title }),
518
- /* @__PURE__ */ jsx(SchemaDescription, { description: schema.description }),
519
- /* @__PURE__ */ jsx(Tabs, { triggers, value: activeTab, onValueChange: setActiveTab, compact: true, children: sortedKeys.map((key) => /* @__PURE__ */ jsx(TabsContent, { value: key, children: /* @__PURE__ */ jsx(
520
- SchemaField,
521
- {
522
- name: key,
523
- schema: schema.properties[key],
524
- uiSchema: uiSchema[key] ?? {},
525
- formData: data[key],
526
- ...SCHEMA_FIELD_STUBS,
527
- fieldPathId: childFieldPathId(fieldPathId, key),
528
- registry,
529
- onChange: onPropertyChange(key),
530
- disabled: !!disabled,
531
- readonly: !!readonly
532
- }
533
- ) }, key)) })
534
- ] });
491
+ //#endregion
492
+ //#region src/blocks/RjsfSchemaEditor/fields/TabsObjectField.tsx
493
+ /**
494
+ * Custom field that renders an object's properties as tabs.
495
+ * Used for schema objects with `format: "tabs"`, `"tabs-top"`, or `"categories"`.
496
+ * Each property becomes a tab panel.
497
+ */
498
+ const TabsObjectField = ({ schema, uiSchema = {}, formData, onChange, disabled, readonly, registry, fieldPathId }) => {
499
+ const properties = schema.properties ?? {};
500
+ const data = formData ?? {};
501
+ const SchemaField = getSchemaField(registry);
502
+ const dataRef = useRef(data);
503
+ dataRef.current = data;
504
+ const onPropertyChange = useCallback((key) => (value, path, errorSchema, id) => {
505
+ onChange({
506
+ ...dataRef.current,
507
+ [key]: value
508
+ }, path, errorSchema, id);
509
+ }, [onChange]);
510
+ const sortedKeys = sortByPropertyOrder(properties);
511
+ const [activeTab, setActiveTab] = useState(sortedKeys[0] ?? "");
512
+ if (sortedKeys.length === 0) return null;
513
+ const triggers = sortedKeys.map((key) => ({
514
+ value: key,
515
+ title: properties[key]?.title ?? key
516
+ }));
517
+ return /* @__PURE__ */ jsxs("div", {
518
+ className: "tw:flex tw:flex-col tw:gap-4",
519
+ children: [
520
+ schema.title && /* @__PURE__ */ jsx("h3", {
521
+ className: "tw:text-base tw:font-medium tw:text-neutral-800",
522
+ children: schema.title
523
+ }),
524
+ /* @__PURE__ */ jsx(SchemaDescription, { description: schema.description }),
525
+ /* @__PURE__ */ jsx(Tabs, {
526
+ triggers,
527
+ value: activeTab,
528
+ onValueChange: setActiveTab,
529
+ compact: true,
530
+ children: sortedKeys.map((key) => /* @__PURE__ */ jsx(TabsContent, {
531
+ value: key,
532
+ children: /* @__PURE__ */ jsx(SchemaField, {
533
+ name: key,
534
+ schema: schema.properties[key],
535
+ uiSchema: uiSchema[key] ?? {},
536
+ formData: data[key],
537
+ ...SCHEMA_FIELD_STUBS,
538
+ fieldPathId: childFieldPathId(fieldPathId, key),
539
+ registry,
540
+ onChange: onPropertyChange(key),
541
+ disabled: !!disabled,
542
+ readonly: !!readonly
543
+ })
544
+ }, key))
545
+ })
546
+ ]
547
+ });
535
548
  };
536
- var ArrayFieldItemTemplate = ({
537
- children,
538
- index,
539
- totalItems,
540
- schema,
541
- hasToolbar,
542
- disabled,
543
- readonly,
544
- buttonsProps
545
- }) => {
546
- const isObject = schema.type === "object";
547
- const canRemove = hasToolbar && buttonsProps.hasRemove && !disabled && !readonly;
548
- if (isObject) {
549
- const itemTitle = `${schema.title || "Item"} ${index + 1}`;
550
- const defaultExpanded = totalItems <= 1;
551
- return /* @__PURE__ */ jsx(
552
- CollapsiblePanel,
553
- {
554
- className: "tw:rounded-lg",
555
- headerClassName: "tw:rounded-lg",
556
- header: /* @__PURE__ */ jsxs("div", { className: "tw:flex tw:w-full tw:items-center tw:justify-between", children: [
557
- /* @__PURE__ */ jsx("span", { children: itemTitle }),
558
- canRemove && /* @__PURE__ */ jsx(
559
- "div",
560
- {
561
- role: "presentation",
562
- onClick: (e) => e.stopPropagation(),
563
- onKeyUp: (e) => e.stopPropagation(),
564
- children: /* @__PURE__ */ jsx(
565
- Button,
566
- {
567
- variant: "invisible",
568
- size: "icon",
569
- "aria-label": `Remove ${itemTitle}`,
570
- onClick: buttonsProps.onRemoveItem,
571
- children: /* @__PURE__ */ jsx(Trash2, { className: "tw:size-4" })
572
- }
573
- )
574
- }
575
- )
576
- ] }),
577
- defaultExpanded,
578
- children: /* @__PURE__ */ jsx("div", { className: "tw:flex tw:flex-col tw:gap-4", children })
579
- }
580
- );
581
- }
582
- return /* @__PURE__ */ jsx("div", { className: "tw:rounded-lg tw:border tw:border-solid tw:border-neutral-200 tw:bg-white tw:p-4", children: /* @__PURE__ */ jsxs("div", { className: "tw:flex tw:items-start tw:gap-3", children: [
583
- /* @__PURE__ */ jsx("div", { className: "tw:flex tw:flex-1 tw:flex-col tw:gap-4", children }),
584
- canRemove && /* @__PURE__ */ jsx(
585
- Button,
586
- {
587
- variant: "outline",
588
- size: "small",
589
- className: "tw:mt-5 tw:shrink-0",
590
- onClick: buttonsProps.onRemoveItem,
591
- children: "Delete"
592
- }
593
- )
594
- ] }) });
549
+ //#endregion
550
+ //#region src/blocks/RjsfSchemaEditor/templates/ArrayFieldItemTemplate.tsx
551
+ const ArrayFieldItemTemplate = ({ children, index, totalItems, schema, hasToolbar, disabled, readonly, buttonsProps }) => {
552
+ const isObject = schema.type === "object";
553
+ const canRemove = hasToolbar && buttonsProps.hasRemove && !disabled && !readonly;
554
+ if (isObject) {
555
+ const itemTitle = `${schema.title || "Item"} ${index + 1}`;
556
+ const defaultExpanded = totalItems <= 1;
557
+ return /* @__PURE__ */ jsx(CollapsiblePanel, {
558
+ className: "tw:rounded-lg",
559
+ headerClassName: "tw:rounded-lg",
560
+ header: /* @__PURE__ */ jsxs("div", {
561
+ className: "tw:flex tw:w-full tw:items-center tw:justify-between",
562
+ children: [/* @__PURE__ */ jsx("span", { children: itemTitle }), canRemove && /* @__PURE__ */ jsx("div", {
563
+ role: "presentation",
564
+ onClick: (e) => e.stopPropagation(),
565
+ onKeyUp: (e) => e.stopPropagation(),
566
+ children: /* @__PURE__ */ jsx(Button, {
567
+ variant: "invisible",
568
+ size: "icon",
569
+ "aria-label": `Remove ${itemTitle}`,
570
+ onClick: buttonsProps.onRemoveItem,
571
+ children: /* @__PURE__ */ jsx(Trash2, { className: "tw:size-4" })
572
+ })
573
+ })]
574
+ }),
575
+ defaultExpanded,
576
+ children: /* @__PURE__ */ jsx("div", {
577
+ className: "tw:flex tw:flex-col tw:gap-4",
578
+ children
579
+ })
580
+ });
581
+ }
582
+ return /* @__PURE__ */ jsx("div", {
583
+ className: "tw:rounded-lg tw:border tw:border-solid tw:border-neutral-200 tw:bg-white tw:p-4",
584
+ children: /* @__PURE__ */ jsxs("div", {
585
+ className: "tw:flex tw:items-start tw:gap-3",
586
+ children: [/* @__PURE__ */ jsx("div", {
587
+ className: "tw:flex tw:flex-1 tw:flex-col tw:gap-4",
588
+ children
589
+ }), canRemove && /* @__PURE__ */ jsx(Button, {
590
+ variant: "outline",
591
+ size: "small",
592
+ className: "tw:mt-5 tw:shrink-0",
593
+ onClick: buttonsProps.onRemoveItem,
594
+ children: "Delete"
595
+ })]
596
+ })
597
+ });
595
598
  };
596
- var ArrayFieldTemplate = ({
597
- items,
598
- canAdd,
599
- onAddClick,
600
- title,
601
- schema,
602
- disabled,
603
- readonly
604
- }) => {
605
- const isReadOnly = disabled || readonly;
606
- const itemLabel = typeof schema.items === "object" && schema.items !== null && !Array.isArray(schema.items) ? schema.items.title || "Item" : "Item";
607
- return /* @__PURE__ */ jsxs("div", { className: "tw:flex tw:flex-col tw:gap-4", children: [
608
- (title || schema.description) && /* @__PURE__ */ jsxs("div", { children: [
609
- title && /* @__PURE__ */ jsx("h3", { className: "tw:text-base tw:font-medium tw:text-neutral-800", children: title }),
610
- schema.description && /* @__PURE__ */ jsx("p", { className: "tw:mt-1 tw:text-xs tw:text-neutral-400", children: schema.description })
611
- ] }),
612
- items,
613
- canAdd && !isReadOnly && /* @__PURE__ */ jsxs(Button, { variant: "outline", onClick: onAddClick, children: [
614
- "Add ",
615
- itemLabel
616
- ] })
617
- ] });
599
+ //#endregion
600
+ //#region src/blocks/RjsfSchemaEditor/templates/ArrayFieldTemplate.tsx
601
+ const ArrayFieldTemplate = ({ items, canAdd, onAddClick, title, schema, disabled, readonly }) => {
602
+ const isReadOnly = disabled || readonly;
603
+ const itemLabel = typeof schema.items === "object" && schema.items !== null && !Array.isArray(schema.items) ? schema.items.title || "Item" : "Item";
604
+ return /* @__PURE__ */ jsxs("div", {
605
+ className: "tw:flex tw:flex-col tw:gap-4",
606
+ children: [
607
+ (title || schema.description) && /* @__PURE__ */ jsxs("div", { children: [title && /* @__PURE__ */ jsx("h3", {
608
+ className: "tw:text-base tw:font-medium tw:text-neutral-800",
609
+ children: title
610
+ }), schema.description && /* @__PURE__ */ jsx("p", {
611
+ className: "tw:mt-1 tw:text-xs tw:text-neutral-400",
612
+ children: schema.description
613
+ })] }),
614
+ items,
615
+ canAdd && !isReadOnly && /* @__PURE__ */ jsxs(Button, {
616
+ variant: "outline",
617
+ onClick: onAddClick,
618
+ children: ["Add ", itemLabel]
619
+ })
620
+ ]
621
+ });
618
622
  };
619
- var DescriptionFieldTemplate = ({ description, id }) => {
620
- if (!description) return null;
621
- if (isValidElement(description)) {
622
- return /* @__PURE__ */ jsx("div", { id, children: description });
623
- }
624
- return /* @__PURE__ */ jsx(
625
- "p",
626
- {
627
- id,
628
- className: "tw:text-xs tw:text-neutral-400",
629
- dangerouslySetInnerHTML: { __html: DOMPurify.sanitize(String(description)) }
630
- }
631
- );
623
+ //#endregion
624
+ //#region src/blocks/RjsfSchemaEditor/templates/DescriptionFieldTemplate.tsx
625
+ /**
626
+ * Custom description template that renders HTML in schema descriptions.
627
+ * Uses DOMPurify to sanitize the HTML before rendering.
628
+ * Schema descriptions are authored by component developers and may contain
629
+ * links (<a>), formatting (<strong>, <code>, <br>), etc.
630
+ */
631
+ const DescriptionFieldTemplate = ({ description, id }) => {
632
+ if (!description) return null;
633
+ if (isValidElement(description)) return /* @__PURE__ */ jsx("div", {
634
+ id,
635
+ children: description
636
+ });
637
+ return /* @__PURE__ */ jsx("p", {
638
+ id,
639
+ className: "tw:text-xs tw:text-neutral-400",
640
+ dangerouslySetInnerHTML: { __html: DOMPurify.sanitize(String(description)) }
641
+ });
632
642
  };
633
- var ErrorListTemplate = ({ errors }) => {
634
- if (!errors.length) return null;
635
- return /* @__PURE__ */ jsx("div", { className: "tw:mb-4", children: errors.map((error) => /* @__PURE__ */ jsx("p", { className: "tw:text-xs tw:text-error-500", children: error.message }, `${error.property}:${error.message}`)) });
643
+ //#endregion
644
+ //#region src/blocks/RjsfSchemaEditor/templates/ErrorListTemplate.tsx
645
+ const ErrorListTemplate = ({ errors }) => {
646
+ if (!errors.length) return null;
647
+ return /* @__PURE__ */ jsx("div", {
648
+ className: "tw:mb-4",
649
+ children: errors.map((error) => /* @__PURE__ */ jsx("p", {
650
+ className: "tw:text-xs tw:text-error-500",
651
+ children: error.message
652
+ }, `${error.property}:${error.message}`))
653
+ });
636
654
  };
637
- var RootFormDataContext = createContext({});
638
- var RootFormDataProvider = RootFormDataContext;
639
- var useRootFormData = () => use(RootFormDataContext);
640
- var resolveByPath2 = (parts, data) => {
641
- let current = data;
642
- for (const part of parts) {
643
- if (current == null || typeof current !== "object") return void 0;
644
- current = current[part];
645
- }
646
- return current;
655
+ //#endregion
656
+ //#region src/blocks/RjsfSchemaEditor/RootFormDataContext.ts
657
+ const RootFormDataContext = createContext({});
658
+ const RootFormDataProvider = RootFormDataContext;
659
+ const useRootFormData = () => use(RootFormDataContext);
660
+ //#endregion
661
+ //#region src/blocks/RjsfSchemaEditor/templates/FieldTemplate.tsx
662
+ /**
663
+ * Resolves a dot-path against an object.
664
+ */
665
+ const resolveByPath$1 = (parts, data) => {
666
+ let current = data;
667
+ for (const part of parts) {
668
+ if (current == null || typeof current !== "object") return void 0;
669
+ current = current[part];
670
+ }
671
+ return current;
647
672
  };
648
- var resolveDependencyValue = (path, formData, parentPath) => {
649
- if (path.startsWith("root.")) {
650
- return resolveByPath2(path.replace(/^root\./, "").split("."), formData);
651
- }
652
- const parent = resolveByPath2(parentPath.map(String), formData);
653
- if (parent && typeof parent === "object") {
654
- const sibling = resolveByPath2(path.split("."), parent);
655
- if (sibling !== void 0) return sibling;
656
- }
657
- return resolveByPath2(path.split("."), formData);
673
+ /**
674
+ * Resolves a dependency path against form data.
675
+ *
676
+ * - Paths starting with "root." are resolved from the root form data
677
+ * - Other paths are resolved as siblings (relative to the parent object)
678
+ */
679
+ const resolveDependencyValue = (path, formData, parentPath) => {
680
+ if (path.startsWith("root.")) return resolveByPath$1(path.replace(/^root\./, "").split("."), formData);
681
+ const parent = resolveByPath$1(parentPath.map(String), formData);
682
+ if (parent && typeof parent === "object") {
683
+ const sibling = resolveByPath$1(path.split("."), parent);
684
+ if (sibling !== void 0) return sibling;
685
+ }
686
+ return resolveByPath$1(path.split("."), formData);
658
687
  };
659
- var evaluateDependencies = (dependencies, formData, parentPath) => {
660
- for (const [path, expected] of Object.entries(dependencies)) {
661
- const actual = resolveDependencyValue(path, formData, parentPath);
662
- if (Array.isArray(expected)) {
663
- if (!expected.includes(actual)) return false;
664
- } else if (expected === "") {
665
- if (actual !== "" && actual !== void 0 && actual !== null) return false;
666
- } else {
667
- if (actual !== expected) return false;
668
- }
669
- }
670
- return true;
688
+ /**
689
+ * Evaluates json-editor `options.dependencies` against current form data.
690
+ * Returns true if the field should be visible.
691
+ *
692
+ * Rules (matching old json-editor behavior):
693
+ * - `{ "field": "value" }` — show when field equals value
694
+ * - `{ "field": ["a", "b"] }` — show when field is one of the values
695
+ * - `{ "field": "" }` — show when field is empty/falsy
696
+ * - Multiple entries are AND-ed: all conditions must match
697
+ */
698
+ const evaluateDependencies = (dependencies, formData, parentPath) => {
699
+ for (const [path, expected] of Object.entries(dependencies)) {
700
+ const actual = resolveDependencyValue(path, formData, parentPath);
701
+ if (Array.isArray(expected)) {
702
+ if (!expected.includes(actual)) return false;
703
+ } else if (expected === "") {
704
+ if (actual !== "" && actual !== void 0 && actual !== null) return false;
705
+ } else if (actual !== expected) return false;
706
+ }
707
+ return true;
671
708
  };
672
- var DocumentationLinkIcon = ({
673
- documentation
674
- }) => /* @__PURE__ */ jsx(
675
- Tooltip,
676
- {
677
- placement: "top",
678
- variant: "explanatory",
679
- tooltip: documentation.tooltip ?? "Open documentation",
680
- triggerAsChild: true,
681
- children: /* @__PURE__ */ jsx(Link, { href: documentation.link, children: /* @__PURE__ */ jsx("span", { className: "tw:cursor-pointer tw:text-neutral-400 tw:hover:text-neutral-600", children: /* @__PURE__ */ jsx(BookOpen, { className: "tw:size-4" }) }) })
682
- }
683
- );
684
- var FieldTemplateBody = ({
685
- id,
686
- label,
687
- rawHelp,
688
- rawDescription,
689
- rawErrors,
690
- children,
691
- schema,
692
- uiSchema,
693
- displayLabel
694
- }) => {
695
- const widget = uiSchema?.["ui:widget"];
696
- if (widget === "test-connection" || widget === "sync-action") {
697
- return /* @__PURE__ */ jsx(Fragment, { children });
698
- }
699
- if (schema.type === "object") {
700
- return /* @__PURE__ */ jsx(Fragment, { children });
701
- }
702
- if (schema.type === "array" && !uiSchema?.["ui:widget"]) {
703
- return /* @__PURE__ */ jsx(Fragment, { children });
704
- }
705
- const uiOptions = uiSchema?.["ui:options"];
706
- const documentation = uiOptions?.documentation;
707
- const hasErrors = rawErrors && rawErrors.length > 0;
708
- const isCheckbox = schema.type === "boolean" && uiSchema?.["ui:widget"] !== "select";
709
- const showLabel = displayLabel && label && !isCheckbox;
710
- const hasHelpIcons = Boolean(rawHelp || documentation);
711
- const helpIcons = /* @__PURE__ */ jsxs(Fragment, { children: [
712
- rawHelp && /* @__PURE__ */ jsx(TooltipIcon, { rawHelp }),
713
- documentation && /* @__PURE__ */ jsx(DocumentationLinkIcon, { documentation })
714
- ] });
715
- return /* @__PURE__ */ jsxs(FormGroup, { state: hasErrors ? "error" : "default", children: [
716
- showLabel && /* @__PURE__ */ jsx(Label, { htmlFor: id, children: /* @__PURE__ */ jsxs("span", { className: "tw:inline-flex tw:items-center tw:gap-1", children: [
717
- label,
718
- helpIcons
719
- ] }) }),
720
- !showLabel && !isCheckbox && hasHelpIcons && /* @__PURE__ */ jsx("div", { className: "tw:flex tw:items-center tw:gap-1", children: helpIcons }),
721
- isCheckbox && hasHelpIcons ? /* @__PURE__ */ jsxs("div", { className: "tw:flex tw:items-center tw:gap-1", children: [
722
- children,
723
- helpIcons
724
- ] }) : children,
725
- rawDescription && /* @__PURE__ */ jsx(FormGroup.Help, { children: /* @__PURE__ */ jsx("span", { dangerouslySetInnerHTML: { __html: DOMPurify.sanitize(rawDescription) } }) }),
726
- hasErrors && /* @__PURE__ */ jsx(FormGroup.Help, { children: rawErrors.join(". ") })
727
- ] });
709
+ const DocumentationLinkIcon = ({ documentation }) => /* @__PURE__ */ jsx(Tooltip, {
710
+ placement: "top",
711
+ variant: "explanatory",
712
+ tooltip: documentation.tooltip ?? "Open documentation",
713
+ triggerAsChild: true,
714
+ children: /* @__PURE__ */ jsx(Link, {
715
+ href: documentation.link,
716
+ children: /* @__PURE__ */ jsx("span", {
717
+ className: "tw:cursor-pointer tw:text-neutral-400 tw:hover:text-neutral-600",
718
+ children: /* @__PURE__ */ jsx(BookOpen, { className: "tw:size-4" })
719
+ })
720
+ })
721
+ });
722
+ /**
723
+ * Renders the field's FormGroup wrapper, label, help, and errors.
724
+ * Does NOT subscribe to RootFormDataContext — that subscription only happens
725
+ * inside FieldTemplateWithDependencies, so fields without dependencies don't
726
+ * re-render on every form-state change.
727
+ */
728
+ const FieldTemplateBody = ({ id, label, rawHelp, rawDescription, rawErrors, children, schema, uiSchema, displayLabel }) => {
729
+ const widget = uiSchema?.["ui:widget"];
730
+ if (widget === "test-connection" || widget === "sync-action") return /* @__PURE__ */ jsx(Fragment$1, { children });
731
+ if (schema.type === "object") return /* @__PURE__ */ jsx(Fragment$1, { children });
732
+ if (schema.type === "array" && !uiSchema?.["ui:widget"]) return /* @__PURE__ */ jsx(Fragment$1, { children });
733
+ const documentation = (uiSchema?.["ui:options"])?.documentation;
734
+ const hasErrors = rawErrors && rawErrors.length > 0;
735
+ const isCheckbox = schema.type === "boolean" && uiSchema?.["ui:widget"] !== "select";
736
+ const showLabel = displayLabel && label && !isCheckbox;
737
+ const hasHelpIcons = Boolean(rawHelp || documentation);
738
+ const helpIcons = /* @__PURE__ */ jsxs(Fragment$1, { children: [rawHelp && /* @__PURE__ */ jsx(TooltipIcon, { rawHelp }), documentation && /* @__PURE__ */ jsx(DocumentationLinkIcon, { documentation })] });
739
+ return /* @__PURE__ */ jsxs(FormGroup, {
740
+ state: hasErrors ? "error" : "default",
741
+ children: [
742
+ showLabel && /* @__PURE__ */ jsx(Label, {
743
+ htmlFor: id,
744
+ children: /* @__PURE__ */ jsxs("span", {
745
+ className: "tw:inline-flex tw:items-center tw:gap-1",
746
+ children: [label, helpIcons]
747
+ })
748
+ }),
749
+ !showLabel && !isCheckbox && hasHelpIcons && /* @__PURE__ */ jsx("div", {
750
+ className: "tw:flex tw:items-center tw:gap-1",
751
+ children: helpIcons
752
+ }),
753
+ isCheckbox && hasHelpIcons ? /* @__PURE__ */ jsxs("div", {
754
+ className: "tw:flex tw:items-center tw:gap-1",
755
+ children: [children, helpIcons]
756
+ }) : children,
757
+ rawDescription && /* @__PURE__ */ jsx(FormGroup.Help, { children: /* @__PURE__ */ jsx("span", { dangerouslySetInnerHTML: { __html: DOMPurify.sanitize(rawDescription) } }) }),
758
+ hasErrors && /* @__PURE__ */ jsx(FormGroup.Help, { children: rawErrors.join(". ") })
759
+ ]
760
+ });
728
761
  };
729
- var FieldTemplateWithDependencies = ({
730
- dependencies,
731
- keepMounted,
732
- ...props
733
- }) => {
734
- const rootFormData = useRootFormData();
735
- const parentPath = props.fieldPathId.path.slice(0, -1);
736
- if (!evaluateDependencies(dependencies, rootFormData, parentPath)) {
737
- return keepMounted ? /* @__PURE__ */ jsx("div", { className: "tw:hidden", children: props.children }) : null;
738
- }
739
- return /* @__PURE__ */ jsx(FieldTemplateBody, { ...props });
762
+ /**
763
+ * Wraps FieldTemplateBody with a root-form-data subscription used to evaluate
764
+ * conditional visibility (options.dependencies). Subscribing here — instead of
765
+ * unconditionally in FieldTemplate — keeps fields without dependencies out of
766
+ * the RootFormDataContext consumer set, so they don't re-render on every
767
+ * keystroke. Critical for forms with many fields (e.g. column_mapping tables).
768
+ */
769
+ const FieldTemplateWithDependencies = ({ dependencies, keepMounted, ...props }) => {
770
+ const rootFormData = useRootFormData();
771
+ const parentPath = props.fieldPathId.path.slice(0, -1);
772
+ if (!evaluateDependencies(dependencies, rootFormData, parentPath)) return keepMounted ? /* @__PURE__ */ jsx("div", {
773
+ className: "tw:hidden",
774
+ children: props.children
775
+ }) : null;
776
+ return /* @__PURE__ */ jsx(FieldTemplateBody, { ...props });
740
777
  };
741
- var FieldTemplate = (props) => {
742
- if (props.hidden) return /* @__PURE__ */ jsx("div", { className: "tw:hidden", children: props.children });
743
- const uiOptions = props.uiSchema?.["ui:options"];
744
- if (isHiddenTemplateWatch(props.uiSchema)) {
745
- return /* @__PURE__ */ jsx("div", { className: "tw:hidden", children: props.children });
746
- }
747
- const dependencies = uiOptions?.dependencies;
748
- if (dependencies) {
749
- return /* @__PURE__ */ jsx(
750
- FieldTemplateWithDependencies,
751
- {
752
- dependencies,
753
- keepMounted: props.uiSchema?.["ui:widget"] === "template-watch",
754
- ...props
755
- }
756
- );
757
- }
758
- return /* @__PURE__ */ jsx(FieldTemplateBody, { ...props });
778
+ const FieldTemplate = (props) => {
779
+ if (props.hidden) return /* @__PURE__ */ jsx("div", {
780
+ className: "tw:hidden",
781
+ children: props.children
782
+ });
783
+ const uiOptions = props.uiSchema?.["ui:options"];
784
+ if (isHiddenTemplateWatch(props.uiSchema)) return /* @__PURE__ */ jsx("div", {
785
+ className: "tw:hidden",
786
+ children: props.children
787
+ });
788
+ const dependencies = uiOptions?.dependencies;
789
+ if (dependencies) return /* @__PURE__ */ jsx(FieldTemplateWithDependencies, {
790
+ dependencies,
791
+ keepMounted: props.uiSchema?.["ui:widget"] === "template-watch",
792
+ ...props
793
+ });
794
+ return /* @__PURE__ */ jsx(FieldTemplateBody, { ...props });
759
795
  };
760
- var ObjectFieldTemplate = ({
761
- title,
762
- description,
763
- properties,
764
- formData,
765
- uiSchema,
766
- schema,
767
- fieldPathId
768
- }) => {
769
- const isRoot = !fieldPathId?.path?.length;
770
- const uiOptions = uiSchema?.["ui:options"];
771
- const hasCollapsed = uiOptions?.collapsed !== void 0;
772
- const collapsed = !!uiOptions?.collapsed;
773
- const disableCollapse = !!uiOptions?.disableCollapse;
774
- const lastPathSegment = fieldPathId?.path?.at(-1);
775
- const isArrayItem = typeof lastPathSegment === "number";
776
- const childSchemas = schema.properties;
777
- const isContainerSchema = (s) => {
778
- if (!s) return false;
779
- if (s.properties || s.items) return true;
780
- if (Array.isArray(s.type)) return s.type.includes("object") || s.type.includes("array");
781
- return s.type === "object" || s.type === "array";
782
- };
783
- const visibleProperties = properties.filter((prop) => {
784
- if (uiSchema?.[prop.name]?.["ui:widget"] !== "hidden") return true;
785
- return !isContainerSchema(childSchemas?.[prop.name]);
786
- });
787
- const isHiddenMount = (name) => {
788
- const childUi = uiSchema?.[name];
789
- return childUi?.["ui:widget"] === "hidden" || isHiddenTemplateWatch(childUi);
790
- };
791
- const renderChildren = (props) => props.map((prop) => /* @__PURE__ */ jsx("div", { className: isHiddenMount(prop.name) ? "tw:hidden" : void 0, children: prop.content }, prop.name));
792
- if (isRoot) {
793
- return /* @__PURE__ */ jsx("div", { className: "tw:flex tw:flex-col tw:gap-4 tw:[&>div:empty]:hidden", children: renderChildren(visibleProperties) });
794
- }
795
- const childrenContent = renderChildren(visibleProperties);
796
- if (hasCollapsed && !disableCollapse) {
797
- const data = formData ?? {};
798
- const hasValues = Object.values(data).some(
799
- (v) => v !== void 0 && v !== null && v !== "" && v !== false
800
- );
801
- const defaultExpanded = hasValues ? !collapsed : true;
802
- return /* @__PURE__ */ jsxs(
803
- CollapsiblePanel,
804
- {
805
- className: "tw:rounded-lg",
806
- headerClassName: "tw:rounded-lg",
807
- header: title || "Settings",
808
- defaultExpanded,
809
- bodyClassName: "tw:flex tw:flex-col tw:gap-4 tw:[&>div:empty]:hidden",
810
- children: [
811
- description,
812
- childrenContent
813
- ]
814
- }
815
- );
816
- }
817
- if (isArrayItem) {
818
- return /* @__PURE__ */ jsx("div", { className: "tw:flex tw:flex-col tw:gap-4 tw:[&>div:empty]:hidden", children: childrenContent });
819
- }
820
- return /* @__PURE__ */ jsxs("div", { className: "tw:rounded-lg tw:border tw:border-solid tw:border-neutral-200 tw:bg-white tw:p-4", children: [
821
- title && /* @__PURE__ */ jsx("h3", { className: "tw:mb-2 tw:text-base tw:font-medium tw:text-neutral-800", children: title }),
822
- description && /* @__PURE__ */ jsx("p", { className: "tw:mb-3 tw:text-xs tw:text-neutral-400", children: description }),
823
- /* @__PURE__ */ jsx("div", { className: "tw:flex tw:flex-col tw:gap-4 tw:[&>div:empty]:hidden", children: childrenContent })
824
- ] });
796
+ //#endregion
797
+ //#region src/blocks/RjsfSchemaEditor/templates/ObjectFieldTemplate.tsx
798
+ const ObjectFieldTemplate = ({ title, description, properties, formData, uiSchema, schema, fieldPathId }) => {
799
+ const isRoot = !fieldPathId?.path?.length;
800
+ const uiOptions = uiSchema?.["ui:options"];
801
+ const hasCollapsed = uiOptions?.collapsed !== void 0;
802
+ const collapsed = !!uiOptions?.collapsed;
803
+ const disableCollapse = !!uiOptions?.disableCollapse;
804
+ const isArrayItem = typeof fieldPathId?.path?.at(-1) === "number";
805
+ const childSchemas = schema.properties;
806
+ const isContainerSchema = (s) => {
807
+ if (!s) return false;
808
+ if (s.properties || s.items) return true;
809
+ if (Array.isArray(s.type)) return s.type.includes("object") || s.type.includes("array");
810
+ return s.type === "object" || s.type === "array";
811
+ };
812
+ const visibleProperties = properties.filter((prop) => {
813
+ if (uiSchema?.[prop.name]?.["ui:widget"] !== "hidden") return true;
814
+ return !isContainerSchema(childSchemas?.[prop.name]);
815
+ });
816
+ const isHiddenMount = (name) => {
817
+ const childUi = uiSchema?.[name];
818
+ return childUi?.["ui:widget"] === "hidden" || isHiddenTemplateWatch(childUi);
819
+ };
820
+ const renderChildren = (props) => props.map((prop) => /* @__PURE__ */ jsx("div", {
821
+ className: isHiddenMount(prop.name) ? "tw:hidden" : void 0,
822
+ children: prop.content
823
+ }, prop.name));
824
+ if (isRoot) return /* @__PURE__ */ jsx("div", {
825
+ className: "tw:flex tw:flex-col tw:gap-4 tw:[&>div:empty]:hidden",
826
+ children: renderChildren(visibleProperties)
827
+ });
828
+ const childrenContent = renderChildren(visibleProperties);
829
+ if (hasCollapsed && !disableCollapse) {
830
+ const defaultExpanded = Object.values(formData ?? {}).some((v) => v !== void 0 && v !== null && v !== "" && v !== false) ? !collapsed : true;
831
+ return /* @__PURE__ */ jsxs(CollapsiblePanel, {
832
+ className: "tw:rounded-lg",
833
+ headerClassName: "tw:rounded-lg",
834
+ header: title || "Settings",
835
+ defaultExpanded,
836
+ bodyClassName: "tw:flex tw:flex-col tw:gap-4 tw:[&>div:empty]:hidden",
837
+ children: [description, childrenContent]
838
+ });
839
+ }
840
+ if (isArrayItem) return /* @__PURE__ */ jsx("div", {
841
+ className: "tw:flex tw:flex-col tw:gap-4 tw:[&>div:empty]:hidden",
842
+ children: childrenContent
843
+ });
844
+ return /* @__PURE__ */ jsxs("div", {
845
+ className: "tw:rounded-lg tw:border tw:border-solid tw:border-neutral-200 tw:bg-white tw:p-4",
846
+ children: [
847
+ title && /* @__PURE__ */ jsx("h3", {
848
+ className: "tw:mb-2 tw:text-base tw:font-medium tw:text-neutral-800",
849
+ children: title
850
+ }),
851
+ description && /* @__PURE__ */ jsx("p", {
852
+ className: "tw:mb-3 tw:text-xs tw:text-neutral-400",
853
+ children: description
854
+ }),
855
+ /* @__PURE__ */ jsx("div", {
856
+ className: "tw:flex tw:flex-col tw:gap-4 tw:[&>div:empty]:hidden",
857
+ children: childrenContent
858
+ })
859
+ ]
860
+ });
825
861
  };
826
- var CheckboxWidget = ({
827
- id,
828
- value,
829
- onChange,
830
- disabled,
831
- readonly,
832
- label,
833
- hideLabel
834
- }) => {
835
- const checked = !!value;
836
- return /* @__PURE__ */ jsx(Checkbox, { id, checked, onCheckedChange: onChange, disabled: disabled || readonly, children: hideLabel ? void 0 : label });
862
+ //#endregion
863
+ //#region src/blocks/RjsfSchemaEditor/widgets/CheckboxWidget.tsx
864
+ const CheckboxWidget = ({ id, value, onChange, disabled, readonly, label, hideLabel }) => {
865
+ return /* @__PURE__ */ jsx(Checkbox, {
866
+ id,
867
+ checked: !!value,
868
+ onCheckedChange: onChange,
869
+ disabled: disabled || readonly,
870
+ children: hideLabel ? void 0 : label
871
+ });
837
872
  };
838
- var DateWidget = ({
839
- id,
840
- value,
841
- onChange,
842
- onBlur,
843
- onFocus,
844
- disabled,
845
- readonly,
846
- placeholder,
847
- rawErrors
848
- }) => {
849
- const dateValue = (() => {
850
- if (!value) return null;
851
- const parts = value.split("-").map(Number);
852
- const [year, month, day] = parts;
853
- if (parts.length !== 3 || parts.some(Number.isNaN)) return null;
854
- if (year === void 0 || month === void 0 || day === void 0) return null;
855
- return new Date(year, month - 1, day);
856
- })();
857
- const isValid = dateValue && !Number.isNaN(dateValue.getTime());
858
- return /* @__PURE__ */ jsx(
859
- DateInput,
860
- {
861
- id,
862
- value: isValid ? dateValue : null,
863
- onValueChange: (date) => {
864
- if (!date) {
865
- onChange(void 0);
866
- return;
867
- }
868
- const year = date.getFullYear();
869
- const month = String(date.getMonth() + 1).padStart(2, "0");
870
- const day = String(date.getDate()).padStart(2, "0");
871
- onChange(`${year}-${month}-${day}`);
872
- },
873
- onBlur: () => onBlur(id, value),
874
- onFocus: () => onFocus(id, value),
875
- disabled: disabled || readonly,
876
- placeholder: placeholder || "Select a date",
877
- state: rawErrors?.length ? "error" : "default",
878
- variant: "secondary"
879
- }
880
- );
873
+ //#endregion
874
+ //#region src/blocks/RjsfSchemaEditor/widgets/DateWidget.tsx
875
+ const DateWidget = ({ id, value, onChange, onBlur, onFocus, disabled, readonly, placeholder, rawErrors }) => {
876
+ const dateValue = (() => {
877
+ if (!value) return null;
878
+ const parts = value.split("-").map(Number);
879
+ const [year, month, day] = parts;
880
+ if (parts.length !== 3 || parts.some(Number.isNaN)) return null;
881
+ if (year === void 0 || month === void 0 || day === void 0) return null;
882
+ return new Date(year, month - 1, day);
883
+ })();
884
+ const isValid = dateValue && !Number.isNaN(dateValue.getTime());
885
+ return /* @__PURE__ */ jsx(DateInput, {
886
+ id,
887
+ value: isValid ? dateValue : null,
888
+ onValueChange: (date) => {
889
+ if (!date) {
890
+ onChange(void 0);
891
+ return;
892
+ }
893
+ onChange(`${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, "0")}-${String(date.getDate()).padStart(2, "0")}`);
894
+ },
895
+ onBlur: () => onBlur(id, value),
896
+ onFocus: () => onFocus(id, value),
897
+ disabled: disabled || readonly,
898
+ placeholder: placeholder || "Select a date",
899
+ state: rawErrors?.length ? "error" : "default",
900
+ variant: "secondary"
901
+ });
881
902
  };
882
- var DynamicSelectWidget = ({
883
- value,
884
- onChange,
885
- disabled,
886
- readonly,
887
- options: widgetOptions
888
- }) => {
889
- const data = useRootFormData();
890
- const watch = widgetOptions.watch;
891
- const enumSource = widgetOptions.enumSource;
892
- const dynamicItems = watch ? buildDynamicOptions(watch, enumSource, data) : [];
893
- const stringValue = value == null ? "" : String(value);
894
- const matched = dynamicItems.find((item) => item.value === stringValue);
895
- const fallbackItem = !matched && stringValue !== "" ? { value: stringValue, label: stringValue } : null;
896
- const selectedItem = matched ?? fallbackItem;
897
- const items = fallbackItem ? [fallbackItem, ...dynamicItems] : dynamicItems;
898
- return /* @__PURE__ */ jsx(
899
- Combobox,
900
- {
901
- variant: "secondary",
902
- items,
903
- value: selectedItem,
904
- disabled: disabled || readonly,
905
- onValueChange: (selected) => onChange(selected?.value ?? "")
906
- }
907
- );
903
+ //#endregion
904
+ //#region src/blocks/RjsfSchemaEditor/widgets/DynamicSelectWidget.tsx
905
+ /**
906
+ * Widget for fields using json-editor's enumSource/watch pattern.
907
+ * Reads options dynamically from the root form data based on watched paths.
908
+ */
909
+ const DynamicSelectWidget = ({ value, onChange, disabled, readonly, options: widgetOptions }) => {
910
+ const data = useRootFormData();
911
+ const watch = widgetOptions.watch;
912
+ const enumSource = widgetOptions.enumSource;
913
+ const dynamicItems = watch ? buildDynamicOptions(watch, enumSource, data) : [];
914
+ const stringValue = value == null ? "" : String(value);
915
+ const matched = dynamicItems.find((item) => item.value === stringValue);
916
+ const fallbackItem = !matched && stringValue !== "" ? {
917
+ value: stringValue,
918
+ label: stringValue
919
+ } : null;
920
+ const selectedItem = matched ?? fallbackItem;
921
+ const items = fallbackItem ? [fallbackItem, ...dynamicItems] : dynamicItems;
922
+ return /* @__PURE__ */ jsx(Combobox, {
923
+ variant: "secondary",
924
+ items,
925
+ value: selectedItem,
926
+ disabled: disabled || readonly,
927
+ onValueChange: (selected) => onChange(selected?.value ?? "")
928
+ });
908
929
  };
909
- var NumberWidget = ({
910
- id,
911
- value,
912
- onChange,
913
- onBlur,
914
- onFocus,
915
- disabled,
916
- readonly,
917
- placeholder,
918
- schema,
919
- rawErrors
920
- }) => {
921
- return /* @__PURE__ */ jsx(
922
- NumberInput,
923
- {
924
- id,
925
- value: value ?? null,
926
- onValueChange: (num) => onChange(num ?? void 0),
927
- onBlur: () => onBlur(id, value),
928
- onFocus: () => onFocus(id, value),
929
- disabled: disabled || readonly,
930
- placeholder,
931
- min: schema.minimum,
932
- max: schema.maximum,
933
- step: schema.multipleOf,
934
- state: rawErrors?.length ? "error" : "default",
935
- variant: "secondary"
936
- }
937
- );
930
+ //#endregion
931
+ //#region src/blocks/RjsfSchemaEditor/widgets/NumberWidget.tsx
932
+ const NumberWidget = ({ id, value, onChange, onBlur, onFocus, disabled, readonly, placeholder, schema, rawErrors }) => {
933
+ return /* @__PURE__ */ jsx(NumberInput, {
934
+ id,
935
+ value: value ?? null,
936
+ onValueChange: (num) => onChange(num ?? void 0),
937
+ onBlur: () => onBlur(id, value),
938
+ onFocus: () => onFocus(id, value),
939
+ disabled: disabled || readonly,
940
+ placeholder,
941
+ min: schema.minimum,
942
+ max: schema.maximum,
943
+ step: schema.multipleOf,
944
+ state: rawErrors?.length ? "error" : "default",
945
+ variant: "secondary"
946
+ });
938
947
  };
939
- var PasswordWidget = ({
940
- id,
941
- value,
942
- onChange,
943
- onBlur,
944
- onFocus,
945
- disabled,
946
- readonly,
947
- placeholder,
948
- rawErrors
949
- }) => {
950
- const stringValue = value == null ? "" : String(value);
951
- return /* @__PURE__ */ jsx(
952
- PasswordInput,
953
- {
954
- id,
955
- value: stringValue,
956
- onValueChange: onChange,
957
- onBlur: () => onBlur(id, value),
958
- onFocus: () => onFocus(id, value),
959
- disabled: disabled || readonly,
960
- placeholder,
961
- allowPasswordToggle: true,
962
- state: rawErrors?.length ? "error" : "default",
963
- variant: "secondary"
964
- }
965
- );
948
+ //#endregion
949
+ //#region src/blocks/RjsfSchemaEditor/widgets/PasswordWidget.tsx
950
+ const PasswordWidget = ({ id, value, onChange, onBlur, onFocus, disabled, readonly, placeholder, rawErrors }) => {
951
+ return /* @__PURE__ */ jsx(PasswordInput, {
952
+ id,
953
+ value: value == null ? "" : String(value),
954
+ onValueChange: onChange,
955
+ onBlur: () => onBlur(id, value),
956
+ onFocus: () => onFocus(id, value),
957
+ disabled: disabled || readonly,
958
+ placeholder,
959
+ allowPasswordToggle: true,
960
+ state: rawErrors?.length ? "error" : "default",
961
+ variant: "secondary"
962
+ });
966
963
  };
967
- var RadioWidget = ({ id, value, onChange, disabled, readonly, options }) => {
968
- const enumOptions = options.enumOptions ?? [];
969
- return /* @__PURE__ */ jsx(
970
- RadioGroup,
971
- {
972
- id,
973
- value: value ?? "",
974
- onValueChange: onChange,
975
- disabled: disabled || readonly,
976
- orientation: "vertical",
977
- children: enumOptions.map((opt) => /* @__PURE__ */ jsx(RadioGroup.Item, { value: opt.value, children: opt.label }, opt.value))
978
- }
979
- );
964
+ //#endregion
965
+ //#region src/blocks/RjsfSchemaEditor/widgets/RadioWidget.tsx
966
+ const RadioWidget = ({ id, value, onChange, disabled, readonly, options }) => {
967
+ const enumOptions = options.enumOptions ?? [];
968
+ return /* @__PURE__ */ jsx(RadioGroup, {
969
+ id,
970
+ value: value ?? "",
971
+ onValueChange: onChange,
972
+ disabled: disabled || readonly,
973
+ orientation: "vertical",
974
+ children: enumOptions.map((opt) => /* @__PURE__ */ jsx(RadioGroup.Item, {
975
+ value: opt.value,
976
+ children: opt.label
977
+ }, opt.value))
978
+ });
980
979
  };
981
- var SelectWidget = ({
982
- value,
983
- schema,
984
- onChange,
985
- disabled,
986
- readonly,
987
- options,
988
- placeholder,
989
- required
990
- }) => {
991
- const enumOptions = options.enumOptions ?? [];
992
- const isBoolean = schema.type === "boolean";
993
- const items = enumOptions.map((o) => ({
994
- value: String(o.value ?? ""),
995
- label: o.label
996
- }));
997
- const selectedItem = items.find((item) => item.value === (value == null ? "" : String(value)));
998
- return /* @__PURE__ */ jsx(
999
- Combobox,
1000
- {
1001
- variant: "secondary",
1002
- items,
1003
- value: selectedItem ?? null,
1004
- allowClear: !required,
1005
- disabled: disabled || readonly,
1006
- placeholder,
1007
- onValueChange: (selected) => {
1008
- const selectedValue = selected?.value ?? "";
1009
- if (isBoolean) {
1010
- onChange(selectedValue === "true");
1011
- return;
1012
- }
1013
- onChange(selectedValue);
1014
- }
1015
- }
1016
- );
980
+ //#endregion
981
+ //#region src/blocks/RjsfSchemaEditor/widgets/SelectWidget.tsx
982
+ const SelectWidget = ({ value, schema, onChange, disabled, readonly, options, placeholder, required }) => {
983
+ const enumOptions = options.enumOptions ?? [];
984
+ const isBoolean = schema.type === "boolean";
985
+ const items = enumOptions.map((o) => ({
986
+ value: String(o.value ?? ""),
987
+ label: o.label
988
+ }));
989
+ const selectedItem = items.find((item) => item.value === (value == null ? "" : String(value)));
990
+ return /* @__PURE__ */ jsx(Combobox, {
991
+ variant: "secondary",
992
+ items,
993
+ value: selectedItem ?? null,
994
+ allowClear: !required,
995
+ disabled: disabled || readonly,
996
+ placeholder,
997
+ onValueChange: (selected) => {
998
+ const selectedValue = selected?.value ?? "";
999
+ if (isBoolean) {
1000
+ onChange(selectedValue === "true");
1001
+ return;
1002
+ }
1003
+ onChange(selectedValue);
1004
+ }
1005
+ });
1017
1006
  };
1018
- var stringify = (value) => {
1019
- if (value == null) return "";
1020
- if (typeof value === "object") return JSON.stringify(value);
1021
- return String(value);
1007
+ //#endregion
1008
+ //#region src/blocks/RjsfSchemaEditor/widgets/TemplateWatchWidget.tsx
1009
+ /**
1010
+ * Renders a watched value as text.
1011
+ *
1012
+ * - Objects and arrays are serialized as JSON; anything else goes through `String`.
1013
+ * - `null` and `undefined` render as an empty string.
1014
+ */
1015
+ const stringify = (value) => {
1016
+ if (value == null) return "";
1017
+ if (typeof value === "object") return JSON.stringify(value);
1018
+ return String(value);
1022
1019
  };
1023
- var resolveTemplate = (template, watch, rootFormData) => {
1024
- return template.replace(/\{\{(\w+)\}\}/g, (_, varName) => {
1025
- const watchPath = watch[varName];
1026
- if (!watchPath) return "";
1027
- return stringify(resolveByPath(watchPath, rootFormData));
1028
- });
1020
+ /**
1021
+ * Resolves a json-editor `template` string by substituting watched variables.
1022
+ * e.g. template="{{val}}" with watch={ val: "some.path" } → resolves "some.path" from form data.
1023
+ */
1024
+ const resolveTemplate = (template, watch, rootFormData) => {
1025
+ return template.replace(/\{\{(\w+)\}\}/g, (_, varName) => {
1026
+ const watchPath = watch[varName];
1027
+ if (!watchPath) return "";
1028
+ return stringify(resolveByPath(watchPath, rootFormData));
1029
+ });
1029
1030
  };
1030
- var TemplateWatchWidget = ({
1031
- id,
1032
- value,
1033
- onChange,
1034
- disabled,
1035
- readonly,
1036
- rawErrors,
1037
- options: widgetOptions
1038
- }) => {
1039
- const data = useRootFormData();
1040
- const watch = widgetOptions.watch;
1041
- const template = widgetOptions.template;
1042
- const computed = watch && template ? resolveTemplate(template, watch, data) : stringify(value);
1043
- const lastSetRef = useRef(stringify(value));
1044
- useEffect(() => {
1045
- if (computed !== lastSetRef.current) {
1046
- lastSetRef.current = computed;
1047
- onChange(computed);
1048
- }
1049
- }, [computed, onChange]);
1050
- if (widgetOptions.hidden) {
1051
- return null;
1052
- }
1053
- return /* @__PURE__ */ jsx(
1054
- TextInput,
1055
- {
1056
- id,
1057
- value: computed,
1058
- readOnly: true,
1059
- disabled: disabled || readonly,
1060
- state: rawErrors?.length ? "error" : "default",
1061
- variant: "secondary"
1062
- }
1063
- );
1031
+ /**
1032
+ * Widget for json-editor's `template`/`watch` pattern (without `enumSource`).
1033
+ * Computes a value from watched form data paths and keeps the field in sync.
1034
+ *
1035
+ * - With `options.hidden` it renders nothing — a helper for cross-object dependencies.
1036
+ * - Without it, the value is shown in a read-only input; `FieldTemplate` supplies the label.
1037
+ */
1038
+ const TemplateWatchWidget = ({ id, value, onChange, disabled, readonly, rawErrors, options: widgetOptions }) => {
1039
+ const data = useRootFormData();
1040
+ const watch = widgetOptions.watch;
1041
+ const template = widgetOptions.template;
1042
+ const computed = watch && template ? resolveTemplate(template, watch, data) : stringify(value);
1043
+ const lastSetRef = useRef(stringify(value));
1044
+ useEffect(() => {
1045
+ if (computed !== lastSetRef.current) {
1046
+ lastSetRef.current = computed;
1047
+ onChange(computed);
1048
+ }
1049
+ }, [computed, onChange]);
1050
+ if (widgetOptions.hidden) return null;
1051
+ return /* @__PURE__ */ jsx(TextInput, {
1052
+ id,
1053
+ value: computed,
1054
+ readOnly: true,
1055
+ disabled: disabled || readonly,
1056
+ state: rawErrors?.length ? "error" : "default",
1057
+ variant: "secondary"
1058
+ });
1064
1059
  };
1065
- var TextareaWidget = ({
1066
- id,
1067
- value,
1068
- onChange,
1069
- onBlur,
1070
- onFocus,
1071
- disabled,
1072
- readonly,
1073
- placeholder,
1074
- options,
1075
- rawErrors
1076
- }) => {
1077
- const rows = options.rows ?? 5;
1078
- const stringValue = value == null ? "" : String(value);
1079
- return /* @__PURE__ */ jsx(
1080
- Textarea,
1081
- {
1082
- id,
1083
- value: stringValue,
1084
- onValueChange: onChange,
1085
- onBlur: () => onBlur(id, value),
1086
- onFocus: () => onFocus(id, value),
1087
- disabled: disabled || readonly,
1088
- placeholder,
1089
- minRows: rows,
1090
- state: rawErrors?.length ? "error" : "default",
1091
- variant: "secondary"
1092
- }
1093
- );
1060
+ //#endregion
1061
+ //#region src/blocks/RjsfSchemaEditor/widgets/TextareaWidget.tsx
1062
+ const TextareaWidget = ({ id, value, onChange, onBlur, onFocus, disabled, readonly, placeholder, options, rawErrors }) => {
1063
+ const rows = options.rows ?? 5;
1064
+ return /* @__PURE__ */ jsx(Textarea, {
1065
+ id,
1066
+ value: value == null ? "" : String(value),
1067
+ onValueChange: onChange,
1068
+ onBlur: () => onBlur(id, value),
1069
+ onFocus: () => onFocus(id, value),
1070
+ disabled: disabled || readonly,
1071
+ placeholder,
1072
+ minRows: rows,
1073
+ state: rawErrors?.length ? "error" : "default",
1074
+ variant: "secondary"
1075
+ });
1094
1076
  };
1095
- var TextWidget = ({
1096
- id,
1097
- value,
1098
- onChange,
1099
- onBlur,
1100
- onFocus,
1101
- disabled,
1102
- readonly,
1103
- placeholder,
1104
- schema,
1105
- options,
1106
- rawErrors
1107
- }) => {
1108
- const stringValue = value == null ? "" : typeof value === "object" ? "" : String(value);
1109
- const shouldTrim = !!options.trim;
1110
- return /* @__PURE__ */ jsx(
1111
- TextInput,
1112
- {
1113
- id,
1114
- value: stringValue,
1115
- onChange: (e) => {
1116
- const v = e.target.value;
1117
- onChange(shouldTrim ? v.trim() : v);
1118
- },
1119
- onBlur: () => onBlur(id, value),
1120
- onFocus: () => onFocus(id, value),
1121
- disabled: disabled || readonly,
1122
- placeholder,
1123
- type: schema.format === "email" ? "email" : "text",
1124
- state: rawErrors?.length ? "error" : "default",
1125
- variant: "secondary"
1126
- }
1127
- );
1077
+ //#endregion
1078
+ //#region src/blocks/RjsfSchemaEditor/widgets/TextWidget.tsx
1079
+ const TextWidget = ({ id, value, onChange, onBlur, onFocus, disabled, readonly, placeholder, schema, options, rawErrors }) => {
1080
+ const stringValue = value == null ? "" : typeof value === "object" ? "" : String(value);
1081
+ const shouldTrim = !!options.trim;
1082
+ return /* @__PURE__ */ jsx(TextInput, {
1083
+ id,
1084
+ value: stringValue,
1085
+ onChange: (e) => {
1086
+ const v = e.target.value;
1087
+ onChange(shouldTrim ? v.trim() : v);
1088
+ },
1089
+ onBlur: () => onBlur(id, value),
1090
+ onFocus: () => onFocus(id, value),
1091
+ disabled: disabled || readonly,
1092
+ placeholder,
1093
+ type: schema.format === "email" ? "email" : "text",
1094
+ state: rawErrors?.length ? "error" : "default",
1095
+ variant: "secondary"
1096
+ });
1128
1097
  };
1129
-
1130
- // src/blocks/RjsfSchemaEditor/registry.ts
1131
- var StubWidget = () => null;
1132
- var StubField = () => null;
1133
- var defaultFields = {
1134
- tableArray: TableArrayField,
1135
- tabsObject: TabsObjectField,
1136
- gridObject: GridObjectField,
1137
- codeEditor: CodeEditorField,
1138
- info: InfoField,
1139
- sshForm: StubField
1098
+ //#endregion
1099
+ //#region src/blocks/RjsfSchemaEditor/registry.ts
1100
+ const StubWidget = () => null;
1101
+ const StubField = () => null;
1102
+ const defaultFields = {
1103
+ tableArray: TableArrayField,
1104
+ tabsObject: TabsObjectField,
1105
+ gridObject: GridObjectField,
1106
+ codeEditor: CodeEditorField,
1107
+ info: InfoField,
1108
+ sshForm: StubField
1140
1109
  };
1141
- var defaultWidgets = {
1142
- // Override RJSF defaults with design system components
1143
- TextWidget,
1144
- UpDownWidget: NumberWidget,
1145
- TextareaWidget,
1146
- PasswordWidget,
1147
- SelectWidget,
1148
- CheckboxWidget,
1149
- RadioWidget,
1150
- // RJSF maps standard formats to dedicated widgets
1151
- EmailWidget: TextWidget,
1152
- URLWidget: TextWidget,
1153
- DateWidget,
1154
- DateTimeWidget: TextWidget,
1155
- // Custom widgets mapped via uiSchema
1156
- "code-editor": CodeEditorWidget,
1157
- "dynamic-select": DynamicSelectWidget,
1158
- "template-watch": TemplateWatchWidget,
1159
- // Host-coupled widgets — injected by the host app
1160
- "test-connection": StubWidget,
1161
- "sync-action": StubWidget,
1162
- "async-select": StubWidget,
1163
- "async-multi-select": StubWidget
1110
+ const defaultWidgets = {
1111
+ TextWidget,
1112
+ UpDownWidget: NumberWidget,
1113
+ TextareaWidget,
1114
+ PasswordWidget,
1115
+ SelectWidget,
1116
+ CheckboxWidget,
1117
+ RadioWidget,
1118
+ EmailWidget: TextWidget,
1119
+ URLWidget: TextWidget,
1120
+ DateWidget,
1121
+ DateTimeWidget: TextWidget,
1122
+ "code-editor": CodeEditorWidget,
1123
+ "dynamic-select": DynamicSelectWidget,
1124
+ "template-watch": TemplateWatchWidget,
1125
+ "test-connection": StubWidget,
1126
+ "sync-action": StubWidget,
1127
+ "async-select": StubWidget,
1128
+ "async-multi-select": StubWidget
1164
1129
  };
1165
- var defaultTemplates = {
1166
- FieldTemplate,
1167
- ObjectFieldTemplate,
1168
- DescriptionFieldTemplate,
1169
- ArrayFieldTemplate,
1170
- ArrayFieldItemTemplate,
1171
- ErrorListTemplate
1130
+ const defaultTemplates = {
1131
+ FieldTemplate,
1132
+ ObjectFieldTemplate,
1133
+ DescriptionFieldTemplate,
1134
+ ArrayFieldTemplate,
1135
+ ArrayFieldItemTemplate,
1136
+ ErrorListTemplate
1172
1137
  };
1173
-
1174
- // src/blocks/RjsfSchemaEditor/schemaUtils.ts
1175
- var resolveRef = (propSchema, definitions) => {
1176
- if (!propSchema.$ref || !definitions) return propSchema;
1177
- const refPath = String(propSchema.$ref).replace("#/definitions/", "");
1178
- const resolved = definitions[refPath];
1179
- if (!resolved) return propSchema;
1180
- const { $ref, ...overrides } = propSchema;
1181
- return { ...resolved, ...overrides };
1138
+ //#endregion
1139
+ //#region src/blocks/RjsfSchemaEditor/schemaUtils.ts
1140
+ /**
1141
+ * Resolves a $ref reference against the schema definitions, merging any
1142
+ * sibling overrides (title, options, etc.) on top of the resolved schema.
1143
+ */
1144
+ const resolveRef = (propSchema, definitions) => {
1145
+ if (!propSchema.$ref || !definitions) return propSchema;
1146
+ const resolved = definitions[String(propSchema.$ref).replace("#/definitions/", "")];
1147
+ if (!resolved) return propSchema;
1148
+ const { $ref, ...overrides } = propSchema;
1149
+ return {
1150
+ ...resolved,
1151
+ ...overrides
1152
+ };
1182
1153
  };
1183
- var generateUiSchema = (schema, readOnly = false, definitions, globalConfig, hasProtectedDefaultBranch = false) => {
1184
- const uiSchema = {};
1185
- const defs = definitions ?? schema.definitions;
1186
- if (readOnly) {
1187
- uiSchema["ui:disabled"] = true;
1188
- }
1189
- const properties = schema.properties;
1190
- if (!properties) ; else {
1191
- for (const [key, rawPropSchema] of Object.entries(properties)) {
1192
- const propSchema = resolveRef(rawPropSchema, defs);
1193
- const format = propSchema.format;
1194
- const type = propSchema.type ?? (propSchema.properties ? "object" : void 0);
1195
- const options = propSchema.options;
1196
- const fieldUi = {};
1197
- if (options?.hidden) {
1198
- fieldUi["ui:widget"] = "hidden";
1199
- }
1200
- if (type === "array" && format === "table") {
1201
- fieldUi["ui:field"] = "tableArray";
1202
- }
1203
- if (type === "array" && format === "checkbox") {
1204
- fieldUi["ui:widget"] = "checkboxes";
1205
- }
1206
- if (format === "radio" && propSchema.enum) {
1207
- fieldUi["ui:widget"] = "radio";
1208
- }
1209
- if (type === "object" && (format === "tabs" || format === "tabs-top" || format === "categories")) {
1210
- fieldUi["ui:field"] = "tabsObject";
1211
- }
1212
- if (type === "object" && (format === "grid" || format === "grid-strict")) {
1213
- fieldUi["ui:field"] = "gridObject";
1214
- }
1215
- if (format === "info") {
1216
- fieldUi["ui:field"] = "info";
1217
- if (options?.alert_type) {
1218
- fieldUi["ui:options"] = {
1219
- ...fieldUi["ui:options"],
1220
- alertType: options.alert_type
1221
- };
1222
- }
1223
- }
1224
- if (type === "button" && format === "test-connection") {
1225
- fieldUi["ui:widget"] = "test-connection";
1226
- fieldUi["ui:options"] = options ?? {};
1227
- } else if (type === "button" && format === "sync-action") {
1228
- fieldUi["ui:widget"] = "sync-action";
1229
- fieldUi["ui:options"] = options ?? {};
1230
- } else if ((type === "string" || type === "object") && format === "editor") {
1231
- if (type === "object") {
1232
- fieldUi["ui:field"] = "codeEditor";
1233
- } else {
1234
- fieldUi["ui:widget"] = "code-editor";
1235
- }
1236
- fieldUi["ui:options"] = {
1237
- editor: options?.editor ?? {},
1238
- // A JSON editor stores parsed keys, so `#` prefixes really are encrypted here.
1239
- // Fields whose JSON is not Keboola configuration (a query filter tree, a payload
1240
- // template) opt out with `encryption_hint: false` — encrypting a key there would
1241
- // hand the component ciphertext it cannot use.
1242
- encryptionHint: options?.encryption_hint !== false
1243
- };
1244
- } else if (type === "object" && format === "ssh-editor") {
1245
- fieldUi["ui:field"] = "sshForm";
1246
- fieldUi["ui:options"] = { only_keys: !!options?.only_keys };
1247
- } else if (type === "string" && format === "password") {
1248
- if (!hasProtectedDefaultBranch) {
1249
- fieldUi["ui:widget"] = "password";
1250
- }
1251
- } else if (type === "string" && format === "textarea") {
1252
- fieldUi["ui:widget"] = "textarea";
1253
- if (options?.input_height) {
1254
- fieldUi["ui:options"] = {
1255
- ...fieldUi["ui:options"],
1256
- rows: parseInputHeightToRows(String(options.input_height))
1257
- };
1258
- }
1259
- } else if (type === "string" && format === "trim") {
1260
- fieldUi["ui:options"] = {
1261
- ...fieldUi["ui:options"],
1262
- trim: true
1263
- };
1264
- } else if (isDynamicSelectSchema(propSchema)) {
1265
- fieldUi["ui:widget"] = "dynamic-select";
1266
- fieldUi["ui:options"] = {
1267
- ...fieldUi["ui:options"],
1268
- watch: propSchema.watch,
1269
- enumSource: propSchema.enumSource,
1270
- tags: !!options?.tags
1271
- };
1272
- } else if (isMultiSelectSchema(propSchema)) {
1273
- const items = propSchema.items;
1274
- const itemsOptions = items?.options;
1275
- fieldUi["ui:widget"] = "async-multi-select";
1276
- fieldUi["ui:options"] = {
1277
- async: options?.async ?? itemsOptions?.async ?? null,
1278
- creatable: !!options?.creatable || !!options?.tags,
1279
- placeholder: String(
1280
- options?.inputAttributes?.placeholder ?? ""
1281
- ),
1282
- // Pass dynamic source from items for enumSource/watch multi-selects
1283
- ...items?.watch && { watch: items.watch },
1284
- ...items?.enumSource && { enumSource: items.enumSource }
1285
- };
1286
- } else if (isAsyncSelectSchema(propSchema)) {
1287
- fieldUi["ui:widget"] = "async-select";
1288
- fieldUi["ui:options"] = {
1289
- async: options?.async ?? null,
1290
- creatable: !!options?.creatable,
1291
- placeholder: String(
1292
- options?.inputAttributes?.placeholder ?? ""
1293
- )
1294
- };
1295
- }
1296
- if (isTemplateWatchSchema(propSchema)) {
1297
- fieldUi["ui:widget"] = "template-watch";
1298
- fieldUi["ui:options"] = {
1299
- ...fieldUi["ui:options"],
1300
- watch: propSchema.watch,
1301
- template: propSchema.template,
1302
- hidden: !!options?.hidden || isContainerType(propSchema)
1303
- };
1304
- }
1305
- if (type === "boolean" && options?.enum_titles) {
1306
- fieldUi["ui:widget"] = "select";
1307
- }
1308
- if (options?.collapsed !== void 0) {
1309
- fieldUi["ui:options"] = {
1310
- ...fieldUi["ui:options"],
1311
- collapsed: !!options.collapsed
1312
- };
1313
- }
1314
- if (options?.disable_collapse) {
1315
- fieldUi["ui:options"] = {
1316
- ...fieldUi["ui:options"],
1317
- disableCollapse: true
1318
- };
1319
- }
1320
- if (options?.dependencies) {
1321
- fieldUi["ui:options"] = {
1322
- ...fieldUi["ui:options"],
1323
- dependencies: options.dependencies
1324
- };
1325
- }
1326
- if (options?.grid_break) {
1327
- fieldUi["ui:options"] = {
1328
- ...fieldUi["ui:options"],
1329
- gridBreak: true
1330
- };
1331
- }
1332
- if (options?.enabled === false) {
1333
- fieldUi["ui:disabled"] = true;
1334
- }
1335
- const globalValue = globalConfig?.[key];
1336
- if (globalValue !== void 0) {
1337
- if (typeof globalValue !== "object" || globalValue === null || Array.isArray(globalValue)) {
1338
- fieldUi["ui:disabled"] = true;
1339
- }
1340
- }
1341
- if (options?.tooltip) {
1342
- fieldUi["ui:help"] = String(options.tooltip);
1343
- }
1344
- if (options?.documentation?.link) {
1345
- fieldUi["ui:options"] = {
1346
- ...fieldUi["ui:options"],
1347
- documentation: options?.documentation
1348
- };
1349
- }
1350
- if (options?.inputAttributes?.placeholder && !fieldUi["ui:widget"]) {
1351
- fieldUi["ui:placeholder"] = String(
1352
- options?.inputAttributes?.placeholder
1353
- );
1354
- }
1355
- if (options?.enum_titles && propSchema.enum) {
1356
- fieldUi["ui:options"] = {
1357
- ...fieldUi["ui:options"],
1358
- enumNames: options.enum_titles
1359
- };
1360
- }
1361
- if (type === "array") {
1362
- const arrayOpts = {};
1363
- if (options?.disable_array_add) arrayOpts.addable = false;
1364
- if (options?.disable_array_delete) arrayOpts.removable = false;
1365
- if (options?.disable_array_reorder) arrayOpts.orderable = false;
1366
- if (Object.keys(arrayOpts).length > 0) {
1367
- fieldUi["ui:options"] = {
1368
- ...fieldUi["ui:options"],
1369
- ...arrayOpts
1370
- };
1371
- }
1372
- const itemsEnumTitles = propSchema.items?.options?.enum_titles;
1373
- if (Array.isArray(itemsEnumTitles)) {
1374
- fieldUi.items = { "ui:options": { enumNames: itemsEnumTitles } };
1375
- }
1376
- }
1377
- if (type === "object" && propSchema.properties) {
1378
- const nestedGlobal = globalValue && typeof globalValue === "object" && !Array.isArray(globalValue) ? globalValue : void 0;
1379
- const nested = generateUiSchema(
1380
- propSchema,
1381
- readOnly,
1382
- defs,
1383
- nestedGlobal,
1384
- hasProtectedDefaultBranch
1385
- );
1386
- Object.assign(fieldUi, nested);
1387
- }
1388
- if (type === "array" && propSchema.items?.properties) {
1389
- const itemsUi = generateUiSchema(
1390
- propSchema.items,
1391
- readOnly,
1392
- defs,
1393
- void 0,
1394
- hasProtectedDefaultBranch
1395
- );
1396
- if (Object.keys(itemsUi).length > 0) {
1397
- fieldUi.items = itemsUi;
1398
- }
1399
- }
1400
- if ((propSchema.enumSource || propSchema.watch) && !fieldUi["ui:widget"]) {
1401
- console.warn(
1402
- `[RJSF] Property "${key}" uses enumSource/watch which is not yet supported. It will render as a plain input.`
1403
- );
1404
- }
1405
- if (Object.keys(fieldUi).length > 0) {
1406
- uiSchema[key] = fieldUi;
1407
- }
1408
- }
1409
- const orderedEntries = Object.entries(properties).filter(([, prop]) => prop.propertyOrder !== void 0).sort(
1410
- ([, a], [, b]) => (a.propertyOrder ?? Number.MAX_SAFE_INTEGER) - (b.propertyOrder ?? Number.MAX_SAFE_INTEGER)
1411
- );
1412
- if (orderedEntries.length > 0) {
1413
- uiSchema["ui:order"] = [...orderedEntries.map(([key]) => key), "*"];
1414
- }
1415
- }
1416
- for (const combiner of ["allOf", "anyOf", "oneOf"]) {
1417
- const schemas = schema[combiner];
1418
- if (schemas) {
1419
- for (const subSchema of schemas) {
1420
- const subUi = generateUiSchema(
1421
- subSchema,
1422
- readOnly,
1423
- void 0,
1424
- void 0,
1425
- hasProtectedDefaultBranch
1426
- );
1427
- Object.assign(uiSchema, subUi);
1428
- }
1429
- }
1430
- }
1431
- for (const branch of ["if", "then", "else"]) {
1432
- const branchSchema = schema[branch];
1433
- if (branchSchema?.properties) {
1434
- const branchUi = generateUiSchema(
1435
- branchSchema,
1436
- readOnly,
1437
- void 0,
1438
- void 0,
1439
- hasProtectedDefaultBranch
1440
- );
1441
- Object.assign(uiSchema, branchUi);
1442
- }
1443
- }
1444
- return uiSchema;
1154
+ /**
1155
+ * Walks a JSON Schema and generates a RJSF uiSchema based on custom `format` and `options` properties.
1156
+ * This maps the legacy @json-editor/json-editor conventions to RJSF widget references.
1157
+ */
1158
+ const generateUiSchema = (schema, readOnly = false, definitions, globalConfig, hasProtectedDefaultBranch = false) => {
1159
+ const uiSchema = {};
1160
+ const defs = definitions ?? schema.definitions;
1161
+ if (readOnly) uiSchema["ui:disabled"] = true;
1162
+ const properties = schema.properties;
1163
+ if (!properties) {} else {
1164
+ for (const [key, rawPropSchema] of Object.entries(properties)) {
1165
+ const propSchema = resolveRef(rawPropSchema, defs);
1166
+ const format = propSchema.format;
1167
+ const type = propSchema.type ?? (propSchema.properties ? "object" : void 0);
1168
+ const options = propSchema.options;
1169
+ const fieldUi = {};
1170
+ if (options?.hidden) fieldUi["ui:widget"] = "hidden";
1171
+ if (type === "array" && format === "table") fieldUi["ui:field"] = "tableArray";
1172
+ if (type === "array" && format === "checkbox") fieldUi["ui:widget"] = "checkboxes";
1173
+ if (format === "radio" && propSchema.enum) fieldUi["ui:widget"] = "radio";
1174
+ if (type === "object" && (format === "tabs" || format === "tabs-top" || format === "categories")) fieldUi["ui:field"] = "tabsObject";
1175
+ if (type === "object" && (format === "grid" || format === "grid-strict")) fieldUi["ui:field"] = "gridObject";
1176
+ if (format === "info") {
1177
+ fieldUi["ui:field"] = "info";
1178
+ if (options?.alert_type) fieldUi["ui:options"] = {
1179
+ ...fieldUi["ui:options"],
1180
+ alertType: options.alert_type
1181
+ };
1182
+ }
1183
+ if (type === "button" && format === "test-connection") {
1184
+ fieldUi["ui:widget"] = "test-connection";
1185
+ fieldUi["ui:options"] = options ?? {};
1186
+ } else if (type === "button" && format === "sync-action") {
1187
+ fieldUi["ui:widget"] = "sync-action";
1188
+ fieldUi["ui:options"] = options ?? {};
1189
+ } else if ((type === "string" || type === "object") && format === "editor") {
1190
+ if (type === "object") fieldUi["ui:field"] = "codeEditor";
1191
+ else fieldUi["ui:widget"] = "code-editor";
1192
+ fieldUi["ui:options"] = {
1193
+ editor: options?.editor ?? {},
1194
+ encryptionHint: options?.encryption_hint !== false
1195
+ };
1196
+ } else if (type === "object" && format === "ssh-editor") {
1197
+ fieldUi["ui:field"] = "sshForm";
1198
+ fieldUi["ui:options"] = { only_keys: !!options?.only_keys };
1199
+ } else if (type === "string" && format === "password") {
1200
+ if (!hasProtectedDefaultBranch) fieldUi["ui:widget"] = "password";
1201
+ } else if (type === "string" && format === "textarea") {
1202
+ fieldUi["ui:widget"] = "textarea";
1203
+ if (options?.input_height) fieldUi["ui:options"] = {
1204
+ ...fieldUi["ui:options"],
1205
+ rows: parseInputHeightToRows(String(options.input_height))
1206
+ };
1207
+ } else if (type === "string" && format === "trim") fieldUi["ui:options"] = {
1208
+ ...fieldUi["ui:options"],
1209
+ trim: true
1210
+ };
1211
+ else if (isDynamicSelectSchema(propSchema)) {
1212
+ fieldUi["ui:widget"] = "dynamic-select";
1213
+ fieldUi["ui:options"] = {
1214
+ ...fieldUi["ui:options"],
1215
+ watch: propSchema.watch,
1216
+ enumSource: propSchema.enumSource,
1217
+ tags: !!options?.tags
1218
+ };
1219
+ } else if (isMultiSelectSchema(propSchema)) {
1220
+ const items = propSchema.items;
1221
+ const itemsOptions = items?.options;
1222
+ fieldUi["ui:widget"] = "async-multi-select";
1223
+ fieldUi["ui:options"] = {
1224
+ async: options?.async ?? itemsOptions?.async ?? null,
1225
+ creatable: !!options?.creatable || !!options?.tags,
1226
+ placeholder: String((options?.inputAttributes)?.placeholder ?? ""),
1227
+ ...items?.watch && { watch: items.watch },
1228
+ ...items?.enumSource && { enumSource: items.enumSource }
1229
+ };
1230
+ } else if (isAsyncSelectSchema(propSchema)) {
1231
+ fieldUi["ui:widget"] = "async-select";
1232
+ fieldUi["ui:options"] = {
1233
+ async: options?.async ?? null,
1234
+ creatable: !!options?.creatable,
1235
+ placeholder: String((options?.inputAttributes)?.placeholder ?? "")
1236
+ };
1237
+ }
1238
+ if (isTemplateWatchSchema(propSchema)) {
1239
+ fieldUi["ui:widget"] = "template-watch";
1240
+ fieldUi["ui:options"] = {
1241
+ ...fieldUi["ui:options"],
1242
+ watch: propSchema.watch,
1243
+ template: propSchema.template,
1244
+ hidden: !!options?.hidden || isContainerType(propSchema)
1245
+ };
1246
+ }
1247
+ if (type === "boolean" && options?.enum_titles) fieldUi["ui:widget"] = "select";
1248
+ if (options?.collapsed !== void 0) fieldUi["ui:options"] = {
1249
+ ...fieldUi["ui:options"],
1250
+ collapsed: !!options.collapsed
1251
+ };
1252
+ if (options?.disable_collapse) fieldUi["ui:options"] = {
1253
+ ...fieldUi["ui:options"],
1254
+ disableCollapse: true
1255
+ };
1256
+ if (options?.dependencies) fieldUi["ui:options"] = {
1257
+ ...fieldUi["ui:options"],
1258
+ dependencies: options.dependencies
1259
+ };
1260
+ if (options?.grid_break) fieldUi["ui:options"] = {
1261
+ ...fieldUi["ui:options"],
1262
+ gridBreak: true
1263
+ };
1264
+ if (options?.enabled === false) fieldUi["ui:disabled"] = true;
1265
+ const globalValue = globalConfig?.[key];
1266
+ if (globalValue !== void 0) {
1267
+ if (typeof globalValue !== "object" || globalValue === null || Array.isArray(globalValue)) fieldUi["ui:disabled"] = true;
1268
+ }
1269
+ if (options?.tooltip) fieldUi["ui:help"] = String(options.tooltip);
1270
+ if ((options?.documentation)?.link) fieldUi["ui:options"] = {
1271
+ ...fieldUi["ui:options"],
1272
+ documentation: options?.documentation
1273
+ };
1274
+ if ((options?.inputAttributes)?.placeholder && !fieldUi["ui:widget"]) fieldUi["ui:placeholder"] = String((options?.inputAttributes)?.placeholder);
1275
+ if (options?.enum_titles && propSchema.enum) fieldUi["ui:options"] = {
1276
+ ...fieldUi["ui:options"],
1277
+ enumNames: options.enum_titles
1278
+ };
1279
+ if (type === "array") {
1280
+ const arrayOpts = {};
1281
+ if (options?.disable_array_add) arrayOpts.addable = false;
1282
+ if (options?.disable_array_delete) arrayOpts.removable = false;
1283
+ if (options?.disable_array_reorder) arrayOpts.orderable = false;
1284
+ if (Object.keys(arrayOpts).length > 0) fieldUi["ui:options"] = {
1285
+ ...fieldUi["ui:options"],
1286
+ ...arrayOpts
1287
+ };
1288
+ const itemsEnumTitles = (propSchema.items?.options)?.enum_titles;
1289
+ if (Array.isArray(itemsEnumTitles)) fieldUi.items = { "ui:options": { enumNames: itemsEnumTitles } };
1290
+ }
1291
+ if (type === "object" && propSchema.properties) {
1292
+ const nested = generateUiSchema(propSchema, readOnly, defs, globalValue && typeof globalValue === "object" && !Array.isArray(globalValue) ? globalValue : void 0, hasProtectedDefaultBranch);
1293
+ Object.assign(fieldUi, nested);
1294
+ }
1295
+ if (type === "array" && propSchema.items?.properties) {
1296
+ const itemsUi = generateUiSchema(propSchema.items, readOnly, defs, void 0, hasProtectedDefaultBranch);
1297
+ if (Object.keys(itemsUi).length > 0) fieldUi.items = itemsUi;
1298
+ }
1299
+ if ((propSchema.enumSource || propSchema.watch) && !fieldUi["ui:widget"]) console.warn(`[RJSF] Property "${key}" uses enumSource/watch which is not yet supported. It will render as a plain input.`);
1300
+ if (Object.keys(fieldUi).length > 0) uiSchema[key] = fieldUi;
1301
+ }
1302
+ const orderedEntries = Object.entries(properties).filter(([, prop]) => prop.propertyOrder !== void 0).sort(([, a], [, b]) => (a.propertyOrder ?? Number.MAX_SAFE_INTEGER) - (b.propertyOrder ?? Number.MAX_SAFE_INTEGER));
1303
+ if (orderedEntries.length > 0) uiSchema["ui:order"] = [...orderedEntries.map(([key]) => key), "*"];
1304
+ }
1305
+ for (const combiner of [
1306
+ "allOf",
1307
+ "anyOf",
1308
+ "oneOf"
1309
+ ]) {
1310
+ const schemas = schema[combiner];
1311
+ if (schemas) for (const subSchema of schemas) {
1312
+ const subUi = generateUiSchema(subSchema, readOnly, void 0, void 0, hasProtectedDefaultBranch);
1313
+ Object.assign(uiSchema, subUi);
1314
+ }
1315
+ }
1316
+ for (const branch of [
1317
+ "if",
1318
+ "then",
1319
+ "else"
1320
+ ]) {
1321
+ const branchSchema = schema[branch];
1322
+ if (branchSchema?.properties) {
1323
+ const branchUi = generateUiSchema(branchSchema, readOnly, void 0, void 0, hasProtectedDefaultBranch);
1324
+ Object.assign(uiSchema, branchUi);
1325
+ }
1326
+ }
1327
+ return uiSchema;
1445
1328
  };
1446
- var isDynamicSelectSchema = (schema) => {
1447
- return !!(schema.enumSource && schema.watch && schema.type === "string");
1329
+ const isDynamicSelectSchema = (schema) => {
1330
+ return !!(schema.enumSource && schema.watch && schema.type === "string");
1448
1331
  };
1449
- var isTemplateWatchSchema = (schema) => {
1450
- return !!(schema.template && schema.watch && !schema.enumSource);
1332
+ const isTemplateWatchSchema = (schema) => {
1333
+ return !!(schema.template && schema.watch && !schema.enumSource);
1451
1334
  };
1452
- var isContainerType = (schema) => {
1453
- if (schema.properties || schema.items) return true;
1454
- const { type } = schema;
1455
- if (Array.isArray(type)) return type.includes("object") || type.includes("array");
1456
- return type === "object" || type === "array";
1335
+ /**
1336
+ * Whether a schema describes an object or an array.
1337
+ *
1338
+ * - `properties` or `items` imply the type even when json-editor omits it.
1339
+ * - `type` may be a union, e.g. `['object', 'null']`.
1340
+ */
1341
+ const isContainerType = (schema) => {
1342
+ if (schema.properties || schema.items) return true;
1343
+ const { type } = schema;
1344
+ if (Array.isArray(type)) return type.includes("object") || type.includes("array");
1345
+ return type === "object" || type === "array";
1457
1346
  };
1458
- var isAsyncSelectSchema = (schema) => {
1459
- return !!(schema.options?.async || schema.options?.creatable);
1347
+ const isAsyncSelectSchema = (schema) => {
1348
+ return !!(schema.options?.async || schema.options?.creatable);
1460
1349
  };
1461
- var isMultiSelectSchema = (schema) => {
1462
- const items = schema.items;
1463
- return !!(items && schema.uniqueItems && schema.type === "array" && schema.format !== "checkbox" && !Array.isArray(items) && ["string", "number", "integer"].includes(items.type) && (items.enum || items.enumSource || schema.options?.tags));
1350
+ const isMultiSelectSchema = (schema) => {
1351
+ const items = schema.items;
1352
+ return !!(items && schema.uniqueItems && schema.type === "array" && schema.format !== "checkbox" && !Array.isArray(items) && [
1353
+ "string",
1354
+ "number",
1355
+ "integer"
1356
+ ].includes(items.type) && (items.enum || items.enumSource || schema.options?.tags));
1464
1357
  };
1465
- var parseInputHeightToRows = (height) => {
1466
- const px = parseInt(height, 10);
1467
- if (Number.isNaN(px) || px <= 0) return 5;
1468
- return Math.max(2, Math.round(px / 20));
1358
+ /**
1359
+ * Cleans up non-standard properties from a schema before passing to RJSF/AJV.
1360
+ * RJSF is strict about unknown keywords, and our schemas contain json-editor-specific
1361
+ * extensions (format: 'button', options, etc.).
1362
+ */
1363
+ /** Convert CSS height like "100px" to approximate textarea rows */
1364
+ const parseInputHeightToRows = (height) => {
1365
+ const px = parseInt(height, 10);
1366
+ if (Number.isNaN(px) || px <= 0) return 5;
1367
+ return Math.max(2, Math.round(px / 20));
1469
1368
  };
1470
- var CUSTOM_FORMATS = [
1471
- "table",
1472
- "editor",
1473
- "ssh-editor",
1474
- "trim",
1475
- "textarea",
1476
- "grid",
1477
- "grid-strict",
1478
- "tabs",
1479
- "tabs-top",
1480
- "categories",
1481
- "info",
1482
- "select",
1483
- "checkbox",
1484
- "json",
1485
- "button",
1486
- "radio"
1369
+ const CUSTOM_FORMATS = [
1370
+ "table",
1371
+ "editor",
1372
+ "ssh-editor",
1373
+ "trim",
1374
+ "textarea",
1375
+ "grid",
1376
+ "grid-strict",
1377
+ "tabs",
1378
+ "tabs-top",
1379
+ "categories",
1380
+ "info",
1381
+ "select",
1382
+ "checkbox",
1383
+ "json",
1384
+ "button",
1385
+ "radio"
1487
1386
  ];
1488
- var sanitizeSchema = (schema, definitions, isConditionalBranch = false) => {
1489
- const cleaned = { ...schema };
1490
- const defs = definitions ?? cleaned.definitions;
1491
- if (Array.isArray(cleaned.enum) && cleaned.enum.length === 0) {
1492
- delete cleaned.enum;
1493
- }
1494
- if (Array.isArray(cleaned.enum) && cleaned.enum.length > 0 && (cleaned.type === "string" || cleaned.type === "integer" || cleaned.type === "number")) {
1495
- if (cleaned.default === void 0) {
1496
- cleaned.default = cleaned.enum[0];
1497
- } else if (!cleaned.enum.includes(cleaned.default)) {
1498
- delete cleaned.default;
1499
- }
1500
- }
1501
- if (cleaned.properties && !cleaned.type) {
1502
- cleaned.type = "object";
1503
- }
1504
- if (cleaned.required === true) {
1505
- delete cleaned.required;
1506
- }
1507
- if (CUSTOM_FORMATS.includes(cleaned.format)) {
1508
- delete cleaned.format;
1509
- }
1510
- const properties = cleaned.properties;
1511
- if (properties) {
1512
- const sanitizedProps = {};
1513
- const required = cleaned.required ?? [];
1514
- const sanitizedRequired = [];
1515
- for (const [key, rawPropSchema] of Object.entries(properties)) {
1516
- const propSchema = resolveRef(rawPropSchema, defs);
1517
- if (propSchema.type === "button") {
1518
- sanitizedProps[key] = {
1519
- type: "string",
1520
- title: propSchema.title,
1521
- ...propSchema.propertyOrder !== void 0 && {
1522
- propertyOrder: propSchema.propertyOrder
1523
- },
1524
- ...propSchema.description !== void 0 && { description: propSchema.description }
1525
- };
1526
- continue;
1527
- }
1528
- if (propSchema.type === "boolean" && propSchema.options?.enum_titles) {
1529
- const titles = propSchema.options.enum_titles;
1530
- const sanitized = sanitizeSchema(propSchema, defs);
1531
- const enumValues = propSchema.enum ?? [true, false];
1532
- sanitized.oneOf = enumValues.map((value, index) => ({
1533
- const: value,
1534
- title: titles[index] ?? (value ? "Yes" : "No")
1535
- }));
1536
- sanitizedProps[key] = sanitized;
1537
- if (required.includes(key) || propSchema.required === true) {
1538
- if (!sanitizedRequired.includes(key)) sanitizedRequired.push(key);
1539
- }
1540
- continue;
1541
- }
1542
- sanitizedProps[key] = sanitizeSchema(propSchema, defs);
1543
- if (required.includes(key) || propSchema.required === true) {
1544
- if (!sanitizedRequired.includes(key)) sanitizedRequired.push(key);
1545
- }
1546
- }
1547
- cleaned.properties = sanitizedProps;
1548
- if (sanitizedRequired.length > 0) {
1549
- cleaned.required = sanitizedRequired;
1550
- }
1551
- if (!isConditionalBranch && cleaned.additionalProperties === void 0 && !cleaned.if) {
1552
- cleaned.additionalProperties = false;
1553
- }
1554
- }
1555
- for (const combiner of ["allOf", "anyOf", "oneOf"]) {
1556
- const schemas = cleaned[combiner];
1557
- if (schemas) {
1558
- cleaned[combiner] = schemas.map((s) => sanitizeSchema(s, defs));
1559
- }
1560
- }
1561
- for (const branch of ["if", "then", "else"]) {
1562
- const branchSchema = cleaned[branch];
1563
- if (branchSchema) {
1564
- cleaned[branch] = sanitizeSchema(branchSchema, defs, true);
1565
- }
1566
- }
1567
- if (cleaned.items && typeof cleaned.items === "object" && !Array.isArray(cleaned.items)) {
1568
- cleaned.items = sanitizeSchema(cleaned.items, defs);
1569
- }
1570
- return cleaned;
1387
+ const sanitizeSchema = (schema, definitions, isConditionalBranch = false) => {
1388
+ const cleaned = { ...schema };
1389
+ const defs = definitions ?? cleaned.definitions;
1390
+ if (Array.isArray(cleaned.enum) && cleaned.enum.length === 0) delete cleaned.enum;
1391
+ if (Array.isArray(cleaned.enum) && cleaned.enum.length > 0 && (cleaned.type === "string" || cleaned.type === "integer" || cleaned.type === "number")) {
1392
+ if (cleaned.default === void 0) cleaned.default = cleaned.enum[0];
1393
+ else if (!cleaned.enum.includes(cleaned.default)) delete cleaned.default;
1394
+ }
1395
+ if (cleaned.properties && !cleaned.type) cleaned.type = "object";
1396
+ if (cleaned.required === true) delete cleaned.required;
1397
+ if (CUSTOM_FORMATS.includes(cleaned.format)) delete cleaned.format;
1398
+ const properties = cleaned.properties;
1399
+ if (properties) {
1400
+ const sanitizedProps = {};
1401
+ const required = cleaned.required ?? [];
1402
+ const sanitizedRequired = [];
1403
+ for (const [key, rawPropSchema] of Object.entries(properties)) {
1404
+ const propSchema = resolveRef(rawPropSchema, defs);
1405
+ if (propSchema.type === "button") {
1406
+ sanitizedProps[key] = {
1407
+ type: "string",
1408
+ title: propSchema.title,
1409
+ ...propSchema.propertyOrder !== void 0 && { propertyOrder: propSchema.propertyOrder },
1410
+ ...propSchema.description !== void 0 && { description: propSchema.description }
1411
+ };
1412
+ continue;
1413
+ }
1414
+ if (propSchema.type === "boolean" && propSchema.options?.enum_titles) {
1415
+ const titles = propSchema.options.enum_titles;
1416
+ const sanitized = sanitizeSchema(propSchema, defs);
1417
+ sanitized.oneOf = (propSchema.enum ?? [true, false]).map((value, index) => ({
1418
+ const: value,
1419
+ title: titles[index] ?? (value ? "Yes" : "No")
1420
+ }));
1421
+ sanitizedProps[key] = sanitized;
1422
+ if (required.includes(key) || propSchema.required === true) {
1423
+ if (!sanitizedRequired.includes(key)) sanitizedRequired.push(key);
1424
+ }
1425
+ continue;
1426
+ }
1427
+ sanitizedProps[key] = sanitizeSchema(propSchema, defs);
1428
+ if (required.includes(key) || propSchema.required === true) {
1429
+ if (!sanitizedRequired.includes(key)) sanitizedRequired.push(key);
1430
+ }
1431
+ }
1432
+ cleaned.properties = sanitizedProps;
1433
+ if (sanitizedRequired.length > 0) cleaned.required = sanitizedRequired;
1434
+ if (!isConditionalBranch && cleaned.additionalProperties === void 0 && !cleaned.if) cleaned.additionalProperties = false;
1435
+ }
1436
+ for (const combiner of [
1437
+ "allOf",
1438
+ "anyOf",
1439
+ "oneOf"
1440
+ ]) {
1441
+ const schemas = cleaned[combiner];
1442
+ if (schemas) cleaned[combiner] = schemas.map((s) => sanitizeSchema(s, defs));
1443
+ }
1444
+ for (const branch of [
1445
+ "if",
1446
+ "then",
1447
+ "else"
1448
+ ]) {
1449
+ const branchSchema = cleaned[branch];
1450
+ if (branchSchema) cleaned[branch] = sanitizeSchema(branchSchema, defs, true);
1451
+ }
1452
+ if (cleaned.items && typeof cleaned.items === "object" && !Array.isArray(cleaned.items)) cleaned.items = sanitizeSchema(cleaned.items, defs);
1453
+ return cleaned;
1571
1454
  };
1572
- var defaultRenderMarkdown = (source) => source;
1573
- var stableStringify = (obj) => JSON.stringify(obj, (_key, val) => {
1574
- if (val && typeof val === "object" && !Array.isArray(val)) {
1575
- const sorted = {};
1576
- for (const key of Object.keys(val).sort()) {
1577
- sorted[key] = val[key];
1578
- }
1579
- return sorted;
1580
- }
1581
- return val;
1455
+ //#endregion
1456
+ //#region src/blocks/RjsfSchemaEditor/RjsfSchemaEditor.tsx
1457
+ const defaultRenderMarkdown = (source) => source;
1458
+ /**
1459
+ * Produces a canonical JSON string with sorted keys at every level.
1460
+ * This ensures two objects with the same data but different key ordering
1461
+ * produce the same string. Also normalizes undefined → omitted (via JSON.stringify).
1462
+ */
1463
+ const stableStringify = (obj) => JSON.stringify(obj, (_key, val) => {
1464
+ if (val && typeof val === "object" && !Array.isArray(val)) {
1465
+ const sorted = {};
1466
+ for (const key of Object.keys(val).sort()) sorted[key] = val[key];
1467
+ return sorted;
1468
+ }
1469
+ return val;
1582
1470
  });
1583
- var RjsfSchemaEditor = ({
1584
- schema,
1585
- value,
1586
- onChange,
1587
- readOnly,
1588
- inForm,
1589
- globalConfig,
1590
- onRegisterValidate,
1591
- widgets,
1592
- fields,
1593
- renderMarkdown,
1594
- hasProtectedDefaultBranch = false
1595
- }) => {
1596
- const schemaJs = useMemo(() => sanitizeSchema(schema), [schema]);
1597
- const uiSchema = useMemo(
1598
- () => generateUiSchema(
1599
- schema,
1600
- readOnly,
1601
- void 0,
1602
- globalConfig ?? void 0,
1603
- hasProtectedDefaultBranch
1604
- ),
1605
- [schema, readOnly, globalConfig, hasProtectedDefaultBranch]
1606
- );
1607
- const mergedWidgets = useMemo(() => ({ ...defaultWidgets, ...widgets }), [widgets]);
1608
- const mergedFields = useMemo(() => ({ ...defaultFields, ...fields }), [fields]);
1609
- const initialDataRef = useRef(value);
1610
- const formDataRef = useRef(initialDataRef.current);
1611
- const [formKey, setFormKey] = useState(0);
1612
- const [hasValidated, setHasValidated] = useState(false);
1613
- const [rootFormData, setRootFormData] = useState(initialDataRef.current);
1614
- const mountedFormDataJsonRef = useRef(null);
1615
- const isInitialMountRef = useRef(true);
1616
- useEffect(() => {
1617
- isInitialMountRef.current = false;
1618
- }, [formKey]);
1619
- const onChangeRef = useRef(onChange);
1620
- onChangeRef.current = onChange;
1621
- const valueRef = useRef(value);
1622
- valueRef.current = value;
1623
- const lastSentJsonRef = useRef(null);
1624
- const debouncedOnChange = useMemo(
1625
- () => debounce((data) => {
1626
- const dataJson = stableStringify(data);
1627
- const storeJson = stableStringify(valueRef.current);
1628
- if (dataJson !== storeJson) {
1629
- if (lastSentJsonRef.current === null && mountedFormDataJsonRef.current && dataJson === mountedFormDataJsonRef.current) {
1630
- return;
1631
- }
1632
- lastSentJsonRef.current = dataJson;
1633
- onChangeRef.current(data);
1634
- }
1635
- }, 100),
1636
- []
1637
- );
1638
- useEffect(() => () => debouncedOnChange.cancel(), [debouncedOnChange]);
1639
- const [prevValue, setPrevValue] = useState(value);
1640
- if (value !== prevValue) {
1641
- setPrevValue(value);
1642
- const incomingJson = stableStringify(value);
1643
- if (incomingJson !== stableStringify(prevValue)) {
1644
- if (lastSentJsonRef.current && lastSentJsonRef.current === incomingJson) {
1645
- lastSentJsonRef.current = null;
1646
- } else {
1647
- debouncedOnChange.cancel();
1648
- lastSentJsonRef.current = null;
1649
- initialDataRef.current = value;
1650
- formDataRef.current = value;
1651
- isInitialMountRef.current = true;
1652
- mountedFormDataJsonRef.current = null;
1653
- setFormKey((k) => k + 1);
1654
- }
1655
- }
1656
- }
1657
- const handleChange = useCallback(
1658
- (e) => {
1659
- if (!e.formData) return;
1660
- formDataRef.current = e.formData;
1661
- setRootFormData(e.formData);
1662
- if (isInitialMountRef.current) {
1663
- mountedFormDataJsonRef.current = stableStringify(e.formData);
1664
- return;
1665
- }
1666
- debouncedOnChange(e.formData);
1667
- },
1668
- [debouncedOnChange]
1669
- );
1670
- const debouncedOnChangeRef = useRef(debouncedOnChange);
1671
- debouncedOnChangeRef.current = debouncedOnChange;
1672
- const setRootFormDataRef = useRef(setRootFormData);
1673
- setRootFormDataRef.current = setRootFormData;
1674
- const formContext = useMemo(
1675
- () => ({
1676
- setFormData: (data) => {
1677
- const merged = { ...formDataRef.current, ...data };
1678
- initialDataRef.current = merged;
1679
- formDataRef.current = merged;
1680
- setRootFormDataRef.current(merged);
1681
- debouncedOnChangeRef.current.cancel();
1682
- lastSentJsonRef.current = stableStringify(merged);
1683
- onChangeRef.current(merged);
1684
- isInitialMountRef.current = true;
1685
- mountedFormDataJsonRef.current = null;
1686
- setFormKey((k) => k + 1);
1687
- },
1688
- getFormData: () => formDataRef.current
1689
- }),
1690
- []
1691
- // stable — uses refs for all external values
1692
- );
1693
- const formRef = useRef(null);
1694
- useEffect(() => {
1695
- if (onRegisterValidate) {
1696
- onRegisterValidate(() => {
1697
- setHasValidated(true);
1698
- return formRef.current?.validateForm() ?? true;
1699
- });
1700
- }
1701
- }, [onRegisterValidate, formKey]);
1702
- return /* @__PURE__ */ jsx("div", { className: "json-editor", children: /* @__PURE__ */ jsx(RenderMarkdownProvider, { value: renderMarkdown ?? defaultRenderMarkdown, children: /* @__PURE__ */ jsx(RootFormDataProvider, { value: rootFormData, children: /* @__PURE__ */ jsx(
1703
- Form,
1704
- {
1705
- ref: formRef,
1706
- schema: schemaJs,
1707
- initialFormData: initialDataRef.current,
1708
- uiSchema,
1709
- validator,
1710
- onChange: handleChange,
1711
- widgets: mergedWidgets,
1712
- fields: mergedFields,
1713
- templates: defaultTemplates,
1714
- formContext,
1715
- disabled: readOnly,
1716
- liveValidate: hasValidated ? "onBlur" : void 0,
1717
- showErrorList: false,
1718
- noHtml5Validate: true,
1719
- tagName: inForm ? "div" : "form",
1720
- children: /* @__PURE__ */ jsx(Fragment, {})
1721
- },
1722
- formKey
1723
- ) }) }) });
1471
+ const RjsfSchemaEditor = ({ schema, value, onChange, readOnly, inForm, globalConfig, onRegisterValidate, widgets, fields, renderMarkdown, hasProtectedDefaultBranch = false }) => {
1472
+ const schemaJs = useMemo(() => sanitizeSchema(schema), [schema]);
1473
+ const uiSchema = useMemo(() => generateUiSchema(schema, readOnly, void 0, globalConfig ?? void 0, hasProtectedDefaultBranch), [
1474
+ schema,
1475
+ readOnly,
1476
+ globalConfig,
1477
+ hasProtectedDefaultBranch
1478
+ ]);
1479
+ const mergedWidgets = useMemo(() => ({
1480
+ ...defaultWidgets,
1481
+ ...widgets
1482
+ }), [widgets]);
1483
+ const mergedFields = useMemo(() => ({
1484
+ ...defaultFields,
1485
+ ...fields
1486
+ }), [fields]);
1487
+ const initialDataRef = useRef(value);
1488
+ const formDataRef = useRef(initialDataRef.current);
1489
+ const [formKey, setFormKey] = useState(0);
1490
+ const [hasValidated, setHasValidated] = useState(false);
1491
+ const [rootFormData, setRootFormData] = useState(initialDataRef.current);
1492
+ const mountedFormDataJsonRef = useRef(null);
1493
+ const isInitialMountRef = useRef(true);
1494
+ useEffect(() => {
1495
+ isInitialMountRef.current = false;
1496
+ }, [formKey]);
1497
+ const onChangeRef = useRef(onChange);
1498
+ onChangeRef.current = onChange;
1499
+ const valueRef = useRef(value);
1500
+ valueRef.current = value;
1501
+ const lastSentJsonRef = useRef(null);
1502
+ const debouncedOnChange = useMemo(() => debounce((data) => {
1503
+ const dataJson = stableStringify(data);
1504
+ if (dataJson !== stableStringify(valueRef.current)) {
1505
+ if (lastSentJsonRef.current === null && mountedFormDataJsonRef.current && dataJson === mountedFormDataJsonRef.current) return;
1506
+ lastSentJsonRef.current = dataJson;
1507
+ onChangeRef.current(data);
1508
+ }
1509
+ }, 100), []);
1510
+ useEffect(() => () => debouncedOnChange.cancel(), [debouncedOnChange]);
1511
+ const [prevValue, setPrevValue] = useState(value);
1512
+ if (value !== prevValue) {
1513
+ setPrevValue(value);
1514
+ const incomingJson = stableStringify(value);
1515
+ if (incomingJson !== stableStringify(prevValue)) {
1516
+ if (lastSentJsonRef.current && lastSentJsonRef.current === incomingJson) lastSentJsonRef.current = null;
1517
+ else {
1518
+ debouncedOnChange.cancel();
1519
+ lastSentJsonRef.current = null;
1520
+ initialDataRef.current = value;
1521
+ formDataRef.current = value;
1522
+ isInitialMountRef.current = true;
1523
+ mountedFormDataJsonRef.current = null;
1524
+ setFormKey((k) => k + 1);
1525
+ }
1526
+ }
1527
+ }
1528
+ const handleChange = useCallback((e) => {
1529
+ if (!e.formData) return;
1530
+ formDataRef.current = e.formData;
1531
+ setRootFormData(e.formData);
1532
+ if (isInitialMountRef.current) {
1533
+ mountedFormDataJsonRef.current = stableStringify(e.formData);
1534
+ return;
1535
+ }
1536
+ debouncedOnChange(e.formData);
1537
+ }, [debouncedOnChange]);
1538
+ const debouncedOnChangeRef = useRef(debouncedOnChange);
1539
+ debouncedOnChangeRef.current = debouncedOnChange;
1540
+ const setRootFormDataRef = useRef(setRootFormData);
1541
+ setRootFormDataRef.current = setRootFormData;
1542
+ const formContext = useMemo(() => ({
1543
+ setFormData: (data) => {
1544
+ const merged = {
1545
+ ...formDataRef.current,
1546
+ ...data
1547
+ };
1548
+ initialDataRef.current = merged;
1549
+ formDataRef.current = merged;
1550
+ setRootFormDataRef.current(merged);
1551
+ debouncedOnChangeRef.current.cancel();
1552
+ lastSentJsonRef.current = stableStringify(merged);
1553
+ onChangeRef.current(merged);
1554
+ isInitialMountRef.current = true;
1555
+ mountedFormDataJsonRef.current = null;
1556
+ setFormKey((k) => k + 1);
1557
+ },
1558
+ getFormData: () => formDataRef.current
1559
+ }), []);
1560
+ const formRef = useRef(null);
1561
+ useEffect(() => {
1562
+ if (onRegisterValidate) onRegisterValidate(() => {
1563
+ setHasValidated(true);
1564
+ return formRef.current?.validateForm() ?? true;
1565
+ });
1566
+ }, [onRegisterValidate, formKey]);
1567
+ return /* @__PURE__ */ jsx("div", {
1568
+ className: "json-editor",
1569
+ children: /* @__PURE__ */ jsx(RenderMarkdownProvider, {
1570
+ value: renderMarkdown ?? defaultRenderMarkdown,
1571
+ children: /* @__PURE__ */ jsx(RootFormDataProvider, {
1572
+ value: rootFormData,
1573
+ children: /* @__PURE__ */ jsx(Form, {
1574
+ ref: formRef,
1575
+ schema: schemaJs,
1576
+ initialFormData: initialDataRef.current,
1577
+ uiSchema,
1578
+ validator,
1579
+ onChange: handleChange,
1580
+ widgets: mergedWidgets,
1581
+ fields: mergedFields,
1582
+ templates: defaultTemplates,
1583
+ formContext,
1584
+ disabled: readOnly,
1585
+ liveValidate: hasValidated ? "onBlur" : void 0,
1586
+ showErrorList: false,
1587
+ noHtml5Validate: true,
1588
+ tagName: inForm ? "div" : "form",
1589
+ children: /* @__PURE__ */ jsx(Fragment$1, {})
1590
+ }, formKey)
1591
+ })
1592
+ })
1593
+ });
1724
1594
  };
1725
-
1595
+ //#endregion
1726
1596
  export { RjsfSchemaEditor, buildDynamicOptions, resolveByPath, useRootFormData };
1727
- //# sourceMappingURL=rjsf.js.map
1597
+
1728
1598
  //# sourceMappingURL=rjsf.js.map