@nolwenture/formik-jsonschema-form 2.0.2 → 3.0.0-beta.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 (811) hide show
  1. package/README.md +18 -0
  2. package/dist/cjs/common/types/index.js +2 -0
  3. package/dist/cjs/index.js +15 -5
  4. package/dist/cjs/v3/codemod/bindings.js +124 -0
  5. package/dist/cjs/v3/codemod/cli.js +89 -0
  6. package/dist/cjs/v3/codemod/migrate.js +21 -0
  7. package/dist/cjs/v3/codemod/package.js +5 -0
  8. package/dist/cjs/v3/codemod/slots.js +27 -0
  9. package/dist/cjs/v3/codemod/transform.js +61 -0
  10. package/dist/cjs/v3/document/fromDocument.js +50 -0
  11. package/dist/cjs/v3/document/index.js +9 -0
  12. package/dist/cjs/v3/document/render.js +22 -0
  13. package/dist/cjs/v3/raw/compat/v2utils.js +39 -0
  14. package/dist/cjs/v3/raw/core/arrays.js +55 -0
  15. package/dist/cjs/v3/raw/core/choiceStyle.js +14 -0
  16. package/dist/cjs/v3/raw/core/conditionals.js +88 -0
  17. package/dist/cjs/v3/raw/core/dates.js +74 -0
  18. package/dist/cjs/v3/raw/core/defaults.js +31 -0
  19. package/dist/cjs/v3/raw/core/enums.js +37 -0
  20. package/dist/cjs/v3/raw/core/initialValues.js +68 -0
  21. package/dist/cjs/v3/raw/core/issues.js +42 -0
  22. package/dist/cjs/v3/raw/core/json.js +58 -0
  23. package/dist/cjs/v3/raw/core/merge.js +51 -0
  24. package/dist/cjs/v3/raw/core/paths.js +88 -0
  25. package/dist/cjs/v3/raw/core/policies/fileUploadView.js +4 -0
  26. package/dist/cjs/v3/raw/core/policies/optionalNumberInitial.js +7 -0
  27. package/dist/cjs/v3/raw/core/policies/storedFormats.js +5 -0
  28. package/dist/cjs/v3/raw/core/refs.js +104 -0
  29. package/dist/cjs/v3/raw/core/schemaType.js +75 -0
  30. package/dist/cjs/v3/raw/core/titles.js +30 -0
  31. package/dist/cjs/v3/raw/core/trail.js +18 -0
  32. package/dist/cjs/v3/raw/core/uiProps.js +72 -0
  33. package/dist/cjs/v3/raw/core/uiSchema.js +56 -0
  34. package/dist/cjs/v3/raw/dom/bind.js +84 -0
  35. package/dist/cjs/v3/raw/dom/build.js +27 -0
  36. package/dist/cjs/v3/raw/dom/controller.js +87 -0
  37. package/dist/cjs/v3/raw/dom/core.js +67 -0
  38. package/dist/cjs/v3/raw/dom/delegate.js +31 -0
  39. package/dist/cjs/v3/raw/dom/effects.js +67 -0
  40. package/dist/cjs/v3/raw/dom/elements.js +88 -0
  41. package/dist/cjs/v3/raw/dom/emitter.js +47 -0
  42. package/dist/cjs/v3/raw/dom/nodes.js +25 -0
  43. package/dist/cjs/v3/raw/dom/render.js +122 -0
  44. package/dist/cjs/v3/raw/dom/upload.js +186 -0
  45. package/dist/cjs/v3/raw/i18n/en.js +47 -0
  46. package/dist/cjs/v3/raw/i18n/fi.js +44 -0
  47. package/dist/cjs/v3/raw/i18n/index.js +14 -0
  48. package/dist/cjs/v3/raw/index.js +98 -0
  49. package/dist/cjs/v3/raw/model/classes.js +9 -0
  50. package/dist/cjs/v3/raw/model/form/actions.js +154 -0
  51. package/dist/cjs/v3/raw/model/form/any.js +27 -0
  52. package/dist/cjs/v3/raw/model/form/appearance.js +32 -0
  53. package/dist/cjs/v3/raw/model/form/array.js +69 -0
  54. package/dist/cjs/v3/raw/model/form/choice.js +74 -0
  55. package/dist/cjs/v3/raw/model/form/chrome.js +65 -0
  56. package/dist/cjs/v3/raw/model/form/componentTable.js +148 -0
  57. package/dist/cjs/v3/raw/model/form/date.js +53 -0
  58. package/dist/cjs/v3/raw/model/form/dispatch.js +119 -0
  59. package/dist/cjs/v3/raw/model/form/iconData.js +19 -0
  60. package/dist/cjs/v3/raw/model/form/icons.js +10 -0
  61. package/dist/cjs/v3/raw/model/form/index.js +43 -0
  62. package/dist/cjs/v3/raw/model/form/leaf.js +99 -0
  63. package/dist/cjs/v3/raw/model/form/markup.js +46 -0
  64. package/dist/cjs/v3/raw/model/form/object.js +105 -0
  65. package/dist/cjs/v3/raw/model/form/parts.js +26 -0
  66. package/dist/cjs/v3/raw/model/form/searchable.js +81 -0
  67. package/dist/cjs/v3/raw/model/form/templated.js +22 -0
  68. package/dist/cjs/v3/raw/model/form/upload.js +88 -0
  69. package/dist/cjs/v3/raw/model/styledChains.js +43 -0
  70. package/dist/cjs/v3/raw/model/view/build.js +165 -0
  71. package/dist/cjs/v3/raw/model/view/fields.js +102 -0
  72. package/dist/cjs/v3/raw/model/view/index.js +10 -0
  73. package/dist/cjs/v3/raw/model/view/markup.js +62 -0
  74. package/dist/cjs/v3/raw/model/view/toVNode.js +67 -0
  75. package/dist/cjs/v3/raw/model/view/values.js +58 -0
  76. package/dist/cjs/v3/raw/model/vnode.js +21 -0
  77. package/dist/cjs/v3/raw/sanitize/index.js +10 -0
  78. package/dist/cjs/v3/raw/sanitize/sanitizeHtml.js +128 -0
  79. package/dist/cjs/v3/raw/serialize/toDOM.js +150 -0
  80. package/dist/cjs/v3/raw/serialize/toString.js +58 -0
  81. package/dist/cjs/v3/raw/store/createStore.js +133 -0
  82. package/dist/cjs/v3/raw/styles/color.js +112 -0
  83. package/dist/cjs/v3/raw/styles/colorNames.js +30 -0
  84. package/dist/cjs/v3/raw/styles/defaultStyles.js +114 -0
  85. package/dist/cjs/v3/raw/styles/index.js +24 -0
  86. package/dist/cjs/v3/raw/styles/themeToCssVars.js +60 -0
  87. package/dist/cjs/v3/raw/styles/vars.js +28 -0
  88. package/dist/cjs/v3/raw/validation/arrays.js +78 -0
  89. package/dist/cjs/v3/raw/validation/conditions.js +63 -0
  90. package/dist/cjs/v3/raw/validation/index.js +182 -0
  91. package/dist/cjs/v3/raw/validation/keywords.js +113 -0
  92. package/dist/cjs/v3/raw/validation/messages.js +14 -0
  93. package/dist/cjs/v3/raw/validation/patterns.js +74 -0
  94. package/dist/cjs/v3/react/chain.js +7 -0
  95. package/dist/cjs/v3/react/compat.js +11 -0
  96. package/dist/cjs/v3/react/componentsProp.js +23 -0
  97. package/dist/cjs/v3/react/defined.js +6 -0
  98. package/dist/cjs/v3/react/ejs/EJSField.js +75 -0
  99. package/dist/cjs/v3/react/ejs/index.js +8 -0
  100. package/dist/cjs/v3/react/form/components.js +105 -0
  101. package/dist/cjs/v3/react/form/fields.js +75 -0
  102. package/dist/cjs/v3/react/form/host.js +100 -0
  103. package/dist/cjs/{Form/FormRegistry.js → v3/react/form/registry.js} +6 -7
  104. package/dist/cjs/v3/react/form/root.js +42 -0
  105. package/dist/cjs/v3/react/form/runtime.js +117 -0
  106. package/dist/cjs/v3/react/form/templates.js +58 -0
  107. package/dist/cjs/v3/react/form/upload.js +173 -0
  108. package/dist/cjs/v3/react/form/uploadContexts.js +27 -0
  109. package/dist/cjs/v3/react/form/useSetDefault.js +21 -0
  110. package/dist/cjs/v3/react/hostCore.js +59 -0
  111. package/dist/cjs/v3/react/index.js +45 -0
  112. package/dist/cjs/v3/react/selector.js +17 -0
  113. package/dist/cjs/v3/react/slots.js +19 -0
  114. package/dist/cjs/v3/react/toReact.js +63 -0
  115. package/dist/cjs/v3/react/view/components.js +63 -0
  116. package/dist/cjs/v3/react/view/fields.js +46 -0
  117. package/dist/cjs/v3/react/view/host.js +36 -0
  118. package/dist/cjs/v3/react/view/registry.js +20 -0
  119. package/dist/cjs/v3/react/view/root.js +37 -0
  120. package/dist/cjs/v3/react/view/templates.js +50 -0
  121. package/dist/esm/common/types/index.js +2 -0
  122. package/dist/esm/index.js +8 -5
  123. package/dist/esm/v3/document/fromDocument.js +46 -0
  124. package/dist/esm/v3/document/index.js +4 -0
  125. package/dist/esm/v3/document/render.js +18 -0
  126. package/dist/esm/v3/raw/compat/v2utils.js +15 -0
  127. package/dist/esm/v3/raw/core/arrays.js +49 -0
  128. package/dist/esm/v3/raw/core/choiceStyle.js +10 -0
  129. package/dist/esm/v3/raw/core/conditionals.js +82 -0
  130. package/dist/esm/v3/raw/core/dates.js +66 -0
  131. package/dist/esm/v3/raw/core/defaults.js +25 -0
  132. package/dist/esm/v3/raw/core/enums.js +32 -0
  133. package/dist/esm/v3/raw/core/initialValues.js +65 -0
  134. package/dist/esm/v3/raw/core/issues.js +36 -0
  135. package/dist/esm/v3/raw/core/json.js +49 -0
  136. package/dist/esm/v3/raw/core/merge.js +47 -0
  137. package/dist/esm/v3/raw/core/paths.js +79 -0
  138. package/dist/esm/v3/raw/core/policies/fileUploadView.js +1 -0
  139. package/dist/esm/v3/raw/core/policies/optionalNumberInitial.js +3 -0
  140. package/dist/esm/v3/raw/core/policies/storedFormats.js +2 -0
  141. package/dist/esm/v3/raw/core/refs.js +97 -0
  142. package/dist/esm/v3/raw/core/schemaType.js +68 -0
  143. package/dist/esm/v3/raw/core/titles.js +25 -0
  144. package/dist/esm/v3/raw/core/trail.js +14 -0
  145. package/dist/esm/v3/raw/core/uiProps.js +68 -0
  146. package/dist/esm/v3/raw/core/uiSchema.js +47 -0
  147. package/dist/esm/v3/raw/dom/bind.js +80 -0
  148. package/dist/esm/v3/raw/dom/build.js +23 -0
  149. package/dist/esm/v3/raw/dom/controller.js +83 -0
  150. package/dist/esm/v3/raw/dom/core.js +63 -0
  151. package/dist/esm/v3/raw/dom/delegate.js +25 -0
  152. package/dist/esm/v3/raw/dom/effects.js +62 -0
  153. package/dist/esm/v3/raw/dom/elements.js +84 -0
  154. package/dist/esm/v3/raw/dom/emitter.js +43 -0
  155. package/dist/esm/v3/raw/dom/nodes.js +20 -0
  156. package/dist/esm/v3/raw/dom/render.js +118 -0
  157. package/dist/esm/v3/raw/dom/upload.js +182 -0
  158. package/dist/esm/v3/raw/i18n/en.js +44 -0
  159. package/dist/esm/v3/raw/i18n/fi.js +41 -0
  160. package/dist/esm/v3/raw/i18n/index.js +9 -0
  161. package/dist/esm/v3/raw/index.js +33 -0
  162. package/dist/esm/v3/raw/model/classes.js +5 -0
  163. package/dist/esm/v3/raw/model/form/actions.js +150 -0
  164. package/dist/esm/v3/raw/model/form/any.js +23 -0
  165. package/dist/esm/v3/raw/model/form/appearance.js +27 -0
  166. package/dist/esm/v3/raw/model/form/array.js +65 -0
  167. package/dist/esm/v3/raw/model/form/choice.js +65 -0
  168. package/dist/esm/v3/raw/model/form/chrome.js +58 -0
  169. package/dist/esm/v3/raw/model/form/componentTable.js +145 -0
  170. package/dist/esm/v3/raw/model/form/date.js +48 -0
  171. package/dist/esm/v3/raw/model/form/dispatch.js +114 -0
  172. package/dist/esm/v3/raw/model/form/iconData.js +16 -0
  173. package/dist/esm/v3/raw/model/form/icons.js +6 -0
  174. package/dist/esm/v3/raw/model/form/index.js +32 -0
  175. package/dist/esm/v3/raw/model/form/leaf.js +89 -0
  176. package/dist/esm/v3/raw/model/form/markup.js +35 -0
  177. package/dist/esm/v3/raw/model/form/object.js +100 -0
  178. package/dist/esm/v3/raw/model/form/parts.js +21 -0
  179. package/dist/esm/v3/raw/model/form/searchable.js +76 -0
  180. package/dist/esm/v3/raw/model/form/templated.js +17 -0
  181. package/dist/esm/v3/raw/model/form/upload.js +81 -0
  182. package/dist/esm/v3/raw/model/styledChains.js +40 -0
  183. package/dist/esm/v3/raw/model/view/build.js +158 -0
  184. package/dist/esm/v3/raw/model/view/fields.js +90 -0
  185. package/dist/esm/v3/raw/model/view/index.js +6 -0
  186. package/dist/esm/v3/raw/model/view/markup.js +48 -0
  187. package/dist/esm/v3/raw/model/view/toVNode.js +63 -0
  188. package/dist/esm/v3/raw/model/view/values.js +50 -0
  189. package/dist/esm/v3/raw/model/vnode.js +13 -0
  190. package/dist/esm/v3/raw/sanitize/index.js +2 -0
  191. package/dist/esm/v3/raw/sanitize/sanitizeHtml.js +119 -0
  192. package/dist/esm/v3/raw/serialize/toDOM.js +145 -0
  193. package/dist/esm/v3/raw/serialize/toString.js +52 -0
  194. package/dist/esm/v3/raw/store/createStore.js +126 -0
  195. package/dist/esm/v3/raw/styles/color.js +104 -0
  196. package/dist/esm/v3/raw/styles/colorNames.js +27 -0
  197. package/dist/esm/v3/raw/styles/defaultStyles.js +111 -0
  198. package/dist/esm/v3/raw/styles/index.js +14 -0
  199. package/dist/esm/v3/raw/styles/themeToCssVars.js +55 -0
  200. package/dist/esm/v3/raw/styles/vars.js +24 -0
  201. package/dist/esm/v3/raw/validation/arrays.js +40 -0
  202. package/dist/esm/v3/raw/validation/conditions.js +60 -0
  203. package/dist/esm/v3/raw/validation/index.js +146 -0
  204. package/dist/esm/v3/raw/validation/keywords.js +73 -0
  205. package/dist/esm/v3/raw/validation/messages.js +10 -0
  206. package/dist/esm/v3/raw/validation/patterns.js +68 -0
  207. package/dist/esm/v3/react/chain.js +4 -0
  208. package/dist/esm/v3/react/compat.js +8 -0
  209. package/dist/esm/v3/react/componentsProp.js +18 -0
  210. package/dist/esm/v3/react/defined.js +2 -0
  211. package/dist/esm/v3/react/ejs/EJSField.js +67 -0
  212. package/dist/esm/v3/react/ejs/index.js +3 -0
  213. package/dist/esm/v3/react/form/components.js +101 -0
  214. package/dist/esm/v3/react/form/fields.js +70 -0
  215. package/dist/esm/v3/react/form/host.js +95 -0
  216. package/dist/esm/{Form/FormRegistry.js → v3/react/form/registry.js} +5 -3
  217. package/dist/esm/v3/react/form/root.js +38 -0
  218. package/dist/esm/v3/react/form/runtime.js +113 -0
  219. package/dist/esm/v3/react/form/templates.js +55 -0
  220. package/dist/esm/v3/react/form/upload.js +168 -0
  221. package/dist/esm/v3/react/form/uploadContexts.js +24 -0
  222. package/dist/esm/v3/react/form/useSetDefault.js +17 -0
  223. package/dist/esm/v3/react/hostCore.js +52 -0
  224. package/dist/esm/v3/react/index.js +18 -0
  225. package/dist/esm/v3/react/selector.js +13 -0
  226. package/dist/esm/v3/react/slots.js +15 -0
  227. package/dist/esm/v3/react/toReact.js +58 -0
  228. package/dist/esm/v3/react/view/components.js +59 -0
  229. package/dist/esm/v3/react/view/fields.js +43 -0
  230. package/dist/esm/v3/react/view/host.js +32 -0
  231. package/dist/esm/v3/react/view/registry.js +16 -0
  232. package/dist/esm/v3/react/view/root.js +33 -0
  233. package/dist/esm/v3/react/view/templates.js +47 -0
  234. package/dist/types/common/types/Form.d.ts +9 -32
  235. package/dist/types/common/types/Utils.d.ts +11 -0
  236. package/dist/types/common/types/index.d.ts +2 -0
  237. package/dist/types/index.d.ts +6 -4
  238. package/dist/types/v3/codemod/bindings.d.ts +18 -0
  239. package/dist/types/v3/codemod/cli.d.ts +2 -0
  240. package/dist/types/v3/codemod/migrate.d.ts +8 -0
  241. package/dist/types/v3/codemod/package.d.ts +2 -0
  242. package/dist/types/v3/codemod/slots.d.ts +13 -0
  243. package/dist/types/v3/codemod/transform.d.ts +29 -0
  244. package/dist/types/v3/document/fromDocument.d.ts +22 -0
  245. package/dist/types/v3/document/index.d.ts +4 -0
  246. package/dist/types/v3/document/render.d.ts +11 -0
  247. package/dist/types/v3/raw/compat/v2utils.d.ts +14 -0
  248. package/dist/types/v3/raw/core/arrays.d.ts +22 -0
  249. package/dist/types/v3/raw/core/choiceStyle.d.ts +4 -0
  250. package/dist/types/v3/raw/core/conditionals.d.ts +6 -0
  251. package/dist/types/v3/raw/core/dates.d.ts +8 -0
  252. package/dist/types/v3/raw/core/defaults.d.ts +15 -0
  253. package/dist/types/v3/raw/core/enums.d.ts +18 -0
  254. package/dist/types/v3/raw/core/initialValues.d.ts +12 -0
  255. package/dist/types/v3/raw/core/issues.d.ts +17 -0
  256. package/dist/types/v3/raw/core/json.d.ts +52 -0
  257. package/dist/types/v3/raw/core/merge.d.ts +6 -0
  258. package/dist/types/v3/raw/core/paths.d.ts +17 -0
  259. package/dist/types/v3/raw/core/policies/fileUploadView.d.ts +2 -0
  260. package/dist/types/v3/raw/core/policies/optionalNumberInitial.d.ts +4 -0
  261. package/dist/types/v3/raw/core/policies/storedFormats.d.ts +4 -0
  262. package/dist/types/v3/raw/core/refs.d.ts +41 -0
  263. package/dist/types/v3/raw/core/schemaType.d.ts +16 -0
  264. package/dist/types/v3/raw/core/titles.d.ts +2 -0
  265. package/dist/types/v3/raw/core/trail.d.ts +5 -0
  266. package/dist/types/v3/raw/core/uiProps.d.ts +12 -0
  267. package/dist/types/v3/raw/core/uiSchema.d.ts +19 -0
  268. package/dist/types/v3/raw/dom/bind.d.ts +2 -0
  269. package/dist/types/v3/raw/dom/build.d.ts +10 -0
  270. package/dist/types/v3/raw/dom/controller.d.ts +37 -0
  271. package/dist/types/v3/raw/dom/core.d.ts +43 -0
  272. package/dist/types/v3/raw/dom/delegate.d.ts +18 -0
  273. package/dist/types/v3/raw/dom/effects.d.ts +18 -0
  274. package/dist/types/v3/raw/dom/elements.d.ts +17 -0
  275. package/dist/types/v3/raw/dom/emitter.d.ts +8 -0
  276. package/dist/types/v3/raw/dom/nodes.d.ts +3 -0
  277. package/dist/types/v3/raw/dom/render.d.ts +2 -0
  278. package/dist/types/v3/raw/dom/types.d.ts +112 -0
  279. package/dist/types/v3/raw/dom/upload.d.ts +16 -0
  280. package/dist/types/v3/raw/i18n/en.d.ts +42 -0
  281. package/dist/types/v3/raw/i18n/fi.d.ts +2 -0
  282. package/dist/types/v3/raw/i18n/index.d.ts +9 -0
  283. package/dist/types/v3/raw/index.d.ts +43 -0
  284. package/dist/types/v3/raw/model/classes.d.ts +2 -0
  285. package/dist/types/v3/raw/model/form/actions.d.ts +41 -0
  286. package/dist/types/v3/raw/model/form/any.d.ts +5 -0
  287. package/dist/types/v3/raw/model/form/appearance.d.ts +9 -0
  288. package/dist/types/v3/raw/model/form/array.d.ts +4 -0
  289. package/dist/types/v3/raw/model/form/choice.d.ts +16 -0
  290. package/dist/types/v3/raw/model/form/chrome.d.ts +20 -0
  291. package/dist/types/v3/raw/model/form/componentTable.d.ts +2 -0
  292. package/dist/types/v3/raw/model/form/date.d.ts +13 -0
  293. package/dist/types/v3/raw/model/form/dispatch.d.ts +13 -0
  294. package/dist/types/v3/raw/model/form/iconData.d.ts +4 -0
  295. package/dist/types/v3/raw/model/form/icons.d.ts +2 -0
  296. package/dist/types/v3/raw/model/form/index.d.ts +38 -0
  297. package/dist/types/v3/raw/model/form/leaf.d.ts +29 -0
  298. package/dist/types/v3/raw/model/form/markup.d.ts +39 -0
  299. package/dist/types/v3/raw/model/form/object.d.ts +9 -0
  300. package/dist/types/v3/raw/model/form/parts.d.ts +10 -0
  301. package/dist/types/v3/raw/model/form/searchable.d.ts +5 -0
  302. package/dist/types/v3/raw/model/form/templated.d.ts +14 -0
  303. package/dist/types/v3/raw/model/form/types.d.ts +179 -0
  304. package/dist/types/v3/raw/model/form/upload.d.ts +28 -0
  305. package/dist/types/v3/raw/model/host.d.ts +46 -0
  306. package/dist/types/v3/raw/model/styledChains.d.ts +1 -0
  307. package/dist/types/v3/raw/model/view/build.d.ts +21 -0
  308. package/dist/types/v3/raw/model/view/fields.d.ts +31 -0
  309. package/dist/types/v3/raw/model/view/index.d.ts +6 -0
  310. package/dist/types/v3/raw/model/view/markup.d.ts +39 -0
  311. package/dist/types/v3/raw/model/view/toVNode.d.ts +3 -0
  312. package/dist/types/v3/raw/model/view/types.d.ts +109 -0
  313. package/dist/types/v3/raw/model/view/values.d.ts +10 -0
  314. package/dist/types/v3/raw/model/vnode.d.ts +24 -0
  315. package/dist/types/v3/raw/sanitize/index.d.ts +2 -0
  316. package/dist/types/v3/raw/sanitize/sanitizeHtml.d.ts +30 -0
  317. package/dist/types/v3/raw/serialize/toDOM.d.ts +14 -0
  318. package/dist/types/v3/raw/serialize/toString.d.ts +4 -0
  319. package/dist/types/v3/raw/store/createStore.d.ts +39 -0
  320. package/dist/types/v3/raw/styles/color.d.ts +15 -0
  321. package/dist/types/v3/raw/styles/colorNames.d.ts +1 -0
  322. package/dist/types/v3/raw/styles/defaultStyles.d.ts +1 -0
  323. package/dist/types/v3/raw/styles/index.d.ts +8 -0
  324. package/dist/types/v3/raw/styles/themeToCssVars.d.ts +4 -0
  325. package/dist/types/v3/raw/styles/vars.d.ts +43 -0
  326. package/dist/types/v3/raw/validation/arrays.d.ts +16 -0
  327. package/dist/types/v3/raw/validation/conditions.d.ts +10 -0
  328. package/dist/types/v3/raw/validation/index.d.ts +30 -0
  329. package/dist/types/v3/raw/validation/keywords.d.ts +10 -0
  330. package/dist/types/v3/raw/validation/messages.d.ts +8 -0
  331. package/dist/types/v3/raw/validation/patterns.d.ts +8 -0
  332. package/dist/types/v3/react/chain.d.ts +1 -0
  333. package/dist/types/v3/react/compat.d.ts +4 -0
  334. package/dist/types/v3/react/componentsProp.d.ts +5 -0
  335. package/dist/types/v3/react/defined.d.ts +1 -0
  336. package/dist/types/v3/react/ejs/EJSField.d.ts +14 -0
  337. package/dist/types/v3/react/ejs/index.d.ts +1 -0
  338. package/dist/types/v3/react/form/components.d.ts +3 -0
  339. package/dist/types/v3/react/form/fields.d.ts +8 -0
  340. package/dist/types/v3/react/form/host.d.ts +9 -0
  341. package/dist/types/v3/react/form/registry.d.ts +46 -0
  342. package/dist/types/v3/react/form/root.d.ts +32 -0
  343. package/dist/types/v3/react/form/runtime.d.ts +3 -0
  344. package/dist/types/v3/react/form/templates.d.ts +1 -0
  345. package/dist/types/v3/react/form/upload.d.ts +3 -0
  346. package/dist/types/v3/react/form/uploadContexts.d.ts +34 -0
  347. package/dist/types/v3/react/form/useSetDefault.d.ts +5 -0
  348. package/dist/types/v3/react/hostCore.d.ts +24 -0
  349. package/dist/types/v3/react/index.d.ts +23 -0
  350. package/dist/types/v3/react/selector.d.ts +10 -0
  351. package/dist/types/v3/react/slots.d.ts +4 -0
  352. package/dist/types/v3/react/toReact.d.ts +10 -0
  353. package/dist/types/v3/react/view/components.d.ts +8 -0
  354. package/dist/types/v3/react/view/fields.d.ts +4 -0
  355. package/dist/types/v3/react/view/host.d.ts +6 -0
  356. package/dist/types/v3/react/view/registry.d.ts +34 -0
  357. package/dist/types/v3/react/view/root.d.ts +32 -0
  358. package/dist/types/v3/react/view/templates.d.ts +15 -0
  359. package/package.json +97 -11
  360. package/styles.css +187 -0
  361. package/dist/cjs/Form/Form.js +0 -38
  362. package/dist/cjs/Form/components/Clickable.js +0 -11
  363. package/dist/cjs/Form/components/ErrorMessage.js +0 -23
  364. package/dist/cjs/Form/components/FieldInfo.js +0 -144
  365. package/dist/cjs/Form/components/FieldInput.js +0 -86
  366. package/dist/cjs/Form/components/Form.js +0 -52
  367. package/dist/cjs/Form/components/Icon.js +0 -5
  368. package/dist/cjs/Form/components/RequiredIndicator.js +0 -9
  369. package/dist/cjs/Form/components/index.js +0 -58
  370. package/dist/cjs/Form/fields/AnyField/AnyField.js +0 -30
  371. package/dist/cjs/Form/fields/AnyField/index.js +0 -38
  372. package/dist/cjs/Form/fields/AnyField/styledComponents.js +0 -6
  373. package/dist/cjs/Form/fields/ArrayField/ArrayField.js +0 -130
  374. package/dist/cjs/Form/fields/ArrayField/index.js +0 -38
  375. package/dist/cjs/Form/fields/ArrayField/styledComponents.js +0 -22
  376. package/dist/cjs/Form/fields/BooleanField/BooleanField.js +0 -26
  377. package/dist/cjs/Form/fields/BooleanField/index.js +0 -38
  378. package/dist/cjs/Form/fields/BooleanField/styledComponents.js +0 -18
  379. package/dist/cjs/Form/fields/DateField/DateField.js +0 -26
  380. package/dist/cjs/Form/fields/DateField/DateInput.js +0 -121
  381. package/dist/cjs/Form/fields/DateField/dateParsing.js +0 -68
  382. package/dist/cjs/Form/fields/DateField/index.js +0 -42
  383. package/dist/cjs/Form/fields/DateField/styledComponents.js +0 -60
  384. package/dist/cjs/Form/fields/FileUploadField/FileUploadField.js +0 -69
  385. package/dist/cjs/Form/fields/FileUploadField/FileUploadFieldInput.js +0 -21
  386. package/dist/cjs/Form/fields/FileUploadField/index.js +0 -41
  387. package/dist/cjs/Form/fields/FileUploadField/styledComponents.js +0 -63
  388. package/dist/cjs/Form/fields/FilesUploadField/FilesUploadField.js +0 -102
  389. package/dist/cjs/Form/fields/FilesUploadField/FilesUploadFieldInput.js +0 -174
  390. package/dist/cjs/Form/fields/FilesUploadField/index.js +0 -41
  391. package/dist/cjs/Form/fields/FilesUploadField/styledComponents.js +0 -217
  392. package/dist/cjs/Form/fields/MultipleChoiceField/MultipleChoiceField.js +0 -35
  393. package/dist/cjs/Form/fields/MultipleChoiceField/MultipleChoiceFieldInput.js +0 -40
  394. package/dist/cjs/Form/fields/MultipleChoiceField/index.js +0 -41
  395. package/dist/cjs/Form/fields/MultipleChoiceField/styledComponents.js +0 -24
  396. package/dist/cjs/Form/fields/NullField/NullField.js +0 -15
  397. package/dist/cjs/Form/fields/NullField/index.js +0 -37
  398. package/dist/cjs/Form/fields/NumberField/NumberField.js +0 -16
  399. package/dist/cjs/Form/fields/NumberField/index.js +0 -38
  400. package/dist/cjs/Form/fields/NumberField/styledComponents.js +0 -6
  401. package/dist/cjs/Form/fields/ObjectField/ObjectField.js +0 -190
  402. package/dist/cjs/Form/fields/ObjectField/ObjectFieldSection.js +0 -17
  403. package/dist/cjs/Form/fields/ObjectField/index.js +0 -41
  404. package/dist/cjs/Form/fields/ObjectField/styledComponents.js +0 -50
  405. package/dist/cjs/Form/fields/ObjectField/types.js +0 -10
  406. package/dist/cjs/Form/fields/RadioField/RadioField.js +0 -19
  407. package/dist/cjs/Form/fields/RadioField/RadioFieldInput.js +0 -11
  408. package/dist/cjs/Form/fields/RadioField/index.js +0 -41
  409. package/dist/cjs/Form/fields/RadioField/styledComponents.js +0 -78
  410. package/dist/cjs/Form/fields/SchemaField/SchemaField.js +0 -38
  411. package/dist/cjs/Form/fields/SchemaField/index.js +0 -37
  412. package/dist/cjs/Form/fields/SearchableMultiTagSelectField/SearchableMultiTagSelectField.js +0 -20
  413. package/dist/cjs/Form/fields/SearchableMultiTagSelectField/SearchableMultiTagSelectFieldInput.js +0 -27
  414. package/dist/cjs/Form/fields/SearchableMultiTagSelectField/index.js +0 -41
  415. package/dist/cjs/Form/fields/SearchableMultiTagSelectField/styledComponents.js +0 -71
  416. package/dist/cjs/Form/fields/SearchableSelectField/SearchableSelectField.js +0 -147
  417. package/dist/cjs/Form/fields/SearchableSelectField/index.js +0 -40
  418. package/dist/cjs/Form/fields/SearchableSelectField/styledComponents.js +0 -53
  419. package/dist/cjs/Form/fields/StringField/StringField.js +0 -44
  420. package/dist/cjs/Form/fields/StringField/index.js +0 -37
  421. package/dist/cjs/Form/fields/StringField/styledComponents.js +0 -6
  422. package/dist/cjs/Form/fields/TextAreaField/TextAreaField.js +0 -21
  423. package/dist/cjs/Form/fields/TextAreaField/index.js +0 -38
  424. package/dist/cjs/Form/fields/TextAreaField/styledComponents.js +0 -17
  425. package/dist/cjs/Form/fields/ToggleField/ToggleField.js +0 -19
  426. package/dist/cjs/Form/fields/ToggleField/ToggleFieldInput.js +0 -11
  427. package/dist/cjs/Form/fields/ToggleField/index.js +0 -41
  428. package/dist/cjs/Form/fields/ToggleField/styledComponents.js +0 -58
  429. package/dist/cjs/Form/fields/index.js +0 -93
  430. package/dist/cjs/Form/hooks/index.js +0 -17
  431. package/dist/cjs/Form/hooks/useSetDefault.js +0 -32
  432. package/dist/cjs/Form/index.js +0 -26
  433. package/dist/cjs/Form/styles/common.js +0 -259
  434. package/dist/cjs/Form/templates/ArrayFieldTemplate/ArrayFieldTemplate.js +0 -36
  435. package/dist/cjs/Form/templates/ArrayFieldTemplate/index.js +0 -38
  436. package/dist/cjs/Form/templates/ArrayFieldTemplate/styledComponents.js +0 -28
  437. package/dist/cjs/Form/templates/CollapsibleObjectFieldTemplate/CollapsibleObjectFieldTemplate.js +0 -41
  438. package/dist/cjs/Form/templates/CollapsibleObjectFieldTemplate/index.js +0 -38
  439. package/dist/cjs/Form/templates/CollapsibleObjectFieldTemplate/styledComponents.js +0 -55
  440. package/dist/cjs/Form/templates/FieldTemplate/FieldTemplate.js +0 -28
  441. package/dist/cjs/Form/templates/FieldTemplate/index.js +0 -37
  442. package/dist/cjs/Form/templates/ObjectFieldTemplate/ObjectFieldTemplate.js +0 -32
  443. package/dist/cjs/Form/templates/ObjectFieldTemplate/index.js +0 -38
  444. package/dist/cjs/Form/templates/ObjectFieldTemplate/styledComponents.js +0 -57
  445. package/dist/cjs/Form/templates/index.js +0 -55
  446. package/dist/cjs/Form/types/index.js +0 -17
  447. package/dist/cjs/FormView/FormView.js +0 -36
  448. package/dist/cjs/FormView/FormViewRegistry.js +0 -19
  449. package/dist/cjs/FormView/components/Field.js +0 -131
  450. package/dist/cjs/FormView/components/Form.js +0 -9
  451. package/dist/cjs/FormView/components/Icon.js +0 -7
  452. package/dist/cjs/FormView/components/index.js +0 -56
  453. package/dist/cjs/FormView/fields/AnyField.js +0 -26
  454. package/dist/cjs/FormView/fields/ArrayField.js +0 -32
  455. package/dist/cjs/FormView/fields/BooleanField.js +0 -33
  456. package/dist/cjs/FormView/fields/DateField.js +0 -12
  457. package/dist/cjs/FormView/fields/EJSField.js +0 -39
  458. package/dist/cjs/FormView/fields/FileUploadField.js +0 -7
  459. package/dist/cjs/FormView/fields/FilesUploadField.js +0 -7
  460. package/dist/cjs/FormView/fields/MultipleChoiceField.js +0 -30
  461. package/dist/cjs/FormView/fields/NullField.js +0 -14
  462. package/dist/cjs/FormView/fields/NumberField.js +0 -12
  463. package/dist/cjs/FormView/fields/ObjectField/ObjectField.js +0 -57
  464. package/dist/cjs/FormView/fields/ObjectField/ObjectFieldSection.js +0 -11
  465. package/dist/cjs/FormView/fields/ObjectField/index.js +0 -41
  466. package/dist/cjs/FormView/fields/ObjectField/styledComponents.js +0 -6
  467. package/dist/cjs/FormView/fields/RadioField.js +0 -15
  468. package/dist/cjs/FormView/fields/SchemaField.js +0 -38
  469. package/dist/cjs/FormView/fields/SearchableMultiTagSelectField.js +0 -14
  470. package/dist/cjs/FormView/fields/SearchableSelectField.js +0 -13
  471. package/dist/cjs/FormView/fields/StringField.js +0 -24
  472. package/dist/cjs/FormView/fields/TextAreaField.js +0 -18
  473. package/dist/cjs/FormView/fields/ToggleField.js +0 -15
  474. package/dist/cjs/FormView/fields/index.js +0 -81
  475. package/dist/cjs/FormView/index.js +0 -25
  476. package/dist/cjs/FormView/templates/ArrayFieldTemplate/ArrayFieldTemplate.js +0 -20
  477. package/dist/cjs/FormView/templates/ArrayFieldTemplate/index.js +0 -38
  478. package/dist/cjs/FormView/templates/ArrayFieldTemplate/styledComponents.js +0 -15
  479. package/dist/cjs/FormView/templates/FieldTemplate/FieldTemplate.js +0 -18
  480. package/dist/cjs/FormView/templates/FieldTemplate/index.js +0 -37
  481. package/dist/cjs/FormView/templates/ObjectFieldTemplate/ObjectFieldTemplate.js +0 -30
  482. package/dist/cjs/FormView/templates/ObjectFieldTemplate/index.js +0 -38
  483. package/dist/cjs/FormView/templates/ObjectFieldTemplate/styledComponents.js +0 -65
  484. package/dist/cjs/FormView/templates/index.js +0 -52
  485. package/dist/cjs/common/FileUploadContext.js +0 -15
  486. package/dist/cjs/common/FilesUploadContext.js +0 -14
  487. package/dist/cjs/common/constants.js +0 -13
  488. package/dist/cjs/common/index.js +0 -20
  489. package/dist/cjs/utils/createInitialValues.js +0 -38
  490. package/dist/cjs/utils/createValidationSchema.js +0 -397
  491. package/dist/cjs/utils/deepOverlap.js +0 -18
  492. package/dist/cjs/utils/extractUiSchema.js +0 -22
  493. package/dist/cjs/utils/getEnums.js +0 -56
  494. package/dist/cjs/utils/getHiddenProperties.js +0 -11
  495. package/dist/cjs/utils/getStyle.js +0 -21
  496. package/dist/cjs/utils/getTitleAndDescription.js +0 -19
  497. package/dist/cjs/utils/getTypes.js +0 -60
  498. package/dist/cjs/utils/immutablySwapItems.js +0 -10
  499. package/dist/cjs/utils/index.js +0 -31
  500. package/dist/cjs/utils/mergeSchemas.js +0 -30
  501. package/dist/cjs/utils/orderAdditionalProperties.js +0 -12
  502. package/dist/cjs/utils/orderByUiSchema.js +0 -29
  503. package/dist/cjs/utils/resolveSchema.js +0 -117
  504. package/dist/cjs/utils/setTitleValues.js +0 -25
  505. package/dist/cjs/utils/solveReferences.js +0 -25
  506. package/dist/esm/Form/Form.js +0 -34
  507. package/dist/esm/Form/components/Clickable.js +0 -7
  508. package/dist/esm/Form/components/ErrorMessage.js +0 -16
  509. package/dist/esm/Form/components/FieldInfo.js +0 -140
  510. package/dist/esm/Form/components/FieldInput.js +0 -50
  511. package/dist/esm/Form/components/Form.js +0 -13
  512. package/dist/esm/Form/components/Icon.js +0 -2
  513. package/dist/esm/Form/components/RequiredIndicator.js +0 -6
  514. package/dist/esm/Form/components/index.js +0 -22
  515. package/dist/esm/Form/fields/AnyField/AnyField.js +0 -26
  516. package/dist/esm/Form/fields/AnyField/index.js +0 -2
  517. package/dist/esm/Form/fields/AnyField/styledComponents.js +0 -3
  518. package/dist/esm/Form/fields/ArrayField/ArrayField.js +0 -126
  519. package/dist/esm/Form/fields/ArrayField/index.js +0 -2
  520. package/dist/esm/Form/fields/ArrayField/styledComponents.js +0 -16
  521. package/dist/esm/Form/fields/BooleanField/BooleanField.js +0 -22
  522. package/dist/esm/Form/fields/BooleanField/index.js +0 -2
  523. package/dist/esm/Form/fields/BooleanField/styledComponents.js +0 -15
  524. package/dist/esm/Form/fields/DateField/DateField.js +0 -22
  525. package/dist/esm/Form/fields/DateField/DateInput.js +0 -117
  526. package/dist/esm/Form/fields/DateField/dateParsing.js +0 -62
  527. package/dist/esm/Form/fields/DateField/index.js +0 -3
  528. package/dist/esm/Form/fields/DateField/styledComponents.js +0 -54
  529. package/dist/esm/Form/fields/FileUploadField/FileUploadField.js +0 -65
  530. package/dist/esm/Form/fields/FileUploadField/FileUploadFieldInput.js +0 -17
  531. package/dist/esm/Form/fields/FileUploadField/index.js +0 -5
  532. package/dist/esm/Form/fields/FileUploadField/styledComponents.js +0 -57
  533. package/dist/esm/Form/fields/FilesUploadField/FilesUploadField.js +0 -98
  534. package/dist/esm/Form/fields/FilesUploadField/FilesUploadFieldInput.js +0 -137
  535. package/dist/esm/Form/fields/FilesUploadField/index.js +0 -5
  536. package/dist/esm/Form/fields/FilesUploadField/styledComponents.js +0 -211
  537. package/dist/esm/Form/fields/MultipleChoiceField/MultipleChoiceField.js +0 -31
  538. package/dist/esm/Form/fields/MultipleChoiceField/MultipleChoiceFieldInput.js +0 -36
  539. package/dist/esm/Form/fields/MultipleChoiceField/index.js +0 -5
  540. package/dist/esm/Form/fields/MultipleChoiceField/styledComponents.js +0 -18
  541. package/dist/esm/Form/fields/NullField/NullField.js +0 -11
  542. package/dist/esm/Form/fields/NullField/index.js +0 -1
  543. package/dist/esm/Form/fields/NumberField/NumberField.js +0 -12
  544. package/dist/esm/Form/fields/NumberField/index.js +0 -2
  545. package/dist/esm/Form/fields/NumberField/styledComponents.js +0 -3
  546. package/dist/esm/Form/fields/ObjectField/ObjectField.js +0 -186
  547. package/dist/esm/Form/fields/ObjectField/ObjectFieldSection.js +0 -13
  548. package/dist/esm/Form/fields/ObjectField/index.js +0 -5
  549. package/dist/esm/Form/fields/ObjectField/styledComponents.js +0 -47
  550. package/dist/esm/Form/fields/ObjectField/types.js +0 -7
  551. package/dist/esm/Form/fields/RadioField/RadioField.js +0 -15
  552. package/dist/esm/Form/fields/RadioField/RadioFieldInput.js +0 -7
  553. package/dist/esm/Form/fields/RadioField/index.js +0 -5
  554. package/dist/esm/Form/fields/RadioField/styledComponents.js +0 -75
  555. package/dist/esm/Form/fields/SchemaField/SchemaField.js +0 -34
  556. package/dist/esm/Form/fields/SchemaField/index.js +0 -1
  557. package/dist/esm/Form/fields/SearchableMultiTagSelectField/SearchableMultiTagSelectField.js +0 -16
  558. package/dist/esm/Form/fields/SearchableMultiTagSelectField/SearchableMultiTagSelectFieldInput.js +0 -23
  559. package/dist/esm/Form/fields/SearchableMultiTagSelectField/index.js +0 -5
  560. package/dist/esm/Form/fields/SearchableMultiTagSelectField/styledComponents.js +0 -68
  561. package/dist/esm/Form/fields/SearchableSelectField/SearchableSelectField.js +0 -143
  562. package/dist/esm/Form/fields/SearchableSelectField/index.js +0 -4
  563. package/dist/esm/Form/fields/SearchableSelectField/styledComponents.js +0 -50
  564. package/dist/esm/Form/fields/StringField/StringField.js +0 -40
  565. package/dist/esm/Form/fields/StringField/index.js +0 -1
  566. package/dist/esm/Form/fields/StringField/styledComponents.js +0 -3
  567. package/dist/esm/Form/fields/TextAreaField/TextAreaField.js +0 -17
  568. package/dist/esm/Form/fields/TextAreaField/index.js +0 -2
  569. package/dist/esm/Form/fields/TextAreaField/styledComponents.js +0 -11
  570. package/dist/esm/Form/fields/ToggleField/ToggleField.js +0 -15
  571. package/dist/esm/Form/fields/ToggleField/ToggleFieldInput.js +0 -7
  572. package/dist/esm/Form/fields/ToggleField/index.js +0 -5
  573. package/dist/esm/Form/fields/ToggleField/styledComponents.js +0 -55
  574. package/dist/esm/Form/fields/index.js +0 -57
  575. package/dist/esm/Form/hooks/index.js +0 -1
  576. package/dist/esm/Form/hooks/useSetDefault.js +0 -28
  577. package/dist/esm/Form/index.js +0 -7
  578. package/dist/esm/Form/styles/common.js +0 -256
  579. package/dist/esm/Form/templates/ArrayFieldTemplate/ArrayFieldTemplate.js +0 -32
  580. package/dist/esm/Form/templates/ArrayFieldTemplate/index.js +0 -2
  581. package/dist/esm/Form/templates/ArrayFieldTemplate/styledComponents.js +0 -24
  582. package/dist/esm/Form/templates/CollapsibleObjectFieldTemplate/CollapsibleObjectFieldTemplate.js +0 -37
  583. package/dist/esm/Form/templates/CollapsibleObjectFieldTemplate/index.js +0 -2
  584. package/dist/esm/Form/templates/CollapsibleObjectFieldTemplate/styledComponents.js +0 -51
  585. package/dist/esm/Form/templates/FieldTemplate/FieldTemplate.js +0 -24
  586. package/dist/esm/Form/templates/FieldTemplate/index.js +0 -1
  587. package/dist/esm/Form/templates/ObjectFieldTemplate/ObjectFieldTemplate.js +0 -28
  588. package/dist/esm/Form/templates/ObjectFieldTemplate/index.js +0 -2
  589. package/dist/esm/Form/templates/ObjectFieldTemplate/styledComponents.js +0 -53
  590. package/dist/esm/Form/templates/index.js +0 -19
  591. package/dist/esm/Form/types/index.js +0 -1
  592. package/dist/esm/FormView/FormView.js +0 -29
  593. package/dist/esm/FormView/FormViewRegistry.js +0 -13
  594. package/dist/esm/FormView/components/Field.js +0 -123
  595. package/dist/esm/FormView/components/Form.js +0 -6
  596. package/dist/esm/FormView/components/Icon.js +0 -4
  597. package/dist/esm/FormView/components/index.js +0 -17
  598. package/dist/esm/FormView/fields/AnyField.js +0 -22
  599. package/dist/esm/FormView/fields/ArrayField.js +0 -28
  600. package/dist/esm/FormView/fields/BooleanField.js +0 -29
  601. package/dist/esm/FormView/fields/DateField.js +0 -8
  602. package/dist/esm/FormView/fields/EJSField.js +0 -32
  603. package/dist/esm/FormView/fields/FileUploadField.js +0 -3
  604. package/dist/esm/FormView/fields/FilesUploadField.js +0 -3
  605. package/dist/esm/FormView/fields/MultipleChoiceField.js +0 -26
  606. package/dist/esm/FormView/fields/NullField.js +0 -10
  607. package/dist/esm/FormView/fields/NumberField.js +0 -8
  608. package/dist/esm/FormView/fields/ObjectField/ObjectField.js +0 -53
  609. package/dist/esm/FormView/fields/ObjectField/ObjectFieldSection.js +0 -7
  610. package/dist/esm/FormView/fields/ObjectField/index.js +0 -5
  611. package/dist/esm/FormView/fields/ObjectField/styledComponents.js +0 -3
  612. package/dist/esm/FormView/fields/RadioField.js +0 -11
  613. package/dist/esm/FormView/fields/SchemaField.js +0 -34
  614. package/dist/esm/FormView/fields/SearchableMultiTagSelectField.js +0 -10
  615. package/dist/esm/FormView/fields/SearchableSelectField.js +0 -9
  616. package/dist/esm/FormView/fields/StringField.js +0 -20
  617. package/dist/esm/FormView/fields/TextAreaField.js +0 -14
  618. package/dist/esm/FormView/fields/ToggleField.js +0 -11
  619. package/dist/esm/FormView/fields/index.js +0 -45
  620. package/dist/esm/FormView/index.js +0 -6
  621. package/dist/esm/FormView/templates/ArrayFieldTemplate/ArrayFieldTemplate.js +0 -16
  622. package/dist/esm/FormView/templates/ArrayFieldTemplate/index.js +0 -2
  623. package/dist/esm/FormView/templates/ArrayFieldTemplate/styledComponents.js +0 -11
  624. package/dist/esm/FormView/templates/FieldTemplate/FieldTemplate.js +0 -14
  625. package/dist/esm/FormView/templates/FieldTemplate/index.js +0 -1
  626. package/dist/esm/FormView/templates/ObjectFieldTemplate/ObjectFieldTemplate.js +0 -26
  627. package/dist/esm/FormView/templates/ObjectFieldTemplate/index.js +0 -2
  628. package/dist/esm/FormView/templates/ObjectFieldTemplate/styledComponents.js +0 -58
  629. package/dist/esm/FormView/templates/index.js +0 -16
  630. package/dist/esm/common/FileUploadContext.js +0 -12
  631. package/dist/esm/common/FilesUploadContext.js +0 -11
  632. package/dist/esm/common/constants.js +0 -10
  633. package/dist/esm/common/index.js +0 -4
  634. package/dist/esm/utils/createInitialValues.js +0 -35
  635. package/dist/esm/utils/createValidationSchema.js +0 -361
  636. package/dist/esm/utils/deepOverlap.js +0 -14
  637. package/dist/esm/utils/extractUiSchema.js +0 -18
  638. package/dist/esm/utils/getEnums.js +0 -51
  639. package/dist/esm/utils/getHiddenProperties.js +0 -7
  640. package/dist/esm/utils/getStyle.js +0 -18
  641. package/dist/esm/utils/getTitleAndDescription.js +0 -14
  642. package/dist/esm/utils/getTypes.js +0 -53
  643. package/dist/esm/utils/immutablySwapItems.js +0 -7
  644. package/dist/esm/utils/index.js +0 -15
  645. package/dist/esm/utils/mergeSchemas.js +0 -26
  646. package/dist/esm/utils/orderAdditionalProperties.js +0 -9
  647. package/dist/esm/utils/orderByUiSchema.js +0 -26
  648. package/dist/esm/utils/resolveSchema.js +0 -112
  649. package/dist/esm/utils/setTitleValues.js +0 -21
  650. package/dist/esm/utils/solveReferences.js +0 -22
  651. package/dist/types/Form/Form.d.ts +0 -2
  652. package/dist/types/Form/FormRegistry.d.ts +0 -3
  653. package/dist/types/Form/components/Clickable.d.ts +0 -15
  654. package/dist/types/Form/components/ErrorMessage.d.ts +0 -3
  655. package/dist/types/Form/components/FieldInfo.d.ts +0 -10
  656. package/dist/types/Form/components/FieldInput.d.ts +0 -19
  657. package/dist/types/Form/components/Form.d.ts +0 -6
  658. package/dist/types/Form/components/Icon.d.ts +0 -1
  659. package/dist/types/Form/components/RequiredIndicator.d.ts +0 -1
  660. package/dist/types/Form/components/index.d.ts +0 -249
  661. package/dist/types/Form/fields/AnyField/AnyField.d.ts +0 -2
  662. package/dist/types/Form/fields/AnyField/index.d.ts +0 -2
  663. package/dist/types/Form/fields/AnyField/styledComponents.d.ts +0 -3
  664. package/dist/types/Form/fields/ArrayField/ArrayField.d.ts +0 -2
  665. package/dist/types/Form/fields/ArrayField/index.d.ts +0 -2
  666. package/dist/types/Form/fields/ArrayField/styledComponents.d.ts +0 -13
  667. package/dist/types/Form/fields/BooleanField/BooleanField.d.ts +0 -2
  668. package/dist/types/Form/fields/BooleanField/index.d.ts +0 -2
  669. package/dist/types/Form/fields/BooleanField/styledComponents.d.ts +0 -3
  670. package/dist/types/Form/fields/DateField/DateField.d.ts +0 -2
  671. package/dist/types/Form/fields/DateField/DateInput.d.ts +0 -17
  672. package/dist/types/Form/fields/DateField/dateParsing.d.ts +0 -9
  673. package/dist/types/Form/fields/DateField/index.d.ts +0 -3
  674. package/dist/types/Form/fields/DateField/styledComponents.d.ts +0 -4
  675. package/dist/types/Form/fields/FileUploadField/FileUploadField.d.ts +0 -2
  676. package/dist/types/Form/fields/FileUploadField/FileUploadFieldInput.d.ts +0 -25
  677. package/dist/types/Form/fields/FileUploadField/index.d.ts +0 -17
  678. package/dist/types/Form/fields/FileUploadField/styledComponents.d.ts +0 -11
  679. package/dist/types/Form/fields/FilesUploadField/FilesUploadField.d.ts +0 -2
  680. package/dist/types/Form/fields/FilesUploadField/FilesUploadFieldInput.d.ts +0 -42
  681. package/dist/types/Form/fields/FilesUploadField/index.d.ts +0 -37
  682. package/dist/types/Form/fields/FilesUploadField/styledComponents.d.ts +0 -32
  683. package/dist/types/Form/fields/MultipleChoiceField/MultipleChoiceField.d.ts +0 -2
  684. package/dist/types/Form/fields/MultipleChoiceField/MultipleChoiceFieldInput.d.ts +0 -17
  685. package/dist/types/Form/fields/MultipleChoiceField/index.d.ts +0 -22
  686. package/dist/types/Form/fields/MultipleChoiceField/styledComponents.d.ts +0 -16
  687. package/dist/types/Form/fields/NullField/NullField.d.ts +0 -2
  688. package/dist/types/Form/fields/NullField/index.d.ts +0 -1
  689. package/dist/types/Form/fields/NumberField/NumberField.d.ts +0 -2
  690. package/dist/types/Form/fields/NumberField/index.d.ts +0 -2
  691. package/dist/types/Form/fields/NumberField/styledComponents.d.ts +0 -1
  692. package/dist/types/Form/fields/ObjectField/ObjectField.d.ts +0 -2
  693. package/dist/types/Form/fields/ObjectField/ObjectFieldSection.d.ts +0 -3
  694. package/dist/types/Form/fields/ObjectField/index.d.ts +0 -20
  695. package/dist/types/Form/fields/ObjectField/styledComponents.d.ts +0 -15
  696. package/dist/types/Form/fields/ObjectField/types.d.ts +0 -19
  697. package/dist/types/Form/fields/RadioField/RadioField.d.ts +0 -2
  698. package/dist/types/Form/fields/RadioField/RadioFieldInput.d.ts +0 -11
  699. package/dist/types/Form/fields/RadioField/index.d.ts +0 -22
  700. package/dist/types/Form/fields/RadioField/styledComponents.d.ts +0 -16
  701. package/dist/types/Form/fields/SchemaField/SchemaField.d.ts +0 -2
  702. package/dist/types/Form/fields/SchemaField/index.d.ts +0 -1
  703. package/dist/types/Form/fields/SearchableMultiTagSelectField/SearchableMultiTagSelectField.d.ts +0 -2
  704. package/dist/types/Form/fields/SearchableMultiTagSelectField/SearchableMultiTagSelectFieldInput.d.ts +0 -11
  705. package/dist/types/Form/fields/SearchableMultiTagSelectField/index.d.ts +0 -21
  706. package/dist/types/Form/fields/SearchableMultiTagSelectField/styledComponents.d.ts +0 -15
  707. package/dist/types/Form/fields/SearchableSelectField/SearchableSelectField.d.ts +0 -2
  708. package/dist/types/Form/fields/SearchableSelectField/index.d.ts +0 -2
  709. package/dist/types/Form/fields/SearchableSelectField/styledComponents.d.ts +0 -22
  710. package/dist/types/Form/fields/SearchableSelectField/types.d.ts +0 -25
  711. package/dist/types/Form/fields/StringField/StringField.d.ts +0 -2
  712. package/dist/types/Form/fields/StringField/index.d.ts +0 -1
  713. package/dist/types/Form/fields/StringField/styledComponents.d.ts +0 -3
  714. package/dist/types/Form/fields/TextAreaField/TextAreaField.d.ts +0 -2
  715. package/dist/types/Form/fields/TextAreaField/index.d.ts +0 -2
  716. package/dist/types/Form/fields/TextAreaField/styledComponents.d.ts +0 -5
  717. package/dist/types/Form/fields/ToggleField/ToggleField.d.ts +0 -2
  718. package/dist/types/Form/fields/ToggleField/ToggleFieldInput.d.ts +0 -6
  719. package/dist/types/Form/fields/ToggleField/index.d.ts +0 -13
  720. package/dist/types/Form/fields/ToggleField/styledComponents.d.ts +0 -7
  721. package/dist/types/Form/fields/index.d.ts +0 -191
  722. package/dist/types/Form/hooks/index.d.ts +0 -1
  723. package/dist/types/Form/hooks/useSetDefault.d.ts +0 -2
  724. package/dist/types/Form/index.d.ts +0 -8
  725. package/dist/types/Form/styles/common.d.ts +0 -2
  726. package/dist/types/Form/templates/ArrayFieldTemplate/ArrayFieldTemplate.d.ts +0 -2
  727. package/dist/types/Form/templates/ArrayFieldTemplate/index.d.ts +0 -2
  728. package/dist/types/Form/templates/ArrayFieldTemplate/styledComponents.d.ts +0 -30
  729. package/dist/types/Form/templates/CollapsibleObjectFieldTemplate/CollapsibleObjectFieldTemplate.d.ts +0 -2
  730. package/dist/types/Form/templates/CollapsibleObjectFieldTemplate/index.d.ts +0 -2
  731. package/dist/types/Form/templates/CollapsibleObjectFieldTemplate/styledComponents.d.ts +0 -36
  732. package/dist/types/Form/templates/FieldTemplate/FieldTemplate.d.ts +0 -2
  733. package/dist/types/Form/templates/FieldTemplate/index.d.ts +0 -1
  734. package/dist/types/Form/templates/ObjectFieldTemplate/ObjectFieldTemplate.d.ts +0 -2
  735. package/dist/types/Form/templates/ObjectFieldTemplate/index.d.ts +0 -2
  736. package/dist/types/Form/templates/ObjectFieldTemplate/styledComponents.d.ts +0 -27
  737. package/dist/types/Form/templates/index.d.ts +0 -57
  738. package/dist/types/Form/types/FormRegistryContext.d.ts +0 -23
  739. package/dist/types/Form/types/index.d.ts +0 -1
  740. package/dist/types/FormView/FormView.d.ts +0 -4
  741. package/dist/types/FormView/FormViewRegistry.d.ts +0 -3
  742. package/dist/types/FormView/components/Field.d.ts +0 -35
  743. package/dist/types/FormView/components/Form.d.ts +0 -1
  744. package/dist/types/FormView/components/Icon.d.ts +0 -1
  745. package/dist/types/FormView/components/index.d.ts +0 -53
  746. package/dist/types/FormView/fields/AnyField.d.ts +0 -2
  747. package/dist/types/FormView/fields/ArrayField.d.ts +0 -2
  748. package/dist/types/FormView/fields/BooleanField.d.ts +0 -2
  749. package/dist/types/FormView/fields/DateField.d.ts +0 -2
  750. package/dist/types/FormView/fields/EJSField.d.ts +0 -2
  751. package/dist/types/FormView/fields/FileUploadField.d.ts +0 -2
  752. package/dist/types/FormView/fields/FilesUploadField.d.ts +0 -2
  753. package/dist/types/FormView/fields/MultipleChoiceField.d.ts +0 -2
  754. package/dist/types/FormView/fields/NullField.d.ts +0 -2
  755. package/dist/types/FormView/fields/NumberField.d.ts +0 -2
  756. package/dist/types/FormView/fields/ObjectField/ObjectField.d.ts +0 -2
  757. package/dist/types/FormView/fields/ObjectField/ObjectFieldSection.d.ts +0 -7
  758. package/dist/types/FormView/fields/ObjectField/index.d.ts +0 -8
  759. package/dist/types/FormView/fields/ObjectField/styledComponents.d.ts +0 -2
  760. package/dist/types/FormView/fields/RadioField.d.ts +0 -2
  761. package/dist/types/FormView/fields/SchemaField.d.ts +0 -2
  762. package/dist/types/FormView/fields/SearchableMultiTagSelectField.d.ts +0 -2
  763. package/dist/types/FormView/fields/SearchableSelectField.d.ts +0 -2
  764. package/dist/types/FormView/fields/StringField.d.ts +0 -2
  765. package/dist/types/FormView/fields/TextAreaField.d.ts +0 -2
  766. package/dist/types/FormView/fields/ToggleField.d.ts +0 -2
  767. package/dist/types/FormView/fields/index.d.ts +0 -9
  768. package/dist/types/FormView/index.d.ts +0 -7
  769. package/dist/types/FormView/templates/ArrayFieldTemplate/ArrayFieldTemplate.d.ts +0 -2
  770. package/dist/types/FormView/templates/ArrayFieldTemplate/index.d.ts +0 -2
  771. package/dist/types/FormView/templates/ArrayFieldTemplate/styledComponents.d.ts +0 -10
  772. package/dist/types/FormView/templates/FieldTemplate/FieldTemplate.d.ts +0 -2
  773. package/dist/types/FormView/templates/FieldTemplate/index.d.ts +0 -1
  774. package/dist/types/FormView/templates/ObjectFieldTemplate/ObjectFieldTemplate.d.ts +0 -2
  775. package/dist/types/FormView/templates/ObjectFieldTemplate/index.d.ts +0 -2
  776. package/dist/types/FormView/templates/ObjectFieldTemplate/styledComponents.d.ts +0 -10
  777. package/dist/types/FormView/templates/index.d.ts +0 -23
  778. package/dist/types/FormView/types/FormViewRegistryContext.d.ts +0 -21
  779. package/dist/types/FormView/types/index.d.ts +0 -1
  780. package/dist/types/common/FileUploadContext.d.ts +0 -18
  781. package/dist/types/common/FilesUploadContext.d.ts +0 -17
  782. package/dist/types/common/constants.d.ts +0 -10
  783. package/dist/types/common/index.d.ts +0 -4
  784. package/dist/types/styles/types.d.ts +0 -216
  785. package/dist/types/utils/createInitialValues.d.ts +0 -7
  786. package/dist/types/utils/createValidationSchema.d.ts +0 -31
  787. package/dist/types/utils/deepOverlap.d.ts +0 -1
  788. package/dist/types/utils/extractUiSchema.d.ts +0 -9
  789. package/dist/types/utils/getEnums.d.ts +0 -30
  790. package/dist/types/utils/getHiddenProperties.d.ts +0 -2
  791. package/dist/types/utils/getStyle.d.ts +0 -5
  792. package/dist/types/utils/getTitleAndDescription.d.ts +0 -12
  793. package/dist/types/utils/getTypes.d.ts +0 -5
  794. package/dist/types/utils/immutablySwapItems.d.ts +0 -1
  795. package/dist/types/utils/index.d.ts +0 -15
  796. package/dist/types/utils/mergeSchemas.d.ts +0 -1
  797. package/dist/types/utils/orderAdditionalProperties.d.ts +0 -2
  798. package/dist/types/utils/orderByUiSchema.d.ts +0 -2
  799. package/dist/types/utils/resolveSchema.d.ts +0 -4
  800. package/dist/types/utils/setTitleValues.d.ts +0 -1
  801. package/dist/types/utils/solveReferences.d.ts +0 -10
  802. /package/dist/cjs/{Form/fields/SearchableSelectField/types.js → common/types/Utils.js} +0 -0
  803. /package/dist/cjs/{styles → v3/raw/dom}/types.js +0 -0
  804. /package/dist/cjs/{Form/types/FormRegistryContext.js → v3/raw/model/form/types.js} +0 -0
  805. /package/dist/cjs/{FormView/types/FormViewRegistryContext.js → v3/raw/model/host.js} +0 -0
  806. /package/dist/cjs/{FormView/types/index.js → v3/raw/model/view/types.js} +0 -0
  807. /package/dist/esm/{Form/fields/SearchableSelectField/types.js → common/types/Utils.js} +0 -0
  808. /package/dist/esm/{styles → v3/raw/dom}/types.js +0 -0
  809. /package/dist/esm/{Form/types/FormRegistryContext.js → v3/raw/model/form/types.js} +0 -0
  810. /package/dist/esm/{FormView/types/FormViewRegistryContext.js → v3/raw/model/host.js} +0 -0
  811. /package/dist/esm/{FormView/types/index.js → v3/raw/model/view/types.js} +0 -0
@@ -0,0 +1,68 @@
1
+ import { issue } from "../core/issues";
2
+ /** Values longer than this are not run through a pattern (they fail it instead). */
3
+ export const DEFAULT_PATTERN_INPUT_CAP = 10_000;
4
+ // Heuristics for catastrophic backtracking (not a full analyser; plan B-34 names
5
+ // recheck / safe-regex2 for later). Rejected:
6
+ // 1. a quantified group that itself contains a quantifier: (a+)+, (\w*)*, (x+){2,};
7
+ // 2. a quantified group whose alternatives can overlap: (a|aa)+, (a|a)*, (.|x)+.
8
+ // Benign patterns such as ^[a-z]+$, ^(\+358|0)\d+$ or ^([A-Z]|[0-9])+$ pass.
9
+ const NESTED_QUANTIFIER = /\((?:[^()\\]|\\.)*[*+}](?:[^()\\]|\\.)*\)\s*(?:[*+]|\{\d+,\d*\})/;
10
+ const QUANTIFIED_GROUP = /\(((?:[^()\\]|\\.)*\|(?:[^()\\]|\\.)*)\)\s*(?:[*+]|\{\d+,\d*\})/g;
11
+ const WILDCARD_START = /^(?:\.|\\[wWsSdD])/;
12
+ /** Splits on top-level `|`, keeping escapes and character classes intact. */
13
+ const alternatives = (body) => {
14
+ const parts = [];
15
+ let current = "";
16
+ let inClass = false;
17
+ for (let i = 0; i < body.length; i++) {
18
+ const ch = body[i];
19
+ if (ch === "\\") {
20
+ current += ch + (body[i + 1] ?? "");
21
+ i++;
22
+ }
23
+ else if (ch === "[" || ch === "]") {
24
+ inClass = ch === "[" ? true : false;
25
+ current += ch;
26
+ }
27
+ else if (ch === "|" && !inClass) {
28
+ parts.push(current);
29
+ current = "";
30
+ }
31
+ else
32
+ current += ch;
33
+ }
34
+ return [...parts, current].map((p) => p.replace(/^\?:/, ""));
35
+ };
36
+ const alternativesOverlap = (alts) => alts.some((a, i) => WILDCARD_START.test(a) || alts.some((b, j) => i !== j && (a === "" || b.startsWith(a))));
37
+ export const isUnsafePattern = (pattern) => {
38
+ if (NESTED_QUANTIFIER.test(pattern))
39
+ return true;
40
+ for (const match of pattern.matchAll(QUANTIFIED_GROUP)) {
41
+ if (alternativesOverlap(alternatives(match[1])))
42
+ return true;
43
+ }
44
+ return false;
45
+ };
46
+ /** A compiled pattern, or undefined when it is invalid or rejected (the keyword is skipped). */
47
+ export const compilePattern = (pattern, sink, path) => {
48
+ if (typeof pattern !== "string")
49
+ return undefined;
50
+ if (isUnsafePattern(pattern)) {
51
+ sink(issue("PATTERN_REJECTED", path, pattern));
52
+ return undefined;
53
+ }
54
+ try {
55
+ return new RegExp(pattern); // unanchored search, like JSON Schema (Q-VAL-1, kept)
56
+ }
57
+ catch {
58
+ sink(issue("PATTERN_INVALID", path, pattern));
59
+ return undefined;
60
+ }
61
+ };
62
+ /** Q-VAL-1 semantics with an input cap: over-long values never reach the regex. */
63
+ export const testPattern = (regex, value, cap) => {
64
+ if (value === undefined || value === null || value === "")
65
+ return true;
66
+ const text = String(value);
67
+ return text.length <= cap && regex.test(text);
68
+ };
@@ -0,0 +1,4 @@
1
+ // The $refs being expanded above a React boundary (SEC-REN-1 / SEC-REF-2 across custom templates
2
+ // and fields), shared by FormView and Form.
3
+ import { createContext } from "react";
4
+ export const ChainContext = createContext([]);
@@ -0,0 +1,8 @@
1
+ // 2.x root names with no other v3 home (C1, kept until 4.0).
2
+ import { createElement, forwardRef } from "react";
3
+ import { COMPONENT_TYPES as TYPES } from "../raw/model/form/dispatch";
4
+ import { asStyledSelector } from "./selector";
5
+ /** 2.x SchemaField's schema type -> field name table. */
6
+ export const COMPONENT_TYPES = Object.freeze({ ...TYPES });
7
+ /** 2.x FormView's outer wrapper (a styled div), as a compat primitive with its `fjsf-view-FormWrapper` class. */
8
+ export const FormWrapper = asStyledSelector(forwardRef(({ className, ...props }, ref) => createElement("div", { ...props, ref, className: ["fjsf-view-FormWrapper", className].filter(Boolean).join(" ") })), "div", ["fjsf-view-FormWrapper"]);
@@ -0,0 +1,18 @@
1
+ // D3 / Q-COMP-1: 2.x's `components` prop is replaced by `slots`. A leftover `components` is a type error
2
+ // (FormProps / FormViewProps declare it `never`), and at runtime it is ignored with one warning in
3
+ // development, so a call that still forwards it (pro3's exam mode HiddenErrorMessage) is not silently dropped.
4
+ let warned = false;
5
+ export const COMPONENTS_PROP_WARNING = "formik-jsonschema-form: the `components` prop is not supported in v3 and is ignored. Pass `slots` instead (each slot gets the library's component as `Default`); the fjsf-v3-codemod rewrites it.";
6
+ /** Warns once per process when `components` is passed (not in production). */
7
+ export const warnComponentsProp = (components) => {
8
+ if (warned || components === undefined)
9
+ return;
10
+ if (globalThis.process?.env?.NODE_ENV === "production")
11
+ return;
12
+ warned = true;
13
+ globalThis.console?.error?.(COMPONENTS_PROP_WARNING);
14
+ };
15
+ /** Tests: warn again. */
16
+ export const resetComponentsPropWarning = () => {
17
+ warned = false;
18
+ };
@@ -0,0 +1,2 @@
1
+ // A 2.x `Partial<FieldsType>` may carry `undefined` entries: they must not replace a built-in field.
2
+ export const defined = (map) => Object.fromEntries(Object.entries(map ?? {}).filter(([, v]) => v !== undefined));
@@ -0,0 +1,67 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useContext, useMemo } from "react";
3
+ import ejs from "ejs-browser";
4
+ import { useFormikContext } from "formik";
5
+ import { issue } from "../../raw/core/issues";
6
+ import { getIn } from "../../raw/core/paths";
7
+ import { getDescription, getTitle } from "../../raw/core/uiSchema";
8
+ import { sanitizeHtml, SanitizerUnavailableError } from "../../raw/sanitize";
9
+ import { FormViewRegistry, ViewRootContext } from "../view/registry";
10
+ const FIXED_ERROR = "Error rendering template.";
11
+ const hasWindow = () => typeof globalThis.window !== "undefined";
12
+ /** True when there is a sanitiser to put the output through (checked BEFORE the template runs). */
13
+ const sanitiserAvailable = () => {
14
+ try {
15
+ sanitizeHtml("");
16
+ return true;
17
+ }
18
+ catch (error) {
19
+ if (error instanceof SanitizerUnavailableError)
20
+ return false;
21
+ throw error;
22
+ }
23
+ };
24
+ /**
25
+ * The final HTML of the field, or `undefined` when nothing may be rendered. The template is NOT RUN unless the output can be
26
+ * sanitised: no window, or a window that cannot sanitise (a shim), reports `window` / `sanitizer` first. ejs-browser
27
+ * templates see Node's globals (SEC-SSR-2), so a server must never execute a tenant's template, and 2.x did (it ran it,
28
+ * then threw SANITIZER_UNAVAILABLE). A real DOM window in a server process still runs templates: only
29
+ * `setSanitizerWindow` without a global window stays disabled.
30
+ */
31
+ export const renderTemplate = (template, scope, onIssue) => {
32
+ if (!hasWindow()) {
33
+ onIssue("window");
34
+ return undefined;
35
+ }
36
+ if (!sanitiserAvailable()) {
37
+ onIssue("sanitizer");
38
+ return undefined;
39
+ }
40
+ let rendered;
41
+ try {
42
+ rendered = ejs.render(String(template), scope);
43
+ }
44
+ catch {
45
+ // SEC-EJS-4: an error becomes a fixed string; v3 also reports it
46
+ onIssue("error");
47
+ rendered = FIXED_ERROR;
48
+ }
49
+ return sanitizeHtml(rendered);
50
+ };
51
+ export const EJSField = (props) => {
52
+ const { components } = useContext(FormViewRegistry);
53
+ const { sink } = useContext(ViewRootContext);
54
+ const { name, uiSchema = {} } = props;
55
+ const values = useFormikContext()?.values;
56
+ const title = getTitle(props) || "Untitled Field";
57
+ const description = getDescription(props) || "No description available.";
58
+ const template = uiSchema["ui:options"]?.template ?? "No template provided.";
59
+ const value = getIn(values, name);
60
+ const html = useMemo(() => renderTemplate(template, { title, description, value }, (detail) => sink?.(issue("TEMPLATE_DISABLED", name, detail))),
61
+ // the sink is the host's reporting channel, not an input of the output
62
+ [template, title, description, name, value]);
63
+ if (html === undefined)
64
+ return null;
65
+ const Value = components.EJSFieldValue ?? "div";
66
+ return _jsx(Value, { dangerouslySetInnerHTML: { __html: html } });
67
+ };
@@ -0,0 +1,3 @@
1
+ // @nolwenture/formik-jsonschema-form/react/ejs (v3): the opt-in EJS field (D1, Q5).
2
+ // Needs the optional peer `ejs-browser`. Register it explicitly: `<FormView fields={{ EJSField }} />`.
3
+ export { EJSField, renderTemplate } from "./EJSField";
@@ -0,0 +1,101 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { createElement, forwardRef, useContext, useId, useState } from "react";
3
+ import { useFormikContext } from "formik";
4
+ import { getIn } from "../../raw/core/paths";
5
+ import { expandClasses } from "../../raw/model/classes";
6
+ import { FORM_COMPONENTS } from "../../raw/model/form/componentTable";
7
+ import { infoMarkup } from "../../raw/model/form/chrome";
8
+ import { createFormContext } from "../../raw/model/form";
9
+ import { toReact } from "../toReact";
10
+ import { withSlots } from "../slots";
11
+ import { asStyledSelector } from "../selector";
12
+ import { formBind, useFormRender } from "./host";
13
+ import { useFormBuild } from "./fields";
14
+ import { choicesInputMarkup, radioInputsMarkup, toggleInputMarkup } from "../../raw/model/form/choice";
15
+ import { FormRegistry, FormRuntimeContext } from "./registry";
16
+ const cx = (...names) => names.filter((n) => typeof n === "string" && n).join(" ");
17
+ const primitive = (name, [tag, ...chain]) => {
18
+ const classes = expandClasses(chain.map((n) => `fjsf-${n}`));
19
+ // `Default` (a slot's prop, forwarded by styled(FormComponents.X) slots) is never a DOM attribute.
20
+ const C = forwardRef(({ className, Default: _default, ...props }, ref) => createElement(tag, { ...props, ref, className: cx(...classes, className) }));
21
+ C.displayName = name;
22
+ return asStyledSelector(C, tag, classes);
23
+ };
24
+ const P = (name) => primitive(name, FORM_COMPONENTS[name]);
25
+ /** 2.x ErrorMessage: the field's error once it is touched. */
26
+ const ErrorMessage = ({ name }) => {
27
+ const formik = useFormikContext();
28
+ const error = getIn(formik?.errors, name);
29
+ if (!getIn(formik?.touched, name) || typeof error !== "string" || !error)
30
+ return null;
31
+ return _jsx("div", { className: "fjsf-ErrorText", children: error });
32
+ };
33
+ /** 2.x FieldInfo (ui:info): tooltip, or inline toggled by the link. */
34
+ const FieldInfo = (props) => {
35
+ const runtime = useContext(FormRuntimeContext);
36
+ const formik = useFormikContext();
37
+ const { formOptions } = useContext(FormRegistry);
38
+ const id = useId();
39
+ const ctx = createFormContext(undefined, undefined, { values: {} }, { ui: runtime.ui, formOptions });
40
+ // Rendered without the host: through it, `FieldInfo` would resolve to this component again.
41
+ return _jsx(_Fragment, { children: toReact(infoMarkup(ctx, id, props), { bind: formBind(runtime, formik) }) });
42
+ };
43
+ /** 2.x Form ObjectFieldSection: fieldset + legend, collapsible sections start collapsed. */
44
+ const ObjectFieldSection = ({ title, collapsible, children }) => {
45
+ const [collapsed, setCollapsed] = useState(!!collapsible);
46
+ const { components: c } = useContext(FormRegistry);
47
+ return (_jsxs(c.ObjectFieldSectionWrapper, { "data-fjsf-section": title ?? "", children: [_jsxs(c.ObjectFieldSectionTitle, { ...(collapsible ? { "data-fjsf-button": "collapse" } : {}), onClick: () => collapsible && setCollapsed((v) => !v), children: [title, _jsx(c.IconWrapper, { children: collapsible && (collapsed ? "▸" : "▾") })] }), _jsx(c.ObjectFieldSectionChildrenWrapper, { style: collapsed ? { display: "none" } : undefined, "data-fjsf-hidden": collapsed ? "true" : undefined, children: children })] }));
48
+ };
49
+ /** 2.x Clickable: a type="button" button. */
50
+ const Clickable = ({ children, onClick, onMouseDown, onMouseUp, innerRef, className, ariaLabel, ariaExpanded = false, ariaControls, id }) => (_jsx("button", { type: "button", className: cx("fjsf-ClickableEl", className), onClick: onClick, onMouseDown: onMouseDown, onMouseUp: onMouseUp, ref: innerRef, "aria-expanded": ariaExpanded, "aria-label": ariaLabel, "aria-controls": ariaControls, id: id, children: children }));
51
+ /** Inputs taking 2.x handler props (SearchableMultiTag, File(s)Upload): not provided standalone in 3.x (no pro3 use). */
52
+ const notYet = (name) => {
53
+ const C = () => null;
54
+ C.displayName = `${name} (not provided)`;
55
+ return C;
56
+ };
57
+ /** The 2.x input components of Radio/Toggle/MultipleChoice with their 2.x props, from the RAW markup. */
58
+ const inputComponent = (name, markup) => {
59
+ const C = (props) => {
60
+ const ctx = useFormBuild();
61
+ const render = useFormRender();
62
+ const p = { name: props.name, schema: { readOnly: props.inputProps?.readOnly }, ui: { "ui:props": props.inputProps ?? {} } };
63
+ return _jsx(_Fragment, { children: render(markup(ctx, p, props)) });
64
+ };
65
+ C.displayName = name;
66
+ return C;
67
+ };
68
+ export const FormComponents = {
69
+ ...Object.fromEntries(Object.entries(FORM_COMPONENTS).map(([name, entry]) => [name, entry === null ? undefined : entry === "fn" ? notYet(name) : P(name)])),
70
+ Clickable,
71
+ ErrorMessage,
72
+ FieldInfo,
73
+ ObjectFieldSection,
74
+ RadioFieldInput: inputComponent("RadioFieldInput", (ctx, p, props) => radioInputsMarkup(ctx, p, props.label)),
75
+ ToggleFieldInput: inputComponent("ToggleFieldInput", (ctx, p) => toggleInputMarkup(ctx, p)),
76
+ MultipleChoiceFieldInput: inputComponent("MultipleChoiceFieldInput", (ctx, p, props) => choicesInputMarkup(ctx, p, props.enums, props.style)),
77
+ /** 2.x helper (ObjectFieldTemplate): the object template's components from a map. */
78
+ getComponents: (components) => ({
79
+ Wrapper: components.ObjectFieldTemplateWrapper,
80
+ Title: components.ObjectFieldTemplateTitle,
81
+ TitleInfoWrapper: components.ObjectFieldTitleInfoWrapper,
82
+ Description: components.ObjectFieldTemplateDescription ?? components.FieldDescription,
83
+ Help: components.ObjectFieldTemplateHelp ?? components.FieldHelp,
84
+ Info: components.ObjectFieldTemplateInfo ?? components.FieldInfo,
85
+ RequiredIndicator: components.ObjectFieldTemplateRequiredIndicator ?? components.RequiredIndicator,
86
+ ErrorMessage: components.ObjectFieldTemplateErrorMessage ?? components.ErrorMessage,
87
+ }),
88
+ };
89
+ /** Override-only keys and the 2.x key they fall back to (getComponents of the templates). */
90
+ const FALLBACK = Object.fromEntries(Object.keys(FORM_COMPONENTS)
91
+ .filter((k) => FORM_COMPONENTS[k] === null)
92
+ .map((k) => {
93
+ const suffix = ["TitleInfoWrapper", "RequiredIndicator", "ErrorMessage", "Description", "Wrapper", "Title", "Help", "Info", "Icon"].find((s) => k.endsWith(s));
94
+ const target = {
95
+ TitleInfoWrapper: "ObjectFieldTitleInfoWrapper", RequiredIndicator: "RequiredIndicator", ErrorMessage: "ErrorMessage", Description: "FieldDescription",
96
+ Wrapper: "ObjectFieldTemplateWrapper", Title: "ObjectFieldTemplateTitle", Help: "FieldHelp", Info: "FieldInfo", Icon: "Icon",
97
+ };
98
+ return [k, target[suffix]];
99
+ }));
100
+ /** registry.components: the defaults with the caller's slots; `SubmitButton` is the submit button (FormButton). */
101
+ export const formCompatComponents = (slots = {}) => withSlots(FormComponents, FALLBACK, slots, { SubmitButton: "FormButton" });
@@ -0,0 +1,70 @@
1
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
+ import { useContext, useEffect, useRef } from "react";
3
+ import { useFormikContext } from "formik";
4
+ import { builtIn, createFormContext, formField, newAppearances, settle } from "../../raw/model/form";
5
+ import { ChainContext } from "../chain";
6
+ import { useFormRender } from "./host";
7
+ import { FormRegistry, FormRuntimeContext } from "./registry";
8
+ import { FileUploadField, FilesUploadField } from "./upload";
9
+ /** The RAW build context of the current form: Formik state, registry, replaced fields, UI state. */
10
+ export const useFormBuild = () => {
11
+ const registry = useContext(FormRegistry);
12
+ const runtime = useContext(FormRuntimeContext);
13
+ const formik = useFormikContext();
14
+ const fields = registry.fields ?? {};
15
+ return createFormContext(undefined, undefined, { values: formik?.values ?? {}, errors: formik?.errors, touched: formik?.touched, submitting: formik?.isSubmitting }, {
16
+ customFields: Object.keys(fields).filter((key) => fields[key] !== FormFields[key]),
17
+ formLocalization: registry.formLocalization,
18
+ formOptions: registry.formOptions,
19
+ locale: globalThis.navigator?.language,
20
+ ui: runtime.ui,
21
+ hideUnmarkedAdditionalProperties: registry.hideUnmarkedAdditionalProperties,
22
+ orderable: typeof registry.onAdditionalPropertyOrderChange === "function",
23
+ sink: runtime.sink,
24
+ definitions: registry.definitions ?? {},
25
+ defs: runtime.defs,
26
+ uiDefinitions: registry.uiSchemaDefinitions,
27
+ });
28
+ };
29
+ /** 2.x field props -> the RAW child props. */
30
+ export const childProps = (p) => ({
31
+ name: p.name ?? "",
32
+ schema: p.schema,
33
+ ui: p.uiSchema,
34
+ ...(p.required !== undefined ? { required: !!p.required } : {}),
35
+ ...(p["data-fjsf-hidden"] === "true" ? { hidden: true } : {}),
36
+ ...(p.forceDefaultValue ? { forceDefaultValue: true } : {}),
37
+ ...(p["data-fjsf-kind"] ? { kind: p["data-fjsf-kind"] } : {}),
38
+ });
39
+ const formFieldComponent = (displayName, build) => {
40
+ const F = (props) => {
41
+ const ctx = useFormBuild();
42
+ const chain = useContext(ChainContext);
43
+ const runtime = useContext(FormRuntimeContext);
44
+ const render = useFormRender();
45
+ const seen = useRef(new Set());
46
+ const node = build(ctx, childProps(props), chain);
47
+ useEffect(() => {
48
+ const fresh = newAppearances(ctx.appeared, seen.current);
49
+ if (fresh.length || ctx.prune.length)
50
+ runtime.settle((values) => settle(values, fresh, ctx.prune));
51
+ if (Object.keys(ctx.anyGuesses).length)
52
+ runtime.keepAnyTypes?.(ctx.anyGuesses);
53
+ });
54
+ return _jsx(_Fragment, { children: render(node) });
55
+ };
56
+ F.displayName = displayName;
57
+ return F;
58
+ };
59
+ export const SchemaField = formFieldComponent("SchemaField", (ctx, p, chain) => formField(ctx, p, chain));
60
+ const NAMES = [
61
+ "AnyField", "ArrayField", "BooleanField", "DateField", "FileUploadField", "FilesUploadField", "MultipleChoiceField", "NullField",
62
+ "NumberField", "ObjectField", "RadioField", "SearchableMultiTagSelectField", "SearchableSelectField", "StringField", "TextAreaField", "ToggleField",
63
+ ];
64
+ export const FormFields = {
65
+ ...Object.fromEntries(NAMES.map((name) => [name, formFieldComponent(name, (ctx, p, chain) => builtIn(ctx, name, p, chain))])),
66
+ SchemaField,
67
+ // Upload state is async and host-provided: React components over the RAW upload markup (upload.tsx).
68
+ FileUploadField: ((props) => _jsx(FileUploadField, { ...props })),
69
+ FilesUploadField: ((props) => _jsx(FilesUploadField, { ...props })),
70
+ };
@@ -0,0 +1,95 @@
1
+ import { createElement, Fragment, useContext } from "react";
2
+ import { useFormikContext } from "formik";
3
+ import { expandClasses } from "../../raw/model/classes";
4
+ import { FORM_COMPONENTS } from "../../raw/model/form/componentTable";
5
+ import { createHost } from "../hostCore";
6
+ import { toReact } from "../toReact";
7
+ import { FormComponents } from "./components";
8
+ import { FormTemplates } from "./templates";
9
+ import { FormRegistry, FormRuntimeContext } from "./registry";
10
+ const chainClasses = (names) => {
11
+ const entry = names.map((n) => FORM_COMPONENTS[n]).find(Array.isArray);
12
+ return entry ? expandClasses(entry.slice(1).map((n) => `fjsf-${n}`)) : [];
13
+ };
14
+ // Getters: components.tsx imports this module, so the defaults are read at render time, not at load.
15
+ export const formHost = createHost({
16
+ get components() {
17
+ return FormComponents;
18
+ },
19
+ get templates() {
20
+ return FormTemplates;
21
+ },
22
+ defaultClasses: chainClasses,
23
+ // 2.x passed the template's content: an array for objects, the single control for fields.
24
+ children: (_registry, host, env) => host.template === "FieldTemplate"
25
+ ? host.children.length === 1 ? toReact(host.children[0], env) : host.children.map((c, i) => createElement(Fragment, { key: i }, toReact(c, env)))
26
+ : host.children.map((c, i) => createElement(Fragment, { key: i }, toReact(c, env))),
27
+ });
28
+ export const formBind = (runtime, formik) => (node, props) => {
29
+ const on = node.on;
30
+ const out = { ...props };
31
+ if (on.change) {
32
+ const action = on.change;
33
+ if (node.tag === "input" && (node.attrs.type === "checkbox" || node.attrs.type === "radio")) {
34
+ out.checked = node.attrs.checked === true;
35
+ out.onChange = (e) => runtime.dispatch(action, { checked: e.target.checked, value: e.target.value });
36
+ }
37
+ else if (node.tag === "select" && node.attrs.multiple) {
38
+ out.value = Array.isArray(node.attrs.value) ? node.attrs.value : [];
39
+ out.onChange = (e) => runtime.dispatch(action, { selected: [...e.target.options].filter((o) => o.selected).map((o) => o.value) });
40
+ }
41
+ else {
42
+ out.value = node.attrs.value ?? "";
43
+ out.onChange = (e) => runtime.dispatch(action, { value: e.target.value });
44
+ }
45
+ }
46
+ if (on.blur)
47
+ out.onBlur = (e) => runtime.dispatch(on.blur, { value: e?.target?.value });
48
+ if (on.focus)
49
+ out.onFocus = () => runtime.dispatch(on.focus);
50
+ if (on.paste) {
51
+ out.onPaste = (e) => {
52
+ e.preventDefault?.();
53
+ runtime.dispatch(on.paste, { value: e.clipboardData?.getData("text")?.trim() ?? "" });
54
+ };
55
+ }
56
+ // focus leaving the field's container (React's onBlur bubbles like focusout)
57
+ if (on.focusout)
58
+ out.onBlur = (e) => runtime.dispatch(on.focusout, { leftContainer: !e.currentTarget?.contains(e.relatedTarget) });
59
+ if (on.mousedown)
60
+ out.onMouseDown = (e) => e.preventDefault?.();
61
+ // Q-SEL-2: Enter in a search input never submits the form (the document listener still selects).
62
+ if (on.keydown?.type === "preventEnter")
63
+ out.onKeyDown = (e) => e.key === "Enter" && e.preventDefault?.();
64
+ if (on.documentKeydown) {
65
+ const action = on.documentKeydown;
66
+ runtime.onDocumentKey?.(action.path, action.open ? action : undefined);
67
+ out.ref = runtime.keyTarget?.(action.path);
68
+ if (!action.open || (runtime.ui.active?.[action.path] ?? -1) < 0)
69
+ runtime.clearActive?.(action.path);
70
+ }
71
+ if (on.active) {
72
+ const { path, index } = on.active;
73
+ out.ref = runtime.scrollActive?.(path, index);
74
+ }
75
+ if (on.click) {
76
+ out.onClick = (e) => {
77
+ if (node.tag === "a" || on.click.type === "preventDefault")
78
+ e.preventDefault?.();
79
+ if (on.click.type !== "preventDefault")
80
+ runtime.dispatch(on.click);
81
+ };
82
+ }
83
+ if (on.submit) {
84
+ out.onSubmit = (e) => formik?.handleSubmit(e);
85
+ out.onReset = (e) => formik?.handleReset(e);
86
+ }
87
+ return out;
88
+ };
89
+ /** toReact with the current registry and runtime; holes are where React children go. */
90
+ export const useFormRender = () => {
91
+ const registry = useContext(FormRegistry);
92
+ const runtime = useContext(FormRuntimeContext);
93
+ const formik = useFormikContext();
94
+ return (node, hole, holes) => toReact(node, { host: formHost(registry, hole, holes), bind: formBind(runtime, formik) });
95
+ };
@@ -1,13 +1,15 @@
1
- import React from "react";
2
- export const FormRegistry = React.createContext({
1
+ import { createContext } from "react";
2
+ export const FormRegistry = createContext({
3
3
  fields: {},
4
4
  templates: {},
5
5
  components: {},
6
6
  definitions: {},
7
7
  uiSchemaDefinitions: {},
8
8
  formContext: {},
9
- formLocalization: {},
10
9
  formOptions: {},
10
+ formLocalization: {},
11
11
  useItemsAsAdditionalItems: false,
12
12
  hideUnmarkedAdditionalProperties: false,
13
13
  });
14
+ const noRuntime = { ui: {}, dispatch: () => undefined, settle: () => undefined };
15
+ export const FormRuntimeContext = createContext(noRuntime);
@@ -0,0 +1,38 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useMemo } from "react";
3
+ import { useFormikContext } from "formik";
4
+ import { isPlainObject } from "../../raw/core/json";
5
+ import { warnComponentsProp } from "../componentsProp";
6
+ import { defined } from "../defined";
7
+ import { formShell } from "../../raw/model/form";
8
+ import { hole } from "../../raw/model/vnode";
9
+ import { toReact } from "../toReact";
10
+ import { formCompatComponents } from "./components";
11
+ import { FormFields } from "./fields";
12
+ import { formBind, formHost } from "./host";
13
+ import { FormRegistry, FormRuntimeContext } from "./registry";
14
+ import { useFormRuntime } from "./runtime";
15
+ import { FormTemplates } from "./templates";
16
+ export const Form = (props) => {
17
+ warnComponentsProp(props.components);
18
+ const { schema, uiSchema = {}, className, children, fields, templates, slots, formContext = {}, formOptions = {}, formLocalization = {} } = props;
19
+ const formik = useFormikContext();
20
+ const registry = useMemo(() => ({
21
+ fields: { ...FormFields, ...defined(fields) },
22
+ templates: { ...FormTemplates, ...templates },
23
+ components: formCompatComponents(slots),
24
+ definitions: schema?.definitions,
25
+ uiSchemaDefinitions: uiSchema?.definitions,
26
+ formContext,
27
+ formOptions,
28
+ formLocalization,
29
+ useItemsAsAdditionalItems: props.useItemsAsAdditionalItems ?? false,
30
+ hideUnmarkedAdditionalProperties: props.hideUnmarkedAdditionalProperties ?? false,
31
+ onAdditionalPropertyOrderChange: props.onAdditionalPropertyOrderChange,
32
+ }), [schema, uiSchema, fields, templates, slots, formContext, formOptions, formLocalization, props.useItemsAsAdditionalItems, props.hideUnmarkedAdditionalProperties, props.onAdditionalPropertyOrderChange]);
33
+ const root = useMemo(() => ({ defs: isPlainObject(schema) && isPlainObject(schema.$defs) ? schema.$defs : undefined, sink: props.sink }), [schema, props.sink]);
34
+ const runtime = useFormRuntime(formik, registry, root);
35
+ const shell = formShell(hole("fields"), { className, hideSubmit: !!props.hideSubmit, submitting: formik?.isSubmitting, children: children !== undefined && children !== null && children !== false ? hole("children") : undefined });
36
+ const holes = { fields: _jsx(registry.fields.SchemaField, { name: "", schema: schema, uiSchema: uiSchema }), children };
37
+ return (_jsx(FormRegistry.Provider, { value: registry, children: _jsx(FormRuntimeContext.Provider, { value: runtime, children: toReact(shell, { host: formHost(registry, undefined, holes), bind: formBind(runtime, formik) }) }) }));
38
+ };
@@ -0,0 +1,113 @@
1
+ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
2
+ import { isPlainObject } from "../../raw/core/json";
3
+ import { setIn } from "../../raw/core/paths";
4
+ import { applyAction } from "../../raw/model/form";
5
+ /** 2.x DateInput openPicker: the native date input's picker, or focus + click. */
6
+ const openPicker = (id) => {
7
+ const el = globalThis.document?.getElementById(id);
8
+ if (!el)
9
+ return;
10
+ try {
11
+ if (typeof el.showPicker === "function")
12
+ el.showPicker();
13
+ else {
14
+ el.focus();
15
+ el.click();
16
+ }
17
+ }
18
+ catch {
19
+ el.focus();
20
+ el.click();
21
+ }
22
+ };
23
+ export const useFormRuntime = (formik, registry, root) => {
24
+ const [ui, setUi] = useState({});
25
+ const latest = useRef({ formik, registry, ui });
26
+ latest.current = { formik, registry, ui };
27
+ const pending = useRef([]);
28
+ const flush = useCallback(() => {
29
+ const queue = pending.current.splice(0);
30
+ const f = latest.current.formik;
31
+ if (!queue.length || !f)
32
+ return;
33
+ const before = f.values;
34
+ const next = queue.reduce((values, transform) => transform(values), before);
35
+ if (next !== before)
36
+ f.setValues(next);
37
+ }, []);
38
+ const settle = useCallback((transform) => {
39
+ if (pending.current.push(transform) === 1)
40
+ queueMicrotask(flush);
41
+ }, [flush]);
42
+ // The root's effect runs after every boundary's effect of the same commit.
43
+ useEffect(() => flush());
44
+ // 2.x searchable selects listened to the document's keydown while open; the bindings register them here.
45
+ const keyHandlers = useRef(new Map());
46
+ const keyTargets = useRef(new Map());
47
+ useEffect(() => {
48
+ const doc = globalThis.document;
49
+ if (!doc)
50
+ return;
51
+ // Q-SEL-1: only the open select whose container holds the key's target (the focused one) reacts.
52
+ const onKey = (e) => keyHandlers.current.forEach((action, path) => {
53
+ const el = keyTargets.current.get(path);
54
+ if (!el || el.contains(e.target))
55
+ latestDispatch.current(action, { keyName: e.key });
56
+ });
57
+ doc.addEventListener("keydown", onKey);
58
+ return () => doc.removeEventListener("keydown", onKey);
59
+ }, []);
60
+ const dispatch = useCallback((action, event = {}) => {
61
+ const { formik: f, registry: r, ui: u } = latest.current;
62
+ if (!f)
63
+ return;
64
+ const effect = applyAction(action, f.values, event, u);
65
+ if (effect.askKey) {
66
+ const key = typeof globalThis.prompt === "function" ? globalThis.prompt("Give key") : null;
67
+ return key ? dispatch(action, { ...event, key }) : undefined;
68
+ }
69
+ if (effect.touchQuietly !== undefined)
70
+ f.setFieldTouched(effect.touchQuietly, true, false);
71
+ if (effect.error)
72
+ f.setFieldError(effect.error.path, effect.error.message);
73
+ if (effect.picker)
74
+ openPicker(effect.picker);
75
+ if (effect.set) {
76
+ const { path, value } = effect.set;
77
+ if (!path)
78
+ f.setValues(value);
79
+ // BUG-109: formik's setIn throws on a primitive root (wrong-typed stored data); it becomes an object.
80
+ else if (!isPlainObject(f.values))
81
+ f.setValues(setIn({}, path, value));
82
+ else
83
+ f.setFieldValue(path, value);
84
+ }
85
+ if (effect.touch !== undefined)
86
+ f.setFieldTouched(effect.touch, true);
87
+ if (effect.ui)
88
+ setUi(effect.ui);
89
+ if (effect.order)
90
+ r.onAdditionalPropertyOrderChange?.(effect.order.path, effect.order.previous, effect.order.next);
91
+ }, []);
92
+ const latestDispatch = useRef(dispatch);
93
+ latestDispatch.current = dispatch;
94
+ const onDocumentKey = useCallback((path, action) => {
95
+ if (action)
96
+ keyHandlers.current.set(path, action);
97
+ else
98
+ keyHandlers.current.delete(path);
99
+ }, []);
100
+ const keyTarget = useCallback((path) => (el) => void (el ? keyTargets.current.set(path, el) : keyTargets.current.delete(path)), []);
101
+ // 2.x scrolled the active option into view (block "center"); guarded, once per change of the active option.
102
+ const scrolled = useRef(new Map());
103
+ const scrollActive = useCallback((path, index) => (el) => {
104
+ if (!el || scrolled.current.get(path) === index)
105
+ return;
106
+ scrolled.current.set(path, index);
107
+ if (typeof el.scrollIntoView === "function")
108
+ el.scrollIntoView({ behavior: "auto", block: "center", inline: "center" });
109
+ }, []);
110
+ const clearActive = useCallback((path) => void scrolled.current.delete(path), []);
111
+ const keepAnyTypes = useCallback((guesses) => setUi((u) => ({ ...u, anyTypes: { ...guesses, ...u.anyTypes } })), []);
112
+ return useMemo(() => ({ ui, dispatch, settle, onDocumentKey, keyTarget, keepAnyTypes, scrollActive, clearActive, ...root }), [ui, dispatch, settle, onDocumentKey, keyTarget, keepAnyTypes, scrollActive, clearActive, root.defs, root.sink]);
113
+ };