@wise/dynamic-flow-client 0.4.0-beta-d2067b.7 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/common/constants/DateMode.js +7 -0
- package/build/common/constants/FormControlType.js +20 -0
- package/build/common/constants/MonthFormat.js +7 -0
- package/build/common/constants/SchemaType.js +14 -0
- package/build/common/constants/Size.js +10 -0
- package/build/common/constants/index.js +21 -0
- package/build/common/contexts/dynamicFlowContexts/DynamicFlowContexts.js +41 -0
- package/build/common/contexts/dynamicFlowContexts/usePendingPromiseCounter.js +17 -0
- package/build/common/contexts/eventsContext/EventsContext.js +39 -0
- package/build/common/contexts/fetcherContexts/FetcherContexts.js +42 -0
- package/build/common/contexts/index.js +20 -0
- package/build/common/contexts/logContext/LogContext.js +45 -0
- package/build/common/hooks/index.js +23 -0
- package/build/common/hooks/useDebouncedFunction/useDebouncedFunction.js +13 -0
- package/build/common/hooks/useExternal/useExternal.js +19 -0
- package/build/common/hooks/useExternalStepPolling/useExternalStepPolling.js +73 -0
- package/build/common/hooks/usePersistAsync/usePersistAsync.js +177 -0
- package/build/common/hooks/usePolling/usePolling.js +53 -0
- package/build/common/hooks/usePrevious/usePrevious.js +12 -0
- package/build/common/hooks/useStepPolling/useStepPolling.js +48 -0
- package/build/common/makeFetcher/index.js +17 -0
- package/build/common/makeFetcher/makeFetcher.js +37 -0
- package/build/common/messages.js +10 -0
- package/build/common/utils/api-utils.js +20 -0
- package/build/common/utils/date-utils.js +27 -0
- package/build/common/utils/debounce.js +42 -0
- package/build/common/utils/file-utils.js +51 -0
- package/build/common/utils/id-utils.js +9 -0
- package/build/common/utils/index.js +24 -0
- package/build/common/utils/is-equal.js +25 -0
- package/build/common/utils/schema-utils.js +55 -0
- package/build/common/utils/step-utils.js +47 -0
- package/build/common/validators/index.js +28 -0
- package/build/common/validators/models/model-validators.js +69 -0
- package/build/common/validators/models/models.utils.js +130 -0
- package/build/common/validators/schemas/schema-validators.js +101 -0
- package/build/common/validators/types/type-validators.js +25 -0
- package/build/common/validators/validationFailures/validation-failures.js +151 -0
- package/build/common/validators/validationFailures/validation-failures.utils.js +51 -0
- package/build/common/validators/values/value-validators.js +9 -0
- package/build/dynamicFlow/DynamicFlow.js +372 -0
- package/build/dynamicFlow/DynamicFlowStep.js +36 -0
- package/build/dynamicFlow/DynamicFlowTypes.js +8 -0
- package/build/dynamicFlow/index.js +16 -0
- package/build/dynamicFlow/stories/DynamicFlow.story.js +36 -0
- package/build/dynamicFlow/stories/EditableDynamicFlow.js +67 -0
- package/build/dynamicFlow/stories/fixtureFetcher.js +118 -0
- package/build/dynamicFlow/utils/errorBoundary/ErrorBoundary.js +47 -0
- package/build/dynamicFlow/utils/errorBoundary/ErrorBoundary.messages.js +15 -0
- package/build/dynamicFlow/utils/errorBoundary/ErrorBoundaryAlert.js +19 -0
- package/build/dynamicFlow/utils/index.js +23 -0
- package/build/dynamicFlow/utils/responseParsers/response-parsers.js +131 -0
- package/build/dynamicFlow/utils/useDebouncedRefresh/useDebouncedRefresh.js +27 -0
- package/build/dynamicFlow/utils/useDynamicFlowState.js +114 -0
- package/build/dynamicFlow/utils/useLoader.js +26 -0
- package/build/fixtures/components/alert.js +33 -0
- package/build/fixtures/components/box.js +22 -0
- package/build/fixtures/components/button.js +67 -0
- package/build/fixtures/components/columns.js +38 -0
- package/build/fixtures/components/copyable.js +24 -0
- package/build/fixtures/components/decision.js +56 -0
- package/build/fixtures/components/heading.js +16 -0
- package/build/fixtures/components/image.js +25 -0
- package/build/fixtures/components/index.js +40 -0
- package/build/fixtures/components/info.js +19 -0
- package/build/fixtures/components/list.js +36 -0
- package/build/fixtures/components/loading-indicator.js +18 -0
- package/build/fixtures/components/paragraph.js +30 -0
- package/build/fixtures/components/review.js +62 -0
- package/build/fixtures/examples/camera-capture.js +123 -0
- package/build/fixtures/examples/index.js +24 -0
- package/build/fixtures/examples/recipient-update.js +252 -0
- package/build/fixtures/examples/recipient.js +315 -0
- package/build/fixtures/examples/single-file-upload.js +100 -0
- package/build/fixtures/examples/step-validation-errors.js +77 -0
- package/build/fixtures/features/action-response.js +31 -0
- package/build/fixtures/features/external.js +33 -0
- package/build/fixtures/features/index.js +24 -0
- package/build/fixtures/features/persist-async.js +46 -0
- package/build/fixtures/features/polling.js +35 -0
- package/build/fixtures/features/validation-async.js +40 -0
- package/build/fixtures/index.js +49 -0
- package/build/fixtures/jsonSchemaForm/allOf.js +121 -0
- package/build/fixtures/jsonSchemaForm/audRecipient.js +1106 -0
- package/build/fixtures/jsonSchemaForm/currency.js +50 -0
- package/build/fixtures/jsonSchemaForm/multipleFileUploadBase64.js +39 -0
- package/build/fixtures/jsonSchemaForm/multipleFileUploadBlob.js +38 -0
- package/build/fixtures/jsonSchemaForm/oneOf.js +121 -0
- package/build/fixtures/jsonSchemaForm/oneOfTabs.js +55 -0
- package/build/fixtures/jsonSchemaForm/promotedOneOf.js +58 -0
- package/build/fixtures/jsonSchemaForm/promotedOneOfCheckbox.js +104 -0
- package/build/fixtures/jsonSchemaForm/simple.js +50 -0
- package/build/fixtures/jsonSchemaForm/uploadPersistAsync.js +73 -0
- package/build/fixtures/jsonSchemaForm/validationAsync.js +25 -0
- package/build/fixtures/layouts/all.js +178 -0
- package/build/fixtures/layouts/final-step-layout.js +41 -0
- package/build/fixtures/layouts/index.js +26 -0
- package/build/fixtures/layouts/list.js +35 -0
- package/build/fixtures/layouts/pay-in.js +99 -0
- package/build/fixtures/layouts/review.js +162 -0
- package/build/fixtures/layouts/success.js +68 -0
- package/build/fixtures/responses/action-response-final.js +26 -0
- package/build/fixtures/responses/action.js +4 -0
- package/build/fixtures/responses/exit.js +4 -0
- package/build/fixtures/responses/index.js +22 -0
- package/build/fixtures/responses/recipient-update-final.js +26 -0
- package/build/fixtures/schemas/basic-form.js +41 -0
- package/build/fixtures/schemas/index.js +22 -0
- package/build/fixtures/schemas/number-and-integer.js +43 -0
- package/build/fixtures/schemas/one-of.js +225 -0
- package/build/fixtures/schemas/string-formats.js +64 -0
- package/build/fixtures/utils/image-util.js +22 -0
- package/build/formControl/FormControl.js +243 -0
- package/build/formControl/index.js +16 -0
- package/build/formControl/utils/index.js +17 -0
- package/build/formControl/utils/value-utils.js +116 -0
- package/build/i18n/index.js +36 -0
- package/build/index.d.ts +11 -0
- package/build/index.js +35 -0
- package/build/jsonSchemaForm/JsonSchemaForm.js +34 -0
- package/build/jsonSchemaForm/allOfSchema/AllOfSchema.js +59 -0
- package/build/jsonSchemaForm/allOfSchema/index.js +16 -0
- package/build/jsonSchemaForm/arrayTypeSchema/ArraySchema.js +30 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.js +31 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/index.js +16 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.js +145 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.messages.js +20 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/index.js +16 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/index.js +18 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/upload-utils.js +90 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/useFormattedDefaultErrorMessages.js +21 -0
- package/build/jsonSchemaForm/arrayTypeSchema/index.js +16 -0
- package/build/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.js +108 -0
- package/build/jsonSchemaForm/basicTypeSchema/index.js +16 -0
- package/build/jsonSchemaForm/controlFeedback/ControlFeedback.js +84 -0
- package/build/jsonSchemaForm/controlFeedback/ControlFeedback.messages.js +55 -0
- package/build/jsonSchemaForm/controlFeedback/index.js +16 -0
- package/build/jsonSchemaForm/genericSchema/GenericSchema.js +127 -0
- package/build/jsonSchemaForm/genericSchema/index.js +16 -0
- package/build/jsonSchemaForm/help/Help.js +14 -0
- package/build/jsonSchemaForm/help/Help.messages.js +10 -0
- package/build/jsonSchemaForm/help/index.js +16 -0
- package/build/jsonSchemaForm/index.js +16 -0
- package/build/jsonSchemaForm/objectSchema/ObjectSchema.js +83 -0
- package/build/jsonSchemaForm/objectSchema/index.js +16 -0
- package/build/jsonSchemaForm/oneOfSchema/OneOfSchema.js +155 -0
- package/build/jsonSchemaForm/oneOfSchema/index.js +16 -0
- package/build/jsonSchemaForm/oneOfSchema/utils/const-schema-utils.js +13 -0
- package/build/jsonSchemaForm/oneOfSchema/utils/index.js +18 -0
- package/build/jsonSchemaForm/oneOfSchema/utils/one-of-utils.js +70 -0
- package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.js +31 -0
- package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.messages.js +10 -0
- package/build/jsonSchemaForm/persistAsyncSchema/index.js +16 -0
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.js +173 -0
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/index.js +16 -0
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.js +131 -0
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.js +36 -0
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/index.js +16 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.js +77 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/index.js +16 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/promoted-one-of-utils.js +12 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.js +29 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.js +36 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.js +34 -0
- package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.js +60 -0
- package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.js +15 -0
- package/build/jsonSchemaForm/readOnlySchema/index.js +16 -0
- package/build/jsonSchemaForm/schemaFormControl/SchemaFormControl.js +111 -0
- package/build/jsonSchemaForm/schemaFormControl/index.js +16 -0
- package/build/jsonSchemaForm/schemaFormControl/utils/currency-utils.js +77 -0
- package/build/jsonSchemaForm/schemaFormControl/utils/index.js +17 -0
- package/build/jsonSchemaForm/schemaFormControl/utils/mapping-utils.js +127 -0
- package/build/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.js +151 -0
- package/build/jsonSchemaForm/validationAsyncSchema/index.js +16 -0
- package/build/layout/DynamicLayout.js +63 -0
- package/build/layout/alert/DynamicAlert.js +31 -0
- package/build/layout/box/DynamicBox.js +43 -0
- package/build/layout/button/DynamicButton.js +60 -0
- package/build/layout/columns/DynamicColumns.js +40 -0
- package/build/layout/decision/DynamicDecision.js +40 -0
- package/build/layout/divider/DynamicDivider.js +11 -0
- package/build/layout/external/DynamicExternal.js +37 -0
- package/build/layout/external/DynamicExternal.messages.js +10 -0
- package/build/layout/form/DynamicForm.js +27 -0
- package/build/layout/heading/DynamicHeading.js +33 -0
- package/build/layout/icon/DynamicIcon.js +50 -0
- package/build/layout/image/DynamicImage.js +112 -0
- package/build/layout/index.js +48 -0
- package/build/layout/info/DynamicInfo.js +21 -0
- package/build/layout/list/DynamicList.js +33 -0
- package/build/layout/loadingIndicator/DynamicLoadingIndicator.js +13 -0
- package/build/layout/paragraph/DynamicParagraph.js +48 -0
- package/build/layout/paragraph/DynamicParagraph.messages.js +15 -0
- package/build/layout/paragraph/useSnackBarIfAvailable.js +13 -0
- package/build/layout/review/DynamicReview.js +35 -0
- package/build/layout/utils.js +35 -0
- package/build/step/cameraStep/CameraStep.js +130 -0
- package/build/step/cameraStep/cameraCapture/CameraCapture.js +127 -0
- package/build/step/cameraStep/cameraCapture/CameraCapture.messages.js +20 -0
- package/build/step/cameraStep/cameraCapture/components/index.js +36 -0
- package/build/step/cameraStep/cameraCapture/hooks/index.js +84 -0
- package/build/step/cameraStep/cameraCapture/index.js +16 -0
- package/build/step/cameraStep/cameraCapture/overlay/Overlay.js +80 -0
- package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.js +24 -0
- package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.messages.js +15 -0
- package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.js +26 -0
- package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.js +20 -0
- package/build/step/cameraStep/cameraCapture/screens/index.js +18 -0
- package/build/step/cameraStep/cameraCapture/tracking/index.js +104 -0
- package/build/step/cameraStep/cameraCapture/utils/index.js +114 -0
- package/build/step/cameraStep/index.js +16 -0
- package/build/step/externalConfirmationStep/ExternalConfirmationStep.js +69 -0
- package/build/step/externalConfirmationStep/ExternalConfirmationStep.messages.js +25 -0
- package/build/step/externalConfirmationStep/index.js +16 -0
- package/build/step/index.js +20 -0
- package/build/step/layoutStep/LayoutStep.js +35 -0
- package/build/step/layoutStep/index.js +16 -0
- package/build/step/layoutStep/utils/index.js +18 -0
- package/build/step/layoutStep/utils/inline-reference-utils.js +95 -0
- package/build/step/layoutStep/utils/layout-utils.js +222 -0
- package/build/types/common/FormControl.js +2 -0
- package/build/types/index.d.ts +15 -10
- package/build/types/index.js +42 -0
- package/build/types/specification/Action.js +2 -0
- package/build/types/specification/FileUploadSchema.js +8 -0
- package/build/types/specification/LayoutComponent.js +2 -0
- package/build/types/specification/Model.js +38 -0
- package/build/types/specification/PersistAsync.js +2 -0
- package/build/types/specification/Polling.js +2 -0
- package/build/types/specification/Promotion.js +2 -0
- package/build/types/specification/Schema.js +67 -0
- package/build/types/specification/Step.js +8 -0
- package/build/types/specification/ValidationAsync.js +2 -0
- package/build/types/specification/core.js +2 -0
- package/package.json +23 -24
- package/build/main.js +0 -6980
- package/build/main.min.js +0 -10
- package/build/types/types/index.d.ts +0 -15
- /package/build/{types/common → common}/constants/DateMode.d.ts +0 -0
- /package/build/{types/common → common}/constants/FormControlType.d.ts +0 -0
- /package/build/{types/common → common}/constants/MonthFormat.d.ts +0 -0
- /package/build/{types/common → common}/constants/SchemaType.d.ts +0 -0
- /package/build/{types/common → common}/constants/Size.d.ts +0 -0
- /package/build/{types/common → common}/constants/index.d.ts +0 -0
- /package/build/{types/common → common}/contexts/dynamicFlowContexts/DynamicFlowContexts.d.ts +0 -0
- /package/build/{types/common → common}/contexts/dynamicFlowContexts/usePendingPromiseCounter.d.ts +0 -0
- /package/build/{types/common → common}/contexts/eventsContext/EventsContext.d.ts +0 -0
- /package/build/{types/common → common}/contexts/fetcherContexts/FetcherContexts.d.ts +0 -0
- /package/build/{types/common → common}/contexts/index.d.ts +0 -0
- /package/build/{types/common → common}/contexts/logContext/LogContext.d.ts +0 -0
- /package/build/{types/common → common}/hooks/index.d.ts +0 -0
- /package/build/{types/common → common}/hooks/useDebouncedFunction/useDebouncedFunction.d.ts +0 -0
- /package/build/{types/common → common}/hooks/useExternal/useExternal.d.ts +0 -0
- /package/build/{types/common → common}/hooks/useExternalStepPolling/useExternalStepPolling.d.ts +0 -0
- /package/build/{types/common → common}/hooks/usePersistAsync/usePersistAsync.d.ts +0 -0
- /package/build/{types/common → common}/hooks/usePolling/usePolling.d.ts +0 -0
- /package/build/{types/common → common}/hooks/usePrevious/usePrevious.d.ts +0 -0
- /package/build/{types/common → common}/hooks/useStepPolling/useStepPolling.d.ts +0 -0
- /package/build/{types/common → common}/makeFetcher/index.d.ts +0 -0
- /package/build/{types/common → common}/makeFetcher/makeFetcher.d.ts +0 -0
- /package/build/{types/common → common}/messages.d.ts +0 -0
- /package/build/{types/common → common}/utils/api-utils.d.ts +0 -0
- /package/build/{types/common → common}/utils/date-utils.d.ts +0 -0
- /package/build/{types/common → common}/utils/debounce.d.ts +0 -0
- /package/build/{types/common → common}/utils/file-utils.d.ts +0 -0
- /package/build/{types/common → common}/utils/id-utils.d.ts +0 -0
- /package/build/{types/common → common}/utils/index.d.ts +0 -0
- /package/build/{types/common → common}/utils/is-equal.d.ts +0 -0
- /package/build/{types/common → common}/utils/schema-utils.d.ts +0 -0
- /package/build/{types/common → common}/utils/step-utils.d.ts +0 -0
- /package/build/{types/common → common}/validators/index.d.ts +0 -0
- /package/build/{types/common → common}/validators/models/model-validators.d.ts +0 -0
- /package/build/{types/common → common}/validators/models/models.utils.d.ts +0 -0
- /package/build/{types/common → common}/validators/schemas/schema-validators.d.ts +0 -0
- /package/build/{types/common → common}/validators/types/type-validators.d.ts +0 -0
- /package/build/{types/common → common}/validators/validationFailures/validation-failures.d.ts +0 -0
- /package/build/{types/common → common}/validators/validationFailures/validation-failures.utils.d.ts +0 -0
- /package/build/{types/common → common}/validators/values/value-validators.d.ts +0 -0
- /package/build/{types/dynamicFlow → dynamicFlow}/DynamicFlow.d.ts +0 -0
- /package/build/{types/dynamicFlow → dynamicFlow}/DynamicFlowStep.d.ts +0 -0
- /package/build/{types/dynamicFlow → dynamicFlow}/DynamicFlowTypes.d.ts +0 -0
- /package/build/{types/dynamicFlow → dynamicFlow}/index.d.ts +0 -0
- /package/build/{types/dynamicFlow → dynamicFlow}/stories/DynamicFlow.story.d.ts +0 -0
- /package/build/{types/dynamicFlow → dynamicFlow}/stories/EditableDynamicFlow.d.ts +0 -0
- /package/build/{types/dynamicFlow → dynamicFlow}/stories/fixtureFetcher.d.ts +0 -0
- /package/build/{types/dynamicFlow → dynamicFlow}/utils/errorBoundary/ErrorBoundary.d.ts +0 -0
- /package/build/{types/dynamicFlow → dynamicFlow}/utils/errorBoundary/ErrorBoundary.messages.d.ts +0 -0
- /package/build/{types/dynamicFlow → dynamicFlow}/utils/errorBoundary/ErrorBoundaryAlert.d.ts +0 -0
- /package/build/{types/dynamicFlow → dynamicFlow}/utils/index.d.ts +0 -0
- /package/build/{types/dynamicFlow → dynamicFlow}/utils/responseParsers/response-parsers.d.ts +0 -0
- /package/build/{types/dynamicFlow → dynamicFlow}/utils/useDebouncedRefresh/useDebouncedRefresh.d.ts +0 -0
- /package/build/{types/dynamicFlow → dynamicFlow}/utils/useDynamicFlowState.d.ts +0 -0
- /package/build/{types/dynamicFlow → dynamicFlow}/utils/useLoader.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/components/alert.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/components/box.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/components/button.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/components/columns.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/components/copyable.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/components/decision.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/components/heading.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/components/image.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/components/index.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/components/info.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/components/list.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/components/loading-indicator.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/components/paragraph.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/components/review.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/examples/camera-capture.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/examples/index.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/examples/recipient-update.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/examples/recipient.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/examples/single-file-upload.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/examples/step-validation-errors.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/features/action-response.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/features/external.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/features/index.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/features/persist-async.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/features/polling.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/features/validation-async.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/index.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/jsonSchemaForm/allOf.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/jsonSchemaForm/audRecipient.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/jsonSchemaForm/currency.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/jsonSchemaForm/multipleFileUploadBase64.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/jsonSchemaForm/multipleFileUploadBlob.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/jsonSchemaForm/oneOf.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/jsonSchemaForm/oneOfTabs.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/jsonSchemaForm/promotedOneOf.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/jsonSchemaForm/promotedOneOfCheckbox.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/jsonSchemaForm/simple.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/jsonSchemaForm/uploadPersistAsync.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/jsonSchemaForm/validationAsync.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/layouts/all.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/layouts/final-step-layout.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/layouts/index.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/layouts/list.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/layouts/pay-in.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/layouts/review.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/layouts/success.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/responses/action-response-final.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/responses/action.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/responses/exit.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/responses/index.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/responses/recipient-update-final.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/schemas/basic-form.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/schemas/index.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/schemas/number-and-integer.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/schemas/one-of.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/schemas/string-formats.d.ts +0 -0
- /package/build/{types/fixtures → fixtures}/utils/image-util.d.ts +0 -0
- /package/build/{types/formControl → formControl}/FormControl.d.ts +0 -0
- /package/build/{types/formControl → formControl}/index.d.ts +0 -0
- /package/build/{types/formControl → formControl}/utils/index.d.ts +0 -0
- /package/build/{types/formControl → formControl}/utils/value-utils.d.ts +0 -0
- /package/build/{types/i18n → i18n}/index.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/JsonSchemaForm.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/allOfSchema/AllOfSchema.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/allOfSchema/index.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/arrayTypeSchema/ArraySchema.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/arrayTypeSchema/arrayListSchema/ArrayListSchema.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/arrayTypeSchema/arrayListSchema/index.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.messages.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/index.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/index.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/upload-utils.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/useFormattedDefaultErrorMessages.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/arrayTypeSchema/index.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/basicTypeSchema/BasicTypeSchema.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/basicTypeSchema/index.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/controlFeedback/ControlFeedback.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/controlFeedback/ControlFeedback.messages.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/controlFeedback/index.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/genericSchema/GenericSchema.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/genericSchema/index.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/help/Help.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/help/Help.messages.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/help/index.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/index.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/objectSchema/ObjectSchema.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/objectSchema/index.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/oneOfSchema/OneOfSchema.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/oneOfSchema/index.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/oneOfSchema/utils/const-schema-utils.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/oneOfSchema/utils/index.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/oneOfSchema/utils/one-of-utils.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/persistAsyncSchema/PersistAsyncSchema.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/persistAsyncSchema/PersistAsyncSchema.messages.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/persistAsyncSchema/index.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/persistAsyncSchema/persistAsyncBasicSchema/index.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/persistAsyncSchema/persistAsyncBlobSchema/index.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/promotedOneOfSchema/PromotedOneOfSchema.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/promotedOneOfSchema/index.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/promotedOneOfSchema/promoted-one-of-utils.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/readOnlySchema/ReadOnlySchema.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/readOnlySchema/ReadOnlySchema.messages.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/readOnlySchema/index.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/schemaFormControl/SchemaFormControl.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/schemaFormControl/index.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/schemaFormControl/utils/currency-utils.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/schemaFormControl/utils/index.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/schemaFormControl/utils/mapping-utils.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/validationAsyncSchema/ValidationAsyncSchema.d.ts +0 -0
- /package/build/{types/jsonSchemaForm → jsonSchemaForm}/validationAsyncSchema/index.d.ts +0 -0
- /package/build/{types/layout → layout}/DynamicLayout.d.ts +0 -0
- /package/build/{types/layout → layout}/alert/DynamicAlert.d.ts +0 -0
- /package/build/{types/layout → layout}/box/DynamicBox.d.ts +0 -0
- /package/build/{types/layout → layout}/button/DynamicButton.d.ts +0 -0
- /package/build/{types/layout → layout}/columns/DynamicColumns.d.ts +0 -0
- /package/build/{types/layout → layout}/decision/DynamicDecision.d.ts +0 -0
- /package/build/{types/layout → layout}/divider/DynamicDivider.d.ts +0 -0
- /package/build/{types/layout → layout}/external/DynamicExternal.d.ts +0 -0
- /package/build/{types/layout → layout}/external/DynamicExternal.messages.d.ts +0 -0
- /package/build/{types/layout → layout}/form/DynamicForm.d.ts +0 -0
- /package/build/{types/layout → layout}/heading/DynamicHeading.d.ts +0 -0
- /package/build/{types/layout → layout}/icon/DynamicIcon.d.ts +0 -0
- /package/build/{types/layout → layout}/image/DynamicImage.d.ts +0 -0
- /package/build/{types/layout → layout}/index.d.ts +0 -0
- /package/build/{types/layout → layout}/info/DynamicInfo.d.ts +0 -0
- /package/build/{types/layout → layout}/list/DynamicList.d.ts +0 -0
- /package/build/{types/layout → layout}/loadingIndicator/DynamicLoadingIndicator.d.ts +0 -0
- /package/build/{types/layout → layout}/paragraph/DynamicParagraph.d.ts +0 -0
- /package/build/{types/layout → layout}/paragraph/DynamicParagraph.messages.d.ts +0 -0
- /package/build/{types/layout → layout}/paragraph/useSnackBarIfAvailable.d.ts +0 -0
- /package/build/{types/layout → layout}/review/DynamicReview.d.ts +0 -0
- /package/build/{types/layout → layout}/utils.d.ts +0 -0
- /package/build/{types/step → step}/cameraStep/CameraStep.d.ts +0 -0
- /package/build/{types/step → step}/cameraStep/cameraCapture/CameraCapture.d.ts +0 -0
- /package/build/{types/step → step}/cameraStep/cameraCapture/CameraCapture.messages.d.ts +0 -0
- /package/build/{types/step → step}/cameraStep/cameraCapture/components/index.d.ts +0 -0
- /package/build/{types/step → step}/cameraStep/cameraCapture/hooks/index.d.ts +0 -0
- /package/build/{types/step → step}/cameraStep/cameraCapture/index.d.ts +0 -0
- /package/build/{types/step → step}/cameraStep/cameraCapture/overlay/Overlay.d.ts +0 -0
- /package/build/{types/step → step}/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.d.ts +0 -0
- /package/build/{types/step → step}/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.messages.d.ts +0 -0
- /package/build/{types/step → step}/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.d.ts +0 -0
- /package/build/{types/step → step}/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.d.ts +0 -0
- /package/build/{types/step → step}/cameraStep/cameraCapture/screens/index.d.ts +0 -0
- /package/build/{types/step → step}/cameraStep/cameraCapture/tracking/index.d.ts +0 -0
- /package/build/{types/step → step}/cameraStep/cameraCapture/utils/index.d.ts +0 -0
- /package/build/{types/step → step}/cameraStep/index.d.ts +0 -0
- /package/build/{types/step → step}/externalConfirmationStep/ExternalConfirmationStep.d.ts +0 -0
- /package/build/{types/step → step}/externalConfirmationStep/ExternalConfirmationStep.messages.d.ts +0 -0
- /package/build/{types/step → step}/externalConfirmationStep/index.d.ts +0 -0
- /package/build/{types/step → step}/index.d.ts +0 -0
- /package/build/{types/step → step}/layoutStep/LayoutStep.d.ts +0 -0
- /package/build/{types/step → step}/layoutStep/index.d.ts +0 -0
- /package/build/{types/step → step}/layoutStep/utils/index.d.ts +0 -0
- /package/build/{types/step → step}/layoutStep/utils/inline-reference-utils.d.ts +0 -0
- /package/build/{types/step → step}/layoutStep/utils/layout-utils.d.ts +0 -0
- /package/build/types/{types/common → common}/FormControl.d.ts +0 -0
- /package/build/types/{types/specification → specification}/Action.d.ts +0 -0
- /package/build/types/{types/specification → specification}/FileUploadSchema.d.ts +0 -0
- /package/build/types/{types/specification → specification}/LayoutComponent.d.ts +0 -0
- /package/build/types/{types/specification → specification}/Model.d.ts +0 -0
- /package/build/types/{types/specification → specification}/PersistAsync.d.ts +0 -0
- /package/build/types/{types/specification → specification}/Polling.d.ts +0 -0
- /package/build/types/{types/specification → specification}/Promotion.d.ts +0 -0
- /package/build/types/{types/specification → specification}/Schema.d.ts +0 -0
- /package/build/types/{types/specification → specification}/Step.d.ts +0 -0
- /package/build/types/{types/specification → specification}/ValidationAsync.d.ts +0 -0
- /package/build/types/{types/specification → specification}/core.d.ts +0 -0
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
14
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
15
|
+
if (ar || !(i in from)) {
|
|
16
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
17
|
+
ar[i] = from[i];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
21
|
+
};
|
|
22
|
+
exports.__esModule = true;
|
|
23
|
+
exports.convertStepActionToDynamicAction = exports.convertStepToLayout = void 0;
|
|
24
|
+
function convertStepToLayout(step, _a) {
|
|
25
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.displayStepTitle, displayStepTitle = _c === void 0 ? true : _c;
|
|
26
|
+
if (!step || !step.type) {
|
|
27
|
+
throw new Error('Missing step type');
|
|
28
|
+
}
|
|
29
|
+
// This condition is meant as a temporary hack until mobile platforms will be refactored to fully support the layout property
|
|
30
|
+
if (step.layout) {
|
|
31
|
+
return addMissingTitleAndDescriptionToStep(step, displayStepTitle);
|
|
32
|
+
}
|
|
33
|
+
switch (step.type) {
|
|
34
|
+
case 'final':
|
|
35
|
+
return convertFinalStepToDynamicLayout(step);
|
|
36
|
+
case 'decision':
|
|
37
|
+
return convertDecisionStepToDynamicLayout(step);
|
|
38
|
+
case 'form':
|
|
39
|
+
return convertFormStepToDynamicLayout(step);
|
|
40
|
+
case 'external':
|
|
41
|
+
return convertExternalStepToDynamicLayout(step);
|
|
42
|
+
default:
|
|
43
|
+
throw new Error('invalid step type');
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.convertStepToLayout = convertStepToLayout;
|
|
47
|
+
function convertCommonComponents(step) {
|
|
48
|
+
var layout = [];
|
|
49
|
+
if (step.title) {
|
|
50
|
+
layout.push(convertStepTitleToDynamicHeading(step.title));
|
|
51
|
+
}
|
|
52
|
+
if (step.image) {
|
|
53
|
+
var image = convertStepImageToDynamicImage(step.image);
|
|
54
|
+
layout.push(image);
|
|
55
|
+
}
|
|
56
|
+
if (step.description) {
|
|
57
|
+
layout.push(convertStepDescriptionToDynamicParagraph(step.description));
|
|
58
|
+
}
|
|
59
|
+
return layout;
|
|
60
|
+
}
|
|
61
|
+
function convertExternalStepToDynamicLayout(step) {
|
|
62
|
+
return __spreadArray(__spreadArray([], convertCommonComponents(step), true), [convertStepToExternalComponent(step)], false);
|
|
63
|
+
}
|
|
64
|
+
function convertStepToExternalComponent(step) {
|
|
65
|
+
return {
|
|
66
|
+
type: 'external',
|
|
67
|
+
requestUrl: step.requestUrl,
|
|
68
|
+
polling: step.polling,
|
|
69
|
+
responseHandlers: step.responseHandlers,
|
|
70
|
+
retryTitle: step.retryTitle
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function convertFormStepToDynamicLayout(step) {
|
|
74
|
+
var layout = convertCommonComponents(step);
|
|
75
|
+
if (step.reviewFields) {
|
|
76
|
+
layout.push(convertStepReviewToDynamicReview(step.reviewFields));
|
|
77
|
+
}
|
|
78
|
+
if (step.schemas) {
|
|
79
|
+
layout.push.apply(layout, getSchemaLayout(step));
|
|
80
|
+
}
|
|
81
|
+
if (step.actions) {
|
|
82
|
+
var actions = step.actions.map(convertStepActionToDynamicAction);
|
|
83
|
+
layout.push(dynamicBox(actions, 'md'));
|
|
84
|
+
}
|
|
85
|
+
return layout;
|
|
86
|
+
}
|
|
87
|
+
function convertFinalStepToDynamicLayout(step) {
|
|
88
|
+
var layout = [];
|
|
89
|
+
if (step.details) {
|
|
90
|
+
if (step.details.image) {
|
|
91
|
+
var image = convertFinalStepImageToDynamicImage(step.details.image);
|
|
92
|
+
layout.push(image);
|
|
93
|
+
}
|
|
94
|
+
if (step.details.title) {
|
|
95
|
+
layout.push(convertStepTitleToDynamicHeading(step.details.title));
|
|
96
|
+
}
|
|
97
|
+
if (step.details.description) {
|
|
98
|
+
layout.push(convertStepDescriptionToDynamicParagraph(step.details.description));
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
if (step.actions) {
|
|
102
|
+
var actions = step.actions.map(function (action) {
|
|
103
|
+
return convertStepActionToDynamicAction(__assign(__assign({}, action), { type: action.type || 'primary' }));
|
|
104
|
+
});
|
|
105
|
+
layout.push(dynamicBox(actions, 'md'));
|
|
106
|
+
}
|
|
107
|
+
return layout;
|
|
108
|
+
}
|
|
109
|
+
function convertDecisionStepToDynamicLayout(step) {
|
|
110
|
+
var layout = convertCommonComponents(step);
|
|
111
|
+
if (step.options) {
|
|
112
|
+
layout.push(convertStepDecisionToDynamicDecision(step.options));
|
|
113
|
+
}
|
|
114
|
+
return layout;
|
|
115
|
+
}
|
|
116
|
+
function dynamicBox(components, size) {
|
|
117
|
+
return {
|
|
118
|
+
type: 'box',
|
|
119
|
+
width: size || 'md',
|
|
120
|
+
components: components
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
function convertStepTitleToDynamicHeading(title) {
|
|
124
|
+
return {
|
|
125
|
+
type: 'heading',
|
|
126
|
+
text: title,
|
|
127
|
+
size: 'lg',
|
|
128
|
+
margin: 'lg',
|
|
129
|
+
align: 'center'
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
function convertStepDescriptionToDynamicParagraph(description) {
|
|
133
|
+
return {
|
|
134
|
+
type: 'paragraph',
|
|
135
|
+
text: description,
|
|
136
|
+
align: 'center'
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
function convertStepSchemaToDynamicForm(schema) {
|
|
140
|
+
return { type: 'form', schema: schema };
|
|
141
|
+
}
|
|
142
|
+
function convertStepDecisionToDynamicDecision(options) {
|
|
143
|
+
return {
|
|
144
|
+
type: 'decision',
|
|
145
|
+
options: options.map(convertStepDecisionOption)
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
function convertStepDecisionOption(option) {
|
|
149
|
+
return {
|
|
150
|
+
title: option.title,
|
|
151
|
+
description: option.description,
|
|
152
|
+
action: {
|
|
153
|
+
title: option.title,
|
|
154
|
+
method: 'GET',
|
|
155
|
+
url: option.url,
|
|
156
|
+
disabled: option.disabled
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
function convertStepImageToDynamicImage(image) {
|
|
161
|
+
return {
|
|
162
|
+
type: 'image',
|
|
163
|
+
url: image.url,
|
|
164
|
+
text: image.text,
|
|
165
|
+
margin: image.margin || 'lg',
|
|
166
|
+
size: image.size || 'md'
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
function convertFinalStepImageToDynamicImage(image) {
|
|
170
|
+
return typeof image === 'string'
|
|
171
|
+
? {
|
|
172
|
+
type: 'image',
|
|
173
|
+
url: image,
|
|
174
|
+
text: undefined,
|
|
175
|
+
margin: 'lg',
|
|
176
|
+
size: 'md'
|
|
177
|
+
}
|
|
178
|
+
: convertStepImageToDynamicImage(image);
|
|
179
|
+
}
|
|
180
|
+
function convertStepActionToDynamicAction(action) {
|
|
181
|
+
var newAction = __assign(__assign({}, action), { title: action.title });
|
|
182
|
+
return {
|
|
183
|
+
type: 'button',
|
|
184
|
+
action: newAction
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
exports.convertStepActionToDynamicAction = convertStepActionToDynamicAction;
|
|
188
|
+
function convertStepReviewToDynamicReview(reviewFields) {
|
|
189
|
+
return {
|
|
190
|
+
type: 'review',
|
|
191
|
+
title: reviewFields.title,
|
|
192
|
+
fields: reviewFields.fields.map(convertReviewFieldToDefinition)
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
function convertReviewFieldToDefinition(reviewField) {
|
|
196
|
+
return {
|
|
197
|
+
label: reviewField.title,
|
|
198
|
+
value: reviewField.value
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
function getSchemaLayout(step) {
|
|
202
|
+
var layout = [];
|
|
203
|
+
if (step.schemas && step.schemas[0]) {
|
|
204
|
+
var schema = step.schemas[0];
|
|
205
|
+
var dynamicForm = convertStepSchemaToDynamicForm(schema);
|
|
206
|
+
if (isWideForm()) {
|
|
207
|
+
layout.push(dynamicForm);
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
layout.push(dynamicBox([dynamicForm], 'md'));
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
return layout;
|
|
214
|
+
}
|
|
215
|
+
function isWideForm() {
|
|
216
|
+
// For the time being we won't support automatically widening forms
|
|
217
|
+
// Unlike it V2, there is no way to easily iterate and identify narrow fields
|
|
218
|
+
return false;
|
|
219
|
+
}
|
|
220
|
+
function addMissingTitleAndDescriptionToStep(step, displayStepTitle) {
|
|
221
|
+
return __spreadArray(__spreadArray(__spreadArray([], (displayStepTitle && step.title ? [convertStepTitleToDynamicHeading(step.title)] : []), true), (step.description ? [convertStepDescriptionToDynamicParagraph(step.description)] : []), true), (step.layout || []), true);
|
|
222
|
+
}
|
package/build/types/index.d.ts
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export * from './
|
|
9
|
-
export
|
|
10
|
-
export type {
|
|
1
|
+
export * from './specification/core';
|
|
2
|
+
export * from './specification/Action';
|
|
3
|
+
export * from './specification/LayoutComponent';
|
|
4
|
+
export * from './specification/Model';
|
|
5
|
+
export * from './specification/Polling';
|
|
6
|
+
export * from './specification/Step';
|
|
7
|
+
export * from './specification/PersistAsync';
|
|
8
|
+
export * from './specification/ValidationAsync';
|
|
9
|
+
export * from './specification/Promotion';
|
|
10
|
+
export type { Schema, AllOfSchema, ArraySchema, BasicSchema, BlobSchema, BooleanSchema, ConstSchema, IntegerSchema, MultipleFileUploadSchema, NumberSchema, ObjectSchema, OneOfObjectSchema, OneOfSchema, PersistAsyncSchema, StringSchema, ListArraySchema, TupleArraySchema, ValidationAsyncSchema, } from './specification/Schema';
|
|
11
|
+
export { isObjectSchema, isOneOfSchema, isAllOfSchema, isBlobSchema, isArraySchema, isTupleArraySchema, isListArraySchema, isValidationAsyncSchema, isPersistAsyncSchema, isBasicSchema, } from './specification/Schema';
|
|
12
|
+
export type { FileUploadSchema, CameraDirection } from './specification/FileUploadSchema';
|
|
13
|
+
export { isFileUploadSchema } from './specification/FileUploadSchema';
|
|
14
|
+
export { isBasicError } from './specification/Step';
|
|
15
|
+
export * from './common/FormControl';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
exports.__esModule = true;
|
|
17
|
+
exports.isBasicError = exports.isFileUploadSchema = exports.isBasicSchema = exports.isPersistAsyncSchema = exports.isValidationAsyncSchema = exports.isListArraySchema = exports.isTupleArraySchema = exports.isArraySchema = exports.isBlobSchema = exports.isAllOfSchema = exports.isOneOfSchema = exports.isObjectSchema = void 0;
|
|
18
|
+
__exportStar(require("./specification/core"), exports);
|
|
19
|
+
__exportStar(require("./specification/Action"), exports);
|
|
20
|
+
__exportStar(require("./specification/LayoutComponent"), exports);
|
|
21
|
+
__exportStar(require("./specification/Model"), exports);
|
|
22
|
+
__exportStar(require("./specification/Polling"), exports);
|
|
23
|
+
__exportStar(require("./specification/Step"), exports);
|
|
24
|
+
__exportStar(require("./specification/PersistAsync"), exports);
|
|
25
|
+
__exportStar(require("./specification/ValidationAsync"), exports);
|
|
26
|
+
__exportStar(require("./specification/Promotion"), exports);
|
|
27
|
+
var Schema_1 = require("./specification/Schema");
|
|
28
|
+
__createBinding(exports, Schema_1, "isObjectSchema");
|
|
29
|
+
__createBinding(exports, Schema_1, "isOneOfSchema");
|
|
30
|
+
__createBinding(exports, Schema_1, "isAllOfSchema");
|
|
31
|
+
__createBinding(exports, Schema_1, "isBlobSchema");
|
|
32
|
+
__createBinding(exports, Schema_1, "isArraySchema");
|
|
33
|
+
__createBinding(exports, Schema_1, "isTupleArraySchema");
|
|
34
|
+
__createBinding(exports, Schema_1, "isListArraySchema");
|
|
35
|
+
__createBinding(exports, Schema_1, "isValidationAsyncSchema");
|
|
36
|
+
__createBinding(exports, Schema_1, "isPersistAsyncSchema");
|
|
37
|
+
__createBinding(exports, Schema_1, "isBasicSchema");
|
|
38
|
+
var FileUploadSchema_1 = require("./specification/FileUploadSchema");
|
|
39
|
+
__createBinding(exports, FileUploadSchema_1, "isFileUploadSchema");
|
|
40
|
+
var Step_1 = require("./specification/Step");
|
|
41
|
+
__createBinding(exports, Step_1, "isBasicError");
|
|
42
|
+
__exportStar(require("./common/FormControl"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.isFileUploadSchema = void 0;
|
|
4
|
+
// TODO HD Move this out of types
|
|
5
|
+
function isFileUploadSchema(schema) {
|
|
6
|
+
return schema.type === 'string' && schema.format === 'base64url';
|
|
7
|
+
}
|
|
8
|
+
exports.isFileUploadSchema = isFileUploadSchema;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.isNullableArrayModel = exports.isArrayModel = exports.isNullableStringModel = exports.isNullableBasicModel = exports.isNullableObjectModel = exports.isObjectModel = void 0;
|
|
4
|
+
var validators_1 = require("../../common/validators");
|
|
5
|
+
// TODO HD Move these functions out of types
|
|
6
|
+
var isObjectModel = function (model) {
|
|
7
|
+
return typeof model === 'object' && model !== null && model.constructor === Object;
|
|
8
|
+
};
|
|
9
|
+
exports.isObjectModel = isObjectModel;
|
|
10
|
+
var isNullableObjectModel = function (model) {
|
|
11
|
+
return (0, validators_1.isNull)(model) || (0, exports.isObjectModel)(model);
|
|
12
|
+
};
|
|
13
|
+
exports.isNullableObjectModel = isNullableObjectModel;
|
|
14
|
+
var isNullableBasicModel = function (model) {
|
|
15
|
+
return (0, validators_1.isBoolean)(model) || (0, validators_1.isNumber)(model) || (0, validators_1.isString)(model) || (0, validators_1.isNull)(model);
|
|
16
|
+
};
|
|
17
|
+
exports.isNullableBasicModel = isNullableBasicModel;
|
|
18
|
+
var isNullableStringModel = function (model) {
|
|
19
|
+
return (0, validators_1.isString)(model) || (0, validators_1.isNull)(model);
|
|
20
|
+
};
|
|
21
|
+
exports.isNullableStringModel = isNullableStringModel;
|
|
22
|
+
var isArrayModel = function (model) {
|
|
23
|
+
if ((0, validators_1.isArray)(model)) {
|
|
24
|
+
if (model.length === 0) {
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
return model.every(function (item) { return typeof item === 'string' || typeof item === 'number' || typeof item === 'boolean'; });
|
|
28
|
+
}
|
|
29
|
+
return false;
|
|
30
|
+
};
|
|
31
|
+
exports.isArrayModel = isArrayModel;
|
|
32
|
+
var isNullableArrayModel = function (model) {
|
|
33
|
+
if ((0, validators_1.isNull)(model)) {
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
return (0, exports.isArrayModel)(model);
|
|
37
|
+
};
|
|
38
|
+
exports.isNullableArrayModel = isNullableArrayModel;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.isMultipleFileUploadSchema = exports.isValidationAsyncSchema = exports.isPersistAsyncFileSchema = exports.isPersistAsyncSchema = exports.isStringSchema = exports.isListArraySchema = exports.isTupleArraySchema = exports.isArraySchema = exports.isBlobSchema = exports.isAllOfSchema = exports.isOneOfSchema = exports.isOneOfObjectSchema = exports.isObjectSchema = exports.isBasicSchema = void 0;
|
|
4
|
+
var basicTypes = new Set(['string', 'number', 'integer', 'boolean']);
|
|
5
|
+
// TODO HD Move these out of types
|
|
6
|
+
function isBasicSchema(schema) {
|
|
7
|
+
return basicTypes.has(schema.type || '') || ('const' in schema && schema["const"] !== undefined);
|
|
8
|
+
}
|
|
9
|
+
exports.isBasicSchema = isBasicSchema;
|
|
10
|
+
function isObjectSchema(schema) {
|
|
11
|
+
return schema.type === 'object';
|
|
12
|
+
}
|
|
13
|
+
exports.isObjectSchema = isObjectSchema;
|
|
14
|
+
function isOneOfObjectSchema(schema) {
|
|
15
|
+
return isOneOfSchema(schema) && schema.oneOf.every(function (subSchema) { return subSchema.type === 'object'; });
|
|
16
|
+
}
|
|
17
|
+
exports.isOneOfObjectSchema = isOneOfObjectSchema;
|
|
18
|
+
function isOneOfSchema(schema) {
|
|
19
|
+
return !!schema.oneOf;
|
|
20
|
+
}
|
|
21
|
+
exports.isOneOfSchema = isOneOfSchema;
|
|
22
|
+
function isAllOfSchema(schema) {
|
|
23
|
+
return !!schema.allOf;
|
|
24
|
+
}
|
|
25
|
+
exports.isAllOfSchema = isAllOfSchema;
|
|
26
|
+
function isBlobSchema(schema) {
|
|
27
|
+
return schema.type === 'blob';
|
|
28
|
+
}
|
|
29
|
+
exports.isBlobSchema = isBlobSchema;
|
|
30
|
+
function isArraySchema(schema) {
|
|
31
|
+
return schema.type === 'array';
|
|
32
|
+
}
|
|
33
|
+
exports.isArraySchema = isArraySchema;
|
|
34
|
+
function isTupleArraySchema(schema) {
|
|
35
|
+
var schemaItems = schema.items;
|
|
36
|
+
return Array.isArray(schemaItems);
|
|
37
|
+
}
|
|
38
|
+
exports.isTupleArraySchema = isTupleArraySchema;
|
|
39
|
+
function isListArraySchema(schema) {
|
|
40
|
+
var schemaItems = schema.items;
|
|
41
|
+
return !Array.isArray(schemaItems);
|
|
42
|
+
}
|
|
43
|
+
exports.isListArraySchema = isListArraySchema;
|
|
44
|
+
function isStringSchema(schema) {
|
|
45
|
+
return schema.type === 'string';
|
|
46
|
+
}
|
|
47
|
+
exports.isStringSchema = isStringSchema;
|
|
48
|
+
function isPersistAsyncSchema(schema) {
|
|
49
|
+
return !!schema.persistAsync;
|
|
50
|
+
}
|
|
51
|
+
exports.isPersistAsyncSchema = isPersistAsyncSchema;
|
|
52
|
+
function isPersistAsyncFileSchema(schema) {
|
|
53
|
+
return (isPersistAsyncSchema(schema) &&
|
|
54
|
+
(isBlobSchema(schema.persistAsync.schema) || isBase64FileSchema(schema.persistAsync.schema)));
|
|
55
|
+
}
|
|
56
|
+
exports.isPersistAsyncFileSchema = isPersistAsyncFileSchema;
|
|
57
|
+
var isValidationAsyncSchema = function (schema) {
|
|
58
|
+
return isBasicSchema(schema) && !!schema.validationAsync;
|
|
59
|
+
};
|
|
60
|
+
exports.isValidationAsyncSchema = isValidationAsyncSchema;
|
|
61
|
+
function isBase64FileSchema(schema) {
|
|
62
|
+
return schema.type === 'string' && schema.format === 'base64url';
|
|
63
|
+
}
|
|
64
|
+
var isMultipleFileUploadSchema = function (schema) {
|
|
65
|
+
return (isArraySchema(schema) && isListArraySchema(schema) && isPersistAsyncFileSchema(schema.items));
|
|
66
|
+
};
|
|
67
|
+
exports.isMultipleFileUploadSchema = isMultipleFileUploadSchema;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.isBasicError = void 0;
|
|
4
|
+
var validators_1 = require("../../common/validators");
|
|
5
|
+
var isBasicError = function (error) {
|
|
6
|
+
return (0, validators_1.isString)(error) || (0, validators_1.isNull)(error);
|
|
7
|
+
};
|
|
8
|
+
exports.isBasicError = isBasicError;
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wise/dynamic-flow-client",
|
|
3
|
-
"version": "0.4.0
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Dynamic Flow web client",
|
|
5
|
-
"main": "./build/
|
|
5
|
+
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
7
7
|
"style": "./build/main.css",
|
|
8
|
+
"type": "commonjs",
|
|
8
9
|
"sideEffects": [
|
|
9
10
|
"*.css"
|
|
10
11
|
],
|
|
@@ -16,24 +17,6 @@
|
|
|
16
17
|
"fullname": "transferwise/dynamic-flow",
|
|
17
18
|
"url": "git+https://github.com/transferwise/dynamic-flow.git"
|
|
18
19
|
},
|
|
19
|
-
"scripts": {
|
|
20
|
-
"dev": "storybook dev -p 3003",
|
|
21
|
-
"build": "npm-run-all build:*",
|
|
22
|
-
"build:types": "tsc --build ./tsconfig.build.json",
|
|
23
|
-
"build:js": "node ./scripts/build-min.mjs",
|
|
24
|
-
"build:css": "postcss src/main.css -o build/main.css",
|
|
25
|
-
"build:messages-source": "formatjs extract 'src/**/*.messages.{js,ts}' --out-file src/i18n/en.json --format simple && prettier --find-config-path --write src/i18n/*.json",
|
|
26
|
-
"build:compiled-messages": "mkdir -p build/i18n && cp src/i18n/*.json build/i18n",
|
|
27
|
-
"test": "npm-run-all test:once test:tz",
|
|
28
|
-
"test:once": "jest --config jest.config.js --env=jsdom",
|
|
29
|
-
"test:coverage": "jest --config jest.config.js --env=jsdom --coverage",
|
|
30
|
-
"test:tz": "TZ=US/Pacific jest ./src/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.errors.spec.js ./src/formControl/FormControl.spec.js",
|
|
31
|
-
"test:watch": "pnpm test:once --watch",
|
|
32
|
-
"lint": "npm-run-all lint:*",
|
|
33
|
-
"lint:ts": "eslint 'src/**/*.{js,jsx,ts,tsx}' --quiet",
|
|
34
|
-
"lint:css": "stylelint './src/**/*.css'",
|
|
35
|
-
"build-storybook": "storybook build -c .storybook"
|
|
36
|
-
},
|
|
37
20
|
"devDependencies": {
|
|
38
21
|
"@babel/core": "7.20.12",
|
|
39
22
|
"@babel/plugin-syntax-flow": "7.18.6",
|
|
@@ -56,7 +39,7 @@
|
|
|
56
39
|
"@testing-library/react": "14.0.0",
|
|
57
40
|
"@testing-library/react-hooks": "8.0.1",
|
|
58
41
|
"@testing-library/user-event": "13.2.1",
|
|
59
|
-
"@transferwise/components": "45.
|
|
42
|
+
"@transferwise/components": "45.4.0",
|
|
60
43
|
"@transferwise/eslint-config": "8.0.1",
|
|
61
44
|
"@transferwise/formatting": "^2.10.0",
|
|
62
45
|
"@transferwise/icons": "3.6.0",
|
|
@@ -72,7 +55,6 @@
|
|
|
72
55
|
"babel-jest": "29.5.0",
|
|
73
56
|
"currency-flags": "4.0.7",
|
|
74
57
|
"enzyme": "^3.11.0",
|
|
75
|
-
"esbuild": "0.17.19",
|
|
76
58
|
"eslint": "8.36.0",
|
|
77
59
|
"eslint-plugin-storybook": "0.6.12",
|
|
78
60
|
"jest": "29.5.0",
|
|
@@ -110,5 +92,22 @@
|
|
|
110
92
|
"react-webcam": "^7.0.1",
|
|
111
93
|
"screenfull": "^5.0.2"
|
|
112
94
|
},
|
|
113
|
-
"prettier": "@transferwise/eslint-config/.prettierrc.js"
|
|
114
|
-
|
|
95
|
+
"prettier": "@transferwise/eslint-config/.prettierrc.js",
|
|
96
|
+
"scripts": {
|
|
97
|
+
"dev": "storybook dev -p 3003",
|
|
98
|
+
"build": "rm -rf build && npm-run-all build:*",
|
|
99
|
+
"build:ts": "tsc --build ./tsconfig.build.json",
|
|
100
|
+
"build:css": "postcss src/main.css -o build/main.css",
|
|
101
|
+
"build:messages-source": "formatjs extract 'src/**/*.messages.{js,ts}' --out-file src/i18n/en.json --format simple && prettier --find-config-path --write src/i18n/*.json",
|
|
102
|
+
"build:compiled-messages": "mkdir -p build/i18n && cp src/i18n/*.json build/i18n",
|
|
103
|
+
"test": "npm-run-all test:once test:tz",
|
|
104
|
+
"test:once": "jest --config jest.config.js --env=jsdom",
|
|
105
|
+
"test:coverage": "jest --config jest.config.js --env=jsdom --coverage",
|
|
106
|
+
"test:tz": "TZ=US/Pacific jest ./src/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.errors.spec.js ./src/formControl/FormControl.spec.js",
|
|
107
|
+
"test:watch": "pnpm test:once --watch",
|
|
108
|
+
"lint": "npm-run-all lint:ts lint:css",
|
|
109
|
+
"lint:ts": "eslint 'src/**/*.{js,jsx,ts,tsx}' --quiet",
|
|
110
|
+
"lint:css": "stylelint './src/**/*.css'",
|
|
111
|
+
"build-storybook": "storybook build -c .storybook"
|
|
112
|
+
}
|
|
113
|
+
}
|