@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.js
CHANGED
|
@@ -291,6 +291,7 @@ __export(src_exports, {
|
|
|
291
291
|
DynamicFlowRevamp: () => DynamicFlowWise_default,
|
|
292
292
|
DynamicFragmentWise: () => DynamicFragmentWise_default,
|
|
293
293
|
JsonSchemaForm: () => JsonSchemaForm_default,
|
|
294
|
+
KYCCameraStepRenderer: () => KYCCameraStepRenderer,
|
|
294
295
|
Layout: () => DynamicLayout_default,
|
|
295
296
|
convertStepToLayout: () => convertStepToLayout,
|
|
296
297
|
inlineReferences: () => inlineReferences,
|
|
@@ -1291,16 +1292,28 @@ var isStringSchemaWithUpload = (schema) => isStringSchema(schema) && schema.form
|
|
|
1291
1292
|
var isSchemaWithPersistAsync = (schema) => "persistAsync" in schema && !isNullish(schema.persistAsync);
|
|
1292
1293
|
|
|
1293
1294
|
// src/revamp/renderers/stepComponentToProps.ts
|
|
1294
|
-
var stepComponentToProps = ({
|
|
1295
|
+
var stepComponentToProps = ({
|
|
1296
|
+
back,
|
|
1297
|
+
description,
|
|
1298
|
+
error,
|
|
1299
|
+
external,
|
|
1300
|
+
loadingState,
|
|
1301
|
+
step,
|
|
1302
|
+
title,
|
|
1303
|
+
trackEvent,
|
|
1304
|
+
onAction
|
|
1305
|
+
}, children) => ({
|
|
1295
1306
|
type: "step",
|
|
1296
1307
|
back,
|
|
1297
1308
|
description,
|
|
1298
1309
|
error,
|
|
1299
1310
|
external,
|
|
1300
1311
|
loadingState,
|
|
1312
|
+
step,
|
|
1301
1313
|
title,
|
|
1314
|
+
children,
|
|
1302
1315
|
trackEvent,
|
|
1303
|
-
|
|
1316
|
+
onAction
|
|
1304
1317
|
});
|
|
1305
1318
|
|
|
1306
1319
|
// src/revamp/renderers/mappers/alertComponentToProps.ts
|
|
@@ -1815,12 +1828,14 @@ var getRenderFunction = (renderers) => {
|
|
|
1815
1828
|
if (type === "hidden") {
|
|
1816
1829
|
return null;
|
|
1817
1830
|
}
|
|
1818
|
-
const renderer = renderers.find(
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1831
|
+
const renderer = renderers.find(({ canRenderType, canRender = () => true }) => {
|
|
1832
|
+
try {
|
|
1833
|
+
return canRenderType === type && canRender(props);
|
|
1834
|
+
} catch (e) {
|
|
1835
|
+
console.error(`Error in canRender function for ${type}`, e);
|
|
1836
|
+
return false;
|
|
1837
|
+
}
|
|
1838
|
+
});
|
|
1824
1839
|
if (!renderer) {
|
|
1825
1840
|
throw new Error(`Could not find a renderer for ${type}`);
|
|
1826
1841
|
}
|
|
@@ -5682,21 +5697,13 @@ var z = /* @__PURE__ */ Object.freeze({
|
|
|
5682
5697
|
quotelessJson,
|
|
5683
5698
|
ZodError
|
|
5684
5699
|
});
|
|
5685
|
-
var
|
|
5686
|
-
|
|
5687
|
-
|
|
5688
|
-
|
|
5689
|
-
|
|
5690
|
-
|
|
5691
|
-
z.literal("GET"),
|
|
5692
|
-
z.literal("POST"),
|
|
5693
|
-
z.literal("PUT"),
|
|
5694
|
-
z.literal("PATCH"),
|
|
5695
|
-
z.literal("DELETE")
|
|
5700
|
+
var sizeSchema = z.union([
|
|
5701
|
+
z.literal("xs"),
|
|
5702
|
+
z.literal("sm"),
|
|
5703
|
+
z.literal("md"),
|
|
5704
|
+
z.literal("lg"),
|
|
5705
|
+
z.literal("xl")
|
|
5696
5706
|
]);
|
|
5697
|
-
var iconNamedSchema = z.object({
|
|
5698
|
-
name: z.string()
|
|
5699
|
-
});
|
|
5700
5707
|
var contextSchema = z.union([
|
|
5701
5708
|
z.literal("positive"),
|
|
5702
5709
|
z.literal("neutral"),
|
|
@@ -5707,18 +5714,114 @@ var contextSchema = z.union([
|
|
|
5707
5714
|
z.literal("info"),
|
|
5708
5715
|
z.literal("primary")
|
|
5709
5716
|
]);
|
|
5710
|
-
var
|
|
5711
|
-
|
|
5712
|
-
|
|
5713
|
-
|
|
5714
|
-
|
|
5715
|
-
|
|
5716
|
-
z.literal("
|
|
5717
|
-
z.literal("
|
|
5718
|
-
z.literal("
|
|
5717
|
+
var columnsLayoutBiasSchema = z.union([
|
|
5718
|
+
z.literal("none"),
|
|
5719
|
+
z.literal("left"),
|
|
5720
|
+
z.literal("right")
|
|
5721
|
+
]);
|
|
5722
|
+
var statusListLayoutStatusSchema = z.union([
|
|
5723
|
+
z.literal("not-done"),
|
|
5724
|
+
z.literal("pending"),
|
|
5725
|
+
z.literal("done")
|
|
5719
5726
|
]);
|
|
5720
5727
|
var alignSchema = z.union([z.literal("left"), z.literal("center"), z.literal("right")]);
|
|
5721
|
-
var
|
|
5728
|
+
var formLayoutSchemaReferenceSchema = z.object({
|
|
5729
|
+
$ref: z.string()
|
|
5730
|
+
});
|
|
5731
|
+
var modalLayoutTriggerSchema = z.object({
|
|
5732
|
+
title: z.string()
|
|
5733
|
+
});
|
|
5734
|
+
var httpMethodSchema = z.union([
|
|
5735
|
+
z.literal("GET"),
|
|
5736
|
+
z.literal("POST"),
|
|
5737
|
+
z.literal("PUT"),
|
|
5738
|
+
z.literal("PATCH"),
|
|
5739
|
+
z.literal("DELETE")
|
|
5740
|
+
]);
|
|
5741
|
+
var dividerLayoutSchema = z.object({
|
|
5742
|
+
type: z.literal("divider"),
|
|
5743
|
+
control: z.string().optional(),
|
|
5744
|
+
margin: sizeSchema.optional()
|
|
5745
|
+
});
|
|
5746
|
+
var listLayoutStatusSchema = z.union([
|
|
5747
|
+
z.literal("warning"),
|
|
5748
|
+
z.literal("neutral"),
|
|
5749
|
+
z.literal("positive")
|
|
5750
|
+
]);
|
|
5751
|
+
var headingLayoutSchema = z.object({
|
|
5752
|
+
type: z.literal("heading"),
|
|
5753
|
+
text: z.string(),
|
|
5754
|
+
size: sizeSchema.optional(),
|
|
5755
|
+
align: alignSchema.optional(),
|
|
5756
|
+
control: z.string().optional(),
|
|
5757
|
+
margin: sizeSchema.optional()
|
|
5758
|
+
});
|
|
5759
|
+
var alertLayoutSchema = z.object({
|
|
5760
|
+
type: z.literal("alert"),
|
|
5761
|
+
markdown: z.string(),
|
|
5762
|
+
context: contextSchema.optional(),
|
|
5763
|
+
control: z.string().optional(),
|
|
5764
|
+
margin: sizeSchema.optional()
|
|
5765
|
+
});
|
|
5766
|
+
var formLayoutSchema = z.object({
|
|
5767
|
+
type: z.literal("form"),
|
|
5768
|
+
schema: formLayoutSchemaReferenceSchema.optional(),
|
|
5769
|
+
schemaId: z.string(),
|
|
5770
|
+
control: z.string().optional(),
|
|
5771
|
+
margin: sizeSchema.optional()
|
|
5772
|
+
});
|
|
5773
|
+
var imageLayoutSchema = z.object({
|
|
5774
|
+
type: z.literal("image"),
|
|
5775
|
+
text: z.string().optional(),
|
|
5776
|
+
url: z.string(),
|
|
5777
|
+
size: sizeSchema.optional(),
|
|
5778
|
+
accessibilityDescription: z.string().optional(),
|
|
5779
|
+
control: z.string().optional(),
|
|
5780
|
+
margin: sizeSchema.optional()
|
|
5781
|
+
});
|
|
5782
|
+
var infoLayoutSchema = z.object({
|
|
5783
|
+
type: z.literal("info"),
|
|
5784
|
+
markdown: z.string(),
|
|
5785
|
+
align: alignSchema.optional(),
|
|
5786
|
+
control: z.string().optional(),
|
|
5787
|
+
margin: sizeSchema.optional()
|
|
5788
|
+
});
|
|
5789
|
+
var loadingIndicatorLayoutSchema = z.object({
|
|
5790
|
+
type: z.literal("loading-indicator"),
|
|
5791
|
+
size: sizeSchema.optional(),
|
|
5792
|
+
control: z.string().optional(),
|
|
5793
|
+
margin: sizeSchema.optional()
|
|
5794
|
+
});
|
|
5795
|
+
var paragraphLayoutSchema = z.object({
|
|
5796
|
+
type: z.literal("paragraph"),
|
|
5797
|
+
text: z.string(),
|
|
5798
|
+
align: alignSchema.optional(),
|
|
5799
|
+
control: z.string().optional(),
|
|
5800
|
+
margin: sizeSchema.optional()
|
|
5801
|
+
});
|
|
5802
|
+
var instructionsLayoutItemSchema = z.object({
|
|
5803
|
+
text: z.string(),
|
|
5804
|
+
context: contextSchema
|
|
5805
|
+
});
|
|
5806
|
+
var helpSchema = z.object({
|
|
5807
|
+
markdown: z.string()
|
|
5808
|
+
});
|
|
5809
|
+
var imageSchema = z.object({
|
|
5810
|
+
text: z.string().optional(),
|
|
5811
|
+
url: z.string(),
|
|
5812
|
+
accessibilityDescription: z.string().optional()
|
|
5813
|
+
});
|
|
5814
|
+
var summaryProviderSchema = z.object({
|
|
5815
|
+
providesTitle: z.boolean().optional(),
|
|
5816
|
+
providesDescription: z.boolean().optional(),
|
|
5817
|
+
providesIcon: z.boolean().optional(),
|
|
5818
|
+
providesImage: z.boolean().optional()
|
|
5819
|
+
});
|
|
5820
|
+
var validateAsyncSchema = z.object({
|
|
5821
|
+
param: z.string(),
|
|
5822
|
+
method: httpMethodSchema,
|
|
5823
|
+
url: z.string()
|
|
5824
|
+
});
|
|
5722
5825
|
var autocompleteTokenSchema = z.union([
|
|
5723
5826
|
z.literal("on"),
|
|
5724
5827
|
z.literal("name"),
|
|
@@ -5784,207 +5887,98 @@ var autocompleteTokenSchema = z.union([
|
|
|
5784
5887
|
z.literal("fax"),
|
|
5785
5888
|
z.literal("pager")
|
|
5786
5889
|
]);
|
|
5787
|
-
var
|
|
5788
|
-
|
|
5789
|
-
|
|
5790
|
-
|
|
5791
|
-
|
|
5890
|
+
var stringSchemaFormatSchema = z.union([
|
|
5891
|
+
z.literal("date"),
|
|
5892
|
+
z.literal("email"),
|
|
5893
|
+
z.literal("numeric"),
|
|
5894
|
+
z.literal("password"),
|
|
5895
|
+
z.literal("phone-number"),
|
|
5896
|
+
z.literal("base64url")
|
|
5897
|
+
]);
|
|
5898
|
+
var jsonElementSchema = z.lazy(
|
|
5899
|
+
() => z.union([
|
|
5900
|
+
z.string(),
|
|
5901
|
+
z.number(),
|
|
5902
|
+
z.boolean(),
|
|
5903
|
+
z.record(jsonElementSchema),
|
|
5904
|
+
z.array(jsonElementSchema)
|
|
5905
|
+
]).nullable()
|
|
5906
|
+
);
|
|
5907
|
+
var uploadSourceSchema = z.union([z.literal("camera"), z.literal("file")]);
|
|
5908
|
+
var externalSchema = z.object({
|
|
5909
|
+
url: z.string()
|
|
5792
5910
|
});
|
|
5793
|
-
var
|
|
5794
|
-
|
|
5795
|
-
|
|
5796
|
-
context: contextSchema.optional(),
|
|
5797
|
-
control: z.string().optional(),
|
|
5798
|
-
margin: sizeSchema.optional()
|
|
5911
|
+
var stepErrorSchema = z.object({
|
|
5912
|
+
error: z.string().optional(),
|
|
5913
|
+
validation: jsonElementSchema.optional()
|
|
5799
5914
|
});
|
|
5800
|
-
var
|
|
5801
|
-
|
|
5802
|
-
|
|
5915
|
+
var errorResponseBodySchema = z.object({
|
|
5916
|
+
refreshFormUrl: z.string().optional(),
|
|
5917
|
+
analytics: z.record(z.string()).optional(),
|
|
5918
|
+
error: z.string().optional(),
|
|
5919
|
+
validation: jsonElementSchema.optional(),
|
|
5920
|
+
refreshUrl: z.string().optional()
|
|
5921
|
+
});
|
|
5922
|
+
var searchSearchRequestSchema = z.object({
|
|
5923
|
+
url: z.string(),
|
|
5924
|
+
method: httpMethodSchema,
|
|
5925
|
+
param: z.string(),
|
|
5926
|
+
query: z.string()
|
|
5927
|
+
});
|
|
5928
|
+
var navigationStackBehaviorSchema = z.union([
|
|
5929
|
+
z.literal("default"),
|
|
5930
|
+
z.literal("remove-previous"),
|
|
5931
|
+
z.literal("remove-all"),
|
|
5932
|
+
z.literal("replace-current")
|
|
5933
|
+
]);
|
|
5934
|
+
var actionTypeSchema = z.union([
|
|
5935
|
+
z.literal("primary"),
|
|
5936
|
+
z.literal("secondary"),
|
|
5937
|
+
z.literal("link"),
|
|
5938
|
+
z.literal("positive"),
|
|
5939
|
+
z.literal("negative")
|
|
5940
|
+
]);
|
|
5941
|
+
var iconNamedSchema = z.object({
|
|
5942
|
+
name: z.string()
|
|
5943
|
+
});
|
|
5944
|
+
var iconTextSchema = z.object({
|
|
5945
|
+
text: z.string()
|
|
5946
|
+
});
|
|
5947
|
+
var actionSchema = z.object({
|
|
5948
|
+
title: z.string().optional(),
|
|
5949
|
+
type: actionTypeSchema.optional(),
|
|
5950
|
+
disabled: z.boolean().optional(),
|
|
5951
|
+
$id: z.string().optional(),
|
|
5952
|
+
$ref: z.string().optional(),
|
|
5953
|
+
id: z.string().optional(),
|
|
5954
|
+
url: z.string().optional(),
|
|
5955
|
+
method: httpMethodSchema.optional(),
|
|
5956
|
+
exit: z.boolean().optional(),
|
|
5957
|
+
result: jsonElementSchema.optional(),
|
|
5958
|
+
data: jsonElementSchema.optional(),
|
|
5959
|
+
timeout: z.number().optional(),
|
|
5960
|
+
skipValidation: z.boolean().optional()
|
|
5961
|
+
});
|
|
5962
|
+
var markdownLayoutSchema = z.object({
|
|
5963
|
+
type: z.literal("markdown"),
|
|
5964
|
+
content: z.string(),
|
|
5803
5965
|
align: alignSchema.optional(),
|
|
5804
5966
|
control: z.string().optional(),
|
|
5805
5967
|
margin: sizeSchema.optional()
|
|
5806
5968
|
});
|
|
5807
|
-
var
|
|
5808
|
-
type: z.literal("
|
|
5969
|
+
var searchLayoutSchema = z.object({
|
|
5970
|
+
type: z.literal("search"),
|
|
5971
|
+
title: z.string(),
|
|
5972
|
+
method: httpMethodSchema,
|
|
5973
|
+
url: z.string(),
|
|
5974
|
+
param: z.string(),
|
|
5975
|
+
emptyMessage: z.string().optional(),
|
|
5809
5976
|
control: z.string().optional(),
|
|
5810
5977
|
margin: sizeSchema.optional()
|
|
5811
5978
|
});
|
|
5812
|
-
var
|
|
5813
|
-
z.literal("warning"),
|
|
5814
|
-
z.literal("neutral"),
|
|
5815
|
-
z.literal("positive")
|
|
5816
|
-
]);
|
|
5817
|
-
var formLayoutSchemaReferenceSchema = z.object({
|
|
5818
|
-
$ref: z.string()
|
|
5819
|
-
});
|
|
5820
|
-
var imageLayoutSchema = z.object({
|
|
5821
|
-
type: z.literal("image"),
|
|
5822
|
-
text: z.string().optional(),
|
|
5823
|
-
url: z.string(),
|
|
5824
|
-
size: sizeSchema.optional(),
|
|
5825
|
-
accessibilityDescription: z.string().optional(),
|
|
5826
|
-
control: z.string().optional(),
|
|
5827
|
-
margin: sizeSchema.optional()
|
|
5828
|
-
});
|
|
5829
|
-
var statusListLayoutStatusSchema = z.union([
|
|
5830
|
-
z.literal("not-done"),
|
|
5831
|
-
z.literal("pending"),
|
|
5832
|
-
z.literal("done")
|
|
5833
|
-
]);
|
|
5834
|
-
var instructionsLayoutItemSchema = z.object({
|
|
5835
|
-
text: z.string(),
|
|
5836
|
-
context: contextSchema
|
|
5837
|
-
});
|
|
5838
|
-
var modalLayoutTriggerSchema = z.object({
|
|
5839
|
-
title: z.string()
|
|
5840
|
-
});
|
|
5841
|
-
var searchLayoutSchema = z.object({
|
|
5842
|
-
type: z.literal("search"),
|
|
5843
|
-
title: z.string(),
|
|
5844
|
-
method: httpMethodSchema,
|
|
5845
|
-
url: z.string(),
|
|
5846
|
-
param: z.string(),
|
|
5847
|
-
emptyMessage: z.string().optional(),
|
|
5848
|
-
control: z.string().optional(),
|
|
5849
|
-
margin: sizeSchema.optional()
|
|
5850
|
-
});
|
|
5851
|
-
var infoLayoutSchema = z.object({
|
|
5852
|
-
type: z.literal("info"),
|
|
5853
|
-
markdown: z.string(),
|
|
5854
|
-
align: alignSchema.optional(),
|
|
5855
|
-
control: z.string().optional(),
|
|
5856
|
-
margin: sizeSchema.optional()
|
|
5857
|
-
});
|
|
5858
|
-
var formLayoutSchema = z.object({
|
|
5859
|
-
type: z.literal("form"),
|
|
5860
|
-
schema: formLayoutSchemaReferenceSchema.optional(),
|
|
5861
|
-
schemaId: z.string(),
|
|
5862
|
-
control: z.string().optional(),
|
|
5863
|
-
margin: sizeSchema.optional()
|
|
5864
|
-
});
|
|
5865
|
-
var headingLayoutSchema = z.object({
|
|
5866
|
-
type: z.literal("heading"),
|
|
5867
|
-
text: z.string(),
|
|
5868
|
-
size: sizeSchema.optional(),
|
|
5869
|
-
align: alignSchema.optional(),
|
|
5870
|
-
control: z.string().optional(),
|
|
5871
|
-
margin: sizeSchema.optional()
|
|
5872
|
-
});
|
|
5873
|
-
var markdownLayoutSchema = z.object({
|
|
5874
|
-
type: z.literal("markdown"),
|
|
5875
|
-
content: z.string(),
|
|
5876
|
-
align: alignSchema.optional(),
|
|
5877
|
-
control: z.string().optional(),
|
|
5878
|
-
margin: sizeSchema.optional()
|
|
5879
|
-
});
|
|
5880
|
-
var columnsLayoutBiasSchema = z.union([
|
|
5881
|
-
z.literal("none"),
|
|
5882
|
-
z.literal("left"),
|
|
5883
|
-
z.literal("right")
|
|
5884
|
-
]);
|
|
5885
|
-
var helpSchema = z.object({
|
|
5886
|
-
markdown: z.string()
|
|
5887
|
-
});
|
|
5888
|
-
var searchSearchRequestSchema = z.object({
|
|
5889
|
-
url: z.string(),
|
|
5890
|
-
method: httpMethodSchema,
|
|
5891
|
-
param: z.string(),
|
|
5892
|
-
query: z.string()
|
|
5893
|
-
});
|
|
5894
|
-
var jsonElementSchema = z.lazy(
|
|
5895
|
-
() => z.union([
|
|
5896
|
-
z.string(),
|
|
5897
|
-
z.number(),
|
|
5898
|
-
z.boolean(),
|
|
5899
|
-
z.record(jsonElementSchema),
|
|
5900
|
-
z.array(jsonElementSchema)
|
|
5901
|
-
]).nullable()
|
|
5902
|
-
);
|
|
5903
|
-
var externalSchema = z.object({
|
|
5904
|
-
url: z.string()
|
|
5905
|
-
});
|
|
5906
|
-
var stepErrorSchema = z.object({
|
|
5907
|
-
error: z.string().optional(),
|
|
5908
|
-
validation: jsonElementSchema.optional()
|
|
5909
|
-
});
|
|
5910
|
-
var stringSchemaFormatSchema = z.union([
|
|
5911
|
-
z.literal("date"),
|
|
5912
|
-
z.literal("email"),
|
|
5913
|
-
z.literal("numeric"),
|
|
5914
|
-
z.literal("password"),
|
|
5915
|
-
z.literal("phone-number"),
|
|
5916
|
-
z.literal("base64url")
|
|
5917
|
-
]);
|
|
5918
|
-
var summarySummariserSchema = z.object({
|
|
5919
|
-
defaultTitle: z.string().optional(),
|
|
5920
|
-
defaultDescription: z.string().optional(),
|
|
5921
|
-
defaultIcon: iconSchema.optional(),
|
|
5922
|
-
defaultImage: imageLayoutSchema.optional(),
|
|
5923
|
-
providesTitle: z.boolean().optional(),
|
|
5924
|
-
providesDescription: z.boolean().optional(),
|
|
5925
|
-
providesIcon: z.boolean().optional(),
|
|
5926
|
-
providesImage: z.boolean().optional()
|
|
5927
|
-
});
|
|
5928
|
-
var validateAsyncSchema = z.object({
|
|
5929
|
-
param: z.string(),
|
|
5930
|
-
method: httpMethodSchema,
|
|
5931
|
-
url: z.string()
|
|
5932
|
-
});
|
|
5933
|
-
var summaryProviderSchema = z.object({
|
|
5934
|
-
providesTitle: z.boolean().optional(),
|
|
5935
|
-
providesDescription: z.boolean().optional(),
|
|
5936
|
-
providesIcon: z.boolean().optional(),
|
|
5937
|
-
providesImage: z.boolean().optional()
|
|
5938
|
-
});
|
|
5939
|
-
var uploadSourceSchema = z.union([z.literal("camera"), z.literal("file")]);
|
|
5940
|
-
var navigationStackBehaviorSchema = z.union([
|
|
5941
|
-
z.literal("default"),
|
|
5942
|
-
z.literal("remove-previous"),
|
|
5943
|
-
z.literal("remove-all"),
|
|
5944
|
-
z.literal("replace-current")
|
|
5945
|
-
]);
|
|
5946
|
-
var actionTypeSchema = z.union([
|
|
5947
|
-
z.literal("primary"),
|
|
5948
|
-
z.literal("secondary"),
|
|
5949
|
-
z.literal("link"),
|
|
5950
|
-
z.literal("positive"),
|
|
5951
|
-
z.literal("negative")
|
|
5952
|
-
]);
|
|
5953
|
-
var summarySchema = z.union([summaryProviderSchema, summarySummariserSchema]);
|
|
5954
|
-
var actionSchema = z.object({
|
|
5955
|
-
title: z.string().optional(),
|
|
5956
|
-
type: actionTypeSchema.optional(),
|
|
5957
|
-
disabled: z.boolean().optional(),
|
|
5958
|
-
$id: z.string().optional(),
|
|
5959
|
-
$ref: z.string().optional(),
|
|
5960
|
-
id: z.string().optional(),
|
|
5961
|
-
url: z.string().optional(),
|
|
5962
|
-
method: httpMethodSchema.optional(),
|
|
5963
|
-
exit: z.boolean().optional(),
|
|
5964
|
-
result: jsonElementSchema.optional(),
|
|
5965
|
-
data: jsonElementSchema.optional(),
|
|
5966
|
-
timeout: z.number().optional(),
|
|
5967
|
-
skipValidation: z.boolean().optional()
|
|
5968
|
-
});
|
|
5969
|
-
var listLayoutItemSchema = z.object({
|
|
5970
|
-
title: z.string(),
|
|
5971
|
-
description: z.string().optional(),
|
|
5972
|
-
icon: iconSchema,
|
|
5973
|
-
status: listLayoutStatusSchema.optional()
|
|
5974
|
-
});
|
|
5975
|
-
var decisionLayoutOptionSchema = z.object({
|
|
5976
|
-
action: actionSchema,
|
|
5977
|
-
title: z.string(),
|
|
5978
|
-
description: z.string().optional(),
|
|
5979
|
-
disabled: z.boolean().optional(),
|
|
5980
|
-
icon: iconSchema.optional(),
|
|
5981
|
-
image: imageLayoutSchema.optional()
|
|
5982
|
-
});
|
|
5983
|
-
var statusListLayoutItemSchema = z.object({
|
|
5979
|
+
var reviewLayoutCallToActionSchema = z.object({
|
|
5984
5980
|
title: z.string(),
|
|
5985
|
-
|
|
5986
|
-
icon: iconSchema,
|
|
5987
|
-
status: statusListLayoutStatusSchema.optional()
|
|
5981
|
+
action: actionSchema
|
|
5988
5982
|
});
|
|
5989
5983
|
var instructionsLayoutSchema = z.object({
|
|
5990
5984
|
type: z.literal("instructions"),
|
|
@@ -5993,51 +5987,17 @@ var instructionsLayoutSchema = z.object({
|
|
|
5993
5987
|
control: z.string().optional(),
|
|
5994
5988
|
margin: sizeSchema.optional()
|
|
5995
5989
|
});
|
|
5996
|
-
var
|
|
5997
|
-
type: z.literal("button"),
|
|
5998
|
-
size: sizeSchema.optional(),
|
|
5999
|
-
title: z.string().optional(),
|
|
6000
|
-
action: actionSchema,
|
|
6001
|
-
context: contextSchema.optional(),
|
|
6002
|
-
disabled: z.boolean().optional(),
|
|
6003
|
-
pinOrder: z.number().optional(),
|
|
6004
|
-
control: z.string().optional(),
|
|
6005
|
-
margin: sizeSchema.optional()
|
|
6006
|
-
});
|
|
5990
|
+
var iconSchema = z.union([iconNamedSchema, iconTextSchema]);
|
|
6007
5991
|
var reviewLayoutFieldSchema = z.object({
|
|
6008
5992
|
label: z.string(),
|
|
6009
5993
|
value: z.string(),
|
|
6010
5994
|
help: helpSchema.optional()
|
|
6011
5995
|
});
|
|
6012
|
-
var
|
|
6013
|
-
type: z.literal("search"),
|
|
6014
|
-
title: z.string(),
|
|
6015
|
-
description: z.string().optional(),
|
|
6016
|
-
icon: iconSchema.optional(),
|
|
6017
|
-
image: imageLayoutSchema.optional(),
|
|
6018
|
-
value: searchSearchRequestSchema
|
|
6019
|
-
});
|
|
6020
|
-
var searchResultActionSchema = z.object({
|
|
6021
|
-
type: z.literal("action"),
|
|
5996
|
+
var statusListLayoutItemSchema = z.object({
|
|
6022
5997
|
title: z.string(),
|
|
6023
5998
|
description: z.string().optional(),
|
|
6024
|
-
icon: iconSchema
|
|
6025
|
-
|
|
6026
|
-
value: actionSchema
|
|
6027
|
-
});
|
|
6028
|
-
var actionResponseBodySchema = z.object({
|
|
6029
|
-
action: actionSchema
|
|
6030
|
-
});
|
|
6031
|
-
var errorResponseBodySchema = z.object({
|
|
6032
|
-
refreshFormUrl: z.string().optional(),
|
|
6033
|
-
analytics: z.record(z.string()).optional(),
|
|
6034
|
-
error: z.string().optional(),
|
|
6035
|
-
validation: jsonElementSchema.optional(),
|
|
6036
|
-
refreshUrl: z.string().optional()
|
|
6037
|
-
});
|
|
6038
|
-
var linkHandlerSchema = z.object({
|
|
6039
|
-
regexPattern: z.string(),
|
|
6040
|
-
action: actionSchema
|
|
5999
|
+
icon: iconSchema,
|
|
6000
|
+
status: statusListLayoutStatusSchema.optional()
|
|
6041
6001
|
});
|
|
6042
6002
|
var blobSchemaSchema = z.object({
|
|
6043
6003
|
type: z.literal("blob"),
|
|
@@ -6077,37 +6037,66 @@ var constSchemaSchema = z.object({
|
|
|
6077
6037
|
analyticsId: z.string().optional(),
|
|
6078
6038
|
disabled: z.boolean().optional()
|
|
6079
6039
|
});
|
|
6080
|
-
var
|
|
6040
|
+
var summarySummariserSchema = z.object({
|
|
6041
|
+
defaultTitle: z.string().optional(),
|
|
6042
|
+
defaultDescription: z.string().optional(),
|
|
6043
|
+
defaultIcon: iconSchema.optional(),
|
|
6044
|
+
defaultImage: imageLayoutSchema.optional(),
|
|
6045
|
+
providesTitle: z.boolean().optional(),
|
|
6046
|
+
providesDescription: z.boolean().optional(),
|
|
6047
|
+
providesIcon: z.boolean().optional(),
|
|
6048
|
+
providesImage: z.boolean().optional()
|
|
6049
|
+
});
|
|
6050
|
+
var linkHandlerSchema = z.object({
|
|
6051
|
+
regexPattern: z.string(),
|
|
6081
6052
|
action: actionSchema
|
|
6082
6053
|
});
|
|
6083
|
-
var
|
|
6084
|
-
title: z.string().optional(),
|
|
6054
|
+
var actionResponseBodySchema = z.object({
|
|
6085
6055
|
action: actionSchema
|
|
6086
6056
|
});
|
|
6087
|
-
var
|
|
6057
|
+
var searchResultSearchSchema = z.object({
|
|
6058
|
+
type: z.literal("search"),
|
|
6088
6059
|
title: z.string(),
|
|
6060
|
+
description: z.string().optional(),
|
|
6061
|
+
icon: iconSchema.optional(),
|
|
6062
|
+
image: imageLayoutSchema.optional(),
|
|
6063
|
+
value: searchSearchRequestSchema
|
|
6064
|
+
});
|
|
6065
|
+
var searchResultActionSchema = z.object({
|
|
6066
|
+
type: z.literal("action"),
|
|
6067
|
+
title: z.string(),
|
|
6068
|
+
description: z.string().optional(),
|
|
6069
|
+
icon: iconSchema.optional(),
|
|
6070
|
+
image: imageLayoutSchema.optional(),
|
|
6071
|
+
value: actionSchema
|
|
6072
|
+
});
|
|
6073
|
+
var pollingOnErrorSchema = z.object({
|
|
6089
6074
|
action: actionSchema
|
|
6090
6075
|
});
|
|
6091
|
-
var
|
|
6092
|
-
type: z.literal("list"),
|
|
6093
|
-
items: z.array(listLayoutItemSchema),
|
|
6076
|
+
var navigationBackBehaviourSchema = z.object({
|
|
6094
6077
|
title: z.string().optional(),
|
|
6095
|
-
|
|
6096
|
-
margin: sizeSchema.optional()
|
|
6097
|
-
});
|
|
6098
|
-
var decisionLayoutSchema = z.object({
|
|
6099
|
-
type: z.literal("decision"),
|
|
6100
|
-
options: z.array(decisionLayoutOptionSchema),
|
|
6101
|
-
control: z.string().optional(),
|
|
6102
|
-
margin: sizeSchema.optional()
|
|
6078
|
+
action: actionSchema
|
|
6103
6079
|
});
|
|
6104
|
-
var
|
|
6105
|
-
|
|
6106
|
-
|
|
6080
|
+
var summarySchema = z.union([summaryProviderSchema, summarySummariserSchema]);
|
|
6081
|
+
var buttonLayoutSchema = z.object({
|
|
6082
|
+
type: z.literal("button"),
|
|
6083
|
+
size: sizeSchema.optional(),
|
|
6107
6084
|
title: z.string().optional(),
|
|
6085
|
+
action: actionSchema,
|
|
6086
|
+
context: contextSchema.optional(),
|
|
6087
|
+
disabled: z.boolean().optional(),
|
|
6088
|
+
pinOrder: z.number().optional(),
|
|
6108
6089
|
control: z.string().optional(),
|
|
6109
6090
|
margin: sizeSchema.optional()
|
|
6110
6091
|
});
|
|
6092
|
+
var decisionLayoutOptionSchema = z.object({
|
|
6093
|
+
action: actionSchema,
|
|
6094
|
+
title: z.string(),
|
|
6095
|
+
description: z.string().optional(),
|
|
6096
|
+
disabled: z.boolean().optional(),
|
|
6097
|
+
icon: iconSchema.optional(),
|
|
6098
|
+
image: imageLayoutSchema.optional()
|
|
6099
|
+
});
|
|
6111
6100
|
var reviewLayoutSchema = z.object({
|
|
6112
6101
|
type: z.literal("review"),
|
|
6113
6102
|
orientation: z.string().optional(),
|
|
@@ -6118,7 +6107,19 @@ var reviewLayoutSchema = z.object({
|
|
|
6118
6107
|
control: z.string().optional(),
|
|
6119
6108
|
margin: sizeSchema.optional()
|
|
6120
6109
|
});
|
|
6121
|
-
var
|
|
6110
|
+
var statusListLayoutSchema = z.object({
|
|
6111
|
+
type: z.literal("status-list"),
|
|
6112
|
+
items: z.array(statusListLayoutItemSchema),
|
|
6113
|
+
title: z.string().optional(),
|
|
6114
|
+
control: z.string().optional(),
|
|
6115
|
+
margin: sizeSchema.optional()
|
|
6116
|
+
});
|
|
6117
|
+
var listLayoutItemSchema = z.object({
|
|
6118
|
+
title: z.string(),
|
|
6119
|
+
description: z.string().optional(),
|
|
6120
|
+
icon: iconSchema,
|
|
6121
|
+
status: listLayoutStatusSchema.optional()
|
|
6122
|
+
});
|
|
6122
6123
|
var pollingSchema = z.object({
|
|
6123
6124
|
url: z.string(),
|
|
6124
6125
|
interval: z.number(),
|
|
@@ -6130,9 +6131,33 @@ var navigationSchema = z.object({
|
|
|
6130
6131
|
back: navigationBackBehaviourSchema.optional(),
|
|
6131
6132
|
stackBehavior: navigationStackBehaviorSchema.optional()
|
|
6132
6133
|
});
|
|
6134
|
+
var searchResultSchema = z.union([searchResultActionSchema, searchResultSearchSchema]);
|
|
6135
|
+
var decisionLayoutSchema = z.object({
|
|
6136
|
+
type: z.literal("decision"),
|
|
6137
|
+
options: z.array(decisionLayoutOptionSchema),
|
|
6138
|
+
control: z.string().optional(),
|
|
6139
|
+
margin: sizeSchema.optional()
|
|
6140
|
+
});
|
|
6141
|
+
var listLayoutSchema = z.object({
|
|
6142
|
+
type: z.literal("list"),
|
|
6143
|
+
items: z.array(listLayoutItemSchema),
|
|
6144
|
+
title: z.string().optional(),
|
|
6145
|
+
control: z.string().optional(),
|
|
6146
|
+
margin: sizeSchema.optional()
|
|
6147
|
+
});
|
|
6133
6148
|
var searchResponseBodySchema = z.object({
|
|
6134
6149
|
results: z.array(searchResultSchema)
|
|
6135
6150
|
});
|
|
6151
|
+
var columnsLayoutSchema = z.lazy(
|
|
6152
|
+
() => z.object({
|
|
6153
|
+
type: z.literal("columns"),
|
|
6154
|
+
left: z.array(layoutSchema),
|
|
6155
|
+
right: z.array(layoutSchema),
|
|
6156
|
+
bias: columnsLayoutBiasSchema.optional(),
|
|
6157
|
+
control: z.string().optional(),
|
|
6158
|
+
margin: sizeSchema.optional()
|
|
6159
|
+
})
|
|
6160
|
+
);
|
|
6136
6161
|
var layoutSchema = z.lazy(
|
|
6137
6162
|
() => z.union([
|
|
6138
6163
|
alertLayoutSchema,
|
|
@@ -6156,26 +6181,6 @@ var layoutSchema = z.lazy(
|
|
|
6156
6181
|
statusListLayoutSchema
|
|
6157
6182
|
])
|
|
6158
6183
|
);
|
|
6159
|
-
var boxLayoutSchema = z.lazy(
|
|
6160
|
-
() => z.object({
|
|
6161
|
-
type: z.literal("box"),
|
|
6162
|
-
components: z.array(layoutSchema),
|
|
6163
|
-
width: sizeSchema.optional(),
|
|
6164
|
-
border: z.boolean().optional(),
|
|
6165
|
-
control: z.string().optional(),
|
|
6166
|
-
margin: sizeSchema.optional()
|
|
6167
|
-
})
|
|
6168
|
-
);
|
|
6169
|
-
var columnsLayoutSchema = z.lazy(
|
|
6170
|
-
() => z.object({
|
|
6171
|
-
type: z.literal("columns"),
|
|
6172
|
-
left: z.array(layoutSchema),
|
|
6173
|
-
right: z.array(layoutSchema),
|
|
6174
|
-
bias: columnsLayoutBiasSchema.optional(),
|
|
6175
|
-
control: z.string().optional(),
|
|
6176
|
-
margin: sizeSchema.optional()
|
|
6177
|
-
})
|
|
6178
|
-
);
|
|
6179
6184
|
var modalLayoutSchema = z.lazy(
|
|
6180
6185
|
() => z.object({
|
|
6181
6186
|
type: z.literal("modal"),
|
|
@@ -6190,25 +6195,14 @@ var modalLayoutContentSchema = z.lazy(
|
|
|
6190
6195
|
components: z.array(layoutSchema)
|
|
6191
6196
|
})
|
|
6192
6197
|
);
|
|
6193
|
-
var
|
|
6198
|
+
var boxLayoutSchema = z.lazy(
|
|
6194
6199
|
() => z.object({
|
|
6195
|
-
|
|
6196
|
-
|
|
6197
|
-
|
|
6198
|
-
|
|
6199
|
-
|
|
6200
|
-
|
|
6201
|
-
description: z.string().optional(),
|
|
6202
|
-
schemas: z.array(schemaSchema),
|
|
6203
|
-
layout: z.array(layoutSchema),
|
|
6204
|
-
model: jsonElementSchema.optional(),
|
|
6205
|
-
external: externalSchema.optional(),
|
|
6206
|
-
polling: pollingSchema.optional(),
|
|
6207
|
-
linkHandlers: z.array(linkHandlerSchema).optional(),
|
|
6208
|
-
analytics: z.record(z.string()).optional(),
|
|
6209
|
-
errors: stepErrorSchema.optional(),
|
|
6210
|
-
navigation: navigationSchema.optional(),
|
|
6211
|
-
refreshUrl: z.string().optional()
|
|
6200
|
+
type: z.literal("box"),
|
|
6201
|
+
components: z.array(layoutSchema),
|
|
6202
|
+
width: sizeSchema.optional(),
|
|
6203
|
+
border: z.boolean().optional(),
|
|
6204
|
+
control: z.string().optional(),
|
|
6205
|
+
margin: sizeSchema.optional()
|
|
6212
6206
|
})
|
|
6213
6207
|
);
|
|
6214
6208
|
var schemaSchema = z.lazy(
|
|
@@ -6434,17 +6428,21 @@ var stringSchemaSchema = z.lazy(
|
|
|
6434
6428
|
help: helpSchema.optional()
|
|
6435
6429
|
})
|
|
6436
6430
|
);
|
|
6437
|
-
var
|
|
6431
|
+
var persistAsyncSchema = z.lazy(
|
|
6432
|
+
() => z.object({
|
|
6433
|
+
param: z.string(),
|
|
6434
|
+
idProperty: z.string(),
|
|
6435
|
+
schema: schemaSchema,
|
|
6436
|
+
url: z.string(),
|
|
6437
|
+
method: httpMethodSchema
|
|
6438
|
+
})
|
|
6439
|
+
);
|
|
6440
|
+
var arraySchemaTupleSchema = z.lazy(
|
|
6438
6441
|
() => z.object({
|
|
6439
6442
|
type: z.literal("array"),
|
|
6440
6443
|
promoted: z.boolean().optional(),
|
|
6441
6444
|
$id: z.string().optional(),
|
|
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(),
|
|
6445
|
+
items: z.array(schemaSchema),
|
|
6448
6446
|
title: z.string().optional(),
|
|
6449
6447
|
description: z.string().optional(),
|
|
6450
6448
|
control: z.string().optional(),
|
|
@@ -6452,30 +6450,24 @@ var arraySchemaListSchema = z.lazy(
|
|
|
6452
6450
|
icon: iconSchema.optional(),
|
|
6453
6451
|
image: imageSchema.optional(),
|
|
6454
6452
|
keywords: z.array(z.string()).optional(),
|
|
6455
|
-
summary:
|
|
6453
|
+
summary: summaryProviderSchema.optional(),
|
|
6456
6454
|
analyticsId: z.string().optional(),
|
|
6457
6455
|
persistAsync: persistAsyncSchema.optional(),
|
|
6458
6456
|
validationAsync: validateAsyncSchema.optional(),
|
|
6459
|
-
alert: alertLayoutSchema.optional()
|
|
6460
|
-
validationMessages: z.record(z.string()).optional(),
|
|
6461
|
-
disabled: z.boolean().optional()
|
|
6462
|
-
})
|
|
6463
|
-
);
|
|
6464
|
-
var persistAsyncSchema = z.lazy(
|
|
6465
|
-
() => z.object({
|
|
6466
|
-
param: z.string(),
|
|
6467
|
-
idProperty: z.string(),
|
|
6468
|
-
schema: schemaSchema,
|
|
6469
|
-
url: z.string(),
|
|
6470
|
-
method: httpMethodSchema
|
|
6457
|
+
alert: alertLayoutSchema.optional()
|
|
6471
6458
|
})
|
|
6472
6459
|
);
|
|
6473
|
-
var
|
|
6460
|
+
var arraySchemaListSchema = z.lazy(
|
|
6474
6461
|
() => z.object({
|
|
6475
6462
|
type: z.literal("array"),
|
|
6476
6463
|
promoted: z.boolean().optional(),
|
|
6477
6464
|
$id: z.string().optional(),
|
|
6478
|
-
items:
|
|
6465
|
+
items: schemaSchema,
|
|
6466
|
+
addItemTitle: z.string(),
|
|
6467
|
+
editItemTitle: z.string(),
|
|
6468
|
+
minItems: z.number().optional(),
|
|
6469
|
+
maxItems: z.number().optional(),
|
|
6470
|
+
placeholder: z.string().optional(),
|
|
6479
6471
|
title: z.string().optional(),
|
|
6480
6472
|
description: z.string().optional(),
|
|
6481
6473
|
control: z.string().optional(),
|
|
@@ -6483,11 +6475,34 @@ var arraySchemaTupleSchema = z.lazy(
|
|
|
6483
6475
|
icon: iconSchema.optional(),
|
|
6484
6476
|
image: imageSchema.optional(),
|
|
6485
6477
|
keywords: z.array(z.string()).optional(),
|
|
6486
|
-
summary:
|
|
6478
|
+
summary: summarySummariserSchema.optional(),
|
|
6487
6479
|
analyticsId: z.string().optional(),
|
|
6488
6480
|
persistAsync: persistAsyncSchema.optional(),
|
|
6489
6481
|
validationAsync: validateAsyncSchema.optional(),
|
|
6490
|
-
alert: alertLayoutSchema.optional()
|
|
6482
|
+
alert: alertLayoutSchema.optional(),
|
|
6483
|
+
validationMessages: z.record(z.string()).optional(),
|
|
6484
|
+
disabled: z.boolean().optional()
|
|
6485
|
+
})
|
|
6486
|
+
);
|
|
6487
|
+
var stepSchema = z.lazy(
|
|
6488
|
+
() => z.object({
|
|
6489
|
+
key: z.string().optional(),
|
|
6490
|
+
type: z.string().optional(),
|
|
6491
|
+
actions: z.array(actionSchema).optional(),
|
|
6492
|
+
refreshFormUrl: z.string().optional(),
|
|
6493
|
+
id: z.string(),
|
|
6494
|
+
title: z.string(),
|
|
6495
|
+
description: z.string().optional(),
|
|
6496
|
+
schemas: z.array(schemaSchema),
|
|
6497
|
+
layout: z.array(layoutSchema),
|
|
6498
|
+
model: jsonElementSchema.optional(),
|
|
6499
|
+
external: externalSchema.optional(),
|
|
6500
|
+
polling: pollingSchema.optional(),
|
|
6501
|
+
linkHandlers: z.array(linkHandlerSchema).optional(),
|
|
6502
|
+
analytics: z.record(z.string()).optional(),
|
|
6503
|
+
errors: stepErrorSchema.optional(),
|
|
6504
|
+
navigation: navigationSchema.optional(),
|
|
6505
|
+
refreshUrl: z.string().optional()
|
|
6491
6506
|
})
|
|
6492
6507
|
);
|
|
6493
6508
|
var validateStep = (step) => validate(step, stepSchema);
|
|
@@ -6630,6 +6645,90 @@ var createStepComponent = (stepProps) => {
|
|
|
6630
6645
|
});
|
|
6631
6646
|
};
|
|
6632
6647
|
|
|
6648
|
+
// src/revamp/flow/response-utils.ts
|
|
6649
|
+
var assertResponseIsValid = (response) => {
|
|
6650
|
+
if (!isResponse(response)) {
|
|
6651
|
+
throw new Error("Incorrect type of response from fetch. Expected object of type Response.");
|
|
6652
|
+
}
|
|
6653
|
+
if (response.bodyUsed) {
|
|
6654
|
+
throw new Error(
|
|
6655
|
+
"The body of the provided Response object has already been used. Every request must respond with a new Response object."
|
|
6656
|
+
);
|
|
6657
|
+
}
|
|
6658
|
+
};
|
|
6659
|
+
var isResponse = (response) => typeof response === "object" && response !== null && "clone" in response && "bodyUsed" in response;
|
|
6660
|
+
var parseResponseBodyAsJsonElement = async (response) => {
|
|
6661
|
+
try {
|
|
6662
|
+
return await response.json();
|
|
6663
|
+
} catch (e) {
|
|
6664
|
+
return null;
|
|
6665
|
+
}
|
|
6666
|
+
};
|
|
6667
|
+
function isActionResponseBody(body) {
|
|
6668
|
+
return validateActionResponse(body).valid;
|
|
6669
|
+
}
|
|
6670
|
+
function assertActionResponseBody(body) {
|
|
6671
|
+
if (!isObject(body) || !isObject(body.action)) {
|
|
6672
|
+
throw new Error(
|
|
6673
|
+
"Incorrect response body in action response. Expected an object satisfying the type { action: Action }."
|
|
6674
|
+
);
|
|
6675
|
+
}
|
|
6676
|
+
}
|
|
6677
|
+
function isErrorResponseBody(body) {
|
|
6678
|
+
return Boolean(
|
|
6679
|
+
isObject(body) && (body.refreshFormUrl || body.refreshUrl || body.validation || body.error || body.analytics)
|
|
6680
|
+
);
|
|
6681
|
+
}
|
|
6682
|
+
function assertStepResponseBody(body) {
|
|
6683
|
+
if (!isObject(body)) {
|
|
6684
|
+
throw new Error("Incorrect response body in step response. Expected an object.");
|
|
6685
|
+
}
|
|
6686
|
+
}
|
|
6687
|
+
|
|
6688
|
+
// src/revamp/domain/features/polling/getStepPolling.ts
|
|
6689
|
+
var getStepPolling = ({
|
|
6690
|
+
httpClient,
|
|
6691
|
+
pollingConfig,
|
|
6692
|
+
onAction
|
|
6693
|
+
}) => {
|
|
6694
|
+
const { interval, maxAttempts, url, onError } = pollingConfig;
|
|
6695
|
+
let abortController = new AbortController();
|
|
6696
|
+
const onFailure = () => {
|
|
6697
|
+
stop();
|
|
6698
|
+
void onAction(onError.action);
|
|
6699
|
+
};
|
|
6700
|
+
let attempts = 0;
|
|
6701
|
+
const poll = () => {
|
|
6702
|
+
attempts += 1;
|
|
6703
|
+
abortController.abort();
|
|
6704
|
+
abortController = new AbortController();
|
|
6705
|
+
const { signal } = abortController;
|
|
6706
|
+
httpClient(url, { signal }).then(async (response) => {
|
|
6707
|
+
if (!response.ok) {
|
|
6708
|
+
onFailure();
|
|
6709
|
+
return;
|
|
6710
|
+
}
|
|
6711
|
+
response.json().then((body) => {
|
|
6712
|
+
if (isActionResponseBody(body)) {
|
|
6713
|
+
void onAction(body.action);
|
|
6714
|
+
stop();
|
|
6715
|
+
}
|
|
6716
|
+
}).catch(() => {
|
|
6717
|
+
});
|
|
6718
|
+
}).catch(() => {
|
|
6719
|
+
});
|
|
6720
|
+
if (attempts >= maxAttempts && !signal.aborted) {
|
|
6721
|
+
onFailure();
|
|
6722
|
+
}
|
|
6723
|
+
};
|
|
6724
|
+
const intervalRef = setInterval(poll, interval * 1e3);
|
|
6725
|
+
const stop = () => {
|
|
6726
|
+
abortController.abort();
|
|
6727
|
+
clearTimeout(intervalRef);
|
|
6728
|
+
};
|
|
6729
|
+
return { stop };
|
|
6730
|
+
};
|
|
6731
|
+
|
|
6633
6732
|
// src/revamp/domain/components/AlertComponent.ts
|
|
6634
6733
|
var createAlertComponent = (alertProps) => __spreadProps(__spreadValues({
|
|
6635
6734
|
type: "alert"
|
|
@@ -7325,59 +7424,19 @@ var autocompleteTokenMap = {
|
|
|
7325
7424
|
"phone-area-code": "tel-area-code",
|
|
7326
7425
|
"phone-local": "tel-local",
|
|
7327
7426
|
"phone-local-prefix": "tel-local-prefix",
|
|
7328
|
-
"phone-local-suffix": "tel-local-suffix",
|
|
7329
|
-
"phone-extension": "tel-extension",
|
|
7330
|
-
url: "url",
|
|
7331
|
-
photo: "photo",
|
|
7332
|
-
impp: "impp",
|
|
7333
|
-
shipping: "shipping",
|
|
7334
|
-
billing: "billing",
|
|
7335
|
-
home: "home",
|
|
7336
|
-
work: "work",
|
|
7337
|
-
mobile: "mobile",
|
|
7338
|
-
fax: "fax",
|
|
7339
|
-
pager: "pager"
|
|
7340
|
-
};
|
|
7341
|
-
|
|
7342
|
-
// src/revamp/flow/response-utils.ts
|
|
7343
|
-
var assertResponseIsValid = (response) => {
|
|
7344
|
-
if (!isResponse(response)) {
|
|
7345
|
-
throw new Error("Incorrect type of response from fetch. Expected object of type Response.");
|
|
7346
|
-
}
|
|
7347
|
-
if (response.bodyUsed) {
|
|
7348
|
-
throw new Error(
|
|
7349
|
-
"The body of the provided Response object has already been used. Every request must respond with a new Response object."
|
|
7350
|
-
);
|
|
7351
|
-
}
|
|
7352
|
-
};
|
|
7353
|
-
var isResponse = (response) => typeof response === "object" && response !== null && "clone" in response && "bodyUsed" in response;
|
|
7354
|
-
var parseResponseBodyAsJsonElement = async (response) => {
|
|
7355
|
-
try {
|
|
7356
|
-
return await response.json();
|
|
7357
|
-
} catch (e) {
|
|
7358
|
-
return null;
|
|
7359
|
-
}
|
|
7360
|
-
};
|
|
7361
|
-
function isActionResponseBody(body) {
|
|
7362
|
-
return validateActionResponse(body).valid;
|
|
7363
|
-
}
|
|
7364
|
-
function assertActionResponseBody(body) {
|
|
7365
|
-
if (!isObject(body) || !isObject(body.action)) {
|
|
7366
|
-
throw new Error(
|
|
7367
|
-
"Incorrect response body in action response. Expected an object satisfying the type { action: Action }."
|
|
7368
|
-
);
|
|
7369
|
-
}
|
|
7370
|
-
}
|
|
7371
|
-
function isErrorResponseBody(body) {
|
|
7372
|
-
return Boolean(
|
|
7373
|
-
isObject(body) && (body.refreshFormUrl || body.refreshUrl || body.validation || body.error || body.analytics)
|
|
7374
|
-
);
|
|
7375
|
-
}
|
|
7376
|
-
function assertStepResponseBody(body) {
|
|
7377
|
-
if (!isObject(body)) {
|
|
7378
|
-
throw new Error("Incorrect response body in step response. Expected an object.");
|
|
7379
|
-
}
|
|
7380
|
-
}
|
|
7427
|
+
"phone-local-suffix": "tel-local-suffix",
|
|
7428
|
+
"phone-extension": "tel-extension",
|
|
7429
|
+
url: "url",
|
|
7430
|
+
photo: "photo",
|
|
7431
|
+
impp: "impp",
|
|
7432
|
+
shipping: "shipping",
|
|
7433
|
+
billing: "billing",
|
|
7434
|
+
home: "home",
|
|
7435
|
+
work: "work",
|
|
7436
|
+
mobile: "mobile",
|
|
7437
|
+
fax: "fax",
|
|
7438
|
+
pager: "pager"
|
|
7439
|
+
};
|
|
7381
7440
|
|
|
7382
7441
|
// src/revamp/domain/features/utils/response-utils.ts
|
|
7383
7442
|
var getAnalyticsFromErrorResponse = (json) => {
|
|
@@ -9416,7 +9475,7 @@ var createFormComponent = (formProps) => __spreadProps(__spreadValues({}, formPr
|
|
|
9416
9475
|
// src/revamp/domain/mappers/layout/formLayoutToComponent.ts
|
|
9417
9476
|
var formLayoutToComponent = (uid, { schemaId, schema: schemaRef, control, margin = "md" }, mapperProps) => {
|
|
9418
9477
|
const { step, stepLocalValue } = mapperProps;
|
|
9419
|
-
const { model, errors
|
|
9478
|
+
const { schemas, model, errors } = step;
|
|
9420
9479
|
const id = schemaId != null ? schemaId : schemaRef == null ? void 0 : schemaRef.$ref;
|
|
9421
9480
|
const schema = schemas.find((s) => s.$id === id);
|
|
9422
9481
|
if (!schema) {
|
|
@@ -9878,48 +9937,37 @@ var mapLayoutToComponent = (uid, layout, mapperProps) => {
|
|
|
9878
9937
|
}
|
|
9879
9938
|
};
|
|
9880
9939
|
|
|
9881
|
-
// src/revamp/domain/
|
|
9882
|
-
var
|
|
9883
|
-
|
|
9884
|
-
|
|
9885
|
-
|
|
9886
|
-
|
|
9887
|
-
|
|
9888
|
-
|
|
9889
|
-
|
|
9890
|
-
|
|
9891
|
-
|
|
9892
|
-
|
|
9893
|
-
|
|
9894
|
-
|
|
9895
|
-
|
|
9896
|
-
|
|
9897
|
-
|
|
9898
|
-
|
|
9899
|
-
|
|
9900
|
-
|
|
9901
|
-
|
|
9902
|
-
|
|
9903
|
-
}
|
|
9904
|
-
response.json().then((body) => {
|
|
9905
|
-
if (isActionResponseBody(body)) {
|
|
9906
|
-
void onAction(body.action);
|
|
9907
|
-
stop();
|
|
9908
|
-
}
|
|
9909
|
-
}).catch(() => {
|
|
9910
|
-
});
|
|
9911
|
-
}).catch(() => {
|
|
9940
|
+
// src/revamp/domain/mappers/mapUnreferencedSchemas.ts
|
|
9941
|
+
var mapUnreferencedSchemas = (mapperProps) => {
|
|
9942
|
+
const { step } = mapperProps;
|
|
9943
|
+
const { model } = step;
|
|
9944
|
+
return getUnreferencedSchemas(step).map((schema) => __spreadProps(__spreadValues({}, schema), { hidden: true })).map((schema, index) => {
|
|
9945
|
+
const uid = `unreferenced-schema-${index}`;
|
|
9946
|
+
return createFormComponent({
|
|
9947
|
+
uid,
|
|
9948
|
+
components: [
|
|
9949
|
+
mapSchemaToComponent(
|
|
9950
|
+
{
|
|
9951
|
+
uid: `${uid}.form`,
|
|
9952
|
+
schema,
|
|
9953
|
+
model: model != null ? model : null,
|
|
9954
|
+
localValue: null,
|
|
9955
|
+
required: false
|
|
9956
|
+
},
|
|
9957
|
+
mapperProps
|
|
9958
|
+
)
|
|
9959
|
+
],
|
|
9960
|
+
control: void 0,
|
|
9961
|
+
margin: "xs"
|
|
9912
9962
|
});
|
|
9913
|
-
|
|
9914
|
-
|
|
9915
|
-
|
|
9916
|
-
};
|
|
9917
|
-
const
|
|
9918
|
-
|
|
9919
|
-
|
|
9920
|
-
|
|
9921
|
-
};
|
|
9922
|
-
return { stop };
|
|
9963
|
+
});
|
|
9964
|
+
};
|
|
9965
|
+
var getUnreferencedSchemas = (step) => {
|
|
9966
|
+
const { schemas, layout } = step;
|
|
9967
|
+
const stringifiedLayout = JSON.stringify(layout);
|
|
9968
|
+
return schemas.filter(
|
|
9969
|
+
(schema) => !stringifiedLayout.includes(`"schemaId":"${schema.$id}"`) && !stringifiedLayout.includes(`"schema":{"$ref":"${schema.$id}"`)
|
|
9970
|
+
);
|
|
9923
9971
|
};
|
|
9924
9972
|
|
|
9925
9973
|
// src/revamp/domain/mappers/mapStepToComponent.ts
|
|
@@ -9965,17 +10013,16 @@ var mapStepToComponent = (_a) => {
|
|
|
9965
10013
|
};
|
|
9966
10014
|
const onRefresh = async (schemaId, url) => restProps.onRefresh(schemaId, url != null ? url : refreshUrl);
|
|
9967
10015
|
const stepPolling = polling ? getStepPolling({ httpClient, pollingConfig: polling, onAction: restProps.onAction }) : void 0;
|
|
10016
|
+
const mapperProps = __spreadProps(__spreadValues({}, restProps), { trackEvent, onAction, onRefresh });
|
|
10017
|
+
const unreferencedSchemaFormComponents = mapUnreferencedSchemas(mapperProps);
|
|
9968
10018
|
const layoutComponents = layout.map(
|
|
9969
|
-
(layoutComponent, index) => mapLayoutToComponent(`${uid}.layout-${index}`, layoutComponent,
|
|
9970
|
-
trackEvent,
|
|
9971
|
-
onAction,
|
|
9972
|
-
onRefresh
|
|
9973
|
-
}))
|
|
10019
|
+
(layoutComponent, index) => mapLayoutToComponent(`${uid}.layout-${index}`, layoutComponent, mapperProps)
|
|
9974
10020
|
);
|
|
10021
|
+
const components = [...unreferencedSchemaFormComponents, ...layoutComponents];
|
|
9975
10022
|
const stepComponent = createStepComponent({
|
|
9976
10023
|
uid,
|
|
9977
10024
|
back,
|
|
9978
|
-
components
|
|
10025
|
+
components,
|
|
9979
10026
|
description,
|
|
9980
10027
|
error: errors == null ? void 0 : errors.error,
|
|
9981
10028
|
external,
|
|
@@ -9983,7 +10030,9 @@ var mapStepToComponent = (_a) => {
|
|
|
9983
10030
|
stepPolling,
|
|
9984
10031
|
updateComponent,
|
|
9985
10032
|
title: displayStepTitle ? title : void 0,
|
|
9986
|
-
trackEvent
|
|
10033
|
+
trackEvent,
|
|
10034
|
+
step,
|
|
10035
|
+
onAction
|
|
9987
10036
|
});
|
|
9988
10037
|
return stepComponent;
|
|
9989
10038
|
};
|
|
@@ -11897,18 +11946,79 @@ function ItemSummaryOption({
|
|
|
11897
11946
|
}
|
|
11898
11947
|
var RepeatableRenderer_default = RepeatableRenderer;
|
|
11899
11948
|
|
|
11900
|
-
// src/revamp/wise/renderers/
|
|
11949
|
+
// src/revamp/wise/renderers/ReviewRenderer.tsx
|
|
11901
11950
|
var import_components26 = require("@transferwise/components");
|
|
11951
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
11952
|
+
var ReviewRenderer = {
|
|
11953
|
+
canRenderType: "review",
|
|
11954
|
+
render: ({ callToAction, control, fields, margin, title }) => {
|
|
11955
|
+
const orientation = mapControlToDefinitionListLayout(control);
|
|
11956
|
+
const action = callToAction ? {
|
|
11957
|
+
text: callToAction.title,
|
|
11958
|
+
onClick: (event) => {
|
|
11959
|
+
event.preventDefault();
|
|
11960
|
+
callToAction.onClick();
|
|
11961
|
+
}
|
|
11962
|
+
} : void 0;
|
|
11963
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: getMargin(margin), children: [
|
|
11964
|
+
(title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_components26.Header, { title: title != null ? title : "", action }),
|
|
11965
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
11966
|
+
import_components26.DefinitionList,
|
|
11967
|
+
{
|
|
11968
|
+
layout: orientation,
|
|
11969
|
+
definitions: fields.map(({ label, value, help }, index) => ({
|
|
11970
|
+
key: String(index),
|
|
11971
|
+
title: label,
|
|
11972
|
+
value: getFieldValue(value, help, orientation)
|
|
11973
|
+
}))
|
|
11974
|
+
}
|
|
11975
|
+
) })
|
|
11976
|
+
] });
|
|
11977
|
+
}
|
|
11978
|
+
};
|
|
11979
|
+
var ReviewRenderer_default = ReviewRenderer;
|
|
11980
|
+
var mapControlToDefinitionListLayout = (control) => {
|
|
11981
|
+
switch (control) {
|
|
11982
|
+
case "horizontal":
|
|
11983
|
+
case "horizontal-end-aligned":
|
|
11984
|
+
return "HORIZONTAL_RIGHT_ALIGNED";
|
|
11985
|
+
case "horizontal-start-aligned":
|
|
11986
|
+
return "HORIZONTAL_LEFT_ALIGNED";
|
|
11987
|
+
case "vertical-two-column":
|
|
11988
|
+
return "VERTICAL_TWO_COLUMN";
|
|
11989
|
+
case "vertical":
|
|
11990
|
+
case "vertical-one-column":
|
|
11991
|
+
default:
|
|
11992
|
+
return "VERTICAL_ONE_COLUMN";
|
|
11993
|
+
}
|
|
11994
|
+
};
|
|
11995
|
+
var getFieldValue = (value, help, orientation) => {
|
|
11996
|
+
if (help) {
|
|
11997
|
+
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
|
|
11998
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Help_default, { help }),
|
|
11999
|
+
" ",
|
|
12000
|
+
value
|
|
12001
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
|
|
12002
|
+
value,
|
|
12003
|
+
" ",
|
|
12004
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Help_default, { help })
|
|
12005
|
+
] });
|
|
12006
|
+
}
|
|
12007
|
+
return value;
|
|
12008
|
+
};
|
|
12009
|
+
|
|
12010
|
+
// src/revamp/wise/renderers/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
12011
|
+
var import_components27 = require("@transferwise/components");
|
|
11902
12012
|
|
|
11903
12013
|
// src/revamp/wise/renderers/SearchRenderer/ErrorResult.tsx
|
|
11904
12014
|
var import_react_intl15 = require("react-intl");
|
|
11905
|
-
var
|
|
12015
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
11906
12016
|
function ErrorResult({ state }) {
|
|
11907
12017
|
const intl = (0, import_react_intl15.useIntl)();
|
|
11908
|
-
return /* @__PURE__ */ (0,
|
|
12018
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("p", { className: "m-t-2", children: [
|
|
11909
12019
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
11910
12020
|
"\xA0",
|
|
11911
|
-
/* @__PURE__ */ (0,
|
|
12021
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
11912
12022
|
"a",
|
|
11913
12023
|
{
|
|
11914
12024
|
href: "/",
|
|
@@ -11924,7 +12034,7 @@ function ErrorResult({ state }) {
|
|
|
11924
12034
|
|
|
11925
12035
|
// src/revamp/wise/renderers/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
11926
12036
|
var import_react15 = require("react");
|
|
11927
|
-
var
|
|
12037
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
11928
12038
|
function BlockSearchRendererComponent({
|
|
11929
12039
|
id,
|
|
11930
12040
|
isLoading,
|
|
@@ -11936,9 +12046,9 @@ function BlockSearchRendererComponent({
|
|
|
11936
12046
|
}) {
|
|
11937
12047
|
const [hasSearched, setHasSearched] = (0, import_react15.useState)(false);
|
|
11938
12048
|
const trackEvent = useTrackEvent();
|
|
11939
|
-
return /* @__PURE__ */ (0,
|
|
11940
|
-
/* @__PURE__ */ (0,
|
|
11941
|
-
|
|
12049
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: getMargin(margin), children: [
|
|
12050
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(FieldInput_default, { id, description: "", error: "", help: "", label: title, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
12051
|
+
import_components27.Input,
|
|
11942
12052
|
{
|
|
11943
12053
|
id,
|
|
11944
12054
|
name: id,
|
|
@@ -11954,7 +12064,7 @@ function BlockSearchRendererComponent({
|
|
|
11954
12064
|
}
|
|
11955
12065
|
}
|
|
11956
12066
|
) }),
|
|
11957
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
12067
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_jsx_runtime43.Fragment, { children: "Loading..." }) : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(SearchResultContent, { state, onChange })
|
|
11958
12068
|
] });
|
|
11959
12069
|
}
|
|
11960
12070
|
function SearchResultContent({
|
|
@@ -11963,29 +12073,29 @@ function SearchResultContent({
|
|
|
11963
12073
|
}) {
|
|
11964
12074
|
switch (state.type) {
|
|
11965
12075
|
case "error":
|
|
11966
|
-
return /* @__PURE__ */ (0,
|
|
12076
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ErrorResult, { state });
|
|
11967
12077
|
case "results":
|
|
11968
|
-
return /* @__PURE__ */ (0,
|
|
12078
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(SearchResults, { state, onChange });
|
|
11969
12079
|
case "noResults":
|
|
11970
|
-
return /* @__PURE__ */ (0,
|
|
12080
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(EmptySearchResult, { state });
|
|
11971
12081
|
case "pending":
|
|
11972
12082
|
default:
|
|
11973
12083
|
return null;
|
|
11974
12084
|
}
|
|
11975
12085
|
}
|
|
11976
12086
|
function EmptySearchResult({ state }) {
|
|
11977
|
-
return /* @__PURE__ */ (0,
|
|
12087
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_components27.Markdown, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
11978
12088
|
}
|
|
11979
12089
|
function SearchResults({
|
|
11980
12090
|
state
|
|
11981
12091
|
}) {
|
|
11982
12092
|
const trackEvent = useTrackEvent();
|
|
11983
|
-
return /* @__PURE__ */ (0,
|
|
11984
|
-
|
|
12093
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_components27.NavigationOptionsList, { children: state.results.map((result) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
12094
|
+
import_components27.NavigationOption,
|
|
11985
12095
|
{
|
|
11986
12096
|
title: result.title,
|
|
11987
12097
|
content: result.description,
|
|
11988
|
-
media: /* @__PURE__ */ (0,
|
|
12098
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(NavigationOptionMedia, __spreadValues({}, result)),
|
|
11989
12099
|
showMediaCircle: false,
|
|
11990
12100
|
showMediaAtAllSizes: true,
|
|
11991
12101
|
onClick: () => {
|
|
@@ -12001,10 +12111,10 @@ function SearchResults({
|
|
|
12001
12111
|
var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
|
|
12002
12112
|
|
|
12003
12113
|
// src/revamp/wise/renderers/SearchRenderer/InlineSearchRendererComponent.tsx
|
|
12004
|
-
var
|
|
12114
|
+
var import_components28 = require("@transferwise/components");
|
|
12005
12115
|
var import_icons2 = require("@transferwise/icons");
|
|
12006
12116
|
var import_react16 = require("react");
|
|
12007
|
-
var
|
|
12117
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
12008
12118
|
function InlineSearchRenderer({
|
|
12009
12119
|
id,
|
|
12010
12120
|
isLoading,
|
|
@@ -12015,19 +12125,19 @@ function InlineSearchRenderer({
|
|
|
12015
12125
|
}) {
|
|
12016
12126
|
const [hasSearched, setHasSearched] = (0, import_react16.useState)(false);
|
|
12017
12127
|
const trackEvent = useTrackEvent();
|
|
12018
|
-
return /* @__PURE__ */ (0,
|
|
12128
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: getMargin(margin), children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(FieldInput_default, { id, description: "", error: "", help: "", label: title, children: [
|
|
12019
12129
|
id,
|
|
12020
|
-
/* @__PURE__ */ (0,
|
|
12021
|
-
|
|
12130
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
12131
|
+
import_components28.Typeahead,
|
|
12022
12132
|
{
|
|
12023
12133
|
id: "typeahead-input-id",
|
|
12024
12134
|
name: "typeahead-input-name",
|
|
12025
12135
|
size: "md",
|
|
12026
12136
|
maxHeight: 100,
|
|
12027
|
-
footer: /* @__PURE__ */ (0,
|
|
12137
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(TypeaheadFooter, { state, isLoading }),
|
|
12028
12138
|
multiple: false,
|
|
12029
12139
|
clearable: false,
|
|
12030
|
-
addon: /* @__PURE__ */ (0,
|
|
12140
|
+
addon: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_icons2.Search, { size: 24 }),
|
|
12031
12141
|
options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
|
|
12032
12142
|
minQueryLength: 1,
|
|
12033
12143
|
onChange: (values) => {
|
|
@@ -12064,29 +12174,29 @@ function mapResultToTypeaheadOption(result) {
|
|
|
12064
12174
|
}
|
|
12065
12175
|
function TypeaheadFooter({ state, isLoading }) {
|
|
12066
12176
|
if (state.type === "noResults") {
|
|
12067
|
-
return /* @__PURE__ */ (0,
|
|
12177
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_components28.Markdown, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
12068
12178
|
}
|
|
12069
12179
|
if (state.type === "error") {
|
|
12070
|
-
return /* @__PURE__ */ (0,
|
|
12180
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ErrorResult, { state }) });
|
|
12071
12181
|
}
|
|
12072
12182
|
if (state.type === "pending" || isLoading) {
|
|
12073
|
-
return /* @__PURE__ */ (0,
|
|
12183
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "m-t-2 m-x-2", children: "Loading..." });
|
|
12074
12184
|
}
|
|
12075
12185
|
return null;
|
|
12076
12186
|
}
|
|
12077
12187
|
var InlineSearchRendererComponent_default = InlineSearchRenderer;
|
|
12078
12188
|
|
|
12079
12189
|
// src/revamp/wise/renderers/SearchRenderer/SearchRenderer.tsx
|
|
12080
|
-
var
|
|
12190
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
12081
12191
|
var SearchRenderer = {
|
|
12082
12192
|
canRenderType: "search",
|
|
12083
|
-
render: (props) => props.control === "inline" ? /* @__PURE__ */ (0,
|
|
12193
|
+
render: (props) => props.control === "inline" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(BlockSearchRendererComponent_default, __spreadValues({}, props))
|
|
12084
12194
|
};
|
|
12085
12195
|
var SearchRenderer_default = SearchRenderer;
|
|
12086
12196
|
|
|
12087
12197
|
// src/revamp/wise/renderers/SelectInputRenderer/RadioInputRendererComponent.tsx
|
|
12088
|
-
var
|
|
12089
|
-
var
|
|
12198
|
+
var import_components29 = require("@transferwise/components");
|
|
12199
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
12090
12200
|
function RadioInputRendererComponent(props) {
|
|
12091
12201
|
const {
|
|
12092
12202
|
id,
|
|
@@ -12100,9 +12210,9 @@ function RadioInputRendererComponent(props) {
|
|
|
12100
12210
|
selectedIndex,
|
|
12101
12211
|
onSelect
|
|
12102
12212
|
} = props;
|
|
12103
|
-
return /* @__PURE__ */ (0,
|
|
12104
|
-
/* @__PURE__ */ (0,
|
|
12105
|
-
|
|
12213
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
|
|
12214
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
12215
|
+
import_components29.RadioGroup,
|
|
12106
12216
|
{
|
|
12107
12217
|
name: id,
|
|
12108
12218
|
radios: options.map((option, index) => ({
|
|
@@ -12110,7 +12220,7 @@ function RadioInputRendererComponent(props) {
|
|
|
12110
12220
|
value: index,
|
|
12111
12221
|
secondary: option.description,
|
|
12112
12222
|
disabled: option.disabled || disabled,
|
|
12113
|
-
avatar: /* @__PURE__ */ (0,
|
|
12223
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(OptionMedia, { icon: option.icon, image: option.image })
|
|
12114
12224
|
})),
|
|
12115
12225
|
selectedValue: selectedIndex != null ? selectedIndex : void 0,
|
|
12116
12226
|
onChange: onSelect
|
|
@@ -12122,9 +12232,9 @@ function RadioInputRendererComponent(props) {
|
|
|
12122
12232
|
}
|
|
12123
12233
|
|
|
12124
12234
|
// src/revamp/wise/renderers/SelectInputRenderer/TabInputRendererComponent.tsx
|
|
12125
|
-
var
|
|
12235
|
+
var import_components30 = require("@transferwise/components");
|
|
12126
12236
|
var import_react17 = require("react");
|
|
12127
|
-
var
|
|
12237
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
12128
12238
|
function TabInputRendererComponent(props) {
|
|
12129
12239
|
const {
|
|
12130
12240
|
id,
|
|
@@ -12143,9 +12253,9 @@ function TabInputRendererComponent(props) {
|
|
|
12143
12253
|
onSelect(0);
|
|
12144
12254
|
}
|
|
12145
12255
|
}, [selectedIndex, onSelect, options.length]);
|
|
12146
|
-
return /* @__PURE__ */ (0,
|
|
12147
|
-
/* @__PURE__ */ (0,
|
|
12148
|
-
|
|
12256
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
|
|
12257
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
12258
|
+
import_components30.Tabs,
|
|
12149
12259
|
{
|
|
12150
12260
|
name: id,
|
|
12151
12261
|
selected: selectedIndex != null ? selectedIndex : 0,
|
|
@@ -12153,7 +12263,7 @@ function TabInputRendererComponent(props) {
|
|
|
12153
12263
|
title: option.title,
|
|
12154
12264
|
// if we pass null, we get some props-types console errors
|
|
12155
12265
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
12156
|
-
content: /* @__PURE__ */ (0,
|
|
12266
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_jsx_runtime47.Fragment, {}),
|
|
12157
12267
|
disabled: option.disabled || disabled
|
|
12158
12268
|
})),
|
|
12159
12269
|
onTabSelect: onSelect
|
|
@@ -12165,26 +12275,26 @@ function TabInputRendererComponent(props) {
|
|
|
12165
12275
|
var isValidIndex = (index, options) => index !== null && index >= 0 && index < options;
|
|
12166
12276
|
|
|
12167
12277
|
// src/revamp/wise/renderers/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
12168
|
-
var
|
|
12278
|
+
var import_components32 = require("@transferwise/components");
|
|
12169
12279
|
|
|
12170
12280
|
// src/revamp/wise/renderers/SelectInputRenderer/SelectTriggerMedia.tsx
|
|
12171
|
-
var
|
|
12172
|
-
var
|
|
12281
|
+
var import_components31 = require("@transferwise/components");
|
|
12282
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
12173
12283
|
function SelectTriggerMedia({ icon, image }) {
|
|
12174
12284
|
if (image == null ? void 0 : image.url) {
|
|
12175
12285
|
return null;
|
|
12176
12286
|
}
|
|
12177
12287
|
if (icon && "name" in icon) {
|
|
12178
|
-
return /* @__PURE__ */ (0,
|
|
12288
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_components31.Avatar, { type: import_components31.AvatarType.ICON, size: 24, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(DynamicIcon_default, { name: icon.name }) });
|
|
12179
12289
|
}
|
|
12180
12290
|
if (icon && "text" in icon) {
|
|
12181
|
-
return /* @__PURE__ */ (0,
|
|
12291
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_components31.Avatar, { type: import_components31.AvatarType.ICON, size: 24, children: icon.text });
|
|
12182
12292
|
}
|
|
12183
12293
|
return null;
|
|
12184
12294
|
}
|
|
12185
12295
|
|
|
12186
12296
|
// src/revamp/wise/renderers/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
12187
|
-
var
|
|
12297
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
12188
12298
|
function SelectInputRendererComponent(props) {
|
|
12189
12299
|
const {
|
|
12190
12300
|
id,
|
|
@@ -12219,17 +12329,17 @@ function SelectInputRendererComponent(props) {
|
|
|
12219
12329
|
const contentProps = withinTrigger ? {
|
|
12220
12330
|
title: option.title,
|
|
12221
12331
|
note: option.description,
|
|
12222
|
-
icon: /* @__PURE__ */ (0,
|
|
12332
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(SelectTriggerMedia, { icon: option.icon, image: option.image })
|
|
12223
12333
|
} : {
|
|
12224
12334
|
title: option.title,
|
|
12225
12335
|
description: option.description,
|
|
12226
|
-
icon: /* @__PURE__ */ (0,
|
|
12336
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(OptionMedia, { icon: option.icon, image: option.image })
|
|
12227
12337
|
};
|
|
12228
|
-
return /* @__PURE__ */ (0,
|
|
12338
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_components32.SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
12229
12339
|
};
|
|
12230
|
-
return /* @__PURE__ */ (0,
|
|
12231
|
-
/* @__PURE__ */ (0,
|
|
12232
|
-
|
|
12340
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, { children: [
|
|
12341
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12342
|
+
import_components32.SelectInput,
|
|
12233
12343
|
{
|
|
12234
12344
|
name: id,
|
|
12235
12345
|
placeholder,
|
|
@@ -12248,8 +12358,8 @@ function SelectInputRendererComponent(props) {
|
|
|
12248
12358
|
|
|
12249
12359
|
// src/revamp/wise/renderers/SelectInputRenderer/SegmentedInputRendererComponent.tsx
|
|
12250
12360
|
var import_react18 = require("react");
|
|
12251
|
-
var
|
|
12252
|
-
var
|
|
12361
|
+
var import_components33 = require("@transferwise/components");
|
|
12362
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
12253
12363
|
function SegmentedInputRendererComponent(props) {
|
|
12254
12364
|
const { id, children, description, error, help, label, options, selectedIndex, onSelect } = props;
|
|
12255
12365
|
(0, import_react18.useEffect)(() => {
|
|
@@ -12257,9 +12367,9 @@ function SegmentedInputRendererComponent(props) {
|
|
|
12257
12367
|
onSelect(0);
|
|
12258
12368
|
}
|
|
12259
12369
|
}, [selectedIndex, onSelect, options.length]);
|
|
12260
|
-
return /* @__PURE__ */ (0,
|
|
12261
|
-
/* @__PURE__ */ (0,
|
|
12262
|
-
|
|
12370
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
|
|
12371
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
12372
|
+
import_components33.SegmentedControl,
|
|
12263
12373
|
{
|
|
12264
12374
|
name: `${id}-segmented-control`,
|
|
12265
12375
|
value: String(selectedIndex),
|
|
@@ -12273,44 +12383,44 @@ function SegmentedInputRendererComponent(props) {
|
|
|
12273
12383
|
onChange: (value) => onSelect(Number(value))
|
|
12274
12384
|
}
|
|
12275
12385
|
) }),
|
|
12276
|
-
/* @__PURE__ */ (0,
|
|
12386
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { id: `${id}-children`, children })
|
|
12277
12387
|
] });
|
|
12278
12388
|
}
|
|
12279
12389
|
var isValidIndex2 = (index, options) => index !== null && index >= 0 && index < options;
|
|
12280
12390
|
|
|
12281
12391
|
// src/revamp/wise/renderers/SelectInputRenderer/SelectInputRenderer.tsx
|
|
12282
|
-
var
|
|
12392
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
12283
12393
|
var SelectInputRenderer = {
|
|
12284
12394
|
canRenderType: "input-select",
|
|
12285
12395
|
render: (props) => {
|
|
12286
12396
|
switch (props.control) {
|
|
12287
12397
|
case "radio":
|
|
12288
|
-
return /* @__PURE__ */ (0,
|
|
12398
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(RadioInputRendererComponent, __spreadValues({}, props));
|
|
12289
12399
|
case "tab":
|
|
12290
|
-
return props.options.length > 3 ? /* @__PURE__ */ (0,
|
|
12400
|
+
return props.options.length > 3 ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TabInputRendererComponent, __spreadValues({}, props));
|
|
12291
12401
|
case "segmented":
|
|
12292
|
-
return props.options.length > 3 ? /* @__PURE__ */ (0,
|
|
12402
|
+
return props.options.length > 3 ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(SegmentedInputRendererComponent, __spreadValues({}, props));
|
|
12293
12403
|
case "select":
|
|
12294
12404
|
default:
|
|
12295
|
-
return /* @__PURE__ */ (0,
|
|
12405
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(SelectInputRendererComponent, __spreadValues({}, props));
|
|
12296
12406
|
}
|
|
12297
12407
|
}
|
|
12298
12408
|
};
|
|
12299
12409
|
var SelectInputRenderer_default = SelectInputRenderer;
|
|
12300
12410
|
|
|
12301
12411
|
// src/revamp/wise/renderers/StatusListRenderer.tsx
|
|
12302
|
-
var
|
|
12303
|
-
var
|
|
12412
|
+
var import_components34 = require("@transferwise/components");
|
|
12413
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
12304
12414
|
var StatusListRenderer = {
|
|
12305
12415
|
canRenderType: "status-list",
|
|
12306
|
-
render: ({ margin, items, title }) => /* @__PURE__ */ (0,
|
|
12307
|
-
title ? /* @__PURE__ */ (0,
|
|
12308
|
-
items.map(({ description, icon, status, title: itemTitle }) => /* @__PURE__ */ (0,
|
|
12309
|
-
|
|
12416
|
+
render: ({ margin, items, title }) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: getMargin(margin), children: [
|
|
12417
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components34.Header, { title }) : null,
|
|
12418
|
+
items.map(({ description, icon, status, title: itemTitle }) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
12419
|
+
import_components34.Summary,
|
|
12310
12420
|
{
|
|
12311
12421
|
title: itemTitle,
|
|
12312
12422
|
description,
|
|
12313
|
-
icon: icon && "name" in icon ? /* @__PURE__ */ (0,
|
|
12423
|
+
icon: icon && "name" in icon ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(DynamicIcon_default, { name: icon.name }) : null,
|
|
12314
12424
|
status: mapStatus(status)
|
|
12315
12425
|
},
|
|
12316
12426
|
`${title}/${description || ""}`
|
|
@@ -12326,63 +12436,63 @@ var mapStatus = (status) => {
|
|
|
12326
12436
|
};
|
|
12327
12437
|
|
|
12328
12438
|
// src/revamp/wise/renderers/components/VariableTextInput.tsx
|
|
12329
|
-
var
|
|
12330
|
-
var
|
|
12439
|
+
var import_components35 = require("@transferwise/components");
|
|
12440
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
12331
12441
|
function VariableTextInput({
|
|
12332
12442
|
control,
|
|
12333
12443
|
inputProps
|
|
12334
12444
|
}) {
|
|
12335
12445
|
switch (control) {
|
|
12336
12446
|
case "password":
|
|
12337
|
-
return /* @__PURE__ */ (0,
|
|
12447
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(TextInput, __spreadValues({ type: "password" }, inputProps));
|
|
12338
12448
|
case "email":
|
|
12339
|
-
return /* @__PURE__ */ (0,
|
|
12449
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(TextInput, __spreadValues({ type: "email" }, inputProps));
|
|
12340
12450
|
case "textarea":
|
|
12341
|
-
return /* @__PURE__ */ (0,
|
|
12451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(TextAreaInput, __spreadValues({}, inputProps));
|
|
12342
12452
|
case "numeric":
|
|
12343
|
-
return /* @__PURE__ */ (0,
|
|
12453
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(NumericInput, __spreadValues({ type: "number" }, inputProps));
|
|
12344
12454
|
case "phone-number":
|
|
12345
|
-
return /* @__PURE__ */ (0,
|
|
12455
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(PhoneNumberInput, __spreadValues({}, inputProps));
|
|
12346
12456
|
default:
|
|
12347
|
-
return /* @__PURE__ */ (0,
|
|
12457
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(TextInput, __spreadValues({ type: "text" }, inputProps));
|
|
12348
12458
|
}
|
|
12349
12459
|
}
|
|
12350
12460
|
function TextInput(_a) {
|
|
12351
12461
|
var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
|
|
12352
12462
|
if (typeof displayFormat === "string") {
|
|
12353
12463
|
const inputProps = __spreadValues({ id, name: id, className: "form-control" }, rest);
|
|
12354
|
-
return /* @__PURE__ */ (0,
|
|
12355
|
-
|
|
12464
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
12465
|
+
import_components35.InputWithDisplayFormat,
|
|
12356
12466
|
__spreadValues({
|
|
12357
12467
|
displayPattern: displayFormat,
|
|
12358
12468
|
onChange: (newValue) => onChange(newValue)
|
|
12359
12469
|
}, inputProps)
|
|
12360
12470
|
);
|
|
12361
12471
|
}
|
|
12362
|
-
return /* @__PURE__ */ (0,
|
|
12472
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components35.Input, __spreadValues({ id, name: id, onChange: (e) => onChange(e.target.value) }, rest));
|
|
12363
12473
|
}
|
|
12364
12474
|
function TextAreaInput(_a) {
|
|
12365
12475
|
var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
|
|
12366
12476
|
const textAreaProps = __spreadValues({ id, name: id }, rest);
|
|
12367
|
-
return typeof displayFormat === "string" ? /* @__PURE__ */ (0,
|
|
12368
|
-
|
|
12477
|
+
return typeof displayFormat === "string" ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
12478
|
+
import_components35.TextareaWithDisplayFormat,
|
|
12369
12479
|
__spreadValues({
|
|
12370
12480
|
displayPattern: displayFormat,
|
|
12371
12481
|
onChange: (newValue) => onChange(newValue)
|
|
12372
12482
|
}, textAreaProps)
|
|
12373
|
-
) : /* @__PURE__ */ (0,
|
|
12483
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components35.TextArea, __spreadValues({ onChange: (e) => onChange(e.target.value) }, textAreaProps));
|
|
12374
12484
|
}
|
|
12375
12485
|
function NumericInput(_a) {
|
|
12376
12486
|
var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
|
|
12377
12487
|
const numericProps = __spreadValues({ id, name: id, onWheel }, rest);
|
|
12378
|
-
return typeof displayFormat === "string" ? /* @__PURE__ */ (0,
|
|
12379
|
-
|
|
12488
|
+
return typeof displayFormat === "string" ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
12489
|
+
import_components35.InputWithDisplayFormat,
|
|
12380
12490
|
__spreadValues({
|
|
12381
12491
|
displayPattern: displayFormat,
|
|
12382
12492
|
onChange: (newValue) => onChange(numericValueOrNull(newValue))
|
|
12383
12493
|
}, numericProps)
|
|
12384
|
-
) : /* @__PURE__ */ (0,
|
|
12385
|
-
|
|
12494
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
12495
|
+
import_components35.Input,
|
|
12386
12496
|
__spreadValues({
|
|
12387
12497
|
onChange: ({ target: { value: newValue } }) => onChange(numericValueOrNull(newValue))
|
|
12388
12498
|
}, numericProps)
|
|
@@ -12390,12 +12500,12 @@ function NumericInput(_a) {
|
|
|
12390
12500
|
}
|
|
12391
12501
|
function PhoneNumberInput(_a) {
|
|
12392
12502
|
var _b = _a, { value } = _b, rest = __objRest(_b, ["value"]);
|
|
12393
|
-
return /* @__PURE__ */ (0,
|
|
12503
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components35.PhoneNumberInput, __spreadValues({ initialValue: value }, rest));
|
|
12394
12504
|
}
|
|
12395
12505
|
var VariableTextInput_default = VariableTextInput;
|
|
12396
12506
|
|
|
12397
12507
|
// src/revamp/wise/renderers/TextInputRenderer.tsx
|
|
12398
|
-
var
|
|
12508
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
12399
12509
|
var TextInputRenderer = {
|
|
12400
12510
|
canRenderType: "input-text",
|
|
12401
12511
|
render: (props) => {
|
|
@@ -12420,14 +12530,14 @@ var TextInputRenderer = {
|
|
|
12420
12530
|
]);
|
|
12421
12531
|
const value = initialValue != null ? initialValue : "";
|
|
12422
12532
|
const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
|
|
12423
|
-
return /* @__PURE__ */ (0,
|
|
12533
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(VariableTextInput_default, { control, inputProps }) });
|
|
12424
12534
|
}
|
|
12425
12535
|
};
|
|
12426
12536
|
var TextInputRenderer_default = TextInputRenderer;
|
|
12427
12537
|
|
|
12428
12538
|
// src/revamp/wise/renderers/UploadInputRenderer.tsx
|
|
12429
|
-
var
|
|
12430
|
-
var
|
|
12539
|
+
var import_components36 = require("@transferwise/components");
|
|
12540
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
12431
12541
|
var UploadInputRenderer = {
|
|
12432
12542
|
canRenderType: "input-upload",
|
|
12433
12543
|
render: (props) => {
|
|
@@ -12443,8 +12553,8 @@ var UploadInputRenderer = {
|
|
|
12443
12553
|
};
|
|
12444
12554
|
return (
|
|
12445
12555
|
// We don't pass help here as there is no sensible place to display it
|
|
12446
|
-
/* @__PURE__ */ (0,
|
|
12447
|
-
|
|
12556
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(UploadFieldInput_default, { id, label: void 0, description: void 0, error, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
12557
|
+
import_components36.UploadInput,
|
|
12448
12558
|
{
|
|
12449
12559
|
id,
|
|
12450
12560
|
description,
|
|
@@ -12498,8 +12608,8 @@ var LargeUploadRenderer = {
|
|
|
12498
12608
|
throw e;
|
|
12499
12609
|
}
|
|
12500
12610
|
};
|
|
12501
|
-
return /* @__PURE__ */ (0,
|
|
12502
|
-
|
|
12611
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
12612
|
+
import_components36.Upload,
|
|
12503
12613
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
12504
12614
|
usAccept: getAcceptsString(accepts),
|
|
12505
12615
|
usDisabled: disabled,
|
|
@@ -12511,67 +12621,6 @@ var LargeUploadRenderer = {
|
|
|
12511
12621
|
}
|
|
12512
12622
|
};
|
|
12513
12623
|
|
|
12514
|
-
// src/revamp/wise/renderers/ReviewRenderer.tsx
|
|
12515
|
-
var import_components36 = require("@transferwise/components");
|
|
12516
|
-
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
12517
|
-
var ReviewRenderer = {
|
|
12518
|
-
canRenderType: "review",
|
|
12519
|
-
render: ({ callToAction, control, fields, margin, title }) => {
|
|
12520
|
-
const orientation = mapControlToDefinitionListLayout(control);
|
|
12521
|
-
const action = callToAction ? {
|
|
12522
|
-
text: callToAction.title,
|
|
12523
|
-
onClick: (event) => {
|
|
12524
|
-
event.preventDefault();
|
|
12525
|
-
callToAction.onClick();
|
|
12526
|
-
}
|
|
12527
|
-
} : void 0;
|
|
12528
|
-
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: getMargin(margin), children: [
|
|
12529
|
-
(title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_components36.Header, { title: title != null ? title : "", action }),
|
|
12530
|
-
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
12531
|
-
import_components36.DefinitionList,
|
|
12532
|
-
{
|
|
12533
|
-
layout: orientation,
|
|
12534
|
-
definitions: fields.map(({ label, value, help }, index) => ({
|
|
12535
|
-
key: String(index),
|
|
12536
|
-
title: label,
|
|
12537
|
-
value: getFieldValue(value, help, orientation)
|
|
12538
|
-
}))
|
|
12539
|
-
}
|
|
12540
|
-
) })
|
|
12541
|
-
] });
|
|
12542
|
-
}
|
|
12543
|
-
};
|
|
12544
|
-
var ReviewRenderer_default = ReviewRenderer;
|
|
12545
|
-
var mapControlToDefinitionListLayout = (control) => {
|
|
12546
|
-
switch (control) {
|
|
12547
|
-
case "horizontal":
|
|
12548
|
-
case "horizontal-end-aligned":
|
|
12549
|
-
return "HORIZONTAL_RIGHT_ALIGNED";
|
|
12550
|
-
case "horizontal-start-aligned":
|
|
12551
|
-
return "HORIZONTAL_LEFT_ALIGNED";
|
|
12552
|
-
case "vertical-two-column":
|
|
12553
|
-
return "VERTICAL_TWO_COLUMN";
|
|
12554
|
-
case "vertical":
|
|
12555
|
-
case "vertical-one-column":
|
|
12556
|
-
default:
|
|
12557
|
-
return "VERTICAL_ONE_COLUMN";
|
|
12558
|
-
}
|
|
12559
|
-
};
|
|
12560
|
-
var getFieldValue = (value, help, orientation) => {
|
|
12561
|
-
if (help) {
|
|
12562
|
-
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, { children: [
|
|
12563
|
-
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Help_default, { help }),
|
|
12564
|
-
" ",
|
|
12565
|
-
value
|
|
12566
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, { children: [
|
|
12567
|
-
value,
|
|
12568
|
-
" ",
|
|
12569
|
-
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Help_default, { help })
|
|
12570
|
-
] });
|
|
12571
|
-
}
|
|
12572
|
-
return value;
|
|
12573
|
-
};
|
|
12574
|
-
|
|
12575
12624
|
// src/revamp/wise/renderers/step/StepRenderer.tsx
|
|
12576
12625
|
var import_react20 = require("react");
|
|
12577
12626
|
|
|
@@ -19479,6 +19528,79 @@ function JsonSchemaForm(props) {
|
|
|
19479
19528
|
var JsonSchemaForm_default = JsonSchemaForm;
|
|
19480
19529
|
var noop8 = () => {
|
|
19481
19530
|
};
|
|
19531
|
+
|
|
19532
|
+
// src/revamp/wise/renderers/step/KYCCameraStepRenderer.tsx
|
|
19533
|
+
var import_react67 = require("react");
|
|
19534
|
+
var import_jsx_runtime130 = require("react/jsx-runtime");
|
|
19535
|
+
var KYCCameraStepRenderer = {
|
|
19536
|
+
canRenderType: "step",
|
|
19537
|
+
canRender: (props) => getKYCCameraStepConfiguration(props.step) != null,
|
|
19538
|
+
render: KYCCameraStepRendererComponent
|
|
19539
|
+
};
|
|
19540
|
+
function KYCCameraStepRendererComponent(props) {
|
|
19541
|
+
const { error, trackEvent, step, onAction } = props;
|
|
19542
|
+
(0, import_react67.useEffect)(() => {
|
|
19543
|
+
if (error) {
|
|
19544
|
+
console.error("KYCCameraStepRendererComponent", error);
|
|
19545
|
+
}
|
|
19546
|
+
}, [error]);
|
|
19547
|
+
const config = getKYCCameraStepConfiguration(step);
|
|
19548
|
+
if (!config) {
|
|
19549
|
+
return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_jsx_runtime130.Fragment, {});
|
|
19550
|
+
}
|
|
19551
|
+
const handleCapture = async (blob) => {
|
|
19552
|
+
if (blob) {
|
|
19553
|
+
const newValue = { [propertyName]: await blobToBase642(blob) };
|
|
19554
|
+
const patchedAction = __spreadProps(__spreadValues({}, action), { skipValidation: true, data: newValue });
|
|
19555
|
+
void onAction(patchedAction);
|
|
19556
|
+
}
|
|
19557
|
+
};
|
|
19558
|
+
const { title, imageUrl, cameraConfig, action, propertyName } = config;
|
|
19559
|
+
const kycCameraConfig = cameraConfig;
|
|
19560
|
+
const { assets, instructions, direction } = kycCameraConfig;
|
|
19561
|
+
return config ? /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
19562
|
+
CameraCapture_default,
|
|
19563
|
+
{
|
|
19564
|
+
overlay: assets == null ? void 0 : assets.overlay,
|
|
19565
|
+
outline: assets == null ? void 0 : assets.outline,
|
|
19566
|
+
title: error != null ? error : title,
|
|
19567
|
+
imageUrl,
|
|
19568
|
+
instructions,
|
|
19569
|
+
direction,
|
|
19570
|
+
onEvent: trackEvent,
|
|
19571
|
+
onCapture: (blob) => {
|
|
19572
|
+
void handleCapture(blob);
|
|
19573
|
+
}
|
|
19574
|
+
},
|
|
19575
|
+
error
|
|
19576
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_jsx_runtime130.Fragment, {});
|
|
19577
|
+
}
|
|
19578
|
+
var getKYCCameraStepConfiguration = (step) => {
|
|
19579
|
+
var _a, _b, _c;
|
|
19580
|
+
const action = (_a = step.actions) == null ? void 0 : _a[0];
|
|
19581
|
+
if (action === void 0) {
|
|
19582
|
+
return null;
|
|
19583
|
+
}
|
|
19584
|
+
const firstSchema = filterHiddenSchemas2((_b = step.schemas) != null ? _b : [])[0];
|
|
19585
|
+
if (!firstSchema || !isObjectSchema(firstSchema)) {
|
|
19586
|
+
return null;
|
|
19587
|
+
}
|
|
19588
|
+
const propertyName = Object.keys(firstSchema.properties)[0];
|
|
19589
|
+
const childSchema = propertyName ? firstSchema.properties[propertyName] : void 0;
|
|
19590
|
+
const cameraConfig = childSchema ? getCameraConfig(childSchema) : null;
|
|
19591
|
+
const title = childSchema == null ? void 0 : childSchema.title;
|
|
19592
|
+
const imageUrl = (_c = childSchema == null ? void 0 : childSchema.image) == null ? void 0 : _c.url;
|
|
19593
|
+
return action && propertyName && cameraConfig ? { title, imageUrl, propertyName, cameraConfig, action } : null;
|
|
19594
|
+
};
|
|
19595
|
+
var getCameraConfig = (childSchema) => childSchema != null && "type" in childSchema && childSchema.type === "string" && childSchema.format === "base64url" && childSchema.source === "camera" && childSchema.cameraConfig != null ? childSchema.cameraConfig : null;
|
|
19596
|
+
var filterHiddenSchemas2 = (schemas) => schemas.filter(
|
|
19597
|
+
(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
|
|
19598
|
+
);
|
|
19599
|
+
var blobToBase642 = (blob) => new Promise((resolve, _) => {
|
|
19600
|
+
const reader = new FileReader();
|
|
19601
|
+
reader.onloadend = () => resolve(reader.result);
|
|
19602
|
+
reader.readAsDataURL(blob);
|
|
19603
|
+
});
|
|
19482
19604
|
/*! Bundled license information:
|
|
19483
19605
|
|
|
19484
19606
|
classnames/index.js:
|