@wise/dynamic-flow-client 0.4.0 → 0.4.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 (465) hide show
  1. package/build/common/constants/DateMode.js +3 -2
  2. package/build/common/constants/DateMode.js.map +1 -0
  3. package/build/common/constants/FormControlType.js +3 -2
  4. package/build/common/constants/FormControlType.js.map +1 -0
  5. package/build/common/constants/MonthFormat.js +3 -2
  6. package/build/common/constants/MonthFormat.js.map +1 -0
  7. package/build/common/constants/SchemaType.js +3 -2
  8. package/build/common/constants/SchemaType.js.map +1 -0
  9. package/build/common/constants/Size.js +3 -2
  10. package/build/common/constants/Size.js.map +1 -0
  11. package/build/common/constants/index.js +2 -1
  12. package/build/common/constants/index.js.map +1 -0
  13. package/build/common/contexts/dynamicFlowContexts/DynamicFlowContexts.js +16 -27
  14. package/build/common/contexts/dynamicFlowContexts/DynamicFlowContexts.js.map +1 -0
  15. package/build/common/contexts/dynamicFlowContexts/usePendingPromiseCounter.js +12 -9
  16. package/build/common/contexts/dynamicFlowContexts/usePendingPromiseCounter.js.map +1 -0
  17. package/build/common/contexts/eventsContext/EventsContext.js +12 -28
  18. package/build/common/contexts/eventsContext/EventsContext.js.map +1 -0
  19. package/build/common/contexts/fetcherContexts/FetcherContexts.js +15 -27
  20. package/build/common/contexts/fetcherContexts/FetcherContexts.js.map +1 -0
  21. package/build/common/contexts/index.js +2 -1
  22. package/build/common/contexts/index.js.map +1 -0
  23. package/build/common/contexts/logContext/LogContext.js +13 -30
  24. package/build/common/contexts/logContext/LogContext.js.map +1 -0
  25. package/build/common/hooks/index.js +2 -1
  26. package/build/common/hooks/index.js.map +1 -0
  27. package/build/common/hooks/useDebouncedFunction/useDebouncedFunction.js +4 -3
  28. package/build/common/hooks/useDebouncedFunction/useDebouncedFunction.js.map +1 -0
  29. package/build/common/hooks/useExternal/useExternal.js +9 -8
  30. package/build/common/hooks/useExternal/useExternal.js.map +1 -0
  31. package/build/common/hooks/useExternalStepPolling/useExternalStepPolling.js +21 -31
  32. package/build/common/hooks/useExternalStepPolling/useExternalStepPolling.js.map +1 -0
  33. package/build/common/hooks/usePersistAsync/usePersistAsync.js +61 -139
  34. package/build/common/hooks/usePersistAsync/usePersistAsync.js.map +1 -0
  35. package/build/common/hooks/usePolling/usePolling.js +21 -21
  36. package/build/common/hooks/usePolling/usePolling.js.map +1 -0
  37. package/build/common/hooks/usePrevious/usePrevious.js +6 -5
  38. package/build/common/hooks/usePrevious/usePrevious.js.map +1 -0
  39. package/build/common/hooks/useStepPolling/useStepPolling.js +16 -14
  40. package/build/common/hooks/useStepPolling/useStepPolling.js.map +1 -0
  41. package/build/common/makeFetcher/index.js +2 -1
  42. package/build/common/makeFetcher/index.js.map +1 -0
  43. package/build/common/makeFetcher/makeFetcher.js +11 -24
  44. package/build/common/makeFetcher/makeFetcher.js.map +1 -0
  45. package/build/common/messages.js +6 -5
  46. package/build/common/messages.js.map +1 -0
  47. package/build/common/utils/api-utils.js +4 -4
  48. package/build/common/utils/api-utils.js.map +1 -0
  49. package/build/common/utils/date-utils.js +12 -11
  50. package/build/common/utils/date-utils.js.map +1 -0
  51. package/build/common/utils/debounce.js +12 -15
  52. package/build/common/utils/debounce.js.map +1 -0
  53. package/build/common/utils/file-utils.js +13 -25
  54. package/build/common/utils/file-utils.js.map +1 -0
  55. package/build/common/utils/id-utils.js +5 -5
  56. package/build/common/utils/id-utils.js.map +1 -0
  57. package/build/common/utils/index.js +2 -1
  58. package/build/common/utils/index.js.map +1 -0
  59. package/build/common/utils/is-equal.js +9 -8
  60. package/build/common/utils/is-equal.js.map +1 -0
  61. package/build/common/utils/schema-utils.js +7 -6
  62. package/build/common/utils/schema-utils.js.map +1 -0
  63. package/build/common/utils/step-utils.js +15 -14
  64. package/build/common/utils/step-utils.js.map +1 -0
  65. package/build/common/validators/index.js +8 -7
  66. package/build/common/validators/index.js.map +1 -0
  67. package/build/common/validators/models/model-validators.js +9 -8
  68. package/build/common/validators/models/model-validators.js.map +1 -0
  69. package/build/common/validators/models/models.utils.js +30 -42
  70. package/build/common/validators/models/models.utils.js.map +1 -0
  71. package/build/common/validators/schemas/schema-validators.js +12 -13
  72. package/build/common/validators/schemas/schema-validators.js.map +1 -0
  73. package/build/common/validators/types/type-validators.js +10 -13
  74. package/build/common/validators/types/type-validators.js.map +1 -0
  75. package/build/common/validators/validationFailures/validation-failures.js +15 -14
  76. package/build/common/validators/validationFailures/validation-failures.js.map +1 -0
  77. package/build/common/validators/validationFailures/validation-failures.utils.js +6 -7
  78. package/build/common/validators/validationFailures/validation-failures.utils.js.map +1 -0
  79. package/build/common/validators/values/value-validators.js +5 -6
  80. package/build/common/validators/values/value-validators.js.map +1 -0
  81. package/build/dynamicFlow/DynamicFlow.js +186 -307
  82. package/build/dynamicFlow/DynamicFlow.js.map +1 -0
  83. package/build/dynamicFlow/DynamicFlowStep.js +13 -23
  84. package/build/dynamicFlow/DynamicFlowStep.js.map +1 -0
  85. package/build/dynamicFlow/DynamicFlowTypes.js +2 -1
  86. package/build/dynamicFlow/DynamicFlowTypes.js.map +1 -0
  87. package/build/dynamicFlow/index.js +7 -14
  88. package/build/dynamicFlow/index.js.map +1 -0
  89. package/build/dynamicFlow/stories/DynamicFlow.story.js +21 -20
  90. package/build/dynamicFlow/stories/DynamicFlow.story.js.map +1 -0
  91. package/build/dynamicFlow/stories/EditableDynamicFlow.js +21 -33
  92. package/build/dynamicFlow/stories/EditableDynamicFlow.js.map +1 -0
  93. package/build/dynamicFlow/stories/fixtureFetcher.js +47 -104
  94. package/build/dynamicFlow/stories/fixtureFetcher.js.map +1 -0
  95. package/build/dynamicFlow/utils/errorBoundary/ErrorBoundary.js +23 -40
  96. package/build/dynamicFlow/utils/errorBoundary/ErrorBoundary.js.map +1 -0
  97. package/build/dynamicFlow/utils/errorBoundary/ErrorBoundary.messages.js +7 -6
  98. package/build/dynamicFlow/utils/errorBoundary/ErrorBoundary.messages.js.map +1 -0
  99. package/build/dynamicFlow/utils/errorBoundary/ErrorBoundaryAlert.js +11 -11
  100. package/build/dynamicFlow/utils/errorBoundary/ErrorBoundaryAlert.js.map +1 -0
  101. package/build/dynamicFlow/utils/index.js +6 -2
  102. package/build/dynamicFlow/utils/index.js.map +1 -0
  103. package/build/dynamicFlow/utils/responseParsers/response-parsers.js +54 -118
  104. package/build/dynamicFlow/utils/responseParsers/response-parsers.js.map +1 -0
  105. package/build/dynamicFlow/utils/useDebouncedRefresh/useDebouncedRefresh.js +10 -9
  106. package/build/dynamicFlow/utils/useDebouncedRefresh/useDebouncedRefresh.js.map +1 -0
  107. package/build/dynamicFlow/utils/useDynamicFlowState.js +52 -74
  108. package/build/dynamicFlow/utils/useDynamicFlowState.js.map +1 -0
  109. package/build/dynamicFlow/utils/useLoader.js +10 -20
  110. package/build/dynamicFlow/utils/useLoader.js.map +1 -0
  111. package/build/fixtures/components/alert.js +9 -8
  112. package/build/fixtures/components/alert.js.map +1 -0
  113. package/build/fixtures/components/box.js +8 -7
  114. package/build/fixtures/components/box.js.map +1 -0
  115. package/build/fixtures/components/button.js +26 -36
  116. package/build/fixtures/components/button.js.map +1 -0
  117. package/build/fixtures/components/columns.js +11 -10
  118. package/build/fixtures/components/columns.js.map +1 -0
  119. package/build/fixtures/components/copyable.js +7 -6
  120. package/build/fixtures/components/copyable.js.map +1 -0
  121. package/build/fixtures/components/decision.js +16 -15
  122. package/build/fixtures/components/decision.js.map +1 -0
  123. package/build/fixtures/components/heading.js +8 -7
  124. package/build/fixtures/components/heading.js.map +1 -0
  125. package/build/fixtures/components/image.js +11 -10
  126. package/build/fixtures/components/image.js.map +1 -0
  127. package/build/fixtures/components/index.js +18 -25
  128. package/build/fixtures/components/index.js.map +1 -0
  129. package/build/fixtures/components/info.js +23 -6
  130. package/build/fixtures/components/info.js.map +1 -0
  131. package/build/fixtures/components/list.js +9 -8
  132. package/build/fixtures/components/list.js.map +1 -0
  133. package/build/fixtures/components/loading-indicator.js +6 -5
  134. package/build/fixtures/components/loading-indicator.js.map +1 -0
  135. package/build/fixtures/components/paragraph.js +10 -9
  136. package/build/fixtures/components/paragraph.js.map +1 -0
  137. package/build/fixtures/components/review.js +12 -11
  138. package/build/fixtures/components/review.js.map +1 -0
  139. package/build/fixtures/examples/camera-capture.js +30 -29
  140. package/build/fixtures/examples/camera-capture.js.map +1 -0
  141. package/build/fixtures/examples/index.js +10 -17
  142. package/build/fixtures/examples/index.js.map +1 -0
  143. package/build/fixtures/examples/recipient-update.js +70 -69
  144. package/build/fixtures/examples/recipient-update.js.map +1 -0
  145. package/build/fixtures/examples/recipient.js +64 -63
  146. package/build/fixtures/examples/recipient.js.map +1 -0
  147. package/build/fixtures/examples/single-file-upload.js +22 -21
  148. package/build/fixtures/examples/single-file-upload.js.map +1 -0
  149. package/build/fixtures/examples/step-validation-errors.js +22 -21
  150. package/build/fixtures/examples/step-validation-errors.js.map +1 -0
  151. package/build/fixtures/features/action-response.js +9 -8
  152. package/build/fixtures/features/action-response.js.map +1 -0
  153. package/build/fixtures/features/external.js +9 -8
  154. package/build/fixtures/features/external.js.map +1 -0
  155. package/build/fixtures/features/index.js +10 -17
  156. package/build/fixtures/features/index.js.map +1 -0
  157. package/build/fixtures/features/persist-async.js +12 -11
  158. package/build/fixtures/features/persist-async.js.map +1 -0
  159. package/build/fixtures/features/polling.js +10 -9
  160. package/build/fixtures/features/polling.js.map +1 -0
  161. package/build/fixtures/features/validation-async.js +11 -10
  162. package/build/fixtures/features/validation-async.js.map +1 -0
  163. package/build/fixtures/index.js +12 -22
  164. package/build/fixtures/index.js.map +1 -0
  165. package/build/fixtures/jsonSchemaForm/allOf.js +31 -30
  166. package/build/fixtures/jsonSchemaForm/allOf.js.map +1 -0
  167. package/build/fixtures/jsonSchemaForm/audRecipient.js +272 -271
  168. package/build/fixtures/jsonSchemaForm/audRecipient.js.map +1 -0
  169. package/build/fixtures/jsonSchemaForm/currency.js +13 -12
  170. package/build/fixtures/jsonSchemaForm/currency.js.map +1 -0
  171. package/build/fixtures/jsonSchemaForm/multipleFileUploadBase64.js +12 -11
  172. package/build/fixtures/jsonSchemaForm/multipleFileUploadBase64.js.map +1 -0
  173. package/build/fixtures/jsonSchemaForm/multipleFileUploadBlob.js +12 -11
  174. package/build/fixtures/jsonSchemaForm/multipleFileUploadBlob.js.map +1 -0
  175. package/build/fixtures/jsonSchemaForm/oneOf.js +28 -27
  176. package/build/fixtures/jsonSchemaForm/oneOf.js.map +1 -0
  177. package/build/fixtures/jsonSchemaForm/oneOfTabs.js +17 -16
  178. package/build/fixtures/jsonSchemaForm/oneOfTabs.js.map +1 -0
  179. package/build/fixtures/jsonSchemaForm/promotedOneOf.js +18 -17
  180. package/build/fixtures/jsonSchemaForm/promotedOneOf.js.map +1 -0
  181. package/build/fixtures/jsonSchemaForm/promotedOneOfCheckbox.js +31 -30
  182. package/build/fixtures/jsonSchemaForm/promotedOneOfCheckbox.js.map +1 -0
  183. package/build/fixtures/jsonSchemaForm/simple.js +17 -16
  184. package/build/fixtures/jsonSchemaForm/simple.js.map +1 -0
  185. package/build/fixtures/jsonSchemaForm/uploadPersistAsync.js +20 -19
  186. package/build/fixtures/jsonSchemaForm/uploadPersistAsync.js.map +1 -0
  187. package/build/fixtures/jsonSchemaForm/validationAsync.js +9 -8
  188. package/build/fixtures/jsonSchemaForm/validationAsync.js.map +1 -0
  189. package/build/fixtures/layouts/all.js +38 -37
  190. package/build/fixtures/layouts/all.js.map +1 -0
  191. package/build/fixtures/layouts/final-step-layout.js +10 -9
  192. package/build/fixtures/layouts/final-step-layout.js.map +1 -0
  193. package/build/fixtures/layouts/index.js +11 -18
  194. package/build/fixtures/layouts/index.js.map +1 -0
  195. package/build/fixtures/layouts/list.js +11 -10
  196. package/build/fixtures/layouts/list.js.map +1 -0
  197. package/build/fixtures/layouts/pay-in.js +24 -23
  198. package/build/fixtures/layouts/pay-in.js.map +1 -0
  199. package/build/fixtures/layouts/review.js +39 -38
  200. package/build/fixtures/layouts/review.js.map +1 -0
  201. package/build/fixtures/layouts/success.js +16 -15
  202. package/build/fixtures/layouts/success.js.map +1 -0
  203. package/build/fixtures/responses/action-response-final.js +9 -8
  204. package/build/fixtures/responses/action-response-final.js.map +1 -0
  205. package/build/fixtures/responses/action.js +4 -3
  206. package/build/fixtures/responses/action.js.map +1 -0
  207. package/build/fixtures/responses/exit.js +4 -3
  208. package/build/fixtures/responses/exit.js.map +1 -0
  209. package/build/fixtures/responses/index.js +9 -16
  210. package/build/fixtures/responses/index.js.map +1 -0
  211. package/build/fixtures/responses/recipient-update-final.js +9 -8
  212. package/build/fixtures/responses/recipient-update-final.js.map +1 -0
  213. package/build/fixtures/schemas/basic-form.js +12 -11
  214. package/build/fixtures/schemas/basic-form.js.map +1 -0
  215. package/build/fixtures/schemas/index.js +9 -16
  216. package/build/fixtures/schemas/index.js.map +1 -0
  217. package/build/fixtures/schemas/number-and-integer.js +12 -11
  218. package/build/fixtures/schemas/number-and-integer.js.map +1 -0
  219. package/build/fixtures/schemas/one-of.js +44 -46
  220. package/build/fixtures/schemas/one-of.js.map +1 -0
  221. package/build/fixtures/schemas/string-formats.js +16 -15
  222. package/build/fixtures/schemas/string-formats.js.map +1 -0
  223. package/build/fixtures/utils/image-util.js +9 -8
  224. package/build/fixtures/utils/image-util.js.map +1 -0
  225. package/build/formControl/FormControl.js +119 -148
  226. package/build/formControl/FormControl.js.map +1 -0
  227. package/build/formControl/index.js +7 -14
  228. package/build/formControl/index.js.map +1 -0
  229. package/build/formControl/utils/index.js +2 -1
  230. package/build/formControl/utils/index.js.map +1 -0
  231. package/build/formControl/utils/value-utils.js +19 -23
  232. package/build/formControl/utils/value-utils.js.map +1 -0
  233. package/build/i18n/index.js +32 -31
  234. package/build/i18n/index.js.map +1 -0
  235. package/build/index.js +14 -10
  236. package/build/index.js.map +1 -0
  237. package/build/jsonSchemaForm/JsonSchemaForm.js +13 -24
  238. package/build/jsonSchemaForm/JsonSchemaForm.js.map +1 -0
  239. package/build/jsonSchemaForm/allOfSchema/AllOfSchema.js +25 -37
  240. package/build/jsonSchemaForm/allOfSchema/AllOfSchema.js.map +1 -0
  241. package/build/jsonSchemaForm/allOfSchema/index.js +7 -14
  242. package/build/jsonSchemaForm/allOfSchema/index.js.map +1 -0
  243. package/build/jsonSchemaForm/arrayTypeSchema/ArraySchema.js +10 -20
  244. package/build/jsonSchemaForm/arrayTypeSchema/ArraySchema.js.map +1 -0
  245. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.js +10 -20
  246. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.js.map +1 -0
  247. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/index.js +7 -14
  248. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/index.js.map +1 -0
  249. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.js +57 -115
  250. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.js.map +1 -0
  251. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.messages.js +8 -7
  252. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.messages.js.map +1 -0
  253. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/index.js +7 -14
  254. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/index.js.map +1 -0
  255. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/index.js +2 -1
  256. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/index.js.map +1 -0
  257. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/upload-utils.js +20 -71
  258. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/upload-utils.js.map +1 -0
  259. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/useFormattedDefaultErrorMessages.js +11 -11
  260. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/useFormattedDefaultErrorMessages.js.map +1 -0
  261. package/build/jsonSchemaForm/arrayTypeSchema/index.js +7 -14
  262. package/build/jsonSchemaForm/arrayTypeSchema/index.js.map +1 -0
  263. package/build/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.js +46 -62
  264. package/build/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.js.map +1 -0
  265. package/build/jsonSchemaForm/basicTypeSchema/index.js +7 -14
  266. package/build/jsonSchemaForm/basicTypeSchema/index.js.map +1 -0
  267. package/build/jsonSchemaForm/controlFeedback/ControlFeedback.js +40 -50
  268. package/build/jsonSchemaForm/controlFeedback/ControlFeedback.js.map +1 -0
  269. package/build/jsonSchemaForm/controlFeedback/ControlFeedback.messages.js +19 -18
  270. package/build/jsonSchemaForm/controlFeedback/ControlFeedback.messages.js.map +1 -0
  271. package/build/jsonSchemaForm/controlFeedback/index.js +7 -14
  272. package/build/jsonSchemaForm/controlFeedback/index.js.map +1 -0
  273. package/build/jsonSchemaForm/genericSchema/GenericSchema.js +53 -61
  274. package/build/jsonSchemaForm/genericSchema/GenericSchema.js.map +1 -0
  275. package/build/jsonSchemaForm/genericSchema/index.js +7 -14
  276. package/build/jsonSchemaForm/genericSchema/index.js.map +1 -0
  277. package/build/jsonSchemaForm/help/Help.js +10 -9
  278. package/build/jsonSchemaForm/help/Help.js.map +1 -0
  279. package/build/jsonSchemaForm/help/Help.messages.js +6 -5
  280. package/build/jsonSchemaForm/help/Help.messages.js.map +1 -0
  281. package/build/jsonSchemaForm/help/index.js +7 -14
  282. package/build/jsonSchemaForm/help/index.js.map +1 -0
  283. package/build/jsonSchemaForm/index.js +7 -14
  284. package/build/jsonSchemaForm/index.js.map +1 -0
  285. package/build/jsonSchemaForm/objectSchema/ObjectSchema.js +29 -49
  286. package/build/jsonSchemaForm/objectSchema/ObjectSchema.js.map +1 -0
  287. package/build/jsonSchemaForm/objectSchema/index.js +7 -14
  288. package/build/jsonSchemaForm/objectSchema/index.js.map +1 -0
  289. package/build/jsonSchemaForm/oneOfSchema/OneOfSchema.js +55 -74
  290. package/build/jsonSchemaForm/oneOfSchema/OneOfSchema.js.map +1 -0
  291. package/build/jsonSchemaForm/oneOfSchema/index.js +7 -14
  292. package/build/jsonSchemaForm/oneOfSchema/index.js.map +1 -0
  293. package/build/jsonSchemaForm/oneOfSchema/utils/const-schema-utils.js +4 -3
  294. package/build/jsonSchemaForm/oneOfSchema/utils/const-schema-utils.js.map +1 -0
  295. package/build/jsonSchemaForm/oneOfSchema/utils/index.js +2 -1
  296. package/build/jsonSchemaForm/oneOfSchema/utils/index.js.map +1 -0
  297. package/build/jsonSchemaForm/oneOfSchema/utils/one-of-utils.js +20 -20
  298. package/build/jsonSchemaForm/oneOfSchema/utils/one-of-utils.js.map +1 -0
  299. package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.js +12 -22
  300. package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.js.map +1 -0
  301. package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.messages.js +6 -5
  302. package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.messages.js.map +1 -0
  303. package/build/jsonSchemaForm/persistAsyncSchema/index.js +7 -14
  304. package/build/jsonSchemaForm/persistAsyncSchema/index.js.map +1 -0
  305. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.js +74 -127
  306. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.js.map +1 -0
  307. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/index.js +7 -14
  308. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/index.js.map +1 -0
  309. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.js +46 -110
  310. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.js.map +1 -0
  311. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.js +18 -17
  312. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.js.map +1 -0
  313. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/index.js +7 -14
  314. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/index.js.map +1 -0
  315. package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.js +29 -47
  316. package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.js.map +1 -0
  317. package/build/jsonSchemaForm/promotedOneOfSchema/index.js +7 -14
  318. package/build/jsonSchemaForm/promotedOneOfSchema/index.js.map +1 -0
  319. package/build/jsonSchemaForm/promotedOneOfSchema/promoted-one-of-utils.js +5 -4
  320. package/build/jsonSchemaForm/promotedOneOfSchema/promoted-one-of-utils.js.map +1 -0
  321. package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.js +14 -24
  322. package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.js.map +1 -0
  323. package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.js +12 -22
  324. package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.js.map +1 -0
  325. package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.js +13 -23
  326. package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.js.map +1 -0
  327. package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.js +25 -26
  328. package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.js.map +1 -0
  329. package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.js +7 -6
  330. package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.js.map +1 -0
  331. package/build/jsonSchemaForm/readOnlySchema/index.js +7 -14
  332. package/build/jsonSchemaForm/readOnlySchema/index.js.map +1 -0
  333. package/build/jsonSchemaForm/schemaFormControl/SchemaFormControl.js +27 -39
  334. package/build/jsonSchemaForm/schemaFormControl/SchemaFormControl.js.map +1 -0
  335. package/build/jsonSchemaForm/schemaFormControl/index.js +7 -14
  336. package/build/jsonSchemaForm/schemaFormControl/index.js.map +1 -0
  337. package/build/jsonSchemaForm/schemaFormControl/utils/currency-utils.js +6 -5
  338. package/build/jsonSchemaForm/schemaFormControl/utils/currency-utils.js.map +1 -0
  339. package/build/jsonSchemaForm/schemaFormControl/utils/index.js +2 -1
  340. package/build/jsonSchemaForm/schemaFormControl/utils/index.js.map +1 -0
  341. package/build/jsonSchemaForm/schemaFormControl/utils/mapping-utils.js +31 -47
  342. package/build/jsonSchemaForm/schemaFormControl/utils/mapping-utils.js.map +1 -0
  343. package/build/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.js +58 -119
  344. package/build/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.js.map +1 -0
  345. package/build/jsonSchemaForm/validationAsyncSchema/index.js +7 -14
  346. package/build/jsonSchemaForm/validationAsyncSchema/index.js.map +1 -0
  347. package/build/layout/DynamicLayout.js +11 -21
  348. package/build/layout/DynamicLayout.js.map +1 -0
  349. package/build/layout/alert/DynamicAlert.js +10 -9
  350. package/build/layout/alert/DynamicAlert.js.map +1 -0
  351. package/build/layout/box/DynamicBox.js +13 -23
  352. package/build/layout/box/DynamicBox.js.map +1 -0
  353. package/build/layout/button/DynamicButton.js +17 -27
  354. package/build/layout/button/DynamicButton.js.map +1 -0
  355. package/build/layout/columns/DynamicColumns.js +14 -24
  356. package/build/layout/columns/DynamicColumns.js.map +1 -0
  357. package/build/layout/decision/DynamicDecision.js +17 -27
  358. package/build/layout/decision/DynamicDecision.js.map +1 -0
  359. package/build/layout/divider/DynamicDivider.js +8 -8
  360. package/build/layout/divider/DynamicDivider.js.map +1 -0
  361. package/build/layout/external/DynamicExternal.js +17 -28
  362. package/build/layout/external/DynamicExternal.js.map +1 -0
  363. package/build/layout/external/DynamicExternal.messages.js +6 -5
  364. package/build/layout/external/DynamicExternal.messages.js.map +1 -0
  365. package/build/layout/form/DynamicForm.js +11 -21
  366. package/build/layout/form/DynamicForm.js.map +1 -0
  367. package/build/layout/heading/DynamicHeading.js +13 -23
  368. package/build/layout/heading/DynamicHeading.js.map +1 -0
  369. package/build/layout/icon/DynamicIcon.js +10 -10
  370. package/build/layout/icon/DynamicIcon.js.map +1 -0
  371. package/build/layout/image/DynamicImage.js +44 -93
  372. package/build/layout/image/DynamicImage.js.map +1 -0
  373. package/build/layout/index.js +22 -29
  374. package/build/layout/index.js.map +1 -0
  375. package/build/layout/info/DynamicInfo.js +8 -19
  376. package/build/layout/info/DynamicInfo.js.map +1 -0
  377. package/build/layout/list/DynamicList.js +15 -26
  378. package/build/layout/list/DynamicList.js.map +1 -0
  379. package/build/layout/loadingIndicator/DynamicLoadingIndicator.js +9 -9
  380. package/build/layout/loadingIndicator/DynamicLoadingIndicator.js.map +1 -0
  381. package/build/layout/paragraph/DynamicParagraph.js +20 -37
  382. package/build/layout/paragraph/DynamicParagraph.js.map +1 -0
  383. package/build/layout/paragraph/DynamicParagraph.messages.js +7 -6
  384. package/build/layout/paragraph/DynamicParagraph.messages.js.map +1 -0
  385. package/build/layout/paragraph/useSnackBarIfAvailable.js +5 -4
  386. package/build/layout/paragraph/useSnackBarIfAvailable.js.map +1 -0
  387. package/build/layout/review/DynamicReview.js +15 -26
  388. package/build/layout/review/DynamicReview.js.map +1 -0
  389. package/build/layout/utils.js +5 -6
  390. package/build/layout/utils.js.map +1 -0
  391. package/build/step/cameraStep/CameraStep.js +43 -88
  392. package/build/step/cameraStep/CameraStep.js.map +1 -0
  393. package/build/step/cameraStep/cameraCapture/CameraCapture.js +49 -105
  394. package/build/step/cameraStep/cameraCapture/CameraCapture.js.map +1 -0
  395. package/build/step/cameraStep/cameraCapture/CameraCapture.messages.js +8 -7
  396. package/build/step/cameraStep/cameraCapture/CameraCapture.messages.js.map +1 -0
  397. package/build/step/cameraStep/cameraCapture/components/index.js +11 -28
  398. package/build/step/cameraStep/cameraCapture/components/index.js.map +1 -0
  399. package/build/step/cameraStep/cameraCapture/hooks/index.js +18 -72
  400. package/build/step/cameraStep/cameraCapture/hooks/index.js.map +1 -0
  401. package/build/step/cameraStep/cameraCapture/index.js +7 -14
  402. package/build/step/cameraStep/cameraCapture/index.js.map +1 -0
  403. package/build/step/cameraStep/cameraCapture/overlay/Overlay.js +34 -45
  404. package/build/step/cameraStep/cameraCapture/overlay/Overlay.js.map +1 -0
  405. package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.js +9 -19
  406. package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.js.map +1 -0
  407. package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.messages.js +7 -6
  408. package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.messages.js.map +1 -0
  409. package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.js +10 -21
  410. package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.js.map +1 -0
  411. package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.js +8 -7
  412. package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.js.map +1 -0
  413. package/build/step/cameraStep/cameraCapture/screens/index.js +7 -14
  414. package/build/step/cameraStep/cameraCapture/screens/index.js.map +1 -0
  415. package/build/step/cameraStep/cameraCapture/tracking/index.js +18 -99
  416. package/build/step/cameraStep/cameraCapture/tracking/index.js.map +1 -0
  417. package/build/step/cameraStep/cameraCapture/utils/index.js +34 -96
  418. package/build/step/cameraStep/cameraCapture/utils/index.js.map +1 -0
  419. package/build/step/cameraStep/index.js +7 -14
  420. package/build/step/cameraStep/index.js.map +1 -0
  421. package/build/step/externalConfirmationStep/ExternalConfirmationStep.js +21 -21
  422. package/build/step/externalConfirmationStep/ExternalConfirmationStep.js.map +1 -0
  423. package/build/step/externalConfirmationStep/ExternalConfirmationStep.messages.js +9 -8
  424. package/build/step/externalConfirmationStep/ExternalConfirmationStep.messages.js.map +1 -0
  425. package/build/step/externalConfirmationStep/index.js +7 -14
  426. package/build/step/externalConfirmationStep/index.js.map +1 -0
  427. package/build/step/index.js +8 -15
  428. package/build/step/index.js.map +1 -0
  429. package/build/step/layoutStep/LayoutStep.js +20 -19
  430. package/build/step/layoutStep/LayoutStep.js.map +1 -0
  431. package/build/step/layoutStep/index.js +7 -14
  432. package/build/step/layoutStep/index.js.map +1 -0
  433. package/build/step/layoutStep/utils/index.js +4 -14
  434. package/build/step/layoutStep/utils/index.js.map +1 -0
  435. package/build/step/layoutStep/utils/inline-reference-utils.js +30 -46
  436. package/build/step/layoutStep/utils/inline-reference-utils.js.map +1 -0
  437. package/build/step/layoutStep/utils/layout-utils.js +35 -53
  438. package/build/step/layoutStep/utils/layout-utils.js.map +1 -0
  439. package/build/types/common/FormControl.js +2 -1
  440. package/build/types/common/FormControl.js.map +1 -0
  441. package/build/types/index.js +14 -13
  442. package/build/types/index.js.map +1 -0
  443. package/build/types/specification/Action.js +2 -1
  444. package/build/types/specification/Action.js.map +1 -0
  445. package/build/types/specification/FileUploadSchema.js +2 -1
  446. package/build/types/specification/FileUploadSchema.js.map +1 -0
  447. package/build/types/specification/LayoutComponent.js +2 -1
  448. package/build/types/specification/LayoutComponent.js.map +1 -0
  449. package/build/types/specification/Model.js +10 -17
  450. package/build/types/specification/Model.js.map +1 -0
  451. package/build/types/specification/PersistAsync.js +2 -1
  452. package/build/types/specification/PersistAsync.js.map +1 -0
  453. package/build/types/specification/Polling.js +2 -1
  454. package/build/types/specification/Polling.js.map +1 -0
  455. package/build/types/specification/Promotion.js +2 -1
  456. package/build/types/specification/Promotion.js.map +1 -0
  457. package/build/types/specification/Schema.js +9 -8
  458. package/build/types/specification/Schema.js.map +1 -0
  459. package/build/types/specification/Step.js +4 -5
  460. package/build/types/specification/Step.js.map +1 -0
  461. package/build/types/specification/ValidationAsync.js +2 -1
  462. package/build/types/specification/ValidationAsync.js.map +1 -0
  463. package/build/types/specification/core.js +2 -1
  464. package/build/types/specification/core.js.map +1 -0
  465. package/package.json +1 -1
@@ -1,62 +1,15 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
- return new (P || (P = Promise))(function (resolve, reject) {
16
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
- step((generator = generator.apply(thisArg, _arguments || [])).next());
20
- });
21
- };
22
- var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
- function verb(n) { return function (v) { return step([n, v]); }; }
26
- function step(op) {
27
- if (f) throw new TypeError("Generator is already executing.");
28
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
- if (y = 0, t) op = [op[0] & 2, t.value];
31
- switch (op[0]) {
32
- case 0: case 1: t = op; break;
33
- case 4: _.label++; return { value: op[1], done: false };
34
- case 5: _.label++; y = op[1]; op = [0]; continue;
35
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
- default:
37
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
- if (t[2]) _.ops.pop();
42
- _.trys.pop(); continue;
43
- }
44
- op = body.call(thisArg, _);
45
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
- }
48
- };
49
- exports.__esModule = true;
50
- var jsx_runtime_1 = require("react/jsx-runtime");
51
- var react_1 = require("react");
52
- var react_intl_1 = require("react-intl");
53
- var contexts_1 = require("../common/contexts");
54
- var validators_1 = require("../common/validators");
55
- var types_1 = require("../types");
56
- var DynamicFlowStep_1 = require("./DynamicFlowStep");
57
- var utils_1 = require("./utils");
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
+ const react_1 = require("react");
5
+ const react_intl_1 = require("react-intl");
6
+ const contexts_1 = require("../common/contexts");
7
+ const validators_1 = require("../common/validators");
8
+ const types_1 = require("../types");
9
+ const DynamicFlowStep_1 = require("./DynamicFlowStep");
10
+ const utils_1 = require("./utils");
58
11
  // eslint-disable-next-line @typescript-eslint/no-empty-function
59
- var noop = function () { };
12
+ const noop = () => { };
60
13
  /**
61
14
  * ## DynamicFlow
62
15
  *
@@ -66,307 +19,233 @@ var noop = function () { };
66
19
  * and reformats it to use a LayoutStep for presentation.
67
20
  *
68
21
  */
69
- var DynamicFlowComponent = function (_a) {
70
- var flowId = _a.flowId, fetcher = _a.fetcher, flowUrl = _a.flowUrl, initialAction = _a.initialAction, initialStep = _a.initialStep, loaderConfig = _a.loaderConfig, _b = _a.displayStepTitle, displayStepTitle = _b === void 0 ? true : _b, onComplete = _a.onComplete, _c = _a.onStepChange, onStepChange = _c === void 0 ? noop : _c, onError = _a.onError, _d = _a.onEvent, onEvent = _d === void 0 ? noop : _d, _e = _a.onLog, onLog = _e === void 0 ? noop : _e;
71
- var locale = (0, react_intl_1.useIntl)().locale;
72
- var _f = (0, utils_1.useDynamicFlowState)(initialStep), formErrors = _f.formErrors, globalError = _f.globalError, step = _f.step, models = _f.models, etag = _f.etag, modelIsValid = _f.modelIsValid, setFormErrors = _f.setFormErrors, setGlobalError = _f.setGlobalError, setStepAndEtag = _f.setStepAndEtag, setSchemaModel = _f.setSchemaModel;
73
- var _g = (0, react_1.useState)(false), submitted = _g[0], setSubmitted = _g[1];
74
- var _h = (0, utils_1.useLoader)(loaderConfig, initialStep ? 'idle' : 'initial'), loadingState = _h.loadingState, setLoadingState = _h.setLoadingState, loader = _h.loader;
75
- var logWarning = (0, contexts_1.getLogger)('warning', onLog, flowId, step === null || step === void 0 ? void 0 : step.key);
76
- var logError = (0, contexts_1.getLogger)('error', onLog, flowId, step === null || step === void 0 ? void 0 : step.key);
77
- var logCritical = (0, contexts_1.getLogger)('critical', onLog, flowId, step === null || step === void 0 ? void 0 : step.key);
78
- var analyticsMetadata = (0, react_1.useMemo)(function () { var _a; return (__assign({ flowId: flowId, stepId: step === null || step === void 0 ? void 0 : step.key }, ((_a = step === null || step === void 0 ? void 0 : step.analytics) !== null && _a !== void 0 ? _a : {}))); }, [flowId, step]);
79
- var dispatchEvent = (0, react_1.useMemo)(function () { return (0, contexts_1.getEventDispatcher)(onEvent, analyticsMetadata); }, [onEvent, analyticsMetadata]);
80
- var triggerActionRequest = (0, react_1.useCallback)(function (_a) {
81
- var action = _a.action, data = _a.data, etag = _a.etag;
82
- var url = action.url, _b = action.method, method = _b === void 0 ? 'POST' : _b;
22
+ const DynamicFlowComponent = ({ flowId, fetcher, flowUrl, initialAction, initialStep, loaderConfig, displayStepTitle = true, onComplete, onStepChange = noop, onError, onEvent = noop, onLog = noop, }) => {
23
+ const { locale } = (0, react_intl_1.useIntl)();
24
+ const { formErrors, globalError, step, models, etag, modelIsValid, setFormErrors, setGlobalError, setStepAndEtag, setSchemaModel, } = (0, utils_1.useDynamicFlowState)(initialStep);
25
+ const [submitted, setSubmitted] = (0, react_1.useState)(false);
26
+ const { loadingState, setLoadingState, loader } = (0, utils_1.useLoader)(loaderConfig, initialStep ? 'idle' : 'initial');
27
+ const logWarning = (0, contexts_1.getLogger)('warning', onLog, flowId, step === null || step === void 0 ? void 0 : step.key);
28
+ const logError = (0, contexts_1.getLogger)('error', onLog, flowId, step === null || step === void 0 ? void 0 : step.key);
29
+ const logCritical = (0, contexts_1.getLogger)('critical', onLog, flowId, step === null || step === void 0 ? void 0 : step.key);
30
+ const analyticsMetadata = (0, react_1.useMemo)(() => { var _a; return (Object.assign({ flowId, stepId: step === null || step === void 0 ? void 0 : step.key }, ((_a = step === null || step === void 0 ? void 0 : step.analytics) !== null && _a !== void 0 ? _a : {}))); }, [flowId, step]);
31
+ const dispatchEvent = (0, react_1.useMemo)(() => (0, contexts_1.getEventDispatcher)(onEvent, analyticsMetadata), [onEvent, analyticsMetadata]);
32
+ const triggerActionRequest = (0, react_1.useCallback)(({ action, data, etag }) => {
33
+ const { url, method = 'POST' } = action;
83
34
  return fetcher(url !== null && url !== void 0 ? url : '', {
84
- method: method,
85
- headers: __assign({ 'accept-language': locale, 'Content-Type': 'application/json' }, (etag ? { 'If-None-Match': etag } : {})),
35
+ method,
36
+ headers: Object.assign({ 'accept-language': locale, 'Content-Type': 'application/json' }, (etag ? { 'If-None-Match': etag } : {})),
86
37
  credentials: 'include',
87
- body: method === 'GET' ? undefined : JSON.stringify(data)
38
+ body: method === 'GET' ? undefined : JSON.stringify(data),
88
39
  });
89
40
  }, [fetcher, locale]);
90
- var fetchNextStep = function (action, data) {
91
- if (data === void 0) { data = {}; }
92
- return __awaiter(void 0, void 0, void 0, function () {
93
- var response, error_1;
94
- return __generator(this, function (_a) {
95
- switch (_a.label) {
96
- case 0:
97
- setLoadingState(loadingState === 'initial' ? 'initial' : 'submission');
98
- _a.label = 1;
99
- case 1:
100
- _a.trys.push([1, 3, , 4]);
101
- dispatchEvent('Dynamic Flow - Step Submitted', { actionId: action.$id });
102
- return [4 /*yield*/, triggerActionRequest({ action: action, data: data })];
103
- case 2:
104
- response = _a.sent();
105
- return [2 /*return*/, handleFetchResponse(response, 'submission')];
106
- case 3:
107
- error_1 = _a.sent();
108
- handleFetchError(error_1, 'Error fetching next step');
109
- return [3 /*break*/, 4];
110
- case 4: return [2 /*return*/];
111
- }
112
- });
113
- });
41
+ const fetchNextStep = async (action, data = {}) => {
42
+ setLoadingState(loadingState === 'initial' ? 'initial' : 'submission');
43
+ try {
44
+ dispatchEvent('Dynamic Flow - Step Submitted', { actionId: action.$id });
45
+ const response = await triggerActionRequest({ action, data });
46
+ return handleFetchResponse(response, 'submission');
47
+ }
48
+ catch (error) {
49
+ handleFetchError(error, 'Error fetching next step');
50
+ }
114
51
  };
115
- var fetchRefreshStep = function (action, data, etag) { return __awaiter(void 0, void 0, void 0, function () {
116
- var response, error_2;
117
- return __generator(this, function (_a) {
118
- switch (_a.label) {
119
- case 0:
120
- setLoadingState('refresh');
121
- _a.label = 1;
122
- case 1:
123
- _a.trys.push([1, 4, , 5]);
124
- dispatchEvent('Dynamic Flow - Step Refreshed', { status: 'pending' });
125
- return [4 /*yield*/, triggerActionRequest({ action: action, data: data, etag: etag })];
126
- case 2:
127
- response = _a.sent();
128
- return [4 /*yield*/, handleFetchResponse(response, 'refresh')];
129
- case 3:
130
- _a.sent();
131
- setLoadingState('idle');
132
- return [3 /*break*/, 5];
133
- case 4:
134
- error_2 = _a.sent();
135
- handleFetchError(error_2, 'Error fetching refresh step');
136
- return [3 /*break*/, 5];
137
- case 5: return [2 /*return*/];
138
- }
139
- });
140
- }); };
141
- var fetchExitResult = function (action, data) { return __awaiter(void 0, void 0, void 0, function () {
142
- var response, exitResult, error_3;
143
- return __generator(this, function (_a) {
144
- switch (_a.label) {
145
- case 0:
146
- _a.trys.push([0, 3, , 4]);
147
- return [4 /*yield*/, triggerActionRequest({ action: action, data: data })];
148
- case 1:
149
- response = _a.sent();
150
- return [4 /*yield*/, (0, utils_1.parseExitResponse)(response)];
151
- case 2:
152
- exitResult = _a.sent();
153
- onCloseWithEvent(__assign(__assign({}, exitResult), action.result));
154
- return [3 /*break*/, 4];
155
- case 3:
156
- error_3 = _a.sent();
157
- handleFetchError(error_3, 'Error fetching exit result');
158
- return [3 /*break*/, 4];
159
- case 4: return [2 /*return*/];
160
- }
161
- });
162
- }); };
163
- var debouncedFetchRefresh = (0, utils_1.useDebouncedRefresh)(fetchRefreshStep);
164
- var onCloseWithEvent = (0, react_1.useCallback)(function (result) {
52
+ const fetchRefreshStep = async (action, data, etag) => {
53
+ setLoadingState('refresh');
54
+ try {
55
+ dispatchEvent('Dynamic Flow - Step Refreshed', { status: 'pending' });
56
+ const response = await triggerActionRequest({ action, data, etag });
57
+ await handleFetchResponse(response, 'refresh');
58
+ setLoadingState('idle');
59
+ }
60
+ catch (error) {
61
+ handleFetchError(error, 'Error fetching refresh step');
62
+ }
63
+ };
64
+ const fetchExitResult = async (action, data) => {
65
+ try {
66
+ const response = await triggerActionRequest({ action, data });
67
+ const exitResult = await (0, utils_1.parseExitResponse)(response);
68
+ onCloseWithEvent(Object.assign(Object.assign({}, exitResult), action.result));
69
+ }
70
+ catch (error) {
71
+ handleFetchError(error, 'Error fetching exit result');
72
+ }
73
+ };
74
+ const debouncedFetchRefresh = (0, utils_1.useDebouncedRefresh)(fetchRefreshStep);
75
+ const onCloseWithEvent = (0, react_1.useCallback)((result) => {
165
76
  dispatchEvent('Dynamic Flow - Flow Finished', { result: 'success' });
166
77
  onComplete(result);
167
78
  }, [onComplete, dispatchEvent]);
168
- (0, react_1.useEffect)(function () {
79
+ (0, react_1.useEffect)(() => {
169
80
  dispatchEvent('Dynamic Flow - Flow Started', {});
170
81
  }, []);
171
- (0, react_1.useEffect)(function () {
82
+ (0, react_1.useEffect)(() => {
172
83
  if (!initialStep) {
173
- var action = __assign({ $id: '#initial-step-request', method: 'GET' }, initialAction);
84
+ const action = Object.assign({ $id: '#initial-step-request', method: 'GET' }, initialAction);
174
85
  void fetchNextStep(action, action.data);
175
86
  }
176
87
  }, [flowUrl, fetcher, locale, JSON.stringify(initialStep), JSON.stringify(initialAction)]);
177
- var handleFetchResponse = function (response, fetchType) { return __awaiter(void 0, void 0, void 0, function () {
178
- var parsedResponse, step_1, etag_1, error_4;
179
- return __generator(this, function (_a) {
180
- switch (_a.label) {
181
- case 0:
182
- if (!response.ok) return [3 /*break*/, 4];
183
- _a.label = 1;
184
- case 1:
185
- _a.trys.push([1, 3, , 4]);
186
- return [4 /*yield*/, (0, utils_1.parseFetchResponse)(response)];
187
- case 2:
188
- parsedResponse = _a.sent();
189
- switch (parsedResponse.type) {
190
- case 'action':
191
- void fetchNextStep(parsedResponse.action, parsedResponse.action.data);
192
- return [2 /*return*/];
193
- case 'exit':
194
- return [2 /*return*/, onCloseWithEvent(parsedResponse.result)];
195
- case 'step':
196
- default: {
197
- step_1 = parsedResponse.step, etag_1 = parsedResponse.etag;
198
- return [2 /*return*/, fetchType === 'submission'
199
- ? updateStepAfterSubmission(step_1, etag_1)
200
- : updateStepAfterRefresh(step_1, etag_1)];
201
- }
88
+ const handleFetchResponse = async (response, fetchType) => {
89
+ if (response.ok) {
90
+ try {
91
+ const parsedResponse = await (0, utils_1.parseFetchResponse)(response);
92
+ switch (parsedResponse.type) {
93
+ case 'action':
94
+ void fetchNextStep(parsedResponse.action, parsedResponse.action.data);
95
+ return;
96
+ case 'exit':
97
+ return onCloseWithEvent(parsedResponse.result);
98
+ case 'step':
99
+ default: {
100
+ const { step, etag } = parsedResponse;
101
+ return fetchType === 'submission'
102
+ ? updateStepAfterSubmission(step, etag)
103
+ : updateStepAfterRefresh(step, etag);
202
104
  }
203
- return [3 /*break*/, 4];
204
- case 3:
205
- error_4 = _a.sent();
206
- return [2 /*return*/, handleFetchError(error_4, 'Error parsing fetch response')];
207
- case 4: return [2 /*return*/, handleErrorResponse(response, fetchType)];
105
+ }
208
106
  }
209
- });
210
- }); };
211
- var updateStepAfterSubmission = function (newStep, etag) {
212
- var previousStep = step;
107
+ catch (error) {
108
+ return handleFetchError(error, 'Error parsing fetch response');
109
+ }
110
+ }
111
+ return handleErrorResponse(response, fetchType);
112
+ };
113
+ const updateStepAfterSubmission = (newStep, etag) => {
114
+ const previousStep = step;
213
115
  setStepAndEtag(newStep, etag);
214
116
  onStepChange(newStep, previousStep);
215
117
  setSubmitted(false);
216
118
  setLoadingState('idle');
217
- dispatchEvent('Dynamic Flow - Step Started', __assign({ stepId: newStep.key }, newStep === null || newStep === void 0 ? void 0 : newStep.analytics));
119
+ dispatchEvent('Dynamic Flow - Step Started', Object.assign({ stepId: newStep.key }, newStep === null || newStep === void 0 ? void 0 : newStep.analytics));
218
120
  };
219
- var updateStepAfterRefresh = function (step, etag) {
121
+ const updateStepAfterRefresh = (step, etag) => {
220
122
  setStepAndEtag(step, etag);
221
123
  setLoadingState('idle');
222
124
  dispatchEvent('Dynamic Flow - Step Refreshed', { status: 'success' });
223
125
  };
224
- var handleErrorResponse = function (response, fetchType) { return __awaiter(void 0, void 0, void 0, function () {
225
- var errorBody, action, error_5;
226
- return __generator(this, function (_a) {
227
- switch (_a.label) {
228
- case 0:
229
- if (response.status === 304) {
230
- setLoadingState('idle');
231
- return [2 /*return*/];
232
- }
233
- _a.label = 1;
234
- case 1:
235
- _a.trys.push([1, 5, , 6]);
236
- return [4 /*yield*/, (0, utils_1.parseErrorResponse)(response)];
237
- case 2:
238
- errorBody = _a.sent();
239
- if (!errorBody.refreshFormUrl) return [3 /*break*/, 4];
240
- action = { url: errorBody === null || errorBody === void 0 ? void 0 : errorBody.refreshFormUrl, method: 'POST' };
241
- return [4 /*yield*/, fetchRefreshStep(action, combineModels(models), etag)];
242
- case 3:
243
- _a.sent();
244
- _a.label = 4;
245
- case 4:
246
- if (errorBody.validation) {
247
- setFormErrors(errorBody.validation);
248
- }
249
- if (errorBody.error) {
250
- setGlobalError(errorBody.error);
251
- }
252
- if (!errorBody.refreshFormUrl && !errorBody.validation && !errorBody.error) {
253
- logError('Invalid response', 'Response body must contain at least one of the following properties: refreshFormUrl, validation, or error.');
254
- throw errorBody;
255
- }
256
- return [3 /*break*/, 6];
257
- case 5:
258
- error_5 = _a.sent();
259
- if (fetchType === 'refresh') {
260
- dispatchEvent('Dynamic Flow - Step Refreshed', { status: 'failure' });
261
- }
262
- dispatchEvent('Dynamic Flow - Flow Finished', { status: 'failure' });
263
- onError(error_5, response.status);
264
- logError('Invalid response', 'Error response body must be an object.');
265
- return [3 /*break*/, 6];
266
- case 6:
267
- setLoadingState('idle');
268
- return [2 /*return*/];
126
+ const handleErrorResponse = async (response, fetchType) => {
127
+ if (response.status === 304) {
128
+ setLoadingState('idle');
129
+ return;
130
+ }
131
+ try {
132
+ const errorBody = await (0, utils_1.parseErrorResponse)(response);
133
+ if (errorBody.refreshFormUrl) {
134
+ const action = { url: errorBody === null || errorBody === void 0 ? void 0 : errorBody.refreshFormUrl, method: 'POST' };
135
+ await fetchRefreshStep(action, combineModels(models), etag);
269
136
  }
270
- });
271
- }); };
272
- var handleFetchError = function (error, message) {
137
+ if (errorBody.validation) {
138
+ setFormErrors(errorBody.validation);
139
+ }
140
+ if (errorBody.error) {
141
+ setGlobalError(errorBody.error);
142
+ }
143
+ if (!errorBody.refreshFormUrl && !errorBody.validation && !errorBody.error) {
144
+ logError('Invalid response', 'Response body must contain at least one of the following properties: refreshFormUrl, validation, or error.');
145
+ throw errorBody;
146
+ }
147
+ }
148
+ catch (error) {
149
+ if (fetchType === 'refresh') {
150
+ dispatchEvent('Dynamic Flow - Step Refreshed', { status: 'failure' });
151
+ }
152
+ dispatchEvent('Dynamic Flow - Flow Finished', { status: 'failure' });
153
+ onError(error, response.status);
154
+ logError('Invalid response', 'Error response body must be an object.');
155
+ }
156
+ setLoadingState('idle');
157
+ };
158
+ const handleFetchError = (error, message) => {
273
159
  logCritical('Error fetching', message);
274
160
  onError(error);
275
161
  setLoadingState('idle');
276
162
  };
277
- var onModelChange = function (onModelChangeProps) {
278
- var model = onModelChangeProps.model, formSchema = onModelChangeProps.formSchema;
279
- var _a = formSchema.$id, $id = _a === void 0 ? '' : _a;
163
+ const onModelChange = (onModelChangeProps) => {
164
+ const { model, formSchema } = onModelChangeProps;
165
+ const { $id = '' } = formSchema;
280
166
  setGlobalError(null);
281
167
  if (!(0, types_1.isObjectModel)(model)) {
282
168
  // TODO: MC-3224
283
169
  logCritical('Invalid model on change', 'onModelChange was called but the model argument is not an object');
284
170
  }
285
- var objectModel = model;
286
- setSchemaModel($id, objectModel, function (updatedModels) {
171
+ const objectModel = model;
172
+ setSchemaModel($id, objectModel, (updatedModels) => {
287
173
  refreshOnChangeIfNeeded(onModelChangeProps, updatedModels);
288
174
  });
289
175
  };
290
- var refreshOnChangeIfNeeded = function (props, updatedModels) {
291
- var triggerSchema = props.triggerSchema;
176
+ const refreshOnChangeIfNeeded = (props, updatedModels) => {
177
+ const { triggerSchema } = props;
292
178
  if (shouldTriggerRefresh(props)) {
293
- var url = triggerSchema.refreshFormUrl || (step === null || step === void 0 ? void 0 : step.refreshFormUrl);
294
- var action = { url: url, method: 'POST' };
179
+ const url = triggerSchema.refreshFormUrl || (step === null || step === void 0 ? void 0 : step.refreshFormUrl);
180
+ const action = { url, method: 'POST' };
295
181
  debouncedFetchRefresh(action, combineModels(updatedModels), etag, triggerSchema);
296
182
  }
297
183
  };
298
- var onAction = function (action) { return __awaiter(void 0, void 0, void 0, function () {
299
- var data, method, exit, url, result, submissionData, extraLoggingProps;
300
- return __generator(this, function (_a) {
301
- switch (_a.label) {
302
- case 0:
303
- data = action.data, method = action.method, exit = action.exit, url = action.url, result = action.result;
304
- submissionData = __assign(__assign({}, combineModels(models)), data);
305
- extraLoggingProps = {
306
- url: action.url,
307
- method: action.method,
308
- currency: submissionData.currency,
309
- type: submissionData.type
310
- };
311
- if (loadingState !== 'idle' || action.disabled) {
312
- logWarning('Action supressed', loadingState !== 'idle'
313
- ? "onAction was supressed because loadingState is ".concat(loadingState)
314
- : "onAction was supressed because action is disabled", extraLoggingProps);
315
- return [2 /*return*/];
316
- }
317
- if (!exit) return [3 /*break*/, 7];
318
- if (!url) return [3 /*break*/, 6];
319
- if (!isSubmissionMethod(method)) return [3 /*break*/, 3];
184
+ const onAction = async (action) => {
185
+ const { data, method, exit, url, result } = action;
186
+ const submissionData = Object.assign(Object.assign({}, combineModels(models)), data);
187
+ // Temporary tracking properties specific to recipient creation
188
+ // the submissionData object typically contains PII
189
+ // but we're only taking "currency" and "type" which are not PII.
190
+ const extraLoggingProps = {
191
+ url: action.url,
192
+ method: action.method,
193
+ currency: submissionData.currency,
194
+ type: submissionData.type,
195
+ };
196
+ if (loadingState !== 'idle' || action.disabled) {
197
+ logWarning('Action supressed', loadingState !== 'idle'
198
+ ? `onAction was supressed because loadingState is ${loadingState}`
199
+ : `onAction was supressed because action is disabled`, extraLoggingProps);
200
+ return;
201
+ }
202
+ if (exit) {
203
+ if (url) {
204
+ if (isSubmissionMethod(method)) {
320
205
  setFormErrors(null);
321
206
  setSubmitted(true);
322
- if (!modelIsValid) return [3 /*break*/, 2];
323
- return [4 /*yield*/, fetchExitResult(action, submissionData)];
324
- case 1:
325
- _a.sent();
326
- _a.label = 2;
327
- case 2: return [3 /*break*/, 5];
328
- case 3: return [4 /*yield*/, fetchExitResult(action)];
329
- case 4:
330
- _a.sent();
331
- _a.label = 5;
332
- case 5: return [2 /*return*/];
333
- case 6:
334
- onCloseWithEvent(result);
335
- return [2 /*return*/];
336
- case 7:
337
- if (isSubmissionMethod(method)) {
338
- setFormErrors(null);
339
- setSubmitted(true);
340
- if (modelIsValid) {
341
- void fetchNextStep(action, submissionData);
342
- }
343
- else {
344
- dispatchEvent('Dynamic Flow - onAction supressed', __assign({ reason: 'invalid model' }, extraLoggingProps));
345
- }
346
- return [2 /*return*/];
207
+ if (modelIsValid) {
208
+ await fetchExitResult(action, submissionData);
347
209
  }
348
- void fetchNextStep(action);
349
- return [2 /*return*/];
210
+ }
211
+ else {
212
+ await fetchExitResult(action);
213
+ }
214
+ return;
350
215
  }
351
- });
352
- }); };
353
- return ((0, jsx_runtime_1.jsx)(contexts_1.LogProvider, __assign({ flowId: flowId, stepId: step === null || step === void 0 ? void 0 : step.key, onLog: onLog }, { children: (0, jsx_runtime_1.jsx)(contexts_1.EventsContextProvider, __assign({ metadata: analyticsMetadata, onEvent: onEvent }, { children: (0, jsx_runtime_1.jsx)(contexts_1.DynamicFlowProvider, __assign({ loading: loadingState !== 'idle' }, { children: (0, jsx_runtime_1.jsx)(contexts_1.FetcherProvider, __assign({ fetcher: fetcher }, { children: loader !== null ? (loader) : ((0, jsx_runtime_1.jsx)(DynamicFlowStep_1.DynamicFlowStep, { step: step, model: combineModels(models), submitted: submitted, globalError: globalError, formErrors: formErrors, stepLayoutOptions: { displayStepTitle: displayStepTitle }, onAction: function (action) {
216
+ onCloseWithEvent(result);
217
+ return;
218
+ }
219
+ if (isSubmissionMethod(method)) {
220
+ setFormErrors(null);
221
+ setSubmitted(true);
222
+ if (modelIsValid) {
223
+ void fetchNextStep(action, submissionData);
224
+ }
225
+ else {
226
+ dispatchEvent('Dynamic Flow - onAction supressed', Object.assign({ reason: 'invalid model' }, extraLoggingProps));
227
+ }
228
+ return;
229
+ }
230
+ void fetchNextStep(action);
231
+ };
232
+ return ((0, jsx_runtime_1.jsx)(contexts_1.LogProvider, Object.assign({ flowId: flowId, stepId: step === null || step === void 0 ? void 0 : step.key, onLog: onLog }, { children: (0, jsx_runtime_1.jsx)(contexts_1.EventsContextProvider, Object.assign({ metadata: analyticsMetadata, onEvent: onEvent }, { children: (0, jsx_runtime_1.jsx)(contexts_1.DynamicFlowProvider, Object.assign({ loading: loadingState !== 'idle' }, { children: (0, jsx_runtime_1.jsx)(contexts_1.FetcherProvider, Object.assign({ fetcher: fetcher }, { children: loader !== null ? (loader) : ((0, jsx_runtime_1.jsx)(DynamicFlowStep_1.DynamicFlowStep, { step: step, model: combineModels(models), submitted: submitted, globalError: globalError, formErrors: formErrors, stepLayoutOptions: { displayStepTitle }, onAction: (action) => {
354
233
  void onAction(action);
355
234
  }, onModelChange: onModelChange })) })) })) })) })));
356
235
  };
357
- var DynamicFlow = function (props) { return ((0, jsx_runtime_1.jsx)(utils_1.ErrorBoundary, __assign({ onError: props.onError }, { children: (0, jsx_runtime_1.jsx)(DynamicFlowComponent, __assign({}, props)) }))); };
358
- exports["default"] = DynamicFlow;
359
- var combineModels = function (formModels) {
360
- return Object.values(formModels).reduce(function (previous, model) { return (__assign(__assign({}, previous), model)); }, {});
236
+ const DynamicFlow = (props) => ((0, jsx_runtime_1.jsx)(utils_1.ErrorBoundary, Object.assign({ onError: props.onError }, { children: (0, jsx_runtime_1.jsx)(DynamicFlowComponent, Object.assign({}, props)) })));
237
+ exports.default = DynamicFlow;
238
+ const combineModels = (formModels) => {
239
+ return Object.values(formModels).reduce((previous, model) => (Object.assign(Object.assign({}, previous), model)), {});
361
240
  };
362
- var isSubmissionMethod = function (method) {
363
- if (method === void 0) { method = 'POST'; }
364
- var submissionMethods = ['POST', 'PUT', 'PATCH'];
241
+ const isSubmissionMethod = (method = 'POST') => {
242
+ const submissionMethods = ['POST', 'PUT', 'PATCH'];
365
243
  return submissionMethods.includes(method.toUpperCase());
366
244
  };
367
- var shouldTriggerRefresh = function (props) {
368
- var type = props.type, triggerSchema = props.triggerSchema, triggerModel = props.triggerModel, _a = props.lastTriggerModel, lastTriggerModel = _a === void 0 ? null : _a;
369
- var isValid = function () { return (0, validators_1.isValidSchema)(triggerModel, triggerSchema); };
370
- var wasValid = function () { return (0, validators_1.isValidSchema)(lastTriggerModel, triggerSchema); };
245
+ const shouldTriggerRefresh = (props) => {
246
+ const { type, triggerSchema, triggerModel, lastTriggerModel = null } = props;
247
+ const isValid = () => (0, validators_1.isValidSchema)(triggerModel, triggerSchema);
248
+ const wasValid = () => (0, validators_1.isValidSchema)(lastTriggerModel, triggerSchema);
371
249
  return type !== 'init' && (triggerSchema === null || triggerSchema === void 0 ? void 0 : triggerSchema.refreshFormOnChange) && (isValid() || wasValid());
372
250
  };
251
+ //# sourceMappingURL=DynamicFlow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DynamicFlow.js","sourceRoot":"","sources":["../../src/dynamicFlow/DynamicFlow.tsx"],"names":[],"mappings":";;;AAAA,iCAAuE;AACvE,2CAAqC;AAErC,iDAO4B;AAC5B,qDAAqD;AAOrD,oCAAoE;AAEpE,uDAAoD;AACpD,mCAQiB;AAEjB,gEAAgE;AAChE,MAAM,IAAI,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;AAItB;;;;;;;;GAQG;AACH,MAAM,oBAAoB,GAA0B,CAAC,EACnD,MAAM,EACN,OAAO,EACP,OAAO,EACP,aAAa,EACb,WAAW,EACX,YAAY,EACZ,gBAAgB,GAAG,IAAI,EACvB,UAAU,EACV,YAAY,GAAG,IAAI,EACnB,OAAO,EACP,OAAO,GAAG,IAAI,EACd,KAAK,GAAG,IAAI,GACb,EAAE,EAAE;IACH,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,oBAAO,GAAE,CAAC;IAE7B,MAAM,EACJ,UAAU,EACV,WAAW,EACX,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,YAAY,EACZ,aAAa,EACb,cAAc,EACd,cAAc,EACd,cAAc,GACf,GAAG,IAAA,2BAAmB,EAAC,WAAW,CAAC,CAAC;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