@wise/dynamic-flow-client 3.12.0 → 3.13.0-experimental-kyc-camera-be63581
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/common/cameraCapture/CameraCapture.js +161 -0
- package/build/common/cameraCapture/CameraCapture.messages.js +58 -0
- package/build/common/cameraCapture/CameraCapture.spec.js +460 -0
- package/build/common/cameraCapture/CameraEventHandler.js +1 -0
- package/build/common/cameraCapture/components/bottomBar/BottomBar.js +17 -0
- package/build/common/cameraCapture/components/index.js +3 -0
- package/build/common/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.js +8 -0
- package/build/common/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.messages.js +8 -0
- package/build/common/cameraCapture/hooks/useFullScreenOrientationLock.js +62 -0
- package/build/common/cameraCapture/hooks/useVideoConstraints.js +80 -0
- package/build/common/cameraCapture/index.js +1 -0
- package/build/common/cameraCapture/overlay/Overlay.js +78 -0
- package/build/common/cameraCapture/screens/cameraErrorScreen/CameraErrorScreen.js +7 -0
- package/build/common/cameraCapture/screens/index.js +1 -0
- package/build/common/cameraCapture/tracking/index.js +109 -0
- package/build/common/cameraCapture/types/index.js +7 -0
- package/build/common/cameraCapture/utils/index.js +107 -0
- package/build/common/cameraCapture/utils/mobile-utils.js +23 -0
- package/build/common/cameraCapture/utils/mobile-utils.spec.js +71 -0
- package/build/common/errorBoundary/ErrorBoundary.js +44 -0
- package/build/common/errorBoundary/ErrorBoundaryAlert.js +12 -0
- package/build/common/httpClientContext/HttpClientContext.js +24 -0
- package/build/common/httpClientContext/index.js +1 -0
- package/build/common/makeHttpClient/index.js +1 -0
- package/build/common/makeHttpClient/makeHttpClient.js +30 -0
- package/build/common/makeHttpClient/makeHttpClient.spec.js +140 -0
- package/build/common/messages/external-confirmation.messages.js +23 -0
- package/build/common/messages/generic-error.messages.js +18 -0
- package/build/common/messages/help.messages.js +8 -0
- package/build/common/messages/multi-file-upload.messages.js +18 -0
- package/build/common/messages/multi-select.messages.js +8 -0
- package/build/common/messages/paragraph.messages.js +13 -0
- package/build/common/messages/repeatable.messages.js +23 -0
- package/build/common/messages/validation.array.messages.js +13 -0
- package/build/common/messages/validation.messages.js +53 -0
- package/build/common/utils/api-utils.js +4 -0
- package/build/common/utils/debounce.js +44 -0
- package/build/common/utils/debounce.spec.js +72 -0
- package/build/i18n/index.js +36 -0
- package/build/index.js +12 -0
- package/build/legacy/common/constants/DateMode.js +4 -0
- package/build/legacy/common/constants/FeatureName.js +4 -0
- package/build/legacy/common/constants/FormControlType.js +21 -0
- package/build/legacy/common/constants/MonthFormat.js +4 -0
- package/build/legacy/common/constants/Size.js +7 -0
- package/build/legacy/common/constants/index.js +4 -0
- package/build/legacy/common/contexts/dynamicFlowContexts/DynamicFlowContexts.js +25 -0
- package/build/legacy/common/contexts/dynamicFlowContexts/usePendingPromiseCounter.js +15 -0
- package/build/legacy/common/contexts/dynamicFlowContexts/usePendingPromiseCounter.spec.js +113 -0
- package/build/legacy/common/contexts/eventsContext/EventsContext.js +38 -0
- package/build/legacy/common/contexts/eventsContext/EventsContext.spec.js +47 -0
- package/build/legacy/common/contexts/featureContext/FeatureContext.js +11 -0
- package/build/legacy/common/contexts/featureContext/FeatureContext.spec.js +30 -0
- package/build/legacy/common/contexts/index.js +3 -0
- package/build/legacy/common/contexts/logContext/LogContext.js +44 -0
- package/build/legacy/common/contexts/logContext/LogContext.spec.js +43 -0
- package/build/legacy/common/hooks/index.js +7 -0
- package/build/legacy/common/hooks/useDebouncedFunction/useDebouncedFunction.js +9 -0
- package/build/legacy/common/hooks/useDebouncedFunction/useDebouncedFunction.spec.js +59 -0
- package/build/legacy/common/hooks/useExternal/useExternal.js +15 -0
- package/build/legacy/common/hooks/useExternal/useExternal.spec.js +236 -0
- package/build/legacy/common/hooks/useExternalStepPolling/useExternalStepPolling.js +71 -0
- package/build/legacy/common/hooks/usePersistAsync/usePersistAsync.js +172 -0
- package/build/legacy/common/hooks/usePersistAsync/usePersistAsync.spec.js +221 -0
- package/build/legacy/common/hooks/usePolling/usePolling.js +53 -0
- package/build/legacy/common/hooks/usePolling/usePolling.spec.js +243 -0
- package/build/legacy/common/hooks/usePrevious/usePrevious.js +8 -0
- package/build/legacy/common/hooks/usePrevious/usePrevious.spec.js +66 -0
- package/build/legacy/common/hooks/useStepPolling/useStepPolling.js +45 -0
- package/build/legacy/common/hooks/useStepPolling/useStepPolling.spec.js +288 -0
- package/build/legacy/common/messages.js +8 -0
- package/build/legacy/common/utils/api-utils.js +6 -0
- package/build/legacy/common/utils/date-utils.js +22 -0
- package/build/legacy/common/utils/file-utils.js +45 -0
- package/build/legacy/common/utils/file-utils.spec.js +69 -0
- package/build/legacy/common/utils/id-utils.js +5 -0
- package/build/legacy/common/utils/id-utils.spec.js +12 -0
- package/build/legacy/common/utils/index.js +11 -0
- package/build/legacy/common/utils/is-equal.js +21 -0
- package/build/legacy/common/utils/is-equal.spec.js +88 -0
- package/build/legacy/common/utils/misc-utils.js +4 -0
- package/build/legacy/common/utils/model-utils.js +33 -0
- package/build/legacy/common/utils/schema-utils.js +113 -0
- package/build/legacy/common/utils/step-utils.js +32 -0
- package/build/legacy/common/validators/index.js +5 -0
- package/build/legacy/common/validators/models/model-utils.js +119 -0
- package/build/legacy/common/validators/models/model-utils.spec.js +45 -0
- package/build/legacy/common/validators/models/model-validators.js +62 -0
- package/build/legacy/common/validators/models/model-validators.spec.js +647 -0
- package/build/legacy/common/validators/schemas/schema-validators.js +101 -0
- package/build/legacy/common/validators/schemas/schema-validators.spec.js +157 -0
- package/build/legacy/common/validators/types/type-validators.js +14 -0
- package/build/legacy/common/validators/types/type-validators.spec.js +147 -0
- package/build/legacy/common/validators/validationFailures/validation-failures.js +139 -0
- package/build/legacy/common/validators/validationFailures/validation-failures.spec.js +198 -0
- package/build/legacy/common/validators/validationFailures/validation-failures.utils.js +40 -0
- package/build/legacy/common/validators/validationFailures/validation-failures.utils.spec.js +145 -0
- package/build/legacy/common/validators/values/value-validators.js +6 -0
- package/build/legacy/common/validators/values/value-validators.spec.js +22 -0
- package/build/legacy/dynamic-flow-types.js +1 -0
- package/build/legacy/dynamicFlow/BackButton.js +22 -0
- package/build/legacy/dynamicFlow/DynamicFlow.js +364 -0
- package/build/legacy/dynamicFlow/DynamicFlowStep.js +37 -0
- package/build/legacy/dynamicFlow/DynamicFlowTypes.js +1 -0
- package/build/legacy/dynamicFlow/index.js +1 -0
- package/build/legacy/dynamicFlow/stories/dev-tools/DynamicFlow.story.js +78 -0
- package/build/legacy/dynamicFlow/stories/dev-tools/ErrorResponses.story.js +124 -0
- package/build/legacy/dynamicFlow/stories/dev-tools/Examples.story.js +57 -0
- package/build/legacy/dynamicFlow/stories/dev-tools/Features.story.js +58 -0
- package/build/legacy/dynamicFlow/stories/dev-tools/JsonSchemaForm.story.js +31 -0
- package/build/legacy/dynamicFlow/stories/dev-tools/RefreshOnChange.story.js +194 -0
- package/build/legacy/dynamicFlow/stories/dev-tools/SearchFeature.story.js +263 -0
- package/build/legacy/dynamicFlow/stories/dev-tools/ServerTest.story.js +44 -0
- package/build/legacy/dynamicFlow/stories/dev-tools/Upload.story.js +212 -0
- package/build/legacy/dynamicFlow/stories/dev-tools/ValidationAsync.story.js +156 -0
- package/build/legacy/dynamicFlow/stories/examples/ObjectConst.story.js +150 -0
- package/build/legacy/dynamicFlow/stories/fixtureHttpClient.js +117 -0
- package/build/legacy/dynamicFlow/tests/Actions.spec.js +232 -0
- package/build/legacy/dynamicFlow/tests/AllOfSchema.spec.js +196 -0
- package/build/legacy/dynamicFlow/tests/AutocompleteHints.spec.js +59 -0
- package/build/legacy/dynamicFlow/tests/DynamicFlow.BackButton.spec.js +179 -0
- package/build/legacy/dynamicFlow/tests/DynamicFlow.InitialAction.spec.js +472 -0
- package/build/legacy/dynamicFlow/tests/DynamicFlow.InitialStep.spec.js +749 -0
- package/build/legacy/dynamicFlow/tests/DynamicFlow.LoaderConfig.spec.js +267 -0
- package/build/legacy/dynamicFlow/tests/DynamicFlow.legacy.spec.js +1202 -0
- package/build/legacy/dynamicFlow/tests/DynamicFlow.search.spec.js +475 -0
- package/build/legacy/dynamicFlow/tests/DynamicFlow.spec.js +559 -0
- package/build/legacy/dynamicFlow/tests/DynamicImage.spec.js +287 -0
- package/build/legacy/dynamicFlow/tests/DynamicInstructions.spec.js +49 -0
- package/build/legacy/dynamicFlow/tests/HiddenSchemas.spec.js +307 -0
- package/build/legacy/dynamicFlow/tests/ModalLayout.spec.js +252 -0
- package/build/legacy/dynamicFlow/tests/MultiSelect.spec.js +327 -0
- package/build/legacy/dynamicFlow/tests/MultipleFileUploadSchema.spec.js +401 -0
- package/build/legacy/dynamicFlow/tests/ObjectSchema.spec.js +295 -0
- package/build/legacy/dynamicFlow/tests/OneOfSchema.spec.js +773 -0
- package/build/legacy/dynamicFlow/tests/PersistAsync.blob-schema.spec.js +331 -0
- package/build/legacy/dynamicFlow/tests/PersistAsync.string-schema.spec.js +389 -0
- package/build/legacy/dynamicFlow/tests/RefreshStepOnChange.debouncing.spec.js +391 -0
- package/build/legacy/dynamicFlow/tests/RefreshStepOnChange.spec.js +588 -0
- package/build/legacy/dynamicFlow/tests/RepeatableSchema.spec.js +977 -0
- package/build/legacy/dynamicFlow/tests/StepModel.spec.js +119 -0
- package/build/legacy/dynamicFlow/tests/ValidationAsync.spec.js +484 -0
- package/build/legacy/dynamicFlow/tests/ssr.spec.js +47 -0
- package/build/legacy/dynamicFlow/utils/index.js +5 -0
- package/build/legacy/dynamicFlow/utils/responseParsers/response-parsers.js +185 -0
- package/build/legacy/dynamicFlow/utils/responseParsers/response-parsers.spec.js +463 -0
- package/build/legacy/dynamicFlow/utils/useDebouncedRefresh/useDebouncedRefresh.js +35 -0
- package/build/legacy/dynamicFlow/utils/useDynamicFlowState.js +137 -0
- package/build/legacy/dynamicFlow/utils/useErrorResponse.js +62 -0
- package/build/legacy/dynamicFlow/utils/useLoader.js +22 -0
- package/build/legacy/formControl/FormControl.js +267 -0
- package/build/legacy/formControl/FormControl.spec.js +445 -0
- package/build/legacy/formControl/Select.spec.js +104 -0
- package/build/legacy/formControl/index.js +1 -0
- package/build/legacy/formControl/utils/getAutocompleteString.js +80 -0
- package/build/legacy/formControl/utils/getAutocompleteString.spec.js +30 -0
- package/build/legacy/formControl/utils/index.js +2 -0
- package/build/legacy/formControl/utils/value-utils.js +108 -0
- package/build/legacy/formControl/utils/value-utils.spec.js +158 -0
- package/build/legacy/jsonSchemaForm/JsonSchemaForm.end-to-end.spec.js +534 -0
- package/build/legacy/jsonSchemaForm/JsonSchemaForm.js +24 -0
- package/build/legacy/jsonSchemaForm/JsonSchemaForm.spec.js +77 -0
- package/build/legacy/jsonSchemaForm/allOfSchema/AllOfSchema.js +50 -0
- package/build/legacy/jsonSchemaForm/allOfSchema/index.js +1 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/ArraySchema.js +25 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/ArrayTypeSchema.spec.js +50 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.js +34 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/index.js +1 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multiSelectSchema/MultiSelectSchema.js +86 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.js +141 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/index.js +1 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/index.js +2 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/upload-utils.js +79 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/useFormattedDefaultErrorMessages.js +14 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/ItemSummary.js +7 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchema.js +134 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchemaStep.js +85 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/utils/summary-utils.js +135 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/utils/summary-utils.spec.js +909 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/index.js +1 -0
- package/build/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.errors.spec.js +233 -0
- package/build/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.js +100 -0
- package/build/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.spec.js +291 -0
- package/build/legacy/jsonSchemaForm/basicTypeSchema/index.js +1 -0
- package/build/legacy/jsonSchemaForm/controlFeedback/ControlFeedback.js +89 -0
- package/build/legacy/jsonSchemaForm/controlFeedback/ControlFeedback.spec.js +182 -0
- package/build/legacy/jsonSchemaForm/controlFeedback/index.js +1 -0
- package/build/legacy/jsonSchemaForm/genericSchema/GenericSchema.js +85 -0
- package/build/legacy/jsonSchemaForm/genericSchema/GenericSchema.rtl.spec.js +55 -0
- package/build/legacy/jsonSchemaForm/genericSchema/GenericSchema.spec.js +334 -0
- package/build/legacy/jsonSchemaForm/genericSchema/index.js +1 -0
- package/build/legacy/jsonSchemaForm/help/Help.js +9 -0
- package/build/legacy/jsonSchemaForm/help/Help.spec.js +61 -0
- package/build/legacy/jsonSchemaForm/help/index.js +1 -0
- package/build/legacy/jsonSchemaForm/index.js +1 -0
- package/build/legacy/jsonSchemaForm/objectSchema/ObjectSchema.js +77 -0
- package/build/legacy/jsonSchemaForm/objectSchema/index.js +1 -0
- package/build/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.js +155 -0
- package/build/legacy/jsonSchemaForm/oneOfSchema/index.js +1 -0
- package/build/legacy/jsonSchemaForm/oneOfSchema/utils.js +68 -0
- package/build/legacy/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.js +26 -0
- package/build/legacy/jsonSchemaForm/persistAsyncSchema/index.js +1 -0
- package/build/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.js +165 -0
- package/build/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/index.js +1 -0
- package/build/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.js +131 -0
- package/build/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.js +31 -0
- package/build/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.spec.js +243 -0
- package/build/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/index.js +1 -0
- package/build/legacy/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.js +72 -0
- package/build/legacy/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.spec.js +420 -0
- package/build/legacy/jsonSchemaForm/promotedOneOfSchema/index.js +1 -0
- package/build/legacy/jsonSchemaForm/promotedOneOfSchema/promoted-one-of-utils.js +8 -0
- package/build/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.js +16 -0
- package/build/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.spec.js +125 -0
- package/build/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.js +31 -0
- package/build/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.spec.js +82 -0
- package/build/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.js +32 -0
- package/build/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.spec.js +130 -0
- package/build/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.js +54 -0
- package/build/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.js +13 -0
- package/build/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.spec.js +117 -0
- package/build/legacy/jsonSchemaForm/readOnlySchema/index.js +1 -0
- package/build/legacy/jsonSchemaForm/schemaFormControl/SchemaFormControl.js +138 -0
- package/build/legacy/jsonSchemaForm/schemaFormControl/SchemaFormControl.spec.js +312 -0
- package/build/legacy/jsonSchemaForm/schemaFormControl/index.js +1 -0
- package/build/legacy/jsonSchemaForm/schemaFormControl/utils/index.js +1 -0
- package/build/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.js +107 -0
- package/build/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.spec.js +220 -0
- package/build/legacy/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.js +150 -0
- package/build/legacy/jsonSchemaForm/validationAsyncSchema/index.js +1 -0
- package/build/legacy/layout/DynamicLayout.end-to-end.spec.js +71 -0
- package/build/legacy/layout/DynamicLayout.js +68 -0
- package/build/legacy/layout/DynamicLayout.spec.js +243 -0
- package/build/legacy/layout/alert/DynamicAlert.js +29 -0
- package/build/legacy/layout/alert/DynamicAlert.spec.js +42 -0
- package/build/legacy/layout/box/DynamicBox.js +30 -0
- package/build/legacy/layout/box/DynamicBox.spec.js +56 -0
- package/build/legacy/layout/button/DynamicButton.js +16 -0
- package/build/legacy/layout/button/DynamicButton.spec.js +141 -0
- package/build/legacy/layout/button/utils.js +45 -0
- package/build/legacy/layout/button/utils.spec.js +50 -0
- package/build/legacy/layout/columns/DynamicColumns.js +27 -0
- package/build/legacy/layout/columns/DynamicColumns.spec.js +83 -0
- package/build/legacy/layout/decision/DynamicDecision.js +10 -0
- package/build/legacy/layout/decision/DynamicDecision.spec.js +146 -0
- package/build/legacy/layout/divider/DynamicDivider.js +9 -0
- package/build/legacy/layout/divider/DynamicDivider.spec.js +17 -0
- package/build/legacy/layout/external/DynamicExternal.js +32 -0
- package/build/legacy/layout/external/DynamicExternal.messages.js +8 -0
- package/build/legacy/layout/external/DynamicExternal.spec.js +264 -0
- package/build/legacy/layout/form/DynamicForm.js +22 -0
- package/build/legacy/layout/form/DynamicForm.spec.js +74 -0
- package/build/legacy/layout/heading/DynamicHeading.js +40 -0
- package/build/legacy/layout/heading/DynamicHeading.spec.js +14 -0
- package/build/legacy/layout/icon/DynamicIcon.js +17 -0
- package/build/legacy/layout/icon/DynamicIcon.spec.js +20 -0
- package/build/legacy/layout/icon/FlagIcon.js +11 -0
- package/build/legacy/layout/icon/NamedIcon.js +19 -0
- package/build/legacy/layout/image/DynamicImage.js +112 -0
- package/build/legacy/layout/index.js +20 -0
- package/build/legacy/layout/instructions/DynamicInstructions.js +19 -0
- package/build/legacy/layout/list/DynamicStatusList.js +37 -0
- package/build/legacy/layout/list/DynamicStatusList.spec.js +111 -0
- package/build/legacy/layout/loadingIndicator/DynamicLoadingIndicator.js +11 -0
- package/build/legacy/layout/loadingIndicator/DynamicLoadingIndicator.spec.js +25 -0
- package/build/legacy/layout/markdown/DynamicMarkdown.js +12 -0
- package/build/legacy/layout/markdown/DynamicMarkdown.spec.js +58 -0
- package/build/legacy/layout/modal/DynamicModal.js +26 -0
- package/build/legacy/layout/paragraph/DynamicParagraph.js +35 -0
- package/build/legacy/layout/paragraph/DynamicParagraph.spec.js +109 -0
- package/build/legacy/layout/paragraph/useSnackBarIfAvailable.js +9 -0
- package/build/legacy/layout/review/DynamicReview.js +59 -0
- package/build/legacy/layout/review/DynamicReview.spec.js +152 -0
- package/build/legacy/layout/search/DynamicSearch.js +83 -0
- package/build/legacy/layout/search/SearchInput.js +6 -0
- package/build/legacy/layout/search/SearchResults.js +20 -0
- package/build/legacy/layout/search/useSearch.js +150 -0
- package/build/legacy/layout/utils/getNavigationOptionMedia.js +17 -0
- package/build/legacy/layout/utils/index.js +32 -0
- package/build/legacy/step/cameraStep/CameraStep.js +124 -0
- package/build/legacy/step/cameraStep/index.js +1 -0
- package/build/legacy/step/externalConfirmationStep/ExternalConfirmationStep.js +64 -0
- package/build/legacy/step/externalConfirmationStep/index.js +1 -0
- package/build/legacy/step/index.js +3 -0
- package/build/legacy/step/layoutStep/LayoutStep.js +33 -0
- package/build/legacy/step/layoutStep/LayoutStep.spec.js +189 -0
- package/build/legacy/step/layoutStep/index.js +1 -0
- package/build/legacy/step/layoutStep/utils/index.js +2 -0
- package/build/legacy/step/layoutStep/utils/inline-reference-utils.js +105 -0
- package/build/legacy/step/layoutStep/utils/inline-reference-utils.spec.js +296 -0
- package/build/legacy/step/layoutStep/utils/layout-utils.js +212 -0
- package/build/legacy/step/layoutStep/utils/layout-utils.spec.js +558 -0
- package/build/legacy/test-utils/DynamicFlowProviders.js +8 -0
- package/build/legacy/test-utils/index.js +4 -0
- package/build/legacy/test-utils/legacy-utils.js +69 -0
- package/build/legacy/test-utils/log-utils.js +9 -0
- package/build/legacy/visual-tests/generated.story.js +234 -0
- package/build/legacy/visual-tests/layouts.story.js +132 -0
- package/build/legacy/visual-tests/schemas.story.js +108 -0
- package/build/legacy/visual-tests/step.story.js +54 -0
- package/build/main.js +724 -602
- package/build/main.min.js +1 -1
- package/build/main.mjs +689 -567
- package/build/revamp/DynamicFlowCore.js +25 -0
- package/build/revamp/DynamicFlowWise.js +32 -0
- package/build/revamp/DynamicFlowWise.spec.js +105 -0
- package/build/revamp/DynamicFragmentWise.js +83 -0
- package/build/revamp/domain/components/AlertComponent.js +50 -0
- package/build/revamp/domain/components/AllOfComponent.js +72 -0
- package/build/revamp/domain/components/BooleanInputComponent.js +109 -0
- package/build/revamp/domain/components/BoxComponent.js +65 -0
- package/build/revamp/domain/components/ButtonComponent.js +50 -0
- package/build/revamp/domain/components/ColumnsComponent.js +74 -0
- package/build/revamp/domain/components/ConstComponent.js +50 -0
- package/build/revamp/domain/components/ContainerComponent.js +65 -0
- package/build/revamp/domain/components/DateInputComponent.js +128 -0
- package/build/revamp/domain/components/DecisionComponent.js +50 -0
- package/build/revamp/domain/components/DividerComponent.js +50 -0
- package/build/revamp/domain/components/FormComponent.js +65 -0
- package/build/revamp/domain/components/HeadingComponent.js +50 -0
- package/build/revamp/domain/components/ImageComponent.js +50 -0
- package/build/revamp/domain/components/InstructionsComponent.js +50 -0
- package/build/revamp/domain/components/IntegerInputComponent.js +129 -0
- package/build/revamp/domain/components/LoadingIndicatorComponent.js +50 -0
- package/build/revamp/domain/components/MarkdownComponent.js +50 -0
- package/build/revamp/domain/components/ModalComponent.js +65 -0
- package/build/revamp/domain/components/MultiSelectInputComponent.js +148 -0
- package/build/revamp/domain/components/MultiUploadInputComponent.js +192 -0
- package/build/revamp/domain/components/NumberInputComponent.js +129 -0
- package/build/revamp/domain/components/ObjectComponent.js +104 -0
- package/build/revamp/domain/components/ParagraphComponent.js +50 -0
- package/build/revamp/domain/components/ReviewComponent.js +50 -0
- package/build/revamp/domain/components/SelectInputComponent.js +140 -0
- package/build/revamp/domain/components/StatusListComponent.js +50 -0
- package/build/revamp/domain/components/StepDomainComponent.js +87 -0
- package/build/revamp/domain/components/TextInputComponent.js +129 -0
- package/build/revamp/domain/components/UploadInputComponent.js +154 -0
- package/build/revamp/domain/components/repeatableComponent/RepeatableComponent.js +150 -0
- package/build/revamp/domain/components/repeatableComponent/RepeatableComponent.spec.js +146 -0
- package/build/revamp/domain/components/searchComponent/SearchComponent.js +111 -0
- package/build/revamp/domain/components/searchComponent/SearchComponent.spec.js +327 -0
- package/build/revamp/domain/components/utils/component-utils.js +18 -0
- package/build/revamp/domain/components/utils/debounce.js +38 -0
- package/build/revamp/domain/components/utils/debounce.spec.js +72 -0
- package/build/revamp/domain/components/utils/file-utils.js +65 -0
- package/build/revamp/domain/components/utils/file-utils.spec.js +81 -0
- package/build/revamp/domain/components/utils/getComponentForLocalValueKey.js +31 -0
- package/build/revamp/domain/components/utils/isPartialLocalValueMatch.js +46 -0
- package/build/revamp/domain/components/utils/isPartialLocalValueMatch.spec.js +125 -0
- package/build/revamp/domain/components/utils/local-value.js +14 -0
- package/build/revamp/domain/features/events.js +1 -0
- package/build/revamp/domain/features/persistAsync/getComponentPersistAsync.js +134 -0
- package/build/revamp/domain/features/persistAsync/getComponentPersistAsync.spec.js +200 -0
- package/build/revamp/domain/features/persistAsync/getInitialPersistedState.js +6 -0
- package/build/revamp/domain/features/persistAsync/getPerformPersistAsync.js +103 -0
- package/build/revamp/domain/features/persistAsync/getPerformPersistAsync.spec.js +280 -0
- package/build/revamp/domain/features/polling/getStepPolling.js +82 -0
- package/build/revamp/domain/features/polling/getStepPolling.spec.js +170 -0
- package/build/revamp/domain/features/refresh/getPerformRefresh.js +16 -0
- package/build/revamp/domain/features/search/getPerformSearchFunction.js +102 -0
- package/build/revamp/domain/features/search/getPerformSearchFunction.spec.js +260 -0
- package/build/revamp/domain/features/summary/summary-utils.js +39 -0
- package/build/revamp/domain/features/summary/summary-utils.spec.js +110 -0
- package/build/revamp/domain/features/utils/http-utils.js +34 -0
- package/build/revamp/domain/features/utils/response-utils.js +9 -0
- package/build/revamp/domain/features/validation/spec-utils.js +16 -0
- package/build/revamp/domain/features/validation/validation-functions.js +12 -0
- package/build/revamp/domain/features/validation/validation-functions.spec.js +110 -0
- package/build/revamp/domain/features/validation/value-checks.js +111 -0
- package/build/revamp/domain/features/validation/value-checks.spec.js +204 -0
- package/build/revamp/domain/features/validationAsync/getComponentValidationAsync.js +95 -0
- package/build/revamp/domain/features/validationAsync/getComponentValidationAsync.spec.js +178 -0
- package/build/revamp/domain/features/validationAsync/getInitialValidationState.js +5 -0
- package/build/revamp/domain/features/validationAsync/getPerformValidationAsync.js +107 -0
- package/build/revamp/domain/features/validationAsync/getPerformValidationAsync.spec.js +266 -0
- package/build/revamp/domain/mappers/layout/alertLayoutToComponent.js +12 -0
- package/build/revamp/domain/mappers/layout/boxLayoutToComponents.js +15 -0
- package/build/revamp/domain/mappers/layout/buttonLayoutToComponent.js +45 -0
- package/build/revamp/domain/mappers/layout/columnsLayoutToComponent.js +18 -0
- package/build/revamp/domain/mappers/layout/decisionLayoutToComponent.js +40 -0
- package/build/revamp/domain/mappers/layout/dividerLayoutToComponent.js +5 -0
- package/build/revamp/domain/mappers/layout/formLayoutToComponent.js +27 -0
- package/build/revamp/domain/mappers/layout/headingLayoutToComponent.js +13 -0
- package/build/revamp/domain/mappers/layout/imageLayoutToComponent.js +12 -0
- package/build/revamp/domain/mappers/layout/infoLayoutToComponent.js +12 -0
- package/build/revamp/domain/mappers/layout/instructionsLayoutToComponent.js +18 -0
- package/build/revamp/domain/mappers/layout/listLayoutToComponent.js +30 -0
- package/build/revamp/domain/mappers/layout/loadingIndicatorLayoutToComponent.js +5 -0
- package/build/revamp/domain/mappers/layout/markdownLayoutToComponent.js +12 -0
- package/build/revamp/domain/mappers/layout/modalLayoutToComponent.js +17 -0
- package/build/revamp/domain/mappers/layout/paragraphLayoutToComponent.js +12 -0
- package/build/revamp/domain/mappers/layout/reviewLayoutToComponent.js +51 -0
- package/build/revamp/domain/mappers/layout/searchLayoutToComponent.js +14 -0
- package/build/revamp/domain/mappers/layout/statusListLayoutToComponent.js +11 -0
- package/build/revamp/domain/mappers/mapLayoutToComponent.js +63 -0
- package/build/revamp/domain/mappers/mapSchemaToComponent.js +84 -0
- package/build/revamp/domain/mappers/mapSchemaToComponent.spec.js +197 -0
- package/build/revamp/domain/mappers/mapStepToComponent.js +146 -0
- package/build/revamp/domain/mappers/mapStepToComponent.spec.js +162 -0
- package/build/revamp/domain/mappers/mapUnreferencedSchemas.js +44 -0
- package/build/revamp/domain/mappers/schema/allOfSchemaToComponent.js +29 -0
- package/build/revamp/domain/mappers/schema/arraySchemaToComponent/arraySchemaToComponent.js +42 -0
- package/build/revamp/domain/mappers/schema/arraySchemaToComponent/arraySchemaToMultiSelectComponent.js +54 -0
- package/build/revamp/domain/mappers/schema/arraySchemaToComponent/arraySchemaToMultiUploadComponent.js +64 -0
- package/build/revamp/domain/mappers/schema/arraySchemaToComponent/arraySchemaToRepeatableComponent.js +66 -0
- package/build/revamp/domain/mappers/schema/blobSchemaToComponent.js +30 -0
- package/build/revamp/domain/mappers/schema/booleanSchemaToComponent.js +38 -0
- package/build/revamp/domain/mappers/schema/constSchemaToComponent.js +14 -0
- package/build/revamp/domain/mappers/schema/integerSchemaToComponent.js +36 -0
- package/build/revamp/domain/mappers/schema/numberSchemaToComponent.js +35 -0
- package/build/revamp/domain/mappers/schema/objectSchemaToComponent/objectSchemaToComponent.js +60 -0
- package/build/revamp/domain/mappers/schema/objectSchemaToComponent/objectSchemaToComponent.spec.js +165 -0
- package/build/revamp/domain/mappers/schema/oneOfSchemaToComponent/oneOfSchemaToComponent.js +67 -0
- package/build/revamp/domain/mappers/schema/oneOfSchemaToComponent/oneOfSchemaToComponent.spec.js +316 -0
- package/build/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToComponent.js +14 -0
- package/build/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToComponent.spec.js +220 -0
- package/build/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToDateInputComponent.js +37 -0
- package/build/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToTextInputComponent.js +45 -0
- package/build/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToUploadInputComponent.js +37 -0
- package/build/revamp/domain/mappers/schema/tests/test-utils.js +27 -0
- package/build/revamp/domain/mappers/schema/types.js +1 -0
- package/build/revamp/domain/mappers/schema/utils/getPersistAsyncInitialState.js +35 -0
- package/build/revamp/domain/mappers/schema/utils/getValidationAsyncInitialState.js +25 -0
- package/build/revamp/domain/mappers/schema/utils/mapCommonSchemaProps.js +28 -0
- package/build/revamp/domain/mappers/types.js +1 -0
- package/build/revamp/domain/mappers/utils/getAutocompleteString.js +76 -0
- package/build/revamp/domain/mappers/utils/getAutocompleteString.spec.js +21 -0
- package/build/revamp/domain/mappers/utils/getRandomId.js +2 -0
- package/build/revamp/domain/mappers/utils/inlineAction.js +23 -0
- package/build/revamp/domain/mappers/utils/legacy-utils.js +53 -0
- package/build/revamp/domain/types.js +1 -0
- package/build/revamp/flow/executeRefresh.js +97 -0
- package/build/revamp/flow/executeSubmission.js +160 -0
- package/build/revamp/flow/getResponseType.js +76 -0
- package/build/revamp/flow/response-utils.js +92 -0
- package/build/revamp/renderers/CoreContainerRenderer.js +8 -0
- package/build/revamp/renderers/getRenderFunction.js +62 -0
- package/build/revamp/renderers/getSchemaErrorMessageFunction.js +90 -0
- package/build/revamp/renderers/mappers/alertComponentToProps.js +4 -0
- package/build/revamp/renderers/mappers/allOfComponentToProps.js +11 -0
- package/build/revamp/renderers/mappers/booleanInputComponentToProps.js +16 -0
- package/build/revamp/renderers/mappers/boxComponentToProps.js +4 -0
- package/build/revamp/renderers/mappers/buttonComponentToProps.js +14 -0
- package/build/revamp/renderers/mappers/columnsComponentToProps.js +4 -0
- package/build/revamp/renderers/mappers/componentToRendererProps.js +108 -0
- package/build/revamp/renderers/mappers/containerComponentToProps.js +4 -0
- package/build/revamp/renderers/mappers/dateInputComponentToProps.js +13 -0
- package/build/revamp/renderers/mappers/decisionComponentToProps.js +4 -0
- package/build/revamp/renderers/mappers/dividerComponentToProps.js +4 -0
- package/build/revamp/renderers/mappers/formComponentToProps.js +4 -0
- package/build/revamp/renderers/mappers/headingComponentToProps.js +11 -0
- package/build/revamp/renderers/mappers/hiddenComponentToProps.js +3 -0
- package/build/revamp/renderers/mappers/imageComponentToProps.js +11 -0
- package/build/revamp/renderers/mappers/instructionsComponentToProps.js +10 -0
- package/build/revamp/renderers/mappers/integerInputComponentToProps.js +13 -0
- package/build/revamp/renderers/mappers/loadingIndicatorComponentToProps.js +9 -0
- package/build/revamp/renderers/mappers/markdownComponentToProps.js +10 -0
- package/build/revamp/renderers/mappers/modalComponentToProps.js +10 -0
- package/build/revamp/renderers/mappers/multiSelectComponentToProps.js +28 -0
- package/build/revamp/renderers/mappers/multiUploadInputComponentToProps.js +24 -0
- package/build/revamp/renderers/mappers/numberInputComponentToProps.js +13 -0
- package/build/revamp/renderers/mappers/objectComponentToProps.js +11 -0
- package/build/revamp/renderers/mappers/paragraphComponentToProps.js +10 -0
- package/build/revamp/renderers/mappers/repeatableComponentToProps.js +40 -0
- package/build/revamp/renderers/mappers/reviewComponentToProps.js +11 -0
- package/build/revamp/renderers/mappers/searchComponentToProps.js +53 -0
- package/build/revamp/renderers/mappers/selectInputComponentToProps.js +29 -0
- package/build/revamp/renderers/mappers/statusListComponentToProps.js +10 -0
- package/build/revamp/renderers/mappers/textInputComponentToProps.js +13 -0
- package/build/revamp/renderers/mappers/uploadInputComponentToProps.js +16 -0
- package/build/revamp/renderers/mappers/utils/inputComponentToProps.js +27 -0
- package/build/revamp/renderers/stepComponentToProps.js +16 -0
- package/build/revamp/renderers/types.js +1 -0
- package/build/revamp/stories/dev-tools/ActionResponse.story.js +101 -0
- package/build/revamp/stories/dev-tools/DynamicFlowRevamp.story.js +314 -0
- package/build/revamp/stories/dev-tools/EditableStep.story.js +73 -0
- package/build/revamp/stories/dev-tools/ErrorHandling.story.js +149 -0
- package/build/revamp/stories/dev-tools/External.story.js +83 -0
- package/build/revamp/stories/dev-tools/OneOf.Inititalisation.story.js +123 -0
- package/build/revamp/stories/dev-tools/PersistAsync.story.js +168 -0
- package/build/revamp/stories/dev-tools/Polling.story.js +79 -0
- package/build/revamp/stories/dev-tools/RefreshOnChange.story.js +309 -0
- package/build/revamp/stories/dev-tools/RefreshOnChange.with.PersistAsync.story.js +1004 -0
- package/build/revamp/stories/dev-tools/SearchFeature.story.js +263 -0
- package/build/revamp/stories/dev-tools/ServerTest.story.js +86 -0
- package/build/revamp/stories/dev-tools/Upload.story.js +221 -0
- package/build/revamp/stories/dev-tools/ValidationAsync.story.js +161 -0
- package/build/revamp/stories/examples/KYCCameraStep.story.js +84 -0
- package/build/revamp/stories/examples/ObjectConst.story.js +153 -0
- package/build/revamp/stories/examples/OneOfInitialisation.story.js +102 -0
- package/build/revamp/stories/utils/fixtureHttpClient.js +130 -0
- package/build/revamp/stories/utils/mockSearchHandler.js +125 -0
- package/build/revamp/test-utils/component-utils.js +19 -0
- package/build/revamp/test-utils/step-utils.js +6 -0
- package/build/revamp/tests/ImageRenderer.spec.js +108 -0
- package/build/revamp/tests/InitialAction.spec.js +299 -0
- package/build/revamp/tests/InitialStep.spec.js +226 -0
- package/build/revamp/tests/Logging.spec.js +112 -0
- package/build/revamp/tests/OneOfInitialisation.spec.js +889 -0
- package/build/revamp/tests/Polling.spec.js +611 -0
- package/build/revamp/tests/RefreshOnChange.ResponseHandling.spec.js +322 -0
- package/build/revamp/tests/RefreshOnChange.with.Segmented.spec.js +447 -0
- package/build/revamp/tests/RefreshOnChange.with.Tabs.spec.js +447 -0
- package/build/revamp/tests/RefreshOnChangePreserve.spec.js +341 -0
- package/build/revamp/tests/Rerendering.spec.js +156 -0
- package/build/revamp/tests/SegmentedControl.spec.js +48 -0
- package/build/revamp/tests/Submission.ResponseHandling.spec.js +697 -0
- package/build/revamp/tests/Submission.spec.js +590 -0
- package/build/revamp/tests/legacy/Actions.spec.js +242 -0
- package/build/revamp/tests/legacy/BackButton.spec.js +189 -0
- package/build/revamp/tests/legacy/HiddenSchemas.spec.js +312 -0
- package/build/revamp/tests/legacy/MultiSelect.spec.js +753 -0
- package/build/revamp/tests/legacy/MultipleFileUploadSchema.spec.js +447 -0
- package/build/revamp/tests/legacy/PersistAsync.blob-schema.spec.js +339 -0
- package/build/revamp/tests/legacy/PersistAsync.string-schema.spec.js +385 -0
- package/build/revamp/tests/legacy/RefreshStepOnChange.debouncing.spec.js +352 -0
- package/build/revamp/tests/legacy/RefreshStepOnChange.spec.js +638 -0
- package/build/revamp/tests/legacy/Search.spec.js +501 -0
- package/build/revamp/tests/legacy/ValidationAsync.spec.js +452 -0
- package/build/revamp/tests/legacy/useExternal.spec.js +235 -0
- package/build/revamp/types.js +1 -0
- package/build/revamp/useDynamicFlowCore.js +298 -0
- package/build/revamp/utils/component-utils.js +86 -0
- package/build/revamp/utils/component-utils.spec.js +385 -0
- package/build/revamp/utils/findComponent.js +29 -0
- package/build/revamp/utils/findComponent.spec.js +92 -0
- package/build/revamp/utils/type-utils.js +59 -0
- package/build/revamp/utils/type-validators.js +16 -0
- package/build/revamp/utils/type-validators.spec.js +163 -0
- package/build/revamp/utils/useStableCallback.js +21 -0
- package/build/revamp/visual-tests/generated.story.js +234 -0
- package/build/revamp/visual-tests/layouts.story.js +132 -0
- package/build/revamp/visual-tests/schemas.story.js +108 -0
- package/build/revamp/visual-tests/step.story.js +54 -0
- package/build/revamp/wise/renderers/AlertRenderer.js +11 -0
- package/build/revamp/wise/renderers/BooleanInputRenderer.js +34 -0
- package/build/revamp/wise/renderers/BoxRenderer.js +19 -0
- package/build/revamp/wise/renderers/ButtonRenderer.js +53 -0
- package/build/revamp/wise/renderers/ColumnsRenderer.js +14 -0
- package/build/revamp/wise/renderers/DateInputRenderer.js +35 -0
- package/build/revamp/wise/renderers/DecisionRenderer.js +18 -0
- package/build/revamp/wise/renderers/DividerRenderer.js +10 -0
- package/build/revamp/wise/renderers/FormRenderer.js +10 -0
- package/build/revamp/wise/renderers/FormSectionRenderer.js +16 -0
- package/build/revamp/wise/renderers/HeadingRenderer.js +57 -0
- package/build/revamp/wise/renderers/ImageRenderer.js +112 -0
- package/build/revamp/wise/renderers/InstructionsRenderer.js +23 -0
- package/build/revamp/wise/renderers/IntegerInputRenderer.js +38 -0
- package/build/revamp/wise/renderers/LoadingIndicatorRenderer.js +11 -0
- package/build/revamp/wise/renderers/MarkdownRenderer.js +11 -0
- package/build/revamp/wise/renderers/ModalRenderer.js +25 -0
- package/build/revamp/wise/renderers/MultiSelectInputRenderer.js +84 -0
- package/build/revamp/wise/renderers/MultiUploadInputRenderer.js +63 -0
- package/build/revamp/wise/renderers/NumberInputRenderer.js +38 -0
- package/build/revamp/wise/renderers/ParagraphRenderer.js +45 -0
- package/build/revamp/wise/renderers/RepeatableRenderer.js +58 -0
- package/build/revamp/wise/renderers/ReviewRenderer.js +50 -0
- package/build/revamp/wise/renderers/SearchRenderer/BlockSearchRendererComponent.js +59 -0
- package/build/revamp/wise/renderers/SearchRenderer/ErrorResult.js +11 -0
- package/build/revamp/wise/renderers/SearchRenderer/InlineSearchRendererComponent.js +63 -0
- package/build/revamp/wise/renderers/SearchRenderer/SearchRenderer.js +21 -0
- package/build/revamp/wise/renderers/SelectInputRenderer/OptionMedia.js +16 -0
- package/build/revamp/wise/renderers/SelectInputRenderer/RadioInputRendererComponent.js +14 -0
- package/build/revamp/wise/renderers/SelectInputRenderer/RadioInputRendererComponent.spec.js +76 -0
- package/build/revamp/wise/renderers/SelectInputRenderer/SegmentedInputRendererComponent.js +21 -0
- package/build/revamp/wise/renderers/SelectInputRenderer/SelectInputRenderer.js +33 -0
- package/build/revamp/wise/renderers/SelectInputRenderer/SelectInputRendererComponent.js +56 -0
- package/build/revamp/wise/renderers/SelectInputRenderer/SelectTriggerMedia.js +16 -0
- package/build/revamp/wise/renderers/SelectInputRenderer/TabInputRendererComponent.js +22 -0
- package/build/revamp/wise/renderers/StatusListRenderer.js +21 -0
- package/build/revamp/wise/renderers/TextInputRenderer.js +35 -0
- package/build/revamp/wise/renderers/UploadInputRenderer.js +136 -0
- package/build/revamp/wise/renderers/components/FieldInput.js +9 -0
- package/build/revamp/wise/renderers/components/Help.js +10 -0
- package/build/revamp/wise/renderers/components/LabelContentWithHelp.js +6 -0
- package/build/revamp/wise/renderers/components/UploadFieldInput.js +14 -0
- package/build/revamp/wise/renderers/components/VariableDateInput.js +36 -0
- package/build/revamp/wise/renderers/components/VariableTextInput.js +69 -0
- package/build/revamp/wise/renderers/components/icon/DynamicIcon.js +17 -0
- package/build/revamp/wise/renderers/components/icon/FlagIcon.js +11 -0
- package/build/revamp/wise/renderers/components/icon/NamedIcon.js +19 -0
- package/build/revamp/wise/renderers/components/icon/NavigationOptionMedia.js +20 -0
- package/build/revamp/wise/renderers/getWiseRenderers.js +61 -0
- package/build/revamp/wise/renderers/hooks/useSnackBarIfAvailable.js +6 -0
- package/build/revamp/wise/renderers/step/BackButton.js +11 -0
- package/build/revamp/wise/renderers/step/ExternalConfirmationDialog.js +20 -0
- package/build/revamp/wise/renderers/step/KYCCameraStepRenderer.js +144 -0
- package/build/revamp/wise/renderers/step/StepRenderer.js +31 -0
- package/build/revamp/wise/renderers/step/StepRendererContext.js +11 -0
- package/build/revamp/wise/renderers/step/useExternal.js +15 -0
- package/build/revamp/wise/renderers/utils/file-utils.js +70 -0
- package/build/revamp/wise/renderers/utils/getRandomId.js +2 -0
- package/build/revamp/wise/renderers/utils/input-utils.js +6 -0
- package/build/revamp/wise/renderers/utils/layout-utils.js +31 -0
- package/build/revamp/wise/renderers/utils/value-utils.js +23 -0
- package/build/revamp/wise/renderers/utils/value-utils.spec.js +33 -0
- package/build/revamp/wise/renderers/validators/type-validators.js +15 -0
- package/build/test-utils/NeptuneProviders.js +23 -0
- package/build/test-utils/fetch-utils.js +104 -0
- package/build/test-utils/index.js +2 -0
- package/build/test-utils/rtl-utils.js +20 -0
- package/build/types/common/cameraCapture/CameraCapture.d.ts +3 -4
- package/build/types/common/cameraCapture/CameraEventHandler.d.ts +2 -0
- package/build/types/common/cameraCapture/hooks/useFullScreenOrientationLock.d.ts +1 -1
- package/build/types/common/cameraCapture/index.d.ts +1 -0
- package/build/types/common/cameraCapture/tracking/index.d.ts +1 -1
- package/build/types/index.d.ts +2 -0
- package/build/types/legacy/dynamic-flow-types.d.ts +1 -1
- package/build/types/revamp/domain/components/StepDomainComponent.d.ts +6 -4
- package/build/types/revamp/domain/mappers/mapUnreferencedSchemas.d.ts +3 -0
- package/build/types/revamp/renderers/stepComponentToProps.d.ts +1 -1
- package/build/types/revamp/renderers/types.d.ts +5 -1
- package/build/types/revamp/wise/renderers/step/KYCCameraStepRenderer.d.ts +2 -0
- package/package.json +1 -1
package/build/main.mjs
CHANGED
|
@@ -1269,16 +1269,28 @@ var isStringSchemaWithUpload = (schema) => isStringSchema(schema) && schema.form
|
|
|
1269
1269
|
var isSchemaWithPersistAsync = (schema) => "persistAsync" in schema && !isNullish(schema.persistAsync);
|
|
1270
1270
|
|
|
1271
1271
|
// src/revamp/renderers/stepComponentToProps.ts
|
|
1272
|
-
var stepComponentToProps = ({
|
|
1272
|
+
var stepComponentToProps = ({
|
|
1273
|
+
back,
|
|
1274
|
+
description,
|
|
1275
|
+
error,
|
|
1276
|
+
external,
|
|
1277
|
+
loadingState,
|
|
1278
|
+
step,
|
|
1279
|
+
title,
|
|
1280
|
+
trackEvent,
|
|
1281
|
+
onAction
|
|
1282
|
+
}, children) => ({
|
|
1273
1283
|
type: "step",
|
|
1274
1284
|
back,
|
|
1275
1285
|
description,
|
|
1276
1286
|
error,
|
|
1277
1287
|
external,
|
|
1278
1288
|
loadingState,
|
|
1289
|
+
step,
|
|
1279
1290
|
title,
|
|
1291
|
+
children,
|
|
1280
1292
|
trackEvent,
|
|
1281
|
-
|
|
1293
|
+
onAction
|
|
1282
1294
|
});
|
|
1283
1295
|
|
|
1284
1296
|
// src/revamp/renderers/mappers/alertComponentToProps.ts
|
|
@@ -1793,12 +1805,14 @@ var getRenderFunction = (renderers) => {
|
|
|
1793
1805
|
if (type === "hidden") {
|
|
1794
1806
|
return null;
|
|
1795
1807
|
}
|
|
1796
|
-
const renderer = renderers.find(
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1808
|
+
const renderer = renderers.find(({ canRenderType, canRender = () => true }) => {
|
|
1809
|
+
try {
|
|
1810
|
+
return canRenderType === type && canRender(props);
|
|
1811
|
+
} catch (e) {
|
|
1812
|
+
console.error(`Error in canRender function for ${type}`, e);
|
|
1813
|
+
return false;
|
|
1814
|
+
}
|
|
1815
|
+
});
|
|
1802
1816
|
if (!renderer) {
|
|
1803
1817
|
throw new Error(`Could not find a renderer for ${type}`);
|
|
1804
1818
|
}
|
|
@@ -5660,21 +5674,13 @@ var z = /* @__PURE__ */ Object.freeze({
|
|
|
5660
5674
|
quotelessJson,
|
|
5661
5675
|
ZodError
|
|
5662
5676
|
});
|
|
5663
|
-
var
|
|
5664
|
-
|
|
5665
|
-
|
|
5666
|
-
|
|
5667
|
-
|
|
5668
|
-
|
|
5669
|
-
z.literal("GET"),
|
|
5670
|
-
z.literal("POST"),
|
|
5671
|
-
z.literal("PUT"),
|
|
5672
|
-
z.literal("PATCH"),
|
|
5673
|
-
z.literal("DELETE")
|
|
5677
|
+
var sizeSchema = z.union([
|
|
5678
|
+
z.literal("xs"),
|
|
5679
|
+
z.literal("sm"),
|
|
5680
|
+
z.literal("md"),
|
|
5681
|
+
z.literal("lg"),
|
|
5682
|
+
z.literal("xl")
|
|
5674
5683
|
]);
|
|
5675
|
-
var iconNamedSchema = z.object({
|
|
5676
|
-
name: z.string()
|
|
5677
|
-
});
|
|
5678
5684
|
var contextSchema = z.union([
|
|
5679
5685
|
z.literal("positive"),
|
|
5680
5686
|
z.literal("neutral"),
|
|
@@ -5685,18 +5691,114 @@ var contextSchema = z.union([
|
|
|
5685
5691
|
z.literal("info"),
|
|
5686
5692
|
z.literal("primary")
|
|
5687
5693
|
]);
|
|
5688
|
-
var
|
|
5689
|
-
|
|
5690
|
-
|
|
5691
|
-
|
|
5692
|
-
|
|
5693
|
-
|
|
5694
|
-
z.literal("
|
|
5695
|
-
z.literal("
|
|
5696
|
-
z.literal("
|
|
5694
|
+
var columnsLayoutBiasSchema = z.union([
|
|
5695
|
+
z.literal("none"),
|
|
5696
|
+
z.literal("left"),
|
|
5697
|
+
z.literal("right")
|
|
5698
|
+
]);
|
|
5699
|
+
var statusListLayoutStatusSchema = z.union([
|
|
5700
|
+
z.literal("not-done"),
|
|
5701
|
+
z.literal("pending"),
|
|
5702
|
+
z.literal("done")
|
|
5697
5703
|
]);
|
|
5698
5704
|
var alignSchema = z.union([z.literal("left"), z.literal("center"), z.literal("right")]);
|
|
5699
|
-
var
|
|
5705
|
+
var formLayoutSchemaReferenceSchema = z.object({
|
|
5706
|
+
$ref: z.string()
|
|
5707
|
+
});
|
|
5708
|
+
var modalLayoutTriggerSchema = z.object({
|
|
5709
|
+
title: z.string()
|
|
5710
|
+
});
|
|
5711
|
+
var httpMethodSchema = z.union([
|
|
5712
|
+
z.literal("GET"),
|
|
5713
|
+
z.literal("POST"),
|
|
5714
|
+
z.literal("PUT"),
|
|
5715
|
+
z.literal("PATCH"),
|
|
5716
|
+
z.literal("DELETE")
|
|
5717
|
+
]);
|
|
5718
|
+
var dividerLayoutSchema = z.object({
|
|
5719
|
+
type: z.literal("divider"),
|
|
5720
|
+
control: z.string().optional(),
|
|
5721
|
+
margin: sizeSchema.optional()
|
|
5722
|
+
});
|
|
5723
|
+
var listLayoutStatusSchema = z.union([
|
|
5724
|
+
z.literal("warning"),
|
|
5725
|
+
z.literal("neutral"),
|
|
5726
|
+
z.literal("positive")
|
|
5727
|
+
]);
|
|
5728
|
+
var headingLayoutSchema = z.object({
|
|
5729
|
+
type: z.literal("heading"),
|
|
5730
|
+
text: z.string(),
|
|
5731
|
+
size: sizeSchema.optional(),
|
|
5732
|
+
align: alignSchema.optional(),
|
|
5733
|
+
control: z.string().optional(),
|
|
5734
|
+
margin: sizeSchema.optional()
|
|
5735
|
+
});
|
|
5736
|
+
var alertLayoutSchema = z.object({
|
|
5737
|
+
type: z.literal("alert"),
|
|
5738
|
+
markdown: z.string(),
|
|
5739
|
+
context: contextSchema.optional(),
|
|
5740
|
+
control: z.string().optional(),
|
|
5741
|
+
margin: sizeSchema.optional()
|
|
5742
|
+
});
|
|
5743
|
+
var formLayoutSchema = z.object({
|
|
5744
|
+
type: z.literal("form"),
|
|
5745
|
+
schema: formLayoutSchemaReferenceSchema.optional(),
|
|
5746
|
+
schemaId: z.string(),
|
|
5747
|
+
control: z.string().optional(),
|
|
5748
|
+
margin: sizeSchema.optional()
|
|
5749
|
+
});
|
|
5750
|
+
var imageLayoutSchema = z.object({
|
|
5751
|
+
type: z.literal("image"),
|
|
5752
|
+
text: z.string().optional(),
|
|
5753
|
+
url: z.string(),
|
|
5754
|
+
size: sizeSchema.optional(),
|
|
5755
|
+
accessibilityDescription: z.string().optional(),
|
|
5756
|
+
control: z.string().optional(),
|
|
5757
|
+
margin: sizeSchema.optional()
|
|
5758
|
+
});
|
|
5759
|
+
var infoLayoutSchema = z.object({
|
|
5760
|
+
type: z.literal("info"),
|
|
5761
|
+
markdown: z.string(),
|
|
5762
|
+
align: alignSchema.optional(),
|
|
5763
|
+
control: z.string().optional(),
|
|
5764
|
+
margin: sizeSchema.optional()
|
|
5765
|
+
});
|
|
5766
|
+
var loadingIndicatorLayoutSchema = z.object({
|
|
5767
|
+
type: z.literal("loading-indicator"),
|
|
5768
|
+
size: sizeSchema.optional(),
|
|
5769
|
+
control: z.string().optional(),
|
|
5770
|
+
margin: sizeSchema.optional()
|
|
5771
|
+
});
|
|
5772
|
+
var paragraphLayoutSchema = z.object({
|
|
5773
|
+
type: z.literal("paragraph"),
|
|
5774
|
+
text: z.string(),
|
|
5775
|
+
align: alignSchema.optional(),
|
|
5776
|
+
control: z.string().optional(),
|
|
5777
|
+
margin: sizeSchema.optional()
|
|
5778
|
+
});
|
|
5779
|
+
var instructionsLayoutItemSchema = z.object({
|
|
5780
|
+
text: z.string(),
|
|
5781
|
+
context: contextSchema
|
|
5782
|
+
});
|
|
5783
|
+
var helpSchema = z.object({
|
|
5784
|
+
markdown: z.string()
|
|
5785
|
+
});
|
|
5786
|
+
var imageSchema = z.object({
|
|
5787
|
+
text: z.string().optional(),
|
|
5788
|
+
url: z.string(),
|
|
5789
|
+
accessibilityDescription: z.string().optional()
|
|
5790
|
+
});
|
|
5791
|
+
var summaryProviderSchema = z.object({
|
|
5792
|
+
providesTitle: z.boolean().optional(),
|
|
5793
|
+
providesDescription: z.boolean().optional(),
|
|
5794
|
+
providesIcon: z.boolean().optional(),
|
|
5795
|
+
providesImage: z.boolean().optional()
|
|
5796
|
+
});
|
|
5797
|
+
var validateAsyncSchema = z.object({
|
|
5798
|
+
param: z.string(),
|
|
5799
|
+
method: httpMethodSchema,
|
|
5800
|
+
url: z.string()
|
|
5801
|
+
});
|
|
5700
5802
|
var autocompleteTokenSchema = z.union([
|
|
5701
5803
|
z.literal("on"),
|
|
5702
5804
|
z.literal("name"),
|
|
@@ -5762,207 +5864,98 @@ var autocompleteTokenSchema = z.union([
|
|
|
5762
5864
|
z.literal("fax"),
|
|
5763
5865
|
z.literal("pager")
|
|
5764
5866
|
]);
|
|
5765
|
-
var
|
|
5766
|
-
|
|
5767
|
-
|
|
5768
|
-
|
|
5769
|
-
|
|
5867
|
+
var stringSchemaFormatSchema = z.union([
|
|
5868
|
+
z.literal("date"),
|
|
5869
|
+
z.literal("email"),
|
|
5870
|
+
z.literal("numeric"),
|
|
5871
|
+
z.literal("password"),
|
|
5872
|
+
z.literal("phone-number"),
|
|
5873
|
+
z.literal("base64url")
|
|
5874
|
+
]);
|
|
5875
|
+
var jsonElementSchema = z.lazy(
|
|
5876
|
+
() => z.union([
|
|
5877
|
+
z.string(),
|
|
5878
|
+
z.number(),
|
|
5879
|
+
z.boolean(),
|
|
5880
|
+
z.record(jsonElementSchema),
|
|
5881
|
+
z.array(jsonElementSchema)
|
|
5882
|
+
]).nullable()
|
|
5883
|
+
);
|
|
5884
|
+
var uploadSourceSchema = z.union([z.literal("camera"), z.literal("file")]);
|
|
5885
|
+
var externalSchema = z.object({
|
|
5886
|
+
url: z.string()
|
|
5770
5887
|
});
|
|
5771
|
-
var
|
|
5772
|
-
|
|
5773
|
-
|
|
5774
|
-
context: contextSchema.optional(),
|
|
5775
|
-
control: z.string().optional(),
|
|
5776
|
-
margin: sizeSchema.optional()
|
|
5888
|
+
var stepErrorSchema = z.object({
|
|
5889
|
+
error: z.string().optional(),
|
|
5890
|
+
validation: jsonElementSchema.optional()
|
|
5777
5891
|
});
|
|
5778
|
-
var
|
|
5779
|
-
|
|
5780
|
-
|
|
5892
|
+
var errorResponseBodySchema = z.object({
|
|
5893
|
+
refreshFormUrl: z.string().optional(),
|
|
5894
|
+
analytics: z.record(z.string()).optional(),
|
|
5895
|
+
error: z.string().optional(),
|
|
5896
|
+
validation: jsonElementSchema.optional(),
|
|
5897
|
+
refreshUrl: z.string().optional()
|
|
5898
|
+
});
|
|
5899
|
+
var searchSearchRequestSchema = z.object({
|
|
5900
|
+
url: z.string(),
|
|
5901
|
+
method: httpMethodSchema,
|
|
5902
|
+
param: z.string(),
|
|
5903
|
+
query: z.string()
|
|
5904
|
+
});
|
|
5905
|
+
var navigationStackBehaviorSchema = z.union([
|
|
5906
|
+
z.literal("default"),
|
|
5907
|
+
z.literal("remove-previous"),
|
|
5908
|
+
z.literal("remove-all"),
|
|
5909
|
+
z.literal("replace-current")
|
|
5910
|
+
]);
|
|
5911
|
+
var actionTypeSchema = z.union([
|
|
5912
|
+
z.literal("primary"),
|
|
5913
|
+
z.literal("secondary"),
|
|
5914
|
+
z.literal("link"),
|
|
5915
|
+
z.literal("positive"),
|
|
5916
|
+
z.literal("negative")
|
|
5917
|
+
]);
|
|
5918
|
+
var iconNamedSchema = z.object({
|
|
5919
|
+
name: z.string()
|
|
5920
|
+
});
|
|
5921
|
+
var iconTextSchema = z.object({
|
|
5922
|
+
text: z.string()
|
|
5923
|
+
});
|
|
5924
|
+
var actionSchema = z.object({
|
|
5925
|
+
title: z.string().optional(),
|
|
5926
|
+
type: actionTypeSchema.optional(),
|
|
5927
|
+
disabled: z.boolean().optional(),
|
|
5928
|
+
$id: z.string().optional(),
|
|
5929
|
+
$ref: z.string().optional(),
|
|
5930
|
+
id: z.string().optional(),
|
|
5931
|
+
url: z.string().optional(),
|
|
5932
|
+
method: httpMethodSchema.optional(),
|
|
5933
|
+
exit: z.boolean().optional(),
|
|
5934
|
+
result: jsonElementSchema.optional(),
|
|
5935
|
+
data: jsonElementSchema.optional(),
|
|
5936
|
+
timeout: z.number().optional(),
|
|
5937
|
+
skipValidation: z.boolean().optional()
|
|
5938
|
+
});
|
|
5939
|
+
var markdownLayoutSchema = z.object({
|
|
5940
|
+
type: z.literal("markdown"),
|
|
5941
|
+
content: z.string(),
|
|
5781
5942
|
align: alignSchema.optional(),
|
|
5782
5943
|
control: z.string().optional(),
|
|
5783
5944
|
margin: sizeSchema.optional()
|
|
5784
5945
|
});
|
|
5785
|
-
var
|
|
5786
|
-
type: z.literal("
|
|
5946
|
+
var searchLayoutSchema = z.object({
|
|
5947
|
+
type: z.literal("search"),
|
|
5948
|
+
title: z.string(),
|
|
5949
|
+
method: httpMethodSchema,
|
|
5950
|
+
url: z.string(),
|
|
5951
|
+
param: z.string(),
|
|
5952
|
+
emptyMessage: z.string().optional(),
|
|
5787
5953
|
control: z.string().optional(),
|
|
5788
5954
|
margin: sizeSchema.optional()
|
|
5789
5955
|
});
|
|
5790
|
-
var
|
|
5791
|
-
z.literal("warning"),
|
|
5792
|
-
z.literal("neutral"),
|
|
5793
|
-
z.literal("positive")
|
|
5794
|
-
]);
|
|
5795
|
-
var formLayoutSchemaReferenceSchema = z.object({
|
|
5796
|
-
$ref: z.string()
|
|
5797
|
-
});
|
|
5798
|
-
var imageLayoutSchema = z.object({
|
|
5799
|
-
type: z.literal("image"),
|
|
5800
|
-
text: z.string().optional(),
|
|
5801
|
-
url: z.string(),
|
|
5802
|
-
size: sizeSchema.optional(),
|
|
5803
|
-
accessibilityDescription: z.string().optional(),
|
|
5804
|
-
control: z.string().optional(),
|
|
5805
|
-
margin: sizeSchema.optional()
|
|
5806
|
-
});
|
|
5807
|
-
var statusListLayoutStatusSchema = z.union([
|
|
5808
|
-
z.literal("not-done"),
|
|
5809
|
-
z.literal("pending"),
|
|
5810
|
-
z.literal("done")
|
|
5811
|
-
]);
|
|
5812
|
-
var instructionsLayoutItemSchema = z.object({
|
|
5813
|
-
text: z.string(),
|
|
5814
|
-
context: contextSchema
|
|
5815
|
-
});
|
|
5816
|
-
var modalLayoutTriggerSchema = z.object({
|
|
5817
|
-
title: z.string()
|
|
5818
|
-
});
|
|
5819
|
-
var searchLayoutSchema = z.object({
|
|
5820
|
-
type: z.literal("search"),
|
|
5821
|
-
title: z.string(),
|
|
5822
|
-
method: httpMethodSchema,
|
|
5823
|
-
url: z.string(),
|
|
5824
|
-
param: z.string(),
|
|
5825
|
-
emptyMessage: z.string().optional(),
|
|
5826
|
-
control: z.string().optional(),
|
|
5827
|
-
margin: sizeSchema.optional()
|
|
5828
|
-
});
|
|
5829
|
-
var infoLayoutSchema = z.object({
|
|
5830
|
-
type: z.literal("info"),
|
|
5831
|
-
markdown: z.string(),
|
|
5832
|
-
align: alignSchema.optional(),
|
|
5833
|
-
control: z.string().optional(),
|
|
5834
|
-
margin: sizeSchema.optional()
|
|
5835
|
-
});
|
|
5836
|
-
var formLayoutSchema = z.object({
|
|
5837
|
-
type: z.literal("form"),
|
|
5838
|
-
schema: formLayoutSchemaReferenceSchema.optional(),
|
|
5839
|
-
schemaId: z.string(),
|
|
5840
|
-
control: z.string().optional(),
|
|
5841
|
-
margin: sizeSchema.optional()
|
|
5842
|
-
});
|
|
5843
|
-
var headingLayoutSchema = z.object({
|
|
5844
|
-
type: z.literal("heading"),
|
|
5845
|
-
text: z.string(),
|
|
5846
|
-
size: sizeSchema.optional(),
|
|
5847
|
-
align: alignSchema.optional(),
|
|
5848
|
-
control: z.string().optional(),
|
|
5849
|
-
margin: sizeSchema.optional()
|
|
5850
|
-
});
|
|
5851
|
-
var markdownLayoutSchema = z.object({
|
|
5852
|
-
type: z.literal("markdown"),
|
|
5853
|
-
content: z.string(),
|
|
5854
|
-
align: alignSchema.optional(),
|
|
5855
|
-
control: z.string().optional(),
|
|
5856
|
-
margin: sizeSchema.optional()
|
|
5857
|
-
});
|
|
5858
|
-
var columnsLayoutBiasSchema = z.union([
|
|
5859
|
-
z.literal("none"),
|
|
5860
|
-
z.literal("left"),
|
|
5861
|
-
z.literal("right")
|
|
5862
|
-
]);
|
|
5863
|
-
var helpSchema = z.object({
|
|
5864
|
-
markdown: z.string()
|
|
5865
|
-
});
|
|
5866
|
-
var searchSearchRequestSchema = z.object({
|
|
5867
|
-
url: z.string(),
|
|
5868
|
-
method: httpMethodSchema,
|
|
5869
|
-
param: z.string(),
|
|
5870
|
-
query: z.string()
|
|
5871
|
-
});
|
|
5872
|
-
var jsonElementSchema = z.lazy(
|
|
5873
|
-
() => z.union([
|
|
5874
|
-
z.string(),
|
|
5875
|
-
z.number(),
|
|
5876
|
-
z.boolean(),
|
|
5877
|
-
z.record(jsonElementSchema),
|
|
5878
|
-
z.array(jsonElementSchema)
|
|
5879
|
-
]).nullable()
|
|
5880
|
-
);
|
|
5881
|
-
var externalSchema = z.object({
|
|
5882
|
-
url: z.string()
|
|
5883
|
-
});
|
|
5884
|
-
var stepErrorSchema = z.object({
|
|
5885
|
-
error: z.string().optional(),
|
|
5886
|
-
validation: jsonElementSchema.optional()
|
|
5887
|
-
});
|
|
5888
|
-
var stringSchemaFormatSchema = z.union([
|
|
5889
|
-
z.literal("date"),
|
|
5890
|
-
z.literal("email"),
|
|
5891
|
-
z.literal("numeric"),
|
|
5892
|
-
z.literal("password"),
|
|
5893
|
-
z.literal("phone-number"),
|
|
5894
|
-
z.literal("base64url")
|
|
5895
|
-
]);
|
|
5896
|
-
var summarySummariserSchema = z.object({
|
|
5897
|
-
defaultTitle: z.string().optional(),
|
|
5898
|
-
defaultDescription: z.string().optional(),
|
|
5899
|
-
defaultIcon: iconSchema.optional(),
|
|
5900
|
-
defaultImage: imageLayoutSchema.optional(),
|
|
5901
|
-
providesTitle: z.boolean().optional(),
|
|
5902
|
-
providesDescription: z.boolean().optional(),
|
|
5903
|
-
providesIcon: z.boolean().optional(),
|
|
5904
|
-
providesImage: z.boolean().optional()
|
|
5905
|
-
});
|
|
5906
|
-
var validateAsyncSchema = z.object({
|
|
5907
|
-
param: z.string(),
|
|
5908
|
-
method: httpMethodSchema,
|
|
5909
|
-
url: z.string()
|
|
5910
|
-
});
|
|
5911
|
-
var summaryProviderSchema = z.object({
|
|
5912
|
-
providesTitle: z.boolean().optional(),
|
|
5913
|
-
providesDescription: z.boolean().optional(),
|
|
5914
|
-
providesIcon: z.boolean().optional(),
|
|
5915
|
-
providesImage: z.boolean().optional()
|
|
5916
|
-
});
|
|
5917
|
-
var uploadSourceSchema = z.union([z.literal("camera"), z.literal("file")]);
|
|
5918
|
-
var navigationStackBehaviorSchema = z.union([
|
|
5919
|
-
z.literal("default"),
|
|
5920
|
-
z.literal("remove-previous"),
|
|
5921
|
-
z.literal("remove-all"),
|
|
5922
|
-
z.literal("replace-current")
|
|
5923
|
-
]);
|
|
5924
|
-
var actionTypeSchema = z.union([
|
|
5925
|
-
z.literal("primary"),
|
|
5926
|
-
z.literal("secondary"),
|
|
5927
|
-
z.literal("link"),
|
|
5928
|
-
z.literal("positive"),
|
|
5929
|
-
z.literal("negative")
|
|
5930
|
-
]);
|
|
5931
|
-
var summarySchema = z.union([summaryProviderSchema, summarySummariserSchema]);
|
|
5932
|
-
var actionSchema = z.object({
|
|
5933
|
-
title: z.string().optional(),
|
|
5934
|
-
type: actionTypeSchema.optional(),
|
|
5935
|
-
disabled: z.boolean().optional(),
|
|
5936
|
-
$id: z.string().optional(),
|
|
5937
|
-
$ref: z.string().optional(),
|
|
5938
|
-
id: z.string().optional(),
|
|
5939
|
-
url: z.string().optional(),
|
|
5940
|
-
method: httpMethodSchema.optional(),
|
|
5941
|
-
exit: z.boolean().optional(),
|
|
5942
|
-
result: jsonElementSchema.optional(),
|
|
5943
|
-
data: jsonElementSchema.optional(),
|
|
5944
|
-
timeout: z.number().optional(),
|
|
5945
|
-
skipValidation: z.boolean().optional()
|
|
5946
|
-
});
|
|
5947
|
-
var listLayoutItemSchema = z.object({
|
|
5948
|
-
title: z.string(),
|
|
5949
|
-
description: z.string().optional(),
|
|
5950
|
-
icon: iconSchema,
|
|
5951
|
-
status: listLayoutStatusSchema.optional()
|
|
5952
|
-
});
|
|
5953
|
-
var decisionLayoutOptionSchema = z.object({
|
|
5954
|
-
action: actionSchema,
|
|
5955
|
-
title: z.string(),
|
|
5956
|
-
description: z.string().optional(),
|
|
5957
|
-
disabled: z.boolean().optional(),
|
|
5958
|
-
icon: iconSchema.optional(),
|
|
5959
|
-
image: imageLayoutSchema.optional()
|
|
5960
|
-
});
|
|
5961
|
-
var statusListLayoutItemSchema = z.object({
|
|
5956
|
+
var reviewLayoutCallToActionSchema = z.object({
|
|
5962
5957
|
title: z.string(),
|
|
5963
|
-
|
|
5964
|
-
icon: iconSchema,
|
|
5965
|
-
status: statusListLayoutStatusSchema.optional()
|
|
5958
|
+
action: actionSchema
|
|
5966
5959
|
});
|
|
5967
5960
|
var instructionsLayoutSchema = z.object({
|
|
5968
5961
|
type: z.literal("instructions"),
|
|
@@ -5971,51 +5964,17 @@ var instructionsLayoutSchema = z.object({
|
|
|
5971
5964
|
control: z.string().optional(),
|
|
5972
5965
|
margin: sizeSchema.optional()
|
|
5973
5966
|
});
|
|
5974
|
-
var
|
|
5975
|
-
type: z.literal("button"),
|
|
5976
|
-
size: sizeSchema.optional(),
|
|
5977
|
-
title: z.string().optional(),
|
|
5978
|
-
action: actionSchema,
|
|
5979
|
-
context: contextSchema.optional(),
|
|
5980
|
-
disabled: z.boolean().optional(),
|
|
5981
|
-
pinOrder: z.number().optional(),
|
|
5982
|
-
control: z.string().optional(),
|
|
5983
|
-
margin: sizeSchema.optional()
|
|
5984
|
-
});
|
|
5967
|
+
var iconSchema = z.union([iconNamedSchema, iconTextSchema]);
|
|
5985
5968
|
var reviewLayoutFieldSchema = z.object({
|
|
5986
5969
|
label: z.string(),
|
|
5987
5970
|
value: z.string(),
|
|
5988
5971
|
help: helpSchema.optional()
|
|
5989
5972
|
});
|
|
5990
|
-
var
|
|
5991
|
-
type: z.literal("search"),
|
|
5992
|
-
title: z.string(),
|
|
5993
|
-
description: z.string().optional(),
|
|
5994
|
-
icon: iconSchema.optional(),
|
|
5995
|
-
image: imageLayoutSchema.optional(),
|
|
5996
|
-
value: searchSearchRequestSchema
|
|
5997
|
-
});
|
|
5998
|
-
var searchResultActionSchema = z.object({
|
|
5999
|
-
type: z.literal("action"),
|
|
5973
|
+
var statusListLayoutItemSchema = z.object({
|
|
6000
5974
|
title: z.string(),
|
|
6001
5975
|
description: z.string().optional(),
|
|
6002
|
-
icon: iconSchema
|
|
6003
|
-
|
|
6004
|
-
value: actionSchema
|
|
6005
|
-
});
|
|
6006
|
-
var actionResponseBodySchema = z.object({
|
|
6007
|
-
action: actionSchema
|
|
6008
|
-
});
|
|
6009
|
-
var errorResponseBodySchema = z.object({
|
|
6010
|
-
refreshFormUrl: z.string().optional(),
|
|
6011
|
-
analytics: z.record(z.string()).optional(),
|
|
6012
|
-
error: z.string().optional(),
|
|
6013
|
-
validation: jsonElementSchema.optional(),
|
|
6014
|
-
refreshUrl: z.string().optional()
|
|
6015
|
-
});
|
|
6016
|
-
var linkHandlerSchema = z.object({
|
|
6017
|
-
regexPattern: z.string(),
|
|
6018
|
-
action: actionSchema
|
|
5976
|
+
icon: iconSchema,
|
|
5977
|
+
status: statusListLayoutStatusSchema.optional()
|
|
6019
5978
|
});
|
|
6020
5979
|
var blobSchemaSchema = z.object({
|
|
6021
5980
|
type: z.literal("blob"),
|
|
@@ -6055,37 +6014,66 @@ var constSchemaSchema = z.object({
|
|
|
6055
6014
|
analyticsId: z.string().optional(),
|
|
6056
6015
|
disabled: z.boolean().optional()
|
|
6057
6016
|
});
|
|
6058
|
-
var
|
|
6017
|
+
var summarySummariserSchema = z.object({
|
|
6018
|
+
defaultTitle: z.string().optional(),
|
|
6019
|
+
defaultDescription: z.string().optional(),
|
|
6020
|
+
defaultIcon: iconSchema.optional(),
|
|
6021
|
+
defaultImage: imageLayoutSchema.optional(),
|
|
6022
|
+
providesTitle: z.boolean().optional(),
|
|
6023
|
+
providesDescription: z.boolean().optional(),
|
|
6024
|
+
providesIcon: z.boolean().optional(),
|
|
6025
|
+
providesImage: z.boolean().optional()
|
|
6026
|
+
});
|
|
6027
|
+
var linkHandlerSchema = z.object({
|
|
6028
|
+
regexPattern: z.string(),
|
|
6059
6029
|
action: actionSchema
|
|
6060
6030
|
});
|
|
6061
|
-
var
|
|
6062
|
-
title: z.string().optional(),
|
|
6031
|
+
var actionResponseBodySchema = z.object({
|
|
6063
6032
|
action: actionSchema
|
|
6064
6033
|
});
|
|
6065
|
-
var
|
|
6034
|
+
var searchResultSearchSchema = z.object({
|
|
6035
|
+
type: z.literal("search"),
|
|
6066
6036
|
title: z.string(),
|
|
6037
|
+
description: z.string().optional(),
|
|
6038
|
+
icon: iconSchema.optional(),
|
|
6039
|
+
image: imageLayoutSchema.optional(),
|
|
6040
|
+
value: searchSearchRequestSchema
|
|
6041
|
+
});
|
|
6042
|
+
var searchResultActionSchema = z.object({
|
|
6043
|
+
type: z.literal("action"),
|
|
6044
|
+
title: z.string(),
|
|
6045
|
+
description: z.string().optional(),
|
|
6046
|
+
icon: iconSchema.optional(),
|
|
6047
|
+
image: imageLayoutSchema.optional(),
|
|
6048
|
+
value: actionSchema
|
|
6049
|
+
});
|
|
6050
|
+
var pollingOnErrorSchema = z.object({
|
|
6067
6051
|
action: actionSchema
|
|
6068
6052
|
});
|
|
6069
|
-
var
|
|
6070
|
-
type: z.literal("list"),
|
|
6071
|
-
items: z.array(listLayoutItemSchema),
|
|
6053
|
+
var navigationBackBehaviourSchema = z.object({
|
|
6072
6054
|
title: z.string().optional(),
|
|
6073
|
-
|
|
6074
|
-
margin: sizeSchema.optional()
|
|
6075
|
-
});
|
|
6076
|
-
var decisionLayoutSchema = z.object({
|
|
6077
|
-
type: z.literal("decision"),
|
|
6078
|
-
options: z.array(decisionLayoutOptionSchema),
|
|
6079
|
-
control: z.string().optional(),
|
|
6080
|
-
margin: sizeSchema.optional()
|
|
6055
|
+
action: actionSchema
|
|
6081
6056
|
});
|
|
6082
|
-
var
|
|
6083
|
-
|
|
6084
|
-
|
|
6057
|
+
var summarySchema = z.union([summaryProviderSchema, summarySummariserSchema]);
|
|
6058
|
+
var buttonLayoutSchema = z.object({
|
|
6059
|
+
type: z.literal("button"),
|
|
6060
|
+
size: sizeSchema.optional(),
|
|
6085
6061
|
title: z.string().optional(),
|
|
6062
|
+
action: actionSchema,
|
|
6063
|
+
context: contextSchema.optional(),
|
|
6064
|
+
disabled: z.boolean().optional(),
|
|
6065
|
+
pinOrder: z.number().optional(),
|
|
6086
6066
|
control: z.string().optional(),
|
|
6087
6067
|
margin: sizeSchema.optional()
|
|
6088
6068
|
});
|
|
6069
|
+
var decisionLayoutOptionSchema = z.object({
|
|
6070
|
+
action: actionSchema,
|
|
6071
|
+
title: z.string(),
|
|
6072
|
+
description: z.string().optional(),
|
|
6073
|
+
disabled: z.boolean().optional(),
|
|
6074
|
+
icon: iconSchema.optional(),
|
|
6075
|
+
image: imageLayoutSchema.optional()
|
|
6076
|
+
});
|
|
6089
6077
|
var reviewLayoutSchema = z.object({
|
|
6090
6078
|
type: z.literal("review"),
|
|
6091
6079
|
orientation: z.string().optional(),
|
|
@@ -6096,7 +6084,19 @@ var reviewLayoutSchema = z.object({
|
|
|
6096
6084
|
control: z.string().optional(),
|
|
6097
6085
|
margin: sizeSchema.optional()
|
|
6098
6086
|
});
|
|
6099
|
-
var
|
|
6087
|
+
var statusListLayoutSchema = z.object({
|
|
6088
|
+
type: z.literal("status-list"),
|
|
6089
|
+
items: z.array(statusListLayoutItemSchema),
|
|
6090
|
+
title: z.string().optional(),
|
|
6091
|
+
control: z.string().optional(),
|
|
6092
|
+
margin: sizeSchema.optional()
|
|
6093
|
+
});
|
|
6094
|
+
var listLayoutItemSchema = z.object({
|
|
6095
|
+
title: z.string(),
|
|
6096
|
+
description: z.string().optional(),
|
|
6097
|
+
icon: iconSchema,
|
|
6098
|
+
status: listLayoutStatusSchema.optional()
|
|
6099
|
+
});
|
|
6100
6100
|
var pollingSchema = z.object({
|
|
6101
6101
|
url: z.string(),
|
|
6102
6102
|
interval: z.number(),
|
|
@@ -6108,9 +6108,33 @@ var navigationSchema = z.object({
|
|
|
6108
6108
|
back: navigationBackBehaviourSchema.optional(),
|
|
6109
6109
|
stackBehavior: navigationStackBehaviorSchema.optional()
|
|
6110
6110
|
});
|
|
6111
|
+
var searchResultSchema = z.union([searchResultActionSchema, searchResultSearchSchema]);
|
|
6112
|
+
var decisionLayoutSchema = z.object({
|
|
6113
|
+
type: z.literal("decision"),
|
|
6114
|
+
options: z.array(decisionLayoutOptionSchema),
|
|
6115
|
+
control: z.string().optional(),
|
|
6116
|
+
margin: sizeSchema.optional()
|
|
6117
|
+
});
|
|
6118
|
+
var listLayoutSchema = z.object({
|
|
6119
|
+
type: z.literal("list"),
|
|
6120
|
+
items: z.array(listLayoutItemSchema),
|
|
6121
|
+
title: z.string().optional(),
|
|
6122
|
+
control: z.string().optional(),
|
|
6123
|
+
margin: sizeSchema.optional()
|
|
6124
|
+
});
|
|
6111
6125
|
var searchResponseBodySchema = z.object({
|
|
6112
6126
|
results: z.array(searchResultSchema)
|
|
6113
6127
|
});
|
|
6128
|
+
var columnsLayoutSchema = z.lazy(
|
|
6129
|
+
() => z.object({
|
|
6130
|
+
type: z.literal("columns"),
|
|
6131
|
+
left: z.array(layoutSchema),
|
|
6132
|
+
right: z.array(layoutSchema),
|
|
6133
|
+
bias: columnsLayoutBiasSchema.optional(),
|
|
6134
|
+
control: z.string().optional(),
|
|
6135
|
+
margin: sizeSchema.optional()
|
|
6136
|
+
})
|
|
6137
|
+
);
|
|
6114
6138
|
var layoutSchema = z.lazy(
|
|
6115
6139
|
() => z.union([
|
|
6116
6140
|
alertLayoutSchema,
|
|
@@ -6134,26 +6158,6 @@ var layoutSchema = z.lazy(
|
|
|
6134
6158
|
statusListLayoutSchema
|
|
6135
6159
|
])
|
|
6136
6160
|
);
|
|
6137
|
-
var boxLayoutSchema = z.lazy(
|
|
6138
|
-
() => z.object({
|
|
6139
|
-
type: z.literal("box"),
|
|
6140
|
-
components: z.array(layoutSchema),
|
|
6141
|
-
width: sizeSchema.optional(),
|
|
6142
|
-
border: z.boolean().optional(),
|
|
6143
|
-
control: z.string().optional(),
|
|
6144
|
-
margin: sizeSchema.optional()
|
|
6145
|
-
})
|
|
6146
|
-
);
|
|
6147
|
-
var columnsLayoutSchema = z.lazy(
|
|
6148
|
-
() => z.object({
|
|
6149
|
-
type: z.literal("columns"),
|
|
6150
|
-
left: z.array(layoutSchema),
|
|
6151
|
-
right: z.array(layoutSchema),
|
|
6152
|
-
bias: columnsLayoutBiasSchema.optional(),
|
|
6153
|
-
control: z.string().optional(),
|
|
6154
|
-
margin: sizeSchema.optional()
|
|
6155
|
-
})
|
|
6156
|
-
);
|
|
6157
6161
|
var modalLayoutSchema = z.lazy(
|
|
6158
6162
|
() => z.object({
|
|
6159
6163
|
type: z.literal("modal"),
|
|
@@ -6168,25 +6172,14 @@ var modalLayoutContentSchema = z.lazy(
|
|
|
6168
6172
|
components: z.array(layoutSchema)
|
|
6169
6173
|
})
|
|
6170
6174
|
);
|
|
6171
|
-
var
|
|
6175
|
+
var boxLayoutSchema = z.lazy(
|
|
6172
6176
|
() => z.object({
|
|
6173
|
-
|
|
6174
|
-
|
|
6175
|
-
|
|
6176
|
-
|
|
6177
|
-
|
|
6178
|
-
|
|
6179
|
-
description: z.string().optional(),
|
|
6180
|
-
schemas: z.array(schemaSchema),
|
|
6181
|
-
layout: z.array(layoutSchema),
|
|
6182
|
-
model: jsonElementSchema.optional(),
|
|
6183
|
-
external: externalSchema.optional(),
|
|
6184
|
-
polling: pollingSchema.optional(),
|
|
6185
|
-
linkHandlers: z.array(linkHandlerSchema).optional(),
|
|
6186
|
-
analytics: z.record(z.string()).optional(),
|
|
6187
|
-
errors: stepErrorSchema.optional(),
|
|
6188
|
-
navigation: navigationSchema.optional(),
|
|
6189
|
-
refreshUrl: z.string().optional()
|
|
6177
|
+
type: z.literal("box"),
|
|
6178
|
+
components: z.array(layoutSchema),
|
|
6179
|
+
width: sizeSchema.optional(),
|
|
6180
|
+
border: z.boolean().optional(),
|
|
6181
|
+
control: z.string().optional(),
|
|
6182
|
+
margin: sizeSchema.optional()
|
|
6190
6183
|
})
|
|
6191
6184
|
);
|
|
6192
6185
|
var schemaSchema = z.lazy(
|
|
@@ -6412,17 +6405,21 @@ var stringSchemaSchema = z.lazy(
|
|
|
6412
6405
|
help: helpSchema.optional()
|
|
6413
6406
|
})
|
|
6414
6407
|
);
|
|
6415
|
-
var
|
|
6408
|
+
var persistAsyncSchema = z.lazy(
|
|
6409
|
+
() => z.object({
|
|
6410
|
+
param: z.string(),
|
|
6411
|
+
idProperty: z.string(),
|
|
6412
|
+
schema: schemaSchema,
|
|
6413
|
+
url: z.string(),
|
|
6414
|
+
method: httpMethodSchema
|
|
6415
|
+
})
|
|
6416
|
+
);
|
|
6417
|
+
var arraySchemaTupleSchema = z.lazy(
|
|
6416
6418
|
() => z.object({
|
|
6417
6419
|
type: z.literal("array"),
|
|
6418
6420
|
promoted: z.boolean().optional(),
|
|
6419
6421
|
$id: z.string().optional(),
|
|
6420
|
-
items: schemaSchema,
|
|
6421
|
-
addItemTitle: z.string(),
|
|
6422
|
-
editItemTitle: z.string(),
|
|
6423
|
-
minItems: z.number().optional(),
|
|
6424
|
-
maxItems: z.number().optional(),
|
|
6425
|
-
placeholder: z.string().optional(),
|
|
6422
|
+
items: z.array(schemaSchema),
|
|
6426
6423
|
title: z.string().optional(),
|
|
6427
6424
|
description: z.string().optional(),
|
|
6428
6425
|
control: z.string().optional(),
|
|
@@ -6430,30 +6427,24 @@ var arraySchemaListSchema = z.lazy(
|
|
|
6430
6427
|
icon: iconSchema.optional(),
|
|
6431
6428
|
image: imageSchema.optional(),
|
|
6432
6429
|
keywords: z.array(z.string()).optional(),
|
|
6433
|
-
summary:
|
|
6430
|
+
summary: summaryProviderSchema.optional(),
|
|
6434
6431
|
analyticsId: z.string().optional(),
|
|
6435
6432
|
persistAsync: persistAsyncSchema.optional(),
|
|
6436
6433
|
validationAsync: validateAsyncSchema.optional(),
|
|
6437
|
-
alert: alertLayoutSchema.optional()
|
|
6438
|
-
validationMessages: z.record(z.string()).optional(),
|
|
6439
|
-
disabled: z.boolean().optional()
|
|
6440
|
-
})
|
|
6441
|
-
);
|
|
6442
|
-
var persistAsyncSchema = z.lazy(
|
|
6443
|
-
() => z.object({
|
|
6444
|
-
param: z.string(),
|
|
6445
|
-
idProperty: z.string(),
|
|
6446
|
-
schema: schemaSchema,
|
|
6447
|
-
url: z.string(),
|
|
6448
|
-
method: httpMethodSchema
|
|
6434
|
+
alert: alertLayoutSchema.optional()
|
|
6449
6435
|
})
|
|
6450
6436
|
);
|
|
6451
|
-
var
|
|
6437
|
+
var arraySchemaListSchema = z.lazy(
|
|
6452
6438
|
() => z.object({
|
|
6453
6439
|
type: z.literal("array"),
|
|
6454
6440
|
promoted: z.boolean().optional(),
|
|
6455
6441
|
$id: z.string().optional(),
|
|
6456
|
-
items:
|
|
6442
|
+
items: schemaSchema,
|
|
6443
|
+
addItemTitle: z.string(),
|
|
6444
|
+
editItemTitle: z.string(),
|
|
6445
|
+
minItems: z.number().optional(),
|
|
6446
|
+
maxItems: z.number().optional(),
|
|
6447
|
+
placeholder: z.string().optional(),
|
|
6457
6448
|
title: z.string().optional(),
|
|
6458
6449
|
description: z.string().optional(),
|
|
6459
6450
|
control: z.string().optional(),
|
|
@@ -6461,11 +6452,34 @@ var arraySchemaTupleSchema = z.lazy(
|
|
|
6461
6452
|
icon: iconSchema.optional(),
|
|
6462
6453
|
image: imageSchema.optional(),
|
|
6463
6454
|
keywords: z.array(z.string()).optional(),
|
|
6464
|
-
summary:
|
|
6455
|
+
summary: summarySummariserSchema.optional(),
|
|
6465
6456
|
analyticsId: z.string().optional(),
|
|
6466
6457
|
persistAsync: persistAsyncSchema.optional(),
|
|
6467
6458
|
validationAsync: validateAsyncSchema.optional(),
|
|
6468
|
-
alert: alertLayoutSchema.optional()
|
|
6459
|
+
alert: alertLayoutSchema.optional(),
|
|
6460
|
+
validationMessages: z.record(z.string()).optional(),
|
|
6461
|
+
disabled: z.boolean().optional()
|
|
6462
|
+
})
|
|
6463
|
+
);
|
|
6464
|
+
var stepSchema = z.lazy(
|
|
6465
|
+
() => z.object({
|
|
6466
|
+
key: z.string().optional(),
|
|
6467
|
+
type: z.string().optional(),
|
|
6468
|
+
actions: z.array(actionSchema).optional(),
|
|
6469
|
+
refreshFormUrl: z.string().optional(),
|
|
6470
|
+
id: z.string(),
|
|
6471
|
+
title: z.string(),
|
|
6472
|
+
description: z.string().optional(),
|
|
6473
|
+
schemas: z.array(schemaSchema),
|
|
6474
|
+
layout: z.array(layoutSchema),
|
|
6475
|
+
model: jsonElementSchema.optional(),
|
|
6476
|
+
external: externalSchema.optional(),
|
|
6477
|
+
polling: pollingSchema.optional(),
|
|
6478
|
+
linkHandlers: z.array(linkHandlerSchema).optional(),
|
|
6479
|
+
analytics: z.record(z.string()).optional(),
|
|
6480
|
+
errors: stepErrorSchema.optional(),
|
|
6481
|
+
navigation: navigationSchema.optional(),
|
|
6482
|
+
refreshUrl: z.string().optional()
|
|
6469
6483
|
})
|
|
6470
6484
|
);
|
|
6471
6485
|
var validateStep = (step) => validate(step, stepSchema);
|
|
@@ -6605,7 +6619,91 @@ var createStepComponent = (stepProps) => {
|
|
|
6605
6619
|
stop() {
|
|
6606
6620
|
stepPolling == null ? void 0 : stepPolling.stop();
|
|
6607
6621
|
}
|
|
6608
|
-
});
|
|
6622
|
+
});
|
|
6623
|
+
};
|
|
6624
|
+
|
|
6625
|
+
// src/revamp/flow/response-utils.ts
|
|
6626
|
+
var assertResponseIsValid = (response) => {
|
|
6627
|
+
if (!isResponse(response)) {
|
|
6628
|
+
throw new Error("Incorrect type of response from fetch. Expected object of type Response.");
|
|
6629
|
+
}
|
|
6630
|
+
if (response.bodyUsed) {
|
|
6631
|
+
throw new Error(
|
|
6632
|
+
"The body of the provided Response object has already been used. Every request must respond with a new Response object."
|
|
6633
|
+
);
|
|
6634
|
+
}
|
|
6635
|
+
};
|
|
6636
|
+
var isResponse = (response) => typeof response === "object" && response !== null && "clone" in response && "bodyUsed" in response;
|
|
6637
|
+
var parseResponseBodyAsJsonElement = async (response) => {
|
|
6638
|
+
try {
|
|
6639
|
+
return await response.json();
|
|
6640
|
+
} catch (e) {
|
|
6641
|
+
return null;
|
|
6642
|
+
}
|
|
6643
|
+
};
|
|
6644
|
+
function isActionResponseBody(body) {
|
|
6645
|
+
return validateActionResponse(body).valid;
|
|
6646
|
+
}
|
|
6647
|
+
function assertActionResponseBody(body) {
|
|
6648
|
+
if (!isObject(body) || !isObject(body.action)) {
|
|
6649
|
+
throw new Error(
|
|
6650
|
+
"Incorrect response body in action response. Expected an object satisfying the type { action: Action }."
|
|
6651
|
+
);
|
|
6652
|
+
}
|
|
6653
|
+
}
|
|
6654
|
+
function isErrorResponseBody(body) {
|
|
6655
|
+
return Boolean(
|
|
6656
|
+
isObject(body) && (body.refreshFormUrl || body.refreshUrl || body.validation || body.error || body.analytics)
|
|
6657
|
+
);
|
|
6658
|
+
}
|
|
6659
|
+
function assertStepResponseBody(body) {
|
|
6660
|
+
if (!isObject(body)) {
|
|
6661
|
+
throw new Error("Incorrect response body in step response. Expected an object.");
|
|
6662
|
+
}
|
|
6663
|
+
}
|
|
6664
|
+
|
|
6665
|
+
// src/revamp/domain/features/polling/getStepPolling.ts
|
|
6666
|
+
var getStepPolling = ({
|
|
6667
|
+
httpClient,
|
|
6668
|
+
pollingConfig,
|
|
6669
|
+
onAction
|
|
6670
|
+
}) => {
|
|
6671
|
+
const { interval, maxAttempts, url, onError } = pollingConfig;
|
|
6672
|
+
let abortController = new AbortController();
|
|
6673
|
+
const onFailure = () => {
|
|
6674
|
+
stop();
|
|
6675
|
+
void onAction(onError.action);
|
|
6676
|
+
};
|
|
6677
|
+
let attempts = 0;
|
|
6678
|
+
const poll = () => {
|
|
6679
|
+
attempts += 1;
|
|
6680
|
+
abortController.abort();
|
|
6681
|
+
abortController = new AbortController();
|
|
6682
|
+
const { signal } = abortController;
|
|
6683
|
+
httpClient(url, { signal }).then(async (response) => {
|
|
6684
|
+
if (!response.ok) {
|
|
6685
|
+
onFailure();
|
|
6686
|
+
return;
|
|
6687
|
+
}
|
|
6688
|
+
response.json().then((body) => {
|
|
6689
|
+
if (isActionResponseBody(body)) {
|
|
6690
|
+
void onAction(body.action);
|
|
6691
|
+
stop();
|
|
6692
|
+
}
|
|
6693
|
+
}).catch(() => {
|
|
6694
|
+
});
|
|
6695
|
+
}).catch(() => {
|
|
6696
|
+
});
|
|
6697
|
+
if (attempts >= maxAttempts && !signal.aborted) {
|
|
6698
|
+
onFailure();
|
|
6699
|
+
}
|
|
6700
|
+
};
|
|
6701
|
+
const intervalRef = setInterval(poll, interval * 1e3);
|
|
6702
|
+
const stop = () => {
|
|
6703
|
+
abortController.abort();
|
|
6704
|
+
clearTimeout(intervalRef);
|
|
6705
|
+
};
|
|
6706
|
+
return { stop };
|
|
6609
6707
|
};
|
|
6610
6708
|
|
|
6611
6709
|
// src/revamp/domain/components/AlertComponent.ts
|
|
@@ -7317,46 +7415,6 @@ var autocompleteTokenMap = {
|
|
|
7317
7415
|
pager: "pager"
|
|
7318
7416
|
};
|
|
7319
7417
|
|
|
7320
|
-
// src/revamp/flow/response-utils.ts
|
|
7321
|
-
var assertResponseIsValid = (response) => {
|
|
7322
|
-
if (!isResponse(response)) {
|
|
7323
|
-
throw new Error("Incorrect type of response from fetch. Expected object of type Response.");
|
|
7324
|
-
}
|
|
7325
|
-
if (response.bodyUsed) {
|
|
7326
|
-
throw new Error(
|
|
7327
|
-
"The body of the provided Response object has already been used. Every request must respond with a new Response object."
|
|
7328
|
-
);
|
|
7329
|
-
}
|
|
7330
|
-
};
|
|
7331
|
-
var isResponse = (response) => typeof response === "object" && response !== null && "clone" in response && "bodyUsed" in response;
|
|
7332
|
-
var parseResponseBodyAsJsonElement = async (response) => {
|
|
7333
|
-
try {
|
|
7334
|
-
return await response.json();
|
|
7335
|
-
} catch (e) {
|
|
7336
|
-
return null;
|
|
7337
|
-
}
|
|
7338
|
-
};
|
|
7339
|
-
function isActionResponseBody(body) {
|
|
7340
|
-
return validateActionResponse(body).valid;
|
|
7341
|
-
}
|
|
7342
|
-
function assertActionResponseBody(body) {
|
|
7343
|
-
if (!isObject(body) || !isObject(body.action)) {
|
|
7344
|
-
throw new Error(
|
|
7345
|
-
"Incorrect response body in action response. Expected an object satisfying the type { action: Action }."
|
|
7346
|
-
);
|
|
7347
|
-
}
|
|
7348
|
-
}
|
|
7349
|
-
function isErrorResponseBody(body) {
|
|
7350
|
-
return Boolean(
|
|
7351
|
-
isObject(body) && (body.refreshFormUrl || body.refreshUrl || body.validation || body.error || body.analytics)
|
|
7352
|
-
);
|
|
7353
|
-
}
|
|
7354
|
-
function assertStepResponseBody(body) {
|
|
7355
|
-
if (!isObject(body)) {
|
|
7356
|
-
throw new Error("Incorrect response body in step response. Expected an object.");
|
|
7357
|
-
}
|
|
7358
|
-
}
|
|
7359
|
-
|
|
7360
7418
|
// src/revamp/domain/features/utils/response-utils.ts
|
|
7361
7419
|
var getAnalyticsFromErrorResponse = (json) => {
|
|
7362
7420
|
if (!isErrorResponseBody(json)) {
|
|
@@ -9394,7 +9452,7 @@ var createFormComponent = (formProps) => __spreadProps(__spreadValues({}, formPr
|
|
|
9394
9452
|
// src/revamp/domain/mappers/layout/formLayoutToComponent.ts
|
|
9395
9453
|
var formLayoutToComponent = (uid, { schemaId, schema: schemaRef, control, margin = "md" }, mapperProps) => {
|
|
9396
9454
|
const { step, stepLocalValue } = mapperProps;
|
|
9397
|
-
const { model, errors
|
|
9455
|
+
const { schemas, model, errors } = step;
|
|
9398
9456
|
const id = schemaId != null ? schemaId : schemaRef == null ? void 0 : schemaRef.$ref;
|
|
9399
9457
|
const schema = schemas.find((s) => s.$id === id);
|
|
9400
9458
|
if (!schema) {
|
|
@@ -9856,48 +9914,37 @@ var mapLayoutToComponent = (uid, layout, mapperProps) => {
|
|
|
9856
9914
|
}
|
|
9857
9915
|
};
|
|
9858
9916
|
|
|
9859
|
-
// src/revamp/domain/
|
|
9860
|
-
var
|
|
9861
|
-
|
|
9862
|
-
|
|
9863
|
-
|
|
9864
|
-
|
|
9865
|
-
|
|
9866
|
-
|
|
9867
|
-
|
|
9868
|
-
|
|
9869
|
-
|
|
9870
|
-
|
|
9871
|
-
|
|
9872
|
-
|
|
9873
|
-
|
|
9874
|
-
|
|
9875
|
-
|
|
9876
|
-
|
|
9877
|
-
|
|
9878
|
-
|
|
9879
|
-
|
|
9880
|
-
|
|
9881
|
-
}
|
|
9882
|
-
response.json().then((body) => {
|
|
9883
|
-
if (isActionResponseBody(body)) {
|
|
9884
|
-
void onAction(body.action);
|
|
9885
|
-
stop();
|
|
9886
|
-
}
|
|
9887
|
-
}).catch(() => {
|
|
9888
|
-
});
|
|
9889
|
-
}).catch(() => {
|
|
9917
|
+
// src/revamp/domain/mappers/mapUnreferencedSchemas.ts
|
|
9918
|
+
var mapUnreferencedSchemas = (mapperProps) => {
|
|
9919
|
+
const { step } = mapperProps;
|
|
9920
|
+
const { model } = step;
|
|
9921
|
+
return getUnreferencedSchemas(step).map((schema) => __spreadProps(__spreadValues({}, schema), { hidden: true })).map((schema, index) => {
|
|
9922
|
+
const uid = `unreferenced-schema-${index}`;
|
|
9923
|
+
return createFormComponent({
|
|
9924
|
+
uid,
|
|
9925
|
+
components: [
|
|
9926
|
+
mapSchemaToComponent(
|
|
9927
|
+
{
|
|
9928
|
+
uid: `${uid}.form`,
|
|
9929
|
+
schema,
|
|
9930
|
+
model: model != null ? model : null,
|
|
9931
|
+
localValue: null,
|
|
9932
|
+
required: false
|
|
9933
|
+
},
|
|
9934
|
+
mapperProps
|
|
9935
|
+
)
|
|
9936
|
+
],
|
|
9937
|
+
control: void 0,
|
|
9938
|
+
margin: "xs"
|
|
9890
9939
|
});
|
|
9891
|
-
|
|
9892
|
-
|
|
9893
|
-
|
|
9894
|
-
};
|
|
9895
|
-
const
|
|
9896
|
-
|
|
9897
|
-
|
|
9898
|
-
|
|
9899
|
-
};
|
|
9900
|
-
return { stop };
|
|
9940
|
+
});
|
|
9941
|
+
};
|
|
9942
|
+
var getUnreferencedSchemas = (step) => {
|
|
9943
|
+
const { schemas, layout } = step;
|
|
9944
|
+
const stringifiedLayout = JSON.stringify(layout);
|
|
9945
|
+
return schemas.filter(
|
|
9946
|
+
(schema) => !stringifiedLayout.includes(`"schemaId":"${schema.$id}"`) && !stringifiedLayout.includes(`"schema":{"$ref":"${schema.$id}"`)
|
|
9947
|
+
);
|
|
9901
9948
|
};
|
|
9902
9949
|
|
|
9903
9950
|
// src/revamp/domain/mappers/mapStepToComponent.ts
|
|
@@ -9943,17 +9990,16 @@ var mapStepToComponent = (_a) => {
|
|
|
9943
9990
|
};
|
|
9944
9991
|
const onRefresh = async (schemaId, url) => restProps.onRefresh(schemaId, url != null ? url : refreshUrl);
|
|
9945
9992
|
const stepPolling = polling ? getStepPolling({ httpClient, pollingConfig: polling, onAction: restProps.onAction }) : void 0;
|
|
9993
|
+
const mapperProps = __spreadProps(__spreadValues({}, restProps), { trackEvent, onAction, onRefresh });
|
|
9994
|
+
const unreferencedSchemaFormComponents = mapUnreferencedSchemas(mapperProps);
|
|
9946
9995
|
const layoutComponents = layout.map(
|
|
9947
|
-
(layoutComponent, index) => mapLayoutToComponent(`${uid}.layout-${index}`, layoutComponent,
|
|
9948
|
-
trackEvent,
|
|
9949
|
-
onAction,
|
|
9950
|
-
onRefresh
|
|
9951
|
-
}))
|
|
9996
|
+
(layoutComponent, index) => mapLayoutToComponent(`${uid}.layout-${index}`, layoutComponent, mapperProps)
|
|
9952
9997
|
);
|
|
9998
|
+
const components = [...unreferencedSchemaFormComponents, ...layoutComponents];
|
|
9953
9999
|
const stepComponent = createStepComponent({
|
|
9954
10000
|
uid,
|
|
9955
10001
|
back,
|
|
9956
|
-
components
|
|
10002
|
+
components,
|
|
9957
10003
|
description,
|
|
9958
10004
|
error: errors == null ? void 0 : errors.error,
|
|
9959
10005
|
external,
|
|
@@ -9961,7 +10007,9 @@ var mapStepToComponent = (_a) => {
|
|
|
9961
10007
|
stepPolling,
|
|
9962
10008
|
updateComponent,
|
|
9963
10009
|
title: displayStepTitle ? title : void 0,
|
|
9964
|
-
trackEvent
|
|
10010
|
+
trackEvent,
|
|
10011
|
+
step,
|
|
10012
|
+
onAction
|
|
9965
10013
|
});
|
|
9966
10014
|
return stepComponent;
|
|
9967
10015
|
};
|
|
@@ -11875,18 +11923,79 @@ function ItemSummaryOption({
|
|
|
11875
11923
|
}
|
|
11876
11924
|
var RepeatableRenderer_default = RepeatableRenderer;
|
|
11877
11925
|
|
|
11926
|
+
// src/revamp/wise/renderers/ReviewRenderer.tsx
|
|
11927
|
+
import { DefinitionList, Header as Header4 } from "@transferwise/components";
|
|
11928
|
+
import { Fragment as Fragment5, jsx as jsx41, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
11929
|
+
var ReviewRenderer = {
|
|
11930
|
+
canRenderType: "review",
|
|
11931
|
+
render: ({ callToAction, control, fields, margin, title }) => {
|
|
11932
|
+
const orientation = mapControlToDefinitionListLayout(control);
|
|
11933
|
+
const action = callToAction ? {
|
|
11934
|
+
text: callToAction.title,
|
|
11935
|
+
onClick: (event) => {
|
|
11936
|
+
event.preventDefault();
|
|
11937
|
+
callToAction.onClick();
|
|
11938
|
+
}
|
|
11939
|
+
} : void 0;
|
|
11940
|
+
return /* @__PURE__ */ jsxs12("div", { className: getMargin(margin), children: [
|
|
11941
|
+
(title || callToAction) && /* @__PURE__ */ jsx41(Header4, { title: title != null ? title : "", action }),
|
|
11942
|
+
/* @__PURE__ */ jsx41("div", { className: margin, children: /* @__PURE__ */ jsx41(
|
|
11943
|
+
DefinitionList,
|
|
11944
|
+
{
|
|
11945
|
+
layout: orientation,
|
|
11946
|
+
definitions: fields.map(({ label, value, help }, index) => ({
|
|
11947
|
+
key: String(index),
|
|
11948
|
+
title: label,
|
|
11949
|
+
value: getFieldValue(value, help, orientation)
|
|
11950
|
+
}))
|
|
11951
|
+
}
|
|
11952
|
+
) })
|
|
11953
|
+
] });
|
|
11954
|
+
}
|
|
11955
|
+
};
|
|
11956
|
+
var ReviewRenderer_default = ReviewRenderer;
|
|
11957
|
+
var mapControlToDefinitionListLayout = (control) => {
|
|
11958
|
+
switch (control) {
|
|
11959
|
+
case "horizontal":
|
|
11960
|
+
case "horizontal-end-aligned":
|
|
11961
|
+
return "HORIZONTAL_RIGHT_ALIGNED";
|
|
11962
|
+
case "horizontal-start-aligned":
|
|
11963
|
+
return "HORIZONTAL_LEFT_ALIGNED";
|
|
11964
|
+
case "vertical-two-column":
|
|
11965
|
+
return "VERTICAL_TWO_COLUMN";
|
|
11966
|
+
case "vertical":
|
|
11967
|
+
case "vertical-one-column":
|
|
11968
|
+
default:
|
|
11969
|
+
return "VERTICAL_ONE_COLUMN";
|
|
11970
|
+
}
|
|
11971
|
+
};
|
|
11972
|
+
var getFieldValue = (value, help, orientation) => {
|
|
11973
|
+
if (help) {
|
|
11974
|
+
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ jsxs12(Fragment5, { children: [
|
|
11975
|
+
/* @__PURE__ */ jsx41(Help_default, { help }),
|
|
11976
|
+
" ",
|
|
11977
|
+
value
|
|
11978
|
+
] }) : /* @__PURE__ */ jsxs12(Fragment5, { children: [
|
|
11979
|
+
value,
|
|
11980
|
+
" ",
|
|
11981
|
+
/* @__PURE__ */ jsx41(Help_default, { help })
|
|
11982
|
+
] });
|
|
11983
|
+
}
|
|
11984
|
+
return value;
|
|
11985
|
+
};
|
|
11986
|
+
|
|
11878
11987
|
// src/revamp/wise/renderers/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
11879
11988
|
import { Input as Input5, Markdown as Markdown3, NavigationOption as NavigationOption3, NavigationOptionsList as NavigationOptionsList2 } from "@transferwise/components";
|
|
11880
11989
|
|
|
11881
11990
|
// src/revamp/wise/renderers/SearchRenderer/ErrorResult.tsx
|
|
11882
11991
|
import { useIntl as useIntl7 } from "react-intl";
|
|
11883
|
-
import { jsx as
|
|
11992
|
+
import { jsx as jsx42, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
11884
11993
|
function ErrorResult({ state }) {
|
|
11885
11994
|
const intl = useIntl7();
|
|
11886
|
-
return /* @__PURE__ */
|
|
11995
|
+
return /* @__PURE__ */ jsxs13("p", { className: "m-t-2", children: [
|
|
11887
11996
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
11888
11997
|
"\xA0",
|
|
11889
|
-
/* @__PURE__ */
|
|
11998
|
+
/* @__PURE__ */ jsx42(
|
|
11890
11999
|
"a",
|
|
11891
12000
|
{
|
|
11892
12001
|
href: "/",
|
|
@@ -11902,7 +12011,7 @@ function ErrorResult({ state }) {
|
|
|
11902
12011
|
|
|
11903
12012
|
// src/revamp/wise/renderers/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
11904
12013
|
import { useState as useState8 } from "react";
|
|
11905
|
-
import { Fragment as
|
|
12014
|
+
import { Fragment as Fragment6, jsx as jsx43, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
11906
12015
|
function BlockSearchRendererComponent({
|
|
11907
12016
|
id,
|
|
11908
12017
|
isLoading,
|
|
@@ -11914,8 +12023,8 @@ function BlockSearchRendererComponent({
|
|
|
11914
12023
|
}) {
|
|
11915
12024
|
const [hasSearched, setHasSearched] = useState8(false);
|
|
11916
12025
|
const trackEvent = useTrackEvent();
|
|
11917
|
-
return /* @__PURE__ */
|
|
11918
|
-
/* @__PURE__ */
|
|
12026
|
+
return /* @__PURE__ */ jsxs14("div", { className: getMargin(margin), children: [
|
|
12027
|
+
/* @__PURE__ */ jsx43(FieldInput_default, { id, description: "", error: "", help: "", label: title, children: /* @__PURE__ */ jsx43(
|
|
11919
12028
|
Input5,
|
|
11920
12029
|
{
|
|
11921
12030
|
id,
|
|
@@ -11932,7 +12041,7 @@ function BlockSearchRendererComponent({
|
|
|
11932
12041
|
}
|
|
11933
12042
|
}
|
|
11934
12043
|
) }),
|
|
11935
|
-
isLoading ? /* @__PURE__ */
|
|
12044
|
+
isLoading ? /* @__PURE__ */ jsx43(Fragment6, { children: "Loading..." }) : /* @__PURE__ */ jsx43(SearchResultContent, { state, onChange })
|
|
11936
12045
|
] });
|
|
11937
12046
|
}
|
|
11938
12047
|
function SearchResultContent({
|
|
@@ -11941,29 +12050,29 @@ function SearchResultContent({
|
|
|
11941
12050
|
}) {
|
|
11942
12051
|
switch (state.type) {
|
|
11943
12052
|
case "error":
|
|
11944
|
-
return /* @__PURE__ */
|
|
12053
|
+
return /* @__PURE__ */ jsx43(ErrorResult, { state });
|
|
11945
12054
|
case "results":
|
|
11946
|
-
return /* @__PURE__ */
|
|
12055
|
+
return /* @__PURE__ */ jsx43(SearchResults, { state, onChange });
|
|
11947
12056
|
case "noResults":
|
|
11948
|
-
return /* @__PURE__ */
|
|
12057
|
+
return /* @__PURE__ */ jsx43(EmptySearchResult, { state });
|
|
11949
12058
|
case "pending":
|
|
11950
12059
|
default:
|
|
11951
12060
|
return null;
|
|
11952
12061
|
}
|
|
11953
12062
|
}
|
|
11954
12063
|
function EmptySearchResult({ state }) {
|
|
11955
|
-
return /* @__PURE__ */
|
|
12064
|
+
return /* @__PURE__ */ jsx43(Markdown3, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
11956
12065
|
}
|
|
11957
12066
|
function SearchResults({
|
|
11958
12067
|
state
|
|
11959
12068
|
}) {
|
|
11960
12069
|
const trackEvent = useTrackEvent();
|
|
11961
|
-
return /* @__PURE__ */
|
|
12070
|
+
return /* @__PURE__ */ jsx43(NavigationOptionsList2, { children: state.results.map((result) => /* @__PURE__ */ jsx43(
|
|
11962
12071
|
NavigationOption3,
|
|
11963
12072
|
{
|
|
11964
12073
|
title: result.title,
|
|
11965
12074
|
content: result.description,
|
|
11966
|
-
media: /* @__PURE__ */
|
|
12075
|
+
media: /* @__PURE__ */ jsx43(NavigationOptionMedia, __spreadValues({}, result)),
|
|
11967
12076
|
showMediaCircle: false,
|
|
11968
12077
|
showMediaAtAllSizes: true,
|
|
11969
12078
|
onClick: () => {
|
|
@@ -11982,7 +12091,7 @@ var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
|
|
|
11982
12091
|
import { Markdown as Markdown4, Typeahead } from "@transferwise/components";
|
|
11983
12092
|
import { Search } from "@transferwise/icons";
|
|
11984
12093
|
import { useState as useState9 } from "react";
|
|
11985
|
-
import { jsx as
|
|
12094
|
+
import { jsx as jsx44, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
11986
12095
|
function InlineSearchRenderer({
|
|
11987
12096
|
id,
|
|
11988
12097
|
isLoading,
|
|
@@ -11993,19 +12102,19 @@ function InlineSearchRenderer({
|
|
|
11993
12102
|
}) {
|
|
11994
12103
|
const [hasSearched, setHasSearched] = useState9(false);
|
|
11995
12104
|
const trackEvent = useTrackEvent();
|
|
11996
|
-
return /* @__PURE__ */
|
|
12105
|
+
return /* @__PURE__ */ jsx44("div", { className: getMargin(margin), children: /* @__PURE__ */ jsxs15(FieldInput_default, { id, description: "", error: "", help: "", label: title, children: [
|
|
11997
12106
|
id,
|
|
11998
|
-
/* @__PURE__ */
|
|
12107
|
+
/* @__PURE__ */ jsx44(
|
|
11999
12108
|
Typeahead,
|
|
12000
12109
|
{
|
|
12001
12110
|
id: "typeahead-input-id",
|
|
12002
12111
|
name: "typeahead-input-name",
|
|
12003
12112
|
size: "md",
|
|
12004
12113
|
maxHeight: 100,
|
|
12005
|
-
footer: /* @__PURE__ */
|
|
12114
|
+
footer: /* @__PURE__ */ jsx44(TypeaheadFooter, { state, isLoading }),
|
|
12006
12115
|
multiple: false,
|
|
12007
12116
|
clearable: false,
|
|
12008
|
-
addon: /* @__PURE__ */
|
|
12117
|
+
addon: /* @__PURE__ */ jsx44(Search, { size: 24 }),
|
|
12009
12118
|
options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
|
|
12010
12119
|
minQueryLength: 1,
|
|
12011
12120
|
onChange: (values) => {
|
|
@@ -12042,29 +12151,29 @@ function mapResultToTypeaheadOption(result) {
|
|
|
12042
12151
|
}
|
|
12043
12152
|
function TypeaheadFooter({ state, isLoading }) {
|
|
12044
12153
|
if (state.type === "noResults") {
|
|
12045
|
-
return /* @__PURE__ */
|
|
12154
|
+
return /* @__PURE__ */ jsx44(Markdown4, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
12046
12155
|
}
|
|
12047
12156
|
if (state.type === "error") {
|
|
12048
|
-
return /* @__PURE__ */
|
|
12157
|
+
return /* @__PURE__ */ jsx44("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ jsx44(ErrorResult, { state }) });
|
|
12049
12158
|
}
|
|
12050
12159
|
if (state.type === "pending" || isLoading) {
|
|
12051
|
-
return /* @__PURE__ */
|
|
12160
|
+
return /* @__PURE__ */ jsx44("p", { className: "m-t-2 m-x-2", children: "Loading..." });
|
|
12052
12161
|
}
|
|
12053
12162
|
return null;
|
|
12054
12163
|
}
|
|
12055
12164
|
var InlineSearchRendererComponent_default = InlineSearchRenderer;
|
|
12056
12165
|
|
|
12057
12166
|
// src/revamp/wise/renderers/SearchRenderer/SearchRenderer.tsx
|
|
12058
|
-
import { jsx as
|
|
12167
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
12059
12168
|
var SearchRenderer = {
|
|
12060
12169
|
canRenderType: "search",
|
|
12061
|
-
render: (props) => props.control === "inline" ? /* @__PURE__ */
|
|
12170
|
+
render: (props) => props.control === "inline" ? /* @__PURE__ */ jsx45(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ jsx45(BlockSearchRendererComponent_default, __spreadValues({}, props))
|
|
12062
12171
|
};
|
|
12063
12172
|
var SearchRenderer_default = SearchRenderer;
|
|
12064
12173
|
|
|
12065
12174
|
// src/revamp/wise/renderers/SelectInputRenderer/RadioInputRendererComponent.tsx
|
|
12066
12175
|
import { RadioGroup } from "@transferwise/components";
|
|
12067
|
-
import { Fragment as
|
|
12176
|
+
import { Fragment as Fragment7, jsx as jsx46, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
12068
12177
|
function RadioInputRendererComponent(props) {
|
|
12069
12178
|
const {
|
|
12070
12179
|
id,
|
|
@@ -12078,8 +12187,8 @@ function RadioInputRendererComponent(props) {
|
|
|
12078
12187
|
selectedIndex,
|
|
12079
12188
|
onSelect
|
|
12080
12189
|
} = props;
|
|
12081
|
-
return /* @__PURE__ */
|
|
12082
|
-
/* @__PURE__ */
|
|
12190
|
+
return /* @__PURE__ */ jsxs16(Fragment7, { children: [
|
|
12191
|
+
/* @__PURE__ */ jsx46(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ jsx46("span", { children: /* @__PURE__ */ jsx46(
|
|
12083
12192
|
RadioGroup,
|
|
12084
12193
|
{
|
|
12085
12194
|
name: id,
|
|
@@ -12088,7 +12197,7 @@ function RadioInputRendererComponent(props) {
|
|
|
12088
12197
|
value: index,
|
|
12089
12198
|
secondary: option.description,
|
|
12090
12199
|
disabled: option.disabled || disabled,
|
|
12091
|
-
avatar: /* @__PURE__ */
|
|
12200
|
+
avatar: /* @__PURE__ */ jsx46(OptionMedia, { icon: option.icon, image: option.image })
|
|
12092
12201
|
})),
|
|
12093
12202
|
selectedValue: selectedIndex != null ? selectedIndex : void 0,
|
|
12094
12203
|
onChange: onSelect
|
|
@@ -12102,7 +12211,7 @@ function RadioInputRendererComponent(props) {
|
|
|
12102
12211
|
// src/revamp/wise/renderers/SelectInputRenderer/TabInputRendererComponent.tsx
|
|
12103
12212
|
import { Tabs } from "@transferwise/components";
|
|
12104
12213
|
import { useEffect as useEffect4 } from "react";
|
|
12105
|
-
import { Fragment as
|
|
12214
|
+
import { Fragment as Fragment8, jsx as jsx47, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
12106
12215
|
function TabInputRendererComponent(props) {
|
|
12107
12216
|
const {
|
|
12108
12217
|
id,
|
|
@@ -12121,8 +12230,8 @@ function TabInputRendererComponent(props) {
|
|
|
12121
12230
|
onSelect(0);
|
|
12122
12231
|
}
|
|
12123
12232
|
}, [selectedIndex, onSelect, options.length]);
|
|
12124
|
-
return /* @__PURE__ */
|
|
12125
|
-
/* @__PURE__ */
|
|
12233
|
+
return /* @__PURE__ */ jsxs17(Fragment8, { children: [
|
|
12234
|
+
/* @__PURE__ */ jsx47(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ jsx47(
|
|
12126
12235
|
Tabs,
|
|
12127
12236
|
{
|
|
12128
12237
|
name: id,
|
|
@@ -12131,7 +12240,7 @@ function TabInputRendererComponent(props) {
|
|
|
12131
12240
|
title: option.title,
|
|
12132
12241
|
// if we pass null, we get some props-types console errors
|
|
12133
12242
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
12134
|
-
content: /* @__PURE__ */
|
|
12243
|
+
content: /* @__PURE__ */ jsx47(Fragment8, {}),
|
|
12135
12244
|
disabled: option.disabled || disabled
|
|
12136
12245
|
})),
|
|
12137
12246
|
onTabSelect: onSelect
|
|
@@ -12147,22 +12256,22 @@ import { SelectInput as SelectInput2, SelectInputOptionContent as SelectInputOpt
|
|
|
12147
12256
|
|
|
12148
12257
|
// src/revamp/wise/renderers/SelectInputRenderer/SelectTriggerMedia.tsx
|
|
12149
12258
|
import { Avatar as Avatar3, AvatarType as AvatarType3 } from "@transferwise/components";
|
|
12150
|
-
import { jsx as
|
|
12259
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
12151
12260
|
function SelectTriggerMedia({ icon, image }) {
|
|
12152
12261
|
if (image == null ? void 0 : image.url) {
|
|
12153
12262
|
return null;
|
|
12154
12263
|
}
|
|
12155
12264
|
if (icon && "name" in icon) {
|
|
12156
|
-
return /* @__PURE__ */
|
|
12265
|
+
return /* @__PURE__ */ jsx48(Avatar3, { type: AvatarType3.ICON, size: 24, children: /* @__PURE__ */ jsx48(DynamicIcon_default, { name: icon.name }) });
|
|
12157
12266
|
}
|
|
12158
12267
|
if (icon && "text" in icon) {
|
|
12159
|
-
return /* @__PURE__ */
|
|
12268
|
+
return /* @__PURE__ */ jsx48(Avatar3, { type: AvatarType3.ICON, size: 24, children: icon.text });
|
|
12160
12269
|
}
|
|
12161
12270
|
return null;
|
|
12162
12271
|
}
|
|
12163
12272
|
|
|
12164
12273
|
// src/revamp/wise/renderers/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
12165
|
-
import { Fragment as
|
|
12274
|
+
import { Fragment as Fragment9, jsx as jsx49, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
12166
12275
|
function SelectInputRendererComponent(props) {
|
|
12167
12276
|
const {
|
|
12168
12277
|
id,
|
|
@@ -12197,16 +12306,16 @@ function SelectInputRendererComponent(props) {
|
|
|
12197
12306
|
const contentProps = withinTrigger ? {
|
|
12198
12307
|
title: option.title,
|
|
12199
12308
|
note: option.description,
|
|
12200
|
-
icon: /* @__PURE__ */
|
|
12309
|
+
icon: /* @__PURE__ */ jsx49(SelectTriggerMedia, { icon: option.icon, image: option.image })
|
|
12201
12310
|
} : {
|
|
12202
12311
|
title: option.title,
|
|
12203
12312
|
description: option.description,
|
|
12204
|
-
icon: /* @__PURE__ */
|
|
12313
|
+
icon: /* @__PURE__ */ jsx49(OptionMedia, { icon: option.icon, image: option.image })
|
|
12205
12314
|
};
|
|
12206
|
-
return /* @__PURE__ */
|
|
12315
|
+
return /* @__PURE__ */ jsx49(SelectInputOptionContent2, __spreadValues({}, contentProps));
|
|
12207
12316
|
};
|
|
12208
|
-
return /* @__PURE__ */
|
|
12209
|
-
/* @__PURE__ */
|
|
12317
|
+
return /* @__PURE__ */ jsxs18(Fragment9, { children: [
|
|
12318
|
+
/* @__PURE__ */ jsx49(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ jsx49(
|
|
12210
12319
|
SelectInput2,
|
|
12211
12320
|
{
|
|
12212
12321
|
name: id,
|
|
@@ -12227,7 +12336,7 @@ function SelectInputRendererComponent(props) {
|
|
|
12227
12336
|
// src/revamp/wise/renderers/SelectInputRenderer/SegmentedInputRendererComponent.tsx
|
|
12228
12337
|
import { useEffect as useEffect5 } from "react";
|
|
12229
12338
|
import { SegmentedControl } from "@transferwise/components";
|
|
12230
|
-
import { Fragment as
|
|
12339
|
+
import { Fragment as Fragment10, jsx as jsx50, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
12231
12340
|
function SegmentedInputRendererComponent(props) {
|
|
12232
12341
|
const { id, children, description, error, help, label, options, selectedIndex, onSelect } = props;
|
|
12233
12342
|
useEffect5(() => {
|
|
@@ -12235,8 +12344,8 @@ function SegmentedInputRendererComponent(props) {
|
|
|
12235
12344
|
onSelect(0);
|
|
12236
12345
|
}
|
|
12237
12346
|
}, [selectedIndex, onSelect, options.length]);
|
|
12238
|
-
return /* @__PURE__ */
|
|
12239
|
-
/* @__PURE__ */
|
|
12347
|
+
return /* @__PURE__ */ jsxs19(Fragment10, { children: [
|
|
12348
|
+
/* @__PURE__ */ jsx50(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ jsx50(
|
|
12240
12349
|
SegmentedControl,
|
|
12241
12350
|
{
|
|
12242
12351
|
name: `${id}-segmented-control`,
|
|
@@ -12251,44 +12360,44 @@ function SegmentedInputRendererComponent(props) {
|
|
|
12251
12360
|
onChange: (value) => onSelect(Number(value))
|
|
12252
12361
|
}
|
|
12253
12362
|
) }),
|
|
12254
|
-
/* @__PURE__ */
|
|
12363
|
+
/* @__PURE__ */ jsx50("div", { id: `${id}-children`, children })
|
|
12255
12364
|
] });
|
|
12256
12365
|
}
|
|
12257
12366
|
var isValidIndex2 = (index, options) => index !== null && index >= 0 && index < options;
|
|
12258
12367
|
|
|
12259
12368
|
// src/revamp/wise/renderers/SelectInputRenderer/SelectInputRenderer.tsx
|
|
12260
|
-
import { jsx as
|
|
12369
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
12261
12370
|
var SelectInputRenderer = {
|
|
12262
12371
|
canRenderType: "input-select",
|
|
12263
12372
|
render: (props) => {
|
|
12264
12373
|
switch (props.control) {
|
|
12265
12374
|
case "radio":
|
|
12266
|
-
return /* @__PURE__ */
|
|
12375
|
+
return /* @__PURE__ */ jsx51(RadioInputRendererComponent, __spreadValues({}, props));
|
|
12267
12376
|
case "tab":
|
|
12268
|
-
return props.options.length > 3 ? /* @__PURE__ */
|
|
12377
|
+
return props.options.length > 3 ? /* @__PURE__ */ jsx51(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx51(TabInputRendererComponent, __spreadValues({}, props));
|
|
12269
12378
|
case "segmented":
|
|
12270
|
-
return props.options.length > 3 ? /* @__PURE__ */
|
|
12379
|
+
return props.options.length > 3 ? /* @__PURE__ */ jsx51(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx51(SegmentedInputRendererComponent, __spreadValues({}, props));
|
|
12271
12380
|
case "select":
|
|
12272
12381
|
default:
|
|
12273
|
-
return /* @__PURE__ */
|
|
12382
|
+
return /* @__PURE__ */ jsx51(SelectInputRendererComponent, __spreadValues({}, props));
|
|
12274
12383
|
}
|
|
12275
12384
|
}
|
|
12276
12385
|
};
|
|
12277
12386
|
var SelectInputRenderer_default = SelectInputRenderer;
|
|
12278
12387
|
|
|
12279
12388
|
// src/revamp/wise/renderers/StatusListRenderer.tsx
|
|
12280
|
-
import { Header as
|
|
12281
|
-
import { jsx as
|
|
12389
|
+
import { Header as Header5, Summary } from "@transferwise/components";
|
|
12390
|
+
import { jsx as jsx52, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
12282
12391
|
var StatusListRenderer = {
|
|
12283
12392
|
canRenderType: "status-list",
|
|
12284
|
-
render: ({ margin, items, title }) => /* @__PURE__ */
|
|
12285
|
-
title ? /* @__PURE__ */
|
|
12286
|
-
items.map(({ description, icon, status, title: itemTitle }) => /* @__PURE__ */
|
|
12393
|
+
render: ({ margin, items, title }) => /* @__PURE__ */ jsxs20("div", { className: getMargin(margin), children: [
|
|
12394
|
+
title ? /* @__PURE__ */ jsx52(Header5, { title }) : null,
|
|
12395
|
+
items.map(({ description, icon, status, title: itemTitle }) => /* @__PURE__ */ jsx52(
|
|
12287
12396
|
Summary,
|
|
12288
12397
|
{
|
|
12289
12398
|
title: itemTitle,
|
|
12290
12399
|
description,
|
|
12291
|
-
icon: icon && "name" in icon ? /* @__PURE__ */
|
|
12400
|
+
icon: icon && "name" in icon ? /* @__PURE__ */ jsx52(DynamicIcon_default, { name: icon.name }) : null,
|
|
12292
12401
|
status: mapStatus(status)
|
|
12293
12402
|
},
|
|
12294
12403
|
`${title}/${description || ""}`
|
|
@@ -12311,31 +12420,31 @@ import {
|
|
|
12311
12420
|
TextArea as TextArea2,
|
|
12312
12421
|
TextareaWithDisplayFormat
|
|
12313
12422
|
} from "@transferwise/components";
|
|
12314
|
-
import { jsx as
|
|
12423
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
12315
12424
|
function VariableTextInput({
|
|
12316
12425
|
control,
|
|
12317
12426
|
inputProps
|
|
12318
12427
|
}) {
|
|
12319
12428
|
switch (control) {
|
|
12320
12429
|
case "password":
|
|
12321
|
-
return /* @__PURE__ */
|
|
12430
|
+
return /* @__PURE__ */ jsx53(TextInput, __spreadValues({ type: "password" }, inputProps));
|
|
12322
12431
|
case "email":
|
|
12323
|
-
return /* @__PURE__ */
|
|
12432
|
+
return /* @__PURE__ */ jsx53(TextInput, __spreadValues({ type: "email" }, inputProps));
|
|
12324
12433
|
case "textarea":
|
|
12325
|
-
return /* @__PURE__ */
|
|
12434
|
+
return /* @__PURE__ */ jsx53(TextAreaInput, __spreadValues({}, inputProps));
|
|
12326
12435
|
case "numeric":
|
|
12327
|
-
return /* @__PURE__ */
|
|
12436
|
+
return /* @__PURE__ */ jsx53(NumericInput, __spreadValues({ type: "number" }, inputProps));
|
|
12328
12437
|
case "phone-number":
|
|
12329
|
-
return /* @__PURE__ */
|
|
12438
|
+
return /* @__PURE__ */ jsx53(PhoneNumberInput, __spreadValues({}, inputProps));
|
|
12330
12439
|
default:
|
|
12331
|
-
return /* @__PURE__ */
|
|
12440
|
+
return /* @__PURE__ */ jsx53(TextInput, __spreadValues({ type: "text" }, inputProps));
|
|
12332
12441
|
}
|
|
12333
12442
|
}
|
|
12334
12443
|
function TextInput(_a) {
|
|
12335
12444
|
var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
|
|
12336
12445
|
if (typeof displayFormat === "string") {
|
|
12337
12446
|
const inputProps = __spreadValues({ id, name: id, className: "form-control" }, rest);
|
|
12338
|
-
return /* @__PURE__ */
|
|
12447
|
+
return /* @__PURE__ */ jsx53(
|
|
12339
12448
|
InputWithDisplayFormat,
|
|
12340
12449
|
__spreadValues({
|
|
12341
12450
|
displayPattern: displayFormat,
|
|
@@ -12343,29 +12452,29 @@ function TextInput(_a) {
|
|
|
12343
12452
|
}, inputProps)
|
|
12344
12453
|
);
|
|
12345
12454
|
}
|
|
12346
|
-
return /* @__PURE__ */
|
|
12455
|
+
return /* @__PURE__ */ jsx53(Input6, __spreadValues({ id, name: id, onChange: (e) => onChange(e.target.value) }, rest));
|
|
12347
12456
|
}
|
|
12348
12457
|
function TextAreaInput(_a) {
|
|
12349
12458
|
var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
|
|
12350
12459
|
const textAreaProps = __spreadValues({ id, name: id }, rest);
|
|
12351
|
-
return typeof displayFormat === "string" ? /* @__PURE__ */
|
|
12460
|
+
return typeof displayFormat === "string" ? /* @__PURE__ */ jsx53(
|
|
12352
12461
|
TextareaWithDisplayFormat,
|
|
12353
12462
|
__spreadValues({
|
|
12354
12463
|
displayPattern: displayFormat,
|
|
12355
12464
|
onChange: (newValue) => onChange(newValue)
|
|
12356
12465
|
}, textAreaProps)
|
|
12357
|
-
) : /* @__PURE__ */
|
|
12466
|
+
) : /* @__PURE__ */ jsx53(TextArea2, __spreadValues({ onChange: (e) => onChange(e.target.value) }, textAreaProps));
|
|
12358
12467
|
}
|
|
12359
12468
|
function NumericInput(_a) {
|
|
12360
12469
|
var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
|
|
12361
12470
|
const numericProps = __spreadValues({ id, name: id, onWheel }, rest);
|
|
12362
|
-
return typeof displayFormat === "string" ? /* @__PURE__ */
|
|
12471
|
+
return typeof displayFormat === "string" ? /* @__PURE__ */ jsx53(
|
|
12363
12472
|
InputWithDisplayFormat,
|
|
12364
12473
|
__spreadValues({
|
|
12365
12474
|
displayPattern: displayFormat,
|
|
12366
12475
|
onChange: (newValue) => onChange(numericValueOrNull(newValue))
|
|
12367
12476
|
}, numericProps)
|
|
12368
|
-
) : /* @__PURE__ */
|
|
12477
|
+
) : /* @__PURE__ */ jsx53(
|
|
12369
12478
|
Input6,
|
|
12370
12479
|
__spreadValues({
|
|
12371
12480
|
onChange: ({ target: { value: newValue } }) => onChange(numericValueOrNull(newValue))
|
|
@@ -12374,12 +12483,12 @@ function NumericInput(_a) {
|
|
|
12374
12483
|
}
|
|
12375
12484
|
function PhoneNumberInput(_a) {
|
|
12376
12485
|
var _b = _a, { value } = _b, rest = __objRest(_b, ["value"]);
|
|
12377
|
-
return /* @__PURE__ */
|
|
12486
|
+
return /* @__PURE__ */ jsx53(PhoneNumber, __spreadValues({ initialValue: value }, rest));
|
|
12378
12487
|
}
|
|
12379
12488
|
var VariableTextInput_default = VariableTextInput;
|
|
12380
12489
|
|
|
12381
12490
|
// src/revamp/wise/renderers/TextInputRenderer.tsx
|
|
12382
|
-
import { jsx as
|
|
12491
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
12383
12492
|
var TextInputRenderer = {
|
|
12384
12493
|
canRenderType: "input-text",
|
|
12385
12494
|
render: (props) => {
|
|
@@ -12404,14 +12513,14 @@ var TextInputRenderer = {
|
|
|
12404
12513
|
]);
|
|
12405
12514
|
const value = initialValue != null ? initialValue : "";
|
|
12406
12515
|
const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
|
|
12407
|
-
return /* @__PURE__ */
|
|
12516
|
+
return /* @__PURE__ */ jsx54(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ jsx54(VariableTextInput_default, { control, inputProps }) });
|
|
12408
12517
|
}
|
|
12409
12518
|
};
|
|
12410
12519
|
var TextInputRenderer_default = TextInputRenderer;
|
|
12411
12520
|
|
|
12412
12521
|
// src/revamp/wise/renderers/UploadInputRenderer.tsx
|
|
12413
12522
|
import { Upload, UploadInput as UploadInput2 } from "@transferwise/components";
|
|
12414
|
-
import { jsx as
|
|
12523
|
+
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
12415
12524
|
var UploadInputRenderer = {
|
|
12416
12525
|
canRenderType: "input-upload",
|
|
12417
12526
|
render: (props) => {
|
|
@@ -12427,7 +12536,7 @@ var UploadInputRenderer = {
|
|
|
12427
12536
|
};
|
|
12428
12537
|
return (
|
|
12429
12538
|
// We don't pass help here as there is no sensible place to display it
|
|
12430
|
-
/* @__PURE__ */
|
|
12539
|
+
/* @__PURE__ */ jsx55(UploadFieldInput_default, { id, label: void 0, description: void 0, error, children: /* @__PURE__ */ jsx55(
|
|
12431
12540
|
UploadInput2,
|
|
12432
12541
|
{
|
|
12433
12542
|
id,
|
|
@@ -12482,7 +12591,7 @@ var LargeUploadRenderer = {
|
|
|
12482
12591
|
throw e;
|
|
12483
12592
|
}
|
|
12484
12593
|
};
|
|
12485
|
-
return /* @__PURE__ */
|
|
12594
|
+
return /* @__PURE__ */ jsx55(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ jsx55(
|
|
12486
12595
|
Upload,
|
|
12487
12596
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
12488
12597
|
usAccept: getAcceptsString(accepts),
|
|
@@ -12495,67 +12604,6 @@ var LargeUploadRenderer = {
|
|
|
12495
12604
|
}
|
|
12496
12605
|
};
|
|
12497
12606
|
|
|
12498
|
-
// src/revamp/wise/renderers/ReviewRenderer.tsx
|
|
12499
|
-
import { DefinitionList, Header as Header5 } from "@transferwise/components";
|
|
12500
|
-
import { Fragment as Fragment10, jsx as jsx55, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
12501
|
-
var ReviewRenderer = {
|
|
12502
|
-
canRenderType: "review",
|
|
12503
|
-
render: ({ callToAction, control, fields, margin, title }) => {
|
|
12504
|
-
const orientation = mapControlToDefinitionListLayout(control);
|
|
12505
|
-
const action = callToAction ? {
|
|
12506
|
-
text: callToAction.title,
|
|
12507
|
-
onClick: (event) => {
|
|
12508
|
-
event.preventDefault();
|
|
12509
|
-
callToAction.onClick();
|
|
12510
|
-
}
|
|
12511
|
-
} : void 0;
|
|
12512
|
-
return /* @__PURE__ */ jsxs20("div", { className: getMargin(margin), children: [
|
|
12513
|
-
(title || callToAction) && /* @__PURE__ */ jsx55(Header5, { title: title != null ? title : "", action }),
|
|
12514
|
-
/* @__PURE__ */ jsx55("div", { className: margin, children: /* @__PURE__ */ jsx55(
|
|
12515
|
-
DefinitionList,
|
|
12516
|
-
{
|
|
12517
|
-
layout: orientation,
|
|
12518
|
-
definitions: fields.map(({ label, value, help }, index) => ({
|
|
12519
|
-
key: String(index),
|
|
12520
|
-
title: label,
|
|
12521
|
-
value: getFieldValue(value, help, orientation)
|
|
12522
|
-
}))
|
|
12523
|
-
}
|
|
12524
|
-
) })
|
|
12525
|
-
] });
|
|
12526
|
-
}
|
|
12527
|
-
};
|
|
12528
|
-
var ReviewRenderer_default = ReviewRenderer;
|
|
12529
|
-
var mapControlToDefinitionListLayout = (control) => {
|
|
12530
|
-
switch (control) {
|
|
12531
|
-
case "horizontal":
|
|
12532
|
-
case "horizontal-end-aligned":
|
|
12533
|
-
return "HORIZONTAL_RIGHT_ALIGNED";
|
|
12534
|
-
case "horizontal-start-aligned":
|
|
12535
|
-
return "HORIZONTAL_LEFT_ALIGNED";
|
|
12536
|
-
case "vertical-two-column":
|
|
12537
|
-
return "VERTICAL_TWO_COLUMN";
|
|
12538
|
-
case "vertical":
|
|
12539
|
-
case "vertical-one-column":
|
|
12540
|
-
default:
|
|
12541
|
-
return "VERTICAL_ONE_COLUMN";
|
|
12542
|
-
}
|
|
12543
|
-
};
|
|
12544
|
-
var getFieldValue = (value, help, orientation) => {
|
|
12545
|
-
if (help) {
|
|
12546
|
-
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ jsxs20(Fragment10, { children: [
|
|
12547
|
-
/* @__PURE__ */ jsx55(Help_default, { help }),
|
|
12548
|
-
" ",
|
|
12549
|
-
value
|
|
12550
|
-
] }) : /* @__PURE__ */ jsxs20(Fragment10, { children: [
|
|
12551
|
-
value,
|
|
12552
|
-
" ",
|
|
12553
|
-
/* @__PURE__ */ jsx55(Help_default, { help })
|
|
12554
|
-
] });
|
|
12555
|
-
}
|
|
12556
|
-
return value;
|
|
12557
|
-
};
|
|
12558
|
-
|
|
12559
12607
|
// src/revamp/wise/renderers/step/StepRenderer.tsx
|
|
12560
12608
|
import { useMemo as useMemo4 } from "react";
|
|
12561
12609
|
|
|
@@ -19478,11 +19526,85 @@ function JsonSchemaForm(props) {
|
|
|
19478
19526
|
var JsonSchemaForm_default = JsonSchemaForm;
|
|
19479
19527
|
var noop8 = () => {
|
|
19480
19528
|
};
|
|
19529
|
+
|
|
19530
|
+
// src/revamp/wise/renderers/step/KYCCameraStepRenderer.tsx
|
|
19531
|
+
import { useEffect as useEffect27 } from "react";
|
|
19532
|
+
import { Fragment as Fragment25, jsx as jsx130 } from "react/jsx-runtime";
|
|
19533
|
+
var KYCCameraStepRenderer = {
|
|
19534
|
+
canRenderType: "step",
|
|
19535
|
+
canRender: (props) => getKYCCameraStepConfiguration(props.step) != null,
|
|
19536
|
+
render: KYCCameraStepRendererComponent
|
|
19537
|
+
};
|
|
19538
|
+
function KYCCameraStepRendererComponent(props) {
|
|
19539
|
+
const { error, trackEvent, step, onAction } = props;
|
|
19540
|
+
useEffect27(() => {
|
|
19541
|
+
if (error) {
|
|
19542
|
+
console.error("KYCCameraStepRendererComponent", error);
|
|
19543
|
+
}
|
|
19544
|
+
}, [error]);
|
|
19545
|
+
const config = getKYCCameraStepConfiguration(step);
|
|
19546
|
+
if (!config) {
|
|
19547
|
+
return /* @__PURE__ */ jsx130(Fragment25, {});
|
|
19548
|
+
}
|
|
19549
|
+
const handleCapture = async (blob) => {
|
|
19550
|
+
if (blob) {
|
|
19551
|
+
const newValue = { [propertyName]: await blobToBase642(blob) };
|
|
19552
|
+
const patchedAction = __spreadProps(__spreadValues({}, action), { skipValidation: true, data: newValue });
|
|
19553
|
+
void onAction(patchedAction);
|
|
19554
|
+
}
|
|
19555
|
+
};
|
|
19556
|
+
const { title, imageUrl, cameraConfig, action, propertyName } = config;
|
|
19557
|
+
const kycCameraConfig = cameraConfig;
|
|
19558
|
+
const { assets, instructions, direction } = kycCameraConfig;
|
|
19559
|
+
return config ? /* @__PURE__ */ jsx130(
|
|
19560
|
+
CameraCapture_default,
|
|
19561
|
+
{
|
|
19562
|
+
overlay: assets == null ? void 0 : assets.overlay,
|
|
19563
|
+
outline: assets == null ? void 0 : assets.outline,
|
|
19564
|
+
title: error != null ? error : title,
|
|
19565
|
+
imageUrl,
|
|
19566
|
+
instructions,
|
|
19567
|
+
direction,
|
|
19568
|
+
onEvent: trackEvent,
|
|
19569
|
+
onCapture: (blob) => {
|
|
19570
|
+
void handleCapture(blob);
|
|
19571
|
+
}
|
|
19572
|
+
},
|
|
19573
|
+
error
|
|
19574
|
+
) : /* @__PURE__ */ jsx130(Fragment25, {});
|
|
19575
|
+
}
|
|
19576
|
+
var getKYCCameraStepConfiguration = (step) => {
|
|
19577
|
+
var _a, _b, _c;
|
|
19578
|
+
const action = (_a = step.actions) == null ? void 0 : _a[0];
|
|
19579
|
+
if (action === void 0) {
|
|
19580
|
+
return null;
|
|
19581
|
+
}
|
|
19582
|
+
const firstSchema = filterHiddenSchemas2((_b = step.schemas) != null ? _b : [])[0];
|
|
19583
|
+
if (!firstSchema || !isObjectSchema(firstSchema)) {
|
|
19584
|
+
return null;
|
|
19585
|
+
}
|
|
19586
|
+
const propertyName = Object.keys(firstSchema.properties)[0];
|
|
19587
|
+
const childSchema = propertyName ? firstSchema.properties[propertyName] : void 0;
|
|
19588
|
+
const cameraConfig = childSchema ? getCameraConfig(childSchema) : null;
|
|
19589
|
+
const title = childSchema == null ? void 0 : childSchema.title;
|
|
19590
|
+
const imageUrl = (_c = childSchema == null ? void 0 : childSchema.image) == null ? void 0 : _c.url;
|
|
19591
|
+
return action && propertyName && cameraConfig ? { title, imageUrl, propertyName, cameraConfig, action } : null;
|
|
19592
|
+
};
|
|
19593
|
+
var getCameraConfig = (childSchema) => childSchema != null && "type" in childSchema && childSchema.type === "string" && childSchema.format === "base64url" && childSchema.source === "camera" && childSchema.cameraConfig != null ? childSchema.cameraConfig : null;
|
|
19594
|
+
var filterHiddenSchemas2 = (schemas) => schemas.filter(
|
|
19595
|
+
(schema) => isObjectSchema(schema) ? Object.values((schema == null ? void 0 : schema.properties) || {}).find((s) => (s == null ? void 0 : s.hidden) !== true) : (schema == null ? void 0 : schema.hidden) !== true
|
|
19596
|
+
);
|
|
19597
|
+
var blobToBase642 = (blob) => new Promise((resolve, _) => {
|
|
19598
|
+
const reader = new FileReader();
|
|
19599
|
+
reader.onloadend = () => resolve(reader.result);
|
|
19600
|
+
reader.readAsDataURL(blob);
|
|
19601
|
+
});
|
|
19481
19602
|
export {
|
|
19482
19603
|
DynamicFlow_default as DynamicFlow,
|
|
19483
19604
|
DynamicFlowWise_default as DynamicFlowRevamp,
|
|
19484
19605
|
DynamicFragmentWise_default as DynamicFragmentWise,
|
|
19485
19606
|
JsonSchemaForm_default as JsonSchemaForm,
|
|
19607
|
+
KYCCameraStepRenderer,
|
|
19486
19608
|
DynamicLayout_default as Layout,
|
|
19487
19609
|
convertStepToLayout,
|
|
19488
19610
|
inlineReferences,
|