@wise/dynamic-flow-client 0.4.0-beta-75e4da.4 → 0.4.0-beta-d2067b.7
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.
- package/build/main.js +582 -595
- package/build/main.min.js +1 -1
- package/build/types/index.d.ts +10 -15
- package/build/types/{index.js → types/index.d.ts} +2 -0
- package/package.json +3 -4
- package/build/common/constants/DateMode.js +0 -4
- package/build/common/constants/FormControlType.js +0 -17
- package/build/common/constants/MonthFormat.js +0 -4
- package/build/common/constants/SchemaType.js +0 -11
- package/build/common/constants/Size.js +0 -7
- package/build/common/constants/index.js +0 -5
- package/build/common/contexts/dynamicFlowContexts/DynamicFlowContexts.js +0 -36
- package/build/common/contexts/dynamicFlowContexts/usePendingPromiseCounter.js +0 -13
- package/build/common/contexts/eventsContext/EventsContext.js +0 -33
- package/build/common/contexts/fetcherContexts/FetcherContexts.js +0 -35
- package/build/common/contexts/index.js +0 -4
- package/build/common/contexts/logContext/LogContext.js +0 -39
- package/build/common/hooks/index.js +0 -7
- package/build/common/hooks/useDebouncedFunction/useDebouncedFunction.js +0 -9
- package/build/common/hooks/useExternal/useExternal.js +0 -15
- package/build/common/hooks/useExternalStepPolling/useExternalStepPolling.js +0 -69
- package/build/common/hooks/usePersistAsync/usePersistAsync.js +0 -170
- package/build/common/hooks/usePolling/usePolling.js +0 -48
- package/build/common/hooks/usePrevious/usePrevious.js +0 -8
- package/build/common/hooks/useStepPolling/useStepPolling.js +0 -44
- package/build/common/makeFetcher/index.js +0 -1
- package/build/common/makeFetcher/makeFetcher.js +0 -33
- package/build/common/messages.js +0 -8
- package/build/common/utils/api-utils.js +0 -13
- package/build/common/utils/date-utils.js +0 -22
- package/build/common/utils/debounce.js +0 -38
- package/build/common/utils/file-utils.js +0 -45
- package/build/common/utils/id-utils.js +0 -5
- package/build/common/utils/index.js +0 -8
- package/build/common/utils/is-equal.js +0 -21
- package/build/common/utils/schema-utils.js +0 -48
- package/build/common/utils/step-utils.js +0 -42
- package/build/common/validators/index.js +0 -5
- package/build/common/validators/models/model-validators.js +0 -63
- package/build/common/validators/models/models.utils.js +0 -118
- package/build/common/validators/schemas/schema-validators.js +0 -98
- package/build/common/validators/types/type-validators.js +0 -14
- package/build/common/validators/validationFailures/validation-failures.js +0 -140
- package/build/common/validators/validationFailures/validation-failures.utils.js +0 -40
- package/build/common/validators/values/value-validators.js +0 -6
- package/build/dynamicFlow/DynamicFlow.js +0 -370
- package/build/dynamicFlow/DynamicFlowStep.js +0 -32
- package/build/dynamicFlow/DynamicFlowTypes.js +0 -4
- package/build/dynamicFlow/index.js +0 -1
- package/build/dynamicFlow/stories/DynamicFlow.story.js +0 -30
- package/build/dynamicFlow/stories/EditableDynamicFlow.js +0 -62
- package/build/dynamicFlow/stories/fixtureFetcher.js +0 -114
- package/build/dynamicFlow/utils/errorBoundary/ErrorBoundary.js +0 -45
- package/build/dynamicFlow/utils/errorBoundary/ErrorBoundary.messages.js +0 -13
- package/build/dynamicFlow/utils/errorBoundary/ErrorBoundaryAlert.js +0 -12
- package/build/dynamicFlow/utils/index.js +0 -5
- package/build/dynamicFlow/utils/responseParsers/response-parsers.js +0 -125
- package/build/dynamicFlow/utils/useDebouncedRefresh/useDebouncedRefresh.js +0 -23
- package/build/dynamicFlow/utils/useDynamicFlowState.js +0 -110
- package/build/dynamicFlow/utils/useLoader.js +0 -22
- package/build/fixtures/components/alert.js +0 -31
- package/build/fixtures/components/box.js +0 -20
- package/build/fixtures/components/button.js +0 -65
- package/build/fixtures/components/columns.js +0 -36
- package/build/fixtures/components/copyable.js +0 -22
- package/build/fixtures/components/decision.js +0 -54
- package/build/fixtures/components/heading.js +0 -14
- package/build/fixtures/components/image.js +0 -23
- package/build/fixtures/components/index.js +0 -13
- package/build/fixtures/components/info.js +0 -17
- package/build/fixtures/components/list.js +0 -34
- package/build/fixtures/components/loading-indicator.js +0 -16
- package/build/fixtures/components/paragraph.js +0 -28
- package/build/fixtures/components/review.js +0 -60
- package/build/fixtures/examples/camera-capture.js +0 -121
- package/build/fixtures/examples/index.js +0 -5
- package/build/fixtures/examples/recipient-update.js +0 -250
- package/build/fixtures/examples/recipient.js +0 -313
- package/build/fixtures/examples/single-file-upload.js +0 -98
- package/build/fixtures/examples/step-validation-errors.js +0 -75
- package/build/fixtures/features/action-response.js +0 -29
- package/build/fixtures/features/external.js +0 -31
- package/build/fixtures/features/index.js +0 -5
- package/build/fixtures/features/persist-async.js +0 -44
- package/build/fixtures/features/polling.js +0 -33
- package/build/fixtures/features/validation-async.js +0 -38
- package/build/fixtures/index.js +0 -23
- package/build/fixtures/jsonSchemaForm/allOf.js +0 -119
- package/build/fixtures/jsonSchemaForm/audRecipient.js +0 -1104
- package/build/fixtures/jsonSchemaForm/currency.js +0 -48
- package/build/fixtures/jsonSchemaForm/multipleFileUploadBase64.js +0 -37
- package/build/fixtures/jsonSchemaForm/multipleFileUploadBlob.js +0 -36
- package/build/fixtures/jsonSchemaForm/oneOf.js +0 -119
- package/build/fixtures/jsonSchemaForm/oneOfTabs.js +0 -53
- package/build/fixtures/jsonSchemaForm/promotedOneOf.js +0 -56
- package/build/fixtures/jsonSchemaForm/promotedOneOfCheckbox.js +0 -102
- package/build/fixtures/jsonSchemaForm/simple.js +0 -48
- package/build/fixtures/jsonSchemaForm/uploadPersistAsync.js +0 -71
- package/build/fixtures/jsonSchemaForm/validationAsync.js +0 -23
- package/build/fixtures/layouts/all.js +0 -176
- package/build/fixtures/layouts/final-step-layout.js +0 -39
- package/build/fixtures/layouts/index.js +0 -6
- package/build/fixtures/layouts/list.js +0 -33
- package/build/fixtures/layouts/pay-in.js +0 -97
- package/build/fixtures/layouts/review.js +0 -160
- package/build/fixtures/layouts/success.js +0 -66
- package/build/fixtures/responses/action-response-final.js +0 -24
- package/build/fixtures/responses/action.js +0 -2
- package/build/fixtures/responses/exit.js +0 -2
- package/build/fixtures/responses/index.js +0 -4
- package/build/fixtures/responses/recipient-update-final.js +0 -24
- package/build/fixtures/schemas/basic-form.js +0 -39
- package/build/fixtures/schemas/index.js +0 -4
- package/build/fixtures/schemas/number-and-integer.js +0 -41
- package/build/fixtures/schemas/one-of.js +0 -223
- package/build/fixtures/schemas/string-formats.js +0 -62
- package/build/fixtures/utils/image-util.js +0 -18
- package/build/formControl/FormControl.js +0 -241
- package/build/formControl/index.js +0 -1
- package/build/formControl/utils/index.js +0 -1
- package/build/formControl/utils/value-utils.js +0 -108
- package/build/i18n/index.js +0 -31
- package/build/index.d.ts +0 -10
- package/build/index.js +0 -8
- package/build/jsonSchemaForm/JsonSchemaForm.js +0 -29
- package/build/jsonSchemaForm/allOfSchema/AllOfSchema.js +0 -54
- package/build/jsonSchemaForm/allOfSchema/index.js +0 -1
- package/build/jsonSchemaForm/arrayTypeSchema/ArraySchema.js +0 -25
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.js +0 -26
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/index.js +0 -1
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.js +0 -140
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.messages.js +0 -18
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/index.js +0 -1
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/index.js +0 -2
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/upload-utils.js +0 -84
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/useFormattedDefaultErrorMessages.js +0 -14
- package/build/jsonSchemaForm/arrayTypeSchema/index.js +0 -1
- package/build/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.js +0 -103
- package/build/jsonSchemaForm/basicTypeSchema/index.js +0 -1
- package/build/jsonSchemaForm/controlFeedback/ControlFeedback.js +0 -79
- package/build/jsonSchemaForm/controlFeedback/ControlFeedback.messages.js +0 -53
- package/build/jsonSchemaForm/controlFeedback/index.js +0 -1
- package/build/jsonSchemaForm/genericSchema/GenericSchema.js +0 -122
- package/build/jsonSchemaForm/genericSchema/index.js +0 -1
- package/build/jsonSchemaForm/help/Help.js +0 -9
- package/build/jsonSchemaForm/help/Help.messages.js +0 -8
- package/build/jsonSchemaForm/help/index.js +0 -1
- package/build/jsonSchemaForm/index.js +0 -1
- package/build/jsonSchemaForm/objectSchema/ObjectSchema.js +0 -78
- package/build/jsonSchemaForm/objectSchema/index.js +0 -1
- package/build/jsonSchemaForm/oneOfSchema/OneOfSchema.js +0 -150
- package/build/jsonSchemaForm/oneOfSchema/index.js +0 -1
- package/build/jsonSchemaForm/oneOfSchema/utils/const-schema-utils.js +0 -8
- package/build/jsonSchemaForm/oneOfSchema/utils/index.js +0 -2
- package/build/jsonSchemaForm/oneOfSchema/utils/one-of-utils.js +0 -64
- package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.js +0 -26
- package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.messages.js +0 -8
- package/build/jsonSchemaForm/persistAsyncSchema/index.js +0 -1
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.js +0 -165
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/index.js +0 -1
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.js +0 -126
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.js +0 -32
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/index.js +0 -1
- package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.js +0 -72
- package/build/jsonSchemaForm/promotedOneOfSchema/index.js +0 -1
- package/build/jsonSchemaForm/promotedOneOfSchema/promoted-one-of-utils.js +0 -8
- package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.js +0 -27
- package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.js +0 -31
- package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.js +0 -32
- package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.js +0 -55
- package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.js +0 -13
- package/build/jsonSchemaForm/readOnlySchema/index.js +0 -1
- package/build/jsonSchemaForm/schemaFormControl/SchemaFormControl.js +0 -104
- package/build/jsonSchemaForm/schemaFormControl/index.js +0 -1
- package/build/jsonSchemaForm/schemaFormControl/utils/currency-utils.js +0 -73
- package/build/jsonSchemaForm/schemaFormControl/utils/index.js +0 -1
- package/build/jsonSchemaForm/schemaFormControl/utils/mapping-utils.js +0 -95
- package/build/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.js +0 -146
- package/build/jsonSchemaForm/validationAsyncSchema/index.js +0 -1
- package/build/layout/DynamicLayout.js +0 -61
- package/build/layout/alert/DynamicAlert.js +0 -29
- package/build/layout/box/DynamicBox.js +0 -41
- package/build/layout/button/DynamicButton.js +0 -58
- package/build/layout/columns/DynamicColumns.js +0 -38
- package/build/layout/decision/DynamicDecision.js +0 -38
- package/build/layout/divider/DynamicDivider.js +0 -9
- package/build/layout/external/DynamicExternal.js +0 -32
- package/build/layout/external/DynamicExternal.messages.js +0 -8
- package/build/layout/form/DynamicForm.js +0 -22
- package/build/layout/heading/DynamicHeading.js +0 -31
- package/build/layout/icon/DynamicIcon.js +0 -23
- package/build/layout/image/DynamicImage.js +0 -110
- package/build/layout/index.js +0 -17
- package/build/layout/info/DynamicInfo.js +0 -19
- package/build/layout/list/DynamicList.js +0 -31
- package/build/layout/loadingIndicator/DynamicLoadingIndicator.js +0 -11
- package/build/layout/paragraph/DynamicParagraph.js +0 -43
- package/build/layout/paragraph/DynamicParagraph.messages.js +0 -13
- package/build/layout/paragraph/useSnackBarIfAvailable.js +0 -9
- package/build/layout/review/DynamicReview.js +0 -33
- package/build/layout/utils.js +0 -31
- package/build/step/cameraStep/CameraStep.js +0 -125
- package/build/step/cameraStep/cameraCapture/CameraCapture.js +0 -122
- package/build/step/cameraStep/cameraCapture/CameraCapture.messages.js +0 -18
- package/build/step/cameraStep/cameraCapture/components/index.js +0 -28
- package/build/step/cameraStep/cameraCapture/hooks/index.js +0 -80
- package/build/step/cameraStep/cameraCapture/index.js +0 -1
- package/build/step/cameraStep/cameraCapture/overlay/Overlay.js +0 -78
- package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.js +0 -19
- package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.messages.js +0 -13
- package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.js +0 -21
- package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.js +0 -18
- package/build/step/cameraStep/cameraCapture/screens/index.js +0 -2
- package/build/step/cameraStep/cameraCapture/tracking/index.js +0 -98
- package/build/step/cameraStep/cameraCapture/utils/index.js +0 -103
- package/build/step/cameraStep/index.js +0 -1
- package/build/step/externalConfirmationStep/ExternalConfirmationStep.js +0 -64
- package/build/step/externalConfirmationStep/ExternalConfirmationStep.messages.js +0 -23
- package/build/step/externalConfirmationStep/index.js +0 -1
- package/build/step/index.js +0 -3
- package/build/step/layoutStep/LayoutStep.js +0 -33
- package/build/step/layoutStep/index.js +0 -1
- package/build/step/layoutStep/utils/index.js +0 -2
- package/build/step/layoutStep/utils/inline-reference-utils.js +0 -91
- package/build/step/layoutStep/utils/layout-utils.js +0 -217
- package/build/types/common/FormControl.js +0 -1
- package/build/types/specification/Action.js +0 -1
- package/build/types/specification/FileUploadSchema.js +0 -4
- package/build/types/specification/LayoutComponent.js +0 -1
- package/build/types/specification/Model.js +0 -29
- package/build/types/specification/PersistAsync.js +0 -1
- package/build/types/specification/Polling.js +0 -1
- package/build/types/specification/Promotion.js +0 -1
- package/build/types/specification/Schema.js +0 -50
- package/build/types/specification/Step.js +0 -4
- package/build/types/specification/ValidationAsync.js +0 -1
- package/build/types/specification/core.js +0 -1
- /package/build/{common → types/common}/constants/DateMode.d.ts +0 -0
- /package/build/{common → types/common}/constants/FormControlType.d.ts +0 -0
- /package/build/{common → types/common}/constants/MonthFormat.d.ts +0 -0
- /package/build/{common → types/common}/constants/SchemaType.d.ts +0 -0
- /package/build/{common → types/common}/constants/Size.d.ts +0 -0
- /package/build/{common → types/common}/constants/index.d.ts +0 -0
- /package/build/{common → types/common}/contexts/dynamicFlowContexts/DynamicFlowContexts.d.ts +0 -0
- /package/build/{common → types/common}/contexts/dynamicFlowContexts/usePendingPromiseCounter.d.ts +0 -0
- /package/build/{common → types/common}/contexts/eventsContext/EventsContext.d.ts +0 -0
- /package/build/{common → types/common}/contexts/fetcherContexts/FetcherContexts.d.ts +0 -0
- /package/build/{common → types/common}/contexts/index.d.ts +0 -0
- /package/build/{common → types/common}/contexts/logContext/LogContext.d.ts +0 -0
- /package/build/{common → types/common}/hooks/index.d.ts +0 -0
- /package/build/{common → types/common}/hooks/useDebouncedFunction/useDebouncedFunction.d.ts +0 -0
- /package/build/{common → types/common}/hooks/useExternal/useExternal.d.ts +0 -0
- /package/build/{common → types/common}/hooks/useExternalStepPolling/useExternalStepPolling.d.ts +0 -0
- /package/build/{common → types/common}/hooks/usePersistAsync/usePersistAsync.d.ts +0 -0
- /package/build/{common → types/common}/hooks/usePolling/usePolling.d.ts +0 -0
- /package/build/{common → types/common}/hooks/usePrevious/usePrevious.d.ts +0 -0
- /package/build/{common → types/common}/hooks/useStepPolling/useStepPolling.d.ts +0 -0
- /package/build/{common → types/common}/makeFetcher/index.d.ts +0 -0
- /package/build/{common → types/common}/makeFetcher/makeFetcher.d.ts +0 -0
- /package/build/{common → types/common}/messages.d.ts +0 -0
- /package/build/{common → types/common}/utils/api-utils.d.ts +0 -0
- /package/build/{common → types/common}/utils/date-utils.d.ts +0 -0
- /package/build/{common → types/common}/utils/debounce.d.ts +0 -0
- /package/build/{common → types/common}/utils/file-utils.d.ts +0 -0
- /package/build/{common → types/common}/utils/id-utils.d.ts +0 -0
- /package/build/{common → types/common}/utils/index.d.ts +0 -0
- /package/build/{common → types/common}/utils/is-equal.d.ts +0 -0
- /package/build/{common → types/common}/utils/schema-utils.d.ts +0 -0
- /package/build/{common → types/common}/utils/step-utils.d.ts +0 -0
- /package/build/{common → types/common}/validators/index.d.ts +0 -0
- /package/build/{common → types/common}/validators/models/model-validators.d.ts +0 -0
- /package/build/{common → types/common}/validators/models/models.utils.d.ts +0 -0
- /package/build/{common → types/common}/validators/schemas/schema-validators.d.ts +0 -0
- /package/build/{common → types/common}/validators/types/type-validators.d.ts +0 -0
- /package/build/{common → types/common}/validators/validationFailures/validation-failures.d.ts +0 -0
- /package/build/{common → types/common}/validators/validationFailures/validation-failures.utils.d.ts +0 -0
- /package/build/{common → types/common}/validators/values/value-validators.d.ts +0 -0
- /package/build/{dynamicFlow → types/dynamicFlow}/DynamicFlow.d.ts +0 -0
- /package/build/{dynamicFlow → types/dynamicFlow}/DynamicFlowStep.d.ts +0 -0
- /package/build/{dynamicFlow → types/dynamicFlow}/DynamicFlowTypes.d.ts +0 -0
- /package/build/{dynamicFlow → types/dynamicFlow}/index.d.ts +0 -0
- /package/build/{dynamicFlow → types/dynamicFlow}/stories/DynamicFlow.story.d.ts +0 -0
- /package/build/{dynamicFlow → types/dynamicFlow}/stories/EditableDynamicFlow.d.ts +0 -0
- /package/build/{dynamicFlow → types/dynamicFlow}/stories/fixtureFetcher.d.ts +0 -0
- /package/build/{dynamicFlow → types/dynamicFlow}/utils/errorBoundary/ErrorBoundary.d.ts +0 -0
- /package/build/{dynamicFlow → types/dynamicFlow}/utils/errorBoundary/ErrorBoundary.messages.d.ts +0 -0
- /package/build/{dynamicFlow → types/dynamicFlow}/utils/errorBoundary/ErrorBoundaryAlert.d.ts +0 -0
- /package/build/{dynamicFlow → types/dynamicFlow}/utils/index.d.ts +0 -0
- /package/build/{dynamicFlow → types/dynamicFlow}/utils/responseParsers/response-parsers.d.ts +0 -0
- /package/build/{dynamicFlow → types/dynamicFlow}/utils/useDebouncedRefresh/useDebouncedRefresh.d.ts +0 -0
- /package/build/{dynamicFlow → types/dynamicFlow}/utils/useDynamicFlowState.d.ts +0 -0
- /package/build/{dynamicFlow → types/dynamicFlow}/utils/useLoader.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/components/alert.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/components/box.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/components/button.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/components/columns.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/components/copyable.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/components/decision.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/components/heading.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/components/image.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/components/index.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/components/info.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/components/list.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/components/loading-indicator.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/components/paragraph.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/components/review.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/examples/camera-capture.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/examples/index.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/examples/recipient-update.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/examples/recipient.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/examples/single-file-upload.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/examples/step-validation-errors.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/features/action-response.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/features/external.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/features/index.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/features/persist-async.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/features/polling.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/features/validation-async.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/index.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/jsonSchemaForm/allOf.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/jsonSchemaForm/audRecipient.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/jsonSchemaForm/currency.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/jsonSchemaForm/multipleFileUploadBase64.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/jsonSchemaForm/multipleFileUploadBlob.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/jsonSchemaForm/oneOf.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/jsonSchemaForm/oneOfTabs.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/jsonSchemaForm/promotedOneOf.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/jsonSchemaForm/promotedOneOfCheckbox.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/jsonSchemaForm/simple.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/jsonSchemaForm/uploadPersistAsync.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/jsonSchemaForm/validationAsync.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/layouts/all.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/layouts/final-step-layout.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/layouts/index.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/layouts/list.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/layouts/pay-in.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/layouts/review.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/layouts/success.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/responses/action-response-final.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/responses/action.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/responses/exit.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/responses/index.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/responses/recipient-update-final.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/schemas/basic-form.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/schemas/index.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/schemas/number-and-integer.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/schemas/one-of.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/schemas/string-formats.d.ts +0 -0
- /package/build/{fixtures → types/fixtures}/utils/image-util.d.ts +0 -0
- /package/build/{formControl → types/formControl}/FormControl.d.ts +0 -0
- /package/build/{formControl → types/formControl}/index.d.ts +0 -0
- /package/build/{formControl → types/formControl}/utils/index.d.ts +0 -0
- /package/build/{formControl → types/formControl}/utils/value-utils.d.ts +0 -0
- /package/build/{i18n → types/i18n}/index.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/JsonSchemaForm.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/allOfSchema/AllOfSchema.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/allOfSchema/index.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/arrayTypeSchema/ArraySchema.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/arrayTypeSchema/arrayListSchema/ArrayListSchema.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/arrayTypeSchema/arrayListSchema/index.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.messages.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/index.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/index.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/upload-utils.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/useFormattedDefaultErrorMessages.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/arrayTypeSchema/index.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/basicTypeSchema/BasicTypeSchema.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/basicTypeSchema/index.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/controlFeedback/ControlFeedback.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/controlFeedback/ControlFeedback.messages.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/controlFeedback/index.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/genericSchema/GenericSchema.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/genericSchema/index.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/help/Help.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/help/Help.messages.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/help/index.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/index.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/objectSchema/ObjectSchema.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/objectSchema/index.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/oneOfSchema/OneOfSchema.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/oneOfSchema/index.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/oneOfSchema/utils/const-schema-utils.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/oneOfSchema/utils/index.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/oneOfSchema/utils/one-of-utils.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/persistAsyncSchema/PersistAsyncSchema.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/persistAsyncSchema/PersistAsyncSchema.messages.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/persistAsyncSchema/index.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/persistAsyncSchema/persistAsyncBasicSchema/index.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/persistAsyncSchema/persistAsyncBlobSchema/index.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/promotedOneOfSchema/PromotedOneOfSchema.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/promotedOneOfSchema/index.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/promotedOneOfSchema/promoted-one-of-utils.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/readOnlySchema/ReadOnlySchema.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/readOnlySchema/ReadOnlySchema.messages.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/readOnlySchema/index.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/schemaFormControl/SchemaFormControl.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/schemaFormControl/index.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/schemaFormControl/utils/currency-utils.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/schemaFormControl/utils/index.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/schemaFormControl/utils/mapping-utils.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/validationAsyncSchema/ValidationAsyncSchema.d.ts +0 -0
- /package/build/{jsonSchemaForm → types/jsonSchemaForm}/validationAsyncSchema/index.d.ts +0 -0
- /package/build/{layout → types/layout}/DynamicLayout.d.ts +0 -0
- /package/build/{layout → types/layout}/alert/DynamicAlert.d.ts +0 -0
- /package/build/{layout → types/layout}/box/DynamicBox.d.ts +0 -0
- /package/build/{layout → types/layout}/button/DynamicButton.d.ts +0 -0
- /package/build/{layout → types/layout}/columns/DynamicColumns.d.ts +0 -0
- /package/build/{layout → types/layout}/decision/DynamicDecision.d.ts +0 -0
- /package/build/{layout → types/layout}/divider/DynamicDivider.d.ts +0 -0
- /package/build/{layout → types/layout}/external/DynamicExternal.d.ts +0 -0
- /package/build/{layout → types/layout}/external/DynamicExternal.messages.d.ts +0 -0
- /package/build/{layout → types/layout}/form/DynamicForm.d.ts +0 -0
- /package/build/{layout → types/layout}/heading/DynamicHeading.d.ts +0 -0
- /package/build/{layout → types/layout}/icon/DynamicIcon.d.ts +0 -0
- /package/build/{layout → types/layout}/image/DynamicImage.d.ts +0 -0
- /package/build/{layout → types/layout}/index.d.ts +0 -0
- /package/build/{layout → types/layout}/info/DynamicInfo.d.ts +0 -0
- /package/build/{layout → types/layout}/list/DynamicList.d.ts +0 -0
- /package/build/{layout → types/layout}/loadingIndicator/DynamicLoadingIndicator.d.ts +0 -0
- /package/build/{layout → types/layout}/paragraph/DynamicParagraph.d.ts +0 -0
- /package/build/{layout → types/layout}/paragraph/DynamicParagraph.messages.d.ts +0 -0
- /package/build/{layout → types/layout}/paragraph/useSnackBarIfAvailable.d.ts +0 -0
- /package/build/{layout → types/layout}/review/DynamicReview.d.ts +0 -0
- /package/build/{layout → types/layout}/utils.d.ts +0 -0
- /package/build/{step → types/step}/cameraStep/CameraStep.d.ts +0 -0
- /package/build/{step → types/step}/cameraStep/cameraCapture/CameraCapture.d.ts +0 -0
- /package/build/{step → types/step}/cameraStep/cameraCapture/CameraCapture.messages.d.ts +0 -0
- /package/build/{step → types/step}/cameraStep/cameraCapture/components/index.d.ts +0 -0
- /package/build/{step → types/step}/cameraStep/cameraCapture/hooks/index.d.ts +0 -0
- /package/build/{step → types/step}/cameraStep/cameraCapture/index.d.ts +0 -0
- /package/build/{step → types/step}/cameraStep/cameraCapture/overlay/Overlay.d.ts +0 -0
- /package/build/{step → types/step}/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.d.ts +0 -0
- /package/build/{step → types/step}/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.messages.d.ts +0 -0
- /package/build/{step → types/step}/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.d.ts +0 -0
- /package/build/{step → types/step}/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.d.ts +0 -0
- /package/build/{step → types/step}/cameraStep/cameraCapture/screens/index.d.ts +0 -0
- /package/build/{step → types/step}/cameraStep/cameraCapture/tracking/index.d.ts +0 -0
- /package/build/{step → types/step}/cameraStep/cameraCapture/utils/index.d.ts +0 -0
- /package/build/{step → types/step}/cameraStep/index.d.ts +0 -0
- /package/build/{step → types/step}/externalConfirmationStep/ExternalConfirmationStep.d.ts +0 -0
- /package/build/{step → types/step}/externalConfirmationStep/ExternalConfirmationStep.messages.d.ts +0 -0
- /package/build/{step → types/step}/externalConfirmationStep/index.d.ts +0 -0
- /package/build/{step → types/step}/index.d.ts +0 -0
- /package/build/{step → types/step}/layoutStep/LayoutStep.d.ts +0 -0
- /package/build/{step → types/step}/layoutStep/index.d.ts +0 -0
- /package/build/{step → types/step}/layoutStep/utils/index.d.ts +0 -0
- /package/build/{step → types/step}/layoutStep/utils/inline-reference-utils.d.ts +0 -0
- /package/build/{step → types/step}/layoutStep/utils/layout-utils.d.ts +0 -0
- /package/build/types/{common → types/common}/FormControl.d.ts +0 -0
- /package/build/types/{specification → types/specification}/Action.d.ts +0 -0
- /package/build/types/{specification → types/specification}/FileUploadSchema.d.ts +0 -0
- /package/build/types/{specification → types/specification}/LayoutComponent.d.ts +0 -0
- /package/build/types/{specification → types/specification}/Model.d.ts +0 -0
- /package/build/types/{specification → types/specification}/PersistAsync.d.ts +0 -0
- /package/build/types/{specification → types/specification}/Polling.d.ts +0 -0
- /package/build/types/{specification → types/specification}/Promotion.d.ts +0 -0
- /package/build/types/{specification → types/specification}/Schema.d.ts +0 -0
- /package/build/types/{specification → types/specification}/Step.d.ts +0 -0
- /package/build/types/{specification → types/specification}/ValidationAsync.d.ts +0 -0
- /package/build/types/{specification → types/specification}/core.d.ts +0 -0
package/build/main.js
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var
|
|
8
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
9
|
-
}) : x)(function(x) {
|
|
10
|
-
if (typeof require !== "undefined")
|
|
11
|
-
return require.apply(this, arguments);
|
|
12
|
-
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
13
|
-
});
|
|
14
|
-
var __commonJS = (cb, mod) => function __require2() {
|
|
8
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
15
9
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
16
10
|
};
|
|
11
|
+
var __export = (target, all) => {
|
|
12
|
+
for (var name in all)
|
|
13
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
14
|
+
};
|
|
17
15
|
var __copyProps = (to, from, except, desc) => {
|
|
18
16
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
19
17
|
for (let key of __getOwnPropNames(from))
|
|
@@ -30,10 +28,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
28
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
31
29
|
mod
|
|
32
30
|
));
|
|
31
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
33
32
|
|
|
34
33
|
// ../../node_modules/.pnpm/classnames@2.3.2/node_modules/classnames/index.js
|
|
35
34
|
var require_classnames = __commonJS({
|
|
36
|
-
"../../node_modules/.pnpm/classnames@2.3.2/node_modules/classnames/index.js"(exports,
|
|
35
|
+
"../../node_modules/.pnpm/classnames@2.3.2/node_modules/classnames/index.js"(exports, module2) {
|
|
37
36
|
(function() {
|
|
38
37
|
"use strict";
|
|
39
38
|
var hasOwn = {}.hasOwnProperty;
|
|
@@ -68,9 +67,9 @@ var require_classnames = __commonJS({
|
|
|
68
67
|
}
|
|
69
68
|
return classes.join(" ");
|
|
70
69
|
}
|
|
71
|
-
if (typeof
|
|
70
|
+
if (typeof module2 !== "undefined" && module2.exports) {
|
|
72
71
|
classNames7.default = classNames7;
|
|
73
|
-
|
|
72
|
+
module2.exports = classNames7;
|
|
74
73
|
} else if (typeof define === "function" && typeof define.amd === "object" && define.amd) {
|
|
75
74
|
define("classnames", [], function() {
|
|
76
75
|
return classNames7;
|
|
@@ -84,14 +83,14 @@ var require_classnames = __commonJS({
|
|
|
84
83
|
|
|
85
84
|
// ../../node_modules/.pnpm/react-webcam@7.0.1_biqbaboplfbrettd7655fr4n2y/node_modules/react-webcam/dist/react-webcam.js
|
|
86
85
|
var require_react_webcam = __commonJS({
|
|
87
|
-
"../../node_modules/.pnpm/react-webcam@7.0.1_biqbaboplfbrettd7655fr4n2y/node_modules/react-webcam/dist/react-webcam.js"(exports,
|
|
86
|
+
"../../node_modules/.pnpm/react-webcam@7.0.1_biqbaboplfbrettd7655fr4n2y/node_modules/react-webcam/dist/react-webcam.js"(exports, module2) {
|
|
88
87
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
89
|
-
if (typeof exports === "object" && typeof
|
|
90
|
-
|
|
88
|
+
if (typeof exports === "object" && typeof module2 === "object")
|
|
89
|
+
module2.exports = factory(require("react"));
|
|
91
90
|
else if (typeof define === "function" && define.amd)
|
|
92
91
|
define(["react"], factory);
|
|
93
92
|
else if (typeof exports === "object")
|
|
94
|
-
exports["Webcam"] = factory(
|
|
93
|
+
exports["Webcam"] = factory(require("react"));
|
|
95
94
|
else
|
|
96
95
|
root["Webcam"] = factory(root["React"]);
|
|
97
96
|
})(exports, function(__WEBPACK_EXTERNAL_MODULE_react__) {
|
|
@@ -103,7 +102,7 @@ var require_react_webcam = __commonJS({
|
|
|
103
102
|
if (installedModules[moduleId]) {
|
|
104
103
|
return installedModules[moduleId].exports;
|
|
105
104
|
}
|
|
106
|
-
var
|
|
105
|
+
var module3 = installedModules[moduleId] = {
|
|
107
106
|
/******/
|
|
108
107
|
i: moduleId,
|
|
109
108
|
/******/
|
|
@@ -112,9 +111,9 @@ var require_react_webcam = __commonJS({
|
|
|
112
111
|
exports: {}
|
|
113
112
|
/******/
|
|
114
113
|
};
|
|
115
|
-
modules[moduleId].call(
|
|
116
|
-
|
|
117
|
-
return
|
|
114
|
+
modules[moduleId].call(module3.exports, module3, module3.exports, __webpack_require__);
|
|
115
|
+
module3.l = true;
|
|
116
|
+
return module3.exports;
|
|
118
117
|
}
|
|
119
118
|
__webpack_require__.m = modules;
|
|
120
119
|
__webpack_require__.c = installedModules;
|
|
@@ -146,16 +145,16 @@ var require_react_webcam = __commonJS({
|
|
|
146
145
|
}.bind(null, key));
|
|
147
146
|
return ns;
|
|
148
147
|
};
|
|
149
|
-
__webpack_require__.n = function(
|
|
150
|
-
var getter =
|
|
148
|
+
__webpack_require__.n = function(module3) {
|
|
149
|
+
var getter = module3 && module3.__esModule ? (
|
|
151
150
|
/******/
|
|
152
151
|
function getDefault() {
|
|
153
|
-
return
|
|
152
|
+
return module3["default"];
|
|
154
153
|
}
|
|
155
154
|
) : (
|
|
156
155
|
/******/
|
|
157
156
|
function getModuleExports() {
|
|
158
|
-
return
|
|
157
|
+
return module3;
|
|
159
158
|
}
|
|
160
159
|
);
|
|
161
160
|
__webpack_require__.d(getter, "a", getter);
|
|
@@ -174,7 +173,7 @@ var require_react_webcam = __commonJS({
|
|
|
174
173
|
\******************************/
|
|
175
174
|
/*! exports provided: default */
|
|
176
175
|
/***/
|
|
177
|
-
function(
|
|
176
|
+
function(module3, __webpack_exports__, __webpack_require__) {
|
|
178
177
|
"use strict";
|
|
179
178
|
__webpack_require__.r(__webpack_exports__);
|
|
180
179
|
var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
@@ -498,8 +497,8 @@ var require_react_webcam = __commonJS({
|
|
|
498
497
|
\**************************************************************************************/
|
|
499
498
|
/*! no static exports found */
|
|
500
499
|
/***/
|
|
501
|
-
function(
|
|
502
|
-
|
|
500
|
+
function(module3, exports2) {
|
|
501
|
+
module3.exports = __WEBPACK_EXTERNAL_MODULE_react__;
|
|
503
502
|
}
|
|
504
503
|
)
|
|
505
504
|
/******/
|
|
@@ -509,6 +508,20 @@ var require_react_webcam = __commonJS({
|
|
|
509
508
|
}
|
|
510
509
|
});
|
|
511
510
|
|
|
511
|
+
// src/index.ts
|
|
512
|
+
var src_exports = {};
|
|
513
|
+
__export(src_exports, {
|
|
514
|
+
DynamicFlow: () => DynamicFlow_default,
|
|
515
|
+
JsonSchemaForm: () => JsonSchemaForm_default,
|
|
516
|
+
Layout: () => DynamicLayout_default,
|
|
517
|
+
convertStepToLayout: () => convertStepToLayout,
|
|
518
|
+
inlineReferences: () => inlineReferences,
|
|
519
|
+
isValidSchema: () => isValidSchema,
|
|
520
|
+
makeFetcher: () => makeFetcher,
|
|
521
|
+
translations: () => i18n_default
|
|
522
|
+
});
|
|
523
|
+
module.exports = __toCommonJS(src_exports);
|
|
524
|
+
|
|
512
525
|
// src/step/layoutStep/utils/layout-utils.ts
|
|
513
526
|
function convertStepToLayout(step, { displayStepTitle = true } = {}) {
|
|
514
527
|
if (!step || !step.type) {
|
|
@@ -816,17 +829,17 @@ function isReference(block) {
|
|
|
816
829
|
}
|
|
817
830
|
|
|
818
831
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
819
|
-
|
|
820
|
-
|
|
832
|
+
var import_react35 = require("react");
|
|
833
|
+
var import_react_intl28 = require("react-intl");
|
|
821
834
|
|
|
822
835
|
// src/common/contexts/dynamicFlowContexts/DynamicFlowContexts.tsx
|
|
823
|
-
|
|
836
|
+
var import_react2 = require("react");
|
|
824
837
|
|
|
825
838
|
// src/common/contexts/dynamicFlowContexts/usePendingPromiseCounter.ts
|
|
826
|
-
|
|
839
|
+
var import_react = require("react");
|
|
827
840
|
function usePendingPromiseCounter() {
|
|
828
|
-
const [count, setCount] = useState(0);
|
|
829
|
-
const addPendingPromise = useCallback(
|
|
841
|
+
const [count, setCount] = (0, import_react.useState)(0);
|
|
842
|
+
const addPendingPromise = (0, import_react.useCallback)(
|
|
830
843
|
(promise) => {
|
|
831
844
|
setCount((c) => c + 1);
|
|
832
845
|
promise.catch(noop).finally(() => delayUntilNextCycle(() => setCount((c) => Math.max(0, c - 1))));
|
|
@@ -840,50 +853,50 @@ var noop = () => {
|
|
|
840
853
|
};
|
|
841
854
|
|
|
842
855
|
// src/common/contexts/dynamicFlowContexts/DynamicFlowContexts.tsx
|
|
843
|
-
|
|
856
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
844
857
|
var defaultContextValue = {
|
|
845
858
|
loading: false,
|
|
846
859
|
registerPersistAsyncPromise: (promise) => {
|
|
847
860
|
}
|
|
848
861
|
};
|
|
849
|
-
var DFContext = createContext(defaultContextValue);
|
|
862
|
+
var DFContext = (0, import_react2.createContext)(defaultContextValue);
|
|
850
863
|
var DynamicFlowProvider = ({ loading, children }) => {
|
|
851
864
|
const { pendingPromises, addPendingPromise } = usePendingPromiseCounter();
|
|
852
|
-
const providerValue = useMemo(() => {
|
|
865
|
+
const providerValue = (0, import_react2.useMemo)(() => {
|
|
853
866
|
return {
|
|
854
867
|
loading: loading || pendingPromises > 0,
|
|
855
868
|
registerPersistAsyncPromise: addPendingPromise
|
|
856
869
|
};
|
|
857
870
|
}, [loading, pendingPromises, addPendingPromise]);
|
|
858
|
-
return /* @__PURE__ */ jsx(DFContext.Provider, { value: providerValue, children });
|
|
871
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DFContext.Provider, { value: providerValue, children });
|
|
859
872
|
};
|
|
860
873
|
var useDynamicFlow = () => {
|
|
861
|
-
const context = useContext(DFContext);
|
|
874
|
+
const context = (0, import_react2.useContext)(DFContext);
|
|
862
875
|
return context || defaultContextValue;
|
|
863
876
|
};
|
|
864
877
|
|
|
865
878
|
// src/common/contexts/eventsContext/EventsContext.tsx
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
var EventsContext =
|
|
879
|
+
var import_react3 = require("react");
|
|
880
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
881
|
+
var EventsContext = (0, import_react3.createContext)({
|
|
869
882
|
triggerEvent: () => {
|
|
870
883
|
}
|
|
871
884
|
});
|
|
872
885
|
var EventsContextProvider = ({ metadata, children, onEvent }) => {
|
|
873
|
-
const value =
|
|
886
|
+
const value = (0, import_react3.useMemo)(
|
|
874
887
|
() => ({ triggerEvent: getEventDispatcher(onEvent, metadata) }),
|
|
875
888
|
[onEvent, metadata]
|
|
876
889
|
);
|
|
877
|
-
return /* @__PURE__ */
|
|
890
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(EventsContext.Provider, { value, children });
|
|
878
891
|
};
|
|
879
892
|
function useEventDispatcher() {
|
|
880
|
-
const { triggerEvent } =
|
|
893
|
+
const { triggerEvent } = (0, import_react3.useContext)(EventsContext);
|
|
881
894
|
return triggerEvent;
|
|
882
895
|
}
|
|
883
896
|
var getEventDispatcher = (onEvent, metadata) => (eventName, properties = {}) => onEvent(eventName, { ...metadata, ...properties });
|
|
884
897
|
|
|
885
898
|
// src/common/contexts/fetcherContexts/FetcherContexts.tsx
|
|
886
|
-
|
|
899
|
+
var import_react4 = require("react");
|
|
887
900
|
|
|
888
901
|
// src/common/utils/api-utils.ts
|
|
889
902
|
function isStatus2xx(status) {
|
|
@@ -919,34 +932,34 @@ var mergeHeaders = (initHeaders, additionalHeaders) => {
|
|
|
919
932
|
};
|
|
920
933
|
|
|
921
934
|
// src/common/contexts/fetcherContexts/FetcherContexts.tsx
|
|
922
|
-
|
|
923
|
-
var FetcherContext =
|
|
935
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
936
|
+
var FetcherContext = (0, import_react4.createContext)(void 0);
|
|
924
937
|
var FetcherProvider = ({ fetcher, children }) => {
|
|
925
|
-
return /* @__PURE__ */
|
|
938
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(FetcherContext.Provider, { value: fetcher, children });
|
|
926
939
|
};
|
|
927
940
|
var FetcherProviderFromBaseUrl = ({
|
|
928
941
|
baseUrl,
|
|
929
942
|
children
|
|
930
943
|
}) => {
|
|
931
|
-
const fetcher =
|
|
932
|
-
return /* @__PURE__ */
|
|
944
|
+
const fetcher = (0, import_react4.useMemo)(() => makeFetcher(baseUrl), [baseUrl]);
|
|
945
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(FetcherContext.Provider, { value: fetcher, children });
|
|
933
946
|
};
|
|
934
947
|
var useFetcher = () => {
|
|
935
|
-
const contextFetch =
|
|
948
|
+
const contextFetch = (0, import_react4.useContext)(FetcherContext);
|
|
936
949
|
return contextFetch || fetch;
|
|
937
950
|
};
|
|
938
951
|
var useHasFetcherProvider = () => {
|
|
939
|
-
const context =
|
|
952
|
+
const context = (0, import_react4.useContext)(FetcherContext);
|
|
940
953
|
return !!context;
|
|
941
954
|
};
|
|
942
955
|
|
|
943
956
|
// src/common/contexts/logContext/LogContext.tsx
|
|
944
|
-
|
|
945
|
-
|
|
957
|
+
var import_react5 = require("react");
|
|
958
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
946
959
|
var getLogger = (level, onLog, flowId = "UNKNOWN-FLOW-ID", stepId = "UNKNOWN-FLOW-ID") => (title, description, extra) => onLog(level, `Dynamic Flow ${level} - ${title} - ${description}`, { flowId, stepId, ...extra });
|
|
947
|
-
var LogContext =
|
|
960
|
+
var LogContext = (0, import_react5.createContext)(null);
|
|
948
961
|
var LogProvider = ({ flowId, stepId, children, onLog }) => {
|
|
949
|
-
const value =
|
|
962
|
+
const value = (0, import_react5.useMemo)(
|
|
950
963
|
() => ({
|
|
951
964
|
debug: getLogger("debug", onLog, flowId, stepId),
|
|
952
965
|
info: getLogger("info", onLog, flowId, stepId),
|
|
@@ -956,10 +969,10 @@ var LogProvider = ({ flowId, stepId, children, onLog }) => {
|
|
|
956
969
|
}),
|
|
957
970
|
[onLog, flowId, stepId]
|
|
958
971
|
);
|
|
959
|
-
return /* @__PURE__ */
|
|
972
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(LogContext.Provider, { value, children });
|
|
960
973
|
};
|
|
961
974
|
var useLogger = () => {
|
|
962
|
-
const logging =
|
|
975
|
+
const logging = (0, import_react5.useContext)(LogContext);
|
|
963
976
|
if (logging == null) {
|
|
964
977
|
throw new Error(
|
|
965
978
|
"Logging context not found. Did you forget to wrap your component in a <LogProvider />?"
|
|
@@ -1476,7 +1489,7 @@ function isValidSchema(value, schema2) {
|
|
|
1476
1489
|
}
|
|
1477
1490
|
|
|
1478
1491
|
// src/common/hooks/useDebouncedFunction/useDebouncedFunction.tsx
|
|
1479
|
-
|
|
1492
|
+
var import_react6 = require("react");
|
|
1480
1493
|
|
|
1481
1494
|
// src/common/utils/date-utils.ts
|
|
1482
1495
|
function formatDate(date) {
|
|
@@ -1731,16 +1744,16 @@ var getStepType = (step) => {
|
|
|
1731
1744
|
|
|
1732
1745
|
// src/common/hooks/useDebouncedFunction/useDebouncedFunction.tsx
|
|
1733
1746
|
function useDebouncedFunction(callback, waitMs) {
|
|
1734
|
-
return
|
|
1747
|
+
return (0, import_react6.useCallback)(debounce(callback, waitMs), [callback, waitMs]);
|
|
1735
1748
|
}
|
|
1736
1749
|
|
|
1737
1750
|
// src/common/hooks/useExternal/useExternal.tsx
|
|
1738
|
-
|
|
1751
|
+
var import_react7 = require("react");
|
|
1739
1752
|
function useExternal(url) {
|
|
1740
|
-
const [externalWindow, setExternalWindow] =
|
|
1741
|
-
const [hasManuallyTriggered, setHasManuallyTriggered] =
|
|
1753
|
+
const [externalWindow, setExternalWindow] = (0, import_react7.useState)(null);
|
|
1754
|
+
const [hasManuallyTriggered, setHasManuallyTriggered] = (0, import_react7.useState)(false);
|
|
1742
1755
|
const dismissConfirmation = () => setHasManuallyTriggered(true);
|
|
1743
|
-
useEffect(() => {
|
|
1756
|
+
(0, import_react7.useEffect)(() => {
|
|
1744
1757
|
if (url) {
|
|
1745
1758
|
setHasManuallyTriggered(false);
|
|
1746
1759
|
setExternalWindow(window.open(url, "_blank"));
|
|
@@ -1751,10 +1764,10 @@ function useExternal(url) {
|
|
|
1751
1764
|
}
|
|
1752
1765
|
|
|
1753
1766
|
// src/common/hooks/useExternalStepPolling/useExternalStepPolling.tsx
|
|
1754
|
-
|
|
1767
|
+
var import_react8 = require("react");
|
|
1755
1768
|
function useExternalStepPolling(polling, onAction) {
|
|
1756
1769
|
const fetcher = useFetcher();
|
|
1757
|
-
const asyncFn =
|
|
1770
|
+
const asyncFn = (0, import_react8.useMemo)(() => {
|
|
1758
1771
|
if (polling) {
|
|
1759
1772
|
return () => {
|
|
1760
1773
|
return fetcher(polling.url).then((response) => {
|
|
@@ -1773,7 +1786,7 @@ function useExternalStepPolling(polling, onAction) {
|
|
|
1773
1786
|
return void 0;
|
|
1774
1787
|
}
|
|
1775
1788
|
}, [polling, fetcher]);
|
|
1776
|
-
const onPollingResponse =
|
|
1789
|
+
const onPollingResponse = (0, import_react8.useCallback)(
|
|
1777
1790
|
(pollingResponse) => {
|
|
1778
1791
|
const responseHandlers = polling?.responseHandlers || [];
|
|
1779
1792
|
const responseHandler = responseHandlers.find(
|
|
@@ -1800,7 +1813,7 @@ function useExternalStepPolling(polling, onAction) {
|
|
|
1800
1813
|
maxAttempts: polling?.maxAttempts || 0,
|
|
1801
1814
|
maxConsecutiveFails: polling?.maxConsecutiveFails || 0,
|
|
1802
1815
|
onPollingResponse,
|
|
1803
|
-
onFailure:
|
|
1816
|
+
onFailure: (0, import_react8.useCallback)(() => {
|
|
1804
1817
|
if (polling) {
|
|
1805
1818
|
onAction(polling.onError.action);
|
|
1806
1819
|
}
|
|
@@ -1809,12 +1822,12 @@ function useExternalStepPolling(polling, onAction) {
|
|
|
1809
1822
|
}
|
|
1810
1823
|
|
|
1811
1824
|
// src/common/hooks/usePersistAsync/usePersistAsync.ts
|
|
1812
|
-
|
|
1813
|
-
|
|
1825
|
+
var import_react23 = require("react");
|
|
1826
|
+
var import_react_intl16 = require("react-intl");
|
|
1814
1827
|
|
|
1815
1828
|
// src/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.messages.js
|
|
1816
|
-
|
|
1817
|
-
var PersistAsyncSchema_messages_default = defineMessages({
|
|
1829
|
+
var import_react_intl = require("react-intl");
|
|
1830
|
+
var PersistAsyncSchema_messages_default = (0, import_react_intl.defineMessages)({
|
|
1818
1831
|
genericError: {
|
|
1819
1832
|
id: "dynamicFlows.PersistAsyncSchema.genericError",
|
|
1820
1833
|
defaultMessage: "Something went wrong, please try again later!",
|
|
@@ -1823,8 +1836,8 @@ var PersistAsyncSchema_messages_default = defineMessages({
|
|
|
1823
1836
|
});
|
|
1824
1837
|
|
|
1825
1838
|
// src/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.tsx
|
|
1826
|
-
|
|
1827
|
-
|
|
1839
|
+
var import_react22 = require("react");
|
|
1840
|
+
var import_react_intl15 = require("react-intl");
|
|
1828
1841
|
|
|
1829
1842
|
// src/fixtures/jsonSchemaForm/allOf.ts
|
|
1830
1843
|
var schema = {
|
|
@@ -1949,10 +1962,10 @@ var allOf_default = schema;
|
|
|
1949
1962
|
|
|
1950
1963
|
// src/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.tsx
|
|
1951
1964
|
var import_classnames6 = __toESM(require_classnames());
|
|
1952
|
-
|
|
1965
|
+
var import_react21 = require("react");
|
|
1953
1966
|
|
|
1954
1967
|
// src/layout/alert/DynamicAlert.tsx
|
|
1955
|
-
|
|
1968
|
+
var import_components = require("@transferwise/components");
|
|
1956
1969
|
|
|
1957
1970
|
// src/layout/utils.ts
|
|
1958
1971
|
var getMarginBottom = (size) => {
|
|
@@ -1985,11 +1998,11 @@ var getTextAlignment = (align) => {
|
|
|
1985
1998
|
var getTextAlignmentAndMargin = (component) => `${getTextAlignment(component.align)} ${getMarginBottom(component.margin)}`;
|
|
1986
1999
|
|
|
1987
2000
|
// src/layout/alert/DynamicAlert.tsx
|
|
1988
|
-
|
|
2001
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
1989
2002
|
var DynamicAlert = (props) => {
|
|
1990
2003
|
const alert = props.component;
|
|
1991
|
-
return /* @__PURE__ */
|
|
1992
|
-
Alert,
|
|
2004
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
2005
|
+
import_components.Alert,
|
|
1993
2006
|
{
|
|
1994
2007
|
type: mapContextToAlertType(legacy_mapContext(alert.context)),
|
|
1995
2008
|
className: getMarginBottom(alert.margin),
|
|
@@ -2021,12 +2034,12 @@ var mapContextToAlertType = (context) => {
|
|
|
2021
2034
|
var DynamicAlert_default = DynamicAlert;
|
|
2022
2035
|
|
|
2023
2036
|
// src/layout/box/DynamicBox.tsx
|
|
2024
|
-
|
|
2037
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
2025
2038
|
var DynamicBox = (props) => {
|
|
2026
2039
|
const box = props.component;
|
|
2027
2040
|
const margin = getMarginBottom(box.margin || box.border ? "lg" : "xs");
|
|
2028
2041
|
if (!box.width || box.width === "xl") {
|
|
2029
|
-
return /* @__PURE__ */
|
|
2042
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: margin + getBorderClass(box.border), children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
2030
2043
|
DynamicLayout_default,
|
|
2031
2044
|
{
|
|
2032
2045
|
components: box.components,
|
|
@@ -2039,7 +2052,7 @@ var DynamicBox = (props) => {
|
|
|
2039
2052
|
}
|
|
2040
2053
|
) });
|
|
2041
2054
|
}
|
|
2042
|
-
return /* @__PURE__ */
|
|
2055
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: margin + getBoxWidthClasses(box), children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: getBorderClass(box.border), children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
2043
2056
|
DynamicLayout_default,
|
|
2044
2057
|
{
|
|
2045
2058
|
components: box.components,
|
|
@@ -2073,16 +2086,16 @@ var getBoxWidthClasses = (component) => {
|
|
|
2073
2086
|
var DynamicBox_default = DynamicBox;
|
|
2074
2087
|
|
|
2075
2088
|
// src/layout/button/DynamicButton.tsx
|
|
2076
|
-
|
|
2077
|
-
|
|
2089
|
+
var import_components2 = require("@transferwise/components");
|
|
2090
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
2078
2091
|
var DynamicButton = (props) => {
|
|
2079
2092
|
const { component, onAction } = props;
|
|
2080
2093
|
const componentAction = component.action;
|
|
2081
2094
|
const { type, priority } = getButtonTypeAndPriority(componentAction);
|
|
2082
2095
|
const { loading } = useDynamicFlow();
|
|
2083
2096
|
const className = getMarginBottom(component.margin || "md") + " " + getActionClasses(componentAction);
|
|
2084
|
-
return /* @__PURE__ */
|
|
2085
|
-
Button,
|
|
2097
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2098
|
+
import_components2.Button,
|
|
2086
2099
|
{
|
|
2087
2100
|
size: getButtonSize(component.size),
|
|
2088
2101
|
type,
|
|
@@ -2130,12 +2143,12 @@ var getButtonTypeAndPriority = (action) => {
|
|
|
2130
2143
|
var DynamicButton_default = DynamicButton;
|
|
2131
2144
|
|
|
2132
2145
|
// src/layout/columns/DynamicColumns.tsx
|
|
2133
|
-
|
|
2146
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
2134
2147
|
var DynamicColumns = (props) => {
|
|
2135
2148
|
const columns = props.component;
|
|
2136
2149
|
const { leftWidth, rightWidth } = getWidth(columns.bias);
|
|
2137
|
-
return /* @__PURE__ */ jsxs("div", { className: `${getMarginBottom(columns.margin || "xs")} row`, children: [
|
|
2138
|
-
/* @__PURE__ */
|
|
2150
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: `${getMarginBottom(columns.margin || "xs")} row`, children: [
|
|
2151
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: `${leftWidth} m-b-0`, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2139
2152
|
DynamicLayout_default,
|
|
2140
2153
|
{
|
|
2141
2154
|
components: columns.left,
|
|
@@ -2147,7 +2160,7 @@ var DynamicColumns = (props) => {
|
|
|
2147
2160
|
onPersistAsync: props.onPersistAsync
|
|
2148
2161
|
}
|
|
2149
2162
|
) }),
|
|
2150
|
-
/* @__PURE__ */
|
|
2163
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: `${rightWidth} m-b-0`, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2151
2164
|
DynamicLayout_default,
|
|
2152
2165
|
{
|
|
2153
2166
|
components: columns.right,
|
|
@@ -2182,23 +2195,18 @@ var getWidth = (bias) => {
|
|
|
2182
2195
|
var DynamicColumns_default = DynamicColumns;
|
|
2183
2196
|
|
|
2184
2197
|
// src/layout/decision/DynamicDecision.tsx
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
AvatarType,
|
|
2188
|
-
NavigationOption,
|
|
2189
|
-
NavigationOptionsList
|
|
2190
|
-
} from "@transferwise/components";
|
|
2191
|
-
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
2198
|
+
var import_components3 = require("@transferwise/components");
|
|
2199
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
2192
2200
|
var getMedia = (option) => {
|
|
2193
2201
|
if (option.icon?.name) {
|
|
2194
|
-
return /* @__PURE__ */
|
|
2202
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_components3.Avatar, { type: import_components3.AvatarType.ICON, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DynamicIcon_default, { type: option.icon.name }) });
|
|
2195
2203
|
}
|
|
2196
2204
|
if (option.icon?.text) {
|
|
2197
|
-
return /* @__PURE__ */
|
|
2205
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_components3.Avatar, { type: import_components3.AvatarType.INITIALS, children: option.icon.text });
|
|
2198
2206
|
}
|
|
2199
2207
|
if (option.image?.url) {
|
|
2200
2208
|
const { url, text } = option.image;
|
|
2201
|
-
return /* @__PURE__ */
|
|
2209
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("img", { src: url, alt: text });
|
|
2202
2210
|
}
|
|
2203
2211
|
return void 0;
|
|
2204
2212
|
};
|
|
@@ -2206,8 +2214,8 @@ var DynamicDecision = (props) => {
|
|
|
2206
2214
|
const decision = props.component;
|
|
2207
2215
|
const renderDecisionOption = (option, onAction) => {
|
|
2208
2216
|
const media = getMedia(option);
|
|
2209
|
-
return /* @__PURE__ */
|
|
2210
|
-
NavigationOption,
|
|
2217
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2218
|
+
import_components3.NavigationOption,
|
|
2211
2219
|
{
|
|
2212
2220
|
title: option.title,
|
|
2213
2221
|
content: option.description,
|
|
@@ -2220,27 +2228,27 @@ var DynamicDecision = (props) => {
|
|
|
2220
2228
|
JSON.stringify(option)
|
|
2221
2229
|
);
|
|
2222
2230
|
};
|
|
2223
|
-
return /* @__PURE__ */
|
|
2231
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: getMarginBottom(decision.margin), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_components3.NavigationOptionsList, { children: decision.options.map((option) => renderDecisionOption(option, props.onAction)) }) });
|
|
2224
2232
|
};
|
|
2225
2233
|
var DynamicDecision_default = DynamicDecision;
|
|
2226
2234
|
|
|
2227
2235
|
// src/layout/divider/DynamicDivider.tsx
|
|
2228
|
-
|
|
2236
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
2229
2237
|
var DynamicDivider = ({ component }) => {
|
|
2230
2238
|
const margin = getMarginBottom(component.margin);
|
|
2231
2239
|
const className = `m-t-0 ${margin}`;
|
|
2232
|
-
return /* @__PURE__ */
|
|
2240
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("hr", { className });
|
|
2233
2241
|
};
|
|
2234
2242
|
var DynamicDivider_default = DynamicDivider;
|
|
2235
2243
|
|
|
2236
2244
|
// src/layout/external/DynamicExternal.tsx
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2245
|
+
var import_components4 = require("@transferwise/components");
|
|
2246
|
+
var import_react9 = require("react");
|
|
2247
|
+
var import_react_intl3 = require("react-intl");
|
|
2240
2248
|
|
|
2241
2249
|
// src/layout/external/DynamicExternal.messages.js
|
|
2242
|
-
|
|
2243
|
-
var DynamicExternal_messages_default =
|
|
2250
|
+
var import_react_intl2 = require("react-intl");
|
|
2251
|
+
var DynamicExternal_messages_default = (0, import_react_intl2.defineMessages)({
|
|
2244
2252
|
retryTitle: {
|
|
2245
2253
|
id: "dynamicFlows.DynamicExternal.retryTitle",
|
|
2246
2254
|
defaultMessage: "Reopen window",
|
|
@@ -2249,15 +2257,15 @@ var DynamicExternal_messages_default = defineMessages2({
|
|
|
2249
2257
|
});
|
|
2250
2258
|
|
|
2251
2259
|
// src/layout/external/DynamicExternal.tsx
|
|
2252
|
-
|
|
2260
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
2253
2261
|
var DynamicExternal = ({ component, onAction }) => {
|
|
2254
2262
|
const { requestUrl, responseHandlers, polling, retryTitle } = component;
|
|
2255
|
-
const intl = useIntl();
|
|
2256
|
-
const openExternalUrl =
|
|
2263
|
+
const intl = (0, import_react_intl3.useIntl)();
|
|
2264
|
+
const openExternalUrl = (0, import_react9.useCallback)(
|
|
2257
2265
|
() => window.open(requestUrl, "df-external-window"),
|
|
2258
2266
|
[requestUrl]
|
|
2259
2267
|
);
|
|
2260
|
-
|
|
2268
|
+
(0, import_react9.useEffect)(() => {
|
|
2261
2269
|
openExternalUrl();
|
|
2262
2270
|
}, [openExternalUrl]);
|
|
2263
2271
|
const pollingConfiguration = polling && responseHandlers ? {
|
|
@@ -2265,18 +2273,18 @@ var DynamicExternal = ({ component, onAction }) => {
|
|
|
2265
2273
|
responseHandlers
|
|
2266
2274
|
} : void 0;
|
|
2267
2275
|
useExternalStepPolling(pollingConfiguration, onAction);
|
|
2268
|
-
return /* @__PURE__ */
|
|
2269
|
-
/* @__PURE__ */
|
|
2270
|
-
/* @__PURE__ */
|
|
2271
|
-
/* @__PURE__ */
|
|
2276
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
2277
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_components4.Loader, { size: import_components4.Size.LARGE, classNames: { "tw-loader": "tw-loader m-x-auto" } }),
|
|
2278
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("br", {}),
|
|
2279
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_components4.Button, { priority: "tertiary", block: true, onClick: openExternalUrl, children: retryTitle || intl.formatMessage(DynamicExternal_messages_default.retryTitle) })
|
|
2272
2280
|
] });
|
|
2273
2281
|
};
|
|
2274
2282
|
var DynamicExternal_default = DynamicExternal;
|
|
2275
2283
|
|
|
2276
2284
|
// src/jsonSchemaForm/allOfSchema/AllOfSchema.tsx
|
|
2277
2285
|
var import_classnames = __toESM(require_classnames());
|
|
2278
|
-
|
|
2279
|
-
|
|
2286
|
+
var import_react10 = require("react");
|
|
2287
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
2280
2288
|
var splitModel = (model, schemas) => {
|
|
2281
2289
|
return schemas.map((schema2) => getValidObjectModelParts(model, schema2) || {});
|
|
2282
2290
|
};
|
|
@@ -2299,13 +2307,13 @@ var AllOfSchema4 = (props) => {
|
|
|
2299
2307
|
setModels(models);
|
|
2300
2308
|
props.onChange({ ...onChangeProps, model: combineModels(models) });
|
|
2301
2309
|
};
|
|
2302
|
-
const [models, setModels] =
|
|
2303
|
-
return /* @__PURE__ */
|
|
2304
|
-
props.schema.title && /* @__PURE__ */
|
|
2305
|
-
props.schema.description && /* @__PURE__ */
|
|
2306
|
-
/* @__PURE__ */
|
|
2310
|
+
const [models, setModels] = (0, import_react10.useState)(splitModel(props.model, props.schema.allOf));
|
|
2311
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
2312
|
+
props.schema.title && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h3", { className: "page-header", children: props.schema.title }),
|
|
2313
|
+
props.schema.description && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { children: props.schema.description }),
|
|
2314
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "row", children: props.schema.allOf.map((schema2, index) => (
|
|
2307
2315
|
// eslint-disable-next-line react/no-array-index-key
|
|
2308
|
-
/* @__PURE__ */
|
|
2316
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: (0, import_classnames.default)(getSchemaColumnClasses(schema2.width)), children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2309
2317
|
GenericSchema_default,
|
|
2310
2318
|
{
|
|
2311
2319
|
schema: schema2,
|
|
@@ -2330,18 +2338,18 @@ AllOfSchema4.defaultProps = {
|
|
|
2330
2338
|
var AllOfSchema_default = AllOfSchema4;
|
|
2331
2339
|
|
|
2332
2340
|
// src/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.tsx
|
|
2341
|
+
var import_components6 = require("@transferwise/components");
|
|
2333
2342
|
var import_classnames2 = __toESM(require_classnames());
|
|
2334
|
-
|
|
2335
|
-
import { useMemo as useMemo6, useState as useState4 } from "react";
|
|
2343
|
+
var import_react11 = require("react");
|
|
2336
2344
|
|
|
2337
2345
|
// src/jsonSchemaForm/controlFeedback/ControlFeedback.tsx
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2346
|
+
var import_components5 = require("@transferwise/components");
|
|
2347
|
+
var import_formatting = require("@transferwise/formatting");
|
|
2348
|
+
var import_react_intl5 = require("react-intl");
|
|
2341
2349
|
|
|
2342
2350
|
// src/jsonSchemaForm/controlFeedback/ControlFeedback.messages.ts
|
|
2343
|
-
|
|
2344
|
-
var ControlFeedback_messages_default =
|
|
2351
|
+
var import_react_intl4 = require("react-intl");
|
|
2352
|
+
var ControlFeedback_messages_default = (0, import_react_intl4.defineMessages)({
|
|
2345
2353
|
type: {
|
|
2346
2354
|
id: "dynamicFlows.ControlFeedback.type",
|
|
2347
2355
|
defaultMessage: "Incorrect type",
|
|
@@ -2395,7 +2403,7 @@ var ControlFeedback_messages_default = defineMessages3({
|
|
|
2395
2403
|
});
|
|
2396
2404
|
|
|
2397
2405
|
// src/jsonSchemaForm/controlFeedback/ControlFeedback.tsx
|
|
2398
|
-
|
|
2406
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
2399
2407
|
var ControlFeedback = (props) => {
|
|
2400
2408
|
const defaultValidationMessages = useDefaultValidationMessages(props.schema);
|
|
2401
2409
|
const validationMessages = {
|
|
@@ -2410,12 +2418,12 @@ var ControlFeedback = (props) => {
|
|
|
2410
2418
|
const isValidationVisible = !isErrorVisible && (props.submitted || props.changed && props.blurred) && !!props.validations?.length;
|
|
2411
2419
|
const isDescriptionVisible = props.focused && props.schema.description && !isValidationVisible;
|
|
2412
2420
|
const hasInfoMessage = !!props.infoMessage;
|
|
2413
|
-
return /* @__PURE__ */
|
|
2414
|
-
isErrorVisible ? /* @__PURE__ */
|
|
2415
|
-
isValidationVisible ? /* @__PURE__ */
|
|
2416
|
-
(isDescriptionVisible || hasInfoMessage) && /* @__PURE__ */
|
|
2417
|
-
isDescriptionVisible && /* @__PURE__ */
|
|
2418
|
-
hasInfoMessage && /* @__PURE__ */
|
|
2421
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { children: [
|
|
2422
|
+
isErrorVisible ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_components5.InlineAlert, { type: "error", children: props.errors }) : null,
|
|
2423
|
+
isValidationVisible ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_components5.InlineAlert, { type: "error", children: props.validations.map((validation) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { children: validationMessages[validation] }, validation)) }) : null,
|
|
2424
|
+
(isDescriptionVisible || hasInfoMessage) && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_components5.InlineAlert, { type: "info", children: [
|
|
2425
|
+
isDescriptionVisible && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { children: props.schema.description }),
|
|
2426
|
+
hasInfoMessage && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { children: props.infoMessage })
|
|
2419
2427
|
] })
|
|
2420
2428
|
] });
|
|
2421
2429
|
};
|
|
@@ -2426,7 +2434,7 @@ ControlFeedback.defaultProps = {
|
|
|
2426
2434
|
validationAsyncSuccessMessage: null
|
|
2427
2435
|
};
|
|
2428
2436
|
function useDefaultValidationMessages(schema2) {
|
|
2429
|
-
const { formatMessage, locale } =
|
|
2437
|
+
const { formatMessage, locale } = (0, import_react_intl5.useIntl)();
|
|
2430
2438
|
const formattedMessages = {
|
|
2431
2439
|
type: formatMessage(ControlFeedback_messages_default.type),
|
|
2432
2440
|
minimum: formatMessage(ControlFeedback_messages_default.minimum, {
|
|
@@ -2448,7 +2456,7 @@ function useDefaultValidationMessages(schema2) {
|
|
|
2448
2456
|
const dateOverrides = {
|
|
2449
2457
|
pattern: formatMessage(ControlFeedback_messages_default.patternDate),
|
|
2450
2458
|
minimum: schema2.minimum ? formatMessage(ControlFeedback_messages_default.minimumDate, {
|
|
2451
|
-
minimum:
|
|
2459
|
+
minimum: (0, import_formatting.formatDate)(
|
|
2452
2460
|
new Date(schema2.minimum),
|
|
2453
2461
|
locale,
|
|
2454
2462
|
{
|
|
@@ -2458,7 +2466,7 @@ function useDefaultValidationMessages(schema2) {
|
|
|
2458
2466
|
)
|
|
2459
2467
|
}) : void 0,
|
|
2460
2468
|
maximum: schema2.maximum ? formatMessage(ControlFeedback_messages_default.maximumDate, {
|
|
2461
|
-
maximum:
|
|
2469
|
+
maximum: (0, import_formatting.formatDate)(
|
|
2462
2470
|
new Date(schema2.maximum),
|
|
2463
2471
|
locale,
|
|
2464
2472
|
{
|
|
@@ -2513,11 +2521,11 @@ function constructUploadError(response) {
|
|
|
2513
2521
|
}
|
|
2514
2522
|
|
|
2515
2523
|
// src/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/useFormattedDefaultErrorMessages.tsx
|
|
2516
|
-
|
|
2524
|
+
var import_react_intl8 = require("react-intl");
|
|
2517
2525
|
|
|
2518
2526
|
// src/common/messages.ts
|
|
2519
|
-
|
|
2520
|
-
var messages_default =
|
|
2527
|
+
var import_react_intl6 = require("react-intl");
|
|
2528
|
+
var messages_default = (0, import_react_intl6.defineMessages)({
|
|
2521
2529
|
required: {
|
|
2522
2530
|
id: "dynamicFlows.DefaultErrorMessages.required",
|
|
2523
2531
|
defaultMessage: "Please fill out this field.",
|
|
@@ -2526,8 +2534,8 @@ var messages_default = defineMessages4({
|
|
|
2526
2534
|
});
|
|
2527
2535
|
|
|
2528
2536
|
// src/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.messages.js
|
|
2529
|
-
|
|
2530
|
-
var MultipleFileUploadSchema_messages_default =
|
|
2537
|
+
var import_react_intl7 = require("react-intl");
|
|
2538
|
+
var MultipleFileUploadSchema_messages_default = (0, import_react_intl7.defineMessages)({
|
|
2531
2539
|
minItemsError: {
|
|
2532
2540
|
id: "dynamicFlows.MultipleFileUploadSchema.minItemsError",
|
|
2533
2541
|
defaultMessage: "Please upload at least {minItems} file(s).",
|
|
@@ -2550,7 +2558,7 @@ function useFormattedDefaultErrorMessages({
|
|
|
2550
2558
|
maxItems,
|
|
2551
2559
|
minItems
|
|
2552
2560
|
}) {
|
|
2553
|
-
const { formatMessage } =
|
|
2561
|
+
const { formatMessage } = (0, import_react_intl8.useIntl)();
|
|
2554
2562
|
const { maxFileSizeError, maxItemsError, minItemsError } = MultipleFileUploadSchema_messages_default;
|
|
2555
2563
|
return {
|
|
2556
2564
|
maxFileSizeErrorMessage: formatMessage(maxFileSizeError),
|
|
@@ -2561,14 +2569,14 @@ function useFormattedDefaultErrorMessages({
|
|
|
2561
2569
|
}
|
|
2562
2570
|
|
|
2563
2571
|
// src/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.tsx
|
|
2564
|
-
|
|
2572
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
2565
2573
|
var MultipleFileUploadSchema = (props) => {
|
|
2566
2574
|
const { onChange, schema: schema2 } = props;
|
|
2567
2575
|
const onEvent = useEventDispatcher();
|
|
2568
2576
|
const defaultErrorMessages = useFormattedDefaultErrorMessages(schema2);
|
|
2569
|
-
const uid =
|
|
2570
|
-
const [inputChanged, setInputChanged] =
|
|
2571
|
-
const [files, setFiles] =
|
|
2577
|
+
const uid = (0, import_react11.useMemo)(() => schema2.$id || generateRandomId(), [schema2.$id]);
|
|
2578
|
+
const [inputChanged, setInputChanged] = (0, import_react11.useState)(false);
|
|
2579
|
+
const [files, setFiles] = (0, import_react11.useState)(() => convertFileIdsToComponentFileObjects(props.model || []));
|
|
2572
2580
|
const performPersistAsync = usePersistAsync(schema2.items.persistAsync);
|
|
2573
2581
|
const fileSchemaDescriptor = schema2.items.persistAsync.schema;
|
|
2574
2582
|
const isBlob = isBlobSchema(fileSchemaDescriptor);
|
|
@@ -2622,10 +2630,10 @@ var MultipleFileUploadSchema = (props) => {
|
|
|
2622
2630
|
onFilesChange,
|
|
2623
2631
|
onDeleteFile: () => Promise.resolve()
|
|
2624
2632
|
};
|
|
2625
|
-
return /* @__PURE__ */
|
|
2626
|
-
/* @__PURE__ */
|
|
2627
|
-
/* @__PURE__ */
|
|
2628
|
-
/* @__PURE__ */
|
|
2633
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: (0, import_classnames2.default)("form-group", { "has-error": showError }), children: [
|
|
2634
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("label", { className: "d-block control-label", htmlFor: uid, children: props.schema.title }),
|
|
2635
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_components6.UploadInput, { ...uploadInputProps }),
|
|
2636
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2629
2637
|
ControlFeedback_default,
|
|
2630
2638
|
{
|
|
2631
2639
|
changed: inputChanged,
|
|
@@ -2654,7 +2662,7 @@ function getSuccessfullyProcessedFiles(allFiles) {
|
|
|
2654
2662
|
return allFiles.filter((file) => !file.error && file.status === "succeeded");
|
|
2655
2663
|
}
|
|
2656
2664
|
function convertFileIdsToComponentFileObjects(fileIds) {
|
|
2657
|
-
return fileIds.map((id) => isValidId(id) ? { id, status: Status.SUCCEEDED } : null).filter((item) => item !== null);
|
|
2665
|
+
return fileIds.map((id) => isValidId(id) ? { id, status: import_components6.Status.SUCCEEDED } : null).filter((item) => item !== null);
|
|
2658
2666
|
}
|
|
2659
2667
|
function isValidId(id) {
|
|
2660
2668
|
return isNumber(id) || isString(id);
|
|
@@ -2669,11 +2677,11 @@ function getValidationMessages(schema2, required, defaultErrorMessages) {
|
|
|
2669
2677
|
}
|
|
2670
2678
|
|
|
2671
2679
|
// src/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.tsx
|
|
2672
|
-
|
|
2680
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
2673
2681
|
var ArrayListSchema = (props) => {
|
|
2674
2682
|
const { schema: schema2 } = props;
|
|
2675
2683
|
if (isMultipleFileUploadSchema(schema2)) {
|
|
2676
|
-
return /* @__PURE__ */
|
|
2684
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(MultipleFileUploadSchema_default, { ...props, schema: schema2 });
|
|
2677
2685
|
}
|
|
2678
2686
|
throw new Error("Not implemented");
|
|
2679
2687
|
};
|
|
@@ -2684,11 +2692,11 @@ ArrayListSchema.defaultProps = {
|
|
|
2684
2692
|
var ArrayListSchema_default = ArrayListSchema;
|
|
2685
2693
|
|
|
2686
2694
|
// src/jsonSchemaForm/arrayTypeSchema/ArraySchema.tsx
|
|
2687
|
-
|
|
2695
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
2688
2696
|
var ArraySchema3 = (props) => {
|
|
2689
2697
|
const { schema: schema2 } = props;
|
|
2690
2698
|
if (isListArraySchema(schema2)) {
|
|
2691
|
-
return /* @__PURE__ */
|
|
2699
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ArrayListSchema_default, { ...props });
|
|
2692
2700
|
}
|
|
2693
2701
|
throw new Error("Not implemented");
|
|
2694
2702
|
};
|
|
@@ -2699,8 +2707,8 @@ var ArraySchema_default = ArraySchema3;
|
|
|
2699
2707
|
|
|
2700
2708
|
// src/jsonSchemaForm/objectSchema/ObjectSchema.tsx
|
|
2701
2709
|
var import_classnames3 = __toESM(require_classnames());
|
|
2702
|
-
|
|
2703
|
-
|
|
2710
|
+
var import_react12 = require("react");
|
|
2711
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
2704
2712
|
var getSchemaColumnClasses2 = (width) => {
|
|
2705
2713
|
return {
|
|
2706
2714
|
"col-xs-12": true,
|
|
@@ -2709,7 +2717,7 @@ var getSchemaColumnClasses2 = (width) => {
|
|
|
2709
2717
|
};
|
|
2710
2718
|
};
|
|
2711
2719
|
var ObjectSchema3 = (props) => {
|
|
2712
|
-
const [model, setModel] =
|
|
2720
|
+
const [model, setModel] = (0, import_react12.useState)(() => ({
|
|
2713
2721
|
...getValidObjectModelParts(props.model, props.schema)
|
|
2714
2722
|
}));
|
|
2715
2723
|
const onChangeProperty = (propertyName, onChangeProps) => {
|
|
@@ -2722,7 +2730,7 @@ var ObjectSchema3 = (props) => {
|
|
|
2722
2730
|
props.onChange({ ...onChangeProps, model });
|
|
2723
2731
|
};
|
|
2724
2732
|
const isRequired = (propertyName) => props.schema.required && props.schema.required.includes(propertyName);
|
|
2725
|
-
|
|
2733
|
+
(0, import_react12.useEffect)(() => {
|
|
2726
2734
|
const newModel = getValidObjectModelParts(model, props.schema) || {};
|
|
2727
2735
|
setModel(newModel);
|
|
2728
2736
|
if (!isEqual(newModel, model)) {
|
|
@@ -2740,25 +2748,25 @@ var ObjectSchema3 = (props) => {
|
|
|
2740
2748
|
const isPropertyDefined = (propertyName) => typeof props.schema.properties[propertyName] !== "undefined";
|
|
2741
2749
|
const orderedPropertyNames = Array.from(allorderedPropertiesSet).filter(isPropertyDefined);
|
|
2742
2750
|
const propsErrors = props.errors;
|
|
2743
|
-
return /* @__PURE__ */
|
|
2744
|
-
props.schema.title && !props.hideTitle && /* @__PURE__ */
|
|
2751
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("fieldset", { children: [
|
|
2752
|
+
props.schema.title && !props.hideTitle && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("legend", { children: [
|
|
2745
2753
|
" ",
|
|
2746
2754
|
props.schema.title,
|
|
2747
2755
|
" "
|
|
2748
2756
|
] }),
|
|
2749
|
-
props.schema.description && !props.hideTitle && /* @__PURE__ */
|
|
2757
|
+
props.schema.description && !props.hideTitle && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("p", { children: [
|
|
2750
2758
|
" ",
|
|
2751
2759
|
props.schema.description,
|
|
2752
2760
|
" "
|
|
2753
2761
|
] }),
|
|
2754
|
-
props.schema.alert && /* @__PURE__ */
|
|
2755
|
-
/* @__PURE__ */
|
|
2762
|
+
props.schema.alert && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DynamicAlert_default, { component: props.schema.alert }),
|
|
2763
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "row", children: orderedPropertyNames.map((propertyName) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2756
2764
|
"div",
|
|
2757
2765
|
{
|
|
2758
2766
|
className: (0, import_classnames3.default)(
|
|
2759
2767
|
getSchemaColumnClasses2(props.schema.properties[propertyName].width)
|
|
2760
2768
|
),
|
|
2761
|
-
children: /* @__PURE__ */
|
|
2769
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2762
2770
|
GenericSchema_default,
|
|
2763
2771
|
{
|
|
2764
2772
|
schema: props.schema.properties[propertyName],
|
|
@@ -2784,15 +2792,15 @@ var ObjectSchema_default = ObjectSchema3;
|
|
|
2784
2792
|
|
|
2785
2793
|
// src/jsonSchemaForm/oneOfSchema/OneOfSchema.tsx
|
|
2786
2794
|
var import_classnames4 = __toESM(require_classnames());
|
|
2787
|
-
|
|
2795
|
+
var import_react14 = require("react");
|
|
2788
2796
|
|
|
2789
2797
|
// src/jsonSchemaForm/help/Help.tsx
|
|
2790
|
-
|
|
2791
|
-
|
|
2798
|
+
var import_components7 = require("@transferwise/components");
|
|
2799
|
+
var import_react_intl10 = require("react-intl");
|
|
2792
2800
|
|
|
2793
2801
|
// src/jsonSchemaForm/help/Help.messages.js
|
|
2794
|
-
|
|
2795
|
-
var Help_messages_default =
|
|
2802
|
+
var import_react_intl9 = require("react-intl");
|
|
2803
|
+
var Help_messages_default = (0, import_react_intl9.defineMessages)({
|
|
2796
2804
|
helpAria: {
|
|
2797
2805
|
id: "dynamicFlows.Help.ariaLabel",
|
|
2798
2806
|
defaultMessage: "Click here for more info.",
|
|
@@ -2801,14 +2809,14 @@ var Help_messages_default = defineMessages6({
|
|
|
2801
2809
|
});
|
|
2802
2810
|
|
|
2803
2811
|
// src/jsonSchemaForm/help/Help.tsx
|
|
2804
|
-
|
|
2812
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
2805
2813
|
var Help = (props) => {
|
|
2806
|
-
const intl =
|
|
2807
|
-
return /* @__PURE__ */
|
|
2808
|
-
Info,
|
|
2814
|
+
const intl = (0, import_react_intl10.useIntl)();
|
|
2815
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2816
|
+
import_components7.Info,
|
|
2809
2817
|
{
|
|
2810
2818
|
className: "m-l-1",
|
|
2811
|
-
content: /* @__PURE__ */
|
|
2819
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_components7.Markdown, { children: props.help.markdown }),
|
|
2812
2820
|
presentation: "POPOVER",
|
|
2813
2821
|
size: "sm",
|
|
2814
2822
|
"aria-label": intl.formatMessage(Help_messages_default.helpAria)
|
|
@@ -2818,19 +2826,8 @@ var Help = (props) => {
|
|
|
2818
2826
|
var Help_default = Help;
|
|
2819
2827
|
|
|
2820
2828
|
// src/formControl/FormControl.tsx
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
DateInput,
|
|
2824
|
-
DateLookup,
|
|
2825
|
-
InputWithDisplayFormat,
|
|
2826
|
-
PhoneNumberInput,
|
|
2827
|
-
RadioGroup,
|
|
2828
|
-
Select,
|
|
2829
|
-
Tabs,
|
|
2830
|
-
TextareaWithDisplayFormat,
|
|
2831
|
-
Upload
|
|
2832
|
-
} from "@transferwise/components";
|
|
2833
|
-
import { PureComponent } from "react";
|
|
2829
|
+
var import_components8 = require("@transferwise/components");
|
|
2830
|
+
var import_react13 = require("react");
|
|
2834
2831
|
|
|
2835
2832
|
// src/formControl/utils/value-utils.ts
|
|
2836
2833
|
var getSafeStringValue = (value, options = {}) => {
|
|
@@ -2940,8 +2937,8 @@ var logInvalidTypeFallbackWarning = ({
|
|
|
2940
2937
|
};
|
|
2941
2938
|
|
|
2942
2939
|
// src/formControl/FormControl.tsx
|
|
2943
|
-
|
|
2944
|
-
var _FormControl = class extends PureComponent {
|
|
2940
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
2941
|
+
var _FormControl = class extends import_react13.PureComponent {
|
|
2945
2942
|
constructor(props) {
|
|
2946
2943
|
super(props);
|
|
2947
2944
|
/**
|
|
@@ -3022,8 +3019,8 @@ var _FormControl = class extends PureComponent {
|
|
|
3022
3019
|
} = this.props;
|
|
3023
3020
|
switch (type) {
|
|
3024
3021
|
case FormControlType.RADIO:
|
|
3025
|
-
return /* @__PURE__ */
|
|
3026
|
-
RadioGroup,
|
|
3022
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3023
|
+
import_components8.RadioGroup,
|
|
3027
3024
|
{
|
|
3028
3025
|
radios: options.map(this.mapOption),
|
|
3029
3026
|
name,
|
|
@@ -3032,8 +3029,8 @@ var _FormControl = class extends PureComponent {
|
|
|
3032
3029
|
}
|
|
3033
3030
|
);
|
|
3034
3031
|
case FormControlType.CHECKBOX:
|
|
3035
|
-
return /* @__PURE__ */
|
|
3036
|
-
Checkbox,
|
|
3032
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3033
|
+
import_components8.Checkbox,
|
|
3037
3034
|
{
|
|
3038
3035
|
checked: getSafeBooleanValue(value, { coerceValue: true }),
|
|
3039
3036
|
disabled,
|
|
@@ -3047,8 +3044,8 @@ var _FormControl = class extends PureComponent {
|
|
|
3047
3044
|
);
|
|
3048
3045
|
case FormControlType.SELECT: {
|
|
3049
3046
|
const search = options.length >= 20;
|
|
3050
|
-
return /* @__PURE__ */
|
|
3051
|
-
Select,
|
|
3047
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3048
|
+
import_components8.Select,
|
|
3052
3049
|
{
|
|
3053
3050
|
id,
|
|
3054
3051
|
selected: this.getSelectedOption(options),
|
|
@@ -3070,13 +3067,13 @@ var _FormControl = class extends PureComponent {
|
|
|
3070
3067
|
);
|
|
3071
3068
|
}
|
|
3072
3069
|
case FormControlType.TAB:
|
|
3073
|
-
return /* @__PURE__ */
|
|
3074
|
-
Tabs,
|
|
3070
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3071
|
+
import_components8.Tabs,
|
|
3075
3072
|
{
|
|
3076
3073
|
selected: this.getSelectedOption(options)?.value || 0,
|
|
3077
3074
|
tabs: options.map((option) => ({
|
|
3078
3075
|
title: option.label,
|
|
3079
|
-
content: /* @__PURE__ */
|
|
3076
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_jsx_runtime19.Fragment, {}),
|
|
3080
3077
|
disabled: option.disabled || false
|
|
3081
3078
|
})),
|
|
3082
3079
|
name: id,
|
|
@@ -3090,7 +3087,7 @@ var _FormControl = class extends PureComponent {
|
|
|
3090
3087
|
}
|
|
3091
3088
|
);
|
|
3092
3089
|
case FormControlType.NUMBER:
|
|
3093
|
-
return /* @__PURE__ */
|
|
3090
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3094
3091
|
"input",
|
|
3095
3092
|
{
|
|
3096
3093
|
autoComplete: this.getAutocompleteStatus(),
|
|
@@ -3118,7 +3115,7 @@ var _FormControl = class extends PureComponent {
|
|
|
3118
3115
|
}
|
|
3119
3116
|
);
|
|
3120
3117
|
case FormControlType.HIDDEN:
|
|
3121
|
-
return /* @__PURE__ */
|
|
3118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3122
3119
|
"input",
|
|
3123
3120
|
{
|
|
3124
3121
|
type: "hidden",
|
|
@@ -3128,7 +3125,7 @@ var _FormControl = class extends PureComponent {
|
|
|
3128
3125
|
}
|
|
3129
3126
|
);
|
|
3130
3127
|
case FormControlType.PASSWORD:
|
|
3131
|
-
return /* @__PURE__ */
|
|
3128
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3132
3129
|
"input",
|
|
3133
3130
|
{
|
|
3134
3131
|
autoComplete: this.getAutocompleteStatus(),
|
|
@@ -3147,8 +3144,8 @@ var _FormControl = class extends PureComponent {
|
|
|
3147
3144
|
);
|
|
3148
3145
|
case FormControlType.DATE:
|
|
3149
3146
|
case FormControlType.DATETIME:
|
|
3150
|
-
return /* @__PURE__ */
|
|
3151
|
-
DateInput,
|
|
3147
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3148
|
+
import_components8.DateInput,
|
|
3152
3149
|
{
|
|
3153
3150
|
disabled,
|
|
3154
3151
|
size,
|
|
@@ -3161,8 +3158,8 @@ var _FormControl = class extends PureComponent {
|
|
|
3161
3158
|
}
|
|
3162
3159
|
);
|
|
3163
3160
|
case FormControlType.DATELOOKUP: {
|
|
3164
|
-
return /* @__PURE__ */
|
|
3165
|
-
DateLookup,
|
|
3161
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3162
|
+
import_components8.DateLookup,
|
|
3166
3163
|
{
|
|
3167
3164
|
value: getSafeDateStringValue(value),
|
|
3168
3165
|
min: minDate,
|
|
@@ -3179,8 +3176,8 @@ var _FormControl = class extends PureComponent {
|
|
|
3179
3176
|
);
|
|
3180
3177
|
}
|
|
3181
3178
|
case FormControlType.TEL:
|
|
3182
|
-
return /* @__PURE__ */
|
|
3183
|
-
PhoneNumberInput,
|
|
3179
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3180
|
+
import_components8.PhoneNumberInput,
|
|
3184
3181
|
{
|
|
3185
3182
|
disabled,
|
|
3186
3183
|
countryCode,
|
|
@@ -3211,8 +3208,8 @@ var _FormControl = class extends PureComponent {
|
|
|
3211
3208
|
autoComplete: this.getAutocompleteStatus()
|
|
3212
3209
|
};
|
|
3213
3210
|
if (this.props.displayPattern) {
|
|
3214
|
-
return /* @__PURE__ */
|
|
3215
|
-
TextareaWithDisplayFormat,
|
|
3211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3212
|
+
import_components8.TextareaWithDisplayFormat,
|
|
3216
3213
|
{
|
|
3217
3214
|
displayPattern: this.props.displayPattern,
|
|
3218
3215
|
...textareaProps,
|
|
@@ -3220,15 +3217,15 @@ var _FormControl = class extends PureComponent {
|
|
|
3220
3217
|
}
|
|
3221
3218
|
);
|
|
3222
3219
|
}
|
|
3223
|
-
return /* @__PURE__ */
|
|
3220
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("textarea", { ...textareaProps, onChange: this.handleInputOnChange });
|
|
3224
3221
|
}
|
|
3225
3222
|
case FormControlType.FILE:
|
|
3226
3223
|
case FormControlType.UPLOAD: {
|
|
3227
3224
|
return (
|
|
3228
3225
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
3229
3226
|
// @ts-expect-error - TODO: Remove this once Upload is migrated to TypeScript
|
|
3230
|
-
/* @__PURE__ */
|
|
3231
|
-
Upload,
|
|
3227
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3228
|
+
import_components8.Upload,
|
|
3232
3229
|
{
|
|
3233
3230
|
...uploadProps,
|
|
3234
3231
|
usAccept: uploadProps.usAccept || "*",
|
|
@@ -3265,8 +3262,8 @@ var _FormControl = class extends PureComponent {
|
|
|
3265
3262
|
autoComplete: this.getAutocompleteStatus()
|
|
3266
3263
|
};
|
|
3267
3264
|
if (this.props.displayPattern) {
|
|
3268
|
-
return /* @__PURE__ */
|
|
3269
|
-
InputWithDisplayFormat,
|
|
3265
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3266
|
+
import_components8.InputWithDisplayFormat,
|
|
3270
3267
|
{
|
|
3271
3268
|
displayPattern: this.props.displayPattern,
|
|
3272
3269
|
...inputProps,
|
|
@@ -3274,7 +3271,7 @@ var _FormControl = class extends PureComponent {
|
|
|
3274
3271
|
}
|
|
3275
3272
|
);
|
|
3276
3273
|
}
|
|
3277
|
-
return /* @__PURE__ */
|
|
3274
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("input", { ...inputProps, onChange: this.handleInputOnChange });
|
|
3278
3275
|
}
|
|
3279
3276
|
}
|
|
3280
3277
|
}
|
|
@@ -3317,18 +3314,18 @@ FormControl.defaultProps = {
|
|
|
3317
3314
|
};
|
|
3318
3315
|
|
|
3319
3316
|
// src/jsonSchemaForm/schemaFormControl/utils/mapping-utils.tsx
|
|
3320
|
-
|
|
3317
|
+
var import_components9 = require("@transferwise/components");
|
|
3321
3318
|
|
|
3322
3319
|
// src/layout/icon/DynamicIcon.tsx
|
|
3323
|
-
|
|
3324
|
-
|
|
3320
|
+
var icons = __toESM(require("@transferwise/icons"));
|
|
3321
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
3325
3322
|
var DynamicIcon = ({ type }) => {
|
|
3326
3323
|
const iconName = toCapitalisedCamelCase(type);
|
|
3327
3324
|
if (!Object.keys(icons).includes(iconName)) {
|
|
3328
|
-
return /* @__PURE__ */
|
|
3325
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_jsx_runtime20.Fragment, {});
|
|
3329
3326
|
}
|
|
3330
3327
|
const Icon = icons[iconName];
|
|
3331
|
-
return /* @__PURE__ */
|
|
3328
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Icon, { size: 24 });
|
|
3332
3329
|
};
|
|
3333
3330
|
function toCapitalisedCamelCase(value) {
|
|
3334
3331
|
return value.split("-").map(capitaliseFirstChar).join("");
|
|
@@ -3418,7 +3415,7 @@ var availableCurrencyFlags = [
|
|
|
3418
3415
|
var availablePrefixedCurrencyFlags = availableCurrencyFlags.map((code) => `flag-${code}`);
|
|
3419
3416
|
|
|
3420
3417
|
// src/jsonSchemaForm/schemaFormControl/utils/mapping-utils.tsx
|
|
3421
|
-
|
|
3418
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
3422
3419
|
var mapConstSchemaToOption = (schema2, controlType) => {
|
|
3423
3420
|
switch (controlType) {
|
|
3424
3421
|
case "select":
|
|
@@ -3458,36 +3455,36 @@ var mapKeywordsToSearchStrings = (searchStrings) => isArray(searchStrings) ? { s
|
|
|
3458
3455
|
var mapImage = (image) => {
|
|
3459
3456
|
if (image?.url) {
|
|
3460
3457
|
return {
|
|
3461
|
-
icon: /* @__PURE__ */
|
|
3458
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "media", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "np-option__no-media-circle", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("img", { src: image.url, alt: image.name || "" }) }) })
|
|
3462
3459
|
};
|
|
3463
3460
|
}
|
|
3464
3461
|
return null;
|
|
3465
3462
|
};
|
|
3466
3463
|
var mapIcon = (icon) => {
|
|
3467
3464
|
if (icon?.name && isValidIconName(icon.name)) {
|
|
3468
|
-
return { icon: /* @__PURE__ */
|
|
3465
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DynamicIcon_default, { type: icon.name }) };
|
|
3469
3466
|
}
|
|
3470
3467
|
if (icon?.text) {
|
|
3471
|
-
return { icon: /* @__PURE__ */
|
|
3468
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: icon.text }) };
|
|
3472
3469
|
}
|
|
3473
3470
|
return null;
|
|
3474
3471
|
};
|
|
3475
3472
|
var mapIconToAvatar = (icon) => {
|
|
3476
3473
|
if (icon?.name && isValidIconName(icon.name)) {
|
|
3477
3474
|
return {
|
|
3478
|
-
avatar: /* @__PURE__ */
|
|
3475
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_components9.Avatar, { type: import_components9.AvatarType.ICON, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DynamicIcon_default, { type: icon.name }) })
|
|
3479
3476
|
};
|
|
3480
3477
|
}
|
|
3481
3478
|
if (icon?.text) {
|
|
3482
3479
|
return {
|
|
3483
|
-
avatar: /* @__PURE__ */
|
|
3480
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_components9.Avatar, { type: import_components9.AvatarType.INITIALS, children: icon.text })
|
|
3484
3481
|
};
|
|
3485
3482
|
}
|
|
3486
3483
|
return null;
|
|
3487
3484
|
};
|
|
3488
3485
|
var mapAvatar = (image) => {
|
|
3489
3486
|
return image && image.url ? {
|
|
3490
|
-
avatar: /* @__PURE__ */
|
|
3487
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_components9.Avatar, { type: import_components9.AvatarType.THUMBNAIL, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("img", { src: image.url, alt: "User avatar" }) })
|
|
3491
3488
|
} : null;
|
|
3492
3489
|
};
|
|
3493
3490
|
var mapSchemaToUploadOptions = ({ accepts }) => ({
|
|
@@ -3508,7 +3505,7 @@ var getDisabled = (disabled) => {
|
|
|
3508
3505
|
};
|
|
3509
3506
|
|
|
3510
3507
|
// src/jsonSchemaForm/schemaFormControl/SchemaFormControl.tsx
|
|
3511
|
-
|
|
3508
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
3512
3509
|
var isNativeInput = (propsSchemaType) => {
|
|
3513
3510
|
return propsSchemaType === "string" || propsSchemaType === "number";
|
|
3514
3511
|
};
|
|
@@ -3586,7 +3583,7 @@ var SchemaFormControl = (props) => {
|
|
|
3586
3583
|
// TODO: LOW avoid type assertion below
|
|
3587
3584
|
uploadProps: mapSchemaToUploadOptions(props.schema)
|
|
3588
3585
|
};
|
|
3589
|
-
return /* @__PURE__ */
|
|
3586
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(FormControl, { type: controlType, value: safeValue, ...events, ...controlProps });
|
|
3590
3587
|
};
|
|
3591
3588
|
SchemaFormControl.defaultProps = {
|
|
3592
3589
|
value: null,
|
|
@@ -3657,17 +3654,17 @@ function getSchemaProperties(childSchema) {
|
|
|
3657
3654
|
}
|
|
3658
3655
|
|
|
3659
3656
|
// src/jsonSchemaForm/oneOfSchema/OneOfSchema.tsx
|
|
3660
|
-
|
|
3657
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
3661
3658
|
var OneOfSchema5 = (props) => {
|
|
3662
3659
|
const onEvent = useEventDispatcher();
|
|
3663
|
-
const [changed, setChanged] =
|
|
3664
|
-
const [focused, setFocused] =
|
|
3665
|
-
const [blurred, setBlurred] =
|
|
3666
|
-
const id =
|
|
3667
|
-
const [schemaIndex, setSchemaIndex] =
|
|
3660
|
+
const [changed, setChanged] = (0, import_react14.useState)(false);
|
|
3661
|
+
const [focused, setFocused] = (0, import_react14.useState)(false);
|
|
3662
|
+
const [blurred, setBlurred] = (0, import_react14.useState)(false);
|
|
3663
|
+
const id = (0, import_react14.useMemo)(() => props.schema.$id || generateRandomId(), [props.schema.$id]);
|
|
3664
|
+
const [schemaIndex, setSchemaIndex] = (0, import_react14.useState)(
|
|
3668
3665
|
getActiveSchemaIndex(props.schema, props.model)
|
|
3669
3666
|
);
|
|
3670
|
-
const [models, setModels] =
|
|
3667
|
+
const [models, setModels] = (0, import_react14.useState)(getModelPartsForSchemas(props.model, props.schema.oneOf));
|
|
3671
3668
|
const debouncedTrackEvent = useDebouncedFunction(onEvent, 200);
|
|
3672
3669
|
const onSearchChange = (searchValue) => {
|
|
3673
3670
|
debouncedTrackEvent("Dynamic Flow - OneOf Searched", {
|
|
@@ -3675,7 +3672,7 @@ var OneOfSchema5 = (props) => {
|
|
|
3675
3672
|
searchValueLength: searchValue.length
|
|
3676
3673
|
});
|
|
3677
3674
|
};
|
|
3678
|
-
|
|
3675
|
+
(0, import_react14.useEffect)(() => {
|
|
3679
3676
|
const modelIndex = getValidIndexFromValue(props.schema, props.model);
|
|
3680
3677
|
const defaultIndex = getValidIndexFromValue(props.schema, props.schema.default);
|
|
3681
3678
|
if (modelIndex === -1 && defaultIndex >= 0) {
|
|
@@ -3730,11 +3727,11 @@ var OneOfSchema5 = (props) => {
|
|
|
3730
3727
|
"form-group": true,
|
|
3731
3728
|
"has-error": !changed && props.errors && !isEmpty(props.errors) || (props.submitted || changed && blurred) && validations.length
|
|
3732
3729
|
};
|
|
3733
|
-
return /* @__PURE__ */
|
|
3734
|
-
(props.schema.oneOf.length > 1 || isConstSchema(props.schema.oneOf[0])) && /* @__PURE__ */
|
|
3735
|
-
/* @__PURE__ */
|
|
3730
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
|
|
3731
|
+
(props.schema.oneOf.length > 1 || isConstSchema(props.schema.oneOf[0])) && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
|
|
3732
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: (0, import_classnames4.default)(formGroupClasses), children: [
|
|
3736
3733
|
getTitleAndHelp(props.schema, id),
|
|
3737
|
-
/* @__PURE__ */
|
|
3734
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3738
3735
|
SchemaFormControl_default,
|
|
3739
3736
|
{
|
|
3740
3737
|
id,
|
|
@@ -3747,7 +3744,7 @@ var OneOfSchema5 = (props) => {
|
|
|
3747
3744
|
onSearchChange
|
|
3748
3745
|
}
|
|
3749
3746
|
),
|
|
3750
|
-
/* @__PURE__ */
|
|
3747
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3751
3748
|
ControlFeedback_default,
|
|
3752
3749
|
{
|
|
3753
3750
|
changed,
|
|
@@ -3761,9 +3758,9 @@ var OneOfSchema5 = (props) => {
|
|
|
3761
3758
|
}
|
|
3762
3759
|
)
|
|
3763
3760
|
] }),
|
|
3764
|
-
props.schema.alert && /* @__PURE__ */
|
|
3761
|
+
props.schema.alert && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DynamicAlert_default, { component: props.schema.alert })
|
|
3765
3762
|
] }),
|
|
3766
|
-
isNoNConstSchema(props.schema.oneOf[schemaIndex]) && /* @__PURE__ */
|
|
3763
|
+
isNoNConstSchema(props.schema.oneOf[schemaIndex]) && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3767
3764
|
GenericSchema_default,
|
|
3768
3765
|
{
|
|
3769
3766
|
schema: props.schema.oneOf[schemaIndex],
|
|
@@ -3779,12 +3776,12 @@ var OneOfSchema5 = (props) => {
|
|
|
3779
3776
|
] });
|
|
3780
3777
|
};
|
|
3781
3778
|
function getTitleAndHelp(schema2, id) {
|
|
3782
|
-
const helpElement = schema2.help ? /* @__PURE__ */
|
|
3783
|
-
const titleElement = isConstSchema(schema2.oneOf[0]) ? /* @__PURE__ */
|
|
3779
|
+
const helpElement = schema2.help ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Help_default, { help: schema2.help }) : null;
|
|
3780
|
+
const titleElement = isConstSchema(schema2.oneOf[0]) ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("label", { className: "control-label d-inline", htmlFor: id, children: [
|
|
3784
3781
|
schema2.title,
|
|
3785
3782
|
" ",
|
|
3786
3783
|
helpElement
|
|
3787
|
-
] }) : /* @__PURE__ */
|
|
3784
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("h4", { className: "m-b-2", children: [
|
|
3788
3785
|
schema2.title,
|
|
3789
3786
|
" ",
|
|
3790
3787
|
helpElement
|
|
@@ -3825,12 +3822,12 @@ var OneOfSchema_default = OneOfSchema5;
|
|
|
3825
3822
|
|
|
3826
3823
|
// src/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.tsx
|
|
3827
3824
|
var import_classnames5 = __toESM(require_classnames());
|
|
3828
|
-
|
|
3825
|
+
var import_react16 = require("react");
|
|
3829
3826
|
|
|
3830
3827
|
// src/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.tsx
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3828
|
+
var import_components10 = require("@transferwise/components");
|
|
3829
|
+
var import_react15 = require("react");
|
|
3830
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
3834
3831
|
var UploadInputAdapter = (props) => {
|
|
3835
3832
|
const {
|
|
3836
3833
|
id,
|
|
@@ -3846,7 +3843,7 @@ var UploadInputAdapter = (props) => {
|
|
|
3846
3843
|
onCancel
|
|
3847
3844
|
} = props;
|
|
3848
3845
|
const onEvent = useEventDispatcher();
|
|
3849
|
-
const files =
|
|
3846
|
+
const files = (0, import_react15.useMemo)(() => fileId ? [{ id: fileId, status: import_components10.Status.SUCCEEDED }] : [], [fileId]);
|
|
3850
3847
|
const uploadFile = (formData) => {
|
|
3851
3848
|
onEvent("Dynamic Flow - PersistAsync", { status: "pending", schemaId: id });
|
|
3852
3849
|
return fetcher(`${httpOptions.url}`, {
|
|
@@ -3864,8 +3861,8 @@ var UploadInputAdapter = (props) => {
|
|
|
3864
3861
|
}
|
|
3865
3862
|
});
|
|
3866
3863
|
};
|
|
3867
|
-
return /* @__PURE__ */
|
|
3868
|
-
|
|
3864
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3865
|
+
import_components10.UploadInput,
|
|
3869
3866
|
{
|
|
3870
3867
|
id,
|
|
3871
3868
|
fileInputName: httpOptions.fileInputName,
|
|
@@ -3884,12 +3881,12 @@ var UploadInputAdapter = (props) => {
|
|
|
3884
3881
|
};
|
|
3885
3882
|
|
|
3886
3883
|
// src/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.tsx
|
|
3887
|
-
|
|
3884
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
3888
3885
|
var PersistAsyncBlobSchema = (props) => {
|
|
3889
|
-
const [persistAsyncValidationMessages, setPersistAsyncValidationMessages] =
|
|
3890
|
-
const [persistAsyncValidations, setPersistAsyncValidations] =
|
|
3891
|
-
const [validations, setValidations] =
|
|
3892
|
-
const [changed, setChanged] =
|
|
3886
|
+
const [persistAsyncValidationMessages, setPersistAsyncValidationMessages] = (0, import_react16.useState)({});
|
|
3887
|
+
const [persistAsyncValidations, setPersistAsyncValidations] = (0, import_react16.useState)(null);
|
|
3888
|
+
const [validations, setValidations] = (0, import_react16.useState)([]);
|
|
3889
|
+
const [changed, setChanged] = (0, import_react16.useState)(false);
|
|
3893
3890
|
const fetcher = useFetcher();
|
|
3894
3891
|
const onEvent = useEventDispatcher();
|
|
3895
3892
|
const refreshValidations = () => {
|
|
@@ -3897,7 +3894,7 @@ var PersistAsyncBlobSchema = (props) => {
|
|
|
3897
3894
|
setValidations(getValidationFailures(props.model, props.schema, !!props.required));
|
|
3898
3895
|
}
|
|
3899
3896
|
};
|
|
3900
|
-
|
|
3897
|
+
(0, import_react16.useEffect)(refreshValidations, [props.model, props.submitted]);
|
|
3901
3898
|
const onSuccess = async (httpResponse, _fileName) => {
|
|
3902
3899
|
const jsonResponse = await httpResponse.json();
|
|
3903
3900
|
const id = getIdFromResponse(props.schema.persistAsync.idProperty, jsonResponse);
|
|
@@ -3926,8 +3923,8 @@ var PersistAsyncBlobSchema = (props) => {
|
|
|
3926
3923
|
"form-group": true,
|
|
3927
3924
|
"has-error": (props.submitted || changed) && !!combinedValidations.length
|
|
3928
3925
|
};
|
|
3929
|
-
return /* @__PURE__ */
|
|
3930
|
-
/* @__PURE__ */
|
|
3926
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: (0, import_classnames5.default)(formGroupClasses), children: [
|
|
3927
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3931
3928
|
UploadInputAdapter,
|
|
3932
3929
|
{
|
|
3933
3930
|
id: props.schema.$id || props.schema.persistAsync.schema.$id || props.schema.persistAsync.idProperty,
|
|
@@ -3945,7 +3942,7 @@ var PersistAsyncBlobSchema = (props) => {
|
|
|
3945
3942
|
...mapSchemaToUploadOptions(props.schema.persistAsync.schema)
|
|
3946
3943
|
}
|
|
3947
3944
|
),
|
|
3948
|
-
/* @__PURE__ */
|
|
3945
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3949
3946
|
ControlFeedback_default,
|
|
3950
3947
|
{
|
|
3951
3948
|
blurred: true,
|
|
@@ -3970,19 +3967,19 @@ PersistAsyncBlobSchema.defaultProps = {
|
|
|
3970
3967
|
var PersistAsyncBlobSchema_default = PersistAsyncBlobSchema;
|
|
3971
3968
|
|
|
3972
3969
|
// src/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.tsx
|
|
3973
|
-
|
|
3970
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
3974
3971
|
var PersistAsyncSchema = (props) => {
|
|
3975
3972
|
const { schema: schema2 } = props;
|
|
3976
3973
|
const persistAsyncSchemaType = schema2.persistAsync.schema.type;
|
|
3977
3974
|
if (persistAsyncSchemaType === "blob") {
|
|
3978
|
-
return /* @__PURE__ */
|
|
3975
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3979
3976
|
PersistAsyncBlobSchema_default,
|
|
3980
3977
|
{
|
|
3981
3978
|
...props
|
|
3982
3979
|
}
|
|
3983
3980
|
);
|
|
3984
3981
|
}
|
|
3985
|
-
return /* @__PURE__ */
|
|
3982
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(PersistAsyncBasicSchema_default, { ...props });
|
|
3986
3983
|
};
|
|
3987
3984
|
PersistAsyncSchema.defaultProps = {
|
|
3988
3985
|
required: false
|
|
@@ -3990,7 +3987,7 @@ PersistAsyncSchema.defaultProps = {
|
|
|
3990
3987
|
var PersistAsyncSchema_default = PersistAsyncSchema;
|
|
3991
3988
|
|
|
3992
3989
|
// src/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.tsx
|
|
3993
|
-
|
|
3990
|
+
var import_react17 = require("react");
|
|
3994
3991
|
|
|
3995
3992
|
// src/jsonSchemaForm/promotedOneOfSchema/promoted-one-of-utils.ts
|
|
3996
3993
|
var getSelectionFromModel = (schema2, model) => {
|
|
@@ -4002,8 +3999,8 @@ var getSelectionFromModel = (schema2, model) => {
|
|
|
4002
3999
|
};
|
|
4003
4000
|
|
|
4004
4001
|
// src/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.tsx
|
|
4005
|
-
|
|
4006
|
-
|
|
4002
|
+
var import_components11 = require("@transferwise/components");
|
|
4003
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
4007
4004
|
var PromotedOneOfCheckboxControl = (props) => {
|
|
4008
4005
|
const { id, selection, setSelection } = props;
|
|
4009
4006
|
const { promoted, other, checkedMeans } = props.promotion;
|
|
@@ -4014,14 +4011,14 @@ var PromotedOneOfCheckboxControl = (props) => {
|
|
|
4014
4011
|
const toggleSelection = () => {
|
|
4015
4012
|
setSelection(checked ? selectionWhenUnchecked : selectionWhenChecked);
|
|
4016
4013
|
};
|
|
4017
|
-
return /* @__PURE__ */
|
|
4014
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "form-group", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_components11.Checkbox, { id, label: title, checked, onChange: toggleSelection }) });
|
|
4018
4015
|
};
|
|
4019
4016
|
PromotedOneOfCheckboxControl.defaultProps = {};
|
|
4020
4017
|
var PromotedOneOfCheckboxControl_default = PromotedOneOfCheckboxControl;
|
|
4021
4018
|
|
|
4022
4019
|
// src/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.tsx
|
|
4023
|
-
|
|
4024
|
-
|
|
4020
|
+
var import_components12 = require("@transferwise/components");
|
|
4021
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
4025
4022
|
var PromotedOneOfRadioControl = (props) => {
|
|
4026
4023
|
const { id, selection, setSelection, promotion, promotedOneOf, title } = props;
|
|
4027
4024
|
const radios = [
|
|
@@ -4041,10 +4038,10 @@ var PromotedOneOfRadioControl = (props) => {
|
|
|
4041
4038
|
...mapAvatar(promotion.other.image)
|
|
4042
4039
|
}
|
|
4043
4040
|
];
|
|
4044
|
-
return /* @__PURE__ */
|
|
4045
|
-
title && /* @__PURE__ */
|
|
4046
|
-
/* @__PURE__ */
|
|
4047
|
-
|
|
4041
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "form-group", children: [
|
|
4042
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("label", { className: "control-label", htmlFor: id, children: title }),
|
|
4043
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4044
|
+
import_components12.RadioGroup,
|
|
4048
4045
|
{
|
|
4049
4046
|
name: "promoted-selection",
|
|
4050
4047
|
selectedValue: selection,
|
|
@@ -4061,16 +4058,16 @@ PromotedOneOfRadioControl.defaultProps = {
|
|
|
4061
4058
|
var PromotedOneOfRadioControl_default = PromotedOneOfRadioControl;
|
|
4062
4059
|
|
|
4063
4060
|
// src/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.tsx
|
|
4064
|
-
|
|
4061
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
4065
4062
|
var PromotedOneOfControl = (props) => {
|
|
4066
4063
|
const controlType = props.promotion.control || "radio";
|
|
4067
4064
|
switch (controlType) {
|
|
4068
4065
|
case "radio":
|
|
4069
|
-
return /* @__PURE__ */
|
|
4066
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(PromotedOneOfRadioControl_default, { ...props });
|
|
4070
4067
|
case "checkbox":
|
|
4071
|
-
return /* @__PURE__ */
|
|
4068
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(PromotedOneOfCheckboxControl_default, { ...props });
|
|
4072
4069
|
default:
|
|
4073
|
-
return /* @__PURE__ */
|
|
4070
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_jsx_runtime29.Fragment, {});
|
|
4074
4071
|
}
|
|
4075
4072
|
};
|
|
4076
4073
|
PromotedOneOfControl.defaultProps = {
|
|
@@ -4080,19 +4077,19 @@ PromotedOneOfControl.defaultProps = {
|
|
|
4080
4077
|
var PromotedOneOfControl_default = PromotedOneOfControl;
|
|
4081
4078
|
|
|
4082
4079
|
// src/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.tsx
|
|
4083
|
-
|
|
4080
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
4084
4081
|
var isPromoted = (schema2) => schema2.promoted === true;
|
|
4085
4082
|
var PromotedOneOfSchema = (props) => {
|
|
4086
|
-
const [selection, setSelection] =
|
|
4083
|
+
const [selection, setSelection] = (0, import_react17.useState)(
|
|
4087
4084
|
getSelectionFromModel(props.schema, props.model) || props.schema.promotion?.default || "promoted"
|
|
4088
4085
|
);
|
|
4089
4086
|
const promotedAlert = props.schema.alert;
|
|
4090
4087
|
const promotedOneOf = props.schema.oneOf.find(isPromoted);
|
|
4091
4088
|
const promotedObjectSchema = getPromotedObjectSchema(promotedOneOf);
|
|
4092
4089
|
const otherOneOf = getOtherOneOf(props.schema);
|
|
4093
|
-
return /* @__PURE__ */
|
|
4094
|
-
promotedAlert && /* @__PURE__ */
|
|
4095
|
-
/* @__PURE__ */
|
|
4090
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
|
|
4091
|
+
promotedAlert && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DynamicAlert_default, { component: promotedAlert }),
|
|
4092
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4096
4093
|
PromotedOneOfControl_default,
|
|
4097
4094
|
{
|
|
4098
4095
|
id: props.schema.$id,
|
|
@@ -4103,8 +4100,8 @@ var PromotedOneOfSchema = (props) => {
|
|
|
4103
4100
|
setSelection
|
|
4104
4101
|
}
|
|
4105
4102
|
),
|
|
4106
|
-
selection === "promoted" && /* @__PURE__ */
|
|
4107
|
-
selection === "other" && /* @__PURE__ */
|
|
4103
|
+
selection === "promoted" && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ObjectSchema_default, { ...props, schema: promotedObjectSchema }),
|
|
4104
|
+
selection === "other" && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(GenericSchema_default, { ...props, schema: otherOneOf })
|
|
4108
4105
|
] });
|
|
4109
4106
|
};
|
|
4110
4107
|
function getPromotedObjectSchema(promotedSchema) {
|
|
@@ -4134,12 +4131,12 @@ function getOtherOneOf(schema2) {
|
|
|
4134
4131
|
var PromotedOneOfSchema_default = PromotedOneOfSchema;
|
|
4135
4132
|
|
|
4136
4133
|
// src/jsonSchemaForm/readOnlySchema/ReadOnlySchema.tsx
|
|
4137
|
-
|
|
4138
|
-
|
|
4134
|
+
var import_components13 = require("@transferwise/components");
|
|
4135
|
+
var import_react_intl12 = require("react-intl");
|
|
4139
4136
|
|
|
4140
4137
|
// src/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.js
|
|
4141
|
-
|
|
4142
|
-
var ReadOnlySchema_messages_default =
|
|
4138
|
+
var import_react_intl11 = require("react-intl");
|
|
4139
|
+
var ReadOnlySchema_messages_default = (0, import_react_intl11.defineMessages)({
|
|
4143
4140
|
yes: {
|
|
4144
4141
|
id: "dynamicFlows.ReadOnlySchema.yes",
|
|
4145
4142
|
defaultMessage: "Yes",
|
|
@@ -4153,12 +4150,12 @@ var ReadOnlySchema_messages_default = defineMessages7({
|
|
|
4153
4150
|
});
|
|
4154
4151
|
|
|
4155
4152
|
// src/jsonSchemaForm/readOnlySchema/ReadOnlySchema.tsx
|
|
4156
|
-
|
|
4153
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
4157
4154
|
var ReadOnlySchema = ({ schema: schema2, model }) => {
|
|
4158
4155
|
const { title = "" } = schema2;
|
|
4159
|
-
const { formatMessage } =
|
|
4156
|
+
const { formatMessage } = (0, import_react_intl12.useIntl)();
|
|
4160
4157
|
const value = getValueForSchema({ schema: schema2, model, formatMessage });
|
|
4161
|
-
return /* @__PURE__ */
|
|
4158
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_components13.DefinitionList, { layout: import_components13.Layout.VERTICAL_ONE_COLUMN, definitions: [{ title, value, key: "" }] });
|
|
4162
4159
|
};
|
|
4163
4160
|
var ReadOnlySchema_default = ReadOnlySchema;
|
|
4164
4161
|
function getValueForSchema({
|
|
@@ -4191,7 +4188,7 @@ function getSelectedOneOf(schema2, model) {
|
|
|
4191
4188
|
function getValueFromOption(option) {
|
|
4192
4189
|
const text = option.title && option.description ? `${option.title} - ${option.description}` : option.title || "";
|
|
4193
4190
|
const currencyFlag = getCurrencyFlagFromOption(option);
|
|
4194
|
-
return currencyFlag ? /* @__PURE__ */
|
|
4191
|
+
return currencyFlag ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
|
4195
4192
|
currencyFlag,
|
|
4196
4193
|
" ",
|
|
4197
4194
|
text
|
|
@@ -4199,21 +4196,21 @@ function getValueFromOption(option) {
|
|
|
4199
4196
|
}
|
|
4200
4197
|
function getCurrencyFlagFromOption(option) {
|
|
4201
4198
|
const currency = getCurrencyFlag(option.icon?.name)?.currency;
|
|
4202
|
-
return currency ? /* @__PURE__ */
|
|
4199
|
+
return currency ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("i", { className: `currency-flag currency-flag-${currency} hidden-xs` }) : null;
|
|
4203
4200
|
}
|
|
4204
4201
|
|
|
4205
4202
|
// src/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.tsx
|
|
4206
|
-
|
|
4207
|
-
|
|
4203
|
+
var import_react18 = require("react");
|
|
4204
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
4208
4205
|
var ValidationAsyncSchema = (props) => {
|
|
4209
|
-
const [validationAsyncModel, setValidationAsyncModel] =
|
|
4210
|
-
const previousRequestedModelReference = useRef(null);
|
|
4211
|
-
const [validationAsyncSuccessMessage, setValidationAsyncSuccessMessage] =
|
|
4206
|
+
const [validationAsyncModel, setValidationAsyncModel] = (0, import_react18.useState)(props.model);
|
|
4207
|
+
const previousRequestedModelReference = (0, import_react18.useRef)(null);
|
|
4208
|
+
const [validationAsyncSuccessMessage, setValidationAsyncSuccessMessage] = (0, import_react18.useState)(
|
|
4212
4209
|
null
|
|
4213
4210
|
);
|
|
4214
|
-
const [validationAsyncErrors, setValidationAsyncErrors] =
|
|
4215
|
-
const [fieldSubmitted, setFieldSubmitted] =
|
|
4216
|
-
const [abortController, setAbortController] =
|
|
4211
|
+
const [validationAsyncErrors, setValidationAsyncErrors] = (0, import_react18.useState)(null);
|
|
4212
|
+
const [fieldSubmitted, setFieldSubmitted] = (0, import_react18.useState)(false);
|
|
4213
|
+
const [abortController, setAbortController] = (0, import_react18.useState)(null);
|
|
4217
4214
|
const fetcher = useFetcher();
|
|
4218
4215
|
const onEvent = useEventDispatcher();
|
|
4219
4216
|
const logger = useLogger();
|
|
@@ -4288,13 +4285,13 @@ var ValidationAsyncSchema = (props) => {
|
|
|
4288
4285
|
onBlur,
|
|
4289
4286
|
infoMessage: validationAsyncSuccessMessage
|
|
4290
4287
|
};
|
|
4291
|
-
return /* @__PURE__ */
|
|
4288
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(BasicTypeSchema_default, { ...basicTypeSchemaProps });
|
|
4292
4289
|
};
|
|
4293
4290
|
ValidationAsyncSchema.defaultProps = { required: false };
|
|
4294
4291
|
var ValidationAsyncSchema_default = ValidationAsyncSchema;
|
|
4295
4292
|
|
|
4296
4293
|
// src/jsonSchemaForm/genericSchema/GenericSchema.tsx
|
|
4297
|
-
|
|
4294
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
4298
4295
|
var GenericSchemaForm = (props) => {
|
|
4299
4296
|
const { schema: schema2, model = null, errors = null, hideTitle = false, disabled = false } = props;
|
|
4300
4297
|
const schemaProps = { ...props, model, errors, hideTitle, disabled };
|
|
@@ -4306,22 +4303,22 @@ var GenericSchemaForm = (props) => {
|
|
|
4306
4303
|
);
|
|
4307
4304
|
switch (type) {
|
|
4308
4305
|
case "readOnly":
|
|
4309
|
-
return /* @__PURE__ */
|
|
4306
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ReadOnlySchema_default, { ...schemaProps });
|
|
4310
4307
|
case "persistAsync":
|
|
4311
4308
|
if (isPersistAsyncSchema(schema2) && isNullableStringModel(model) && isBasicError(errors)) {
|
|
4312
4309
|
const filteredProps = { ...schemaProps, schema: schema2, model, errors };
|
|
4313
|
-
return /* @__PURE__ */
|
|
4310
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(PersistAsyncSchema_default, { ...filteredProps });
|
|
4314
4311
|
} else {
|
|
4315
4312
|
logInvalidSchemaWarning();
|
|
4316
|
-
return /* @__PURE__ */
|
|
4313
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(PersistAsyncSchema_default, { ...props });
|
|
4317
4314
|
}
|
|
4318
4315
|
case "validationAsync":
|
|
4319
4316
|
if (isValidationAsyncSchema(schema2) && isNullableBasicModel(model) && isBasicError(errors)) {
|
|
4320
4317
|
const filteredProps = { ...schemaProps, schema: schema2, model, errors };
|
|
4321
|
-
return /* @__PURE__ */
|
|
4318
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ValidationAsyncSchema_default, { ...filteredProps });
|
|
4322
4319
|
} else {
|
|
4323
4320
|
logInvalidSchemaWarning();
|
|
4324
|
-
return /* @__PURE__ */
|
|
4321
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ValidationAsyncSchema_default, { ...props });
|
|
4325
4322
|
}
|
|
4326
4323
|
case "basic": {
|
|
4327
4324
|
if (isBasicSchema(schema2) && isNullableBasicModel(model) && isBasicError(errors)) {
|
|
@@ -4332,7 +4329,7 @@ var GenericSchemaForm = (props) => {
|
|
|
4332
4329
|
model,
|
|
4333
4330
|
errors
|
|
4334
4331
|
};
|
|
4335
|
-
return /* @__PURE__ */
|
|
4332
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(BasicTypeSchema_default, { ...filteredProps });
|
|
4336
4333
|
} else {
|
|
4337
4334
|
const filteredProps = {
|
|
4338
4335
|
infoMessage: null,
|
|
@@ -4342,56 +4339,56 @@ var GenericSchemaForm = (props) => {
|
|
|
4342
4339
|
errors
|
|
4343
4340
|
};
|
|
4344
4341
|
logInvalidSchemaWarning();
|
|
4345
|
-
return /* @__PURE__ */
|
|
4342
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(BasicTypeSchema_default, { ...filteredProps });
|
|
4346
4343
|
}
|
|
4347
4344
|
}
|
|
4348
4345
|
case "object":
|
|
4349
4346
|
if (isObjectSchema(schema2) && isNullableObjectModel(model)) {
|
|
4350
4347
|
const filteredProps = { ...schemaProps, schema: schema2, model, errors };
|
|
4351
|
-
return /* @__PURE__ */
|
|
4348
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ObjectSchema_default, { ...filteredProps }, JSON.stringify(schema2));
|
|
4352
4349
|
} else {
|
|
4353
4350
|
logInvalidSchemaWarning();
|
|
4354
|
-
return /* @__PURE__ */
|
|
4351
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ObjectSchema_default, { ...props });
|
|
4355
4352
|
}
|
|
4356
4353
|
case "array":
|
|
4357
4354
|
if (isArraySchema(schema2) && isNullableArrayModel(model) && isBasicError(errors)) {
|
|
4358
4355
|
const filteredProps = { ...schemaProps, schema: schema2, model, errors };
|
|
4359
|
-
return /* @__PURE__ */
|
|
4356
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ArraySchema_default, { ...filteredProps });
|
|
4360
4357
|
} else {
|
|
4361
4358
|
logInvalidSchemaWarning();
|
|
4362
|
-
return /* @__PURE__ */
|
|
4359
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ArraySchema_default, { ...props });
|
|
4363
4360
|
}
|
|
4364
4361
|
case "promotedOneOf":
|
|
4365
4362
|
if (isOneOfObjectSchema(schema2) && isNullableObjectModel(model)) {
|
|
4366
4363
|
const filteredProps = { ...schemaProps, schema: schema2, model, errors };
|
|
4367
|
-
return /* @__PURE__ */
|
|
4364
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(PromotedOneOfSchema_default, { ...filteredProps });
|
|
4368
4365
|
} else {
|
|
4369
4366
|
logInvalidSchemaWarning();
|
|
4370
|
-
return /* @__PURE__ */
|
|
4367
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(PromotedOneOfSchema_default, { ...props });
|
|
4371
4368
|
}
|
|
4372
4369
|
case "oneOf":
|
|
4373
4370
|
if (isOneOfSchema(schema2)) {
|
|
4374
4371
|
const filteredProps = { ...schemaProps, schema: schema2, model, errors };
|
|
4375
|
-
return /* @__PURE__ */
|
|
4372
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(OneOfSchema_default, { ...filteredProps });
|
|
4376
4373
|
} else {
|
|
4377
4374
|
logInvalidSchemaWarning();
|
|
4378
|
-
return /* @__PURE__ */
|
|
4375
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(OneOfSchema_default, { ...props });
|
|
4379
4376
|
}
|
|
4380
4377
|
case "allOf":
|
|
4381
4378
|
if (isAllOfSchema(schema2) && isObjectModel(model)) {
|
|
4382
4379
|
const filteredProps = { ...schemaProps, schema: schema2, model, errors };
|
|
4383
|
-
return /* @__PURE__ */
|
|
4380
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(AllOfSchema_default, { ...filteredProps });
|
|
4384
4381
|
} else {
|
|
4385
4382
|
logInvalidSchemaWarning();
|
|
4386
|
-
return /* @__PURE__ */
|
|
4383
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(AllOfSchema_default, { ...props });
|
|
4387
4384
|
}
|
|
4388
4385
|
}
|
|
4389
|
-
return /* @__PURE__ */
|
|
4386
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_jsx_runtime33.Fragment, {});
|
|
4390
4387
|
};
|
|
4391
4388
|
var GenericSchema_default = GenericSchemaForm;
|
|
4392
4389
|
|
|
4393
4390
|
// src/jsonSchemaForm/JsonSchemaForm.tsx
|
|
4394
|
-
|
|
4391
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
4395
4392
|
var JsonSchemaForm = (props) => {
|
|
4396
4393
|
const schemaProps = {
|
|
4397
4394
|
model: null,
|
|
@@ -4401,26 +4398,26 @@ var JsonSchemaForm = (props) => {
|
|
|
4401
4398
|
...props
|
|
4402
4399
|
};
|
|
4403
4400
|
if (useHasFetcherProvider() || schemaProps.baseUrl == null) {
|
|
4404
|
-
return /* @__PURE__ */
|
|
4401
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GenericSchema_default, { ...schemaProps });
|
|
4405
4402
|
}
|
|
4406
|
-
return /* @__PURE__ */
|
|
4403
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4407
4404
|
Providers,
|
|
4408
4405
|
{
|
|
4409
4406
|
baseUrl: schemaProps.baseUrl,
|
|
4410
4407
|
onEvent: schemaProps.onEvent,
|
|
4411
4408
|
onLog: schemaProps.onLog,
|
|
4412
|
-
children: /* @__PURE__ */
|
|
4409
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GenericSchema_default, { ...schemaProps })
|
|
4413
4410
|
}
|
|
4414
4411
|
);
|
|
4415
4412
|
};
|
|
4416
4413
|
var JsonSchemaForm_default = JsonSchemaForm;
|
|
4417
4414
|
var Providers = ({ baseUrl, onEvent, onLog, children }) => {
|
|
4418
|
-
return /* @__PURE__ */
|
|
4415
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(LogProvider, { flowId: "JsonSchemaForm", stepId: "JsonSchemaForm", onLog: onLog ?? noop2, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4419
4416
|
EventsContextProvider,
|
|
4420
4417
|
{
|
|
4421
4418
|
metadata: { flowId: "JsonSchemaForm", stepId: "JsonSchemaForm" },
|
|
4422
4419
|
onEvent: onEvent ?? noop2,
|
|
4423
|
-
children: /* @__PURE__ */
|
|
4420
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(FetcherProviderFromBaseUrl, { baseUrl, children })
|
|
4424
4421
|
}
|
|
4425
4422
|
) });
|
|
4426
4423
|
};
|
|
@@ -4428,11 +4425,11 @@ var noop2 = () => {
|
|
|
4428
4425
|
};
|
|
4429
4426
|
|
|
4430
4427
|
// src/layout/form/DynamicForm.tsx
|
|
4431
|
-
|
|
4428
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
4432
4429
|
var DynamicForm = (props) => {
|
|
4433
4430
|
const form = props.component;
|
|
4434
4431
|
const formSchema = form.schema;
|
|
4435
|
-
return /* @__PURE__ */
|
|
4432
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: getMarginBottom(form.margin || "md"), children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4436
4433
|
JsonSchemaForm_default,
|
|
4437
4434
|
{
|
|
4438
4435
|
schema: formSchema,
|
|
@@ -4449,43 +4446,43 @@ var DynamicForm = (props) => {
|
|
|
4449
4446
|
var DynamicForm_default = DynamicForm;
|
|
4450
4447
|
|
|
4451
4448
|
// src/layout/heading/DynamicHeading.tsx
|
|
4452
|
-
|
|
4449
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
4453
4450
|
var DynamicHeading = (props) => {
|
|
4454
4451
|
const { text, size = "md", align = "left", margin = "md" } = props.component;
|
|
4455
4452
|
const classes = getTextAlignmentAndMargin({ align, margin });
|
|
4456
4453
|
switch (size) {
|
|
4457
4454
|
case "xs":
|
|
4458
|
-
return /* @__PURE__ */
|
|
4455
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("h5", { className: classes, children: text });
|
|
4459
4456
|
case "sm":
|
|
4460
|
-
return /* @__PURE__ */
|
|
4457
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("h4", { className: classes, children: text });
|
|
4461
4458
|
case "lg":
|
|
4462
|
-
return /* @__PURE__ */
|
|
4459
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("h2", { className: classes, children: text });
|
|
4463
4460
|
case "xl":
|
|
4464
|
-
return /* @__PURE__ */
|
|
4461
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("h1", { className: classes, children: text });
|
|
4465
4462
|
case "md":
|
|
4466
4463
|
default:
|
|
4467
|
-
return /* @__PURE__ */
|
|
4464
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("h3", { className: classes, children: text });
|
|
4468
4465
|
}
|
|
4469
4466
|
};
|
|
4470
4467
|
var DynamicHeading_default = DynamicHeading;
|
|
4471
4468
|
|
|
4472
4469
|
// src/layout/info/DynamicInfo.tsx
|
|
4473
|
-
|
|
4474
|
-
|
|
4470
|
+
var import_components14 = require("@transferwise/components");
|
|
4471
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
4475
4472
|
var DynamicInfo = ({ component }) => {
|
|
4476
|
-
return /* @__PURE__ */
|
|
4473
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: getTextAlignmentAndMargin(component), children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_components14.Markdown, { config: { link: { target: "_blank" } }, children: component.markdown }) });
|
|
4477
4474
|
};
|
|
4478
4475
|
var DynamicInfo_default = DynamicInfo;
|
|
4479
4476
|
|
|
4480
4477
|
// src/layout/image/DynamicImage.tsx
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4478
|
+
var import_components15 = require("@transferwise/components");
|
|
4479
|
+
var import_react19 = require("react");
|
|
4480
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
4484
4481
|
var DynamicImage = ({ component: image }) => {
|
|
4485
4482
|
const { url, size, text, margin } = image;
|
|
4486
4483
|
const fetcher = useFetcher();
|
|
4487
|
-
const [imageSource, setImageSource] =
|
|
4488
|
-
|
|
4484
|
+
const [imageSource, setImageSource] = (0, import_react19.useState)("");
|
|
4485
|
+
(0, import_react19.useEffect)(() => {
|
|
4489
4486
|
void getImageSource(fetcher, url).then(setImageSource);
|
|
4490
4487
|
}, [url, fetcher]);
|
|
4491
4488
|
const imageProps = {
|
|
@@ -4497,7 +4494,7 @@ var DynamicImage = ({ component: image }) => {
|
|
|
4497
4494
|
if (!imageSource) {
|
|
4498
4495
|
return null;
|
|
4499
4496
|
}
|
|
4500
|
-
return /* @__PURE__ */
|
|
4497
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: `df-image ${size || "xl"}`, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_components15.Image, { className: `img-responsive ${getMarginBottom(margin || "lg")}`, ...imageProps }) });
|
|
4501
4498
|
};
|
|
4502
4499
|
var readImageBlobAsDataURL = (imageBlob) => {
|
|
4503
4500
|
return new Promise((resolve, reject) => {
|
|
@@ -4529,28 +4526,28 @@ var getImageSource = async (fetcher, imageUrl) => {
|
|
|
4529
4526
|
var DynamicImage_default = DynamicImage;
|
|
4530
4527
|
|
|
4531
4528
|
// src/layout/DynamicLayout.tsx
|
|
4532
|
-
|
|
4529
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
4533
4530
|
var getKey = (component) => JSON.stringify(component);
|
|
4534
4531
|
var DynamicLayout = (props) => {
|
|
4535
4532
|
const { components, model, submitted, errors, onModelChange, onAction, onPersistAsync, baseUrl } = props;
|
|
4536
4533
|
const renderComponent = (component) => {
|
|
4537
4534
|
switch (component.type) {
|
|
4538
4535
|
case "heading":
|
|
4539
|
-
return /* @__PURE__ */
|
|
4536
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DynamicHeading_default, { component }, getKey(component));
|
|
4540
4537
|
case "paragraph":
|
|
4541
|
-
return /* @__PURE__ */
|
|
4538
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DynamicParagraph_default, { component }, getKey(component));
|
|
4542
4539
|
case "image":
|
|
4543
|
-
return /* @__PURE__ */
|
|
4540
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DynamicImage_default, { component }, getKey(component));
|
|
4544
4541
|
case "alert":
|
|
4545
|
-
return /* @__PURE__ */
|
|
4542
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DynamicAlert_default, { component }, getKey(component));
|
|
4546
4543
|
case "review":
|
|
4547
|
-
return /* @__PURE__ */
|
|
4544
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DynamicReview_default, { component, onAction }, getKey(component));
|
|
4548
4545
|
case "divider":
|
|
4549
|
-
return /* @__PURE__ */
|
|
4546
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DynamicDivider_default, { component }, getKey(component));
|
|
4550
4547
|
case "info":
|
|
4551
|
-
return /* @__PURE__ */
|
|
4548
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DynamicInfo_default, { component }, getKey(component));
|
|
4552
4549
|
case "columns":
|
|
4553
|
-
return /* @__PURE__ */
|
|
4550
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
4554
4551
|
DynamicColumns_default,
|
|
4555
4552
|
{
|
|
4556
4553
|
component,
|
|
@@ -4564,7 +4561,7 @@ var DynamicLayout = (props) => {
|
|
|
4564
4561
|
getKey(component)
|
|
4565
4562
|
);
|
|
4566
4563
|
case "form":
|
|
4567
|
-
return /* @__PURE__ */
|
|
4564
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
4568
4565
|
DynamicForm_default,
|
|
4569
4566
|
{
|
|
4570
4567
|
component,
|
|
@@ -4577,9 +4574,9 @@ var DynamicLayout = (props) => {
|
|
|
4577
4574
|
getKey(component)
|
|
4578
4575
|
);
|
|
4579
4576
|
case "button":
|
|
4580
|
-
return /* @__PURE__ */
|
|
4577
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DynamicButton_default, { component, onAction }, getKey(component));
|
|
4581
4578
|
case "box":
|
|
4582
|
-
return /* @__PURE__ */
|
|
4579
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
4583
4580
|
DynamicBox_default,
|
|
4584
4581
|
{
|
|
4585
4582
|
component,
|
|
@@ -4593,31 +4590,31 @@ var DynamicLayout = (props) => {
|
|
|
4593
4590
|
getKey(component)
|
|
4594
4591
|
);
|
|
4595
4592
|
case "decision":
|
|
4596
|
-
return /* @__PURE__ */
|
|
4593
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DynamicDecision_default, { component, onAction }, getKey(component));
|
|
4597
4594
|
case "external":
|
|
4598
|
-
return /* @__PURE__ */
|
|
4595
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DynamicExternal_default, { component, onAction }, getKey(component));
|
|
4599
4596
|
case "list":
|
|
4600
|
-
return /* @__PURE__ */
|
|
4597
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DynamicList_default, { component, onAction }, getKey(component));
|
|
4601
4598
|
case "loading-indicator":
|
|
4602
|
-
return /* @__PURE__ */
|
|
4599
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DynamicLoadingIndicator_default, { component }, getKey(component));
|
|
4603
4600
|
default:
|
|
4604
|
-
return /* @__PURE__ */
|
|
4601
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", {}, getKey(component));
|
|
4605
4602
|
}
|
|
4606
4603
|
};
|
|
4607
4604
|
if (useHasFetcherProvider() || baseUrl == null) {
|
|
4608
|
-
return /* @__PURE__ */
|
|
4605
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_jsx_runtime39.Fragment, { children: components.map(renderComponent) });
|
|
4609
4606
|
} else {
|
|
4610
|
-
return /* @__PURE__ */
|
|
4607
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(FetcherProviderFromBaseUrl, { baseUrl, children: components.map(renderComponent) });
|
|
4611
4608
|
}
|
|
4612
4609
|
};
|
|
4613
4610
|
var DynamicLayout_default = DynamicLayout;
|
|
4614
4611
|
|
|
4615
4612
|
// src/layout/list/DynamicList.tsx
|
|
4616
|
-
|
|
4617
|
-
|
|
4613
|
+
var import_components16 = require("@transferwise/components");
|
|
4614
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
4618
4615
|
var DynamicList = ({ component }) => {
|
|
4619
|
-
return /* @__PURE__ */
|
|
4620
|
-
component.title ? /* @__PURE__ */
|
|
4616
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: getMarginBottom(component.margin || "md"), children: [
|
|
4617
|
+
component.title ? /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("h4", { className: "m-b-2", children: [
|
|
4621
4618
|
" ",
|
|
4622
4619
|
component.title,
|
|
4623
4620
|
" "
|
|
@@ -4630,10 +4627,10 @@ function mapItemToSummary({ title, description, icon, status }) {
|
|
|
4630
4627
|
key: `${title}/${description || ""}`,
|
|
4631
4628
|
title,
|
|
4632
4629
|
description,
|
|
4633
|
-
...icon?.name ? { icon: /* @__PURE__ */
|
|
4630
|
+
...icon?.name ? { icon: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(DynamicIcon_default, { type: icon.name }) } : {},
|
|
4634
4631
|
...status ? { status: statusMap[status] } : {}
|
|
4635
4632
|
};
|
|
4636
|
-
return /* @__PURE__ */
|
|
4633
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_components16.Summary, { ...props });
|
|
4637
4634
|
}
|
|
4638
4635
|
var statusMap = {
|
|
4639
4636
|
positive: "done",
|
|
@@ -4643,12 +4640,12 @@ var statusMap = {
|
|
|
4643
4640
|
var DynamicList_default = DynamicList;
|
|
4644
4641
|
|
|
4645
4642
|
// src/layout/loadingIndicator/DynamicLoadingIndicator.tsx
|
|
4646
|
-
|
|
4647
|
-
|
|
4643
|
+
var import_components17 = require("@transferwise/components");
|
|
4644
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
4648
4645
|
var DynamicLoadingIndicator = ({ component }) => {
|
|
4649
4646
|
const { margin, size = "md" } = component;
|
|
4650
|
-
return /* @__PURE__ */
|
|
4651
|
-
|
|
4647
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4648
|
+
import_components17.Loader,
|
|
4652
4649
|
{
|
|
4653
4650
|
size,
|
|
4654
4651
|
classNames: {
|
|
@@ -4661,12 +4658,12 @@ var DynamicLoadingIndicator = ({ component }) => {
|
|
|
4661
4658
|
var DynamicLoadingIndicator_default = DynamicLoadingIndicator;
|
|
4662
4659
|
|
|
4663
4660
|
// src/layout/paragraph/DynamicParagraph.tsx
|
|
4664
|
-
|
|
4665
|
-
|
|
4661
|
+
var import_components19 = require("@transferwise/components");
|
|
4662
|
+
var import_react_intl14 = require("react-intl");
|
|
4666
4663
|
|
|
4667
4664
|
// src/layout/paragraph/DynamicParagraph.messages.ts
|
|
4668
|
-
|
|
4669
|
-
var DynamicParagraph_messages_default =
|
|
4665
|
+
var import_react_intl13 = require("react-intl");
|
|
4666
|
+
var DynamicParagraph_messages_default = (0, import_react_intl13.defineMessages)({
|
|
4670
4667
|
copy: {
|
|
4671
4668
|
id: "dynamicFlows.DynamicParagraph.copy",
|
|
4672
4669
|
defaultMessage: "Copy",
|
|
@@ -4680,33 +4677,33 @@ var DynamicParagraph_messages_default = defineMessages8({
|
|
|
4680
4677
|
});
|
|
4681
4678
|
|
|
4682
4679
|
// src/layout/paragraph/useSnackBarIfAvailable.ts
|
|
4683
|
-
|
|
4684
|
-
|
|
4680
|
+
var import_components18 = require("@transferwise/components");
|
|
4681
|
+
var import_react20 = require("react");
|
|
4685
4682
|
function useSnackBarIfAvailable() {
|
|
4686
|
-
const context =
|
|
4683
|
+
const context = (0, import_react20.useContext)(import_components18.SnackbarContext);
|
|
4687
4684
|
return context ? context.createSnackbar : noop3;
|
|
4688
4685
|
}
|
|
4689
4686
|
function noop3() {
|
|
4690
4687
|
}
|
|
4691
4688
|
|
|
4692
4689
|
// src/layout/paragraph/DynamicParagraph.tsx
|
|
4693
|
-
|
|
4694
|
-
var DynamicParagraph = ({ component }) => component.control === "copyable" ? /* @__PURE__ */
|
|
4695
|
-
var BasicDynamicParagraph = ({ component }) => /* @__PURE__ */
|
|
4690
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
4691
|
+
var DynamicParagraph = ({ component }) => component.control === "copyable" ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(CopyableDynamicParagraph, { component }) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(BasicDynamicParagraph, { component });
|
|
4692
|
+
var BasicDynamicParagraph = ({ component }) => /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("p", { className: getTextAlignmentAndMargin(component), children: [
|
|
4696
4693
|
" ",
|
|
4697
4694
|
component.text,
|
|
4698
4695
|
" "
|
|
4699
4696
|
] });
|
|
4700
4697
|
var CopyableDynamicParagraph = ({ component }) => {
|
|
4701
|
-
const { formatMessage } =
|
|
4698
|
+
const { formatMessage } = (0, import_react_intl14.useIntl)();
|
|
4702
4699
|
const createSnackbar = useSnackBarIfAvailable();
|
|
4703
4700
|
const { text } = component;
|
|
4704
4701
|
const copy = () => {
|
|
4705
4702
|
navigator.clipboard?.writeText(text).then(() => createSnackbar({ text: formatMessage(DynamicParagraph_messages_default.copied) })).catch(noop4);
|
|
4706
4703
|
};
|
|
4707
4704
|
const classNames7 = getTextAlignmentAndMargin({ align: component.align, margin: "sm" }) + " form-control";
|
|
4708
|
-
return /* @__PURE__ */
|
|
4709
|
-
/* @__PURE__ */
|
|
4705
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: getTextAlignmentAndMargin(component), children: [
|
|
4706
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4710
4707
|
"input",
|
|
4711
4708
|
{
|
|
4712
4709
|
type: "text",
|
|
@@ -4716,7 +4713,7 @@ var CopyableDynamicParagraph = ({ component }) => {
|
|
|
4716
4713
|
style: { textOverflow: "ellipsis" }
|
|
4717
4714
|
}
|
|
4718
4715
|
),
|
|
4719
|
-
/* @__PURE__ */
|
|
4716
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_components19.Button, { block: true, onClick: copy, children: formatMessage(DynamicParagraph_messages_default.copy) })
|
|
4720
4717
|
] });
|
|
4721
4718
|
};
|
|
4722
4719
|
function noop4() {
|
|
@@ -4724,8 +4721,8 @@ function noop4() {
|
|
|
4724
4721
|
var DynamicParagraph_default = DynamicParagraph;
|
|
4725
4722
|
|
|
4726
4723
|
// src/layout/review/DynamicReview.tsx
|
|
4727
|
-
|
|
4728
|
-
|
|
4724
|
+
var import_components20 = require("@transferwise/components");
|
|
4725
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
4729
4726
|
var mapFieldsToDefinitions = ({ label, value }, index) => {
|
|
4730
4727
|
return { key: String(index), title: label, value };
|
|
4731
4728
|
};
|
|
@@ -4736,7 +4733,7 @@ var DynamicReview = (props) => {
|
|
|
4736
4733
|
const review = props.component;
|
|
4737
4734
|
const margin = getMarginBottom(review.margin || "xs");
|
|
4738
4735
|
const getReviewAction = (action) => {
|
|
4739
|
-
return /* @__PURE__ */
|
|
4736
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4740
4737
|
"a",
|
|
4741
4738
|
{
|
|
4742
4739
|
href: action.url,
|
|
@@ -4750,13 +4747,13 @@ var DynamicReview = (props) => {
|
|
|
4750
4747
|
}
|
|
4751
4748
|
);
|
|
4752
4749
|
};
|
|
4753
|
-
return /* @__PURE__ */
|
|
4754
|
-
review.title && /* @__PURE__ */
|
|
4750
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_jsx_runtime43.Fragment, { children: [
|
|
4751
|
+
review.title && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("h6", { className: "m-b-2", children: [
|
|
4755
4752
|
review.title,
|
|
4756
4753
|
review.action && getReviewAction(review.action)
|
|
4757
4754
|
] }),
|
|
4758
|
-
/* @__PURE__ */
|
|
4759
|
-
|
|
4755
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4756
|
+
import_components20.DefinitionList,
|
|
4760
4757
|
{
|
|
4761
4758
|
layout: getReviewLayout(review.orientation),
|
|
4762
4759
|
definitions: review.fields.map(mapFieldsToDefinitions)
|
|
@@ -4767,7 +4764,7 @@ var DynamicReview = (props) => {
|
|
|
4767
4764
|
var DynamicReview_default = DynamicReview;
|
|
4768
4765
|
|
|
4769
4766
|
// src/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.tsx
|
|
4770
|
-
|
|
4767
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
4771
4768
|
var isNullish = (value) => isNull(value) || isUndefined(value);
|
|
4772
4769
|
var getDefaultValue = (schema2) => {
|
|
4773
4770
|
return schema2.type === "boolean" && isNullish(schema2.default) ? false : schema2.default;
|
|
@@ -4803,13 +4800,13 @@ var BasicTypeSchema = (props) => {
|
|
|
4803
4800
|
props.onBlur();
|
|
4804
4801
|
}
|
|
4805
4802
|
};
|
|
4806
|
-
const [model, setModel] =
|
|
4807
|
-
const [lastModel, setLastModel] =
|
|
4808
|
-
const [changed, setChanged] =
|
|
4809
|
-
const [focused, setFocused] =
|
|
4810
|
-
const [blurred, setBlurred] =
|
|
4811
|
-
const [validations, setValidations] =
|
|
4812
|
-
const id =
|
|
4803
|
+
const [model, setModel] = (0, import_react21.useState)(props.model ?? null);
|
|
4804
|
+
const [lastModel, setLastModel] = (0, import_react21.useState)(props.model ?? null);
|
|
4805
|
+
const [changed, setChanged] = (0, import_react21.useState)(false);
|
|
4806
|
+
const [focused, setFocused] = (0, import_react21.useState)(false);
|
|
4807
|
+
const [blurred, setBlurred] = (0, import_react21.useState)(false);
|
|
4808
|
+
const [validations, setValidations] = (0, import_react21.useState)([]);
|
|
4809
|
+
const id = (0, import_react21.useMemo)(() => props.schema.$id || generateRandomId(), [props.schema.$id]);
|
|
4813
4810
|
const onSchemaChange = () => {
|
|
4814
4811
|
const defaultValue = getDefaultValue(props.schema);
|
|
4815
4812
|
if (isNullish(model) && !isNullish(defaultValue)) {
|
|
@@ -4824,9 +4821,9 @@ var BasicTypeSchema = (props) => {
|
|
|
4824
4821
|
};
|
|
4825
4822
|
const isConst = props.schema.const;
|
|
4826
4823
|
const isHidden = props.schema.hidden || isConst;
|
|
4827
|
-
|
|
4828
|
-
|
|
4829
|
-
|
|
4824
|
+
(0, import_react21.useEffect)(refreshValidations, [props.model, props.submitted]);
|
|
4825
|
+
(0, import_react21.useEffect)(onSchemaChange, [props.schema]);
|
|
4826
|
+
(0, import_react21.useEffect)(() => setModel(props.model ?? null), [props.model]);
|
|
4830
4827
|
const formGroupClasses = {
|
|
4831
4828
|
"form-group": true,
|
|
4832
4829
|
"has-error": (props.submitted || !changed) && !!props.errors || (props.submitted || changed && blurred) && !!validations.length,
|
|
@@ -4834,15 +4831,15 @@ var BasicTypeSchema = (props) => {
|
|
|
4834
4831
|
};
|
|
4835
4832
|
const showLabel = props.schema.format !== "file" && props.schema.type !== "boolean";
|
|
4836
4833
|
const schemaHelp = props.schema.help;
|
|
4837
|
-
return !isHidden ? /* @__PURE__ */
|
|
4838
|
-
props.schema.alert && /* @__PURE__ */
|
|
4839
|
-
/* @__PURE__ */
|
|
4840
|
-
showLabel && /* @__PURE__ */
|
|
4841
|
-
/* @__PURE__ */
|
|
4842
|
-
!!schemaHelp && /* @__PURE__ */
|
|
4834
|
+
return !isHidden ? /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
|
|
4835
|
+
props.schema.alert && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(DynamicAlert_default, { component: props.schema.alert }),
|
|
4836
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: (0, import_classnames6.default)(formGroupClasses), children: [
|
|
4837
|
+
showLabel && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "d-inline-block", children: [
|
|
4838
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("label", { className: "control-label d-inline", htmlFor: id, children: props.schema.title }),
|
|
4839
|
+
!!schemaHelp && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Help_default, { help: schemaHelp })
|
|
4843
4840
|
] }),
|
|
4844
|
-
!showLabel && !!schemaHelp && /* @__PURE__ */
|
|
4845
|
-
/* @__PURE__ */
|
|
4841
|
+
!showLabel && !!schemaHelp && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Help_default, { help: schemaHelp }),
|
|
4842
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4846
4843
|
SchemaFormControl_default,
|
|
4847
4844
|
{
|
|
4848
4845
|
id,
|
|
@@ -4854,7 +4851,7 @@ var BasicTypeSchema = (props) => {
|
|
|
4854
4851
|
onBlur
|
|
4855
4852
|
}
|
|
4856
4853
|
),
|
|
4857
|
-
/* @__PURE__ */
|
|
4854
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4858
4855
|
ControlFeedback_default,
|
|
4859
4856
|
{
|
|
4860
4857
|
changed,
|
|
@@ -4878,7 +4875,7 @@ BasicTypeSchema.defaultProps = {
|
|
|
4878
4875
|
var BasicTypeSchema_default = BasicTypeSchema;
|
|
4879
4876
|
|
|
4880
4877
|
// src/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.tsx
|
|
4881
|
-
|
|
4878
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
4882
4879
|
var getIdFromResponse = (idProperty, response) => {
|
|
4883
4880
|
return response[idProperty];
|
|
4884
4881
|
};
|
|
@@ -4893,15 +4890,15 @@ var controlTypesWithPersistOnChange = /* @__PURE__ */ new Set([
|
|
|
4893
4890
|
FormControlType.UPLOAD
|
|
4894
4891
|
]);
|
|
4895
4892
|
var PersistAsyncBasicSchema = (props) => {
|
|
4896
|
-
const intl =
|
|
4893
|
+
const intl = (0, import_react_intl15.useIntl)();
|
|
4897
4894
|
const fetcher = useFetcher();
|
|
4898
4895
|
const onEvent = useEventDispatcher();
|
|
4899
|
-
const [persistAsyncModel, setPersistAsyncModel] =
|
|
4896
|
+
const [persistAsyncModel, setPersistAsyncModel] = (0, import_react22.useState)(null);
|
|
4900
4897
|
const previousPersistAsyncModel = usePrevious(persistAsyncModel);
|
|
4901
|
-
const [persistAsyncError, setPersistAsyncError] =
|
|
4902
|
-
const [fieldSubmitted, setFieldSubmitted] =
|
|
4903
|
-
const [abortController, setAbortController] =
|
|
4904
|
-
|
|
4898
|
+
const [persistAsyncError, setPersistAsyncError] = (0, import_react22.useState)(null);
|
|
4899
|
+
const [fieldSubmitted, setFieldSubmitted] = (0, import_react22.useState)(false);
|
|
4900
|
+
const [abortController, setAbortController] = (0, import_react22.useState)(null);
|
|
4901
|
+
(0, import_react22.useEffect)(() => {
|
|
4905
4902
|
if (controlTypesWithPersistOnChange.has(
|
|
4906
4903
|
// TODO: LOW avoid type assertion below -- control type may be nullish. consider ?? ''
|
|
4907
4904
|
getControlType(props.schema.persistAsync.schema)
|
|
@@ -4968,7 +4965,7 @@ var PersistAsyncBasicSchema = (props) => {
|
|
|
4968
4965
|
setPersistAsyncModel(newPersistAsyncModel);
|
|
4969
4966
|
}
|
|
4970
4967
|
};
|
|
4971
|
-
return /* @__PURE__ */
|
|
4968
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4972
4969
|
BasicTypeSchema_default,
|
|
4973
4970
|
{
|
|
4974
4971
|
required: props.required,
|
|
@@ -4989,9 +4986,9 @@ var PersistAsyncBasicSchema_default = PersistAsyncBasicSchema;
|
|
|
4989
4986
|
|
|
4990
4987
|
// src/common/hooks/usePersistAsync/usePersistAsync.ts
|
|
4991
4988
|
var usePersistAsync = (persistAsync) => {
|
|
4992
|
-
const [abortController, setAbortController] =
|
|
4989
|
+
const [abortController, setAbortController] = (0, import_react23.useState)(null);
|
|
4993
4990
|
const fetcher = useFetcher();
|
|
4994
|
-
const intl =
|
|
4991
|
+
const intl = (0, import_react_intl16.useIntl)();
|
|
4995
4992
|
const { schema: schema2 } = persistAsync;
|
|
4996
4993
|
async function handlePersistAsync(model) {
|
|
4997
4994
|
const isInvalidSchema = model instanceof Blob ? !isBlobSchema(schema2) : !isValidSchema(model, schema2);
|
|
@@ -5070,7 +5067,7 @@ function hasStringMessage(value) {
|
|
|
5070
5067
|
}
|
|
5071
5068
|
|
|
5072
5069
|
// src/common/hooks/usePolling/usePolling.tsx
|
|
5073
|
-
|
|
5070
|
+
var import_react24 = require("react");
|
|
5074
5071
|
function usePolling({
|
|
5075
5072
|
asyncFn,
|
|
5076
5073
|
interval,
|
|
@@ -5079,9 +5076,9 @@ function usePolling({
|
|
|
5079
5076
|
onPollingResponse,
|
|
5080
5077
|
onFailure
|
|
5081
5078
|
}) {
|
|
5082
|
-
const onPollingResponseReference =
|
|
5083
|
-
const onFailureReference =
|
|
5084
|
-
const poll =
|
|
5079
|
+
const onPollingResponseReference = (0, import_react24.useRef)(onPollingResponse);
|
|
5080
|
+
const onFailureReference = (0, import_react24.useRef)(onFailure);
|
|
5081
|
+
const poll = (0, import_react24.useMemo)(
|
|
5085
5082
|
() => createPollingClosure(
|
|
5086
5083
|
asyncFn,
|
|
5087
5084
|
maxAttempts,
|
|
@@ -5091,7 +5088,7 @@ function usePolling({
|
|
|
5091
5088
|
),
|
|
5092
5089
|
[asyncFn, maxAttempts, maxConsecutiveFails]
|
|
5093
5090
|
);
|
|
5094
|
-
|
|
5091
|
+
(0, import_react24.useEffect)(() => {
|
|
5095
5092
|
if (interval > 0) {
|
|
5096
5093
|
const intervalReference = setInterval(() => {
|
|
5097
5094
|
poll();
|
|
@@ -5099,7 +5096,7 @@ function usePolling({
|
|
|
5099
5096
|
return () => clearInterval(intervalReference);
|
|
5100
5097
|
}
|
|
5101
5098
|
}, [poll, interval]);
|
|
5102
|
-
|
|
5099
|
+
(0, import_react24.useEffect)(() => {
|
|
5103
5100
|
onPollingResponseReference.current = onPollingResponse;
|
|
5104
5101
|
onFailureReference.current = onFailure;
|
|
5105
5102
|
}, [onPollingResponse, onFailure]);
|
|
@@ -5128,20 +5125,20 @@ function createPollingClosure(asyncFn, maxAttempts, maxConsecutiveFails, onPolli
|
|
|
5128
5125
|
}
|
|
5129
5126
|
|
|
5130
5127
|
// src/common/hooks/usePrevious/usePrevious.js
|
|
5131
|
-
|
|
5128
|
+
var import_react25 = require("react");
|
|
5132
5129
|
var usePrevious = (value) => {
|
|
5133
|
-
const reference =
|
|
5134
|
-
|
|
5130
|
+
const reference = (0, import_react25.useRef)();
|
|
5131
|
+
(0, import_react25.useEffect)(() => {
|
|
5135
5132
|
reference.current = value;
|
|
5136
5133
|
}, [value]);
|
|
5137
5134
|
return reference.current;
|
|
5138
5135
|
};
|
|
5139
5136
|
|
|
5140
5137
|
// src/common/hooks/useStepPolling/useStepPolling.tsx
|
|
5141
|
-
|
|
5138
|
+
var import_react26 = require("react");
|
|
5142
5139
|
function useStepPolling(polling, onAction) {
|
|
5143
5140
|
const fetcher = useFetcher();
|
|
5144
|
-
const asyncFn =
|
|
5141
|
+
const asyncFn = (0, import_react26.useMemo)(() => {
|
|
5145
5142
|
if (polling) {
|
|
5146
5143
|
return () => {
|
|
5147
5144
|
return fetcher(polling.url).then((response) => {
|
|
@@ -5156,7 +5153,7 @@ function useStepPolling(polling, onAction) {
|
|
|
5156
5153
|
return void 0;
|
|
5157
5154
|
}
|
|
5158
5155
|
}, [polling, fetcher]);
|
|
5159
|
-
const onPollingResponse =
|
|
5156
|
+
const onPollingResponse = (0, import_react26.useCallback)(
|
|
5160
5157
|
(pollingResponse) => {
|
|
5161
5158
|
if (pollingResponse?.action) {
|
|
5162
5159
|
onAction(pollingResponse.action);
|
|
@@ -5172,7 +5169,7 @@ function useStepPolling(polling, onAction) {
|
|
|
5172
5169
|
maxAttempts: polling?.maxAttempts || 0,
|
|
5173
5170
|
maxConsecutiveFails: 1,
|
|
5174
5171
|
onPollingResponse,
|
|
5175
|
-
onFailure:
|
|
5172
|
+
onFailure: (0, import_react26.useCallback)(() => {
|
|
5176
5173
|
if (polling) {
|
|
5177
5174
|
onAction(polling.onError.action);
|
|
5178
5175
|
}
|
|
@@ -5181,7 +5178,7 @@ function useStepPolling(polling, onAction) {
|
|
|
5181
5178
|
}
|
|
5182
5179
|
|
|
5183
5180
|
// src/step/layoutStep/LayoutStep.tsx
|
|
5184
|
-
|
|
5181
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
5185
5182
|
var getComponents = (step, options) => {
|
|
5186
5183
|
if (!step || isEmpty(step) || !step.layout && !step.type) {
|
|
5187
5184
|
return [];
|
|
@@ -5203,7 +5200,7 @@ var LayoutStep = (props) => {
|
|
|
5203
5200
|
onEvent("Dynamic Flow - onAction supressed", { reason: "LayoutStep - loading state" });
|
|
5204
5201
|
};
|
|
5205
5202
|
useStepPolling(stepSpecification.polling, onAction);
|
|
5206
|
-
return /* @__PURE__ */
|
|
5203
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
5207
5204
|
DynamicLayout_default,
|
|
5208
5205
|
{
|
|
5209
5206
|
components,
|
|
@@ -5219,16 +5216,16 @@ var LayoutStep = (props) => {
|
|
|
5219
5216
|
var LayoutStep_default = LayoutStep;
|
|
5220
5217
|
|
|
5221
5218
|
// src/step/cameraStep/CameraStep.tsx
|
|
5222
|
-
|
|
5219
|
+
var import_react30 = require("react");
|
|
5223
5220
|
|
|
5224
5221
|
// src/step/cameraStep/cameraCapture/CameraCapture.tsx
|
|
5222
|
+
var import_react29 = require("react");
|
|
5223
|
+
var import_react_intl23 = require("react-intl");
|
|
5225
5224
|
var import_react_webcam = __toESM(require_react_webcam());
|
|
5226
|
-
import { useCallback as useCallback6, useRef as useRef5, useState as useState15 } from "react";
|
|
5227
|
-
import { useIntl as useIntl12 } from "react-intl";
|
|
5228
5225
|
|
|
5229
5226
|
// src/step/cameraStep/cameraCapture/CameraCapture.messages.ts
|
|
5230
|
-
|
|
5231
|
-
var CameraCapture_messages_default =
|
|
5227
|
+
var import_react_intl17 = require("react-intl");
|
|
5228
|
+
var CameraCapture_messages_default = (0, import_react_intl17.defineMessages)({
|
|
5232
5229
|
reviewSubmit: {
|
|
5233
5230
|
id: "dynamicFlows.CameraCapture.reviewSubmit",
|
|
5234
5231
|
defaultMessage: "Yes, submit",
|
|
@@ -5247,54 +5244,54 @@ var CameraCapture_messages_default = defineMessages9({
|
|
|
5247
5244
|
});
|
|
5248
5245
|
|
|
5249
5246
|
// src/step/cameraStep/cameraCapture/components/index.tsx
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
var CaptureBottomBar = ({ onCapture }) => /* @__PURE__ */
|
|
5247
|
+
var import_components21 = require("@transferwise/components");
|
|
5248
|
+
var import_react_intl18 = require("react-intl");
|
|
5249
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
5250
|
+
var CaptureBottomBar = ({ onCapture }) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "bottom-bar", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(CaptureButton, { onClick: onCapture }) });
|
|
5254
5251
|
var ReviewBottomBar = ({
|
|
5255
5252
|
onSubmit,
|
|
5256
5253
|
onRetry
|
|
5257
5254
|
}) => {
|
|
5258
|
-
const intl =
|
|
5259
|
-
return /* @__PURE__ */
|
|
5260
|
-
/* @__PURE__ */
|
|
5261
|
-
|
|
5255
|
+
const intl = (0, import_react_intl18.useIntl)();
|
|
5256
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "bottom-bar p-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "col-xs-12 col-md-6 col-md-offset-3", children: [
|
|
5257
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5258
|
+
import_components21.Button,
|
|
5262
5259
|
{
|
|
5263
5260
|
className: "m-b-1",
|
|
5264
5261
|
block: true,
|
|
5265
|
-
size:
|
|
5266
|
-
type: ControlType.ACCENT,
|
|
5262
|
+
size: import_components21.Size.MEDIUM,
|
|
5263
|
+
type: import_components21.ControlType.ACCENT,
|
|
5267
5264
|
onClick: onSubmit,
|
|
5268
5265
|
children: intl.formatMessage(CameraCapture_messages_default.reviewSubmit)
|
|
5269
5266
|
}
|
|
5270
5267
|
),
|
|
5271
|
-
/* @__PURE__ */
|
|
5272
|
-
|
|
5268
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5269
|
+
import_components21.Button,
|
|
5273
5270
|
{
|
|
5274
5271
|
className: "m-b-2",
|
|
5275
5272
|
block: true,
|
|
5276
|
-
size:
|
|
5277
|
-
type: ControlType.ACCENT,
|
|
5278
|
-
priority: Priority.SECONDARY,
|
|
5273
|
+
size: import_components21.Size.MEDIUM,
|
|
5274
|
+
type: import_components21.ControlType.ACCENT,
|
|
5275
|
+
priority: import_components21.Priority.SECONDARY,
|
|
5279
5276
|
onClick: onRetry,
|
|
5280
5277
|
children: intl.formatMessage(CameraCapture_messages_default.reviewRetry)
|
|
5281
5278
|
}
|
|
5282
5279
|
)
|
|
5283
5280
|
] }) }) });
|
|
5284
5281
|
};
|
|
5285
|
-
var CaptureButton = ({ onClick }) => /* @__PURE__ */
|
|
5282
|
+
var CaptureButton = ({ onClick }) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5286
5283
|
"button",
|
|
5287
5284
|
{
|
|
5288
5285
|
type: "button",
|
|
5289
5286
|
className: "camera-capture-btn m-b-2",
|
|
5290
5287
|
"data-testid": "camera-capture-button",
|
|
5291
5288
|
onClick,
|
|
5292
|
-
children: /* @__PURE__ */
|
|
5289
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "camera-capture-btn-inner" })
|
|
5293
5290
|
}
|
|
5294
5291
|
);
|
|
5295
5292
|
|
|
5296
5293
|
// src/step/cameraStep/cameraCapture/hooks/index.ts
|
|
5297
|
-
|
|
5294
|
+
var import_react27 = require("react");
|
|
5298
5295
|
|
|
5299
5296
|
// src/step/cameraStep/cameraCapture/utils/index.ts
|
|
5300
5297
|
var isSelfieCamera = (stream) => {
|
|
@@ -5328,7 +5325,7 @@ var getVideoCapabilities = (videoStream) => getVideoTrack(videoStream)?.getCapab
|
|
|
5328
5325
|
|
|
5329
5326
|
// src/step/cameraStep/cameraCapture/hooks/index.ts
|
|
5330
5327
|
var useVideoConstraints = (direction) => {
|
|
5331
|
-
const [videoConstraints, setVideoConstraints] =
|
|
5328
|
+
const [videoConstraints, setVideoConstraints] = (0, import_react27.useState)();
|
|
5332
5329
|
const defaultVideoConstraints = {
|
|
5333
5330
|
facingMode: direction === "front" ? "user" : "environment",
|
|
5334
5331
|
height: { min: 480, max: 1080, ideal: 720 },
|
|
@@ -5336,7 +5333,7 @@ var useVideoConstraints = (direction) => {
|
|
|
5336
5333
|
frameRate: 30,
|
|
5337
5334
|
aspectRatio: 16 / 9
|
|
5338
5335
|
};
|
|
5339
|
-
|
|
5336
|
+
(0, import_react27.useEffect)(() => {
|
|
5340
5337
|
void getVideoConstraints(direction).then(setVideoConstraints);
|
|
5341
5338
|
}, [direction]);
|
|
5342
5339
|
const getVideoConstraints = async (direction2) => {
|
|
@@ -5355,8 +5352,8 @@ var useVideoConstraints = (direction) => {
|
|
|
5355
5352
|
};
|
|
5356
5353
|
|
|
5357
5354
|
// src/step/cameraStep/cameraCapture/overlay/Overlay.tsx
|
|
5358
|
-
|
|
5359
|
-
|
|
5355
|
+
var import_react28 = require("react");
|
|
5356
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
5360
5357
|
var captureButtonHeight = 92;
|
|
5361
5358
|
var reviewButtonsHeight = 120;
|
|
5362
5359
|
var imageHeight = 40;
|
|
@@ -5372,8 +5369,8 @@ var Overlay = ({
|
|
|
5372
5369
|
instructions,
|
|
5373
5370
|
reviewInstructions
|
|
5374
5371
|
}) => {
|
|
5375
|
-
const svgReference =
|
|
5376
|
-
|
|
5372
|
+
const svgReference = (0, import_react28.useRef)(null);
|
|
5373
|
+
(0, import_react28.useEffect)(() => {
|
|
5377
5374
|
const listener = debounce(() => {
|
|
5378
5375
|
if (svgReference.current?.innerHTML) {
|
|
5379
5376
|
const reference = svgReference.current;
|
|
@@ -5384,18 +5381,18 @@ var Overlay = ({
|
|
|
5384
5381
|
return () => window.removeEventListener("resize", listener);
|
|
5385
5382
|
});
|
|
5386
5383
|
let helperBoxHeight = (imageUrl ? imageHeight : 0) + (title ? titleHeight : 0) + (instructions ? instructionsHeight : 0);
|
|
5387
|
-
let helperBox = /* @__PURE__ */
|
|
5388
|
-
imageUrl && /* @__PURE__ */
|
|
5389
|
-
title && /* @__PURE__ */
|
|
5390
|
-
instructions && /* @__PURE__ */
|
|
5384
|
+
let helperBox = /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
|
|
5385
|
+
imageUrl && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("img", { className: "camera-capture-img", src: imageUrl, alt: "" }),
|
|
5386
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("h4", { className: "camera-capture-title", children: title }),
|
|
5387
|
+
instructions && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("small", { className: "camera-capture-instructions", children: instructions })
|
|
5391
5388
|
] });
|
|
5392
5389
|
const frameBottomMargin = captureButtonHeight + helperBoxHeight;
|
|
5393
5390
|
if (reviewInstructions) {
|
|
5394
5391
|
helperBoxHeight = frameBottomMargin - reviewButtonsHeight;
|
|
5395
|
-
helperBox = /* @__PURE__ */
|
|
5392
|
+
helperBox = /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("small", { className: "camera-capture-instructions", children: reviewInstructions });
|
|
5396
5393
|
const frameWithReviewInstructionsMinBottomMargin = reviewButtonsHeight + reviewInstructionsHeight;
|
|
5397
5394
|
if (frameBottomMargin < frameWithReviewInstructionsMinBottomMargin) {
|
|
5398
|
-
helperBox = /* @__PURE__ */
|
|
5395
|
+
helperBox = /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_jsx_runtime48.Fragment, {});
|
|
5399
5396
|
}
|
|
5400
5397
|
}
|
|
5401
5398
|
const framePosition = {
|
|
@@ -5413,25 +5410,25 @@ var Overlay = ({
|
|
|
5413
5410
|
width: "90%"
|
|
5414
5411
|
}
|
|
5415
5412
|
};
|
|
5416
|
-
return /* @__PURE__ */
|
|
5417
|
-
/* @__PURE__ */
|
|
5418
|
-
/* @__PURE__ */
|
|
5419
|
-
/* @__PURE__ */
|
|
5413
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("svg", { ref: svgReference, xmlns: "http://www.w3.org/2000/svg", children: [
|
|
5414
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("mask", { id: "mask", children: [
|
|
5415
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("rect", { width: "100%", height: "100%", fill: "#fff" }),
|
|
5416
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("image", { href: overlay, ...framePosition })
|
|
5420
5417
|
] }) }),
|
|
5421
|
-
overlay && /* @__PURE__ */
|
|
5422
|
-
outline && /* @__PURE__ */
|
|
5423
|
-
/* @__PURE__ */
|
|
5418
|
+
overlay && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("rect", { width: "100%", height: "100%", mask: "url(#mask)", fillOpacity: "0.72" }),
|
|
5419
|
+
outline && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("image", { href: outline, ...framePosition }),
|
|
5420
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("foreignObject", { width: "100%", height: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "camera-capture-text-and-image-container", ...helperBoxPosition, children: helperBox }) })
|
|
5424
5421
|
] });
|
|
5425
5422
|
};
|
|
5426
5423
|
var Overlay_default = Overlay;
|
|
5427
5424
|
|
|
5428
5425
|
// src/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.tsx
|
|
5429
|
-
|
|
5430
|
-
|
|
5426
|
+
var import_components22 = require("@transferwise/components");
|
|
5427
|
+
var import_react_intl20 = require("react-intl");
|
|
5431
5428
|
|
|
5432
5429
|
// src/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.ts
|
|
5433
|
-
|
|
5434
|
-
var NoCameraAccess_messages_default =
|
|
5430
|
+
var import_react_intl19 = require("react-intl");
|
|
5431
|
+
var NoCameraAccess_messages_default = (0, import_react_intl19.defineMessages)({
|
|
5435
5432
|
title: {
|
|
5436
5433
|
id: "dynamicFlows.CameraCapture.NoCameraAccess.title",
|
|
5437
5434
|
defaultMessage: "We can't access your camera",
|
|
@@ -5450,23 +5447,23 @@ var NoCameraAccess_messages_default = defineMessages10({
|
|
|
5450
5447
|
});
|
|
5451
5448
|
|
|
5452
5449
|
// src/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.tsx
|
|
5453
|
-
|
|
5450
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
5454
5451
|
var NoCameraAccess = ({ onAction }) => {
|
|
5455
|
-
const intl =
|
|
5456
|
-
return /* @__PURE__ */
|
|
5457
|
-
/* @__PURE__ */
|
|
5458
|
-
/* @__PURE__ */
|
|
5459
|
-
/* @__PURE__ */
|
|
5452
|
+
const intl = (0, import_react_intl20.useIntl)();
|
|
5453
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { id: "no-camera-access", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "container p-t-5", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "col-md-6 col-md-offset-3", children: [
|
|
5454
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("h2", { className: "text-xs-center m-b-3", children: intl.formatMessage(NoCameraAccess_messages_default.title) }),
|
|
5455
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { className: "text-xs-center m-b-5", children: intl.formatMessage(NoCameraAccess_messages_default.paragraph) }),
|
|
5456
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_components22.Button, { block: true, onClick: onAction, children: intl.formatMessage(NoCameraAccess_messages_default.action) })
|
|
5460
5457
|
] }) }) }) });
|
|
5461
5458
|
};
|
|
5462
5459
|
var NoCameraAccess_default = NoCameraAccess;
|
|
5463
5460
|
|
|
5464
5461
|
// src/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.tsx
|
|
5465
|
-
|
|
5462
|
+
var import_react_intl22 = require("react-intl");
|
|
5466
5463
|
|
|
5467
5464
|
// src/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.messages.ts
|
|
5468
|
-
|
|
5469
|
-
var CameraNotSupported_messages_default =
|
|
5465
|
+
var import_react_intl21 = require("react-intl");
|
|
5466
|
+
var CameraNotSupported_messages_default = (0, import_react_intl21.defineMessages)({
|
|
5470
5467
|
title: {
|
|
5471
5468
|
id: "dynamicFlows.CameraCapture.CameraNotSupported.title",
|
|
5472
5469
|
defaultMessage: "Camera not supported",
|
|
@@ -5480,12 +5477,12 @@ var CameraNotSupported_messages_default = defineMessages11({
|
|
|
5480
5477
|
});
|
|
5481
5478
|
|
|
5482
5479
|
// src/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.tsx
|
|
5483
|
-
|
|
5480
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
5484
5481
|
var CameraNotSupported = () => {
|
|
5485
|
-
const intl =
|
|
5486
|
-
return /* @__PURE__ */
|
|
5487
|
-
/* @__PURE__ */
|
|
5488
|
-
/* @__PURE__ */
|
|
5482
|
+
const intl = (0, import_react_intl22.useIntl)();
|
|
5483
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { id: "camera-not-supported", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "container p-t-5", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "col-md-6 col-md-offset-3", children: [
|
|
5484
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("h2", { className: "text-xs-center m-b-3", children: intl.formatMessage(CameraNotSupported_messages_default.title) }),
|
|
5485
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("p", { className: "text-xs-center m-b-5", children: intl.formatMessage(CameraNotSupported_messages_default.paragraph) })
|
|
5489
5486
|
] }) }) }) });
|
|
5490
5487
|
};
|
|
5491
5488
|
var CameraNotSupported_default = CameraNotSupported;
|
|
@@ -5510,7 +5507,7 @@ var getCameraStartedProperties = async (props, videoStream) => {
|
|
|
5510
5507
|
};
|
|
5511
5508
|
|
|
5512
5509
|
// src/step/cameraStep/cameraCapture/CameraCapture.tsx
|
|
5513
|
-
|
|
5510
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
5514
5511
|
var CameraCapture = ({
|
|
5515
5512
|
direction = "back",
|
|
5516
5513
|
overlay = "",
|
|
@@ -5522,14 +5519,14 @@ var CameraCapture = ({
|
|
|
5522
5519
|
onCapture,
|
|
5523
5520
|
onEvent
|
|
5524
5521
|
}) => {
|
|
5525
|
-
const [mode, setMode] =
|
|
5526
|
-
const [isVideoMirrored, setIsVideoMirrored] =
|
|
5527
|
-
const [ready, setReady] =
|
|
5528
|
-
const [reviewImage, setReviewImage] =
|
|
5529
|
-
const webcamReference =
|
|
5522
|
+
const [mode, setMode] = (0, import_react29.useState)("CAPTURE");
|
|
5523
|
+
const [isVideoMirrored, setIsVideoMirrored] = (0, import_react29.useState)(false);
|
|
5524
|
+
const [ready, setReady] = (0, import_react29.useState)(false);
|
|
5525
|
+
const [reviewImage, setReviewImage] = (0, import_react29.useState)();
|
|
5526
|
+
const webcamReference = (0, import_react29.useRef)(null);
|
|
5530
5527
|
const { videoConstraints } = useVideoConstraints(direction);
|
|
5531
|
-
const intl =
|
|
5532
|
-
const handleCapture =
|
|
5528
|
+
const intl = (0, import_react_intl23.useIntl)();
|
|
5529
|
+
const handleCapture = (0, import_react29.useCallback)(async () => {
|
|
5533
5530
|
if (webcamReference?.current?.video && webcamReference?.current?.video?.readyState >= 3) {
|
|
5534
5531
|
webcamReference?.current?.video?.pause();
|
|
5535
5532
|
const canvas = await generateCanvasFromVideo(webcamReference?.current?.video);
|
|
@@ -5550,7 +5547,7 @@ var CameraCapture = ({
|
|
|
5550
5547
|
);
|
|
5551
5548
|
}
|
|
5552
5549
|
}, [webcamReference, showReview, setReviewImage, setMode, onCapture, isVideoMirrored]);
|
|
5553
|
-
const handleUserMediaError =
|
|
5550
|
+
const handleUserMediaError = (0, import_react29.useCallback)(
|
|
5554
5551
|
(error) => {
|
|
5555
5552
|
if (error instanceof DOMException && error?.name === "NotAllowedError") {
|
|
5556
5553
|
setMode("NO_CAMERA_ACCESS");
|
|
@@ -5562,7 +5559,7 @@ var CameraCapture = ({
|
|
|
5562
5559
|
},
|
|
5563
5560
|
[setMode, onEvent]
|
|
5564
5561
|
);
|
|
5565
|
-
const handleUserMedia =
|
|
5562
|
+
const handleUserMedia = (0, import_react29.useCallback)(
|
|
5566
5563
|
(stream) => {
|
|
5567
5564
|
setReady(true);
|
|
5568
5565
|
setIsVideoMirrored(isSelfieCamera(stream));
|
|
@@ -5578,8 +5575,8 @@ var CameraCapture = ({
|
|
|
5578
5575
|
setReviewImage(void 0);
|
|
5579
5576
|
};
|
|
5580
5577
|
const handleRetryCameraAccess = () => setMode("CAPTURE");
|
|
5581
|
-
const captureScreen = /* @__PURE__ */
|
|
5582
|
-
videoConstraints && /* @__PURE__ */
|
|
5578
|
+
const captureScreen = /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
|
|
5579
|
+
videoConstraints && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5583
5580
|
import_react_webcam.default,
|
|
5584
5581
|
{
|
|
5585
5582
|
ref: webcamReference,
|
|
@@ -5590,7 +5587,7 @@ var CameraCapture = ({
|
|
|
5590
5587
|
onUserMedia: handleUserMedia
|
|
5591
5588
|
}
|
|
5592
5589
|
),
|
|
5593
|
-
/* @__PURE__ */
|
|
5590
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5594
5591
|
Overlay_default,
|
|
5595
5592
|
{
|
|
5596
5593
|
overlay,
|
|
@@ -5600,11 +5597,11 @@ var CameraCapture = ({
|
|
|
5600
5597
|
instructions
|
|
5601
5598
|
}
|
|
5602
5599
|
),
|
|
5603
|
-
ready && /* @__PURE__ */
|
|
5600
|
+
ready && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(CaptureBottomBar, { onCapture: () => void handleCapture() })
|
|
5604
5601
|
] });
|
|
5605
|
-
const reviewScreen = /* @__PURE__ */
|
|
5606
|
-
/* @__PURE__ */
|
|
5607
|
-
/* @__PURE__ */
|
|
5602
|
+
const reviewScreen = /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
|
|
5603
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("img", { className: "review-image", src: reviewImage?.source, alt: "" }),
|
|
5604
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5608
5605
|
Overlay_default,
|
|
5609
5606
|
{
|
|
5610
5607
|
overlay,
|
|
@@ -5614,19 +5611,19 @@ var CameraCapture = ({
|
|
|
5614
5611
|
reviewInstructions: intl.formatMessage(CameraCapture_messages_default.reviewInstructions)
|
|
5615
5612
|
}
|
|
5616
5613
|
),
|
|
5617
|
-
/* @__PURE__ */
|
|
5614
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ReviewBottomBar, { onSubmit: handleReviewSubmit, onRetry: handleReviewRetry })
|
|
5618
5615
|
] });
|
|
5619
|
-
return /* @__PURE__ */
|
|
5616
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("section", { className: "camera-capture", children: [
|
|
5620
5617
|
mode === "CAPTURE" && captureScreen,
|
|
5621
5618
|
mode === "REVIEW" && reviewScreen,
|
|
5622
|
-
mode === "NO_CAMERA_ACCESS" && /* @__PURE__ */
|
|
5623
|
-
mode === "CAMERA_NOT_SUPPORTED" && /* @__PURE__ */
|
|
5619
|
+
mode === "NO_CAMERA_ACCESS" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(NoCameraAccess_default, { onAction: handleRetryCameraAccess }),
|
|
5620
|
+
mode === "CAMERA_NOT_SUPPORTED" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(CameraNotSupported_default, {})
|
|
5624
5621
|
] });
|
|
5625
5622
|
};
|
|
5626
5623
|
var CameraCapture_default = CameraCapture;
|
|
5627
5624
|
|
|
5628
5625
|
// src/step/cameraStep/CameraStep.tsx
|
|
5629
|
-
|
|
5626
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
5630
5627
|
function blobToBase64(blob) {
|
|
5631
5628
|
return new Promise((resolve, _) => {
|
|
5632
5629
|
const reader = new FileReader();
|
|
@@ -5644,8 +5641,8 @@ var CameraStep = (props) => {
|
|
|
5644
5641
|
const { assets, direction, instructions } = cameraConfig || {};
|
|
5645
5642
|
const { overlay, outline } = assets || {};
|
|
5646
5643
|
const { url: imageUrl } = image || {};
|
|
5647
|
-
const [captureClicked, setCaptureClicked] =
|
|
5648
|
-
|
|
5644
|
+
const [captureClicked, setCaptureClicked] = (0, import_react30.useState)(false);
|
|
5645
|
+
(0, import_react30.useEffect)(() => {
|
|
5649
5646
|
if (captureClicked) {
|
|
5650
5647
|
onAction(action);
|
|
5651
5648
|
}
|
|
@@ -5664,7 +5661,7 @@ var CameraStep = (props) => {
|
|
|
5664
5661
|
});
|
|
5665
5662
|
}
|
|
5666
5663
|
};
|
|
5667
|
-
return /* @__PURE__ */
|
|
5664
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
5668
5665
|
CameraCapture_default,
|
|
5669
5666
|
{
|
|
5670
5667
|
overlay,
|
|
@@ -5712,11 +5709,11 @@ function getFirstAction(step) {
|
|
|
5712
5709
|
}
|
|
5713
5710
|
|
|
5714
5711
|
// src/step/externalConfirmationStep/ExternalConfirmationStep.tsx
|
|
5715
|
-
|
|
5712
|
+
var import_react_intl25 = require("react-intl");
|
|
5716
5713
|
|
|
5717
5714
|
// src/step/externalConfirmationStep/ExternalConfirmationStep.messages.ts
|
|
5718
|
-
|
|
5719
|
-
var ExternalConfirmationStep_messages_default =
|
|
5715
|
+
var import_react_intl24 = require("react-intl");
|
|
5716
|
+
var ExternalConfirmationStep_messages_default = (0, import_react_intl24.defineMessages)({
|
|
5720
5717
|
title: {
|
|
5721
5718
|
id: "dynamicFlows.ExternalConfirmation.title",
|
|
5722
5719
|
defaultMessage: "Please confirm",
|
|
@@ -5740,12 +5737,12 @@ var ExternalConfirmationStep_messages_default = defineMessages12({
|
|
|
5740
5737
|
});
|
|
5741
5738
|
|
|
5742
5739
|
// src/step/externalConfirmationStep/ExternalConfirmationStep.tsx
|
|
5743
|
-
|
|
5740
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
5744
5741
|
var noop5 = () => {
|
|
5745
5742
|
};
|
|
5746
5743
|
var ExternalConfirmationStep = ({ url, onClose }) => {
|
|
5747
|
-
const { formatMessage } =
|
|
5748
|
-
return /* @__PURE__ */
|
|
5744
|
+
const { formatMessage } = (0, import_react_intl25.useIntl)();
|
|
5745
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
5749
5746
|
DynamicLayout_default,
|
|
5750
5747
|
{
|
|
5751
5748
|
components: [
|
|
@@ -5810,7 +5807,7 @@ function getOrigin(url) {
|
|
|
5810
5807
|
}
|
|
5811
5808
|
|
|
5812
5809
|
// src/dynamicFlow/DynamicFlowStep.tsx
|
|
5813
|
-
|
|
5810
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
5814
5811
|
var DynamicFlowStep = (props) => {
|
|
5815
5812
|
const { step, globalError } = props;
|
|
5816
5813
|
const externalUrl = step?.external?.url;
|
|
@@ -5819,22 +5816,22 @@ var DynamicFlowStep = (props) => {
|
|
|
5819
5816
|
return null;
|
|
5820
5817
|
}
|
|
5821
5818
|
if (externalUrl && requiresManualTrigger) {
|
|
5822
|
-
return /* @__PURE__ */
|
|
5819
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ExternalConfirmationStep_default, { url: externalUrl, onClose: dismissConfirmation });
|
|
5823
5820
|
}
|
|
5824
5821
|
if (getStepType(step) === "camera") {
|
|
5825
|
-
return /* @__PURE__ */
|
|
5822
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(CameraStep_default, { ...props, step });
|
|
5826
5823
|
}
|
|
5827
|
-
return /* @__PURE__ */
|
|
5828
|
-
globalError ? /* @__PURE__ */
|
|
5829
|
-
/* @__PURE__ */
|
|
5824
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_jsx_runtime54.Fragment, { children: [
|
|
5825
|
+
globalError ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(DynamicAlert_default, { component: { context: "negative", markdown: globalError, margin: "lg" } }) : null,
|
|
5826
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(LayoutStep_default, { ...props, stepSpecification: step })
|
|
5830
5827
|
] });
|
|
5831
5828
|
};
|
|
5832
5829
|
|
|
5833
5830
|
// src/dynamicFlow/utils/useDebouncedRefresh/useDebouncedRefresh.ts
|
|
5834
|
-
|
|
5831
|
+
var import_react31 = require("react");
|
|
5835
5832
|
var DEBOUNCE_DELAY = 1e3;
|
|
5836
5833
|
function useDebouncedRefresh(fetchRefresh) {
|
|
5837
|
-
const map =
|
|
5834
|
+
const map = (0, import_react31.useRef)(/* @__PURE__ */ new Map());
|
|
5838
5835
|
const retrieveOrCreate = (key) => {
|
|
5839
5836
|
if (map.current.has(key)) {
|
|
5840
5837
|
return map.current.get(key);
|
|
@@ -5857,7 +5854,7 @@ function useDebouncedRefresh(fetchRefresh) {
|
|
|
5857
5854
|
}
|
|
5858
5855
|
|
|
5859
5856
|
// src/dynamicFlow/utils/useDynamicFlowState.ts
|
|
5860
|
-
|
|
5857
|
+
var import_react32 = require("react");
|
|
5861
5858
|
|
|
5862
5859
|
// src/dynamicFlow/DynamicFlowTypes.ts
|
|
5863
5860
|
function isSchema(schema2) {
|
|
@@ -5866,9 +5863,9 @@ function isSchema(schema2) {
|
|
|
5866
5863
|
|
|
5867
5864
|
// src/dynamicFlow/utils/useDynamicFlowState.ts
|
|
5868
5865
|
var useDynamicFlowState = (initialStep) => {
|
|
5869
|
-
const [formErrors, setFormErrors] =
|
|
5870
|
-
const [globalError, setGlobalError] =
|
|
5871
|
-
const [stepAndModels, setStepAndModels] =
|
|
5866
|
+
const [formErrors, setFormErrors] = (0, import_react32.useState)(initialStep?.errors?.validation);
|
|
5867
|
+
const [globalError, setGlobalError] = (0, import_react32.useState)(initialStep?.errors?.error);
|
|
5868
|
+
const [stepAndModels, setStepAndModels] = (0, import_react32.useState)({
|
|
5872
5869
|
step: initialStep || void 0,
|
|
5873
5870
|
models: initialStep?.model ? buildInitialModels(initialStep.model, getAllSchemas(initialStep)) : {},
|
|
5874
5871
|
etag: void 0
|
|
@@ -5898,7 +5895,7 @@ var useDynamicFlowState = (initialStep) => {
|
|
|
5898
5895
|
return updatedState;
|
|
5899
5896
|
});
|
|
5900
5897
|
};
|
|
5901
|
-
const modelIsValid =
|
|
5898
|
+
const modelIsValid = (0, import_react32.useMemo)(() => areModelsValid(models, getAllSchemas(step)), [models, step]);
|
|
5902
5899
|
return {
|
|
5903
5900
|
formErrors,
|
|
5904
5901
|
globalError,
|
|
@@ -5949,20 +5946,20 @@ var areModelsValid = (formModels, schemas = []) => {
|
|
|
5949
5946
|
};
|
|
5950
5947
|
|
|
5951
5948
|
// src/dynamicFlow/utils/useLoader.tsx
|
|
5952
|
-
|
|
5953
|
-
|
|
5954
|
-
|
|
5949
|
+
var import_components24 = require("@transferwise/components");
|
|
5950
|
+
var import_react33 = require("react");
|
|
5951
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
5955
5952
|
function useLoader(loaderConfig, initialState) {
|
|
5956
5953
|
const config = {
|
|
5957
|
-
size:
|
|
5954
|
+
size: import_components24.Size.EXTRA_LARGE,
|
|
5958
5955
|
initial: true,
|
|
5959
5956
|
submission: false,
|
|
5960
5957
|
...loaderConfig
|
|
5961
5958
|
};
|
|
5962
|
-
const [loadingState, setLoadingState] =
|
|
5959
|
+
const [loadingState, setLoadingState] = (0, import_react33.useState)(initialState);
|
|
5963
5960
|
const shouldDisplayLoader = config.initial && loadingState === "initial" || config.submission && loadingState === "submission";
|
|
5964
|
-
const loader = shouldDisplayLoader ? /* @__PURE__ */
|
|
5965
|
-
|
|
5961
|
+
const loader = shouldDisplayLoader ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
5962
|
+
import_components24.Loader,
|
|
5966
5963
|
{
|
|
5967
5964
|
size: config.size,
|
|
5968
5965
|
classNames: { "tw-loader": "tw-loader m-x-auto" },
|
|
@@ -5973,15 +5970,15 @@ function useLoader(loaderConfig, initialState) {
|
|
|
5973
5970
|
}
|
|
5974
5971
|
|
|
5975
5972
|
// src/dynamicFlow/utils/errorBoundary/ErrorBoundary.tsx
|
|
5976
|
-
|
|
5973
|
+
var import_react34 = require("react");
|
|
5977
5974
|
|
|
5978
5975
|
// src/dynamicFlow/utils/errorBoundary/ErrorBoundaryAlert.tsx
|
|
5979
|
-
|
|
5980
|
-
|
|
5976
|
+
var import_components25 = require("@transferwise/components");
|
|
5977
|
+
var import_react_intl27 = require("react-intl");
|
|
5981
5978
|
|
|
5982
5979
|
// src/dynamicFlow/utils/errorBoundary/ErrorBoundary.messages.ts
|
|
5983
|
-
|
|
5984
|
-
var ErrorBoundary_messages_default =
|
|
5980
|
+
var import_react_intl26 = require("react-intl");
|
|
5981
|
+
var ErrorBoundary_messages_default = (0, import_react_intl26.defineMessages)({
|
|
5985
5982
|
errorAlert: {
|
|
5986
5983
|
id: "dynamicFlows.ErrorBoundary.errorAlert",
|
|
5987
5984
|
defaultMessage: "Oops. Something went wrong...",
|
|
@@ -5995,18 +5992,18 @@ var ErrorBoundary_messages_default = defineMessages13({
|
|
|
5995
5992
|
});
|
|
5996
5993
|
|
|
5997
5994
|
// src/dynamicFlow/utils/errorBoundary/ErrorBoundaryAlert.tsx
|
|
5998
|
-
|
|
5995
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
5999
5996
|
var ErrorBoundaryAlert = ({ onDismiss }) => {
|
|
6000
|
-
const { formatMessage } =
|
|
6001
|
-
return /* @__PURE__ */
|
|
6002
|
-
|
|
5997
|
+
const { formatMessage } = (0, import_react_intl27.useIntl)();
|
|
5998
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
5999
|
+
import_components25.Alert,
|
|
6003
6000
|
{
|
|
6004
6001
|
action: {
|
|
6005
6002
|
text: formatMessage(ErrorBoundary_messages_default.retry),
|
|
6006
6003
|
href: window.location.href
|
|
6007
6004
|
},
|
|
6008
6005
|
message: formatMessage(ErrorBoundary_messages_default.errorAlert),
|
|
6009
|
-
type: Sentiment.NEGATIVE,
|
|
6006
|
+
type: import_components25.Sentiment.NEGATIVE,
|
|
6010
6007
|
className: "m-b-3",
|
|
6011
6008
|
onDismiss
|
|
6012
6009
|
}
|
|
@@ -6014,10 +6011,10 @@ var ErrorBoundaryAlert = ({ onDismiss }) => {
|
|
|
6014
6011
|
};
|
|
6015
6012
|
|
|
6016
6013
|
// src/dynamicFlow/utils/errorBoundary/ErrorBoundary.tsx
|
|
6017
|
-
|
|
6014
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
6018
6015
|
var noop6 = () => {
|
|
6019
6016
|
};
|
|
6020
|
-
var ErrorBoundary = class extends Component {
|
|
6017
|
+
var ErrorBoundary = class extends import_react34.Component {
|
|
6021
6018
|
constructor(props) {
|
|
6022
6019
|
super(props);
|
|
6023
6020
|
this.handleErrorReset = () => {
|
|
@@ -6035,8 +6032,8 @@ var ErrorBoundary = class extends Component {
|
|
|
6035
6032
|
render() {
|
|
6036
6033
|
const { children } = this.props;
|
|
6037
6034
|
const { hasError, isFatalError } = this.state;
|
|
6038
|
-
return /* @__PURE__ */
|
|
6039
|
-
hasError && /* @__PURE__ */
|
|
6035
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
|
|
6036
|
+
hasError && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(ErrorBoundaryAlert, { onDismiss: this.handleErrorReset }),
|
|
6040
6037
|
!isFatalError && children
|
|
6041
6038
|
] });
|
|
6042
6039
|
}
|
|
@@ -6103,7 +6100,7 @@ var assertResponseIsValid = (response) => {
|
|
|
6103
6100
|
};
|
|
6104
6101
|
|
|
6105
6102
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
6106
|
-
|
|
6103
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
6107
6104
|
var noop7 = () => {
|
|
6108
6105
|
};
|
|
6109
6106
|
var DynamicFlowComponent = ({
|
|
@@ -6120,7 +6117,7 @@ var DynamicFlowComponent = ({
|
|
|
6120
6117
|
onEvent = noop7,
|
|
6121
6118
|
onLog = noop7
|
|
6122
6119
|
}) => {
|
|
6123
|
-
const { locale } =
|
|
6120
|
+
const { locale } = (0, import_react_intl28.useIntl)();
|
|
6124
6121
|
const {
|
|
6125
6122
|
formErrors,
|
|
6126
6123
|
globalError,
|
|
@@ -6133,7 +6130,7 @@ var DynamicFlowComponent = ({
|
|
|
6133
6130
|
setStepAndEtag,
|
|
6134
6131
|
setSchemaModel
|
|
6135
6132
|
} = useDynamicFlowState(initialStep);
|
|
6136
|
-
const [submitted, setSubmitted] =
|
|
6133
|
+
const [submitted, setSubmitted] = (0, import_react35.useState)(false);
|
|
6137
6134
|
const { loadingState, setLoadingState, loader } = useLoader(
|
|
6138
6135
|
loaderConfig,
|
|
6139
6136
|
initialStep ? "idle" : "initial"
|
|
@@ -6141,15 +6138,15 @@ var DynamicFlowComponent = ({
|
|
|
6141
6138
|
const logWarning = getLogger("warning", onLog, flowId, step?.key);
|
|
6142
6139
|
const logError = getLogger("error", onLog, flowId, step?.key);
|
|
6143
6140
|
const logCritical = getLogger("critical", onLog, flowId, step?.key);
|
|
6144
|
-
const analyticsMetadata =
|
|
6141
|
+
const analyticsMetadata = (0, import_react35.useMemo)(
|
|
6145
6142
|
() => ({ flowId, stepId: step?.key, ...step?.analytics ?? {} }),
|
|
6146
6143
|
[flowId, step]
|
|
6147
6144
|
);
|
|
6148
|
-
const dispatchEvent =
|
|
6145
|
+
const dispatchEvent = (0, import_react35.useMemo)(
|
|
6149
6146
|
() => getEventDispatcher(onEvent, analyticsMetadata),
|
|
6150
6147
|
[onEvent, analyticsMetadata]
|
|
6151
6148
|
);
|
|
6152
|
-
const triggerActionRequest =
|
|
6149
|
+
const triggerActionRequest = (0, import_react35.useCallback)(
|
|
6153
6150
|
({ action, data, etag: etag2 }) => {
|
|
6154
6151
|
const { url, method = "POST" } = action;
|
|
6155
6152
|
return fetcher(url ?? "", {
|
|
@@ -6197,17 +6194,17 @@ var DynamicFlowComponent = ({
|
|
|
6197
6194
|
}
|
|
6198
6195
|
};
|
|
6199
6196
|
const debouncedFetchRefresh = useDebouncedRefresh(fetchRefreshStep);
|
|
6200
|
-
const onCloseWithEvent =
|
|
6197
|
+
const onCloseWithEvent = (0, import_react35.useCallback)(
|
|
6201
6198
|
(result) => {
|
|
6202
6199
|
dispatchEvent("Dynamic Flow - Flow Finished", { result: "success" });
|
|
6203
6200
|
onComplete(result);
|
|
6204
6201
|
},
|
|
6205
6202
|
[onComplete, dispatchEvent]
|
|
6206
6203
|
);
|
|
6207
|
-
|
|
6204
|
+
(0, import_react35.useEffect)(() => {
|
|
6208
6205
|
dispatchEvent("Dynamic Flow - Flow Started", {});
|
|
6209
6206
|
}, []);
|
|
6210
|
-
|
|
6207
|
+
(0, import_react35.useEffect)(() => {
|
|
6211
6208
|
if (!initialStep) {
|
|
6212
6209
|
const action = {
|
|
6213
6210
|
$id: "#initial-step-request",
|
|
@@ -6362,7 +6359,7 @@ var DynamicFlowComponent = ({
|
|
|
6362
6359
|
}
|
|
6363
6360
|
void fetchNextStep(action);
|
|
6364
6361
|
};
|
|
6365
|
-
return /* @__PURE__ */
|
|
6362
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(LogProvider, { flowId, stepId: step?.key, onLog, children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(EventsContextProvider, { metadata: analyticsMetadata, onEvent, children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(DynamicFlowProvider, { loading: loadingState !== "idle", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(FetcherProvider, { fetcher, children: loader !== null ? loader : /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
6366
6363
|
DynamicFlowStep,
|
|
6367
6364
|
{
|
|
6368
6365
|
step,
|
|
@@ -6378,7 +6375,7 @@ var DynamicFlowComponent = ({
|
|
|
6378
6375
|
}
|
|
6379
6376
|
) }) }) }) });
|
|
6380
6377
|
};
|
|
6381
|
-
var DynamicFlow = (props) => /* @__PURE__ */
|
|
6378
|
+
var DynamicFlow = (props) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(ErrorBoundary_default, { onError: props.onError, children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(DynamicFlowComponent, { ...props }) });
|
|
6382
6379
|
var DynamicFlow_default = DynamicFlow;
|
|
6383
6380
|
var combineModels2 = (formModels) => {
|
|
6384
6381
|
return Object.values(formModels).reduce((previous, model) => ({ ...previous, ...model }), {});
|
|
@@ -6972,16 +6969,6 @@ var translations = {
|
|
|
6972
6969
|
zh: zh_default
|
|
6973
6970
|
};
|
|
6974
6971
|
var i18n_default = translations;
|
|
6975
|
-
export {
|
|
6976
|
-
DynamicFlow_default as DynamicFlow,
|
|
6977
|
-
JsonSchemaForm_default as JsonSchemaForm,
|
|
6978
|
-
DynamicLayout_default as Layout,
|
|
6979
|
-
convertStepToLayout,
|
|
6980
|
-
inlineReferences,
|
|
6981
|
-
isValidSchema,
|
|
6982
|
-
makeFetcher,
|
|
6983
|
-
i18n_default as translations
|
|
6984
|
-
};
|
|
6985
6972
|
/*! Bundled license information:
|
|
6986
6973
|
|
|
6987
6974
|
classnames/index.js:
|