@wise/dynamic-flow-client 0.4.0-beta-d2067b.7 → 0.4.0

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 (468) hide show
  1. package/build/common/constants/DateMode.js +7 -0
  2. package/build/common/constants/FormControlType.js +20 -0
  3. package/build/common/constants/MonthFormat.js +7 -0
  4. package/build/common/constants/SchemaType.js +14 -0
  5. package/build/common/constants/Size.js +10 -0
  6. package/build/common/constants/index.js +21 -0
  7. package/build/common/contexts/dynamicFlowContexts/DynamicFlowContexts.js +41 -0
  8. package/build/common/contexts/dynamicFlowContexts/usePendingPromiseCounter.js +17 -0
  9. package/build/common/contexts/eventsContext/EventsContext.js +39 -0
  10. package/build/common/contexts/fetcherContexts/FetcherContexts.js +42 -0
  11. package/build/common/contexts/index.js +20 -0
  12. package/build/common/contexts/logContext/LogContext.js +45 -0
  13. package/build/common/hooks/index.js +23 -0
  14. package/build/common/hooks/useDebouncedFunction/useDebouncedFunction.js +13 -0
  15. package/build/common/hooks/useExternal/useExternal.js +19 -0
  16. package/build/common/hooks/useExternalStepPolling/useExternalStepPolling.js +73 -0
  17. package/build/common/hooks/usePersistAsync/usePersistAsync.js +177 -0
  18. package/build/common/hooks/usePolling/usePolling.js +53 -0
  19. package/build/common/hooks/usePrevious/usePrevious.js +12 -0
  20. package/build/common/hooks/useStepPolling/useStepPolling.js +48 -0
  21. package/build/common/makeFetcher/index.js +17 -0
  22. package/build/common/makeFetcher/makeFetcher.js +37 -0
  23. package/build/common/messages.js +10 -0
  24. package/build/common/utils/api-utils.js +20 -0
  25. package/build/common/utils/date-utils.js +27 -0
  26. package/build/common/utils/debounce.js +42 -0
  27. package/build/common/utils/file-utils.js +51 -0
  28. package/build/common/utils/id-utils.js +9 -0
  29. package/build/common/utils/index.js +24 -0
  30. package/build/common/utils/is-equal.js +25 -0
  31. package/build/common/utils/schema-utils.js +55 -0
  32. package/build/common/utils/step-utils.js +47 -0
  33. package/build/common/validators/index.js +28 -0
  34. package/build/common/validators/models/model-validators.js +69 -0
  35. package/build/common/validators/models/models.utils.js +130 -0
  36. package/build/common/validators/schemas/schema-validators.js +101 -0
  37. package/build/common/validators/types/type-validators.js +25 -0
  38. package/build/common/validators/validationFailures/validation-failures.js +151 -0
  39. package/build/common/validators/validationFailures/validation-failures.utils.js +51 -0
  40. package/build/common/validators/values/value-validators.js +9 -0
  41. package/build/dynamicFlow/DynamicFlow.js +372 -0
  42. package/build/dynamicFlow/DynamicFlowStep.js +36 -0
  43. package/build/dynamicFlow/DynamicFlowTypes.js +8 -0
  44. package/build/dynamicFlow/index.js +16 -0
  45. package/build/dynamicFlow/stories/DynamicFlow.story.js +36 -0
  46. package/build/dynamicFlow/stories/EditableDynamicFlow.js +67 -0
  47. package/build/dynamicFlow/stories/fixtureFetcher.js +118 -0
  48. package/build/dynamicFlow/utils/errorBoundary/ErrorBoundary.js +47 -0
  49. package/build/dynamicFlow/utils/errorBoundary/ErrorBoundary.messages.js +15 -0
  50. package/build/dynamicFlow/utils/errorBoundary/ErrorBoundaryAlert.js +19 -0
  51. package/build/dynamicFlow/utils/index.js +23 -0
  52. package/build/dynamicFlow/utils/responseParsers/response-parsers.js +131 -0
  53. package/build/dynamicFlow/utils/useDebouncedRefresh/useDebouncedRefresh.js +27 -0
  54. package/build/dynamicFlow/utils/useDynamicFlowState.js +114 -0
  55. package/build/dynamicFlow/utils/useLoader.js +26 -0
  56. package/build/fixtures/components/alert.js +33 -0
  57. package/build/fixtures/components/box.js +22 -0
  58. package/build/fixtures/components/button.js +67 -0
  59. package/build/fixtures/components/columns.js +38 -0
  60. package/build/fixtures/components/copyable.js +24 -0
  61. package/build/fixtures/components/decision.js +56 -0
  62. package/build/fixtures/components/heading.js +16 -0
  63. package/build/fixtures/components/image.js +25 -0
  64. package/build/fixtures/components/index.js +40 -0
  65. package/build/fixtures/components/info.js +19 -0
  66. package/build/fixtures/components/list.js +36 -0
  67. package/build/fixtures/components/loading-indicator.js +18 -0
  68. package/build/fixtures/components/paragraph.js +30 -0
  69. package/build/fixtures/components/review.js +62 -0
  70. package/build/fixtures/examples/camera-capture.js +123 -0
  71. package/build/fixtures/examples/index.js +24 -0
  72. package/build/fixtures/examples/recipient-update.js +252 -0
  73. package/build/fixtures/examples/recipient.js +315 -0
  74. package/build/fixtures/examples/single-file-upload.js +100 -0
  75. package/build/fixtures/examples/step-validation-errors.js +77 -0
  76. package/build/fixtures/features/action-response.js +31 -0
  77. package/build/fixtures/features/external.js +33 -0
  78. package/build/fixtures/features/index.js +24 -0
  79. package/build/fixtures/features/persist-async.js +46 -0
  80. package/build/fixtures/features/polling.js +35 -0
  81. package/build/fixtures/features/validation-async.js +40 -0
  82. package/build/fixtures/index.js +49 -0
  83. package/build/fixtures/jsonSchemaForm/allOf.js +121 -0
  84. package/build/fixtures/jsonSchemaForm/audRecipient.js +1106 -0
  85. package/build/fixtures/jsonSchemaForm/currency.js +50 -0
  86. package/build/fixtures/jsonSchemaForm/multipleFileUploadBase64.js +39 -0
  87. package/build/fixtures/jsonSchemaForm/multipleFileUploadBlob.js +38 -0
  88. package/build/fixtures/jsonSchemaForm/oneOf.js +121 -0
  89. package/build/fixtures/jsonSchemaForm/oneOfTabs.js +55 -0
  90. package/build/fixtures/jsonSchemaForm/promotedOneOf.js +58 -0
  91. package/build/fixtures/jsonSchemaForm/promotedOneOfCheckbox.js +104 -0
  92. package/build/fixtures/jsonSchemaForm/simple.js +50 -0
  93. package/build/fixtures/jsonSchemaForm/uploadPersistAsync.js +73 -0
  94. package/build/fixtures/jsonSchemaForm/validationAsync.js +25 -0
  95. package/build/fixtures/layouts/all.js +178 -0
  96. package/build/fixtures/layouts/final-step-layout.js +41 -0
  97. package/build/fixtures/layouts/index.js +26 -0
  98. package/build/fixtures/layouts/list.js +35 -0
  99. package/build/fixtures/layouts/pay-in.js +99 -0
  100. package/build/fixtures/layouts/review.js +162 -0
  101. package/build/fixtures/layouts/success.js +68 -0
  102. package/build/fixtures/responses/action-response-final.js +26 -0
  103. package/build/fixtures/responses/action.js +4 -0
  104. package/build/fixtures/responses/exit.js +4 -0
  105. package/build/fixtures/responses/index.js +22 -0
  106. package/build/fixtures/responses/recipient-update-final.js +26 -0
  107. package/build/fixtures/schemas/basic-form.js +41 -0
  108. package/build/fixtures/schemas/index.js +22 -0
  109. package/build/fixtures/schemas/number-and-integer.js +43 -0
  110. package/build/fixtures/schemas/one-of.js +225 -0
  111. package/build/fixtures/schemas/string-formats.js +64 -0
  112. package/build/fixtures/utils/image-util.js +22 -0
  113. package/build/formControl/FormControl.js +243 -0
  114. package/build/formControl/index.js +16 -0
  115. package/build/formControl/utils/index.js +17 -0
  116. package/build/formControl/utils/value-utils.js +116 -0
  117. package/build/i18n/index.js +36 -0
  118. package/build/index.d.ts +11 -0
  119. package/build/index.js +35 -0
  120. package/build/jsonSchemaForm/JsonSchemaForm.js +34 -0
  121. package/build/jsonSchemaForm/allOfSchema/AllOfSchema.js +59 -0
  122. package/build/jsonSchemaForm/allOfSchema/index.js +16 -0
  123. package/build/jsonSchemaForm/arrayTypeSchema/ArraySchema.js +30 -0
  124. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.js +31 -0
  125. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/index.js +16 -0
  126. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.js +145 -0
  127. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.messages.js +20 -0
  128. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/index.js +16 -0
  129. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/index.js +18 -0
  130. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/upload-utils.js +90 -0
  131. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/useFormattedDefaultErrorMessages.js +21 -0
  132. package/build/jsonSchemaForm/arrayTypeSchema/index.js +16 -0
  133. package/build/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.js +108 -0
  134. package/build/jsonSchemaForm/basicTypeSchema/index.js +16 -0
  135. package/build/jsonSchemaForm/controlFeedback/ControlFeedback.js +84 -0
  136. package/build/jsonSchemaForm/controlFeedback/ControlFeedback.messages.js +55 -0
  137. package/build/jsonSchemaForm/controlFeedback/index.js +16 -0
  138. package/build/jsonSchemaForm/genericSchema/GenericSchema.js +127 -0
  139. package/build/jsonSchemaForm/genericSchema/index.js +16 -0
  140. package/build/jsonSchemaForm/help/Help.js +14 -0
  141. package/build/jsonSchemaForm/help/Help.messages.js +10 -0
  142. package/build/jsonSchemaForm/help/index.js +16 -0
  143. package/build/jsonSchemaForm/index.js +16 -0
  144. package/build/jsonSchemaForm/objectSchema/ObjectSchema.js +83 -0
  145. package/build/jsonSchemaForm/objectSchema/index.js +16 -0
  146. package/build/jsonSchemaForm/oneOfSchema/OneOfSchema.js +155 -0
  147. package/build/jsonSchemaForm/oneOfSchema/index.js +16 -0
  148. package/build/jsonSchemaForm/oneOfSchema/utils/const-schema-utils.js +13 -0
  149. package/build/jsonSchemaForm/oneOfSchema/utils/index.js +18 -0
  150. package/build/jsonSchemaForm/oneOfSchema/utils/one-of-utils.js +70 -0
  151. package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.js +31 -0
  152. package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.messages.js +10 -0
  153. package/build/jsonSchemaForm/persistAsyncSchema/index.js +16 -0
  154. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.js +173 -0
  155. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/index.js +16 -0
  156. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.js +131 -0
  157. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.js +36 -0
  158. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/index.js +16 -0
  159. package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.js +77 -0
  160. package/build/jsonSchemaForm/promotedOneOfSchema/index.js +16 -0
  161. package/build/jsonSchemaForm/promotedOneOfSchema/promoted-one-of-utils.js +12 -0
  162. package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.js +29 -0
  163. package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.js +36 -0
  164. package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.js +34 -0
  165. package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.js +60 -0
  166. package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.js +15 -0
  167. package/build/jsonSchemaForm/readOnlySchema/index.js +16 -0
  168. package/build/jsonSchemaForm/schemaFormControl/SchemaFormControl.js +111 -0
  169. package/build/jsonSchemaForm/schemaFormControl/index.js +16 -0
  170. package/build/jsonSchemaForm/schemaFormControl/utils/currency-utils.js +77 -0
  171. package/build/jsonSchemaForm/schemaFormControl/utils/index.js +17 -0
  172. package/build/jsonSchemaForm/schemaFormControl/utils/mapping-utils.js +127 -0
  173. package/build/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.js +151 -0
  174. package/build/jsonSchemaForm/validationAsyncSchema/index.js +16 -0
  175. package/build/layout/DynamicLayout.js +63 -0
  176. package/build/layout/alert/DynamicAlert.js +31 -0
  177. package/build/layout/box/DynamicBox.js +43 -0
  178. package/build/layout/button/DynamicButton.js +60 -0
  179. package/build/layout/columns/DynamicColumns.js +40 -0
  180. package/build/layout/decision/DynamicDecision.js +40 -0
  181. package/build/layout/divider/DynamicDivider.js +11 -0
  182. package/build/layout/external/DynamicExternal.js +37 -0
  183. package/build/layout/external/DynamicExternal.messages.js +10 -0
  184. package/build/layout/form/DynamicForm.js +27 -0
  185. package/build/layout/heading/DynamicHeading.js +33 -0
  186. package/build/layout/icon/DynamicIcon.js +50 -0
  187. package/build/layout/image/DynamicImage.js +112 -0
  188. package/build/layout/index.js +48 -0
  189. package/build/layout/info/DynamicInfo.js +21 -0
  190. package/build/layout/list/DynamicList.js +33 -0
  191. package/build/layout/loadingIndicator/DynamicLoadingIndicator.js +13 -0
  192. package/build/layout/paragraph/DynamicParagraph.js +48 -0
  193. package/build/layout/paragraph/DynamicParagraph.messages.js +15 -0
  194. package/build/layout/paragraph/useSnackBarIfAvailable.js +13 -0
  195. package/build/layout/review/DynamicReview.js +35 -0
  196. package/build/layout/utils.js +35 -0
  197. package/build/step/cameraStep/CameraStep.js +130 -0
  198. package/build/step/cameraStep/cameraCapture/CameraCapture.js +127 -0
  199. package/build/step/cameraStep/cameraCapture/CameraCapture.messages.js +20 -0
  200. package/build/step/cameraStep/cameraCapture/components/index.js +36 -0
  201. package/build/step/cameraStep/cameraCapture/hooks/index.js +84 -0
  202. package/build/step/cameraStep/cameraCapture/index.js +16 -0
  203. package/build/step/cameraStep/cameraCapture/overlay/Overlay.js +80 -0
  204. package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.js +24 -0
  205. package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.messages.js +15 -0
  206. package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.js +26 -0
  207. package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.js +20 -0
  208. package/build/step/cameraStep/cameraCapture/screens/index.js +18 -0
  209. package/build/step/cameraStep/cameraCapture/tracking/index.js +104 -0
  210. package/build/step/cameraStep/cameraCapture/utils/index.js +114 -0
  211. package/build/step/cameraStep/index.js +16 -0
  212. package/build/step/externalConfirmationStep/ExternalConfirmationStep.js +69 -0
  213. package/build/step/externalConfirmationStep/ExternalConfirmationStep.messages.js +25 -0
  214. package/build/step/externalConfirmationStep/index.js +16 -0
  215. package/build/step/index.js +20 -0
  216. package/build/step/layoutStep/LayoutStep.js +35 -0
  217. package/build/step/layoutStep/index.js +16 -0
  218. package/build/step/layoutStep/utils/index.js +18 -0
  219. package/build/step/layoutStep/utils/inline-reference-utils.js +95 -0
  220. package/build/step/layoutStep/utils/layout-utils.js +222 -0
  221. package/build/types/common/FormControl.js +2 -0
  222. package/build/types/index.d.ts +15 -10
  223. package/build/types/index.js +42 -0
  224. package/build/types/specification/Action.js +2 -0
  225. package/build/types/specification/FileUploadSchema.js +8 -0
  226. package/build/types/specification/LayoutComponent.js +2 -0
  227. package/build/types/specification/Model.js +38 -0
  228. package/build/types/specification/PersistAsync.js +2 -0
  229. package/build/types/specification/Polling.js +2 -0
  230. package/build/types/specification/Promotion.js +2 -0
  231. package/build/types/specification/Schema.js +67 -0
  232. package/build/types/specification/Step.js +8 -0
  233. package/build/types/specification/ValidationAsync.js +2 -0
  234. package/build/types/specification/core.js +2 -0
  235. package/package.json +23 -24
  236. package/build/main.js +0 -6980
  237. package/build/main.min.js +0 -10
  238. package/build/types/types/index.d.ts +0 -15
  239. /package/build/{types/common → common}/constants/DateMode.d.ts +0 -0
  240. /package/build/{types/common → common}/constants/FormControlType.d.ts +0 -0
  241. /package/build/{types/common → common}/constants/MonthFormat.d.ts +0 -0
  242. /package/build/{types/common → common}/constants/SchemaType.d.ts +0 -0
  243. /package/build/{types/common → common}/constants/Size.d.ts +0 -0
  244. /package/build/{types/common → common}/constants/index.d.ts +0 -0
  245. /package/build/{types/common → common}/contexts/dynamicFlowContexts/DynamicFlowContexts.d.ts +0 -0
  246. /package/build/{types/common → common}/contexts/dynamicFlowContexts/usePendingPromiseCounter.d.ts +0 -0
  247. /package/build/{types/common → common}/contexts/eventsContext/EventsContext.d.ts +0 -0
  248. /package/build/{types/common → common}/contexts/fetcherContexts/FetcherContexts.d.ts +0 -0
  249. /package/build/{types/common → common}/contexts/index.d.ts +0 -0
  250. /package/build/{types/common → common}/contexts/logContext/LogContext.d.ts +0 -0
  251. /package/build/{types/common → common}/hooks/index.d.ts +0 -0
  252. /package/build/{types/common → common}/hooks/useDebouncedFunction/useDebouncedFunction.d.ts +0 -0
  253. /package/build/{types/common → common}/hooks/useExternal/useExternal.d.ts +0 -0
  254. /package/build/{types/common → common}/hooks/useExternalStepPolling/useExternalStepPolling.d.ts +0 -0
  255. /package/build/{types/common → common}/hooks/usePersistAsync/usePersistAsync.d.ts +0 -0
  256. /package/build/{types/common → common}/hooks/usePolling/usePolling.d.ts +0 -0
  257. /package/build/{types/common → common}/hooks/usePrevious/usePrevious.d.ts +0 -0
  258. /package/build/{types/common → common}/hooks/useStepPolling/useStepPolling.d.ts +0 -0
  259. /package/build/{types/common → common}/makeFetcher/index.d.ts +0 -0
  260. /package/build/{types/common → common}/makeFetcher/makeFetcher.d.ts +0 -0
  261. /package/build/{types/common → common}/messages.d.ts +0 -0
  262. /package/build/{types/common → common}/utils/api-utils.d.ts +0 -0
  263. /package/build/{types/common → common}/utils/date-utils.d.ts +0 -0
  264. /package/build/{types/common → common}/utils/debounce.d.ts +0 -0
  265. /package/build/{types/common → common}/utils/file-utils.d.ts +0 -0
  266. /package/build/{types/common → common}/utils/id-utils.d.ts +0 -0
  267. /package/build/{types/common → common}/utils/index.d.ts +0 -0
  268. /package/build/{types/common → common}/utils/is-equal.d.ts +0 -0
  269. /package/build/{types/common → common}/utils/schema-utils.d.ts +0 -0
  270. /package/build/{types/common → common}/utils/step-utils.d.ts +0 -0
  271. /package/build/{types/common → common}/validators/index.d.ts +0 -0
  272. /package/build/{types/common → common}/validators/models/model-validators.d.ts +0 -0
  273. /package/build/{types/common → common}/validators/models/models.utils.d.ts +0 -0
  274. /package/build/{types/common → common}/validators/schemas/schema-validators.d.ts +0 -0
  275. /package/build/{types/common → common}/validators/types/type-validators.d.ts +0 -0
  276. /package/build/{types/common → common}/validators/validationFailures/validation-failures.d.ts +0 -0
  277. /package/build/{types/common → common}/validators/validationFailures/validation-failures.utils.d.ts +0 -0
  278. /package/build/{types/common → common}/validators/values/value-validators.d.ts +0 -0
  279. /package/build/{types/dynamicFlow → dynamicFlow}/DynamicFlow.d.ts +0 -0
  280. /package/build/{types/dynamicFlow → dynamicFlow}/DynamicFlowStep.d.ts +0 -0
  281. /package/build/{types/dynamicFlow → dynamicFlow}/DynamicFlowTypes.d.ts +0 -0
  282. /package/build/{types/dynamicFlow → dynamicFlow}/index.d.ts +0 -0
  283. /package/build/{types/dynamicFlow → dynamicFlow}/stories/DynamicFlow.story.d.ts +0 -0
  284. /package/build/{types/dynamicFlow → dynamicFlow}/stories/EditableDynamicFlow.d.ts +0 -0
  285. /package/build/{types/dynamicFlow → dynamicFlow}/stories/fixtureFetcher.d.ts +0 -0
  286. /package/build/{types/dynamicFlow → dynamicFlow}/utils/errorBoundary/ErrorBoundary.d.ts +0 -0
  287. /package/build/{types/dynamicFlow → dynamicFlow}/utils/errorBoundary/ErrorBoundary.messages.d.ts +0 -0
  288. /package/build/{types/dynamicFlow → dynamicFlow}/utils/errorBoundary/ErrorBoundaryAlert.d.ts +0 -0
  289. /package/build/{types/dynamicFlow → dynamicFlow}/utils/index.d.ts +0 -0
  290. /package/build/{types/dynamicFlow → dynamicFlow}/utils/responseParsers/response-parsers.d.ts +0 -0
  291. /package/build/{types/dynamicFlow → dynamicFlow}/utils/useDebouncedRefresh/useDebouncedRefresh.d.ts +0 -0
  292. /package/build/{types/dynamicFlow → dynamicFlow}/utils/useDynamicFlowState.d.ts +0 -0
  293. /package/build/{types/dynamicFlow → dynamicFlow}/utils/useLoader.d.ts +0 -0
  294. /package/build/{types/fixtures → fixtures}/components/alert.d.ts +0 -0
  295. /package/build/{types/fixtures → fixtures}/components/box.d.ts +0 -0
  296. /package/build/{types/fixtures → fixtures}/components/button.d.ts +0 -0
  297. /package/build/{types/fixtures → fixtures}/components/columns.d.ts +0 -0
  298. /package/build/{types/fixtures → fixtures}/components/copyable.d.ts +0 -0
  299. /package/build/{types/fixtures → fixtures}/components/decision.d.ts +0 -0
  300. /package/build/{types/fixtures → fixtures}/components/heading.d.ts +0 -0
  301. /package/build/{types/fixtures → fixtures}/components/image.d.ts +0 -0
  302. /package/build/{types/fixtures → fixtures}/components/index.d.ts +0 -0
  303. /package/build/{types/fixtures → fixtures}/components/info.d.ts +0 -0
  304. /package/build/{types/fixtures → fixtures}/components/list.d.ts +0 -0
  305. /package/build/{types/fixtures → fixtures}/components/loading-indicator.d.ts +0 -0
  306. /package/build/{types/fixtures → fixtures}/components/paragraph.d.ts +0 -0
  307. /package/build/{types/fixtures → fixtures}/components/review.d.ts +0 -0
  308. /package/build/{types/fixtures → fixtures}/examples/camera-capture.d.ts +0 -0
  309. /package/build/{types/fixtures → fixtures}/examples/index.d.ts +0 -0
  310. /package/build/{types/fixtures → fixtures}/examples/recipient-update.d.ts +0 -0
  311. /package/build/{types/fixtures → fixtures}/examples/recipient.d.ts +0 -0
  312. /package/build/{types/fixtures → fixtures}/examples/single-file-upload.d.ts +0 -0
  313. /package/build/{types/fixtures → fixtures}/examples/step-validation-errors.d.ts +0 -0
  314. /package/build/{types/fixtures → fixtures}/features/action-response.d.ts +0 -0
  315. /package/build/{types/fixtures → fixtures}/features/external.d.ts +0 -0
  316. /package/build/{types/fixtures → fixtures}/features/index.d.ts +0 -0
  317. /package/build/{types/fixtures → fixtures}/features/persist-async.d.ts +0 -0
  318. /package/build/{types/fixtures → fixtures}/features/polling.d.ts +0 -0
  319. /package/build/{types/fixtures → fixtures}/features/validation-async.d.ts +0 -0
  320. /package/build/{types/fixtures → fixtures}/index.d.ts +0 -0
  321. /package/build/{types/fixtures → fixtures}/jsonSchemaForm/allOf.d.ts +0 -0
  322. /package/build/{types/fixtures → fixtures}/jsonSchemaForm/audRecipient.d.ts +0 -0
  323. /package/build/{types/fixtures → fixtures}/jsonSchemaForm/currency.d.ts +0 -0
  324. /package/build/{types/fixtures → fixtures}/jsonSchemaForm/multipleFileUploadBase64.d.ts +0 -0
  325. /package/build/{types/fixtures → fixtures}/jsonSchemaForm/multipleFileUploadBlob.d.ts +0 -0
  326. /package/build/{types/fixtures → fixtures}/jsonSchemaForm/oneOf.d.ts +0 -0
  327. /package/build/{types/fixtures → fixtures}/jsonSchemaForm/oneOfTabs.d.ts +0 -0
  328. /package/build/{types/fixtures → fixtures}/jsonSchemaForm/promotedOneOf.d.ts +0 -0
  329. /package/build/{types/fixtures → fixtures}/jsonSchemaForm/promotedOneOfCheckbox.d.ts +0 -0
  330. /package/build/{types/fixtures → fixtures}/jsonSchemaForm/simple.d.ts +0 -0
  331. /package/build/{types/fixtures → fixtures}/jsonSchemaForm/uploadPersistAsync.d.ts +0 -0
  332. /package/build/{types/fixtures → fixtures}/jsonSchemaForm/validationAsync.d.ts +0 -0
  333. /package/build/{types/fixtures → fixtures}/layouts/all.d.ts +0 -0
  334. /package/build/{types/fixtures → fixtures}/layouts/final-step-layout.d.ts +0 -0
  335. /package/build/{types/fixtures → fixtures}/layouts/index.d.ts +0 -0
  336. /package/build/{types/fixtures → fixtures}/layouts/list.d.ts +0 -0
  337. /package/build/{types/fixtures → fixtures}/layouts/pay-in.d.ts +0 -0
  338. /package/build/{types/fixtures → fixtures}/layouts/review.d.ts +0 -0
  339. /package/build/{types/fixtures → fixtures}/layouts/success.d.ts +0 -0
  340. /package/build/{types/fixtures → fixtures}/responses/action-response-final.d.ts +0 -0
  341. /package/build/{types/fixtures → fixtures}/responses/action.d.ts +0 -0
  342. /package/build/{types/fixtures → fixtures}/responses/exit.d.ts +0 -0
  343. /package/build/{types/fixtures → fixtures}/responses/index.d.ts +0 -0
  344. /package/build/{types/fixtures → fixtures}/responses/recipient-update-final.d.ts +0 -0
  345. /package/build/{types/fixtures → fixtures}/schemas/basic-form.d.ts +0 -0
  346. /package/build/{types/fixtures → fixtures}/schemas/index.d.ts +0 -0
  347. /package/build/{types/fixtures → fixtures}/schemas/number-and-integer.d.ts +0 -0
  348. /package/build/{types/fixtures → fixtures}/schemas/one-of.d.ts +0 -0
  349. /package/build/{types/fixtures → fixtures}/schemas/string-formats.d.ts +0 -0
  350. /package/build/{types/fixtures → fixtures}/utils/image-util.d.ts +0 -0
  351. /package/build/{types/formControl → formControl}/FormControl.d.ts +0 -0
  352. /package/build/{types/formControl → formControl}/index.d.ts +0 -0
  353. /package/build/{types/formControl → formControl}/utils/index.d.ts +0 -0
  354. /package/build/{types/formControl → formControl}/utils/value-utils.d.ts +0 -0
  355. /package/build/{types/i18n → i18n}/index.d.ts +0 -0
  356. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/JsonSchemaForm.d.ts +0 -0
  357. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/allOfSchema/AllOfSchema.d.ts +0 -0
  358. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/allOfSchema/index.d.ts +0 -0
  359. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/arrayTypeSchema/ArraySchema.d.ts +0 -0
  360. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/arrayTypeSchema/arrayListSchema/ArrayListSchema.d.ts +0 -0
  361. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/arrayTypeSchema/arrayListSchema/index.d.ts +0 -0
  362. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.d.ts +0 -0
  363. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.messages.d.ts +0 -0
  364. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/index.d.ts +0 -0
  365. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/index.d.ts +0 -0
  366. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/upload-utils.d.ts +0 -0
  367. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/useFormattedDefaultErrorMessages.d.ts +0 -0
  368. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/arrayTypeSchema/index.d.ts +0 -0
  369. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/basicTypeSchema/BasicTypeSchema.d.ts +0 -0
  370. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/basicTypeSchema/index.d.ts +0 -0
  371. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/controlFeedback/ControlFeedback.d.ts +0 -0
  372. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/controlFeedback/ControlFeedback.messages.d.ts +0 -0
  373. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/controlFeedback/index.d.ts +0 -0
  374. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/genericSchema/GenericSchema.d.ts +0 -0
  375. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/genericSchema/index.d.ts +0 -0
  376. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/help/Help.d.ts +0 -0
  377. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/help/Help.messages.d.ts +0 -0
  378. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/help/index.d.ts +0 -0
  379. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/index.d.ts +0 -0
  380. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/objectSchema/ObjectSchema.d.ts +0 -0
  381. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/objectSchema/index.d.ts +0 -0
  382. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/oneOfSchema/OneOfSchema.d.ts +0 -0
  383. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/oneOfSchema/index.d.ts +0 -0
  384. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/oneOfSchema/utils/const-schema-utils.d.ts +0 -0
  385. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/oneOfSchema/utils/index.d.ts +0 -0
  386. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/oneOfSchema/utils/one-of-utils.d.ts +0 -0
  387. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/persistAsyncSchema/PersistAsyncSchema.d.ts +0 -0
  388. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/persistAsyncSchema/PersistAsyncSchema.messages.d.ts +0 -0
  389. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/persistAsyncSchema/index.d.ts +0 -0
  390. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.d.ts +0 -0
  391. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/persistAsyncSchema/persistAsyncBasicSchema/index.d.ts +0 -0
  392. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.d.ts +0 -0
  393. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.d.ts +0 -0
  394. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/persistAsyncSchema/persistAsyncBlobSchema/index.d.ts +0 -0
  395. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/promotedOneOfSchema/PromotedOneOfSchema.d.ts +0 -0
  396. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/promotedOneOfSchema/index.d.ts +0 -0
  397. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/promotedOneOfSchema/promoted-one-of-utils.d.ts +0 -0
  398. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.d.ts +0 -0
  399. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.d.ts +0 -0
  400. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.d.ts +0 -0
  401. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/readOnlySchema/ReadOnlySchema.d.ts +0 -0
  402. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/readOnlySchema/ReadOnlySchema.messages.d.ts +0 -0
  403. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/readOnlySchema/index.d.ts +0 -0
  404. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/schemaFormControl/SchemaFormControl.d.ts +0 -0
  405. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/schemaFormControl/index.d.ts +0 -0
  406. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/schemaFormControl/utils/currency-utils.d.ts +0 -0
  407. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/schemaFormControl/utils/index.d.ts +0 -0
  408. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/schemaFormControl/utils/mapping-utils.d.ts +0 -0
  409. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/validationAsyncSchema/ValidationAsyncSchema.d.ts +0 -0
  410. /package/build/{types/jsonSchemaForm → jsonSchemaForm}/validationAsyncSchema/index.d.ts +0 -0
  411. /package/build/{types/layout → layout}/DynamicLayout.d.ts +0 -0
  412. /package/build/{types/layout → layout}/alert/DynamicAlert.d.ts +0 -0
  413. /package/build/{types/layout → layout}/box/DynamicBox.d.ts +0 -0
  414. /package/build/{types/layout → layout}/button/DynamicButton.d.ts +0 -0
  415. /package/build/{types/layout → layout}/columns/DynamicColumns.d.ts +0 -0
  416. /package/build/{types/layout → layout}/decision/DynamicDecision.d.ts +0 -0
  417. /package/build/{types/layout → layout}/divider/DynamicDivider.d.ts +0 -0
  418. /package/build/{types/layout → layout}/external/DynamicExternal.d.ts +0 -0
  419. /package/build/{types/layout → layout}/external/DynamicExternal.messages.d.ts +0 -0
  420. /package/build/{types/layout → layout}/form/DynamicForm.d.ts +0 -0
  421. /package/build/{types/layout → layout}/heading/DynamicHeading.d.ts +0 -0
  422. /package/build/{types/layout → layout}/icon/DynamicIcon.d.ts +0 -0
  423. /package/build/{types/layout → layout}/image/DynamicImage.d.ts +0 -0
  424. /package/build/{types/layout → layout}/index.d.ts +0 -0
  425. /package/build/{types/layout → layout}/info/DynamicInfo.d.ts +0 -0
  426. /package/build/{types/layout → layout}/list/DynamicList.d.ts +0 -0
  427. /package/build/{types/layout → layout}/loadingIndicator/DynamicLoadingIndicator.d.ts +0 -0
  428. /package/build/{types/layout → layout}/paragraph/DynamicParagraph.d.ts +0 -0
  429. /package/build/{types/layout → layout}/paragraph/DynamicParagraph.messages.d.ts +0 -0
  430. /package/build/{types/layout → layout}/paragraph/useSnackBarIfAvailable.d.ts +0 -0
  431. /package/build/{types/layout → layout}/review/DynamicReview.d.ts +0 -0
  432. /package/build/{types/layout → layout}/utils.d.ts +0 -0
  433. /package/build/{types/step → step}/cameraStep/CameraStep.d.ts +0 -0
  434. /package/build/{types/step → step}/cameraStep/cameraCapture/CameraCapture.d.ts +0 -0
  435. /package/build/{types/step → step}/cameraStep/cameraCapture/CameraCapture.messages.d.ts +0 -0
  436. /package/build/{types/step → step}/cameraStep/cameraCapture/components/index.d.ts +0 -0
  437. /package/build/{types/step → step}/cameraStep/cameraCapture/hooks/index.d.ts +0 -0
  438. /package/build/{types/step → step}/cameraStep/cameraCapture/index.d.ts +0 -0
  439. /package/build/{types/step → step}/cameraStep/cameraCapture/overlay/Overlay.d.ts +0 -0
  440. /package/build/{types/step → step}/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.d.ts +0 -0
  441. /package/build/{types/step → step}/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.messages.d.ts +0 -0
  442. /package/build/{types/step → step}/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.d.ts +0 -0
  443. /package/build/{types/step → step}/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.d.ts +0 -0
  444. /package/build/{types/step → step}/cameraStep/cameraCapture/screens/index.d.ts +0 -0
  445. /package/build/{types/step → step}/cameraStep/cameraCapture/tracking/index.d.ts +0 -0
  446. /package/build/{types/step → step}/cameraStep/cameraCapture/utils/index.d.ts +0 -0
  447. /package/build/{types/step → step}/cameraStep/index.d.ts +0 -0
  448. /package/build/{types/step → step}/externalConfirmationStep/ExternalConfirmationStep.d.ts +0 -0
  449. /package/build/{types/step → step}/externalConfirmationStep/ExternalConfirmationStep.messages.d.ts +0 -0
  450. /package/build/{types/step → step}/externalConfirmationStep/index.d.ts +0 -0
  451. /package/build/{types/step → step}/index.d.ts +0 -0
  452. /package/build/{types/step → step}/layoutStep/LayoutStep.d.ts +0 -0
  453. /package/build/{types/step → step}/layoutStep/index.d.ts +0 -0
  454. /package/build/{types/step → step}/layoutStep/utils/index.d.ts +0 -0
  455. /package/build/{types/step → step}/layoutStep/utils/inline-reference-utils.d.ts +0 -0
  456. /package/build/{types/step → step}/layoutStep/utils/layout-utils.d.ts +0 -0
  457. /package/build/types/{types/common → common}/FormControl.d.ts +0 -0
  458. /package/build/types/{types/specification → specification}/Action.d.ts +0 -0
  459. /package/build/types/{types/specification → specification}/FileUploadSchema.d.ts +0 -0
  460. /package/build/types/{types/specification → specification}/LayoutComponent.d.ts +0 -0
  461. /package/build/types/{types/specification → specification}/Model.d.ts +0 -0
  462. /package/build/types/{types/specification → specification}/PersistAsync.d.ts +0 -0
  463. /package/build/types/{types/specification → specification}/Polling.d.ts +0 -0
  464. /package/build/types/{types/specification → specification}/Promotion.d.ts +0 -0
  465. /package/build/types/{types/specification → specification}/Schema.d.ts +0 -0
  466. /package/build/types/{types/specification → specification}/Step.d.ts +0 -0
  467. /package/build/types/{types/specification → specification}/ValidationAsync.d.ts +0 -0
  468. /package/build/types/{types/specification → specification}/core.d.ts +0 -0
@@ -0,0 +1,26 @@
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 __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ exports.__esModule = true;
17
+ var jsx_runtime_1 = require("react/jsx-runtime");
18
+ var components_1 = require("@transferwise/components");
19
+ var react_intl_1 = require("react-intl");
20
+ var NoCameraAccess_messages_1 = __importDefault(require("./NoCameraAccess.messages"));
21
+ var NoCameraAccess = function (_a) {
22
+ var onAction = _a.onAction;
23
+ var intl = (0, react_intl_1.useIntl)();
24
+ return ((0, jsx_runtime_1.jsx)("div", __assign({ id: "no-camera-access" }, { children: (0, jsx_runtime_1.jsx)("div", __assign({ className: "container p-t-5" }, { children: (0, jsx_runtime_1.jsx)("div", __assign({ className: "row" }, { children: (0, jsx_runtime_1.jsxs)("div", __assign({ className: "col-md-6 col-md-offset-3" }, { children: [(0, jsx_runtime_1.jsx)("h2", __assign({ className: "text-xs-center m-b-3" }, { children: intl.formatMessage(NoCameraAccess_messages_1["default"].title) })), (0, jsx_runtime_1.jsx)("p", __assign({ className: "text-xs-center m-b-5" }, { children: intl.formatMessage(NoCameraAccess_messages_1["default"].paragraph) })), (0, jsx_runtime_1.jsx)(components_1.Button, __assign({ block: true, onClick: onAction }, { children: intl.formatMessage(NoCameraAccess_messages_1["default"].action) }))] })) })) })) })));
25
+ };
26
+ exports["default"] = NoCameraAccess;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ var react_intl_1 = require("react-intl");
4
+ exports["default"] = (0, react_intl_1.defineMessages)({
5
+ title: {
6
+ id: 'dynamicFlows.CameraCapture.NoCameraAccess.title',
7
+ defaultMessage: "We can't access your camera",
8
+ description: 'Title of standalone page prompting missing camera permissions'
9
+ },
10
+ paragraph: {
11
+ id: 'dynamicFlows.CameraCapture.NoCameraAccess.paragraph',
12
+ defaultMessage: "Enable camera access in your browser's settings to get going again.",
13
+ description: 'Further text of standalone page prompting missing camera permissions'
14
+ },
15
+ action: {
16
+ id: 'dynamicFlows.CameraCapture.NoCameraAccess.action',
17
+ defaultMessage: 'Enable camera access',
18
+ description: 'Action to ask for camera permissions again'
19
+ }
20
+ });
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ exports.__esModule = true;
14
+ exports.CameraNotSupported = exports.NoCameraAccess = void 0;
15
+ var NoCameraAccess_1 = require("./NoCameraAccess/NoCameraAccess");
16
+ __createBinding(exports, NoCameraAccess_1, "default", "NoCameraAccess");
17
+ var CameraNotSupported_1 = require("./CameraNotSupported/CameraNotSupported");
18
+ __createBinding(exports, CameraNotSupported_1, "default", "CameraNotSupported");
@@ -0,0 +1,104 @@
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
+ exports.trackCameraNotSupported = exports.trackCameraFeedStarted = exports.trackCameraPermissionDenied = void 0;
51
+ var utils_1 = require("../utils");
52
+ var trackCameraPermissionDenied = function (onEvent) {
53
+ return onEvent === null || onEvent === void 0 ? void 0 : onEvent('Dynamic Flow - Camera Permission Denied', {});
54
+ };
55
+ exports.trackCameraPermissionDenied = trackCameraPermissionDenied;
56
+ var trackCameraFeedStarted = function (onEvent, props, stream) { return __awaiter(void 0, void 0, void 0, function () { var _a, _b, _c; return __generator(this, function (_d) {
57
+ switch (_d.label) {
58
+ case 0:
59
+ if (!(onEvent === null || onEvent === void 0)) return [3 /*break*/, 1];
60
+ _a = void 0;
61
+ return [3 /*break*/, 3];
62
+ case 1:
63
+ _b = onEvent;
64
+ _c = ['Dynamic Flow - Camera Feed Started'];
65
+ return [4 /*yield*/, getCameraStartedProperties(props, stream)];
66
+ case 2:
67
+ _a = _b.apply(void 0, _c.concat([_d.sent()]));
68
+ _d.label = 3;
69
+ case 3: return [2 /*return*/, _a];
70
+ }
71
+ }); }); };
72
+ exports.trackCameraFeedStarted = trackCameraFeedStarted;
73
+ var trackCameraNotSupported = function (onEvent, error) { return onEvent === null || onEvent === void 0 ? void 0 : onEvent('Dynamic Flow - Camera Not Supported', { Error: error }); };
74
+ exports.trackCameraNotSupported = trackCameraNotSupported;
75
+ var getCameraStartedProperties = function (props, videoStream) { return __awaiter(void 0, void 0, void 0, function () {
76
+ var videoTrack, capabilities, settings, _a, _b, _c, _d;
77
+ var _e;
78
+ var _f;
79
+ return __generator(this, function (_g) {
80
+ switch (_g.label) {
81
+ case 0:
82
+ videoTrack = (0, utils_1.getVideoTrack)(videoStream);
83
+ capabilities = (0, utils_1.getVideoCapabilities)(videoStream);
84
+ settings = (_f = videoTrack === null || videoTrack === void 0 ? void 0 : videoTrack.getSettings) === null || _f === void 0 ? void 0 : _f.call(videoTrack);
85
+ _a = [{}];
86
+ _b = videoTrack;
87
+ if (!_b) return [3 /*break*/, 3];
88
+ _e = {};
89
+ _c = 'Available Video Devices (by label)';
90
+ return [4 /*yield*/, (0, utils_1.getAvailableVideoDeviceLabels)()];
91
+ case 1:
92
+ _e[_c] = _g.sent();
93
+ _d = 'Active Video Device (by label)';
94
+ return [4 /*yield*/, (0, utils_1.getActiveVideoDeviceLabel)(videoStream)];
95
+ case 2:
96
+ _b = (_e[_d] = _g.sent(),
97
+ _e['Camera Capabilities'] = capabilities,
98
+ _e['Camera Settings'] = settings,
99
+ _e);
100
+ _g.label = 3;
101
+ case 3: return [2 /*return*/, __assign.apply(void 0, [__assign.apply(void 0, _a.concat([(_b)])), { 'Camera Direction (Asked)': props === null || props === void 0 ? void 0 : props.direction }])];
102
+ }
103
+ });
104
+ }); };
@@ -0,0 +1,114 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
+ 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;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ exports.__esModule = true;
39
+ exports.getVideoCapabilities = exports.getVideoTrack = exports.getActiveVideoDeviceLabel = exports.getAvailableVideoDeviceLabels = exports.getAvailableVideoDevices = exports.generateCanvasFromVideo = exports.isMainBackCamera = exports.isSelfieCamera = void 0;
40
+ var isSelfieCamera = function (stream) {
41
+ var _a;
42
+ var facingMode = (((_a = (0, exports.getVideoTrack)(stream)) === null || _a === void 0 ? void 0 : _a.getSettings()) || {}).facingMode;
43
+ // facingMode === undefined for desktop users
44
+ return facingMode === 'user' || facingMode === undefined;
45
+ };
46
+ exports.isSelfieCamera = isSelfieCamera;
47
+ var isMainBackCamera = function (deviceInfo) {
48
+ return !!((deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.label) || '').match(/camera2? 0/g);
49
+ };
50
+ exports.isMainBackCamera = isMainBackCamera;
51
+ var generateCanvasFromVideo = function (video) { return __awaiter(void 0, void 0, void 0, function () {
52
+ var canvas, context;
53
+ return __generator(this, function (_a) {
54
+ switch (_a.label) {
55
+ case 0:
56
+ canvas = document.createElement('canvas');
57
+ if (!video) return [3 /*break*/, 2];
58
+ canvas.setAttribute('height', "".concat(video.videoHeight));
59
+ canvas.setAttribute('width', "".concat(video.videoWidth));
60
+ context = canvas === null || canvas === void 0 ? void 0 : canvas.getContext('2d');
61
+ if (!context) return [3 /*break*/, 2];
62
+ // Timeout is needed for intermittent iOS issue
63
+ return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, 100); })];
64
+ case 1:
65
+ // Timeout is needed for intermittent iOS issue
66
+ _a.sent();
67
+ context.drawImage(video, 0, 0, canvas.width, canvas.height);
68
+ _a.label = 2;
69
+ case 2: return [2 /*return*/, canvas];
70
+ }
71
+ });
72
+ }); };
73
+ exports.generateCanvasFromVideo = generateCanvasFromVideo;
74
+ var getAvailableVideoDevices = function () { return __awaiter(void 0, void 0, void 0, function () {
75
+ var _a, _b;
76
+ return __generator(this, function (_c) {
77
+ switch (_c.label) {
78
+ case 0: return [4 /*yield*/, ((_b = (_a = navigator === null || navigator === void 0 ? void 0 : navigator.mediaDevices) === null || _a === void 0 ? void 0 : _a.enumerateDevices) === null || _b === void 0 ? void 0 : _b.call(_a))];
79
+ case 1: return [2 /*return*/, ((_c.sent()) || []).filter(function (deviceInfo) { return deviceInfo.kind === 'videoinput'; })];
80
+ }
81
+ });
82
+ }); };
83
+ exports.getAvailableVideoDevices = getAvailableVideoDevices;
84
+ var getAvailableVideoDeviceLabels = function () { return __awaiter(void 0, void 0, void 0, function () {
85
+ var _a, _b;
86
+ return __generator(this, function (_c) {
87
+ switch (_c.label) {
88
+ case 0: return [4 /*yield*/, ((_b = (_a = navigator === null || navigator === void 0 ? void 0 : navigator.mediaDevices) === null || _a === void 0 ? void 0 : _a.enumerateDevices) === null || _b === void 0 ? void 0 : _b.call(_a))];
89
+ case 1: return [2 /*return*/, ((_c.sent()) || [])
90
+ .filter(function (deviceInfo) { return deviceInfo.kind === 'videoinput'; })
91
+ .map(function (deviceInfo) { return deviceInfo.label; })];
92
+ }
93
+ });
94
+ }); };
95
+ exports.getAvailableVideoDeviceLabels = getAvailableVideoDeviceLabels;
96
+ var getActiveVideoDeviceLabel = function (videoStream) { return __awaiter(void 0, void 0, void 0, function () {
97
+ var capabilities;
98
+ var _a, _b, _c;
99
+ return __generator(this, function (_d) {
100
+ switch (_d.label) {
101
+ case 0:
102
+ capabilities = (0, exports.getVideoCapabilities)(videoStream);
103
+ return [4 /*yield*/, ((_b = (_a = navigator === null || navigator === void 0 ? void 0 : navigator.mediaDevices) === null || _a === void 0 ? void 0 : _a.enumerateDevices) === null || _b === void 0 ? void 0 : _b.call(_a))];
104
+ case 1: return [2 /*return*/, (_c = ((_d.sent()) || [])
105
+ .filter(function (deviceInfo) { return deviceInfo.kind === 'videoinput'; })
106
+ .find(function (deviceInfo) { return deviceInfo.deviceId === (capabilities === null || capabilities === void 0 ? void 0 : capabilities.deviceId); })) === null || _c === void 0 ? void 0 : _c.label];
107
+ }
108
+ });
109
+ }); };
110
+ exports.getActiveVideoDeviceLabel = getActiveVideoDeviceLabel;
111
+ var getVideoTrack = function (videoStream) { var _a; return (((_a = videoStream === null || videoStream === void 0 ? void 0 : videoStream.getVideoTracks) === null || _a === void 0 ? void 0 : _a.call(videoStream)) || [])[0]; };
112
+ exports.getVideoTrack = getVideoTrack;
113
+ var getVideoCapabilities = function (videoStream) { var _a, _b; return (_b = (_a = (0, exports.getVideoTrack)(videoStream)) === null || _a === void 0 ? void 0 : _a.getCapabilities) === null || _b === void 0 ? void 0 : _b.call(_a); };
114
+ exports.getVideoCapabilities = getVideoCapabilities;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ exports.__esModule = true;
14
+ exports["default"] = void 0;
15
+ var CameraStep_1 = require("./CameraStep");
16
+ __createBinding(exports, CameraStep_1, "default");
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ exports.__esModule = true;
6
+ var jsx_runtime_1 = require("react/jsx-runtime");
7
+ var react_intl_1 = require("react-intl");
8
+ var layout_1 = require("../../layout");
9
+ var ExternalConfirmationStep_messages_1 = __importDefault(require("./ExternalConfirmationStep.messages"));
10
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
11
+ var noop = function () { };
12
+ var ExternalConfirmationStep = function (_a) {
13
+ var url = _a.url, onClose = _a.onClose;
14
+ var formatMessage = (0, react_intl_1.useIntl)().formatMessage;
15
+ return ((0, jsx_runtime_1.jsx)(layout_1.DynamicLayout, { components: [
16
+ {
17
+ type: 'box',
18
+ width: 'lg',
19
+ components: [
20
+ {
21
+ type: 'heading',
22
+ text: formatMessage(ExternalConfirmationStep_messages_1["default"].title),
23
+ size: 'lg',
24
+ align: 'center',
25
+ margin: 'xl'
26
+ },
27
+ {
28
+ type: 'info',
29
+ markdown: formatMessage(ExternalConfirmationStep_messages_1["default"].description, { origin: getOrigin(url) }),
30
+ align: 'center',
31
+ margin: 'xl'
32
+ },
33
+ {
34
+ type: 'box',
35
+ width: 'md',
36
+ components: [
37
+ {
38
+ type: 'button',
39
+ action: { title: formatMessage(ExternalConfirmationStep_messages_1["default"].open), type: 'primary', url: url, exit: true }
40
+ },
41
+ {
42
+ type: 'button',
43
+ action: {
44
+ title: formatMessage(ExternalConfirmationStep_messages_1["default"].cancel),
45
+ type: 'link',
46
+ url: '',
47
+ exit: true
48
+ }
49
+ },
50
+ ]
51
+ },
52
+ ]
53
+ },
54
+ ], submitted: false, onAction: function (action) {
55
+ if (action.url) {
56
+ window.open(action.url, '_blank');
57
+ }
58
+ onClose();
59
+ }, onModelChange: noop, onPersistAsync: noop }));
60
+ };
61
+ exports["default"] = ExternalConfirmationStep;
62
+ function getOrigin(url) {
63
+ try {
64
+ return new URL(url).origin;
65
+ }
66
+ catch (_a) {
67
+ return url;
68
+ }
69
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ var react_intl_1 = require("react-intl");
4
+ exports["default"] = (0, react_intl_1.defineMessages)({
5
+ title: {
6
+ id: 'dynamicFlows.ExternalConfirmation.title',
7
+ defaultMessage: 'Please confirm',
8
+ description: 'Heading for the confirmation screen.'
9
+ },
10
+ description: {
11
+ id: 'dynamicFlows.ExternalConfirmation.description',
12
+ defaultMessage: 'Please confirm you want to open **{origin}** in a new browser tab.',
13
+ description: 'Description for the confirmation screen.'
14
+ },
15
+ open: {
16
+ id: 'dynamicFlows.ExternalConfirmation.open',
17
+ defaultMessage: 'Open in new tab',
18
+ description: 'Button text confirming opening a new browser tab.'
19
+ },
20
+ cancel: {
21
+ id: 'dynamicFlows.ExternalConfirmation.cancel',
22
+ defaultMessage: 'Cancel',
23
+ description: 'Button text rejecting opening a new browser tab.'
24
+ }
25
+ });
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ exports.__esModule = true;
14
+ exports["default"] = void 0;
15
+ var ExternalConfirmationStep_1 = require("./ExternalConfirmationStep");
16
+ __createBinding(exports, ExternalConfirmationStep_1, "default");
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ exports.__esModule = true;
14
+ exports.ExternalConfirmationStep = exports.CameraStep = exports.LayoutStep = void 0;
15
+ var layoutStep_1 = require("./layoutStep");
16
+ __createBinding(exports, layoutStep_1, "default", "LayoutStep");
17
+ var cameraStep_1 = require("./cameraStep");
18
+ __createBinding(exports, cameraStep_1, "default", "CameraStep");
19
+ var externalConfirmationStep_1 = require("./externalConfirmationStep");
20
+ __createBinding(exports, externalConfirmationStep_1, "default", "ExternalConfirmationStep");
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ var jsx_runtime_1 = require("react/jsx-runtime");
4
+ var contexts_1 = require("../../common/contexts");
5
+ var hooks_1 = require("../../common/hooks");
6
+ var validators_1 = require("../../common/validators");
7
+ var layout_1 = require("../../layout");
8
+ var utils_1 = require("./utils");
9
+ var getComponents = function (step, options) {
10
+ var _a;
11
+ if (!step || (0, validators_1.isEmpty)(step) || (!step.layout && !step.type)) {
12
+ return [];
13
+ }
14
+ var layout = (0, utils_1.convertStepToLayout)(step, options);
15
+ return (0, utils_1.inlineReferences)({
16
+ layout: layout,
17
+ schemas: step.schemas || [],
18
+ actions: step.actions || [],
19
+ model: (_a = step.model) !== null && _a !== void 0 ? _a : null
20
+ });
21
+ };
22
+ var LayoutStep = function (props) {
23
+ var stepSpecification = props.stepSpecification, stepLayoutOptions = props.stepLayoutOptions, submitted = props.submitted, model = props.model, formErrors = props.formErrors, onModelChange = props.onModelChange;
24
+ var components = getComponents(stepSpecification, stepLayoutOptions);
25
+ var _a = (0, contexts_1.useDynamicFlow)(), loading = _a.loading, registerPersistAsyncPromise = _a.registerPersistAsyncPromise;
26
+ var onEvent = (0, contexts_1.useEventDispatcher)();
27
+ var onAction = !loading
28
+ ? props.onAction
29
+ : function () {
30
+ onEvent('Dynamic Flow - onAction supressed', { reason: 'LayoutStep - loading state' });
31
+ };
32
+ (0, hooks_1.useStepPolling)(stepSpecification.polling, onAction);
33
+ return ((0, jsx_runtime_1.jsx)(layout_1.DynamicLayout, { components: components, submitted: submitted, model: model, errors: formErrors, onAction: onAction, onModelChange: onModelChange, onPersistAsync: registerPersistAsyncPromise }));
34
+ };
35
+ exports["default"] = LayoutStep;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ exports.__esModule = true;
14
+ exports["default"] = void 0;
15
+ var LayoutStep_1 = require("./LayoutStep");
16
+ __createBinding(exports, LayoutStep_1, "default");
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ exports.__esModule = true;
14
+ exports.inlineReferences = exports.convertStepToLayout = void 0;
15
+ var layout_utils_1 = require("./layout-utils");
16
+ __createBinding(exports, layout_utils_1, "convertStepToLayout");
17
+ var inline_reference_utils_1 = require("./inline-reference-utils");
18
+ __createBinding(exports, inline_reference_utils_1, "inlineReferences");
@@ -0,0 +1,95 @@
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
+ exports.__esModule = true;
14
+ exports.inlineReferences = void 0;
15
+ var layout_utils_1 = require("./layout-utils");
16
+ function inlineReferences(_a) {
17
+ var layout = _a.layout, schemas = _a.schemas, actions = _a.actions, model = _a.model;
18
+ if (!layout) {
19
+ return [];
20
+ }
21
+ if (!schemas) {
22
+ return layout;
23
+ }
24
+ return layout.map(function (component) {
25
+ if (component.type === 'form') {
26
+ return inlineFormSchema({ formComponent: component, schemas: schemas });
27
+ }
28
+ if (component.type === 'decision') {
29
+ return inlineDecisionActions({ decisionComponent: component, actions: actions });
30
+ }
31
+ if (component.type === 'button') {
32
+ return inlineAction({ actionComponent: component, actions: actions });
33
+ }
34
+ if (component.type === 'box') {
35
+ return inlineBoxReferences({ boxComponent: component, schemas: schemas, actions: actions, model: model });
36
+ }
37
+ if (component.type === 'columns') {
38
+ return inlineColumnsReferences({ columnsComponent: component, schemas: schemas, actions: actions, model: model });
39
+ }
40
+ return component;
41
+ });
42
+ }
43
+ exports.inlineReferences = inlineReferences;
44
+ function inlineFormSchema(_a) {
45
+ var formComponent = _a.formComponent, schemas = _a.schemas;
46
+ if (isReference(formComponent.schema) && formComponent.schema.$ref) {
47
+ return __assign(__assign({}, formComponent), { schema: getSchemaById(schemas, formComponent.schema.$ref) });
48
+ }
49
+ return __assign({}, formComponent);
50
+ }
51
+ function inlineDecisionActions(_a) {
52
+ var _b;
53
+ var decisionComponent = _a.decisionComponent, actions = _a.actions;
54
+ var newOptions = (_b = decisionComponent === null || decisionComponent === void 0 ? void 0 : decisionComponent.options) === null || _b === void 0 ? void 0 : _b.map(function (option) {
55
+ return option.action && isReference(option.action)
56
+ ? __assign(__assign({}, option), { action: getActionById(actions, option.action.$ref) }) : option;
57
+ });
58
+ return __assign(__assign({}, decisionComponent), { options: newOptions });
59
+ }
60
+ function inlineAction(_a) {
61
+ var _b;
62
+ var actionComponent = _a.actionComponent, actions = _a.actions;
63
+ if (actionComponent.action &&
64
+ isReference(actionComponent.action) &&
65
+ ((_b = actionComponent.action) === null || _b === void 0 ? void 0 : _b.$ref)) {
66
+ var newAction = getActionById(actions, actionComponent.action.$ref);
67
+ return (0, layout_utils_1.convertStepActionToDynamicAction)(newAction);
68
+ }
69
+ return actionComponent;
70
+ }
71
+ function inlineBoxReferences(_a) {
72
+ var boxComponent = _a.boxComponent, schemas = _a.schemas, actions = _a.actions, model = _a.model;
73
+ return __assign(__assign({}, boxComponent), { components: inlineReferences({ layout: boxComponent.components, schemas: schemas, actions: actions, model: model }) });
74
+ }
75
+ function inlineColumnsReferences(_a) {
76
+ var columnsComponent = _a.columnsComponent, schemas = _a.schemas, actions = _a.actions, model = _a.model;
77
+ return __assign(__assign({}, columnsComponent), { left: inlineReferences({ layout: columnsComponent.left, schemas: schemas, actions: actions, model: model }), right: inlineReferences({ layout: columnsComponent.right, schemas: schemas, actions: actions, model: model }) });
78
+ }
79
+ function getSchemaById(schemas, id) {
80
+ var schema = schemas.find(function (schema) { return schema.$id === id; });
81
+ if (!schema) {
82
+ throw new Error("Fatal Error. Schema not found. $id ".concat(id));
83
+ }
84
+ return schema;
85
+ }
86
+ function getActionById(actions, id) {
87
+ var action = actions.find(function (action) { return action.$id === id; });
88
+ if (!action) {
89
+ throw new Error("Fatal Error. Action not found. $id ".concat(id));
90
+ }
91
+ return action;
92
+ }
93
+ function isReference(block) {
94
+ return Object.prototype.hasOwnProperty.call(block, '$ref');
95
+ }