@wise/dynamic-flow-client 3.5.0-experimental-63c768d → 3.5.1-experimental-ccbce45
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/errorBoundary/ErrorBoundaryAlert.js +1 -1
- package/build/common/httpClientContext/HttpClientContext.js +2 -13
- package/build/common/makeHttpClient/makeHttpClient.spec.js +10 -10
- package/build/common/messages/external-confirmation.messages.js +5 -5
- package/build/common/messages/generic-error.messages.js +4 -4
- package/build/common/messages/help.messages.js +2 -2
- package/build/common/messages/multi-file-upload.messages.js +4 -4
- package/build/common/messages/multi-select.messages.js +2 -2
- package/build/common/messages/paragraph.messages.js +3 -3
- package/build/common/messages/repeatable.messages.js +5 -5
- package/build/common/messages/validation.array.messages.js +3 -3
- package/build/common/messages/validation.messages.js +11 -11
- package/build/i18n/index.js +1 -1
- package/build/legacy/common/constants/DateMode.js +1 -1
- package/build/legacy/common/constants/FormControlType.js +1 -1
- package/build/legacy/common/constants/MonthFormat.js +1 -1
- package/build/legacy/common/constants/Size.js +1 -1
- package/build/legacy/common/contexts/dynamicFlowContexts/DynamicFlowContexts.js +3 -14
- package/build/legacy/common/contexts/dynamicFlowContexts/usePendingPromiseCounter.js +3 -1
- package/build/legacy/common/contexts/eventsContext/EventsContext.js +2 -2
- package/build/legacy/common/contexts/eventsContext/EventsContext.spec.js +1 -12
- package/build/legacy/common/contexts/featureContext/FeatureContext.js +1 -12
- package/build/legacy/common/contexts/featureContext/FeatureContext.spec.js +4 -15
- package/build/legacy/common/contexts/logContext/LogContext.js +2 -2
- package/build/legacy/common/contexts/logContext/LogContext.spec.js +1 -12
- package/build/legacy/common/hooks/useExternal/useExternal.spec.js +6 -6
- package/build/legacy/common/hooks/useExternalStepPolling/useExternalStepPolling.js +3 -2
- package/build/legacy/common/hooks/usePersistAsync/usePersistAsync.js +1 -1
- package/build/legacy/common/hooks/usePolling/usePolling.js +4 -2
- package/build/legacy/common/hooks/useStepPolling/useStepPolling.js +5 -3
- package/build/legacy/common/hooks/useStepPolling/useStepPolling.spec.js +4 -4
- package/build/legacy/common/messages.js +2 -2
- package/build/legacy/common/utils/file-utils.spec.js +4 -4
- package/build/legacy/common/utils/mobile-utils.spec.js +1 -1
- package/build/legacy/common/utils/schema-utils.js +2 -2
- package/build/legacy/common/validators/models/model-utils.spec.js +7 -7
- package/build/legacy/common/validators/models/model-validators.js +2 -2
- package/build/legacy/common/validators/models/model-validators.spec.js +54 -54
- package/build/legacy/common/validators/schemas/schema-validators.js +1 -1
- package/build/legacy/common/validators/schemas/schema-validators.spec.js +20 -20
- package/build/legacy/common/validators/validationFailures/validation-failures.js +2 -2
- package/build/legacy/common/validators/validationFailures/validation-failures.spec.js +11 -11
- package/build/legacy/dynamicFlow/BackButton.js +2 -2
- package/build/legacy/dynamicFlow/DynamicFlow.js +5 -5
- package/build/legacy/dynamicFlow/stories/dev-tools/DynamicFlow.story.js +7 -7
- package/build/legacy/dynamicFlow/stories/dev-tools/ErrorResponses.story.js +18 -18
- package/build/legacy/dynamicFlow/stories/dev-tools/Examples.story.js +1 -1
- package/build/legacy/dynamicFlow/stories/dev-tools/Features.story.js +1 -1
- package/build/legacy/dynamicFlow/stories/dev-tools/JsonSchemaForm.story.js +5 -5
- package/build/legacy/dynamicFlow/stories/dev-tools/RefreshOnChange.story.js +24 -24
- package/build/legacy/dynamicFlow/stories/dev-tools/SearchFeature.story.js +10 -21
- package/build/legacy/dynamicFlow/stories/dev-tools/ServerTest.story.js +4 -4
- package/build/legacy/dynamicFlow/stories/dev-tools/Upload.story.js +19 -19
- package/build/legacy/dynamicFlow/stories/dev-tools/ValidationAsync.story.js +18 -18
- package/build/legacy/dynamicFlow/stories/examples/ObjectConst.story.js +25 -25
- package/build/legacy/dynamicFlow/tests/Actions.spec.js +6 -6
- package/build/legacy/dynamicFlow/tests/AllOfSchema.spec.js +17 -17
- package/build/legacy/dynamicFlow/tests/AutocompleteHints.spec.js +6 -6
- package/build/legacy/dynamicFlow/tests/DynamicFlow.BackButton.spec.js +11 -11
- package/build/legacy/dynamicFlow/tests/DynamicFlow.search.spec.js +13 -13
- package/build/legacy/dynamicFlow/tests/DynamicFlow.spec.js +48 -48
- package/build/legacy/dynamicFlow/tests/DynamicImage.spec.js +4 -4
- package/build/legacy/dynamicFlow/tests/DynamicInstructions.spec.js +3 -3
- package/build/legacy/dynamicFlow/tests/HiddenSchemas.spec.js +24 -24
- package/build/legacy/dynamicFlow/tests/ModalLayout.spec.js +20 -20
- package/build/legacy/dynamicFlow/tests/MultiSelect.spec.js +21 -21
- package/build/legacy/dynamicFlow/tests/MultipleFileUploadSchema.spec.js +24 -24
- package/build/legacy/dynamicFlow/tests/ObjectSchema.spec.js +16 -16
- package/build/legacy/dynamicFlow/tests/OneOfSchema.spec.js +77 -77
- package/build/legacy/dynamicFlow/tests/PersistAsync.blob-schema.spec.js +19 -19
- package/build/legacy/dynamicFlow/tests/PersistAsync.string-schema.spec.js +10 -10
- package/build/legacy/dynamicFlow/tests/RefreshStepOnChange.debouncing.spec.js +19 -19
- package/build/legacy/dynamicFlow/tests/RefreshStepOnChange.spec.js +46 -46
- package/build/legacy/dynamicFlow/tests/RepeatableSchema.spec.js +62 -62
- package/build/legacy/dynamicFlow/tests/StepModel.spec.js +6 -6
- package/build/legacy/dynamicFlow/tests/ValidationAsync.spec.js +13 -13
- package/build/legacy/dynamicFlow/utils/responseParsers/response-parsers.spec.js +13 -13
- package/build/legacy/dynamicFlow/utils/useDynamicFlowState.js +4 -4
- package/build/legacy/formControl/FormControl.js +9 -9
- package/build/legacy/formControl/Select.spec.js +3 -3
- package/build/legacy/formControl/utils/getAutocompleteString.js +1 -1
- package/build/legacy/formControl/utils/value-utils.js +1 -1
- package/build/legacy/jsonSchemaForm/JsonSchemaForm.end-to-end.spec.js +66 -66
- package/build/legacy/jsonSchemaForm/JsonSchemaForm.js +1 -1
- package/build/legacy/jsonSchemaForm/allOfSchema/AllOfSchema.js +5 -5
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/ArraySchema.js +1 -1
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.js +1 -1
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multiSelectSchema/MultiSelectSchema.js +6 -17
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.js +3 -3
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/useFormattedDefaultErrorMessages.js +1 -1
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchema.js +7 -7
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchemaStep.js +6 -6
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/utils/summary-utils.js +7 -7
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/utils/summary-utils.spec.js +190 -190
- package/build/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.js +8 -19
- package/build/legacy/jsonSchemaForm/controlFeedback/ControlFeedback.js +14 -14
- package/build/legacy/jsonSchemaForm/genericSchema/GenericSchema.rtl.spec.js +2 -2
- package/build/legacy/jsonSchemaForm/help/Help.js +1 -12
- package/build/legacy/jsonSchemaForm/objectSchema/ObjectSchema.js +4 -4
- package/build/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.js +12 -12
- package/build/legacy/jsonSchemaForm/oneOfSchema/utils.js +6 -6
- package/build/legacy/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.js +1 -1
- package/build/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.js +2 -2
- package/build/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.js +4 -4
- package/build/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.js +2 -2
- package/build/legacy/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.js +2 -2
- package/build/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.js +1 -12
- package/build/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.js +1 -1
- package/build/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.js +3 -3
- package/build/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.js +1 -1
- package/build/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.js +3 -3
- package/build/legacy/jsonSchemaForm/schemaFormControl/SchemaFormControl.js +6 -6
- package/build/legacy/jsonSchemaForm/schemaFormControl/SchemaFormControl.spec.js +12 -12
- package/build/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.js +10 -10
- package/build/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.spec.js +23 -23
- package/build/legacy/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.js +2 -2
- package/build/legacy/layout/DynamicLayout.js +1 -1
- package/build/legacy/layout/box/DynamicBox.js +2 -13
- package/build/legacy/layout/button/DynamicButton.js +1 -12
- package/build/legacy/layout/button/DynamicButton.spec.js +13 -24
- package/build/legacy/layout/button/utils.js +3 -3
- package/build/legacy/layout/button/utils.spec.js +6 -6
- package/build/legacy/layout/columns/DynamicColumns.js +4 -15
- package/build/legacy/layout/decision/DynamicDecision.js +1 -12
- package/build/legacy/layout/external/DynamicExternal.js +1 -1
- package/build/legacy/layout/external/DynamicExternal.messages.js +2 -2
- package/build/legacy/layout/form/DynamicForm.js +2 -2
- package/build/legacy/layout/heading/DynamicHeading.js +8 -19
- package/build/legacy/layout/image/DynamicImage.js +5 -4
- package/build/legacy/layout/instructions/DynamicInstructions.js +1 -12
- package/build/legacy/layout/list/DynamicStatusList.js +3 -3
- package/build/legacy/layout/list/DynamicStatusList.spec.js +9 -9
- package/build/legacy/layout/loadingIndicator/DynamicLoadingIndicator.js +1 -1
- package/build/legacy/layout/markdown/DynamicMarkdown.js +2 -13
- package/build/legacy/layout/markdown/DynamicMarkdown.spec.js +4 -4
- package/build/legacy/layout/modal/DynamicModal.js +2 -2
- package/build/legacy/layout/paragraph/DynamicParagraph.js +5 -16
- package/build/legacy/layout/review/DynamicReview.js +3 -14
- package/build/legacy/layout/review/DynamicReview.spec.js +6 -6
- package/build/legacy/layout/search/DynamicSearch.js +2 -13
- package/build/legacy/layout/search/SearchInput.js +1 -12
- package/build/legacy/layout/search/SearchResults.js +3 -14
- package/build/legacy/layout/search/useSearch.js +4 -4
- package/build/legacy/layout/utils/getNavigationOptionMedia.js +2 -13
- package/build/legacy/step/cameraStep/CameraStep.js +1 -1
- package/build/legacy/step/cameraStep/cameraCapture/CameraCapture.js +6 -6
- package/build/legacy/step/cameraStep/cameraCapture/CameraCapture.messages.js +12 -12
- package/build/legacy/step/cameraStep/cameraCapture/CameraCapture.spec.js +13 -13
- package/build/legacy/step/cameraStep/cameraCapture/components/bottomBar/BottomBar.js +3 -14
- package/build/legacy/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.js +1 -12
- package/build/legacy/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.messages.js +2 -2
- package/build/legacy/step/cameraStep/cameraCapture/hooks/useFullScreenOrientationLock.js +6 -4
- package/build/legacy/step/cameraStep/cameraCapture/hooks/useVideoConstraints.js +1 -1
- package/build/legacy/step/cameraStep/cameraCapture/overlay/Overlay.js +6 -6
- package/build/legacy/step/cameraStep/cameraCapture/screens/cameraErrorScreen/CameraErrorScreen.js +1 -12
- package/build/legacy/step/cameraStep/cameraCapture/tracking/index.js +1 -1
- package/build/legacy/step/externalConfirmationStep/ExternalConfirmationStep.js +7 -7
- package/build/legacy/step/layoutStep/LayoutStep.js +1 -1
- package/build/legacy/step/layoutStep/utils/inline-reference-utils.js +3 -3
- package/build/legacy/step/layoutStep/utils/layout-utils.js +12 -12
- package/build/legacy/test-utils/DynamicFlowProviders.js +1 -12
- package/build/legacy/test-utils/legacy-utils.js +4 -4
- package/build/legacy/test-utils/log-utils.js +1 -1
- package/build/revamp/DynamicFlowCore.js +5 -5
- package/build/revamp/DynamicFlowWise.js +1 -1
- package/build/revamp/DynamicFlowWise.spec.js +11 -11
- package/build/revamp/domain/components/AllOfComponent.js +1 -1
- package/build/revamp/domain/components/BooleanInputComponent.js +2 -2
- package/build/revamp/domain/components/ConstComponent.js +1 -1
- package/build/revamp/domain/components/DateInputComponent.js +2 -2
- package/build/revamp/domain/components/IntegerInputComponent.js +2 -2
- package/build/revamp/domain/components/NumberInputComponent.js +2 -2
- package/build/revamp/domain/components/ObjectComponent.js +1 -1
- package/build/revamp/domain/components/SelectInputComponent.js +2 -2
- package/build/revamp/domain/components/StepDomainComponent.js +1 -1
- package/build/revamp/domain/components/TextInputComponent.js +2 -2
- package/build/revamp/domain/components/UploadInputComponent.js +1 -1
- package/build/revamp/domain/components/repeatableComponent/RepeatableComponent.js +1 -1
- package/build/revamp/domain/components/repeatableComponent/RepeatableComponent.spec.js +1 -1
- package/build/revamp/domain/components/searchComponent/SearchComponent.js +4 -3
- package/build/revamp/domain/components/searchComponent/SearchComponent.spec.js +13 -13
- package/build/revamp/domain/components/utils/isPartialLocalValueMatch.spec.js +7 -7
- package/build/revamp/domain/features/persistAsync/getComponentPersistAsync.js +4 -4
- package/build/revamp/domain/features/persistAsync/getComponentPersistAsync.spec.js +1 -1
- package/build/revamp/domain/features/persistAsync/getInitialPersistedState.js +1 -1
- package/build/revamp/domain/features/persistAsync/getPerformPersistAsync.spec.js +17 -17
- package/build/revamp/domain/features/search/getPerformSearchFunction.js +3 -3
- package/build/revamp/domain/features/search/getPerformSearchFunction.spec.js +18 -18
- package/build/revamp/domain/features/summary/summary-utils.js +2 -2
- package/build/revamp/domain/features/summary/summary-utils.spec.js +27 -27
- package/build/revamp/domain/features/utils/http-utils.js +1 -1
- package/build/revamp/domain/features/validation/spec-utils.js +1 -1
- package/build/revamp/domain/features/validation/validation-functions.spec.js +4 -4
- package/build/revamp/domain/features/validation/value-checks.spec.js +4 -4
- package/build/revamp/domain/features/validationAsync/getComponentValidationAsync.js +4 -3
- package/build/revamp/domain/features/validationAsync/getComponentValidationAsync.spec.js +1 -1
- package/build/revamp/domain/features/validationAsync/getInitialValidationState.js +1 -1
- package/build/revamp/domain/features/validationAsync/getPerformValidationAsync.js +1 -1
- package/build/revamp/domain/features/validationAsync/getPerformValidationAsync.spec.js +17 -17
- package/build/revamp/domain/mappers/layout/alertLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/layout/boxLayoutToComponents.js +1 -1
- package/build/revamp/domain/mappers/layout/buttonLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/layout/columnsLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/layout/decisionLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/layout/formLayoutToComponent.js +2 -2
- package/build/revamp/domain/mappers/layout/headingLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/layout/imageLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/layout/infoLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/layout/instructionsLayoutToComponent.js +2 -2
- package/build/revamp/domain/mappers/layout/listLayoutToComponent.js +2 -2
- package/build/revamp/domain/mappers/layout/markdownLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/layout/modalLayoutToComponent.js +2 -2
- package/build/revamp/domain/mappers/layout/paragraphLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/layout/reviewLayoutToComponent.js +3 -3
- package/build/revamp/domain/mappers/layout/searchLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/layout/statusListLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/mapSchemaToComponent.js +1 -1
- package/build/revamp/domain/mappers/mapSchemaToComponent.spec.js +22 -22
- package/build/revamp/domain/mappers/mapStepToComponent.js +3 -3
- package/build/revamp/domain/mappers/mapStepToComponent.spec.js +12 -12
- package/build/revamp/domain/mappers/schema/allOfSchemaToComponent.js +1 -1
- package/build/revamp/domain/mappers/schema/arraySchemaToComponent/arraySchemaToRepeatableComponent.js +2 -2
- package/build/revamp/domain/mappers/schema/booleanSchemaToComponent.js +1 -1
- package/build/revamp/domain/mappers/schema/constSchemaToComponent.js +2 -2
- package/build/revamp/domain/mappers/schema/integerSchemaToComponent.js +1 -1
- package/build/revamp/domain/mappers/schema/numberSchemaToComponent.js +1 -1
- package/build/revamp/domain/mappers/schema/objectSchemaToComponent/objectSchemaToComponent.js +1 -1
- package/build/revamp/domain/mappers/schema/objectSchemaToComponent/objectSchemaToComponent.spec.js +21 -21
- package/build/revamp/domain/mappers/schema/oneOfSchemaToComponent/oneOfSchemaToComponent.js +4 -4
- package/build/revamp/domain/mappers/schema/oneOfSchemaToComponent/oneOfSchemaToComponent.spec.js +48 -48
- package/build/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToComponent.spec.js +21 -21
- package/build/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToDateInputComponent.js +1 -1
- package/build/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToTextInputComponent.js +1 -1
- package/build/revamp/domain/mappers/schema/utils/getPersistAsyncInitialState.js +1 -1
- package/build/revamp/domain/mappers/schema/utils/getValidationAsyncInitialState.js +1 -1
- package/build/revamp/domain/mappers/utils/getAutocompleteString.js +1 -1
- package/build/revamp/domain/mappers/utils/legacy-utils.js +2 -2
- package/build/revamp/flow/executeRefresh.js +2 -2
- package/build/revamp/flow/executeSubmission.js +1 -1
- package/build/revamp/renderers/CoreContainerRenderer.js +1 -1
- package/build/revamp/renderers/getRenderFunction.js +3 -3
- package/build/revamp/renderers/getSchemaErrorMessageFunction.js +12 -12
- package/build/revamp/renderers/mappers/allOfComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/buttonComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/containerComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/headingComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/hiddenComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/imageComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/instructionsComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/loadingIndicatorComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/markdownComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/modalComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/multiUploadInputComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/objectComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/paragraphComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/repeatableComponentToProps.js +2 -2
- package/build/revamp/renderers/mappers/reviewComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/searchComponentToProps.js +2 -2
- package/build/revamp/renderers/mappers/statusListComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/utils/inputComponentToProps.js +1 -1
- package/build/revamp/renderers/step/ExternalConfirmationDialog.js +2 -13
- package/build/revamp/renderers/step/StepRenderer.js +2 -13
- package/build/revamp/renderers/stepComponentToProps.js +1 -1
- package/build/revamp/stories/dev-tools/DynamicFlowRevamp.story.js +53 -53
- package/build/revamp/stories/dev-tools/EditableStep.story.js +7 -7
- package/build/revamp/stories/dev-tools/ErrorHandling.story.js +17 -17
- package/build/revamp/stories/dev-tools/External.story.js +6 -6
- package/build/revamp/stories/dev-tools/OneOf.Inititalisation.story.js +14 -14
- package/build/revamp/stories/dev-tools/PersistAsync.story.js +16 -16
- package/build/revamp/stories/dev-tools/RefreshOnChange.story.js +41 -41
- package/build/revamp/stories/dev-tools/RefreshOnChange.with.PersistAsync.story.js +210 -210
- package/build/revamp/stories/dev-tools/ServerTest.story.js +4 -4
- package/build/revamp/stories/dev-tools/Upload.story.js +18 -18
- package/build/revamp/stories/dev-tools/ValidationAsync.story.js +18 -18
- package/build/revamp/stories/examples/ObjectConst.story.js +25 -25
- package/build/revamp/stories/examples/OneOfInitialisation.story.js +10 -10
- package/build/revamp/stories/utils/fixtureHttpClient.js +1 -1
- package/build/revamp/stories/utils/mockSearchHandler.js +8 -8
- package/build/revamp/stories/visual-tests/VisualTests.story.js +1 -1
- package/build/revamp/test-utils/step-utils.js +1 -1
- package/build/revamp/tests/ImageRenderer.spec.js +3 -3
- package/build/revamp/tests/InitialAction.spec.js +9 -9
- package/build/revamp/tests/InitialStep.spec.js +3 -3
- package/build/revamp/tests/Logging.spec.js +5 -5
- package/build/revamp/tests/OneOfInitialisation.spec.js +73 -73
- package/build/revamp/tests/RefreshOnChange.ResponseHandling.spec.js +19 -19
- package/build/revamp/tests/RefreshOnChange.with.Tabs.spec.js +57 -57
- package/build/revamp/tests/RefreshOnChangePreserve.spec.js +13 -13
- package/build/revamp/tests/Submission.ResponseHandling.spec.js +38 -38
- package/build/revamp/tests/Submission.spec.js +23 -23
- package/build/revamp/tests/legacy/HiddenSchemas.spec.js +24 -24
- package/build/revamp/tests/legacy/MultipleFileUploadSchema.spec.js +27 -27
- package/build/revamp/tests/legacy/PersistAsync.blob-schema.spec.js +18 -18
- package/build/revamp/tests/legacy/PersistAsync.string-schema.spec.js +8 -8
- package/build/revamp/tests/legacy/RefreshStepOnChange.debouncing.spec.js +15 -14
- package/build/revamp/tests/legacy/RefreshStepOnChange.spec.js +50 -50
- package/build/revamp/tests/legacy/ValidationAsync.spec.js +14 -14
- package/build/revamp/tests/legacy/useExternal.spec.js +6 -6
- package/build/revamp/utils/component-utils.spec.js +43 -43
- package/build/revamp/utils/findComponent.spec.js +14 -14
- package/build/revamp/utils/type-utils.js +1 -1
- package/build/revamp/wise/renderers/AlertRenderer.js +1 -1
- package/build/revamp/wise/renderers/BooleanInputRenderer.js +2 -2
- package/build/revamp/wise/renderers/BoxRenderer.js +4 -15
- package/build/revamp/wise/renderers/ButtonRenderer.js +2 -13
- package/build/revamp/wise/renderers/ColumnsRenderer.js +4 -15
- package/build/revamp/wise/renderers/DateInputRenderer.js +2 -2
- package/build/revamp/wise/renderers/DecisionRenderer.js +3 -14
- package/build/revamp/wise/renderers/DividerRenderer.js +1 -1
- package/build/revamp/wise/renderers/FormRenderer.js +2 -13
- package/build/revamp/wise/renderers/FormSectionRenderer.js +1 -1
- package/build/revamp/wise/renderers/HeadingRenderer.js +7 -7
- package/build/revamp/wise/renderers/ImageRenderer.js +5 -4
- package/build/revamp/wise/renderers/InstructionsRenderer.js +2 -13
- package/build/revamp/wise/renderers/IntegerInputRenderer.js +3 -3
- package/build/revamp/wise/renderers/LoadingIndicatorRenderer.js +1 -1
- package/build/revamp/wise/renderers/MarkdownRenderer.js +2 -13
- package/build/revamp/wise/renderers/ModalRenderer.js +2 -2
- package/build/revamp/wise/renderers/MultiUploadInputRenderer.js +3 -14
- package/build/revamp/wise/renderers/NumberInputRenderer.js +3 -3
- package/build/revamp/wise/renderers/ParagraphRenderer.js +5 -4
- package/build/revamp/wise/renderers/RepeatableRenderer.js +5 -5
- package/build/revamp/wise/renderers/ReviewRenderer.js +5 -16
- package/build/revamp/wise/renderers/SearchRenderer.js +5 -5
- package/build/revamp/wise/renderers/SelectInputRenderer/OptionMedia.js +2 -13
- package/build/revamp/wise/renderers/SelectInputRenderer/RadioInputRendererComponent.js +3 -14
- package/build/revamp/wise/renderers/SelectInputRenderer/SelectInputRenderer.js +1 -1
- package/build/revamp/wise/renderers/SelectInputRenderer/SelectInputRendererComponent.js +4 -4
- package/build/revamp/wise/renderers/SelectInputRenderer/SelectTriggerMedia.js +2 -13
- package/build/revamp/wise/renderers/SelectInputRenderer/TabInputRendererComponent.js +3 -14
- package/build/revamp/wise/renderers/StatusListRenderer.js +3 -14
- package/build/revamp/wise/renderers/TextInputRenderer.js +2 -2
- package/build/revamp/wise/renderers/UploadInputRenderer.js +6 -6
- package/build/revamp/wise/renderers/components/FieldInput.js +1 -12
- package/build/revamp/wise/renderers/components/Help.js +1 -12
- package/build/revamp/wise/renderers/components/UploadFieldInput.js +3 -14
- package/build/revamp/wise/renderers/components/icon/NavigationOptionMedia.js +2 -13
- package/build/test-utils/NeptuneProviders.js +1 -1
- package/build/types/common/messages/multi-file-upload.messages.d.ts +9 -9
- package/build/types/legacy/common/utils/mobile-utils.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.d.ts +6 -6
- package/build/types/legacy/layout/external/DynamicExternal.messages.d.ts +3 -3
- package/build/types/revamp/domain/components/MultiUploadInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/UploadInputComponent.d.ts +1 -1
- package/package.json +3 -3
|
@@ -63,12 +63,12 @@ function DynamicImage(_a) {
|
|
|
63
63
|
alt: accessibilityDescription || text || '',
|
|
64
64
|
src: imageSource,
|
|
65
65
|
stretch: true,
|
|
66
|
-
shrink: true
|
|
66
|
+
shrink: true,
|
|
67
67
|
};
|
|
68
68
|
if (!imageSource) {
|
|
69
69
|
return null;
|
|
70
70
|
}
|
|
71
|
-
return (_jsx("div",
|
|
71
|
+
return (_jsx("div", { className: "df-image ".concat(size || 'md'), children: _jsx(Image, __assign({ className: "img-responsive ".concat(getMargin(margin || 'md')) }, imageProps)) }));
|
|
72
72
|
}
|
|
73
73
|
var readImageBlobAsDataURL = function (imageBlob) {
|
|
74
74
|
// we can safely assume the type of reader.result is string
|
|
@@ -90,7 +90,7 @@ var getImageSource = function (httpClient, imageUrl) { return __awaiter(void 0,
|
|
|
90
90
|
return [2 /*return*/, httpClient(imageUrl, {
|
|
91
91
|
method: 'GET',
|
|
92
92
|
headers: { 'Content-Type': 'image/image' },
|
|
93
|
-
credentials: 'same-origin'
|
|
93
|
+
credentials: 'same-origin',
|
|
94
94
|
})
|
|
95
95
|
.then(function (response) {
|
|
96
96
|
if (response.ok) {
|
|
@@ -98,7 +98,8 @@ var getImageSource = function (httpClient, imageUrl) { return __awaiter(void 0,
|
|
|
98
98
|
}
|
|
99
99
|
throw new Error('Image fetching failed');
|
|
100
100
|
})
|
|
101
|
-
.then(readImageBlobAsDataURL)
|
|
101
|
+
.then(readImageBlobAsDataURL)
|
|
102
|
+
.catch(function () { return imageUrl; })];
|
|
102
103
|
}
|
|
103
104
|
return [2 /*return*/, imageUrl];
|
|
104
105
|
}
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
2
|
import { Header, InstructionsList } from '@transferwise/components';
|
|
14
3
|
import { getMargin } from '../utils';
|
|
@@ -25,6 +14,6 @@ var DynamicInstructions = function (_a) {
|
|
|
25
14
|
var text = _a.text;
|
|
26
15
|
return text;
|
|
27
16
|
});
|
|
28
|
-
return (_jsxs("div",
|
|
17
|
+
return (_jsxs("div", { className: getMargin(component.margin || 'md'), children: [component.title ? _jsx(Header, { title: component.title }) : null, _jsx(InstructionsList, { dos: dos, donts: donts })] }));
|
|
29
18
|
};
|
|
30
19
|
export default DynamicInstructions;
|
|
@@ -16,7 +16,7 @@ import { DynamicIcon } from '..';
|
|
|
16
16
|
import { getMargin } from '../utils';
|
|
17
17
|
var DynamicStatusList = function (_a) {
|
|
18
18
|
var component = _a.component;
|
|
19
|
-
return (_jsxs("div",
|
|
19
|
+
return (_jsxs("div", { className: getMargin(component.margin || 'md'), children: [component.title ? _jsx(Header, { title: component.title }) : null, component.items.map(mapListItemToSummary)] }));
|
|
20
20
|
};
|
|
21
21
|
var mapListItemToSummary = function (_a) {
|
|
22
22
|
var title = _a.title, description = _a.description, icon = _a.icon, status = _a.status;
|
|
@@ -26,12 +26,12 @@ var mapListItemToSummary = function (_a) {
|
|
|
26
26
|
var statusListMap = {
|
|
27
27
|
done: 'done',
|
|
28
28
|
pending: 'pending',
|
|
29
|
-
'not-done': 'notDone'
|
|
29
|
+
'not-done': 'notDone',
|
|
30
30
|
};
|
|
31
31
|
var legacyStatusMap = {
|
|
32
32
|
positive: 'done',
|
|
33
33
|
warning: 'pending',
|
|
34
|
-
neutral: 'notDone'
|
|
34
|
+
neutral: 'notDone',
|
|
35
35
|
};
|
|
36
36
|
var statusMap = __assign(__assign({}, statusListMap), legacyStatusMap);
|
|
37
37
|
export default DynamicStatusList;
|
|
@@ -19,16 +19,16 @@ var onError = jest.fn();
|
|
|
19
19
|
var onCompletion = jest.fn();
|
|
20
20
|
var i18n = { locale: 'en-GB', messages: __assign({}, componentTranslations.en) };
|
|
21
21
|
var renderComponent = function (step) {
|
|
22
|
-
render(_jsx(Provider,
|
|
22
|
+
render(_jsx(Provider, { i18n: i18n, children: _jsx(DynamicFlow, { flowId: "test", initialStep: step, httpClient: mockHttpClient, onCompletion: onCompletion, onError: onError }) }));
|
|
23
23
|
};
|
|
24
24
|
var makeStatusListStep = function (items) {
|
|
25
25
|
return ({
|
|
26
|
-
layout: [{ type: 'status-list', title: 'This is a status List', items: items }]
|
|
26
|
+
layout: [{ type: 'status-list', title: 'This is a status List', items: items }],
|
|
27
27
|
});
|
|
28
28
|
};
|
|
29
29
|
var makeListStep = function (items) {
|
|
30
30
|
return ({
|
|
31
|
-
layout: [{ type: 'list', title: 'This is a List', items: items }]
|
|
31
|
+
layout: [{ type: 'list', title: 'This is a List', items: items }],
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
34
|
describe('DynamicStatusList', function () {
|
|
@@ -38,19 +38,19 @@ describe('DynamicStatusList', function () {
|
|
|
38
38
|
title: 'Item 1',
|
|
39
39
|
description: 'The first item is positive',
|
|
40
40
|
icon: { name: 'bank' },
|
|
41
|
-
status: 'done'
|
|
41
|
+
status: 'done',
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
44
|
title: 'Item 2',
|
|
45
45
|
description: 'The second item is neutral',
|
|
46
46
|
icon: { name: 'emoji' },
|
|
47
|
-
status: 'not-done'
|
|
47
|
+
status: 'not-done',
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
title: 'Item 3',
|
|
51
51
|
description: 'The third item is warning',
|
|
52
52
|
icon: { name: 'gift-box' },
|
|
53
|
-
status: 'pending'
|
|
53
|
+
status: 'pending',
|
|
54
54
|
},
|
|
55
55
|
];
|
|
56
56
|
it('renders the list title', function () {
|
|
@@ -76,19 +76,19 @@ describe('DynamicStatusList', function () {
|
|
|
76
76
|
title: 'Item 1',
|
|
77
77
|
description: 'The first item is positive',
|
|
78
78
|
icon: { name: 'bank' },
|
|
79
|
-
status: 'positive'
|
|
79
|
+
status: 'positive',
|
|
80
80
|
},
|
|
81
81
|
{
|
|
82
82
|
title: 'Item 2',
|
|
83
83
|
description: 'The second item is neutral',
|
|
84
84
|
icon: { name: 'emoji' },
|
|
85
|
-
status: 'neutral'
|
|
85
|
+
status: 'neutral',
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
title: 'Item 3',
|
|
89
89
|
description: 'The third item is warning',
|
|
90
90
|
icon: { name: 'gift-box' },
|
|
91
|
-
status: 'warning'
|
|
91
|
+
status: 'warning',
|
|
92
92
|
},
|
|
93
93
|
];
|
|
94
94
|
it('renders the list title', function () {
|
|
@@ -5,7 +5,7 @@ var DynamicLoadingIndicator = function (_a) {
|
|
|
5
5
|
var component = _a.component;
|
|
6
6
|
var _b = component.margin, margin = _b === void 0 ? 'md' : _b, _c = component.size, size = _c === void 0 ? 'md' : _c;
|
|
7
7
|
return (_jsx(Loader, { size: size, classNames: {
|
|
8
|
-
'tw-loader': "tw-loader m-x-auto ".concat(getMargin(margin))
|
|
8
|
+
'tw-loader': "tw-loader m-x-auto ".concat(getMargin(margin)),
|
|
9
9
|
}, "data-testid": "loading-indicator" }));
|
|
10
10
|
};
|
|
11
11
|
export default DynamicLoadingIndicator;
|
|
@@ -1,23 +1,12 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
2
|
import { Markdown } from '@transferwise/components';
|
|
14
3
|
import { getTextAlignmentAndMargin } from '../utils';
|
|
15
4
|
export var DynamicMarkdown = function (_a) {
|
|
16
5
|
var component = _a.component;
|
|
17
6
|
var content = component.content, align = component.align, margin = component.margin;
|
|
18
|
-
return (_jsx("div",
|
|
7
|
+
return (_jsx("div", { className: getTextAlignmentAndMargin({ align: align, margin: margin }), children: _jsx(Markdown, { config: { link: { target: '_blank' } }, children: content }) }));
|
|
19
8
|
};
|
|
20
9
|
export var DynamicInfo = function (_a) {
|
|
21
10
|
var component = _a.component;
|
|
22
|
-
return (_jsx("div",
|
|
11
|
+
return (_jsx("div", { className: getTextAlignmentAndMargin(component), children: _jsx(Markdown, { config: { link: { target: '_blank' } }, children: component.markdown }) }));
|
|
23
12
|
};
|
|
@@ -16,8 +16,8 @@ describe('Given a component for dynamically rendering information with markdown'
|
|
|
16
16
|
var props = function () { return ({
|
|
17
17
|
component: {
|
|
18
18
|
type: 'info',
|
|
19
|
-
markdown: '### Title ###\n[first link](./first-link)'
|
|
20
|
-
}
|
|
19
|
+
markdown: '### Title ###\n[first link](./first-link)',
|
|
20
|
+
},
|
|
21
21
|
}); };
|
|
22
22
|
it('should render the markdown as HTML', function () {
|
|
23
23
|
render(_jsx(DynamicInfo, __assign({}, props())));
|
|
@@ -38,8 +38,8 @@ describe('Given a "markdown" component', function () {
|
|
|
38
38
|
var props = function () { return ({
|
|
39
39
|
component: {
|
|
40
40
|
type: 'markdown',
|
|
41
|
-
content: '### Title ###\n[first link](./first-link)'
|
|
42
|
-
}
|
|
41
|
+
content: '### Title ###\n[first link](./first-link)',
|
|
42
|
+
},
|
|
43
43
|
}); };
|
|
44
44
|
it('should render the markdown as HTML', function () {
|
|
45
45
|
render(_jsx(DynamicMarkdown, __assign({}, props())));
|
|
@@ -18,9 +18,9 @@ function DynamicModal(props) {
|
|
|
18
18
|
var _a = useState(false), visible = _a[0], isVisible = _a[1];
|
|
19
19
|
var component = props.component, onAction = props.onAction;
|
|
20
20
|
var _b = component.margin, margin = _b === void 0 ? 'md' : _b;
|
|
21
|
-
return (_jsxs("div",
|
|
21
|
+
return (_jsxs("div", { className: getTextAlignmentAndMargin({ margin: margin }), children: [_jsx(Button, { priority: "tertiary", block: true, onClick: function () { return isVisible(true); }, children: component.trigger.title }), _jsx(Modal, { scroll: "content", open: visible, size: "lg", body: _jsx(DynamicLayout, __assign({}, props, { components: component.content.components, onAction: function (action) {
|
|
22
22
|
isVisible(false);
|
|
23
23
|
onAction(action);
|
|
24
|
-
} })), onClose: function () { return isVisible(false); } })] }))
|
|
24
|
+
} })), onClose: function () { return isVisible(false); } })] }));
|
|
25
25
|
}
|
|
26
26
|
export default DynamicModal;
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
2
|
import { Button } from '@transferwise/components';
|
|
14
3
|
import { useIntl } from 'react-intl';
|
|
@@ -21,7 +10,7 @@ function DynamicParagraph(_a) {
|
|
|
21
10
|
}
|
|
22
11
|
function BasicDynamicParagraph(_a) {
|
|
23
12
|
var component = _a.component;
|
|
24
|
-
return _jsxs("p",
|
|
13
|
+
return _jsxs("p", { className: getTextAlignmentAndMargin(component), children: [" ", component.text, " "] });
|
|
25
14
|
}
|
|
26
15
|
function CopyableDynamicParagraph(_a) {
|
|
27
16
|
var component = _a.component;
|
|
@@ -30,15 +19,15 @@ function CopyableDynamicParagraph(_a) {
|
|
|
30
19
|
var text = component.text;
|
|
31
20
|
var copy = function () {
|
|
32
21
|
var _a;
|
|
33
|
-
(_a = navigator.clipboard) === null || _a === void 0 ? void 0 : _a.writeText(text).then(function () { return createSnackbar({ text: formatMessage(messages.copied) }); })
|
|
22
|
+
(_a = navigator.clipboard) === null || _a === void 0 ? void 0 : _a.writeText(text).then(function () { return createSnackbar({ text: formatMessage(messages.copied) }); }).catch(noop);
|
|
34
23
|
};
|
|
35
24
|
var classNames = "".concat(getTextAlignmentAndMargin({
|
|
36
25
|
align: component.align,
|
|
37
|
-
margin: 'sm'
|
|
26
|
+
margin: 'sm',
|
|
38
27
|
}), " form-control");
|
|
39
|
-
return (_jsxs("div",
|
|
28
|
+
return (_jsxs("div", { className: getTextAlignmentAndMargin(component), children: [_jsx("input", { type: "text", className: classNames, value: text, readOnly: true,
|
|
40
29
|
// eslint-disable-next-line react/forbid-dom-props
|
|
41
|
-
style: { textOverflow: 'ellipsis' } }), _jsx(Button,
|
|
30
|
+
style: { textOverflow: 'ellipsis' } }), _jsx(Button, { block: true, onClick: copy, children: formatMessage(messages.copy) })] }));
|
|
42
31
|
}
|
|
43
32
|
function noop() {
|
|
44
33
|
//
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
2
|
import { DefinitionList, Header } from '@transferwise/components';
|
|
14
3
|
import Help from '../../jsonSchemaForm/help/Help';
|
|
@@ -19,7 +8,7 @@ var getDefinitions = function (orientation, review) {
|
|
|
19
8
|
return ({
|
|
20
9
|
key: String(index),
|
|
21
10
|
title: label,
|
|
22
|
-
value: getFieldValue(value, help, orientation)
|
|
11
|
+
value: getFieldValue(value, help, orientation),
|
|
23
12
|
});
|
|
24
13
|
});
|
|
25
14
|
};
|
|
@@ -44,7 +33,7 @@ function DynamicReview(props) {
|
|
|
44
33
|
if (action) {
|
|
45
34
|
props.onAction(action);
|
|
46
35
|
}
|
|
47
|
-
}
|
|
36
|
+
},
|
|
48
37
|
}); };
|
|
49
38
|
var orientation = getReviewLayout(review);
|
|
50
39
|
var callToAction = review.callToAction
|
|
@@ -53,6 +42,6 @@ function DynamicReview(props) {
|
|
|
53
42
|
var legacyCallToAction = !callToAction && review.action
|
|
54
43
|
? getReviewAction(review.action.title || '', review.action)
|
|
55
44
|
: null;
|
|
56
|
-
return (_jsxs("div",
|
|
45
|
+
return (_jsxs("div", { className: margin, children: [review.title && (_jsx(Header, { title: review.title, action: callToAction || legacyCallToAction || undefined })), _jsx("div", { className: margin, children: _jsx(DefinitionList, { layout: orientation, definitions: getDefinitions(orientation, review) }) })] }));
|
|
57
46
|
}
|
|
58
47
|
export default DynamicReview;
|
|
@@ -58,17 +58,17 @@ describe('Given a component for dynamically rendering reviews', function () {
|
|
|
58
58
|
fields: [
|
|
59
59
|
{
|
|
60
60
|
label: 'First Field Label',
|
|
61
|
-
value: 'First Field Value'
|
|
61
|
+
value: 'First Field Value',
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
64
|
label: 'Second Field Label',
|
|
65
65
|
value: 'Second Field Value',
|
|
66
66
|
help: {
|
|
67
|
-
markdown: '# This is a help title \n This is a help description'
|
|
68
|
-
}
|
|
67
|
+
markdown: '# This is a help title \n This is a help description',
|
|
68
|
+
},
|
|
69
69
|
},
|
|
70
70
|
],
|
|
71
|
-
margin: 'md'
|
|
71
|
+
margin: 'md',
|
|
72
72
|
}); };
|
|
73
73
|
it('should render the title and fields', function () {
|
|
74
74
|
renderWithProviders(_jsx(DynamicReview, { component: getComponent(), onAction: jest.fn() }));
|
|
@@ -81,7 +81,7 @@ describe('Given a component for dynamically rendering reviews', function () {
|
|
|
81
81
|
describe('when a callToAction is provided and its title clicked', function () {
|
|
82
82
|
var component = __assign(__assign({}, getComponent()), { callToAction: {
|
|
83
83
|
title: 'Call To Action Title',
|
|
84
|
-
action: { url: '/action-url' }
|
|
84
|
+
action: { url: '/action-url' },
|
|
85
85
|
} });
|
|
86
86
|
it('should call onAction callback with the action object', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
87
87
|
var onAction;
|
|
@@ -120,7 +120,7 @@ describe('Given a component for dynamically rendering reviews', function () {
|
|
|
120
120
|
describe('when both callToAction and action are provided', function () {
|
|
121
121
|
var component = __assign(__assign({}, getComponent()), { callToAction: {
|
|
122
122
|
title: 'Call To Action Title',
|
|
123
|
-
action: { url: '/action-url' }
|
|
123
|
+
action: { url: '/action-url' },
|
|
124
124
|
}, action: { title: 'Legacy Action Title', url: '/action-url' } });
|
|
125
125
|
it('prefers callToAction over action', function () {
|
|
126
126
|
var onAction = jest.fn();
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
2
|
import { useMemo, useState } from 'react';
|
|
14
3
|
import { useEventDispatcher } from '../../common/contexts';
|
|
@@ -38,7 +27,7 @@ function DynamicSearch(_a) {
|
|
|
38
27
|
if (type === 'action') {
|
|
39
28
|
onEvent('Dynamic Flow - Search Result Selected', {
|
|
40
29
|
type: 'action',
|
|
41
|
-
actionId: value.id || value.$id
|
|
30
|
+
actionId: value.id || value.$id,
|
|
42
31
|
});
|
|
43
32
|
onAction(value);
|
|
44
33
|
}
|
|
@@ -53,6 +42,6 @@ function DynamicSearch(_a) {
|
|
|
53
42
|
setQuery(query);
|
|
54
43
|
void search(query);
|
|
55
44
|
};
|
|
56
|
-
return (_jsxs("div",
|
|
45
|
+
return (_jsxs("div", { className: getMargin(margin || 'md'), children: [_jsx(SearchInput, { title: title, value: query, onChange: onChange, onFocus: onSearchStart }), status === 'loading' && (_jsx(DynamicLoadingIndicator, { component: { type: 'loading-indicator', size: 'sm' } })), status === 'error' && _jsx(ErrorResult, { onRetrySearch: onRetrySearch }), status === 'success' && (_jsx(SearchResults, { results: results, emptyMessage: emptyMessage, onSelect: onResultSelected }))] }));
|
|
57
46
|
}
|
|
58
47
|
export default DynamicSearch;
|
|
@@ -1,17 +1,6 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
2
|
import { Input } from '@transferwise/components';
|
|
14
3
|
export var SearchInput = function (_a) {
|
|
15
4
|
var title = _a.title, value = _a.value, onFocus = _a.onFocus, onChange = _a.onChange;
|
|
16
|
-
return (_jsxs("label",
|
|
5
|
+
return (_jsxs("label", { className: "control-label d-inline", children: [title, _jsx(Input, { type: "text", value: value, className: "m-t-1", onFocus: onFocus, onChange: function (event) { return onChange(event.currentTarget.value); } })] }));
|
|
17
6
|
};
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
2
|
import { NavigationOption, NavigationOptionsList } from '@transferwise/components';
|
|
14
3
|
import { useIntl } from 'react-intl';
|
|
@@ -17,15 +6,15 @@ import { getNavigationOptionMedia } from '../utils';
|
|
|
17
6
|
export function SearchResults(_a) {
|
|
18
7
|
var results = _a.results, emptyMessage = _a.emptyMessage, onSelect = _a.onSelect;
|
|
19
8
|
if (results.length === 0) {
|
|
20
|
-
return _jsx("p",
|
|
9
|
+
return _jsx("p", { className: "m-t-2", children: emptyMessage });
|
|
21
10
|
}
|
|
22
11
|
return (_jsx(NavigationOptionsList, { children: results.map(function (result) { return (_jsx(NavigationOption, { title: result.title, content: result.description, media: getNavigationOptionMedia(result), showMediaCircle: false, showMediaAtAllSizes: true, onClick: function () { return onSelect(result); } }, JSON.stringify(result))); }) }));
|
|
23
12
|
}
|
|
24
13
|
export function ErrorResult(_a) {
|
|
25
14
|
var onRetrySearch = _a.onRetrySearch;
|
|
26
15
|
var intl = useIntl();
|
|
27
|
-
return (_jsxs("p",
|
|
16
|
+
return (_jsxs("p", { className: "m-t-2", children: [intl.formatMessage(messages.genericError), "\u00A0", _jsx("a", { href: "/", onClick: function (e) {
|
|
28
17
|
e.preventDefault();
|
|
29
18
|
onRetrySearch();
|
|
30
|
-
}
|
|
19
|
+
}, children: intl.formatMessage(messages.retry) })] }));
|
|
31
20
|
}
|
|
@@ -40,7 +40,7 @@ import { useHttpClient } from '../../../common/httpClientContext';
|
|
|
40
40
|
var headers = { 'Content-Type': 'application/json' };
|
|
41
41
|
export var useSearch = function (defaultSearchConfig) {
|
|
42
42
|
var _a = useState({
|
|
43
|
-
status: 'idle'
|
|
43
|
+
status: 'idle',
|
|
44
44
|
}), state = _a[0], setState = _a[1];
|
|
45
45
|
var abortControllerRef = useRef(null);
|
|
46
46
|
var httpClient = useHttpClient();
|
|
@@ -68,13 +68,13 @@ export var useSearch = function (defaultSearchConfig) {
|
|
|
68
68
|
? httpClient(addQueryParameter(url, param, query), {
|
|
69
69
|
method: method,
|
|
70
70
|
signal: signal,
|
|
71
|
-
headers: headers
|
|
71
|
+
headers: headers,
|
|
72
72
|
})
|
|
73
73
|
: httpClient(url, {
|
|
74
74
|
method: method,
|
|
75
75
|
signal: signal,
|
|
76
76
|
headers: headers,
|
|
77
|
-
body: JSON.stringify((_c = {}, _c[param] = query, _c))
|
|
77
|
+
body: JSON.stringify((_c = {}, _c[param] = query, _c)),
|
|
78
78
|
});
|
|
79
79
|
return [4 /*yield*/, request];
|
|
80
80
|
case 2:
|
|
@@ -98,7 +98,7 @@ export var useSearch = function (defaultSearchConfig) {
|
|
|
98
98
|
switch (_a.label) {
|
|
99
99
|
case 0:
|
|
100
100
|
if (!response.ok) return [3 /*break*/, 2];
|
|
101
|
-
return [4 /*yield*/, response.json()
|
|
101
|
+
return [4 /*yield*/, response.json().catch(function () { return null; })];
|
|
102
102
|
case 1:
|
|
103
103
|
body = _a.sent();
|
|
104
104
|
if (isValidResponseBody(body)) {
|
|
@@ -1,24 +1,13 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
2
|
import { Avatar, AvatarType } from '@transferwise/components';
|
|
14
3
|
import DynamicIcon from '../icon/DynamicIcon';
|
|
15
4
|
export var getNavigationOptionMedia = function (_a) {
|
|
16
5
|
var icon = _a.icon, image = _a.image;
|
|
17
6
|
if (icon === null || icon === void 0 ? void 0 : icon.name) {
|
|
18
|
-
return (_jsx(Avatar,
|
|
7
|
+
return (_jsx(Avatar, { type: AvatarType.ICON, children: _jsx(DynamicIcon, { type: icon.name }) }));
|
|
19
8
|
}
|
|
20
9
|
if (icon === null || icon === void 0 ? void 0 : icon.text) {
|
|
21
|
-
return _jsx(Avatar,
|
|
10
|
+
return _jsx(Avatar, { type: AvatarType.INITIALS, children: icon.text });
|
|
22
11
|
}
|
|
23
12
|
if (image === null || image === void 0 ? void 0 : image.url) {
|
|
24
13
|
var url = image.url, text = image.text;
|
|
@@ -109,7 +109,7 @@ function CameraCapture(_a) {
|
|
|
109
109
|
title: intl.formatMessage(messages.noCameraAccessTitle),
|
|
110
110
|
description: intl.formatMessage(messages.noCameraAccessParagraph),
|
|
111
111
|
actionButton: intl.formatMessage(messages.noCameraAccessAction),
|
|
112
|
-
onAction: handleRetryCameraAccess
|
|
112
|
+
onAction: handleRetryCameraAccess,
|
|
113
113
|
});
|
|
114
114
|
trackCameraError('Dynamic Flow - Camera Permission Denied', onEvent, error);
|
|
115
115
|
return;
|
|
@@ -121,7 +121,7 @@ function CameraCapture(_a) {
|
|
|
121
121
|
title: intl.formatMessage(messages.cameraConnectionIssueTitle),
|
|
122
122
|
description: intl.formatMessage(messages.cameraConnectionIssueParagraph),
|
|
123
123
|
actionButton: intl.formatMessage(messages.cameraConnectionIssueAction),
|
|
124
|
-
onAction: handleRetryCameraAccess
|
|
124
|
+
onAction: handleRetryCameraAccess,
|
|
125
125
|
});
|
|
126
126
|
trackCameraError('Dynamic Flow - Camera Not Accessible', onEvent, error);
|
|
127
127
|
return;
|
|
@@ -129,7 +129,7 @@ function CameraCapture(_a) {
|
|
|
129
129
|
}
|
|
130
130
|
setCameraError({
|
|
131
131
|
title: intl.formatMessage(messages.cameraNotSupportedTitle),
|
|
132
|
-
description: intl.formatMessage(messages.cameraNotSupportedParagraph)
|
|
132
|
+
description: intl.formatMessage(messages.cameraNotSupportedParagraph),
|
|
133
133
|
});
|
|
134
134
|
trackCameraError('Dynamic Flow - Camera Not Supported', onEvent, error);
|
|
135
135
|
}, [intl, onEvent]);
|
|
@@ -152,10 +152,10 @@ function CameraCapture(_a) {
|
|
|
152
152
|
exitFullScreen();
|
|
153
153
|
}
|
|
154
154
|
}, [mode, exitFullScreen]);
|
|
155
|
-
var captureScreen = (_jsxs("div",
|
|
155
|
+
var captureScreen = (_jsxs("div", { className: "camera-capture", children: [videoConstraints && (_jsx(Webcam, { ref: webcamReference, audio: false, videoConstraints: videoConstraints, mirrored: isVideoMirrored, onUserMediaError: handleUserMediaError, onUserMedia: handleUserMedia })), _jsx(Overlay, { overlay: overlay, outline: outline, imageUrl: imageUrl, title: title, instructions: instructions }), shouldLockOrientation && _jsx(OrientationLockOverlay, {}), ready && (_jsx(CaptureBottomBar, { onCapture: function () {
|
|
156
156
|
void handleCapture();
|
|
157
|
-
} }))] }))
|
|
158
|
-
var reviewScreen = (_jsxs("div",
|
|
157
|
+
} }))] }));
|
|
158
|
+
var reviewScreen = (_jsxs("div", { className: "camera-capture", children: [_jsx("img", { className: "review-image", src: reviewImage === null || reviewImage === void 0 ? void 0 : reviewImage.source, alt: "" }), _jsx(Overlay, { overlay: overlay, imageUrl: imageUrl, title: title, instructions: instructions, reviewInstructions: intl.formatMessage(messages.reviewInstructions) }), _jsx(ReviewBottomBar, { onSubmit: handleReviewSubmit, onRetry: handleReviewRetry })] }));
|
|
159
159
|
return (_jsxs("section", { children: [mode === CameraMode.CAPTURE && captureScreen, mode === CameraMode.REVIEW && reviewScreen, mode === CameraMode.ERROR && cameraError && _jsx(CameraErrorScreen, __assign({}, cameraError))] }));
|
|
160
160
|
}
|
|
161
161
|
export default CameraCapture;
|
|
@@ -3,56 +3,56 @@ export default defineMessages({
|
|
|
3
3
|
reviewSubmit: {
|
|
4
4
|
id: 'dynamicFlows.CameraCapture.reviewSubmit',
|
|
5
5
|
defaultMessage: 'Yes, submit',
|
|
6
|
-
description: 'Accept and submit the image taken with the camera'
|
|
6
|
+
description: 'Accept and submit the image taken with the camera',
|
|
7
7
|
},
|
|
8
8
|
reviewRetry: {
|
|
9
9
|
id: 'dynamicFlows.CameraCapture.reviewRetry',
|
|
10
10
|
defaultMessage: 'No, try again',
|
|
11
|
-
description: "Image taken with camera is not good, don't submit, and retake the image"
|
|
11
|
+
description: "Image taken with camera is not good, don't submit, and retake the image",
|
|
12
12
|
},
|
|
13
13
|
reviewInstructions: {
|
|
14
14
|
id: 'dynamicFlows.CameraCapture.reviewInstructions',
|
|
15
15
|
defaultMessage: 'Is your picture clear, readable and complete?',
|
|
16
|
-
description: 'After taking an image with the camera, prompt user to review the image'
|
|
16
|
+
description: 'After taking an image with the camera, prompt user to review the image',
|
|
17
17
|
},
|
|
18
18
|
cameraNotSupportedTitle: {
|
|
19
19
|
id: 'dynamicFlows.CameraCapture.CameraNotSupported.title',
|
|
20
20
|
defaultMessage: 'Camera not supported',
|
|
21
|
-
description: 'Title of standalone page prompting that camera is not available on users browser'
|
|
21
|
+
description: 'Title of standalone page prompting that camera is not available on users browser',
|
|
22
22
|
},
|
|
23
23
|
cameraNotSupportedParagraph: {
|
|
24
24
|
id: 'dynamicFlows.CameraCapture.CameraNotSupported.paragraph',
|
|
25
25
|
defaultMessage: "The browser you're using doesn't have support for a camera. Try a different browser, device, or download our mobile app.",
|
|
26
|
-
description: "Further text of standalone page prompting that camera is not available on user's browser"
|
|
26
|
+
description: "Further text of standalone page prompting that camera is not available on user's browser",
|
|
27
27
|
},
|
|
28
28
|
noCameraAccessTitle: {
|
|
29
29
|
id: 'dynamicFlows.CameraCapture.NoCameraAccess.title',
|
|
30
30
|
defaultMessage: "We can't access your camera",
|
|
31
|
-
description: 'Title of standalone page prompting missing camera permissions'
|
|
31
|
+
description: 'Title of standalone page prompting missing camera permissions',
|
|
32
32
|
},
|
|
33
33
|
noCameraAccessParagraph: {
|
|
34
34
|
id: 'dynamicFlows.CameraCapture.NoCameraAccess.paragraph',
|
|
35
35
|
defaultMessage: "Enable camera access in your browser's settings to get going again.",
|
|
36
|
-
description: 'Further text of standalone page prompting missing camera permissions'
|
|
36
|
+
description: 'Further text of standalone page prompting missing camera permissions',
|
|
37
37
|
},
|
|
38
38
|
noCameraAccessAction: {
|
|
39
39
|
id: 'dynamicFlows.CameraCapture.NoCameraAccess.action',
|
|
40
40
|
defaultMessage: 'Enable camera access',
|
|
41
|
-
description: 'Action to ask for camera permissions again'
|
|
41
|
+
description: 'Action to ask for camera permissions again',
|
|
42
42
|
},
|
|
43
43
|
cameraConnectionIssueTitle: {
|
|
44
44
|
id: 'dynamicFlows.CameraCapture.CameraConnectionIssue.title',
|
|
45
45
|
defaultMessage: "We can't access your camera",
|
|
46
|
-
description: 'Title of standalone page prompting that there was an issue connecting to a camera'
|
|
46
|
+
description: 'Title of standalone page prompting that there was an issue connecting to a camera',
|
|
47
47
|
},
|
|
48
48
|
cameraConnectionIssueParagraph: {
|
|
49
49
|
id: 'dynamicFlows.CameraCapture.CameraConnectionIssue.paragraph',
|
|
50
50
|
defaultMessage: "Please check if it is connected and try again.",
|
|
51
|
-
description: 'Further text of standalone page prompting that there was an issue connecting to a camera'
|
|
51
|
+
description: 'Further text of standalone page prompting that there was an issue connecting to a camera',
|
|
52
52
|
},
|
|
53
53
|
cameraConnectionIssueAction: {
|
|
54
54
|
id: 'dynamicFlows.CameraCapture.CameraConnectionIssue.action',
|
|
55
55
|
defaultMessage: 'Try again',
|
|
56
|
-
description: 'Action to try using camera again'
|
|
57
|
-
}
|
|
56
|
+
description: 'Action to try using camera again',
|
|
57
|
+
},
|
|
58
58
|
});
|